@vuetify/nightly 3.7.5-dev.2024-12-03 → 3.7.5-dev.2024-12-16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/json/attributes.json +3779 -3779
  2. package/dist/json/importMap-labs.json +20 -20
  3. package/dist/json/importMap.json +136 -136
  4. package/dist/json/web-types.json +7026 -7026
  5. package/dist/vuetify-labs.css +4372 -4372
  6. package/dist/vuetify-labs.d.ts +40 -40
  7. package/dist/vuetify-labs.esm.js +21 -38
  8. package/dist/vuetify-labs.esm.js.map +1 -1
  9. package/dist/vuetify-labs.js +20 -37
  10. package/dist/vuetify-labs.min.css +2 -2
  11. package/dist/vuetify.css +4189 -4189
  12. package/dist/vuetify.d.ts +92 -92
  13. package/dist/vuetify.esm.js +21 -38
  14. package/dist/vuetify.esm.js.map +1 -1
  15. package/dist/vuetify.js +20 -37
  16. package/dist/vuetify.js.map +1 -1
  17. package/dist/vuetify.min.css +2 -2
  18. package/dist/vuetify.min.js +876 -881
  19. package/dist/vuetify.min.js.map +1 -1
  20. package/lib/components/VAppBar/index.d.mts +6 -6
  21. package/lib/components/VAutocomplete/index.d.mts +6 -6
  22. package/lib/components/VBtn/index.d.mts +7 -7
  23. package/lib/components/VBtnToggle/index.d.mts +9 -9
  24. package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
  25. package/lib/components/VCarousel/index.d.mts +9 -9
  26. package/lib/components/VCheckbox/VCheckbox.mjs +3 -3
  27. package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
  28. package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
  29. package/lib/components/VChipGroup/index.d.mts +15 -15
  30. package/lib/components/VCombobox/index.d.mts +6 -6
  31. package/lib/components/VExpansionPanel/index.d.mts +7 -7
  32. package/lib/components/VFab/index.d.mts +6 -6
  33. package/lib/components/VField/VField.mjs +3 -3
  34. package/lib/components/VField/VField.mjs.map +1 -1
  35. package/lib/components/VInput/VInput.mjs +3 -3
  36. package/lib/components/VInput/VInput.mjs.map +1 -1
  37. package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
  38. package/lib/components/VItemGroup/index.d.mts +9 -9
  39. package/lib/components/VMenu/VMenu.mjs +3 -3
  40. package/lib/components/VMenu/VMenu.mjs.map +1 -1
  41. package/lib/components/VMenu/index.d.mts +6 -6
  42. package/lib/components/VRadioGroup/VRadioGroup.mjs +3 -3
  43. package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
  44. package/lib/components/VRating/VRating.mjs +4 -3
  45. package/lib/components/VRating/VRating.mjs.map +1 -1
  46. package/lib/components/VSelect/index.d.mts +6 -6
  47. package/lib/components/VSelectionControl/VSelectionControl.mjs +3 -3
  48. package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
  49. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +3 -3
  50. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
  51. package/lib/components/VSlideGroup/index.d.mts +10 -10
  52. package/lib/components/VSparkline/VBarline.mjs +3 -3
  53. package/lib/components/VSparkline/VBarline.mjs.map +1 -1
  54. package/lib/components/VSparkline/VTrendline.mjs +3 -3
  55. package/lib/components/VSparkline/VTrendline.mjs.map +1 -1
  56. package/lib/components/VSwitch/VSwitch.mjs +3 -3
  57. package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
  58. package/lib/components/VTabs/index.d.mts +7 -7
  59. package/lib/components/VTooltip/VTooltip.mjs +3 -3
  60. package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
  61. package/lib/components/VWindow/index.d.mts +7 -7
  62. package/lib/components/index.d.mts +40 -40
  63. package/lib/composables/group.mjs +3 -3
  64. package/lib/composables/group.mjs.map +1 -1
  65. package/lib/composables/layout.mjs +3 -3
  66. package/lib/composables/layout.mjs.map +1 -1
  67. package/lib/composables/nested/nested.mjs +2 -2
  68. package/lib/composables/nested/nested.mjs.map +1 -1
  69. package/lib/composables/validation.mjs +3 -3
  70. package/lib/composables/validation.mjs.map +1 -1
  71. package/lib/entry-bundler.mjs +1 -1
  72. package/lib/framework.mjs +2 -3
  73. package/lib/framework.mjs.map +1 -1
  74. package/lib/index.d.mts +52 -52
  75. package/lib/util/getCurrentInstance.mjs +1 -15
  76. package/lib/util/getCurrentInstance.mjs.map +1 -1
  77. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VDefaultsProvider","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","getUid","IN_BROWSER","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","value","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","isForcedColorsModeActive","window","matchMedia","matches","loaderColor","color","uid","id","onChange","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","_createVNode","_mergeProps","class","$event","style","_ref2","messagesId","isDisabled","isReadonly","isValid","slotProps","undefined","_ref3","backgroundColorClasses","backgroundColorStyles","_ref4","inputNode","icon","_Fragment","thumb","size","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider/VDefaultsProvider'\nimport { VIcon } from '@/components/VIcon'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VProgressCircular } from '@/components/VProgressCircular'\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { LoaderSlot, useLoader } from '@/composables/loader'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, IN_BROWSER, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef, Ref } from 'vue'\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { IconValue } from '@/composables/icons'\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { GenericProps } from '@/util'\n\nexport type VSwitchSlot = {\n model: Ref<boolean>\n isValid: ComputedRef<boolean | null>\n}\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & {\n loader: LoaderSlotProps\n thumb: { icon: IconValue | undefined } & VSwitchSlot\n 'track-false': VSwitchSlot\n 'track-true': VSwitchSlot\n }\n\nexport const makeVSwitchProps = propsFactory({\n indeterminate: Boolean,\n inset: Boolean,\n flat: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n\n ...makeVInputProps(),\n ...makeVSelectionControlProps(),\n}, 'VSwitch')\n\nexport const VSwitch = genericComponent<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VSwitchSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (value: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n const { loaderClasses } = useLoader(props)\n const { isFocused, focus, blur } = useFocus(props)\n const control = ref<VSelectionControl>()\n const isForcedColorsModeActive = IN_BROWSER && window.matchMedia('(forced-colors: active)').matches\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = getUid()\n const id = computed(() => props.id || `switch-${uid}`)\n\n function onChange () {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n function onTrackClick (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n control.value?.input?.click()\n }\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const inputProps = VInput.filterProps(props)\n const controlProps = VSelectionControl.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--flat': props.flat },\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => {\n const slotProps = {\n model,\n isValid,\n }\n\n return (\n <VSelectionControl\n ref={ control }\n { ...controlProps }\n v-model={ model.value }\n id={ id.value }\n aria-describedby={ messagesId.value }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n onFocus={ focus }\n onBlur={ blur }\n { ...controlAttrs }\n >\n {{\n ...slots,\n default: ({ backgroundColorClasses, backgroundColorStyles }) => (\n <div\n class={[\n 'v-switch__track',\n !isForcedColorsModeActive ? backgroundColorClasses.value : undefined,\n ]}\n style={ backgroundColorStyles.value }\n onClick={ onTrackClick }\n >\n { slots['track-true'] && (\n <div key=\"prepend\" class=\"v-switch__track-true\">\n { slots['track-true'](slotProps) }\n </div>\n )}\n\n { slots['track-false'] && (\n <div key=\"append\" class=\"v-switch__track-false\">\n { slots['track-false'](slotProps) }\n </div>\n )}\n </div>\n ),\n input: ({ inputNode, icon, backgroundColorClasses, backgroundColorStyles }) => (\n <>\n { inputNode }\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n props.inset || isForcedColorsModeActive ? undefined : backgroundColorClasses.value,\n ]}\n style={ props.inset ? undefined : backgroundColorStyles.value }\n >\n { slots.thumb ? (\n <VDefaultsProvider\n defaults={{\n VIcon: {\n icon,\n size: 'x-small',\n },\n }}\n >\n { slots.thumb({ ...slotProps, icon }) }\n </VDefaultsProvider>\n ) : (\n <VScaleTransition>\n { !props.loading ? (\n (icon && (\n <VIcon\n key={ String(icon) }\n icon={ icon }\n size=\"x-small\"\n />\n ))) : (\n <LoaderSlot\n name=\"v-switch\"\n active\n color={ isValid.value === false ? undefined : loaderColor.value }\n >\n { slotProps => (\n slots.loader\n ? slots.loader(slotProps)\n : (\n <VProgressCircular\n active={ slotProps.isActive }\n color={ slotProps.color }\n indeterminate\n size=\"16\"\n width=\"2\"\n />\n )\n )}\n </LoaderSlot>\n )}\n </VScaleTransition>\n )}\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n )\n },\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSwitch = InstanceType<typeof VSwitch>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB;AAAA,SAChBC,iBAAiB;AAAA,SACjBC,KAAK;AAAA,SACLC,eAAe,EAAEC,MAAM;AAAA,SACvBC,iBAAiB;AAAA,SACjBC,0BAA0B,EAAEC,iBAAiB,sDAEtD;AAAA,SACSC,QAAQ;AAAA,SACRC,UAAU,EAAEC,SAAS;AAAA,SACrBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,UAAU,EAAEC,YAAY,EAAEC,SAAS,gCAExF;AAuBA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,aAAa,EAAEC,OAAO;EACtBC,KAAK,EAAED,OAAO;EACdE,IAAI,EAAEF,OAAO;EACbG,OAAO,EAAE;IACPC,IAAI,EAAE,CAACJ,OAAO,EAAEK,MAAM,CAAC;IACvBC,OAAO,EAAE;EACX,CAAC;EA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ACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VDefaultsProvider","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","useId","filterInputAttrs","genericComponent","IN_BROWSER","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","value","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","isForcedColorsModeActive","window","matchMedia","matches","loaderColor","color","uid","id","onChange","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","_createVNode","_mergeProps","class","$event","style","_ref2","messagesId","isDisabled","isReadonly","isValid","slotProps","undefined","_ref3","backgroundColorClasses","backgroundColorStyles","_ref4","inputNode","icon","_Fragment","thumb","size","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider/VDefaultsProvider'\nimport { VIcon } from '@/components/VIcon'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VProgressCircular } from '@/components/VProgressCircular'\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { LoaderSlot, useLoader } from '@/composables/loader'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref, useId } from 'vue'\nimport { filterInputAttrs, genericComponent, IN_BROWSER, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef, Ref } from 'vue'\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { IconValue } from '@/composables/icons'\nimport type { LoaderSlotProps } from '@/composables/loader'\nimport type { GenericProps } from '@/util'\n\nexport type VSwitchSlot = {\n model: Ref<boolean>\n isValid: ComputedRef<boolean | null>\n}\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & {\n loader: LoaderSlotProps\n thumb: { icon: IconValue | undefined } & VSwitchSlot\n 'track-false': VSwitchSlot\n 'track-true': VSwitchSlot\n }\n\nexport const makeVSwitchProps = propsFactory({\n indeterminate: Boolean,\n inset: Boolean,\n flat: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n\n ...makeVInputProps(),\n ...makeVSelectionControlProps(),\n}, 'VSwitch')\n\nexport const VSwitch = genericComponent<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VSwitchSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (value: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n const { loaderClasses } = useLoader(props)\n const { isFocused, focus, blur } = useFocus(props)\n const control = ref<VSelectionControl>()\n const isForcedColorsModeActive = IN_BROWSER && window.matchMedia('(forced-colors: active)').matches\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = useId()\n const id = computed(() => props.id || `switch-${uid}`)\n\n function onChange () {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n function onTrackClick (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n control.value?.input?.click()\n }\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const inputProps = VInput.filterProps(props)\n const controlProps = VSelectionControl.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--flat': props.flat },\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => {\n const slotProps = {\n model,\n isValid,\n }\n\n return (\n <VSelectionControl\n ref={ control }\n { ...controlProps }\n v-model={ model.value }\n id={ id.value }\n aria-describedby={ messagesId.value }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n onFocus={ focus }\n onBlur={ blur }\n { ...controlAttrs }\n >\n {{\n ...slots,\n default: ({ backgroundColorClasses, backgroundColorStyles }) => (\n <div\n class={[\n 'v-switch__track',\n !isForcedColorsModeActive ? backgroundColorClasses.value : undefined,\n ]}\n style={ backgroundColorStyles.value }\n onClick={ onTrackClick }\n >\n { slots['track-true'] && (\n <div key=\"prepend\" class=\"v-switch__track-true\">\n { slots['track-true'](slotProps) }\n </div>\n )}\n\n { slots['track-false'] && (\n <div key=\"append\" class=\"v-switch__track-false\">\n { slots['track-false'](slotProps) }\n </div>\n )}\n </div>\n ),\n input: ({ inputNode, icon, backgroundColorClasses, backgroundColorStyles }) => (\n <>\n { inputNode }\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n props.inset || isForcedColorsModeActive ? undefined : backgroundColorClasses.value,\n ]}\n style={ props.inset ? undefined : backgroundColorStyles.value }\n >\n { slots.thumb ? (\n <VDefaultsProvider\n defaults={{\n VIcon: {\n icon,\n size: 'x-small',\n },\n }}\n >\n { slots.thumb({ ...slotProps, icon }) }\n </VDefaultsProvider>\n ) : (\n <VScaleTransition>\n { !props.loading ? (\n (icon && (\n <VIcon\n key={ String(icon) }\n icon={ icon }\n size=\"x-small\"\n />\n ))) : (\n <LoaderSlot\n name=\"v-switch\"\n active\n color={ isValid.value === false ? undefined : loaderColor.value }\n >\n { slotProps => (\n slots.loader\n ? slots.loader(slotProps)\n : (\n <VProgressCircular\n active={ slotProps.isActive }\n color={ slotProps.color }\n indeterminate\n size=\"16\"\n width=\"2\"\n />\n )\n )}\n </LoaderSlot>\n )}\n </VScaleTransition>\n )}\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n )\n },\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSwitch = InstanceType<typeof VSwitch>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB;AAAA,SAChBC,iBAAiB;AAAA,SACjBC,KAAK;AAAA,SACLC,eAAe,EAAEC,MAAM;AAAA,SACvBC,iBAAiB;AAAA,SACjBC,0BAA0B,EAAEC,iBAAiB,sDAEtD;AAAA,SACSC,QAAQ;AAAA,SACRC,UAAU,EAAEC,SAAS;AAAA,SACrBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjCC,gBAAgB,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,YAAY,EAAEC,SAAS,gCAEhF;AAuBA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,aAAa,EAAEC,OAAO;EACtBC,KAAK,EAAED,OAAO;EACdE,IAAI,EAAEF,OAAO;EACbG,OAAO,EAAE;IACPC,IAAI,EAAE,CAACJ,OAAO,EAAEK,MAAM,CAAC;IACvBC,OAAO,EAAE;EACX,CAAC;EAED,GAAGzB,eAAe,CAAC,CAAC;EACpB,GAAGG,0BAA0B,CAAC;AAChC,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,MAAMuB,OAAO,GAAGb,gBAAgB,CAMQ,CAAC,CAAC;EAC/Cc,IAAI,EAAE,SAAS;EAEfC,YAAY,EAAE,KAAK;EAEnBC,KAAK,EAAEZ,gBAAg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A,SACOH,KAAK,CAACT,KAAK,GAAGsD,SAAS,GAAGG,qBAAqB,CAAC7C;cAAK,IAE3DI,KAAK,CAAC8C,KAAK,GAAAnB,YAAA,CAAAjE,iBAAA;gBAAA,YAEC;kBACRC,KAAK,EAAE;oBACLiF,IAAI;oBACJG,IAAI,EAAE;kBACR;gBACF;cAAC;gBAAA1D,OAAA,EAAAA,CAAA,MAECW,KAAK,CAAC8C,KAAK,CAAC;kBAAE,GAAGT,SAAS;kBAAEO;gBAAK,CAAC,CAAC;cAAA,KAAAjB,YAAA,CAAAlE,gBAAA;gBAAA4B,OAAA,EAAAA,CAAA,MAInC,CAACI,KAAK,CAACP,OAAO,GACb0D,IAAI,IAAAjB,YAAA,CAAAhE,KAAA;kBAAA,OAEKyB,MAAM,CAACwD,IAAI,CAAC;kBAAA,QACXA,IAAI;kBAAA;gBAAA,QAGd,GAAAjB,YAAA,CAAAzD,UAAA;kBAAA;kBAAA;kBAAA,SAISkE,OAAO,CAACxC,KAAK,KAAK,KAAK,GAAG0C,SAAS,GAAG3B,WAAW,CAACf;gBAAK;kBAAAP,OAAA,EAE7DgD,SAAS,IACTrC,KAAK,CAACgD,MAAM,GACRhD,KAAK,CAACgD,MAAM,CAACX,SAAS,CAAC,GAAAV,YAAA,CAAA7D,iBAAA;oBAAA,UAGZuE,SAAS,CAACY,QAAQ;oBAAA,SACnBZ,SAAS,CAACzB,KAAK;oBAAA;oBAAA;oBAAA;kBAAA;gBAM9B,EAEJ;cAAA,EAEJ;YAAA;UAGN;QAIT;MAAC;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
@@ -17,22 +17,22 @@ interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions
17
17
  }
18
18
 
19
19
  interface GroupItem {
20
- id: number;
20
+ id: string;
21
21
  value: Ref<unknown>;
22
22
  disabled: Ref<boolean | undefined>;
23
23
  useIndexAsValue?: boolean;
24
24
  }
25
25
  interface GroupProvide {
26
26
  register: (item: GroupItem, cmp: ComponentInternalInstance) => void;
27
- unregister: (id: number) => void;
28
- select: (id: number, value: boolean) => void;
29
- selected: Ref<Readonly<number[]>>;
30
- isSelected: (id: number) => boolean;
27
+ unregister: (id: string) => void;
28
+ select: (id: string, value: boolean) => void;
29
+ selected: Ref<Readonly<string[]>>;
30
+ isSelected: (id: string) => boolean;
31
31
  prev: () => void;
32
32
  next: () => void;
33
33
  selectedClass: Ref<string | undefined>;
34
34
  items: ComputedRef<{
35
- id: number;
35
+ id: string;
36
36
  value: unknown;
37
37
  disabled: boolean | undefined;
38
38
  }[]>;
@@ -40,7 +40,7 @@ interface GroupProvide {
40
40
  getItemIndex: (value: unknown) => number;
41
41
  }
42
42
  interface GroupItemProvide {
43
- id: number;
43
+ id: string;
44
44
  isSelected: Ref<boolean>;
45
45
  isFirst: Ref<boolean>;
46
46
  isLast: Ref<boolean>;
@@ -8,8 +8,8 @@ import { makeVOverlayProps } from "../VOverlay/VOverlay.mjs"; // Composables
8
8
  import { forwardRefs } from "../../composables/forwardRefs.mjs";
9
9
  import { useProxiedModel } from "../../composables/proxiedModel.mjs";
10
10
  import { useScopeId } from "../../composables/scopeId.mjs"; // Utilities
11
- import { computed, mergeProps, ref } from 'vue';
12
- import { genericComponent, getUid, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
11
+ import { computed, mergeProps, ref, useId } from 'vue';
12
+ import { genericComponent, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
13
13
  export const makeVTooltipProps = propsFactory({
14
14
  id: String,
15
15
  text: String,
@@ -42,7 +42,7 @@ export const VTooltip = genericComponent()({
42
42
  const {
43
43
  scopeId
44
44
  } = useScopeId();
45
- const uid = getUid();
45
+ const uid = useId();
46
46
  const id = computed(() => props.id || `v-tooltip-${uid}`);
47
47
  const overlay = ref();
48
48
  const location = computed(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"VTooltip.mjs","names":["VOverlay","makeVOverlayProps","forwardRefs","useProxiedModel","useScopeId","computed","mergeProps","ref","genericComponent","getUid","omit","propsFactory","useRender","makeVTooltipProps","id","String","text","closeOnBack","location","locationStrategy","eager","minWidth","offset","openOnClick","openOnHover","origin","scrim","scrollStrategy","transition","VTooltip","name","props","emits","value","setup","_ref","slots","isActive","scopeId","uid","overlay","split","length","activatorProps","overlayProps","filterProps","_createVNode","_mergeProps","class","style","$event","activator","default","_len","arguments","args","Array","_key"],"sources":["../../../src/components/VTooltip/VTooltip.tsx"],"sourcesContent":["// Styles\nimport './VTooltip.sass'\n\n// Components\nimport { VOverlay } from '@/components/VOverlay'\nimport { makeVOverlayProps } from '@/components/VOverlay/VOverlay'\n\n// Composables\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useScopeId } from '@/composables/scopeId'\n\n// Utilities\nimport { computed, mergeProps, ref } from 'vue'\nimport { genericComponent, getUid, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { StrategyProps } from '@/components/VOverlay/locationStrategies'\nimport type { OverlaySlots } from '@/components/VOverlay/VOverlay'\n\nexport const makeVTooltipProps = propsFactory({\n id: String,\n text: String,\n\n ...omit(makeVOverlayProps({\n closeOnBack: false,\n location: 'end' as const,\n locationStrategy: 'connected' as const,\n eager: true,\n minWidth: 0,\n offset: 10,\n openOnClick: false,\n openOnHover: true,\n origin: 'auto' as const,\n scrim: false,\n scrollStrategy: 'reposition' as const,\n transition: false,\n }), [\n 'absolute',\n 'persistent',\n ]),\n}, 'VTooltip')\n\nexport const VTooltip = genericComponent<OverlaySlots>()({\n name: 'VTooltip',\n\n props: makeVTooltipProps(),\n\n emits: {\n 'update:modelValue': (value: boolean) => true,\n },\n\n setup (props, { slots }) {\n const isActive = useProxiedModel(props, 'modelValue')\n const { scopeId } = useScopeId()\n\n const uid = getUid()\n const id = computed(() => props.id || `v-tooltip-${uid}`)\n\n const overlay = ref<VOverlay>()\n\n const location = computed(() => {\n return props.location.split(' ').length > 1\n ? props.location\n : props.location + ' center' as StrategyProps['location']\n })\n\n const origin = computed(() => {\n return (\n props.origin === 'auto' ||\n props.origin === 'overlap' ||\n props.origin.split(' ').length > 1 ||\n props.location.split(' ').length > 1\n ) ? props.origin\n : props.origin + ' center' as StrategyProps['origin']\n })\n\n const transition = computed(() => {\n if (props.transition) return props.transition\n return isActive.value ? 'scale-transition' : 'fade-transition'\n })\n\n const activatorProps = computed(() =>\n mergeProps({\n 'aria-describedby': id.value,\n }, props.activatorProps)\n )\n\n useRender(() => {\n const overlayProps = VOverlay.filterProps(props)\n\n return (\n <VOverlay\n ref={ overlay }\n class={[\n 'v-tooltip',\n props.class,\n ]}\n style={ props.style }\n id={ id.value }\n { ...overlayProps }\n v-model={ isActive.value }\n transition={ transition.value }\n absolute\n location={ location.value }\n origin={ origin.value }\n persistent\n role=\"tooltip\"\n activatorProps={ activatorProps.value }\n _disableGlobalStack\n { ...scopeId }\n >\n {{\n activator: slots.activator,\n default: (...args) => slots.default?.(...args) ?? props.text,\n }}\n </VOverlay>\n )\n })\n\n return forwardRefs({}, overlay)\n },\n})\n\nexport type VTooltip = InstanceType<typeof VTooltip>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,QAAQ;AAAA,SACRC,iBAAiB,oCAE1B;AAAA,SACSC,WAAW;AAAA,SACXC,eAAe;AAAA,SACfC,UAAU,yCAEnB;AACA,SAASC,QAAQ,EAAEC,UAAU,EAAEC,GAAG,QAAQ,KAAK;AAAA,SACtCC,gBAAgB,EAAEC,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAEhE;AAIA,OAAO,MAAMC,iBAAiB,GAAGF,YAAY,CAAC;EAC5CG,EAAE,EAAEC,MAAM;EACVC,IAAI,EAAED,MAAM;EAEZ,GAAGL,IAAI,CAACT,iBAAiB,CAAC;IACxBgB,WAAW,EAAE,KAAK;IAClBC,QAAQ,EAAE,KAAc;IACxBC,gBAAgB,EAAE,WAAoB;IACtCC,KAAK,EAAE,I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AAA,GAAAC,SAAA,CAAAZ,MAAA,EAAIa,IAAI,OAAAC,KAAA,CAAAH,IAAA,GAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;YAAJF,IAAI,CAAAE,IAAA,IAAAH,SAAA,CAAAG,IAAA;UAAA;UAAA,OAAKrB,KAAK,CAACgB,OAAO,GAAG,GAAGG,IAAI,CAAC,IAAIxB,KAAK,CAACf,IAAI;QAAA;MAAA;IAIpE,CAAC,CAAC;IAEF,OAAOd,WAAW,CAAC,CAAC,CAAC,EAAEsC,OAAO,CAAC;EACjC;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"VTooltip.mjs","names":["VOverlay","makeVOverlayProps","forwardRefs","useProxiedModel","useScopeId","computed","mergeProps","ref","useId","genericComponent","omit","propsFactory","useRender","makeVTooltipProps","id","String","text","closeOnBack","location","locationStrategy","eager","minWidth","offset","openOnClick","openOnHover","origin","scrim","scrollStrategy","transition","VTooltip","name","props","emits","value","setup","_ref","slots","isActive","scopeId","uid","overlay","split","length","activatorProps","overlayProps","filterProps","_createVNode","_mergeProps","class","style","$event","activator","default","_len","arguments","args","Array","_key"],"sources":["../../../src/components/VTooltip/VTooltip.tsx"],"sourcesContent":["// Styles\nimport './VTooltip.sass'\n\n// Components\nimport { VOverlay } from '@/components/VOverlay'\nimport { makeVOverlayProps } from '@/components/VOverlay/VOverlay'\n\n// Composables\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useScopeId } from '@/composables/scopeId'\n\n// Utilities\nimport { computed, mergeProps, ref, useId } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { StrategyProps } from '@/components/VOverlay/locationStrategies'\nimport type { OverlaySlots } from '@/components/VOverlay/VOverlay'\n\nexport const makeVTooltipProps = propsFactory({\n id: String,\n text: String,\n\n ...omit(makeVOverlayProps({\n closeOnBack: false,\n location: 'end' as const,\n locationStrategy: 'connected' as const,\n eager: true,\n minWidth: 0,\n offset: 10,\n openOnClick: false,\n openOnHover: true,\n origin: 'auto' as const,\n scrim: false,\n scrollStrategy: 'reposition' as const,\n transition: false,\n }), [\n 'absolute',\n 'persistent',\n ]),\n}, 'VTooltip')\n\nexport const VTooltip = genericComponent<OverlaySlots>()({\n name: 'VTooltip',\n\n props: makeVTooltipProps(),\n\n emits: {\n 'update:modelValue': (value: boolean) => true,\n },\n\n setup (props, { slots }) {\n const isActive = useProxiedModel(props, 'modelValue')\n const { scopeId } = useScopeId()\n\n const uid = useId()\n const id = computed(() => props.id || `v-tooltip-${uid}`)\n\n const overlay = ref<VOverlay>()\n\n const location = computed(() => {\n return props.location.split(' ').length > 1\n ? props.location\n : props.location + ' center' as StrategyProps['location']\n })\n\n const origin = computed(() => {\n return (\n props.origin === 'auto' ||\n props.origin === 'overlap' ||\n props.origin.split(' ').length > 1 ||\n props.location.split(' ').length > 1\n ) ? props.origin\n : props.origin + ' center' as StrategyProps['origin']\n })\n\n const transition = computed(() => {\n if (props.transition) return props.transition\n return isActive.value ? 'scale-transition' : 'fade-transition'\n })\n\n const activatorProps = computed(() =>\n mergeProps({\n 'aria-describedby': id.value,\n }, props.activatorProps)\n )\n\n useRender(() => {\n const overlayProps = VOverlay.filterProps(props)\n\n return (\n <VOverlay\n ref={ overlay }\n class={[\n 'v-tooltip',\n props.class,\n ]}\n style={ props.style }\n id={ id.value }\n { ...overlayProps }\n v-model={ isActive.value }\n transition={ transition.value }\n absolute\n location={ location.value }\n origin={ origin.value }\n persistent\n role=\"tooltip\"\n activatorProps={ activatorProps.value }\n _disableGlobalStack\n { ...scopeId }\n >\n {{\n activator: slots.activator,\n default: (...args) => slots.default?.(...args) ?? props.text,\n }}\n </VOverlay>\n )\n })\n\n return forwardRefs({}, overlay)\n },\n})\n\nexport type VTooltip = InstanceType<typeof VTooltip>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,QAAQ;AAAA,SACRC,iBAAiB,o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CAACiB,KAAK,CACZ;QAAA,SACOjB,KAAK,CAACkB,KAAK;QAAA,MACdnC,EAAE,CAACmB;MAAK,GACRW,YAAY;QAAA,cACPP,QAAQ,CAACJ,KAAK;QAAA,uBAAAiB,MAAA,IAAdb,QAAQ,CAACJ,KAAK,GAAAiB,MAAA;QAAA,cACXtB,UAAU,CAACK,KAAK;QAAA;QAAA,YAElBf,QAAQ,CAACe,KAAK;QAAA,UAChBR,MAAM,CAACQ,KAAK;QAAA;QAAA;QAAA,kBAGJU,cAAc,CAACV,KAAK;QAAA;MAAA,GAEhCK,OAAO;QAGVa,SAAS,EAAEf,KAAK,CAACe,SAAS;QAC1BC,OAAO,EAAE,SAAAA,CAAA;UAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAZ,MAAA,EAAIa,IAAI,OAAAC,KAAA,CAAAH,IAAA,GAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;YAAJF,IAAI,CAAAE,IAAA,IAAAH,SAAA,CAAAG,IAAA;UAAA;UAAA,OAAKrB,KAAK,CAACgB,OAAO,GAAG,GAAGG,IAAI,CAAC,IAAIxB,KAAK,CAACf,IAAI;QAAA;MAAA;IAIpE,CAAC,CAAC;IAEF,OAAOd,WAAW,CAAC,CAAC,CAAC,EAAEsC,OAAO,CAAC;EACjC;AACF,CAAC,CAAC","ignoreList":[]}
@@ -33,22 +33,22 @@ interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions
33
33
  type ClassValue = any;
34
34
 
35
35
  interface GroupItem {
36
- id: number;
36
+ id: string;
37
37
  value: Ref<unknown>;
38
38
  disabled: Ref<boolean | undefined>;
39
39
  useIndexAsValue?: boolean;
40
40
  }
41
41
  interface GroupProvide {
42
42
  register: (item: GroupItem, cmp: ComponentInternalInstance) => void;
43
- unregister: (id: number) => void;
44
- select: (id: number, value: boolean) => void;
45
- selected: Ref<Readonly<number[]>>;
46
- isSelected: (id: number) => boolean;
43
+ unregister: (id: string) => void;
44
+ select: (id: string, value: boolean) => void;
45
+ selected: Ref<Readonly<string[]>>;
46
+ isSelected: (id: string) => boolean;
47
47
  prev: () => void;
48
48
  next: () => void;
49
49
  selectedClass: Ref<string | undefined>;
50
50
  items: ComputedRef<{
51
- id: number;
51
+ id: string;
52
52
  value: unknown;
53
53
  disabled: boolean | undefined;
54
54
  }[]>;
@@ -56,7 +56,7 @@ interface GroupProvide {
56
56
  getItemIndex: (value: unknown) => number;
57
57
  }
58
58
  interface GroupItemProvide {
59
- id: number;
59
+ id: string;
60
60
  isSelected: Ref<boolean>;
61
61
  isFirst: Ref<boolean>;
62
62
  isLast: Ref<boolean>;
@@ -1235,22 +1235,22 @@ declare const VClassIcon: {
1235
1235
  type VClassIcon = InstanceType<typeof VClassIcon>;
1236
1236
 
1237
1237
  interface GroupItem {
1238
- id: number;
1238
+ id: string;
1239
1239
  value: Ref<unknown>;
1240
1240
  disabled: Ref<boolean | undefined>;
1241
1241
  useIndexAsValue?: boolean;
1242
1242
  }
1243
1243
  interface GroupProvide {
1244
1244
  register: (item: GroupItem, cmp: ComponentInternalInstance) => void;
1245
- unregister: (id: number) => void;
1246
- select: (id: number, value: boolean) => void;
1247
- selected: Ref<Readonly<number[]>>;
1248
- isSelected: (id: number) => boolean;
1245
+ unregister: (id: string) => void;
1246
+ select: (id: string, value: boolean) => void;
1247
+ selected: Ref<Readonly<string[]>>;
1248
+ isSelected: (id: string) => boolean;
1249
1249
  prev: () => void;
1250
1250
  next: () => void;
1251
1251
  selectedClass: Ref<string | undefined>;
1252
1252
  items: ComputedRef<{
1253
- id: number;
1253
+ id: string;
1254
1254
  value: unknown;
1255
1255
  disabled: boolean | undefined;
1256
1256
  }[]>;
@@ -1258,7 +1258,7 @@ interface GroupProvide {
1258
1258
  getItemIndex: (value: unknown) => number;
1259
1259
  }
1260
1260
  interface GroupItemProvide {
1261
- id: number;
1261
+ id: string;
1262
1262
  isSelected: Ref<boolean>;
1263
1263
  isFirst: Ref<boolean>;
1264
1264
  isLast: Ref<boolean>;
@@ -5453,7 +5453,7 @@ declare const VMenu: {
5453
5453
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
5454
5454
  }, {
5455
5455
  id: vue.ComputedRef<string>;
5456
- ΨopenChildren: vue.ShallowRef<Set<number>, Set<number>>;
5456
+ ΨopenChildren: vue.ShallowRef<Set<string>, Set<string>>;
5457
5457
  } & Omit<Omit<{
5458
5458
  $: vue.ComponentInternalInstance;
5459
5459
  $data: {};
@@ -5866,7 +5866,7 @@ declare const VMenu: {
5866
5866
  updateLocation: vue.Ref<((e: Event) => void) | undefined, ((e: Event) => void) | undefined>;
5867
5867
  } | {
5868
5868
  id: vue.ComputedRef<string>;
5869
- ΨopenChildren: vue.ShallowRef<Set<number>, Set<number>>;
5869
+ ΨopenChildren: vue.ShallowRef<Set<string>, Set<string>>;
5870
5870
  };
5871
5871
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
5872
5872
  'update:modelValue': (value: boolean) => true;
@@ -5999,7 +5999,7 @@ declare const VMenu: {
5999
5999
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
6000
6000
  }, {
6001
6001
  id: vue.ComputedRef<string>;
6002
- ΨopenChildren: vue.ShallowRef<Set<number>, Set<number>>;
6002
+ ΨopenChildren: vue.ShallowRef<Set<string>, Set<string>>;
6003
6003
  } & Omit<Omit<{
6004
6004
  $: vue.ComponentInternalInstance;
6005
6005
  $data: {};
@@ -6412,7 +6412,7 @@ declare const VMenu: {
6412
6412
  updateLocation: vue.Ref<((e: Event) => void) | undefined, ((e: Event) => void) | undefined>;
6413
6413
  } | {
6414
6414
  id: vue.ComputedRef<string>;
6415
- ΨopenChildren: vue.ShallowRef<Set<number>, Set<number>>;
6415
+ ΨopenChildren: vue.ShallowRef<Set<string>, Set<string>>;
6416
6416
  };
6417
6417
  }, {}, {}, {}, {
6418
6418
  location: Anchor | undefined;
@@ -6531,7 +6531,7 @@ declare const VMenu: {
6531
6531
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
6532
6532
  }, {
6533
6533
  id: vue.ComputedRef<string>;
6534
- ΨopenChildren: vue.ShallowRef<Set<number>, Set<number>>;
6534
+ ΨopenChildren: vue.ShallowRef<Set<string>, Set<string>>;
6535
6535
  } & Omit<Omit<{
6536
6536
  $: vue.ComponentInternalInstance;
6537
6537
  $data: {};
@@ -6944,7 +6944,7 @@ declare const VMenu: {
6944
6944
  updateLocation: vue.Ref<((e: Event) => void) | undefined, ((e: Event) => void) | undefined>;
6945
6945
  } | {
6946
6946
  id: vue.ComputedRef<string>;
6947
- ΨopenChildren: vue.ShallowRef<Set<number>, Set<number>>;
6947
+ ΨopenChildren: vue.ShallowRef<Set<string>, Set<string>>;
6948
6948
  };
6949
6949
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
6950
6950
  'update:modelValue': (value: boolean) => true;
@@ -12022,7 +12022,7 @@ declare const VBtnToggle: {
12022
12022
  } & {}, {
12023
12023
  next: () => void;
12024
12024
  prev: () => void;
12025
- select: (id: number, value: boolean) => void;
12025
+ select: (id: string, value: boolean) => void;
12026
12026
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
12027
12027
  'update:modelValue': (value: any) => true;
12028
12028
  }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue">, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, {
@@ -12067,7 +12067,7 @@ declare const VBtnToggle: {
12067
12067
  } & {}, {
12068
12068
  next: () => void;
12069
12069
  prev: () => void;
12070
- select: (id: number, value: boolean) => void;
12070
+ select: (id: string, value: boolean) => void;
12071
12071
  }, {}, {}, {}, {
12072
12072
  variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
12073
12073
  style: vue.StyleValue;
@@ -12105,7 +12105,7 @@ declare const VBtnToggle: {
12105
12105
  } & {}, {
12106
12106
  next: () => void;
12107
12107
  prev: () => void;
12108
- select: (id: number, value: boolean) => void;
12108
+ select: (id: string, value: boolean) => void;
12109
12109
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
12110
12110
  'update:modelValue': (value: any) => true;
12111
12111
  }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue">, string, {
@@ -13470,7 +13470,7 @@ type VCarouselSlots = VWindowSlots & {
13470
13470
  item: {
13471
13471
  props: Record<string, any>;
13472
13472
  item: {
13473
- id: number;
13473
+ id: string;
13474
13474
  value: unknown;
13475
13475
  disabled: boolean | undefined;
13476
13476
  };
@@ -13549,7 +13549,7 @@ declare const VCarousel: {
13549
13549
  item: (arg: {
13550
13550
  props: Record<string, any>;
13551
13551
  item: {
13552
- id: number;
13552
+ id: string;
13553
13553
  value: unknown;
13554
13554
  disabled: boolean | undefined;
13555
13555
  };
@@ -13681,7 +13681,7 @@ declare const VCarousel: {
13681
13681
  item: (arg: {
13682
13682
  props: Record<string, any>;
13683
13683
  item: {
13684
- id: number;
13684
+ id: string;
13685
13685
  value: unknown;
13686
13686
  disabled: boolean | undefined;
13687
13687
  };
@@ -16480,11 +16480,11 @@ interface FormProps {
16480
16480
 
16481
16481
  type VChipGroupSlots = {
16482
16482
  default: {
16483
- isSelected: (id: number) => boolean;
16484
- select: (id: number, value: boolean) => void;
16483
+ isSelected: (id: string) => boolean;
16484
+ select: (id: string, value: boolean) => void;
16485
16485
  next: () => void;
16486
16486
  prev: () => void;
16487
- selected: readonly number[];
16487
+ selected: readonly string[];
16488
16488
  };
16489
16489
  };
16490
16490
  declare const VChipGroup: {
@@ -16533,11 +16533,11 @@ declare const VChipGroup: {
16533
16533
  prevIcon: IconValue;
16534
16534
  }, true, {}, vue.SlotsType<Partial<{
16535
16535
  default: (arg: {
16536
- isSelected: (id: number) => boolean;
16537
- select: (id: number, value: boolean) => void;
16536
+ isSelected: (id: string) => boolean;
16537
+ select: (id: string, value: boolean) => void;
16538
16538
  next: () => void;
16539
16539
  prev: () => void;
16540
- selected: readonly number[];
16540
+ selected: readonly string[];
16541
16541
  }) => vue.VNode[];
16542
16542
  }>>, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
16543
16543
  P: {};
@@ -16636,11 +16636,11 @@ declare const VChipGroup: {
16636
16636
  prevIcon: IconValue;
16637
16637
  }, {}, string, vue.SlotsType<Partial<{
16638
16638
  default: (arg: {
16639
- isSelected: (id: number) => boolean;
16640
- select: (id: number, value: boolean) => void;
16639
+ isSelected: (id: string) => boolean;
16640
+ select: (id: string, value: boolean) => void;
16641
16641
  next: () => void;
16642
16642
  prev: () => void;
16643
- selected: readonly number[];
16643
+ selected: readonly string[];
16644
16644
  }) => vue.VNode[];
16645
16645
  }>>, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T>(props: {
16646
16646
  modelValue?: T;
@@ -32683,11 +32683,11 @@ type VInfiniteScroll = InstanceType<typeof VInfiniteScroll>;
32683
32683
 
32684
32684
  type VItemGroupSlots = {
32685
32685
  default: {
32686
- isSelected: (id: number) => boolean;
32687
- select: (id: number, value: boolean) => void;
32686
+ isSelected: (id: string) => boolean;
32687
+ select: (id: string, value: boolean) => void;
32688
32688
  next: () => void;
32689
32689
  prev: () => void;
32690
- selected: readonly number[];
32690
+ selected: readonly string[];
32691
32691
  };
32692
32692
  };
32693
32693
  declare const VItemGroup: {
@@ -32712,11 +32712,11 @@ declare const VItemGroup: {
32712
32712
  selectedClass: string;
32713
32713
  }, true, {}, vue.SlotsType<Partial<{
32714
32714
  default: (arg: {
32715
- isSelected: (id: number) => boolean;
32716
- select: (id: number, value: boolean) => void;
32715
+ isSelected: (id: string) => boolean;
32716
+ select: (id: string, value: boolean) => void;
32717
32717
  next: () => void;
32718
32718
  prev: () => void;
32719
- selected: readonly number[];
32719
+ selected: readonly string[];
32720
32720
  }) => vue.VNode[];
32721
32721
  }>>, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
32722
32722
  P: {};
@@ -32767,11 +32767,11 @@ declare const VItemGroup: {
32767
32767
  selectedClass: string;
32768
32768
  }, {}, string, vue.SlotsType<Partial<{
32769
32769
  default: (arg: {
32770
- isSelected: (id: number) => boolean;
32771
- select: (id: number, value: boolean) => void;
32770
+ isSelected: (id: string) => boolean;
32771
+ select: (id: string, value: boolean) => void;
32772
32772
  next: () => void;
32773
32773
  prev: () => void;
32774
- selected: readonly number[];
32774
+ selected: readonly string[];
32775
32775
  }) => vue.VNode[];
32776
32776
  }>>, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T>(props: {
32777
32777
  modelValue?: T;
@@ -40569,7 +40569,7 @@ declare const VSlideGroup: {
40569
40569
  mobileBreakpoint?: number | DisplayBreakpoint | undefined;
40570
40570
  showArrows?: string | boolean | undefined;
40571
40571
  } & {}, {
40572
- selected: vue.Ref<readonly number[], readonly number[]>;
40572
+ selected: vue.Ref<readonly string[], readonly string[]>;
40573
40573
  scrollTo: (location: "prev" | "next") => void;
40574
40574
  scrollOffset: vue.ShallowRef<number, number>;
40575
40575
  focus: (location?: "next" | "prev" | "first" | "last") => void;
@@ -40619,7 +40619,7 @@ declare const VSlideGroup: {
40619
40619
  mobileBreakpoint?: number | DisplayBreakpoint | undefined;
40620
40620
  showArrows?: string | boolean | undefined;
40621
40621
  } & {}, {
40622
- selected: vue.Ref<readonly number[], readonly number[]>;
40622
+ selected: vue.Ref<readonly string[], readonly string[]>;
40623
40623
  scrollTo: (location: "prev" | "next") => void;
40624
40624
  scrollOffset: vue.ShallowRef<number, number>;
40625
40625
  focus: (location?: "next" | "prev" | "first" | "last") => void;
@@ -40660,7 +40660,7 @@ declare const VSlideGroup: {
40660
40660
  mobileBreakpoint?: number | DisplayBreakpoint | undefined;
40661
40661
  showArrows?: string | boolean | undefined;
40662
40662
  } & {}, {
40663
- selected: vue.Ref<readonly number[], readonly number[]>;
40663
+ selected: vue.Ref<readonly string[], readonly string[]>;
40664
40664
  scrollTo: (location: "prev" | "next") => void;
40665
40665
  scrollOffset: vue.ShallowRef<number, number>;
40666
40666
  focus: (location?: "next" | "prev" | "first" | "last") => void;
@@ -1,7 +1,7 @@
1
1
  // Composables
2
2
  import { useProxiedModel } from "./proxiedModel.mjs"; // Utilities
3
- import { computed, inject, onBeforeUnmount, onMounted, onUpdated, provide, reactive, toRef, unref, watch } from 'vue';
4
- import { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from "../util/index.mjs"; // Types
3
+ import { computed, inject, onBeforeUnmount, onMounted, onUpdated, provide, reactive, toRef, unref, useId, watch } from 'vue';
4
+ import { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, propsFactory, wrapInArray } from "../util/index.mjs"; // Types
5
5
  export const makeGroupProps = propsFactory({
6
6
  modelValue: {
7
7
  type: null,
@@ -27,7 +27,7 @@ export function useGroupItem(props, injectKey) {
27
27
  if (!vm) {
28
28
  throw new Error('[Vuetify] useGroupItem composable must be used inside a component setup function');
29
29
  }
30
- const id = getUid();
30
+ const id = useId();
31
31
  provide(Symbol.for(`${injectKey.description}:id`), id);
32
32
  const group = inject(injectKey, null);
33
33
  if (!group) {
@@ -1 +1 @@
1
- {"version":3,"file":"group.mjs","names":["useProxiedModel","computed","inject","onBeforeUnmount","onMounted","onUpdated","provide","reactive","toRef","unref","watch","consoleWarn","deepEqual","findChildrenWithProvide","getCurrentInstance","getUid","propsFactory","wrapInArray","makeGroupProps","modelValue","type","default","undefined","multiple","Boolean","mandatory","String","max","Number","selectedClass","disabled","makeGroupItemProps","value","useGroupItem","props","injectKey","required","arguments","length","vm","Error","id","Symbol","for","description","group","register","unregister","isSelected","isFirst","items","isLast","emit","flush","toggle","select","useGroup","isUnmounted","selected","v","getIds","arr","getValues","groupVm","item","unwrapped","key","children","vnode","index","indexOf","useIndexAsValue","splice","push","forceMandatoryValue","findIndex","find","i","internalValue","slice","includes","step","offset","currentId","currentIndex","newIndex","newItem","state","prev","next","getItemIndex","ids","forEach","itemByIndex","values","itemIndex"],"sources":["../../src/composables/group.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from './proxiedModel'\n\n// Utilities\nimport { computed, inject, onBeforeUnmount, onMounted, onUpdated, provide, reactive, toRef, unref, watch } from 'vue'\nimport { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { ComponentInternalInstance, ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref, UnwrapRef } from 'vue'\nimport type { EventProp } from '@/util'\n\nexport interface GroupItem {\n id: number\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n useIndexAsValue?: boolean\n}\n\nexport interface GroupProps {\n disabled: boolean\n modelValue: unknown\n multiple?: boolean\n mandatory?: boolean | 'force' | undefined\n max?: number | undefined\n selectedClass: string | undefined\n 'onUpdate:modelValue': EventProp<[unknown]> | undefined\n}\n\nexport interface GroupProvide {\n register: (item: GroupItem, cmp: ComponentInternalInstance) => void\n unregister: (id: number) => void\n select: (id: number, value: boolean) => void\n selected: Ref<Readonly<number[]>>\n isSelected: (id: number) => boolean\n prev: () => void\n next: () => void\n selectedClass: Ref<string | undefined>\n items: ComputedRef<{\n id: number\n value: unknown\n disabled: boolean | undefined\n }[]>\n disabled: Ref<boolean | undefined>\n getItemIndex: (value: unknown) => number\n}\n\nexport interface GroupItemProvide {\n id: number\n isSelected: Ref<boolean>\n isFirst: Ref<boolean>\n isLast: Ref<boolean>\n toggle: () => void\n select: (value: boolean) => void\n selectedClass: Ref<(string | undefined)[] | false>\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n group: GroupProvide\n}\n\nexport const makeGroupProps = propsFactory({\n modelValue: {\n type: null,\n default: undefined,\n },\n multiple: Boolean,\n mandatory: [Boolean, String] as PropType<boolean | 'force'>,\n max: Number,\n selectedClass: String,\n disabled: Boolean,\n}, 'group')\n\nexport const makeGroupItemProps = propsFactory({\n value: null,\n disabled: Boolean,\n selectedClass: String,\n}, 'group-item')\n\nexport interface GroupItemProps extends ExtractPropTypes<ReturnType<typeof makeGroupItemProps>> {\n 'onGroup:selected': EventProp<[{ value: boolean }]> | undefined\n}\n\n// Composables\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required?: true,\n): GroupItemProvide\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required: false,\n): GroupItemProvide | null\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required = true,\n): GroupItemProvide | null {\n const vm = getCurrentInstance('useGroupItem')\n\n if (!vm) {\n throw new Error(\n '[Vuetify] useGroupItem composable must be used inside a component setup function'\n )\n }\n\n const id = getUid()\n\n provide(Symbol.for(`${injectKey.description}:id`), id)\n\n const group = inject(injectKey, null)\n\n if (!group) {\n if (!required) return group\n\n throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`)\n }\n\n const value = toRef(props, 'value')\n const disabled = computed(() => !!(group.disabled.value || props.disabled))\n\n group.register({\n id,\n value,\n disabled,\n }, vm)\n\n onBeforeUnmount(() => {\n group.unregister(id)\n })\n\n const isSelected = computed(() => {\n return group.isSelected(id)\n })\n const isFirst = computed(() => {\n return group.items.value[0].id === id\n })\n const isLast = computed(() => {\n return group.items.value[group.items.value.length - 1].id === id\n })\n\n const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass])\n\n watch(isSelected, value => {\n vm.emit('group:selected', { value })\n }, { flush: 'sync' })\n\n return {\n id,\n isSelected,\n isFirst,\n isLast,\n toggle: () => group.select(id, !isSelected.value),\n select: (value: boolean) => group.select(id, value),\n selectedClass,\n value,\n disabled,\n group,\n }\n}\n\nexport function useGroup (\n props: GroupProps,\n injectKey: InjectionKey<GroupProvide>\n) {\n let isUnmounted = false\n const items = reactive<GroupItem[]>([])\n const selected = useProxiedModel(\n props,\n 'modelValue',\n [],\n v => {\n if (v == null) return []\n\n return getIds(items, wrapInArray(v))\n },\n v => {\n const arr = getValues(items, v)\n\n return props.multiple ? arr : arr[0]\n }\n )\n\n const groupVm = getCurrentInstance('useGroup')\n\n function register (item: GroupItem, vm: ComponentInternalInstance) {\n // Is there a better way to fix this typing?\n const unwrapped = item as unknown as UnwrapRef<GroupItem>\n\n const key = Symbol.for(`${injectKey.description}:id`)\n const children = findChildrenWithProvide(key, groupVm?.vnode)\n const index = children.indexOf(vm)\n\n if (unref(unwrapped.value) == null) {\n unwrapped.value = index\n unwrapped.useIndexAsValue = true\n }\n\n if (index > -1) {\n items.splice(index, 0, unwrapped)\n } else {\n items.push(unwrapped)\n }\n }\n\n function unregister (id: number) {\n if (isUnmounted) return\n\n // TODO: re-evaluate this line's importance in the future\n // should we only modify the model if mandatory is set.\n // selected.value = selected.value.filter(v => v !== id)\n\n forceMandatoryValue()\n\n const index = items.findIndex(item => item.id === id)\n items.splice(index, 1)\n }\n\n // If mandatory and nothing is selected, then select first non-disabled item\n function forceMandatoryValue () {\n const item = items.find(item => !item.disabled)\n if (item && props.mandatory === 'force' && !selected.value.length) {\n selected.value = [item.id]\n }\n }\n\n onMounted(() => {\n forceMandatoryValue()\n })\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n onUpdated(() => {\n // #19655 update the items that use the index as the value.\n for (let i = 0; i < items.length; i++) {\n if (items[i].useIndexAsValue) {\n items[i].value = i\n }\n }\n })\n\n function select (id: number, value?: boolean) {\n const item = items.find(item => item.id === id)\n if (value && item?.disabled) return\n\n if (props.multiple) {\n const internalValue = selected.value.slice()\n const index = internalValue.findIndex(v => v === id)\n const isSelected = ~index\n value = value ?? !isSelected\n\n // We can't remove value if group is\n // mandatory, value already exists,\n // and it is the only value\n if (\n isSelected &&\n props.mandatory &&\n internalValue.length <= 1\n ) return\n\n // We can't add value if it would\n // cause max limit to be exceeded\n if (\n !isSelected &&\n props.max != null &&\n internalValue.length + 1 > props.max\n ) return\n\n if (index < 0 && value) internalValue.push(id)\n else if (index >= 0 && !value) internalValue.splice(index, 1)\n\n selected.value = internalValue\n } else {\n const isSelected = selected.value.includes(id)\n if (props.mandatory && isSelected) return\n\n selected.value = (value ?? !isSelected) ? [id] : []\n }\n }\n\n function step (offset: number) {\n // getting an offset from selected value obviously won't work with multiple values\n if (props.multiple) consoleWarn('This method is not supported when using \"multiple\" prop')\n\n if (!selected.value.length) {\n const item = items.find(item => !item.disabled)\n item && (selected.value = [item.id])\n } else {\n const currentId = selected.value[0]\n const currentIndex = items.findIndex(i => i.id === currentId)\n\n let newIndex = (currentIndex + offset) % items.length\n let newItem = items[newIndex]\n\n while (newItem.disabled && newIndex !== currentIndex) {\n newIndex = (newIndex + offset) % items.length\n newItem = items[newIndex]\n }\n\n if (newItem.disabled) return\n\n selected.value = [items[newIndex].id]\n }\n }\n\n const state: GroupProvide = {\n register,\n unregister,\n selected,\n select,\n disabled: toRef(props, 'disabled'),\n prev: () => step(items.length - 1),\n next: () => step(1),\n isSelected: (id: number) => selected.value.includes(id),\n selectedClass: computed(() => props.selectedClass),\n items: computed(() => items),\n getItemIndex: (value: unknown) => getItemIndex(items, value),\n }\n\n provide(injectKey, state)\n\n return state\n}\n\nfunction getItemIndex (items: UnwrapRef<GroupItem[]>, value: unknown) {\n const ids = getIds(items, [value])\n\n if (!ids.length) return -1\n\n return items.findIndex(item => item.id === ids[0])\n}\n\nfunction getIds (items: UnwrapRef<GroupItem[]>, modelValue: any[]) {\n const ids: number[] = []\n\n modelValue.forEach(value => {\n const item = items.find(item => deepEqual(value, item.value))\n const itemByIndex = items[value]\n\n if (item?.value != null) {\n ids.push(item.id)\n } else if (itemByIndex != null) {\n ids.push(itemByIndex.id)\n }\n })\n\n return ids\n}\n\nfunction getValues (items: UnwrapRef<GroupItem[]>, ids: any[]) {\n const values: unknown[] = []\n\n ids.forEach(id => {\n const itemIndex = items.findIndex(item => item.id === id)\n if (~itemIndex) {\n const item = items[itemIndex]\n values.push(item.value != null ? item.value : itemIndex)\n }\n })\n\n return values\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,8BAExB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,eAAe,EAAEC,SAAS,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5GC,WAAW,EAAEC,SAAS,EAAEC,uBAAuB,EAAEC,kBAAkB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,WAAW,6BAE/G;AAoDA,OAAO,MAAMC,cAAc,GAAGF,YAAY,CAAC;EACzCG,UAAU,EAAE;IACVC,IAAI,EAAE,IAAI;IACVC,OAAO,EAAEC;EACX,CAAC;EACDC,QAAQ,EAAEC,OAAO;EACjBC,SAAS,EAAE,CAACD,OAAO,EAAEE,MAAM,CAAgC;EAC3DC,GAAG,EAAEC,MAAM;EACXC,aAAa,EAAEH,MAAM;EACrBI,QAAQ,EAAEN;AACZ,CAAC,EAAE,OAAO,CAAC;AAEX,OAAO,MAAMO,kBAAkB,GAAGf,YAAY,CAAC;EAC7CgB,KAAK,EAAE,IAAI;EACXF,QAAQ,EAAEN,OAAO;EACjBK,aAAa,EAAEH;AACjB,CAAC,EAAE,YAAY,CAAC;;AAMhB;;AAWA,OAAO,SAASO,YAAYA,CAC1BC,KAAqB,EACrBC,SAAqC,EAEZ;EAAA,IADzBC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAf,SAAA,GAAAe,SAAA,MAAG,IAAI;EAEf,MAAME,EAAE,GAAGzB,kBAAkB,CAAC,cAAc,CAAC;EAE7C,IAAI,CAACyB,EAAE,EAAE;IACP,MAAM,IAAIC,KAAK,CACb,kFACF,CAAC;EACH;EAEA,MAAMC,EAAE,GAAG1B,MAAM,CAAC,CAAC;EAEnBT,OAAO,CAACoC,MAAM,CA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AAS/B,MAAMA,CAAEV,KAA6B,EAAE/B,UAAiB,EAAE;EACjE,MAAMwE,GAAa,GAAG,EAAE;EAExBxE,UAAU,CAACyE,OAAO,CAAC5D,KAAK,IAAI;IAC1B,MAAMgC,IAAI,GAAGd,KAAK,CAAC0B,IAAI,CAACZ,IAAI,IAAIpD,SAAS,CAACoB,KAAK,EAAEgC,IAAI,CAAChC,KAAK,CAAC,CAAC;IAC7D,MAAM6D,WAAW,GAAG3C,KAAK,CAAClB,KAAK,CAAC;IAEhC,IAAIgC,IAAI,EAAEhC,KAAK,IAAI,IAAI,EAAE;MACvB2D,GAAG,CAAClB,IAAI,CAACT,IAAI,CAACvB,EAAE,CAAC;IACnB,CAAC,MAAM,IAAIoD,WAAW,IAAI,IAAI,EAAE;MAC9BF,GAAG,CAAClB,IAAI,CAACoB,WAAW,CAACpD,EAAE,CAAC;IAC1B;EACF,CAAC,CAAC;EAEF,OAAOkD,GAAG;AACZ;AAEA,SAAS7B,SAASA,CAAEZ,KAA6B,EAAEyC,GAAU,EAAE;EAC7D,MAAMG,MAAiB,GAAG,EAAE;EAE5BH,GAAG,CAACC,OAAO,CAACnD,EAAE,IAAI;IAChB,MAAMsD,SAAS,GAAG7C,KAAK,CAACyB,SAAS,CAACX,IAAI,IAAIA,IAAI,CAACvB,EAAE,KAAKA,EAAE,CAAC;IACzD,IAAI,CAACsD,SAAS,EAAE;MACd,MAAM/B,IAAI,GAAGd,KAAK,CAAC6C,SAAS,CAAC;MAC7BD,MAAM,CAACrB,IAAI,CAACT,IAAI,CAAChC,KAAK,IAAI,IAAI,GAAGgC,IAAI,CAAChC,KAAK,GAAG+D,SAAS,CAAC;IAC1D;EACF,CAAC,CAAC;EAEF,OAAOD,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"group.mjs","names":["useProxiedModel","computed","inject","onBeforeUnmount","onMounted","onUpdated","provide","reactive","toRef","unref","useId","watch","consoleWarn","deepEqual","findChildrenWithProvide","getCurrentInstance","propsFactory","wrapInArray","makeGroupProps","modelValue","type","default","undefined","multiple","Boolean","mandatory","String","max","Number","selectedClass","disabled","makeGroupItemProps","value","useGroupItem","props","injectKey","required","arguments","length","vm","Error","id","Symbol","for","description","group","register","unregister","isSelected","isFirst","items","isLast","emit","flush","toggle","select","useGroup","isUnmounted","selected","v","getIds","arr","getValues","groupVm","item","unwrapped","key","children","vnode","index","indexOf","useIndexAsValue","splice","push","forceMandatoryValue","findIndex","find","i","internalValue","slice","includes","step","offset","currentId","currentIndex","newIndex","newItem","state","prev","next","getItemIndex","ids","forEach","itemByIndex","values","itemIndex"],"sources":["../../src/composables/group.ts"],"sourcesContent":["// Composables\nimport { useProxiedModel } from './proxiedModel'\n\n// Utilities\nimport { computed, inject, onBeforeUnmount, onMounted, onUpdated, provide, reactive, toRef, unref, useId, watch } from 'vue'\nimport { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, propsFactory, wrapInArray } from '@/util'\n\n// Types\nimport type { ComponentInternalInstance, ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref, UnwrapRef } from 'vue'\nimport type { EventProp } from '@/util'\n\nexport interface GroupItem {\n id: string\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n useIndexAsValue?: boolean\n}\n\nexport interface GroupProps {\n disabled: boolean\n modelValue: unknown\n multiple?: boolean\n mandatory?: boolean | 'force' | undefined\n max?: number | undefined\n selectedClass: string | undefined\n 'onUpdate:modelValue': EventProp<[unknown]> | undefined\n}\n\nexport interface GroupProvide {\n register: (item: GroupItem, cmp: ComponentInternalInstance) => void\n unregister: (id: string) => void\n select: (id: string, value: boolean) => void\n selected: Ref<Readonly<string[]>>\n isSelected: (id: string) => boolean\n prev: () => void\n next: () => void\n selectedClass: Ref<string | undefined>\n items: ComputedRef<{\n id: string\n value: unknown\n disabled: boolean | undefined\n }[]>\n disabled: Ref<boolean | undefined>\n getItemIndex: (value: unknown) => number\n}\n\nexport interface GroupItemProvide {\n id: string\n isSelected: Ref<boolean>\n isFirst: Ref<boolean>\n isLast: Ref<boolean>\n toggle: () => void\n select: (value: boolean) => void\n selectedClass: Ref<(string | undefined)[] | false>\n value: Ref<unknown>\n disabled: Ref<boolean | undefined>\n group: GroupProvide\n}\n\nexport const makeGroupProps = propsFactory({\n modelValue: {\n type: null,\n default: undefined,\n },\n multiple: Boolean,\n mandatory: [Boolean, String] as PropType<boolean | 'force'>,\n max: Number,\n selectedClass: String,\n disabled: Boolean,\n}, 'group')\n\nexport const makeGroupItemProps = propsFactory({\n value: null,\n disabled: Boolean,\n selectedClass: String,\n}, 'group-item')\n\nexport interface GroupItemProps extends ExtractPropTypes<ReturnType<typeof makeGroupItemProps>> {\n 'onGroup:selected': EventProp<[{ value: boolean }]> | undefined\n}\n\n// Composables\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required?: true,\n): GroupItemProvide\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required: false,\n): GroupItemProvide | null\nexport function useGroupItem (\n props: GroupItemProps,\n injectKey: InjectionKey<GroupProvide>,\n required = true,\n): GroupItemProvide | null {\n const vm = getCurrentInstance('useGroupItem')\n\n if (!vm) {\n throw new Error(\n '[Vuetify] useGroupItem composable must be used inside a component setup function'\n )\n }\n\n const id = useId()\n\n provide(Symbol.for(`${injectKey.description}:id`), id)\n\n const group = inject(injectKey, null)\n\n if (!group) {\n if (!required) return group\n\n throw new Error(`[Vuetify] Could not find useGroup injection with symbol ${injectKey.description}`)\n }\n\n const value = toRef(props, 'value')\n const disabled = computed(() => !!(group.disabled.value || props.disabled))\n\n group.register({\n id,\n value,\n disabled,\n }, vm)\n\n onBeforeUnmount(() => {\n group.unregister(id)\n })\n\n const isSelected = computed(() => {\n return group.isSelected(id)\n })\n const isFirst = computed(() => {\n return group.items.value[0].id === id\n })\n const isLast = computed(() => {\n return group.items.value[group.items.value.length - 1].id === id\n })\n\n const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass])\n\n watch(isSelected, value => {\n vm.emit('group:selected', { value })\n }, { flush: 'sync' })\n\n return {\n id,\n isSelected,\n isFirst,\n isLast,\n toggle: () => group.select(id, !isSelected.value),\n select: (value: boolean) => group.select(id, value),\n selectedClass,\n value,\n disabled,\n group,\n }\n}\n\nexport function useGroup (\n props: GroupProps,\n injectKey: InjectionKey<GroupProvide>\n) {\n let isUnmounted = false\n const items = reactive<GroupItem[]>([])\n const selected = useProxiedModel(\n props,\n 'modelValue',\n [],\n v => {\n if (v == null) return []\n\n return getIds(items, wrapInArray(v))\n },\n v => {\n const arr = getValues(items, v)\n\n return props.multiple ? arr : arr[0]\n }\n )\n\n const groupVm = getCurrentInstance('useGroup')\n\n function register (item: GroupItem, vm: ComponentInternalInstance) {\n // Is there a better way to fix this typing?\n const unwrapped = item as unknown as UnwrapRef<GroupItem>\n\n const key = Symbol.for(`${injectKey.description}:id`)\n const children = findChildrenWithProvide(key, groupVm?.vnode)\n const index = children.indexOf(vm)\n\n if (unref(unwrapped.value) == null) {\n unwrapped.value = index\n unwrapped.useIndexAsValue = true\n }\n\n if (index > -1) {\n items.splice(index, 0, unwrapped)\n } else {\n items.push(unwrapped)\n }\n }\n\n function unregister (id: string) {\n if (isUnmounted) return\n\n // TODO: re-evaluate this line's importance in the future\n // should we only modify the model if mandatory is set.\n // selected.value = selected.value.filter(v => v !== id)\n\n forceMandatoryValue()\n\n const index = items.findIndex(item => item.id === id)\n items.splice(index, 1)\n }\n\n // If mandatory and nothing is selected, then select first non-disabled item\n function forceMandatoryValue () {\n const item = items.find(item => !item.disabled)\n if (item && props.mandatory === 'force' && !selected.value.length) {\n selected.value = [item.id]\n }\n }\n\n onMounted(() => {\n forceMandatoryValue()\n })\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n onUpdated(() => {\n // #19655 update the items that use the index as the value.\n for (let i = 0; i < items.length; i++) {\n if (items[i].useIndexAsValue) {\n items[i].value = i\n }\n }\n })\n\n function select (id: string, value?: boolean) {\n const item = items.find(item => item.id === id)\n if (value && item?.disabled) return\n\n if (props.multiple) {\n const internalValue = selected.value.slice()\n const index = internalValue.findIndex(v => v === id)\n const isSelected = ~index\n value = value ?? !isSelected\n\n // We can't remove value if group is\n // mandatory, value already exists,\n // and it is the only value\n if (\n isSelected &&\n props.mandatory &&\n internalValue.length <= 1\n ) return\n\n // We can't add value if it would\n // cause max limit to be exceeded\n if (\n !isSelected &&\n props.max != null &&\n internalValue.length + 1 > props.max\n ) return\n\n if (index < 0 && value) internalValue.push(id)\n else if (index >= 0 && !value) internalValue.splice(index, 1)\n\n selected.value = internalValue\n } else {\n const isSelected = selected.value.includes(id)\n if (props.mandatory && isSelected) return\n\n selected.value = (value ?? !isSelected) ? [id] : []\n }\n }\n\n function step (offset: number) {\n // getting an offset from selected value obviously won't work with multiple values\n if (props.multiple) consoleWarn('This method is not supported when using \"multiple\" prop')\n\n if (!selected.value.length) {\n const item = items.find(item => !item.disabled)\n item && (selected.value = [item.id])\n } else {\n const currentId = selected.value[0]\n const currentIndex = items.findIndex(i => i.id === currentId)\n\n let newIndex = (currentIndex + offset) % items.length\n let newItem = items[newIndex]\n\n while (newItem.disabled && newIndex !== currentIndex) {\n newIndex = (newIndex + offset) % items.length\n newItem = items[newIndex]\n }\n\n if (newItem.disabled) return\n\n selected.value = [items[newIndex].id]\n }\n }\n\n const state: GroupProvide = {\n register,\n unregister,\n selected,\n select,\n disabled: toRef(props, 'disabled'),\n prev: () => step(items.length - 1),\n next: () => step(1),\n isSelected: (id: string) => selected.value.includes(id),\n selectedClass: computed(() => props.selectedClass),\n items: computed(() => items),\n getItemIndex: (value: unknown) => getItemIndex(items, value),\n }\n\n provide(injectKey, state)\n\n return state\n}\n\nfunction getItemIndex (items: UnwrapRef<GroupItem[]>, value: unknown) {\n const ids = getIds(items, [value])\n\n if (!ids.length) return -1\n\n return items.findIndex(item => item.id === ids[0])\n}\n\nfunction getIds (items: UnwrapRef<GroupItem[]>, modelValue: any[]) {\n const ids: string[] = []\n\n modelValue.forEach(value => {\n const item = items.find(item => deepEqual(value, item.value))\n const itemByIndex = items[value]\n\n if (item?.value != null) {\n ids.push(item.id)\n } else if (itemByIndex != null) {\n ids.push(itemByIndex.id)\n }\n })\n\n return ids\n}\n\nfunction getValues (items: UnwrapRef<GroupItem[]>, ids: any[]) {\n const values: unknown[] = []\n\n ids.forEach(id => {\n const itemIndex = items.findIndex(item => item.id === id)\n if (~itemIndex) {\n const item = items[itemIndex]\n values.push(item.value != null ? item.value : itemIndex)\n }\n })\n\n return values\n}\n"],"mappings":"AAAA;AAAA,SACSA,eAAe,8BAExB;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,eAAe,EAAEC,SAAS,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACnHC,WAAW,EAAEC,SAAS,EAAEC,uBAAuB,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,WAAW,6BAEvG;AAoDA,OAAO,MAAMC,cAAc,GAAGF,YAAY,CAAC;EACzCG,UAAU,EAAE;IACVC,IAAI,EAAE,IAAI;IACVC,OAAO,EAAEC;EACX,CAAC;EACDC,QAAQ,EAAEC,OAAO;EACjBC,SAAS,EAAE,CAACD,OAAO,EAAEE,MAAM,CAAgC;EAC3DC,GAAG,EAAEC,MAAM;EACXC,aAAa,EAAEH,MAAM;EACrBI,QAAQ,EAAEN;AACZ,CAAC,EAAE,OAAO,CAAC;AAEX,OAAO,MAAMO,kBAAkB,GAAGf,YAAY,CAAC;EAC7CgB,KAAK,EAAE,IAAI;EACXF,QAAQ,EAAEN,OAAO;EACjBK,aAAa,EAAEH;AACjB,CAAC,EAAE,YAAY,CAAC;;AAMhB;;AAWA,OAAO,SAASO,YAAYA,CAC1BC,KAAqB,EACrBC,SAAqC,EAEZ;EAAA,IADzBC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAf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I,CAAChC,KAAK,GAAG+D,SAAS,CAAC;IAC1D;EACF,CAAC,CAAC;EAEF,OAAOD,MAAM;AACf","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  // Composables
2
2
  import { useResizeObserver } from "./resizeObserver.mjs"; // Utilities
3
- import { computed, inject, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, reactive, ref, shallowRef } from 'vue';
4
- import { convertToUnit, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory } from "../util/index.mjs"; // Types
3
+ import { computed, inject, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, reactive, ref, shallowRef, useId } from 'vue';
4
+ import { convertToUnit, findChildrenWithProvide, getCurrentInstance, propsFactory } from "../util/index.mjs"; // Types
5
5
  export const VuetifyLayoutKey = Symbol.for('vuetify:layout');
6
6
  export const VuetifyLayoutItemKey = Symbol.for('vuetify:layout-item');
7
7
  const ROOT_ZINDEX = 1000;
@@ -36,7 +36,7 @@ export function useLayout() {
36
36
  export function useLayoutItem(options) {
37
37
  const layout = inject(VuetifyLayoutKey);
38
38
  if (!layout) throw new Error('[Vuetify] Could not find injected layout');
39
- const id = options.id ?? `layout-item-${getUid()}`;
39
+ const id = options.id ?? `layout-item-${useId()}`;
40
40
  const vm = getCurrentInstance('useLayoutItem');
41
41
  provide(VuetifyLayoutItemKey, {
42
42
  id