VStepperWindow.mjs.map 3.7 KB

1
  1. {"version":3,"file":"VStepperWindow.mjs","names":["makeVWindowProps","VWindow","useProxiedModel","computed","inject","genericComponent","propsFactory","useRender","VStepperSymbol","Symbol","for","makeVStepperWindowProps","mandatory","VStepperWindow","name","props","emits","v","setup","_ref","slots","group","_model","model","get","value","items","find","item","selected","includes","id","set","val","windowProps","filterProps","_createVNode","_mergeProps","$event"],"sources":["../../../src/labs/VStepper/VStepperWindow.tsx"],"sourcesContent":["// Components\nimport { makeVWindowProps, VWindow } from '@/components/VWindow/VWindow'\n\n// Composables\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, inject } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { InjectionKey } from 'vue'\nimport type { GroupProvide } from '@/composables/group'\n\nexport const VStepperSymbol: InjectionKey<GroupProvide> = Symbol.for('vuetify:v-stepper')\n\nexport const makeVStepperWindowProps = propsFactory({\n ...makeVWindowProps({\n mandatory: false as const,\n }),\n}, 'VStepperWindow')\n\nexport const VStepperWindow = genericComponent()({\n name: 'VStepperWindow',\n\n props: makeVStepperWindowProps(),\n\n emits: {\n 'update:modelValue': (v: unknown) => true,\n },\n\n setup (props, { slots }) {\n const group = inject(VStepperSymbol, null)\n const _model = useProxiedModel(props, 'modelValue')\n\n const model = computed({\n get () {\n // Always return modelValue if defined\n // or if not within a VStepper group\n if (_model.value != null || !group) return _model.value\n\n // If inside of a VStepper, find the currently selected\n // item by id. Item value may be assigned by its index\n return group.items.value.find(item => group.selected.value.includes(item.id))?.value\n },\n set (val) {\n _model.value = val\n },\n })\n\n useRender(() => {\n const [windowProps] = VWindow.filterProps(props)\n\n return (\n <VWindow\n { ...windowProps }\n v-model={ model.value }\n class=\"v-stepper-window\"\n v-slots={ slots }\n />\n )\n })\n\n return {}\n },\n})\n\nexport type VStepperWindow = InstanceType<typeof VStepperWindow>\n"],"mappings":";AAAA;AAAA,SACSA,gBAAgB,EAAEC,O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