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AM,MADK;AAEX,uBAAO,KAAK;AAFD,aAAD,CAFO;AAMnB,gBAAI,KAAK;AANU,SAAT,EAOT,KAAK,eAAL,CAAqB,KAAK,cAAL,EAArB,CAPS,CAAZ;AASA,eAAO,EAAE,YAAF,EAAgB;AACrB,mBAAO;AACL,sBAAM,KAAK;AADN,aADc;AAIrB,gBAAI;AACF,4BAAY,KAAK,YADf;AAEF,6BAAa,KAAK,aAFhB;AAGF,uBAAO,KAAK,OAHV;AAIF,uBAAO,KAAK,OAJV;AAKF,gCAAgB,KAAK;AALnB;AAJiB,SAAhB,EAWJ,CAAC,GAAD,CAXI,CAAP;AAYD;AAhIM,CAJM,C;AAlBf","sourcesContent":["// Components\nimport VWindow from './VWindow'\n\n// Mixins\nimport Bootable from '../../mixins/bootable'\nimport { factory as GroupableFactory } from '../../mixins/groupable'\n\n// Directives\nimport Touch from '../../directives/touch'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\nimport { ExtractVue } from './../../util/mixins'\nimport mixins from '../../util/mixins'\n\n// Types\nimport Vue, { VNode } from 'vue'\n\ntype VBaseWindow = InstanceType<typeof VWindow>\n\ninterface options extends Vue {\n $el: HTMLElement\n windowGroup: VBaseWindow\n}\n\nexport default mixins<options & ExtractVue<[typeof Bootable]>>(\n Bootable,\n GroupableFactory('windowGroup', 'v-window-item', 'v-window')\n /* @vue/component */\n).extend({\n name: 'v-window-item',\n\n directives: {\n Touch\n },\n\n props: {\n reverseTransition: {\n type: [Boolean, String],\n default: undefined\n },\n transition: {\n type: [Boolean, String],\n default: undefined\n },\n value: {\n required: false\n }\n },\n\n data () {\n return {\n done: null as null | (() => void),\n isActive: false,\n wasCancelled: false\n }\n },\n\n computed: {\n computedTransition (): string | boolean {\n if (!this.windowGroup.internalReverse) {\n return typeof this.transition !== 'undefined'\n ? this.transition || ''\n : this.windowGroup.computedTransition\n }\n\n return typeof this.reverseTransition !== 'undefined'\n ? this.reverseTransition || ''\n : this.windowGroup.computedTransition\n }\n },\n\n mounted () {\n this.$el.addEventListener('transitionend', this.onTransitionEnd, false)\n },\n\n beforeDestroy () {\n this.$el.removeEventListener('transitionend', this.onTransitionEnd, false)\n },\n\n methods: {\n genDefaultSlot () {\n return this.$slots.default\n },\n onAfterEnter () {\n if (this.wasCancelled) {\n this.wasCancelled = false\n return\n }\n\n requestAnimationFrame(() => {\n this.windowGroup.internalHeight = undefined\n this.windowGroup.isActive = false\n })\n },\n onBeforeEnter () {\n this.windowGroup.isActive = true\n },\n onLeave (el: HTMLElement) {\n this.windowGroup.internalHeight = convertToUnit(el.clientHeight)\n },\n onEnterCancelled () {\n this.wasCancelled = true\n },\n onEnter (el: HTMLElement, done: () => void) {\n const isBooted = this.windowGroup.isBooted\n\n if (isBooted) this.done = done\n\n requestAnimationFrame(() => {\n if (!this.computedTransition) return done()\n\n this.windowGroup.internalHeight = convertToUnit(el.clientHeight)\n\n // On initial render, there is no transition\n // Vue leaves a `enter` transition class\n // if done is called too fast\n !isBooted && setTimeout(done, 100)\n })\n },\n onTransitionEnd (e: TransitionEvent) {\n // This ensures we only call done\n // when the element transform\n // completes\n if (\n e.propertyName !== 'transform' ||\n e.target !== this.$el ||\n !this.done\n ) return\n\n this.done()\n this.done = null\n }\n },\n\n render (h): VNode {\n const div = h('div', {\n staticClass: 'v-window-item',\n directives: [{\n name: 'show',\n value: this.isActive\n }],\n on: this.$listeners\n }, this.showLazyContent(this.genDefaultSlot()))\n\n return h('transition', {\n props: {\n name: this.computedTransition\n },\n on: {\n afterEnter: this.onAfterEnter,\n beforeEnter: this.onBeforeEnter,\n leave: this.onLeave,\n enter: this.onEnter,\n enterCancelled: this.onEnterCancelled\n }\n }, [div])\n }\n})\n"],"sourceRoot":""}
|