@bridge-ui/vue 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/Adapters/I18n/index.d.ts +1 -0
  2. package/dist/Adapters/I18n/index.js +2 -0
  3. package/dist/Adapters/I18n/useI18nAdapter.d.ts +12 -0
  4. package/dist/Adapters/I18n/useI18nAdapter.js +13 -0
  5. package/dist/Adapters/Icon/iconSource.types.d.ts +11 -0
  6. package/dist/Adapters/Icon/index.d.ts +2 -0
  7. package/dist/Adapters/Icon/index.js +2 -0
  8. package/dist/Adapters/Icon/useIconAdapter.d.ts +11 -0
  9. package/dist/Adapters/Icon/useIconAdapter.js +13 -0
  10. package/dist/Adapters/index.d.ts +3 -0
  11. package/dist/Adapters/index.js +3 -0
  12. package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +1 -5
  13. package/dist/Components/Alert/alert.types.d.ts +2 -2
  14. package/dist/Components/Alert/alertDefaultIcons.d.ts +2 -2
  15. package/dist/Components/Alert/alertDefaultIcons.js +9 -10
  16. package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
  17. package/dist/Components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
  18. package/dist/Components/Avatar/avatar.types.d.ts +2 -2
  19. package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
  20. package/dist/Components/Avatar/composables/useAvatar.js +43 -44
  21. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
  22. package/dist/Components/Button/button.types.d.ts +4 -4
  23. package/dist/Components/Button/composables/useButton.d.ts +1 -1
  24. package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +25 -25
  25. package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
  26. package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +8 -9
  27. package/dist/Components/FormControl/composables/useFormControl.d.ts +1 -1
  28. package/dist/Components/FormField/composables/useFormField.d.ts +4 -4
  29. package/dist/Components/FormField/composables/useFormField.js +98 -99
  30. package/dist/Components/FormField/formField.types.d.ts +5 -5
  31. package/dist/Components/Icon/Icon.vue_vue_type_script_setup_true_lang.js +7 -7
  32. package/dist/Components/Icon/composables/useIcon.d.ts +2 -0
  33. package/dist/Components/Icon/composables/useIcon.js +20 -18
  34. package/dist/Components/Icon/icon.types.d.ts +3 -3
  35. package/dist/Components/Label/composables/useLabel.d.ts +1 -1
  36. package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +2 -2
  37. package/dist/Components/Link/link.types.d.ts +3 -3
  38. package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
  39. package/dist/Components/ListItem/composables/useListItem.js +75 -76
  40. package/dist/Components/ListItem/listItem.types.d.ts +2 -2
  41. package/dist/Components/Listbox/Listbox.vue.d.ts +0 -2
  42. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +73 -72
  43. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +40 -40
  44. package/dist/Components/NumberField/composables/useNumberField.d.ts +6 -6
  45. package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +24 -24
  46. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +6 -6
  47. package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
  48. package/dist/Components/Select/Select.vue.d.ts +0 -1
  49. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +62 -61
  50. package/dist/Components/Select/composables/useSelect.d.ts +8 -8
  51. package/dist/Components/Select/composables/useSelect.js +214 -214
  52. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +81 -75
  53. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +4 -4
  54. package/dist/Components/Snackbar/snackbar.types.d.ts +2 -2
  55. package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +3 -3
  56. package/dist/Components/Snackbar/snackbarDefaultIcons.js +9 -10
  57. package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
  58. package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +2 -2
  59. package/dist/Components/Tab/tab.types.d.ts +3 -3
  60. package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +2 -2
  61. package/dist/Components/TabItem/tabItem.types.d.ts +3 -3
  62. package/dist/Components/Tabs/composables/useTabs.d.ts +468 -4
  63. package/dist/Components/Tabs/tabsInjectionKey.d.ts +5 -5
  64. package/dist/Components/TextField/composables/useTextField.d.ts +6 -6
  65. package/dist/Components/Textarea/composables/useTextarea.d.ts +6 -6
  66. package/dist/Components/Tooltip/Tooltip.js +5 -0
  67. package/dist/Components/Tooltip/Tooltip.vue.d.ts +35 -0
  68. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +73 -0
  69. package/dist/Components/Tooltip/composables/useTooltip.d.ts +50 -0
  70. package/dist/Components/Tooltip/composables/useTooltip.js +208 -0
  71. package/dist/Components/Tooltip/index.d.ts +4 -0
  72. package/dist/Components/Tooltip/index.js +3 -0
  73. package/dist/Components/Tooltip/tooltip.types.d.ts +166 -0
  74. package/dist/Provider/createBridgeUIApi.js +2 -1
  75. package/dist/index.d.ts +7 -1
  76. package/dist/index.js +80 -76
  77. package/package.json +20 -3
