@fluidattacks/design 9.8.0 → 9.9.1
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/_virtual/index.js +3 -2
- package/dist/_virtual/index2.js +5 -3
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +2 -5
- package/dist/components/drawer/index.js +77 -73
- package/dist/components/drawer/types.d.ts +2 -0
- package/dist/components/filters/index.d.ts +2 -2
- package/dist/components/filters/options-menu/index.js +21 -21
- 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/filters/types.d.ts +2 -0
- package/dist/components/group-selector/option-container/index.js +8 -8
- package/dist/components/list-item/styles.js +1 -1
- package/dist/node_modules/react-joyride/dist/index.js +4 -4
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index.js
CHANGED
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as e } from "../node_modules/react-innertext/index.js";
|
|
3
|
+
var t = e();
|
|
4
|
+
const n = /* @__PURE__ */ r(t);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
n as default
|
|
5
7
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/@fastify/deepmerge/index.js";
|
|
3
|
+
var o = r();
|
|
4
|
+
const p = /* @__PURE__ */ e(o);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as o } from "../node_modules/scroll/index.js";
|
|
3
|
+
var t = o();
|
|
4
|
+
const s = /* @__PURE__ */ r(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback as
|
|
2
|
+
import { useCallback as k, useEffect as O } from "react";
|
|
3
3
|
import { createPortal as L } from "react-dom";
|
|
4
4
|
import { useTheme as P } from "styled-components";
|
|
5
5
|
import { DrawerWrapper as K, DrawerPanel as q, DrawerBody as A } from "./styles.js";
|
|
6
6
|
import { Button as F } from "../button/index.js";
|
|
7
7
|
import { Container as i } from "../container/index.js";
|
|
8
8
|
import { Icon as G } from "../icon/index.js";
|
|
9
|
-
import { IconButton as
|
|
9
|
+
import { IconButton as C } from "../icon-button/index.js";
|
|
10
10
|
import { Tabs as H } from "../tabs/index.js";
|
|
11
11
|
import "../typography/heading/index.js";
|
|
12
12
|
import "../typography/span/index.js";
|
|
13
|
-
import { Text as
|
|
13
|
+
import { Text as T } from "../typography/text/index.js";
|
|
14
14
|
const re = ({
|
|
15
|
-
_containerId:
|
|
16
|
-
_portal:
|
|
17
|
-
actions:
|
|
18
|
-
children:
|
|
15
|
+
_containerId: D = "portals",
|
|
16
|
+
_portal: S = !0,
|
|
17
|
+
actions: W = void 0,
|
|
18
|
+
children: z = void 0,
|
|
19
19
|
dismissable: a = !0,
|
|
20
|
-
footer:
|
|
21
|
-
footerMessage:
|
|
22
|
-
header:
|
|
20
|
+
footer: s = void 0,
|
|
21
|
+
footerMessage: y = void 0,
|
|
22
|
+
header: B = void 0,
|
|
23
23
|
id: d = "drawer-container",
|
|
24
|
-
modalRef:
|
|
25
|
-
side:
|
|
26
|
-
size:
|
|
27
|
-
subtitle:
|
|
28
|
-
tabs:
|
|
29
|
-
title:
|
|
30
|
-
titleIcon:
|
|
31
|
-
titleTag:
|
|
32
|
-
onClose:
|
|
24
|
+
modalRef: n,
|
|
25
|
+
side: g = "right",
|
|
26
|
+
size: I = "md",
|
|
27
|
+
subtitle: v = void 0,
|
|
28
|
+
tabs: w = void 0,
|
|
29
|
+
title: b,
|
|
30
|
+
titleIcon: x = void 0,
|
|
31
|
+
titleTag: j = void 0,
|
|
32
|
+
onClose: u = void 0
|
|
33
33
|
}) => {
|
|
34
|
-
const o = P(), p =
|
|
35
|
-
|
|
36
|
-
}, [
|
|
34
|
+
const o = P(), p = k(() => {
|
|
35
|
+
n.close(), u?.();
|
|
36
|
+
}, [n, u]), E = k(
|
|
37
37
|
(r) => {
|
|
38
38
|
a && r.target === r.currentTarget && p();
|
|
39
39
|
},
|
|
40
40
|
[a, p]
|
|
41
41
|
);
|
|
42
42
|
O(() => {
|
|
43
|
-
if (!a || !
|
|
43
|
+
if (!a || !n.isOpen)
|
|
44
44
|
return () => {
|
|
45
45
|
};
|
|
46
|
-
const r = (
|
|
47
|
-
|
|
46
|
+
const r = (l) => {
|
|
47
|
+
l.key === "Escape" && p();
|
|
48
48
|
};
|
|
49
49
|
return window.addEventListener("keydown", r), () => {
|
|
50
50
|
window.removeEventListener("keydown", r);
|
|
51
51
|
};
|
|
52
|
-
}, [a, p,
|
|
53
|
-
const
|
|
52
|
+
}, [a, p, n.isOpen]);
|
|
53
|
+
const $ = /* @__PURE__ */ e(
|
|
54
54
|
K,
|
|
55
55
|
{
|
|
56
|
-
$side:
|
|
56
|
+
$side: g,
|
|
57
57
|
id: `${d}-wrapper`,
|
|
58
|
-
onClick:
|
|
58
|
+
onClick: E,
|
|
59
59
|
role: "presentation",
|
|
60
60
|
children: /* @__PURE__ */ t(
|
|
61
61
|
q,
|
|
62
62
|
{
|
|
63
|
-
$side:
|
|
64
|
-
$size:
|
|
65
|
-
"aria-label":
|
|
63
|
+
$side: g,
|
|
64
|
+
$size: I,
|
|
65
|
+
"aria-label": n.name,
|
|
66
66
|
"aria-modal": "true",
|
|
67
67
|
"data-testid": d,
|
|
68
68
|
id: d,
|
|
@@ -96,7 +96,7 @@ const re = ({
|
|
|
96
96
|
gap: 0.5,
|
|
97
97
|
minWidth: "0",
|
|
98
98
|
children: [
|
|
99
|
-
|
|
99
|
+
x === void 0 ? void 0 : /* @__PURE__ */ e(
|
|
100
100
|
i,
|
|
101
101
|
{
|
|
102
102
|
alignItems: "center",
|
|
@@ -110,7 +110,7 @@ const re = ({
|
|
|
110
110
|
children: /* @__PURE__ */ e(
|
|
111
111
|
G,
|
|
112
112
|
{
|
|
113
|
-
icon:
|
|
113
|
+
icon: x,
|
|
114
114
|
iconColor: o.palette.gray[700],
|
|
115
115
|
iconSize: "md",
|
|
116
116
|
iconType: "fa-solid"
|
|
@@ -134,7 +134,7 @@ const re = ({
|
|
|
134
134
|
minWidth: "0",
|
|
135
135
|
children: [
|
|
136
136
|
/* @__PURE__ */ e(
|
|
137
|
-
|
|
137
|
+
T,
|
|
138
138
|
{
|
|
139
139
|
color: o.palette.gray[800],
|
|
140
140
|
display: "inline-block",
|
|
@@ -143,22 +143,22 @@ const re = ({
|
|
|
143
143
|
size: "lg",
|
|
144
144
|
textOverflow: "ellipsis",
|
|
145
145
|
whiteSpace: "nowrap",
|
|
146
|
-
children:
|
|
146
|
+
children: b
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
|
|
149
|
+
j
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
v === void 0 ? void 0 : /* @__PURE__ */ e(
|
|
154
|
+
T,
|
|
155
155
|
{
|
|
156
156
|
color: o.palette.gray[400],
|
|
157
157
|
overflow: "hidden",
|
|
158
158
|
size: "md",
|
|
159
159
|
textOverflow: "ellipsis",
|
|
160
160
|
whiteSpace: "nowrap",
|
|
161
|
-
children:
|
|
161
|
+
children: v
|
|
162
162
|
}
|
|
163
163
|
)
|
|
164
164
|
]
|
|
@@ -167,37 +167,37 @@ const re = ({
|
|
|
167
167
|
]
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
|
-
|
|
170
|
+
B
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
173
|
),
|
|
174
174
|
/* @__PURE__ */ t(i, { display: "flex", gap: 0.25, children: [
|
|
175
|
-
|
|
175
|
+
W?.map(
|
|
176
176
|
({
|
|
177
177
|
disabled: r,
|
|
178
|
-
icon:
|
|
179
|
-
iconColor:
|
|
178
|
+
icon: l,
|
|
179
|
+
iconColor: h,
|
|
180
180
|
shadow: c,
|
|
181
|
-
tooltip:
|
|
182
|
-
onClick:
|
|
181
|
+
tooltip: f,
|
|
182
|
+
onClick: m
|
|
183
183
|
}) => /* @__PURE__ */ e(
|
|
184
|
-
|
|
184
|
+
C,
|
|
185
185
|
{
|
|
186
186
|
disabled: r,
|
|
187
|
-
icon:
|
|
188
|
-
iconColor:
|
|
187
|
+
icon: l ?? "paper-plane",
|
|
188
|
+
iconColor: h ?? o.palette.gray[400],
|
|
189
189
|
iconSize: "sm",
|
|
190
190
|
iconType: "fa-light",
|
|
191
|
-
onClick:
|
|
191
|
+
onClick: m,
|
|
192
192
|
shadow: c,
|
|
193
|
-
tooltip:
|
|
193
|
+
tooltip: f,
|
|
194
194
|
variant: "ghost"
|
|
195
195
|
},
|
|
196
|
-
`${d}-${
|
|
196
|
+
`${d}-${l}`
|
|
197
197
|
)
|
|
198
198
|
),
|
|
199
199
|
a ? /* @__PURE__ */ e(
|
|
200
|
-
|
|
200
|
+
C,
|
|
201
201
|
{
|
|
202
202
|
icon: "xmark",
|
|
203
203
|
iconColor: o.palette.gray[400],
|
|
@@ -212,9 +212,9 @@ const re = ({
|
|
|
212
212
|
]
|
|
213
213
|
}
|
|
214
214
|
),
|
|
215
|
-
|
|
216
|
-
/* @__PURE__ */ e(A, { children:
|
|
217
|
-
|
|
215
|
+
w ? /* @__PURE__ */ e(i, { display: "flex", pt: 0.25, width: "100%", children: /* @__PURE__ */ e(H, { items: w }) }) : void 0,
|
|
216
|
+
/* @__PURE__ */ e(A, { children: z }),
|
|
217
|
+
s || y ? /* @__PURE__ */ t(
|
|
218
218
|
i,
|
|
219
219
|
{
|
|
220
220
|
alignSelf: "stretch",
|
|
@@ -225,25 +225,29 @@ const re = ({
|
|
|
225
225
|
px: 1.25,
|
|
226
226
|
py: 1,
|
|
227
227
|
children: [
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
y,
|
|
229
|
+
s ? /* @__PURE__ */ e(
|
|
230
230
|
i,
|
|
231
231
|
{
|
|
232
232
|
display: "flex",
|
|
233
233
|
gap: 0.5,
|
|
234
234
|
justify: "end",
|
|
235
235
|
width: "100%",
|
|
236
|
-
children:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
236
|
+
children: s.map(
|
|
237
|
+
({ disabled: r, icon: l, id: h, text: c, onClick: f }, m) => /* @__PURE__ */ e(
|
|
238
|
+
F,
|
|
239
|
+
{
|
|
240
|
+
disabled: r,
|
|
241
|
+
icon: l,
|
|
242
|
+
id: h,
|
|
243
|
+
onClick: f,
|
|
244
|
+
variant: m === 0 ? "primary" : "tertiary",
|
|
245
|
+
width: "100%",
|
|
246
|
+
children: c
|
|
247
|
+
},
|
|
248
|
+
`${m}-${c}`
|
|
249
|
+
)
|
|
250
|
+
)
|
|
247
251
|
}
|
|
248
252
|
) : void 0
|
|
249
253
|
]
|
|
@@ -254,10 +258,10 @@ const re = ({
|
|
|
254
258
|
)
|
|
255
259
|
}
|
|
256
260
|
);
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
document.getElementById(
|
|
260
|
-
) :
|
|
261
|
+
return n.isOpen ? S ? L(
|
|
262
|
+
$,
|
|
263
|
+
document.getElementById(D) ?? document.body
|
|
264
|
+
) : $ : null;
|
|
261
265
|
};
|
|
262
266
|
export {
|
|
263
267
|
re as Drawer
|
|
@@ -23,11 +23,13 @@ interface IDrawerActionProps extends Partial<IIconModifiable>, Pick<IDisplayModi
|
|
|
23
23
|
* Drawer footer button props.
|
|
24
24
|
* @interface IDrawerButtonProps
|
|
25
25
|
* @extends IIconModifiable
|
|
26
|
+
* @property { boolean } [disabled] - Whether the button is disabled.
|
|
26
27
|
* @property { string } [id] - Button id.
|
|
27
28
|
* @property { string } [text] - Button text.
|
|
28
29
|
* @property { Function } [onClick] - Button click handler.
|
|
29
30
|
*/
|
|
30
31
|
interface IDrawerButtonProps extends Partial<IIconModifiable> {
|
|
32
|
+
disabled?: boolean;
|
|
31
33
|
id?: string;
|
|
32
34
|
onClick?: () => void;
|
|
33
35
|
text?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActiveFilters } from './active-filters';
|
|
2
|
-
import { IFilterItem, IFilterProps, IFiltersImperativeHandle, IFiltersOptions, TFilterType } from './types';
|
|
2
|
+
import { IFilterItem, IFilterOptionProps, IFilterProps, IFiltersImperativeHandle, IFiltersOptions, TFilterType } from './types';
|
|
3
3
|
import { partitionFilters } from './utils';
|
|
4
4
|
declare const Filters: import('react').ForwardRefExoticComponent<IFilterProps & import('react').RefAttributes<IFiltersImperativeHandle>>;
|
|
5
|
-
export type { IFilterItem, IFiltersImperativeHandle, IFiltersOptions, TFilterType, };
|
|
5
|
+
export type { IFilterItem, IFilterOptionProps, IFiltersImperativeHandle, IFiltersOptions, TFilterType, };
|
|
6
6
|
export { Filters, ActiveFilters, partitionFilters };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as d, jsxs as
|
|
1
|
+
import { jsx as d, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import b from "../../../_virtual/dayjs.min.js";
|
|
3
3
|
import { l as Q } from "../../../_virtual/lodash.js";
|
|
4
4
|
import { forwardRef as U, useContext as Z, useMemo as ee, useCallback as C, Fragment as te } from "react";
|
|
@@ -17,20 +17,20 @@ import "../../typography/span/index.js";
|
|
|
17
17
|
import { Text as H } from "../../typography/text/index.js";
|
|
18
18
|
import { parseCheckboxesFilterValue as S, formatCheckboxesFilterValue as A } from "../../../utils/filters.js";
|
|
19
19
|
const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
20
|
-
const
|
|
20
|
+
const w = oe(), {
|
|
21
21
|
id: t,
|
|
22
22
|
searchValues: { searchFilter: h },
|
|
23
23
|
setSearchValues: I,
|
|
24
24
|
values: Y,
|
|
25
25
|
setValues: f,
|
|
26
26
|
scrollState: z
|
|
27
|
-
} = Z(re), { ref: B } = z,
|
|
27
|
+
} = Z(re), { ref: B } = z, g = Y[t], k = (m ?? []).some(
|
|
28
28
|
(e) => e.type !== "combobox" && (e.items ?? []).length > de
|
|
29
29
|
), L = m?.find(
|
|
30
30
|
(e) => e.type === "includeExclude"
|
|
31
|
-
),
|
|
31
|
+
), y = m?.find(
|
|
32
32
|
(e) => e.type === "checkboxes" && e.excludeLabel
|
|
33
|
-
), { mode: D, values: T } = S(
|
|
33
|
+
), { mode: D, values: T } = S(g ?? ""), W = D === "exclude", _ = T.length > 0, N = !x || k || y !== void 0, $ = ee(() => m?.map((e) => {
|
|
34
34
|
const s = e?.items ?? [];
|
|
35
35
|
return e.type === "combobox" ? s : s.filter(
|
|
36
36
|
(u) => u.label?.toLowerCase().includes(h.toLowerCase()) ?? !1
|
|
@@ -97,10 +97,10 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
97
97
|
), c = l.filter(
|
|
98
98
|
(a) => a === "-" || RegExp(/^\d+$/).test(a.trim())
|
|
99
99
|
), n = ["-", "-"];
|
|
100
|
-
c.forEach((a,
|
|
101
|
-
if (
|
|
100
|
+
c.forEach((a, R) => {
|
|
101
|
+
if (R >= 2) return;
|
|
102
102
|
const E = a.trim();
|
|
103
|
-
RegExp(/^\d+$/).test(E) ? n[
|
|
103
|
+
RegExp(/^\d+$/).test(E) ? n[R] = Number(E) : E === "-" && (n[R] = "-");
|
|
104
104
|
});
|
|
105
105
|
const i = u ?? 0;
|
|
106
106
|
if (e === "" || e === void 0 || e === null)
|
|
@@ -150,8 +150,8 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
150
150
|
ref: F
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
const P =
|
|
154
|
-
|
|
153
|
+
const P = g !== void 0 && g !== "" && h === "" || k && h !== "", O = /* @__PURE__ */ p(te, { children: [
|
|
154
|
+
g && h === "" ? /* @__PURE__ */ d(
|
|
155
155
|
v,
|
|
156
156
|
{
|
|
157
157
|
$variant: "lowRelevance",
|
|
@@ -172,7 +172,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
172
172
|
}
|
|
173
173
|
) : void 0
|
|
174
174
|
] });
|
|
175
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ p(
|
|
176
176
|
le,
|
|
177
177
|
{
|
|
178
178
|
$left: "346px",
|
|
@@ -180,8 +180,8 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
180
180
|
ref: F,
|
|
181
181
|
children: [
|
|
182
182
|
x && !N && P ? /* @__PURE__ */ d(ce, { "data-testid": "options-menu-floating-actions", children: O }) : void 0,
|
|
183
|
-
N ? /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
183
|
+
N ? /* @__PURE__ */ p(ae, { "data-testid": "options-menu-header", children: [
|
|
184
|
+
/* @__PURE__ */ p(
|
|
185
185
|
j,
|
|
186
186
|
{
|
|
187
187
|
display: "flex",
|
|
@@ -191,7 +191,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
191
191
|
x ? void 0 : /* @__PURE__ */ d(
|
|
192
192
|
H,
|
|
193
193
|
{
|
|
194
|
-
color:
|
|
194
|
+
color: w.palette.gray[800],
|
|
195
195
|
fontWeight: "bold",
|
|
196
196
|
size: "md",
|
|
197
197
|
children: `Select ${V}`
|
|
@@ -201,7 +201,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
),
|
|
204
|
-
|
|
204
|
+
y ? /* @__PURE__ */ d(
|
|
205
205
|
j,
|
|
206
206
|
{
|
|
207
207
|
"data-testid": "exclude-toggle-row",
|
|
@@ -214,7 +214,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
214
214
|
defaultChecked: W,
|
|
215
215
|
disabled: !_,
|
|
216
216
|
justify: "space-between",
|
|
217
|
-
leftText:
|
|
217
|
+
leftText: y.excludeLabel,
|
|
218
218
|
name: `${t}-exclude`,
|
|
219
219
|
onChange: q,
|
|
220
220
|
variant: "inline"
|
|
@@ -245,17 +245,17 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
245
245
|
"div",
|
|
246
246
|
{
|
|
247
247
|
style: { position: "relative" },
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ p(
|
|
249
249
|
ie,
|
|
250
250
|
{
|
|
251
251
|
$border: u.length > 1 && s > 0,
|
|
252
252
|
$overflow: o,
|
|
253
|
-
style: { padding: l ?
|
|
253
|
+
style: { padding: l ? w.spacing[0.875] : 0 },
|
|
254
254
|
children: [
|
|
255
|
-
x || u.length > 1 && !o ? /* @__PURE__ */ d(
|
|
255
|
+
x || e.showLabel === !0 || u.length > 1 && !o ? /* @__PURE__ */ d(
|
|
256
256
|
H,
|
|
257
257
|
{
|
|
258
|
-
color:
|
|
258
|
+
color: w.palette.gray[x ? 800 : 400],
|
|
259
259
|
fontWeight: "bold",
|
|
260
260
|
mb: 0.5,
|
|
261
261
|
size: "md",
|
|
@@ -265,7 +265,7 @@ const Ie = U(function({ hideTitle: x = !1, label: V, options: m }, F) {
|
|
|
265
265
|
/* @__PURE__ */ d(
|
|
266
266
|
ne,
|
|
267
267
|
{
|
|
268
|
-
filterValue:
|
|
268
|
+
filterValue: g,
|
|
269
269
|
filteredItems: $[s] ?? [],
|
|
270
270
|
id: t,
|
|
271
271
|
label: V,
|
|
@@ -1,185 +1,189 @@
|
|
|
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 r, 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 "../../../container/index.js";
|
|
20
|
-
import { Tag as
|
|
20
|
+
import { Tag as te } from "../../../tag/index.js";
|
|
21
21
|
import "../../../icon-button/index.js";
|
|
22
22
|
import "../../../button/index.js";
|
|
23
|
-
import { InputDateRange as
|
|
24
|
-
import { TextInput as
|
|
23
|
+
import { InputDateRange as oe } from "../../../inputs/fields/date-range/index.js";
|
|
24
|
+
import { TextInput as ne } from "../../../inputs/fields/text-input/index.js";
|
|
25
25
|
import "../../../layout/categories/buttons/index.js";
|
|
26
26
|
import "../../../inputs/utils/action-button/index.js";
|
|
27
|
-
import { InputNumberRange as
|
|
27
|
+
import { InputNumberRange as re } from "../../../inputs/fields/number-range/index.js";
|
|
28
28
|
import "../../../../node_modules/react-international-phone/dist/index.js";
|
|
29
|
-
import { useDebouncedCallback as
|
|
30
|
-
import {
|
|
31
|
-
|
|
29
|
+
import { useDebouncedCallback as le } from "../../../../hooks/use-debounced-callback.js";
|
|
30
|
+
import { useMountEffect as ae } from "../../../../hooks/use-mount-effect.js";
|
|
31
|
+
import { parseCheckboxesFilterValue as ie, parseTextFilterValue as se } from "../../../../utils/filters.js";
|
|
32
|
+
const ce = ({
|
|
32
33
|
id: i,
|
|
33
|
-
filterValue:
|
|
34
|
-
label:
|
|
34
|
+
filterValue: l,
|
|
35
|
+
label: a,
|
|
35
36
|
onTextValue: t,
|
|
36
37
|
checkboxLabel: s,
|
|
37
38
|
onCheckboxChange: e,
|
|
38
|
-
debounceMs:
|
|
39
|
+
debounceMs: n
|
|
39
40
|
}) => {
|
|
40
|
-
const { text:
|
|
41
|
-
|
|
42
|
-
), [
|
|
43
|
-
|
|
41
|
+
const { text: c, checked: f } = se(
|
|
42
|
+
l ?? ""
|
|
43
|
+
), [u, d] = T(c), [g, R] = T(c), h = Number.isFinite(n) && (n ?? 0) >= 0 ? Math.min(n ?? 0, 5e3) : 0, b = le(t, h);
|
|
44
|
+
c !== g && (R(c), d(c), b.cancel());
|
|
44
45
|
const k = p(
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
v
|
|
46
|
+
(x) => {
|
|
47
|
+
x.stopPropagation(), x.preventDefault();
|
|
48
|
+
const v = x.target.value;
|
|
49
|
+
d(v), h > 0 ? b(v) : t(v);
|
|
49
50
|
},
|
|
50
|
-
[h,
|
|
51
|
+
[h, b, t]
|
|
51
52
|
);
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ w(
|
|
53
54
|
"div",
|
|
54
55
|
{
|
|
55
56
|
style: {
|
|
56
57
|
display: "flex",
|
|
57
58
|
flexDirection: "column",
|
|
58
|
-
gap:
|
|
59
|
+
gap: L.spacing[0.25],
|
|
59
60
|
width: "100%"
|
|
60
61
|
},
|
|
61
62
|
children: [
|
|
62
|
-
s ? /* @__PURE__ */
|
|
63
|
-
|
|
63
|
+
s ? /* @__PURE__ */ r(
|
|
64
|
+
O,
|
|
64
65
|
{
|
|
65
|
-
checked:
|
|
66
|
+
checked: f,
|
|
66
67
|
label: s,
|
|
67
68
|
name: `${i}-checkbox`,
|
|
68
69
|
onChange: e,
|
|
69
70
|
value: "textCheck"
|
|
70
71
|
}
|
|
71
72
|
) : void 0,
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
73
|
+
/* @__PURE__ */ r(
|
|
74
|
+
ne,
|
|
74
75
|
{
|
|
75
76
|
name: i,
|
|
76
77
|
onChange: k,
|
|
77
|
-
placeholder: `Type ${
|
|
78
|
-
value:
|
|
78
|
+
placeholder: `Type ${a}...`,
|
|
79
|
+
value: u
|
|
79
80
|
}
|
|
80
81
|
)
|
|
81
82
|
]
|
|
82
83
|
}
|
|
83
84
|
);
|
|
84
|
-
},
|
|
85
|
+
}, me = {
|
|
85
86
|
text: ({
|
|
86
87
|
id: i,
|
|
87
|
-
filterValue:
|
|
88
|
-
label:
|
|
88
|
+
filterValue: l,
|
|
89
|
+
label: a,
|
|
89
90
|
onTextValue: t,
|
|
90
91
|
checkboxLabel: s,
|
|
91
92
|
onCheckboxChange: e,
|
|
92
|
-
debounceMs:
|
|
93
|
-
}) => t === void 0 ? null : /* @__PURE__ */
|
|
94
|
-
|
|
93
|
+
debounceMs: n
|
|
94
|
+
}) => t === void 0 ? null : /* @__PURE__ */ r(
|
|
95
|
+
ce,
|
|
95
96
|
{
|
|
96
97
|
checkboxLabel: s,
|
|
97
|
-
debounceMs:
|
|
98
|
-
filterValue:
|
|
98
|
+
debounceMs: n,
|
|
99
|
+
filterValue: l,
|
|
99
100
|
id: i,
|
|
100
|
-
label:
|
|
101
|
+
label: a,
|
|
101
102
|
onCheckboxChange: e,
|
|
102
103
|
onTextValue: t
|
|
103
104
|
}
|
|
104
105
|
),
|
|
105
106
|
checkboxes: ({
|
|
106
107
|
items: i,
|
|
107
|
-
virtualItems:
|
|
108
|
-
filterValue:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
virtualItems: l,
|
|
109
|
+
filterValue: a,
|
|
110
|
+
listRef: t,
|
|
111
|
+
ref: s,
|
|
112
|
+
scrollMargin: e,
|
|
113
|
+
totalSize: n,
|
|
114
|
+
onChange: c
|
|
112
115
|
}) => {
|
|
113
|
-
const
|
|
114
|
-
|
|
116
|
+
const f = new Set(
|
|
117
|
+
ie(a ?? "").values
|
|
115
118
|
);
|
|
116
|
-
return
|
|
119
|
+
return l.length > 0 ? (
|
|
117
120
|
// Positioning context for the absolute rows, and it reserves their height
|
|
118
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ r(
|
|
119
122
|
"div",
|
|
120
123
|
{
|
|
121
124
|
"data-testid": "options-virtual-list",
|
|
125
|
+
ref: t,
|
|
122
126
|
style: {
|
|
123
|
-
height: `${
|
|
127
|
+
height: `${n}px`,
|
|
124
128
|
position: "relative",
|
|
125
129
|
width: "100%"
|
|
126
130
|
},
|
|
127
|
-
children:
|
|
128
|
-
const
|
|
129
|
-
return /* @__PURE__ */
|
|
131
|
+
children: l.map((u) => {
|
|
132
|
+
const d = i[u.index], g = f.has(d?.value);
|
|
133
|
+
return /* @__PURE__ */ r(
|
|
130
134
|
"div",
|
|
131
135
|
{
|
|
132
|
-
"data-index":
|
|
133
|
-
ref:
|
|
136
|
+
"data-index": u.index,
|
|
137
|
+
ref: s,
|
|
134
138
|
style: {
|
|
135
139
|
position: "absolute",
|
|
136
|
-
top: `${
|
|
140
|
+
top: `${u.start - e}px`,
|
|
137
141
|
left: 0,
|
|
138
142
|
width: "100%"
|
|
139
143
|
},
|
|
140
|
-
children: /* @__PURE__ */
|
|
141
|
-
|
|
144
|
+
children: /* @__PURE__ */ r(y, { "aria-selected": g, children: /* @__PURE__ */ r(
|
|
145
|
+
O,
|
|
142
146
|
{
|
|
143
|
-
checked:
|
|
144
|
-
label:
|
|
145
|
-
name:
|
|
146
|
-
onChange:
|
|
147
|
-
value:
|
|
147
|
+
checked: g,
|
|
148
|
+
label: d?.label,
|
|
149
|
+
name: d?.value,
|
|
150
|
+
onChange: c,
|
|
151
|
+
value: d?.value
|
|
148
152
|
}
|
|
149
153
|
) })
|
|
150
154
|
},
|
|
151
|
-
`${
|
|
155
|
+
`${u.index}-${d?.value}`
|
|
152
156
|
);
|
|
153
157
|
})
|
|
154
158
|
}
|
|
155
159
|
)
|
|
156
|
-
) : /* @__PURE__ */
|
|
160
|
+
) : /* @__PURE__ */ r(X, {});
|
|
157
161
|
},
|
|
158
162
|
combobox: ({
|
|
159
163
|
id: i,
|
|
160
|
-
items:
|
|
161
|
-
filterValue:
|
|
164
|
+
items: l,
|
|
165
|
+
filterValue: a,
|
|
162
166
|
label: t,
|
|
163
167
|
onSelectChange: s
|
|
164
|
-
}) => /* @__PURE__ */
|
|
165
|
-
|
|
168
|
+
}) => /* @__PURE__ */ r(
|
|
169
|
+
Z,
|
|
166
170
|
{
|
|
167
|
-
items:
|
|
171
|
+
items: l,
|
|
168
172
|
name: i,
|
|
169
173
|
onSelect: s,
|
|
170
174
|
placeholder: `Search ${t}`,
|
|
171
|
-
selected:
|
|
175
|
+
selected: a?.split(",").map((e) => e.trim()).find((e) => l.some((n) => n.value === e)) ?? null
|
|
172
176
|
}
|
|
173
177
|
),
|
|
174
|
-
list: ({ items: i, filterValue:
|
|
175
|
-
|
|
178
|
+
list: ({ items: i, filterValue: l, onListChange: a }) => i.map((t) => /* @__PURE__ */ w(
|
|
179
|
+
y,
|
|
176
180
|
{
|
|
177
|
-
"aria-selected":
|
|
181
|
+
"aria-selected": l?.split(",").includes(t?.value),
|
|
178
182
|
as: "button",
|
|
179
|
-
onClick:
|
|
183
|
+
onClick: a?.(t.value),
|
|
180
184
|
children: [
|
|
181
|
-
t.icon ? /* @__PURE__ */
|
|
182
|
-
|
|
185
|
+
t.icon ? /* @__PURE__ */ r(
|
|
186
|
+
z,
|
|
183
187
|
{
|
|
184
188
|
icon: t.icon,
|
|
185
189
|
iconColor: t.iconColor,
|
|
@@ -187,10 +191,10 @@ const Z = ({
|
|
|
187
191
|
iconType: t.iconType ?? "fa-light"
|
|
188
192
|
}
|
|
189
193
|
) : void 0,
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
194
|
+
/* @__PURE__ */ r(
|
|
195
|
+
ee,
|
|
192
196
|
{
|
|
193
|
-
color:
|
|
197
|
+
color: L.palette.gray[800],
|
|
194
198
|
display: "block",
|
|
195
199
|
overflow: "hidden",
|
|
196
200
|
size: "md",
|
|
@@ -200,16 +204,16 @@ const Z = ({
|
|
|
200
204
|
children: t.label
|
|
201
205
|
}
|
|
202
206
|
),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
t.count === void 0 ? void 0 : /* @__PURE__ */
|
|
205
|
-
|
|
207
|
+
/* @__PURE__ */ r("span", { className: "filter-item" }),
|
|
208
|
+
t.count === void 0 ? void 0 : /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
|
|
209
|
+
te,
|
|
206
210
|
{
|
|
207
211
|
tagLabel: t.count.toLocaleString("en-US"),
|
|
208
212
|
variant: "default"
|
|
209
213
|
}
|
|
210
214
|
) }),
|
|
211
|
-
|
|
212
|
-
|
|
215
|
+
l?.split(",").includes(t?.value) ? /* @__PURE__ */ r("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ r(
|
|
216
|
+
z,
|
|
213
217
|
{
|
|
214
218
|
icon: "check",
|
|
215
219
|
iconClass: "selected",
|
|
@@ -223,25 +227,25 @@ const Z = ({
|
|
|
223
227
|
)),
|
|
224
228
|
dateRange: ({
|
|
225
229
|
id: i,
|
|
226
|
-
filterValue:
|
|
227
|
-
onRangeChange:
|
|
230
|
+
filterValue: l,
|
|
231
|
+
onRangeChange: a,
|
|
228
232
|
updateCalendarState: t
|
|
229
233
|
}) => {
|
|
230
|
-
const [s, e] =
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
234
|
+
const [s, e] = l?.split(",").filter((n) => J(n).isValid() || n === "-") ?? [];
|
|
235
|
+
return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
236
|
+
oe,
|
|
233
237
|
{
|
|
234
238
|
name: i,
|
|
235
239
|
onOpenCalendar: t,
|
|
236
240
|
propsMax: {
|
|
237
241
|
name: "maxValue",
|
|
238
242
|
value: e !== "-" ? e : "",
|
|
239
|
-
onChange:
|
|
243
|
+
onChange: a?.(1)
|
|
240
244
|
},
|
|
241
245
|
propsMin: {
|
|
242
246
|
name: "minValue",
|
|
243
247
|
value: s !== "-" ? s : "",
|
|
244
|
-
onChange:
|
|
248
|
+
onChange: a?.(0)
|
|
245
249
|
},
|
|
246
250
|
variant: "filters"
|
|
247
251
|
}
|
|
@@ -249,114 +253,144 @@ const Z = ({
|
|
|
249
253
|
},
|
|
250
254
|
numberRange: ({
|
|
251
255
|
id: i,
|
|
252
|
-
filterValue:
|
|
253
|
-
minValue:
|
|
256
|
+
filterValue: l,
|
|
257
|
+
minValue: a,
|
|
254
258
|
maxValue: t,
|
|
255
259
|
onRangeNumberChange: s
|
|
256
260
|
}) => {
|
|
257
|
-
const e =
|
|
258
|
-
return /* @__PURE__ */
|
|
259
|
-
|
|
261
|
+
const e = l?.split(",") ?? [], n = e[0]?.trim(), c = e[1]?.trim(), f = n && n !== "" && n !== "-" && !E(Number(n)) ? Number(n) : void 0, u = c && c !== "" && c !== "-" && !E(Number(c)) ? Number(c) : void 0;
|
|
262
|
+
return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
263
|
+
re,
|
|
260
264
|
{
|
|
261
265
|
name: i,
|
|
262
266
|
propsMax: {
|
|
263
267
|
name: "maxValue",
|
|
264
|
-
min:
|
|
268
|
+
min: a,
|
|
265
269
|
max: t,
|
|
266
270
|
onChange: s?.(1),
|
|
267
271
|
placeholder: "Max %",
|
|
268
|
-
value:
|
|
272
|
+
value: u
|
|
269
273
|
},
|
|
270
274
|
propsMin: {
|
|
271
275
|
name: "minValue",
|
|
272
|
-
min:
|
|
276
|
+
min: a,
|
|
273
277
|
max: t,
|
|
274
278
|
onChange: s?.(0),
|
|
275
279
|
placeholder: "Min %",
|
|
276
|
-
value:
|
|
280
|
+
value: f
|
|
277
281
|
},
|
|
278
282
|
variant: "filters"
|
|
279
283
|
}
|
|
280
284
|
) });
|
|
281
285
|
}
|
|
282
|
-
},
|
|
286
|
+
}, Ge = ({
|
|
283
287
|
id: i,
|
|
284
|
-
filteredItems:
|
|
285
|
-
filterValue:
|
|
288
|
+
filteredItems: l,
|
|
289
|
+
filterValue: a,
|
|
286
290
|
label: t,
|
|
287
291
|
option: s,
|
|
288
292
|
onChange: e
|
|
289
293
|
}) => {
|
|
290
|
-
const { type:
|
|
291
|
-
calendarState: { updateCalendarState:
|
|
294
|
+
const { type: n, minValue: c, maxValue: f, checkboxLabel: u, debounceMs: d } = s ?? {}, g = n && me[n], {
|
|
295
|
+
calendarState: { updateCalendarState: R },
|
|
292
296
|
scrollState: h
|
|
293
|
-
} =
|
|
297
|
+
} = K(W), b = p(() => 36, []), k = p(
|
|
294
298
|
() => h.ref.current,
|
|
295
299
|
[h.ref]
|
|
296
|
-
),
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
), x = Q(null), [v, V] = T(0), M = p(() => {
|
|
301
|
+
const o = h.ref.current, m = x.current;
|
|
302
|
+
if (o && m) {
|
|
303
|
+
const S = m.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop;
|
|
304
|
+
V(
|
|
305
|
+
(C) => C === S ? C : S
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
}, [h.ref]), $ = p(
|
|
309
|
+
(o) => {
|
|
310
|
+
x.current = o, M();
|
|
311
|
+
},
|
|
312
|
+
[M]
|
|
313
|
+
);
|
|
314
|
+
ae(() => {
|
|
315
|
+
const o = h.ref.current;
|
|
316
|
+
if (o === null || typeof ResizeObserver > "u")
|
|
317
|
+
return;
|
|
318
|
+
const m = new ResizeObserver(M), S = () => {
|
|
319
|
+
m.disconnect(), Array.from(o.children).forEach((_) => {
|
|
320
|
+
m.observe(_);
|
|
321
|
+
});
|
|
322
|
+
}, C = new MutationObserver(S);
|
|
323
|
+
return C.observe(o, { childList: !0 }), S(), () => {
|
|
324
|
+
C.disconnect(), m.disconnect();
|
|
325
|
+
};
|
|
326
|
+
});
|
|
327
|
+
const N = H({
|
|
328
|
+
count: l.length,
|
|
329
|
+
estimateSize: b,
|
|
299
330
|
getScrollElement: k,
|
|
331
|
+
scrollMargin: v,
|
|
300
332
|
useFlushSync: !1
|
|
301
|
-
}),
|
|
302
|
-
(
|
|
303
|
-
|
|
333
|
+
}), D = N.getVirtualItems(), F = p(
|
|
334
|
+
(o) => {
|
|
335
|
+
o.stopPropagation(), o.preventDefault(), e(o.target.value, n ?? "");
|
|
304
336
|
},
|
|
305
|
-
[e,
|
|
306
|
-
),
|
|
307
|
-
(
|
|
308
|
-
e(
|
|
337
|
+
[e, n]
|
|
338
|
+
), P = p(
|
|
339
|
+
(o) => (m) => {
|
|
340
|
+
e(m, "dateRange", o);
|
|
309
341
|
},
|
|
310
342
|
[e]
|
|
311
|
-
),
|
|
312
|
-
(
|
|
313
|
-
|
|
343
|
+
), I = p(
|
|
344
|
+
(o) => (m) => {
|
|
345
|
+
m.stopPropagation(), m.preventDefault(), e(m.target.value, "numberRange", o);
|
|
314
346
|
},
|
|
315
347
|
[e]
|
|
316
|
-
),
|
|
317
|
-
(
|
|
318
|
-
e(
|
|
348
|
+
), j = p(
|
|
349
|
+
(o) => () => {
|
|
350
|
+
e(o, "list");
|
|
319
351
|
},
|
|
320
352
|
[e]
|
|
321
|
-
),
|
|
322
|
-
(
|
|
323
|
-
e(
|
|
353
|
+
), A = p(
|
|
354
|
+
(o) => () => {
|
|
355
|
+
e(o, "combobox");
|
|
324
356
|
},
|
|
325
357
|
[e]
|
|
326
|
-
),
|
|
327
|
-
(
|
|
328
|
-
|
|
358
|
+
), B = p(
|
|
359
|
+
(o) => {
|
|
360
|
+
o.stopPropagation(), e(o.target.checked ? "true" : "false", "textCheckbox");
|
|
329
361
|
},
|
|
330
362
|
[e]
|
|
331
|
-
),
|
|
332
|
-
(
|
|
333
|
-
e(
|
|
363
|
+
), G = p(
|
|
364
|
+
(o) => {
|
|
365
|
+
e(o, n ?? "text");
|
|
334
366
|
},
|
|
335
|
-
[e,
|
|
336
|
-
),
|
|
337
|
-
return /* @__PURE__ */
|
|
338
|
-
items:
|
|
367
|
+
[e, n]
|
|
368
|
+
), U = N.getTotalSize();
|
|
369
|
+
return /* @__PURE__ */ r(q, { children: g?.({
|
|
370
|
+
items: l,
|
|
339
371
|
label: t,
|
|
340
|
-
virtualItems:
|
|
372
|
+
virtualItems: D,
|
|
341
373
|
id: i,
|
|
342
|
-
filterValue:
|
|
343
|
-
onChange:
|
|
344
|
-
onListChange:
|
|
345
|
-
onSelectChange:
|
|
346
|
-
onRangeChange:
|
|
347
|
-
onRangeNumberChange:
|
|
348
|
-
onTextValue:
|
|
349
|
-
debounceMs:
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
374
|
+
filterValue: a,
|
|
375
|
+
onChange: F,
|
|
376
|
+
onListChange: j,
|
|
377
|
+
onSelectChange: A,
|
|
378
|
+
onRangeChange: P,
|
|
379
|
+
onRangeNumberChange: I,
|
|
380
|
+
onTextValue: G,
|
|
381
|
+
debounceMs: d,
|
|
382
|
+
listRef: $,
|
|
383
|
+
ref: N.measureElement,
|
|
384
|
+
scrollMargin: v,
|
|
385
|
+
totalSize: U,
|
|
386
|
+
updateCalendarState: R,
|
|
387
|
+
minValue: c,
|
|
388
|
+
maxValue: f,
|
|
389
|
+
checkboxLabel: u,
|
|
390
|
+
onCheckboxChange: B
|
|
357
391
|
}) ?? null });
|
|
358
392
|
};
|
|
359
393
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
394
|
+
Ge as Options,
|
|
395
|
+
ce as TextFilterRenderer
|
|
362
396
|
};
|
|
@@ -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;
|
|
@@ -77,6 +77,8 @@ interface IFilterOptionProps {
|
|
|
77
77
|
includeLabel?: string;
|
|
78
78
|
/** Debounce window in ms before committing typed value to filter state. Applies to type "text". */
|
|
79
79
|
debounceMs?: number;
|
|
80
|
+
/** Whether the block shows its label as a heading under the menu title. Checkboxes blocks hide it by default. */
|
|
81
|
+
showLabel?: boolean;
|
|
80
82
|
}
|
|
81
83
|
/** Filter option properties. */
|
|
82
84
|
interface IFiltersOptions {
|
|
@@ -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
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import E, { useMemo as J, useCallback as Q, useRef as N, useState as nt, useEffect as F, isValidElement as dt, cloneElement as ht } from "react";
|
|
2
2
|
import { useMemoDeepCompare as $t, usePrevious as xt, useMount as Ut, useUpdateEffect as Mt, useWindowSize as jt } from "../../@gilbarbara/hooks/dist/index.js";
|
|
3
|
-
import { s as Ht } from "../../../_virtual/
|
|
3
|
+
import { s as Ht } from "../../../_virtual/index.js";
|
|
4
4
|
import z from "../../is-lite/dist/index.js";
|
|
5
|
-
import ut from "../../../_virtual/
|
|
6
|
-
import Yt from "../../../_virtual/
|
|
5
|
+
import ut from "../../../_virtual/index2.js";
|
|
6
|
+
import Yt from "../../../_virtual/index3.js";
|
|
7
7
|
import It from "../../@gilbarbara/deep-equal/dist/index.js";
|
|
8
|
-
import zt from "../../../_virtual/
|
|
8
|
+
import zt from "../../../_virtual/index4.js";
|
|
9
9
|
import Nt from "../../../_virtual/scrollparent.js";
|
|
10
10
|
import { createPortal as Wt } from "react-dom";
|
|
11
11
|
import { offset as yt, shift as Kt, arrow as Gt, useFloating as Et, autoPlacement as Vt, flip as Jt } from "../../@floating-ui/react-dom/dist/floating-ui.react-dom.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../_virtual/
|
|
1
|
+
import { __module as r } from "../../../_virtual/index5.js";
|
|
2
2
|
import { __require as o } from "../cjs/use-sync-external-store-shim.production.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.development.js";
|
|
4
4
|
var e;
|
package/package.json
CHANGED