@bridge-ui/vue 0.19.0 → 0.20.0

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 (45) hide show
  1. package/dist/Components/Autocomplete/composables/useAutocomplete.js +257 -265
  2. package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -1
  3. package/dist/Components/Calendar/composables/useCalendar.js +192 -187
  4. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  5. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +1 -1
  6. package/dist/Components/CalendarRange/composables/useCalendarRange.js +243 -238
  7. package/dist/Components/ChartBar/composables/useChartBar.js +4 -4
  8. package/dist/Components/ChartFunnel/composables/useChartFunnel.js +10 -10
  9. package/dist/Components/ChartLine/composables/useChartLine.js +1 -1
  10. package/dist/Components/ChartPie/composables/useChartPie.js +10 -10
  11. package/dist/Components/ChartScatter/composables/useChartScatter.js +21 -21
  12. package/dist/Components/DataTable/DataTableColumnsMenu.vue.d.ts +1 -2
  13. package/dist/Components/DataTable/composables/useDataTable.d.ts +8 -66
  14. package/dist/Components/DataTable/composables/useDataTable.js +267 -349
  15. package/dist/Components/DataTable/composables/useDataTableColumnsMenu.d.ts +1 -2
  16. package/dist/Components/ListItem/composables/useListItem.js +29 -30
  17. package/dist/Components/Listbox/composables/useListboxNavigation.d.ts +0 -5
  18. package/dist/Components/Listbox/composables/useListboxNavigation.js +23 -50
  19. package/dist/Components/Listbox/index.d.ts +1 -1
  20. package/dist/Components/Listbox/index.js +5 -5
  21. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
  22. package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +31 -31
  23. package/dist/Components/Select/composables/useSelect.js +201 -211
  24. package/dist/Components/Slider/composables/useSlider.js +93 -122
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +175 -175
  27. package/package.json +2 -2
  28. package/dist/Components/RichTextEditor/tiptapEditor.d.ts +0 -111
  29. package/dist/Components/RichTextEditor/tiptapEditor.js +0 -121
  30. package/dist/Utils/Charts/echarts/bar.d.ts +0 -6
  31. package/dist/Utils/Charts/echarts/bar.js +0 -23
  32. package/dist/Utils/Charts/echarts/cartesian.d.ts +0 -15
  33. package/dist/Utils/Charts/echarts/cartesian.js +0 -290
  34. package/dist/Utils/Charts/echarts/funnel.d.ts +0 -15
  35. package/dist/Utils/Charts/echarts/funnel.js +0 -79
  36. package/dist/Utils/Charts/echarts/line.d.ts +0 -5
  37. package/dist/Utils/Charts/echarts/line.js +0 -20
  38. package/dist/Utils/Charts/echarts/part.d.ts +0 -19
  39. package/dist/Utils/Charts/echarts/part.js +0 -45
  40. package/dist/Utils/Charts/echarts/pie.d.ts +0 -14
  41. package/dist/Utils/Charts/echarts/pie.js +0 -76
  42. package/dist/Utils/Charts/echarts/plot.d.ts +0 -44
  43. package/dist/Utils/Charts/echarts/plot.js +0 -52
  44. package/dist/Utils/Charts/echarts/scatter.d.ts +0 -14
  45. package/dist/Utils/Charts/echarts/scatter.js +0 -161
@@ -1,17 +1,17 @@
1
1
  import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
2
  import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
3
3
  import { useBreakpoint as n } from "../../../Utils/useBreakpoint.js";
