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