@leaflink/stash 53.4.5 → 53.4.7

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 (62) hide show
  1. package/dist/AppSidebar.js +43 -41
  2. package/dist/AppSidebar.js.map +1 -1
  3. package/dist/AppTopbar.js +1 -1
  4. package/dist/Copy.js +1 -1
  5. package/dist/DataTable/index.js +2400 -0
  6. package/dist/DataTable/index.js.map +1 -0
  7. package/dist/DataViewFilters.js +1 -1
  8. package/dist/DataViewFilters.js.map +1 -1
  9. package/dist/DataViewToolbar.js +139 -125
  10. package/dist/DataViewToolbar.js.map +1 -1
  11. package/dist/DatePicker.js +1114 -1113
  12. package/dist/DatePicker.js.map +1 -1
  13. package/dist/Modal.js +104 -90
  14. package/dist/Modal.js.map +1 -1
  15. package/dist/MoreActions.js +294 -288
  16. package/dist/MoreActions.js.map +1 -1
  17. package/dist/PageNavigation.js +1 -1
  18. package/dist/RadioGroup.js +69 -62
  19. package/dist/RadioGroup.js.map +1 -1
  20. package/dist/Select.js +90 -90
  21. package/dist/Select.js.map +1 -1
  22. package/dist/Stepper.js +1 -1
  23. package/dist/Tab.js +1 -1
  24. package/dist/Table.js +36 -36
  25. package/dist/Table.js.map +1 -1
  26. package/dist/Table.vue.d.ts +12 -0
  27. package/dist/TableCell.js +17 -17
  28. package/dist/TableCell.js.map +1 -1
  29. package/dist/TableHeaderCell.js +44 -38
  30. package/dist/TableHeaderCell.js.map +1 -1
  31. package/dist/TableHeaderCell.vue.d.ts +10 -0
  32. package/dist/TableHeaderRow.js +32 -32
  33. package/dist/TableHeaderRow.js.map +1 -1
  34. package/dist/TableRow.js +82 -74
  35. package/dist/TableRow.js.map +1 -1
  36. package/dist/TableRow.vue.d.ts +9 -2
  37. package/dist/Tabs.js +2 -2
  38. package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js +131 -0
  39. package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js.map +1 -0
  40. package/dist/Thumbnail.js +42 -42
  41. package/dist/Thumbnail.js.map +1 -1
  42. package/dist/Toast.vue.d.ts +1 -1
  43. package/dist/Tooltip.js +1 -1
  44. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js} +2 -2
  45. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js.map → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js.map} +1 -1
  46. package/dist/components.css +1 -1
  47. package/dist/getContrastingTextColor.d.ts +8 -0
  48. package/dist/index-t9tXBnql.js +469 -0
  49. package/dist/{index-DA70nQCT.js.map → index-t9tXBnql.js.map} +1 -1
  50. package/dist/templateRefNarrowing-CeANDylX.js +22 -0
  51. package/dist/templateRefNarrowing-CeANDylX.js.map +1 -0
  52. package/dist/useMediaQuery.d.ts +12 -10
  53. package/dist/useMediaQuery.js +7 -29
  54. package/dist/useMediaQuery.js.map +1 -1
  55. package/dist/useSortable.js +1 -1
  56. package/dist/utils/getContrastingTextColor.js +36 -24
  57. package/dist/utils/getContrastingTextColor.js.map +1 -1
  58. package/package.json +7 -1
  59. package/types/tanstack-vue-table.d.ts +18 -0
  60. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js +0 -130
  61. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js.map +0 -1
  62. package/dist/index-DA70nQCT.js +0 -424
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../src/components/RadioGroup/components/VariantButton.vue","../src/components/RadioGroup/components/VariantChip.vue","../src/components/RadioGroup/components/VariantRadio.vue","../src/components/RadioGroup/components/VariantTile.vue","../src/components/RadioGroup/RadioGroup.types.ts","../src/components/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantButton must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"flex\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n .root label {\n padding: 8px 30px;\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-semibold);\n color: var(--color-ice-700);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n display: block;\n text-align: center;\n }\n\n .root > div:first-child label {\n border-top-left-radius: var(--radius-sm);\n border-bottom-left-radius: var(--radius-sm);\n }\n\n .root > div:last-child label {\n border-top-right-radius: var(--radius-sm);\n border-bottom-right-radius: var(--radius-sm);\n }\n\n .root > div:not(:first-child) label {\n margin-left: -1px;\n }\n\n .root > div:not(:last-child) label {\n border-right-color: transparent;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n z-index: 1;\n position: relative;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n background-color: var(--color-blue-100);\n z-index: 1;\n position: relative;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantChip must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"my-1.5 flex flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n gap: --spacing(6);\n }\n\n .root label {\n padding: --spacing(1.5) --spacing(3);\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-normal);\n color: var(--color-ice-900);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n border-radius: 9999px;\n white-space: nowrap;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-white);\n background-color: var(--color-blue-500);\n font-weight: var(--font-weight-bold);\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantRadio must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"flex flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n gap: --spacing(6);\n }\n\n .root label {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 --spacing(3);\n }\n\n .root input {\n appearance: none;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 5px;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n .root input:hover:not(:disabled) {\n border-color: var(--color-blue-500);\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantTile must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"flex flex-wrap\" :class=\"classes.root\">\n <label\n v-for=\"option in options\"\n :key=\"`${name}-${option.id}`\"\n :class=\"[classes['tile-container'], { 'w-full': fullWidth }]\"\n :for=\"`${name}-${option.id}`\"\n >\n <div\n class=\"flex border\"\n :class=\"[\n classes['tile-header'],\n {\n 'border-blue-500 bg-blue-100 text-ice-900': modelValue === option.value,\n 'border-ice-500 bg-ice-100 text-ice-700': modelValue !== option.value,\n },\n ]\"\n >\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <div>\n <span>\n {{ option.text }}\n </span>\n </div>\n </div>\n <div\n class=\"border-x border-b\"\n :class=\"[\n classes['tile-body'],\n {\n 'border-ice-500': modelValue !== option.value,\n 'border-blue-500': modelValue === option.value,\n },\n ]\"\n >\n <p class=\"m-0 text-ice-900\">{{ option.subTitle }}</p>\n <p class=\"m-0 text-ice-700\">{{ option.subText }}</p>\n </div>\n </label>\n </div>\n</template>\n\n<style module>\n @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n gap: --spacing(6);\n }\n\n .root label {\n cursor: pointer;\n user-select: none;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n\n .root label.tile-container {\n border-radius: var(--radius-sm);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n .tile-header,\n .tile-body {\n transition: all 0.2s;\n }\n\n .tile-header {\n border-radius: var(--radius-sm) var(--radius-sm) 0 0;\n padding: --spacing(3) 0;\n }\n\n .root label.tile-container:hover .tile-header {\n background-color: var(--color-blue-100) !important;\n border-color: var(--color-blue-500) !important;\n color: var(--color-ice-900) !important;\n transition: all 0.2s;\n }\n\n .tile-body {\n border-radius: 0 0 var(--radius-sm) var(--radius-sm);\n background-color: var(--color-white);\n padding: --spacing(6);\n display: flex;\n flex-direction: column;\n }\n\n .root label.tile-container:hover .tile-body {\n border-color: var(--color-blue-500) !important;\n transition: all 0.2s;\n }\n\n .root input {\n appearance: none;\n background-color: var(--color-white);\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 2px;\n }\n\n .root input ~ div {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 --spacing(3);\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root label.tile-container input {\n margin-left: --spacing(3);\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n @media screen and (width <= 640px) {\n .root {\n flex-direction: column;\n }\n }\n }\n</style>\n","import { ComputedRef } from 'vue';\n\nexport enum RadioGroupVariant {\n Radio = 'radio',\n Button = 'button',\n Chip = 'chip',\n Tile = 'tile',\n}\n\nexport type RadioGroupVariants = `${RadioGroupVariant}`;\n\n/**\n * An individual radio `<input>` within a RadioGroup instance\n */\nexport interface RadioGroupOption {\n /**\n * Disables the RadioGroupOption if truthy\n */\n disabled?: boolean;\n\n /**\n * The unique identifier for the option\n */\n id: number | string;\n\n /**\n * The text to be displayed for the option\n */\n text: string;\n\n /**\n * The value of the option. Used for the modelValue of the RadioGroup.\n */\n value: string;\n\n /**\n * The subtitle for tile variant\n */\n subTitle?: string;\n\n /**\n * The subtext for tile variant\n */\n subText?: string;\n}\n\n/**\n * Properties and utilities provided to children of a RadioGroup instance\n */\nexport interface RadioGroupInjection {\n /**\n * This type should match RadioGroupProps['disabled']\n */\n disabled: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['fullWidth']\n */\n fullWidth: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['modelValue']\n */\n modelValue: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['name']\n */\n name: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['options']\n */\n options: ComputedRef<RadioGroupOption[] | undefined>;\n\n /**\n * Triggered when the user changes their selection; updates the v-model.\n */\n update: (e: Event) => void;\n\n /**\n * This type should match RadioGroupProps['variant']\n * @default 'radio'\n */\n variant: ComputedRef<RadioGroupVariants | undefined>;\n\n /**\n * Default orientation. If the variant is `button` and the group is wider than its parent it will be displayed in a column, and this prop will be ignored.\n *\n * Note: This does not work with the deprecated `options` prop. Update those instances to use the `RadioNew` component and default slot.\n */\n orientation?: ComputedRef<'horizontal' | 'vertical'>;\n}\n","<script lang=\"ts\">\n import { FieldProps } from '../Field/Field.types';\n import Field from '../Field/Field.vue';\n import { RadioGroupOption, RadioGroupVariant, RadioGroupVariants } from './RadioGroup.types';\n\n export * from './RadioGroup.keys';\n export * from './RadioGroup.types';\n\n export interface RadioGroupProps extends FieldProps {\n /**\n * Passed to the \"name\" attribute of the `<input>` elements within the RadioGroup.\n */\n name?: string;\n\n /**\n * Deprecated - Compose your radio group with the `Radio` component instead\n * @deprecated\n */\n options?: RadioGroupOption[];\n\n /**\n * The value of the selected radio option. Use this prop with the `update:modelValue` event to create a controlled component.\n */\n modelValue?: RadioGroupOption['value'];\n\n /**\n * @defaultValue 'radio'\n */\n variant?: RadioGroupVariants;\n\n /**\n * Whether the group should expand to the parent's width\n */\n fullWidth?: boolean;\n\n /**\n * Default orientation. If the variant is `button` and the group is wider than its parent it will be displayed in a column, and this prop will be ignored.\n *\n * Note: This does not work with the deprecated `options` prop. Update those instances to use the `RadioNew` component and default slot.\n *\n * @defaultValue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onMounted, onUnmounted, provide, ref, useCssModule, useTemplateRef, watchEffect } from 'vue';\n\n import VariantButton from './components/VariantButton.vue';\n import VariantChip from './components/VariantChip.vue';\n import VariantRadio from './components/VariantRadio.vue';\n import VariantTile from './components/VariantTile.vue';\n import { RADIO_GROUP_INJECTION } from './RadioGroup.keys';\n\n const variantComponentsMap = {\n [RadioGroupVariant.Button]: VariantButton,\n [RadioGroupVariant.Chip]: VariantChip,\n [RadioGroupVariant.Radio]: VariantRadio,\n [RadioGroupVariant.Tile]: VariantTile,\n };\n\n const props = withDefaults(defineProps<RadioGroupProps>(), {\n variant: 'radio',\n fullWidth: false,\n modelValue: undefined,\n name: undefined,\n options: undefined,\n orientation: 'horizontal',\n });\n\n const emit = defineEmits<{\n /**\n * Occurs when the user selects a radio option. Also, it enables v-model usage on the component.\n */\n (e: 'update:modelValue', value: RadioGroupOption['value']): void;\n }>();\n\n const classes = useCssModule();\n\n function update(e: Event) {\n emit('update:modelValue', (e.target as HTMLInputElement).value);\n }\n\n const errorId = uniqueId('radio-group-field-error-');\n\n provide(RADIO_GROUP_INJECTION.key, {\n name: computed(() => props.name),\n disabled: computed(() => props.isDisabled || props.disabled),\n fullWidth: computed(() => props.fullWidth),\n modelValue: computed(() => props.modelValue),\n options: computed(() => props.options),\n variant: computed(() => props.variant),\n orientation: computed(() => internalOrientation.value),\n update,\n });\n\n const internalOrientation = ref(props.orientation);\n\n const defaultSlotClasses = computed(() => {\n return {\n 'flex-wrap': props.variant !== 'button',\n 'gap-x-1.5 gap-y-3': props.variant === 'chip' && internalOrientation.value === 'horizontal',\n 'gap-6':\n props.variant === 'radio' ||\n props.variant === 'tile' ||\n (props.variant === 'chip' && internalOrientation.value === 'vertical'),\n 'flex-col': internalOrientation.value === 'vertical',\n };\n });\n\n const resizeObserver = ref<ResizeObserver | null>(null);\n const radioGroupRef = useTemplateRef('radioGroup');\n const radioGroupParent = computed(() => radioGroupRef.value?.$el.parentElement);\n const radioGroupButtons = computed(() => {\n if (props.variant !== 'button') {\n return [];\n }\n\n return Array.from<HTMLElement>(radioGroupRef.value?.$el.querySelectorAll('[data-variant-button]')) || [];\n });\n\n function getButtonsWidth() {\n return radioGroupButtons.value.reduce((acc, button) => {\n const buttonWidth = button.getBoundingClientRect().width;\n return acc + buttonWidth;\n }, 0);\n }\n\n const initialTotalButtonsWidth = ref(0);\n\n const handleResize = (entry: ResizeObserverEntry) => {\n internalOrientation.value =\n initialTotalButtonsWidth.value > entry.contentBoxSize[0].inlineSize ? 'vertical' : props.orientation;\n };\n\n onMounted(() => {\n // If the width of the buttons is greater than the parent element,\n // set orientation to vertical\n if (props.variant === 'button' && !props.fullWidth) {\n initialTotalButtonsWidth.value = getButtonsWidth();\n resizeObserver.value = new ResizeObserver((entries) => handleResize(entries[0]));\n\n resizeObserver.value.observe(radioGroupParent.value);\n }\n });\n\n onUnmounted(() => {\n if (props.variant === 'button' && resizeObserver.value) {\n resizeObserver.value?.disconnect();\n }\n });\n\n watchEffect(() => {\n internalOrientation.value = props.orientation;\n });\n</script>\n\n<template>\n <Field\n v-bind=\"props\"\n ref=\"radioGroup\"\n class=\"stash-radio-group\"\n :class=\"classes['stash-radio-group']\"\n data-test=\"stash-radio-group\"\n :aria-errormessage=\"errorId\"\n :error-id=\"errorId\"\n :aria-invalid=\"!!props.errorText\"\n role=\"radiogroup\"\n fieldset\n >\n <slot v-if=\"props.options\">\n <component :is=\"variantComponentsMap[props.variant]\" />\n </slot>\n <div v-else class=\"flex\" data-test=\"stash-radio-group|default-slot\" :class=\"defaultSlotClasses\">\n <slot></slot>\n </div>\n </Field>\n</template>\n\n<style module>\n @layer utilities {\n .stash-radio-group :global(.stash-field-hint),\n .stash-radio-group :global(.stash-field-error) {\n display: block;\n width: 100%;\n }\n\n .stash-radio-group > :global(.stash-label) {\n margin-bottom: 4px;\n }\n }\n</style>\n"],"names":["radioGroupInjection","inject","RADIO_GROUP_INJECTION","name","disabled","fullWidth","modelValue","options","update","classes","useCssModule","_createElementBlock","_normalizeClass","_unref","_Fragment","_renderList","option","_createElementVNode","_cache","args","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","RadioGroupVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","props","__props","emit","__emit","e","errorId","uniqueId","provide","computed","internalOrientation","ref","defaultSlotClasses","resizeObserver","radioGroupRef","useTemplateRef","radioGroupParent","_a","radioGroupButtons","getButtonsWidth","acc","button","buttonWidth","initialTotalButtonsWidth","handleResize","entry","onMounted","entries","onUnmounted","watchEffect","_createBlock","Field","_mergeProps","_renderSlot","_ctx","_openBlock","_resolveDynamicComponent"],"mappings":";;;;;;;;AAKE,UAAMA,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACH,YAAM,IAAI,MAAM,wDAAwD;AAG1E,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,MAAWR,GAC7DS,IAAUC,EAAA;2BAIhBC,EAgBM,OAAA;AAAA,MAhBD,OAAKC,EAAA,CAAC,QAAeC,EAAAJ,CAAA,EAAQ,IAAI,CAAA;AAAA,IAAA;cACpCE,EAcMG,GAAA,MAAAC,EAdgBF,EAAAN,CAAA,GAAO,CAAjBS,YAAZL,EAcM,OAAA;AAAA,QAd0B,KAAG,GAAKE,EAAAV,CAAA,CAAI,IAAIa,EAAO,EAAE;AAAA,QAAK,sBAAoBH,EAAAR,CAAA,GAAS,CAAA;AAAA,MAAA;QACzFY,EASE,SAAA;AAAA,UARC,IAAE,GAAKJ,EAAAV,CAAA,CAAI,IAAIa,EAAO,EAAE;AAAA,UACzB,OAAM;AAAA,UACN,MAAK;AAAA,UACJ,MAAMH,EAAAV,CAAA;AAAA,UACN,OAAOa,EAAO;AAAA,UACd,SAASH,EAAAP,CAAA,MAAeU,EAAO;AAAA,UAC/B,UAAUH,EAAAT,CAAA,KAAYY,EAAO;AAAA,UAC7B,SAAKE,EAAA,CAAA,MAAAA,EAAA,CAAA;AAAA,oBAAEL,EAAAL,CAAA,KAAAK,EAAAL,CAAA,EAAA,GAAAW,CAAA;AAAA,QAAA;QAEVF,EAEQ,SAAA;AAAA,UAFA,KAAG,GAAKJ,EAAAV,CAAA,CAAI,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B,EAAM,YAAY,YAAYY,EAAe,WAC/CI,IAAAJ,EAAe,UAAf,QAAAI,EAAsB;AAAA,IAE1B,CAAC,GAEDY,EAAY,MAAM;AAChB,MAAAnB,EAAoB,QAAQT,EAAM;AAAA,IACpC,CAAC,mBAID6B,EAkBQC,GAlBRC,EAkBQ/B,GAjBO;AAAA,MACb,KAAI;AAAA,MACJ,OAAK,CAAC,qBACEjB,EAAAJ,CAAA,EAAO,mBAAA,CAAA;AAAA,MACf,aAAU;AAAA,MACT,qBAAmBI,EAAAsB,CAAA;AAAA,MACnB,YAAUtB,EAAAsB,CAAA;AAAA,MACV,gBAAY,CAAA,CAAIL,EAAM;AAAA,MACvB,MAAK;AAAA,MACL,UAAA;AAAA,IAAA;iBAEA,MAEO;AAAA,QAFKA,EAAM,UAAlBgC,EAEOC,iCAFP,MAEO;AAAA,WADLC,EAAA,GAAAL,EAAuDM,EAAvCxC,EAAqBK,EAAM,OAAO,CAAA,CAAA;AAAA,QAAA,WAEpDnB,EAEM,OAAA;AAAA;UAFM,OAAKC,EAAA,CAAC,QAA0D6B,EAAA,KAAkB,CAAA;AAAA,UAArE,aAAU;AAAA,QAAA;UACjCqB,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../src/components/RadioGroup/components/VariantButton.vue","../src/components/RadioGroup/components/VariantChip.vue","../src/components/RadioGroup/components/VariantRadio.vue","../src/components/RadioGroup/components/VariantTile.vue","../src/components/RadioGroup/RadioGroup.types.ts","../src/components/RadioGroup/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantButton must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"flex\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n .root label {\n padding: 8px 30px;\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-semibold);\n color: var(--color-ice-700);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n display: block;\n text-align: center;\n }\n\n .root > div:first-child label {\n border-top-left-radius: var(--radius-sm);\n border-bottom-left-radius: var(--radius-sm);\n }\n\n .root > div:last-child label {\n border-top-right-radius: var(--radius-sm);\n border-bottom-right-radius: var(--radius-sm);\n }\n\n .root > div:not(:first-child) label {\n margin-left: -1px;\n }\n\n .root > div:not(:last-child) label {\n border-right-color: transparent;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n z-index: 1;\n position: relative;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-blue-500);\n background-color: var(--color-blue-100);\n z-index: 1;\n position: relative;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantChip must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"my-1.5 flex flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n gap: --spacing(6);\n }\n\n .root label {\n padding: --spacing(1.5) --spacing(3);\n border: 1px solid var(--color-ice-500);\n font-weight: var(--font-weight-normal);\n color: var(--color-ice-900);\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n border-radius: 9999px;\n white-space: nowrap;\n }\n\n .root input:disabled ~ label {\n background-color: var(--color-ice-200);\n color: var(--color-ice-500);\n cursor: auto;\n }\n\n .root input:checked:not(:disabled) ~ label {\n border-color: var(--color-blue-500);\n color: var(--color-white);\n background-color: var(--color-blue-500);\n font-weight: var(--font-weight-bold);\n }\n\n .root input:not(:checked, :disabled) ~ label:hover {\n border-color: var(--color-blue-500);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantRadio must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"flex flex-wrap\" :class=\"classes.root\">\n <div v-for=\"option in options\" :key=\"`${name}-${option.id}`\" :class=\"[{ 'w-full': fullWidth }]\">\n <input\n :id=\"`${name}-${option.id}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <label :for=\"`${name}-${option.id}`\">\n {{ option.text }}\n </label>\n </div>\n </div>\n</template>\n\n<style module>\n @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n gap: --spacing(6);\n }\n\n .root label {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 --spacing(3);\n }\n\n .root input {\n appearance: none;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 5px;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n .root input:hover:not(:disabled) {\n border-color: var(--color-blue-500);\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { inject, useCssModule } from 'vue';\n\n import { RADIO_GROUP_INJECTION } from '../RadioGroup.keys';\n\n const radioGroupInjection = inject(RADIO_GROUP_INJECTION.key);\n\n if (!radioGroupInjection) {\n throw new Error('VariantTile must be used with a RadioGroup instance.');\n }\n\n const { name, disabled, fullWidth, modelValue, options, update } = radioGroupInjection;\n const classes = useCssModule();\n</script>\n\n<template>\n <div class=\"flex flex-wrap\" :class=\"classes.root\">\n <label\n v-for=\"option in options\"\n :key=\"`${name}-${option.id}`\"\n :class=\"[classes['tile-container'], { 'w-full': fullWidth }]\"\n :for=\"`${name}-${option.id}`\"\n >\n <div\n class=\"flex border\"\n :class=\"[\n classes['tile-header'],\n {\n 'border-blue-500 bg-blue-100 text-ice-900': modelValue === option.value,\n 'border-ice-500 bg-ice-100 text-ice-700': modelValue !== option.value,\n },\n ]\"\n >\n <input\n :id=\"`${name}-${option.id}`\"\n class=\"sr-only\"\n type=\"radio\"\n :name=\"name\"\n :value=\"option.value\"\n :checked=\"modelValue === option.value\"\n :disabled=\"disabled || option.disabled\"\n @input=\"update\"\n />\n <div>\n <span>\n {{ option.text }}\n </span>\n </div>\n </div>\n <div\n class=\"border-x border-b\"\n :class=\"[\n classes['tile-body'],\n {\n 'border-ice-500': modelValue !== option.value,\n 'border-blue-500': modelValue === option.value,\n },\n ]\"\n >\n <p class=\"m-0 text-ice-900\">{{ option.subTitle }}</p>\n <p class=\"m-0 text-ice-700\">{{ option.subText }}</p>\n </div>\n </label>\n </div>\n</template>\n\n<style module>\n @reference \"../../../../styles/main.css\";\n\n @layer utilities {\n .root {\n gap: --spacing(6);\n }\n\n .root label {\n cursor: pointer;\n user-select: none;\n }\n\n .root input:disabled ~ label {\n cursor: auto;\n }\n\n .root input:hover:not(:disabled) ~ label {\n color: var(--color-ice-900);\n }\n\n .root input:not(:disabled) ~ label:hover {\n color: var(--color-ice-900);\n }\n\n .root label.tile-container {\n border-radius: var(--radius-sm);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n .tile-header,\n .tile-body {\n transition: all 0.2s;\n }\n\n .tile-header {\n border-radius: var(--radius-sm) var(--radius-sm) 0 0;\n padding: --spacing(3) 0;\n }\n\n .root label.tile-container:hover .tile-header {\n background-color: var(--color-blue-100) !important;\n border-color: var(--color-blue-500) !important;\n color: var(--color-ice-900) !important;\n transition: all 0.2s;\n }\n\n .tile-body {\n border-radius: 0 0 var(--radius-sm) var(--radius-sm);\n background-color: var(--color-white);\n padding: --spacing(6);\n display: flex;\n flex-direction: column;\n }\n\n .root label.tile-container:hover .tile-body {\n border-color: var(--color-blue-500) !important;\n transition: all 0.2s;\n }\n\n .root input {\n appearance: none;\n background-color: var(--color-white);\n border-radius: 50%;\n width: 20px;\n height: 20px;\n border: 1px solid var(--color-ice-500);\n transition: all 0.2s;\n position: relative;\n cursor: pointer;\n top: 2px;\n }\n\n .root input ~ div {\n font-weight: var(--font-weight-medium);\n user-select: none;\n cursor: pointer;\n padding: 0 --spacing(3);\n }\n\n .root input:disabled {\n background: #eef2f4;\n }\n\n .root input:checked {\n background-image: radial-gradient(var(--color-blue-500) 50%, transparent 54%);\n }\n\n .root label.tile-container input {\n margin-left: --spacing(3);\n }\n\n .root input:disabled:checked {\n background-image: radial-gradient(var(--color-ice-500) 50%, transparent 54%);\n }\n\n @media screen and (width <= 640px) {\n .root {\n flex-direction: column;\n }\n }\n }\n</style>\n","import { ComputedRef } from 'vue';\n\nexport enum RadioGroupVariant {\n Radio = 'radio',\n Button = 'button',\n Chip = 'chip',\n Tile = 'tile',\n}\n\nexport type RadioGroupVariants = `${RadioGroupVariant}`;\n\n/**\n * An individual radio `<input>` within a RadioGroup instance\n */\nexport interface RadioGroupOption {\n /**\n * Disables the RadioGroupOption if truthy\n */\n disabled?: boolean;\n\n /**\n * The unique identifier for the option\n */\n id: number | string;\n\n /**\n * The text to be displayed for the option\n */\n text: string;\n\n /**\n * The value of the option. Used for the modelValue of the RadioGroup.\n */\n value: string;\n\n /**\n * The subtitle for tile variant\n */\n subTitle?: string;\n\n /**\n * The subtext for tile variant\n */\n subText?: string;\n}\n\n/**\n * Properties and utilities provided to children of a RadioGroup instance\n */\nexport interface RadioGroupInjection {\n /**\n * This type should match RadioGroupProps['disabled']\n */\n disabled: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['fullWidth']\n */\n fullWidth: ComputedRef<boolean | undefined>;\n\n /**\n * This type should match RadioGroupProps['modelValue']\n */\n modelValue: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['name']\n */\n name: ComputedRef<string | undefined>;\n\n /**\n * This type should match RadioGroupProps['options']\n */\n options: ComputedRef<RadioGroupOption[] | undefined>;\n\n /**\n * Triggered when the user changes their selection; updates the v-model.\n */\n update: (e: Event) => void;\n\n /**\n * This type should match RadioGroupProps['variant']\n * @default 'radio'\n */\n variant: ComputedRef<RadioGroupVariants | undefined>;\n\n /**\n * Default orientation. If the variant is `button` and the group is wider than its parent it will be displayed in a column, and this prop will be ignored.\n *\n * Note: This does not work with the deprecated `options` prop. Update those instances to use the `RadioNew` component and default slot.\n */\n orientation?: ComputedRef<'horizontal' | 'vertical'>;\n}\n","<script lang=\"ts\">\n import { FieldProps } from '../Field/Field.types';\n import Field from '../Field/Field.vue';\n import { RadioGroupOption, RadioGroupVariant, RadioGroupVariants } from './RadioGroup.types';\n\n export * from './RadioGroup.keys';\n export * from './RadioGroup.types';\n\n export interface RadioGroupProps extends FieldProps {\n /**\n * Passed to the \"name\" attribute of the `<input>` elements within the RadioGroup.\n */\n name?: string;\n\n /**\n * Deprecated - Compose your radio group with the `Radio` component instead\n * @deprecated\n */\n options?: RadioGroupOption[];\n\n /**\n * The value of the selected radio option. Use this prop with the `update:modelValue` event to create a controlled component.\n */\n modelValue?: RadioGroupOption['value'];\n\n /**\n * @defaultValue 'radio'\n */\n variant?: RadioGroupVariants;\n\n /**\n * Whether the group should expand to the parent's width\n */\n fullWidth?: boolean;\n\n /**\n * Default orientation. If the variant is `button` and the group is wider than its parent it will be displayed in a column, and this prop will be ignored.\n *\n * Note: This does not work with the deprecated `options` prop. Update those instances to use the `RadioNew` component and default slot.\n *\n * @defaultValue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n }\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onMounted, onUnmounted, provide, ref, useCssModule, useTemplateRef, watchEffect } from 'vue';\n\n import { isComponentWithEl, toComponentEl } from '../../utils/templateRefNarrowing';\n import VariantButton from './components/VariantButton.vue';\n import VariantChip from './components/VariantChip.vue';\n import VariantRadio from './components/VariantRadio.vue';\n import VariantTile from './components/VariantTile.vue';\n import { RADIO_GROUP_INJECTION } from './RadioGroup.keys';\n\n const variantComponentsMap = {\n [RadioGroupVariant.Button]: VariantButton,\n [RadioGroupVariant.Chip]: VariantChip,\n [RadioGroupVariant.Radio]: VariantRadio,\n [RadioGroupVariant.Tile]: VariantTile,\n };\n\n const props = withDefaults(defineProps<RadioGroupProps>(), {\n variant: 'radio',\n fullWidth: false,\n modelValue: undefined,\n name: undefined,\n options: undefined,\n orientation: 'horizontal',\n });\n\n const emit = defineEmits<{\n /**\n * Occurs when the user selects a radio option. Also, it enables v-model usage on the component.\n */\n (e: 'update:modelValue', value: RadioGroupOption['value']): void;\n }>();\n\n const classes = useCssModule();\n\n function update(e: Event) {\n emit('update:modelValue', (e.target as HTMLInputElement).value);\n }\n\n const errorId = uniqueId('radio-group-field-error-');\n\n provide(RADIO_GROUP_INJECTION.key, {\n name: computed(() => props.name),\n disabled: computed(() => props.isDisabled || props.disabled),\n fullWidth: computed(() => props.fullWidth),\n modelValue: computed(() => props.modelValue),\n options: computed(() => props.options),\n variant: computed(() => props.variant),\n orientation: computed(() => internalOrientation.value),\n update,\n });\n\n const internalOrientation = ref(props.orientation);\n\n const defaultSlotClasses = computed(() => {\n return {\n 'flex-wrap': props.variant !== 'button',\n 'gap-x-1.5 gap-y-3': props.variant === 'chip' && internalOrientation.value === 'horizontal',\n 'gap-6':\n props.variant === 'radio' ||\n props.variant === 'tile' ||\n (props.variant === 'chip' && internalOrientation.value === 'vertical'),\n 'flex-col': internalOrientation.value === 'vertical',\n };\n });\n\n const resizeObserver = ref<ResizeObserver | null>(null);\n const radioGroupRef = useTemplateRef('radioGroup');\n const radioGroupParent = computed(() => {\n const comp = radioGroupRef.value;\n return isComponentWithEl(comp) ? comp.$el.parentElement : null;\n });\n const radioGroupButtons = computed(() => {\n if (props.variant !== 'button') {\n return [];\n }\n\n const el = toComponentEl(radioGroupRef.value);\n return el ? Array.from(el.querySelectorAll<HTMLElement>('[data-variant-button]')) : [];\n });\n\n function getButtonsWidth() {\n return radioGroupButtons.value.reduce((acc, button) => {\n const buttonWidth = button.getBoundingClientRect().width;\n return acc + buttonWidth;\n }, 0);\n }\n\n const initialTotalButtonsWidth = ref(0);\n\n const handleResize = (entry: ResizeObserverEntry) => {\n internalOrientation.value =\n initialTotalButtonsWidth.value > entry.contentBoxSize[0].inlineSize ? 'vertical' : props.orientation;\n };\n\n onMounted(() => {\n // If the width of the buttons is greater than the parent element,\n // set orientation to vertical\n if (props.variant === 'button' && !props.fullWidth) {\n initialTotalButtonsWidth.value = getButtonsWidth();\n resizeObserver.value = new ResizeObserver((entries) => handleResize(entries[0]));\n\n const parent = radioGroupParent.value;\n if (parent) resizeObserver.value.observe(parent);\n }\n });\n\n onUnmounted(() => {\n if (props.variant === 'button' && resizeObserver.value) {\n resizeObserver.value?.disconnect();\n }\n });\n\n watchEffect(() => {\n internalOrientation.value = props.orientation;\n });\n</script>\n\n<template>\n <Field\n v-bind=\"props\"\n ref=\"radioGroup\"\n class=\"stash-radio-group\"\n :class=\"classes['stash-radio-group']\"\n data-test=\"stash-radio-group\"\n :aria-errormessage=\"errorId\"\n :error-id=\"errorId\"\n :aria-invalid=\"!!props.errorText\"\n role=\"radiogroup\"\n fieldset\n >\n <slot v-if=\"props.options\">\n <component :is=\"variantComponentsMap[props.variant]\" />\n </slot>\n <div v-else class=\"flex\" data-test=\"stash-radio-group|default-slot\" :class=\"defaultSlotClasses\">\n <slot></slot>\n </div>\n </Field>\n</template>\n\n<style module>\n @layer utilities {\n .stash-radio-group :global(.stash-field-hint),\n .stash-radio-group :global(.stash-field-error) {\n display: block;\n width: 100%;\n }\n\n .stash-radio-group > :global(.stash-label) {\n margin-bottom: 4px;\n }\n }\n</style>\n"],"names":["radioGroupInjection","inject","RADIO_GROUP_INJECTION","name","disabled","fullWidth","modelValue","options","update","classes","useCssModule","_createElementBlock","_normalizeClass","_unref","_Fragment","_renderList","option","_createElementVNode","_cache","args","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","RadioGroupVariant","variantComponentsMap","VariantButton","VariantChip","VariantRadio","VariantTile","props","__props","emit","__emit","e","errorId","uniqueId","provide","computed","internalOrientation","ref","defaultSlotClasses","resizeObserver","radioGroupRef","useTemplateRef","radioGroupParent","comp","isComponentWithEl","radioGroupButtons","el","toComponentEl","getButtonsWidth","acc","button","buttonWidth","initialTotalButtonsWidth","handleResize","entry","onMounted","entries","parent","onUnmounted","_a","watchEffect","_createBlock","Field","_mergeProps","_renderSlot","_ctx","_openBlock","_resolveDynamicComponent"],"mappings":";;;;;;;;;AAKE,UAAMA,IAAsBC,EAAOC,EAAsB,GAAG;AAE5D,QAAI,CAACF;AACH,YAAM,IAAI,MAAM,wDAAwD;AAG1E,UAAM,EAAE,MAAAG,GAAM,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,QAAAC,MAAWR,GAC7DS,IAAUC,EAAA;2BAIhBC,EAgBM,OAAA;AAAA,MAhBD,OAAKC,EAAA,CAAC,QAAeC,EAAAJ,CAAA,EAAQ,IAAI,CAAA;AAAA,IAAA;cACpCE,EAcMG,GAAA,MAAAC,EAdgBF,EAAAN,CAAA,GAAO,CAAjBS,YAAZL,EAcM,OAAA;AAAA,QAd0B,KAAG,GAAKE,EAAAV,CAAA,CAAI,IAAIa,EAAO,EAAE;AAAA,QAAK,sBAAoBH,EAAAR,CAAA,GAAS,CAAA;AAAA,MAAA;QACzFY,EASE,SAAA;AAAA,UARC,IAAE,GAAKJ,EAAAV,CAAA,CAAI,IAAIa,EAAO,EAAE;AAAA,UACzB,OAAM;AAAA,UACN,MAAK;AAAA,UACJ,MAAMH,EAAAV,CAAA;AAAA,UACN,OAAOa,EAAO;AAAA,UACd,SAASH,EAAAP,CAAA,MAAeU,EAAO;AAAA,UAC/B,UAAUH,EAAAT,CAAA,KAAYY,EAAO;AAAA,UAC7B,SAAKE,EAAA,CAAA,MAAAA,EAAA,CAAA;AAAA,oBAAEL,EAAAL,CAAA,KAAAK,EAAAL,CAAA,EAAA,GAAAW,CAAA;AAAA,QAAA;QAEVF,EAEQ,SAAA;AAAA,UAFA,KAAG,GAAKJ,EAAAV,CAAA,CAAI,IAAI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f,EAAiB;AAChC,QAAIe,KAAQlB,EAAe,MAAM,QAAQkB,CAAM;AAAA,MACjD;AAAA,IACF,CAAC,GAEDC,EAAY,MAAM;;AAChB,MAAI/B,EAAM,YAAY,YAAYY,EAAe,WAC/CoB,IAAApB,EAAe,UAAf,QAAAoB,EAAsB;AAAA,IAE1B,CAAC,GAEDC,EAAY,MAAM;AAChB,MAAAxB,EAAoB,QAAQT,EAAM;AAAA,IACpC,CAAC,mBAIDkC,EAkBQC,GAlBRC,EAkBQpC,GAjBO;AAAA,MACb,KAAI;AAAA,MACJ,OAAK,CAAC,qBACEjB,EAAAJ,CAAA,EAAO,mBAAA,CAAA;AAAA,MACf,aAAU;AAAA,MACT,qBAAmBI,EAAAsB,CAAA;AAAA,MACnB,YAAUtB,EAAAsB,CAAA;AAAA,MACV,gBAAY,CAAA,CAAIL,EAAM;AAAA,MACvB,MAAK;AAAA,MACL,UAAA;AAAA,IAAA;iBAEA,MAEO;AAAA,QAFKA,EAAM,UAAlBqC,EAEOC,iCAFP,MAEO;AAAA,WADLC,EAAA,GAAAL,EAAuDM,EAAvC7C,EAAqBK,EAAM,OAAO,CAAA,CAAA;AAAA,QAAA,WAEpDnB,EAEM,OAAA;AAAA;UAFM,OAAKC,EAAA,CAAC,QAA0D6B,EAAA,KAAkB,CAAA;AAAA,UAArE,aAAU;AAAA,QAAA;UACjC0B,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;;;;;"}
package/dist/Select.js CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as ze, useAttrs as He, useSlots as Pe, ref as c, computed as h, watch as $, nextTick as Q, onMounted as Ne, onUnmounted as Ae, createBlock as Z, openBlock as i, mergeProps as De, unref as B, createSlots as Ue, withCtx as x, createElementVNode as f, toDisplayString as k, withDirectives as z, createElementBlock as d, Fragment as q, renderList as j, withKeys as fe, normalizeClass as H, createCommentVNode as P, renderSlot as N, createTextVNode as A, withModifiers as D, createVNode as S, Teleport as Le, Transition as Ve, normalizeStyle as Ke, vModelText as Ge, vShow as ee } from "vue";
1
+ import { defineComponent as ze, useAttrs as He, useSlots as Pe, ref as c, computed as h, watch as z, nextTick as Z, onMounted as Ne, onUnmounted as Ae, createBlock as ee, openBlock as i, mergeProps as De, unref as B, createSlots as Ue, withCtx as x, createElementVNode as f, toDisplayString as k, withDirectives as H, createElementBlock as d, Fragment as j, renderList as W, withKeys as fe, normalizeClass as P, createCommentVNode as N, renderSlot as A, createTextVNode as D, withModifiers as U, createVNode as S, Teleport as Le, Transition as Ve, normalizeStyle as Ke, vModelText as Ge, vShow as te } from "vue";
2
2
  import { u as qe, a as je, f as We, o as Xe, c as Ye } from "./floating-ui.vue-CuGrC-z8.js";
