neatkit 0.16.5 → 0.16.7
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/{Button-ZzJbnjNg.js → Button-Dsr1zrKT.js} +1 -1
- package/dist/{Button-CYFy6sTv.cjs → Button-DyO8fkk1.cjs} +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/{Icon-BHNINDhB.js → Icon-B9-_-fzr.js} +25 -16
- package/dist/{Icon-De6sqmQ9.cjs → Icon-Yl22zVSN.cjs} +1 -1
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +1 -1
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +7 -2
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +26 -26
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +81 -82
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +280 -283
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +21 -21
- package/dist/{Table-WlCsBVHC.js → Table-CURYs469.js} +2 -2
- package/dist/{Table-DEjAMnG3.cjs → Table-DTxKbMgJ.cjs} +1 -1
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/{Tooltip-4RWCnb2Q.js → Tooltip-BuRMZ4p_.js} +35 -35
- package/dist/{Tooltip-B2rZmRCs.cjs → Tooltip-tzVg8Bky.cjs} +1 -1
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/components/Markdown/utils/security.d.ts +2 -2
- package/dist/components/Popover/Popover.d.ts +10 -8
- package/dist/components/Portal/hooks/useDismissableLayer.d.ts +7 -4
- package/dist/components/Select/components/CustomSelect.d.ts +5 -4
- package/dist/components/Select/components/SelectListbox.d.ts +2 -4
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{useFocusTrap-BxPazAL6.js → useFocusTrap-BL3fDmTs.js} +1 -1
- package/dist/{useFocusTrap-CrMcAu8s.cjs → useFocusTrap-C--8mnsI.cjs} +1 -1
- package/dist/usePresence-BYnWctTh.js +232 -0
- package/dist/usePresence-HVr855AK.cjs +1 -0
- package/package.json +1 -1
- package/dist/usePresence-BTRY1_l-.js +0 -212
- package/dist/usePresence-Dm0mls5p.cjs +0 -1
package/dist/Select.js
CHANGED
|
@@ -1,118 +1,118 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { u as
|
|
5
|
-
import { h as
|
|
6
|
-
import { a as
|
|
7
|
-
import { I as
|
|
8
|
-
import { c as
|
|
9
|
-
import { c as Ae, u as
|
|
10
|
-
function
|
|
11
|
-
const { form: n, onReset: a, resetValue:
|
|
12
|
-
return
|
|
13
|
-
var
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
(
|
|
21
|
-
) ??
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
import { jsx as m, jsxs as O } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as P, useEffect as X, useCallback as I, useMemo as ke, useId as xe, useState as j, forwardRef as Ee } from "react";
|
|
4
|
+
import { u as z } from "./effects-DGbA6Q2O.js";
|
|
5
|
+
import { h as se, r as le } from "./aria-Bv-xVREf.js";
|
|
6
|
+
import { a as Re } from "./reference-CXMr27nM.js";
|
|
7
|
+
import { I as W } from "./Icon-B9-_-fzr.js";
|
|
8
|
+
import { c as De, d as Oe, b as Le, P as Ne } from "./usePresence-BYnWctTh.js";
|
|
9
|
+
import { c as Ae, u as Pe } from "./useAnchoredPosition-xI79veB2.js";
|
|
10
|
+
function Te(t) {
|
|
11
|
+
const { form: n, onReset: a, resetValue: r, triggerReference: s } = t, l = P(null);
|
|
12
|
+
return X(() => {
|
|
13
|
+
var c;
|
|
14
|
+
const d = (c = s.current) == null ? void 0 : c.form;
|
|
15
|
+
if (!d) return;
|
|
16
|
+
function i() {
|
|
17
|
+
const h = l.current;
|
|
18
|
+
if (h) {
|
|
19
|
+
const y = Array.from(h.options), g = y.find(
|
|
20
|
+
(p) => p.value === r
|
|
21
|
+
) ?? y[0];
|
|
22
|
+
y.forEach((p) => {
|
|
23
|
+
p.defaultSelected = p === g;
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
a();
|
|
27
27
|
}
|
|
28
|
-
return
|
|
29
|
-
}, [n, a,
|
|
28
|
+
return d.addEventListener("reset", i), () => d.removeEventListener("reset", i);
|
|
29
|
+
}, [n, a, r, s]), l;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
const s = a.bottom - t.bottom -
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
),
|
|
31
|
+
const C = 8, U = 4, Se = 160, He = 72;
|
|
32
|
+
function Me(t, n, a, r = "start") {
|
|
33
|
+
const s = a.bottom - t.bottom - U - C, l = t.top - a.top - U - C, d = s < Se && l > s, i = Math.max(
|
|
34
|
+
He,
|
|
35
|
+
d ? l : s
|
|
36
|
+
), c = Math.max(
|
|
37
37
|
t.width,
|
|
38
38
|
(n == null ? void 0 : n.width) ?? t.width
|
|
39
|
-
),
|
|
40
|
-
|
|
39
|
+
), h = a.left + C, y = Ae(
|
|
40
|
+
r,
|
|
41
41
|
t.left,
|
|
42
42
|
t.width,
|
|
43
|
-
|
|
43
|
+
c
|
|
44
44
|
), g = Math.min(
|
|
45
|
-
Math.max(
|
|
45
|
+
Math.max(h, y),
|
|
46
46
|
Math.max(
|
|
47
|
-
|
|
48
|
-
a.right -
|
|
47
|
+
h,
|
|
48
|
+
a.right - C - c
|
|
49
49
|
)
|
|
50
|
-
),
|
|
51
|
-
a.top +
|
|
52
|
-
t.top -
|
|
53
|
-
) : t.bottom +
|
|
50
|
+
), p = d ? Math.max(
|
|
51
|
+
a.top + C,
|
|
52
|
+
t.top - U - Math.min((n == null ? void 0 : n.height) ?? i, i)
|
|
53
|
+
) : t.bottom + U;
|
|
54
54
|
return {
|
|
55
55
|
left: g,
|
|
56
|
-
maxHeight:
|
|
56
|
+
maxHeight: i,
|
|
57
57
|
minWidth: t.width,
|
|
58
|
-
top:
|
|
58
|
+
top: p
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
(
|
|
64
|
-
const { panelSize:
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
function Ve(t, n, a, r, s = "start") {
|
|
62
|
+
const l = I(
|
|
63
|
+
(d) => {
|
|
64
|
+
const { panelSize: i, triggerBounds: c, visibleBounds: h } = d;
|
|
65
|
+
return Me(
|
|
66
|
+
c,
|
|
67
|
+
i,
|
|
68
|
+
h,
|
|
69
69
|
s
|
|
70
70
|
);
|
|
71
71
|
},
|
|
72
72
|
[s]
|
|
73
73
|
);
|
|
74
|
-
return
|
|
74
|
+
return Pe({
|
|
75
75
|
active: t,
|
|
76
|
-
boundary:
|
|
77
|
-
fit:
|
|
76
|
+
boundary: r,
|
|
77
|
+
fit: l,
|
|
78
78
|
panel: a,
|
|
79
79
|
trigger: n
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
function
|
|
84
|
-
const n =
|
|
85
|
-
return
|
|
86
|
-
const s =
|
|
82
|
+
const Ce = 500;
|
|
83
|
+
function We(t) {
|
|
84
|
+
const n = P(""), a = P(null), r = P(null);
|
|
85
|
+
return X(() => () => {
|
|
86
|
+
const s = r.current;
|
|
87
87
|
s && a.current !== null && s.clearTimeout(a.current);
|
|
88
88
|
}, []), I((s) => {
|
|
89
|
-
var
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
return n.current =
|
|
89
|
+
var c;
|
|
90
|
+
const l = (c = t.current) == null ? void 0 : c.ownerDocument.defaultView;
|
|
91
|
+
if (!l) return null;
|
|
92
|
+
r.current = l;
|
|
93
|
+
const d = n.current + s, i = Array.from(d).every((h) => h === s);
|
|
94
|
+
return n.current = i ? s : d, a.current !== null && l.clearTimeout(a.current), a.current = l.setTimeout(() => {
|
|
95
95
|
n.current = "", a.current = null;
|
|
96
|
-
},
|
|
96
|
+
}, Ce), n.current;
|
|
97
97
|
}, [t]);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Z(t, n, a) {
|
|
100
100
|
if (t.length === 0) return -1;
|
|
101
|
-
for (let
|
|
102
|
-
const s = (n + a *
|
|
101
|
+
for (let r = 1; r <= t.length; r += 1) {
|
|
102
|
+
const s = (n + a * r + t.length) % t.length;
|
|
103
103
|
if (!t[s].disabled) return s;
|
|
104
104
|
}
|
|
105
105
|
return -1;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
for (let
|
|
109
|
-
const s = (a +
|
|
110
|
-
if (!
|
|
107
|
+
function $e(t, n, a) {
|
|
108
|
+
for (let r = 1; r <= t.length; r += 1) {
|
|
109
|
+
const s = (a + r + t.length) % t.length, l = t[s];
|
|
110
|
+
if (!l.disabled && l.label.toLocaleLowerCase().startsWith(n))
|
|
111
111
|
return s;
|
|
112
112
|
}
|
|
113
113
|
return -1;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Ge(t) {
|
|
116
116
|
const n = /* @__PURE__ */ new Set();
|
|
117
117
|
t.forEach((a) => {
|
|
118
118
|
if (n.has(a.value))
|
|
@@ -120,282 +120,280 @@ function Ke(t) {
|
|
|
120
120
|
n.add(a.value);
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Ke(t) {
|
|
124
124
|
const {
|
|
125
125
|
active: n,
|
|
126
126
|
align: a,
|
|
127
|
-
closeOnEscape: i,
|
|
128
|
-
closeOnOutsideInteraction: s,
|
|
129
127
|
highlightedIndex: r,
|
|
130
|
-
id:
|
|
128
|
+
id: s,
|
|
131
129
|
listboxReference: l,
|
|
132
130
|
onEscapeDismiss: d,
|
|
133
|
-
onEscapeKeyDown:
|
|
134
|
-
onHighlight:
|
|
135
|
-
onOutsideDismiss:
|
|
131
|
+
onEscapeKeyDown: i,
|
|
132
|
+
onHighlight: c,
|
|
133
|
+
onOutsideDismiss: h,
|
|
136
134
|
onPointerDownOutside: y,
|
|
137
|
-
onSelect:
|
|
138
|
-
options:
|
|
139
|
-
ownerDocument:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
[
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
135
|
+
onSelect: g,
|
|
136
|
+
options: p,
|
|
137
|
+
ownerDocument: R,
|
|
138
|
+
persistent: Y,
|
|
139
|
+
position: w,
|
|
140
|
+
selectedValue: k,
|
|
141
|
+
state: B,
|
|
142
|
+
triggerReference: f
|
|
143
|
+
} = t, $ = P(null), T = z("Select").boundaryElement, D = De(!0, T), G = ke(
|
|
144
|
+
() => [f, $],
|
|
145
|
+
[f]
|
|
146
|
+
), K = I(
|
|
147
|
+
(u) => {
|
|
148
|
+
$.current = u, l(u);
|
|
150
149
|
},
|
|
151
150
|
[l]
|
|
152
151
|
);
|
|
153
|
-
return
|
|
152
|
+
return Oe({
|
|
154
153
|
active: n,
|
|
155
|
-
boundaries:
|
|
156
|
-
boundary:
|
|
157
|
-
dismissOnEscape:
|
|
158
|
-
|
|
154
|
+
boundaries: G,
|
|
155
|
+
boundary: T,
|
|
156
|
+
dismissOnEscape: !0,
|
|
157
|
+
dismissOnOutsideInteraction: Y ? "none" : "pass-through",
|
|
159
158
|
layerId: D.id,
|
|
160
159
|
onEscapeDismiss: d,
|
|
161
|
-
onEscapeKeyDown:
|
|
160
|
+
onEscapeKeyDown: i,
|
|
161
|
+
onOutsideDismiss: h,
|
|
162
162
|
onPointerDownOutside: y,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}), /* @__PURE__ */ h(
|
|
163
|
+
ownerDocument: R
|
|
164
|
+
}), /* @__PURE__ */ m(
|
|
166
165
|
"div",
|
|
167
166
|
{
|
|
168
167
|
"aria-hidden": n ? void 0 : !0,
|
|
169
|
-
"aria-labelledby":
|
|
168
|
+
"aria-labelledby": s,
|
|
170
169
|
className: "nk-select__listbox",
|
|
171
170
|
"data-align": a,
|
|
172
|
-
"data-state":
|
|
173
|
-
id: `${
|
|
174
|
-
ref:
|
|
171
|
+
"data-state": B,
|
|
172
|
+
id: `${s}-listbox`,
|
|
173
|
+
ref: K,
|
|
175
174
|
role: "listbox",
|
|
176
|
-
style:
|
|
177
|
-
left:
|
|
178
|
-
maxHeight:
|
|
179
|
-
minWidth:
|
|
180
|
-
top:
|
|
175
|
+
style: w ? {
|
|
176
|
+
left: w.left,
|
|
177
|
+
maxHeight: w.maxHeight,
|
|
178
|
+
minWidth: w.minWidth,
|
|
179
|
+
top: w.top,
|
|
181
180
|
zIndex: D.zIndex
|
|
182
181
|
} : { visibility: "hidden", zIndex: D.zIndex },
|
|
183
|
-
children:
|
|
182
|
+
children: p.map((u, S) => /* @__PURE__ */ O(
|
|
184
183
|
"div",
|
|
185
184
|
{
|
|
186
|
-
"aria-disabled":
|
|
187
|
-
"aria-selected":
|
|
185
|
+
"aria-disabled": u.disabled || void 0,
|
|
186
|
+
"aria-selected": u.value === k,
|
|
188
187
|
className: "nk-select__option",
|
|
189
|
-
"data-highlighted":
|
|
190
|
-
"data-selected":
|
|
191
|
-
id: `${
|
|
192
|
-
onPointerDown: (
|
|
193
|
-
|
|
188
|
+
"data-highlighted": S === r || void 0,
|
|
189
|
+
"data-selected": u.value === k || void 0,
|
|
190
|
+
id: `${s}-option-${S}`,
|
|
191
|
+
onPointerDown: (Q) => {
|
|
192
|
+
Q.preventDefault(), u.disabled || g(u);
|
|
194
193
|
},
|
|
195
194
|
onPointerMove: () => {
|
|
196
|
-
|
|
195
|
+
u.disabled || c(S);
|
|
197
196
|
},
|
|
198
197
|
role: "option",
|
|
199
198
|
children: [
|
|
200
|
-
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
199
|
+
u.icon ? /* @__PURE__ */ m(W, { type: u.icon }) : null,
|
|
200
|
+
/* @__PURE__ */ m("span", { className: "nk-select__option-label", children: u.label }),
|
|
201
|
+
u.value === k ? /* @__PURE__ */ m(W, { className: "nk-select__check", type: "checkmark" }) : null
|
|
203
202
|
]
|
|
204
203
|
},
|
|
205
|
-
|
|
204
|
+
u.value
|
|
206
205
|
))
|
|
207
206
|
}
|
|
208
207
|
);
|
|
209
208
|
}
|
|
210
|
-
function
|
|
211
|
-
n.current = t,
|
|
209
|
+
function qe(t, n, a) {
|
|
210
|
+
n.current = t, Re(a, t);
|
|
212
211
|
}
|
|
213
|
-
function
|
|
214
|
-
var
|
|
212
|
+
function Fe(t) {
|
|
213
|
+
var ne;
|
|
215
214
|
const {
|
|
216
215
|
"aria-invalid": n,
|
|
217
216
|
align: a = "start",
|
|
218
|
-
className:
|
|
219
|
-
|
|
220
|
-
closeOnOutsideInteraction: r = !0,
|
|
221
|
-
defaultValue: c = "",
|
|
217
|
+
className: r,
|
|
218
|
+
defaultValue: s = "",
|
|
222
219
|
disabled: l = !1,
|
|
223
220
|
displayOverride: d,
|
|
224
|
-
form:
|
|
225
|
-
forwardedReference:
|
|
226
|
-
id:
|
|
221
|
+
form: i,
|
|
222
|
+
forwardedReference: c,
|
|
223
|
+
id: h,
|
|
227
224
|
invalid: y = !1,
|
|
228
|
-
name:
|
|
229
|
-
onChange:
|
|
230
|
-
onClick:
|
|
231
|
-
onEscapeKeyDown:
|
|
232
|
-
onKeyDown:
|
|
233
|
-
onOpenChange:
|
|
234
|
-
onPointerDownOutside:
|
|
235
|
-
options:
|
|
236
|
-
placeholder:
|
|
225
|
+
name: g,
|
|
226
|
+
onChange: p,
|
|
227
|
+
onClick: R,
|
|
228
|
+
onEscapeKeyDown: Y,
|
|
229
|
+
onKeyDown: w,
|
|
230
|
+
onOpenChange: k,
|
|
231
|
+
onPointerDownOutside: B,
|
|
232
|
+
options: f,
|
|
233
|
+
placeholder: $,
|
|
234
|
+
persistent: T = !1,
|
|
237
235
|
required: D = !1,
|
|
238
|
-
style:
|
|
239
|
-
value:
|
|
240
|
-
width:
|
|
241
|
-
...
|
|
236
|
+
style: G,
|
|
237
|
+
value: K,
|
|
238
|
+
width: u,
|
|
239
|
+
...S
|
|
242
240
|
} = t;
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
(e) => e.value ===
|
|
246
|
-
),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
241
|
+
Ge(f);
|
|
242
|
+
const Q = xe(), L = h ?? Q, _ = P(null), [H, oe] = j(null), [v, re] = j(!1), [x, M] = j(-1), [ie, ee] = j(s), N = K !== void 0, A = N ? K : ie, ce = f.find(
|
|
243
|
+
(e) => e.value === A
|
|
244
|
+
), de = y || se(n), ue = le(y, n), J = Le(v), V = ((ne = _.current) == null ? void 0 : ne.ownerDocument) ?? (typeof document > "u" ? null : document), fe = z("Select").boundaryElement, me = Ve(
|
|
245
|
+
J.present,
|
|
246
|
+
_.current,
|
|
247
|
+
H,
|
|
248
|
+
fe,
|
|
251
249
|
a
|
|
252
|
-
),
|
|
253
|
-
(e) =>
|
|
250
|
+
), he = We(_), pe = u === void 0 ? G : { ...G, width: u }, q = d ?? ce, ve = I(
|
|
251
|
+
(e) => qe(
|
|
254
252
|
e,
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
_,
|
|
254
|
+
c
|
|
257
255
|
),
|
|
258
|
-
[
|
|
259
|
-
),
|
|
260
|
-
|
|
261
|
-
}, [
|
|
262
|
-
|
|
263
|
-
}, [
|
|
264
|
-
form:
|
|
265
|
-
onReset:
|
|
266
|
-
resetValue:
|
|
267
|
-
triggerReference:
|
|
268
|
-
}),
|
|
269
|
-
const o =
|
|
270
|
-
(
|
|
271
|
-
),
|
|
272
|
-
|
|
273
|
-
o >= 0 ? o :
|
|
274
|
-
),
|
|
275
|
-
}, [
|
|
256
|
+
[c]
|
|
257
|
+
), b = I((e) => {
|
|
258
|
+
v !== e && (re(e), k == null || k(e));
|
|
259
|
+
}, [k, v]), be = I(() => {
|
|
260
|
+
N || ee(s), b(!1);
|
|
261
|
+
}, [s, N, b]), ye = Te({
|
|
262
|
+
form: i,
|
|
263
|
+
onReset: be,
|
|
264
|
+
resetValue: N ? A : s,
|
|
265
|
+
triggerReference: _
|
|
266
|
+
}), F = I((e = 1) => {
|
|
267
|
+
const o = f.findIndex(
|
|
268
|
+
(ae) => ae.value === A && !ae.disabled
|
|
269
|
+
), E = e === 1 ? -1 : f.length;
|
|
270
|
+
M(
|
|
271
|
+
o >= 0 ? o : Z(f, E, e)
|
|
272
|
+
), b(!0);
|
|
273
|
+
}, [f, A, b]), te = I((e) => {
|
|
276
274
|
var o;
|
|
277
|
-
l || e.disabled || (
|
|
278
|
-
}, [l,
|
|
275
|
+
l || e.disabled || (N || ee(e.value), b(!1), (o = _.current) == null || o.focus(), p == null || p(e.value));
|
|
276
|
+
}, [l, N, p, b]), ge = I(() => {
|
|
279
277
|
var e;
|
|
280
|
-
|
|
281
|
-
}, [
|
|
282
|
-
|
|
283
|
-
}, [
|
|
284
|
-
function
|
|
285
|
-
|
|
278
|
+
b(!1), (e = _.current) == null || e.focus();
|
|
279
|
+
}, [b]), Ie = I(() => {
|
|
280
|
+
b(!1);
|
|
281
|
+
}, [b]);
|
|
282
|
+
function we(e) {
|
|
283
|
+
R == null || R(e), !(e.defaultPrevented || l) && (v ? b(!1) : F());
|
|
286
284
|
}
|
|
287
|
-
function
|
|
288
|
-
if (
|
|
285
|
+
function _e(e) {
|
|
286
|
+
if (w == null || w(e), !(e.defaultPrevented || l)) {
|
|
289
287
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
290
288
|
e.preventDefault();
|
|
291
289
|
const o = e.key === "ArrowDown" ? 1 : -1;
|
|
292
|
-
|
|
293
|
-
(
|
|
294
|
-
) :
|
|
290
|
+
v ? M(
|
|
291
|
+
(E) => Z(f, E, o)
|
|
292
|
+
) : F(o);
|
|
295
293
|
return;
|
|
296
294
|
}
|
|
297
295
|
if (e.key === "Home" || e.key === "End") {
|
|
298
|
-
if (e.preventDefault(), !
|
|
296
|
+
if (e.preventDefault(), !v) F(e.key === "Home" ? 1 : -1);
|
|
299
297
|
else {
|
|
300
|
-
const o = e.key === "Home" ? 1 : -1,
|
|
301
|
-
|
|
302
|
-
|
|
298
|
+
const o = e.key === "Home" ? 1 : -1, E = o === 1 ? -1 : f.length;
|
|
299
|
+
M(
|
|
300
|
+
Z(f, E, o)
|
|
303
301
|
);
|
|
304
302
|
}
|
|
305
303
|
return;
|
|
306
304
|
}
|
|
307
305
|
if (e.key === "Enter" || e.key === " ") {
|
|
308
306
|
e.preventDefault();
|
|
309
|
-
const o =
|
|
310
|
-
|
|
307
|
+
const o = f[x];
|
|
308
|
+
v && o ? te(o) : v || F();
|
|
311
309
|
return;
|
|
312
310
|
}
|
|
313
311
|
if (e.key === "Tab") {
|
|
314
|
-
|
|
312
|
+
T || b(!1);
|
|
315
313
|
return;
|
|
316
314
|
}
|
|
317
315
|
if (e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
|
|
318
|
-
const o =
|
|
316
|
+
const o = he(e.key.toLocaleLowerCase());
|
|
319
317
|
if (o === null) return;
|
|
320
|
-
const
|
|
321
|
-
|
|
318
|
+
const E = $e(
|
|
319
|
+
f,
|
|
322
320
|
o,
|
|
323
|
-
|
|
321
|
+
x
|
|
324
322
|
);
|
|
325
|
-
|
|
323
|
+
E >= 0 && (e.preventDefault(), v || b(!0), M(E));
|
|
326
324
|
}
|
|
327
325
|
}
|
|
328
326
|
}
|
|
329
|
-
return
|
|
330
|
-
l &&
|
|
331
|
-
}, [l,
|
|
327
|
+
return X(() => {
|
|
328
|
+
l && b(!1);
|
|
329
|
+
}, [l, b]), X(() => {
|
|
332
330
|
var e;
|
|
333
|
-
if (
|
|
334
|
-
const o =
|
|
335
|
-
`${
|
|
331
|
+
if (v && x >= 0) {
|
|
332
|
+
const o = V == null ? void 0 : V.getElementById(
|
|
333
|
+
`${L}-option-${x}`
|
|
336
334
|
);
|
|
337
|
-
o && (
|
|
335
|
+
o && (H != null && H.contains(o)) && ((e = o.scrollIntoView) == null || e.call(o, { block: "nearest" }));
|
|
338
336
|
}
|
|
339
|
-
}, [
|
|
337
|
+
}, [x, L, H, v]), /* @__PURE__ */ O(
|
|
340
338
|
"span",
|
|
341
339
|
{
|
|
342
|
-
className: ["nk-select",
|
|
340
|
+
className: ["nk-select", r].filter(Boolean).join(" "),
|
|
343
341
|
"data-disabled": l || void 0,
|
|
344
|
-
"data-invalid":
|
|
342
|
+
"data-invalid": de || void 0,
|
|
345
343
|
"data-mode": "custom",
|
|
346
|
-
"data-open":
|
|
347
|
-
style:
|
|
344
|
+
"data-open": v || void 0,
|
|
345
|
+
style: pe,
|
|
348
346
|
children: [
|
|
349
347
|
/* @__PURE__ */ O(
|
|
350
348
|
"button",
|
|
351
349
|
{
|
|
352
|
-
...
|
|
353
|
-
ref:
|
|
354
|
-
"aria-activedescendant":
|
|
355
|
-
"aria-controls": `${
|
|
356
|
-
"aria-expanded":
|
|
350
|
+
...S,
|
|
351
|
+
ref: ve,
|
|
352
|
+
"aria-activedescendant": v && x >= 0 ? `${L}-option-${x}` : void 0,
|
|
353
|
+
"aria-controls": `${L}-listbox`,
|
|
354
|
+
"aria-expanded": v,
|
|
357
355
|
"aria-haspopup": "listbox",
|
|
358
|
-
"aria-invalid":
|
|
356
|
+
"aria-invalid": ue,
|
|
359
357
|
"aria-required": D || void 0,
|
|
360
358
|
"aria-autocomplete": "none",
|
|
361
359
|
className: "nk-select__trigger",
|
|
362
360
|
disabled: l,
|
|
363
|
-
form:
|
|
364
|
-
id:
|
|
365
|
-
onClick:
|
|
366
|
-
onKeyDown:
|
|
361
|
+
form: i,
|
|
362
|
+
id: L,
|
|
363
|
+
onClick: we,
|
|
364
|
+
onKeyDown: _e,
|
|
367
365
|
role: "combobox",
|
|
368
366
|
type: "button",
|
|
369
367
|
children: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
] }) : /* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
368
|
+
q ? /* @__PURE__ */ O("span", { className: "nk-select__value", children: [
|
|
369
|
+
q.icon ? /* @__PURE__ */ m(W, { type: q.icon }) : null,
|
|
370
|
+
/* @__PURE__ */ m("span", { className: "nk-select__value-label", children: q.label })
|
|
371
|
+
] }) : /* @__PURE__ */ m("span", { className: "nk-select__placeholder", children: $ }),
|
|
372
|
+
/* @__PURE__ */ m(W, { className: "nk-select__icon", type: "chevron-down" })
|
|
375
373
|
]
|
|
376
374
|
}
|
|
377
375
|
),
|
|
378
|
-
|
|
376
|
+
g || D ? /* @__PURE__ */ O(
|
|
379
377
|
"select",
|
|
380
378
|
{
|
|
381
|
-
ref:
|
|
379
|
+
ref: ye,
|
|
382
380
|
"aria-hidden": "true",
|
|
383
381
|
className: "nk-select__form-control",
|
|
384
382
|
disabled: l,
|
|
385
|
-
form:
|
|
386
|
-
name:
|
|
383
|
+
form: i,
|
|
384
|
+
name: g,
|
|
387
385
|
onChange: () => {
|
|
388
386
|
},
|
|
389
387
|
onInvalid: (e) => {
|
|
390
388
|
var o;
|
|
391
|
-
e.preventDefault(), (o =
|
|
389
|
+
e.preventDefault(), (o = _.current) == null || o.focus();
|
|
392
390
|
},
|
|
393
391
|
required: D,
|
|
394
392
|
tabIndex: -1,
|
|
395
|
-
value:
|
|
393
|
+
value: A,
|
|
396
394
|
children: [
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
|
|
395
|
+
/* @__PURE__ */ m("option", { value: "" }),
|
|
396
|
+
f.map((e) => /* @__PURE__ */ m(
|
|
399
397
|
"option",
|
|
400
398
|
{
|
|
401
399
|
disabled: e.disabled,
|
|
@@ -407,88 +405,87 @@ function je(t) {
|
|
|
407
405
|
]
|
|
408
406
|
}
|
|
409
407
|
) : null,
|
|
410
|
-
|
|
411
|
-
|
|
408
|
+
J.present && V ? /* @__PURE__ */ m(Ne, { children: /* @__PURE__ */ m(
|
|
409
|
+
Ke,
|
|
412
410
|
{
|
|
413
|
-
active:
|
|
411
|
+
active: v,
|
|
414
412
|
align: a,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
id: P,
|
|
419
|
-
listboxReference: ie,
|
|
413
|
+
highlightedIndex: x,
|
|
414
|
+
id: L,
|
|
415
|
+
listboxReference: oe,
|
|
420
416
|
onEscapeDismiss: ge,
|
|
421
|
-
onEscapeKeyDown:
|
|
422
|
-
onHighlight:
|
|
423
|
-
onOutsideDismiss:
|
|
424
|
-
onPointerDownOutside:
|
|
425
|
-
onSelect:
|
|
426
|
-
options:
|
|
427
|
-
ownerDocument:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
417
|
+
onEscapeKeyDown: Y,
|
|
418
|
+
onHighlight: M,
|
|
419
|
+
onOutsideDismiss: Ie,
|
|
420
|
+
onPointerDownOutside: B,
|
|
421
|
+
onSelect: te,
|
|
422
|
+
options: f,
|
|
423
|
+
ownerDocument: V,
|
|
424
|
+
persistent: T,
|
|
425
|
+
position: me,
|
|
426
|
+
selectedValue: A,
|
|
427
|
+
state: J.state === "closing" ? "closing" : "open",
|
|
428
|
+
triggerReference: _
|
|
432
429
|
}
|
|
433
430
|
) }) : null
|
|
434
431
|
]
|
|
435
432
|
}
|
|
436
433
|
);
|
|
437
434
|
}
|
|
438
|
-
function
|
|
435
|
+
function je(t) {
|
|
439
436
|
const {
|
|
440
437
|
"aria-invalid": n,
|
|
441
438
|
children: a,
|
|
442
|
-
className:
|
|
439
|
+
className: r,
|
|
443
440
|
defaultValue: s,
|
|
444
|
-
disabled:
|
|
445
|
-
forwardedReference:
|
|
446
|
-
invalid:
|
|
447
|
-
placeholder:
|
|
448
|
-
style:
|
|
449
|
-
value:
|
|
441
|
+
disabled: l = !1,
|
|
442
|
+
forwardedReference: d,
|
|
443
|
+
invalid: i = !1,
|
|
444
|
+
placeholder: c,
|
|
445
|
+
style: h,
|
|
446
|
+
value: y,
|
|
450
447
|
...g
|
|
451
|
-
} = t,
|
|
448
|
+
} = t, p = le(i, n), R = i || se(n);
|
|
452
449
|
return /* @__PURE__ */ O(
|
|
453
450
|
"span",
|
|
454
451
|
{
|
|
455
|
-
className: ["nk-select",
|
|
456
|
-
"data-disabled":
|
|
452
|
+
className: ["nk-select", r].filter(Boolean).join(" "),
|
|
453
|
+
"data-disabled": l || void 0,
|
|
457
454
|
"data-invalid": R || void 0,
|
|
458
455
|
"data-mode": "native",
|
|
459
|
-
style:
|
|
456
|
+
style: h,
|
|
460
457
|
children: [
|
|
461
458
|
/* @__PURE__ */ O(
|
|
462
459
|
"select",
|
|
463
460
|
{
|
|
464
461
|
...g,
|
|
465
|
-
ref:
|
|
466
|
-
"aria-invalid":
|
|
462
|
+
ref: d,
|
|
463
|
+
"aria-invalid": p,
|
|
467
464
|
className: "nk-select__control",
|
|
468
|
-
defaultValue:
|
|
469
|
-
disabled:
|
|
470
|
-
value:
|
|
465
|
+
defaultValue: y === void 0 ? s ?? (c !== void 0 ? "" : void 0) : void 0,
|
|
466
|
+
disabled: l,
|
|
467
|
+
value: y,
|
|
471
468
|
children: [
|
|
472
|
-
|
|
469
|
+
c !== void 0 ? /* @__PURE__ */ m("option", { disabled: !0, value: "", children: c }) : null,
|
|
473
470
|
a
|
|
474
471
|
]
|
|
475
472
|
}
|
|
476
473
|
),
|
|
477
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ m(W, { className: "nk-select__icon", type: "chevron-down" })
|
|
478
475
|
]
|
|
479
476
|
}
|
|
480
477
|
);
|
|
481
478
|
}
|
|
482
|
-
const
|
|
483
|
-
const { options:
|
|
484
|
-
return
|
|
485
|
-
|
|
479
|
+
const et = Ee(function(n, a) {
|
|
480
|
+
const { options: r } = n;
|
|
481
|
+
return z("Select"), r !== void 0 ? /* @__PURE__ */ m(
|
|
482
|
+
Fe,
|
|
486
483
|
{
|
|
487
484
|
...n,
|
|
488
485
|
forwardedReference: a
|
|
489
486
|
}
|
|
490
|
-
) : /* @__PURE__ */
|
|
491
|
-
|
|
487
|
+
) : /* @__PURE__ */ m(
|
|
488
|
+
je,
|
|
492
489
|
{
|
|
493
490
|
...n,
|
|
494
491
|
forwardedReference: a
|
|
@@ -496,5 +493,5 @@ const tt = De(function(n, a) {
|
|
|
496
493
|
);
|
|
497
494
|
});
|
|
498
495
|
export {
|
|
499
|
-
|
|
496
|
+
et as default
|
|
500
497
|
};
|