@fluidattacks/design 9.9.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/components/card/card-with-input/index.js +2 -3
- package/dist/components/filters/filters-menu/index.js +23 -24
- package/dist/components/filters/options-menu/options/index.js +198 -165
- 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/slider/index.js +2 -3
- package/package.json +1 -1
|
@@ -12,7 +12,6 @@ import "react-dom";
|
|
|
12
12
|
import "../../typography/heading/index.js";
|
|
13
13
|
import "../../typography/span/index.js";
|
|
14
14
|
import "../../typography/text/index.js";
|
|
15
|
-
import "../../inputs/styles.js";
|
|
16
15
|
import "../../container/index.js";
|
|
17
16
|
import "../../icon-button/index.js";
|
|
18
17
|
import "../../../_virtual/dayjs.min.js";
|
|
@@ -21,7 +20,7 @@ import "../../layout/categories/buttons/index.js";
|
|
|
21
20
|
import { InputNumber as S } from "../../inputs/fields/number/index.js";
|
|
22
21
|
import "../../inputs/utils/action-button/index.js";
|
|
23
22
|
import "../../../node_modules/react-international-phone/dist/index.js";
|
|
24
|
-
const
|
|
23
|
+
const it = ({
|
|
25
24
|
control: u,
|
|
26
25
|
description: B,
|
|
27
26
|
disabled: t,
|
|
@@ -142,5 +141,5 @@ const pt = ({
|
|
|
142
141
|
);
|
|
143
142
|
};
|
|
144
143
|
export {
|
|
145
|
-
|
|
144
|
+
it as CardWithInput
|
|
146
145
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import I from "../../../_virtual/snakeCase.js";
|
|
3
|
-
import { forwardRef as O, useContext as $, useMemo as B, useCallback as
|
|
3
|
+
import { forwardRef as O, useContext as $, useMemo as B, useCallback as h, Fragment as L } from "react";
|
|
4
4
|
import { useTheme as R } from "styled-components";
|
|
5
5
|
import { FiltersContext as A } from "../context/index.js";
|
|
6
6
|
import { NoMatches as P } from "../search/no-matches/index.js";
|
|
@@ -15,7 +15,6 @@ import "react-dom";
|
|
|
15
15
|
import "../../typography/heading/index.js";
|
|
16
16
|
import "../../typography/span/index.js";
|
|
17
17
|
import { Text as M } from "../../typography/text/index.js";
|
|
18
|
-
import "../../inputs/styles.js";
|
|
19
18
|
import { Tag as K } from "../../tag/index.js";
|
|
20
19
|
import "../../../_virtual/dayjs.min.js";
|
|
21
20
|
import "../../icon-button/index.js";
|
|
@@ -27,8 +26,8 @@ import { parseTextFilterValue as U, parseCheckboxesFilterValue as X, parseInclud
|
|
|
27
26
|
const Z = (c, d) => {
|
|
28
27
|
if (d?.some((t) => t.type === "text") ?? !1)
|
|
29
28
|
return U(c ?? "").text ? "1" : "0";
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
29
|
+
const l = new Set(d?.map((t) => t.type) ?? []);
|
|
30
|
+
if (l.size === 1 && l.has("checkboxes"))
|
|
32
31
|
return X(
|
|
33
32
|
c ?? ""
|
|
34
33
|
).values.length.toString();
|
|
@@ -39,11 +38,11 @@ const Z = (c, d) => {
|
|
|
39
38
|
return (t.length + f.length).toString();
|
|
40
39
|
}
|
|
41
40
|
return (c ?? "").split(",").filter((t) => t && t !== "-").length.toString();
|
|
42
|
-
},
|
|
41
|
+
}, ke = O(function({
|
|
43
42
|
includeSearch: d = !1,
|
|
44
43
|
groupedFilters: g,
|
|
45
|
-
handleChangeId:
|
|
46
|
-
pinnedFilters:
|
|
44
|
+
handleChangeId: l,
|
|
45
|
+
pinnedFilters: p
|
|
47
46
|
}, b) {
|
|
48
47
|
const t = R(), {
|
|
49
48
|
id: f,
|
|
@@ -52,16 +51,16 @@ const Z = (c, d) => {
|
|
|
52
51
|
values: s,
|
|
53
52
|
updateSearch: v,
|
|
54
53
|
setValues: u
|
|
55
|
-
} = $(A), C = q(g, y), w = B(() => Object.values(s).filter(Boolean).length > 0, [s]), S =
|
|
54
|
+
} = $(A), C = q(g, y), w = B(() => Object.values(s).filter(Boolean).length > 0, [s]), S = p.length > 0, V = h(
|
|
56
55
|
(e) => () => {
|
|
57
|
-
|
|
56
|
+
l(e), v({ previousValue: s[e] ?? "" }), m({ searchFilter: "", searchGlobal: "" });
|
|
58
57
|
},
|
|
59
|
-
[
|
|
60
|
-
), j =
|
|
58
|
+
[l, v, m, s]
|
|
59
|
+
), j = h(() => {
|
|
61
60
|
u(
|
|
62
61
|
(e) => Object.keys(e).reduce((n, r) => ({ ...n, [r]: "" }), {})
|
|
63
|
-
),
|
|
64
|
-
}, [u,
|
|
62
|
+
), l("");
|
|
63
|
+
}, [u, l]), z = h(
|
|
65
64
|
(e) => {
|
|
66
65
|
m((n) => ({
|
|
67
66
|
...n,
|
|
@@ -69,7 +68,7 @@ const Z = (c, d) => {
|
|
|
69
68
|
}));
|
|
70
69
|
},
|
|
71
70
|
[m]
|
|
72
|
-
), E =
|
|
71
|
+
), E = h(
|
|
73
72
|
(e) => (n) => {
|
|
74
73
|
u((r) => ({ ...r, [e]: n }));
|
|
75
74
|
},
|
|
@@ -108,7 +107,7 @@ const Z = (c, d) => {
|
|
|
108
107
|
scroll: "y",
|
|
109
108
|
width: "100%",
|
|
110
109
|
children: [
|
|
111
|
-
S ? /* @__PURE__ */ o(k, { "data-testid": "menu-pinned", children:
|
|
110
|
+
S ? /* @__PURE__ */ o(k, { "data-testid": "menu-pinned", children: p.map((e) => {
|
|
112
111
|
const n = e.options?.[0]?.items?.map((r) => ({
|
|
113
112
|
name: r.label ?? r.value,
|
|
114
113
|
value: r.value
|
|
@@ -141,17 +140,17 @@ const Z = (c, d) => {
|
|
|
141
140
|
children: e
|
|
142
141
|
}
|
|
143
142
|
) : void 0,
|
|
144
|
-
n.map((
|
|
145
|
-
const G = s[
|
|
143
|
+
n.map((i) => {
|
|
144
|
+
const G = s[i.id], F = Z(
|
|
146
145
|
G,
|
|
147
|
-
|
|
146
|
+
i.options
|
|
148
147
|
);
|
|
149
148
|
return /* @__PURE__ */ o(L, { children: /* @__PURE__ */ a(
|
|
150
149
|
N,
|
|
151
150
|
{
|
|
152
151
|
as: "button",
|
|
153
|
-
"data-testid":
|
|
154
|
-
onClick: V(
|
|
152
|
+
"data-testid": i.id,
|
|
153
|
+
onClick: V(i.id),
|
|
155
154
|
children: [
|
|
156
155
|
/* @__PURE__ */ o(
|
|
157
156
|
T,
|
|
@@ -162,7 +161,7 @@ const Z = (c, d) => {
|
|
|
162
161
|
iconType: "fa-light"
|
|
163
162
|
}
|
|
164
163
|
),
|
|
165
|
-
|
|
164
|
+
i.label,
|
|
166
165
|
/* @__PURE__ */ a(
|
|
167
166
|
x,
|
|
168
167
|
{
|
|
@@ -171,7 +170,7 @@ const Z = (c, d) => {
|
|
|
171
170
|
gap: 0.5,
|
|
172
171
|
style: { marginLeft: "auto" },
|
|
173
172
|
children: [
|
|
174
|
-
f ===
|
|
173
|
+
f === i.id ? /* @__PURE__ */ o(
|
|
175
174
|
T,
|
|
176
175
|
{
|
|
177
176
|
icon: "chevron-right",
|
|
@@ -186,7 +185,7 @@ const Z = (c, d) => {
|
|
|
186
185
|
)
|
|
187
186
|
]
|
|
188
187
|
}
|
|
189
|
-
) },
|
|
188
|
+
) }, i.id);
|
|
190
189
|
})
|
|
191
190
|
]
|
|
192
191
|
},
|
|
@@ -198,5 +197,5 @@ const Z = (c, d) => {
|
|
|
198
197
|
] });
|
|
199
198
|
});
|
|
200
199
|
export {
|
|
201
|
-
|
|
200
|
+
ke as FiltersMenu
|
|
202
201
|
};
|
|
@@ -1,186 +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
|
-
import "../../../inputs/styles.js";
|
|
20
19
|
import "../../../container/index.js";
|
|
21
|
-
import { Tag as
|
|
20
|
+
import { Tag as te } from "../../../tag/index.js";
|
|
22
21
|
import "../../../icon-button/index.js";
|
|
23
22
|
import "../../../button/index.js";
|
|
24
|
-
import { InputDateRange as
|
|
25
|
-
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";
|
|
26
25
|
import "../../../layout/categories/buttons/index.js";
|
|
27
26
|
import "../../../inputs/utils/action-button/index.js";
|
|
28
|
-
import { InputNumberRange as
|
|
27
|
+
import { InputNumberRange as re } from "../../../inputs/fields/number-range/index.js";
|
|
29
28
|
import "../../../../node_modules/react-international-phone/dist/index.js";
|
|
30
|
-
import { useDebouncedCallback as
|
|
31
|
-
import {
|
|
32
|
-
|
|
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 = ({
|
|
33
33
|
id: i,
|
|
34
|
-
filterValue:
|
|
35
|
-
label:
|
|
34
|
+
filterValue: l,
|
|
35
|
+
label: a,
|
|
36
36
|
onTextValue: t,
|
|
37
37
|
checkboxLabel: s,
|
|
38
38
|
onCheckboxChange: e,
|
|
39
|
-
debounceMs:
|
|
39
|
+
debounceMs: n
|
|
40
40
|
}) => {
|
|
41
|
-
const { text:
|
|
42
|
-
|
|
43
|
-
), [
|
|
44
|
-
|
|
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());
|
|
45
45
|
const k = p(
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
v
|
|
46
|
+
(x) => {
|
|
47
|
+
x.stopPropagation(), x.preventDefault();
|
|
48
|
+
const v = x.target.value;
|
|
49
|
+
d(v), h > 0 ? b(v) : t(v);
|
|
50
50
|
},
|
|
51
|
-
[h,
|
|
51
|
+
[h, b, t]
|
|
52
52
|
);
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ w(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
style: {
|
|
57
57
|
display: "flex",
|
|
58
58
|
flexDirection: "column",
|
|
59
|
-
gap:
|
|
59
|
+
gap: L.spacing[0.25],
|
|
60
60
|
width: "100%"
|
|
61
61
|
},
|
|
62
62
|
children: [
|
|
63
|
-
s ? /* @__PURE__ */
|
|
64
|
-
|
|
63
|
+
s ? /* @__PURE__ */ r(
|
|
64
|
+
O,
|
|
65
65
|
{
|
|
66
|
-
checked:
|
|
66
|
+
checked: f,
|
|
67
67
|
label: s,
|
|
68
68
|
name: `${i}-checkbox`,
|
|
69
69
|
onChange: e,
|
|
70
70
|
value: "textCheck"
|
|
71
71
|
}
|
|
72
72
|
) : void 0,
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
73
|
+
/* @__PURE__ */ r(
|
|
74
|
+
ne,
|
|
75
75
|
{
|
|
76
76
|
name: i,
|
|
77
77
|
onChange: k,
|
|
78
|
-
placeholder: `Type ${
|
|
79
|
-
value:
|
|
78
|
+
placeholder: `Type ${a}...`,
|
|
79
|
+
value: u
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
-
},
|
|
85
|
+
}, me = {
|
|
86
86
|
text: ({
|
|
87
87
|
id: i,
|
|
88
|
-
filterValue:
|
|
89
|
-
label:
|
|
88
|
+
filterValue: l,
|
|
89
|
+
label: a,
|
|
90
90
|
onTextValue: t,
|
|
91
91
|
checkboxLabel: s,
|
|
92
92
|
onCheckboxChange: e,
|
|
93
|
-
debounceMs:
|
|
94
|
-
}) => t === void 0 ? null : /* @__PURE__ */
|
|
95
|
-
|
|
93
|
+
debounceMs: n
|
|
94
|
+
}) => t === void 0 ? null : /* @__PURE__ */ r(
|
|
95
|
+
ce,
|
|
96
96
|
{
|
|
97
97
|
checkboxLabel: s,
|
|
98
|
-
debounceMs:
|
|
99
|
-
filterValue:
|
|
98
|
+
debounceMs: n,
|
|
99
|
+
filterValue: l,
|
|
100
100
|
id: i,
|
|
101
|
-
label:
|
|
101
|
+
label: a,
|
|
102
102
|
onCheckboxChange: e,
|
|
103
103
|
onTextValue: t
|
|
104
104
|
}
|
|
105
105
|
),
|
|
106
106
|
checkboxes: ({
|
|
107
107
|
items: i,
|
|
108
|
-
virtualItems:
|
|
109
|
-
filterValue:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
virtualItems: l,
|
|
109
|
+
filterValue: a,
|
|
110
|
+
listRef: t,
|
|
111
|
+
ref: s,
|
|
112
|
+
scrollMargin: e,
|
|
113
|
+
totalSize: n,
|
|
114
|
+
onChange: c
|
|
113
115
|
}) => {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
+
const f = new Set(
|
|
117
|
+
ie(a ?? "").values
|
|
116
118
|
);
|
|
117
|
-
return
|
|
119
|
+
return l.length > 0 ? (
|
|
118
120
|
// Positioning context for the absolute rows, and it reserves their height
|
|
119
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ r(
|
|
120
122
|
"div",
|
|
121
123
|
{
|
|
122
124
|
"data-testid": "options-virtual-list",
|
|
125
|
+
ref: t,
|
|
123
126
|
style: {
|
|
124
|
-
height: `${
|
|
127
|
+
height: `${n}px`,
|
|
125
128
|
position: "relative",
|
|
126
129
|
width: "100%"
|
|
127
130
|
},
|
|
128
|
-
children:
|
|
129
|
-
const
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
+
children: l.map((u) => {
|
|
132
|
+
const d = i[u.index], g = f.has(d?.value);
|
|
133
|
+
return /* @__PURE__ */ r(
|
|
131
134
|
"div",
|
|
132
135
|
{
|
|
133
|
-
"data-index":
|
|
134
|
-
ref:
|
|
136
|
+
"data-index": u.index,
|
|
137
|
+
ref: s,
|
|
135
138
|
style: {
|
|
136
139
|
position: "absolute",
|
|
137
|
-
top: `${
|
|
140
|
+
top: `${u.start - e}px`,
|
|
138
141
|
left: 0,
|
|
139
142
|
width: "100%"
|
|
140
143
|
},
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
-
|
|
144
|
+
children: /* @__PURE__ */ r(y, { "aria-selected": g, children: /* @__PURE__ */ r(
|
|
145
|
+
O,
|
|
143
146
|
{
|
|
144
|
-
checked:
|
|
145
|
-
label:
|
|
146
|
-
name:
|
|
147
|
-
onChange:
|
|
148
|
-
value:
|
|
147
|
+
checked: g,
|
|
148
|
+
label: d?.label,
|
|
149
|
+
name: d?.value,
|
|
150
|
+
onChange: c,
|
|
151
|
+
value: d?.value
|
|
149
152
|
}
|
|
150
153
|
) })
|
|
151
154
|
},
|
|
152
|
-
`${
|
|
155
|
+
`${u.index}-${d?.value}`
|
|
153
156
|
);
|
|
154
157
|
})
|
|
155
158
|
}
|
|
156
159
|
)
|
|
157
|
-
) : /* @__PURE__ */
|
|
160
|
+
) : /* @__PURE__ */ r(X, {});
|
|
158
161
|
},
|
|
159
162
|
combobox: ({
|
|
160
163
|
id: i,
|
|
161
|
-
items:
|
|
162
|
-
filterValue:
|
|
164
|
+
items: l,
|
|
165
|
+
filterValue: a,
|
|
163
166
|
label: t,
|
|
164
167
|
onSelectChange: s
|
|
165
|
-
}) => /* @__PURE__ */
|
|
166
|
-
|
|
168
|
+
}) => /* @__PURE__ */ r(
|
|
169
|
+
Z,
|
|
167
170
|
{
|
|
168
|
-
items:
|
|
171
|
+
items: l,
|
|
169
172
|
name: i,
|
|
170
173
|
onSelect: s,
|
|
171
174
|
placeholder: `Search ${t}`,
|
|
172
|
-
selected:
|
|
175
|
+
selected: a?.split(",").map((e) => e.trim()).find((e) => l.some((n) => n.value === e)) ?? null
|
|
173
176
|
}
|
|
174
177
|
),
|
|
175
|
-
list: ({ items: i, filterValue:
|
|
176
|
-
|
|
178
|
+
list: ({ items: i, filterValue: l, onListChange: a }) => i.map((t) => /* @__PURE__ */ w(
|
|
179
|
+
y,
|
|
177
180
|
{
|
|
178
|
-
"aria-selected":
|
|
181
|
+
"aria-selected": l?.split(",").includes(t?.value),
|
|
179
182
|
as: "button",
|
|
180
|
-
onClick:
|
|
183
|
+
onClick: a?.(t.value),
|
|
181
184
|
children: [
|
|
182
|
-
t.icon ? /* @__PURE__ */
|
|
183
|
-
|
|
185
|
+
t.icon ? /* @__PURE__ */ r(
|
|
186
|
+
z,
|
|
184
187
|
{
|
|
185
188
|
icon: t.icon,
|
|
186
189
|
iconColor: t.iconColor,
|
|
@@ -188,10 +191,10 @@ const Z = ({
|
|
|
188
191
|
iconType: t.iconType ?? "fa-light"
|
|
189
192
|
}
|
|
190
193
|
) : void 0,
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
194
|
+
/* @__PURE__ */ r(
|
|
195
|
+
ee,
|
|
193
196
|
{
|
|
194
|
-
color:
|
|
197
|
+
color: L.palette.gray[800],
|
|
195
198
|
display: "block",
|
|
196
199
|
overflow: "hidden",
|
|
197
200
|
size: "md",
|
|
@@ -201,16 +204,16 @@ const Z = ({
|
|
|
201
204
|
children: t.label
|
|
202
205
|
}
|
|
203
206
|
),
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
t.count === void 0 ? void 0 : /* @__PURE__ */
|
|
206
|
-
|
|
207
|
+
/* @__PURE__ */ r("span", { className: "filter-item" }),
|
|
208
|
+
t.count === void 0 ? void 0 : /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
|
|
209
|
+
te,
|
|
207
210
|
{
|
|
208
211
|
tagLabel: t.count.toLocaleString("en-US"),
|
|
209
212
|
variant: "default"
|
|
210
213
|
}
|
|
211
214
|
) }),
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
l?.split(",").includes(t?.value) ? /* @__PURE__ */ r("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ r(
|
|
216
|
+
z,
|
|
214
217
|
{
|
|
215
218
|
icon: "check",
|
|
216
219
|
iconClass: "selected",
|
|
@@ -224,25 +227,25 @@ const Z = ({
|
|
|
224
227
|
)),
|
|
225
228
|
dateRange: ({
|
|
226
229
|
id: i,
|
|
227
|
-
filterValue:
|
|
228
|
-
onRangeChange:
|
|
230
|
+
filterValue: l,
|
|
231
|
+
onRangeChange: a,
|
|
229
232
|
updateCalendarState: t
|
|
230
233
|
}) => {
|
|
231
|
-
const [s, e] =
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
|
|
234
|
+
const [s, e] = l?.split(",").filter((n) => J(n).isValid() || n === "-") ?? [];
|
|
235
|
+
return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
236
|
+
oe,
|
|
234
237
|
{
|
|
235
238
|
name: i,
|
|
236
239
|
onOpenCalendar: t,
|
|
237
240
|
propsMax: {
|
|
238
241
|
name: "maxValue",
|
|
239
242
|
value: e !== "-" ? e : "",
|
|
240
|
-
onChange:
|
|
243
|
+
onChange: a?.(1)
|
|
241
244
|
},
|
|
242
245
|
propsMin: {
|
|
243
246
|
name: "minValue",
|
|
244
247
|
value: s !== "-" ? s : "",
|
|
245
|
-
onChange:
|
|
248
|
+
onChange: a?.(0)
|
|
246
249
|
},
|
|
247
250
|
variant: "filters"
|
|
248
251
|
}
|
|
@@ -250,114 +253,144 @@ const Z = ({
|
|
|
250
253
|
},
|
|
251
254
|
numberRange: ({
|
|
252
255
|
id: i,
|
|
253
|
-
filterValue:
|
|
254
|
-
minValue:
|
|
256
|
+
filterValue: l,
|
|
257
|
+
minValue: a,
|
|
255
258
|
maxValue: t,
|
|
256
259
|
onRangeNumberChange: s
|
|
257
260
|
}) => {
|
|
258
|
-
const e =
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
|
|
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,
|
|
261
264
|
{
|
|
262
265
|
name: i,
|
|
263
266
|
propsMax: {
|
|
264
267
|
name: "maxValue",
|
|
265
|
-
min:
|
|
268
|
+
min: a,
|
|
266
269
|
max: t,
|
|
267
270
|
onChange: s?.(1),
|
|
268
271
|
placeholder: "Max %",
|
|
269
|
-
value:
|
|
272
|
+
value: u
|
|
270
273
|
},
|
|
271
274
|
propsMin: {
|
|
272
275
|
name: "minValue",
|
|
273
|
-
min:
|
|
276
|
+
min: a,
|
|
274
277
|
max: t,
|
|
275
278
|
onChange: s?.(0),
|
|
276
279
|
placeholder: "Min %",
|
|
277
|
-
value:
|
|
280
|
+
value: f
|
|
278
281
|
},
|
|
279
282
|
variant: "filters"
|
|
280
283
|
}
|
|
281
284
|
) });
|
|
282
285
|
}
|
|
283
|
-
},
|
|
286
|
+
}, Ge = ({
|
|
284
287
|
id: i,
|
|
285
|
-
filteredItems:
|
|
286
|
-
filterValue:
|
|
288
|
+
filteredItems: l,
|
|
289
|
+
filterValue: a,
|
|
287
290
|
label: t,
|
|
288
291
|
option: s,
|
|
289
292
|
onChange: e
|
|
290
293
|
}) => {
|
|
291
|
-
const { type:
|
|
292
|
-
calendarState: { updateCalendarState:
|
|
294
|
+
const { type: n, minValue: c, maxValue: f, checkboxLabel: u, debounceMs: d } = s ?? {}, g = n && me[n], {
|
|
295
|
+
calendarState: { updateCalendarState: R },
|
|
293
296
|
scrollState: h
|
|
294
|
-
} =
|
|
297
|
+
} = K(W), b = p(() => 36, []), k = p(
|
|
295
298
|
() => h.ref.current,
|
|
296
299
|
[h.ref]
|
|
297
|
-
),
|
|
298
|
-
|
|
299
|
-
|
|
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,
|
|
300
330
|
getScrollElement: k,
|
|
331
|
+
scrollMargin: v,
|
|
301
332
|
useFlushSync: !1
|
|
302
|
-
}),
|
|
303
|
-
(
|
|
304
|
-
|
|
333
|
+
}), D = N.getVirtualItems(), F = p(
|
|
334
|
+
(o) => {
|
|
335
|
+
o.stopPropagation(), o.preventDefault(), e(o.target.value, n ?? "");
|
|
305
336
|
},
|
|
306
|
-
[e,
|
|
307
|
-
),
|
|
308
|
-
(
|
|
309
|
-
e(
|
|
337
|
+
[e, n]
|
|
338
|
+
), P = p(
|
|
339
|
+
(o) => (m) => {
|
|
340
|
+
e(m, "dateRange", o);
|
|
310
341
|
},
|
|
311
342
|
[e]
|
|
312
|
-
),
|
|
313
|
-
(
|
|
314
|
-
|
|
343
|
+
), I = p(
|
|
344
|
+
(o) => (m) => {
|
|
345
|
+
m.stopPropagation(), m.preventDefault(), e(m.target.value, "numberRange", o);
|
|
315
346
|
},
|
|
316
347
|
[e]
|
|
317
|
-
),
|
|
318
|
-
(
|
|
319
|
-
e(
|
|
348
|
+
), j = p(
|
|
349
|
+
(o) => () => {
|
|
350
|
+
e(o, "list");
|
|
320
351
|
},
|
|
321
352
|
[e]
|
|
322
|
-
),
|
|
323
|
-
(
|
|
324
|
-
e(
|
|
353
|
+
), A = p(
|
|
354
|
+
(o) => () => {
|
|
355
|
+
e(o, "combobox");
|
|
325
356
|
},
|
|
326
357
|
[e]
|
|
327
|
-
),
|
|
328
|
-
(
|
|
329
|
-
|
|
358
|
+
), B = p(
|
|
359
|
+
(o) => {
|
|
360
|
+
o.stopPropagation(), e(o.target.checked ? "true" : "false", "textCheckbox");
|
|
330
361
|
},
|
|
331
362
|
[e]
|
|
332
|
-
),
|
|
333
|
-
(
|
|
334
|
-
e(
|
|
363
|
+
), G = p(
|
|
364
|
+
(o) => {
|
|
365
|
+
e(o, n ?? "text");
|
|
335
366
|
},
|
|
336
|
-
[e,
|
|
337
|
-
),
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
items:
|
|
367
|
+
[e, n]
|
|
368
|
+
), U = N.getTotalSize();
|
|
369
|
+
return /* @__PURE__ */ r(q, { children: g?.({
|
|
370
|
+
items: l,
|
|
340
371
|
label: t,
|
|
341
|
-
virtualItems:
|
|
372
|
+
virtualItems: D,
|
|
342
373
|
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
|
-
|
|
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
|
|
358
391
|
}) ?? null });
|
|
359
392
|
};
|
|
360
393
|
export {
|
|
361
|
-
|
|
362
|
-
|
|
394
|
+
Ge as Options,
|
|
395
|
+
ce as TextFilterRenderer
|
|
363
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;
|
|
@@ -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
|
}
|
|
@@ -9,7 +9,6 @@ import { Thumb as k } from "./thumb/index.js";
|
|
|
9
9
|
import { normalizeValue as v } from "./utils.js";
|
|
10
10
|
import { Container as w } from "../container/index.js";
|
|
11
11
|
import { OutlineContainer as y } from "../inputs/outline-container/index.js";
|
|
12
|
-
import "../inputs/styles.js";
|
|
13
12
|
import "../checkbox/index.js";
|
|
14
13
|
import "../icon/index.js";
|
|
15
14
|
import "../../_virtual/lodash.js";
|
|
@@ -23,7 +22,7 @@ import "react-dom";
|
|
|
23
22
|
import "../layout/categories/buttons/index.js";
|
|
24
23
|
import "../inputs/utils/action-button/index.js";
|
|
25
24
|
import "../../node_modules/react-international-phone/dist/index.js";
|
|
26
|
-
const
|
|
25
|
+
const ee = (o) => {
|
|
27
26
|
const p = S(), m = $(null), { label: s, minValue: i = 0, maxValue: n = 100, name: r, setValue: d, watch: c } = o, a = x(), t = V({
|
|
28
27
|
...o,
|
|
29
28
|
numberFormatter: a,
|
|
@@ -76,6 +75,6 @@ const re = (o) => {
|
|
|
76
75
|
) });
|
|
77
76
|
};
|
|
78
77
|
export {
|
|
79
|
-
|
|
78
|
+
ee as Slider,
|
|
80
79
|
x as useNumberFormatter
|
|
81
80
|
};
|
package/package.json
CHANGED