3
3
  import Je from "@leaflink/snitch";
4
- import te from "lodash-es/debounce";
4
+ import le from "lodash-es/debounce";
5
5
  import Qe from "lodash-es/isEmpty";
6
6
  import pe from "lodash-es/isEqual";
7
7
  import Ze from "lodash-es/isPlainObject";
@@ -12,7 +12,7 @@ import st from "./directives/clickoutside.js";
12
12
  import { D as at } from "./MenusPlugin-Bk6UW6o9.js";
13
13
  import he from "./Chip.js";
14
14
  import { _ as nt } from "./Field.vue_vue_type_script_setup_true_lang-D2I8xDEW.js";
15
- import U from "./Icon.js";
15
+ import L from "./Icon.js";
16
16
  import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-labelledby"], ct = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], ut = ["selected", "value", "disabled"], dt = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], ft = ["id"], pt = ["onKeypress", "onMousedown"], ht = {
18
18
  key: 0,
@@ -76,7 +76,7 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
76
76
  },
77
77
  emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
78
78
  setup(ve, { emit: me }) {
79
- const t = ve, v = me, L = He(), W = Pe(), le = c(null), m = c(null), O = c(null), I = c(null), se = c(null), R = c(0), F = c(0), a = c([]), ae = c(() => []), y = c(""), p = c(-1), u = c(!1), X = c({}), ne = c(!1), { floatingStyles: ye, update: _e } = qe(le, O, {
79
+ const t = ve, v = me, V = He(), X = Pe(), se = c(null), m = c(null), O = c(null), I = c(null), ae = c(null), R = c(0), F = c(0), a = c([]), ne = c(() => []), y = c(""), p = c(-1), u = c(!1), Y = c({}), oe = c(!1), { floatingStyles: ye, update: _e } = qe(se, O, {
80
80
  whileElementsMounted: je,
81
81
  placement: t.menuPlacement,
82
82
  middleware: [
@@ -91,13 +91,13 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
91
91
  }
92
92
  })
93
93
  ]
94
- }), oe = new ResizeObserver(() => w()), Y = h(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), V = h(() => {
95
- let e = (ne.value && t.lazy ? t.lazy() : t.options).filter(Boolean);
94
+ }), M = typeof ResizeObserver < "u" ? new ResizeObserver(() => w()) : null, J = h(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), K = h(() => {
95
+ let e = (oe.value && t.lazy ? t.lazy() : t.options).filter(Boolean);
96
96
  return Ze(e[0]) || (e = e.map((l, n) => ({ name: l, id: n }))), e;
97
- }), ge = h(() => a.value.length ? a.value.map((e) => e[t.displayBy] || e).join(", ") : ""), re = h(() => t.searchLoading || Object.keys(X.value).length > 0), M = h(() => t.disableFiltering || !(y.value || "").trim() ? V.value : ae.value(y.value)), be = h(() => R.value <= F.value), Be = h(
97
+ }), ge = h(() => a.value.length ? a.value.map((e) => e[t.displayBy] || e).join(", ") : ""), re = h(() => t.searchLoading || Object.keys(Y.value).length > 0), $ = h(() => t.disableFiltering || !(y.value || "").trim() ? K.value : ne.value(y.value)), be = h(() => R.value <= F.value), Be = h(
98
98
  () => !u.value && !t.single && !be.value && a.value.length
99
99
  ), ke = h(() => [a.value.length, t.selectItemType, "selected"].filter(Boolean).join(" ")), Se = h(() => t.preventEmpty || t.allowEmpty === "false" || t.allowEmpty === !1);
