@auronui/vue 1.4.1 → 1.4.2
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.
- package/dist/cjs/index.cjs +719 -460
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/_shared/TimeScroller.js.map +1 -1
- package/dist/components/_shared/TimeScroller.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/components/_shared/TimeScroller.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js +17 -6
- package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js.map +1 -1
- package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +23 -3
- package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteCreateItem.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteInput.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js +23 -11
- package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteItem.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteOverflowChips.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/components/autocomplete/AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +11 -13
- package/dist/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/avatar/AvatarGroup.js.map +1 -1
- package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js +11 -2
- package/dist/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/button/ButtonGroup.js.map +1 -1
- package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/calendar/Calendar.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/calendar/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +32 -19
- package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/collapsible/CollapsibleGroup.js.map +1 -1
- package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-field/ColorField.js.map +1 -1
- package/dist/components/color-field/ColorField.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/components/color-field/ColorField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/color-input-group/ColorInputGroup.js.map +1 -1
- package/dist/components/color-input-group/ColorInputGroup.vue_vue_type_script_setup_true_lang.js +16 -18
- package/dist/components/color-input-group/ColorInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/combo-box/ComboBoxInput.js.map +1 -1
- package/dist/components/combo-box/ComboBoxInput.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/components/combo-box/ComboBoxInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/combo-box/ComboBoxItem.js.map +1 -1
- package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js +15 -6
- package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/components/date-picker/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js.map +1 -1
- package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +10 -4
- package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/list-box/ListBox.js.map +1 -1
- package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js +14 -4
- package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/modal/ModalContent.js.map +1 -1
- package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/components/modal/ModalContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/radio/RadioGroup.js.map +1 -1
- package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js +32 -19
- package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/scroll-area/ScrollArea.js.map +1 -1
- package/dist/components/scroll-area/ScrollArea.vue_vue_type_script_setup_true_lang.js +30 -13
- package/dist/components/scroll-area/ScrollArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js +21 -5
- package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/SelectItem.js.map +1 -1
- package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js +11 -6
- package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/SelectOverflowChips.js.map +1 -1
- package/dist/components/select/SelectOverflowChips.vue_vue_type_script_setup_true_lang.js +8 -5
- package/dist/components/select/SelectOverflowChips.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/SelectTrigger.js.map +1 -1
- package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js +7 -5
- package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/SelectValue.js.map +1 -1
- package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/separator/Separator.js.map +1 -1
- package/dist/components/separator/Separator.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/separator/Separator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js +20 -10
- package/dist/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/switch/SwitchGroup.js.map +1 -1
- package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js +29 -15
- package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.vue_vue_type_script_setup_true_lang.js +29 -9
- package/dist/components/table/Table.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/TabList.js.map +1 -1
- package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js +18 -15
- package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js +30 -7
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/time-picker/TimePicker.js.map +1 -1
- package/dist/components/time-picker/TimePicker.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/components/time-picker/TimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/toast/ToastViewport.js.map +1 -1
- package/dist/components/toast/ToastViewport.vue_vue_type_script_setup_true_lang.js +19 -6
- package/dist/components/toast/ToastViewport.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/index.d.ts +363 -0
- package/dist/packages/styles/dist/components/modal/modal.styles.js +2 -1
- package/dist/packages/styles/dist/components/modal/modal.styles.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, useId, useSlots, watch } from 'vue'\nimport { ComboboxRoot } from 'reka-ui'\nimport { comboBoxVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useComboBoxProvide } from './ComboBox.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport ComboBoxInput from './ComboBoxInput.vue'\nimport ComboBoxContent from './ComboBoxContent.vue'\nimport ComboBoxItem from './ComboBoxItem.vue'\n\nexport interface ComboBoxItem {\n value: string\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n open?: boolean\n defaultOpen?: boolean\n items?: ComboBoxItem[]\n label?: string\n placeholder?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isRequired?: boolean\n allowsCustomValue?: boolean\n fullWidth?: boolean\n /** Custom filter function: return true to include item */\n filterFunction?: (item: string, searchTerm: string) => boolean\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n }>\n /** Reset search term when user blurs the input. */\n resetSearchTermOnBlur?: boolean\n /** Reset search term after an item is selected. */\n resetSearchTermOnSelect?: boolean\n /** Open dropdown when the input gains focus. */\n openOnFocus?: boolean\n /** Open dropdown when the input is clicked. */\n openOnClick?: boolean\n /** Disable Reka's built-in filter; handle filtering externally. */\n ignoreFilter?: boolean\n /** Reset modelValue when the input is cleared. */\n resetModelValueOnClear?: boolean\n /** Allow selecting multiple values. */\n multiple?: boolean\n /** Reading direction for the component. */\n dir?: 'ltr' | 'rtl'\n /** Highlight the matching item on hover. */\n highlightOnHover?: boolean\n /** Key to compare items by for selection equality. */\n by?: string\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Form field name for native form submission. */\n name?: string\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n items: () => [],\n label: undefined,\n placeholder: undefined,\n description: undefined,\n errorMessage: undefined,\n isInvalid: false,\n isDisabled: false,\n isRequired: false,\n allowsCustomValue: false,\n fullWidth: false,\n filterFunction: undefined,\n class: undefined,\n classNames: undefined,\n resetSearchTermOnBlur: undefined,\n resetSearchTermOnSelect: undefined,\n openOnFocus: undefined,\n openOnClick: undefined,\n ignoreFilter: undefined,\n resetModelValueOnClear: undefined,\n multiple: false,\n dir: undefined,\n highlightOnHover: undefined,\n by: undefined,\n as: undefined,\n asChild: false,\n name: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'update:open': [value: boolean]\n 'highlight': [context: { ref: Element; value: string } | undefined]\n}>()\n\nconst labelId = useId()\n\nconst slots = useSlots()\n// Compound chrome present → pass slot through (advanced). Otherwise render the\n// input/content/items internally (short-form).\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.({}), [ComboBoxInput, ComboBoxContent]),\n)\n\nconst slotFns = computed(() =>\n comboBoxVariants({\n fullWidth: props.fullWidth,\n })\n)\n\n// Default filter: case-insensitive substring match\nconst effectiveFilter = computed(() => {\n if (props.filterFunction) return props.filterFunction\n return (itemText: string, searchTerm: string): boolean =>\n itemText.toLowerCase().includes(searchTerm.toLowerCase())\n})\n\n// Registry for slot-rendered items: value → label (populated by ComboBoxItem at mount).\n// Replaced with a new Map instance on each mutation so Vue's ref() reactivity tracks changes.\nconst slotItemRegistry = ref(new Map<string, string>())\n\nfunction registerItem(value: string, label: string) {\n const next = new Map(slotItemRegistry.value)\n next.set(value, label)\n slotItemRegistry.value = next\n}\n\nfunction unregisterItem(value: string) {\n const next = new Map(slotItemRegistry.value)\n next.delete(value)\n slotItemRegistry.value = next\n}\n\n// Resolve a user-facing value (\"us\") to the label text used internally by Reka.\n// Priority: items prop entry > slot registry > identity fallback\nfunction labelFor(value: string | undefined): string {\n if (!value) return ''\n const item = props.items.find(i => i.value === value)\n if (item) return item.label ?? item.textValue ?? value\n return slotItemRegistry.value.get(value) ?? value\n}\n\n// Resolve a Reka-internal label text back to the user-facing value.\nfunction valueFor(label: string): string {\n if (!label) return ''\n // Check items prop first\n const item = props.items.find(i => (i.label ?? i.textValue ?? i.value) === label)\n if (item) return item.value\n // Check slot registry\n for (const [value, lbl] of slotItemRegistry.value) {\n if (lbl === label) return value\n }\n return label\n}\n\n// internalValue holds the label text that Reka sees as its modelValue.\n// This lets Reka write the label directly into the input without a displayValue function.\nconst internalValue = ref(labelFor(props.modelValue))\n\n// Map a stored value back to its human-readable label for the input display.\n// Used as a no-op pass-through since internalValue already holds the label.\nconst displayValue = computed(() => (val: string): string => val)\n\n// Parent → internal: when the user's v-model changes, resolve to label text\nwatch(() => props.modelValue, (val) => {\n const next = labelFor(val)\n if (internalValue.value !== next) internalValue.value = next\n})\n\n// Internal → parent: when Reka emits a label text (after selection), translate to real value\nfunction handleModelValueUpdate(emitted: string) {\n internalValue.value = emitted\n emit('update:modelValue', valueFor(emitted))\n}\n\n// When slot items register (children mount after parent), re-resolve internalValue.\n// This covers the case where modelValue is set before children have mounted.\nwatch(slotItemRegistry, () => {\n const next = labelFor(props.modelValue)\n if (next !== internalValue.value && valueFor(internalValue.value) === (props.modelValue ?? '')) {\n internalValue.value = next\n }\n})\n\nuseComboBoxProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n fullWidth: toRef(props, 'fullWidth'),\n slots: slotFns,\n displayValue,\n registerItem,\n unregisterItem,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :aria-invalid=\"props.isInvalid || undefined\"\n data-slot=\"combo-box\"\n >\n <label\n v-if=\"props.label\"\n :id=\"labelId\"\n data-slot=\"label\"\n >\n {{ props.label }}\n <span\n v-if=\"props.isRequired\"\n aria-hidden=\"true\"\n > *</span>\n </label>\n\n <ComboboxRoot\n v-model=\"internalValue\"\n :default-value=\"props.defaultValue ? labelFor(props.defaultValue) : undefined\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :multiple=\"props.multiple\"\n :name=\"props.name\"\n :dir=\"props.dir\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :reset-search-term-on-blur=\"props.resetSearchTermOnBlur\"\n :reset-search-term-on-select=\"props.resetSearchTermOnSelect\"\n :open-on-focus=\"props.openOnFocus\"\n :open-on-click=\"props.openOnClick\"\n :ignore-filter=\"props.ignoreFilter\"\n :reset-model-value-on-clear=\"props.resetModelValueOnClear\"\n :highlight-on-hover=\"props.highlightOnHover\"\n :by=\"props.by\"\n :filter-function=\"effectiveFilter\"\n @update:model-value=\"handleModelValueUpdate($event)\"\n @update:open=\"emit('update:open', $event)\"\n @highlight=\"emit('highlight', $event)\"\n >\n <slot v-if=\"usesCustomChrome\" />\n <template v-else>\n <ComboBoxInput :placeholder=\"props.placeholder\" />\n <ComboBoxContent>\n <ComboBoxItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.isDisabled\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n >{{ item.label ?? item.textValue ?? item.value }}</slot>\n </ComboBoxItem>\n </ComboBoxContent>\n </template>\n </ComboboxRoot>\n\n <div\n v-if=\"props.description || (props.isInvalid && props.errorMessage)\"\n data-slot=\"helper-wrapper\"\n >\n <p\n v-if=\"props.isInvalid && props.errorMessage\"\n data-slot=\"error-message\"\n aria-live=\"polite\"\n >\n {{ props.errorMessage }}\n </p>\n <p\n v-else-if=\"props.description\"\n data-slot=\"description\"\n >\n {{ props.description }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ;EAiFd,MAAM,OAAO;EAMb,MAAM,UAAU,OAAM;EAEtB,MAAM,QAAQ,UAAS;EAGvB,MAAM,mBAAmB,eACvB,iBAAiB,MAAM,UAAU,EAAE,CAAC,EAAE,CAAC,uBAAe,wBAAgB,CAAC,CACzE;EAEA,MAAM,UAAU,eACd,iBAAiB,EACf,WAAW,MAAM,WAClB,CAAA,CACH;EAGA,MAAM,kBAAkB,eAAe;AACrC,OAAI,MAAM,eAAgB,QAAO,MAAM;AACvC,WAAQ,UAAkB,eACxB,SAAS,aA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AApB,iBAAA,QAAZ,WAAgC,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,IAAA,WAAA,EAChC,mBAeW,UAAA,EAAA,KAAA,GAAA,EAAA,CAdT,YAAkD,uBAAA,EAAlC,aAAa,MAAM,aAAA,EAAA,MAAA,GAAA,CAAA,cAAA,CAAA,EACnC,YAYkB,yBAAA,MAAA;6BAVa,EAAA,UAAA,KAAA,EAD7B,mBAUe,UAAA,MAAA,WATE,MAAM,QAAd,SAAI;2BADb,YAUe,sBAAA;QARZ,KAAK,KAAK;QACV,OAAO,KAAK;QACZ,eAAa,KAAK;;+BAKqC,CAHxD,WAGwD,KAAA,QAAA,QAAA,EAD/C,MAAI,QAC2C,CAAA,gBAAA,gBAApD,KAAK,SAAS,KAAK,aAAa,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO9C,MAAM,eAAgB,MAAM,aAAa,MAAM,gBAAA,WAAA,EADvD,mBAiBM,OAjBN,YAiBM,CAZI,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAMI,KANJ,YAMI,gBADC,MAAM,aAAY,EAAA,EAAA,IAGV,MAAM,eAAA,WAAA,EADnB,mBAKI,KALJ,YAKI,gBADC,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"ComboBox.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, useId, useSlots, watch } from 'vue'\nimport { ComboboxRoot } from 'reka-ui'\nimport { comboBoxVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useComboBoxProvide } from './ComboBox.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport ComboBoxInput from './ComboBoxInput.vue'\nimport ComboBoxContent from './ComboBoxContent.vue'\nimport ComboBoxItem from './ComboBoxItem.vue'\n\nexport interface ComboBoxItem {\n value: string\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n open?: boolean\n defaultOpen?: boolean\n items?: ComboBoxItem[]\n label?: string\n placeholder?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isRequired?: boolean\n allowsCustomValue?: boolean\n fullWidth?: boolean\n /** Custom filter function: return true to include item */\n filterFunction?: (item: string, searchTerm: string) => boolean\n class?: ClassValue\n /** Override classes for individual slots */\n classNames?: Partial<{\n base: ClassValue\n item: ClassValue\n indicator: ClassValue\n }>\n /** Reset search term when user blurs the input. */\n resetSearchTermOnBlur?: boolean\n /** Reset search term after an item is selected. */\n resetSearchTermOnSelect?: boolean\n /** Open dropdown when the input gains focus. */\n openOnFocus?: boolean\n /** Open dropdown when the input is clicked. */\n openOnClick?: boolean\n /** Disable Reka's built-in filter; handle filtering externally. */\n ignoreFilter?: boolean\n /** Reset modelValue when the input is cleared. */\n resetModelValueOnClear?: boolean\n /** Allow selecting multiple values. */\n multiple?: boolean\n /** Reading direction for the component. */\n dir?: 'ltr' | 'rtl'\n /** Highlight the matching item on hover. */\n highlightOnHover?: boolean\n /** Key to compare items by for selection equality. */\n by?: string\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Form field name for native form submission. */\n name?: string\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n items: () => [],\n label: undefined,\n placeholder: undefined,\n description: undefined,\n errorMessage: undefined,\n isInvalid: false,\n isDisabled: false,\n isRequired: false,\n allowsCustomValue: false,\n fullWidth: false,\n filterFunction: undefined,\n class: undefined,\n classNames: undefined,\n resetSearchTermOnBlur: undefined,\n resetSearchTermOnSelect: undefined,\n openOnFocus: undefined,\n openOnClick: undefined,\n ignoreFilter: undefined,\n resetModelValueOnClear: undefined,\n multiple: false,\n dir: undefined,\n highlightOnHover: undefined,\n by: undefined,\n as: undefined,\n asChild: false,\n name: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'update:open': [value: boolean]\n 'highlight': [context: { ref: Element; value: string } | undefined]\n}>()\n\nconst labelId = useId()\n\nconst slots = useSlots()\n// Compound chrome present → pass slot through (advanced). Otherwise render the\n// input/content/items internally (short-form).\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.({}), [ComboBoxInput, ComboBoxContent]),\n)\n\nconst slotFns = computed(() =>\n comboBoxVariants({\n fullWidth: props.fullWidth,\n })\n)\n\n// Default filter: case-insensitive substring match\nconst effectiveFilter = computed(() => {\n if (props.filterFunction) return props.filterFunction\n return (itemText: string, searchTerm: string): boolean =>\n itemText.toLowerCase().includes(searchTerm.toLowerCase())\n})\n\n// Registry for slot-rendered items: value → label (populated by ComboBoxItem at mount).\n// Replaced with a new Map instance on each mutation so Vue's ref() reactivity tracks changes.\nconst slotItemRegistry = ref(new Map<string, string>())\n\nfunction registerItem(value: string, label: string) {\n const next = new Map(slotItemRegistry.value)\n next.set(value, label)\n slotItemRegistry.value = next\n}\n\nfunction unregisterItem(value: string) {\n const next = new Map(slotItemRegistry.value)\n next.delete(value)\n slotItemRegistry.value = next\n}\n\n// Resolve a user-facing value (\"us\") to the label text used internally by Reka.\n// Priority: items prop entry > slot registry > identity fallback\nfunction labelFor(value: string | undefined): string {\n if (!value) return ''\n const item = props.items.find(i => i.value === value)\n if (item) return item.label ?? item.textValue ?? value\n return slotItemRegistry.value.get(value) ?? value\n}\n\n// Resolve a Reka-internal label text back to the user-facing value.\nfunction valueFor(label: string): string {\n if (!label) return ''\n // Check items prop first\n const item = props.items.find(i => (i.label ?? i.textValue ?? i.value) === label)\n if (item) return item.value\n // Check slot registry\n for (const [value, lbl] of slotItemRegistry.value) {\n if (lbl === label) return value\n }\n return label\n}\n\n// internalValue holds the label text that Reka sees as its modelValue.\n// This lets Reka write the label directly into the input without a displayValue function.\nconst internalValue = ref(labelFor(props.modelValue))\n\n// Map a stored value back to its human-readable label for the input display.\n// Used as a no-op pass-through since internalValue already holds the label.\nconst displayValue = computed(() => (val: string): string => val)\n\n// Parent → internal: when the user's v-model changes, resolve to label text\nwatch(() => props.modelValue, (val) => {\n const next = labelFor(val)\n if (internalValue.value !== next) internalValue.value = next\n})\n\n// Internal → parent: when Reka emits a label text (after selection), translate to real value\nfunction handleModelValueUpdate(emitted: string) {\n internalValue.value = emitted\n emit('update:modelValue', valueFor(emitted))\n}\n\n// When slot items register (children mount after parent), re-resolve internalValue.\n// This covers the case where modelValue is set before children have mounted.\nwatch(slotItemRegistry, () => {\n const next = labelFor(props.modelValue)\n if (next !== internalValue.value && valueFor(internalValue.value) === (props.modelValue ?? '')) {\n internalValue.value = next\n }\n})\n\nuseComboBoxProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n fullWidth: toRef(props, 'fullWidth'),\n slots: slotFns,\n displayValue,\n registerItem,\n unregisterItem,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :aria-invalid=\"props.isInvalid || undefined\"\n data-slot=\"combo-box\"\n >\n <label\n v-if=\"props.label\"\n :id=\"labelId\"\n data-slot=\"label\"\n >\n {{ props.label }}\n <span\n v-if=\"props.isRequired\"\n aria-hidden=\"true\"\n > *</span>\n </label>\n\n <ComboboxRoot\n v-model=\"internalValue\"\n :default-value=\"props.defaultValue ? labelFor(props.defaultValue) : undefined\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :multiple=\"props.multiple\"\n :name=\"props.name\"\n :dir=\"props.dir\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :reset-search-term-on-blur=\"props.resetSearchTermOnBlur\"\n :reset-search-term-on-select=\"props.resetSearchTermOnSelect\"\n :open-on-focus=\"props.openOnFocus\"\n :open-on-click=\"props.openOnClick\"\n :ignore-filter=\"props.ignoreFilter\"\n :reset-model-value-on-clear=\"props.resetModelValueOnClear\"\n :highlight-on-hover=\"props.highlightOnHover\"\n :by=\"props.by\"\n :filter-function=\"effectiveFilter\"\n @update:model-value=\"handleModelValueUpdate($event)\"\n @update:open=\"emit('update:open', $event)\"\n @highlight=\"emit('highlight', $event)\"\n >\n <slot v-if=\"usesCustomChrome\" />\n <template v-else>\n <ComboBoxInput :placeholder=\"props.placeholder\" />\n <ComboBoxContent>\n <ComboBoxItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.isDisabled\"\n :class-names=\"{ item: props.classNames?.item, indicator: props.classNames?.indicator }\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n >{{ item.label ?? item.textValue ?? item.value }}</slot>\n </ComboBoxItem>\n </ComboBoxContent>\n </template>\n </ComboboxRoot>\n\n <div\n v-if=\"props.description || (props.isInvalid && props.errorMessage)\"\n data-slot=\"helper-wrapper\"\n >\n <p\n v-if=\"props.isInvalid && props.errorMessage\"\n data-slot=\"error-message\"\n aria-live=\"polite\"\n >\n {{ props.errorMessage }}\n </p>\n <p\n v-else-if=\"props.description\"\n data-slot=\"description\"\n >\n {{ props.description }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ;EAmFd,MAAM,OAAO;EAMb,MAAM,UAAU,OAAM;EAEtB,MAAM,QAAQ,UAAS;EAGvB,MAAM,mBAAmB,eACvB,iBAAiB,MAAM,UAAU,EAAE,CAAC,EAAE,CAAC,uBAAe,wBAAgB,CAAC,CACzE;EAEA,MAAM,U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\">\nimport { ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxCancel } from 'reka-ui'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Custom reference element for the anchor. */\n anchorReference?: object | null\n /** Render the anchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n /** Function to compute the display value from the current model value. */\n displayValue?: (value: string) => string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the input as a different element. */\n as?: string\n /** Merge input props onto child element. */\n asChild?: boolean\n /** Disable the trigger button. */\n triggerDisabled?: boolean\n /** Render the trigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Render the cancel button as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n}>(), {\n placeholder: undefined,\n class: undefined,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n displayValue: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerDisabled: undefined,\n triggerAs: undefined,\n triggerAsChild: false,\n cancelAs: undefined,\n cancelAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useComboBoxInject()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n</script>\n\n<template>\n <ComboboxAnchor\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"ctx.slots.value.inputGroup()\"\n data-slot=\"input-group\"\n >\n <ComboboxInput\n :placeholder=\"props.placeholder\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :disabled=\"isDisabled\"\n :display-value=\"props.displayValue ?? ctx.displayValue.value\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n class=\"
|
|
1
|
+
{"version":3,"file":"ComboBoxInput.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxCancel } from 'reka-ui'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Custom reference element for the anchor. */\n anchorReference?: object | null\n /** Render the anchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n /** Function to compute the display value from the current model value. */\n displayValue?: (value: string) => string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the input as a different element. */\n as?: string\n /** Merge input props onto child element. */\n asChild?: boolean\n /** Disable the trigger button. */\n triggerDisabled?: boolean\n /** Render the trigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Render the cancel button as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n}>(), {\n placeholder: undefined,\n class: undefined,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n displayValue: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerDisabled: undefined,\n triggerAs: undefined,\n triggerAsChild: false,\n cancelAs: undefined,\n cancelAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useComboBoxInject()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n</script>\n\n<template>\n <ComboboxAnchor\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"ctx.slots.value.inputGroup()\"\n data-slot=\"input-group\"\n >\n <ComboboxInput\n :placeholder=\"props.placeholder\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :disabled=\"isDisabled\"\n :display-value=\"props.displayValue ?? ctx.displayValue.value\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"ctx.slots.value.input()\"\n data-slot=\"input\"\n autocomplete=\"off\"\n @update:model-value=\"emit('update:modelValue', $event)\"\n />\n <!-- Clear button: shown when there's input -->\n <ComboboxCancel\n :as=\"props.cancelAs\"\n :as-child=\"props.cancelAsChild\"\n :class=\"ctx.slots.value.clearButton()\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </ComboboxCancel>\n <!-- Dropdown trigger -->\n <ComboboxTrigger\n :disabled=\"props.triggerDisabled\"\n :as=\"props.triggerAs\"\n :as-child=\"props.triggerAsChild\"\n :class=\"ctx.slots.value.trigger()\"\n data-slot=\"selector-button\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"combo-box-trigger-default-icon\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </ComboboxTrigger>\n </ComboboxAnchor>\n</template>\n"],"mappings":""}
|
|
@@ -74,7 +74,7 @@ var ComboBoxInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
74
74
|
"display-value": props.displayValue ?? unref(ctx).displayValue.value,
|
|
75
75
|
as: props.as,
|
|
76
76
|
"as-child": props.asChild,
|
|
77
|
-
class:
|
|
77
|
+
class: normalizeClass(unref(ctx).slots.value.input()),
|
|
78
78
|
"data-slot": "input",
|
|
79
79
|
autocomplete: "off",
|
|
80
80
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
|
|
@@ -85,12 +85,13 @@ var ComboBoxInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
85
85
|
"disabled",
|
|
86
86
|
"display-value",
|
|
87
87
|
"as",
|
|
88
|
-
"as-child"
|
|
88
|
+
"as-child",
|
|
89
|
+
"class"
|
|
89
90
|
]),
|
|
90
91
|
createVNode(unref(ComboboxCancel), {
|
|
91
92
|
as: props.cancelAs,
|
|
92
93
|
"as-child": props.cancelAsChild,
|
|
93
|
-
class:
|
|
94
|
+
class: normalizeClass(unref(ctx).slots.value.clearButton()),
|
|
94
95
|
"data-slot": "clear-button",
|
|
95
96
|
"aria-label": "Clear"
|
|
96
97
|
}, {
|
|
@@ -117,7 +118,11 @@ var ComboBoxInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
117
118
|
y2: "18"
|
|
118
119
|
})], -1))])]),
|
|
119
120
|
_: 3
|
|
120
|
-
}, 8, [
|
|
121
|
+
}, 8, [
|
|
122
|
+
"as",
|
|
123
|
+
"as-child",
|
|
124
|
+
"class"
|
|
125
|
+
]),
|
|
121
126
|
createVNode(unref(ComboboxTrigger), {
|
|
122
127
|
disabled: props.triggerDisabled,
|
|
123
128
|
as: props.triggerAs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBoxInput.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxCancel } from 'reka-ui'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Custom reference element for the anchor. */\n anchorReference?: object | null\n /** Render the anchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n /** Function to compute the display value from the current model value. */\n displayValue?: (value: string) => string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the input as a different element. */\n as?: string\n /** Merge input props onto child element. */\n asChild?: boolean\n /** Disable the trigger button. */\n triggerDisabled?: boolean\n /** Render the trigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Render the cancel button as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n}>(), {\n placeholder: undefined,\n class: undefined,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n displayValue: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerDisabled: undefined,\n triggerAs: undefined,\n triggerAsChild: false,\n cancelAs: undefined,\n cancelAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useComboBoxInject()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n</script>\n\n<template>\n <ComboboxAnchor\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"ctx.slots.value.inputGroup()\"\n data-slot=\"input-group\"\n >\n <ComboboxInput\n :placeholder=\"props.placeholder\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :disabled=\"isDisabled\"\n :display-value=\"props.displayValue ?? ctx.displayValue.value\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n class=\"
|
|
1
|
+
{"version":3,"file":"ComboBoxInput.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxCancel } from 'reka-ui'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n /** Custom reference element for the anchor. */\n anchorReference?: object | null\n /** Render the anchor as a different element. */\n anchorAs?: string\n /** Merge anchor props onto child element. */\n anchorAsChild?: boolean\n /** Function to compute the display value from the current model value. */\n displayValue?: (value: string) => string\n /** Two-way bound search input value. */\n modelValue?: string\n /** Auto-focus the input on mount. */\n autoFocus?: boolean\n /** Disable the input. Falls back to context isDisabled. */\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render the input as a different element. */\n as?: string\n /** Merge input props onto child element. */\n asChild?: boolean\n /** Disable the trigger button. */\n triggerDisabled?: boolean\n /** Render the trigger as a different element. */\n triggerAs?: string\n /** Merge trigger props onto child element. */\n triggerAsChild?: boolean\n /** Render the cancel button as a different element. */\n cancelAs?: string\n /** Merge cancel props onto child element. */\n cancelAsChild?: boolean\n}>(), {\n placeholder: undefined,\n class: undefined,\n anchorReference: undefined,\n anchorAs: undefined,\n anchorAsChild: false,\n displayValue: undefined,\n modelValue: undefined,\n autoFocus: false,\n isDisabled: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n triggerDisabled: undefined,\n triggerAs: undefined,\n triggerAsChild: false,\n cancelAs: undefined,\n cancelAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst ctx = useComboBoxInject()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxInput', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n () => ctx.isDisabled.value,\n)\n</script>\n\n<template>\n <ComboboxAnchor\n :reference=\"(props.anchorReference as any)\"\n :as=\"props.anchorAs\"\n :as-child=\"props.anchorAsChild\"\n :class=\"ctx.slots.value.inputGroup()\"\n data-slot=\"input-group\"\n >\n <ComboboxInput\n :placeholder=\"props.placeholder\"\n :model-value=\"props.modelValue\"\n :auto-focus=\"props.autoFocus\"\n :disabled=\"isDisabled\"\n :display-value=\"props.displayValue ?? ctx.displayValue.value\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"ctx.slots.value.input()\"\n data-slot=\"input\"\n autocomplete=\"off\"\n @update:model-value=\"emit('update:modelValue', $event)\"\n />\n <!-- Clear button: shown when there's input -->\n <ComboboxCancel\n :as=\"props.cancelAs\"\n :as-child=\"props.cancelAsChild\"\n :class=\"ctx.slots.value.clearButton()\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </ComboboxCancel>\n <!-- Dropdown trigger -->\n <ComboboxTrigger\n :disabled=\"props.triggerDisabled\"\n :as=\"props.triggerAs\"\n :as-child=\"props.triggerAsChild\"\n :class=\"ctx.slots.value.trigger()\"\n data-slot=\"selector-button\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"combo-box-trigger-default-icon\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </ComboboxTrigger>\n </ComboboxAnchor>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAqDd,MAAM,OAAO;EAIb,MAAM,MAAM,mBAAkB;EAE9B,MAAM,aAAa,yBACjB,iBAAiB,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,gBACzE,IAAI,WAAW,MACvB;;uBAIE,YAmFiB,MAAA,eAAA,EAAA;IAlFd,WAAY,MAAM;IAClB,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,YAAU,CAAA;IAClC,aAAU;;2BAcR;KAZF,YAYE,MAAA,cAAA,EAAA;MAXC,aAAa,MAAM;MACnB,eAAa,MAAM;MACnB,cAAY,MAAM;MAClB,UAAU,MAAA,WAAU;MACpB,iBAAe,MA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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBoxItem.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { ComboboxItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useComboBoxInject()\n\n// Extract plain text from default slot VNodes at render time.\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\n// The display text Reka writes into the input when this item is selected.\n// Reads slot text content — no extra props needed.\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// Register this item's value→label mapping with the parent ComboBox bridge\n// so displayValue() and handleModelValueUpdate() can translate correctly.\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n</script>\n\n<template>\n <ComboboxItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n class=\"
|
|
1
|
+
{"version":3,"file":"ComboBoxItem.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { ComboboxItem, ComboboxItemIndicator } from 'reka-ui'\nimport { listboxItemVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n indicator: ClassValue\n }>\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useComboBoxInject()\nconst itemSlots = listboxItemVariants()\n\n// Extract plain text from default slot VNodes at render time.\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\n// The display text Reka writes into the input when this item is selected.\n// Reads slot text content — no extra props needed.\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// Register this item's value→label mapping with the parent ComboBox bridge\n// so displayValue() and handleModelValueUpdate() can translate correctly.\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n</script>\n\n<template>\n <ComboboxItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n :class=\"composeClassName(itemSlots.item(), props.classNames?.item)\"\n data-slot=\"list-box-item\"\n @select=\"emit('select', $event)\"\n >\n <slot name=\"startContent\" />\n <slot />\n <ComboboxItemIndicator\n :as=\"props.indicatorAs\"\n :as-child=\"props.indicatorAsChild\"\n :class=\"composeClassName(itemSlots.indicator(), props.classNames?.indicator)\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <slot name=\"endContent\" />\n </ComboboxItem>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { composeClassName } from "../../utils/composeClassName.js";
|
|
1
2
|
import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
|
|
2
3
|
import { useComboBoxInject } from "./ComboBox.context.js";
|
|
3
|
-
import { computed, createBlock, createElementVNode, createVNode, defineComponent, onMounted, onUnmounted, openBlock, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
4
|
+
import { computed, createBlock, createElementVNode, createVNode, defineComponent, normalizeClass, onMounted, onUnmounted, openBlock, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
5
|
+
import { listboxItemVariants } from "@auronui/styles";
|
|
4
6
|
import { ComboboxItem, ComboboxItemIndicator } from "reka-ui";
|
|
5
7
|
//#region src/components/combo-box/ComboBoxItem.vue?vue&type=script&setup=true&lang.ts
|
|
6
8
|
var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -26,7 +28,8 @@ var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
26
28
|
indicatorAsChild: {
|
|
27
29
|
type: Boolean,
|
|
28
30
|
default: false
|
|
29
|
-
}
|
|
31
|
+
},
|
|
32
|
+
classNames: {}
|
|
30
33
|
},
|
|
31
34
|
emits: ["select"],
|
|
32
35
|
setup(__props, { emit: __emit }) {
|
|
@@ -35,6 +38,7 @@ var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
35
38
|
const isDisabled = useDeprecatedBooleanProp("ComboBoxItem", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
|
|
36
39
|
const slots = useSlots();
|
|
37
40
|
const ctx = useComboBoxInject();
|
|
41
|
+
const itemSlots = listboxItemVariants();
|
|
38
42
|
function extractText(nodes) {
|
|
39
43
|
return nodes.map((n) => {
|
|
40
44
|
if (typeof n.children === "string") return n.children;
|
|
@@ -61,7 +65,7 @@ var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
61
65
|
as: props.as,
|
|
62
66
|
"as-child": props.asChild,
|
|
63
67
|
"data-item-value": props.value,
|
|
64
|
-
class:
|
|
68
|
+
class: normalizeClass(unref(composeClassName)(unref(itemSlots).item(), props.classNames?.item)),
|
|
65
69
|
"data-slot": "list-box-item",
|
|
66
70
|
onSelect: _cache[0] || (_cache[0] = ($event) => emit("select", $event))
|
|
67
71
|
}, {
|
|
@@ -71,7 +75,7 @@ var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
71
75
|
createVNode(unref(ComboboxItemIndicator), {
|
|
72
76
|
as: props.indicatorAs,
|
|
73
77
|
"as-child": props.indicatorAsChild,
|
|
74
|
-
class:
|
|
78
|
+
class: normalizeClass(unref(composeClassName)(unref(itemSlots).indicator(), props.classNames?.indicator)),
|
|
75
79
|
"data-slot": "list-box-item-indicator"
|
|
76
80
|
}, {
|
|
77
81
|
default: withCtx(() => [renderSlot(_ctx.$slots, "selectedIcon", {}, () => [_cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
@@ -88,7 +92,11 @@ var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
88
92
|
"aria-hidden": "true"
|
|
89
93
|
}, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])]),
|
|
90
94
|
_: 3
|
|
91
|
-
}, 8, [
|
|
95
|
+
}, 8, [
|
|
96
|
+
"as",
|
|
97
|
+
"as-child",
|
|
98
|
+
"class"
|
|
99
|
+
]),
|
|
92
100
|
renderSlot(_ctx.$slots, "endContent")
|
|
93
101
|
]),
|
|
94
102
|
_: 3
|
|
@@ -98,7 +106,8 @@ var ComboBoxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
98
106
|
"disabled",
|
|
99
107
|
"as",
|
|
100
108
|
"as-child",
|
|
101
|
-
"data-item-value"
|
|
109
|
+
"data-item-value",
|
|
110
|
+
"class"
|
|
102
111
|
]);
|
|
103
112
|
};
|
|
104
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBoxItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { ComboboxItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useComboBoxInject()\n\n// Extract plain text from default slot VNodes at render time.\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\n// The display text Reka writes into the input when this item is selected.\n// Reads slot text content — no extra props needed.\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// Register this item's value→label mapping with the parent ComboBox bridge\n// so displayValue() and handleModelValueUpdate() can translate correctly.\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n</script>\n\n<template>\n <ComboboxItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n class=\"
|
|
1
|
+
{"version":3,"file":"ComboBoxItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBoxItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { ComboboxItem, ComboboxItemIndicator } from 'reka-ui'\nimport { listboxItemVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useComboBoxInject } from './ComboBox.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n /** A string value for typeahead matching. Defaults to display text. */\n textValue?: string\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n /** Render as a different element or component. */\n as?: string\n /** Merge props onto child element instead of rendering a wrapper. */\n asChild?: boolean\n /** Render the ComboboxItemIndicator as a different element. */\n indicatorAs?: string\n /** Merge indicator props onto child element. */\n indicatorAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n indicator: ClassValue\n }>\n}>(), {\n isDisabled: undefined,\n class: undefined,\n textValue: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n indicatorAs: undefined,\n indicatorAsChild: false,\n})\n\nconst emit = defineEmits<{\n 'select': [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'ComboBoxItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst slots: Slots = useSlots()\nconst ctx = useComboBoxInject()\nconst itemSlots = listboxItemVariants()\n\n// Extract plain text from default slot VNodes at render time.\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\n// The display text Reka writes into the input when this item is selected.\n// Reads slot text content — no extra props needed.\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// Register this item's value→label mapping with the parent ComboBox bridge\n// so displayValue() and handleModelValueUpdate() can translate correctly.\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n</script>\n\n<template>\n <ComboboxItem\n :value=\"displayText\"\n :text-value=\"props.textValue ?? displayText\"\n :disabled=\"isDisabled\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :data-item-value=\"props.value\"\n :class=\"composeClassName(itemSlots.item(), props.classNames?.item)\"\n data-slot=\"list-box-item\"\n @select=\"emit('select', $event)\"\n >\n <slot name=\"startContent\" />\n <slot />\n <ComboboxItemIndicator\n :as=\"props.indicatorAs\"\n :as-child=\"props.indicatorAsChild\"\n :class=\"composeClassName(itemSlots.indicator(), props.classNames?.indicator)\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <slot name=\"endContent\" />\n </ComboboxItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EAgCd,MAAM,OAAO;E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,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAfL,mBAcM,OAAA;OAbJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,aAAU;OACV,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA;;;;;;;KAIvC,WAA0B,KAAA,QAAA,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","names":[],"sources":["../../../src/components/date-picker/DatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n DatePickerRoot,\n DatePickerTrigger,\n DatePickerContent,\n} from 'reka-ui'\nimport type { DateValue } from '@internationalized/date'\nimport type { CalendarDateTime, ZonedDateTime } from '@internationalized/date'\nimport { datePickerVariants, type DateInputVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport Calendar from '../calendar/Calendar.vue'\nimport DateInput from '../date-input/DateInput.vue'\n\nconst props = withDefaults(defineProps<{\n /* Field appearance — forwarded to DateInput */\n variant?: DateInputVariants['variant']\n size?: DateInputVariants['size']\n color?: DateInputVariants['color']\n labelPlacement?: DateInputVariants['labelPlacement']\n fullWidth?: boolean\n\n defaultValue?: DateValue\n defaultOpen?: boolean\n defaultPlaceholder?: DateValue\n placeholderValue?: DateValue\n minValue?: DateValue\n maxValue?: DateValue\n isDateUnavailable?: (date: DateValue) => boolean\n isDateDisabled?: (date: DateValue) => boolean\n locale?: string\n granularity?: 'day' | 'hour' | 'minute' | 'second'\n hourCycle?: 12 | 24\n /** Steps for segment keyboard navigation. */\n step?: Partial<Record<'hour' | 'minute' | 'second' | 'millisecond', number>>\n label?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isReadOnly?: boolean\n isRequired?: boolean\n name?: string\n hideTimeZone?: boolean\n visibleMonths?: number\n pageBehavior?: 'visible' | 'single'\n closeOnSelect?: boolean\n modal?: boolean\n /** Text direction. */\n dir?: 'ltr' | 'rtl'\n /** HTML id attribute forwarded to the root DatePickerRoot element. */\n id?: string\n /** Marks the field as required. */\n required?: boolean\n /** Use paged navigation (advance by numberOfMonths). */\n pagedNavigation?: boolean\n /** Day the week starts on. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n /** Format for weekday header cells. */\n weekdayFormat?: 'narrow' | 'short' | 'long'\n /** Always show 6 weeks per month. */\n fixedWeeks?: boolean\n /** Number of months shown in the calendar. */\n numberOfMonths?: number\n /** Prevent deselecting a selected date. */\n preventDeselect?: boolean\n /** Render trigger as a different element. */\n triggerAs?: string\n /** Render trigger child as root element. */\n triggerAsChild?: boolean\n /** Portal target for the content. */\n portal?: string | HTMLElement\n /** Force the content to stay mounted. */\n forceMount?: boolean\n /** Side of the anchor the content appears on. */\n side?: 'top' | 'right' | 'bottom' | 'left'\n /** Distance in px from the anchor. */\n sideOffset?: number\n /** Allow flipping to opposite side. */\n sideFlip?: boolean\n /** Alignment of the content relative to the anchor. */\n align?: 'start' | 'center' | 'end'\n /** Offset along the align axis. */\n alignOffset?: number\n /** Allow flipping alignment. */\n alignFlip?: boolean\n /** Avoid collisions with the viewport. */\n avoidCollisions?: boolean\n /** Elements to use as collision boundaries. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Padding for collision detection. */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n /** Padding between arrow and content edge. */\n arrowPadding?: number\n /** Hide the arrow when it is shifted. */\n hideShiftedArrow?: boolean\n /** Sticky behavior when overflowing. */\n sticky?: 'partial' | 'always'\n /** Hide content when anchor is detached. */\n hideWhenDetached?: boolean\n /** CSS position strategy. */\n positionStrategy?: 'fixed' | 'absolute'\n /** When to recalculate position. */\n updatePositionStrategy?: 'always' | 'optimized'\n /** Disable position update on layout shift. */\n disableUpdateOnLayoutShift?: boolean\n /** Prioritize keeping content in viewport. */\n prioritizePosition?: boolean\n /** Virtual reference element for positioning. */\n reference?: object | null\n /** Render content as a different element. */\n contentAs?: string\n /** Render content child as root element. */\n contentAsChild?: boolean\n /** Disable pointer events outside the content. */\n disableOutsidePointerEvents?: boolean\n class?: ClassValue\n /** Override classes for individual slots (base, trigger, triggerIndicator, popover) */\n classNames?: Partial<{\n base: ClassValue\n trigger: ClassValue\n triggerIndicator: ClassValue\n popover: ClassValue\n }>\n}>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: false,\n isRequired: false,\n hideTimeZone: false,\n closeOnSelect: true,\n modal: false,\n visibleMonths: 1,\n defaultOpen: false,\n avoidCollisions: true,\n collisionPadding: 8,\n prioritizePosition: true,\n})\n\nconst emit = defineEmits<{\n 'update:placeholder': [value: DateValue | undefined]\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'focus-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\nconst modelValue = defineModel<DateValue | null | undefined>('modelValue')\nconst openModel = defineModel<boolean>('open')\n\nconst slotFns = computed(() => datePickerVariants())\n\n// Reka treats `undefined` as \"uncontrolled mode\" — always pass null (controlled + empty) instead.\nconst rekaModelValue = computed<DateValue | null>({\n get: () => modelValue.value ?? null,\n set: (val: DateValue | null) => { modelValue.value = val ?? null },\n})\n\n// Sync Calendar's `DateValue` v-model with DatePicker's `DateValue | null` model,\n// and close the popover on selection when closeOnSelect is enabled.\n// When the current value carries a time component (CalendarDateTime / ZonedDateTime),\n// preserve it so clicking a date in the calendar doesn't wipe out the time the user\n// typed into the field segments.\nconst calendarValue = computed<DateValue | undefined>({\n get: () => modelValue.value ?? undefined,\n set: (val) => {\n if (val != null && modelValue.value != null && 'hour' in modelValue.value) {\n const existing = modelValue.value as CalendarDateTime | ZonedDateTime\n modelValue.value = existing.set({ year: val.year, month: val.month, day: val.day })\n } else {\n modelValue.value = val ?? null\n }\n if (props.closeOnSelect && val != null) {\n openModel.value = false\n }\n },\n})\n</script>\n\n<template>\n <DatePickerRoot\n v-model=\"rekaModelValue\"\n v-model:open=\"openModel\"\n :default-value=\"defaultValue\"\n :default-open=\"defaultOpen\"\n :default-placeholder=\"defaultPlaceholder\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-unavailable=\"isDateUnavailable\"\n :is-date-disabled=\"isDateDisabled\"\n :locale=\"locale\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :step=\"step\"\n :disabled=\"isDisabled\"\n :readonly=\"isReadOnly\"\n :name=\"name\"\n :dir=\"dir\"\n :id=\"id\"\n :required=\"required\"\n :paged-navigation=\"pagedNavigation\"\n :week-starts-on=\"weekStartsOn\"\n :weekday-format=\"weekdayFormat\"\n :fixed-weeks=\"fixedWeeks\"\n :number-of-months=\"numberOfMonths ?? visibleMonths\"\n :prevent-deselect=\"preventDeselect\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n data-slot=\"date-picker\"\n >\n <!-- DateInput hosts label/helper/field; trigger sits in its endContent slot -->\n <DateInput\n v-model=\"modelValue\"\n :variant=\"variant\"\n :size=\"size\"\n :color=\"color\"\n :label-placement=\"labelPlacement\"\n :full-width=\"fullWidth\"\n :default-value=\"defaultValue\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :locale=\"locale\"\n :label=\"label\"\n :description=\"description\"\n :error-message=\"errorMessage\"\n :is-invalid=\"isInvalid\"\n :is-disabled=\"isDisabled\"\n :is-read-only=\"isReadOnly\"\n :is-required=\"isRequired\"\n :name=\"name\"\n :hide-time-zone=\"hideTimeZone\"\n >\n <template #endContent>\n <DatePickerTrigger\n :class=\"composeClassName(slotFns.trigger(), props.classNames?.trigger)\"\n :as=\"triggerAs\"\n :as-child=\"triggerAsChild\"\n aria-label=\"Open date picker\"\n @mousedown.prevent\n >\n <slot name=\"selectorIcon\">\n <svg\n :class=\"composeClassName(slotFns.triggerIndicator(), props.classNames?.triggerIndicator)\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect\n x=\"3\"\n y=\"4\"\n width=\"18\"\n height=\"18\"\n rx=\"2\"\n ry=\"2\"\n />\n <line\n x1=\"16\"\n y1=\"2\"\n x2=\"16\"\n y2=\"6\"\n />\n <line\n x1=\"8\"\n y1=\"2\"\n x2=\"8\"\n y2=\"6\"\n />\n <line\n x1=\"3\"\n y1=\"10\"\n x2=\"21\"\n y2=\"10\"\n />\n </svg>\n </slot>\n </DatePickerTrigger>\n </template>\n </DateInput>\n\n <!-- Popover (portaled + positioned by Reka) -->\n <DatePickerContent\n :class=\"composeClassName(slotFns.popover(), props.classNames?.popover)\"\n data-slot=\"popover\"\n :side-offset=\"sideOffset ?? 8\"\n :portal=\"portal != null ? { to: portal } : undefined\"\n :force-mount=\"forceMount\"\n :side=\"side\"\n :side-flip=\"sideFlip\"\n :align=\"align\"\n :align-offset=\"alignOffset\"\n :align-flip=\"alignFlip\"\n :avoid-collisions=\"avoidCollisions\"\n :collision-boundary=\"collisionBoundary\"\n :collision-padding=\"collisionPadding\"\n :arrow-padding=\"arrowPadding\"\n :hide-shifted-arrow=\"hideShiftedArrow\"\n :sticky=\"sticky\"\n :hide-when-detached=\"hideWhenDetached\"\n :position-strategy=\"positionStrategy\"\n :update-position-strategy=\"updatePositionStrategy\"\n :disable-update-on-layout-shift=\"disableUpdateOnLayoutShift\"\n :prioritize-position=\"prioritizePosition\"\n :reference=\"(reference as any)\"\n :as=\"contentAs\"\n :as-child=\"contentAsChild\"\n :disable-outside-pointer-events=\"disableOutsidePointerEvents\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @focus-outside=\"emit('focus-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <slot name=\"calendarTopContent\" />\n\n <Calendar\n v-model=\"calendarValue\"\n :default-value=\"defaultValue\"\n :default-placeholder=\"placeholderValue ?? defaultValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-disabled=\"isDateDisabled\"\n :is-date-unavailable=\"isDateUnavailable\"\n :locale=\"locale\"\n :number-of-months=\"visibleMonths\"\n :readonly=\"isReadOnly\"\n :disabled=\"isDisabled\"\n />\n\n <slot name=\"calendarBottomContent\" />\n </DatePickerContent>\n </DatePickerRoot>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"DatePicker.js","names":[],"sources":["../../../src/components/date-picker/DatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n DatePickerRoot,\n DatePickerTrigger,\n DatePickerContent,\n} from 'reka-ui'\nimport type { DateValue } from '@internationalized/date'\nimport type { CalendarDateTime, ZonedDateTime } from '@internationalized/date'\nimport { datePickerVariants, type DateInputVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport Calendar from '../calendar/Calendar.vue'\nimport DateInput from '../date-input/DateInput.vue'\n\nconst props = withDefaults(defineProps<{\n /* Field appearance — forwarded to DateInput */\n variant?: DateInputVariants['variant']\n size?: DateInputVariants['size']\n color?: DateInputVariants['color']\n labelPlacement?: DateInputVariants['labelPlacement']\n fullWidth?: boolean\n\n defaultValue?: DateValue\n defaultOpen?: boolean\n defaultPlaceholder?: DateValue\n placeholderValue?: DateValue\n minValue?: DateValue\n maxValue?: DateValue\n isDateUnavailable?: (date: DateValue) => boolean\n isDateDisabled?: (date: DateValue) => boolean\n locale?: string\n granularity?: 'day' | 'hour' | 'minute' | 'second'\n hourCycle?: 12 | 24\n /** Steps for segment keyboard navigation. */\n step?: Partial<Record<'hour' | 'minute' | 'second' | 'millisecond', number>>\n label?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isReadOnly?: boolean\n isRequired?: boolean\n name?: string\n hideTimeZone?: boolean\n visibleMonths?: number\n pageBehavior?: 'visible' | 'single'\n closeOnSelect?: boolean\n modal?: boolean\n /** Text direction. */\n dir?: 'ltr' | 'rtl'\n /** HTML id attribute forwarded to the root DatePickerRoot element. */\n id?: string\n /** Marks the field as required. */\n required?: boolean\n /** Use paged navigation (advance by numberOfMonths). */\n pagedNavigation?: boolean\n /** Day the week starts on. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n /** Format for weekday header cells. */\n weekdayFormat?: 'narrow' | 'short' | 'long'\n /** Always show 6 weeks per month. */\n fixedWeeks?: boolean\n /** Number of months shown in the calendar. */\n numberOfMonths?: number\n /** Prevent deselecting a selected date. */\n preventDeselect?: boolean\n /** Render trigger as a different element. */\n triggerAs?: string\n /** Render trigger child as root element. */\n triggerAsChild?: boolean\n /** Portal target for the content. */\n portal?: string | HTMLElement\n /** Force the content to stay mounted. */\n forceMount?: boolean\n /** Side of the anchor the content appears on. */\n side?: 'top' | 'right' | 'bottom' | 'left'\n /** Distance in px from the anchor. */\n sideOffset?: number\n /** Allow flipping to opposite side. */\n sideFlip?: boolean\n /** Alignment of the content relative to the anchor. */\n align?: 'start' | 'center' | 'end'\n /** Offset along the align axis. */\n alignOffset?: number\n /** Allow flipping alignment. */\n alignFlip?: boolean\n /** Avoid collisions with the viewport. */\n avoidCollisions?: boolean\n /** Elements to use as collision boundaries. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Padding for collision detection. */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n /** Padding between arrow and content edge. */\n arrowPadding?: number\n /** Hide the arrow when it is shifted. */\n hideShiftedArrow?: boolean\n /** Sticky behavior when overflowing. */\n sticky?: 'partial' | 'always'\n /** Hide content when anchor is detached. */\n hideWhenDetached?: boolean\n /** CSS position strategy. */\n positionStrategy?: 'fixed' | 'absolute'\n /** When to recalculate position. */\n updatePositionStrategy?: 'always' | 'optimized'\n /** Disable position update on layout shift. */\n disableUpdateOnLayoutShift?: boolean\n /** Prioritize keeping content in viewport. */\n prioritizePosition?: boolean\n /** Virtual reference element for positioning. */\n reference?: object | null\n /** Render content as a different element. */\n contentAs?: string\n /** Render content child as root element. */\n contentAsChild?: boolean\n /** Disable pointer events outside the content. */\n disableOutsidePointerEvents?: boolean\n class?: ClassValue\n /** Override classes for individual slots (base, trigger, triggerIndicator, popover) */\n classNames?: Partial<{\n base: ClassValue\n trigger: ClassValue\n triggerIndicator: ClassValue\n popover: ClassValue\n calendar: Partial<{\n base: ClassValue\n header: ClassValue\n navButton: ClassValue\n navButtonIcon: ClassValue\n heading: ClassValue\n headingButton: ClassValue\n grid: ClassValue\n gridHeader: ClassValue\n gridRow: ClassValue\n headerCell: ClassValue\n gridBody: ClassValue\n cell: ClassValue\n cellButton: ClassValue\n monthGrid: ClassValue\n monthGridBody: ClassValue\n monthGridRow: ClassValue\n monthCell: ClassValue\n yearView: Partial<{\n header: ClassValue\n navButton: ClassValue\n navButtonIcon: ClassValue\n heading: ClassValue\n yearGrid: ClassValue\n yearGridBody: ClassValue\n yearGridRow: ClassValue\n yearCell: ClassValue\n }>\n }>\n dateInput: Partial<{\n label: ClassValue\n mainWrapper: ClassValue\n inputWrapper: ClassValue\n startContent: ClassValue\n segmentList: ClassValue\n segment: ClassValue\n endContent: ClassValue\n helperWrapper: ClassValue\n errorMessage: ClassValue\n description: ClassValue\n }>\n }>\n}>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: false,\n isRequired: false,\n hideTimeZone: false,\n closeOnSelect: true,\n modal: false,\n visibleMonths: 1,\n defaultOpen: false,\n avoidCollisions: true,\n collisionPadding: 8,\n prioritizePosition: true,\n})\n\nconst emit = defineEmits<{\n 'update:placeholder': [value: DateValue | undefined]\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'focus-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\nconst modelValue = defineModel<DateValue | null | undefined>('modelValue')\nconst openModel = defineModel<boolean>('open')\n\nconst slotFns = computed(() => datePickerVariants())\n\n// Reka treats `undefined` as \"uncontrolled mode\" — always pass null (controlled + empty) instead.\nconst rekaModelValue = computed<DateValue | null>({\n get: () => modelValue.value ?? null,\n set: (val: DateValue | null) => { modelValue.value = val ?? null },\n})\n\n// Sync Calendar's `DateValue` v-model with DatePicker's `DateValue | null` model,\n// and close the popover on selection when closeOnSelect is enabled.\n// When the current value carries a time component (CalendarDateTime / ZonedDateTime),\n// preserve it so clicking a date in the calendar doesn't wipe out the time the user\n// typed into the field segments.\nconst calendarValue = computed<DateValue | undefined>({\n get: () => modelValue.value ?? undefined,\n set: (val) => {\n if (val != null && modelValue.value != null && 'hour' in modelValue.value) {\n const existing = modelValue.value as CalendarDateTime | ZonedDateTime\n modelValue.value = existing.set({ year: val.year, month: val.month, day: val.day })\n } else {\n modelValue.value = val ?? null\n }\n if (props.closeOnSelect && val != null) {\n openModel.value = false\n }\n },\n})\n</script>\n\n<template>\n <DatePickerRoot\n v-model=\"rekaModelValue\"\n v-model:open=\"openModel\"\n :default-value=\"defaultValue\"\n :default-open=\"defaultOpen\"\n :default-placeholder=\"defaultPlaceholder\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-unavailable=\"isDateUnavailable\"\n :is-date-disabled=\"isDateDisabled\"\n :locale=\"locale\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :step=\"step\"\n :disabled=\"isDisabled\"\n :readonly=\"isReadOnly\"\n :name=\"name\"\n :dir=\"dir\"\n :id=\"id\"\n :required=\"required\"\n :paged-navigation=\"pagedNavigation\"\n :week-starts-on=\"weekStartsOn\"\n :weekday-format=\"weekdayFormat\"\n :fixed-weeks=\"fixedWeeks\"\n :number-of-months=\"numberOfMonths ?? visibleMonths\"\n :prevent-deselect=\"preventDeselect\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n data-slot=\"date-picker\"\n >\n <!-- DateInput hosts label/helper/field; trigger sits in its endContent slot -->\n <DateInput\n v-model=\"modelValue\"\n :variant=\"variant\"\n :size=\"size\"\n :color=\"color\"\n :label-placement=\"labelPlacement\"\n :full-width=\"fullWidth\"\n :default-value=\"defaultValue\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :locale=\"locale\"\n :label=\"label\"\n :description=\"description\"\n :error-message=\"errorMessage\"\n :is-invalid=\"isInvalid\"\n :is-disabled=\"isDisabled\"\n :is-read-only=\"isReadOnly\"\n :is-required=\"isRequired\"\n :name=\"name\"\n :hide-time-zone=\"hideTimeZone\"\n :class-names=\"props.classNames?.dateInput\"\n >\n <template #endContent>\n <DatePickerTrigger\n :class=\"composeClassName(slotFns.trigger(), props.classNames?.trigger)\"\n :as=\"triggerAs\"\n :as-child=\"triggerAsChild\"\n aria-label=\"Open date picker\"\n @mousedown.prevent\n >\n <slot name=\"selectorIcon\">\n <svg\n :class=\"composeClassName(slotFns.triggerIndicator(), props.classNames?.triggerIndicator)\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect\n x=\"3\"\n y=\"4\"\n width=\"18\"\n height=\"18\"\n rx=\"2\"\n ry=\"2\"\n />\n <line\n x1=\"16\"\n y1=\"2\"\n x2=\"16\"\n y2=\"6\"\n />\n <line\n x1=\"8\"\n y1=\"2\"\n x2=\"8\"\n y2=\"6\"\n />\n <line\n x1=\"3\"\n y1=\"10\"\n x2=\"21\"\n y2=\"10\"\n />\n </svg>\n </slot>\n </DatePickerTrigger>\n </template>\n </DateInput>\n\n <!-- Popover (portaled + positioned by Reka) -->\n <DatePickerContent\n :class=\"composeClassName(slotFns.popover(), props.classNames?.popover)\"\n data-slot=\"popover\"\n :side-offset=\"sideOffset ?? 8\"\n :portal=\"portal != null ? { to: portal } : undefined\"\n :force-mount=\"forceMount\"\n :side=\"side\"\n :side-flip=\"sideFlip\"\n :align=\"align\"\n :align-offset=\"alignOffset\"\n :align-flip=\"alignFlip\"\n :avoid-collisions=\"avoidCollisions\"\n :collision-boundary=\"collisionBoundary\"\n :collision-padding=\"collisionPadding\"\n :arrow-padding=\"arrowPadding\"\n :hide-shifted-arrow=\"hideShiftedArrow\"\n :sticky=\"sticky\"\n :hide-when-detached=\"hideWhenDetached\"\n :position-strategy=\"positionStrategy\"\n :update-position-strategy=\"updatePositionStrategy\"\n :disable-update-on-layout-shift=\"disableUpdateOnLayoutShift\"\n :prioritize-position=\"prioritizePosition\"\n :reference=\"(reference as any)\"\n :as=\"contentAs\"\n :as-child=\"contentAsChild\"\n :disable-outside-pointer-events=\"disableOutsidePointerEvents\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @focus-outside=\"emit('focus-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <slot name=\"calendarTopContent\" />\n\n <Calendar\n v-model=\"calendarValue\"\n :default-value=\"defaultValue\"\n :default-placeholder=\"placeholderValue ?? defaultValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-disabled=\"isDateDisabled\"\n :is-date-unavailable=\"isDateUnavailable\"\n :locale=\"locale\"\n :number-of-months=\"visibleMonths\"\n :readonly=\"isReadOnly\"\n :disabled=\"isDisabled\"\n :class-names=\"props.classNames?.calendar\"\n />\n\n <slot name=\"calendarBottomContent\" />\n </DatePickerContent>\n </DatePickerRoot>\n</template>\n"],"mappings":""}
|
|
@@ -208,7 +208,8 @@ var DatePicker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
208
208
|
"is-read-only": __props.isReadOnly,
|
|
209
209
|
"is-required": __props.isRequired,
|
|
210
210
|
name: __props.name,
|
|
211
|
-
"hide-time-zone": __props.hideTimeZone
|
|
211
|
+
"hide-time-zone": __props.hideTimeZone,
|
|
212
|
+
"class-names": props.classNames?.dateInput
|
|
212
213
|
}, {
|
|
213
214
|
endContent: withCtx(() => [createVNode(unref(DatePickerTrigger), {
|
|
214
215
|
class: normalizeClass(unref(composeClassName)(slotFns.value.trigger(), props.classNames?.trigger)),
|
|
@@ -287,7 +288,8 @@ var DatePicker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
287
288
|
"is-read-only",
|
|
288
289
|
"is-required",
|
|
289
290
|
"name",
|
|
290
|
-
"hide-time-zone"
|
|
291
|
+
"hide-time-zone",
|
|
292
|
+
"class-names"
|
|
291
293
|
]), createVNode(unref(DatePickerContent), {
|
|
292
294
|
class: normalizeClass(unref(composeClassName)(slotFns.value.popover(), props.classNames?.popover)),
|
|
293
295
|
"data-slot": "popover",
|
|
@@ -335,7 +337,8 @@ var DatePicker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
335
337
|
locale: __props.locale,
|
|
336
338
|
"number-of-months": __props.visibleMonths,
|
|
337
339
|
readonly: __props.isReadOnly,
|
|
338
|
-
disabled: __props.isDisabled
|
|
340
|
+
disabled: __props.isDisabled,
|
|
341
|
+
"class-names": props.classNames?.calendar
|
|
339
342
|
}, null, 8, [
|
|
340
343
|
"modelValue",
|
|
341
344
|
"default-value",
|
|
@@ -347,7 +350,8 @@ var DatePicker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
347
350
|
"locale",
|
|
348
351
|
"number-of-months",
|
|
349
352
|
"readonly",
|
|
350
|
-
"disabled"
|
|
353
|
+
"disabled",
|
|
354
|
+
"class-names"
|
|
351
355
|
]),
|
|
352
356
|
renderSlot(_ctx.$slots, "calendarBottomContent")
|
|
353
357
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/date-picker/DatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n DatePickerRoot,\n DatePickerTrigger,\n DatePickerContent,\n} from 'reka-ui'\nimport type { DateValue } from '@internationalized/date'\nimport type { CalendarDateTime, ZonedDateTime } from '@internationalized/date'\nimport { datePickerVariants, type DateInputVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport Calendar from '../calendar/Calendar.vue'\nimport DateInput from '../date-input/DateInput.vue'\n\nconst props = withDefaults(defineProps<{\n /* Field appearance — forwarded to DateInput */\n variant?: DateInputVariants['variant']\n size?: DateInputVariants['size']\n color?: DateInputVariants['color']\n labelPlacement?: DateInputVariants['labelPlacement']\n fullWidth?: boolean\n\n defaultValue?: DateValue\n defaultOpen?: boolean\n defaultPlaceholder?: DateValue\n placeholderValue?: DateValue\n minValue?: DateValue\n maxValue?: DateValue\n isDateUnavailable?: (date: DateValue) => boolean\n isDateDisabled?: (date: DateValue) => boolean\n locale?: string\n granularity?: 'day' | 'hour' | 'minute' | 'second'\n hourCycle?: 12 | 24\n /** Steps for segment keyboard navigation. */\n step?: Partial<Record<'hour' | 'minute' | 'second' | 'millisecond', number>>\n label?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isReadOnly?: boolean\n isRequired?: boolean\n name?: string\n hideTimeZone?: boolean\n visibleMonths?: number\n pageBehavior?: 'visible' | 'single'\n closeOnSelect?: boolean\n modal?: boolean\n /** Text direction. */\n dir?: 'ltr' | 'rtl'\n /** HTML id attribute forwarded to the root DatePickerRoot element. */\n id?: string\n /** Marks the field as required. */\n required?: boolean\n /** Use paged navigation (advance by numberOfMonths). */\n pagedNavigation?: boolean\n /** Day the week starts on. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n /** Format for weekday header cells. */\n weekdayFormat?: 'narrow' | 'short' | 'long'\n /** Always show 6 weeks per month. */\n fixedWeeks?: boolean\n /** Number of months shown in the calendar. */\n numberOfMonths?: number\n /** Prevent deselecting a selected date. */\n preventDeselect?: boolean\n /** Render trigger as a different element. */\n triggerAs?: string\n /** Render trigger child as root element. */\n triggerAsChild?: boolean\n /** Portal target for the content. */\n portal?: string | HTMLElement\n /** Force the content to stay mounted. */\n forceMount?: boolean\n /** Side of the anchor the content appears on. */\n side?: 'top' | 'right' | 'bottom' | 'left'\n /** Distance in px from the anchor. */\n sideOffset?: number\n /** Allow flipping to opposite side. */\n sideFlip?: boolean\n /** Alignment of the content relative to the anchor. */\n align?: 'start' | 'center' | 'end'\n /** Offset along the align axis. */\n alignOffset?: number\n /** Allow flipping alignment. */\n alignFlip?: boolean\n /** Avoid collisions with the viewport. */\n avoidCollisions?: boolean\n /** Elements to use as collision boundaries. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Padding for collision detection. */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n /** Padding between arrow and content edge. */\n arrowPadding?: number\n /** Hide the arrow when it is shifted. */\n hideShiftedArrow?: boolean\n /** Sticky behavior when overflowing. */\n sticky?: 'partial' | 'always'\n /** Hide content when anchor is detached. */\n hideWhenDetached?: boolean\n /** CSS position strategy. */\n positionStrategy?: 'fixed' | 'absolute'\n /** When to recalculate position. */\n updatePositionStrategy?: 'always' | 'optimized'\n /** Disable position update on layout shift. */\n disableUpdateOnLayoutShift?: boolean\n /** Prioritize keeping content in viewport. */\n prioritizePosition?: boolean\n /** Virtual reference element for positioning. */\n reference?: object | null\n /** Render content as a different element. */\n contentAs?: string\n /** Render content child as root element. */\n contentAsChild?: boolean\n /** Disable pointer events outside the content. */\n disableOutsidePointerEvents?: boolean\n class?: ClassValue\n /** Override classes for individual slots (base, trigger, triggerIndicator, popover) */\n classNames?: Partial<{\n base: ClassValue\n trigger: ClassValue\n triggerIndicator: ClassValue\n popover: ClassValue\n }>\n}>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: false,\n isRequired: false,\n hideTimeZone: false,\n closeOnSelect: true,\n modal: false,\n visibleMonths: 1,\n defaultOpen: false,\n avoidCollisions: true,\n collisionPadding: 8,\n prioritizePosition: true,\n})\n\nconst emit = defineEmits<{\n 'update:placeholder': [value: DateValue | undefined]\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'focus-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\nconst modelValue = defineModel<DateValue | null | undefined>('modelValue')\nconst openModel = defineModel<boolean>('open')\n\nconst slotFns = computed(() => datePickerVariants())\n\n// Reka treats `undefined` as \"uncontrolled mode\" — always pass null (controlled + empty) instead.\nconst rekaModelValue = computed<DateValue | null>({\n get: () => modelValue.value ?? null,\n set: (val: DateValue | null) => { modelValue.value = val ?? null },\n})\n\n// Sync Calendar's `DateValue` v-model with DatePicker's `DateValue | null` model,\n// and close the popover on selection when closeOnSelect is enabled.\n// When the current value carries a time component (CalendarDateTime / ZonedDateTime),\n// preserve it so clicking a date in the calendar doesn't wipe out the time the user\n// typed into the field segments.\nconst calendarValue = computed<DateValue | undefined>({\n get: () => modelValue.value ?? undefined,\n set: (val) => {\n if (val != null && modelValue.value != null && 'hour' in modelValue.value) {\n const existing = modelValue.value as CalendarDateTime | ZonedDateTime\n modelValue.value = existing.set({ year: val.year, month: val.month, day: val.day })\n } else {\n modelValue.value = val ?? null\n }\n if (props.closeOnSelect && val != null) {\n openModel.value = false\n }\n },\n})\n</script>\n\n<template>\n <DatePickerRoot\n v-model=\"rekaModelValue\"\n v-model:open=\"openModel\"\n :default-value=\"defaultValue\"\n :default-open=\"defaultOpen\"\n :default-placeholder=\"defaultPlaceholder\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-unavailable=\"isDateUnavailable\"\n :is-date-disabled=\"isDateDisabled\"\n :locale=\"locale\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :step=\"step\"\n :disabled=\"isDisabled\"\n :readonly=\"isReadOnly\"\n :name=\"name\"\n :dir=\"dir\"\n :id=\"id\"\n :required=\"required\"\n :paged-navigation=\"pagedNavigation\"\n :week-starts-on=\"weekStartsOn\"\n :weekday-format=\"weekdayFormat\"\n :fixed-weeks=\"fixedWeeks\"\n :number-of-months=\"numberOfMonths ?? visibleMonths\"\n :prevent-deselect=\"preventDeselect\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n data-slot=\"date-picker\"\n >\n <!-- DateInput hosts label/helper/field; trigger sits in its endContent slot -->\n <DateInput\n v-model=\"modelValue\"\n :variant=\"variant\"\n :size=\"size\"\n :color=\"color\"\n :label-placement=\"labelPlacement\"\n :full-width=\"fullWidth\"\n :default-value=\"defaultValue\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :locale=\"locale\"\n :label=\"label\"\n :description=\"description\"\n :error-message=\"errorMessage\"\n :is-invalid=\"isInvalid\"\n :is-disabled=\"isDisabled\"\n :is-read-only=\"isReadOnly\"\n :is-required=\"isRequired\"\n :name=\"name\"\n :hide-time-zone=\"hideTimeZone\"\n >\n <template #endContent>\n <DatePickerTrigger\n :class=\"composeClassName(slotFns.trigger(), props.classNames?.trigger)\"\n :as=\"triggerAs\"\n :as-child=\"triggerAsChild\"\n aria-label=\"Open date picker\"\n @mousedown.prevent\n >\n <slot name=\"selectorIcon\">\n <svg\n :class=\"composeClassName(slotFns.triggerIndicator(), props.classNames?.triggerIndicator)\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect\n x=\"3\"\n y=\"4\"\n width=\"18\"\n height=\"18\"\n rx=\"2\"\n ry=\"2\"\n />\n <line\n x1=\"16\"\n y1=\"2\"\n x2=\"16\"\n y2=\"6\"\n />\n <line\n x1=\"8\"\n y1=\"2\"\n x2=\"8\"\n y2=\"6\"\n />\n <line\n x1=\"3\"\n y1=\"10\"\n x2=\"21\"\n y2=\"10\"\n />\n </svg>\n </slot>\n </DatePickerTrigger>\n </template>\n </DateInput>\n\n <!-- Popover (portaled + positioned by Reka) -->\n <DatePickerContent\n :class=\"composeClassName(slotFns.popover(), props.classNames?.popover)\"\n data-slot=\"popover\"\n :side-offset=\"sideOffset ?? 8\"\n :portal=\"portal != null ? { to: portal } : undefined\"\n :force-mount=\"forceMount\"\n :side=\"side\"\n :side-flip=\"sideFlip\"\n :align=\"align\"\n :align-offset=\"alignOffset\"\n :align-flip=\"alignFlip\"\n :avoid-collisions=\"avoidCollisions\"\n :collision-boundary=\"collisionBoundary\"\n :collision-padding=\"collisionPadding\"\n :arrow-padding=\"arrowPadding\"\n :hide-shifted-arrow=\"hideShiftedArrow\"\n :sticky=\"sticky\"\n :hide-when-detached=\"hideWhenDetached\"\n :position-strategy=\"positionStrategy\"\n :update-position-strategy=\"updatePositionStrategy\"\n :disable-update-on-layout-shift=\"disableUpdateOnLayoutShift\"\n :prioritize-position=\"prioritizePosition\"\n :reference=\"(reference as any)\"\n :as=\"contentAs\"\n :as-child=\"contentAsChild\"\n :disable-outside-pointer-events=\"disableOutsidePointerEvents\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @focus-outside=\"emit('focus-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <slot name=\"calendarTopContent\" />\n\n <Calendar\n v-model=\"calendarValue\"\n :default-value=\"defaultValue\"\n :default-placeholder=\"placeholderValue ?? defaultValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-disabled=\"isDateDisabled\"\n :is-date-unavailable=\"isDateUnavailable\"\n :locale=\"locale\"\n :number-of-months=\"visibleMonths\"\n :readonly=\"isReadOnly\"\n :disabled=\"isDisabled\"\n />\n\n <slot name=\"calendarBottomContent\" />\n </DatePickerContent>\n </DatePickerRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAkId,MAAM,OAAO;EAUb,MAAM,aAAa,SAAyC,SAAC,aAAY;EACzE,MAAM,YAAY,SAAoB,SAAC,OAAM;EAE7C,MAAM,UAAU,eAAe,oBAAoB,CAAA;EAGnD,MAAM,iBAAiB,SAA2B;GAChD,WAAW,WAAW,SAAS;GAC/B,MAAM,QAA0B;AAAE,eAAW,QAAQ,OAAO;;GAC7D,CAAA;EAOD,M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ue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/date-picker/DatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport {\n DatePickerRoot,\n DatePickerTrigger,\n DatePickerContent,\n} from 'reka-ui'\nimport type { DateValue } from '@internationalized/date'\nimport type { CalendarDateTime, ZonedDateTime } from '@internationalized/date'\nimport { datePickerVariants, type DateInputVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport Calendar from '../calendar/Calendar.vue'\nimport DateInput from '../date-input/DateInput.vue'\n\nconst props = withDefaults(defineProps<{\n /* Field appearance — forwarded to DateInput */\n variant?: DateInputVariants['variant']\n size?: DateInputVariants['size']\n color?: DateInputVariants['color']\n labelPlacement?: DateInputVariants['labelPlacement']\n fullWidth?: boolean\n\n defaultValue?: DateValue\n defaultOpen?: boolean\n defaultPlaceholder?: DateValue\n placeholderValue?: DateValue\n minValue?: DateValue\n maxValue?: DateValue\n isDateUnavailable?: (date: DateValue) => boolean\n isDateDisabled?: (date: DateValue) => boolean\n locale?: string\n granularity?: 'day' | 'hour' | 'minute' | 'second'\n hourCycle?: 12 | 24\n /** Steps for segment keyboard navigation. */\n step?: Partial<Record<'hour' | 'minute' | 'second' | 'millisecond', number>>\n label?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isReadOnly?: boolean\n isRequired?: boolean\n name?: string\n hideTimeZone?: boolean\n visibleMonths?: number\n pageBehavior?: 'visible' | 'single'\n closeOnSelect?: boolean\n modal?: boolean\n /** Text direction. */\n dir?: 'ltr' | 'rtl'\n /** HTML id attribute forwarded to the root DatePickerRoot element. */\n id?: string\n /** Marks the field as required. */\n required?: boolean\n /** Use paged navigation (advance by numberOfMonths). */\n pagedNavigation?: boolean\n /** Day the week starts on. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n /** Format for weekday header cells. */\n weekdayFormat?: 'narrow' | 'short' | 'long'\n /** Always show 6 weeks per month. */\n fixedWeeks?: boolean\n /** Number of months shown in the calendar. */\n numberOfMonths?: number\n /** Prevent deselecting a selected date. */\n preventDeselect?: boolean\n /** Render trigger as a different element. */\n triggerAs?: string\n /** Render trigger child as root element. */\n triggerAsChild?: boolean\n /** Portal target for the content. */\n portal?: string | HTMLElement\n /** Force the content to stay mounted. */\n forceMount?: boolean\n /** Side of the anchor the content appears on. */\n side?: 'top' | 'right' | 'bottom' | 'left'\n /** Distance in px from the anchor. */\n sideOffset?: number\n /** Allow flipping to opposite side. */\n sideFlip?: boolean\n /** Alignment of the content relative to the anchor. */\n align?: 'start' | 'center' | 'end'\n /** Offset along the align axis. */\n alignOffset?: number\n /** Allow flipping alignment. */\n alignFlip?: boolean\n /** Avoid collisions with the viewport. */\n avoidCollisions?: boolean\n /** Elements to use as collision boundaries. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Padding for collision detection. */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n /** Padding between arrow and content edge. */\n arrowPadding?: number\n /** Hide the arrow when it is shifted. */\n hideShiftedArrow?: boolean\n /** Sticky behavior when overflowing. */\n sticky?: 'partial' | 'always'\n /** Hide content when anchor is detached. */\n hideWhenDetached?: boolean\n /** CSS position strategy. */\n positionStrategy?: 'fixed' | 'absolute'\n /** When to recalculate position. */\n updatePositionStrategy?: 'always' | 'optimized'\n /** Disable position update on layout shift. */\n disableUpdateOnLayoutShift?: boolean\n /** Prioritize keeping content in viewport. */\n prioritizePosition?: boolean\n /** Virtual reference element for positioning. */\n reference?: object | null\n /** Render content as a different element. */\n contentAs?: string\n /** Render content child as root element. */\n contentAsChild?: boolean\n /** Disable pointer events outside the content. */\n disableOutsidePointerEvents?: boolean\n class?: ClassValue\n /** Override classes for individual slots (base, trigger, triggerIndicator, popover) */\n classNames?: Partial<{\n base: ClassValue\n trigger: ClassValue\n triggerIndicator: ClassValue\n popover: ClassValue\n calendar: Partial<{\n base: ClassValue\n header: ClassValue\n navButton: ClassValue\n navButtonIcon: ClassValue\n heading: ClassValue\n headingButton: ClassValue\n grid: ClassValue\n gridHeader: ClassValue\n gridRow: ClassValue\n headerCell: ClassValue\n gridBody: ClassValue\n cell: ClassValue\n cellButton: ClassValue\n monthGrid: ClassValue\n monthGridBody: ClassValue\n monthGridRow: ClassValue\n monthCell: ClassValue\n yearView: Partial<{\n header: ClassValue\n navButton: ClassValue\n navButtonIcon: ClassValue\n heading: ClassValue\n yearGrid: ClassValue\n yearGridBody: ClassValue\n yearGridRow: ClassValue\n yearCell: ClassValue\n }>\n }>\n dateInput: Partial<{\n label: ClassValue\n mainWrapper: ClassValue\n inputWrapper: ClassValue\n startContent: ClassValue\n segmentList: ClassValue\n segment: ClassValue\n endContent: ClassValue\n helperWrapper: ClassValue\n errorMessage: ClassValue\n description: ClassValue\n }>\n }>\n}>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: false,\n isRequired: false,\n hideTimeZone: false,\n closeOnSelect: true,\n modal: false,\n visibleMonths: 1,\n defaultOpen: false,\n avoidCollisions: true,\n collisionPadding: 8,\n prioritizePosition: true,\n})\n\nconst emit = defineEmits<{\n 'update:placeholder': [value: DateValue | undefined]\n 'escape-key-down': [event: KeyboardEvent]\n 'pointer-down-outside': [event: Event]\n 'focus-outside': [event: Event]\n 'interact-outside': [event: Event]\n 'open-auto-focus': [event: Event]\n 'close-auto-focus': [event: Event]\n}>()\n\nconst modelValue = defineModel<DateValue | null | undefined>('modelValue')\nconst openModel = defineModel<boolean>('open')\n\nconst slotFns = computed(() => datePickerVariants())\n\n// Reka treats `undefined` as \"uncontrolled mode\" — always pass null (controlled + empty) instead.\nconst rekaModelValue = computed<DateValue | null>({\n get: () => modelValue.value ?? null,\n set: (val: DateValue | null) => { modelValue.value = val ?? null },\n})\n\n// Sync Calendar's `DateValue` v-model with DatePicker's `DateValue | null` model,\n// and close the popover on selection when closeOnSelect is enabled.\n// When the current value carries a time component (CalendarDateTime / ZonedDateTime),\n// preserve it so clicking a date in the calendar doesn't wipe out the time the user\n// typed into the field segments.\nconst calendarValue = computed<DateValue | undefined>({\n get: () => modelValue.value ?? undefined,\n set: (val) => {\n if (val != null && modelValue.value != null && 'hour' in modelValue.value) {\n const existing = modelValue.value as CalendarDateTime | ZonedDateTime\n modelValue.value = existing.set({ year: val.year, month: val.month, day: val.day })\n } else {\n modelValue.value = val ?? null\n }\n if (props.closeOnSelect && val != null) {\n openModel.value = false\n }\n },\n})\n</script>\n\n<template>\n <DatePickerRoot\n v-model=\"rekaModelValue\"\n v-model:open=\"openModel\"\n :default-value=\"defaultValue\"\n :default-open=\"defaultOpen\"\n :default-placeholder=\"defaultPlaceholder\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-unavailable=\"isDateUnavailable\"\n :is-date-disabled=\"isDateDisabled\"\n :locale=\"locale\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :step=\"step\"\n :disabled=\"isDisabled\"\n :readonly=\"isReadOnly\"\n :name=\"name\"\n :dir=\"dir\"\n :id=\"id\"\n :required=\"required\"\n :paged-navigation=\"pagedNavigation\"\n :week-starts-on=\"weekStartsOn\"\n :weekday-format=\"weekdayFormat\"\n :fixed-weeks=\"fixedWeeks\"\n :number-of-months=\"numberOfMonths ?? visibleMonths\"\n :prevent-deselect=\"preventDeselect\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n data-slot=\"date-picker\"\n >\n <!-- DateInput hosts label/helper/field; trigger sits in its endContent slot -->\n <DateInput\n v-model=\"modelValue\"\n :variant=\"variant\"\n :size=\"size\"\n :color=\"color\"\n :label-placement=\"labelPlacement\"\n :full-width=\"fullWidth\"\n :default-value=\"defaultValue\"\n :placeholder-value=\"placeholderValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :granularity=\"granularity\"\n :hour-cycle=\"hourCycle\"\n :locale=\"locale\"\n :label=\"label\"\n :description=\"description\"\n :error-message=\"errorMessage\"\n :is-invalid=\"isInvalid\"\n :is-disabled=\"isDisabled\"\n :is-read-only=\"isReadOnly\"\n :is-required=\"isRequired\"\n :name=\"name\"\n :hide-time-zone=\"hideTimeZone\"\n :class-names=\"props.classNames?.dateInput\"\n >\n <template #endContent>\n <DatePickerTrigger\n :class=\"composeClassName(slotFns.trigger(), props.classNames?.trigger)\"\n :as=\"triggerAs\"\n :as-child=\"triggerAsChild\"\n aria-label=\"Open date picker\"\n @mousedown.prevent\n >\n <slot name=\"selectorIcon\">\n <svg\n :class=\"composeClassName(slotFns.triggerIndicator(), props.classNames?.triggerIndicator)\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect\n x=\"3\"\n y=\"4\"\n width=\"18\"\n height=\"18\"\n rx=\"2\"\n ry=\"2\"\n />\n <line\n x1=\"16\"\n y1=\"2\"\n x2=\"16\"\n y2=\"6\"\n />\n <line\n x1=\"8\"\n y1=\"2\"\n x2=\"8\"\n y2=\"6\"\n />\n <line\n x1=\"3\"\n y1=\"10\"\n x2=\"21\"\n y2=\"10\"\n />\n </svg>\n </slot>\n </DatePickerTrigger>\n </template>\n </DateInput>\n\n <!-- Popover (portaled + positioned by Reka) -->\n <DatePickerContent\n :class=\"composeClassName(slotFns.popover(), props.classNames?.popover)\"\n data-slot=\"popover\"\n :side-offset=\"sideOffset ?? 8\"\n :portal=\"portal != null ? { to: portal } : undefined\"\n :force-mount=\"forceMount\"\n :side=\"side\"\n :side-flip=\"sideFlip\"\n :align=\"align\"\n :align-offset=\"alignOffset\"\n :align-flip=\"alignFlip\"\n :avoid-collisions=\"avoidCollisions\"\n :collision-boundary=\"collisionBoundary\"\n :collision-padding=\"collisionPadding\"\n :arrow-padding=\"arrowPadding\"\n :hide-shifted-arrow=\"hideShiftedArrow\"\n :sticky=\"sticky\"\n :hide-when-detached=\"hideWhenDetached\"\n :position-strategy=\"positionStrategy\"\n :update-position-strategy=\"updatePositionStrategy\"\n :disable-update-on-layout-shift=\"disableUpdateOnLayoutShift\"\n :prioritize-position=\"prioritizePosition\"\n :reference=\"(reference as any)\"\n :as=\"contentAs\"\n :as-child=\"contentAsChild\"\n :disable-outside-pointer-events=\"disableOutsidePointerEvents\"\n @escape-key-down=\"emit('escape-key-down', $event)\"\n @pointer-down-outside=\"emit('pointer-down-outside', $event)\"\n @focus-outside=\"emit('focus-outside', $event)\"\n @interact-outside=\"emit('interact-outside', $event)\"\n @open-auto-focus=\"emit('open-auto-focus', $event)\"\n @close-auto-focus=\"emit('close-auto-focus', $event)\"\n >\n <slot name=\"calendarTopContent\" />\n\n <Calendar\n v-model=\"calendarValue\"\n :default-value=\"defaultValue\"\n :default-placeholder=\"placeholderValue ?? defaultValue\"\n :min-value=\"minValue\"\n :max-value=\"maxValue\"\n :is-date-disabled=\"isDateDisabled\"\n :is-date-unavailable=\"isDateUnavailable\"\n :locale=\"locale\"\n :number-of-months=\"visibleMonths\"\n :readonly=\"isReadOnly\"\n :disabled=\"isDisabled\"\n :class-names=\"props.classNames?.calendar\"\n />\n\n <slot name=\"calendarBottomContent\" />\n </DatePickerContent>\n </DatePickerRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EA2Kd,MAAM,OAAO;EAUb,MAAM,aAAa,SAAyC,SAAC,aAAY;EACzE,MAAM,YAAY,SAAoB,SAAC,OAAM;EAE7C,MAAM,UAAU,eAAe,oBAAoB,CAAA;EAGnD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