@auronui/vue 1.0.11 → 1.0.13
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 +1080 -902
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/autocomplete/Autocomplete.context.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 +141 -17
- package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteCreateItem.js +7 -0
- package/dist/components/autocomplete/AutocompleteCreateItem.js.map +1 -0
- package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/autocomplete/AutocompleteInput.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js +40 -9
- 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 +33 -5
- package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteOverflowChips.js +7 -0
- package/dist/components/autocomplete/AutocompleteOverflowChips.js.map +1 -0
- package/dist/components/autocomplete/AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/components/autocomplete/AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js +20 -2
- package/dist/components/combo-box/ComboBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/Select.context.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 +45 -6
- 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 +2 -2
- package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/select/SelectOverflowChips.js +7 -0
- package/dist/components/select/SelectOverflowChips.js.map +1 -0
- package/dist/components/select/SelectOverflowChips.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/components/select/SelectOverflowChips.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/select/SelectValue.js.map +1 -1
- package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js +6 -1
- package/dist/components/select/SelectValue.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/index.d.ts +362 -432
- package/dist/index.js +5 -10
- package/dist/utils/hasSlotComponent.js +26 -0
- package/dist/utils/hasSlotComponent.js.map +1 -0
- package/package.json +2 -2
- package/dist/components/tag/Tag.js +0 -7
- package/dist/components/tag/Tag.js.map +0 -1
- package/dist/components/tag/Tag.vue_vue_type_script_setup_true_lang.js +0 -69
- package/dist/components/tag/Tag.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/tag/TagDelete.js +0 -7
- package/dist/components/tag/TagDelete.js.map +0 -1
- package/dist/components/tag/TagDelete.vue_vue_type_script_setup_true_lang.js +0 -49
- package/dist/components/tag/TagDelete.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/tag/TagText.js +0 -7
- package/dist/components/tag/TagText.js.map +0 -1
- package/dist/components/tag/TagText.vue_vue_type_script_setup_true_lang.js +0 -18
- package/dist/components/tag/TagText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/tag-group/TagGroup.context.js +0 -7
- package/dist/components/tag-group/TagGroup.context.js.map +0 -1
- package/dist/components/tag-group/TagGroup.js +0 -7
- package/dist/components/tag-group/TagGroup.js.map +0 -1
- package/dist/components/tag-group/TagGroup.vue_vue_type_script_setup_true_lang.js +0 -142
- package/dist/components/tag-group/TagGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/tag-group/TagGroupInput.js +0 -7
- package/dist/components/tag-group/TagGroupInput.js.map +0 -1
- package/dist/components/tag-group/TagGroupInput.vue_vue_type_script_setup_true_lang.js +0 -37
- package/dist/components/tag-group/TagGroupInput.vue_vue_type_script_setup_true_lang.js.map +0 -1
package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Spinner_default from "../spinner/Spinner.js";
|
|
2
|
+
import Chip_default from "../chip/Chip.js";
|
|
2
3
|
import { useAutocompleteInject } from "./Autocomplete.context.js";
|
|
3
|
-
import
|
|
4
|
+
import AutocompleteOverflowChips_default from "./AutocompleteOverflowChips.js";
|
|
5
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
4
6
|
import { useFocusWithin } from "@vueuse/core";
|
|
5
7
|
import { AutocompleteAnchor, AutocompleteCancel, AutocompleteInput, AutocompleteTrigger } from "reka-ui";
|
|
6
8
|
//#region src/components/autocomplete/AutocompleteInput.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -20,6 +22,8 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
20
22
|
const ctx = useAutocompleteInject();
|
|
21
23
|
const { focused: isFocused } = useFocusWithin(useTemplateRef("anchor"));
|
|
22
24
|
const showInsideLabel = computed(() => ctx.hasLabel.value && ctx.labelPlacement.value === "inside");
|
|
25
|
+
const effectivePlaceholder = computed(() => ctx.multiple.value && ctx.selectedValues.value.length > 0 ? void 0 : props.placeholder);
|
|
26
|
+
const getLabel = (v) => ctx.selectedLabels.value.find((l) => l.value === v)?.label ?? v;
|
|
23
27
|
return (_ctx, _cache) => {
|
|
24
28
|
return openBlock(), createBlock(unref(AutocompleteAnchor), {
|
|
25
29
|
ref: "anchor",
|
|
@@ -29,6 +33,7 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
29
33
|
"data-invalid": unref(ctx).isInvalid.value || void 0,
|
|
30
34
|
"data-disabled": unref(ctx).isDisabled.value || void 0,
|
|
31
35
|
"data-readonly": unref(ctx).isReadonly.value || void 0,
|
|
36
|
+
"data-multiple-overflow": unref(ctx).multiple.value ? unref(ctx).multipleOverflow.value : void 0,
|
|
32
37
|
"data-slot": "trigger"
|
|
33
38
|
}, {
|
|
34
39
|
default: withCtx(() => [
|
|
@@ -42,15 +47,38 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
42
47
|
class: normalizeClass(unref(ctx).slots.value.startContent()),
|
|
43
48
|
"data-slot": "start-content"
|
|
44
49
|
}, [renderSlot(_ctx.$slots, "startContent")], 2)) : createCommentVNode("", true),
|
|
50
|
+
unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "collapse" && unref(ctx).selectedValues.value.length > 0 ? (openBlock(), createBlock(AutocompleteOverflowChips_default, {
|
|
51
|
+
key: 2,
|
|
52
|
+
values: unref(ctx).selectedValues.value,
|
|
53
|
+
"get-label": getLabel,
|
|
54
|
+
"remove-value": unref(ctx).removeValue
|
|
55
|
+
}, null, 8, ["values", "remove-value"])) : unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "wrap" ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(unref(ctx).selectedLabels.value, (item) => {
|
|
56
|
+
return openBlock(), createBlock(Chip_default, {
|
|
57
|
+
key: item.value,
|
|
58
|
+
size: "sm",
|
|
59
|
+
"is-closable": "",
|
|
60
|
+
"close-aria-label": `Remove ${item.label}`,
|
|
61
|
+
"data-slot": "selected-chip",
|
|
62
|
+
onClose: withModifiers(($event) => unref(ctx).removeValue(item.value), ["stop"])
|
|
63
|
+
}, {
|
|
64
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
65
|
+
_: 2
|
|
66
|
+
}, 1032, ["close-aria-label", "onClose"]);
|
|
67
|
+
}), 128)) : createCommentVNode("", true),
|
|
45
68
|
createVNode(unref(AutocompleteInput), {
|
|
46
69
|
id: unref(ctx).inputId.value,
|
|
47
|
-
placeholder:
|
|
70
|
+
placeholder: effectivePlaceholder.value,
|
|
48
71
|
disabled: unref(ctx).isDisabled.value,
|
|
49
72
|
readonly: unref(ctx).isReadonly.value,
|
|
50
73
|
required: unref(ctx).isRequired.value,
|
|
51
74
|
"aria-invalid": unref(ctx).isInvalid.value || void 0,
|
|
52
75
|
"aria-describedby": unref(ctx).ariaDescribedBy.value,
|
|
53
76
|
class: normalizeClass(unref(ctx).slots.value.input()),
|
|
77
|
+
style: normalizeStyle(unref(ctx).multiple.value && unref(ctx).multipleOverflow.value === "collapse" && unref(ctx).selectedValues.value.length > 0 ? {
|
|
78
|
+
flex: "0 0 auto",
|
|
79
|
+
minWidth: "80px",
|
|
80
|
+
width: "auto"
|
|
81
|
+
} : void 0),
|
|
54
82
|
"data-slot": "input",
|
|
55
83
|
autocomplete: "off"
|
|
56
84
|
}, null, 8, [
|
|
@@ -61,15 +89,17 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
61
89
|
"required",
|
|
62
90
|
"aria-invalid",
|
|
63
91
|
"aria-describedby",
|
|
64
|
-
"class"
|
|
92
|
+
"class",
|
|
93
|
+
"style"
|
|
65
94
|
]),
|
|
66
95
|
createVNode(unref(AutocompleteCancel), {
|
|
67
96
|
class: normalizeClass(unref(ctx).slots.value.clearButton()),
|
|
68
97
|
"data-empty": !unref(ctx).isFilled.value || unref(ctx).isReadonly.value || unref(ctx).isDisabled.value ? "true" : void 0,
|
|
69
98
|
"data-slot": "clear-button",
|
|
70
|
-
"aria-label": "Clear"
|
|
99
|
+
"aria-label": "Clear",
|
|
100
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(ctx).multiple.value ? unref(ctx).clearAll() : void 0)
|
|
71
101
|
}, {
|
|
72
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "clearIcon", {}, () => [_cache[
|
|
102
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "clearIcon", {}, () => [_cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
73
103
|
xmlns: "http://www.w3.org/2000/svg",
|
|
74
104
|
width: "10",
|
|
75
105
|
height: "10",
|
|
@@ -95,19 +125,19 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
95
125
|
_: 3
|
|
96
126
|
}, 8, ["class", "data-empty"]),
|
|
97
127
|
unref(ctx).isLoading.value ? (openBlock(), createElementBlock("span", {
|
|
98
|
-
key:
|
|
128
|
+
key: 4,
|
|
99
129
|
class: normalizeClass(unref(ctx).slots.value.indicator()),
|
|
100
130
|
"data-slot": "autocomplete-loading-indicator",
|
|
101
131
|
role: "status",
|
|
102
132
|
"aria-live": "polite",
|
|
103
133
|
"aria-label": "Loading suggestions"
|
|
104
134
|
}, [createVNode(Spinner_default, { size: "sm" })], 2)) : (openBlock(), createBlock(unref(AutocompleteTrigger), {
|
|
105
|
-
key:
|
|
135
|
+
key: 5,
|
|
106
136
|
class: normalizeClass(unref(ctx).slots.value.indicator()),
|
|
107
137
|
"data-slot": "autocomplete-default-indicator",
|
|
108
138
|
"aria-label": "Toggle suggestions"
|
|
109
139
|
}, {
|
|
110
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "triggerIcon", {}, () => [_cache[
|
|
140
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "triggerIcon", {}, () => [_cache[2] || (_cache[2] = createElementVNode("svg", {
|
|
111
141
|
xmlns: "http://www.w3.org/2000/svg",
|
|
112
142
|
width: "16",
|
|
113
143
|
height: "16",
|
|
@@ -129,7 +159,8 @@ var AutocompleteInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
129
159
|
"data-focused",
|
|
130
160
|
"data-invalid",
|
|
131
161
|
"data-disabled",
|
|
132
|
-
"data-readonly"
|
|
162
|
+
"data-readonly",
|
|
163
|
+
"data-multiple-overflow"
|
|
133
164
|
]);
|
|
134
165
|
};
|
|
135
166
|
}
|
package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteInput.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/autocomplete/AutocompleteInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\nimport { AutocompleteInput, AutocompleteTrigger, AutocompleteCancel, AutocompleteAnchor } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport Spinner from '../spinner/Spinner.vue';\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n}>(), {\n placeholder: undefined,\n class: undefined,\n})\n\nconst ctx = useAutocompleteInject()\n\n// Track focused state via useFocusWithin (NOT manual @focus/@blur listeners) — the\n// inner Reka <AutocompleteInput> wraps the native <input>; useFocusWithin observes\n// the actual DOM subtree of the anchor, so isFocused flips reliably regardless of\n// how Reka forwards refs/attrs.\nconst anchorRef = useTemplateRef<HTMLElement>('anchor')\nconst { focused: isFocused } = useFocusWithin(anchorRef)\n\n// Render the inside-label only when (a) a label is set and (b) labelPlacement is 'inside'\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n</script>\n\n<template>\n <AutocompleteAnchor\n ref=\"anchor\"\n :class=\"ctx.slots.value.trigger()\"\n :data-filled=\"ctx.hasLabel.value ? (ctx.isFilled.value || undefined) : undefined\"\n :data-focused=\"isFocused || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-disabled=\"ctx.isDisabled.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n data-slot=\"trigger\"\n >\n <label\n v-if=\"showInsideLabel\"\n :for=\"ctx.inputId.value\"\n :class=\"ctx.slots.value.label()\"\n >{{ ctx.label.value }}<span\n v-if=\"ctx.isRequired.value\"\n aria-hidden=\"true\"\n > *</span></label>\n <span\n v-if=\"$slots.startContent\"\n :class=\"ctx.slots.value.startContent()\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <AutocompleteInput\n :id=\"ctx.inputId.value\"\n :placeholder=\"props.placeholder\"\n :disabled=\"ctx.isDisabled.value\"\n :readonly=\"ctx.isReadonly.value\"\n :required=\"ctx.isRequired.value\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n :class=\"ctx.slots.value.input()\"\n data-slot=\"input\"\n autocomplete=\"off\"\n />\n <!-- Clear button: only shown when filled and not in a readonly/disabled state.\n Reka's AutocompleteCancel does not set data-empty itself, so we drive it here. -->\n <AutocompleteCancel\n :class=\"ctx.slots.value.clearButton()\"\n :data-empty=\"(!ctx.isFilled.value || ctx.isReadonly.value || ctx.isDisabled.value) ? 'true' : undefined\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"autocomplete-clear-button-icon\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </AutocompleteCancel>\n <!-- Inline loading spinner: replaces the dropdown indicator while loadItems is pending -->\n <span\n v-if=\"ctx.isLoading.value\"\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-loading-indicator\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Loading suggestions\"\n >\n <Spinner size=\"sm\" />\n </span>\n <!-- Dropdown trigger indicator (hidden while loading) -->\n <AutocompleteTrigger\n v-else\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-default-indicator\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </AutocompleteTrigger>\n </AutocompleteAnchor>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAOA,MAAM,QAAQ;EAQd,MAAM,MAAM,uBAAsB;EAOlC,MAAM,EAAE,SAAS,cAAc,eADb,eAA4B,SAAQ,CACC;EAGvD,MAAM,kBAAkB,eAChB,IAAI,SAAS,SAAS,IAAI,eAAe,UAAU,SAC3D;;uBAIE,YA6GqB,MAAA,mBAAA,EAAA;IA5GnB,KAAI;IACH,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,SAAO,CAAA;IAC9B,eAAa,MAAA,IAAG,CAAC,SAAS,QAAS,MAAA,IAAG,CAAC,SAAS,SAAS,KAAA,IAAa,KAAA;IACtE,gBAAc,MAAA,UAAS,IAAI,KAAA;IAC3B,gBAAc,MAAA,IAAG,CAAC,UAAU,SAAS,KAAA;IACrC,iBAAe,MAAA,IAAG,CAAC,WAAW,SAAS,KAAA;IACvC,iBAAe,MAAA,IAAG,CAAC,WAAW,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aAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KA1BL,mBAyBM,OAAA;OAxBJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,aAAU;OACV,eAAY;UAEZ,mBAKE,QAAA;OAJA,IAAG;OACH,IAAG;OACH,IAAG;OACH,IAAG;UAEL,mBAKE,QAAA;OAJA,IAAG;OACH,IAAG;OACH,IAAG;OACH,IAAG;;;;KAOH,MAAA,IAAG,CAAC,UAAU,SAAA,WAAA,EADtB,mBASO,QAAA;;MAPJ,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,WAAS,CAAA;MACjC,aAAU;MACV,MAAK;MACL,aAAU;MACV,cAAW;SAEX,YAAqB,iBAAA,EAAZ,MAAK,MAAI,CAAA,CAAA,EAAA,EAAA,KAAA,WAAA,EAGpB,YAsBsB,MAAA,oBAAA,EAAA;;MApBnB,OAAK,eAAE,MAAA,IAAG,CAAC,MAAM,MAAM,WAAS,CAAA;MACjC,aAAU;MACV,cAAW;;6BAiBJ,CAfP,WAeO,KAAA,QAAA,eAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAdL,mBAaM,OAAA;OAZJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"AutocompleteInput.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/autocomplete/AutocompleteInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useTemplateRef } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\nimport { AutocompleteInput, AutocompleteTrigger, AutocompleteCancel, AutocompleteAnchor } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\nimport Chip from '../chip/Chip.vue'\nimport Spinner from '../spinner/Spinner.vue'\nimport AutocompleteOverflowChips from './AutocompleteOverflowChips.vue'\n\nconst props = withDefaults(defineProps<{\n placeholder?: string\n class?: string\n}>(), {\n placeholder: undefined,\n class: undefined,\n})\n\nconst ctx = useAutocompleteInject()\n\n// Track focused state via useFocusWithin (NOT manual @focus/@blur listeners) — the\n// inner Reka <AutocompleteInput> wraps the native <input>; useFocusWithin observes\n// the actual DOM subtree of the anchor, so isFocused flips reliably regardless of\n// how Reka forwards refs/attrs.\nconst anchorRef = useTemplateRef<HTMLElement>('anchor')\nconst { focused: isFocused } = useFocusWithin(anchorRef)\n\n// Render the inside-label only when (a) a label is set and (b) labelPlacement is 'inside'\nconst showInsideLabel = computed(\n () => ctx.hasLabel.value && ctx.labelPlacement.value === 'inside',\n)\n\n// In multiple mode, hide placeholder once chips are present\nconst effectivePlaceholder = computed(() =>\n ctx.multiple.value && ctx.selectedValues.value.length > 0 ? undefined : props.placeholder,\n)\n\nconst getLabel = (v: string) => ctx.selectedLabels.value.find(l => l.value === v)?.label ?? v\n</script>\n\n<template>\n <AutocompleteAnchor\n ref=\"anchor\"\n :class=\"ctx.slots.value.trigger()\"\n :data-filled=\"ctx.hasLabel.value ? (ctx.isFilled.value || undefined) : undefined\"\n :data-focused=\"isFocused || undefined\"\n :data-invalid=\"ctx.isInvalid.value || undefined\"\n :data-disabled=\"ctx.isDisabled.value || undefined\"\n :data-readonly=\"ctx.isReadonly.value || undefined\"\n :data-multiple-overflow=\"ctx.multiple.value ? ctx.multipleOverflow.value : undefined\"\n data-slot=\"trigger\"\n >\n <label\n v-if=\"showInsideLabel\"\n :for=\"ctx.inputId.value\"\n :class=\"ctx.slots.value.label()\"\n >{{ ctx.label.value }}<span\n v-if=\"ctx.isRequired.value\"\n aria-hidden=\"true\"\n > *</span></label>\n <span\n v-if=\"$slots.startContent\"\n :class=\"ctx.slots.value.startContent()\"\n data-slot=\"start-content\"\n >\n <slot name=\"startContent\" />\n </span>\n <!-- Multiple/collapse: overflow chip area with truncation -->\n <AutocompleteOverflowChips\n v-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\"\n :values=\"ctx.selectedValues.value\"\n :get-label=\"getLabel\"\n :remove-value=\"ctx.removeValue\"\n />\n <!-- Multiple/wrap: chips that wrap onto new lines -->\n <template v-else-if=\"ctx.multiple.value && ctx.multipleOverflow.value === 'wrap'\">\n <Chip\n v-for=\"item in ctx.selectedLabels.value\"\n :key=\"item.value\"\n size=\"sm\"\n is-closable\n :close-aria-label=\"`Remove ${item.label}`\"\n data-slot=\"selected-chip\"\n @close.stop=\"ctx.removeValue(item.value)\"\n >\n {{ item.label }}\n </Chip>\n </template>\n <AutocompleteInput\n :id=\"ctx.inputId.value\"\n :placeholder=\"effectivePlaceholder\"\n :disabled=\"ctx.isDisabled.value\"\n :readonly=\"ctx.isReadonly.value\"\n :required=\"ctx.isRequired.value\"\n :aria-invalid=\"ctx.isInvalid.value || undefined\"\n :aria-describedby=\"ctx.ariaDescribedBy.value\"\n :class=\"ctx.slots.value.input()\"\n :style=\"ctx.multiple.value && ctx.multipleOverflow.value === 'collapse' && ctx.selectedValues.value.length > 0\n ? { flex: '0 0 auto', minWidth: '80px', width: 'auto' }\n : undefined\"\n data-slot=\"input\"\n autocomplete=\"off\"\n />\n <!-- Clear button: only shown when filled and not in a readonly/disabled state.\n Reka's AutocompleteCancel does not set data-empty itself, so we drive it here.\n In multiple mode also clears selectedValues via ctx.clearAll(). -->\n <AutocompleteCancel\n :class=\"ctx.slots.value.clearButton()\"\n :data-empty=\"(!ctx.isFilled.value || ctx.isReadonly.value || ctx.isDisabled.value) ? 'true' : undefined\"\n data-slot=\"clear-button\"\n aria-label=\"Clear\"\n @click=\"ctx.multiple.value ? ctx.clearAll() : undefined\"\n >\n <slot name=\"clearIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"autocomplete-clear-button-icon\"\n aria-hidden=\"true\"\n >\n <line\n x1=\"18\"\n y1=\"6\"\n x2=\"6\"\n y2=\"18\"\n />\n <line\n x1=\"6\"\n y1=\"6\"\n x2=\"18\"\n y2=\"18\"\n />\n </svg>\n </slot>\n </AutocompleteCancel>\n <!-- Inline loading spinner: replaces the dropdown indicator while loadItems is pending -->\n <span\n v-if=\"ctx.isLoading.value\"\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-loading-indicator\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label=\"Loading suggestions\"\n >\n <Spinner size=\"sm\" />\n </span>\n <!-- Dropdown trigger indicator (hidden while loading) -->\n <AutocompleteTrigger\n v-else\n :class=\"ctx.slots.value.indicator()\"\n data-slot=\"autocomplete-default-indicator\"\n aria-label=\"Toggle suggestions\"\n >\n <slot name=\"triggerIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </slot>\n </AutocompleteTrigger>\n </AutocompleteAnchor>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EAQd,MAAM,MAAM,uBAAsB;EAOlC,MAAM,EAAE,SAAS,cAAc,eADb,eAA4B,SAAQ,CACC;EAGvD,MAAM,kBAAkB,eAChB,IAAI,SAAS,SAAS,IAAI,eAAe,UAAU,SAC3D;EAGA,MAAM,uBAAuB,eAC3B,IAAI,SAAS,SAAS,IAAI,eAAe,MAAM,SA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AAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteItem.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n}>(), {\n isDisabled: false,\n class: undefined,\n})\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\n\
|
|
1
|
+
{"version":3,"file":"AutocompleteItem.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n}>(), {\n isDisabled: false,\n class: undefined,\n})\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\n\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// In multiple mode, track whether this item is in the selected array\nconst isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value))\n\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n\nfunction handleSelect(event: Event) {\n if (ctx.multiple.value) {\n // Prevent Reka from overwriting the combobox value with the selected item's text.\n // Without this, Reka's internal handler fires after ours and sets searchTerm = displayText.\n event.preventDefault()\n ctx.onMultipleSelect(props.value)\n }\n}\n</script>\n\n<template>\n <AutocompleteItem\n :value=\"displayText\"\n :text-value=\"displayText\"\n :disabled=\"props.isDisabled\"\n :data-item-value=\"props.value\"\n :data-selected=\"isChecked || undefined\"\n class=\"list-box-item list-box-item--default\"\n data-slot=\"list-box-item\"\n @select=\"handleSelect\"\n >\n <slot name=\"startContent\" />\n <span\n class=\"autocomplete-item__text\"\n data-slot=\"item-text\"\n ><slot /></span>\n <!-- Single mode: Reka's ComboboxItemIndicator handles the checkmark natively -->\n <ComboboxItemIndicator\n v-if=\"!ctx.multiple.value\"\n class=\"list-box-item__indicator\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <!-- Multiple mode: check against our selectedValues array instead -->\n <span\n v-else-if=\"isChecked\"\n class=\"list-box-item__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 </span>\n <slot name=\"endContent\" />\n </AutocompleteItem>\n</template>\n"],"mappings":""}
|
package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { useAutocompleteInject } from "./Autocomplete.context.js";
|
|
2
|
-
import { computed, createBlock,
|
|
2
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, onMounted, onUnmounted, openBlock, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
3
3
|
import { AutocompleteItem, ComboboxItemIndicator } from "reka-ui";
|
|
4
4
|
//#region src/components/autocomplete/AutocompleteItem.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = {
|
|
6
6
|
class: "autocomplete-item__text",
|
|
7
7
|
"data-slot": "item-text"
|
|
8
8
|
};
|
|
9
|
+
var _hoisted_2 = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "list-box-item__indicator",
|
|
12
|
+
"data-slot": "list-box-item-indicator"
|
|
13
|
+
};
|
|
9
14
|
var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
10
15
|
__name: "AutocompleteItem",
|
|
11
16
|
props: {
|
|
@@ -32,25 +37,35 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
32
37
|
if (!vnodes) return props.value;
|
|
33
38
|
return extractText(vnodes).trim() || props.value;
|
|
34
39
|
});
|
|
40
|
+
const isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value));
|
|
35
41
|
onMounted(() => {
|
|
36
42
|
ctx.registerItem(props.value, displayText.value);
|
|
37
43
|
});
|
|
38
44
|
onUnmounted(() => {
|
|
39
45
|
ctx.unregisterItem(props.value);
|
|
40
46
|
});
|
|
47
|
+
function handleSelect(event) {
|
|
48
|
+
if (ctx.multiple.value) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
ctx.onMultipleSelect(props.value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
41
53
|
return (_ctx, _cache) => {
|
|
42
54
|
return openBlock(), createBlock(unref(AutocompleteItem), {
|
|
43
55
|
value: displayText.value,
|
|
44
56
|
"text-value": displayText.value,
|
|
45
57
|
disabled: props.isDisabled,
|
|
46
58
|
"data-item-value": props.value,
|
|
59
|
+
"data-selected": isChecked.value || void 0,
|
|
47
60
|
class: "list-box-item list-box-item--default",
|
|
48
|
-
"data-slot": "list-box-item"
|
|
61
|
+
"data-slot": "list-box-item",
|
|
62
|
+
onSelect: handleSelect
|
|
49
63
|
}, {
|
|
50
64
|
default: withCtx(() => [
|
|
51
65
|
renderSlot(_ctx.$slots, "startContent"),
|
|
52
66
|
createElementVNode("span", _hoisted_1, [renderSlot(_ctx.$slots, "default")]),
|
|
53
|
-
|
|
67
|
+
!unref(ctx).multiple.value ? (openBlock(), createBlock(unref(ComboboxItemIndicator), {
|
|
68
|
+
key: 0,
|
|
54
69
|
class: "list-box-item__indicator",
|
|
55
70
|
"data-slot": "list-box-item-indicator"
|
|
56
71
|
}, {
|
|
@@ -68,7 +83,19 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
68
83
|
"aria-hidden": "true"
|
|
69
84
|
}, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])]),
|
|
70
85
|
_: 3
|
|
71
|
-
}),
|
|
86
|
+
})) : isChecked.value ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "selectedIcon", {}, () => [_cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
87
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
88
|
+
width: "12",
|
|
89
|
+
height: "12",
|
|
90
|
+
viewBox: "0 0 24 24",
|
|
91
|
+
fill: "none",
|
|
92
|
+
stroke: "currentColor",
|
|
93
|
+
"stroke-width": "3",
|
|
94
|
+
"stroke-linecap": "round",
|
|
95
|
+
"stroke-linejoin": "round",
|
|
96
|
+
"data-slot": "list-box-item-indicator--checkmark",
|
|
97
|
+
"aria-hidden": "true"
|
|
98
|
+
}, [createElementVNode("polyline", { points: "20 6 9 17 4 12" })], -1))])])) : createCommentVNode("", true),
|
|
72
99
|
renderSlot(_ctx.$slots, "endContent")
|
|
73
100
|
]),
|
|
74
101
|
_: 3
|
|
@@ -76,7 +103,8 @@ var AutocompleteItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
76
103
|
"value",
|
|
77
104
|
"text-value",
|
|
78
105
|
"disabled",
|
|
79
|
-
"data-item-value"
|
|
106
|
+
"data-item-value",
|
|
107
|
+
"data-selected"
|
|
80
108
|
]);
|
|
81
109
|
};
|
|
82
110
|
}
|
package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n}>(), {\n isDisabled: false,\n class: undefined,\n})\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\n\
|
|
1
|
+
{"version":3,"file":"AutocompleteItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, useSlots, type Slots, type VNode } from 'vue'\nimport { AutocompleteItem, ComboboxItemIndicator } from 'reka-ui'\nimport { useAutocompleteInject } from './Autocomplete.context'\n\nconst props = withDefaults(defineProps<{\n value: string\n isDisabled?: boolean\n class?: string\n}>(), {\n isDisabled: false,\n class: undefined,\n})\n\nconst slots: Slots = useSlots()\nconst ctx = useAutocompleteInject()\n\nfunction extractText(nodes: VNode[]): string {\n return nodes.map(n => {\n if (typeof n.children === 'string') return n.children\n if (Array.isArray(n.children)) return extractText(n.children as VNode[])\n return ''\n }).join('')\n}\n\nconst displayText = computed((): string => {\n const vnodes: VNode[] | undefined = (slots.default as (() => VNode[]) | undefined)?.()\n if (!vnodes) return props.value\n return extractText(vnodes).trim() || props.value\n})\n\n// In multiple mode, track whether this item is in the selected array\nconst isChecked = computed(() => ctx.multiple.value && ctx.isSelected(props.value))\n\nonMounted(() => {\n ctx.registerItem(props.value, displayText.value)\n})\n\nonUnmounted(() => {\n ctx.unregisterItem(props.value)\n})\n\nfunction handleSelect(event: Event) {\n if (ctx.multiple.value) {\n // Prevent Reka from overwriting the combobox value with the selected item's text.\n // Without this, Reka's internal handler fires after ours and sets searchTerm = displayText.\n event.preventDefault()\n ctx.onMultipleSelect(props.value)\n }\n}\n</script>\n\n<template>\n <AutocompleteItem\n :value=\"displayText\"\n :text-value=\"displayText\"\n :disabled=\"props.isDisabled\"\n :data-item-value=\"props.value\"\n :data-selected=\"isChecked || undefined\"\n class=\"list-box-item list-box-item--default\"\n data-slot=\"list-box-item\"\n @select=\"handleSelect\"\n >\n <slot name=\"startContent\" />\n <span\n class=\"autocomplete-item__text\"\n data-slot=\"item-text\"\n ><slot /></span>\n <!-- Single mode: Reka's ComboboxItemIndicator handles the checkmark natively -->\n <ComboboxItemIndicator\n v-if=\"!ctx.multiple.value\"\n class=\"list-box-item__indicator\"\n data-slot=\"list-box-item-indicator\"\n >\n <slot name=\"selectedIcon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n data-slot=\"list-box-item-indicator--checkmark\"\n aria-hidden=\"true\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </slot>\n </ComboboxItemIndicator>\n <!-- Multiple mode: check against our selectedValues array instead -->\n <span\n v-else-if=\"isChecked\"\n class=\"list-box-item__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 </span>\n <slot name=\"endContent\" />\n </AutocompleteItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EASd,MAAM,QAAe,UAAS;EAC9B,MAAM,MAAM,uBAAsB;EAElC,SAAS,YAAY,OAAwB;AAC3C,UAAO,MAAM,KAAI,MAAK;AACpB,QAAI,OAAO,EAAE,aAAa,SAAU,QAAO,EAAE;AAC7C,QAAI,MAAM,QAAQ,EAAE,SAAS,CAAE,QAAO,YAAY,EAAE,SAAmB;AACvE,WAAO;KACP,CAAC,KAAK,GAAE;;EAGZ,MAAM,cAAc,eAAuB;GACzC,MAAM,SAA+B,MAAM,WAA0C;AACrF,OAAI,CAAC,OAAQ,QAAO,MAAM;AAC1B,UAAO,YAAY,OAAO,CAAC,MAAM,IAAI,MAAM;IAC5C;EAGD,MAAM,YAAY,eAAe,IAAI,SAAS,SAAS,IAAI,WAAW,MAAM,MAAM,CAAA;AAElF,kBAAgB;AACd,OAAI,aAAa,MAAM,OAAO,YAAY,MAAK;IAChD;AAED,oBAAkB;AAChB,OAAI,eAAe,MAAM,MAAK;IAC/B;EAED,SAAS,aAAa,OAAc;AAClC,OAAI,IAAI,SAAS,OAAO;AAGtB,UAAM,gBAAe;AACrB,QAAI,iBAAiB,MAAM,MAAK;;;;uBAMlC,YAgEmB,MAAA,iBAAA,EAAA;IA/DhB,OAAO,YAAA;IACP,cAAY,YAAA;IACZ,UAAU,MAAM;IAChB,mBAAiB,MAAM;IACvB,iBAAe,UAAA,SAAa,KAAA;IAC7B,OAAM;IACN,aAAU;IACT,UAAQ;;2BAEmB;KAA5B,WAA4B,KAAA,QAAA,eAAA;KAC5B,mBAGgB,QAHhB,YAGgB,CAAf,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;MAGA,MAAA,IAAG,CAAC,SAAS,SAAA,WAAA,EADtB,YAsBwB,MAAA,sBAAA,EAAA;;MApBtB,OAAM;MACN,aAAU;;6BAkBH,CAhBP,WAgBO,KAAA,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAfL,mBAcM,OAAA;OAbJ,OAAM;OACN,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,gBAAa;OACb,kBAAe;OACf,mBAAgB;OAChB,aAAU;OACV,eAAY;UAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA;;WAM1B,UAAA,SAAA,WAAA,EADb,mBAsBO,QAtBP,YAsBO,CAjBL,WAgBO,KAAA,QAAA,gBAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAfL,mBAcM,OAAA;MAbJ,OAAM;MACN,OAAM;MACN,QAAO;MACP,SAAQ;MACR,MAAK;MACL,QAAO;MACP,gBAAa;MACb,kBAAe;MACf,mBAAgB;MAChB,aAAU;MACV,eAAY;SAEZ,mBAAoC,YAAA,EAA1B,QAAO,kBAAgB,CAAA,CAAA,EAAA,GAAA,EAAA,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;KAIvC,WAA0B,KAAA,QAAA,aAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AutocompleteOverflowChips_vue_vue_type_script_setup_true_lang_default from "./AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/autocomplete/AutocompleteOverflowChips.vue
|
|
3
|
+
var AutocompleteOverflowChips_default = AutocompleteOverflowChips_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { AutocompleteOverflowChips_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=AutocompleteOverflowChips.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutocompleteOverflowChips.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteOverflowChips.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, nextTick, useTemplateRef, onMounted, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport Chip from '../chip/Chip.vue'\n\nconst props = defineProps<{\n values: string[]\n getLabel: (value: string) => string\n removeValue: (value: string) => void\n}>()\n\nconst containerEl = useTemplateRef<HTMLElement>('container')\nconst visibleCount = ref(props.values.length)\nconst overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value))\n\n// Prevents re-entrant reflows while we are in the async measurement phase.\nlet measuring = false\n\nasync function reflow() {\n if (measuring) return\n measuring = true\n\n try {\n const el = containerEl.value\n if (!el) return\n\n // Phase 1: show all chips to measure their natural widths\n visibleCount.value = props.values.length\n await nextTick()\n\n const chips = [...el.querySelectorAll<HTMLElement>('[data-chip-item]')]\n if (!chips.length) return\n\n const containerW = el.offsetWidth\n if (!containerW) return\n\n // BADGE_W = estimated chip width (68px) + CSS gap before it (4px).\n const BADGE_W = 76\n\n let usedW = 0\n let n = 0\n\n for (let i = 0; i < chips.length; i++) {\n const gap = i > 0 ? 4 : 0\n const chipW = chips[i].offsetWidth\n const isLast = i === chips.length - 1\n const budget = isLast ? containerW : containerW - BADGE_W\n\n if (usedW + gap + chipW > budget) break\n usedW += gap + chipW\n n++\n }\n\n visibleCount.value = Math.max(1, n)\n } finally {\n measuring = false\n }\n}\n\nonMounted(reflow)\nuseResizeObserver(containerEl, reflow)\nwatch(\n () => props.values.join('\\x00'),\n () => reflow(),\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"container\"\n style=\"display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0;\"\n >\n <Chip\n v-for=\"(val, i) in values\"\n :key=\"val\"\n data-chip-item\n size=\"sm\"\n is-closable\n :style=\"i >= visibleCount ? 'display: none' : undefined\"\n @close.stop=\"removeValue(val)\"\n >\n {{ getLabel(val) }}\n </Chip>\n <Chip\n v-if=\"overflowCount > 0\"\n size=\"sm\"\n color=\"default\"\n >\n +{{ overflowCount }} more\n </Chip>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import Chip_default from "../chip/Chip.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, defineComponent, nextTick, normalizeStyle, onMounted, openBlock, ref, renderList, toDisplayString, useTemplateRef, watch, withCtx, withModifiers } from "vue";
|
|
3
|
+
import { useResizeObserver } from "@vueuse/core";
|
|
4
|
+
//#region src/components/autocomplete/AutocompleteOverflowChips.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _hoisted_1 = {
|
|
6
|
+
ref: "container",
|
|
7
|
+
style: {
|
|
8
|
+
"display": "flex",
|
|
9
|
+
"flex-wrap": "nowrap",
|
|
10
|
+
"align-items": "center",
|
|
11
|
+
"gap": "4px",
|
|
12
|
+
"overflow": "hidden",
|
|
13
|
+
"flex": "1",
|
|
14
|
+
"min-width": "0"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var AutocompleteOverflowChips_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "AutocompleteOverflowChips",
|
|
19
|
+
props: {
|
|
20
|
+
values: {},
|
|
21
|
+
getLabel: { type: Function },
|
|
22
|
+
removeValue: { type: Function }
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const containerEl = useTemplateRef("container");
|
|
27
|
+
const visibleCount = ref(props.values.length);
|
|
28
|
+
const overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value));
|
|
29
|
+
let measuring = false;
|
|
30
|
+
async function reflow() {
|
|
31
|
+
if (measuring) return;
|
|
32
|
+
measuring = true;
|
|
33
|
+
try {
|
|
34
|
+
const el = containerEl.value;
|
|
35
|
+
if (!el) return;
|
|
36
|
+
visibleCount.value = props.values.length;
|
|
37
|
+
await nextTick();
|
|
38
|
+
const chips = [...el.querySelectorAll("[data-chip-item]")];
|
|
39
|
+
if (!chips.length) return;
|
|
40
|
+
const containerW = el.offsetWidth;
|
|
41
|
+
if (!containerW) return;
|
|
42
|
+
const BADGE_W = 76;
|
|
43
|
+
let usedW = 0;
|
|
44
|
+
let n = 0;
|
|
45
|
+
for (let i = 0; i < chips.length; i++) {
|
|
46
|
+
const gap = i > 0 ? 4 : 0;
|
|
47
|
+
const chipW = chips[i].offsetWidth;
|
|
48
|
+
const budget = i === chips.length - 1 ? containerW : containerW - BADGE_W;
|
|
49
|
+
if (usedW + gap + chipW > budget) break;
|
|
50
|
+
usedW += gap + chipW;
|
|
51
|
+
n++;
|
|
52
|
+
}
|
|
53
|
+
visibleCount.value = Math.max(1, n);
|
|
54
|
+
} finally {
|
|
55
|
+
measuring = false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
onMounted(reflow);
|
|
59
|
+
useResizeObserver(containerEl, reflow);
|
|
60
|
+
watch(() => props.values.join("\0"), () => reflow(), { flush: "post" });
|
|
61
|
+
return (_ctx, _cache) => {
|
|
62
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.values, (val, i) => {
|
|
63
|
+
return openBlock(), createBlock(Chip_default, {
|
|
64
|
+
key: val,
|
|
65
|
+
"data-chip-item": "",
|
|
66
|
+
size: "sm",
|
|
67
|
+
"is-closable": "",
|
|
68
|
+
style: normalizeStyle(i >= visibleCount.value ? "display: none" : void 0),
|
|
69
|
+
onClose: withModifiers(($event) => __props.removeValue(val), ["stop"])
|
|
70
|
+
}, {
|
|
71
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.getLabel(val)), 1)]),
|
|
72
|
+
_: 2
|
|
73
|
+
}, 1032, ["style", "onClose"]);
|
|
74
|
+
}), 128)), overflowCount.value > 0 ? (openBlock(), createBlock(Chip_default, {
|
|
75
|
+
key: 0,
|
|
76
|
+
size: "sm",
|
|
77
|
+
color: "default"
|
|
78
|
+
}, {
|
|
79
|
+
default: withCtx(() => [createTextVNode(" +" + toDisplayString(overflowCount.value) + " more ", 1)]),
|
|
80
|
+
_: 1
|
|
81
|
+
})) : createCommentVNode("", true)], 512);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { AutocompleteOverflowChips_vue_vue_type_script_setup_true_lang_default as default };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutocompleteOverflowChips.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/autocomplete/AutocompleteOverflowChips.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed, nextTick, useTemplateRef, onMounted, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport Chip from '../chip/Chip.vue'\n\nconst props = defineProps<{\n values: string[]\n getLabel: (value: string) => string\n removeValue: (value: string) => void\n}>()\n\nconst containerEl = useTemplateRef<HTMLElement>('container')\nconst visibleCount = ref(props.values.length)\nconst overflowCount = computed(() => Math.max(0, props.values.length - visibleCount.value))\n\n// Prevents re-entrant reflows while we are in the async measurement phase.\nlet measuring = false\n\nasync function reflow() {\n if (measuring) return\n measuring = true\n\n try {\n const el = containerEl.value\n if (!el) return\n\n // Phase 1: show all chips to measure their natural widths\n visibleCount.value = props.values.length\n await nextTick()\n\n const chips = [...el.querySelectorAll<HTMLElement>('[data-chip-item]')]\n if (!chips.length) return\n\n const containerW = el.offsetWidth\n if (!containerW) return\n\n // BADGE_W = estimated chip width (68px) + CSS gap before it (4px).\n const BADGE_W = 76\n\n let usedW = 0\n let n = 0\n\n for (let i = 0; i < chips.length; i++) {\n const gap = i > 0 ? 4 : 0\n const chipW = chips[i].offsetWidth\n const isLast = i === chips.length - 1\n const budget = isLast ? containerW : containerW - BADGE_W\n\n if (usedW + gap + chipW > budget) break\n usedW += gap + chipW\n n++\n }\n\n visibleCount.value = Math.max(1, n)\n } finally {\n measuring = false\n }\n}\n\nonMounted(reflow)\nuseResizeObserver(containerEl, reflow)\nwatch(\n () => props.values.join('\\x00'),\n () => reflow(),\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"container\"\n style=\"display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; flex: 1; min-width: 0;\"\n >\n <Chip\n v-for=\"(val, i) in values\"\n :key=\"val\"\n data-chip-item\n size=\"sm\"\n is-closable\n :style=\"i >= visibleCount ? 'display: none' : undefined\"\n @close.stop=\"removeValue(val)\"\n >\n {{ getLabel(val) }}\n </Chip>\n <Chip\n v-if=\"overflowCount > 0\"\n size=\"sm\"\n color=\"default\"\n >\n +{{ overflowCount }} more\n </Chip>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAMd,MAAM,cAAc,eAA4B,YAAW;EAC3D,MAAM,eAAe,IAAI,MAAM,OAAO,OAAM;EAC5C,MAAM,gBAAgB,eAAe,KAAK,IAAI,GAAG,MAAM,OAAO,SAAS,aAAa,MAAM,CAAA;EAG1F,IAAI,YAAY;EAEhB,eAAe,SAAS;AACtB,OAAI,UAAW;AACf,eAAY;AAEZ,OAAI;IACF,MAAM,KAAK,YAAY;AACvB,QAAI,CAAC,GAAI;AAGT,iBAAa,QAAQ,MAAM,OAAO;AAClC,UAAM,UAAS;IAEf,MAAM,QAAQ,CAAC,GAAG,G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ts\">\nimport { computed, ref, toRef, useId, watch } from 'vue'\nimport { ComboboxRoot } from 'reka-ui'\nimport { comboBoxVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useComboBoxProvide } from './ComboBox.context'\n\nexport interface ComboBoxItem {\n value: string\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n open?: boolean\n defaultOpen?: boolean\n items?: ComboBoxItem[]\n label?: string\n placeholder?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isRequired?: boolean\n allowsCustomValue?: boolean\n fullWidth?: boolean\n /** Custom filter function: return true to include item */\n filterFunction?: (item: string, searchTerm: string) => boolean\n class?: string\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n items: () => [],\n label: undefined,\n placeholder: undefined,\n description: undefined,\n errorMessage: undefined,\n isInvalid: false,\n isDisabled: false,\n isRequired: false,\n allowsCustomValue: false,\n fullWidth: false,\n filterFunction: undefined,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'update:open': [value: boolean]\n}>()\n\nconst labelId = useId()\n\nconst slotFns = computed(() =>\n comboBoxVariants({\n fullWidth: props.fullWidth,\n })\n)\n\n// Default filter: case-insensitive substring match\nconst effectiveFilter = computed(() => {\n if (props.filterFunction) return props.filterFunction\n return (itemText: string, searchTerm: string): boolean =>\n itemText.toLowerCase().includes(searchTerm.toLowerCase())\n})\n\n// Registry for slot-rendered items: value → label (populated by ComboBoxItem at mount).\n// Replaced with a new Map instance on each mutation so Vue's ref() reactivity tracks changes.\nconst slotItemRegistry = ref(new Map<string, string>())\n\nfunction registerItem(value: string, label: string) {\n const next = new Map(slotItemRegistry.value)\n next.set(value, label)\n slotItemRegistry.value = next\n}\n\nfunction unregisterItem(value: string) {\n const next = new Map(slotItemRegistry.value)\n next.delete(value)\n slotItemRegistry.value = next\n}\n\n// Resolve a user-facing value (\"us\") to the label text used internally by Reka.\n// Priority: items prop entry > slot registry > identity fallback\nfunction labelFor(value: string | undefined): string {\n if (!value) return ''\n const item = props.items.find(i => i.value === value)\n if (item) return item.label ?? item.textValue ?? value\n return slotItemRegistry.value.get(value) ?? value\n}\n\n// Resolve a Reka-internal label text back to the user-facing value.\nfunction valueFor(label: string): string {\n if (!label) return ''\n // Check items prop first\n const item = props.items.find(i => (i.label ?? i.textValue ?? i.value) === label)\n if (item) return item.value\n // Check slot registry\n for (const [value, lbl] of slotItemRegistry.value) {\n if (lbl === label) return value\n }\n return label\n}\n\n// internalValue holds the label text that Reka sees as its modelValue.\n// This lets Reka write the label directly into the input without a displayValue function.\nconst internalValue = ref(labelFor(props.modelValue))\n\n// Map a stored value back to its human-readable label for the input display.\n// Used as a no-op pass-through since internalValue already holds the label.\nconst displayValue = computed(() => (val: string): string => val)\n\n// Parent → internal: when the user's v-model changes, resolve to label text\nwatch(() => props.modelValue, (val) => {\n const next = labelFor(val)\n if (internalValue.value !== next) internalValue.value = next\n})\n\n// Internal → parent: when Reka emits a label text (after selection), translate to real value\nfunction handleModelValueUpdate(emitted: string) {\n internalValue.value = emitted\n emit('update:modelValue', valueFor(emitted))\n}\n\n// When slot items register (children mount after parent), re-resolve internalValue.\n// This covers the case where modelValue is set before children have mounted.\nwatch(slotItemRegistry, () => {\n const next = labelFor(props.modelValue)\n if (next !== internalValue.value && valueFor(internalValue.value) === (props.modelValue ?? '')) {\n internalValue.value = next\n }\n})\n\nuseComboBoxProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n fullWidth: toRef(props, 'fullWidth'),\n slots: slotFns,\n displayValue,\n registerItem,\n unregisterItem,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class)\"\n :aria-invalid=\"props.isInvalid || undefined\"\n data-slot=\"combo-box\"\n >\n <label\n v-if=\"props.label\"\n :id=\"labelId\"\n data-slot=\"label\"\n >\n {{ props.label }}\n <span\n v-if=\"props.isRequired\"\n aria-hidden=\"true\"\n > *</span>\n </label>\n\n <ComboboxRoot\n v-model=\"internalValue\"\n :default-value=\"props.defaultValue ? labelFor(props.defaultValue) : undefined\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :filter-function=\"effectiveFilter\"\n @update:model-value=\"handleModelValueUpdate($event)\"\n @update:open=\"emit('update:open', $event)\"\n >\n <slot />\n </ComboboxRoot>\n\n <div\n v-if=\"props.description || (props.isInvalid && props.errorMessage)\"\n data-slot=\"helper-wrapper\"\n >\n <p\n v-if=\"props.isInvalid && props.errorMessage\"\n data-slot=\"error-message\"\n aria-live=\"polite\"\n >\n {{ props.errorMessage }}\n </p>\n <p\n v-else-if=\"props.description\"\n data-slot=\"description\"\n >\n {{ props.description }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ComboBox.js","names":[],"sources":["../../../src/components/combo-box/ComboBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, useId, useSlots, watch } from 'vue'\nimport { ComboboxRoot } from 'reka-ui'\nimport { comboBoxVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useComboBoxProvide } from './ComboBox.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport ComboBoxInput from './ComboBoxInput.vue'\nimport ComboBoxContent from './ComboBoxContent.vue'\nimport ComboBoxItem from './ComboBoxItem.vue'\n\nexport interface ComboBoxItem {\n value: string\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n open?: boolean\n defaultOpen?: boolean\n items?: ComboBoxItem[]\n label?: string\n placeholder?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isRequired?: boolean\n allowsCustomValue?: boolean\n fullWidth?: boolean\n /** Custom filter function: return true to include item */\n filterFunction?: (item: string, searchTerm: string) => boolean\n class?: string\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n items: () => [],\n label: undefined,\n placeholder: undefined,\n description: undefined,\n errorMessage: undefined,\n isInvalid: false,\n isDisabled: false,\n isRequired: false,\n allowsCustomValue: false,\n fullWidth: false,\n filterFunction: undefined,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'update:open': [value: boolean]\n}>()\n\nconst labelId = useId()\n\nconst slots = useSlots()\n// Compound chrome present → pass slot through (advanced). Otherwise render the\n// input/content/items internally (short-form).\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.(), [ComboBoxInput, ComboBoxContent]),\n)\n\nconst slotFns = computed(() =>\n comboBoxVariants({\n fullWidth: props.fullWidth,\n })\n)\n\n// Default filter: case-insensitive substring match\nconst effectiveFilter = computed(() => {\n if (props.filterFunction) return props.filterFunction\n return (itemText: string, searchTerm: string): boolean =>\n itemText.toLowerCase().includes(searchTerm.toLowerCase())\n})\n\n// Registry for slot-rendered items: value → label (populated by ComboBoxItem at mount).\n// Replaced with a new Map instance on each mutation so Vue's ref() reactivity tracks changes.\nconst slotItemRegistry = ref(new Map<string, string>())\n\nfunction registerItem(value: string, label: string) {\n const next = new Map(slotItemRegistry.value)\n next.set(value, label)\n slotItemRegistry.value = next\n}\n\nfunction unregisterItem(value: string) {\n const next = new Map(slotItemRegistry.value)\n next.delete(value)\n slotItemRegistry.value = next\n}\n\n// Resolve a user-facing value (\"us\") to the label text used internally by Reka.\n// Priority: items prop entry > slot registry > identity fallback\nfunction labelFor(value: string | undefined): string {\n if (!value) return ''\n const item = props.items.find(i => i.value === value)\n if (item) return item.label ?? item.textValue ?? value\n return slotItemRegistry.value.get(value) ?? value\n}\n\n// Resolve a Reka-internal label text back to the user-facing value.\nfunction valueFor(label: string): string {\n if (!label) return ''\n // Check items prop first\n const item = props.items.find(i => (i.label ?? i.textValue ?? i.value) === label)\n if (item) return item.value\n // Check slot registry\n for (const [value, lbl] of slotItemRegistry.value) {\n if (lbl === label) return value\n }\n return label\n}\n\n// internalValue holds the label text that Reka sees as its modelValue.\n// This lets Reka write the label directly into the input without a displayValue function.\nconst internalValue = ref(labelFor(props.modelValue))\n\n// Map a stored value back to its human-readable label for the input display.\n// Used as a no-op pass-through since internalValue already holds the label.\nconst displayValue = computed(() => (val: string): string => val)\n\n// Parent → internal: when the user's v-model changes, resolve to label text\nwatch(() => props.modelValue, (val) => {\n const next = labelFor(val)\n if (internalValue.value !== next) internalValue.value = next\n})\n\n// Internal → parent: when Reka emits a label text (after selection), translate to real value\nfunction handleModelValueUpdate(emitted: string) {\n internalValue.value = emitted\n emit('update:modelValue', valueFor(emitted))\n}\n\n// When slot items register (children mount after parent), re-resolve internalValue.\n// This covers the case where modelValue is set before children have mounted.\nwatch(slotItemRegistry, () => {\n const next = labelFor(props.modelValue)\n if (next !== internalValue.value && valueFor(internalValue.value) === (props.modelValue ?? '')) {\n internalValue.value = next\n }\n})\n\nuseComboBoxProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n fullWidth: toRef(props, 'fullWidth'),\n slots: slotFns,\n displayValue,\n registerItem,\n unregisterItem,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class)\"\n :aria-invalid=\"props.isInvalid || undefined\"\n data-slot=\"combo-box\"\n >\n <label\n v-if=\"props.label\"\n :id=\"labelId\"\n data-slot=\"label\"\n >\n {{ props.label }}\n <span\n v-if=\"props.isRequired\"\n aria-hidden=\"true\"\n > *</span>\n </label>\n\n <ComboboxRoot\n v-model=\"internalValue\"\n :default-value=\"props.defaultValue ? labelFor(props.defaultValue) : undefined\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :filter-function=\"effectiveFilter\"\n @update:model-value=\"handleModelValueUpdate($event)\"\n @update:open=\"emit('update:open', $event)\"\n >\n <slot v-if=\"usesCustomChrome\" />\n <template v-else>\n <ComboBoxInput :placeholder=\"props.placeholder\" />\n <ComboBoxContent>\n <ComboBoxItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.isDisabled\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n >{{ item.label ?? item.textValue ?? item.value }}</slot>\n </ComboBoxItem>\n </ComboBoxContent>\n </template>\n </ComboboxRoot>\n\n <div\n v-if=\"props.description || (props.isInvalid && props.errorMessage)\"\n data-slot=\"helper-wrapper\"\n >\n <p\n v-if=\"props.isInvalid && props.errorMessage\"\n data-slot=\"error-message\"\n aria-live=\"polite\"\n >\n {{ props.errorMessage }}\n </p>\n <p\n v-else-if=\"props.description\"\n data-slot=\"description\"\n >\n {{ props.description }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
|
+
import { hasSlotComponent } from "../../utils/hasSlotComponent.js";
|
|
2
3
|
import { useComboBoxProvide } from "./ComboBox.context.js";
|
|
3
|
-
import
|
|
4
|
+
import ComboBoxInput_default from "./ComboBoxInput.js";
|
|
5
|
+
import ComboBoxContent_default from "./ComboBoxContent.js";
|
|
6
|
+
import ComboBoxItem_default from "./ComboBoxItem.js";
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, useId, useSlots, watch, withCtx } from "vue";
|
|
4
8
|
import { comboBoxVariants } from "@auronui/styles";
|
|
5
9
|
import { ComboboxRoot } from "reka-ui";
|
|
6
10
|
//#region src/components/combo-box/ComboBox.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -72,6 +76,8 @@ var ComboBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
72
76
|
const props = __props;
|
|
73
77
|
const emit = __emit;
|
|
74
78
|
const labelId = useId();
|
|
79
|
+
const slots = useSlots();
|
|
80
|
+
const usesCustomChrome = computed(() => hasSlotComponent(slots.default?.(), [ComboBoxInput_default, ComboBoxContent_default]));
|
|
75
81
|
const slotFns = computed(() => comboBoxVariants({ fullWidth: props.fullWidth }));
|
|
76
82
|
const effectiveFilter = computed(() => {
|
|
77
83
|
if (props.filterFunction) return props.filterFunction;
|
|
@@ -146,7 +152,19 @@ var ComboBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
146
152
|
"filter-function": effectiveFilter.value,
|
|
147
153
|
"onUpdate:open": _cache[2] || (_cache[2] = ($event) => emit("update:open", $event))
|
|
148
154
|
}, {
|
|
149
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
155
|
+
default: withCtx(() => [usesCustomChrome.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(ComboBoxInput_default, { placeholder: props.placeholder }, null, 8, ["placeholder"]), createVNode(ComboBoxContent_default, null, {
|
|
156
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
|
|
157
|
+
return openBlock(), createBlock(ComboBoxItem_default, {
|
|
158
|
+
key: item.value,
|
|
159
|
+
value: item.value,
|
|
160
|
+
"is-disabled": item.isDisabled
|
|
161
|
+
}, {
|
|
162
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "item", { item }, () => [createTextVNode(toDisplayString(item.label ?? item.textValue ?? item.value), 1)])]),
|
|
163
|
+
_: 2
|
|
164
|
+
}, 1032, ["value", "is-disabled"]);
|
|
165
|
+
}), 128))]),
|
|
166
|
+
_: 3
|
|
167
|
+
})], 64))]),
|
|
150
168
|
_: 3
|
|
151
169
|
}, 8, [
|
|
152
170
|
"modelValue",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, useId, watch } from 'vue'\nimport { ComboboxRoot } from 'reka-ui'\nimport { comboBoxVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useComboBoxProvide } from './ComboBox.context'\n\nexport interface ComboBoxItem {\n value: string\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n open?: boolean\n defaultOpen?: boolean\n items?: ComboBoxItem[]\n label?: string\n placeholder?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isRequired?: boolean\n allowsCustomValue?: boolean\n fullWidth?: boolean\n /** Custom filter function: return true to include item */\n filterFunction?: (item: string, searchTerm: string) => boolean\n class?: string\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n items: () => [],\n label: undefined,\n placeholder: undefined,\n description: undefined,\n errorMessage: undefined,\n isInvalid: false,\n isDisabled: false,\n isRequired: false,\n allowsCustomValue: false,\n fullWidth: false,\n filterFunction: undefined,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'update:open': [value: boolean]\n}>()\n\nconst labelId = useId()\n\nconst slotFns = computed(() =>\n comboBoxVariants({\n fullWidth: props.fullWidth,\n })\n)\n\n// Default filter: case-insensitive substring match\nconst effectiveFilter = computed(() => {\n if (props.filterFunction) return props.filterFunction\n return (itemText: string, searchTerm: string): boolean =>\n itemText.toLowerCase().includes(searchTerm.toLowerCase())\n})\n\n// Registry for slot-rendered items: value → label (populated by ComboBoxItem at mount).\n// Replaced with a new Map instance on each mutation so Vue's ref() reactivity tracks changes.\nconst slotItemRegistry = ref(new Map<string, string>())\n\nfunction registerItem(value: string, label: string) {\n const next = new Map(slotItemRegistry.value)\n next.set(value, label)\n slotItemRegistry.value = next\n}\n\nfunction unregisterItem(value: string) {\n const next = new Map(slotItemRegistry.value)\n next.delete(value)\n slotItemRegistry.value = next\n}\n\n// Resolve a user-facing value (\"us\") to the label text used internally by Reka.\n// Priority: items prop entry > slot registry > identity fallback\nfunction labelFor(value: string | undefined): string {\n if (!value) return ''\n const item = props.items.find(i => i.value === value)\n if (item) return item.label ?? item.textValue ?? value\n return slotItemRegistry.value.get(value) ?? value\n}\n\n// Resolve a Reka-internal label text back to the user-facing value.\nfunction valueFor(label: string): string {\n if (!label) return ''\n // Check items prop first\n const item = props.items.find(i => (i.label ?? i.textValue ?? i.value) === label)\n if (item) return item.value\n // Check slot registry\n for (const [value, lbl] of slotItemRegistry.value) {\n if (lbl === label) return value\n }\n return label\n}\n\n// internalValue holds the label text that Reka sees as its modelValue.\n// This lets Reka write the label directly into the input without a displayValue function.\nconst internalValue = ref(labelFor(props.modelValue))\n\n// Map a stored value back to its human-readable label for the input display.\n// Used as a no-op pass-through since internalValue already holds the label.\nconst displayValue = computed(() => (val: string): string => val)\n\n// Parent → internal: when the user's v-model changes, resolve to label text\nwatch(() => props.modelValue, (val) => {\n const next = labelFor(val)\n if (internalValue.value !== next) internalValue.value = next\n})\n\n// Internal → parent: when Reka emits a label text (after selection), translate to real value\nfunction handleModelValueUpdate(emitted: string) {\n internalValue.value = emitted\n emit('update:modelValue', valueFor(emitted))\n}\n\n// When slot items register (children mount after parent), re-resolve internalValue.\n// This covers the case where modelValue is set before children have mounted.\nwatch(slotItemRegistry, () => {\n const next = labelFor(props.modelValue)\n if (next !== internalValue.value && valueFor(internalValue.value) === (props.modelValue ?? '')) {\n internalValue.value = next\n }\n})\n\nuseComboBoxProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n fullWidth: toRef(props, 'fullWidth'),\n slots: slotFns,\n displayValue,\n registerItem,\n unregisterItem,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class)\"\n :aria-invalid=\"props.isInvalid || undefined\"\n data-slot=\"combo-box\"\n >\n <label\n v-if=\"props.label\"\n :id=\"labelId\"\n data-slot=\"label\"\n >\n {{ props.label }}\n <span\n v-if=\"props.isRequired\"\n aria-hidden=\"true\"\n > *</span>\n </label>\n\n <ComboboxRoot\n v-model=\"internalValue\"\n :default-value=\"props.defaultValue ? labelFor(props.defaultValue) : undefined\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :filter-function=\"effectiveFilter\"\n @update:model-value=\"handleModelValueUpdate($event)\"\n @update:open=\"emit('update:open', $event)\"\n >\n <slot />\n </ComboboxRoot>\n\n <div\n v-if=\"props.description || (props.isInvalid && props.errorMessage)\"\n data-slot=\"helper-wrapper\"\n >\n <p\n v-if=\"props.isInvalid && props.errorMessage\"\n data-slot=\"error-message\"\n aria-live=\"polite\"\n >\n {{ props.errorMessage }}\n </p>\n <p\n v-else-if=\"props.description\"\n data-slot=\"description\"\n >\n {{ props.description }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAqCd,MAAM,OAAO;EAKb,MAAM,UAAU,OAAM;EAEtB,MAAM,UAAU,eACd,iBAAiB,EACf,WAAW,MAAM,WAClB,CAAA,CACH;EAGA,MAAM,kBAAkB,eAAe;AACrC,OAAI,MAAM,eAAgB,QAAO,MAAM;AACvC,WAAQ,UAAkB,eACxB,SAAS,aAAa,CAAC,SAAS,WAAW,aAAa,CAAA;IAC3D;EAID,MAAM,mBAAmB,oBAAI,IAAI,KAAqB,CAAA;EAEtD,SAAS,aAAa,OAAe,OAAe;GAClD,MAAM,OAAO,IAAI,IAAI,iBAAiB,MAAK;AAC3C,QAAK,IAAI,OAAO,MAAK;AACrB,oBAAiB,QAAQ;;EAG3B,SAAS,eAAe,O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Q,MAAI,EAAI,MAAM,MAAK,CAAA;IACnD,gBAAc,MAAM,aAAa,KAAA;IAClC,aAAU;;IAGF,MAAM,SAAA,WAAA,EADd,mBAUQ,SAAA;;KARL,IAAI,MAAA,QAAO;KACZ,aAAU;wCAEP,MAAM,MAAK,GAAG,KACjB,EAAA,EACQ,MAAM,cAAA,WAAA,EADd,mBAGU,QAHV,YAGC,KAAE,IAAA,mBAAA,IAAA,KAAA,CAAA,EAAA,GAAA,WAAA,IAAA,mBAAA,IAAA,KAAA;IAGL,YAYe,MAAA,aAAA,EAAA;iBAXJ,cAAA;iFAAa,QAAA,SAAA,OAAA,OAAA,OAAA,MAAA,WAOD,uBAAuB,OAAM,EAAA;KANjD,iBAAe,MAAM,eAAe,SAAS,MAAM,aAAY,GAAI,KAAA;KACnE,MAAM,MAAM;KACZ,gBAAc,MAAM;KACpB,UAAU,MAAM;KAChB,UAAU,MAAM;KAChB,mBAAiB,gBAAA;KAEjB,iBAAW,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,eAAgB,OAAM;;4BAEhC,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;;;;;;;;;IAIF,MAAM,eAAgB,MAAM,aAAa,MAAM,gBAAA,WAAA,EADvD,mBAiBM,OAjBN,YAiBM,CAZI,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAMI,KANJ,YAMI,gBADC,MAAM,aAAY,EAAA,EAAA,IAGV,MAAM,eAAA,WAAA,EADnB,mBAKI,KALJ,YAKI,gBADC,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"ComboBox.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/combo-box/ComboBox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, useId, useSlots, watch } from 'vue'\nimport { ComboboxRoot } from 'reka-ui'\nimport { comboBoxVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useComboBoxProvide } from './ComboBox.context'\nimport { hasSlotComponent } from '../../utils/hasSlotComponent'\nimport ComboBoxInput from './ComboBoxInput.vue'\nimport ComboBoxContent from './ComboBoxContent.vue'\nimport ComboBoxItem from './ComboBoxItem.vue'\n\nexport interface ComboBoxItem {\n value: string\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n open?: boolean\n defaultOpen?: boolean\n items?: ComboBoxItem[]\n label?: string\n placeholder?: string\n description?: string\n errorMessage?: string\n isInvalid?: boolean\n isDisabled?: boolean\n isRequired?: boolean\n allowsCustomValue?: boolean\n fullWidth?: boolean\n /** Custom filter function: return true to include item */\n filterFunction?: (item: string, searchTerm: string) => boolean\n class?: string\n}>(), {\n modelValue: undefined,\n defaultValue: undefined,\n open: undefined,\n defaultOpen: undefined,\n items: () => [],\n label: undefined,\n placeholder: undefined,\n description: undefined,\n errorMessage: undefined,\n isInvalid: false,\n isDisabled: false,\n isRequired: false,\n allowsCustomValue: false,\n fullWidth: false,\n filterFunction: undefined,\n class: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'update:open': [value: boolean]\n}>()\n\nconst labelId = useId()\n\nconst slots = useSlots()\n// Compound chrome present → pass slot through (advanced). Otherwise render the\n// input/content/items internally (short-form).\nconst usesCustomChrome = computed(() =>\n hasSlotComponent(slots.default?.(), [ComboBoxInput, ComboBoxContent]),\n)\n\nconst slotFns = computed(() =>\n comboBoxVariants({\n fullWidth: props.fullWidth,\n })\n)\n\n// Default filter: case-insensitive substring match\nconst effectiveFilter = computed(() => {\n if (props.filterFunction) return props.filterFunction\n return (itemText: string, searchTerm: string): boolean =>\n itemText.toLowerCase().includes(searchTerm.toLowerCase())\n})\n\n// Registry for slot-rendered items: value → label (populated by ComboBoxItem at mount).\n// Replaced with a new Map instance on each mutation so Vue's ref() reactivity tracks changes.\nconst slotItemRegistry = ref(new Map<string, string>())\n\nfunction registerItem(value: string, label: string) {\n const next = new Map(slotItemRegistry.value)\n next.set(value, label)\n slotItemRegistry.value = next\n}\n\nfunction unregisterItem(value: string) {\n const next = new Map(slotItemRegistry.value)\n next.delete(value)\n slotItemRegistry.value = next\n}\n\n// Resolve a user-facing value (\"us\") to the label text used internally by Reka.\n// Priority: items prop entry > slot registry > identity fallback\nfunction labelFor(value: string | undefined): string {\n if (!value) return ''\n const item = props.items.find(i => i.value === value)\n if (item) return item.label ?? item.textValue ?? value\n return slotItemRegistry.value.get(value) ?? value\n}\n\n// Resolve a Reka-internal label text back to the user-facing value.\nfunction valueFor(label: string): string {\n if (!label) return ''\n // Check items prop first\n const item = props.items.find(i => (i.label ?? i.textValue ?? i.value) === label)\n if (item) return item.value\n // Check slot registry\n for (const [value, lbl] of slotItemRegistry.value) {\n if (lbl === label) return value\n }\n return label\n}\n\n// internalValue holds the label text that Reka sees as its modelValue.\n// This lets Reka write the label directly into the input without a displayValue function.\nconst internalValue = ref(labelFor(props.modelValue))\n\n// Map a stored value back to its human-readable label for the input display.\n// Used as a no-op pass-through since internalValue already holds the label.\nconst displayValue = computed(() => (val: string): string => val)\n\n// Parent → internal: when the user's v-model changes, resolve to label text\nwatch(() => props.modelValue, (val) => {\n const next = labelFor(val)\n if (internalValue.value !== next) internalValue.value = next\n})\n\n// Internal → parent: when Reka emits a label text (after selection), translate to real value\nfunction handleModelValueUpdate(emitted: string) {\n internalValue.value = emitted\n emit('update:modelValue', valueFor(emitted))\n}\n\n// When slot items register (children mount after parent), re-resolve internalValue.\n// This covers the case where modelValue is set before children have mounted.\nwatch(slotItemRegistry, () => {\n const next = labelFor(props.modelValue)\n if (next !== internalValue.value && valueFor(internalValue.value) === (props.modelValue ?? '')) {\n internalValue.value = next\n }\n})\n\nuseComboBoxProvide({\n isDisabled: toRef(props, 'isDisabled'),\n isInvalid: toRef(props, 'isInvalid'),\n fullWidth: toRef(props, 'fullWidth'),\n slots: slotFns,\n displayValue,\n registerItem,\n unregisterItem,\n})\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class)\"\n :aria-invalid=\"props.isInvalid || undefined\"\n data-slot=\"combo-box\"\n >\n <label\n v-if=\"props.label\"\n :id=\"labelId\"\n data-slot=\"label\"\n >\n {{ props.label }}\n <span\n v-if=\"props.isRequired\"\n aria-hidden=\"true\"\n > *</span>\n </label>\n\n <ComboboxRoot\n v-model=\"internalValue\"\n :default-value=\"props.defaultValue ? labelFor(props.defaultValue) : undefined\"\n :open=\"props.open\"\n :default-open=\"props.defaultOpen\"\n :disabled=\"props.isDisabled\"\n :required=\"props.isRequired\"\n :filter-function=\"effectiveFilter\"\n @update:model-value=\"handleModelValueUpdate($event)\"\n @update:open=\"emit('update:open', $event)\"\n >\n <slot v-if=\"usesCustomChrome\" />\n <template v-else>\n <ComboBoxInput :placeholder=\"props.placeholder\" />\n <ComboBoxContent>\n <ComboBoxItem\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.isDisabled\"\n >\n <slot\n name=\"item\"\n :item=\"item\"\n >{{ item.label ?? item.textValue ?? item.value }}</slot>\n </ComboBoxItem>\n </ComboBoxContent>\n </template>\n </ComboboxRoot>\n\n <div\n v-if=\"props.description || (props.isInvalid && props.errorMessage)\"\n data-slot=\"helper-wrapper\"\n >\n <p\n v-if=\"props.isInvalid && props.errorMessage\"\n data-slot=\"error-message\"\n aria-live=\"polite\"\n >\n {{ props.errorMessage }}\n </p>\n <p\n v-else-if=\"props.description\"\n data-slot=\"description\"\n >\n {{ props.description }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ;EAqCd,MAAM,OAAO;EAKb,MAAM,UAAU,OAAM;EAEtB,MAAM,QAAQ,UAAS;EAGvB,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BAeW,UAAA,EAAA,KAAA,GAAA,EAAA,CAdT,YAAkD,uBAAA,EAAlC,aAAa,MAAM,aAAA,EAAA,MAAA,GAAA,CAAA,cAAA,CAAA,EACnC,YAYkB,yBAAA,MAAA;6BAVa,EAAA,UAAA,KAAA,EAD7B,mBAUe,UAAA,MAAA,WATE,MAAM,QAAd,SAAI;2BADb,YAUe,sBAAA;QARZ,KAAK,KAAK;QACV,OAAO,KAAK;QACZ,eAAa,KAAK;;+BAKqC,CAHxD,WAGwD,KAAA,QAAA,QAAA,EAD/C,MAAI,QAC2C,CAAA,gBAAA,gBAApD,KAAK,SAAS,KAAK,aAAa,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;IAO9C,MAAM,eAAgB,MAAM,aAAa,MAAM,gBAAA,WAAA,EADvD,mBAiBM,OAjBN,YAiBM,CAZI,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAMI,KANJ,YAMI,gBADC,MAAM,aAAY,EAAA,EAAA,IAGV,MAAM,eAAA,WAAA,EADnB,mBAKI,KALJ,YAKI,gBADC,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.context.js","names":[],"sources":["../../../src/components/select/Select.context.ts"],"sourcesContent":["import { createContext } from '../../utils/context'\nimport type { ComputedRef, Ref } from 'vue'\nimport type { selectVariants } from '@auronui/styles'\n\nexport interface SelectContext {\n isDisabled: Ref<boolean>\n isInvalid: Ref<boolean>\n isReadonly: Ref<boolean>\n isRequired: Ref<boolean>\n fullWidth: Ref<boolean>\n hasLabel: Ref<boolean>\n labelPlacement: Ref<'inside' | 'outside' | 'outside-left'>\n triggerId: Ref<string>\n label: Ref<string | undefined>\n ariaDescribedBy: Ref<string | undefined>\n slots: ComputedRef<ReturnType<typeof selectVariants>>\n /**\n * Persistent registry of item value → display label. SelectItem registers\n * once on first mount and never unregisters — survives SelectContent\n * unmount so SelectValue can show the selected label while the popover\n * is closed (Reka clears its own optionsSet on unmount).\n */\n registerItem: (value:
|
|
1
|
+
{"version":3,"file":"Select.context.js","names":[],"sources":["../../../src/components/select/Select.context.ts"],"sourcesContent":["import { createContext } from '../../utils/context'\nimport type { ComputedRef, Ref } from 'vue'\nimport type { selectVariants } from '@auronui/styles'\n\n/**\n * Acceptable value for a Select item / model. Numeric values are legitimate\n * (e.g. entity IDs) and are preserved end-to-end — they are only coerced to a\n * string where the underlying contract requires one (Reka `text-value`,\n * registry display labels).\n */\nexport type SelectItemValue = string | number\n\n/**\n * Data-driven item shape for the terse `items` prop. `value` accepts numeric\n * keys (see SelectItemValue). `label` is the display text (falls back to\n * String(value)); `textValue` overrides the type-ahead / pre-set label.\n */\nexport interface SelectItemData {\n value: SelectItemValue\n label?: string\n textValue?: string\n isDisabled?: boolean\n}\n\nexport interface SelectContext {\n isDisabled: Ref<boolean>\n isInvalid: Ref<boolean>\n isReadonly: Ref<boolean>\n isRequired: Ref<boolean>\n fullWidth: Ref<boolean>\n hasLabel: Ref<boolean>\n labelPlacement: Ref<'inside' | 'outside' | 'outside-left'>\n triggerId: Ref<string>\n label: Ref<string | undefined>\n ariaDescribedBy: Ref<string | undefined>\n slots: ComputedRef<ReturnType<typeof selectVariants>>\n multiple: Ref<boolean>\n /**\n * Persistent registry of item value → display label. SelectItem registers\n * once on first mount and never unregisters — survives SelectContent\n * unmount so SelectValue can show the selected label while the popover\n * is closed (Reka clears its own optionsSet on unmount).\n */\n registerItem: (value: SelectItemValue, label: string) => void\n itemLabel: (value: SelectItemValue | SelectItemValue[] | undefined | null) => string\n removeValue: (value: SelectItemValue) => void\n}\n\nexport const {\n useProvide: useSelectProvide,\n useInject: useSelectInject,\n key: selectContextKey,\n} = createContext<SelectContext>('Select')\n"],"mappings":";;AAgDA,IAAa,EACX,YAAY,kBACZ,WAAW,iBACX,KAAK,qBACH,cAA6B,SAAS"}
|