100
- $(y, (e, l) => l !== e && G(-1)), $(a, () => w(), { deep: !0 }), $(
100
+ z(y, (e, l) => l !== e && q(-1)), z(a, () => w(), { deep: !0 }), z(
101
101
  () => t.modelValue,
102
102
  (e) => {
103
103
  if (Array.isArray(e)) {
@@ -112,29 +112,29 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
112
112
  a.value = [];
113
113
  },
114
114
  { immediate: !0 }
115
- ), $(
115
+ ), z(
116
116
  () => t.options,
117
117
  () => {
118
118
  const { searchFor: e } = tt({
119
- items: h(() => V.value),
119
+ items: h(() => K.value),
120
120
  fieldNames: t.searchBy.length ? t.searchBy : [t.displayBy],
121
121
  trackBy: t.trackBy
122
122
  });
123
- ae.value = (l) => e(l, { fuzzy: t.useFuzzySearch });
123
+ ne.value = (l) => e(l, { fuzzy: t.useFuzzySearch });
124
124
  },
125
125
  { immediate: !0 }
126
- ), $(R, () => we());
127
- const we = te(() => _e(), 50), w = te(() => de(), 50), J = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), Ee = () => {
126
+ ), z(R, () => we());
127
+ const we = le(() => _e(), 50), w = le(() => de(), 50), Q = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), Ee = () => {
128
128
  a.value = [], v("update:model-value", t.single ? void 0 : a.value), v("clear");
129
- }, K = (e) => {
130
- t.disabled || !e || J(e) || (T(e) ? _(e) : (t.single && (a.value = []), a.value.push(e), v("update:model-value", t.single ? a.value[0] : a.value), v("add", e)), t.single && E());
129
+ }, G = (e) => {
130
+ t.disabled || !e || Q(e) || (T(e) ? _(e) : (t.single && (a.value = []), a.value.push(e), v("update:model-value", t.single ? a.value[0] : a.value), v("add", e)), t.single && E());
131
131
  }, Te = (e) => {
132
132
  if (t.single) {
133
- const n = V.value.find((o) => {
133
+ const n = K.value.find((o) => {
134
134
  var r;
135
135
  return ((r = o[t.trackBy]) == null ? void 0 : r.toString()) === e.target.value;
136
136
  });
137
- K(n);
137
+ G(n);
138
138
  return;
139
139
  }
140
140
  const l = [...e.target.selectedOptions];
@@ -144,13 +144,13 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
144
144
  return r.value === ((g = n[t.trackBy]) == null ? void 0 : g.toString());
145
145
  }) || _(n);
146
146
  for (const n of l) {
147
- const o = V.value.find(
147
+ const o = K.value.find(
148
148
  (r) => {
149
149
  var g;
150
150
  return ((g = r[t.trackBy]) == null ? void 0 : g.toString()) === n.value;
151
151
  }
152
152
  );
153
- T(o) || K(o);
153
+ T(o) || G(o);
154
154
  }
155
155
  }, _ = (e) => {
156
156
  if (t.disabled || Se.value && a.value.length === 1)
@@ -162,15 +162,15 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
162
162
  }
163
163
  a.value.splice(l, 1), v("update:model-value", t.single ? a.value[0] : a.value), v("remove", e, l);
164
164
  }, ie = () => {
165
- u.value || (w(), u.value = !0, v("opened"), Y.value && Q(() => {
165
+ u.value || (w(), u.value = !0, v("opened"), J.value && Z(() => {
166
166
  var e;
167
- (e = se.value) == null || e.focus({ preventScroll: !0 });
167
+ (e = ae.value) == null || e.focus({ preventScroll: !0 });
168
168
  }));
169
169
  }, E = () => {
170
170
  var e;
171
- u.value && v("closed", a.value), G(-1), u.value = !1, t.preserveSearchTerm || (y.value = ""), (e = m.value) == null || e.blur();
171
+ u.value && v("closed", a.value), q(-1), u.value = !1, t.preserveSearchTerm || (y.value = ""), (e = m.value) == null || e.blur();
172
172
  }, xe = async (e) => {
173
- if (await Q(), !m.value)
173
+ if (await Z(), !m.value)
174
174
  return;
175
175
  if (![C.ENTER, C.ESCAPE].includes(e.keyCode)) {
176
176
  const n = m.value.querySelector(".stash-select__option--highlighted"), o = n == null ? void 0 : n.getBoundingClientRect(), r = m.value.getBoundingClientRect();
@@ -178,35 +178,35 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
178
178
  return;
179
179
  (o.bottom >= r.bottom || o.top <= r.top + o.height) && (n == null || n.scrollIntoView({ block: "nearest", inline: "nearest" }));
180
180
  }
181
- }, G = (e) => {
181
+ }, q = (e) => {
182
182
  p.value = e;
183
183
  }, Ce = (e) => {
184
184
  if (e.keyCode === C.ESCAPE)
185
185
  E();
186
- else if (e.keyCode === C.DOWN && p.value < M.value.length - 1 && u.value)
186
+ else if (e.keyCode === C.DOWN && p.value < $.value.length - 1 && u.value)
187
187
  p.value++;
188
188
  else if (e.keyCode === C.UP && p.value > 0)
189
- u.value && p.value--, O.value && Y.value && p.value === 0 && (O.value.scrollTop -= 100);
189
+ u.value && p.value--, O.value && J.value && p.value === 0 && (O.value.scrollTop -= 100);
190
190
  else if (e.keyCode === C.ENTER && p.value !== -1 && u.value)
191
- K(M.value[p.value]);
191
+ G($.value[p.value]);
192
192
  else
193
193
  return;
194
194
  e.preventDefault(), xe(e);
195
- }, ce = te(function() {
195
+ }, ce = le(function() {
196
196
  Oe();
197
197
  }, lt.FAST), Oe = async function() {
198
198
  if (!t.onSearch)
199
199
  return;
200
200
  const e = et("search-request-");
201
201
  try {
202
- X.value[e] = !0, await t.onSearch(y.value);
202
+ Y.value[e] = !0, await t.onSearch(y.value);
203
203
  } finally {
204
- delete X.value[e];
204
+ delete Y.value[e];
205
205
  }
206
206
  }, Ie = (e, l) => [
207
207
  {
208
208
  "stash-select__option": !0,
209
- "stash-select__option--disabled": J(e),
209
+ "stash-select__option--disabled": Q(e),
210
210
  "stash-select__option--highlighted": p.value === l,
211
211
  "stash-select__option--selected": T(e)
212
212
  },
@@ -234,20 +234,20 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
234
234
  ue(l) || E();
235
235
  }
236
236
  const Me = () => {
237
- G(-1);
237
+ q(-1);
238
238
  }, de = async () => {
239
- await Q(), I.value && m.value && (F.value = F.value === 0 ? m.value.clientHeight : F.value, R.value = I.value.clientHeight);
239
+ await Z(), I.value && m.value && (F.value = F.value === 0 ? m.value.clientHeight : F.value, R.value = I.value.clientHeight);
240
240
  };
241
241
  return Ne(() => {
242
- if (L.onInput)
242
+ if (V.onInput)
243
243
  throw new Error("ll-select: use the @update:model-value event instead of @input.");
244
- I.value && oe.observe(I.value), window.addEventListener("resize", w), w();
244
+ M && I.value && M.observe(I.value), window.addEventListener("resize", w), w();
245
245
  }), Ae(() => {
246
- window.removeEventListener("resize", de), oe.disconnect(), w.cancel();
246
+ window.removeEventListener("resize", de), M == null || M.disconnect(), w.cancel();
247
247
  }), (e, l) => {
248
248
  var n;
249
- return i(), Z(nt, De(t, {
250
- class: ["input ll-select stash-select", B(L).class],
249
+ return i(), ee(nt, De(t, {
250
+ class: ["input ll-select stash-select", B(V).class],
251
251
  "data-test": "stash-select",
252
252
  "error-text": t.errorText || t.error,
253
253
  "hint-text": t.hintText || t.hint
@@ -277,20 +277,20 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
277
277
  name: t.name,
278
278
  onChange: Te
279
279
  }, [
280
- (i(!0), d(q, null, j(M.value, (s, b) => (i(), d("option", {
280
+ (i(!0), d(j, null, W($.value, (s, b) => (i(), d("option", {
281
281
  key: `srOnlyOption-${b}`,
282
282
  selected: T(s),
283
283
  value: s[t.trackBy],
284
- disabled: J(s)
284
+ disabled: Q(s)
285
285
  }, k(s[t.displayBy] || ""), 9, ut))), 128)),
286
286
  l[5] || (l[5] = f("option", { value: "" }, null, -1))
287
287
  ], 40, ct),
288
- z((i(), d("div", {
288
+ H((i(), d("div", {
289
289
  ref_key: "selectRef",
290
- ref: le,
290
+ ref: se,
291
291
  role: "listbox",
292
292
  "aria-hidden": "true",
293
- class: H(["stash-select__content-wrapper", [
293
+ class: P(["stash-select__content-wrapper", [
294
294
  {
295
295
  "stash-select--disabled": !!t.disabled,
296
296
  "stash-select--error": !!(t.errorText || t.error),
@@ -320,7 +320,7 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
320
320
  tabindex: "0",
321
321
  "data-test": "stash-select|dropdown-trigger",
322
322
  onFocusin: ie,
323
- onFocusinOnce: l[4] || (l[4] = (s) => ne.value = !0),
323
+ onFocusinOnce: l[4] || (l[4] = (s) => oe.value = !0),
324
324
  onFocusout: Re,
325
325
  onKeydown: ie,
326
326
  onMouseleave: Me
@@ -330,38 +330,38 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
330
330
  ref: I,
331
331
  class: "stash-select__chips"
332
332
  }, [
333
- a.value.length ? P("", !0) : (i(), d("li", {
333
+ a.value.length ? N("", !0) : (i(), d("li", {
334
334
  key: 0,
335
- class: H(["stash-select__placeholder mr-0 pl-1.5", { truncate: !t.noTruncate }])
335
+ class: P(["stash-select__placeholder mr-0 pl-1.5", { truncate: !t.noTruncate }])
336
336
  }, k(t.placeholder), 3)),
337
- t.single ? (i(!0), d(q, { key: 1 }, j(a.value, (s) => (i(), d("li", {
337
+ t.single ? (i(!0), d(j, { key: 1 }, W(a.value, (s) => (i(), d("li", {
338
338
  key: `chip-${s[t.trackBy]}`,
339
- class: H(["stash-select__selected mr-0 pl-1.5", { truncate: !t.noTruncate }])
339
+ class: P(["stash-select__selected mr-0 pl-1.5", { truncate: !t.noTruncate }])
340
340
  }, [
341
- N(e.$slots, "selected", {
341
+ A(e.$slots, "selected", {
342
342
  option: s,
343
343
  onRemove: () => _(s),
344
344
  chipSelectedClass: "stash-select__chip"
345
345
  }, () => [
346
- A(k(s[t.displayBy] || s) + " ", 1),
346
+ D(k(s[t.displayBy] || s) + " ", 1),
347
347
  f("button", {
348
348
  tabindex: "-1",
349
349
  class: "stash-select__remove",
350
- onKeypress: fe(D((b) => _(s), ["prevent"]), ["enter"]),
351
- onMousedown: D((b) => _(s), ["prevent", "stop"])
350
+ onKeypress: fe(U((b) => _(s), ["prevent"]), ["enter"]),
351
+ onMousedown: U((b) => _(s), ["prevent", "stop"])
352
352
  }, [
353
- S(U, {
353
+ S(L, {
354
354
  icon: "close",
355
355
  name: "close",
356
356
  size: "small"
357
357
  })
358
358
  ], 40, pt)
359
359
  ], !0)
360
- ], 2))), 128)) : (i(!0), d(q, { key: 2 }, j(a.value, (s) => (i(), d("li", {
360
+ ], 2))), 128)) : (i(!0), d(j, { key: 2 }, W(a.value, (s) => (i(), d("li", {
361
361
  key: `chip-${s[t.trackBy]}`,
362
362
  class: "inline-block"
363
363
  }, [
364
- N(e.$slots, "selected", {
364
+ A(e.$slots, "selected", {
365
365
  option: s,
366
366
  onRemove: () => _(s),
367
367
  chipSelectedClass: "stash-select__chip"
@@ -374,7 +374,7 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
374
374
  onRemove: (b) => _(s)
375
375
  }, {
376
376
  default: x(() => [
377
- A(k(s[t.displayBy] || s), 1)
377
+ D(k(s[t.displayBy] || s), 1)
378
378
  ]),
379
379
  _: 2
380
380
  }, 1032, ["onRemove"])
@@ -390,41 +390,41 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
390
390
  onRemove: Ee
391
391
  }, {
392
392
  default: x(() => [
393
- A(k(ke.value), 1)
393
+ D(k(ke.value), 1)
394
394
  ]),
395
395
  _: 1
396
396
  })
397
- ])) : P("", !0),
398
- t.icon ? (i(), Z(U, {
397
+ ])) : N("", !0),
398
+ t.icon ? (i(), ee(L, {
399
399
  key: 1,
400
- class: H(["stash-select__icon", { "text-ice-500": t.disabled }]),
400
+ class: P(["stash-select__icon", { "text-ice-500": t.disabled }]),
401
401
  "data-test": "stash-select|toggle-icon",
402
402
  name: t.icon,
403
- onMousedown: l[0] || (l[0] = D((s) => u.value && E(), ["prevent"]))
404
- }, null, 8, ["name", "class"])) : P("", !0),
405
- (i(), Z(Le, {
403
+ onMousedown: l[0] || (l[0] = U((s) => u.value && E(), ["prevent"]))
404
+ }, null, 8, ["name", "class"])) : N("", !0),
405
+ (i(), ee(Le, {
406
406
  to: t.teleportTo,
407
407
  disabled: !t.enableTeleport
408
408
  }, [
409
409
  S(Ve, { name: "fade" }, {
410
410
  default: x(() => [
411
- z(f("div", {
411
+ H(f("div", {
412
412
  ref_key: "optionsWrapperRef",
413
413
  ref: O,
414
414
  class: "stash-select__border-selector w-full shadow-2xl",
415
415
  style: Ke(B(ye)),
416
- onClick: l[3] || (l[3] = D(() => {
416
+ onClick: l[3] || (l[3] = U(() => {
417
417
  }, ["stop"]))
418
418
  }, [
419
- Y.value ? (i(), d("div", vt, [
420
- z(f("input", {
419
+ J.value ? (i(), d("div", vt, [
420
+ H(f("input", {
421
421
  ref_key: "searchRef",
422
- ref: se,
422
+ ref: ae,
423
423
  "onUpdate:modelValue": l[1] || (l[1] = (s) => y.value = s),
424
424
  type: "text",
425
425
  autocomplete: "off",
426
426
  class: "stash-select__search",
427
- "data-test": B(L)["data-test"] ? B(L)["data-test"] + "-search" : "stash-select|search",
427
+ "data-test": B(V)["data-test"] ? B(V)["data-test"] + "-search" : "stash-select|search",
428
428
  placeholder: t.searchPlaceholder,
429
429
  spellcheck: !1,
430
430
  onInput: l[2] || (l[2] = //@ts-ignore
@@ -432,48 +432,48 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
432
432
  }, null, 40, mt), [
433
433
  [Ge, y.value]
434
434
  ]),
435
- S(U, {
435
+ S(L, {
436
436
  name: "search",
437
437
  class: "text-ice-500"
438
438
  })
439
- ])) : P("", !0),
439
+ ])) : N("", !0),
440
440
  f("ul", yt, [
441
- (i(!0), d(q, null, j(M.value, (s, b) => (i(), d("li", {
441
+ (i(!0), d(j, null, W($.value, (s, b) => (i(), d("li", {
442
442
  key: `option-${s[t.trackBy]}`,
443
443
  "data-test": s[t.trackBy],
444
- class: H(Ie(s, b)),
445
- onClick: ($e) => K(s),
446
- onMouseenter: D(($e) => G(b), ["self"])
444
+ class: P(Ie(s, b)),
445
+ onClick: ($e) => G(s),
446
+ onMouseenter: U(($e) => q(b), ["self"])
447
447
  }, [
448
- N(e.$slots, "option", { option: s }, () => [
449
- A(k(s[t.displayBy] || s), 1)
448
+ A(e.$slots, "option", { option: s }, () => [
449
+ D(k(s[t.displayBy] || s), 1)
450
450
  ], !0),
451
451
  T(s) && !t.hideCheck ? (i(), d("span", gt, [
452
- S(U, {
452
+ S(L, {
453
453
  class: "text-blue-500",
454
454
  name: "check"
455
455
  })
456
- ])) : P("", !0)
456
+ ])) : N("", !0)
457
457
  ], 42, _t))), 128)),
458
- z(f("li", bt, [
459
- S(U, {
458
+ H(f("li", bt, [
459
+ S(L, {
460
460
  "data-test": "stash-select|options-loading",
461
461
  name: "working",
462
462
  class: "animate-spin text-ice-500"
463
463
  })
464
464
  ], 512), [
465
- [ee, t.loading || re.value]
465
+ [te, t.loading || re.value]
466
466
  ]),
467
- z(f("li", Bt, [
468
- N(e.$slots, "no-options", {}, () => [
469
- l[6] || (l[6] = A(" No options ", -1))
467
+ H(f("li", Bt, [
468
+ A(e.$slots, "no-options", {}, () => [
469
+ l[6] || (l[6] = D(" No options ", -1))
470
470
  ], !0)
471
471
  ], 512), [
472
- [ee, !t.loading && !re.value && !M.value.length]
472
+ [te, !t.loading && !re.value && !$.value.length]
473
473
  ])
474
474
  ])
475
475
  ], 4), [
476
- [ee, u.value && !t.disabled]
476
+ [te, u.value && !t.disabled]
477
477
  ])
478
478
  ]),
479
479
  _: 3
@@ -486,17 +486,17 @@ const rt = { class: "flex h-input items-center text-sm" }, it = ["id", "aria-lab
486
486
  ]),
487
487
  key: "1"
488
488
  },
489
- (n = W.hint) != null && n.call(W) ? {
489
+ (n = X.hint) != null && n.call(X) ? {
490
490
  name: "hint",
491
491
  fn: x(() => [
492
- N(e.$slots, "hint", {}, void 0, !0)
492
+ A(e.$slots, "hint", {}, void 0, !0)
493
493
  ]),
494
494
  key: "2"
495
495
  } : void 0
496
496
  ]), 1040, ["class", "error-text", "hint-text"]);
497
497
  };
498
498
  }
499
- }), Ut = /* @__PURE__ */ ot(kt, [["__scopeId", "data-v-fb075f99"]]);
499
+ }), Ut = /* @__PURE__ */ ot(kt, [["__scopeId", "data-v-8b16635a"]]);
500
500
  export {
501
501
  Ut as default
502
502
  };