@bioturing/components 0.46.2 → 0.46.3
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/combobox/component.d.ts +2 -120
- package/dist/components/combobox/component.d.ts.map +1 -1
- package/dist/components/combobox/component.js +224 -253
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/types.d.ts +121 -0
- package/dist/components/combobox/types.d.ts.map +1 -0
- package/dist/components/combobox/use-combobox-token-input.d.ts +25 -0
- package/dist/components/combobox/use-combobox-token-input.d.ts.map +1 -0
- package/dist/components/combobox/use-combobox-token-input.js +52 -0
- package/dist/components/combobox/use-combobox-token-input.js.map +1 -0
- package/dist/components/combobox/utils.d.ts +7 -0
- package/dist/components/combobox/utils.d.ts.map +1 -1
- package/dist/components/combobox/utils.js +26 -5
- package/dist/components/combobox/utils.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1,366 +1,337 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import { Combobox as
|
|
4
|
-
import
|
|
5
|
-
import { FormItemInputContext as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { BaseMenu as
|
|
2
|
+
import { jsx as t, jsxs as g, Fragment as ne } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as r } from "@base-ui/react/combobox";
|
|
4
|
+
import Re from "antd/es/config-provider/DisabledContext";
|
|
5
|
+
import { FormItemInputContext as Te } from "antd/es/form/context";
|
|
6
|
+
import { forwardRef as Se, useRef as ke, useContext as re, useCallback as v, useMemo as y, useState as De } from "react";
|
|
7
|
+
import { BaseMenu as M } from "../base-menu/index.js";
|
|
8
8
|
import { XIcon as Me } from "@bioturing/assets";
|
|
9
|
-
import { splitBySeparators as
|
|
9
|
+
import { splitBySeparators as Ve } from "./utils.js";
|
|
10
|
+
import { useComboboxTokenInput as Fe } from "./use-combobox-token-input.js";
|
|
10
11
|
import './style.css';/* empty css */
|
|
11
|
-
import { SelectTrigger as
|
|
12
|
-
import { BaseMenuItem as
|
|
13
|
-
import { Empty as
|
|
14
|
-
import { useControlledState as
|
|
15
|
-
import { useCls as
|
|
16
|
-
import { clsx as
|
|
17
|
-
import { reactNodeToString as
|
|
18
|
-
import { ScrollArea as
|
|
19
|
-
const
|
|
20
|
-
options:
|
|
21
|
-
value:
|
|
22
|
-
defaultValue:
|
|
23
|
-
onChange:
|
|
24
|
-
placeholder:
|
|
25
|
-
disabled:
|
|
26
|
-
status:
|
|
27
|
-
allowClear:
|
|
28
|
-
multiple:
|
|
29
|
-
showSearch:
|
|
30
|
-
open:
|
|
12
|
+
import { SelectTrigger as p } from "../select-trigger/component.js";
|
|
13
|
+
import { BaseMenuItem as se } from "../base-menu/item.js";
|
|
14
|
+
import { Empty as Oe } from "../empty/component.js";
|
|
15
|
+
import { useControlledState as ce } from "../hooks/useControlledState.js";
|
|
16
|
+
import { useCls as $e } from "../utils/antdUtils.js";
|
|
17
|
+
import { clsx as l } from "../utils/cn.js";
|
|
18
|
+
import { reactNodeToString as le } from "../utils/reactToString.js";
|
|
19
|
+
import { ScrollArea as Be } from "../scroll-area/component.js";
|
|
20
|
+
const Le = (s) => /* @__PURE__ */ t(M.Root, { ...s }), Pe = (s) => /* @__PURE__ */ t(M.Popup, { ...s }), je = (s) => /* @__PURE__ */ t(M.Divider, { ...s }), Ee = (s) => /* @__PURE__ */ t(M.List, { ...s }), Ke = ({
|
|
21
|
+
options: s = [],
|
|
22
|
+
value: ae,
|
|
23
|
+
defaultValue: K,
|
|
24
|
+
onChange: V,
|
|
25
|
+
placeholder: w = "Select...",
|
|
26
|
+
disabled: ie = !1,
|
|
27
|
+
status: de,
|
|
28
|
+
allowClear: W = !1,
|
|
29
|
+
multiple: n = !1,
|
|
30
|
+
showSearch: He = !0,
|
|
31
|
+
open: me,
|
|
31
32
|
onOpenChange: he,
|
|
32
|
-
className:
|
|
33
|
-
classNames:
|
|
34
|
-
size:
|
|
35
|
-
optionRender:
|
|
36
|
-
onSearch:
|
|
37
|
-
clearIcon:
|
|
38
|
-
suffixIcon:
|
|
39
|
-
placement:
|
|
33
|
+
className: ue,
|
|
34
|
+
classNames: b,
|
|
35
|
+
size: F = "middle",
|
|
36
|
+
optionRender: H,
|
|
37
|
+
onSearch: O,
|
|
38
|
+
clearIcon: Q,
|
|
39
|
+
suffixIcon: U,
|
|
40
|
+
placement: A = "bottomLeft",
|
|
40
41
|
// showSelectionSummary: _showSelectionSummary = false,
|
|
41
42
|
// selectionSummaryRender,
|
|
42
|
-
showSelectAll:
|
|
43
|
-
optionLabelRender:
|
|
44
|
-
getOptionKeywords:
|
|
45
|
-
String(
|
|
46
|
-
|
|
43
|
+
showSelectAll: X = !1,
|
|
44
|
+
optionLabelRender: R,
|
|
45
|
+
getOptionKeywords: G = (u) => [
|
|
46
|
+
String(u.value),
|
|
47
|
+
le(u.label)
|
|
47
48
|
],
|
|
48
|
-
popupMatchSelectWidth:
|
|
49
|
-
addOnEnter:
|
|
50
|
-
tokenSeparators:
|
|
51
|
-
autoHighlight:
|
|
52
|
-
filterOption:
|
|
53
|
-
...
|
|
54
|
-
},
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
), [
|
|
49
|
+
popupMatchSelectWidth: be = !0,
|
|
50
|
+
addOnEnter: $ = !1,
|
|
51
|
+
tokenSeparators: C,
|
|
52
|
+
autoHighlight: B = !0,
|
|
53
|
+
filterOption: T,
|
|
54
|
+
...fe
|
|
55
|
+
}, ge) => {
|
|
56
|
+
const [u, J] = ce(
|
|
57
|
+
ae,
|
|
58
|
+
V,
|
|
59
|
+
K !== void 0 ? K : n ? [] : void 0
|
|
60
|
+
), [L, S] = ce(me, he, !1), c = $e(), P = ke(null), { status: pe } = re(Te), Ce = re(Re), k = de || pe, I = ie || Ce, m = v(
|
|
60
61
|
(e) => {
|
|
61
|
-
|
|
62
|
+
J(e), V?.(e);
|
|
62
63
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
if (
|
|
66
|
-
const e =
|
|
67
|
-
|
|
64
|
+
[J, V]
|
|
65
|
+
), Y = v(() => {
|
|
66
|
+
if (n) {
|
|
67
|
+
const e = s.map((o) => o.value);
|
|
68
|
+
m(e);
|
|
68
69
|
}
|
|
69
|
-
}, [
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
}, [
|
|
70
|
+
}, [n, s, m]), Z = v(() => {
|
|
71
|
+
n && m([]);
|
|
72
|
+
}, [n, m]), _ = v(() => {
|
|
73
|
+
m(n ? [] : void 0);
|
|
74
|
+
}, [n, m]), h = y(() => Array.isArray(u) ? u : u ? [u] : [], [u]), i = y(() => {
|
|
74
75
|
const e = /* @__PURE__ */ new Map();
|
|
75
|
-
for (const o of
|
|
76
|
+
for (const o of s)
|
|
76
77
|
e.set(o.value, o);
|
|
77
78
|
return e;
|
|
78
|
-
}, [
|
|
79
|
-
if (!
|
|
79
|
+
}, [s]), D = y(() => {
|
|
80
|
+
if (!X || !n || s.length === 0)
|
|
80
81
|
return null;
|
|
81
|
-
const e =
|
|
82
|
+
const e = h.filter((d) => i.has(d)), o = e.length === s.length && s.length > 0, a = e.length > 0 && e.length < s.length;
|
|
82
83
|
return {
|
|
83
84
|
checked: o,
|
|
84
|
-
indeterminate:
|
|
85
|
+
indeterminate: a,
|
|
85
86
|
onToggle: () => {
|
|
86
|
-
|
|
87
|
+
a || o ? Z() : Y();
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
}, [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
),
|
|
90
|
+
}, [X, n, s, i, h, Z, Y]), xe = y(() => s.map((e) => e.value), [s]), z = y(() => n ? h.length > 0 ? `${h.length} item${h.length === 1 ? "" : "s"} selected` : null : i.get(h[0])?.label || null, [n, h, i]), q = l(
|
|
91
|
+
c("combobox-input"),
|
|
92
|
+
c(`combobox-input-${F}`),
|
|
93
|
+
k && c(`combobox-input-${k}`),
|
|
94
|
+
b?.input
|
|
95
|
+
), ve = v(
|
|
95
96
|
(e) => {
|
|
96
|
-
const o =
|
|
97
|
-
return
|
|
97
|
+
const o = i.get(e);
|
|
98
|
+
return le(o?.label || String(e));
|
|
98
99
|
},
|
|
99
|
-
[
|
|
100
|
-
), [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
[d]
|
|
113
|
-
), ne = x(
|
|
114
|
-
(e) => {
|
|
115
|
-
if (!L || !e.trim()) return !1;
|
|
116
|
-
const o = r && m && m.length > 0 ? le(e, m) : [e.trim()], n = [];
|
|
117
|
-
for (const s of o) {
|
|
118
|
-
const u = te(s);
|
|
119
|
-
u && !u.disabled && n.push(u.value);
|
|
120
|
-
}
|
|
121
|
-
if (n.length === 0) return !1;
|
|
122
|
-
if (r) {
|
|
123
|
-
const s = Array.isArray(h) ? [...h] : [], u = [.../* @__PURE__ */ new Set([...s, ...n])];
|
|
124
|
-
f(u);
|
|
125
|
-
} else
|
|
126
|
-
f(n[0]), y(!1);
|
|
127
|
-
return !0;
|
|
128
|
-
},
|
|
129
|
-
[
|
|
130
|
-
L,
|
|
131
|
-
r,
|
|
132
|
-
m,
|
|
133
|
-
te,
|
|
134
|
-
h,
|
|
135
|
-
f,
|
|
136
|
-
y
|
|
137
|
-
]
|
|
138
|
-
), Ae = w(() => !m || m.length === 0 ? !1 : m.some((e) => N.includes(e)), [N, m]), Ne = r ? S && !Ae : S, re = x(
|
|
100
|
+
[i]
|
|
101
|
+
), [j, ee] = De(""), { handleAddOnEnter: oe, handleInputValueChange: ye } = Fe({
|
|
102
|
+
addOnEnter: $,
|
|
103
|
+
multiple: n,
|
|
104
|
+
tokenSeparators: C,
|
|
105
|
+
optionMap: i,
|
|
106
|
+
value: u,
|
|
107
|
+
handleValueChange: m,
|
|
108
|
+
setOpen: S,
|
|
109
|
+
setSearchValue: ee,
|
|
110
|
+
onSearch: O
|
|
111
|
+
}), Ie = !!C?.length, Ne = n && Ie ? !1 : B, te = v(
|
|
139
112
|
(e) => (o) => {
|
|
140
|
-
if (o.key === "Enter" &&
|
|
141
|
-
if (!
|
|
142
|
-
|
|
113
|
+
if (o.key === "Enter" && $ && e) {
|
|
114
|
+
if (!n && B) return;
|
|
115
|
+
oe(e) && (o.preventDefault(), ee(""), O?.(""));
|
|
143
116
|
}
|
|
144
117
|
},
|
|
145
|
-
[
|
|
146
|
-
),
|
|
147
|
-
const
|
|
148
|
-
return
|
|
118
|
+
[$, B, n, oe, O]
|
|
119
|
+
), we = y(() => T === !1 ? null : typeof T == "function" ? (e, o) => {
|
|
120
|
+
const a = i.get(e);
|
|
121
|
+
return T(o, a);
|
|
149
122
|
} : (e, o) => {
|
|
150
123
|
if (!o) return !0;
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
-
const
|
|
154
|
-
const
|
|
155
|
-
return
|
|
124
|
+
const a = i.get(e);
|
|
125
|
+
if (!a) return !1;
|
|
126
|
+
const d = C && C.length > 0 ? Ve(o, C) : [o], x = G(a).map((N) => N.toLowerCase()), f = d.filter((N) => {
|
|
127
|
+
const E = N.toLowerCase();
|
|
128
|
+
return x.some((Ae) => Ae.includes(E));
|
|
156
129
|
}).length;
|
|
157
|
-
if (
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
return
|
|
130
|
+
if (f === 0) return !1;
|
|
131
|
+
if (d.length > 1 && f > 1) {
|
|
132
|
+
const N = o.toLowerCase();
|
|
133
|
+
return x.some((E) => E.includes(N));
|
|
161
134
|
}
|
|
162
135
|
return !0;
|
|
163
|
-
}, [
|
|
164
|
-
return /* @__PURE__ */ t("div", { ref:
|
|
165
|
-
|
|
136
|
+
}, [T, i, C, G]);
|
|
137
|
+
return /* @__PURE__ */ t("div", { ref: ge, className: l(c("combobox"), ue), ...fe, children: /* @__PURE__ */ g(
|
|
138
|
+
r.Root,
|
|
166
139
|
{
|
|
167
|
-
value:
|
|
140
|
+
value: n ? h : h[0] ?? null,
|
|
168
141
|
onValueChange: (e) => {
|
|
169
|
-
|
|
170
|
-
|
|
142
|
+
m(
|
|
143
|
+
n ? Array.isArray(e) ? e : [] : e
|
|
171
144
|
);
|
|
172
145
|
},
|
|
173
|
-
inputValue:
|
|
174
|
-
onInputValueChange:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
multiple: r,
|
|
180
|
-
disabled: A,
|
|
146
|
+
inputValue: j,
|
|
147
|
+
onInputValueChange: ye,
|
|
148
|
+
open: L,
|
|
149
|
+
onOpenChange: S,
|
|
150
|
+
multiple: n,
|
|
151
|
+
disabled: I,
|
|
181
152
|
autoHighlight: Ne,
|
|
182
|
-
items:
|
|
183
|
-
itemToStringLabel:
|
|
184
|
-
filter:
|
|
153
|
+
items: xe,
|
|
154
|
+
itemToStringLabel: ve,
|
|
155
|
+
filter: we,
|
|
185
156
|
children: [
|
|
186
|
-
|
|
157
|
+
n ? (
|
|
187
158
|
/* Multiple Selection Layout using SelectTrigger compound components */
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
159
|
+
/* @__PURE__ */ g(
|
|
160
|
+
p.Root,
|
|
190
161
|
{
|
|
191
|
-
ref:
|
|
192
|
-
size:
|
|
193
|
-
disabled:
|
|
194
|
-
open:
|
|
195
|
-
status:
|
|
196
|
-
placeholder:
|
|
197
|
-
displayValue:
|
|
198
|
-
allowClear:
|
|
199
|
-
suffixIcon:
|
|
200
|
-
clearIcon:
|
|
201
|
-
onClear:
|
|
202
|
-
onOpenChange:
|
|
203
|
-
className:
|
|
162
|
+
ref: P,
|
|
163
|
+
size: F,
|
|
164
|
+
disabled: I,
|
|
165
|
+
open: L,
|
|
166
|
+
status: k,
|
|
167
|
+
placeholder: w,
|
|
168
|
+
displayValue: z,
|
|
169
|
+
allowClear: W,
|
|
170
|
+
suffixIcon: U,
|
|
171
|
+
clearIcon: Q,
|
|
172
|
+
onClear: _,
|
|
173
|
+
onOpenChange: S,
|
|
174
|
+
className: l(b?.trigger, c("combobox-trigger-multiple")),
|
|
204
175
|
as: "div",
|
|
205
176
|
children: [
|
|
206
177
|
/* @__PURE__ */ t(
|
|
207
|
-
|
|
178
|
+
p.Content,
|
|
208
179
|
{
|
|
209
|
-
contentRender: ({ className: e, children: o, ...
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
|
|
214
|
-
/* @__PURE__ */ t("span", { className:
|
|
180
|
+
contentRender: ({ className: e, children: o, ...a }) => /* @__PURE__ */ t(r.Chips, { className: l(c("combobox-chips"), e), ...a, children: /* @__PURE__ */ t(r.Value, { children: (d) => /* @__PURE__ */ g(ne, { children: [
|
|
181
|
+
d.map((x) => {
|
|
182
|
+
const f = i.get(x);
|
|
183
|
+
return /* @__PURE__ */ g(r.Chip, { className: l(c("combobox-chip")), children: [
|
|
184
|
+
f?.icon && /* @__PURE__ */ t("span", { className: l(c("combobox-chip-icon")), children: f.icon }),
|
|
185
|
+
/* @__PURE__ */ t("span", { className: l(c("combobox-chip-text")), children: f ? R ? R(f) : f.label : x }),
|
|
215
186
|
/* @__PURE__ */ t(
|
|
216
|
-
|
|
187
|
+
r.ChipRemove,
|
|
217
188
|
{
|
|
218
|
-
className:
|
|
189
|
+
className: l(c("combobox-chip-remove")),
|
|
219
190
|
children: /* @__PURE__ */ t(Me, {})
|
|
220
191
|
}
|
|
221
192
|
)
|
|
222
|
-
] },
|
|
193
|
+
] }, x);
|
|
223
194
|
}),
|
|
224
195
|
/* @__PURE__ */ t(
|
|
225
|
-
|
|
196
|
+
r.Input,
|
|
226
197
|
{
|
|
227
|
-
placeholder:
|
|
228
|
-
className:
|
|
229
|
-
disabled:
|
|
230
|
-
onKeyDown:
|
|
198
|
+
placeholder: d.length > 0 ? "" : w,
|
|
199
|
+
className: q,
|
|
200
|
+
disabled: I,
|
|
201
|
+
onKeyDown: te(j)
|
|
231
202
|
}
|
|
232
203
|
)
|
|
233
204
|
] }) }) })
|
|
234
205
|
}
|
|
235
206
|
),
|
|
236
207
|
/* @__PURE__ */ t(
|
|
237
|
-
|
|
208
|
+
p.Clear,
|
|
238
209
|
{
|
|
239
|
-
render: (e) => /* @__PURE__ */ t(
|
|
210
|
+
render: (e) => /* @__PURE__ */ t(r.Clear, { ...e })
|
|
240
211
|
}
|
|
241
212
|
),
|
|
242
213
|
/* @__PURE__ */ t(
|
|
243
|
-
|
|
214
|
+
p.Arrow,
|
|
244
215
|
{
|
|
245
|
-
render: (e, { icon: o }) => /* @__PURE__ */ t(
|
|
216
|
+
render: (e, { icon: o }) => /* @__PURE__ */ t(r.Trigger, { ...e, children: /* @__PURE__ */ t(r.Icon, { children: o }) })
|
|
246
217
|
}
|
|
247
218
|
)
|
|
248
219
|
]
|
|
249
220
|
}
|
|
250
221
|
)
|
|
251
|
-
) : /* @__PURE__ */
|
|
252
|
-
|
|
222
|
+
) : /* @__PURE__ */ g(
|
|
223
|
+
p.Root,
|
|
253
224
|
{
|
|
254
|
-
ref:
|
|
225
|
+
ref: P,
|
|
255
226
|
as: "div",
|
|
256
|
-
size:
|
|
257
|
-
disabled:
|
|
258
|
-
open:
|
|
259
|
-
status:
|
|
260
|
-
placeholder:
|
|
261
|
-
displayValue:
|
|
262
|
-
allowClear:
|
|
263
|
-
suffixIcon:
|
|
264
|
-
clearIcon:
|
|
265
|
-
onClear:
|
|
266
|
-
onOpenChange:
|
|
267
|
-
className:
|
|
227
|
+
size: F,
|
|
228
|
+
disabled: I,
|
|
229
|
+
open: L,
|
|
230
|
+
status: k,
|
|
231
|
+
placeholder: w,
|
|
232
|
+
displayValue: z,
|
|
233
|
+
allowClear: W,
|
|
234
|
+
suffixIcon: U,
|
|
235
|
+
clearIcon: Q,
|
|
236
|
+
onClear: _,
|
|
237
|
+
onOpenChange: S,
|
|
238
|
+
className: l(b?.trigger, c("combobox-trigger-single")),
|
|
268
239
|
children: [
|
|
269
240
|
/* @__PURE__ */ t(
|
|
270
|
-
|
|
241
|
+
p.Content,
|
|
271
242
|
{
|
|
272
|
-
contentRender: ({ className: e, children: o, ...
|
|
273
|
-
|
|
243
|
+
contentRender: ({ className: e, children: o, ...a }) => /* @__PURE__ */ t(
|
|
244
|
+
r.Input,
|
|
274
245
|
{
|
|
275
|
-
placeholder:
|
|
276
|
-
className:
|
|
277
|
-
disabled:
|
|
278
|
-
onKeyDown:
|
|
279
|
-
...
|
|
246
|
+
placeholder: w,
|
|
247
|
+
className: l(e, q),
|
|
248
|
+
disabled: I,
|
|
249
|
+
onKeyDown: te(j),
|
|
250
|
+
...a
|
|
280
251
|
}
|
|
281
252
|
)
|
|
282
253
|
}
|
|
283
254
|
),
|
|
284
255
|
/* @__PURE__ */ t(
|
|
285
|
-
|
|
256
|
+
p.Clear,
|
|
286
257
|
{
|
|
287
|
-
render: (e) => /* @__PURE__ */ t(
|
|
258
|
+
render: (e) => /* @__PURE__ */ t(r.Clear, { ...e })
|
|
288
259
|
}
|
|
289
260
|
),
|
|
290
261
|
/* @__PURE__ */ t(
|
|
291
|
-
|
|
262
|
+
p.Arrow,
|
|
292
263
|
{
|
|
293
|
-
render: (e, { icon: o }) => /* @__PURE__ */ t(
|
|
264
|
+
render: (e, { icon: o }) => /* @__PURE__ */ t(r.Trigger, { ...e, children: /* @__PURE__ */ t(r.Icon, { children: o }) })
|
|
294
265
|
}
|
|
295
266
|
)
|
|
296
267
|
]
|
|
297
268
|
}
|
|
298
269
|
),
|
|
299
|
-
/* @__PURE__ */ t(
|
|
300
|
-
|
|
270
|
+
/* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ t(
|
|
271
|
+
r.Positioner,
|
|
301
272
|
{
|
|
302
|
-
anchor:
|
|
273
|
+
anchor: P.current,
|
|
303
274
|
sideOffset: 4,
|
|
304
|
-
side:
|
|
305
|
-
align:
|
|
306
|
-
render:
|
|
275
|
+
side: A.startsWith("top") ? "top" : "bottom",
|
|
276
|
+
align: A.endsWith("Right") ? "end" : A === "top" || A === "bottom" ? "center" : "start",
|
|
277
|
+
render: Le,
|
|
307
278
|
children: /* @__PURE__ */ t(
|
|
308
|
-
|
|
279
|
+
r.Popup,
|
|
309
280
|
{
|
|
310
|
-
className:
|
|
311
|
-
|
|
312
|
-
!
|
|
313
|
-
|
|
281
|
+
className: l(
|
|
282
|
+
c("combobox-popup"),
|
|
283
|
+
!be && c("combobox-popup--auto-width"),
|
|
284
|
+
b?.portal
|
|
314
285
|
),
|
|
315
286
|
render: Pe,
|
|
316
|
-
children: /* @__PURE__ */
|
|
317
|
-
|
|
287
|
+
children: /* @__PURE__ */ g("div", { className: l(c("combobox-container")), children: [
|
|
288
|
+
D && /* @__PURE__ */ g(ne, { children: [
|
|
318
289
|
/* @__PURE__ */ t(
|
|
319
|
-
|
|
290
|
+
se,
|
|
320
291
|
{
|
|
321
292
|
as: "button",
|
|
322
293
|
type: "button",
|
|
323
|
-
className:
|
|
324
|
-
selected:
|
|
325
|
-
onClick:
|
|
326
|
-
indeterminate:
|
|
294
|
+
className: l(c("combobox-select-all")),
|
|
295
|
+
selected: D.checked,
|
|
296
|
+
onClick: D.onToggle,
|
|
297
|
+
indeterminate: D.indeterminate,
|
|
327
298
|
showCheckbox: !0,
|
|
328
299
|
children: "Select All"
|
|
329
300
|
}
|
|
330
301
|
),
|
|
331
|
-
/* @__PURE__ */ t(
|
|
302
|
+
/* @__PURE__ */ t(r.Separator, { render: je })
|
|
332
303
|
] }),
|
|
333
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ g(Be, { fadeEdges: !0, children: [
|
|
334
305
|
/* @__PURE__ */ t(
|
|
335
|
-
|
|
306
|
+
r.List,
|
|
336
307
|
{
|
|
337
|
-
className:
|
|
338
|
-
render:
|
|
308
|
+
className: l(c("combobox-list"), b?.list),
|
|
309
|
+
render: Ee,
|
|
339
310
|
children: (e) => {
|
|
340
|
-
const o =
|
|
311
|
+
const o = i.get(e);
|
|
341
312
|
if (!o) return null;
|
|
342
|
-
const
|
|
343
|
-
return
|
|
344
|
-
|
|
313
|
+
const a = h.includes(e);
|
|
314
|
+
return H ? H(o, {}) : /* @__PURE__ */ t(
|
|
315
|
+
se,
|
|
345
316
|
{
|
|
346
317
|
disabled: o.disabled,
|
|
347
|
-
selected:
|
|
348
|
-
showCheckbox:
|
|
318
|
+
selected: a,
|
|
319
|
+
showCheckbox: n,
|
|
349
320
|
icon: o.icon,
|
|
350
321
|
classNames: {
|
|
351
|
-
root:
|
|
352
|
-
icon:
|
|
353
|
-
text:
|
|
322
|
+
root: l(b?.option),
|
|
323
|
+
icon: b?.optionIcon,
|
|
324
|
+
text: b?.optionText
|
|
354
325
|
},
|
|
355
|
-
labelRender:
|
|
356
|
-
render: (
|
|
357
|
-
|
|
326
|
+
labelRender: R ? (d) => R(o, d) : void 0,
|
|
327
|
+
render: (d) => /* @__PURE__ */ t(
|
|
328
|
+
r.Item,
|
|
358
329
|
{
|
|
359
330
|
value: e,
|
|
360
331
|
disabled: o.disabled,
|
|
361
|
-
...
|
|
332
|
+
...d,
|
|
362
333
|
"data-disabled": o.disabled,
|
|
363
|
-
"data-selected":
|
|
334
|
+
"data-selected": a
|
|
364
335
|
}
|
|
365
336
|
),
|
|
366
337
|
children: o.label
|
|
@@ -370,7 +341,7 @@ const Be = (l) => /* @__PURE__ */ t(O.Root, { ...l }), Pe = (l) => /* @__PURE__
|
|
|
370
341
|
}
|
|
371
342
|
}
|
|
372
343
|
),
|
|
373
|
-
/* @__PURE__ */ t(
|
|
344
|
+
/* @__PURE__ */ t(r.Empty, { className: l(c("combobox-empty")), children: /* @__PURE__ */ t(Oe, { description: "No options found" }) })
|
|
374
345
|
] })
|
|
375
346
|
] })
|
|
376
347
|
}
|
|
@@ -380,11 +351,11 @@ const Be = (l) => /* @__PURE__ */ t(O.Root, { ...l }), Pe = (l) => /* @__PURE__
|
|
|
380
351
|
]
|
|
381
352
|
}
|
|
382
353
|
) });
|
|
383
|
-
},
|
|
354
|
+
}, We = Se(Ke), ao = Object.assign(We, {
|
|
384
355
|
// Add any sub components here if needed
|
|
385
356
|
});
|
|
386
357
|
export {
|
|
387
|
-
|
|
388
|
-
|
|
358
|
+
ao as Combobox,
|
|
359
|
+
ao as default
|
|
389
360
|
};
|
|
390
361
|
//# sourceMappingURL=component.js.map
|