@@ -1,14 +1,14 @@
1
- import { hasNamedSlot as e } from "../../../Utils/slotOrProp.js";
2
- import { mergePartBind as t, resolveFieldAdornmentIconSize as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as ee } from "../../../Utils/index.js";
3
- import { formFieldBridgeKeys as te, useFormField as i } from "../../FormField/composables/useFormField.js";
4
- import { useListboxNavigation as ne } from "../../Listbox/composables/useListboxNavigation.js";
5
- import { Comment as re, Text as ie, computed as a, nextTick as ae, onBeforeUnmount as oe, onMounted as se, ref as o, useAttrs as ce, useId as le, useSlots as ue, watch as s } from "vue";
6
- import { get as c, isNil as de, omit as fe } from "es-toolkit/compat";
7
- import { adjustAutosizeTextareaHeight as pe, cn as l, createSelectAsyncSearch as me, filterListboxEntries as he, flattenListboxOptions as u, mergeBridgeUILayeredClasses as d, normalizeListboxEntries as f, normalizeSelectOptions as ge, resolveSelectAsyncDebounce as _e, resolveSelectAsyncOptions as ve, selectValuesEqual as p, splitComponentProps as ye } from "@bridge-ui/core";
8
- import { ChevronsUpDown as be } from "@lucide/vue";
9
- import { colorProps as xe, invalidatedProps as Se } from "@bridge-ui/core/Tokens/Listbox";
1
+ import { useI18nAdapter as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
+ import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
3
+ import { mergePartBind as n, resolveFieldAdornmentIconSize as r, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
4
+ import { formFieldBridgeKeys as te, useFormField as ne } from "../../FormField/composables/useFormField.js";
5
+ import { useListboxNavigation as re } from "../../Listbox/composables/useListboxNavigation.js";
6
+ import { Comment as ie, Text as ae, computed as a, nextTick as o, onBeforeUnmount as oe, onMounted as se, ref as s, useAttrs as ce, useId as le, useSlots as ue, watch as c } from "vue";
7
+ import { get as l, isNil as de, omit as fe } from "es-toolkit/compat";
8
+ import { adjustAutosizeTextareaHeight as pe, cn as u, createSelectAsyncSearch as me, filterListboxEntries as he, flattenListboxOptions as d, mergeBridgeUILayeredClasses as f, normalizeListboxEntries as p, normalizeSelectOptions as ge, resolveMessage as m, resolveSelectAsyncDebounce as _e, resolveSelectAsyncOptions as ve, selectValuesEqual as h, splitComponentProps as ye } from "@bridge-ui/core";
9
+ import { colorProps as be, invalidatedProps as xe } from "@bridge-ui/core/Tokens/Listbox";
10
10
  //#region src/Components/Select/composables/useSelect.ts
11
- var Ce = [
11
+ var Se = [
12
12
  "classes",
13
13
  "loading",
14
14
  "options",
@@ -29,333 +29,333 @@ var Ce = [
29
29
  "minItemsForSearch",
30
30
  "optionDescription"
31
31
  ];
32
- function m(m, h, g, _, we) {
33
- let Te = ce(), v = ue(), y = le(), b = o(!1), x = o(""), S = o(-1), C = o(null), w = o(!1), T = o([]), E = null, D = o([]), O = a(() => ye({
34
- bridgeKeys: Ce,
32
+ function g(g, _, v, y, b) {
33
+ let Ce = ce(), x = ue(), S = e(), C = le(), w = s(!1), T = s(""), E = s(-1), we = s(null), D = s(!1), O = s([]), k = null, A = s([]), Te = a(() => ye({
34
+ bridgeKeys: Se,
35
35
  props: {
36
- ...Te,
37
- ...m
36
+ ...Ce,
37
+ ...g
38
38
  }
39
- })), k = a(() => O.value.componentProps), A = a(() => ({ classes: k.value.classes })), { components: j, entry: Ee } = r({
39
+ })), j = a(() => Te.value.componentProps), Ee = a(() => ({ classes: j.value.classes })), { components: M, entry: De } = ee({
40
40
  componentName: "Select",
41
- props: () => A.value
42
- }), M = ee({
43
- entry: Ee,
44
- props: () => A.value
45
- }), N = a(() => !!k.value.multiple), P = a(() => ({
46
- optionLabel: k.value.optionLabel ?? "label",
47
- optionValue: k.value.optionValue ?? "value",
48
- optionDescription: k.value.optionDescription ?? "description"
49
- })), F = a(() => we.value.length > 0 ? we.value.map((e) => ({
41
+ props: () => Ee.value
42
+ }), N = i({
43
+ entry: De,
44
+ props: () => Ee.value
45
+ }), P = a(() => !!j.value.multiple), F = a(() => ({
46
+ optionLabel: j.value.optionLabel ?? "label",
47
+ optionValue: j.value.optionValue ?? "value",
48
+ optionDescription: j.value.optionDescription ?? "description"
49
+ })), I = a(() => b.value.length > 0 ? b.value.map((e) => ({
50
50
  option: e,
51
51
  type: "option"
52
- })) : f(k.value.options, P.value)), De = a(() => u(F.value)), I = o([]);
53
- function Oe(e) {
52
+ })) : p(j.value.options, F.value)), Oe = a(() => d(I.value)), L = s([]);
53
+ function ke(e) {
54
54
  if (!e || typeof e != "object") return !1;
55
55
  let t = e.type;
56
56
  if (!t || typeof t != "object") return !1;
57
57
  let n = t.name, r = t.__name;
58
58
  return n === "SelectOption" || r === "SelectOption";
59
59
  }
60
- function ke() {
61
- return e(v, "default") ? (v.default?.({}) ?? []).some((e) => {
60
+ function Ae() {
61
+ return t(x, "default") ? (x.default?.({}) ?? []).some((e) => {
62
62
  if (!e || typeof e != "object") return !1;
63
63
  let t = e.type;
64
- return t === re || t === ie || t === void 0 || typeof t == "symbol" ? !1 : !Oe(e);
64
+ return t === ie || t === ae || t === void 0 || typeof t == "symbol" ? !1 : !ke(e);
65
65
  }) : !1;
66
66
  }
67
- let L = a(() => ke() && !k.value.options?.length), R = a(() => {
68
- if (L.value) return [];
69
- if (T.value.length > 0) {
70
- let e = f(T.value, P.value);
71
- return k.value.flipOptions ? [...e].reverse() : e;
67
+ let R = a(() => Ae() && !j.value.options?.length), z = a(() => {
68
+ if (R.value) return [];
69
+ if (O.value.length > 0) {
70
+ let e = p(O.value, F.value);
71
+ return j.value.flipOptions ? [...e].reverse() : e;
72
72
  }
73
- return k.value.flipOptions ? [...F.value].reverse().map((e) => e.type === "section" ? {
73
+ return j.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
74
74
  ...e,
75
75
  options: [...e.options].reverse()
76
- } : e) : F.value;
77
- }), Ae = a(() => L.value ? I.value : u(R.value)), z = a(() => {
78
- let e = h.value;
79
- return N.value ? Array.isArray(e) ? e : [] : !de(e) && e !== "" ? [e] : [];
80
- }), B = a(() => {
76
+ } : e) : I.value;
77
+ }), je = a(() => R.value ? L.value : d(z.value)), B = a(() => {
78
+ let e = _.value;
79
+ return P.value ? Array.isArray(e) ? e : [] : !de(e) && e !== "" ? [e] : [];
80
+ }), V = a(() => {
81
81
  let e = /* @__PURE__ */ new Map();
82
- for (let t of [...Ae.value, ...D.value]) e.set(t.value, t);
83
- return z.value.map((t) => e.get(t) ?? {
82
+ for (let t of [...je.value, ...A.value]) e.set(t.value, t);
83
+ return B.value.map((t) => e.get(t) ?? {
84
84
  value: t,
85
85
  label: String(t)
86
86
  });
87
- }), je = a(() => z.value.length > 0), Me = a(() => k.value.clearable !== !1), V = a(() => !!k.value.asyncData), H = a(() => {
88
- if (V.value || k.value.searchable) return !0;
89
- let e = k.value.minItemsForSearch ?? 11;
90
- return De.value.length >= e;
91
- }), U = a(() => b.value && H.value), Ne = a(() => !!k.value.loading || w.value), Pe = a(() => {
92
- if (L.value) return [];
93
- if (!U.value || !x.value.trim()) return R.value;
94
- let e = x.value.trim().toLowerCase();
95
- return he(R.value, (t) => t.label.toLowerCase().includes(e));
96
- }), W = a(() => L.value ? I.value : u(Pe.value)), G = ne(() => W.value, S, y), Fe = a(() => m.readonly || m.disabled ? !0 : !U.value), Ie = a(() => U.value || N.value ? x.value : B.value[0]?.label ?? ""), Le = (e) => {
97
- C.value = e instanceof HTMLElement ? e : null;
87
+ }), Me = a(() => B.value.length > 0), Ne = a(() => j.value.clearable !== !1), H = a(() => !!j.value.asyncData), U = a(() => {
88
+ if (H.value || j.value.searchable) return !0;
89
+ let e = j.value.minItemsForSearch ?? 11;
90
+ return Oe.value.length >= e;
91
+ }), W = a(() => w.value && U.value), Pe = a(() => !!j.value.loading || D.value), Fe = a(() => {
92
+ if (R.value) return [];
93
+ if (!W.value || !T.value.trim()) return z.value;
94
+ let e = T.value.trim().toLowerCase();
95
+ return he(z.value, (t) => t.label.toLowerCase().includes(e));
96
+ }), G = a(() => R.value ? L.value : d(Fe.value)), K = re(() => G.value, E, C), Ie = a(() => g.readonly || g.disabled ? !0 : !W.value), Le = a(() => W.value || P.value ? T.value : V.value[0]?.label ?? ""), Re = (e) => {
97
+ we.value = e instanceof HTMLElement ? e : null;
98
98
  };
99
- function Re(e) {
99
+ function ze(e) {
100
100
  e.preventDefault();
101
101
  }
102
- function ze(e) {
103
- if (m.disabled || m.readonly) return;
102
+ function Be(e) {
103
+ if (g.disabled || g.readonly) return;
104
104
  let t = e.target;
105
105
  if (!t.closest("[data-select-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
106
- if (!b.value) {
107
- Z();
106
+ if (!w.value) {
107
+ Q();
108
108
  return;
109
109
  }
110
- U.value || (Q(), g.value?.focus({ preventScroll: !0 }));
110
+ W.value || ($(), v.value?.focus({ preventScroll: !0 }));
111
111
  }
112
112
  }
113
- let Be = a(() => {
114
- let n = ye({
113
+ let Ve = a(() => {
114
+ let e = ye({
115
115
  bridgeKeys: te,
116
- props: fe(O.value.inheritedAttrs, ["class"])
117
- }).componentProps, r = n.endIcon ?? (e(v, "end") ? void 0 : be), { listbox: ee, ...i } = n.customProps ?? {};
116
+ props: fe(Te.value.inheritedAttrs, ["class"])
117
+ }).componentProps, r = e.endIcon ?? (t(x, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...i } = e.customProps ?? {};
118
118
  return {
119
- ...n,
119
+ ...e,
120
120
  endIcon: r,
121
- classes: M.value,
121
+ classes: N.value,
122
122
  customProps: {
123
123
  ...i,
124
- container: t(i.container, {}, {
125
- ref: Le,
126
- onClick: ze,
127
- class: l({ "cursor-pointer": !m.disabled && !m.readonly && !U.value })
124
+ container: n(i.container, {}, {
125
+ ref: Re,
126
+ onClick: Be,
127
+ class: u({ "cursor-pointer": !g.disabled && !g.readonly && !W.value })
128
128
  })
129
129
  }
130
130
  };
131
- }), Ve = a(() => m.customProps?.listbox), K = i(() => Be.value, {
131
+ }), He = a(() => g.customProps?.listbox), q = ne(() => Ve.value, {
132
132
  size: "md",
133
133
  rounded: "md",
134
134
  color: "primary",
135
135
  variant: "outline",
136
136
  withErrorIcon: !0
137
137
  }, {
138
- likeInput: () => N.value,
139
- control: () => N.value ? "textarea" : "input"
140
- }), q = (e) => {
141
- !e || !N.value || pe(e);
138
+ likeInput: () => P.value,
139
+ control: () => P.value ? "textarea" : "input"
140
+ }), J = (e) => {
141
+ !e || !P.value || pe(e);
142
142
  };
143
- function J(e) {
144
- return z.value.some((t) => p(t, e));
145
- }
146
143
  function Y(e) {
147
- h.value = e;
144
+ return B.value.some((t) => h(t, e));
148
145
  }
149
146
  function X(e) {
150
- if (N.value) {
147
+ _.value = e;
148
+ }
149
+ function Z(e) {
150
+ if (P.value) {
151
151
  let t = Array.isArray(e) ? e : [];
152
- _("update:modelValue", t), _("change", t);
152
+ y("update:modelValue", t), y("change", t);
153
153
  return;
154
154
  }
155
155
  let t = e ?? "";
156
- _("update:modelValue", t), _("change", t);
157
- }
158
- function Z() {
159
- m.disabled || m.readonly || b.value || (b.value = !0, x.value = "", G.highlightCurrentSelection(J), _("open"), V.value && k.value.asyncData && E?.searchImmediate(""));
156
+ y("update:modelValue", t), y("change", t);
160
157
  }
161
158
  function Q() {
162
- E?.cancel(), b.value && (b.value = !1, x.value = "", S.value = -1, _("close"));
159
+ g.disabled || g.readonly || w.value || (w.value = !0, T.value = "", K.highlightCurrentSelection(Y), y("open"), H.value && j.value.asyncData && k?.searchImmediate(""));
163
160
  }
164
- function $(e) {
161
+ function $() {
162
+ k?.cancel(), w.value && (w.value = !1, T.value = "", E.value = -1, y("close"));
163
+ }
164
+ function Ue(e) {
165
165
  if (!e.disabled) {
166
- if (N.value) {
167
- let t = [...z.value], n = t.findIndex((t) => p(t, e.value));
168
- n >= 0 ? (t.splice(n, 1), _("deselect", e)) : (t.push(e.value), _("select", e)), Y(t), X(t), x.value = "", S.value = -1, ae(() => {
169
- q(g.value), g.value?.focus({ preventScroll: !0 });
166
+ if (P.value) {
167
+ let t = [...B.value], n = t.findIndex((t) => h(t, e.value));
168
+ n >= 0 ? (t.splice(n, 1), y("deselect", e)) : (t.push(e.value), y("select", e)), X(t), Z(t), T.value = "", E.value = -1, o(() => {
169
+ J(v.value), v.value?.focus({ preventScroll: !0 });
170
170
  });
171
171
  return;
172
172
  }
173
- Y(e.value), X(e.value), _("select", e), Q();
173
+ X(e.value), Z(e.value), y("select", e), $();
174
174
  }
175
175
  }
176
- function He(e) {
177
- e?.preventDefault(), e?.stopPropagation(), N.value ? (Y([]), X([])) : (Y(null), X(null)), _("clear"), Q();
176
+ function We(e) {
177
+ e?.preventDefault(), e?.stopPropagation(), P.value ? (X([]), Z([])) : (X(null), Z(null)), y("clear"), $();
178
178
  }
179
- function Ue(e, t) {
180
- if (t.preventDefault(), t.stopPropagation(), !N.value) return;
181
- let n = z.value.filter((t) => !p(t, e.value));
182
- Y(n), X(n), _("deselect", e), ae(() => q(g.value));
179
+ function Ge(e, t) {
180
+ if (t.preventDefault(), t.stopPropagation(), !P.value) return;
181
+ let n = B.value.filter((t) => !h(t, e.value));
182
+ X(n), Z(n), y("deselect", e), o(() => J(v.value));
183
183
  }
184
- function We() {
185
- let e = G.getHighlightedOption();
186
- e && $(e);
184
+ function Ke() {
185
+ let e = K.getHighlightedOption();
186
+ e && Ue(e);
187
187
  }
188
- function Ge(e) {
189
- x.value = e.target.value, _("search", x.value), b.value || Z(), G.resetHighlight(), V.value && E?.searchDebounced(x.value);
188
+ function qe(e) {
189
+ T.value = e.target.value, y("search", T.value), w.value || Q(), K.resetHighlight(), H.value && k?.searchDebounced(T.value);
190
190
  }
191
- function Ke(e) {
192
- if (!(m.disabled || m.readonly)) switch (e.key) {
191
+ function Je(e) {
192
+ if (!(g.disabled || g.readonly)) switch (e.key) {
193
193
  case "ArrowDown":
194
- e.preventDefault(), b.value ? G.moveHighlight(1) : Z();
194
+ e.preventDefault(), w.value ? K.moveHighlight(1) : Q();
195
195
  break;
196
196
  case "ArrowUp":
197
- e.preventDefault(), b.value ? G.moveHighlight(-1) : Z();
197
+ e.preventDefault(), w.value ? K.moveHighlight(-1) : Q();
198
198
  break;
199
199
  case "Enter":
200
- e.preventDefault(), b.value ? We() : Z();
200
+ e.preventDefault(), w.value ? Ke() : Q();
201
201
  break;
202
202
  case "Escape":
203
- e.preventDefault(), Q();
203
+ e.preventDefault(), $();
204
204
  break;
205
205
  case "Home":
206
- b.value && (e.preventDefault(), G.highlightFirst());
206
+ w.value && (e.preventDefault(), K.highlightFirst());
207
207
  break;
208
208
  case "End":
209
- b.value && (e.preventDefault(), G.highlightLast());
209
+ w.value && (e.preventDefault(), K.highlightLast());
210
210
  break;
211
211
  case "Backspace":
212
- if (N.value && !x.value && B.value.length > 0) {
212
+ if (P.value && !T.value && V.value.length > 0) {
213
213
  e.preventDefault();
214
- let t = B.value.at(-1);
215
- t && Ue(t, e);
214
+ let t = V.value.at(-1);
215
+ t && Ge(t, e);
216
216
  }
217
217
  break;
218
218
  case "Tab":
219
- Q();
219
+ $();
220
220
  break;
221
221
  default: break;
222
222
  }
223
223
  }
224
- async function qe(e) {
225
- let t = k.value.asyncData;
224
+ async function Ye(e) {
225
+ let t = j.value.asyncData;
226
226
  if (t) {
227
- w.value = !0;
227
+ D.value = !0;
228
228
  try {
229
- let { options: n, resolvedSelected: r } = await ve(t, e, z.value, (e) => ge(e, P.value));
230
- r.length > 0 && (D.value = r), T.value = n;
229
+ let { options: n, resolvedSelected: r } = await ve(t, e, B.value, (e) => ge(e, F.value));
230
+ r.length > 0 && (A.value = r), O.value = n;
231
231
  } finally {
232
- w.value = !1;
232
+ D.value = !1;
233
233
  }
234
234
  }
235
235
  }
236
- async function Je() {
237
- let e = k.value.asyncData;
238
- !e?.resolve || z.value.length === 0 || (D.value = ge(await e.resolve(z.value), P.value));
236
+ async function Xe() {
237
+ let e = j.value.asyncData;
238
+ !e?.resolve || B.value.length === 0 || (A.value = ge(await e.resolve(B.value), F.value));
239
239
  }
240
- let Ye = a(() => {
241
- let e = c(d(xe, c(j.value, [
240
+ let Ze = a(() => {
241
+ let e = l(f(be, l(M.value, [
242
242
  "Listbox",
243
243
  "tokens",
244
244
  "color"
245
- ])), K.merged.value.color ?? "primary");
246
- return K.invalidated.value ? d(Se, c(j.value, [
245
+ ])), q.merged.value.color ?? "primary");
246
+ return q.invalidated.value ? f(xe, l(M.value, [
247
247
  "Listbox",
248
248
  "tokens",
249
249
  "invalidated"
250
250
  ])) : e;
251
- }), Xe = a(() => Ye.value?.value), Ze = a(() => {
252
- let e = !m.disabled && !m.readonly && !U.value, n = !m.disabled && !m.readonly && U.value && H.value, r = je.value && !N.value && !U.value;
253
- return t({
251
+ }), Qe = a(() => Ze.value?.value), $e = a(() => {
252
+ let e = !g.disabled && !g.readonly && !W.value, t = !g.disabled && !g.readonly && W.value && U.value, r = Me.value && !P.value && !W.value;
253
+ return n({
254
254
  role: "combobox",
255
- value: Ie.value,
256
- "aria-controls": y,
257
- "aria-expanded": b.value,
258
- readonly: Fe.value,
259
- onKeydown: Ke,
260
- placeholder: k.value.placeholder,
261
- "aria-autocomplete": H.value ? "list" : void 0,
262
- "aria-activedescendant": b.value ? G.activeDescendantId.value : void 0,
263
- ...N.value ? {
255
+ value: Le.value,
256
+ "aria-controls": C,
257
+ "aria-expanded": w.value,
258
+ readonly: Ie.value,
259
+ onKeydown: Je,
260
+ placeholder: j.value.placeholder,
261
+ "aria-autocomplete": U.value ? "list" : void 0,
262
+ "aria-activedescendant": w.value ? K.activeDescendantId.value : void 0,
263
+ ...P.value ? {
264
264
  rows: 1,
265
265
  onInput: (e) => {
266
- Ge(e), q(e.target);
266
+ qe(e), J(e.target);
267
267
  }
268
- } : { onInput: Ge }
269
- }, K.inputBind.value, l({
270
- "cursor-text": n,
268
+ } : { onInput: qe }
269
+ }, q.inputBind.value, u({
270
+ "cursor-text": t,
271
271
  "cursor-pointer": e,
272
- "resize-none overflow-hidden": N.value,
273
- [l(Xe.value, M.value.value) ?? ""]: r
272
+ "resize-none overflow-hidden": P.value,
273
+ [u(Qe.value, N.value.value) ?? ""]: r
274
274
  }));
275
275
  });
276
- s(() => [
277
- b.value,
278
- N.value,
279
- g.value
276
+ c(() => [
277
+ w.value,
278
+ P.value,
279
+ v.value
280
280
  ], () => {
281
- q(g.value);
282
- }, { immediate: !0 }), s(() => h.value, () => {
283
- Je();
284
- }, { immediate: !0 }), s(() => k.value.asyncData, (e) => {
285
- if (E?.cancel(), T.value = [], Je(), !e) {
286
- E = null;
281
+ J(v.value);
282
+ }, { immediate: !0 }), c(() => _.value, () => {
283
+ Xe();
284
+ }, { immediate: !0 }), c(() => j.value.asyncData, (e) => {
285
+ if (k?.cancel(), O.value = [], Xe(), !e) {
286
+ k = null;
287
287
  return;
288
288
  }
289
- E = me((e) => void qe(e), _e(e));
289
+ k = me((e) => void Ye(e), _e(e));
290
290
  }, { immediate: !0 }), oe(() => {
291
- E?.cancel();
291
+ k?.cancel();
292
292
  }), se(() => {
293
- q(g.value);
293
+ J(v.value);
294
294
  });
295
- let Qe = a(() => n(K.merged.value.size)), $e = a(() => t({}, {}, {
295
+ let et = a(() => r(q.merged.value.size)), tt = a(() => n({}, {}, {
296
296
  tabindex: 0,
297
297
  role: "button",
298
298
  "data-select-clear": !0,
299
- onMousedown: Re,
300
- class: l({
299
+ onMousedown: ze,
300
+ class: u({
301
301
  "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
302
- [Ye.value?.clear ?? ""]: !0,
303
- [M.value.clear ?? ""]: !0
302
+ [Ze.value?.clear ?? ""]: !0,
303
+ [N.value.clear ?? ""]: !0
304
304
  })
305
- })), et = a(() => ({
306
- listboxId: y,
307
- isSelected: J,
305
+ })), nt = a(() => ({
306
+ listboxId: C,
307
+ isSelected: Y,
308
308
  disableAutoFocus: !0,
309
- loading: Ne.value,
310
- multiple: N.value,
311
- maxHeight: m.maxHeight,
312
- entries: Pe.value,
313
- options: W.value,
314
- size: K.merged.value.size,
315
- color: K.merged.value.color,
316
- labelledBy: K.controlId.value,
317
- rounded: K.merged.value.rounded,
318
- invalidated: K.invalidated.value,
319
- highlightedIndex: S.value,
320
- disableMaxHeight: m.disableMaxHeight === !0,
321
- emptyMessage: k.value.emptyMessage ?? "No options",
322
- hideEmptyMessage: k.value.hideEmptyMessage === !0,
323
- loadingMessage: k.value.loadingMessage ?? "Loading...",
324
- ...Ve.value
309
+ loading: Pe.value,
310
+ multiple: P.value,
311
+ maxHeight: g.maxHeight,
312
+ entries: Fe.value,
313
+ options: G.value,
314
+ size: q.merged.value.size,
315
+ color: q.merged.value.color,
316
+ labelledBy: q.controlId.value,
317
+ rounded: q.merged.value.rounded,
318
+ invalidated: q.invalidated.value,
319
+ highlightedIndex: E.value,
320
+ disableMaxHeight: g.disableMaxHeight === !0,
321
+ hideEmptyMessage: j.value.hideEmptyMessage === !0,
322
+ emptyMessage: j.value.emptyMessage ?? m("No options", S.value),
323
+ loadingMessage: j.value.loadingMessage ?? m("Loading...", S.value),
324
+ ...He.value
325
325
  }));
326
- function tt(e) {
327
- let t = I.value;
328
- t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (I.value = e);
326
+ function rt(e) {
327
+ let t = L.value;
328
+ t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (L.value = e);
329
329
  }
330
330
  return {
331
- open: b,
332
- slots: v,
333
- hasValue: je,
334
- multiple: N,
335
- listboxId: y,
336
- formField: K,
337
- isLoading: Ne,
338
- clearable: Me,
339
- clearBind: $e,
340
- isSelected: J,
341
- clearValue: He,
342
- removeChip: Ue,
343
- triggerBind: Ze,
344
- selectOption: $,
345
- containerRef: C,
346
- listboxProps: et,
347
- clearIconSize: Qe,
348
- mergedClasses: M,
349
- visibleOptions: W,
350
- isSearchActive: U,
351
- selectedOptions: B,
352
- hasComposedList: L,
353
- highlightedIndex: S,
354
- handleRegisteredOptionsChange: tt,
355
- emptyMessage: a(() => k.value.emptyMessage ?? "No options"),
356
- hideEmptyMessage: a(() => k.value.hideEmptyMessage === !0),
357
- loadingMessage: a(() => k.value.loadingMessage ?? "Loading...")
331
+ open: w,
332
+ slots: x,
333
+ hasValue: Me,
334
+ multiple: P,
335
+ listboxId: C,
336
+ formField: q,
337
+ isLoading: Pe,
338
+ clearable: Ne,
339
+ clearBind: tt,
340
+ isSelected: Y,
341
+ clearValue: We,
342
+ removeChip: Ge,
343
+ triggerBind: $e,
344
+ selectOption: Ue,
345
+ containerRef: we,
346
+ listboxProps: nt,
347
+ clearIconSize: et,
348
+ mergedClasses: N,
349
+ visibleOptions: G,
350
+ isSearchActive: W,
351
+ selectedOptions: V,
352
+ hasComposedList: R,
353
+ highlightedIndex: E,
354
+ handleRegisteredOptionsChange: rt,
355
+ hideEmptyMessage: a(() => j.value.hideEmptyMessage === !0),
356
+ emptyMessage: a(() => j.value.emptyMessage ?? m("No options", S.value)),
357
+ loadingMessage: a(() => j.value.loadingMessage ?? m("Loading...", S.value))
358
358
  };
359
359
  }
360
360
  //#endregion
361
- export { m as useSelect };
361
+ export { g as useSelect };