4
- import { mergePartBind as r, resolveFieldAdornmentIconSize as ee, useBridgeUIComponent as te, useBridgeUIMergedRegistryClasses as i, useFieldShowFooter as ne } from "../../../Utils/index.js";
5
- import { formFieldBridgeKeys as re, useFormField as ie } from "../../FormField/composables/useFormField.js";
6
- import { collectComposedListboxOptions as ae } from "../../Listbox/collectComposedListboxOptions.js";
7
- import { useListboxNavigation as oe } from "../../Listbox/composables/useListboxNavigation.js";
8
- import { Comment as se, Text as ce, computed as a, nextTick as o, onBeforeUnmount as le, onMounted as ue, ref as s, useAttrs as de, useId as fe, useSlots as pe, watch as c } from "vue";
9
- import { get as me, isNil as he, isObjectLike as l, isSymbol as ge, omit as _e } from "es-toolkit/compat";
10
- import { createSelectAsyncSearch as ve, filterListboxEntries as ye, flattenListboxOptions as u, mergeListboxOptionsByValue as be, normalizeListboxEntries as xe, normalizeSelectOptions as Se, resolveFieldOverlay as Ce, resolveSelectAsyncDebounce as we, resolveSelectAsyncOptions as Te, selectValuesEqual as d } from "@bridge-ui/core/Domain";
11
- import { listboxColorProps as Ee } from "@bridge-ui/core/Tokens";
12
- import { adjustAutosizeTextareaHeight as De, cn as f, getColorToken as Oe, mergeBridgeUILayeredClasses as ke, splitComponentProps as Ae } from "@bridge-ui/core/Utils";
4
+ import { mergePartBind as r, resolveFieldAdornmentIconSize as i, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as a, useFieldShowFooter as te } from "../../../Utils/index.js";
5
+ import { formFieldBridgeKeys as ne, useFormField as re } from "../../FormField/composables/useFormField.js";
6
+ import { collectComposedListboxOptions as ie } from "../../Listbox/collectComposedListboxOptions.js";
7
+ import { useListboxNavigation as ae } from "../../Listbox/composables/useListboxNavigation.js";
8
+ import { Comment as oe, Text as se, computed as o, nextTick as s, onBeforeUnmount as ce, onMounted as le, ref as c, useAttrs as ue, useId as de, useSlots as fe, watch as l } from "vue";
9
+ import { get as pe, isNil as me, isObjectLike as u, isSymbol as he, omit as ge } from "es-toolkit/compat";
10
+ import { createSelectAsyncSearch as _e, filterListboxEntries as ve, flattenListboxOptions as d, handleSelectTriggerKeyDown as ye, mergeListboxOptionsByValue as be, normalizeListboxEntries as f, normalizeSelectOptions as xe, resolveFieldOverlay as Se, resolveSelectAsyncDebounce as Ce, resolveSelectAsyncOptions as we, selectValuesEqual as p } from "@bridge-ui/core/Domain";
11
+ import { listboxColorProps as Te } from "@bridge-ui/core/Tokens";
12
+ import { adjustAutosizeTextareaHeight as Ee, cn as m, getColorToken as De, mergeBridgeUILayeredClasses as Oe, splitComponentProps as ke } from "@bridge-ui/core/Utils";
13
13
  //#region src/Components/Select/composables/useSelect.ts
