@fluidattacks/design 9.9.0 → 9.9.2
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/filters/options-menu/options/index.js +198 -164
- package/dist/components/filters/options-menu/options/types.d.ts +2 -0
- package/dist/components/group-selector/option-container/index.js +8 -8
- package/dist/components/table/pagination/pagination-dropdown/index.js +4 -4
- package/package.json +1 -1
|
@@ -1,186 +1,190 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useVirtualizer as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useContext as
|
|
6
|
-
import { FiltersContext as
|
|
7
|
-
import { NoMatches as
|
|
8
|
-
import { StyledItem as
|
|
9
|
-
import { SingleSelectSearch as
|
|
10
|
-
import { Checkbox as
|
|
11
|
-
import { theme as
|
|
12
|
-
import { Icon as
|
|
1
|
+
import { jsx as n, Fragment as q, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { useVirtualizer as H } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
3
|
+
import J from "../../../../_virtual/dayjs.min.js";
|
|
4
|
+
import E from "../../../../_virtual/isNaN.js";
|
|
5
|
+
import { useContext as K, useCallback as p, useRef as Q, useState as T } from "react";
|
|
6
|
+
import { FiltersContext as W } from "../../context/index.js";
|
|
7
|
+
import { NoMatches as X } from "../../search/no-matches/index.js";
|
|
8
|
+
import { StyledItem as y, StyledItemCount as Y } from "../../styles.js";
|
|
9
|
+
import { SingleSelectSearch as Z } from "../single-select/index.js";
|
|
10
|
+
import { Checkbox as O } from "../../../checkbox/index.js";
|
|
11
|
+
import { theme as L } from "../../../colors/index.js";
|
|
12
|
+
import { Icon as z } from "../../../icon/index.js";
|
|
13
13
|
import "styled-components";
|
|
14
14
|
import "../../../../_virtual/lodash.js";
|
|
15
15
|
import "react-dom";
|
|
16
16
|
import "../../../typography/heading/index.js";
|
|
17
|
-
import { Span as
|
|
17
|
+
import { Span as ee } from "../../../typography/span/index.js";
|
|
18
18
|
import "../../../typography/text/index.js";
|
|
19
19
|
import "../../../inputs/styles.js";
|
|
20
20
|
import "../../../container/index.js";
|
|
21
|
-
import { Tag as
|
|
21
|
+
import { Tag as te } from "../../../tag/index.js";
|
|
22
22
|
import "../../../icon-button/index.js";
|
|
23
23
|
import "../../../button/index.js";
|
|
24
|
-
import { InputDateRange as
|
|
25
|
-
import { TextInput as
|
|
24
|
+
import { InputDateRange as oe } from "../../../inputs/fields/date-range/index.js";
|
|
25
|
+
import { TextInput as re } from "../../../inputs/fields/text-input/index.js";
|
|
26
26
|
import "../../../layout/categories/buttons/index.js";
|
|
27
27
|
import "../../../inputs/utils/action-button/index.js";
|
|
28
|
-
import { InputNumberRange as
|
|
28
|
+
import { InputNumberRange as ne } from "../../../inputs/fields/number-range/index.js";
|
|
29
29
|
import "../../../../node_modules/react-international-phone/dist/index.js";
|
|
30
|
-
import { useDebouncedCallback as
|
|
31
|
-
import {
|
|
32
|
-
|
|
30
|
+
import { useDebouncedCallback as le } from "../../../../hooks/use-debounced-callback.js";
|
|
31
|
+
import { useMountEffect as ae } from "../../../../hooks/use-mount-effect.js";
|
|
32
|
+
import { parseCheckboxesFilterValue as ie, parseTextFilterValue as se } from "../../../../utils/filters.js";
|
|
33
|
+
const ce = ({
|
|
33
34
|
id: i,
|
|
34
|
-
filterValue:
|
|
35
|
-
label:
|
|
35
|
+
filterValue: l,
|
|
36
|
+
label: a,
|
|
36
37
|
onTextValue: t,
|
|
37
38
|
checkboxLabel: s,
|
|
38
39
|
onCheckboxChange: e,
|
|
39
|
-
debounceMs:
|
|
40
|
+
debounceMs: r
|
|
40
41
|
}) => {
|
|
41
|
-
const { text:
|
|
42
|
-
|
|
43
|
-
), [
|
|
44
|
-
|
|
42
|
+
const { text: c, checked: f } = se(
|
|
43
|
+
l ?? ""
|
|
44
|
+
), [u, d] = T(c), [g, R] = T(c), h = Number.isFinite(r) && (r ?? 0) >= 0 ? Math.min(r ?? 0, 5e3) : 0, b = le(t, h);
|
|
45
|
+
c !== g && (R(c), d(c), b.cancel());
|
|
45
46
|
const k = p(
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
v
|
|
47
|
+
(x) => {
|
|
48
|
+
x.stopPropagation(), x.preventDefault();
|
|
49
|
+
const v = x.target.value;
|
|
50
|
+
d(v), h > 0 ? b(v) : t(v);
|
|
50
51
|
},
|
|
51
|
-
[h,
|
|
52
|
+
[h, b, t]
|
|
52
53
|
);
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ w(
|
|
54
55
|
"div",
|
|
55
56
|
{
|
|
56
57
|
style: {
|
|
57
58
|
display: "flex",
|
|
58
59
|
flexDirection: "column",
|
|
59
|
-
gap:
|
|
60
|
+
gap: L.spacing[0.25],
|
|
60
61
|
width: "100%"
|
|
61
62
|
},
|
|
62
63
|
children: [
|
|
63
|
-
s ? /* @__PURE__ */
|
|
64
|
-
|
|
64
|
+
s ? /* @__PURE__ */ n(
|
|
65
|
+
O,
|
|
65
66
|
{
|
|
66
|
-
checked:
|
|
67
|
+
checked: f,
|
|
67
68
|
label: s,
|
|
68
69
|
name: `${i}-checkbox`,
|
|
69
70
|
onChange: e,
|
|
70
71
|
value: "textCheck"
|
|
71
72
|
}
|
|
72
73
|
) : void 0,
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
74
|
+
/* @__PURE__ */ n(
|
|
75
|
+
re,
|
|
75
76
|
{
|
|
76
77
|
name: i,
|
|
77
78
|
onChange: k,
|
|
78
|
-
placeholder: `Type ${
|
|
79
|
-
value:
|
|
79
|
+
placeholder: `Type ${a}...`,
|
|
80
|
+
value: u
|
|
80
81
|
}
|
|
81
82
|
)
|
|
82
83
|
]
|
|
83
84
|
}
|
|
84
85
|
);
|
|
85
|
-
},
|
|
86
|
+
}, me = {
|
|
86
87
|
text: ({
|
|
87
88
|
id: i,
|
|
88
|
-
filterValue:
|
|
89
|
-
label:
|
|
89
|
+
filterValue: l,
|
|
90
|
+
label: a,
|
|
90
91
|
onTextValue: t,
|
|
91
92
|
checkboxLabel: s,
|
|
92
93
|
onCheckboxChange: e,
|
|
93
|
-
debounceMs:
|
|
94
|
-
}) => t === void 0 ? null : /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
debounceMs: r
|
|
95
|
+
}) => t === void 0 ? null : /* @__PURE__ */ n(
|
|
96
|
+
ce,
|
|
96
97
|
{
|
|
97
98
|
checkboxLabel: s,
|
|
98
|
-
debounceMs:
|
|
99
|
-
filterValue:
|
|
99
|
+
debounceMs: r,
|
|
100
|
+
filterValue: l,
|
|
100
101
|
id: i,
|
|
101
|
-
label:
|
|
102
|
+
label: a,
|
|
102
103
|
onCheckboxChange: e,
|
|
103
104
|
onTextValue: t
|
|
104
105
|
}
|
|
105
106
|
),
|
|
106
107
|
checkboxes: ({
|
|
107
108
|
items: i,
|
|
108
|
-
virtualItems:
|
|
109
|
-
filterValue:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
virtualItems: l,
|
|
110
|
+
filterValue: a,
|
|
111
|
+
listRef: t,
|
|
112
|
+
ref: s,
|
|
113
|
+
scrollMargin: e,
|
|
114
|
+
totalSize: r,
|
|
115
|
+
onChange: c
|
|
113
116
|
}) => {
|
|
114
|
-
const
|
|
115
|
-
|
|
117
|
+
const f = new Set(
|
|
118
|
+
ie(a ?? "").values
|
|
116
119
|
);
|
|
117
|
-
return
|
|
120
|
+
return l.length > 0 ? (
|
|
118
121
|
// Positioning context for the absolute rows, and it reserves their height
|
|
119
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ n(
|
|
120
123
|
"div",
|
|
121
124
|
{
|
|
122
125
|
"data-testid": "options-virtual-list",
|
|
126
|
+
ref: t,
|
|
123
127
|
style: {
|
|
124
|
-
height: `${
|
|
128
|
+
height: `${r}px`,
|
|
125
129
|
position: "relative",
|
|
126
130
|
width: "100%"
|
|
127
131
|
},
|
|
128
|
-
children:
|
|
129
|
-
const
|
|
130
|
-
return /* @__PURE__ */
|
|
132
|
+
children: l.map((u) => {
|
|
133
|
+
const d = i[u.index], g = f.has(d?.value);
|
|
134
|
+
return /* @__PURE__ */ n(
|
|
131
135
|
"div",
|
|
132
136
|
{
|
|
133
|
-
"data-index":
|
|
134
|
-
ref:
|
|
137
|
+
"data-index": u.index,
|
|
138
|
+
ref: s,
|
|
135
139
|
style: {
|
|
136
140
|
position: "absolute",
|
|
137
|
-
top: `${
|
|
141
|
+
top: `${u.start - e}px`,
|
|
138
142
|
left: 0,
|
|
139
143
|
width: "100%"
|
|
140
144
|
},
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
-
|
|
145
|
+
children: /* @__PURE__ */ n(y, { "aria-selected": g, children: /* @__PURE__ */ n(
|
|
146
|
+
O,
|
|
143
147
|
{
|
|
144
|
-
checked:
|
|
145
|
-
label:
|
|
146
|
-
name:
|
|
147
|
-
onChange:
|
|
148
|
-
value:
|
|
148
|
+
checked: g,
|
|
149
|
+
label: d?.label,
|
|
150
|
+
name: d?.value,
|
|
151
|
+
onChange: c,
|
|
152
|
+
value: d?.value
|
|
149
153
|
}
|
|
150
154
|
) })
|
|
151
155
|
},
|
|
152
|
-
`${
|
|
156
|
+
`${u.index}-${d?.value}`
|
|
153
157
|
);
|
|
154
158
|
})
|
|
155
159
|
}
|
|
156
160
|
)
|
|
157
|
-
) : /* @__PURE__ */
|
|
161
|
+
) : /* @__PURE__ */ n(X, {});
|
|
158
162
|
},
|
|
159
163
|
combobox: ({
|
|
160
164
|
id: i,
|
|
161
|
-
items:
|
|
162
|
-
filterValue:
|
|
165
|
+
items: l,
|
|
166
|
+
filterValue: a,
|
|
163
167
|
label: t,
|
|
164
168
|
onSelectChange: s
|
|
165
|
-
}) => /* @__PURE__ */
|
|
166
|
-
|
|
169
|
+
}) => /* @__PURE__ */ n(
|
|
170
|
+
Z,
|
|
167
171
|
{
|
|
168
|
-
items:
|
|
172
|
+
items: l,
|
|
169
173
|
name: i,
|
|
170
174
|
onSelect: s,
|
|
171
175
|
placeholder: `Search ${t}`,
|
|
172
|
-
selected:
|
|
176
|
+
selected: a?.split(",").map((e) => e.trim()).find((e) => l.some((r) => r.value === e)) ?? null
|
|
173
177
|
}
|
|
174
178
|
),
|
|
175
|
-
list: ({ items: i, filterValue:
|
|
176
|
-
|
|
179
|
+
list: ({ items: i, filterValue: l, onListChange: a }) => i.map((t) => /* @__PURE__ */ w(
|
|
180
|
+
y,
|
|
177
181
|
{
|
|
178
|
-
"aria-selected":
|
|
182
|
+
"aria-selected": l?.split(",").includes(t?.value),
|
|
179
183
|
as: "button",
|
|
180
|
-
onClick:
|
|
184
|
+
onClick: a?.(t.value),
|
|
181
185
|
children: [
|
|
182
|
-
t.icon ? /* @__PURE__ */
|
|
183
|
-
|
|
186
|
+
t.icon ? /* @__PURE__ */ n(
|
|
187
|
+
z,
|
|
184
188
|
{
|
|
185
189
|
icon: t.icon,
|
|
186
190
|
iconColor: t.iconColor,
|
|
@@ -188,10 +192,10 @@ const Z = ({
|
|
|
188
192
|
iconType: t.iconType ?? "fa-light"
|
|
189
193
|
}
|
|
190
194
|
) : void 0,
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
195
|
+
/* @__PURE__ */ n(
|
|
196
|
+
ee,
|
|
193
197
|
{
|
|
194
|
-
color:
|
|
198
|
+
color: L.palette.gray[800],
|
|
195
199
|
display: "block",
|
|
196
200
|
overflow: "hidden",
|
|
197
201
|
size: "md",
|
|
@@ -201,16 +205,16 @@ const Z = ({
|
|
|
201
205
|
children: t.label
|
|
202
206
|
}
|
|
203
207
|
),
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
t.count === void 0 ? void 0 : /* @__PURE__ */
|
|
206
|
-
|
|
208
|
+
/* @__PURE__ */ n("span", { className: "filter-item" }),
|
|
209
|
+
t.count === void 0 ? void 0 : /* @__PURE__ */ n(Y, { children: /* @__PURE__ */ n(
|
|
210
|
+
te,
|
|
207
211
|
{
|
|
208
212
|
tagLabel: t.count.toLocaleString("en-US"),
|
|
209
213
|
variant: "default"
|
|
210
214
|
}
|
|
211
215
|
) }),
|
|
212
|
-
|
|
213
|
-
|
|
216
|
+
l?.split(",").includes(t?.value) ? /* @__PURE__ */ n("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ n(
|
|
217
|
+
z,
|
|
214
218
|
{
|
|
215
219
|
icon: "check",
|
|
216
220
|
iconClass: "selected",
|
|
@@ -224,25 +228,25 @@ const Z = ({
|
|
|
224
228
|
)),
|
|
225
229
|
dateRange: ({
|
|
226
230
|
id: i,
|
|
227
|
-
filterValue:
|
|
228
|
-
onRangeChange:
|
|
231
|
+
filterValue: l,
|
|
232
|
+
onRangeChange: a,
|
|
229
233
|
updateCalendarState: t
|
|
230
234
|
}) => {
|
|
231
|
-
const [s, e] =
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
|
|
235
|
+
const [s, e] = l?.split(",").filter((r) => J(r).isValid() || r === "-") ?? [];
|
|
236
|
+
return /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(
|
|
237
|
+
oe,
|
|
234
238
|
{
|
|
235
239
|
name: i,
|
|
236
240
|
onOpenCalendar: t,
|
|
237
241
|
propsMax: {
|
|
238
242
|
name: "maxValue",
|
|
239
243
|
value: e !== "-" ? e : "",
|
|
240
|
-
onChange:
|
|
244
|
+
onChange: a?.(1)
|
|
241
245
|
},
|
|
242
246
|
propsMin: {
|
|
243
247
|
name: "minValue",
|
|
244
248
|
value: s !== "-" ? s : "",
|
|
245
|
-
onChange:
|
|
249
|
+
onChange: a?.(0)
|
|
246
250
|
},
|
|
247
251
|
variant: "filters"
|
|
248
252
|
}
|
|
@@ -250,114 +254,144 @@ const Z = ({
|
|
|
250
254
|
},
|
|
251
255
|
numberRange: ({
|
|
252
256
|
id: i,
|
|
253
|
-
filterValue:
|
|
254
|
-
minValue:
|
|
257
|
+
filterValue: l,
|
|
258
|
+
minValue: a,
|
|
255
259
|
maxValue: t,
|
|
256
260
|
onRangeNumberChange: s
|
|
257
261
|
}) => {
|
|
258
|
-
const e =
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
|
|
262
|
+
const e = l?.split(",") ?? [], r = e[0]?.trim(), c = e[1]?.trim(), f = r && r !== "" && r !== "-" && !E(Number(r)) ? Number(r) : void 0, u = c && c !== "" && c !== "-" && !E(Number(c)) ? Number(c) : void 0;
|
|
263
|
+
return /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(
|
|
264
|
+
ne,
|
|
261
265
|
{
|
|
262
266
|
name: i,
|
|
263
267
|
propsMax: {
|
|
264
268
|
name: "maxValue",
|
|
265
|
-
min:
|
|
269
|
+
min: a,
|
|
266
270
|
max: t,
|
|
267
271
|
onChange: s?.(1),
|
|
268
272
|
placeholder: "Max %",
|
|
269
|
-
value:
|
|
273
|
+
value: u
|
|
270
274
|
},
|
|
271
275
|
propsMin: {
|
|
272
276
|
name: "minValue",
|
|
273
|
-
min:
|
|
277
|
+
min: a,
|
|
274
278
|
max: t,
|
|
275
279
|
onChange: s?.(0),
|
|
276
280
|
placeholder: "Min %",
|
|
277
|
-
value:
|
|
281
|
+
value: f
|
|
278
282
|
},
|
|
279
283
|
variant: "filters"
|
|
280
284
|
}
|
|
281
285
|
) });
|
|
282
286
|
}
|
|
283
|
-
},
|
|
287
|
+
}, Ue = ({
|
|
284
288
|
id: i,
|
|
285
|
-
filteredItems:
|
|
286
|
-
filterValue:
|
|
289
|
+
filteredItems: l,
|
|
290
|
+
filterValue: a,
|
|
287
291
|
label: t,
|
|
288
292
|
option: s,
|
|
289
293
|
onChange: e
|
|
290
294
|
}) => {
|
|
291
|
-
const { type:
|
|
292
|
-
calendarState: { updateCalendarState:
|
|
295
|
+
const { type: r, minValue: c, maxValue: f, checkboxLabel: u, debounceMs: d } = s ?? {}, g = r && me[r], {
|
|
296
|
+
calendarState: { updateCalendarState: R },
|
|
293
297
|
scrollState: h
|
|
294
|
-
} =
|
|
298
|
+
} = K(W), b = p(() => 36, []), k = p(
|
|
295
299
|
() => h.ref.current,
|
|
296
300
|
[h.ref]
|
|
297
|
-
),
|
|
298
|
-
|
|
299
|
-
|
|
301
|
+
), x = Q(null), [v, V] = T(0), M = p(() => {
|
|
302
|
+
const o = h.ref.current, m = x.current;
|
|
303
|
+
if (o && m) {
|
|
304
|
+
const S = m.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop;
|
|
305
|
+
V(
|
|
306
|
+
(C) => C === S ? C : S
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
}, [h.ref]), $ = p(
|
|
310
|
+
(o) => {
|
|
311
|
+
x.current = o, M();
|
|
312
|
+
},
|
|
313
|
+
[M]
|
|
314
|
+
);
|
|
315
|
+
ae(() => {
|
|
316
|
+
const o = h.ref.current;
|
|
317
|
+
if (o === null || typeof ResizeObserver > "u")
|
|
318
|
+
return;
|
|
319
|
+
const m = new ResizeObserver(M), S = () => {
|
|
320
|
+
m.disconnect(), Array.from(o.children).forEach((_) => {
|
|
321
|
+
m.observe(_);
|
|
322
|
+
});
|
|
323
|
+
}, C = new MutationObserver(S);
|
|
324
|
+
return C.observe(o, { childList: !0 }), S(), () => {
|
|
325
|
+
C.disconnect(), m.disconnect();
|
|
326
|
+
};
|
|
327
|
+
});
|
|
328
|
+
const N = H({
|
|
329
|
+
count: l.length,
|
|
330
|
+
estimateSize: b,
|
|
300
331
|
getScrollElement: k,
|
|
332
|
+
scrollMargin: v,
|
|
301
333
|
useFlushSync: !1
|
|
302
|
-
}),
|
|
303
|
-
(
|
|
304
|
-
|
|
334
|
+
}), D = N.getVirtualItems(), F = p(
|
|
335
|
+
(o) => {
|
|
336
|
+
o.stopPropagation(), o.preventDefault(), e(o.target.value, r ?? "");
|
|
305
337
|
},
|
|
306
|
-
[e,
|
|
307
|
-
),
|
|
308
|
-
(
|
|
309
|
-
e(
|
|
338
|
+
[e, r]
|
|
339
|
+
), P = p(
|
|
340
|
+
(o) => (m) => {
|
|
341
|
+
e(m, "dateRange", o);
|
|
310
342
|
},
|
|
311
343
|
[e]
|
|
312
|
-
),
|
|
313
|
-
(
|
|
314
|
-
|
|
344
|
+
), I = p(
|
|
345
|
+
(o) => (m) => {
|
|
346
|
+
m.stopPropagation(), m.preventDefault(), e(m.target.value, "numberRange", o);
|
|
315
347
|
},
|
|
316
348
|
[e]
|
|
317
|
-
),
|
|
318
|
-
(
|
|
319
|
-
e(
|
|
349
|
+
), j = p(
|
|
350
|
+
(o) => () => {
|
|
351
|
+
e(o, "list");
|
|
320
352
|
},
|
|
321
353
|
[e]
|
|
322
|
-
),
|
|
323
|
-
(
|
|
324
|
-
e(
|
|
354
|
+
), A = p(
|
|
355
|
+
(o) => () => {
|
|
356
|
+
e(o, "combobox");
|
|
325
357
|
},
|
|
326
358
|
[e]
|
|
327
|
-
),
|
|
328
|
-
(
|
|
329
|
-
|
|
359
|
+
), B = p(
|
|
360
|
+
(o) => {
|
|
361
|
+
o.stopPropagation(), e(o.target.checked ? "true" : "false", "textCheckbox");
|
|
330
362
|
},
|
|
331
363
|
[e]
|
|
332
|
-
),
|
|
333
|
-
(
|
|
334
|
-
e(
|
|
364
|
+
), G = p(
|
|
365
|
+
(o) => {
|
|
366
|
+
e(o, r ?? "text");
|
|
335
367
|
},
|
|
336
|
-
[e,
|
|
337
|
-
),
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
items:
|
|
368
|
+
[e, r]
|
|
369
|
+
), U = N.getTotalSize();
|
|
370
|
+
return /* @__PURE__ */ n(q, { children: g?.({
|
|
371
|
+
items: l,
|
|
340
372
|
label: t,
|
|
341
|
-
virtualItems:
|
|
373
|
+
virtualItems: D,
|
|
342
374
|
id: i,
|
|
343
|
-
filterValue:
|
|
344
|
-
onChange:
|
|
345
|
-
onListChange:
|
|
346
|
-
onSelectChange:
|
|
347
|
-
onRangeChange:
|
|
348
|
-
onRangeNumberChange:
|
|
349
|
-
onTextValue:
|
|
350
|
-
debounceMs:
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
375
|
+
filterValue: a,
|
|
376
|
+
onChange: F,
|
|
377
|
+
onListChange: j,
|
|
378
|
+
onSelectChange: A,
|
|
379
|
+
onRangeChange: P,
|
|
380
|
+
onRangeNumberChange: I,
|
|
381
|
+
onTextValue: G,
|
|
382
|
+
debounceMs: d,
|
|
383
|
+
listRef: $,
|
|
384
|
+
ref: N.measureElement,
|
|
385
|
+
scrollMargin: v,
|
|
386
|
+
totalSize: U,
|
|
387
|
+
updateCalendarState: R,
|
|
388
|
+
minValue: c,
|
|
389
|
+
maxValue: f,
|
|
390
|
+
checkboxLabel: u,
|
|
391
|
+
onCheckboxChange: B
|
|
358
392
|
}) ?? null });
|
|
359
393
|
};
|
|
360
394
|
export {
|
|
361
|
-
|
|
362
|
-
|
|
395
|
+
Ue as Options,
|
|
396
|
+
ce as TextFilterRenderer
|
|
363
397
|
};
|
|
@@ -24,6 +24,8 @@ interface IRendererConfig {
|
|
|
24
24
|
onRangeChange?: (index: number) => (value: string) => void;
|
|
25
25
|
onRangeNumberChange?: (index: number) => (event: Readonly<ChangeEvent<HTMLInputElement>>) => void;
|
|
26
26
|
ref: (node: Readonly<Element | null>) => void;
|
|
27
|
+
listRef: (node: Readonly<HTMLDivElement> | null) => void;
|
|
28
|
+
scrollMargin: number;
|
|
27
29
|
totalSize: number;
|
|
28
30
|
updateCalendarState: (isOpen: boolean) => void;
|
|
29
31
|
minValue?: number | string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useCallback as
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as l } from "react";
|
|
3
3
|
import { useTheme as f } from "styled-components";
|
|
4
4
|
import { OptionBoxContainer as a } from "../styles.js";
|
|
5
|
-
import { Container as
|
|
6
|
-
import { Icon as
|
|
5
|
+
import { Container as s } from "../../container/index.js";
|
|
6
|
+
import { Icon as d } from "../../icon/index.js";
|
|
7
7
|
import { ItemAction as h } from "../../list-item/item-action/index.js";
|
|
8
8
|
import "../../typography/heading/index.js";
|
|
9
9
|
import "../../typography/span/index.js";
|
|
@@ -15,10 +15,10 @@ const T = ({
|
|
|
15
15
|
onSelect: t,
|
|
16
16
|
value: e
|
|
17
17
|
}) => {
|
|
18
|
-
const m = f(), p =
|
|
18
|
+
const m = f(), p = l(() => {
|
|
19
19
|
t && t(i);
|
|
20
20
|
}, [t, i]);
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ c(
|
|
22
22
|
a,
|
|
23
23
|
{
|
|
24
24
|
$hasAction: o !== void 0,
|
|
@@ -26,14 +26,14 @@ const T = ({
|
|
|
26
26
|
onClick: p,
|
|
27
27
|
children: [
|
|
28
28
|
n && o === void 0 ? /* @__PURE__ */ r(
|
|
29
|
-
|
|
29
|
+
d,
|
|
30
30
|
{
|
|
31
31
|
icon: "check",
|
|
32
32
|
iconColor: m.palette.gray[800],
|
|
33
33
|
iconSize: "lg"
|
|
34
34
|
}
|
|
35
35
|
) : null,
|
|
36
|
-
/* @__PURE__ */ r(
|
|
36
|
+
/* @__PURE__ */ r(s, { flexGrow: 1, children: /* @__PURE__ */ r(C, { color: m.palette.gray[800], fontWeight: "bold", size: "md", children: i }) }),
|
|
37
37
|
o === void 0 ? null : /* @__PURE__ */ r(h, { action: o, value: e })
|
|
38
38
|
]
|
|
39
39
|
}
|
|
@@ -14,12 +14,12 @@ import { autoUpdate as j } from "../../../../node_modules/@floating-ui/dom/dist/
|
|
|
14
14
|
const G = 10, H = 20, U = 50, C = 100, ne = () => {
|
|
15
15
|
const t = T(), { table: o } = F(_), S = o?.options.meta?.hasNextPage ?? !1, f = o?.options.meta?.dataSize ?? 0, b = Number.isFinite(f) ? f : 0, g = o?.getRowCount() ?? 0, y = Number.isFinite(g) ? Math.max(0, g) : 0, l = S ? Math.max(b, C) : y, [n, i] = x(!1), [a, u] = x(
|
|
16
16
|
o?.getState().pagination.pageSize ?? 10
|
|
17
|
-
), { refs: p, floatingStyles:
|
|
17
|
+
), { refs: p, floatingStyles: z } = L({
|
|
18
18
|
middleware: [k({ mainAxis: 4 })],
|
|
19
19
|
open: n,
|
|
20
20
|
placement: "top-end",
|
|
21
21
|
whileElementsMounted: j
|
|
22
|
-
}), { setFloating:
|
|
22
|
+
}), { setFloating: E, setReference: I } = p, R = D(
|
|
23
23
|
() => A(
|
|
24
24
|
[G, H, U, C],
|
|
25
25
|
// eslint-disable-next-line functional/prefer-immutable-types
|
|
@@ -87,9 +87,9 @@ const G = 10, H = 20, U = 50, C = 100, ne = () => {
|
|
|
87
87
|
flexDirection: "column",
|
|
88
88
|
px: 0.25,
|
|
89
89
|
py: 0.25,
|
|
90
|
-
ref:
|
|
90
|
+
ref: E,
|
|
91
91
|
shadow: "md",
|
|
92
|
-
style:
|
|
92
|
+
style: { ...z, zIndex: 10 },
|
|
93
93
|
children: R.map((e) => {
|
|
94
94
|
const r = M(e);
|
|
95
95
|
return /* @__PURE__ */ s(
|
package/package.json
CHANGED