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