14
- var je = [
14
+ var Ae = [
15
15
  "classes",
16
16
  "loading",
17
17
  "options",
@@ -34,112 +34,112 @@ var je = [
34
34
  "minItemsForSearch",
35
35
  "optionDescription"
36
36
  ];
37
- function p(p, m, h, g, Me) {
38
- let Ne = de(), _ = pe(), v = fe(), Pe = n(), y = e(), b = s(!1), x = s(""), S = s(!1), C = s(-1), w = s([]), T = s([]), E = s([]), D = s(null), O = null, k = a(() => Ae({
39
- bridgeKeys: je,
37
+ function h(h, g, _, v, je) {
38
+ let Me = ue(), y = fe(), b = de(), Ne = n(), x = e(), S = c(!1), C = c(""), w = c(!1), T = c(-1), E = c([]), D = c([]), O = c([]), k = c(null), A = null, j = o(() => ke({
39
+ bridgeKeys: Ae,
40
40
  props: {
41
- ...Ne,
42
- ...p
41
+ ...Me,
42
+ ...h
43
43
  }
44
- })), A = a(() => k.value.componentProps), j = a(() => ({ classes: A.value.classes })), { components: Fe, entry: Ie } = te({
44
+ })), M = o(() => j.value.componentProps), Pe = o(() => ({ classes: M.value.classes })), { components: Fe, entry: Ie } = ee({
45
45
  chrome: "FormField",
46
46
  componentName: "Select",
47
- props: () => j.value
48
- }), M = i({
47
+ props: () => Pe.value
48
+ }), N = a({
49
49
  entry: Ie,
50
- props: () => j.value
51
- }), N = a(() => !!A.value.multiple), P = a(() => ({
52
- optionLabel: A.value.optionLabel ?? "label",
53
- optionValue: A.value.optionValue ?? "value",
54
- optionDescription: A.value.optionDescription ?? "description"
55
- })), F = a(() => Me.value.length > 0 ? Me.value.map((e) => ({
50
+ props: () => Pe.value
51
+ }), P = o(() => !!M.value.multiple), F = o(() => ({
52
+ optionLabel: M.value.optionLabel ?? "label",
53
+ optionValue: M.value.optionValue ?? "value",
54
+ optionDescription: M.value.optionDescription ?? "description"
55
+ })), I = o(() => je.value.length > 0 ? je.value.map((e) => ({
56
56
  option: e,
57
57
  type: "option"
58
- })) : xe(A.value.options, P.value)), Le = a(() => u(F.value)), I = s([]);
58
+ })) : f(M.value.options, F.value)), Le = o(() => d(I.value)), L = c([]);
59
59
  function Re(e) {
60
- if (!l(e)) return !1;
60
+ if (!u(e)) return !1;
61
61
  let t = e.type;
62
- if (!l(t)) return !1;
62
+ if (!u(t)) return !1;
63
63
  let n = t.name, r = t.__name;
64
64
  return n === "SelectOption" || r === "SelectOption";
65
65
  }
66
66
  function ze() {
67
- return t(_, "default") ? (_.default?.({}) ?? []).some((e) => {
68
- if (!l(e)) return !1;
67
+ return t(y, "default") ? (y.default?.({}) ?? []).some((e) => {
68
+ if (!u(e)) return !1;
69
69
  let t = e.type;
70
- return t === se || t === ce || t === void 0 || ge(t) ? !1 : !Re(e);
70
+ return t === oe || t === se || t === void 0 || he(t) ? !1 : !Re(e);
71
71
  }) : !1;
72
72
  }
73
- let L = a(() => ze()), Be = a(() => L.value ? ae(_.default?.({}) ?? []) : []), R = a(() => {
74
- if (L.value) return [];
75
- if (T.value.length > 0) {
76
- let e = xe(T.value, P.value);
77
- return A.value.flipOptions ? [...e].reverse() : e;
73
+ let R = o(() => ze()), Be = o(() => R.value ? ie(y.default?.({}) ?? []) : []), z = o(() => {
74
+ if (R.value) return [];
75
+ if (D.value.length > 0) {
76
+ let e = f(D.value, F.value);
77
+ return M.value.flipOptions ? [...e].reverse() : e;
78
78
  }
79
- return A.value.flipOptions ? [...F.value].reverse().map((e) => e.type === "section" ? {
79
+ return M.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
80
80
  ...e,
81
81
  options: [...e.options].reverse()
82
- } : e) : F.value;
83
- }), Ve = a(() => L.value ? be(I.value, Be.value) : u(R.value)), z = a(() => {
84
- let e = m.value;
85
- return N.value ? Array.isArray(e) ? e : [] : !he(e) && e !== "" ? [e] : [];
86
- }), He = a(() => Ce(A.value.overlay, Pe.mobile)), B = ne({
82
+ } : e) : I.value;
83
+ }), Ve = o(() => R.value ? be(L.value, Be.value) : d(z.value)), B = o(() => {
84
+ let e = g.value;
85
+ return P.value ? Array.isArray(e) ? e : [] : !me(e) && e !== "" ? [e] : [];
86
+ }), He = o(() => Se(M.value.overlay, Ne.mobile)), V = te({
87
87
  chrome: "FormField",
88
88
  componentName: "Select",
89
89
  overlay: He,
90
- showFooter: () => A.value.showFooter
91
- }), Ue = a(() => B.value ? w.value : z.value), V = a(() => {
90
+ showFooter: () => M.value.showFooter
91
+ }), Ue = o(() => V.value ? E.value : B.value), H = o(() => {
92
92
  let e = /* @__PURE__ */ new Map();
93
- for (let t of [...Ve.value, ...E.value]) e.set(t.value, t);
94
- return z.value.map((t) => e.get(t) ?? {
93
+ for (let t of [...Ve.value, ...O.value]) e.set(t.value, t);
94
+ return B.value.map((t) => e.get(t) ?? {
95
95
  value: t,
96
96
  label: String(t)
97
97
  });
98
- }), H = a(() => z.value.length > 0), We = a(() => A.value.clearable === !0), U = a(() => !!A.value.asyncData), W = a(() => {
99
- if (U.value || A.value.searchable) return !0;
100
- let e = A.value.minItemsForSearch ?? 11;
98
+ }), U = o(() => B.value.length > 0), We = o(() => M.value.clearable === !0), W = o(() => !!M.value.asyncData), G = o(() => {
99
+ if (W.value || M.value.searchable) return !0;
100
+ let e = M.value.minItemsForSearch ?? 11;
101
101
  return Le.value.length >= e;
102
- }), G = a(() => b.value && W.value), Ge = a(() => !!A.value.loading || S.value), Ke = a(() => {
103
- if (L.value) return [];
104
- if (!G.value || !x.value.trim()) return R.value;
105
- let e = x.value.trim().toLowerCase();
106
- return ye(R.value, (t) => t.label.toLowerCase().includes(e));
107
- }), K = a(() => L.value ? I.value : u(Ke.value)), q = oe(() => K.value, C, v), qe = a(() => p.readonly || p.disabled ? !0 : !G.value), Je = a(() => G.value || N.value ? x.value : V.value[0]?.label ?? ""), Ye = (e) => {
108
- D.value = e instanceof HTMLElement ? e : null;
102
+ }), K = o(() => S.value && G.value), Ge = o(() => !!M.value.loading || w.value), Ke = o(() => {
103
+ if (R.value) return [];
104
+ if (!K.value || !C.value.trim()) return z.value;
105
+ let e = C.value.trim().toLowerCase();
106
+ return ve(z.value, (t) => t.label.toLowerCase().includes(e));
107
+ }), q = o(() => R.value ? L.value : d(Ke.value)), J = ae(() => q.value, T, b), qe = o(() => h.readonly || h.disabled ? !0 : !K.value), Je = o(() => K.value || P.value ? C.value : H.value[0]?.label ?? ""), Ye = (e) => {
108
+ k.value = e instanceof HTMLElement ? e : null;
109
109
  };
110
110
  function Xe(e) {
111
111
  e.preventDefault();
112
112
  }
113
113
  function Ze(e) {
114
- if (p.disabled || p.readonly) return;
114
+ if (h.disabled || h.readonly) return;
115
115
  let t = e.target;
116
116
  if (!t.closest("[data-select-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
117
- if (!b.value) {
118
- Z();
117
+ if (!S.value) {
118
+ Q();
119
119
  return;
120
120
  }
121
- G.value || (Q(), h.value?.focus({ preventScroll: !0 }));
121
+ K.value || ($(), _.value?.focus({ preventScroll: !0 }));
122
122
  }
123
123
  }
124
- let Qe = a(() => {
125
- let e = _e(k.value.inheritedAttrs, ["class"]), n = Ae({
126
- bridgeKeys: re,
124
+ let Qe = o(() => {
125
+ let e = ge(j.value.inheritedAttrs, ["class"]), n = ke({
126
+ bridgeKeys: ne,
127
127
  props: e
128
- }).componentProps, ee = n.endIcon ?? (t(_, "end") ? void 0 : "chevronUpDown"), { listbox: te, ...i } = n.customProps ?? {};
128
+ }).componentProps, i = n.endIcon ?? (t(y, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...a } = n.customProps ?? {};
129
129
  return {
130
130
  ...n,
131
- endIcon: ee,
132
- classes: M.value,
131
+ endIcon: i,
132
+ classes: N.value,
133
133
  customProps: {
134
- ...i,
135
- container: r(i.container, {}, {
134
+ ...a,
135
+ container: r(a.container, {}, {
136
136
  ref: Ye,
137
137
  onClick: Ze,
138
- class: f({ "cursor-pointer": !p.disabled && !p.readonly && !G.value })
138
+ class: m({ "cursor-pointer": !h.disabled && !h.readonly && !K.value })
139
139
  })
140
140
  }
141
141
  };
142
- }), $e = a(() => p.customProps?.listbox), J = ie(() => Qe.value, {
142
+ }), $e = o(() => h.customProps?.listbox), Y = re(() => Qe.value, {
143
143
  size: "md",
144
144
  rounded: "md",
145
145
  color: "primary",
@@ -147,247 +147,237 @@ function p(p, m, h, g, Me) {
147
147
  showErrorIcon: !0
148
148
  }, {
149
149
  componentName: "Select",
150
- likeInput: () => N.value,
151
- control: () => N.value ? "textarea" : "input"
152
- }), et = a(() => H.value && We.value && !p.readonly && !J.isDisabled.value), Y = (e) => {
153
- e && N.value && De(e);
150
+ likeInput: () => P.value,
151
+ control: () => P.value ? "textarea" : "input"
152
+ }), et = o(() => U.value && We.value && !h.readonly && !Y.isDisabled.value), X = (e) => {
153
+ e && P.value && Ee(e);
154
154
  };
155
155
  function tt(e) {
156
- return Ue.value.some((t) => d(t, e));
156
+ return Ue.value.some((t) => p(t, e));
157
157
  }
158
- function X(e) {
159
- if (N.value) {
158
+ function Z(e) {
159
+ if (P.value) {
160
160
  let t = Array.isArray(e) ? e : [];
161
- m.value = t, g("change", t);
161
+ g.value = t, v("change", t);
162
162
  return;
163
163
  }
164
164
  let t = e ?? "";
165
- m.value = t, g("change", t);
166
- }
167
- function Z() {
168
- p.disabled || p.readonly || b.value || (w.value = [...z.value], b.value = !0, x.value = "", q.highlightCurrentSelection((e) => z.value.some((t) => d(t, e))), g("open"), U.value && A.value.asyncData && O?.searchImmediate(""));
165
+ g.value = t, v("change", t);
169
166
  }
170
167
  function Q() {
171
- O?.cancel(), b.value && (b.value = !1, x.value = "", C.value = -1, g("close"));
168
+ h.disabled || h.readonly || S.value || (E.value = [...B.value], S.value = !0, C.value = "", J.highlightCurrentSelection((e) => B.value.some((t) => p(t, e))), v("open"), W.value && M.value.asyncData && A?.searchImmediate(""));
169
+ }
170
+ function $() {
171
+ A?.cancel(), S.value && (S.value = !1, C.value = "", T.value = -1, v("close"));
172
172
  }
173
173
  function nt(e) {
174
174
  if (!e.disabled) {
175
- if (B.value) {
176
- if (N.value) {
177
- let t = [...w.value], n = t.findIndex((t) => d(t, e.value));
178
- n >= 0 ? (t.splice(n, 1), g("deselect", e)) : (t.push(e.value), g("select", e)), w.value = t, x.value = "", C.value = -1, o(() => {
179
- h.value?.focus({ preventScroll: !0 });
175
+ if (V.value) {
176
+ if (P.value) {
177
+ let t = [...E.value], n = t.findIndex((t) => p(t, e.value));
178
+ n >= 0 ? (t.splice(n, 1), v("deselect", e)) : (t.push(e.value), v("select", e)), E.value = t, C.value = "", T.value = -1, s(() => {
179
+ _.value?.focus({ preventScroll: !0 });
180
180
  });
181
181
  return;
182
182
  }
183
- w.value = [e.value], g("select", e), x.value = "", C.value = -1;
183
+ E.value = [e.value], v("select", e), C.value = "", T.value = -1;
184
184
  return;
185
185
  }
186
- if (N.value) {
187
- let t = [...z.value], n = t.findIndex((t) => d(t, e.value));
188
- n >= 0 ? (t.splice(n, 1), g("deselect", e)) : (t.push(e.value), g("select", e)), X(t), x.value = "", C.value = -1, o(() => {
189
- Y(h.value), h.value?.focus({ preventScroll: !0 });
186
+ if (P.value) {
187
+ let t = [...B.value], n = t.findIndex((t) => p(t, e.value));
188
+ n >= 0 ? (t.splice(n, 1), v("deselect", e)) : (t.push(e.value), v("select", e)), Z(t), C.value = "", T.value = -1, s(() => {
189
+ X(_.value), _.value?.focus({ preventScroll: !0 });
190
190
  });
191
191
  return;
192
192
  }
193
- X(e.value), g("select", e), Q();
193
+ Z(e.value), v("select", e), $();
194
194
  }
195
195
  }
196
196
  function rt() {
197
- N.value ? X(w.value) : X(w.value[0] ?? null), Q(), g("apply");
197
+ P.value ? Z(E.value) : Z(E.value[0] ?? null), $(), v("apply");
198
198
  }
199
199
  function it() {
200
- w.value = [...z.value], Q(), g("cancel");
200
+ E.value = [...B.value], $(), v("cancel");
201
201
  }
202
202
  function at(e) {
203
- e?.preventDefault(), e?.stopPropagation(), !(p.disabled || p.readonly) && (N.value ? X([]) : X(null), g("clear"), Q());
203
+ e?.preventDefault(), e?.stopPropagation(), !(h.disabled || h.readonly) && (P.value ? Z([]) : Z(null), v("clear"), $());
204
204
  }
205
205
  function ot(e, t) {
206
- t.preventDefault(), t.stopPropagation(), N.value && (X(z.value.filter((t) => !d(t, e.value))), g("deselect", e), o(() => Y(h.value)));
206
+ t.preventDefault(), t.stopPropagation(), P.value && (Z(B.value.filter((t) => !p(t, e.value))), v("deselect", e), s(() => X(_.value)));
207
207
  }
208
208
  function st() {
209
- let e = q.getHighlightedOption();
209
+ let e = J.getHighlightedOption();
210
210
  e && nt(e);
211
211
  }
212
212
  function ct(e) {
213
213
  let t = e.target;
214
- x.value = t.value, g("search", x.value), b.value || Z(), q.resetHighlight(), U.value && O?.searchDebounced(x.value);
214
+ C.value = t.value, v("search", C.value), S.value || Q(), J.resetHighlight(), W.value && A?.searchDebounced(C.value);
215
215
  }
216
216
  function lt(e) {
217
- if (!(p.disabled || p.readonly)) switch (e.key) {
218
- case "ArrowDown":
219
- e.preventDefault(), b.value ? q.moveHighlight(1) : Z();
220
- break;
221
- case "ArrowUp":
222
- e.preventDefault(), b.value ? q.moveHighlight(-1) : Z();
223
- break;
224
- case "Enter":
225
- e.preventDefault(), b.value ? st() : Z();
226
- break;
227
- case "Escape":
228
- e.preventDefault(), Q();
229
- break;
230
- case "Home":
231
- b.value && (e.preventDefault(), q.highlightFirst());
232
- break;
233
- case "End":
234
- b.value && (e.preventDefault(), q.highlightLast());
235
- break;
236
- case "Backspace":
237
- if (N.value && !x.value && V.value.length > 0) {
238
- e.preventDefault();
239
- let t = V.value.at(-1);
240
- t && ot(t, e);
241
- }
242
- break;
243
- case "Tab": Q();
244
- }
217
+ h.disabled || h.readonly || ye(e, {
218
+ open: S.value,
219
+ multiple: P.value,
220
+ searchQuery: C.value,
221
+ selectedCount: H.value.length
222
+ }, {
223
+ open: Q,
224
+ tabOut: () => $(),
225
+ dismiss: () => $(),
226
+ commitHighlighted: st,
227
+ moveHighlight: J.moveHighlight,
228
+ highlightLast: J.highlightLast,
229
+ highlightFirst: J.highlightFirst,
230
+ removeLastSelected: () => {
231
+ let t = H.value.at(-1);
232
+ t && ot(t, e);
233
+ }
234
+ });
245
235
  }
246
236
  async function ut(e) {
247
- let t = A.value.asyncData;
237
+ let t = M.value.asyncData;
248
238
  if (t) {
249
- S.value = !0;
239
+ w.value = !0;
250
240
  try {
251
- let { options: n, resolvedSelected: r } = await Te(t, e, z.value, (e) => Se(e, P.value));
252
- r.length > 0 && (E.value = r), T.value = n;
241
+ let { options: n, resolvedSelected: r } = await we(t, e, B.value, (e) => xe(e, F.value));
242
+ r.length > 0 && (O.value = r), D.value = n;
253
243
  } finally {
254
- S.value = !1;
244
+ w.value = !1;
255
245
  }
256
246
  }
257
247
  }
258
248
  async function dt() {
259
- let e = A.value.asyncData;
260
- e?.resolve && z.value.length !== 0 && (E.value = Se(await e.resolve(z.value), P.value));
249
+ let e = M.value.asyncData;
250
+ e?.resolve && B.value.length !== 0 && (O.value = xe(await e.resolve(B.value), F.value));
261
251
  }
262
- let $ = a(() => {
263
- let e = ke(Ee, me(Fe.value, [
252
+ let ft = o(() => {
253
+ let e = Oe(Te, pe(Fe.value, [
264
254
  "Select",
265
255
  "tokens",
266
256
  "listbox",
267
257
  "color"
268
258
  ]));
269
- return Oe({
259
+ return De({
270
260
  tokens: e,
271
- color: J.merged.value.color,
272
- invalid: J.invalidated.value
261
+ color: Y.merged.value.color,
262
+ invalid: Y.invalidated.value
273
263
  });
274
- }), ft = a(() => $.value?.value), pt = a(() => {
275
- let e = !p.disabled && !p.readonly && !G.value, t = !p.disabled && !p.readonly && G.value && W.value, n = H.value && !N.value && !G.value;
264
+ }), pt = o(() => ft.value?.value), mt = o(() => {
265
+ let e = !h.disabled && !h.readonly && !K.value, t = !h.disabled && !h.readonly && K.value && G.value, n = U.value && !P.value && !K.value;
276
266
  return r({
277
267
  role: "combobox",
278
268
  value: Je.value,
279
- "aria-controls": v,
280
- "aria-expanded": b.value,
269
+ "aria-controls": b,
270
+ "aria-expanded": S.value,
281
271
  readonly: qe.value,
282
272
  onKeydown: lt,
283
- placeholder: A.value.placeholder,
284
- "aria-autocomplete": W.value ? "list" : void 0,
285
- "aria-activedescendant": b.value ? q.activeDescendantId.value : void 0,
286
- ...N.value ? {
273
+ placeholder: M.value.placeholder,
274
+ "aria-autocomplete": G.value ? "list" : void 0,
275
+ "aria-activedescendant": S.value ? J.activeDescendantId.value : void 0,
276
+ ...P.value ? {
287
277
  rows: 1,
288
278
  onInput: (e) => {
289
- ct(e), Y(e.target);
279
+ ct(e), X(e.target);
290
280
  }
291
281
  } : { onInput: ct }
292
- }, J.inputBind.value, f({
282
+ }, Y.inputBind.value, m({
293
283
  "cursor-text": t,
294
284
  "cursor-pointer": e,
295
- "resize-none overflow-hidden": N.value,
296
- [f(ft.value, M.value.value) ?? ""]: n
285
+ "resize-none overflow-hidden": P.value,
286
+ [m(pt.value, N.value.value) ?? ""]: n
297
287
  }));
298
288
  });
299
- c(() => [
300
- b.value,
301
- N.value,
302
- h.value
289
+ l(() => [
290
+ S.value,
291
+ P.value,
292
+ _.value
303
293
  ], () => {
304
- Y(h.value);
305
- }, { immediate: !0 }), c(() => m.value, () => {
294
+ X(_.value);
295
+ }, { immediate: !0 }), l(() => g.value, () => {
306
296
  dt();
307
- }, { immediate: !0 }), c(() => A.value.asyncData, (e) => {
308
- if (O?.cancel(), T.value = [], dt(), !e) {
309
- O = null;
297
+ }, { immediate: !0 }), l(() => M.value.asyncData, (e) => {
298
+ if (A?.cancel(), D.value = [], dt(), !e) {
299
+ A = null;
310
300
  return;
311
301
  }
312
- O = ve((e) => void ut(e), we(e));
313
- }, { immediate: !0 }), le(() => {
314
- O?.cancel();
315
- }), ue(() => {
316
- Y(h.value);
302
+ A = _e((e) => void ut(e), Ce(e));
303
+ }, { immediate: !0 }), ce(() => {
304
+ A?.cancel();
305
+ }), le(() => {
306
+ X(_.value);
317
307
  });
318
- let mt = a(() => ee(J.merged.value.size)), ht = a(() => r({}, {}, {
308
+ let ht = o(() => i(Y.merged.value.size)), gt = o(() => r({}, {}, {
319
309
  tabindex: 0,
320
310
  role: "button",
321
311
  "data-select-clear": !0,
322
312
  onMousedown: Xe,
323
- class: f({
313
+ class: m({
324
314
  "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
325
- [$.value?.clear ?? ""]: !0,
326
- [M.value.clear ?? ""]: !0
315
+ [ft.value?.clear ?? ""]: !0,
316
+ [N.value.clear ?? ""]: !0
327
317
  })
328
- })), gt = a(() => ({
329
- listboxId: v,
318
+ })), _t = o(() => ({
319
+ listboxId: b,
330
320
  isSelected: tt,
331
321
  disableAutoFocus: !0,
332
- overlay: p.overlay,
322
+ overlay: h.overlay,
333
323
  loading: Ge.value,
334
- multiple: N.value,
335
- maxHeight: p.maxHeight,
336
- showFooter: B.value,
324
+ multiple: P.value,
325
+ maxHeight: h.maxHeight,
326
+ showFooter: V.value,
337
327
  entries: Ke.value,
338
- options: K.value,
339
- size: J.merged.value.size,
340
- error: J.invalidated.value,
341
- color: J.merged.value.color,
342
- labelledBy: J.controlId.value,
343
- rounded: J.merged.value.rounded,
344
- highlightedIndex: C.value,
345
- disableMaxHeight: p.disableMaxHeight === !0,
346
- hideEmptyMessage: A.value.hideEmptyMessage === !0,
347
- emptyMessage: A.value.emptyMessage ?? y("No options"),
348
- loadingMessage: A.value.loadingMessage ?? y("Loading..."),
328
+ options: q.value,
329
+ size: Y.merged.value.size,
330
+ error: Y.invalidated.value,
331
+ color: Y.merged.value.color,
332
+ labelledBy: Y.controlId.value,
333
+ rounded: Y.merged.value.rounded,
334
+ highlightedIndex: T.value,
335
+ disableMaxHeight: h.disableMaxHeight === !0,
336
+ hideEmptyMessage: M.value.hideEmptyMessage === !0,
337
+ emptyMessage: M.value.emptyMessage ?? x("No options"),
338
+ loadingMessage: M.value.loadingMessage ?? x("Loading..."),
349
339
  ...$e.value
350
340
  }));
351
- function _t(e) {
341
+ function vt(e) {
352
342
  if (e.length === 0) return;
353
- let t = I.value;
343
+ let t = L.value;
354
344
  t.length === e.length && t.every((t, n) => {
355
345
  let r = e[n];
356
346
  return t.label === r?.label && t.description === r?.description && String(t.value) === String(r?.value) && !!t.disabled == !!r?.disabled;
357
- }) || (I.value = e);
347
+ }) || (L.value = e);
358
348
  }
359
349
  return {
360
- open: b,
361
- slots: _,
362
- hasValue: H,
363
- multiple: N,
364
- listboxId: v,
365
- formField: J,
350
+ open: S,
351
+ slots: y,
352
+ hasValue: U,
353
+ multiple: P,
354
+ listboxId: b,
355
+ formField: Y,
366
356
  isLoading: Ge,
367
357
  clearable: We,
368
- clearBind: ht,
358
+ clearBind: gt,
369
359
  isSelected: tt,
370
360
  clearValue: at,
371
361
  removeChip: ot,
372
- triggerBind: pt,
362
+ triggerBind: mt,
373
363
  handleApply: rt,
374
364
  selectOption: nt,
375
365
  handleCancel: it,
376
- containerRef: D,
377
- listboxProps: gt,
378
- clearIconSize: mt,
379
- mergedClasses: M,
366
+ containerRef: k,
367
+ listboxProps: _t,
368
+ clearIconSize: ht,
369
+ mergedClasses: N,
380
370
  showClearIcon: et,
381
- visibleOptions: K,
382
- isSearchActive: G,
383
- selectedOptions: V,
384
- hasComposedList: L,
385
- highlightedIndex: C,
386
- handleRegisteredOptionsChange: _t,
387
- hideEmptyMessage: a(() => A.value.hideEmptyMessage === !0),
388
- emptyMessage: a(() => A.value.emptyMessage ?? y("No options")),
389
- loadingMessage: a(() => A.value.loadingMessage ?? y("Loading..."))
371
+ visibleOptions: q,
372
+ isSearchActive: K,
373
+ selectedOptions: H,
374
+ hasComposedList: R,
375
+ highlightedIndex: T,
376
+ handleRegisteredOptionsChange: vt,
377
+ hideEmptyMessage: o(() => M.value.hideEmptyMessage === !0),
378
+ emptyMessage: o(() => M.value.emptyMessage ?? x("No options")),
379
+ loadingMessage: o(() => M.value.loadingMessage ?? x("Loading..."))
390
380
  };
391
381
  }
392
382
  //#endregion
393
- export { p as useSelect };
383
+ export { h as useSelect };