VStepper.mjs.map 7.4 KB

1
  1. {"version":3,"file":"VStepper.mjs","names":["VSheet","provide","RegistrableProvide","Proxyable","mixins","breaking","baseMixins","extend","name","stepClick","isVertical","vertical","props","altLabels","Boolean","nonLinear","flat","data","isBooted","steps","content","isReverse","internalLazyValue","value","step","computed","classes","options","call","styles","watch","internalValue","val","oldVal","Number","updateView","created","$listeners","input","mounted","methods","register","item","$options","push","unregister","filter","i","$nextTick","index","length","toggle","render","h","tag","staticClass","class","style","$slots","default"],"sources":["../../../src/components/VStepper/VStepper.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n\n// Styles\nimport './VStepper.sass'\n\n// Extensions\nimport VSheet from '../VSheet'\n\n// Components\nimport VStepperStep from './VStepperStep'\nimport VStepperContent from './VStepperContent'\n\n// Mixins\nimport { provide as RegistrableProvide } from '../../mixins/registrable'\nimport Proxyable from '../../mixins/proxyable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { breaking } from '../../util/console'\n\n// Types\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n VSheet,\n RegistrableProvide('stepper'),\n Proxyable,\n)\n\ntype VStepperStepInstance = InstanceType<typeof VStepperStep>\ntype VStepperContentInstance = InstanceType<typeof VStepperContent>\n\n/* @vue/component */\nexport default baseMixins.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 altLabels: Boolean,\n nonLinear: Boolean,\n flat: Boolean,\n vertical: Boolean,\n },\n\n data () {\n const data: Record<string, any> = {\n isBooted: false,\n steps: [] as VStepperStepInstance[],\n content: [] as VStepperContentInstance[],\n isReverse: false,\n }\n\n data.internalLazyValue = this.value != null\n ? this.value\n : (data[0] || {}).step || 1\n\n return data\n },\n\n computed: {\n classes (): object {\n return {\n 'v-stepper--flat': this.flat,\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 ...VSheet.options.computed.classes.call(this),\n }\n },\n styles (): object {\n return {\n ...VSheet.options.computed.styles.call(this),\n }\n },\n },\n\n watch: {\n internalValue (val, oldVal) {\n this.isReverse = Number(val) < Number(oldVal)\n\n oldVal && (this.isBooted = true)\n\n this.updateView()\n },\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$listeners.input) {\n breaking('@input', '@change', this)\n }\n },\n\n mounted () {\n this.updateView()\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.internalValue = step))\n },\n updateView () {\n for (let index = this.steps.length; --index >= 0;) {\n this.steps[index].toggle(this.internalValue as any)\n }\n for (let index = this.content.length; --index >= 0;) {\n this.content[index].toggle(this.internalValue as any, this.isReverse)\n }\n },\n },\n\n render (h): VNode {\n return h(this.tag, {\n staticClass: 'v-stepper',\n class: this.classes,\n style: this.styles,\n }, this.$slots.default)\n },\n})\n"],"mappings":"AAAA;AACA;;AAEA;AACA;;AAEA;AAAA,OACOA,MAAM,6BAEb;AAIA;AAAA,SACSC,OAAO,IAAIC,kBAAkB;AAAA,OAC/BC,SAAS,oCAEhB;AAAA,OACOC,MAAM;AAAA,SACJC,QAAQ,kCAEjB;AAGA,MAAMC,UAAU,GAAGF,MAAM,CACvBJ,MAAM,EACNE,kBAAkB,CAAC,SAAS,CAAC,EAC7BC,SAAS,CACV;AAK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