1 line
No EOL
6.5 KiB
Text
1 line
No EOL
6.5 KiB
Text
{"version":3,"sources":["../../../src/components/VStepper/VStepperContent.ts"],"names":[],"mappings":";;;;;;;AACA;;AAMA;;AAGA;;AAGA;;;;AAbA;AAMA;AAGA;AAGA;AAMA,IAAM,UAAU,GAAG,qBACjB,yBAAkB,SAAlB,EAA6B,mBAA7B,EAAkD,WAAlD,CADiB,CAAnB;AAWA;;eACe,UAAU,CAAC,MAAX,GAA6B,MAA7B,CAAoC;AACjD,EAAA,IAAI,EAAE,mBAD2C;AAGjD,EAAA,MAAM,EAAE;AACN,IAAA,kBAAkB,EAAE;AAClB,MAAA,IAAI,EAAE;AADY;AADd,GAHyC;AASjD,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADF;AAEJ,MAAA,QAAQ,EAAE;AAFN;AADD,GAT0C;AAgBjD,EAAA,IAhBiD,kBAgB7C;AACF,WAAO;AACL,MAAA,MAAM,EAAE,CADH;AAEL;AACA;AACA,MAAA,QAAQ,EAAE,IAJL;AAKL,MAAA,SAAS,EAAE,KALN;AAML,MAAA,UAAU,EAAE,KAAK;AANZ,KAAP;AAQD,GAzBgD;AA2BjD,EAAA,QAAQ,EAAE;AACR,IAAA,kBADQ,gCACU;AAChB,aAAO,KAAK,SAAL,GACH,kCADG,GAEH,2BAFJ;AAGD,KALO;AAMR,IAAA,MANQ,oBAMF;AACJ,UAAI,CAAC,KAAK,UAAV,EAAsB,OAAO,EAAP;AAEtB,aAAO;AACL,QAAA,MAAM,EAAE,4BAAc,KAAK,MAAnB;AADH,OAAP;AAGD;AAZO,GA3BuC;AA0CjD,EAAA,KAAK,EAAE;AACL,IAAA,QADK,oBACK,OADL,EACc,QADd,EACsB;AACzB;AACA;AACA,UAAI,OAAO,IAAI,QAAQ,IAAI,IAA3B,EAAiC;AAC/B,aAAK,MAAL,GAAc,MAAd;AACA;AACD;;AAED,UAAI,CAAC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AAA,OAAD,EAA0B,EAA1B,CAAV;AACD,KAxBM;AAyBP,IAAA,MAzBO,kBAyBC,IAzBD,EAyBwB,OAzBxB,EAyBwC;AAC7C,WAAK,QAAL,GAAgB,IAAI,CAAC,QAAL,OAAoB,KAAK,IAAL,CAAU,QAAV,EAApC;AACA,WAAK,SAAL,GAAiB,OAAjB;AACD;AA5BM,GA5EwC;AA2GjD,EAAA,MA3GiD,kBA2GzC,CA3GyC,EA2GxC;AACP,QAAM,WAAW,GAAG;AAClB,MAAA,WAAW,EAAE;AADK,KAApB;AAGA,QAAM,WAAW,GAAG;AAClB,MAAA,WAAW,EAAE,oBADK;AAElB,MAAA,KAAK,EAAE,KAAK,MAFM;AAGlB,MAAA,GAAG,EAAE;AAHa,KAApB;;AAMA,QAAI,CAAC,KAAK,UAAV,EAAsB;AACpB,MAAA,WAAW,CAAC,UAAZ,GAAyB,CAAC;AACxB,QAAA,IAAI,EAAE,MADkB;AAExB,QAAA,KAAK,EAAE,KAAK;AAFY,OAAD,CAAzB;AAID;;AAED,QAAM,OAAO,GAAG,CAAC,CAAC,KAAD,EAAQ,WAAR,EAAqB,CAAC,KAAK,MAAL,CAAY,OAAb,CAArB,CAAjB;AACA,QAAM,OAAO,GAAG,CAAC,CAAC,KAAD,EAAQ,WAAR,EAAqB,CAAC,OAAD,CAArB,CAAjB;AAEA,WAAO,CAAC,CAAC,KAAK,kBAAN,EAA0B;AAChC,MAAA,EAAE,EAAE,KAAK;AADuB,KAA1B,EAEL,CAAC,OAAD,CAFK,CAAR;AAGD;AAlIgD,CAApC,C","sourcesContent":["// Components\nimport {\n VTabTransition,\n VTabReverseTransition,\n} from '../transitions'\n\n// Mixins\nimport { inject as RegistrableInject } from '../../mixins/registrable'\n\n// Helpers\nimport { convertToUnit } from '../../util/helpers'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode, FunctionalComponentOptions, VNodeData } from 'vue'\n\nconst baseMixins = mixins(\n RegistrableInject('stepper', 'v-stepper-content', 'v-stepper')\n)\n\ninterface options extends InstanceType<typeof baseMixins> {\n $refs: {\n wrapper: HTMLElement\n }\n isVerticalProvided: boolean\n}\n\n/* @vue/component */\nexport default baseMixins.extend<options>().extend({\n name: 'v-stepper-content',\n\n inject: {\n isVerticalProvided: {\n from: 'isVertical',\n },\n },\n\n props: {\n step: {\n type: [Number, String],\n required: true,\n },\n },\n\n data () {\n return {\n height: 0 as number | string,\n // Must be null to allow\n // previous comparison\n isActive: null as boolean | null,\n isReverse: false,\n isVertical: this.isVerticalProvided,\n }\n },\n\n computed: {\n computedTransition (): FunctionalComponentOptions {\n return this.isReverse\n ? VTabReverseTransition\n : VTabTransition\n },\n styles (): object {\n if (!this.isVertical) return {}\n\n return {\n height: convertToUnit(this.height),\n }\n },\n },\n\n watch: {\n isActive (current, previous) {\n // If active and the previous state\n // was null, is just booting up\n if (current && previous == null) {\n this.height = 'auto'\n return\n }\n\n if (!this.isVertical) return\n\n if (this.isActive) this.enter()\n else this.leave()\n },\n },\n\n mounted () {\n this.$refs.wrapper.addEventListener(\n 'transitionend',\n this.onTransition,\n false\n )\n this.stepper && this.stepper.register(this)\n },\n\n beforeDestroy () {\n this.$refs.wrapper.removeEventListener(\n 'transitionend',\n this.onTransition,\n false\n )\n this.stepper && this.stepper.unregister(this)\n },\n\n methods: {\n onTransition (e: TransitionEvent) {\n if (!this.isActive ||\n e.propertyName !== 'height'\n ) return\n\n this.height = 'auto'\n },\n enter () {\n let scrollHeight = 0\n\n // Render bug with height\n requestAnimationFrame(() => {\n scrollHeight = this.$refs.wrapper.scrollHeight\n })\n\n this.height = 0\n\n // Give the collapsing element time to collapse\n setTimeout(() => this.isActive && (this.height = (scrollHeight || 'auto')), 450)\n },\n leave () {\n this.height = this.$refs.wrapper.clientHeight\n setTimeout(() => (this.height = 0), 10)\n },\n toggle (step: string | number, reverse: boolean) {\n this.isActive = step.toString() === this.step.toString()\n this.isReverse = reverse\n },\n },\n\n render (h): VNode {\n const contentData = {\n staticClass: 'v-stepper__content',\n } as VNodeData\n const wrapperData = {\n staticClass: 'v-stepper__wrapper',\n style: this.styles,\n ref: 'wrapper',\n }\n\n if (!this.isVertical) {\n contentData.directives = [{\n name: 'show',\n value: this.isActive,\n }]\n }\n\n const wrapper = h('div', wrapperData, [this.$slots.default])\n const content = h('div', contentData, [wrapper])\n\n return h(this.computedTransition, {\n on: this.$listeners,\n }, [content])\n },\n})\n"],"sourceRoot":"","file":"VStepperContent.js"} |