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