@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
|
@@ -6,15 +6,6 @@ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock
|
|
|
6
6
|
import { radioGroupVariants } from "@auronui/styles";
|
|
7
7
|
import { RadioGroupRoot } from "reka-ui";
|
|
8
8
|
//#region src/components/radio/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var _hoisted_1 = { class: "radio-group__wrapper" };
|
|
10
|
-
var _hoisted_2 = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "radio-group__error-message"
|
|
13
|
-
};
|
|
14
|
-
var _hoisted_3 = {
|
|
15
|
-
key: 2,
|
|
16
|
-
class: "radio-group__description"
|
|
17
|
-
};
|
|
18
9
|
var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
19
10
|
__name: "RadioGroup",
|
|
20
11
|
props: {
|
|
@@ -57,7 +48,8 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
57
48
|
default: void 0
|
|
58
49
|
},
|
|
59
50
|
class: {},
|
|
60
|
-
items: {}
|
|
51
|
+
items: {},
|
|
52
|
+
classNames: {}
|
|
61
53
|
},
|
|
62
54
|
emits: ["update:modelValue"],
|
|
63
55
|
setup(__props, { emit: __emit }) {
|
|
@@ -71,7 +63,15 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
71
63
|
isInvalid: toRef(props, "isInvalid")
|
|
72
64
|
});
|
|
73
65
|
const labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`;
|
|
74
|
-
const
|
|
66
|
+
const slotFns = computed(() => radioGroupVariants({ variant: props.variant }));
|
|
67
|
+
function itemClassNames(item) {
|
|
68
|
+
return {
|
|
69
|
+
base: composeClassName(props.classNames?.radio?.base, item.classNames?.base),
|
|
70
|
+
control: composeClassName(props.classNames?.radio?.control, item.classNames?.control),
|
|
71
|
+
indicator: composeClassName(props.classNames?.radio?.indicator, item.classNames?.indicator),
|
|
72
|
+
content: composeClassName(props.classNames?.radio?.content, item.classNames?.content)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
75
|
return (_ctx, _cache) => {
|
|
76
76
|
return openBlock(), createBlock(unref(RadioGroupRoot), {
|
|
77
77
|
"model-value": props.modelValue,
|
|
@@ -86,26 +86,39 @@ var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
86
86
|
as: props.as,
|
|
87
87
|
required: unref(isRequired),
|
|
88
88
|
"aria-labelledby": props.label ? labelId : void 0,
|
|
89
|
-
class: normalizeClass(unref(composeClassName)(
|
|
89
|
+
class: normalizeClass(unref(composeClassName)(slotFns.value.base(), props.class)),
|
|
90
90
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $event != null && emit("update:modelValue", String($event)))
|
|
91
91
|
}, {
|
|
92
92
|
default: withCtx(() => [
|
|
93
93
|
props.label ? (openBlock(), createElementBlock("span", {
|
|
94
94
|
key: 0,
|
|
95
95
|
id: labelId,
|
|
96
|
-
class:
|
|
97
|
-
}, toDisplayString(props.label),
|
|
98
|
-
createElementVNode("div",
|
|
96
|
+
class: normalizeClass(unref(composeClassName)(slotFns.value.label(), props.classNames?.label))
|
|
97
|
+
}, toDisplayString(props.label), 3)) : createCommentVNode("", true),
|
|
98
|
+
createElementVNode("div", { class: normalizeClass(unref(composeClassName)(slotFns.value.wrapper(), props.classNames?.wrapper)) }, [props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.items, (item) => {
|
|
99
99
|
return openBlock(), createBlock(Radio_default, {
|
|
100
100
|
key: item.value,
|
|
101
101
|
value: item.value,
|
|
102
|
-
"is-disabled": item.disabled
|
|
102
|
+
"is-disabled": item.disabled,
|
|
103
|
+
class: normalizeClass(item.class),
|
|
104
|
+
"class-names": itemClassNames(item)
|
|
103
105
|
}, {
|
|
104
106
|
default: withCtx(() => [createTextVNode(toDisplayString(item.label ?? item.value), 1)]),
|
|
105
107
|
_: 2
|
|
106
|
-
}, 1032, [
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
}, 1032, [
|
|
109
|
+
"value",
|
|
110
|
+
"is-disabled",
|
|
111
|
+
"class",
|
|
112
|
+
"class-names"
|
|
113
|
+
]);
|
|
114
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 2),
|
|
115
|
+
props.isInvalid && props.errorMessage ? (openBlock(), createElementBlock("span", {
|
|
116
|
+
key: 1,
|
|
117
|
+
class: normalizeClass(unref(composeClassName)(slotFns.value.errorMessage(), props.classNames?.errorMessage))
|
|
118
|
+
}, toDisplayString(props.errorMessage), 3)) : props.description ? (openBlock(), createElementBlock("span", {
|
|
119
|
+
key: 2,
|
|
120
|
+
class: normalizeClass(unref(composeClassName)(slotFns.value.description(), props.classNames?.description))
|
|
121
|
+
}, toDisplayString(props.description), 3)) : createCommentVNode("", true)
|
|
109
122
|
]),
|
|
110
123
|
_: 3
|
|
111
124
|
}, 8, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/radio/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { RadioGroupRoot } from 'reka-ui'\nimport { radioGroupVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useRadioGroupProvide } from './radio-group.context'\nimport Radio from './Radio.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\ntype RadioShorthandItem = {
|
|
1
|
+
{"version":3,"file":"RadioGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/radio/RadioGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { RadioGroupRoot } from 'reka-ui'\nimport { radioGroupVariants, type RadioGroupVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useRadioGroupProvide } from './radio-group.context'\nimport Radio from './Radio.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\ntype RadioShorthandItem = {\n value: string\n label?: string\n disabled?: boolean\n class?: ClassValue\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n indicator: ClassValue\n content: ClassValue\n }>\n}\n\nconst props = withDefaults(defineProps<{\n variant?: RadioGroupVariants['variant']\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n isInvalid?: boolean\n modelValue?: string\n defaultValue?: string\n name?: string\n orientation?: 'horizontal' | 'vertical'\n label?: string\n description?: string\n errorMessage?: string\n /** Text direction forwarded to RadioGroupRoot. */\n dir?: 'ltr' | 'rtl'\n /** Whether keyboard navigation loops from last to first item. */\n loop?: boolean\n /** Whether RadioGroupRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render RadioGroupRoot as. */\n as?: string\n isRequired?: boolean\n /**\n * Whether the radio group is required.\n * @deprecated Use isRequired instead.\n */\n required?: boolean\n class?: string\n /** Shorthand API: render radio options from an array instead of the compound slot API */\n items?: RadioShorthandItem[]\n /** Per-slot class overrides */\n classNames?: Partial<{\n label: ClassValue\n wrapper: ClassValue\n description: ClassValue\n errorMessage: ClassValue\n /** Applied to every shorthand-rendered Radio, before any per-item override */\n radio: Partial<{\n base: ClassValue\n control: ClassValue\n indicator: ClassValue\n content: ClassValue\n }>\n }>\n}>(), {\n variant: 'primary',\n isDisabled: undefined,\n disabled: undefined,\n isInvalid: false,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n errorMessage: undefined,\n dir: undefined,\n loop: true,\n asChild: false,\n as: undefined,\n isRequired: undefined,\n required: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'RadioGroup', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst isRequired = useDeprecatedBooleanProp(\n 'RadioGroup', 'isRequired', () => props.isRequired, 'required', () => props.required,\n)\n\n// Provide context to child Radio components\nuseRadioGroupProvide({\n variant: toRef(props, 'variant'),\n disabled: isDisabled,\n isInvalid: toRef(props, 'isInvalid'),\n})\n\nconst labelId = `radio-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst slotFns = computed(() =>\n radioGroupVariants({ variant: props.variant })\n)\n\n// Group-wide radio classNames apply first; per-item classNames win on conflict.\nfunction itemClassNames(item: RadioShorthandItem) {\n return {\n base: composeClassName(props.classNames?.radio?.base, item.classNames?.base),\n control: composeClassName(props.classNames?.radio?.control, item.classNames?.control),\n indicator: composeClassName(props.classNames?.radio?.indicator, item.classNames?.indicator),\n content: composeClassName(props.classNames?.radio?.content, item.classNames?.content),\n }\n}\n</script>\n\n<template>\n <RadioGroupRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :disabled=\"isDisabled\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :name=\"props.name\"\n :orientation=\"props.orientation\"\n :dir=\"props.dir\"\n :loop=\"props.loop\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"isRequired\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :class=\"composeClassName(slotFns.base(), props.class)\"\n @update:model-value=\"$event != null && emit('update:modelValue', String($event))\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n :class=\"composeClassName(slotFns.label(), props.classNames?.label)\"\n >{{ props.label }}</span>\n <div :class=\"composeClassName(slotFns.wrapper(), props.classNames?.wrapper)\">\n <template v-if=\"props.items\">\n <Radio\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.disabled\"\n :class=\"item.class\"\n :class-names=\"itemClassNames(item)\"\n >{{ item.label ?? item.value }}</Radio>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n :class=\"composeClassName(slotFns.errorMessage(), props.classNames?.errorMessage)\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n :class=\"composeClassName(slotFns.description(), props.classNames?.description)\"\n >{{ props.description }}</span>\n </RadioGroupRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ;EAgEd,MAAM,OAAO;EAIb,MAAM,aAAa,yBACjB,cAAc,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SAC9E;EAEA,MAAM,aAAa,yBACjB,cAAc,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SAC9E;AAGA,uBAAqB;GACnB,SAAS,MAAM,OAAO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A,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA,EAAA,EAAA,CACxD,MAAM,SAAA,UAAA,KAAA,EACpB,mBAOuC,UAAA,EAAA,KAAA,GAAA,EAAA,WANtB,MAAM,QAAd,SAAI;0BADb,YAOuC,eAAA;OALpC,KAAK,KAAK;OACV,OAAO,KAAK;OACZ,eAAa,KAAK;OAClB,OAAK,eAAE,KAAK,MAAK;OACjB,eAAa,eAAe,KAAI;;8BACJ,CAAA,gBAAA,gBAA3B,KAAK,SAAS,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA;;;;;;;;iBAE9B,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,EAAA,EAAA;KAGT,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAGgC,QAAA;;MAD7B,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,cAAY,EAAI,MAAM,YAAY,aAAY,CAAA;wBAC7E,MAAM,aAAY,EAAA,EAAA,IAET,MAAM,eAAA,WAAA,EADnB,mBAG+B,QAAA;;MAD5B,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,aAAW,EAAI,MAAM,YAAY,YAAW,CAAA;wBAC3E,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollArea.js","names":[],"sources":["../../../src/components/scroll-area/ScrollArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScrollAreaRoot,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n} from 'reka-ui'\nimport { composeClassName } from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n class?: string\n viewportClass?: string\n type?: 'auto' | 'always' | 'scroll' | 'hover'\n scrollHideDelay?: number\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Text direction for the scroll area */\n dir?: 'ltr' | 'rtl'\n /** Render root as a different element */\n as?: string\n /** Merge root props onto child element */\n asChild?: boolean\n /** Nonce for the viewport's inline style */\n viewportNonce?: string\n /** Render viewport as a different element */\n viewportAs?: string\n /** Merge viewport props onto child element */\n viewportAsChild?: boolean\n /** Keep scrollbar mounted when hidden */\n scrollbarForceMount?: boolean\n /** Render scrollbar as a different element */\n scrollbarAs?: string\n /** Merge scrollbar props onto child element */\n scrollbarAsChild?: boolean\n /** Render thumb as a different element */\n thumbAs?: string\n /** Merge thumb props onto child element */\n thumbAsChild?: boolean\n /** Render corner as a different element */\n cornerAs?: string\n /** Merge corner props onto child element */\n cornerAsChild?: boolean\n}>(), {\n type: 'hover',\n scrollHideDelay: 600,\n orientation: 'vertical',\n})\n</script>\n\n<template>\n <ScrollAreaRoot\n :type=\"props.type\"\n :scroll-hide-delay=\"props.scrollHideDelay\"\n :dir=\"props.dir\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(
|
|
1
|
+
{"version":3,"file":"ScrollArea.js","names":[],"sources":["../../../src/components/scroll-area/ScrollArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScrollAreaRoot,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n} from 'reka-ui'\nimport { scrollAreaVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n class?: string\n viewportClass?: string\n type?: 'auto' | 'always' | 'scroll' | 'hover'\n scrollHideDelay?: number\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Text direction for the scroll area */\n dir?: 'ltr' | 'rtl'\n /** Render root as a different element */\n as?: string\n /** Merge root props onto child element */\n asChild?: boolean\n /** Nonce for the viewport's inline style */\n viewportNonce?: string\n /** Render viewport as a different element */\n viewportAs?: string\n /** Merge viewport props onto child element */\n viewportAsChild?: boolean\n /** Keep scrollbar mounted when hidden */\n scrollbarForceMount?: boolean\n /** Render scrollbar as a different element */\n scrollbarAs?: string\n /** Merge scrollbar props onto child element */\n scrollbarAsChild?: boolean\n /** Render thumb as a different element */\n thumbAs?: string\n /** Merge thumb props onto child element */\n thumbAsChild?: boolean\n /** Render corner as a different element */\n cornerAs?: string\n /** Merge corner props onto child element */\n cornerAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n root: ClassValue\n viewport: ClassValue\n scrollbar: ClassValue\n thumb: ClassValue\n corner: ClassValue\n }>\n}>(), {\n type: 'hover',\n scrollHideDelay: 600,\n orientation: 'vertical',\n})\n\nconst slotFns = scrollAreaVariants()\n</script>\n\n<template>\n <ScrollAreaRoot\n :type=\"props.type\"\n :scroll-hide-delay=\"props.scrollHideDelay\"\n :dir=\"props.dir\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.root(), props.class, props.classNames?.root)\"\n >\n <ScrollAreaViewport\n :nonce=\"props.viewportNonce\"\n :as=\"props.viewportAs\"\n :as-child=\"props.viewportAsChild\"\n :class=\"composeClassName(slotFns.viewport(), props.viewportClass, props.classNames?.viewport)\"\n >\n <slot />\n </ScrollAreaViewport>\n\n <ScrollAreaScrollbar\n v-if=\"props.orientation === 'vertical' || props.orientation === 'both'\"\n orientation=\"vertical\"\n :force-mount=\"props.scrollbarForceMount\"\n :as=\"props.scrollbarAs\"\n :as-child=\"props.scrollbarAsChild\"\n :class=\"composeClassName(slotFns.scrollbar(), 'scroll-area__scrollbar--vertical', props.classNames?.scrollbar)\"\n >\n <ScrollAreaThumb\n :as=\"props.thumbAs\"\n :as-child=\"props.thumbAsChild\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </ScrollAreaScrollbar>\n\n <ScrollAreaScrollbar\n v-if=\"props.orientation === 'horizontal' || props.orientation === 'both'\"\n orientation=\"horizontal\"\n :force-mount=\"props.scrollbarForceMount\"\n :as=\"props.scrollbarAs\"\n :as-child=\"props.scrollbarAsChild\"\n :class=\"composeClassName(slotFns.scrollbar(), 'scroll-area__scrollbar--horizontal', props.classNames?.scrollbar)\"\n >\n <ScrollAreaThumb\n :as=\"props.thumbAs\"\n :as-child=\"props.thumbAsChild\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </ScrollAreaScrollbar>\n\n <ScrollAreaCorner\n v-if=\"props.orientation === 'both'\"\n :as=\"props.cornerAs\"\n :as-child=\"props.cornerAsChild\"\n :class=\"composeClassName(slotFns.corner(), props.classNames?.corner)\"\n />\n </ScrollAreaRoot>\n</template>\n"],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { createBlock, createCommentVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
3
|
+
import { scrollAreaVariants } from "@auronui/styles";
|
|
3
4
|
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "reka-ui";
|
|
4
5
|
//#region src/components/scroll-area/ScrollArea.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var ScrollArea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -22,10 +23,12 @@ var ScrollArea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
22
23
|
thumbAs: {},
|
|
23
24
|
thumbAsChild: { type: Boolean },
|
|
24
25
|
cornerAs: {},
|
|
25
|
-
cornerAsChild: { type: Boolean }
|
|
26
|
+
cornerAsChild: { type: Boolean },
|
|
27
|
+
classNames: {}
|
|
26
28
|
},
|
|
27
29
|
setup(__props) {
|
|
28
30
|
const props = __props;
|
|
31
|
+
const slotFns = scrollAreaVariants();
|
|
29
32
|
return (_ctx, _cache) => {
|
|
30
33
|
return openBlock(), createBlock(unref(ScrollAreaRoot), {
|
|
31
34
|
type: props.type,
|
|
@@ -33,14 +36,14 @@ var ScrollArea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
33
36
|
dir: props.dir,
|
|
34
37
|
as: props.as,
|
|
35
38
|
"as-child": props.asChild,
|
|
36
|
-
class: normalizeClass(unref(composeClassName)(
|
|
39
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).root(), props.class, props.classNames?.root))
|
|
37
40
|
}, {
|
|
38
41
|
default: withCtx(() => [
|
|
39
42
|
createVNode(unref(ScrollAreaViewport), {
|
|
40
43
|
nonce: props.viewportNonce,
|
|
41
44
|
as: props.viewportAs,
|
|
42
45
|
"as-child": props.viewportAsChild,
|
|
43
|
-
class: normalizeClass(unref(composeClassName)(
|
|
46
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).viewport(), props.viewportClass, props.classNames?.viewport))
|
|
44
47
|
}, {
|
|
45
48
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
46
49
|
_: 3
|
|
@@ -56,18 +59,23 @@ var ScrollArea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
56
59
|
"force-mount": props.scrollbarForceMount,
|
|
57
60
|
as: props.scrollbarAs,
|
|
58
61
|
"as-child": props.scrollbarAsChild,
|
|
59
|
-
class: "scroll-area__scrollbar
|
|
62
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).scrollbar(), "scroll-area__scrollbar--vertical", props.classNames?.scrollbar))
|
|
60
63
|
}, {
|
|
61
64
|
default: withCtx(() => [createVNode(unref(ScrollAreaThumb), {
|
|
62
65
|
as: props.thumbAs,
|
|
63
66
|
"as-child": props.thumbAsChild,
|
|
64
|
-
class:
|
|
65
|
-
}, null, 8, [
|
|
67
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).thumb(), props.classNames?.thumb))
|
|
68
|
+
}, null, 8, [
|
|
69
|
+
"as",
|
|
70
|
+
"as-child",
|
|
71
|
+
"class"
|
|
72
|
+
])]),
|
|
66
73
|
_: 1
|
|
67
74
|
}, 8, [
|
|
68
75
|
"force-mount",
|
|
69
76
|
"as",
|
|
70
|
-
"as-child"
|
|
77
|
+
"as-child",
|
|
78
|
+
"class"
|
|
71
79
|
])) : createCommentVNode("", true),
|
|
72
80
|
props.orientation === "horizontal" || props.orientation === "both" ? (openBlock(), createBlock(unref(ScrollAreaScrollbar), {
|
|
73
81
|
key: 1,
|
|
@@ -75,25 +83,34 @@ var ScrollArea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
75
83
|
"force-mount": props.scrollbarForceMount,
|
|
76
84
|
as: props.scrollbarAs,
|
|
77
85
|
"as-child": props.scrollbarAsChild,
|
|
78
|
-
class: "scroll-area__scrollbar
|
|
86
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).scrollbar(), "scroll-area__scrollbar--horizontal", props.classNames?.scrollbar))
|
|
79
87
|
}, {
|
|
80
88
|
default: withCtx(() => [createVNode(unref(ScrollAreaThumb), {
|
|
81
89
|
as: props.thumbAs,
|
|
82
90
|
"as-child": props.thumbAsChild,
|
|
83
|
-
class:
|
|
84
|
-
}, null, 8, [
|
|
91
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).thumb(), props.classNames?.thumb))
|
|
92
|
+
}, null, 8, [
|
|
93
|
+
"as",
|
|
94
|
+
"as-child",
|
|
95
|
+
"class"
|
|
96
|
+
])]),
|
|
85
97
|
_: 1
|
|
86
98
|
}, 8, [
|
|
87
99
|
"force-mount",
|
|
88
100
|
"as",
|
|
89
|
-
"as-child"
|
|
101
|
+
"as-child",
|
|
102
|
+
"class"
|
|
90
103
|
])) : createCommentVNode("", true),
|
|
91
104
|
props.orientation === "both" ? (openBlock(), createBlock(unref(ScrollAreaCorner), {
|
|
92
105
|
key: 2,
|
|
93
106
|
as: props.cornerAs,
|
|
94
107
|
"as-child": props.cornerAsChild,
|
|
95
|
-
class:
|
|
96
|
-
}, null, 8, [
|
|
108
|
+
class: normalizeClass(unref(composeClassName)(unref(slotFns).corner(), props.classNames?.corner))
|
|
109
|
+
}, null, 8, [
|
|
110
|
+
"as",
|
|
111
|
+
"as-child",
|
|
112
|
+
"class"
|
|
113
|
+
])) : createCommentVNode("", true)
|
|
97
114
|
]),
|
|
98
115
|
_: 3
|
|
99
116
|
}, 8, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollArea.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/scroll-area/ScrollArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScrollAreaRoot,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n} from 'reka-ui'\nimport { composeClassName } from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n class?: string\n viewportClass?: string\n type?: 'auto' | 'always' | 'scroll' | 'hover'\n scrollHideDelay?: number\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Text direction for the scroll area */\n dir?: 'ltr' | 'rtl'\n /** Render root as a different element */\n as?: string\n /** Merge root props onto child element */\n asChild?: boolean\n /** Nonce for the viewport's inline style */\n viewportNonce?: string\n /** Render viewport as a different element */\n viewportAs?: string\n /** Merge viewport props onto child element */\n viewportAsChild?: boolean\n /** Keep scrollbar mounted when hidden */\n scrollbarForceMount?: boolean\n /** Render scrollbar as a different element */\n scrollbarAs?: string\n /** Merge scrollbar props onto child element */\n scrollbarAsChild?: boolean\n /** Render thumb as a different element */\n thumbAs?: string\n /** Merge thumb props onto child element */\n thumbAsChild?: boolean\n /** Render corner as a different element */\n cornerAs?: string\n /** Merge corner props onto child element */\n cornerAsChild?: boolean\n}>(), {\n type: 'hover',\n scrollHideDelay: 600,\n orientation: 'vertical',\n})\n</script>\n\n<template>\n <ScrollAreaRoot\n :type=\"props.type\"\n :scroll-hide-delay=\"props.scrollHideDelay\"\n :dir=\"props.dir\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(
|
|
1
|
+
{"version":3,"file":"ScrollArea.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/scroll-area/ScrollArea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScrollAreaRoot,\n ScrollAreaViewport,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaCorner,\n} from 'reka-ui'\nimport { scrollAreaVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n class?: string\n viewportClass?: string\n type?: 'auto' | 'always' | 'scroll' | 'hover'\n scrollHideDelay?: number\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Text direction for the scroll area */\n dir?: 'ltr' | 'rtl'\n /** Render root as a different element */\n as?: string\n /** Merge root props onto child element */\n asChild?: boolean\n /** Nonce for the viewport's inline style */\n viewportNonce?: string\n /** Render viewport as a different element */\n viewportAs?: string\n /** Merge viewport props onto child element */\n viewportAsChild?: boolean\n /** Keep scrollbar mounted when hidden */\n scrollbarForceMount?: boolean\n /** Render scrollbar as a different element */\n scrollbarAs?: string\n /** Merge scrollbar props onto child element */\n scrollbarAsChild?: boolean\n /** Render thumb as a different element */\n thumbAs?: string\n /** Merge thumb props onto child element */\n thumbAsChild?: boolean\n /** Render corner as a different element */\n cornerAs?: string\n /** Merge corner props onto child element */\n cornerAsChild?: boolean\n /** Per-slot class overrides */\n classNames?: Partial<{\n root: ClassValue\n viewport: ClassValue\n scrollbar: ClassValue\n thumb: ClassValue\n corner: ClassValue\n }>\n}>(), {\n type: 'hover',\n scrollHideDelay: 600,\n orientation: 'vertical',\n})\n\nconst slotFns = scrollAreaVariants()\n</script>\n\n<template>\n <ScrollAreaRoot\n :type=\"props.type\"\n :scroll-hide-delay=\"props.scrollHideDelay\"\n :dir=\"props.dir\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.root(), props.class, props.classNames?.root)\"\n >\n <ScrollAreaViewport\n :nonce=\"props.viewportNonce\"\n :as=\"props.viewportAs\"\n :as-child=\"props.viewportAsChild\"\n :class=\"composeClassName(slotFns.viewport(), props.viewportClass, props.classNames?.viewport)\"\n >\n <slot />\n </ScrollAreaViewport>\n\n <ScrollAreaScrollbar\n v-if=\"props.orientation === 'vertical' || props.orientation === 'both'\"\n orientation=\"vertical\"\n :force-mount=\"props.scrollbarForceMount\"\n :as=\"props.scrollbarAs\"\n :as-child=\"props.scrollbarAsChild\"\n :class=\"composeClassName(slotFns.scrollbar(), 'scroll-area__scrollbar--vertical', props.classNames?.scrollbar)\"\n >\n <ScrollAreaThumb\n :as=\"props.thumbAs\"\n :as-child=\"props.thumbAsChild\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </ScrollAreaScrollbar>\n\n <ScrollAreaScrollbar\n v-if=\"props.orientation === 'horizontal' || props.orientation === 'both'\"\n orientation=\"horizontal\"\n :force-mount=\"props.scrollbarForceMount\"\n :as=\"props.scrollbarAs\"\n :as-child=\"props.scrollbarAsChild\"\n :class=\"composeClassName(slotFns.scrollbar(), 'scroll-area__scrollbar--horizontal', props.classNames?.scrollbar)\"\n >\n <ScrollAreaThumb\n :as=\"props.thumbAs\"\n :as-child=\"props.thumbAsChild\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </ScrollAreaScrollbar>\n\n <ScrollAreaCorner\n v-if=\"props.orientation === 'both'\"\n :as=\"props.cornerAs\"\n :as-child=\"props.cornerAsChild\"\n :class=\"composeClassName(slotFns.corner(), props.classNames?.corner)\"\n />\n </ScrollAreaRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EA8Cd,MAAM,UAAU,oBAAmB;;uBAIjC,YAqDiB,MAAA,eAAA,EAAA;IApDd,MAAM,MAAM;IACZ,qBAAmB,MAAM;IACzB,KAAK,MAAM;IACX,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,QAAO,CAAC,MAA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AA,EAAA;;MAHC,IAAI,MAAM;MACV,YAAU,MAAM;MAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,MAAA,QAAO,CAAC,QAAM,EAAI,MAAM,YAAY,OAAM,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":[],"sources":["../../../src/components/select/Select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, reactive, toRef, useAttrs, useId, useSlots } from 'vue'\nimport { SelectRoot } from 'reka-ui'\nimport { selectVariants, type SelectVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSelectProvide, type SelectItemValue, type SelectItemData } from './Select.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport SelectTrigger from './SelectTrigger.vue'\nimport SelectValue from './SelectValue.vue'\nimport SelectContent from './SelectContent.vue'\nimport SelectItem from './SelectItem.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport { useFormField } from '../../composables/useFormField'\nimport FieldLabel from '../_shared/FieldLabel.vue'\nimport FormFieldHelper from '../_shared/FormFieldHelper.vue'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: undefined,\n isReadonly: undefined,\n isRequired: false,\n multiple: false,\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n by: undefined,\n dir: undefined,\n autocomplete: undefined,\n items: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SelectItemValue | SelectItemValue[]]\n 'update:open': [value: boolean]\n}>()\n\nconst isReadOnly = useDeprecatedBooleanProp(\n 'Select', 'isReadOnly', () => props.isReadOnly, 'isReadonly', () => props.isReadonly,\n)\n\ntype Props = {\n /** Visual style of the field. @default 'flat' */\n variant?: SelectVariants['variant']\n /** Field height. @default 'md' */\n size?: SelectVariants['size']\n /** Accent color applied to focus ring + floating label. @default 'default' */\n color?: SelectVariants['color']\n /**\n * Where the `label` is rendered relative to the field.\n * - `inside`: floats above the trigger (shrinks when focused/filled)\n * - `outside`: sits above the field, static\n * - `outside-left`: sits to the left, horizontal layout\n * @default 'inside'\n */\n labelPlacement?: SelectVariants['labelPlacement']\n /** Stretches root wrapper to 100% width. @default false */\n fullWidth?: boolean\n /** Marks the field as invalid. Triggers danger styling and enables `errorMessage`. @default false */\n isInvalid?: boolean\n /** Disables the field. @default false */\n isDisabled?: boolean\n /** Makes the field read-only. @default false */\n isReadOnly?: boolean\n /** @deprecated Use isReadOnly instead. */\n isReadonly?: boolean\n /** Adds a required asterisk next to the label. @default false */\n isRequired?: boolean\n /** Placeholder shown when no value is selected. */\n placeholder?: string\n /** Form field name, for native form submission. */\n name?: string\n /** Field label. When omitted, the floating-label behavior is skipped. */\n label?: string\n /** Helper text displayed below the field. Suppressed when `isInvalid && errorMessage` is shown. */\n description?: string\n /** Error text displayed below the field. Only rendered when `isInvalid` is also true. */\n errorMessage?: string\n /** Extra classes merged onto the root wrapper via `composeClassName`. */\n class?: ClassValue\n /** Per-slot class name overrides via `composeClassName`. */\n classNames?: Partial<{\n base: ClassValue\n label: ClassValue\n mainWrapper: ClassValue\n helperWrapper: ClassValue\n errorMessage: ClassValue\n description: ClassValue\n }>\n\n /* ─── Select-specific ─────────────────────────────────────── */\n /** Two-way bound selected value. Accepts string or numeric keys. */\n modelValue?: SelectItemValue | SelectItemValue[]\n /** Initial selected value (uncontrolled). Accepts string or numeric keys. */\n defaultValue?: SelectItemValue | SelectItemValue[]\n /** Allow selecting multiple values. modelValue becomes string[]. @default false */\n multiple?: boolean\n /** Controls open state of the dropdown. */\n open?: boolean\n /** Initial open state of the dropdown (uncontrolled). */\n defaultOpen?: boolean\n /** Comparison key or function for value matching. */\n by?: string | ((a: SelectItemValue, b: SelectItemValue) => boolean)\n /** Text direction for the select. */\n dir?: 'ltr' | 'rtl'\n /** Native autocomplete attribute for the hidden input. */\n autocomplete?: string\n /**\n * Data-driven items for the terse API. When provided (and no SelectTrigger /\n * SelectContent is passed as a child), the trigger, value, and popover are\n * rendered internally. Use the `#item` slot to customize per-item rendering.\n */\n items?: SelectItemData[]\n}\n\nconst attrs = useAttrs()\nconst generatedId = useId()\nconst triggerId = computed(() => (attrs.id as string | undefined) ?? generatedId)\n\nconst slots = useSlots()\n// Tier 3 (advanced): consumer supplied explicit compound chrome → pass through.\n// Tier 1/2 (terse): render trigger/value/content internally.\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.({}), [SelectTrigger, SelectContent]),\n)\n\nconst {\n descriptionId,\n errorMessageId,\n showError,\n showDescription,\n hasHelper,\n ariaDescribedBy,\n hasLabel,\n showOutsideLabel,\n rootDataAttrs,\n} = useFormField({\n fieldId: () => triggerId.value,\n label: () => props.label,\n description: () => props.description,\n errorMessage: () => props.errorMessage,\n isInvalid: () => props.isInvalid,\n isDisabled: () => props.isDisabled,\n isReadOnly: () => isReadOnly.value,\n isRequired: () => props.isRequired,\n labelPlacement: () => props.labelPlacement,\n})\n\nconst slotFns = computed(() =>\n selectVariants({\n variant: props.variant,\n size: props.size,\n color: props.color,\n fullWidth: props.fullWidth,\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isReadonly: isReadOnly.value,\n hasLabel: hasLabel.value,\n labelPlacement: props.labelPlacement,\n }),\n)\n\n// Persistent item registry. SelectItem populates on first mount; entries\n// survive SelectContent unmount so SelectValue can render the label while\n// the popover is closed.\nconst itemRegistry = reactive(new Map<SelectItemValue, string>())\nconst registerItem = (value: SelectItemValue, label: string) => {\n itemRegistry.set(value, label)\n}\nconst itemLabel = (value: SelectItemValue | SelectItemValue[] | undefined | null): string => {\n if (value == null) return ''\n if (Array.isArray(value)) {\n // Fall back to the stringified value (handles numeric keys) when no label is\n // registered. Filter empty strings only — never use filter(Boolean), which\n // would drop a registered label for the numeric key 0.\n return value\n .map(v => String(itemRegistry.get(v) ?? v))\n .filter(s => s.length > 0)\n .join(', ')\n }\n return itemRegistry.get(value) ?? String(value)\n}\n\nfunction removeValue(value: SelectItemValue) {\n const current = Array.isArray(props.modelValue) ? props.modelValue : []\n emit('update:modelValue', current.filter(v => v !== value))\n}\n\nuseSelectProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n isReadonly: isReadOnly,\n isRequired: toRef(props, 'isRequired'),\n fullWidth: toRef(props, 'fullWidth'),\n hasLabel,\n labelPlacement: toRef(props, 'labelPlacement'),\n triggerId,\n label: toRef(props, 'label'),\n ariaDescribedBy,\n slots: slotFns,\n multiple: toRef(props, 'multiple'),\n registerItem,\n itemLabel,\n removeValue,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n v-bind=\"rootDataAttrs\"\n >\n <FieldLabel\n v-if=\"showOutsideLabel\"\n :for=\"triggerId\"\n :label=\"label\"\n :is-required=\"isRequired\"\n :class=\"composeClassName(slotFns.label(), props.classNames?.label)\"\n />\n\n <div :class=\"composeClassName(slotFns.mainWrapper(), props.classNames?.mainWrapper)\">\n <SelectRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :multiple=\"props.multiple\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :by=\"props.by\"\n :dir=\"props.dir\"\n :autocomplete=\"props.autocomplete\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :name=\"props.name\"\n @update:model-value=\"emit('update:modelValue', $event as SelectItemValue | SelectItemValue[])\"\n @update:open=\"emit('update:open', $event)\"\n >\n <!-- Tier 3: consumer-provided compound chrome -->\n <slot v-if=\"usesCustomChrome\" />\n <!-- Tier 1/2: internally rendered chrome -->\n <template v-else>\n <SelectTrigger>\n <SelectValue :placeholder=\"props.placeholder\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :text-value=\"item.textValue ?? item.label\"\n :is-disabled=\"item.isDisabled\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n >{{ item.label ?? String(item.value) }}</slot>\n </SelectItem>\n <slot />\n </SelectContent>\n </template>\n </SelectRoot>\n\n <FormFieldHelper\n :has-helper=\"hasHelper\"\n :show-error=\"showError\"\n :show-description=\"showDescription\"\n :error-message=\"errorMessage\"\n :description=\"description\"\n :error-message-id=\"errorMessageId\"\n :description-id=\"descriptionId\"\n :wrapper-class=\"composeClassName(slotFns.helperWrapper(), props.classNames?.helperWrapper)\"\n :error-class=\"composeClassName(slotFns.errorMessage(), props.classNames?.errorMessage)\"\n :description-class=\"composeClassName(slotFns.description(), props.classNames?.description)\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Select.js","names":[],"sources":["../../../src/components/select/Select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, reactive, toRef, useAttrs, useId, useSlots } from 'vue'\nimport { SelectRoot } from 'reka-ui'\nimport { selectVariants, type SelectVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSelectProvide, type SelectItemValue, type SelectItemData } from './Select.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport SelectTrigger from './SelectTrigger.vue'\nimport SelectValue from './SelectValue.vue'\nimport SelectContent from './SelectContent.vue'\nimport SelectItem from './SelectItem.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport { useFormField } from '../../composables/useFormField'\nimport FieldLabel from '../_shared/FieldLabel.vue'\nimport FormFieldHelper from '../_shared/FormFieldHelper.vue'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: undefined,\n isReadonly: undefined,\n isRequired: false,\n multiple: false,\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n by: undefined,\n dir: undefined,\n autocomplete: undefined,\n items: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SelectItemValue | SelectItemValue[]]\n 'update:open': [value: boolean]\n}>()\n\nconst isReadOnly = useDeprecatedBooleanProp(\n 'Select', 'isReadOnly', () => props.isReadOnly, 'isReadonly', () => props.isReadonly,\n)\n\ntype Props = {\n /** Visual style of the field. @default 'flat' */\n variant?: SelectVariants['variant']\n /** Field height. @default 'md' */\n size?: SelectVariants['size']\n /** Accent color applied to focus ring + floating label. @default 'default' */\n color?: SelectVariants['color']\n /**\n * Where the `label` is rendered relative to the field.\n * - `inside`: floats above the trigger (shrinks when focused/filled)\n * - `outside`: sits above the field, static\n * - `outside-left`: sits to the left, horizontal layout\n * @default 'inside'\n */\n labelPlacement?: SelectVariants['labelPlacement']\n /** Stretches root wrapper to 100% width. @default false */\n fullWidth?: boolean\n /** Marks the field as invalid. Triggers danger styling and enables `errorMessage`. @default false */\n isInvalid?: boolean\n /** Disables the field. @default false */\n isDisabled?: boolean\n /** Makes the field read-only. @default false */\n isReadOnly?: boolean\n /** @deprecated Use isReadOnly instead. */\n isReadonly?: boolean\n /** Adds a required asterisk next to the label. @default false */\n isRequired?: boolean\n /** Placeholder shown when no value is selected. */\n placeholder?: string\n /** Form field name, for native form submission. */\n name?: string\n /** Field label. When omitted, the floating-label behavior is skipped. */\n label?: string\n /** Helper text displayed below the field. Suppressed when `isInvalid && errorMessage` is shown. */\n description?: string\n /** Error text displayed below the field. Only rendered when `isInvalid` is also true. */\n errorMessage?: string\n /** Extra classes merged onto the root wrapper via `composeClassName`. */\n class?: ClassValue\n /** Per-slot class name overrides via `composeClassName`. */\n classNames?: Partial<{\n base: ClassValue\n label: ClassValue\n mainWrapper: ClassValue\n helperWrapper: ClassValue\n errorMessage: ClassValue\n description: ClassValue\n item: ClassValue\n indicator: ClassValue\n trigger: ClassValue\n startContent: ClassValue\n /** The chevron/indicator icon inside the trigger (distinct from `indicator`, which styles each item's checkmark). */\n triggerIndicator: ClassValue\n value: ClassValue\n chip: Partial<{\n base: ClassValue\n dot: ClassValue\n startContent: ClassValue\n label: ClassValue\n endContent: ClassValue\n closeButton: ClassValue\n }>\n }>\n\n /* ─── Select-specific ─────────────────────────────────────── */\n /** Two-way bound selected value. Accepts string or numeric keys. */\n modelValue?: SelectItemValue | SelectItemValue[]\n /** Initial selected value (uncontrolled). Accepts string or numeric keys. */\n defaultValue?: SelectItemValue | SelectItemValue[]\n /** Allow selecting multiple values. modelValue becomes string[]. @default false */\n multiple?: boolean\n /** Controls open state of the dropdown. */\n open?: boolean\n /** Initial open state of the dropdown (uncontrolled). */\n defaultOpen?: boolean\n /** Comparison key or function for value matching. */\n by?: string | ((a: SelectItemValue, b: SelectItemValue) => boolean)\n /** Text direction for the select. */\n dir?: 'ltr' | 'rtl'\n /** Native autocomplete attribute for the hidden input. */\n autocomplete?: string\n /**\n * Data-driven items for the terse API. When provided (and no SelectTrigger /\n * SelectContent is passed as a child), the trigger, value, and popover are\n * rendered internally. Use the `#item` slot to customize per-item rendering.\n */\n items?: SelectItemData[]\n}\n\nconst attrs = useAttrs()\nconst generatedId = useId()\nconst triggerId = computed(() => (attrs.id as string | undefined) ?? generatedId)\n\nconst slots = useSlots()\n// Tier 3 (advanced): consumer supplied explicit compound chrome → pass through.\n// Tier 1/2 (terse): render trigger/value/content internally.\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.({}), [SelectTrigger, SelectContent]),\n)\n\nconst {\n descriptionId,\n errorMessageId,\n showError,\n showDescription,\n hasHelper,\n ariaDescribedBy,\n hasLabel,\n showOutsideLabel,\n rootDataAttrs,\n} = useFormField({\n fieldId: () => triggerId.value,\n label: () => props.label,\n description: () => props.description,\n errorMessage: () => props.errorMessage,\n isInvalid: () => props.isInvalid,\n isDisabled: () => props.isDisabled,\n isReadOnly: () => isReadOnly.value,\n isRequired: () => props.isRequired,\n labelPlacement: () => props.labelPlacement,\n})\n\nconst slotFns = computed(() =>\n selectVariants({\n variant: props.variant,\n size: props.size,\n color: props.color,\n fullWidth: props.fullWidth,\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isReadonly: isReadOnly.value,\n hasLabel: hasLabel.value,\n labelPlacement: props.labelPlacement,\n }),\n)\n\n// Persistent item registry. SelectItem populates on first mount; entries\n// survive SelectContent unmount so SelectValue can render the label while\n// the popover is closed.\nconst itemRegistry = reactive(new Map<SelectItemValue, string>())\nconst registerItem = (value: SelectItemValue, label: string) => {\n itemRegistry.set(value, label)\n}\nconst itemLabel = (value: SelectItemValue | SelectItemValue[] | undefined | null): string => {\n if (value == null) return ''\n if (Array.isArray(value)) {\n // Fall back to the stringified value (handles numeric keys) when no label is\n // registered. Filter empty strings only — never use filter(Boolean), which\n // would drop a registered label for the numeric key 0.\n return value\n .map(v => String(itemRegistry.get(v) ?? v))\n .filter(s => s.length > 0)\n .join(', ')\n }\n return itemRegistry.get(value) ?? String(value)\n}\n\nfunction removeValue(value: SelectItemValue) {\n const current = Array.isArray(props.modelValue) ? props.modelValue : []\n emit('update:modelValue', current.filter(v => v !== value))\n}\n\nuseSelectProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n isReadonly: isReadOnly,\n isRequired: toRef(props, 'isRequired'),\n fullWidth: toRef(props, 'fullWidth'),\n hasLabel,\n labelPlacement: toRef(props, 'labelPlacement'),\n triggerId,\n label: toRef(props, 'label'),\n ariaDescribedBy,\n slots: slotFns,\n multiple: toRef(props, 'multiple'),\n registerItem,\n itemLabel,\n removeValue,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n v-bind=\"rootDataAttrs\"\n >\n <FieldLabel\n v-if=\"showOutsideLabel\"\n :for=\"triggerId\"\n :label=\"label\"\n :is-required=\"isRequired\"\n :class=\"composeClassName(slotFns.label(), props.classNames?.label)\"\n />\n\n <div :class=\"composeClassName(slotFns.mainWrapper(), props.classNames?.mainWrapper)\">\n <SelectRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :multiple=\"props.multiple\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :by=\"props.by\"\n :dir=\"props.dir\"\n :autocomplete=\"props.autocomplete\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :name=\"props.name\"\n @update:model-value=\"emit('update:modelValue', $event as SelectItemValue | SelectItemValue[])\"\n @update:open=\"emit('update:open', $event)\"\n >\n <!-- Tier 3: consumer-provided compound chrome -->\n <slot v-if=\"usesCustomChrome\" />\n <!-- Tier 1/2: internally rendered chrome -->\n <template v-else>\n <SelectTrigger\n :class-names=\"{ trigger: props.classNames?.trigger, label: props.classNames?.label, startContent: props.classNames?.startContent, indicator: props.classNames?.triggerIndicator }\"\n >\n <SelectValue\n :placeholder=\"props.placeholder\"\n :class-names=\"{ value: props.classNames?.value, chip: props.classNames?.chip }\"\n />\n </SelectTrigger>\n <SelectContent>\n <SelectItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :text-value=\"item.textValue ?? item.label\"\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 ?? String(item.value) }}</slot>\n </SelectItem>\n <slot />\n </SelectContent>\n </template>\n </SelectRoot>\n\n <FormFieldHelper\n :has-helper=\"hasHelper\"\n :show-error=\"showError\"\n :show-description=\"showDescription\"\n :error-message=\"errorMessage\"\n :description=\"description\"\n :error-message-id=\"errorMessageId\"\n :description-id=\"descriptionId\"\n :wrapper-class=\"composeClassName(slotFns.helperWrapper(), props.classNames?.helperWrapper)\"\n :error-class=\"composeClassName(slotFns.errorMessage(), props.classNames?.errorMessage)\"\n :description-class=\"composeClassName(slotFns.description(), props.classNames?.description)\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -168,23 +168,39 @@ var Select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
168
168
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
|
|
169
169
|
"onUpdate:open": _cache[1] || (_cache[1] = ($event) => emit("update:open", $event))
|
|
170
170
|
}, {
|
|
171
|
-
default: withCtx(() => [usesCustomChrome.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(SelectTrigger_default,
|
|
172
|
-
|
|
171
|
+
default: withCtx(() => [usesCustomChrome.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(SelectTrigger_default, { "class-names": {
|
|
172
|
+
trigger: props.classNames?.trigger,
|
|
173
|
+
label: props.classNames?.label,
|
|
174
|
+
startContent: props.classNames?.startContent,
|
|
175
|
+
indicator: props.classNames?.triggerIndicator
|
|
176
|
+
} }, {
|
|
177
|
+
default: withCtx(() => [createVNode(SelectValue_default, {
|
|
178
|
+
placeholder: props.placeholder,
|
|
179
|
+
"class-names": {
|
|
180
|
+
value: props.classNames?.value,
|
|
181
|
+
chip: props.classNames?.chip
|
|
182
|
+
}
|
|
183
|
+
}, null, 8, ["placeholder", "class-names"])]),
|
|
173
184
|
_: 1
|
|
174
|
-
}), createVNode(SelectContent_default, null, {
|
|
185
|
+
}, 8, ["class-names"]), createVNode(SelectContent_default, null, {
|
|
175
186
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
|
|
176
187
|
return openBlock(), createBlock(SelectItem_default, {
|
|
177
188
|
key: item.value,
|
|
178
189
|
value: item.value,
|
|
179
190
|
"text-value": item.textValue ?? item.label,
|
|
180
|
-
"is-disabled": item.isDisabled
|
|
191
|
+
"is-disabled": item.isDisabled,
|
|
192
|
+
"class-names": {
|
|
193
|
+
item: props.classNames?.item,
|
|
194
|
+
indicator: props.classNames?.indicator
|
|
195
|
+
}
|
|
181
196
|
}, {
|
|
182
197
|
default: withCtx(() => [renderSlot(_ctx.$slots, "item", { item }, () => [createTextVNode(toDisplayString(item.label ?? String(item.value)), 1)])]),
|
|
183
198
|
_: 2
|
|
184
199
|
}, 1032, [
|
|
185
200
|
"value",
|
|
186
201
|
"text-value",
|
|
187
|
-
"is-disabled"
|
|
202
|
+
"is-disabled",
|
|
203
|
+
"class-names"
|
|
188
204
|
]);
|
|
189
205
|
}), 128)), renderSlot(_ctx.$slots, "default")]),
|
|
190
206
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/select/Select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, reactive, toRef, useAttrs, useId, useSlots } from 'vue'\nimport { SelectRoot } from 'reka-ui'\nimport { selectVariants, type SelectVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSelectProvide, type SelectItemValue, type SelectItemData } from './Select.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport SelectTrigger from './SelectTrigger.vue'\nimport SelectValue from './SelectValue.vue'\nimport SelectContent from './SelectContent.vue'\nimport SelectItem from './SelectItem.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport { useFormField } from '../../composables/useFormField'\nimport FieldLabel from '../_shared/FieldLabel.vue'\nimport FormFieldHelper from '../_shared/FormFieldHelper.vue'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: undefined,\n isReadonly: undefined,\n isRequired: false,\n multiple: false,\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n by: undefined,\n dir: undefined,\n autocomplete: undefined,\n items: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SelectItemValue | SelectItemValue[]]\n 'update:open': [value: boolean]\n}>()\n\nconst isReadOnly = useDeprecatedBooleanProp(\n 'Select', 'isReadOnly', () => props.isReadOnly, 'isReadonly', () => props.isReadonly,\n)\n\ntype Props = {\n /** Visual style of the field. @default 'flat' */\n variant?: SelectVariants['variant']\n /** Field height. @default 'md' */\n size?: SelectVariants['size']\n /** Accent color applied to focus ring + floating label. @default 'default' */\n color?: SelectVariants['color']\n /**\n * Where the `label` is rendered relative to the field.\n * - `inside`: floats above the trigger (shrinks when focused/filled)\n * - `outside`: sits above the field, static\n * - `outside-left`: sits to the left, horizontal layout\n * @default 'inside'\n */\n labelPlacement?: SelectVariants['labelPlacement']\n /** Stretches root wrapper to 100% width. @default false */\n fullWidth?: boolean\n /** Marks the field as invalid. Triggers danger styling and enables `errorMessage`. @default false */\n isInvalid?: boolean\n /** Disables the field. @default false */\n isDisabled?: boolean\n /** Makes the field read-only. @default false */\n isReadOnly?: boolean\n /** @deprecated Use isReadOnly instead. */\n isReadonly?: boolean\n /** Adds a required asterisk next to the label. @default false */\n isRequired?: boolean\n /** Placeholder shown when no value is selected. */\n placeholder?: string\n /** Form field name, for native form submission. */\n name?: string\n /** Field label. When omitted, the floating-label behavior is skipped. */\n label?: string\n /** Helper text displayed below the field. Suppressed when `isInvalid && errorMessage` is shown. */\n description?: string\n /** Error text displayed below the field. Only rendered when `isInvalid` is also true. */\n errorMessage?: string\n /** Extra classes merged onto the root wrapper via `composeClassName`. */\n class?: ClassValue\n /** Per-slot class name overrides via `composeClassName`. */\n classNames?: Partial<{\n base: ClassValue\n label: ClassValue\n mainWrapper: ClassValue\n helperWrapper: ClassValue\n errorMessage: ClassValue\n description: ClassValue\n }>\n\n /* ─── Select-specific ─────────────────────────────────────── */\n /** Two-way bound selected value. Accepts string or numeric keys. */\n modelValue?: SelectItemValue | SelectItemValue[]\n /** Initial selected value (uncontrolled). Accepts string or numeric keys. */\n defaultValue?: SelectItemValue | SelectItemValue[]\n /** Allow selecting multiple values. modelValue becomes string[]. @default false */\n multiple?: boolean\n /** Controls open state of the dropdown. */\n open?: boolean\n /** Initial open state of the dropdown (uncontrolled). */\n defaultOpen?: boolean\n /** Comparison key or function for value matching. */\n by?: string | ((a: SelectItemValue, b: SelectItemValue) => boolean)\n /** Text direction for the select. */\n dir?: 'ltr' | 'rtl'\n /** Native autocomplete attribute for the hidden input. */\n autocomplete?: string\n /**\n * Data-driven items for the terse API. When provided (and no SelectTrigger /\n * SelectContent is passed as a child), the trigger, value, and popover are\n * rendered internally. Use the `#item` slot to customize per-item rendering.\n */\n items?: SelectItemData[]\n}\n\nconst attrs = useAttrs()\nconst generatedId = useId()\nconst triggerId = computed(() => (attrs.id as string | undefined) ?? generatedId)\n\nconst slots = useSlots()\n// Tier 3 (advanced): consumer supplied explicit compound chrome → pass through.\n// Tier 1/2 (terse): render trigger/value/content internally.\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.({}), [SelectTrigger, SelectContent]),\n)\n\nconst {\n descriptionId,\n errorMessageId,\n showError,\n showDescription,\n hasHelper,\n ariaDescribedBy,\n hasLabel,\n showOutsideLabel,\n rootDataAttrs,\n} = useFormField({\n fieldId: () => triggerId.value,\n label: () => props.label,\n description: () => props.description,\n errorMessage: () => props.errorMessage,\n isInvalid: () => props.isInvalid,\n isDisabled: () => props.isDisabled,\n isReadOnly: () => isReadOnly.value,\n isRequired: () => props.isRequired,\n labelPlacement: () => props.labelPlacement,\n})\n\nconst slotFns = computed(() =>\n selectVariants({\n variant: props.variant,\n size: props.size,\n color: props.color,\n fullWidth: props.fullWidth,\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isReadonly: isReadOnly.value,\n hasLabel: hasLabel.value,\n labelPlacement: props.labelPlacement,\n }),\n)\n\n// Persistent item registry. SelectItem populates on first mount; entries\n// survive SelectContent unmount so SelectValue can render the label while\n// the popover is closed.\nconst itemRegistry = reactive(new Map<SelectItemValue, string>())\nconst registerItem = (value: SelectItemValue, label: string) => {\n itemRegistry.set(value, label)\n}\nconst itemLabel = (value: SelectItemValue | SelectItemValue[] | undefined | null): string => {\n if (value == null) return ''\n if (Array.isArray(value)) {\n // Fall back to the stringified value (handles numeric keys) when no label is\n // registered. Filter empty strings only — never use filter(Boolean), which\n // would drop a registered label for the numeric key 0.\n return value\n .map(v => String(itemRegistry.get(v) ?? v))\n .filter(s => s.length > 0)\n .join(', ')\n }\n return itemRegistry.get(value) ?? String(value)\n}\n\nfunction removeValue(value: SelectItemValue) {\n const current = Array.isArray(props.modelValue) ? props.modelValue : []\n emit('update:modelValue', current.filter(v => v !== value))\n}\n\nuseSelectProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n isReadonly: isReadOnly,\n isRequired: toRef(props, 'isRequired'),\n fullWidth: toRef(props, 'fullWidth'),\n hasLabel,\n labelPlacement: toRef(props, 'labelPlacement'),\n triggerId,\n label: toRef(props, 'label'),\n ariaDescribedBy,\n slots: slotFns,\n multiple: toRef(props, 'multiple'),\n registerItem,\n itemLabel,\n removeValue,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n v-bind=\"rootDataAttrs\"\n >\n <FieldLabel\n v-if=\"showOutsideLabel\"\n :for=\"triggerId\"\n :label=\"label\"\n :is-required=\"isRequired\"\n :class=\"composeClassName(slotFns.label(), props.classNames?.label)\"\n />\n\n <div :class=\"composeClassName(slotFns.mainWrapper(), props.classNames?.mainWrapper)\">\n <SelectRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :multiple=\"props.multiple\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :by=\"props.by\"\n :dir=\"props.dir\"\n :autocomplete=\"props.autocomplete\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :name=\"props.name\"\n @update:model-value=\"emit('update:modelValue', $event as SelectItemValue | SelectItemValue[])\"\n @update:open=\"emit('update:open', $event)\"\n >\n <!-- Tier 3: consumer-provided compound chrome -->\n <slot v-if=\"usesCustomChrome\" />\n <!-- Tier 1/2: internally rendered chrome -->\n <template v-else>\n <SelectTrigger>\n <SelectValue :placeholder=\"props.placeholder\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :text-value=\"item.textValue ?? item.label\"\n :is-disabled=\"item.isDisabled\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n >{{ item.label ?? String(item.value) }}</slot>\n </SelectItem>\n <slot />\n </SelectContent>\n </template>\n </SelectRoot>\n\n <FormFieldHelper\n :has-helper=\"hasHelper\"\n :show-error=\"showError\"\n :show-description=\"showDescription\"\n :error-message=\"errorMessage\"\n :description=\"description\"\n :error-message-id=\"errorMessageId\"\n :description-id=\"descriptionId\"\n :wrapper-class=\"composeClassName(slotFns.helperWrapper(), props.classNames?.helperWrapper)\"\n :error-class=\"composeClassName(slotFns.errorMessage(), props.classNames?.errorMessage)\"\n :description-class=\"composeClassName(slotFns.description(), props.classNames?.description)\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ;EAsBd,MAAM,OAAO;EAKb,MAAM,aAAa,yBACjB,UAAU,oBAAoB,MAAM,YAAY,oBAAoB,MAAM,WAC5E;EA4EA,MAAM,QAAQ,UAAS;EACvB,MAAM,cAAc,OAAM;EAC1B,MAAM,YAAY,eAAgB,MAAM,MAA6B,YAAW;EAEhF,MAAM,QAAQ,UAAS;EAGvB,MAAM,mBAAmB,eACvB,iBAAiB,MAAM,UAAU,EAAE,CAAC,EAAE,CAAC,uBAAe,sBAAc,CAAC,CACv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WAVI,MAAM,QAAd,SAAI;0BADb,YAWa,oBAAA;OATV,KAAK,KAAK;OACV,OAAO,KAAK;OACZ,cAAY,KAAK,aAAa,KAAK;OACnC,eAAa,KAAK;;8BAK2B,CAH9C,WAG8C,KAAA,QAAA,QAAA,EADrC,MAAI,QACiC,CAAA,gBAAA,gBAA1C,KAAK,SAAS,OAAO,KAAK,MAAK,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;gBAErC,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;;;;;;;;;;;;;;OAKd,YAWE,yBAAA;IAVC,cAAY,MAAA,UAAS;IACrB,cAAY,MAAA,UAAS;IACrB,oBAAkB,MAAA,gBAAe;IACjC,iBAAe,QAAA;IACf,aAAa,QAAA;IACb,oBAAkB,MAAA,eAAc;IAChC,kBAAgB,MAAA,cAAa;IAC7B,iBAAe,MAAA,iBAAgB,CAAC,QAAA,MAAQ,eAAa,EAAI,MAAM,YAAY,cAAa;IACxF,eAAa,MAAA,iBAAgB,CAAC,QAAA,MAAQ,cAAY,EAAI,MAAM,YAAY,aAAY;IACpF,qBAAmB,MAAA,iBAAgB,CAAC,QAAA,MAAQ,aAAW,EAAI,MAAM,YAAY,YAAW"}
|
|
1
|
+
{"version":3,"file":"Select.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/select/Select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, reactive, toRef, useAttrs, useId, useSlots } from 'vue'\nimport { SelectRoot } from 'reka-ui'\nimport { selectVariants, type SelectVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSelectProvide, type SelectItemValue, type SelectItemData } from './Select.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport SelectTrigger from './SelectTrigger.vue'\nimport SelectValue from './SelectValue.vue'\nimport SelectContent from './SelectContent.vue'\nimport SelectItem from './SelectItem.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\nimport { useFormField } from '../../composables/useFormField'\nimport FieldLabel from '../_shared/FieldLabel.vue'\nimport FormFieldHelper from '../_shared/FormFieldHelper.vue'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: 'flat',\n size: 'md',\n color: 'default',\n labelPlacement: 'inside',\n fullWidth: false,\n isInvalid: false,\n isDisabled: false,\n isReadOnly: undefined,\n isReadonly: undefined,\n isRequired: false,\n multiple: false,\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n by: undefined,\n dir: undefined,\n autocomplete: undefined,\n items: () => [],\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: SelectItemValue | SelectItemValue[]]\n 'update:open': [value: boolean]\n}>()\n\nconst isReadOnly = useDeprecatedBooleanProp(\n 'Select', 'isReadOnly', () => props.isReadOnly, 'isReadonly', () => props.isReadonly,\n)\n\ntype Props = {\n /** Visual style of the field. @default 'flat' */\n variant?: SelectVariants['variant']\n /** Field height. @default 'md' */\n size?: SelectVariants['size']\n /** Accent color applied to focus ring + floating label. @default 'default' */\n color?: SelectVariants['color']\n /**\n * Where the `label` is rendered relative to the field.\n * - `inside`: floats above the trigger (shrinks when focused/filled)\n * - `outside`: sits above the field, static\n * - `outside-left`: sits to the left, horizontal layout\n * @default 'inside'\n */\n labelPlacement?: SelectVariants['labelPlacement']\n /** Stretches root wrapper to 100% width. @default false */\n fullWidth?: boolean\n /** Marks the field as invalid. Triggers danger styling and enables `errorMessage`. @default false */\n isInvalid?: boolean\n /** Disables the field. @default false */\n isDisabled?: boolean\n /** Makes the field read-only. @default false */\n isReadOnly?: boolean\n /** @deprecated Use isReadOnly instead. */\n isReadonly?: boolean\n /** Adds a required asterisk next to the label. @default false */\n isRequired?: boolean\n /** Placeholder shown when no value is selected. */\n placeholder?: string\n /** Form field name, for native form submission. */\n name?: string\n /** Field label. When omitted, the floating-label behavior is skipped. */\n label?: string\n /** Helper text displayed below the field. Suppressed when `isInvalid && errorMessage` is shown. */\n description?: string\n /** Error text displayed below the field. Only rendered when `isInvalid` is also true. */\n errorMessage?: string\n /** Extra classes merged onto the root wrapper via `composeClassName`. */\n class?: ClassValue\n /** Per-slot class name overrides via `composeClassName`. */\n classNames?: Partial<{\n base: ClassValue\n label: ClassValue\n mainWrapper: ClassValue\n helperWrapper: ClassValue\n errorMessage: ClassValue\n description: ClassValue\n item: ClassValue\n indicator: ClassValue\n trigger: ClassValue\n startContent: ClassValue\n /** The chevron/indicator icon inside the trigger (distinct from `indicator`, which styles each item's checkmark). */\n triggerIndicator: ClassValue\n value: ClassValue\n chip: Partial<{\n base: ClassValue\n dot: ClassValue\n startContent: ClassValue\n label: ClassValue\n endContent: ClassValue\n closeButton: ClassValue\n }>\n }>\n\n /* ─── Select-specific ─────────────────────────────────────── */\n /** Two-way bound selected value. Accepts string or numeric keys. */\n modelValue?: SelectItemValue | SelectItemValue[]\n /** Initial selected value (uncontrolled). Accepts string or numeric keys. */\n defaultValue?: SelectItemValue | SelectItemValue[]\n /** Allow selecting multiple values. modelValue becomes string[]. @default false */\n multiple?: boolean\n /** Controls open state of the dropdown. */\n open?: boolean\n /** Initial open state of the dropdown (uncontrolled). */\n defaultOpen?: boolean\n /** Comparison key or function for value matching. */\n by?: string | ((a: SelectItemValue, b: SelectItemValue) => boolean)\n /** Text direction for the select. */\n dir?: 'ltr' | 'rtl'\n /** Native autocomplete attribute for the hidden input. */\n autocomplete?: string\n /**\n * Data-driven items for the terse API. When provided (and no SelectTrigger /\n * SelectContent is passed as a child), the trigger, value, and popover are\n * rendered internally. Use the `#item` slot to customize per-item rendering.\n */\n items?: SelectItemData[]\n}\n\nconst attrs = useAttrs()\nconst generatedId = useId()\nconst triggerId = computed(() => (attrs.id as string | undefined) ?? generatedId)\n\nconst slots = useSlots()\n// Tier 3 (advanced): consumer supplied explicit compound chrome → pass through.\n// Tier 1/2 (terse): render trigger/value/content internally.\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.({}), [SelectTrigger, SelectContent]),\n)\n\nconst {\n descriptionId,\n errorMessageId,\n showError,\n showDescription,\n hasHelper,\n ariaDescribedBy,\n hasLabel,\n showOutsideLabel,\n rootDataAttrs,\n} = useFormField({\n fieldId: () => triggerId.value,\n label: () => props.label,\n description: () => props.description,\n errorMessage: () => props.errorMessage,\n isInvalid: () => props.isInvalid,\n isDisabled: () => props.isDisabled,\n isReadOnly: () => isReadOnly.value,\n isRequired: () => props.isRequired,\n labelPlacement: () => props.labelPlacement,\n})\n\nconst slotFns = computed(() =>\n selectVariants({\n variant: props.variant,\n size: props.size,\n color: props.color,\n fullWidth: props.fullWidth,\n isInvalid: props.isInvalid,\n isDisabled: props.isDisabled,\n isReadonly: isReadOnly.value,\n hasLabel: hasLabel.value,\n labelPlacement: props.labelPlacement,\n }),\n)\n\n// Persistent item registry. SelectItem populates on first mount; entries\n// survive SelectContent unmount so SelectValue can render the label while\n// the popover is closed.\nconst itemRegistry = reactive(new Map<SelectItemValue, string>())\nconst registerItem = (value: SelectItemValue, label: string) => {\n itemRegistry.set(value, label)\n}\nconst itemLabel = (value: SelectItemValue | SelectItemValue[] | undefined | null): string => {\n if (value == null) return ''\n if (Array.isArray(value)) {\n // Fall back to the stringified value (handles numeric keys) when no label is\n // registered. Filter empty strings only — never use filter(Boolean), which\n // would drop a registered label for the numeric key 0.\n return value\n .map(v => String(itemRegistry.get(v) ?? v))\n .filter(s => s.length > 0)\n .join(', ')\n }\n return itemRegistry.get(value) ?? String(value)\n}\n\nfunction removeValue(value: SelectItemValue) {\n const current = Array.isArray(props.modelValue) ? props.modelValue : []\n emit('update:modelValue', current.filter(v => v !== value))\n}\n\nuseSelectProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n isReadonly: isReadOnly,\n isRequired: toRef(props, 'isRequired'),\n fullWidth: toRef(props, 'fullWidth'),\n hasLabel,\n labelPlacement: toRef(props, 'labelPlacement'),\n triggerId,\n label: toRef(props, 'label'),\n ariaDescribedBy,\n slots: slotFns,\n multiple: toRef(props, 'multiple'),\n registerItem,\n itemLabel,\n removeValue,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n v-bind=\"rootDataAttrs\"\n >\n <FieldLabel\n v-if=\"showOutsideLabel\"\n :for=\"triggerId\"\n :label=\"label\"\n :is-required=\"isRequired\"\n :class=\"composeClassName(slotFns.label(), props.classNames?.label)\"\n />\n\n <div :class=\"composeClassName(slotFns.mainWrapper(), props.classNames?.mainWrapper)\">\n <SelectRoot\n :model-value=\"props.modelValue\"\n :default-value=\"props.defaultValue\"\n :multiple=\"props.multiple\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :by=\"props.by\"\n :dir=\"props.dir\"\n :autocomplete=\"props.autocomplete\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :name=\"props.name\"\n @update:model-value=\"emit('update:modelValue', $event as SelectItemValue | SelectItemValue[])\"\n @update:open=\"emit('update:open', $event)\"\n >\n <!-- Tier 3: consumer-provided compound chrome -->\n <slot v-if=\"usesCustomChrome\" />\n <!-- Tier 1/2: internally rendered chrome -->\n <template v-else>\n <SelectTrigger\n :class-names=\"{ trigger: props.classNames?.trigger, label: props.classNames?.label, startContent: props.classNames?.startContent, indicator: props.classNames?.triggerIndicator }\"\n >\n <SelectValue\n :placeholder=\"props.placeholder\"\n :class-names=\"{ value: props.classNames?.value, chip: props.classNames?.chip }\"\n />\n </SelectTrigger>\n <SelectContent>\n <SelectItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :text-value=\"item.textValue ?? item.label\"\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 ?? String(item.value) }}</slot>\n </SelectItem>\n <slot />\n </SelectContent>\n </template>\n </SelectRoot>\n\n <FormFieldHelper\n :has-helper=\"hasHelper\"\n :show-error=\"showError\"\n :show-description=\"showDescription\"\n :error-message=\"errorMessage\"\n :description=\"description\"\n :error-message-id=\"errorMessageId\"\n :description-id=\"descriptionId\"\n :wrapper-class=\"composeClassName(slotFns.helperWrapper(), props.classNames?.helperWrapper)\"\n :error-class=\"composeClassName(slotFns.errorMessage(), props.classNames?.errorMessage)\"\n :description-class=\"composeClassName(slotFns.description(), props.classNames?.description)\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ;EAsBd,MAAM,OAAO;EAKb,MAAM,aAAa,yBACjB,UAAU,oBAAoB,MAAM,YAAY,oBAAoB,MAAM,WAC5E;EA2FA,MAAM,QAAQ,UAAS;EACvB,MAAM,cAAc,OAAM;EAC1B,MAAM,YAAY,eAAgB,MAAM,MAA6B,YAAW;EAEhF,MAAM,QAAQ,UAAS;EAGvB,MAAM,mBAAmB,eACvB,iBAAiB,MAAM,UAAU,EAAE,CAAC,EAAE,CAAC,uBAAe,sBAAc,CAAC,CACvE;EAEA,MAAM,EACJ,eACA,gBACA,WACA,iBACA,WACA,iBACA,UACA,kBACA,kBACE,aAAa;GACf,eAAe,UAAU;GACzB,aAAa,MAAM;GACnB,mBAAmB,MAAM;GACzB,oBAAoB,MAAM;GAC1B,iBAAiB,MAAM;GACvB,kBAAkB,MAAM;GACxB,kBAAkB,WAAW;GAC7B,kBAAkB,MAAM;GACxB,sBAAsB,MAAM;GAC7B,CAAA;EAED,MAAM,UAAU,eACd,eAAe;GACb,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,WAAW,MAAM;GACjB,WAAW,MAAM;GACjB,YAAY,MAAM;GAClB,YAAY,WAAW;GACvB,UAAU,SAAS;GACnB,gBAAgB,MAAM;GACvB,CAAC,CACJ;EAKA,M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;;;;;;;gBAErC,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;;;;;;;;;;;;;;OAKd,YAWE,yBAAA;IAVC,cAAY,MAAA,UAAS;IACrB,cAAY,MAAA,UAAS;IACrB,oBAAkB,MAAA,gBAAe;IACjC,iBAAe,QAAA;IACf,aAAa,QAAA;IACb,oBAAkB,MAAA,eAAc;IAChC,kBAAgB,MAAA,cAAa;IAC7B,iBAAe,MAAA,iBAAgB,CAAC,QAAA,MAAQ,eAAa,EAAI,MAAM,YAAY,cAAa;IACxF,eAAa,MAAA,iBAAgB,CAAC,QAAA,MAAQ,cAAY,EAAI,MAAM,YAAY,aAAY;IACpF,qBAAmB,MAAA,iBAAgB,CAAC,QAAA,MAAQ,aAAW,EAAI,MAAM,YAAY,YAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItem.js","names":[],"sources":["../../../src/components/select/SelectItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, useTemplateRef } from 'vue'\nimport { SelectItem, SelectItemText, SelectItemIndicator } from 'reka-ui'\nimport { useSelectInject, type SelectItemValue } from './Select.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: SelectItemValue\n /**\n * Explicit human-readable label for this item. When provided, the registry is\n * populated immediately at setup time (before the dropdown is ever opened),\n * so SelectValue can display the correct label for a pre-set modelValue.\n * When omitted, the label is read from slot DOM text on first mount.\n */\n textValue?: string\n isDisabled?: boolean\n class?: 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}>(), {\n textValue: undefined,\n isDisabled: undefined,\n class: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n})\n\nconst emit = defineEmits<{\n select: [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SelectItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst ctx = useSelectInject()\nconst textRef = useTemplateRef<HTMLElement>('textRef')\n\n// Register immediately with textValue if provided — this runs at setup time,\n// before mount, so SelectValue shows the correct label for a pre-set modelValue\n// even before the dropdown has ever been opened.\nif (props.textValue !== undefined) {\n ctx.registerItem(props.value, props.textValue)\n}\n\nonMounted(() => {\n // textRef points to the SelectItemText component instance (not a DOM element).\n // Access $el to get the underlying span element and read its text content.\n // This refines the registry entry with actual DOM text (handles slot-text items\n // that don't have an explicit textValue prop).\n const el = (textRef.value as { $el?: HTMLElement } | null)?.$el\n const label = props.textValue ?? el?.textContent?.trim() ?? String(props.value)\n ctx.registerItem(props.value, label)\n})\n</script>\n\n<template>\n <SelectItem\n :value=\"props.value\"\n :disabled=\"isDisabled\"\n :text-value=\"props.textValue ?? String(props.value)\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n class=\"
|
|
1
|
+
{"version":3,"file":"SelectItem.js","names":[],"sources":["../../../src/components/select/SelectItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, useTemplateRef } from 'vue'\nimport { SelectItem, SelectItemText, SelectItemIndicator } from 'reka-ui'\nimport { listboxItemVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useSelectInject, type SelectItemValue } from './Select.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: SelectItemValue\n /**\n * Explicit human-readable label for this item. When provided, the registry is\n * populated immediately at setup time (before the dropdown is ever opened),\n * so SelectValue can display the correct label for a pre-set modelValue.\n * When omitted, the label is read from slot DOM text on first mount.\n */\n textValue?: string\n isDisabled?: boolean\n class?: 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 /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n indicator: ClassValue\n }>\n}>(), {\n textValue: undefined,\n isDisabled: undefined,\n class: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n})\n\nconst emit = defineEmits<{\n select: [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SelectItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst ctx = useSelectInject()\nconst textRef = useTemplateRef<HTMLElement>('textRef')\nconst itemSlots = listboxItemVariants()\n\n// Register immediately with textValue if provided — this runs at setup time,\n// before mount, so SelectValue shows the correct label for a pre-set modelValue\n// even before the dropdown has ever been opened.\nif (props.textValue !== undefined) {\n ctx.registerItem(props.value, props.textValue)\n}\n\nonMounted(() => {\n // textRef points to the SelectItemText component instance (not a DOM element).\n // Access $el to get the underlying span element and read its text content.\n // This refines the registry entry with actual DOM text (handles slot-text items\n // that don't have an explicit textValue prop).\n const el = (textRef.value as { $el?: HTMLElement } | null)?.$el\n const label = props.textValue ?? el?.textContent?.trim() ?? String(props.value)\n ctx.registerItem(props.value, label)\n})\n</script>\n\n<template>\n <SelectItem\n :value=\"props.value\"\n :disabled=\"isDisabled\"\n :text-value=\"props.textValue ?? String(props.value)\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\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 <SelectItemText ref=\"textRef\">\n <slot />\n </SelectItemText>\n <SelectItemIndicator\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 </SelectItemIndicator>\n <slot name=\"endContent\" />\n </SelectItem>\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 { useSelectInject } from "./Select.context.js";
|
|
3
|
-
import { createBlock, createElementVNode, createVNode, defineComponent, onMounted, openBlock, renderSlot, unref, useTemplateRef, withCtx } from "vue";
|
|
4
|
+
import { createBlock, createElementVNode, createVNode, defineComponent, normalizeClass, onMounted, openBlock, renderSlot, unref, useTemplateRef, withCtx } from "vue";
|
|
5
|
+
import { listboxItemVariants } from "@auronui/styles";
|
|
4
6
|
import { SelectItem, SelectItemIndicator, SelectItemText } from "reka-ui";
|
|
5
7
|
//#region src/components/select/SelectItem.vue?vue&type=script&setup=true&lang.ts
|
|
6
8
|
var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -21,7 +23,8 @@ var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
21
23
|
asChild: {
|
|
22
24
|
type: Boolean,
|
|
23
25
|
default: false
|
|
24
|
-
}
|
|
26
|
+
},
|
|
27
|
+
classNames: {}
|
|
25
28
|
},
|
|
26
29
|
emits: ["select"],
|
|
27
30
|
setup(__props, { emit: __emit }) {
|
|
@@ -30,6 +33,7 @@ var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
30
33
|
const isDisabled = useDeprecatedBooleanProp("SelectItem", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
|
|
31
34
|
const ctx = useSelectInject();
|
|
32
35
|
const textRef = useTemplateRef("textRef");
|
|
36
|
+
const itemSlots = listboxItemVariants();
|
|
33
37
|
if (props.textValue !== void 0) ctx.registerItem(props.value, props.textValue);
|
|
34
38
|
onMounted(() => {
|
|
35
39
|
const el = textRef.value?.$el;
|
|
@@ -43,7 +47,7 @@ var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
43
47
|
"text-value": props.textValue ?? String(props.value),
|
|
44
48
|
as: props.as,
|
|
45
49
|
"as-child": props.asChild,
|
|
46
|
-
class:
|
|
50
|
+
class: normalizeClass(unref(composeClassName)(unref(itemSlots).item(), props.classNames?.item)),
|
|
47
51
|
"data-slot": "list-box-item",
|
|
48
52
|
onSelect: _cache[0] || (_cache[0] = ($event) => emit("select", $event))
|
|
49
53
|
}, {
|
|
@@ -57,7 +61,7 @@ var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
57
61
|
_: 3
|
|
58
62
|
}, 512),
|
|
59
63
|
createVNode(unref(SelectItemIndicator), {
|
|
60
|
-
class:
|
|
64
|
+
class: normalizeClass(unref(composeClassName)(unref(itemSlots).indicator(), props.classNames?.indicator)),
|
|
61
65
|
"data-slot": "list-box-item-indicator"
|
|
62
66
|
}, {
|
|
63
67
|
default: withCtx(() => [renderSlot(_ctx.$slots, "selectedIcon", {}, () => [_cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
@@ -74,7 +78,7 @@ var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
74
78
|
"aria-hidden": "true"
|
|
75
79
|
}, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])]),
|
|
76
80
|
_: 3
|
|
77
|
-
}),
|
|
81
|
+
}, 8, ["class"]),
|
|
78
82
|
renderSlot(_ctx.$slots, "endContent")
|
|
79
83
|
]),
|
|
80
84
|
_: 3
|
|
@@ -83,7 +87,8 @@ var SelectItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
83
87
|
"disabled",
|
|
84
88
|
"text-value",
|
|
85
89
|
"as",
|
|
86
|
-
"as-child"
|
|
90
|
+
"as-child",
|
|
91
|
+
"class"
|
|
87
92
|
]);
|
|
88
93
|
};
|
|
89
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/select/SelectItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, useTemplateRef } from 'vue'\nimport { SelectItem, SelectItemText, SelectItemIndicator } from 'reka-ui'\nimport { useSelectInject, type SelectItemValue } from './Select.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: SelectItemValue\n /**\n * Explicit human-readable label for this item. When provided, the registry is\n * populated immediately at setup time (before the dropdown is ever opened),\n * so SelectValue can display the correct label for a pre-set modelValue.\n * When omitted, the label is read from slot DOM text on first mount.\n */\n textValue?: string\n isDisabled?: boolean\n class?: 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}>(), {\n textValue: undefined,\n isDisabled: undefined,\n class: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n})\n\nconst emit = defineEmits<{\n select: [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SelectItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst ctx = useSelectInject()\nconst textRef = useTemplateRef<HTMLElement>('textRef')\n\n// Register immediately with textValue if provided — this runs at setup time,\n// before mount, so SelectValue shows the correct label for a pre-set modelValue\n// even before the dropdown has ever been opened.\nif (props.textValue !== undefined) {\n ctx.registerItem(props.value, props.textValue)\n}\n\nonMounted(() => {\n // textRef points to the SelectItemText component instance (not a DOM element).\n // Access $el to get the underlying span element and read its text content.\n // This refines the registry entry with actual DOM text (handles slot-text items\n // that don't have an explicit textValue prop).\n const el = (textRef.value as { $el?: HTMLElement } | null)?.$el\n const label = props.textValue ?? el?.textContent?.trim() ?? String(props.value)\n ctx.registerItem(props.value, label)\n})\n</script>\n\n<template>\n <SelectItem\n :value=\"props.value\"\n :disabled=\"isDisabled\"\n :text-value=\"props.textValue ?? String(props.value)\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n class=\"
|
|
1
|
+
{"version":3,"file":"SelectItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/select/SelectItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, useTemplateRef } from 'vue'\nimport { SelectItem, SelectItemText, SelectItemIndicator } from 'reka-ui'\nimport { listboxItemVariants } from '@auronui/styles'\nimport { composeClassName, type ClassValue } from '../../utils/composeClassName'\nimport { useSelectInject, type SelectItemValue } from './Select.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n value: SelectItemValue\n /**\n * Explicit human-readable label for this item. When provided, the registry is\n * populated immediately at setup time (before the dropdown is ever opened),\n * so SelectValue can display the correct label for a pre-set modelValue.\n * When omitted, the label is read from slot DOM text on first mount.\n */\n textValue?: string\n isDisabled?: boolean\n class?: 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 /** Per-slot class overrides */\n classNames?: Partial<{\n item: ClassValue\n indicator: ClassValue\n }>\n}>(), {\n textValue: undefined,\n isDisabled: undefined,\n class: undefined,\n disabled: undefined,\n as: undefined,\n asChild: false,\n})\n\nconst emit = defineEmits<{\n select: [event: Event]\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SelectItem', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst ctx = useSelectInject()\nconst textRef = useTemplateRef<HTMLElement>('textRef')\nconst itemSlots = listboxItemVariants()\n\n// Register immediately with textValue if provided — this runs at setup time,\n// before mount, so SelectValue shows the correct label for a pre-set modelValue\n// even before the dropdown has ever been opened.\nif (props.textValue !== undefined) {\n ctx.registerItem(props.value, props.textValue)\n}\n\nonMounted(() => {\n // textRef points to the SelectItemText component instance (not a DOM element).\n // Access $el to get the underlying span element and read its text content.\n // This refines the registry entry with actual DOM text (handles slot-text items\n // that don't have an explicit textValue prop).\n const el = (textRef.value as { $el?: HTMLElement } | null)?.$el\n const label = props.textValue ?? el?.textContent?.trim() ?? String(props.value)\n ctx.registerItem(props.value, label)\n})\n</script>\n\n<template>\n <SelectItem\n :value=\"props.value\"\n :disabled=\"isDisabled\"\n :text-value=\"props.textValue ?? String(props.value)\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\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 <SelectItemText ref=\"textRef\">\n <slot />\n </SelectItemText>\n <SelectItemIndicator\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 </SelectItemIndicator>\n <slot name=\"endContent\" />\n </SelectItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EA+Bd,MAAM,OAAO;EAIb,MAAM,aAAa,yBACjB,cAAc,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SAC9E;EAEA,MAAM,MAAM,iBAAgB;EAC5B,MAAM,UAAU,eAA4B,UAAS;EACrD,MAAM,YAAY,qBAAoB;AAKtC,MAAI,MAAM,cAAc,KAAA,EACtB,KAAI,aAAa,MAAM,OAAO,MAA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