@kapiuara/ui 0.13.0 → 0.14.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/README.md +5 -0
- package/dist/components/chat/KapiChatDivider.d.ts +7 -3
- package/dist/components/chat/KapiChatDivider.js +6 -6
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/display/KapiAnnotation.js +4 -4
- package/dist/components/feedback/KapiFab.js +4 -4
- package/dist/components/feedback/KapiToastContainer.js +5 -5
- package/dist/components/feedback/KapiTour.js +4 -4
- package/dist/components/inputs/KapiDatePicker.js +124 -122
- package/dist/components/inputs/KapiDateRangePicker.js +138 -136
- package/dist/components/inputs/KapiFacetedSearch.js +8 -8
- package/dist/components/inputs/KapiMaskedInput.d.ts +8 -3
- package/dist/components/inputs/KapiMaskedInput.js +66 -53
- package/dist/components/inputs/KapiNumberStepper.js +29 -29
- package/dist/components/inputs/KapiRating.js +61 -59
- package/dist/components/inputs/KapiSegmented.js +68 -58
- package/dist/components/inputs/KapiSelect.js +204 -194
- package/dist/components/inputs/KapiTagInput.js +82 -80
- package/dist/components/inputs/misuseWarnings.d.ts +37 -0
- package/dist/components/inputs/misuseWarnings.js +36 -0
- package/dist/components/inputs/numberStepLogic.d.ts +10 -0
- package/dist/components/inputs/numberStepLogic.js +16 -7
- package/dist/components/layout/KapiAccountMenu.js +4 -4
- package/dist/components/navigation/CtxSlidingList.js +4 -4
- package/dist/components/navigation/KapiTabs.js +58 -51
- package/dist/components/navigation/KapiTree.js +5 -5
- package/dist/components/overlays/KapiContextMenu.js +4 -4
- package/dist/components/overlays/KapiMenuButton.js +4 -4
- package/dist/components/overlays/KapiPhotoView.js +1 -1
- package/dist/components/overlays/KapiPopover.js +4 -4
- package/dist/components/overlays/KapiShapeSheet.js +4 -4
- package/dist/components/overlays/KapiTooltip.js +1 -1
- package/dist/css/components/chat/chat.css +1 -1
- package/dist/hooks/useControllableState.d.ts +6 -2
- package/dist/hooks/useControllableState.js +14 -11
- package/dist/hooks/useFormReset.d.ts +22 -0
- package/dist/hooks/useFormReset.js +17 -0
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +5 -2
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/inputs/KapiSelect.css";
|
|
3
3
|
import { assignRef as e, fieldControlProps as t, focusLeaves as n, resolveReadOnly as r } from "./fieldLogic.js";
|
|
4
|
-
import { useOwnField as
|
|
5
|
-
import { resolveGroupSize as
|
|
6
|
-
import { useKapiInputGroup as
|
|
7
|
-
import { useLabels as
|
|
8
|
-
import { useRangeSelect as
|
|
9
|
-
import { SELECT_MENU_PLACEMENT as
|
|
10
|
-
import { useControllableState as
|
|
11
|
-
import { resolveKapiRoot as
|
|
12
|
-
import { isCreateRow as
|
|
4
|
+
import { useOwnField as ee } from "./ownField.js";
|
|
5
|
+
import { resolveGroupSize as i, selectControlId as te } from "./inputGroupLogic.js";
|
|
6
|
+
import { useKapiInputGroup as ne } from "./KapiInputGroup.js";
|
|
7
|
+
import { useLabels as re } from "../locale/KapiLocaleProvider.js";
|
|
8
|
+
import { useRangeSelect as ie } from "../../hooks/useRangeSelect.js";
|
|
9
|
+
import { SELECT_MENU_PLACEMENT as ae, displayLabel as oe, filterOptions as se, findTypeaheadIndex as ce, flattenOptions as le, indexEntries as ue, initialActiveIndex as de, nextActiveIndex as fe, normalizeValue as pe, resolveChipLabel as me, resolveVirtualMenu as he, toggleValue as ge, withUnknownValues as _e } from "./selectLogic.js";
|
|
10
|
+
import { useControllableState as ve } from "../../hooks/useControllableState.js";
|
|
11
|
+
import { resolveKapiRoot as ye } from "../../hooks/kapiRoot.js";
|
|
12
|
+
import { isCreateRow as be, menuItems as a, withCreated as xe } from "./asyncSelectLogic.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import { usePlacement as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
14
|
+
import { usePlacement as Se } from "../../hooks/usePlacement.js";
|
|
15
|
+
import { useDuplicateValueWarning as Ce, useMutedControlWarning as we } from "./misuseWarnings.js";
|
|
16
|
+
import { useFormReset as Te } from "../../hooks/useFormReset.js";
|
|
17
|
+
import { useMergedRefs as Ee } from "../../hooks/mergeRefs.js";
|
|
18
|
+
import { useOutsidePress as De } from "../../hooks/useOutsidePress.js";
|
|
19
|
+
import { useTypeahead as Oe } from "../../hooks/useTypeahead.js";
|
|
20
|
+
import { selectKeyAction as ke } from "./selectKeyLogic.js";
|
|
21
|
+
import { useSelectSource as Ae } from "./useSelectSource.js";
|
|
22
|
+
import { useSelectCreate as je } from "./useSelectCreate.js";
|
|
23
|
+
import { KapiSelectMenu as Me } from "./KapiSelectMenu.js";
|
|
24
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
25
|
+
import { useCallback as Ne, useEffect as Pe, useId as Fe, useLayoutEffect as Ie, useMemo as c, useRef as l, useState as u } from "react";
|
|
26
|
+
import { ChevronDown as Le, X as Re } from "lucide-react";
|
|
24
27
|
//#region src/components/inputs/KapiSelect.tsx
|
|
25
|
-
var
|
|
26
|
-
...
|
|
28
|
+
var ze = 6, Be = [], d = "\0kapisel-all", f = (e, t) => `${e} “${t.trim()}”`, Ve = ({ size: e = "md", open: t, disabled: n, readOnly: r, multi: ee, chip: i, className: te }) => [
|
|
29
|
+
...i ? ["kapi-filterchip", "kapisel--chip"] : ["kapisel", `kapisel--${e}`],
|
|
27
30
|
t && "kapisel--open",
|
|
28
31
|
n && "kapisel--disabled",
|
|
29
32
|
r && "kapisel--readonly",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
].filter(Boolean).join(" "),
|
|
33
|
+
ee && "kapisel--multi",
|
|
34
|
+
te
|
|
35
|
+
].filter(Boolean).join(" "), He = {
|
|
33
36
|
clear: "Limpiar selección",
|
|
34
37
|
remove: "Quitar",
|
|
35
38
|
placeholder: "Seleccionar…",
|
|
@@ -40,126 +43,133 @@ var Pe = 6, Fe = [], f = "\0kapisel-all", Ie = (e, t) => `${e} “${t.trim()}”
|
|
|
40
43
|
create: "Crear",
|
|
41
44
|
all: "Todas"
|
|
42
45
|
}, p = (p) => {
|
|
43
|
-
let { options: m =
|
|
44
|
-
value:
|
|
45
|
-
label:
|
|
46
|
-
}), [
|
|
46
|
+
let { options: m = Be, loadOptions: Ue, loadDelay: We = 300, reloadKey: Ge, onCreate: Ke, value: qe, defaultValue: Je, multiple: h = !1, variant: Ye = "field", icon: Xe, label: Ze, chipLabel: Qe, help: $e, fieldClassName: et, clearable: tt = !1, disabled: g = !1, invalid: nt, required: rt, readOnly: it, loading: _ = !1, placeholder: at, size: ot, renderOption: st, renderValue: ct, virtual: lt, emptyMessage: ut, noOptionsMessage: dt, loadingMessage: ft, name: v, id: pt, className: mt, style: ht, "aria-label": gt, labels: _t, ref: y, onBlur: vt } = p, b = Ye === "chip", x = p.searchable ?? !b, yt = p.onChange, S = re("select", He, _t), bt = at ?? S.placeholder, C = h ? void 0 : p.allOption, w = C !== void 0 && C !== !1, xt = typeof C == "string" ? C : S.all, T = c(() => ({
|
|
47
|
+
value: d,
|
|
48
|
+
label: xt
|
|
49
|
+
}), [xt]), St = c(() => w && !(Ue && m.length === 0) ? [T, ...m] : m, [
|
|
47
50
|
w,
|
|
48
|
-
|
|
51
|
+
Ue,
|
|
49
52
|
m,
|
|
50
53
|
T
|
|
51
|
-
]),
|
|
54
|
+
]), Ct = ut ?? dt ?? S.noOptions, wt = ft ?? S.loading, Tt = ne(), Et = i(ot, Tt?.size) ?? "md", { chipLabel: Dt, fieldLabel: Ot } = me({
|
|
52
55
|
chip: b,
|
|
53
|
-
chipLabel:
|
|
54
|
-
label:
|
|
55
|
-
}),
|
|
56
|
-
id:
|
|
57
|
-
label:
|
|
58
|
-
help:
|
|
59
|
-
required:
|
|
60
|
-
invalid:
|
|
61
|
-
readOnly:
|
|
62
|
-
fieldClassName:
|
|
63
|
-
}), E =
|
|
64
|
-
id:
|
|
56
|
+
chipLabel: Qe,
|
|
57
|
+
label: Ze
|
|
58
|
+
}), kt = ee({
|
|
59
|
+
id: pt,
|
|
60
|
+
label: Ot,
|
|
61
|
+
help: $e,
|
|
62
|
+
required: rt,
|
|
63
|
+
invalid: nt,
|
|
64
|
+
readOnly: it,
|
|
65
|
+
fieldClassName: et
|
|
66
|
+
}), E = kt.field, D = r(it, E), O = gt ?? (b && !E ? Dt : void 0), At = Fe(), k = te({
|
|
67
|
+
id: pt,
|
|
65
68
|
fieldControlId: E?.controlId,
|
|
66
|
-
autoId:
|
|
67
|
-
inGroup:
|
|
68
|
-
}),
|
|
69
|
+
autoId: At,
|
|
70
|
+
inGroup: Tt !== null
|
|
71
|
+
}), jt = `${k}-listbox`, Mt = `${k}-value`, Nt = (e) => `${k}-opt-${e}`, [Pt, Ft, , It] = ve(qe, () => pe(Je, h), yt), Lt = c(() => le(m).map((e) => e.value), [m]);
|
|
72
|
+
Ce("KapiSelect", Lt), we("KapiSelect", {
|
|
73
|
+
controlled: qe !== void 0,
|
|
74
|
+
hasOnChange: !!yt,
|
|
75
|
+
readOnly: D,
|
|
76
|
+
disabled: g
|
|
77
|
+
});
|
|
78
|
+
let A = (e) => Ft(w && e === d ? null : e), Rt = pe(Pt, h), j = w && Rt === null ? d : Rt, M = j === d, N = c(() => pe(j, !0), [j]), [P, F] = u(!1), [I, L] = u(""), [zt, R] = u(-1), z = l(null), Bt = Ee(z, Te(It)), B = l(null), Vt = l(null), Ht = Ne((t) => {
|
|
69
79
|
B.current = t, e(y, t);
|
|
70
|
-
}, [y]),
|
|
71
|
-
|
|
72
|
-
}, [y]), V =
|
|
73
|
-
options:
|
|
74
|
-
loadOptions:
|
|
75
|
-
loadDelay:
|
|
76
|
-
reloadKey:
|
|
77
|
-
creatable:
|
|
80
|
+
}, [y]), Ut = Ne((t) => {
|
|
81
|
+
Vt.current = t, e(y, t);
|
|
82
|
+
}, [y]), V = l(null), Wt = Oe(500), H = c(() => new Set(N), [N]), Gt = ie(), Kt = I.trim(), U = P && !g && !D, W = Ae({
|
|
83
|
+
options: St,
|
|
84
|
+
loadOptions: Ue,
|
|
85
|
+
loadDelay: We,
|
|
86
|
+
reloadKey: Ge,
|
|
87
|
+
creatable: Ke !== void 0,
|
|
78
88
|
searchable: x,
|
|
79
89
|
query: I,
|
|
80
|
-
open:
|
|
90
|
+
open: U,
|
|
81
91
|
current: j,
|
|
82
|
-
onLoaded: (e, t) => R(
|
|
83
|
-
}), { isAsync:
|
|
92
|
+
onLoaded: (e, t) => R(fe(-1, "first", a(e, t, J, f(S.create, t))))
|
|
93
|
+
}), { isAsync: qt, filtered: G, asyncLoading: Jt, loadError: Yt } = W, K = c(() => M ? [T] : _ ? W.selected : _e(W.selected, j), [
|
|
84
94
|
M,
|
|
85
95
|
T,
|
|
86
|
-
|
|
96
|
+
W.selected,
|
|
87
97
|
_,
|
|
88
98
|
j
|
|
89
|
-
]),
|
|
90
|
-
onCreate:
|
|
91
|
-
open:
|
|
99
|
+
]), q = je({
|
|
100
|
+
onCreate: Ke,
|
|
101
|
+
open: U,
|
|
92
102
|
onSettled: (e, t) => {
|
|
93
|
-
e && (
|
|
103
|
+
e && (W.remember([e]), A(xe(j, e.value, h))), I.trim() === t && an(e ? e.value : null);
|
|
94
104
|
}
|
|
95
|
-
}),
|
|
96
|
-
|
|
105
|
+
}), Xt = _ || Jt, Zt = Xt || q.creating, J = Ke !== void 0 && x && !_ && !q.creating, Y = c(() => a(G, I, J && !Jt, f(S.create, I)), [
|
|
106
|
+
G,
|
|
97
107
|
I,
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
J,
|
|
109
|
+
Jt,
|
|
100
110
|
S.create
|
|
101
|
-
]),
|
|
102
|
-
|
|
111
|
+
]), Qt = c(() => ue(G), [G]), $t = Y.length > 0 && be(Y[Y.length - 1]) ? Y[Y.length - 1] : null, X = zt >= 0 && zt < Y.length ? zt : -1, Z = K.length > 0, en = x && I !== "", tn = Xt ? wt : q.failed ? S.createError : Yt ? S.loadError : Y.length === 0 ? Ct : null, nn = () => (x ? B.current : Vt.current)?.focus();
|
|
112
|
+
Pe(() => {
|
|
103
113
|
g && (F(!1), L(""));
|
|
104
114
|
}, [g]);
|
|
105
|
-
let
|
|
115
|
+
let Q = Ne(() => {
|
|
106
116
|
F(!1), L(""), R(-1);
|
|
107
|
-
}, []),
|
|
108
|
-
g || D || (F(!0), R(
|
|
109
|
-
},
|
|
110
|
-
h ? (L(""), R(e === null ? -1 :
|
|
111
|
-
},
|
|
117
|
+
}, []), rn = (e = "selected") => {
|
|
118
|
+
g || D || (F(!0), R(de(Y, N, e)));
|
|
119
|
+
}, an = (e) => {
|
|
120
|
+
h ? (L(""), R(e === null ? -1 : de(le(m), [e], "selected")), B.current?.focus()) : Q();
|
|
121
|
+
}, on = (e, t = !1) => {
|
|
112
122
|
if (e.disabled) return;
|
|
113
|
-
if (
|
|
114
|
-
|
|
123
|
+
if (be(e)) {
|
|
124
|
+
q.create(Kt);
|
|
115
125
|
return;
|
|
116
126
|
}
|
|
117
127
|
if (h) {
|
|
118
|
-
let n =
|
|
119
|
-
selected: new Set(
|
|
128
|
+
let n = Y.filter((e) => !be(e)), r = n.map((e) => e.value), ee = new Set(n.filter((e) => !e.disabled).map((e) => e.value)), i = Gt.toggle({
|
|
129
|
+
selected: new Set(H),
|
|
120
130
|
ids: r,
|
|
121
131
|
target: e.value,
|
|
122
132
|
shift: t,
|
|
123
|
-
isSelectable: (e) =>
|
|
133
|
+
isSelectable: (e) => ee.has(e)
|
|
124
134
|
});
|
|
125
|
-
A([...N.filter((e) =>
|
|
135
|
+
A([...N.filter((e) => i.has(e)), ...r.filter((e) => i.has(e) && !H.has(e))]), an(e.value);
|
|
126
136
|
return;
|
|
127
137
|
}
|
|
128
|
-
let n =
|
|
129
|
-
n === j ?
|
|
130
|
-
},
|
|
131
|
-
A(h ? [] : null), L(""),
|
|
132
|
-
}, { placement:
|
|
133
|
-
open:
|
|
138
|
+
let n = ge(j, e.value, h);
|
|
139
|
+
n === j ? Q() : (A(n), an(e.value));
|
|
140
|
+
}, sn = (e) => A(N.filter((t) => t !== e)), cn = () => {
|
|
141
|
+
A(h ? [] : null), L(""), nn();
|
|
142
|
+
}, { placement: ln, style: un, update: dn } = Se({
|
|
143
|
+
open: U,
|
|
134
144
|
anchor: z,
|
|
135
145
|
floatingRef: V,
|
|
136
|
-
...
|
|
137
|
-
offset:
|
|
146
|
+
...ae,
|
|
147
|
+
offset: ze
|
|
138
148
|
});
|
|
139
|
-
|
|
140
|
-
|
|
149
|
+
Ie(() => {
|
|
150
|
+
U && dn();
|
|
141
151
|
}, [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
]),
|
|
147
|
-
if (!
|
|
148
|
-
let e = V.current?.querySelector(`[data-kapisel-index="${
|
|
152
|
+
U,
|
|
153
|
+
Y.length,
|
|
154
|
+
tn,
|
|
155
|
+
dn
|
|
156
|
+
]), De(U, [z, V], Q), Pe(() => {
|
|
157
|
+
if (!U || X < 0) return;
|
|
158
|
+
let e = V.current?.querySelector(`[data-kapisel-index="${X}"]`);
|
|
149
159
|
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
150
|
-
}, [
|
|
151
|
-
let
|
|
160
|
+
}, [U, X]);
|
|
161
|
+
let fn = (e) => {
|
|
152
162
|
if (g) return;
|
|
153
163
|
let t = e.target;
|
|
154
|
-
V.current?.contains(t) || (t.closest("[data-kapisel-action]") ? e.preventDefault() : t === B.current ? P ||
|
|
155
|
-
},
|
|
156
|
-
L(e), F(!0),
|
|
157
|
-
},
|
|
158
|
-
let t =
|
|
164
|
+
V.current?.contains(t) || (t.closest("[data-kapisel-action]") ? e.preventDefault() : t === B.current ? P || rn() : (e.preventDefault(), nn(), P ? Q() : rn()));
|
|
165
|
+
}, pn = (e) => {
|
|
166
|
+
L(e), F(!0), q.resetError(), R(qt ? -1 : fe(-1, "first", a(se(St, e), e, J, f(S.create, e))));
|
|
167
|
+
}, mn = (e) => {
|
|
168
|
+
let t = ce(Y, Wt(e), P ? X : Y.findIndex((e) => H.has(e.value)));
|
|
159
169
|
t < 0 || (P || F(!0), R(t));
|
|
160
|
-
},
|
|
170
|
+
}, hn = (e) => {
|
|
161
171
|
if (g || D) return;
|
|
162
|
-
let t =
|
|
172
|
+
let t = ke(e, {
|
|
163
173
|
open: P,
|
|
164
174
|
searchable: x,
|
|
165
175
|
multiple: h,
|
|
@@ -171,88 +181,88 @@ var Pe = 6, Fe = [], f = "\0kapisel-all", Ie = (e, t) => `${e} “${t.trim()}”
|
|
|
171
181
|
let { intent: n } = t;
|
|
172
182
|
switch (n.type) {
|
|
173
183
|
case "open":
|
|
174
|
-
|
|
184
|
+
rn(n.edge);
|
|
175
185
|
break;
|
|
176
186
|
case "move":
|
|
177
|
-
R(
|
|
187
|
+
R(fe(X, n.to, Y));
|
|
178
188
|
break;
|
|
179
189
|
case "choose": {
|
|
180
|
-
let e =
|
|
181
|
-
e &&
|
|
190
|
+
let e = X >= 0 ? Y[X] : void 0;
|
|
191
|
+
e && on(e);
|
|
182
192
|
break;
|
|
183
193
|
}
|
|
184
194
|
case "close":
|
|
185
|
-
|
|
195
|
+
Q();
|
|
186
196
|
break;
|
|
187
197
|
case "removeLast":
|
|
188
|
-
|
|
198
|
+
sn(N[N.length - 1]);
|
|
189
199
|
break;
|
|
190
|
-
case "typeahead":
|
|
200
|
+
case "typeahead": mn(n.key);
|
|
191
201
|
}
|
|
192
|
-
},
|
|
193
|
-
n(e.relatedTarget, z.current, V.current) && (P &&
|
|
194
|
-
},
|
|
195
|
-
virtual:
|
|
196
|
-
count:
|
|
197
|
-
contentSized:
|
|
198
|
-
customRows:
|
|
199
|
-
}),
|
|
202
|
+
}, gn = (e) => {
|
|
203
|
+
n(e.relatedTarget, z.current, V.current) && (P && Q(), vt?.(e));
|
|
204
|
+
}, _n = U ? ye(z.current) : null, vn = Tt !== null || b, yn = he({
|
|
205
|
+
virtual: lt,
|
|
206
|
+
count: Y.length,
|
|
207
|
+
contentSized: vn,
|
|
208
|
+
customRows: st !== void 0
|
|
209
|
+
}), bn = {
|
|
200
210
|
role: "combobox",
|
|
201
211
|
...t(E, {
|
|
202
212
|
id: k,
|
|
203
|
-
describedBy:
|
|
204
|
-
invalid:
|
|
205
|
-
required:
|
|
213
|
+
describedBy: Mt,
|
|
214
|
+
invalid: nt,
|
|
215
|
+
required: rt,
|
|
206
216
|
labelable: x,
|
|
207
217
|
ariaLabel: O
|
|
208
218
|
}),
|
|
209
219
|
"aria-haspopup": "listbox",
|
|
210
|
-
"aria-expanded":
|
|
211
|
-
"aria-controls":
|
|
212
|
-
"aria-activedescendant":
|
|
220
|
+
"aria-expanded": U,
|
|
221
|
+
"aria-controls": U ? jt : void 0,
|
|
222
|
+
"aria-activedescendant": U && X >= 0 ? Nt(X) : void 0,
|
|
213
223
|
"aria-label": O,
|
|
214
224
|
"aria-disabled": g || void 0,
|
|
215
225
|
"aria-readonly": D || void 0,
|
|
216
|
-
"aria-busy":
|
|
217
|
-
}, $ =
|
|
226
|
+
"aria-busy": Zt || void 0
|
|
227
|
+
}, $ = ct && Z && !M ? ct(K) : null, xn = !Z && !en && /* @__PURE__ */ o("span", {
|
|
218
228
|
className: "kapisel__placeholder",
|
|
219
229
|
"aria-hidden": "true",
|
|
220
|
-
children:
|
|
230
|
+
children: bt
|
|
221
231
|
});
|
|
222
|
-
return
|
|
223
|
-
ref:
|
|
224
|
-
className:
|
|
225
|
-
size:
|
|
226
|
-
open:
|
|
232
|
+
return kt.wrap(/* @__PURE__ */ s("div", {
|
|
233
|
+
ref: Bt,
|
|
234
|
+
className: Ve({
|
|
235
|
+
size: Et,
|
|
236
|
+
open: U,
|
|
227
237
|
disabled: g,
|
|
228
238
|
readOnly: D,
|
|
229
239
|
multi: h,
|
|
230
240
|
chip: b,
|
|
231
|
-
className:
|
|
241
|
+
className: mt
|
|
232
242
|
}),
|
|
233
|
-
style:
|
|
234
|
-
onMouseDown:
|
|
243
|
+
style: ht,
|
|
244
|
+
onMouseDown: fn,
|
|
235
245
|
children: [
|
|
236
|
-
b &&
|
|
237
|
-
b &&
|
|
246
|
+
b && Xe,
|
|
247
|
+
b && Dt && /* @__PURE__ */ s("span", {
|
|
238
248
|
className: "kapisel__chiplabel",
|
|
239
249
|
"aria-hidden": "true",
|
|
240
|
-
children: [
|
|
250
|
+
children: [Dt, ":"]
|
|
241
251
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ s("div", {
|
|
243
253
|
className: "kapisel__values",
|
|
244
254
|
children: [
|
|
245
|
-
h && $ !== null && /* @__PURE__ */
|
|
255
|
+
h && $ !== null && /* @__PURE__ */ o("span", {
|
|
246
256
|
className: "kapisel__single",
|
|
247
257
|
"aria-hidden": "true",
|
|
248
258
|
children: $
|
|
249
259
|
}),
|
|
250
|
-
h && $ === null &&
|
|
260
|
+
h && $ === null && K.map((e) => /* @__PURE__ */ s("span", {
|
|
251
261
|
className: "kapisel__chip",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ o("span", {
|
|
253
263
|
className: "kapisel__chip-label",
|
|
254
264
|
children: e.label
|
|
255
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ o("button", {
|
|
256
266
|
type: "button",
|
|
257
267
|
tabIndex: -1,
|
|
258
268
|
"data-kapisel-action": !0,
|
|
@@ -260,26 +270,26 @@ var Pe = 6, Fe = [], f = "\0kapisel-all", Ie = (e, t) => `${e} “${t.trim()}”
|
|
|
260
270
|
"aria-label": `${S.remove} ${e.label}`,
|
|
261
271
|
disabled: g,
|
|
262
272
|
hidden: D || void 0,
|
|
263
|
-
onClick: () =>
|
|
264
|
-
children: /* @__PURE__ */
|
|
273
|
+
onClick: () => sn(e.value),
|
|
274
|
+
children: /* @__PURE__ */ o(Re, {
|
|
265
275
|
size: 12,
|
|
266
276
|
strokeWidth: 2.6,
|
|
267
277
|
"aria-hidden": "true"
|
|
268
278
|
})
|
|
269
279
|
})]
|
|
270
280
|
}, e.value)),
|
|
271
|
-
x ? /* @__PURE__ */
|
|
281
|
+
x ? /* @__PURE__ */ s("div", {
|
|
272
282
|
className: "kapisel__inputwrap",
|
|
273
283
|
children: [
|
|
274
|
-
!h &&
|
|
284
|
+
!h && Z && !en && /* @__PURE__ */ o("span", {
|
|
275
285
|
className: "kapisel__single",
|
|
276
286
|
"aria-hidden": "true",
|
|
277
|
-
children: $ ??
|
|
287
|
+
children: $ ?? K[0]?.label
|
|
278
288
|
}),
|
|
279
|
-
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
...
|
|
282
|
-
ref:
|
|
289
|
+
xn,
|
|
290
|
+
/* @__PURE__ */ o("input", {
|
|
291
|
+
...bn,
|
|
292
|
+
ref: Ht,
|
|
283
293
|
type: "text",
|
|
284
294
|
className: "kapisel__input",
|
|
285
295
|
autoComplete: "off",
|
|
@@ -287,91 +297,91 @@ var Pe = 6, Fe = [], f = "\0kapisel-all", Ie = (e, t) => `${e} “${t.trim()}”
|
|
|
287
297
|
disabled: g,
|
|
288
298
|
readOnly: D || void 0,
|
|
289
299
|
value: I,
|
|
290
|
-
onChange: (e) =>
|
|
291
|
-
onKeyDown:
|
|
292
|
-
onBlur:
|
|
300
|
+
onChange: (e) => pn(e.target.value),
|
|
301
|
+
onKeyDown: hn,
|
|
302
|
+
onBlur: gn
|
|
293
303
|
})
|
|
294
304
|
]
|
|
295
|
-
}) : /* @__PURE__ */
|
|
296
|
-
...
|
|
297
|
-
ref:
|
|
305
|
+
}) : /* @__PURE__ */ s("div", {
|
|
306
|
+
...bn,
|
|
307
|
+
ref: Ut,
|
|
298
308
|
className: "kapisel__combo",
|
|
299
309
|
tabIndex: g ? -1 : 0,
|
|
300
|
-
onKeyDown:
|
|
301
|
-
onBlur:
|
|
302
|
-
children: [!h &&
|
|
310
|
+
onKeyDown: hn,
|
|
311
|
+
onBlur: gn,
|
|
312
|
+
children: [!h && Z && /* @__PURE__ */ o("span", {
|
|
303
313
|
className: "kapisel__single",
|
|
304
314
|
"aria-hidden": "true",
|
|
305
|
-
children: $ ??
|
|
306
|
-
}),
|
|
315
|
+
children: $ ?? K[0]?.label
|
|
316
|
+
}), xn]
|
|
307
317
|
})
|
|
308
318
|
]
|
|
309
319
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
id:
|
|
320
|
+
/* @__PURE__ */ o("span", {
|
|
321
|
+
id: Mt,
|
|
312
322
|
className: "kapisel__sr",
|
|
313
|
-
children:
|
|
323
|
+
children: oe(K, bt)
|
|
314
324
|
}),
|
|
315
|
-
|
|
325
|
+
Zt && /* @__PURE__ */ o("span", {
|
|
316
326
|
className: "kapisel__spinner kapi-spinner kapi-spinner--sm",
|
|
317
327
|
"aria-hidden": "true"
|
|
318
328
|
}),
|
|
319
|
-
|
|
329
|
+
tt && Z && !M && !g && !D && /* @__PURE__ */ o("button", {
|
|
320
330
|
type: "button",
|
|
321
331
|
tabIndex: -1,
|
|
322
332
|
"data-kapisel-action": !0,
|
|
323
333
|
className: "kapisel__clear",
|
|
324
334
|
"aria-label": S.clear,
|
|
325
|
-
onClick:
|
|
326
|
-
children: /* @__PURE__ */
|
|
335
|
+
onClick: cn,
|
|
336
|
+
children: /* @__PURE__ */ o(Re, {
|
|
327
337
|
size: 15,
|
|
328
338
|
strokeWidth: 2.4,
|
|
329
339
|
"aria-hidden": "true"
|
|
330
340
|
})
|
|
331
341
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ o("span", {
|
|
333
343
|
className: "kapisel__caret",
|
|
334
344
|
"aria-hidden": "true",
|
|
335
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ o(Le, {
|
|
336
346
|
size: b ? 14 : 17,
|
|
337
347
|
strokeWidth: 2.2
|
|
338
348
|
})
|
|
339
349
|
}),
|
|
340
|
-
v && (h ? N.map((e) => /* @__PURE__ */
|
|
350
|
+
v && (h ? N.map((e) => /* @__PURE__ */ o("input", {
|
|
341
351
|
type: "hidden",
|
|
342
352
|
name: v,
|
|
343
353
|
value: e
|
|
344
|
-
}, e)) : /* @__PURE__ */
|
|
354
|
+
}, e)) : /* @__PURE__ */ o("input", {
|
|
345
355
|
type: "hidden",
|
|
346
356
|
name: v,
|
|
347
357
|
value: M ? "" : j ?? ""
|
|
348
358
|
})),
|
|
349
|
-
|
|
350
|
-
root:
|
|
359
|
+
_n && /* @__PURE__ */ o(Me, {
|
|
360
|
+
root: _n,
|
|
351
361
|
ref: V,
|
|
352
|
-
side:
|
|
353
|
-
hug:
|
|
354
|
-
style:
|
|
355
|
-
listboxId:
|
|
356
|
-
optionId:
|
|
362
|
+
side: ln?.side === "top" ? "top" : "bottom",
|
|
363
|
+
hug: vn,
|
|
364
|
+
style: un,
|
|
365
|
+
listboxId: jt,
|
|
366
|
+
optionId: Nt,
|
|
357
367
|
multiple: h,
|
|
358
368
|
"aria-label": O,
|
|
359
|
-
rows:
|
|
360
|
-
createRow:
|
|
361
|
-
createIndex:
|
|
362
|
-
loading:
|
|
363
|
-
empty:
|
|
364
|
-
message:
|
|
365
|
-
active:
|
|
369
|
+
rows: Qt,
|
|
370
|
+
createRow: $t,
|
|
371
|
+
createIndex: Y.length - 1,
|
|
372
|
+
loading: Xt,
|
|
373
|
+
empty: Y.length === 0,
|
|
374
|
+
message: tn,
|
|
375
|
+
active: X,
|
|
366
376
|
values: N,
|
|
367
|
-
renderOption:
|
|
377
|
+
renderOption: st,
|
|
368
378
|
query: I,
|
|
369
|
-
virtual:
|
|
379
|
+
virtual: yn,
|
|
370
380
|
onHover: R,
|
|
371
|
-
onChoose:
|
|
381
|
+
onChoose: on
|
|
372
382
|
})
|
|
373
383
|
]
|
|
374
384
|
}));
|
|
375
385
|
};
|
|
376
386
|
//#endregion
|
|
377
|
-
export {
|
|
387
|
+
export { He as DEFAULT_SELECT_LABELS, p as KapiSelect, Ve as selectClasses };
|