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;AAAA;;AAC9B,iBAAK,SAAL,CAAe;AAAA,uBAAO,OAAK,UAAL,GAAkB,IAAzB;AAAA,aAAf;AACD;AAnBM,KA9DF;AAoFP,UApFO,kBAoFC,CApFD,EAoFE;AACP,eAAO,EAAE,KAAF,EAAS;AACd,qBAAS,KAAK;AADA,SAAT,EAEJ,KAAK,MAAL,CAAY,OAFR,CAAP;AAGD;AAxFM,CAJM,CAAf","sourcesContent":["// Styles\nimport '../../stylus/components/_steppers.styl'\n\n// Components\nimport VStepperStep from './VStepperStep'\nimport VStepperContent from './VStepperContent'\n\n// Mixins\nimport { provide as RegistrableProvide } from '../../mixins/registrable'\nimport Themeable from '../../mixins/themeable'\n\n// Util\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode } from 'vue'\n\ntype VStepperStepInstance = InstanceType<typeof VStepperStep>\ntype VStepperContentInstance = InstanceType<typeof VStepperContent>\n\nexport default mixins(\n RegistrableProvide('stepper'),\n Themeable\n/* @vue/component */\n).extend({\n name: 'v-stepper',\n\n provide (): object {\n return {\n stepClick: this.stepClick,\n isVertical: this.vertical\n }\n },\n\n props: {\n nonLinear: Boolean,\n altLabels: Boolean,\n vertical: Boolean,\n value: [Number, String]\n },\n\n data () {\n return {\n inputValue: null as any,\n isBooted: false,\n steps: [] as VStepperStepInstance[],\n content: [] as VStepperContentInstance[],\n isReverse: false\n }\n },\n\n computed: {\n classes (): object {\n return {\n 'v-stepper': true,\n 'v-stepper--is-booted': this.isBooted,\n 'v-stepper--vertical': this.vertical,\n 'v-stepper--alt-labels': this.altLabels,\n 'v-stepper--non-linear': this.nonLinear,\n ...this.themeClasses\n }\n }\n },\n\n watch: {\n inputValue (val, prev) {\n this.isReverse = Number(val) < Number(prev)\n for (let index = this.steps.length; --index >= 0;) {\n this.steps[index].toggle(this.inputValue)\n }\n for (let index = this.content.length; --index >= 0;) {\n this.content[index].toggle(this.inputValue, this.isReverse)\n }\n\n this.$emit('input', this.inputValue)\n prev && (this.isBooted = true)\n },\n value () {\n this.$nextTick(() => (this.inputValue = this.value))\n }\n },\n\n mounted () {\n this.inputValue = this.value || this.steps[0].step || 1\n },\n\n methods: {\n register (item: VStepperStepInstance | VStepperContentInstance) {\n if (item.$options.name === 'v-stepper-step') {\n this.steps.push(item as VStepperStepInstance)\n } else if (item.$options.name === 'v-stepper-content') {\n (item as VStepperContentInstance).isVertical = this.vertical\n this.content.push(item as VStepperContentInstance)\n }\n },\n unregister (item: VStepperStepInstance | VStepperContentInstance) {\n if (item.$options.name === 'v-stepper-step') {\n this.steps = this.steps.filter((i: VStepperStepInstance) => i !== item)\n } else if (item.$options.name === 'v-stepper-content') {\n (item as VStepperContentInstance).isVertical = this.vertical\n this.content = this.content.filter((i: VStepperContentInstance) => i !== item)\n }\n },\n stepClick (step: string | number) {\n this.$nextTick(() => (this.inputValue = step))\n }\n },\n\n render (h): VNode {\n return h('div', {\n 'class': this.classes\n }, this.$slots.default)\n }\n})\n"],"sourceRoot":""}
|