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