@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 { createSelectAsyncSearch as
|
|
11
|
-
import { listboxColorProps as
|
|
12
|
-
import { adjustAutosizeTextareaHeight as
|
|
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
|
|
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
|
|
38
|
-
let
|
|
39
|
-
bridgeKeys:
|
|
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
|
-
...
|
|
42
|
-
...
|
|
41
|
+
...Me,
|
|
42
|
+
...h
|
|
43
43
|
}
|
|
44
|
-
})),
|
|
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: () =>
|
|
48
|
-
}),
|
|
47
|
+
props: () => Pe.value
|
|
48
|
+
}), N = a({
|
|
49
49
|
entry: Ie,
|
|
50
|
-
props: () =>
|
|
51
|
-
}),
|
|
52
|
-
optionLabel:
|
|
53
|
-
optionValue:
|
|
54
|
-
optionDescription:
|
|
55
|
-
})),
|
|
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
|
-
})) :
|
|
58
|
+
})) : f(M.value.options, F.value)), Le = o(() => d(I.value)), L = c([]);
|
|
59
59
|
function Re(e) {
|
|
60
|
-
if (!
|
|
60
|
+
if (!u(e)) return !1;
|
|
61
61
|
let t = e.type;
|
|
62
|
-
if (!
|
|
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(
|
|
68
|
-
if (!
|
|
67
|
+
return t(y, "default") ? (y.default?.({}) ?? []).some((e) => {
|
|
68
|
+
if (!u(e)) return !1;
|
|
69
69
|
let t = e.type;
|
|
70
|
-
return t ===
|
|
70
|
+
return t === oe || t === se || t === void 0 || he(t) ? !1 : !Re(e);
|
|
71
71
|
}) : !1;
|
|
72
72
|
}
|
|
73
|
-
let
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
76
|
-
let e =
|
|
77
|
-
return
|
|
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
|
|
79
|
+
return M.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
|
|
80
80
|
...e,
|
|
81
81
|
options: [...e.options].reverse()
|
|
82
|
-
} : e) :
|
|
83
|
-
}), Ve =
|
|
84
|
-
let e =
|
|
85
|
-
return
|
|
86
|
-
}), He =
|
|
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: () =>
|
|
91
|
-
}), Ue =
|
|
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, ...
|
|
94
|
-
return
|
|
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
|
-
}),
|
|
99
|
-
if (
|
|
100
|
-
let e =
|
|
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
|
-
}),
|
|
103
|
-
if (
|
|
104
|
-
if (!
|
|
105
|
-
let e =
|
|
106
|
-
return
|
|
107
|
-
}),
|
|
108
|
-
|
|
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 (
|
|
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 (!
|
|
118
|
-
|
|
117
|
+
if (!S.value) {
|
|
118
|
+
Q();
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
K.value || ($(), _.value?.focus({ preventScroll: !0 }));
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
let Qe =
|
|
125
|
-
let e =
|
|
126
|
-
bridgeKeys:
|
|
124
|
+
let Qe = o(() => {
|
|
125
|
+
let e = ge(j.value.inheritedAttrs, ["class"]), n = ke({
|
|
126
|
+
bridgeKeys: ne,
|
|
127
127
|
props: e
|
|
128
|
-
}).componentProps,
|
|
128
|
+
}).componentProps, i = n.endIcon ?? (t(y, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...a } = n.customProps ?? {};
|
|
129
129
|
return {
|
|
130
130
|
...n,
|
|
131
|
-
endIcon:
|
|
132
|
-
classes:
|
|
131
|
+
endIcon: i,
|
|
132
|
+
classes: N.value,
|
|
133
133
|
customProps: {
|
|
134
|
-
...
|
|
135
|
-
container: r(
|
|
134
|
+
...a,
|
|
135
|
+
container: r(a.container, {}, {
|
|
136
136
|
ref: Ye,
|
|
137
137
|
onClick: Ze,
|
|
138
|
-
class:
|
|
138
|
+
class: m({ "cursor-pointer": !h.disabled && !h.readonly && !K.value })
|
|
139
139
|
})
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
}), $e =
|
|
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: () =>
|
|
151
|
-
control: () =>
|
|
152
|
-
}), et =
|
|
153
|
-
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) =>
|
|
156
|
+
return Ue.value.some((t) => p(t, e));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
if (
|
|
158
|
+
function Z(e) {
|
|
159
|
+
if (P.value) {
|
|
160
160
|
let t = Array.isArray(e) ? e : [];
|
|
161
|
-
|
|
161
|
+
g.value = t, v("change", t);
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
let t = e ?? "";
|
|
165
|
-
|
|
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
|
-
|
|
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 (
|
|
176
|
-
if (
|
|
177
|
-
let t = [...
|
|
178
|
-
n >= 0 ? (t.splice(n, 1),
|
|
179
|
-
|
|
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
|
-
|
|
183
|
+
E.value = [e.value], v("select", e), C.value = "", T.value = -1;
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
if (
|
|
187
|
-
let t = [...
|
|
188
|
-
n >= 0 ? (t.splice(n, 1),
|
|
189
|
-
|
|
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
|
-
|
|
193
|
+
Z(e.value), v("select", e), $();
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
function rt() {
|
|
197
|
-
|
|
197
|
+
P.value ? Z(E.value) : Z(E.value[0] ?? null), $(), v("apply");
|
|
198
198
|
}
|
|
199
199
|
function it() {
|
|
200
|
-
|
|
200
|
+
E.value = [...B.value], $(), v("cancel");
|
|
201
201
|
}
|
|
202
202
|
function at(e) {
|
|
203
|
-
e?.preventDefault(), e?.stopPropagation(), !(
|
|
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(),
|
|
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 =
|
|
209
|
+
let e = J.getHighlightedOption();
|
|
210
210
|
e && nt(e);
|
|
211
211
|
}
|
|
212
212
|
function ct(e) {
|
|
213
213
|
let t = e.target;
|
|
214
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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 =
|
|
237
|
+
let t = M.value.asyncData;
|
|
248
238
|
if (t) {
|
|
249
|
-
|
|
239
|
+
w.value = !0;
|
|
250
240
|
try {
|
|
251
|
-
let { options: n, resolvedSelected: r } = await
|
|
252
|
-
r.length > 0 && (
|
|
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
|
-
|
|
244
|
+
w.value = !1;
|
|
255
245
|
}
|
|
256
246
|
}
|
|
257
247
|
}
|
|
258
248
|
async function dt() {
|
|
259
|
-
let e =
|
|
260
|
-
e?.resolve &&
|
|
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
|
|
263
|
-
let e =
|
|
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
|
|
259
|
+
return De({
|
|
270
260
|
tokens: e,
|
|
271
|
-
color:
|
|
272
|
-
invalid:
|
|
261
|
+
color: Y.merged.value.color,
|
|
262
|
+
invalid: Y.invalidated.value
|
|
273
263
|
});
|
|
274
|
-
}),
|
|
275
|
-
let e = !
|
|
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":
|
|
280
|
-
"aria-expanded":
|
|
269
|
+
"aria-controls": b,
|
|
270
|
+
"aria-expanded": S.value,
|
|
281
271
|
readonly: qe.value,
|
|
282
272
|
onKeydown: lt,
|
|
283
|
-
placeholder:
|
|
284
|
-
"aria-autocomplete":
|
|
285
|
-
"aria-activedescendant":
|
|
286
|
-
...
|
|
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),
|
|
279
|
+
ct(e), X(e.target);
|
|
290
280
|
}
|
|
291
281
|
} : { onInput: ct }
|
|
292
|
-
},
|
|
282
|
+
}, Y.inputBind.value, m({
|
|
293
283
|
"cursor-text": t,
|
|
294
284
|
"cursor-pointer": e,
|
|
295
|
-
"resize-none overflow-hidden":
|
|
296
|
-
[
|
|
285
|
+
"resize-none overflow-hidden": P.value,
|
|
286
|
+
[m(pt.value, N.value.value) ?? ""]: n
|
|
297
287
|
}));
|
|
298
288
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
289
|
+
l(() => [
|
|
290
|
+
S.value,
|
|
291
|
+
P.value,
|
|
292
|
+
_.value
|
|
303
293
|
], () => {
|
|
304
|
-
|
|
305
|
-
}, { immediate: !0 }),
|
|
294
|
+
X(_.value);
|
|
295
|
+
}, { immediate: !0 }), l(() => g.value, () => {
|
|
306
296
|
dt();
|
|
307
|
-
}, { immediate: !0 }),
|
|
308
|
-
if (
|
|
309
|
-
|
|
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
|
-
|
|
313
|
-
}, { immediate: !0 }),
|
|
314
|
-
|
|
315
|
-
}),
|
|
316
|
-
|
|
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
|
|
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:
|
|
313
|
+
class: m({
|
|
324
314
|
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
|
|
325
|
-
[
|
|
326
|
-
[
|
|
315
|
+
[ft.value?.clear ?? ""]: !0,
|
|
316
|
+
[N.value.clear ?? ""]: !0
|
|
327
317
|
})
|
|
328
|
-
})),
|
|
329
|
-
listboxId:
|
|
318
|
+
})), _t = o(() => ({
|
|
319
|
+
listboxId: b,
|
|
330
320
|
isSelected: tt,
|
|
331
321
|
disableAutoFocus: !0,
|
|
332
|
-
overlay:
|
|
322
|
+
overlay: h.overlay,
|
|
333
323
|
loading: Ge.value,
|
|
334
|
-
multiple:
|
|
335
|
-
maxHeight:
|
|
336
|
-
showFooter:
|
|
324
|
+
multiple: P.value,
|
|
325
|
+
maxHeight: h.maxHeight,
|
|
326
|
+
showFooter: V.value,
|
|
337
327
|
entries: Ke.value,
|
|
338
|
-
options:
|
|
339
|
-
size:
|
|
340
|
-
error:
|
|
341
|
-
color:
|
|
342
|
-
labelledBy:
|
|
343
|
-
rounded:
|
|
344
|
-
highlightedIndex:
|
|
345
|
-
disableMaxHeight:
|
|
346
|
-
hideEmptyMessage:
|
|
347
|
-
emptyMessage:
|
|
348
|
-
loadingMessage:
|
|
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
|
|
341
|
+
function vt(e) {
|
|
352
342
|
if (e.length === 0) return;
|
|
353
|
-
let t =
|
|
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
|
-
}) || (
|
|
347
|
+
}) || (L.value = e);
|
|
358
348
|
}
|
|
359
349
|
return {
|
|
360
|
-
open:
|
|
361
|
-
slots:
|
|
362
|
-
hasValue:
|
|
363
|
-
multiple:
|
|
364
|
-
listboxId:
|
|
365
|
-
formField:
|
|
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:
|
|
358
|
+
clearBind: gt,
|
|
369
359
|
isSelected: tt,
|
|
370
360
|
clearValue: at,
|
|
371
361
|
removeChip: ot,
|
|
372
|
-
triggerBind:
|
|
362
|
+
triggerBind: mt,
|
|
373
363
|
handleApply: rt,
|
|
374
364
|
selectOption: nt,
|
|
375
365
|
handleCancel: it,
|
|
376
|
-
containerRef:
|
|
377
|
-
listboxProps:
|
|
378
|
-
clearIconSize:
|
|
379
|
-
mergedClasses:
|
|
366
|
+
containerRef: k,
|
|
367
|
+
listboxProps: _t,
|
|
368
|
+
clearIconSize: ht,
|
|
369
|
+
mergedClasses: N,
|
|
380
370
|
showClearIcon: et,
|
|
381
|
-
visibleOptions:
|
|
382
|
-
isSearchActive:
|
|
383
|
-
selectedOptions:
|
|
384
|
-
hasComposedList:
|
|
385
|
-
highlightedIndex:
|
|
386
|
-
handleRegisteredOptionsChange:
|
|
387
|
-
hideEmptyMessage:
|
|
388
|
-
emptyMessage:
|
|
389
|
-
loadingMessage:
|
|
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 {
|
|
383
|
+
export { h as useSelect };
|