{"version":3,"file":"VWindow-CjZ_2cCg.js","sources":["../../../node_modules/.pnpm/vuetify@2.7.2_vue@2.7.16/node_modules/vuetify/lib/components/VWindow/VWindow.js"],"sourcesContent":["// Styles\nimport \"../../../src/components/VWindow/VWindow.sass\"; // Directives\n\nimport Touch from '../../directives/touch'; // Components\n\nimport VBtn from '../VBtn';\nimport VIcon from '../VIcon';\nimport { BaseItemGroup } from '../VItemGroup/VItemGroup';\nimport { getSlot } from '../../util/helpers';\n/* @vue/component */\n\nexport default BaseItemGroup.extend({\n name: 'v-window',\n directives: {\n Touch\n },\n\n provide() {\n return {\n windowGroup: this\n };\n },\n\n props: {\n activeClass: {\n type: String,\n default: 'v-window-item--active'\n },\n continuous: Boolean,\n mandatory: {\n type: Boolean,\n default: true\n },\n nextIcon: {\n type: [Boolean, String],\n default: '$next'\n },\n prevIcon: {\n type: [Boolean, String],\n default: '$prev'\n },\n reverse: Boolean,\n showArrows: Boolean,\n showArrowsOnHover: Boolean,\n touch: Object,\n touchless: Boolean,\n value: {\n required: false\n },\n vertical: Boolean\n },\n\n data() {\n return {\n changedByDelimiters: false,\n internalHeight: undefined,\n transitionHeight: undefined,\n transitionCount: 0,\n isBooted: false,\n isReverse: false\n };\n },\n\n computed: {\n isActive() {\n return this.transitionCount > 0;\n },\n\n classes() {\n return { ...BaseItemGroup.options.computed.classes.call(this),\n 'v-window--show-arrows-on-hover': this.showArrowsOnHover\n };\n },\n\n computedTransition() {\n if (!this.isBooted) return '';\n const axis = this.vertical ? 'y' : 'x';\n const reverse = this.internalReverse ? !this.isReverse : this.isReverse;\n const direction = reverse ? '-reverse' : '';\n return `v-window-${axis}${direction}-transition`;\n },\n\n hasActiveItems() {\n return Boolean(this.items.find(item => !item.disabled));\n },\n\n hasNext() {\n return this.continuous || this.internalIndex < this.items.length - 1;\n },\n\n hasPrev() {\n return this.continuous || this.internalIndex > 0;\n },\n\n internalIndex() {\n return this.items.findIndex((item, i) => {\n return this.internalValue === this.getValue(item, i);\n });\n },\n\n internalReverse() {\n return this.$vuetify.rtl ? !this.reverse : this.reverse;\n }\n\n },\n watch: {\n internalIndex(val, oldVal) {\n this.isReverse = this.updateReverse(val, oldVal);\n }\n\n },\n\n mounted() {\n window.requestAnimationFrame(() => this.isBooted = true);\n },\n\n methods: {\n genDefaultSlot() {\n return getSlot(this);\n },\n\n genContainer() {\n const children = [this.genDefaultSlot()];\n\n if (this.showArrows) {\n children.push(this.genControlIcons());\n }\n\n return this.$createElement('div', {\n staticClass: 'v-window__container',\n class: {\n 'v-window__container--is-active': this.isActive\n },\n style: {\n height: this.internalHeight || this.transitionHeight\n }\n }, children);\n },\n\n genIcon(direction, icon, click) {\n var _a, _b, _c;\n\n const on = {\n click: e => {\n e.stopPropagation();\n this.changedByDelimiters = true;\n click();\n }\n };\n const attrs = {\n 'aria-label': this.$vuetify.lang.t(`$vuetify.carousel.${direction}`)\n };\n const children = (_c = (_b = (_a = this.$scopedSlots)[direction]) === null || _b === void 0 ? void 0 : _b.call(_a, {\n on,\n attrs\n })) !== null && _c !== void 0 ? _c : [this.$createElement(VBtn, {\n props: {\n icon: true\n },\n attrs,\n on\n }, [this.$createElement(VIcon, {\n props: {\n large: true\n }\n }, icon)])];\n return this.$createElement('div', {\n staticClass: `v-window__${direction}`\n }, children);\n },\n\n genControlIcons() {\n const icons = [];\n const prevIcon = this.$vuetify.rtl ? this.nextIcon : this.prevIcon;\n /* istanbul ignore else */\n\n if (this.hasPrev && prevIcon && typeof prevIcon === 'string') {\n const icon = this.genIcon('prev', prevIcon, this.prev);\n icon && icons.push(icon);\n }\n\n const nextIcon = this.$vuetify.rtl ? this.prevIcon : this.nextIcon;\n /* istanbul ignore else */\n\n if (this.hasNext && nextIcon && typeof nextIcon === 'string') {\n const icon = this.genIcon('next', nextIcon, this.next);\n icon && icons.push(icon);\n }\n\n return icons;\n },\n\n getNextIndex(index) {\n const nextIndex = (index + 1) % this.items.length;\n const item = this.items[nextIndex];\n if (item.disabled) return this.getNextIndex(nextIndex);\n return nextIndex;\n },\n\n getPrevIndex(index) {\n const prevIndex = (index + this.items.length - 1) % this.items.length;\n const item = this.items[prevIndex];\n if (item.disabled) return this.getPrevIndex(prevIndex);\n return prevIndex;\n },\n\n next() {\n /* istanbul ignore if */\n if (!this.hasActiveItems || !this.hasNext) return;\n const nextIndex = this.getNextIndex(this.internalIndex);\n const item = this.items[nextIndex];\n this.internalValue = this.getValue(item, nextIndex);\n },\n\n prev() {\n /* istanbul ignore if */\n if (!this.hasActiveItems || !this.hasPrev) return;\n const lastIndex = this.getPrevIndex(this.internalIndex);\n const item = this.items[lastIndex];\n this.internalValue = this.getValue(item, lastIndex);\n },\n\n updateReverse(val, oldVal) {\n const itemsLength = this.items.length;\n const lastIndex = itemsLength - 1;\n if (itemsLength <= 2) return val < oldVal;\n\n if (val === lastIndex && oldVal === 0) {\n return true;\n } else if (val === 0 && oldVal === lastIndex) {\n return false;\n } else {\n return val < oldVal;\n }\n }\n\n },\n\n render(h) {\n const data = {\n staticClass: 'v-window',\n class: this.classes,\n directives: []\n };\n\n if (!this.touchless) {\n const value = this.touch || {\n left: () => {\n this.$vuetify.rtl ? this.prev() : this.next();\n },\n right: () => {\n this.$vuetify.rtl ? this.next() : this.prev();\n },\n end: e => {\n e.stopPropagation();\n },\n start: e => {\n e.stopPropagation();\n }\n };\n data.directives.push({\n name: 'touch',\n value\n });\n }\n\n return h('div', data, [this.genContainer()]);\n }\n\n});\n//# sourceMappingURL=VWindow.js.map"],"names":["__unplugin_components_1","BaseItemGroup","Touch","__spreadProps","__spreadValues","axis","direction","item","i","val","oldVal","getSlot","children","icon","click","_a","_b","_c","on","e","attrs","VBtn","VIcon","icons","prevIcon","nextIcon","index","nextIndex","prevIndex","lastIndex","itemsLength","h","data","value"],"mappings":"s8BAWA,MAAeA,EAAAC,EAAc,OAAO,CAClC,KAAM,WACN,WAAY,CACV,MAAAC,CACD,EAED,SAAU,CACR,MAAO,CACL,YAAa,IACd,CACF,EAED,MAAO,CACL,YAAa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