@bioturing/components 0.47.0 → 0.48.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 +1 -1
- package/dist/components/base-menu/index.d.ts.map +1 -1
- package/dist/components/base-menu/item.css +1 -1
- package/dist/components/base-menu/item.d.ts +13 -2
- package/dist/components/base-menu/item.d.ts.map +1 -1
- package/dist/components/base-menu/item.js +62 -47
- package/dist/components/base-menu/item.js.map +1 -1
- package/dist/components/base-menu/style.css +1 -1
- package/dist/components/combobox/component.d.ts.map +1 -1
- package/dist/components/combobox/component.js +121 -121
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/combobox/style.css +1 -1
- package/dist/components/data-table/component.d.ts.map +1 -1
- package/dist/components/data-table/component.js +81 -70
- package/dist/components/data-table/component.js.map +1 -1
- package/dist/components/data-table/components/TableBody.d.ts +3 -2
- package/dist/components/data-table/components/TableBody.d.ts.map +1 -1
- package/dist/components/data-table/components/TableBody.js +107 -99
- package/dist/components/data-table/components/TableBody.js.map +1 -1
- package/dist/components/data-table/components/TableHeader.d.ts +3 -1
- package/dist/components/data-table/components/TableHeader.d.ts.map +1 -1
- package/dist/components/data-table/components/TableHeader.js +121 -93
- package/dist/components/data-table/components/TableHeader.js.map +1 -1
- package/dist/components/data-table/components/TablePagination.d.ts.map +1 -1
- package/dist/components/data-table/components/TablePagination.js +32 -21
- package/dist/components/data-table/components/TablePagination.js.map +1 -1
- package/dist/components/data-table/hooks.d.ts.map +1 -1
- package/dist/components/data-table/hooks.js +98 -84
- package/dist/components/data-table/hooks.js.map +1 -1
- package/dist/components/data-table/style.css +1 -1
- package/dist/components/data-table/utils.js +37 -30
- package/dist/components/data-table/utils.js.map +1 -1
- package/dist/components/dropdown-menu/component.d.ts.map +1 -1
- package/dist/components/dropdown-menu/component.js +121 -144
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/index.d.ts +2 -0
- package/dist/components/dropdown-menu/index.d.ts.map +1 -1
- package/dist/components/dropdown-menu/item.d.ts +7 -15
- package/dist/components/dropdown-menu/item.d.ts.map +1 -1
- package/dist/components/dropdown-menu/item.js +132 -81
- package/dist/components/dropdown-menu/item.js.map +1 -1
- package/dist/components/dropdown-menu/radio-group.d.ts +14 -0
- package/dist/components/dropdown-menu/radio-group.d.ts.map +1 -0
- package/dist/components/dropdown-menu/radio-group.js +45 -0
- package/dist/components/dropdown-menu/radio-group.js.map +1 -0
- package/dist/components/dropdown-menu/search-mode.d.ts +4 -0
- package/dist/components/dropdown-menu/search-mode.d.ts.map +1 -0
- package/dist/components/dropdown-menu/search-mode.js +6 -0
- package/dist/components/dropdown-menu/search-mode.js.map +1 -0
- package/dist/components/dropdown-menu/style.css +1 -1
- package/dist/components/dropdown-menu/submenu.d.ts +25 -0
- package/dist/components/dropdown-menu/submenu.d.ts.map +1 -0
- package/dist/components/dropdown-menu/submenu.js +96 -0
- package/dist/components/dropdown-menu/submenu.js.map +1 -0
- package/dist/components/dropdown-menu/types.d.ts +85 -12
- package/dist/components/dropdown-menu/types.d.ts.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +4 -8
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.js +108 -81
- package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
- package/dist/components/select/component.js +29 -29
- package/dist/components/select/component.js.map +1 -1
- package/dist/index.js +278 -274
- package/dist/index.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1,140 +1,140 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as g, Fragment as
|
|
2
|
+
import { jsx as t, jsxs as g, Fragment as te } from "react/jsx-runtime";
|
|
3
3
|
import { Combobox as r } from "@base-ui/react/combobox";
|
|
4
4
|
import Ae from "antd/es/config-provider/DisabledContext";
|
|
5
5
|
import { FormItemInputContext as Re } from "antd/es/form/context";
|
|
6
|
-
import { forwardRef as Se, useRef as ke, useContext as
|
|
7
|
-
import { BaseMenu as
|
|
8
|
-
import { XIcon as
|
|
9
|
-
import { hasTokenSeparator as
|
|
6
|
+
import { forwardRef as Se, useRef as ke, useContext as ne, useCallback as v, useMemo as w, useState as De } from "react";
|
|
7
|
+
import { BaseMenu as M } from "../base-menu/index.js";
|
|
8
|
+
import { XIcon as Ve } from "@bioturing/assets";
|
|
9
|
+
import { hasTokenSeparator as Me, splitBySeparators as Fe } from "./utils.js";
|
|
10
10
|
import { useComboboxTokenInput as Oe } from "./use-combobox-token-input.js";
|
|
11
11
|
import './style.css';/* empty css */
|
|
12
12
|
import { SelectTrigger as p } from "../select-trigger/component.js";
|
|
13
|
-
import { BaseMenuItem as
|
|
13
|
+
import { BaseMenuItem as re } from "../base-menu/item.js";
|
|
14
14
|
import { Empty as $e } from "../empty/component.js";
|
|
15
|
-
import { useControlledState as
|
|
15
|
+
import { useControlledState as se } from "../hooks/useControlledState.js";
|
|
16
16
|
import { useCls as Be } from "../utils/antdUtils.js";
|
|
17
|
-
import { clsx as
|
|
18
|
-
import { reactNodeToString as
|
|
17
|
+
import { clsx as a } from "../utils/cn.js";
|
|
18
|
+
import { reactNodeToString as ce } from "../utils/reactToString.js";
|
|
19
19
|
import { ScrollArea as Le } from "../scroll-area/component.js";
|
|
20
|
-
const Pe = (s) => /* @__PURE__ */ t(
|
|
20
|
+
const Pe = (s) => /* @__PURE__ */ t(M.Root, { ...s }), je = (s) => /* @__PURE__ */ t(M.Popup, { ...s }), Ee = (s) => /* @__PURE__ */ t(M.Divider, { ...s }), Ke = (s) => /* @__PURE__ */ t(M.List, { ...s }), We = ({
|
|
21
21
|
options: s = [],
|
|
22
22
|
value: ae,
|
|
23
|
-
defaultValue:
|
|
24
|
-
onChange:
|
|
25
|
-
placeholder:
|
|
23
|
+
defaultValue: E,
|
|
24
|
+
onChange: le,
|
|
25
|
+
placeholder: N = "Select...",
|
|
26
26
|
disabled: ie = !1,
|
|
27
27
|
status: de,
|
|
28
|
-
allowClear:
|
|
28
|
+
allowClear: K = !1,
|
|
29
29
|
multiple: n = !1,
|
|
30
30
|
showSearch: Qe = !0,
|
|
31
31
|
open: he,
|
|
32
32
|
onOpenChange: me,
|
|
33
33
|
className: ue,
|
|
34
34
|
classNames: b,
|
|
35
|
-
size:
|
|
36
|
-
optionRender:
|
|
37
|
-
onSearch:
|
|
38
|
-
clearIcon:
|
|
39
|
-
suffixIcon:
|
|
35
|
+
size: F = "middle",
|
|
36
|
+
optionRender: W,
|
|
37
|
+
onSearch: O,
|
|
38
|
+
clearIcon: H,
|
|
39
|
+
suffixIcon: Q,
|
|
40
40
|
placement: T = "bottomLeft",
|
|
41
41
|
// showSelectionSummary: _showSelectionSummary = false,
|
|
42
42
|
// selectionSummaryRender,
|
|
43
|
-
showSelectAll:
|
|
43
|
+
showSelectAll: U = !1,
|
|
44
44
|
optionLabelRender: A,
|
|
45
|
-
getOptionKeywords:
|
|
45
|
+
getOptionKeywords: X = (u) => [
|
|
46
46
|
String(u.value),
|
|
47
|
-
|
|
47
|
+
ce(u.label)
|
|
48
48
|
],
|
|
49
49
|
popupMatchSelectWidth: be = !0,
|
|
50
|
-
addOnEnter:
|
|
50
|
+
addOnEnter: $ = !1,
|
|
51
51
|
tokenSeparators: C,
|
|
52
|
-
autoHighlight:
|
|
52
|
+
autoHighlight: B = !0,
|
|
53
53
|
filterOption: R,
|
|
54
54
|
...fe
|
|
55
55
|
}, ge) => {
|
|
56
|
-
const [u,
|
|
56
|
+
const [u, G] = se(
|
|
57
57
|
ae,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
), [
|
|
58
|
+
le,
|
|
59
|
+
E !== void 0 ? E : n ? [] : void 0
|
|
60
|
+
), [L, S] = se(he, me, !1), c = Be(), P = ke(null), { status: pe } = ne(Re), Ce = ne(Ae), k = de || pe, y = ie || Ce, h = v(
|
|
61
61
|
(e) => {
|
|
62
|
-
|
|
62
|
+
G(e);
|
|
63
63
|
},
|
|
64
|
-
[
|
|
65
|
-
),
|
|
64
|
+
[G]
|
|
65
|
+
), J = v(() => {
|
|
66
66
|
if (n) {
|
|
67
67
|
const e = s.map((o) => o.value);
|
|
68
68
|
h(e);
|
|
69
69
|
}
|
|
70
|
-
}, [n, s, h]),
|
|
70
|
+
}, [n, s, h]), Y = v(() => {
|
|
71
71
|
n && h([]);
|
|
72
|
-
}, [n, h]),
|
|
72
|
+
}, [n, h]), Z = v(() => {
|
|
73
73
|
h(n ? [] : void 0);
|
|
74
|
-
}, [n, h]), m =
|
|
74
|
+
}, [n, h]), m = w(() => Array.isArray(u) ? u : u ? [u] : [], [u]), i = w(() => {
|
|
75
75
|
const e = /* @__PURE__ */ new Map();
|
|
76
76
|
for (const o of s)
|
|
77
77
|
e.set(o.value, o);
|
|
78
78
|
return e;
|
|
79
|
-
}, [s]), D =
|
|
80
|
-
if (!
|
|
79
|
+
}, [s]), D = w(() => {
|
|
80
|
+
if (!U || !n || s.length === 0)
|
|
81
81
|
return null;
|
|
82
|
-
const e = m.filter((d) => i.has(d)), o = e.length === s.length && s.length > 0,
|
|
82
|
+
const e = m.filter((d) => i.has(d)), o = e.length === s.length && s.length > 0, l = e.length > 0 && e.length < s.length;
|
|
83
83
|
return {
|
|
84
84
|
checked: o,
|
|
85
|
-
indeterminate:
|
|
85
|
+
indeterminate: l,
|
|
86
86
|
onToggle: () => {
|
|
87
|
-
|
|
87
|
+
l || o ? Y() : J();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
}, [
|
|
90
|
+
}, [U, n, s, i, m, Y, J]), xe = w(() => s.map((e) => e.value), [s]), _ = w(() => n ? m.length > 0 ? `${m.length} item${m.length === 1 ? "" : "s"} selected` : null : i.get(m[0])?.label || null, [n, m, i]), z = a(
|
|
91
91
|
c("combobox-input"),
|
|
92
|
-
c(`combobox-input-${
|
|
92
|
+
c(`combobox-input-${F}`),
|
|
93
93
|
k && c(`combobox-input-${k}`),
|
|
94
94
|
b?.input
|
|
95
95
|
), ve = v(
|
|
96
96
|
(e) => {
|
|
97
97
|
const o = i.get(e);
|
|
98
|
-
return
|
|
98
|
+
return ce(o?.label || String(e));
|
|
99
99
|
},
|
|
100
100
|
[i]
|
|
101
|
-
), [
|
|
102
|
-
addOnEnter:
|
|
101
|
+
), [V, q] = De(""), { handleAddOnEnter: ee, handleInputValueChange: we } = Oe({
|
|
102
|
+
addOnEnter: $,
|
|
103
103
|
multiple: n,
|
|
104
104
|
tokenSeparators: C,
|
|
105
105
|
optionMap: i,
|
|
106
106
|
value: u,
|
|
107
107
|
handleValueChange: h,
|
|
108
108
|
setOpen: S,
|
|
109
|
-
setSearchValue:
|
|
110
|
-
onSearch:
|
|
111
|
-
}),
|
|
109
|
+
setSearchValue: q,
|
|
110
|
+
onSearch: O
|
|
111
|
+
}), ye = !!C?.length, Ie = n && ye && Me(V, C) ? !1 : B, oe = v(
|
|
112
112
|
(e) => (o) => {
|
|
113
|
-
if (o.key === "Enter" &&
|
|
114
|
-
if (!n &&
|
|
115
|
-
|
|
113
|
+
if (o.key === "Enter" && $ && e) {
|
|
114
|
+
if (!n && B) return;
|
|
115
|
+
ee(e) && (o.preventDefault(), q(""), O?.(""));
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
-
[B,
|
|
119
|
-
),
|
|
120
|
-
const
|
|
121
|
-
return R(o,
|
|
118
|
+
[$, B, n, ee, O]
|
|
119
|
+
), Ne = w(() => R === !1 ? null : typeof R == "function" ? (e, o) => {
|
|
120
|
+
const l = i.get(e);
|
|
121
|
+
return R(o, l);
|
|
122
122
|
} : (e, o) => {
|
|
123
123
|
if (!o) return !0;
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
126
|
-
const d = C && C.length > 0 ? Fe(o, C) : [o], x =
|
|
127
|
-
const
|
|
128
|
-
return x.some((Te) => Te.includes(
|
|
124
|
+
const l = i.get(e);
|
|
125
|
+
if (!l) return !1;
|
|
126
|
+
const d = C && C.length > 0 ? Fe(o, C) : [o], x = X(l).map((I) => I.toLowerCase()), f = d.filter((I) => {
|
|
127
|
+
const j = I.toLowerCase();
|
|
128
|
+
return x.some((Te) => Te.includes(j));
|
|
129
129
|
}).length;
|
|
130
130
|
if (f === 0) return !1;
|
|
131
131
|
if (d.length > 1 && f > 1) {
|
|
132
|
-
const
|
|
133
|
-
return x.some((
|
|
132
|
+
const I = o.toLowerCase();
|
|
133
|
+
return x.some((j) => j.includes(I));
|
|
134
134
|
}
|
|
135
135
|
return !0;
|
|
136
|
-
}, [R, i, C,
|
|
137
|
-
return /* @__PURE__ */ t("div", { ref: ge, className:
|
|
136
|
+
}, [R, i, C, X]);
|
|
137
|
+
return /* @__PURE__ */ t("div", { ref: ge, className: a(c("combobox"), ue), ...fe, children: /* @__PURE__ */ g(
|
|
138
138
|
r.Root,
|
|
139
139
|
{
|
|
140
140
|
value: n ? m : m[0] ?? null,
|
|
@@ -143,51 +143,51 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
143
143
|
n ? Array.isArray(e) ? e : [] : e
|
|
144
144
|
);
|
|
145
145
|
},
|
|
146
|
-
inputValue:
|
|
147
|
-
onInputValueChange:
|
|
148
|
-
open:
|
|
146
|
+
inputValue: n ? V : void 0,
|
|
147
|
+
onInputValueChange: we,
|
|
148
|
+
open: L,
|
|
149
149
|
onOpenChange: S,
|
|
150
150
|
multiple: n,
|
|
151
|
-
disabled:
|
|
152
|
-
autoHighlight:
|
|
151
|
+
disabled: y,
|
|
152
|
+
autoHighlight: Ie,
|
|
153
153
|
items: xe,
|
|
154
154
|
itemToStringLabel: ve,
|
|
155
|
-
filter:
|
|
155
|
+
filter: Ne,
|
|
156
156
|
children: [
|
|
157
157
|
n ? (
|
|
158
158
|
/* Multiple Selection Layout using SelectTrigger compound components */
|
|
159
159
|
/* @__PURE__ */ g(
|
|
160
160
|
p.Root,
|
|
161
161
|
{
|
|
162
|
-
ref:
|
|
163
|
-
size:
|
|
164
|
-
disabled:
|
|
165
|
-
open:
|
|
162
|
+
ref: P,
|
|
163
|
+
size: F,
|
|
164
|
+
disabled: y,
|
|
165
|
+
open: L,
|
|
166
166
|
status: k,
|
|
167
|
-
placeholder:
|
|
168
|
-
displayValue:
|
|
169
|
-
allowClear:
|
|
170
|
-
suffixIcon:
|
|
171
|
-
clearIcon:
|
|
172
|
-
onClear:
|
|
167
|
+
placeholder: N,
|
|
168
|
+
displayValue: _,
|
|
169
|
+
allowClear: K,
|
|
170
|
+
suffixIcon: Q,
|
|
171
|
+
clearIcon: H,
|
|
172
|
+
onClear: Z,
|
|
173
173
|
onOpenChange: S,
|
|
174
|
-
className:
|
|
174
|
+
className: a(b?.trigger, c("combobox-trigger-multiple")),
|
|
175
175
|
as: "div",
|
|
176
176
|
children: [
|
|
177
177
|
/* @__PURE__ */ t(
|
|
178
178
|
p.Content,
|
|
179
179
|
{
|
|
180
|
-
contentRender: ({ className: e, children: o, ...
|
|
180
|
+
contentRender: ({ className: e, children: o, ...l }) => /* @__PURE__ */ t(r.Chips, { className: a(c("combobox-chips"), e), ...l, children: /* @__PURE__ */ t(r.Value, { children: (d) => /* @__PURE__ */ g(te, { children: [
|
|
181
181
|
d.map((x) => {
|
|
182
182
|
const f = i.get(x);
|
|
183
|
-
return /* @__PURE__ */ g(r.Chip, { className:
|
|
184
|
-
f?.icon && /* @__PURE__ */ t("span", { className:
|
|
185
|
-
/* @__PURE__ */ t("span", { className:
|
|
183
|
+
return /* @__PURE__ */ g(r.Chip, { className: a(c("combobox-chip")), children: [
|
|
184
|
+
f?.icon && /* @__PURE__ */ t("span", { className: a(c("combobox-chip-icon")), children: f.icon }),
|
|
185
|
+
/* @__PURE__ */ t("span", { className: a(c("combobox-chip-text")), children: f ? A ? A(f) : f.label : x }),
|
|
186
186
|
/* @__PURE__ */ t(
|
|
187
187
|
r.ChipRemove,
|
|
188
188
|
{
|
|
189
|
-
className:
|
|
190
|
-
children: /* @__PURE__ */ t(
|
|
189
|
+
className: a(c("combobox-chip-remove")),
|
|
190
|
+
children: /* @__PURE__ */ t(Ve, {})
|
|
191
191
|
}
|
|
192
192
|
)
|
|
193
193
|
] }, x);
|
|
@@ -195,10 +195,10 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
195
195
|
/* @__PURE__ */ t(
|
|
196
196
|
r.Input,
|
|
197
197
|
{
|
|
198
|
-
placeholder: d.length > 0 ? "" :
|
|
199
|
-
className:
|
|
200
|
-
disabled:
|
|
201
|
-
onKeyDown:
|
|
198
|
+
placeholder: d.length > 0 ? "" : N,
|
|
199
|
+
className: z,
|
|
200
|
+
disabled: y,
|
|
201
|
+
onKeyDown: oe(V)
|
|
202
202
|
}
|
|
203
203
|
)
|
|
204
204
|
] }) }) })
|
|
@@ -222,32 +222,32 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
222
222
|
) : /* @__PURE__ */ g(
|
|
223
223
|
p.Root,
|
|
224
224
|
{
|
|
225
|
-
ref:
|
|
225
|
+
ref: P,
|
|
226
226
|
as: "div",
|
|
227
|
-
size:
|
|
228
|
-
disabled:
|
|
229
|
-
open:
|
|
227
|
+
size: F,
|
|
228
|
+
disabled: y,
|
|
229
|
+
open: L,
|
|
230
230
|
status: k,
|
|
231
|
-
placeholder:
|
|
232
|
-
displayValue:
|
|
233
|
-
allowClear:
|
|
234
|
-
suffixIcon:
|
|
235
|
-
clearIcon:
|
|
236
|
-
onClear:
|
|
231
|
+
placeholder: N,
|
|
232
|
+
displayValue: _,
|
|
233
|
+
allowClear: K,
|
|
234
|
+
suffixIcon: Q,
|
|
235
|
+
clearIcon: H,
|
|
236
|
+
onClear: Z,
|
|
237
237
|
onOpenChange: S,
|
|
238
|
-
className:
|
|
238
|
+
className: a(b?.trigger, c("combobox-trigger-single")),
|
|
239
239
|
children: [
|
|
240
240
|
/* @__PURE__ */ t(
|
|
241
241
|
p.Content,
|
|
242
242
|
{
|
|
243
|
-
contentRender: ({ className: e, children: o, ...
|
|
243
|
+
contentRender: ({ className: e, children: o, ...l }) => /* @__PURE__ */ t(
|
|
244
244
|
r.Input,
|
|
245
245
|
{
|
|
246
|
-
placeholder:
|
|
247
|
-
className:
|
|
248
|
-
disabled:
|
|
249
|
-
onKeyDown:
|
|
250
|
-
...
|
|
246
|
+
placeholder: N,
|
|
247
|
+
className: a(e, z),
|
|
248
|
+
disabled: y,
|
|
249
|
+
onKeyDown: oe(V),
|
|
250
|
+
...l
|
|
251
251
|
}
|
|
252
252
|
)
|
|
253
253
|
}
|
|
@@ -270,7 +270,7 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
270
270
|
/* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ t(
|
|
271
271
|
r.Positioner,
|
|
272
272
|
{
|
|
273
|
-
anchor:
|
|
273
|
+
anchor: P.current,
|
|
274
274
|
sideOffset: 4,
|
|
275
275
|
side: T.startsWith("top") ? "top" : "bottom",
|
|
276
276
|
align: T.endsWith("Right") ? "end" : T === "top" || T === "bottom" ? "center" : "start",
|
|
@@ -278,20 +278,20 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
278
278
|
children: /* @__PURE__ */ t(
|
|
279
279
|
r.Popup,
|
|
280
280
|
{
|
|
281
|
-
className:
|
|
281
|
+
className: a(
|
|
282
282
|
c("combobox-popup"),
|
|
283
283
|
!be && c("combobox-popup--auto-width"),
|
|
284
284
|
b?.portal
|
|
285
285
|
),
|
|
286
286
|
render: je,
|
|
287
|
-
children: /* @__PURE__ */ g("div", { className:
|
|
288
|
-
D && /* @__PURE__ */ g(
|
|
287
|
+
children: /* @__PURE__ */ g("div", { className: a(c("combobox-container")), children: [
|
|
288
|
+
D && /* @__PURE__ */ g(te, { children: [
|
|
289
289
|
/* @__PURE__ */ t(
|
|
290
|
-
|
|
290
|
+
re,
|
|
291
291
|
{
|
|
292
292
|
as: "button",
|
|
293
293
|
type: "button",
|
|
294
|
-
className:
|
|
294
|
+
className: a(c("combobox-select-all")),
|
|
295
295
|
selected: D.checked,
|
|
296
296
|
onClick: D.onToggle,
|
|
297
297
|
indeterminate: D.indeterminate,
|
|
@@ -305,21 +305,21 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
305
305
|
/* @__PURE__ */ t(
|
|
306
306
|
r.List,
|
|
307
307
|
{
|
|
308
|
-
className:
|
|
308
|
+
className: a(c("combobox-list"), b?.list),
|
|
309
309
|
render: Ke,
|
|
310
310
|
children: (e) => {
|
|
311
311
|
const o = i.get(e);
|
|
312
312
|
if (!o) return null;
|
|
313
|
-
const
|
|
314
|
-
return
|
|
315
|
-
|
|
313
|
+
const l = m.includes(e);
|
|
314
|
+
return W ? W(o, {}) : /* @__PURE__ */ t(
|
|
315
|
+
re,
|
|
316
316
|
{
|
|
317
317
|
disabled: o.disabled,
|
|
318
|
-
selected:
|
|
318
|
+
selected: l,
|
|
319
319
|
showCheckbox: n,
|
|
320
320
|
icon: o.icon,
|
|
321
321
|
classNames: {
|
|
322
|
-
root:
|
|
322
|
+
root: a(b?.option),
|
|
323
323
|
icon: b?.optionIcon,
|
|
324
324
|
text: b?.optionText
|
|
325
325
|
},
|
|
@@ -331,7 +331,7 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
331
331
|
disabled: o.disabled,
|
|
332
332
|
...d,
|
|
333
333
|
"data-disabled": o.disabled,
|
|
334
|
-
"data-selected":
|
|
334
|
+
"data-selected": l
|
|
335
335
|
}
|
|
336
336
|
),
|
|
337
337
|
children: o.label
|
|
@@ -341,7 +341,7 @@ const Pe = (s) => /* @__PURE__ */ t(V.Root, { ...s }), je = (s) => /* @__PURE__
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
|
-
/* @__PURE__ */ t(r.Empty, { className:
|
|
344
|
+
/* @__PURE__ */ t(r.Empty, { className: a(c("combobox-empty")), children: /* @__PURE__ */ t($e, { description: "No options found" }) })
|
|
345
345
|
] })
|
|
346
346
|
] })
|
|
347
347
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/combobox/component.tsx"],"sourcesContent":["\"use client\";\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport DisabledContext from \"antd/es/config-provider/DisabledContext\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\nimport React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { BaseMenuItem } from \"../base-menu\";\nimport { useControlledState } from \"../hooks\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { SelectTrigger } from \"../select-trigger\";\nimport { clsx, reactNodeToString, useCls } from \"../utils\";\n\nimport { XIcon } from \"@bioturing/assets\";\nimport { BaseMenu } from \"../base-menu\";\nimport { Empty } from \"../empty\";\nimport type { ComboboxOption, ComboboxProps } from \"./types\";\nimport { hasTokenSeparator, splitBySeparators } from \"./utils\";\nimport { useComboboxTokenInput } from \"./use-combobox-token-input\";\nimport \"./style.css\";\n\nexport type { ComboboxOption, ComboboxProps } from \"./types\";\n\n// Module-level static renderers — avoid recreating on every render\nconst positionerRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Root {...props} />;\nconst popupRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Popup {...props} />;\nconst separatorRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Divider {...props} />;\nconst listRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.List {...props} />;\n\nconst ComboboxInner = <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n {\n options = [],\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"Select...\",\n disabled: disabledProp = false,\n status: statusProp,\n allowClear = false,\n multiple = false as M,\n showSearch: _showSearch = true,\n open: controlledOpen,\n onOpenChange,\n className,\n classNames,\n size = \"middle\",\n optionRender,\n onSearch,\n clearIcon,\n suffixIcon,\n placement = \"bottomLeft\",\n // showSelectionSummary: _showSelectionSummary = false,\n // selectionSummaryRender,\n showSelectAll = false,\n optionLabelRender,\n getOptionKeywords: _getOptionKeywords = (option: ComboboxOption<T, O>) => [\n String(option.value),\n reactNodeToString(option.label),\n ],\n popupMatchSelectWidth = true,\n addOnEnter = false,\n tokenSeparators,\n autoHighlight = true,\n filterOption,\n ...rest\n }: ComboboxProps<T, M, O>,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControlledState(\n controlledValue,\n onChange,\n defaultValue !== undefined ? defaultValue : multiple ? ([] as T[]) : undefined,\n );\n\n const [open, setOpen] = useControlledState(controlledOpen, onOpenChange, false);\n\n const cls = useCls();\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n // Get form context values\n const { status: contextStatus } = useContext(FormItemInputContext);\n const contextDisabled = useContext(DisabledContext);\n\n // Merge context values with props\n const mergedStatus = statusProp || contextStatus;\n const disabled = disabledProp || contextDisabled;\n\n const handleValueChange = useCallback(\n (newValue: M extends true ? T[] : T) => {\n setValue(newValue);\n onChange?.(newValue);\n },\n [setValue, onChange],\n );\n\n const handleSelectAll = useCallback(() => {\n if (multiple) {\n const allValues = options.map((option) => option.value);\n (handleValueChange as (v: T[]) => void)(allValues);\n }\n }, [multiple, options, handleValueChange]);\n\n const handleDeselectAll = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n }\n }, [multiple, handleValueChange]);\n\n const handleClear = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n } else {\n (handleValueChange as (v: T) => void)(undefined as T);\n }\n }, [multiple, handleValueChange]);\n\n // Prepare selected values\n const selectedValues = useMemo(() => {\n return Array.isArray(value) ? value : value ? [value] : [];\n }, [value]);\n\n // Build a Map for O(1) option lookups.\n // `options.find()` was being called 7+ times per render and inside\n // the hot `filter` path on every keystroke.\n const optionMap = useMemo(() => {\n const map = new Map<T, ComboboxOption<T, O>>();\n for (const opt of options) {\n map.set(opt.value, opt);\n }\n return map;\n }, [options]);\n\n // Select all option logic\n const selectAllOption = useMemo(() => {\n if (!showSelectAll || !multiple || options.length === 0) {\n return null;\n }\n\n const selectedFromFiltered = selectedValues.filter((val) => optionMap.has(val as T));\n const checked = selectedFromFiltered.length === options.length && options.length > 0;\n const indeterminate =\n selectedFromFiltered.length > 0 && selectedFromFiltered.length < options.length;\n\n return {\n checked,\n indeterminate,\n onToggle: () => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n },\n };\n }, [showSelectAll, multiple, options, optionMap, selectedValues, handleDeselectAll, handleSelectAll]);\n\n // Convert options to Base UI format\n const baseUIItems = useMemo(() => options.map((opt) => opt.value), [options]);\n\n // Get display value for SelectTrigger\n const displayValue = useMemo(() => {\n if (multiple) {\n return selectedValues.length > 0\n ? `${selectedValues.length} item${selectedValues.length === 1 ? \"\" : \"s\"} selected`\n : null;\n } else {\n const selectedOption = optionMap.get(selectedValues[0] as T);\n return selectedOption?.label || null;\n }\n }, [multiple, selectedValues, optionMap]);\n\n const inputClassName = clsx(\n cls(\"combobox-input\"),\n cls(`combobox-input-${size}`),\n mergedStatus && cls(`combobox-input-${mergedStatus}`),\n classNames?.input,\n );\n\n const itemToStringLabel = useCallback(\n (itemValue: T) => {\n const option = optionMap.get(itemValue);\n return reactNodeToString(option?.label || String(itemValue));\n },\n [optionMap],\n );\n\n const [searchValue, setSearchValue] = useState(\"\");\n\n const { handleAddOnEnter, handleInputValueChange } = useComboboxTokenInput<T, O>({\n addOnEnter,\n multiple,\n tokenSeparators,\n optionMap,\n value: value as T | T[] | undefined,\n handleValueChange: handleValueChange as (nextValue: T | T[]) => void,\n setOpen,\n setSearchValue,\n onSearch,\n });\n\n const hasTokenSeparators = Boolean(tokenSeparators?.length);\n const effectiveAutoHighlight =\n multiple && hasTokenSeparators && hasTokenSeparator(searchValue, tokenSeparators)\n ? false\n : autoHighlight;\n\n const createInputKeyDownHandler = useCallback(\n (currentSearchValue: string) => (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && addOnEnter && currentSearchValue) {\n // In single-select mode with autoHighlight, let Base UI handle Enter\n // to select the natively highlighted item instead of exact matching.\n if (!multiple && autoHighlight) return;\n\n const matched = handleAddOnEnter(currentSearchValue);\n if (matched) {\n event.preventDefault();\n setSearchValue(\"\");\n onSearch?.(\"\");\n }\n }\n },\n [addOnEnter, autoHighlight, multiple, handleAddOnEnter, onSearch],\n );\n\n const mergedFilter = useMemo(() => {\n if (filterOption === false) {\n return null;\n }\n\n if (typeof filterOption === \"function\") {\n return (itemValue: T, query: string) => {\n const option = optionMap.get(itemValue);\n return filterOption(query, option);\n };\n }\n\n return (itemValue: T, query: string) => {\n if (!query) return true;\n const option = optionMap.get(itemValue);\n if (!option) return false;\n\n const tokens =\n tokenSeparators && tokenSeparators.length > 0\n ? splitBySeparators(query, tokenSeparators)\n : [query];\n\n const keywords = _getOptionKeywords(option).map((k) => k.toLowerCase());\n\n const matchingTokenCount = tokens.filter((token) => {\n const lowerToken = token.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerToken));\n }).length;\n\n if (matchingTokenCount === 0) return false;\n if (tokens.length > 1 && matchingTokenCount > 1) {\n const lowerQuery = query.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerQuery));\n }\n return true;\n };\n }, [filterOption, optionMap, tokenSeparators, _getOptionKeywords]);\n\n return (\n <div ref={ref} className={clsx(cls(\"combobox\"), className)} {...rest}>\n <BaseCombobox.Root<T, M>\n value={\n (multiple ? selectedValues : (selectedValues[0] ?? null)) as M extends true\n ? T[]\n : T | null\n }\n onValueChange={(newValue) => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)(\n Array.isArray(newValue) ? (newValue as T[]) : [],\n );\n } else {\n (handleValueChange as (v: T) => void)(newValue as T);\n }\n }}\n inputValue={searchValue}\n onInputValueChange={handleInputValueChange}\n open={open}\n onOpenChange={setOpen}\n multiple={multiple}\n disabled={disabled}\n autoHighlight={effectiveAutoHighlight}\n items={baseUIItems}\n itemToStringLabel={itemToStringLabel}\n filter={mergedFilter}\n >\n {/* Single Selection Layout using SelectTrigger compound components */}\n {!multiple ? (\n <SelectTrigger.Root\n ref={inputContainerRef}\n as=\"div\"\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-single\"))}\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Input\n placeholder={placeholder}\n className={clsx(className, inputClassName)}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n {...rest}\n />\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n ) : (\n /* Multiple Selection Layout using SelectTrigger compound components */\n <SelectTrigger.Root\n ref={inputContainerRef}\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-multiple\"))}\n as=\"div\"\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Chips className={clsx(cls(\"combobox-chips\"), className)} {...rest}>\n <BaseCombobox.Value>\n {(selectedItems) => (\n <>\n {selectedItems.map((item: T) => {\n const option = optionMap.get(item);\n return (\n <BaseCombobox.Chip key={item} className={clsx(cls(\"combobox-chip\"))}>\n {option?.icon && (\n <span className={clsx(cls(\"combobox-chip-icon\"))}>\n {option.icon}\n </span>\n )}\n <span className={clsx(cls(\"combobox-chip-text\"))}>\n {option\n ? optionLabelRender\n ? optionLabelRender(option)\n : option.label\n : item}\n </span>\n <BaseCombobox.ChipRemove\n className={clsx(cls(\"combobox-chip-remove\"))}\n >\n <XIcon />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n );\n })}\n\n <BaseCombobox.Input\n placeholder={selectedItems.length > 0 ? \"\" : placeholder}\n className={inputClassName}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n />\n </>\n )}\n </BaseCombobox.Value>\n </BaseCombobox.Chips>\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n )}\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner\n anchor={inputContainerRef.current}\n sideOffset={4}\n side={placement.startsWith(\"top\") ? \"top\" : \"bottom\"}\n align={\n placement.endsWith(\"Right\")\n ? \"end\"\n : placement === \"top\" || placement === \"bottom\"\n ? \"center\"\n : \"start\"\n }\n render={positionerRender}\n >\n <BaseCombobox.Popup\n className={clsx(\n cls(\"combobox-popup\"),\n !popupMatchSelectWidth && cls(\"combobox-popup--auto-width\"),\n classNames?.portal,\n )}\n render={popupRender}\n >\n <div className={clsx(cls(\"combobox-container\"))}>\n {/* Select All Option */}\n {selectAllOption && (\n <>\n <BaseMenuItem\n as=\"button\"\n type=\"button\"\n className={clsx(cls(\"combobox-select-all\"))}\n selected={selectAllOption.checked}\n onClick={selectAllOption.onToggle}\n indeterminate={selectAllOption.indeterminate}\n showCheckbox\n >\n Select All\n </BaseMenuItem>\n <BaseCombobox.Separator render={separatorRender} />\n </>\n )}\n <ScrollArea fadeEdges>\n <BaseCombobox.List\n className={clsx(cls(\"combobox-list\"), classNames?.list)}\n render={listRender}\n >\n {(item: T) => {\n const option = optionMap.get(item);\n if (!option) return null;\n const isSelected = (selectedValues as T[]).includes(item);\n return optionRender ? (\n optionRender(option, {})\n ) : (\n <BaseMenuItem\n key={option.value}\n disabled={option.disabled}\n selected={isSelected}\n showCheckbox={multiple}\n icon={option.icon}\n classNames={{\n root: clsx(classNames?.option),\n icon: classNames?.optionIcon,\n text: classNames?.optionText,\n }}\n labelRender={\n optionLabelRender\n ? (props: React.HTMLAttributes<HTMLElement>) =>\n optionLabelRender(option, props)\n : undefined\n }\n render={(props: React.HTMLAttributes<HTMLElement>) => (\n <BaseCombobox.Item\n value={item as T}\n disabled={option.disabled}\n {...props}\n data-disabled={option.disabled}\n data-selected={isSelected}\n />\n )}\n >\n {option.label}\n </BaseMenuItem>\n );\n }}\n </BaseCombobox.List>\n\n <BaseCombobox.Empty className={clsx(cls(\"combobox-empty\"))}>\n <Empty description=\"No options found\" />\n </BaseCombobox.Empty>\n </ScrollArea>\n </div>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n </div>\n );\n};\n\nconst MainCombobox = forwardRef(ComboboxInner) as <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n props: ComboboxProps<T, M, O> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReturnType<typeof ComboboxInner>;\n\nexport const Combobox = Object.assign(MainCombobox, {\n // Add any sub components here if needed\n});\n\nexport default Combobox;\n"],"names":["positionerRender","props","jsx","BaseMenu","popupRender","separatorRender","listRender","ComboboxInner","options","controlledValue","defaultValue","onChange","placeholder","disabledProp","statusProp","allowClear","multiple","_showSearch","controlledOpen","onOpenChange","className","classNames","size","optionRender","onSearch","clearIcon","suffixIcon","placement","showSelectAll","optionLabelRender","_getOptionKeywords","option","reactNodeToString","popupMatchSelectWidth","addOnEnter","tokenSeparators","autoHighlight","filterOption","rest","ref","value","setValue","useControlledState","open","setOpen","cls","useCls","inputContainerRef","useRef","contextStatus","useContext","FormItemInputContext","contextDisabled","DisabledContext","mergedStatus","disabled","handleValueChange","useCallback","newValue","handleSelectAll","allValues","handleDeselectAll","handleClear","selectedValues","useMemo","optionMap","map","opt","selectAllOption","selectedFromFiltered","val","checked","indeterminate","baseUIItems","displayValue","inputClassName","clsx","itemToStringLabel","itemValue","searchValue","setSearchValue","useState","handleAddOnEnter","handleInputValueChange","useComboboxTokenInput","hasTokenSeparators","effectiveAutoHighlight","hasTokenSeparator","createInputKeyDownHandler","currentSearchValue","event","mergedFilter","query","tokens","splitBySeparators","keywords","k","matchingTokenCount","token","lowerToken","keyword","lowerQuery","jsxs","BaseCombobox","SelectTrigger","children","selectedItems","Fragment","item","XIcon","icon","BaseMenuItem","ScrollArea","isSelected","Empty","MainCombobox","forwardRef","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAmB,CAACC,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GACrFG,KAAc,CAACH,MAAuC,gBAAAC,EAACC,EAAS,OAAT,EAAgB,GAAGF,GAAO,GACjFI,KAAkB,CAACJ,MAAuC,gBAAAC,EAACC,EAAS,SAAT,EAAkB,GAAGF,GAAO,GACvFK,KAAa,CAACL,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GAE/EM,KAAgB,CAKpB;AAAA,EACE,SAAAC,IAAU,CAAA;AAAA,EACV,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAUC,KAAe;AAAA,EACzB,QAAQC;AAAA,EACR,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AAAA,EACX,Y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AuB,SAAS6C,CAAI;AACxD,iCAAOrF,IACLA,EAAaQ,GAAQ,CAAA,CAAE,IAEvB,gBAAA7B;AAAA,4BAAC6G;AAAA,4BAAA;AAAA,8BAEC,UAAUhF,EAAO;AAAA,8BACjB,UAAUkF;AAAA,8BACV,cAAcjG;AAAA,8BACd,MAAMe,EAAO;AAAA,8BACb,YAAY;AAAA,gCACV,MAAM6C,EAAKvD,GAAY,MAAM;AAAA,gCAC7B,MAAMA,GAAY;AAAA,gCAClB,MAAMA,GAAY;AAAA,8BAAA;AAAA,8BAEpB,aACEQ,IACI,CAAC5B,MACC4B,EAAkBE,GAAQ9B,CAAK,IACjC;AAAA,8BAEN,QAAQ,CAACA,MACP,gBAAAC;AAAA,gCAACqG,EAAa;AAAA,gCAAb;AAAA,kCACC,OAAOK;AAAA,kCACP,UAAU7E,EAAO;AAAA,kCAChB,GAAG9B;AAAA,kCACJ,iBAAe8B,EAAO;AAAA,kCACtB,iBAAekF;AAAA,gCAAA;AAAA,8BAAA;AAAA,8BAIlB,UAAAlF,EAAO;AAAA,4BAAA;AAAA,4BA1BHA,EAAO;AAAA,0BAAA;AAAA,wBA6BlB;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAGF,gBAAA7B,EAACqG,EAAa,OAAb,EAAmB,WAAW3B,EAAK/B,EAAI,gBAAgB,CAAC,GACvD,UAAA,gBAAA3C,EAACgH,IAAA,EAAM,aAAY,oBAAmB,EAAA,CACxC;AAAA,kBAAA,EAAA,CACF;AAAA,gBAAA,EAAA,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEMC,KAAeC,GAAW7G,EAAa,GAQhC8G,KAAW,OAAO,OAAOF,IAAc;AAAA;AAEpD,CAAC;"}
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/combobox/component.tsx"],"sourcesContent":["\"use client\";\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport DisabledContext from \"antd/es/config-provider/DisabledContext\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\nimport React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { BaseMenuItem } from \"../base-menu\";\nimport { useControlledState } from \"../hooks\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { SelectTrigger } from \"../select-trigger\";\nimport { clsx, reactNodeToString, useCls } from \"../utils\";\n\nimport { XIcon } from \"@bioturing/assets\";\nimport { BaseMenu } from \"../base-menu\";\nimport { Empty } from \"../empty\";\nimport type { ComboboxOption, ComboboxProps } from \"./types\";\nimport { hasTokenSeparator, splitBySeparators } from \"./utils\";\nimport { useComboboxTokenInput } from \"./use-combobox-token-input\";\nimport \"./style.css\";\n\nexport type { ComboboxOption, ComboboxProps } from \"./types\";\n\n// Module-level static renderers — avoid recreating on every render\nconst positionerRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Root {...props} />;\nconst popupRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Popup {...props} />;\nconst separatorRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.Divider {...props} />;\nconst listRender = (props: React.ComponentProps<\"div\">) => <BaseMenu.List {...props} />;\n\nconst ComboboxInner = <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n {\n options = [],\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"Select...\",\n disabled: disabledProp = false,\n status: statusProp,\n allowClear = false,\n multiple = false as M,\n showSearch: _showSearch = true,\n open: controlledOpen,\n onOpenChange,\n className,\n classNames,\n size = \"middle\",\n optionRender,\n onSearch,\n clearIcon,\n suffixIcon,\n placement = \"bottomLeft\",\n // showSelectionSummary: _showSelectionSummary = false,\n // selectionSummaryRender,\n showSelectAll = false,\n optionLabelRender,\n getOptionKeywords: _getOptionKeywords = (option: ComboboxOption<T, O>) => [\n String(option.value),\n reactNodeToString(option.label),\n ],\n popupMatchSelectWidth = true,\n addOnEnter = false,\n tokenSeparators,\n autoHighlight = true,\n filterOption,\n ...rest\n }: ComboboxProps<T, M, O>,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControlledState(\n controlledValue,\n onChange,\n defaultValue !== undefined ? defaultValue : multiple ? ([] as T[]) : undefined,\n );\n\n const [open, setOpen] = useControlledState(controlledOpen, onOpenChange, false);\n\n const cls = useCls();\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n // Get form context values\n const { status: contextStatus } = useContext(FormItemInputContext);\n const contextDisabled = useContext(DisabledContext);\n\n // Merge context values with props\n const mergedStatus = statusProp || contextStatus;\n const disabled = disabledProp || contextDisabled;\n\n const handleValueChange = useCallback(\n (newValue: M extends true ? T[] : T) => {\n setValue(newValue);\n },\n [setValue],\n );\n\n const handleSelectAll = useCallback(() => {\n if (multiple) {\n const allValues = options.map((option) => option.value);\n (handleValueChange as (v: T[]) => void)(allValues);\n }\n }, [multiple, options, handleValueChange]);\n\n const handleDeselectAll = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n }\n }, [multiple, handleValueChange]);\n\n const handleClear = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n } else {\n (handleValueChange as (v: T) => void)(undefined as T);\n }\n }, [multiple, handleValueChange]);\n\n // Prepare selected values\n const selectedValues = useMemo(() => {\n return Array.isArray(value) ? value : value ? [value] : [];\n }, [value]);\n\n // Build a Map for O(1) option lookups.\n // `options.find()` was being called 7+ times per render and inside\n // the hot `filter` path on every keystroke.\n const optionMap = useMemo(() => {\n const map = new Map<T, ComboboxOption<T, O>>();\n for (const opt of options) {\n map.set(opt.value, opt);\n }\n return map;\n }, [options]);\n\n // Select all option logic\n const selectAllOption = useMemo(() => {\n if (!showSelectAll || !multiple || options.length === 0) {\n return null;\n }\n\n const selectedFromFiltered = selectedValues.filter((val) => optionMap.has(val as T));\n const checked = selectedFromFiltered.length === options.length && options.length > 0;\n const indeterminate =\n selectedFromFiltered.length > 0 && selectedFromFiltered.length < options.length;\n\n return {\n checked,\n indeterminate,\n onToggle: () => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n },\n };\n }, [showSelectAll, multiple, options, optionMap, selectedValues, handleDeselectAll, handleSelectAll]);\n\n // Convert options to Base UI format\n const baseUIItems = useMemo(() => options.map((opt) => opt.value), [options]);\n\n // Get display value for SelectTrigger\n const displayValue = useMemo(() => {\n if (multiple) {\n return selectedValues.length > 0\n ? `${selectedValues.length} item${selectedValues.length === 1 ? \"\" : \"s\"} selected`\n : null;\n } else {\n const selectedOption = optionMap.get(selectedValues[0] as T);\n return selectedOption?.label || null;\n }\n }, [multiple, selectedValues, optionMap]);\n\n const inputClassName = clsx(\n cls(\"combobox-input\"),\n cls(`combobox-input-${size}`),\n mergedStatus && cls(`combobox-input-${mergedStatus}`),\n classNames?.input,\n );\n\n const itemToStringLabel = useCallback(\n (itemValue: T) => {\n const option = optionMap.get(itemValue);\n return reactNodeToString(option?.label || String(itemValue));\n },\n [optionMap],\n );\n\n const [searchValue, setSearchValue] = useState(\"\");\n\n const { handleAddOnEnter, handleInputValueChange } = useComboboxTokenInput<T, O>({\n addOnEnter,\n multiple,\n tokenSeparators,\n optionMap,\n value: value as T | T[] | undefined,\n handleValueChange: handleValueChange as (nextValue: T | T[]) => void,\n setOpen,\n setSearchValue,\n onSearch,\n });\n\n const hasTokenSeparators = Boolean(tokenSeparators?.length);\n const effectiveAutoHighlight =\n multiple && hasTokenSeparators && hasTokenSeparator(searchValue, tokenSeparators)\n ? false\n : autoHighlight;\n\n const createInputKeyDownHandler = useCallback(\n (currentSearchValue: string) => (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && addOnEnter && currentSearchValue) {\n // In single-select mode with autoHighlight, let Base UI handle Enter\n // to select the natively highlighted item instead of exact matching.\n if (!multiple && autoHighlight) return;\n\n const matched = handleAddOnEnter(currentSearchValue);\n if (matched) {\n event.preventDefault();\n setSearchValue(\"\");\n onSearch?.(\"\");\n }\n }\n },\n [addOnEnter, autoHighlight, multiple, handleAddOnEnter, onSearch],\n );\n\n const mergedFilter = useMemo(() => {\n if (filterOption === false) {\n return null;\n }\n\n if (typeof filterOption === \"function\") {\n return (itemValue: T, query: string) => {\n const option = optionMap.get(itemValue);\n return filterOption(query, option);\n };\n }\n\n return (itemValue: T, query: string) => {\n if (!query) return true;\n const option = optionMap.get(itemValue);\n if (!option) return false;\n\n const tokens =\n tokenSeparators && tokenSeparators.length > 0\n ? splitBySeparators(query, tokenSeparators)\n : [query];\n\n const keywords = _getOptionKeywords(option).map((k) => k.toLowerCase());\n\n const matchingTokenCount = tokens.filter((token) => {\n const lowerToken = token.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerToken));\n }).length;\n\n if (matchingTokenCount === 0) return false;\n if (tokens.length > 1 && matchingTokenCount > 1) {\n const lowerQuery = query.toLowerCase();\n return keywords.some((keyword) => keyword.includes(lowerQuery));\n }\n return true;\n };\n }, [filterOption, optionMap, tokenSeparators, _getOptionKeywords]);\n\n return (\n <div ref={ref} className={clsx(cls(\"combobox\"), className)} {...rest}>\n <BaseCombobox.Root<T, M>\n value={\n (multiple ? selectedValues : (selectedValues[0] ?? null)) as M extends true\n ? T[]\n : T | null\n }\n onValueChange={(newValue) => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)(\n Array.isArray(newValue) ? (newValue as T[]) : [],\n );\n } else {\n (handleValueChange as (v: T) => void)(newValue as T);\n }\n }}\n inputValue={multiple ? searchValue : undefined}\n onInputValueChange={handleInputValueChange}\n open={open}\n onOpenChange={setOpen}\n multiple={multiple}\n disabled={disabled}\n autoHighlight={effectiveAutoHighlight}\n items={baseUIItems}\n itemToStringLabel={itemToStringLabel}\n filter={mergedFilter}\n >\n {/* Single Selection Layout using SelectTrigger compound components */}\n {!multiple ? (\n <SelectTrigger.Root\n ref={inputContainerRef}\n as=\"div\"\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-single\"))}\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Input\n placeholder={placeholder}\n className={clsx(className, inputClassName)}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n {...rest}\n />\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n ) : (\n /* Multiple Selection Layout using SelectTrigger compound components */\n <SelectTrigger.Root\n ref={inputContainerRef}\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(classNames?.trigger, cls(\"combobox-trigger-multiple\"))}\n as=\"div\"\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Chips className={clsx(cls(\"combobox-chips\"), className)} {...rest}>\n <BaseCombobox.Value>\n {(selectedItems) => (\n <>\n {selectedItems.map((item: T) => {\n const option = optionMap.get(item);\n return (\n <BaseCombobox.Chip key={item} className={clsx(cls(\"combobox-chip\"))}>\n {option?.icon && (\n <span className={clsx(cls(\"combobox-chip-icon\"))}>\n {option.icon}\n </span>\n )}\n <span className={clsx(cls(\"combobox-chip-text\"))}>\n {option\n ? optionLabelRender\n ? optionLabelRender(option)\n : option.label\n : item}\n </span>\n <BaseCombobox.ChipRemove\n className={clsx(cls(\"combobox-chip-remove\"))}\n >\n <XIcon />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n );\n })}\n\n <BaseCombobox.Input\n placeholder={selectedItems.length > 0 ? \"\" : placeholder}\n className={inputClassName}\n disabled={disabled}\n onKeyDown={createInputKeyDownHandler(searchValue)}\n />\n </>\n )}\n </BaseCombobox.Value>\n </BaseCombobox.Chips>\n )}\n />\n <SelectTrigger.Clear\n render={(props) => <BaseCombobox.Clear {...props}></BaseCombobox.Clear>}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n )}\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner\n anchor={inputContainerRef.current}\n sideOffset={4}\n side={placement.startsWith(\"top\") ? \"top\" : \"bottom\"}\n align={\n placement.endsWith(\"Right\")\n ? \"end\"\n : placement === \"top\" || placement === \"bottom\"\n ? \"center\"\n : \"start\"\n }\n render={positionerRender}\n >\n <BaseCombobox.Popup\n className={clsx(\n cls(\"combobox-popup\"),\n !popupMatchSelectWidth && cls(\"combobox-popup--auto-width\"),\n classNames?.portal,\n )}\n render={popupRender}\n >\n <div className={clsx(cls(\"combobox-container\"))}>\n {/* Select All Option */}\n {selectAllOption && (\n <>\n <BaseMenuItem\n as=\"button\"\n type=\"button\"\n className={clsx(cls(\"combobox-select-all\"))}\n selected={selectAllOption.checked}\n onClick={selectAllOption.onToggle}\n indeterminate={selectAllOption.indeterminate}\n showCheckbox\n >\n Select All\n </BaseMenuItem>\n <BaseCombobox.Separator render={separatorRender} />\n </>\n )}\n <ScrollArea fadeEdges>\n <BaseCombobox.List\n className={clsx(cls(\"combobox-list\"), classNames?.list)}\n render={listRender}\n >\n {(item: T) => {\n const option = optionMap.get(item);\n if (!option) return null;\n const isSelected = (selectedValues as T[]).includes(item);\n return optionRender ? (\n optionRender(option, {})\n ) : (\n <BaseMenuItem\n key={option.value}\n disabled={option.disabled}\n selected={isSelected}\n showCheckbox={multiple}\n icon={option.icon}\n classNames={{\n root: clsx(classNames?.option),\n icon: classNames?.optionIcon,\n text: classNames?.optionText,\n }}\n labelRender={\n optionLabelRender\n ? (props: React.HTMLAttributes<HTMLElement>) =>\n optionLabelRender(option, props)\n : undefined\n }\n render={(props: React.HTMLAttributes<HTMLElement>) => (\n <BaseCombobox.Item\n value={item as T}\n disabled={option.disabled}\n {...props}\n data-disabled={option.disabled}\n data-selected={isSelected}\n />\n )}\n >\n {option.label}\n </BaseMenuItem>\n );\n }}\n </BaseCombobox.List>\n\n <BaseCombobox.Empty className={clsx(cls(\"combobox-empty\"))}>\n <Empty description=\"No options found\" />\n </BaseCombobox.Empty>\n </ScrollArea>\n </div>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n </div>\n );\n};\n\nconst MainCombobox = forwardRef(ComboboxInner) as <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {},\n>(\n props: ComboboxProps<T, M, O> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReturnType<typeof ComboboxInner>;\n\nexport const Combobox = Object.assign(MainCombobox, {\n // Add any sub components here if needed\n});\n\nexport default Combobox;\n"],"names":["positionerRender","props","jsx","BaseMenu","popupRender","separatorRender","listRender","ComboboxInner","options","controlledValue","defaultValue","onChange","placeholder","disabledProp","statusProp","allowClear","multiple","_showSearch","controlledOpen","onOpenChange","className","classNames","size","optionRender","onSearch","clearIcon","suffixIcon","placement","showSelectAll","optionLabelRender","_getOptionKeywords","option","reactNodeToString","popupMatchSelectWidth","addOnEnter","tokenSeparators","autoHighlight","filterOption","rest","ref","value","setValue","useControlledState","open","setOpen","cls","useCls","inputContainerRef","useRef","contextStatus","useContext","FormItemInputContext","contextDisabled","DisabledContext","mergedStatus","disabled","handleValueChange","useCallback","newValue","handleSelectAll","allValues","handleDeselectAll","handleClear","selectedValues","useMemo","optionMap","map","opt","selectAllOption","selectedFromFiltered","val","checked","indeterminate","baseUIItems","displayValue","inputClassName","clsx","itemToStringLabel","itemValue","searchValue","setSearchValue","useState","handleAddOnEnter","handleInputValueChange","useComboboxTokenInput","hasTokenSeparators","effectiveAutoHighlight","hasTokenSeparator","createInputKeyDownHandler","currentSearchValue","event","mergedFilter","query","tokens","splitBySeparators","keywords","k","matchingTokenCount","token","lowerToken","keyword","lowerQuery","jsxs","BaseCombobox","SelectTrigger","children","selectedItems","Fragment","item","XIcon","icon","BaseMenuItem","ScrollArea","isSelected","Empty","MainCombobox","forwardRef","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAmB,CAACC,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GACrFG,KAAc,CAACH,MAAuC,gBAAAC,EAACC,EAAS,OAAT,EAAgB,GAAGF,GAAO,GACjFI,KAAkB,CAACJ,MAAuC,gBAAAC,EAACC,EAAS,SAAT,EAAkB,GAAGF,GAAO,GACvFK,KAAa,CAACL,MAAuC,gBAAAC,EAACC,EAAS,MAAT,EAAe,GAAGF,GAAO,GAE/EM,KAAgB,CAKpB;AAAA,EACE,SAAAC,IAAU,CAAA;AAAA,EACV,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAUC,KAAe;AAAA,EACzB,QAAQC;AAAA,EACR,YAAAC,IAAa;AAAA,EACb,UAAAC,IAAW;AAAA,EACX,YAAYC,KAAc;AAAA,EAC1B,MAAMC;AAAA,EACN,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA;AAAA;AAAA,EAGZ,eAAAC,IAAgB;AAAA,EAChB,mBA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B,MAAMA,GAAY;AAAA,gCAClB,MAAMA,GAAY;AAAA,8BAAA;AAAA,8BAEpB,aACEQ,IACI,CAAC5B,MACC4B,EAAkBE,GAAQ9B,CAAK,IACjC;AAAA,8BAEN,QAAQ,CAACA,MACP,gBAAAC;AAAA,gCAACqG,EAAa;AAAA,gCAAb;AAAA,kCACC,OAAOK;AAAA,kCACP,UAAU7E,EAAO;AAAA,kCAChB,GAAG9B;AAAA,kCACJ,iBAAe8B,EAAO;AAAA,kCACtB,iBAAekF;AAAA,gCAAA;AAAA,8BAAA;AAAA,8BAIlB,UAAAlF,EAAO;AAAA,4BAAA;AAAA,4BA1BHA,EAAO;AAAA,0BAAA;AAAA,wBA6BlB;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAGF,gBAAA7B,EAACqG,EAAa,OAAb,EAAmB,WAAW3B,EAAK/B,EAAI,gBAAgB,CAAC,GACvD,UAAA,gBAAA3C,EAACgH,IAAA,EAAM,aAAY,oBAAmB,EAAA,CACxC;AAAA,kBAAA,EAAA,CACF;AAAA,gBAAA,EAAA,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEMC,KAAeC,GAAW7G,EAAa,GAQhC8G,KAAW,OAAO,OAAOF,IAAc;AAAA;AAEpD,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-combobox{position:relative;display:inline-block;width:100%}.ds-combobox-popup{width:var(--anchor-width)}.ds-combobox-popup--auto-width{width:max-content;min-width:var(--anchor-width);max-width:var(--available-width)}.ds-combobox-input{flex:1;border:none;outline:none;background:transparent;color:var(--ds-color-text);min-width:0}.ds-combobox-input::placeholder{color:var(--ds-color-text-placeholder)}.ds-combobox-divider{border:none;border-bottom:1px solid var(--ds-color-split);margin:.25rem 0}.ds-combobox-chip{display:inline-flex;align-items:center;gap:.25rem;background:var(--ds-color-fill-secondary);border-radius:var(--ds-border-radius-sm);padding:.25rem .5rem;font-size:var(--ds-font-size);color:var(--ds-color-text);max-width:100%;min-width:0;height:var(--ds-control-line-height)}.ds-combobox-chip-icon{display:flex;align-items:center;flex-shrink:0;font-size:.75rem}.ds-combobox-chip-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ds-combobox-chip-remove{display:flex;align-items:center;justify-content:center;padding:.125rem;border-radius:var(--ds-border-radius-lg);cursor:pointer;color:var(--ds-color-text-secondary);transition:all .2s var(--ds-motion-ease-out);background:none;border:none;font-size:.875rem;line-height:1}.ds-combobox-chip-remove:hover{background:var(--ds-control-item-bg-hover);color:var(--ds-color-text)}.ds-combobox-chips-container .ds-combobox-input{flex:1;min-width:120px;border:none;background:transparent;padding:.25rem 0;margin:0}.ds-combobox-chips{display:flex;flex-wrap:wrap;gap:.375rem}.ds-select-trigger-small .ds-combobox-chips{gap:.25rem}.ds-combobox-trigger-multiple.ds-select-trigger-has-value .ds-select-trigger-content{padding-left:.5rem}.ds-combobox[data-disabled=true] .ds-combobox-chip{background-color:var(--ds-color-bg-disabled);color:var(--ds-color-text-disabled)}.ds-combobox[data-disabled=true] .ds-combobox-chip-remove{cursor:not-allowed;color:var(--ds-color-text-disabled)}.ds-combobox-empty{padding:1rem}.ds-combobox-empty:empty{display:none}.ds-combobox-container{display:flex;flex-direction:column;flex-shrink:1;min-height:0
|
|
1
|
+
@layer components{.ds-combobox{position:relative;display:inline-block;width:100%}.ds-combobox-popup{width:var(--anchor-width)}.ds-combobox-popup--auto-width{width:max-content;min-width:var(--anchor-width);max-width:var(--available-width)}.ds-combobox-input{flex:1;border:none;outline:none;background:transparent;color:var(--ds-color-text);min-width:0}.ds-combobox-input::placeholder{color:var(--ds-color-text-placeholder)}.ds-combobox-divider{border:none;border-bottom:1px solid var(--ds-color-split);margin:.25rem 0}.ds-combobox-chip{display:inline-flex;align-items:center;gap:.25rem;background:var(--ds-color-fill-secondary);border-radius:var(--ds-border-radius-sm);padding:.25rem .5rem;font-size:var(--ds-font-size);color:var(--ds-color-text);max-width:100%;min-width:0;height:var(--ds-control-line-height)}.ds-combobox-chip-icon{display:flex;align-items:center;flex-shrink:0;font-size:.75rem}.ds-combobox-chip-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ds-combobox-chip-remove{display:flex;align-items:center;justify-content:center;padding:.125rem;border-radius:var(--ds-border-radius-lg);cursor:pointer;color:var(--ds-color-text-secondary);transition:all .2s var(--ds-motion-ease-out);background:none;border:none;font-size:.875rem;line-height:1}.ds-combobox-chip-remove:hover{background:var(--ds-control-item-bg-hover);color:var(--ds-color-text)}.ds-combobox-chips-container .ds-combobox-input{flex:1;min-width:120px;border:none;background:transparent;padding:.25rem 0;margin:0}.ds-combobox-chips{display:flex;flex-wrap:wrap;gap:.375rem}.ds-select-trigger-small .ds-combobox-chips{gap:.25rem}.ds-combobox-trigger-multiple.ds-select-trigger-has-value .ds-select-trigger-content{padding-left:.5rem}.ds-combobox[data-disabled=true] .ds-combobox-chip{background-color:var(--ds-color-bg-disabled);color:var(--ds-color-text-disabled)}.ds-combobox[data-disabled=true] .ds-combobox-chip-remove{cursor:not-allowed;color:var(--ds-color-text-disabled)}.ds-combobox-empty{padding:1rem}.ds-combobox-empty:empty{display:none}.ds-combobox-container{display:flex;flex-direction:column;flex-shrink:1;min-height:0}.ds-combobox-popup .ds-menu-item-show-checkbox:not([data-disabled=true])[data-selected=true]{background:transparent}.ds-combobox-popup .ds-menu-item-show-checkbox[data-selected=true]:not([data-disabled=true]):hover,.ds-combobox-popup .ds-menu-item-show-checkbox[data-selected=true][data-highlighted]:not([data-disabled=true]),.ds-combobox-popup .ds-menu-item-show-checkbox[data-selected=true][data-active=true]:not([data-disabled=true]){background:var(--ds-control-item-bg-active)}.ds-combobox-popup .ds-menu-item-show-checkbox:not([data-disabled=true]):not([data-selected=true]):hover,.ds-combobox-popup .ds-menu-item-show-checkbox:not([data-disabled=true]):not([data-selected=true])[data-highlighted],.ds-combobox-popup .ds-menu-item-show-checkbox:not([data-disabled=true]):not([data-selected=true])[data-active=true]{background:var(--ds-control-item-bg-hover)}.ds-combobox-popup .ds-menu-item-base:not([data-disabled=true])[data-selected=true] .ds-menu-item-text{font-weight:600}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/component.tsx"],"names":[],"mappings":"AACA,OAAc,EAKZ,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,aAAa,CAAC;AACrB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAU/B,QAAA,MAAM,cAAc,GAClB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEhE,OAAO,cAAc,CAAC,UAAU,CAAC,EACjC,KAAK,GAAG,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/component.tsx"],"names":[],"mappings":"AACA,OAAc,EAKZ,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,aAAa,CAAC;AACrB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAU/B,QAAA,MAAM,cAAc,GAClB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEhE,OAAO,cAAc,CAAC,UAAU,CAAC,EACjC,KAAK,GAAG,CAAC,YAAY,CAAC,4CAoLvB,CAAC;AAQF,eAAO,MAAM,SAAS,GALpB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,mCAE/B,cAAc,CAAC,UAAU,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;CAAE,KAC5D,UAAU,CAAC,OAAO,cAAc,CAEK,CAAC"}
|