@stackone/malachite 2.101.1 → 2.103.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/COMPONENTS.md +2 -2
- package/dist/components/FilterSearch.js +423 -308
- package/dist/components/FilterSearch.js.map +1 -1
- package/dist/components/SidePanelNavFooter.js +44 -17
- package/dist/components/SidePanelNavFooter.js.map +1 -1
- package/dist/components/filterSearchModel.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsxs as m, Fragment as Z, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import ft, { useId as ht, useState as z, useRef as w, useEffect as W, useMemo as q, useCallback as ne, useLayoutEffect as Pe, useInsertionEffect as gt } from "react";
|
|
3
|
+
import { createPortal as xt } from "react-dom";
|
|
4
|
+
import bt from "./CustomIcons/CaretDownIcon.js";
|
|
5
|
+
import vt from "./CustomIcons/CheckmarkIcon.js";
|
|
6
|
+
import ze from "./CustomIcons/DismissIcon.js";
|
|
7
|
+
import yt from "./CustomIcons/FilterIcon.js";
|
|
8
|
+
import Be from "./CustomIcons/SearchIcon.js";
|
|
9
|
+
import We from "./Spinner.js";
|
|
10
|
+
import { CONTROL_TEXT_SIZE_CLASS as de, CONTROL_TEXT_SIZE as wt } from "./controlTextSize.js";
|
|
11
|
+
import { controlWidthStyle as kt } from "./controlWidth.js";
|
|
12
|
+
import { getTriggerVisual as St, DROPDOWN_TRIGGER_ATTR as Nt } from "./dropdownTriggerStyle.js";
|
|
13
|
+
import { pushEscapeLayer as Rt } from "./escapeLayers.js";
|
|
14
|
+
import { orderSelections as It, resolveMode as $t, openFilterOf as Et, filterRows as Ge, searchRows as Ct, chipText as Tt, removeFilter as _t, commitText as Lt, selectAll as At, deselectAll as Dt, toggleValue as Mt, clearAll as Ht } from "./filterSearchModel.js";
|
|
15
|
+
import { ensureFilterSearchStyles as Ft, FILTER_SEARCH_CLASS as L } from "./filterSearchStyles.js";
|
|
16
|
+
import { measureMenuGeometry as Ot, MENU_MAX_HEIGHT_PX as Pt, MENU_SPECS as B } from "./floatingMenuGeometry.js";
|
|
17
|
+
import { FOCUS_RING_INSET as Ue, FOCUS_RING as Ve } from "./focusRing.js";
|
|
18
|
+
import { usePopupLayer as zt } from "./overlayLayers.js";
|
|
19
|
+
import { useTopLayer as Wt } from "./topLayer.js";
|
|
20
|
+
import { useFollowTrigger as Gt } from "./useFollowTrigger.js";
|
|
21
|
+
import { useLatestRef as ue } from "./useLatestRef.js";
|
|
22
|
+
const Ut = {
|
|
23
|
+
small: `min-h-[var(--malachite-control-height-small,28px)] gap-1 px-2.5 py-[2px] ${de.small} rounded-[var(--malachite-radius-10,10px)]`,
|
|
24
|
+
medium: `min-h-[var(--malachite-control-height-medium,32px)] gap-1 px-3 py-[3px] ${de.medium} rounded-xl`,
|
|
25
|
+
large: `min-h-[var(--malachite-control-height-large,42px)] gap-1.5 px-4 py-[6px] ${de.large} rounded-[var(--malachite-radius-xxl,14px)]`
|
|
26
|
+
}, Vt = {
|
|
26
27
|
small: "gap-1",
|
|
27
28
|
medium: "gap-1",
|
|
28
29
|
large: "gap-1.5"
|
|
29
|
-
},
|
|
30
|
-
resting:
|
|
31
|
-
active:
|
|
32
|
-
|
|
30
|
+
}, je = "bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-primary,rgb(10,10,10))]", _ = {
|
|
31
|
+
resting: `border-[var(--malachite-card-border,rgb(232,232,232))] ${je}`,
|
|
32
|
+
active: `border-[var(--malachite-accent-background,rgb(0,175,102))] ${je}`,
|
|
33
|
+
muted: "bg-[var(--malachite-tag-default-background,rgba(123,123,123,0.1))] text-[var(--malachite-text-secondary,rgb(123,123,123))]",
|
|
34
|
+
divider: "border-0 border-r border-solid border-[var(--malachite-card-border,rgb(232,232,232))]"
|
|
35
|
+
}, jt = 5, Xt = 440, Kt = 2, me = (i) => !!i && !(i.kind === "item" && i.row.item.disabled), qt = (i) => {
|
|
33
36
|
switch (i.kind) {
|
|
34
37
|
case "text":
|
|
35
38
|
return "text";
|
|
@@ -40,11 +43,11 @@ const Nt = {
|
|
|
40
43
|
case "item":
|
|
41
44
|
return `item:${i.row.filter.value}:${i.row.item.value}`;
|
|
42
45
|
}
|
|
43
|
-
},
|
|
44
|
-
for (let
|
|
45
|
-
if (
|
|
46
|
+
}, Bt = (i, y) => {
|
|
47
|
+
for (let o = Math.max(y, 0); o < i.length; o++)
|
|
48
|
+
if (me(i[o])) return o;
|
|
46
49
|
return -1;
|
|
47
|
-
},
|
|
50
|
+
}, Zt = {
|
|
48
51
|
display: "flex",
|
|
49
52
|
alignItems: "center",
|
|
50
53
|
gap: 8,
|
|
@@ -57,38 +60,43 @@ const Nt = {
|
|
|
57
60
|
font: "inherit",
|
|
58
61
|
cursor: "pointer",
|
|
59
62
|
minWidth: 0
|
|
60
|
-
},
|
|
63
|
+
}, Xe = {
|
|
61
64
|
borderRadius: 6,
|
|
62
65
|
padding: "2px 6px",
|
|
63
66
|
flexShrink: 0,
|
|
64
67
|
whiteSpace: "nowrap"
|
|
65
|
-
},
|
|
68
|
+
}, Y = {
|
|
66
69
|
overflow: "hidden",
|
|
67
70
|
textOverflow: "ellipsis",
|
|
68
71
|
whiteSpace: "nowrap",
|
|
69
72
|
minWidth: 0
|
|
70
|
-
},
|
|
73
|
+
}, Ke = { ...Y, marginLeft: "auto", flexShrink: 1 }, Yt = {
|
|
74
|
+
display: "inline-flex",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
flexShrink: 0
|
|
77
|
+
}, qe = (i) => i.preventDefault(), Jt = (i) => {
|
|
71
78
|
i.preventDefault(), i.stopPropagation();
|
|
72
|
-
},
|
|
79
|
+
}, Qt = ({ row: i, showFilter: y }) => {
|
|
73
80
|
if (i.kind === "text")
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ m(Z, { children: [
|
|
82
|
+
/* @__PURE__ */ l(Be, { size: 13, style: { flexShrink: 0 } }),
|
|
83
|
+
/* @__PURE__ */ l("span", { style: Y, children: `${i.label} "${i.text}"` })
|
|
77
84
|
] });
|
|
78
85
|
if (i.kind === "filter")
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
i.filter.info && /* @__PURE__ */
|
|
82
|
-
i.filter.example && /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ m(Z, { children: [
|
|
87
|
+
/* @__PURE__ */ l("span", { className: L.pill, style: Xe, children: i.filter.label }),
|
|
88
|
+
i.filter.info && /* @__PURE__ */ l("span", { style: Y, children: i.filter.info }),
|
|
89
|
+
i.filter.example && /* @__PURE__ */ l("span", { className: L.hint, style: Ke, children: i.filter.example })
|
|
83
90
|
] });
|
|
84
91
|
if (i.kind === "toggle")
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
const { item:
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
return /* @__PURE__ */ l("span", { style: { color: "var(--malachite-text-primary, rgb(10, 10, 10))" }, children: i.toggle === "select" ? "Select All" : "Deselect All" });
|
|
93
|
+
const { item: o, filter: A, selected: G } = i.row;
|
|
94
|
+
return /* @__PURE__ */ m(Z, { children: [
|
|
95
|
+
y && /* @__PURE__ */ l("span", { className: L.pill, style: Xe, children: A.label }),
|
|
96
|
+
o.icon && /* @__PURE__ */ l("span", { style: Yt, children: o.icon }),
|
|
97
|
+
/* @__PURE__ */ l("span", { style: Y, children: o.label }),
|
|
98
|
+
G ? /* @__PURE__ */ l(
|
|
99
|
+
vt,
|
|
92
100
|
{
|
|
93
101
|
size: 16,
|
|
94
102
|
style: {
|
|
@@ -97,317 +105,404 @@ const Nt = {
|
|
|
97
105
|
color: "var(--malachite-accent-background, rgb(0, 175, 102))"
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
|
-
) :
|
|
108
|
+
) : y && A.info && /* @__PURE__ */ l("span", { className: L.hint, style: Ke, children: A.info })
|
|
101
109
|
] });
|
|
102
|
-
},
|
|
110
|
+
}, wr = ({
|
|
103
111
|
filters: i,
|
|
104
|
-
searchFilters:
|
|
105
|
-
value:
|
|
106
|
-
onChange:
|
|
107
|
-
onClear:
|
|
108
|
-
onActiveFilterChange:
|
|
109
|
-
onQueryChange:
|
|
110
|
-
textFilter:
|
|
111
|
-
placeholder:
|
|
112
|
-
size:
|
|
113
|
-
width:
|
|
114
|
-
loading:
|
|
115
|
-
disabled:
|
|
116
|
-
clearable:
|
|
117
|
-
maxVisibleChips:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"aria-
|
|
112
|
+
searchFilters: y,
|
|
113
|
+
value: o,
|
|
114
|
+
onChange: A,
|
|
115
|
+
onClear: G,
|
|
116
|
+
onActiveFilterChange: Ze,
|
|
117
|
+
onQueryChange: Ye,
|
|
118
|
+
textFilter: D,
|
|
119
|
+
placeholder: ie = "Search",
|
|
120
|
+
size: le = "medium",
|
|
121
|
+
width: Je,
|
|
122
|
+
loading: g = !1,
|
|
123
|
+
disabled: f = !1,
|
|
124
|
+
clearable: Qe = !1,
|
|
125
|
+
maxVisibleChips: et = 4,
|
|
126
|
+
filtersButton: M = !1,
|
|
127
|
+
className: tt = "",
|
|
128
|
+
style: rt,
|
|
129
|
+
id: nt,
|
|
130
|
+
"aria-label": pe,
|
|
131
|
+
"aria-labelledby": fe
|
|
123
132
|
}) => {
|
|
124
|
-
var
|
|
125
|
-
const
|
|
126
|
-
|
|
133
|
+
var Oe;
|
|
134
|
+
const he = ht(), ge = `${he}-listbox`, xe = (e) => `${he}-option-${e}`, [c, J] = z(!1), [p, k] = z(""), N = ue(Ye), oe = w("");
|
|
135
|
+
W(() => {
|
|
127
136
|
var e;
|
|
128
|
-
|
|
129
|
-
}, [
|
|
137
|
+
oe.current !== p && (oe.current = p, (e = N.current) == null || e.call(N, p));
|
|
138
|
+
}, [p, N]), W(
|
|
130
139
|
() => () => {
|
|
131
140
|
var e;
|
|
132
|
-
|
|
141
|
+
oe.current !== "" && ((e = N.current) == null || e.call(N, ""));
|
|
133
142
|
},
|
|
134
|
-
[
|
|
143
|
+
[N]
|
|
135
144
|
);
|
|
136
|
-
const [
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
145
|
+
const [d, it] = z(null), [be, x] = z(0), [h, ve] = z(null), [Q, se] = z(!1), C = w(null), ye = w(null), H = w(null), R = w(null), ee = w(null), we = w([]);
|
|
146
|
+
Wt(R, c);
|
|
147
|
+
const lt = zt("multiselect", c, R), ke = w(/* @__PURE__ */ new Map()), U = q(() => {
|
|
148
|
+
const e = new Map(ke.current), t = /* @__PURE__ */ new Set();
|
|
149
|
+
for (const n of [...y ?? [], ...i]) {
|
|
150
|
+
const r = e.get(n.value), a = new Map(r == null ? void 0 : r.items), s = new Map(r == null ? void 0 : r.icons);
|
|
151
|
+
for (const u of n.items) {
|
|
152
|
+
a.set(u.value, u.label);
|
|
153
|
+
const v = `${n.value}\0${u.value}`;
|
|
154
|
+
u.icon ? (s.set(u.value, u.icon), t.add(v)) : t.has(v) || s.delete(u.value);
|
|
155
|
+
}
|
|
143
156
|
e.set(n.value, {
|
|
144
157
|
label: n.label,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
])
|
|
158
|
+
chipLabel: n.chipLabel !== !1,
|
|
159
|
+
items: a,
|
|
160
|
+
icons: s
|
|
149
161
|
});
|
|
150
162
|
}
|
|
151
163
|
return e;
|
|
152
|
-
}, [i,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}, [
|
|
156
|
-
const
|
|
157
|
-
() =>
|
|
158
|
-
[
|
|
164
|
+
}, [i, y]);
|
|
165
|
+
W(() => {
|
|
166
|
+
ke.current = U;
|
|
167
|
+
}, [U]);
|
|
168
|
+
const Se = w([]), V = q(
|
|
169
|
+
() => It(o, Se.current, d),
|
|
170
|
+
[o, d]
|
|
159
171
|
);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
const
|
|
164
|
-
() =>
|
|
165
|
-
[
|
|
166
|
-
),
|
|
172
|
+
W(() => {
|
|
173
|
+
Se.current = V;
|
|
174
|
+
}, [V]);
|
|
175
|
+
const b = $t(d, p), ae = y ?? i, T = q(
|
|
176
|
+
() => Et(d, i, y, o),
|
|
177
|
+
[d, i, y, o]
|
|
178
|
+
), Ne = w(d), te = ue(Ze), I = ne(
|
|
167
179
|
(e) => {
|
|
168
180
|
var t;
|
|
169
|
-
|
|
181
|
+
Ne.current !== e && (Ne.current = e, it(e), (t = te.current) == null || t.call(te, e));
|
|
170
182
|
},
|
|
171
|
-
[
|
|
172
|
-
), F =
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
175
|
-
const { toggle: e, items: t } =
|
|
183
|
+
[te]
|
|
184
|
+
), F = D == null ? void 0 : D.value, j = D == null ? void 0 : D.label, S = q(() => {
|
|
185
|
+
if (g) return [];
|
|
186
|
+
if (b === "filters") return i.map((r) => ({ kind: "filter", filter: r }));
|
|
187
|
+
const { toggle: e, items: t } = b === "items" ? Ge(T, o, p) : Ct(ae, o, p);
|
|
176
188
|
return [
|
|
177
|
-
...
|
|
189
|
+
...b === "search" && j !== void 0 ? [{ kind: "text", label: j, text: p.trim() }] : [],
|
|
178
190
|
...e ? [{ kind: "toggle", toggle: e }] : [],
|
|
179
191
|
...t.map((r) => ({ kind: "item", row: r }))
|
|
180
192
|
];
|
|
181
|
-
}, [
|
|
182
|
-
const e = new Map(
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
return r ===
|
|
186
|
-
if (!s &&
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
193
|
+
}, [g, b, i, ae, T, o, p, j]), re = q(() => {
|
|
194
|
+
const e = new Map(o.map((r) => [r.filter, r.items])), t = (r) => {
|
|
195
|
+
const a = r === F, s = a ? void 0 : U.get(r), u = a ? j ?? r : (s == null ? void 0 : s.label) ?? r, v = e.get(r);
|
|
196
|
+
if (!v)
|
|
197
|
+
return r === d ? [{ filter: r, text: u, label: u, values: [] }] : [];
|
|
198
|
+
if (!a && !s && g) return [];
|
|
199
|
+
const E = v.map((P) => ({
|
|
200
|
+
value: P,
|
|
201
|
+
label: (s == null ? void 0 : s.items.get(P)) ?? P,
|
|
202
|
+
icon: s == null ? void 0 : s.icons.get(P)
|
|
203
|
+
}));
|
|
204
|
+
return [
|
|
205
|
+
{
|
|
206
|
+
filter: r,
|
|
207
|
+
text: Tt(
|
|
208
|
+
u,
|
|
209
|
+
E.map((P) => P.label)
|
|
210
|
+
),
|
|
211
|
+
// With no values to show, the chip keeps its name rather than drawing empty.
|
|
212
|
+
label: (s == null ? void 0 : s.chipLabel) === !1 && E.length > 0 ? null : u,
|
|
213
|
+
values: E
|
|
214
|
+
}
|
|
215
|
+
];
|
|
216
|
+
}, n = d !== null && !V.includes(d);
|
|
217
|
+
return [...V, ...n ? [d] : []].flatMap(t);
|
|
218
|
+
}, [V, o, U, g, d, F, j]), Re = re.slice(0, et), Ie = re.length - Re.length, X = ne(
|
|
192
219
|
({ next: e, changes: t }) => {
|
|
193
|
-
t.length > 0 &&
|
|
220
|
+
t.length > 0 && A(e, t);
|
|
194
221
|
},
|
|
195
|
-
[
|
|
196
|
-
),
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
|
|
200
|
-
},
|
|
222
|
+
[A]
|
|
223
|
+
), $ = ne(() => {
|
|
224
|
+
J(!1), k(""), I(null), ve(null), se(!1);
|
|
225
|
+
}, [I]), ce = () => {
|
|
226
|
+
f || c || (x(0), J(!0));
|
|
227
|
+
}, K = ne(() => {
|
|
201
228
|
const e = C.current;
|
|
202
|
-
e
|
|
203
|
-
|
|
204
|
-
|
|
229
|
+
if (!e) return;
|
|
230
|
+
const t = e.getBoundingClientRect(), n = Q ? ye.current : null, r = n == null ? void 0 : n.getBoundingClientRect();
|
|
231
|
+
ve(
|
|
232
|
+
Ot(R.current, {
|
|
233
|
+
// The field's edges top and bottom, so the menu clears the bar however tall it wraps.
|
|
234
|
+
triggerRect: r ? {
|
|
235
|
+
top: t.top,
|
|
236
|
+
bottom: t.bottom,
|
|
237
|
+
left: r.left,
|
|
238
|
+
right: r.right,
|
|
239
|
+
width: r.width
|
|
240
|
+
} : t,
|
|
205
241
|
preset: "standard",
|
|
242
|
+
...r && { minWidth: Xt, align: "right" },
|
|
206
243
|
viewportWidth: window.innerWidth,
|
|
207
244
|
viewportHeight: window.innerHeight
|
|
208
245
|
})
|
|
209
246
|
);
|
|
210
|
-
}, []);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}, [
|
|
214
|
-
if (!
|
|
215
|
-
const e = (
|
|
216
|
-
const
|
|
217
|
-
(!
|
|
247
|
+
}, [Q]), $e = ue(K);
|
|
248
|
+
Gt(c, C, K, $), W(() => {
|
|
249
|
+
f && c && $();
|
|
250
|
+
}, [f, c, $]), W(() => {
|
|
251
|
+
if (!c) return;
|
|
252
|
+
const e = (a) => {
|
|
253
|
+
const s = a.composedPath(), u = C.current, v = R.current;
|
|
254
|
+
(!u || !s.includes(u)) && (!v || !s.includes(v)) && $();
|
|
218
255
|
};
|
|
219
256
|
let t = null;
|
|
220
257
|
const n = () => {
|
|
221
258
|
t === null && (t = requestAnimationFrame(() => {
|
|
222
|
-
t = null,
|
|
259
|
+
t = null, $e.current();
|
|
223
260
|
}));
|
|
224
|
-
}, r =
|
|
261
|
+
}, r = Rt($);
|
|
225
262
|
return document.addEventListener("mousedown", e), window.addEventListener("resize", n), () => {
|
|
226
263
|
document.removeEventListener("mousedown", e), window.removeEventListener("resize", n), t !== null && cancelAnimationFrame(t), r();
|
|
227
264
|
};
|
|
228
|
-
}, [
|
|
229
|
-
if (!
|
|
230
|
-
const e = new ResizeObserver(() =>
|
|
231
|
-
return
|
|
232
|
-
}, [
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
|
|
236
|
-
}, [
|
|
237
|
-
const
|
|
265
|
+
}, [c, $, $e]), Pe(() => {
|
|
266
|
+
if (!c || (K(), typeof ResizeObserver > "u")) return;
|
|
267
|
+
const e = new ResizeObserver(() => K());
|
|
268
|
+
return R.current && e.observe(R.current), C.current && e.observe(C.current), () => e.disconnect();
|
|
269
|
+
}, [c, K]), Pe(() => {
|
|
270
|
+
ee.current && (ee.current.scrollTop = 0);
|
|
271
|
+
}, [b, d, p]), gt(() => {
|
|
272
|
+
c && Ft();
|
|
273
|
+
}, [c]);
|
|
274
|
+
const Ee = (e) => {
|
|
238
275
|
requestAnimationFrame(() => {
|
|
239
|
-
const t =
|
|
276
|
+
const t = we.current[e], n = ee.current;
|
|
240
277
|
if (!t || !n) return;
|
|
241
|
-
const r = t.offsetTop,
|
|
242
|
-
|
|
278
|
+
const r = t.offsetTop, a = r + t.offsetHeight;
|
|
279
|
+
a > n.scrollTop + n.clientHeight ? n.scrollTop = a - n.clientHeight : r < n.scrollTop && (n.scrollTop = r);
|
|
243
280
|
});
|
|
244
|
-
},
|
|
281
|
+
}, Ce = (e) => {
|
|
245
282
|
if (e.kind === "text") {
|
|
246
|
-
F !== void 0 &&
|
|
283
|
+
F !== void 0 && X(Lt(o, F, e.text)), k(""), x(0);
|
|
247
284
|
return;
|
|
248
285
|
}
|
|
249
286
|
if (e.kind === "filter") {
|
|
250
|
-
|
|
287
|
+
I(e.filter.value), k(""), x(0);
|
|
251
288
|
return;
|
|
252
289
|
}
|
|
253
290
|
if (e.kind === "toggle") {
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
e.toggle === "select" ?
|
|
257
|
-
),
|
|
291
|
+
const E = b === "items" && T ? [T] : ae;
|
|
292
|
+
X(
|
|
293
|
+
e.toggle === "select" ? At(E, o, p) : Dt(E, o, p)
|
|
294
|
+
), k(""), x(0);
|
|
258
295
|
return;
|
|
259
296
|
}
|
|
260
297
|
const { item: t, filter: n } = e.row;
|
|
261
298
|
if (t.disabled) return;
|
|
262
|
-
const r =
|
|
263
|
-
if (
|
|
264
|
-
|
|
299
|
+
const r = Mt(o, n.value, t.value);
|
|
300
|
+
if (X(r), k(""), b !== "items") {
|
|
301
|
+
x(0);
|
|
265
302
|
return;
|
|
266
303
|
}
|
|
267
|
-
const { toggle:
|
|
268
|
-
|
|
269
|
-
},
|
|
270
|
-
if (
|
|
271
|
-
let t =
|
|
272
|
-
for (let n = 0; n <
|
|
273
|
-
if (t = (t + e +
|
|
274
|
-
|
|
304
|
+
const { toggle: a, items: s } = Ge(n, r.next, ""), u = s.findIndex((E) => E.item.value === t.value), v = u < 0 ? 0 : u + (a ? 1 : 0);
|
|
305
|
+
x(v), Ee(v);
|
|
306
|
+
}, ot = (e) => {
|
|
307
|
+
if (S.length === 0) return;
|
|
308
|
+
let t = O < 0 ? be : O;
|
|
309
|
+
for (let n = 0; n < S.length; n++)
|
|
310
|
+
if (t = (t + e + S.length) % S.length, me(S[t])) {
|
|
311
|
+
x(t), Ee(t);
|
|
275
312
|
return;
|
|
276
313
|
}
|
|
277
|
-
},
|
|
278
|
-
e ===
|
|
279
|
-
},
|
|
314
|
+
}, Te = (e) => {
|
|
315
|
+
e === d && I(null), X(_t(o, e));
|
|
316
|
+
}, st = (e) => {
|
|
280
317
|
var n, r;
|
|
281
|
-
if (
|
|
282
|
-
const t = e === F ? (n =
|
|
283
|
-
|
|
284
|
-
},
|
|
318
|
+
if (f || g) return;
|
|
319
|
+
const t = e === F ? (n = o.find((a) => a.filter === e)) == null ? void 0 : n.items[0] : void 0;
|
|
320
|
+
I(t === void 0 ? e : null), k(t ?? ""), x(0), se(!1), J(!0), (r = H.current) == null || r.focus();
|
|
321
|
+
}, at = (e) => {
|
|
285
322
|
if (!(e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229))
|
|
286
323
|
switch (e.key) {
|
|
287
324
|
case "ArrowDown":
|
|
288
325
|
case "ArrowUp": {
|
|
289
|
-
if (e.preventDefault(), !
|
|
290
|
-
|
|
326
|
+
if (e.preventDefault(), !c) {
|
|
327
|
+
Ae();
|
|
291
328
|
return;
|
|
292
329
|
}
|
|
293
|
-
|
|
330
|
+
ot(e.key === "ArrowDown" ? 1 : -1);
|
|
294
331
|
return;
|
|
295
332
|
}
|
|
296
333
|
case "Enter": {
|
|
297
|
-
if (e.preventDefault(), !
|
|
298
|
-
|
|
334
|
+
if (e.preventDefault(), !c) {
|
|
335
|
+
Ae();
|
|
299
336
|
return;
|
|
300
337
|
}
|
|
301
|
-
const t =
|
|
302
|
-
|
|
338
|
+
const t = S[O];
|
|
339
|
+
me(t) && Ce(t);
|
|
303
340
|
return;
|
|
304
341
|
}
|
|
305
342
|
case "Backspace": {
|
|
306
|
-
if (
|
|
307
|
-
if (
|
|
308
|
-
e.preventDefault(),
|
|
343
|
+
if (p !== "") return;
|
|
344
|
+
if (d !== null && !o.some((a) => a.filter === d)) {
|
|
345
|
+
e.preventDefault(), I(null), x(0);
|
|
309
346
|
return;
|
|
310
347
|
}
|
|
311
|
-
const n =
|
|
348
|
+
const n = re.filter((a) => o.some((s) => s.filter === a.filter)), r = n[n.length - 1];
|
|
312
349
|
if (!r) return;
|
|
313
|
-
e.preventDefault(),
|
|
350
|
+
e.preventDefault(), Te(r.filter);
|
|
314
351
|
return;
|
|
315
352
|
}
|
|
316
353
|
}
|
|
317
|
-
},
|
|
318
|
-
e.stopPropagation(),
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
},
|
|
354
|
+
}, ct = (e) => {
|
|
355
|
+
e.stopPropagation(), X(Ht(o)), I(null), k(""), G == null || G();
|
|
356
|
+
}, _e = () => {
|
|
357
|
+
I(null), k(""), x(0);
|
|
358
|
+
}, Le = () => {
|
|
359
|
+
_e(), se(!0), J(!0);
|
|
360
|
+
}, dt = () => {
|
|
361
|
+
var e;
|
|
362
|
+
if (c && Q && d === null && p === "") {
|
|
363
|
+
$();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
Le(), (e = H.current) == null || e.focus();
|
|
367
|
+
}, Ae = () => {
|
|
368
|
+
M ? Le() : ce();
|
|
369
|
+
}, De = o.filter(
|
|
370
|
+
(e) => e.filter !== F && e.items.length > 0
|
|
371
|
+
).length, Me = Qe && o.length > 0 && !f && !g, O = c ? Bt(S, be) : -1, ut = St({ disabled: f, open: c }), He = (e) => ({
|
|
372
|
+
"aria-haspopup": "listbox",
|
|
373
|
+
"aria-expanded": e,
|
|
374
|
+
"aria-controls": e ? ge : void 0
|
|
375
|
+
}), Fe = Me && /* @__PURE__ */ l(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
type: "button",
|
|
379
|
+
"aria-label": "Clear filters",
|
|
380
|
+
onMouseDown: qe,
|
|
381
|
+
onClick: ct,
|
|
382
|
+
className: `${M ? "" : "absolute top-0 bottom-0 right-[30px] "}flex items-center justify-center px-[2px] bg-transparent border-none text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] cursor-pointer ${Ve}`,
|
|
383
|
+
children: /* @__PURE__ */ l(ze, { size: 10 })
|
|
384
|
+
}
|
|
385
|
+
), mt = b === "filters" ? "No filters available" : "No matching values", pt = {
|
|
322
386
|
position: "fixed",
|
|
323
|
-
top: (
|
|
324
|
-
left: (
|
|
325
|
-
width:
|
|
326
|
-
background:
|
|
327
|
-
border:
|
|
328
|
-
borderRadius:
|
|
329
|
-
boxShadow:
|
|
330
|
-
padding:
|
|
387
|
+
top: (h == null ? void 0 : h.top) ?? 0,
|
|
388
|
+
left: (h == null ? void 0 : h.left) ?? 0,
|
|
389
|
+
width: h == null ? void 0 : h.width,
|
|
390
|
+
background: B.standard.background,
|
|
391
|
+
border: B.standard.border,
|
|
392
|
+
borderRadius: B.standard.radius,
|
|
393
|
+
boxShadow: B.standard.shadow,
|
|
394
|
+
padding: B.standard.padding,
|
|
331
395
|
display: "flex",
|
|
332
396
|
flexDirection: "column",
|
|
333
397
|
gap: 4,
|
|
334
|
-
maxHeight: (
|
|
335
|
-
fontSize:
|
|
336
|
-
visibility:
|
|
337
|
-
opacity:
|
|
398
|
+
maxHeight: (h == null ? void 0 : h.maxHeight) ?? Pt,
|
|
399
|
+
fontSize: wt[le],
|
|
400
|
+
visibility: h ? "visible" : "hidden",
|
|
401
|
+
opacity: h ? 1 : 0
|
|
338
402
|
};
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
403
|
+
return /* @__PURE__ */ m(Z, { children: [
|
|
404
|
+
/* @__PURE__ */ m(
|
|
341
405
|
"div",
|
|
342
406
|
{
|
|
343
|
-
className: `relative min-w-0 ${
|
|
344
|
-
style: { ...
|
|
407
|
+
className: `relative min-w-0 ${tt}`,
|
|
408
|
+
style: { ...kt(Je), ...rt },
|
|
345
409
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ m(
|
|
347
411
|
"div",
|
|
348
412
|
{
|
|
349
413
|
ref: C,
|
|
350
|
-
[
|
|
351
|
-
"data-open":
|
|
414
|
+
[Nt]: "",
|
|
415
|
+
"data-open": c || void 0,
|
|
352
416
|
onBlur: (e) => {
|
|
353
417
|
var n, r;
|
|
354
418
|
const t = e.relatedTarget;
|
|
355
|
-
t && ((n = C.current) != null && n.contains(t) || (r =
|
|
419
|
+
t && ((n = C.current) != null && n.contains(t) || (r = R.current) != null && r.contains(t)) || $();
|
|
356
420
|
},
|
|
357
421
|
onMouseDown: (e) => {
|
|
358
422
|
var t;
|
|
359
|
-
|
|
423
|
+
f || (e.target !== H.current && e.preventDefault(), (t = H.current) == null || t.focus(), M || ce());
|
|
360
424
|
},
|
|
361
425
|
style: {
|
|
362
426
|
transition: "border-color 0.15s ease, box-shadow 0.15s ease",
|
|
363
|
-
...
|
|
427
|
+
...ut
|
|
364
428
|
},
|
|
365
|
-
className: `w-full min-w-0 flex items-center border border-solid font-normal ${
|
|
429
|
+
className: `w-full min-w-0 flex items-center border border-solid font-normal ${Ut[le]} ${f ? "cursor-not-allowed" : "cursor-text"}`,
|
|
366
430
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
431
|
+
/* @__PURE__ */ l(
|
|
432
|
+
Be,
|
|
369
433
|
{
|
|
370
434
|
size: 13,
|
|
371
435
|
className: "shrink-0 mr-1",
|
|
372
436
|
style: { color: "var(--malachite-text-placeholder, rgb(187, 187, 187))" }
|
|
373
437
|
}
|
|
374
438
|
),
|
|
375
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ m(
|
|
376
440
|
"div",
|
|
377
441
|
{
|
|
378
|
-
className: `flex flex-1 min-w-0 flex-wrap items-center ${
|
|
442
|
+
className: `flex flex-1 min-w-0 flex-wrap items-center ${Vt[le]} ${Me && !M ? "pr-[18px]" : ""}`,
|
|
379
443
|
children: [
|
|
380
|
-
|
|
381
|
-
const t =
|
|
382
|
-
return /* @__PURE__ */
|
|
444
|
+
Re.map((e) => {
|
|
445
|
+
const t = c && e.filter === d, n = e.values.slice(0, Kt), r = e.values.length - n.length;
|
|
446
|
+
return /* @__PURE__ */ m(
|
|
383
447
|
"span",
|
|
384
448
|
{
|
|
385
|
-
onMouseDown:
|
|
386
|
-
className: `inline-flex items-
|
|
449
|
+
onMouseDown: Jt,
|
|
450
|
+
className: `inline-flex items-stretch max-w-[max(60px,calc(100%-64px))] min-w-0 h-[22px] rounded-md border border-solid overflow-hidden text-xs ${t ? _.active : _.resting}`,
|
|
387
451
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ m(
|
|
389
453
|
"button",
|
|
390
454
|
{
|
|
391
455
|
type: "button",
|
|
392
|
-
disabled:
|
|
456
|
+
disabled: f,
|
|
393
457
|
title: e.text,
|
|
394
458
|
"aria-label": `Edit filter ${e.text}`,
|
|
395
|
-
onClick: () =>
|
|
396
|
-
className: `
|
|
397
|
-
children:
|
|
459
|
+
onClick: () => st(e.filter),
|
|
460
|
+
className: `flex items-stretch min-w-0 bg-transparent border-none p-0 text-[length:inherit] text-current ${f || g ? "cursor-default" : "cursor-pointer"} ${Ue}`,
|
|
461
|
+
children: [
|
|
462
|
+
e.label !== null && /* @__PURE__ */ l(
|
|
463
|
+
"span",
|
|
464
|
+
{
|
|
465
|
+
className: `flex items-center min-w-0 px-1.5 ${_.muted} ${_.divider}`,
|
|
466
|
+
children: /* @__PURE__ */ l("span", { className: "truncate", children: e.label })
|
|
467
|
+
}
|
|
468
|
+
),
|
|
469
|
+
n.length > 0 && /* @__PURE__ */ m(
|
|
470
|
+
"span",
|
|
471
|
+
{
|
|
472
|
+
className: `flex items-center gap-1 min-w-0 pl-1.5 font-medium ${f ? "pr-1.5" : ""}`,
|
|
473
|
+
children: [
|
|
474
|
+
/* @__PURE__ */ l("span", { className: "truncate", children: n.map((a, s) => /* @__PURE__ */ m(ft.Fragment, { children: [
|
|
475
|
+
s > 0 && ", ",
|
|
476
|
+
a.icon && /* @__PURE__ */ l("span", { className: "inline-flex items-center align-middle mr-1", children: a.icon }),
|
|
477
|
+
a.label
|
|
478
|
+
] }, a.value)) }),
|
|
479
|
+
r > 0 && /* @__PURE__ */ m(
|
|
480
|
+
"span",
|
|
481
|
+
{
|
|
482
|
+
className: `shrink-0 px-1 rounded text-[11px] leading-4 ${_.muted}`,
|
|
483
|
+
children: [
|
|
484
|
+
"+",
|
|
485
|
+
r
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
)
|
|
492
|
+
]
|
|
398
493
|
}
|
|
399
494
|
),
|
|
400
|
-
!
|
|
495
|
+
!f && /* @__PURE__ */ l(
|
|
401
496
|
"button",
|
|
402
497
|
{
|
|
403
498
|
type: "button",
|
|
404
499
|
"aria-label": `Remove filter ${e.text}`,
|
|
405
|
-
onClick: (
|
|
406
|
-
var
|
|
407
|
-
|
|
500
|
+
onClick: (a) => {
|
|
501
|
+
var s;
|
|
502
|
+
a.stopPropagation(), Te(e.filter), (s = H.current) == null || s.focus();
|
|
408
503
|
},
|
|
409
|
-
className: `flex items-center justify-center shrink-0 bg-transparent border-none
|
|
410
|
-
children: /* @__PURE__ */
|
|
504
|
+
className: `flex items-center justify-center shrink-0 bg-transparent border-none px-1.5 text-[var(--malachite-text-secondary,rgb(123,123,123))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] cursor-pointer ${Ue}`,
|
|
505
|
+
children: /* @__PURE__ */ l(ze, { size: 10 })
|
|
411
506
|
}
|
|
412
507
|
)
|
|
413
508
|
]
|
|
@@ -415,84 +510,104 @@ const Nt = {
|
|
|
415
510
|
e.filter
|
|
416
511
|
);
|
|
417
512
|
}),
|
|
418
|
-
|
|
513
|
+
Ie > 0 && /* @__PURE__ */ m(
|
|
419
514
|
"span",
|
|
420
515
|
{
|
|
421
|
-
className: `inline-flex items-center h-[22px] px-1.5 rounded-md text-xs ${
|
|
516
|
+
className: `inline-flex items-center h-[22px] px-1.5 rounded-md border border-solid text-xs font-medium ${_.resting}`,
|
|
422
517
|
children: [
|
|
423
518
|
"+",
|
|
424
|
-
|
|
519
|
+
Ie
|
|
425
520
|
]
|
|
426
521
|
}
|
|
427
522
|
),
|
|
428
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ l(
|
|
429
524
|
"input",
|
|
430
525
|
{
|
|
431
|
-
ref:
|
|
432
|
-
id:
|
|
526
|
+
ref: H,
|
|
527
|
+
id: nt,
|
|
433
528
|
type: "text",
|
|
434
529
|
role: "combobox",
|
|
435
|
-
value:
|
|
436
|
-
disabled:
|
|
437
|
-
placeholder:
|
|
530
|
+
value: p,
|
|
531
|
+
disabled: f,
|
|
532
|
+
placeholder: re.length === 0 ? ie : "",
|
|
438
533
|
autoComplete: "off",
|
|
439
534
|
spellCheck: !1,
|
|
440
|
-
"aria-label":
|
|
441
|
-
"aria-labelledby":
|
|
442
|
-
|
|
535
|
+
"aria-label": fe ? void 0 : pe ?? ie,
|
|
536
|
+
"aria-labelledby": fe,
|
|
537
|
+
...He(c),
|
|
443
538
|
"aria-autocomplete": "list",
|
|
444
|
-
"aria-
|
|
445
|
-
"aria-
|
|
446
|
-
"aria-activedescendant": _ >= 0 ? me(_) : void 0,
|
|
447
|
-
"aria-busy": u || void 0,
|
|
539
|
+
"aria-activedescendant": O >= 0 ? xe(O) : void 0,
|
|
540
|
+
"aria-busy": g || void 0,
|
|
448
541
|
onChange: (e) => {
|
|
449
|
-
|
|
542
|
+
k(e.target.value), x(0), ce();
|
|
450
543
|
},
|
|
451
|
-
onKeyDown:
|
|
544
|
+
onKeyDown: at,
|
|
452
545
|
className: "flex-1 min-w-[60px] border-none outline-none bg-transparent p-0 text-[length:inherit] text-[var(--malachite-text-primary,rgb(10,10,10))] placeholder:text-[var(--malachite-text-placeholder,rgb(187,187,187))] disabled:cursor-not-allowed"
|
|
453
546
|
}
|
|
454
547
|
)
|
|
455
548
|
]
|
|
456
549
|
}
|
|
457
550
|
),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
|
|
551
|
+
M ? /* @__PURE__ */ m("span", { className: "flex items-center self-stretch shrink-0 gap-1.5 ml-1", children: [
|
|
552
|
+
g && /* @__PURE__ */ l(We, { size: "xxxsmall" }),
|
|
553
|
+
Fe,
|
|
554
|
+
/* @__PURE__ */ l(
|
|
555
|
+
"span",
|
|
556
|
+
{
|
|
557
|
+
"aria-hidden": "true",
|
|
558
|
+
className: "w-px self-stretch my-1 bg-[var(--malachite-card-border,rgb(232,232,232))]"
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ m(
|
|
562
|
+
"button",
|
|
563
|
+
{
|
|
564
|
+
ref: ye,
|
|
565
|
+
type: "button",
|
|
566
|
+
disabled: f,
|
|
567
|
+
...He(c && Q),
|
|
568
|
+
onClick: dt,
|
|
569
|
+
className: `flex items-center gap-1 h-[22px] px-1.5 rounded-md bg-transparent border-none font-medium text-[length:inherit] text-[var(--malachite-text-primary,rgb(10,10,10))] hover:bg-[var(--malachite-tag-default-background,rgba(123,123,123,0.1))] disabled:cursor-not-allowed cursor-pointer ${Ve}`,
|
|
570
|
+
children: [
|
|
571
|
+
/* @__PURE__ */ l(yt, { size: 12 }),
|
|
572
|
+
"Filters",
|
|
573
|
+
De > 0 && /* @__PURE__ */ l(
|
|
574
|
+
"span",
|
|
575
|
+
{
|
|
576
|
+
className: `min-w-4 px-1 rounded text-[11px] leading-4 text-center ${_.muted}`,
|
|
577
|
+
children: De
|
|
578
|
+
}
|
|
579
|
+
)
|
|
580
|
+
]
|
|
581
|
+
}
|
|
582
|
+
)
|
|
583
|
+
] }) : /* @__PURE__ */ l("span", { className: "flex items-center justify-center shrink-0 size-[14px] ml-1", children: g ? /* @__PURE__ */ l(We, { size: "xxxsmall" }) : /* @__PURE__ */ l(
|
|
584
|
+
bt,
|
|
460
585
|
{
|
|
461
586
|
size: 13,
|
|
462
587
|
style: {
|
|
463
|
-
color:
|
|
588
|
+
color: c ? "var(--malachite-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-placeholder, rgb(187, 187, 187))",
|
|
464
589
|
transition: "transform 0.2s ease, color 0.2s ease",
|
|
465
|
-
transform:
|
|
590
|
+
transform: c ? "rotate(180deg)" : "rotate(0deg)"
|
|
466
591
|
}
|
|
467
592
|
}
|
|
468
593
|
) })
|
|
469
594
|
]
|
|
470
595
|
}
|
|
471
596
|
),
|
|
472
|
-
|
|
473
|
-
"button",
|
|
474
|
-
{
|
|
475
|
-
type: "button",
|
|
476
|
-
"aria-label": "Clear filters",
|
|
477
|
-
onMouseDown: Le,
|
|
478
|
-
onClick: Be,
|
|
479
|
-
className: `absolute top-0 bottom-0 right-[30px] flex items-center justify-center px-[2px] bg-transparent border-none text-[var(--malachite-text-placeholder)] hover:text-[var(--malachite-text-primary)] cursor-pointer ${le}`,
|
|
480
|
-
children: /* @__PURE__ */ o(Ie, { size: 10 })
|
|
481
|
-
}
|
|
482
|
-
)
|
|
597
|
+
!M && Fe
|
|
483
598
|
]
|
|
484
599
|
}
|
|
485
600
|
),
|
|
486
|
-
|
|
487
|
-
/* @__PURE__ */
|
|
601
|
+
c && xt(
|
|
602
|
+
/* @__PURE__ */ m(
|
|
488
603
|
"div",
|
|
489
604
|
{
|
|
490
|
-
ref:
|
|
491
|
-
...
|
|
492
|
-
style:
|
|
493
|
-
onMouseDown:
|
|
605
|
+
ref: R,
|
|
606
|
+
...lt,
|
|
607
|
+
style: pt,
|
|
608
|
+
onMouseDown: qe,
|
|
494
609
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ l(
|
|
496
611
|
"div",
|
|
497
612
|
{
|
|
498
613
|
style: {
|
|
@@ -502,14 +617,14 @@ const Nt = {
|
|
|
502
617
|
gap: 4,
|
|
503
618
|
minWidth: 0
|
|
504
619
|
},
|
|
505
|
-
children:
|
|
506
|
-
/* @__PURE__ */
|
|
620
|
+
children: b === "items" ? /* @__PURE__ */ m(Z, { children: [
|
|
621
|
+
/* @__PURE__ */ l(
|
|
507
622
|
"button",
|
|
508
623
|
{
|
|
509
624
|
type: "button",
|
|
510
625
|
tabIndex: -1,
|
|
511
|
-
onClick:
|
|
512
|
-
className:
|
|
626
|
+
onClick: _e,
|
|
627
|
+
className: L.crumb,
|
|
513
628
|
style: {
|
|
514
629
|
background: "none",
|
|
515
630
|
border: "none",
|
|
@@ -520,19 +635,19 @@ const Nt = {
|
|
|
520
635
|
children: "Filters"
|
|
521
636
|
}
|
|
522
637
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ l("span", { style: Y, children: `> ${(T == null ? void 0 : T.label) ?? ((Oe = U.get(d ?? "")) == null ? void 0 : Oe.label) ?? ""}` })
|
|
524
639
|
] }) : "Filters"
|
|
525
640
|
}
|
|
526
641
|
),
|
|
527
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ m(
|
|
528
643
|
"div",
|
|
529
644
|
{
|
|
530
|
-
ref:
|
|
531
|
-
id:
|
|
645
|
+
ref: ee,
|
|
646
|
+
id: ge,
|
|
532
647
|
role: "listbox",
|
|
533
|
-
"aria-multiselectable":
|
|
534
|
-
"aria-label":
|
|
535
|
-
"aria-busy":
|
|
648
|
+
"aria-multiselectable": b !== "filters",
|
|
649
|
+
"aria-label": pe ?? ie,
|
|
650
|
+
"aria-busy": g || void 0,
|
|
536
651
|
style: {
|
|
537
652
|
display: "flex",
|
|
538
653
|
flexDirection: "column",
|
|
@@ -544,11 +659,11 @@ const Nt = {
|
|
|
544
659
|
scrollbarWidth: "thin"
|
|
545
660
|
},
|
|
546
661
|
children: [
|
|
547
|
-
|
|
662
|
+
g && Array.from({ length: jt }, (e, t) => /* @__PURE__ */ l(
|
|
548
663
|
"div",
|
|
549
664
|
{
|
|
550
665
|
role: "presentation",
|
|
551
|
-
className:
|
|
666
|
+
className: L.loading,
|
|
552
667
|
style: {
|
|
553
668
|
height: 24,
|
|
554
669
|
margin: "4px 10px",
|
|
@@ -558,7 +673,7 @@ const Nt = {
|
|
|
558
673
|
},
|
|
559
674
|
t
|
|
560
675
|
)),
|
|
561
|
-
!
|
|
676
|
+
!g && S.length === 0 && /* @__PURE__ */ l(
|
|
562
677
|
"div",
|
|
563
678
|
{
|
|
564
679
|
role: "presentation",
|
|
@@ -566,34 +681,34 @@ const Nt = {
|
|
|
566
681
|
padding: "6px 10px",
|
|
567
682
|
color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
|
|
568
683
|
},
|
|
569
|
-
children:
|
|
684
|
+
children: mt
|
|
570
685
|
}
|
|
571
686
|
),
|
|
572
|
-
|
|
687
|
+
S.map((e, t) => {
|
|
573
688
|
const n = e.kind === "item" && !!e.row.item.disabled;
|
|
574
|
-
return /* @__PURE__ */
|
|
689
|
+
return /* @__PURE__ */ l(
|
|
575
690
|
"button",
|
|
576
691
|
{
|
|
577
|
-
id:
|
|
692
|
+
id: xe(t),
|
|
578
693
|
ref: (r) => {
|
|
579
|
-
|
|
694
|
+
we.current[t] = r;
|
|
580
695
|
},
|
|
581
696
|
type: "button",
|
|
582
697
|
tabIndex: -1,
|
|
583
698
|
role: "option",
|
|
584
699
|
"aria-selected": e.kind === "item" ? e.row.selected : !1,
|
|
585
700
|
"aria-disabled": n || void 0,
|
|
586
|
-
"data-highlighted": t ===
|
|
701
|
+
"data-highlighted": t === O,
|
|
587
702
|
"data-disabled": n,
|
|
588
|
-
className:
|
|
703
|
+
className: L.row,
|
|
589
704
|
onMouseEnter: () => {
|
|
590
|
-
n ||
|
|
705
|
+
n || x(t);
|
|
591
706
|
},
|
|
592
|
-
onClick: () =>
|
|
593
|
-
style:
|
|
594
|
-
children: /* @__PURE__ */
|
|
707
|
+
onClick: () => Ce(e),
|
|
708
|
+
style: Zt,
|
|
709
|
+
children: /* @__PURE__ */ l(Qt, { row: e, showFilter: b === "search" })
|
|
595
710
|
},
|
|
596
|
-
|
|
711
|
+
qt(e)
|
|
597
712
|
);
|
|
598
713
|
})
|
|
599
714
|
]
|
|
@@ -607,7 +722,7 @@ const Nt = {
|
|
|
607
722
|
] });
|
|
608
723
|
};
|
|
609
724
|
export {
|
|
610
|
-
|
|
611
|
-
|
|
725
|
+
wr as FilterSearch,
|
|
726
|
+
wr as default
|
|
612
727
|
};
|
|
613
728
|
//# sourceMappingURL=FilterSearch.js.map
|