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EAAtB;AACD;AAED;;;AACA,QAAI,KAAK,QAAL,IAAiB,KAAK,aAA1B,EAAyC;AACvC,MAAA,MAAM,CAAC,QAAP,CAAiB,IAAjB,CAAsB,KAAK,WAAL,EAAtB;AACD;;AAED,WAAO,MAAP;AACD;AAjL2B,CAAf,C","sourcesContent":["// Styles\nimport './VCarousel.sass'\n\n// Extensions\nimport VWindow from '../VWindow/VWindow'\n\n// Components\nimport VBtn from '../VBtn'\nimport VIcon from '../VIcon'\nimport VProgressLinear from '../VProgressLinear'\n\n// Mixins\n// TODO: Move this into core components v2.0\nimport ButtonGroup from '../../mixins/button-group'\n\n// Utilities\nimport { convertToUnit } from '../../util/helpers'\nimport { breaking } from '../../util/console'\n\n// Types\nimport { VNode } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\nexport default VWindow.extend({\n name: 'v-carousel',\n\n props: {\n continuous: {\n type: Boolean,\n default: true,\n },\n cycle: Boolean,\n delimiterIcon: {\n type: String,\n default: '$vuetify.icons.delimiter',\n },\n height: {\n type: [Number, String],\n default: 500,\n },\n hideDelimiters: Boolean,\n hideDelimiterBackground: Boolean,\n interval: {\n type: [Number, String],\n default: 6000,\n validator: (value: string | number) => value > 0,\n },\n mandatory: {\n type: Boolean,\n default: true,\n },\n progress: Boolean,\n progressColor: String,\n showArrows: {\n type: Boolean,\n default: true,\n },\n verticalDelimiters: {\n type: String,\n default: undefined,\n } as PropValidator<'' | 'left' | 'right'>,\n },\n\n data () {\n return {\n internalHeight: this.height,\n slideTimeout: undefined as number | undefined,\n }\n },\n\n computed: {\n classes (): object {\n return {\n ...VWindow.options.computed.classes.call(this),\n 'v-carousel': true,\n 'v-carousel--hide-delimiter-background': this.hideDelimiterBackground,\n 'v-carousel--vertical-delimiters': this.isVertical,\n }\n },\n isDark (): boolean {\n return this.dark || !this.light\n },\n isVertical (): boolean {\n return this.verticalDelimiters != null\n },\n },\n\n watch: {\n internalValue: 'restartTimeout',\n interval: 'restartTimeout',\n height (val, oldVal) {\n if (val === oldVal || !val) return\n this.internalHeight = val\n },\n cycle (val) {\n if (val) {\n this.restartTimeout()\n } else {\n clearTimeout(this.slideTimeout)\n this.slideTimeout = undefined\n }\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('hide-controls')) {\n breaking('hide-controls', ':show-arrows=\"false\"', this)\n }\n },\n\n mounted () {\n this.startTimeout()\n },\n\n methods: {\n genControlIcons () {\n if (this.isVertical) return null\n\n return VWindow.options.methods.genControlIcons.call(this)\n },\n genDelimiters (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-carousel__controls',\n style: {\n left: this.verticalDelimiters === 'left' && this.isVertical ? 0 : 'auto',\n right: this.verticalDelimiters === 'right' ? 0 : 'auto',\n },\n }, [this.genItems()])\n },\n genItems (): VNode {\n const length = this.items.length\n const children = []\n\n for (let i = 0; i < length; i++) {\n const child = this.$createElement(VBtn, {\n staticClass: 'v-carousel__controls__item',\n props: {\n icon: true,\n small: true,\n value: this.getValue(this.items[i], i),\n },\n }, [\n this.$createElement(VIcon, {\n props: { size: 18 },\n }, this.delimiterIcon),\n ])\n\n children.push(child)\n }\n\n return this.$createElement(ButtonGroup, {\n props: {\n value: this.internalValue,\n },\n on: {\n change: (val: any) => {\n this.internalValue = val\n },\n },\n }, children)\n },\n genProgress () {\n return this.$createElement(VProgressLinear, {\n staticClass: 'v-carousel__progress',\n props: {\n color: this.progressColor,\n value: (this.internalIndex + 1) / this.items.length * 100,\n },\n })\n },\n restartTimeout () {\n this.slideTimeout && clearTimeout(this.slideTimeout)\n this.slideTimeout = undefined\n\n window.requestAnimationFrame(this.startTimeout)\n },\n startTimeout () {\n if (!this.cycle) return\n\n this.slideTimeout = window.setTimeout(this.next, +this.interval > 0 ? +this.interval : 6000)\n },\n },\n\n render (h): VNode {\n const render = VWindow.options.render.call(this, h)\n\n render.data!.style = `height: ${convertToUnit(this.height)};`\n\n /* istanbul ignore else */\n if (!this.hideDelimiters) {\n render.children!.push(this.genDelimiters())\n }\n\n /* istanbul ignore else */\n if (this.progress || this.progressColor) {\n render.children!.push(this.genProgress())\n }\n\n return render\n },\n})\n"],"sourceRoot":"","file":"VCarousel.js"} |