@fluidattacks/design 11.0.0 → 11.1.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/dist/components/checkbox/styles.js +4 -4
- package/dist/components/filters/index.stories.d.ts +2 -1
- package/dist/components/filters/options-menu/options/index.js +177 -157
- package/dist/components/filters/styles.d.ts +2 -1
- package/dist/components/filters/styles.js +9 -2
- package/dist/components/icon/index.js +42 -39
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled as i } from "styled-components";
|
|
2
|
-
const
|
|
2
|
+
const t = i.label`
|
|
3
3
|
${({ theme: a }) => `
|
|
4
4
|
align-items: center;
|
|
5
5
|
color: ${a.palette.gray[600]};
|
|
@@ -24,7 +24,7 @@ const p = i.label`
|
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
svg {
|
|
27
|
+
input ~ span > svg {
|
|
28
28
|
background-color: ${a.palette.white};
|
|
29
29
|
border-radius: ${a.spacing[0.25]};
|
|
30
30
|
border: 1px solid ${a.palette.gray[600]};
|
|
@@ -36,7 +36,7 @@ const p = i.label`
|
|
|
36
36
|
padding: ${a.spacing[0.25]};
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
svg > path {
|
|
39
|
+
input ~ span > svg > path {
|
|
40
40
|
fill: ${a.palette.white};
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -78,5 +78,5 @@ const p = i.label`
|
|
|
78
78
|
`}
|
|
79
79
|
`;
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
t as InputContainer
|
|
82
82
|
};
|
|
@@ -8,5 +8,6 @@ declare const IncludeExclude: import('storybook/internal/csf').AnnotatedStoryFn<
|
|
|
8
8
|
declare const IncludeExcludeSearch: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IFilterProps>;
|
|
9
9
|
declare const PinnedSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('@storybook/react').Args>;
|
|
10
10
|
declare const Combobox: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IFilterProps>;
|
|
11
|
+
declare const CheckboxesIndicators: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IFilterProps>;
|
|
11
12
|
export default config;
|
|
12
|
-
export { Combobox, Default, Grouped, IncludeExclude, IncludeExcludeSearch, Navigable, PinnedSelect, };
|
|
13
|
+
export { CheckboxesIndicators, Combobox, Default, Grouped, IncludeExclude, IncludeExcludeSearch, Navigable, PinnedSelect, };
|
|
@@ -1,104 +1,104 @@
|
|
|
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 y, StyledItemCount as
|
|
9
|
-
import { MultiSelectSearch as
|
|
10
|
-
import { SingleSelectSearch as
|
|
11
|
-
import { Checkbox as
|
|
12
|
-
import { theme as
|
|
13
|
-
import { Icon as
|
|
1
|
+
import { jsx as r, Fragment as Q, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { useVirtualizer as W } from "../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
3
|
+
import X from "../../../../_virtual/dayjs.min.js";
|
|
4
|
+
import w from "../../../../_virtual/isNaN.js";
|
|
5
|
+
import { useContext as Y, useCallback as u, useRef as Z, useState as E } from "react";
|
|
6
|
+
import { FiltersContext as ee } from "../../context/index.js";
|
|
7
|
+
import { NoMatches as te } from "../../search/no-matches/index.js";
|
|
8
|
+
import { StyledItem as y, StyledItemCount as L, StyledCheckboxLabel as oe } from "../../styles.js";
|
|
9
|
+
import { MultiSelectSearch as ne } from "../include-exclude/multi-select.js";
|
|
10
|
+
import { SingleSelectSearch as re } from "../single-select/index.js";
|
|
11
|
+
import { Checkbox as $ } from "../../../checkbox/index.js";
|
|
12
|
+
import { theme as D } from "../../../colors/index.js";
|
|
13
|
+
import { Icon as z } from "../../../icon/index.js";
|
|
14
14
|
import "styled-components";
|
|
15
15
|
import "../../../../_virtual/lodash.js";
|
|
16
16
|
import "react-dom";
|
|
17
17
|
import "../../../typography/heading/index.js";
|
|
18
|
-
import { Span as
|
|
18
|
+
import { Span as le } from "../../../typography/span/index.js";
|
|
19
19
|
import "../../../typography/text/index.js";
|
|
20
20
|
import "../../../inputs/styles.js";
|
|
21
21
|
import "../../../container/index.js";
|
|
22
|
-
import { Tag as
|
|
22
|
+
import { Tag as O } from "../../../tag/index.js";
|
|
23
23
|
import "../../../icon-button/index.js";
|
|
24
24
|
import "../../../button/index.js";
|
|
25
|
-
import { InputDateRange as
|
|
26
|
-
import { TextInput as
|
|
25
|
+
import { InputDateRange as ae } from "../../../inputs/fields/date-range/index.js";
|
|
26
|
+
import { TextInput as ie } from "../../../inputs/fields/text-input/index.js";
|
|
27
27
|
import "../../../layout/categories/buttons/index.js";
|
|
28
28
|
import "../../../inputs/utils/action-button/index.js";
|
|
29
|
-
import { InputNumberRange as
|
|
29
|
+
import { InputNumberRange as ce } from "../../../inputs/fields/number-range/index.js";
|
|
30
30
|
import "../../../../node_modules/react-international-phone/dist/index.js";
|
|
31
31
|
import { useDebouncedCallback as se } from "../../../../hooks/use-debounced-callback.js";
|
|
32
|
-
import { useMountEffect as
|
|
33
|
-
import { parseCheckboxesFilterValue as
|
|
32
|
+
import { useMountEffect as me } from "../../../../hooks/use-mount-effect.js";
|
|
33
|
+
import { parseCheckboxesFilterValue as V, parseTextFilterValue as ue } from "../../../../utils/filters.js";
|
|
34
34
|
const pe = ({
|
|
35
35
|
id: i,
|
|
36
|
-
filterValue:
|
|
36
|
+
filterValue: l,
|
|
37
37
|
label: a,
|
|
38
38
|
onTextValue: t,
|
|
39
|
-
checkboxLabel:
|
|
39
|
+
checkboxLabel: c,
|
|
40
40
|
onCheckboxChange: e,
|
|
41
|
-
debounceMs:
|
|
41
|
+
debounceMs: n
|
|
42
42
|
}) => {
|
|
43
|
-
const { text:
|
|
44
|
-
|
|
45
|
-
), [
|
|
46
|
-
|
|
47
|
-
const k =
|
|
43
|
+
const { text: m, checked: f } = ue(
|
|
44
|
+
l ?? ""
|
|
45
|
+
), [d, s] = E(m), [g, T] = E(m), h = Number.isFinite(n) && (n ?? 0) >= 0 ? Math.min(n ?? 0, 5e3) : 0, b = se(t, h);
|
|
46
|
+
m !== g && (T(m), s(m), b.cancel());
|
|
47
|
+
const k = u(
|
|
48
48
|
(x) => {
|
|
49
49
|
x.stopPropagation(), x.preventDefault();
|
|
50
50
|
const v = x.target.value;
|
|
51
|
-
|
|
51
|
+
s(v), h > 0 ? b(v) : t(v);
|
|
52
52
|
},
|
|
53
53
|
[h, b, t]
|
|
54
54
|
);
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ R(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
58
|
style: {
|
|
59
59
|
display: "flex",
|
|
60
60
|
flexDirection: "column",
|
|
61
|
-
gap:
|
|
61
|
+
gap: D.spacing[0.25],
|
|
62
62
|
width: "100%"
|
|
63
63
|
},
|
|
64
64
|
children: [
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
c ? /* @__PURE__ */ r(
|
|
66
|
+
$,
|
|
67
67
|
{
|
|
68
68
|
checked: f,
|
|
69
|
-
label:
|
|
69
|
+
label: c,
|
|
70
70
|
name: `${i}-checkbox`,
|
|
71
71
|
onChange: e,
|
|
72
72
|
value: "textCheck"
|
|
73
73
|
}
|
|
74
74
|
) : void 0,
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
75
|
+
/* @__PURE__ */ r(
|
|
76
|
+
ie,
|
|
77
77
|
{
|
|
78
78
|
name: i,
|
|
79
79
|
onChange: k,
|
|
80
80
|
placeholder: `Type ${a}...`,
|
|
81
|
-
value:
|
|
81
|
+
value: d
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
]
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
},
|
|
87
|
+
}, de = {
|
|
88
88
|
text: ({
|
|
89
89
|
id: i,
|
|
90
|
-
filterValue:
|
|
90
|
+
filterValue: l,
|
|
91
91
|
label: a,
|
|
92
92
|
onTextValue: t,
|
|
93
|
-
checkboxLabel:
|
|
93
|
+
checkboxLabel: c,
|
|
94
94
|
onCheckboxChange: e,
|
|
95
|
-
debounceMs:
|
|
96
|
-
}) => t === void 0 ? null : /* @__PURE__ */
|
|
95
|
+
debounceMs: n
|
|
96
|
+
}) => t === void 0 ? null : /* @__PURE__ */ r(
|
|
97
97
|
pe,
|
|
98
98
|
{
|
|
99
|
-
checkboxLabel:
|
|
100
|
-
debounceMs:
|
|
101
|
-
filterValue:
|
|
99
|
+
checkboxLabel: c,
|
|
100
|
+
debounceMs: n,
|
|
101
|
+
filterValue: l,
|
|
102
102
|
id: i,
|
|
103
103
|
label: a,
|
|
104
104
|
onCheckboxChange: e,
|
|
@@ -107,105 +107,125 @@ const pe = ({
|
|
|
107
107
|
),
|
|
108
108
|
checkboxes: ({
|
|
109
109
|
items: i,
|
|
110
|
-
virtualItems:
|
|
110
|
+
virtualItems: l,
|
|
111
111
|
filterValue: a,
|
|
112
112
|
listRef: t,
|
|
113
|
-
ref:
|
|
113
|
+
ref: c,
|
|
114
114
|
scrollMargin: e,
|
|
115
|
-
totalSize:
|
|
116
|
-
onChange:
|
|
115
|
+
totalSize: n,
|
|
116
|
+
onChange: m
|
|
117
117
|
}) => {
|
|
118
118
|
const f = new Set(
|
|
119
|
-
|
|
119
|
+
V(a ?? "").values
|
|
120
120
|
);
|
|
121
|
-
return
|
|
121
|
+
return l.length > 0 ? (
|
|
122
122
|
// Positioning context for the absolute rows, and it reserves their height
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ r(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
126
126
|
"data-testid": "options-virtual-list",
|
|
127
127
|
ref: t,
|
|
128
128
|
style: {
|
|
129
|
-
height: `${
|
|
129
|
+
height: `${n}px`,
|
|
130
130
|
position: "relative",
|
|
131
131
|
width: "100%"
|
|
132
132
|
},
|
|
133
|
-
children:
|
|
134
|
-
const
|
|
135
|
-
return /* @__PURE__ */
|
|
133
|
+
children: l.map((d) => {
|
|
134
|
+
const s = i[d.index], g = f.has(s?.value);
|
|
135
|
+
return /* @__PURE__ */ r(
|
|
136
136
|
"div",
|
|
137
137
|
{
|
|
138
|
-
"data-index":
|
|
139
|
-
ref:
|
|
138
|
+
"data-index": d.index,
|
|
139
|
+
ref: c,
|
|
140
140
|
style: {
|
|
141
141
|
position: "absolute",
|
|
142
|
-
top: `${
|
|
142
|
+
top: `${d.start - e}px`,
|
|
143
143
|
left: 0,
|
|
144
144
|
width: "100%"
|
|
145
145
|
},
|
|
146
|
-
children: /* @__PURE__ */
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
children: /* @__PURE__ */ R(y, { "aria-selected": g, children: [
|
|
147
|
+
/* @__PURE__ */ r(
|
|
148
|
+
$,
|
|
149
|
+
{
|
|
150
|
+
checked: g,
|
|
151
|
+
label: s?.icon ? /* @__PURE__ */ R(oe, { children: [
|
|
152
|
+
/* @__PURE__ */ r(
|
|
153
|
+
z,
|
|
154
|
+
{
|
|
155
|
+
icon: s.icon,
|
|
156
|
+
iconColor: s.iconColor,
|
|
157
|
+
iconSize: "md",
|
|
158
|
+
iconType: s.iconType ?? "fa-light"
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
s.label ?? s.value
|
|
162
|
+
] }) : s?.label,
|
|
163
|
+
name: s?.value,
|
|
164
|
+
onChange: m,
|
|
165
|
+
value: s?.value
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
s?.count === void 0 ? void 0 : /* @__PURE__ */ r(L, { children: /* @__PURE__ */ r(
|
|
169
|
+
O,
|
|
170
|
+
{
|
|
171
|
+
tagLabel: s.count.toLocaleString("en-US"),
|
|
172
|
+
variant: "default"
|
|
173
|
+
}
|
|
174
|
+
) })
|
|
175
|
+
] })
|
|
156
176
|
},
|
|
157
|
-
`${
|
|
177
|
+
`${d.index}-${s?.value}`
|
|
158
178
|
);
|
|
159
179
|
})
|
|
160
180
|
}
|
|
161
181
|
)
|
|
162
|
-
) : /* @__PURE__ */
|
|
182
|
+
) : /* @__PURE__ */ r(te, {});
|
|
163
183
|
},
|
|
164
184
|
combobox: ({
|
|
165
185
|
id: i,
|
|
166
|
-
items:
|
|
186
|
+
items: l,
|
|
167
187
|
filterValue: a,
|
|
168
188
|
label: t,
|
|
169
|
-
onSelectChange:
|
|
170
|
-
}) => /* @__PURE__ */
|
|
171
|
-
|
|
189
|
+
onSelectChange: c
|
|
190
|
+
}) => /* @__PURE__ */ r(
|
|
191
|
+
re,
|
|
172
192
|
{
|
|
173
|
-
items:
|
|
193
|
+
items: l,
|
|
174
194
|
name: i,
|
|
175
|
-
onSelect:
|
|
195
|
+
onSelect: c,
|
|
176
196
|
placeholder: `Search ${t}`,
|
|
177
|
-
selected: a?.split(",").map((e) => e.trim()).find((e) =>
|
|
197
|
+
selected: a?.split(",").map((e) => e.trim()).find((e) => l.some((n) => n.value === e)) ?? null
|
|
178
198
|
}
|
|
179
199
|
),
|
|
180
200
|
multiSelect: ({
|
|
181
201
|
id: i,
|
|
182
|
-
items:
|
|
202
|
+
items: l,
|
|
183
203
|
filterValue: a,
|
|
184
204
|
label: t,
|
|
185
|
-
onMultiSelectToggle:
|
|
186
|
-
}) => /* @__PURE__ */
|
|
187
|
-
|
|
205
|
+
onMultiSelectToggle: c
|
|
206
|
+
}) => /* @__PURE__ */ r(
|
|
207
|
+
ne,
|
|
188
208
|
{
|
|
189
|
-
items: [...
|
|
209
|
+
items: [...l],
|
|
190
210
|
name: i,
|
|
191
|
-
onToggle:
|
|
211
|
+
onToggle: c,
|
|
192
212
|
placeholder: `Search ${t}`,
|
|
193
213
|
portal: !0,
|
|
194
|
-
selected:
|
|
195
|
-
(e) =>
|
|
214
|
+
selected: V(a ?? "").values.filter(
|
|
215
|
+
(e) => l.some((n) => n.value === e)
|
|
196
216
|
),
|
|
197
217
|
showValues: !1
|
|
198
218
|
}
|
|
199
219
|
),
|
|
200
|
-
list: ({ items: i, filterValue:
|
|
220
|
+
list: ({ items: i, filterValue: l, onListChange: a }) => i.map((t) => /* @__PURE__ */ R(
|
|
201
221
|
y,
|
|
202
222
|
{
|
|
203
|
-
"aria-selected":
|
|
223
|
+
"aria-selected": l?.split(",").includes(t?.value),
|
|
204
224
|
as: "button",
|
|
205
225
|
onClick: a?.(t.value),
|
|
206
226
|
children: [
|
|
207
|
-
t.icon ? /* @__PURE__ */
|
|
208
|
-
|
|
227
|
+
t.icon ? /* @__PURE__ */ r(
|
|
228
|
+
z,
|
|
209
229
|
{
|
|
210
230
|
icon: t.icon,
|
|
211
231
|
iconColor: t.iconColor,
|
|
@@ -213,10 +233,10 @@ const pe = ({
|
|
|
213
233
|
iconType: t.iconType ?? "fa-light"
|
|
214
234
|
}
|
|
215
235
|
) : void 0,
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
236
|
+
/* @__PURE__ */ r(
|
|
237
|
+
le,
|
|
218
238
|
{
|
|
219
|
-
color:
|
|
239
|
+
color: D.palette.gray[800],
|
|
220
240
|
display: "block",
|
|
221
241
|
overflow: "hidden",
|
|
222
242
|
size: "md",
|
|
@@ -226,16 +246,16 @@ const pe = ({
|
|
|
226
246
|
children: t.label
|
|
227
247
|
}
|
|
228
248
|
),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
t.count === void 0 ? void 0 : /* @__PURE__ */
|
|
231
|
-
|
|
249
|
+
/* @__PURE__ */ r("span", { className: "filter-item" }),
|
|
250
|
+
t.count === void 0 ? void 0 : /* @__PURE__ */ r(L, { children: /* @__PURE__ */ r(
|
|
251
|
+
O,
|
|
232
252
|
{
|
|
233
253
|
tagLabel: t.count.toLocaleString("en-US"),
|
|
234
254
|
variant: "default"
|
|
235
255
|
}
|
|
236
256
|
) }),
|
|
237
|
-
|
|
238
|
-
|
|
257
|
+
l?.split(",").includes(t?.value) ? /* @__PURE__ */ r("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ r(
|
|
258
|
+
z,
|
|
239
259
|
{
|
|
240
260
|
icon: "check",
|
|
241
261
|
iconClass: "selected",
|
|
@@ -249,13 +269,13 @@ const pe = ({
|
|
|
249
269
|
)),
|
|
250
270
|
dateRange: ({
|
|
251
271
|
id: i,
|
|
252
|
-
filterValue:
|
|
272
|
+
filterValue: l,
|
|
253
273
|
onRangeChange: a,
|
|
254
274
|
updateCalendarState: t
|
|
255
275
|
}) => {
|
|
256
|
-
const [
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
276
|
+
const [c, e] = l?.split(",").filter((n) => X(n).isValid() || n === "-") ?? [];
|
|
277
|
+
return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
278
|
+
ae,
|
|
259
279
|
{
|
|
260
280
|
name: i,
|
|
261
281
|
onOpenCalendar: t,
|
|
@@ -266,7 +286,7 @@ const pe = ({
|
|
|
266
286
|
},
|
|
267
287
|
propsMin: {
|
|
268
288
|
name: "minValue",
|
|
269
|
-
value:
|
|
289
|
+
value: c !== "-" ? c : "",
|
|
270
290
|
onChange: a?.(0)
|
|
271
291
|
},
|
|
272
292
|
variant: "filters"
|
|
@@ -275,29 +295,29 @@ const pe = ({
|
|
|
275
295
|
},
|
|
276
296
|
numberRange: ({
|
|
277
297
|
id: i,
|
|
278
|
-
filterValue:
|
|
298
|
+
filterValue: l,
|
|
279
299
|
minValue: a,
|
|
280
300
|
maxValue: t,
|
|
281
|
-
onRangeNumberChange:
|
|
301
|
+
onRangeNumberChange: c
|
|
282
302
|
}) => {
|
|
283
|
-
const e =
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
|
|
303
|
+
const e = l?.split(",") ?? [], n = e[0]?.trim(), m = e[1]?.trim(), f = n && n !== "" && n !== "-" && !w(Number(n)) ? Number(n) : void 0, d = m && m !== "" && m !== "-" && !w(Number(m)) ? Number(m) : void 0;
|
|
304
|
+
return /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
|
|
305
|
+
ce,
|
|
286
306
|
{
|
|
287
307
|
name: i,
|
|
288
308
|
propsMax: {
|
|
289
309
|
name: "maxValue",
|
|
290
310
|
min: a,
|
|
291
311
|
max: t,
|
|
292
|
-
onChange:
|
|
312
|
+
onChange: c?.(1),
|
|
293
313
|
placeholder: "Max %",
|
|
294
|
-
value:
|
|
314
|
+
value: d
|
|
295
315
|
},
|
|
296
316
|
propsMin: {
|
|
297
317
|
name: "minValue",
|
|
298
318
|
min: a,
|
|
299
319
|
max: t,
|
|
300
|
-
onChange:
|
|
320
|
+
onChange: c?.(0),
|
|
301
321
|
placeholder: "Min %",
|
|
302
322
|
value: f
|
|
303
323
|
},
|
|
@@ -305,120 +325,120 @@ const pe = ({
|
|
|
305
325
|
}
|
|
306
326
|
) });
|
|
307
327
|
}
|
|
308
|
-
},
|
|
328
|
+
}, Je = ({
|
|
309
329
|
id: i,
|
|
310
|
-
filteredItems:
|
|
330
|
+
filteredItems: l,
|
|
311
331
|
filterValue: a,
|
|
312
332
|
label: t,
|
|
313
|
-
option:
|
|
333
|
+
option: c,
|
|
314
334
|
onChange: e
|
|
315
335
|
}) => {
|
|
316
|
-
const { type:
|
|
317
|
-
calendarState: { updateCalendarState:
|
|
336
|
+
const { type: n, minValue: m, maxValue: f, checkboxLabel: d, debounceMs: s } = c ?? {}, g = n && de[n], {
|
|
337
|
+
calendarState: { updateCalendarState: T },
|
|
318
338
|
scrollState: h
|
|
319
|
-
} =
|
|
339
|
+
} = Y(ee), b = u(() => 36, []), k = u(
|
|
320
340
|
() => h.ref.current,
|
|
321
341
|
[h.ref]
|
|
322
|
-
), x =
|
|
342
|
+
), x = Z(null), [v, F] = E(0), M = u(() => {
|
|
323
343
|
const o = h.ref.current, p = x.current;
|
|
324
344
|
if (o && p) {
|
|
325
345
|
const S = p.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop;
|
|
326
|
-
|
|
346
|
+
F(
|
|
327
347
|
(C) => C === S ? C : S
|
|
328
348
|
);
|
|
329
349
|
}
|
|
330
|
-
}, [h.ref]),
|
|
350
|
+
}, [h.ref]), P = u(
|
|
331
351
|
(o) => {
|
|
332
352
|
x.current = o, M();
|
|
333
353
|
},
|
|
334
354
|
[M]
|
|
335
355
|
);
|
|
336
|
-
|
|
356
|
+
me(() => {
|
|
337
357
|
const o = h.ref.current;
|
|
338
358
|
if (o === null || typeof ResizeObserver > "u")
|
|
339
359
|
return;
|
|
340
360
|
const p = new ResizeObserver(M), S = () => {
|
|
341
|
-
p.disconnect(), Array.from(o.children).forEach((
|
|
342
|
-
p.observe(
|
|
361
|
+
p.disconnect(), Array.from(o.children).forEach((K) => {
|
|
362
|
+
p.observe(K);
|
|
343
363
|
});
|
|
344
364
|
}, C = new MutationObserver(S);
|
|
345
365
|
return C.observe(o, { childList: !0 }), S(), () => {
|
|
346
366
|
C.disconnect(), p.disconnect();
|
|
347
367
|
};
|
|
348
368
|
});
|
|
349
|
-
const
|
|
350
|
-
count:
|
|
369
|
+
const N = W({
|
|
370
|
+
count: l.length,
|
|
351
371
|
estimateSize: b,
|
|
352
372
|
getScrollElement: k,
|
|
353
373
|
scrollMargin: v,
|
|
354
374
|
useFlushSync: !1
|
|
355
|
-
}),
|
|
375
|
+
}), I = N.getVirtualItems(), j = u(
|
|
356
376
|
(o) => {
|
|
357
|
-
o.stopPropagation(), o.preventDefault(), e(o.target.value,
|
|
377
|
+
o.stopPropagation(), o.preventDefault(), e(o.target.value, n ?? "");
|
|
358
378
|
},
|
|
359
|
-
[e,
|
|
360
|
-
),
|
|
379
|
+
[e, n]
|
|
380
|
+
), A = u(
|
|
361
381
|
(o) => (p) => {
|
|
362
382
|
e(p, "dateRange", o);
|
|
363
383
|
},
|
|
364
384
|
[e]
|
|
365
|
-
),
|
|
385
|
+
), B = u(
|
|
366
386
|
(o) => (p) => {
|
|
367
387
|
p.stopPropagation(), p.preventDefault(), e(p.target.value, "numberRange", o);
|
|
368
388
|
},
|
|
369
389
|
[e]
|
|
370
|
-
),
|
|
390
|
+
), U = u(
|
|
371
391
|
(o) => () => {
|
|
372
392
|
e(o, "list");
|
|
373
393
|
},
|
|
374
394
|
[e]
|
|
375
|
-
),
|
|
395
|
+
), G = u(
|
|
376
396
|
(o) => () => {
|
|
377
397
|
e(o, "combobox");
|
|
378
398
|
},
|
|
379
399
|
[e]
|
|
380
|
-
),
|
|
400
|
+
), _ = u(
|
|
381
401
|
(o) => {
|
|
382
402
|
e(o, "multiSelect");
|
|
383
403
|
},
|
|
384
404
|
[e]
|
|
385
|
-
),
|
|
405
|
+
), q = u(
|
|
386
406
|
(o) => {
|
|
387
407
|
o.stopPropagation(), e(o.target.checked ? "true" : "false", "textCheckbox");
|
|
388
408
|
},
|
|
389
409
|
[e]
|
|
390
|
-
),
|
|
410
|
+
), H = u(
|
|
391
411
|
(o) => {
|
|
392
|
-
e(o,
|
|
412
|
+
e(o, n ?? "text");
|
|
393
413
|
},
|
|
394
|
-
[e,
|
|
395
|
-
),
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
items:
|
|
414
|
+
[e, n]
|
|
415
|
+
), J = N.getTotalSize();
|
|
416
|
+
return /* @__PURE__ */ r(Q, { children: g?.({
|
|
417
|
+
items: l,
|
|
398
418
|
label: t,
|
|
399
|
-
virtualItems:
|
|
419
|
+
virtualItems: I,
|
|
400
420
|
id: i,
|
|
401
421
|
filterValue: a,
|
|
402
|
-
onChange:
|
|
403
|
-
onListChange:
|
|
404
|
-
onSelectChange:
|
|
405
|
-
onMultiSelectToggle:
|
|
406
|
-
onRangeChange:
|
|
407
|
-
onRangeNumberChange:
|
|
408
|
-
onTextValue:
|
|
409
|
-
debounceMs:
|
|
410
|
-
listRef:
|
|
411
|
-
ref:
|
|
422
|
+
onChange: j,
|
|
423
|
+
onListChange: U,
|
|
424
|
+
onSelectChange: G,
|
|
425
|
+
onMultiSelectToggle: _,
|
|
426
|
+
onRangeChange: A,
|
|
427
|
+
onRangeNumberChange: B,
|
|
428
|
+
onTextValue: H,
|
|
429
|
+
debounceMs: s,
|
|
430
|
+
listRef: P,
|
|
431
|
+
ref: N.measureElement,
|
|
412
432
|
scrollMargin: v,
|
|
413
|
-
totalSize:
|
|
414
|
-
updateCalendarState:
|
|
415
|
-
minValue:
|
|
433
|
+
totalSize: J,
|
|
434
|
+
updateCalendarState: T,
|
|
435
|
+
minValue: m,
|
|
416
436
|
maxValue: f,
|
|
417
|
-
checkboxLabel:
|
|
418
|
-
onCheckboxChange:
|
|
437
|
+
checkboxLabel: d,
|
|
438
|
+
onCheckboxChange: q
|
|
419
439
|
}) ?? null });
|
|
420
440
|
};
|
|
421
441
|
export {
|
|
422
|
-
|
|
442
|
+
Je as Options,
|
|
423
443
|
pe as TextFilterRenderer
|
|
424
444
|
};
|
|
@@ -21,5 +21,6 @@ declare const StyledActionButton: import('styled-components/dist/types').IStyled
|
|
|
21
21
|
}, never>>> & string;
|
|
22
22
|
declare const StyledActiveFilters: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
23
23
|
declare const StyledItemCount: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
24
|
+
declare const StyledCheckboxLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
24
25
|
declare const StyledFloatingDropdown: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
25
|
-
export { StyledActionButton, StyledModalContainer, StyledHeader, StyledContent, StyledFloatingActions, StyledFloatingDropdown, StyledItem, StyledItemCount, StyledActiveFilters, };
|
|
26
|
+
export { StyledActionButton, StyledModalContainer, StyledHeader, StyledContent, StyledFloatingActions, StyledFloatingDropdown, StyledCheckboxLabel, StyledItem, StyledItemCount, StyledActiveFilters, };
|
|
@@ -108,7 +108,13 @@ const s = i.div`
|
|
|
108
108
|
`}
|
|
109
109
|
`, y = i.span`
|
|
110
110
|
margin-left: auto;
|
|
111
|
-
`, f = i.
|
|
111
|
+
`, f = i.span`
|
|
112
|
+
${({ theme: t }) => `
|
|
113
|
+
align-items: center;
|
|
114
|
+
display: inline-flex;
|
|
115
|
+
gap: ${t.spacing[0.5]};
|
|
116
|
+
`}
|
|
117
|
+
`, x = i.div`
|
|
112
118
|
${({ theme: t }) => `
|
|
113
119
|
background-color: ${t.palette.white};
|
|
114
120
|
border: 1px solid ${t.palette.gray[200]};
|
|
@@ -128,9 +134,10 @@ const s = i.div`
|
|
|
128
134
|
export {
|
|
129
135
|
g as StyledActionButton,
|
|
130
136
|
$ as StyledActiveFilters,
|
|
137
|
+
f as StyledCheckboxLabel,
|
|
131
138
|
p as StyledContent,
|
|
132
139
|
r as StyledFloatingActions,
|
|
133
|
-
|
|
140
|
+
x as StyledFloatingDropdown,
|
|
134
141
|
d as StyledHeader,
|
|
135
142
|
c as StyledItem,
|
|
136
143
|
y as StyledItemCount,
|
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { IconWrap as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { IconWrap as N } from "./styles.js";
|
|
4
|
+
const S = {
|
|
5
|
+
"fa-gradient": "fa-solid",
|
|
6
|
+
"fa-kit-duotone": "fakd"
|
|
7
|
+
}, E = u(function({
|
|
8
|
+
clickable: s,
|
|
9
|
+
disabled: d,
|
|
10
|
+
hoverColor: i,
|
|
11
|
+
icon: a,
|
|
9
12
|
iconClass: n = "",
|
|
10
|
-
iconColor:
|
|
13
|
+
iconColor: l,
|
|
11
14
|
iconMask: r,
|
|
12
15
|
iconSize: f,
|
|
13
|
-
iconTransform:
|
|
14
|
-
iconType:
|
|
15
|
-
onClick:
|
|
16
|
-
rotation:
|
|
17
|
-
spanClass:
|
|
18
|
-
secondaryColor:
|
|
19
|
-
secondaryOpacity:
|
|
20
|
-
...
|
|
16
|
+
iconTransform: t,
|
|
17
|
+
iconType: o = "fa-solid",
|
|
18
|
+
onClick: c,
|
|
19
|
+
rotation: $,
|
|
20
|
+
spanClass: m,
|
|
21
|
+
secondaryColor: I,
|
|
22
|
+
secondaryOpacity: p,
|
|
23
|
+
...v
|
|
21
24
|
}, C) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
`fa-${
|
|
25
|
-
|
|
25
|
+
const g = o === "fa-gradient", k = [
|
|
26
|
+
S[o] ?? o,
|
|
27
|
+
`fa-${a}`,
|
|
28
|
+
g ? "fill-gradient-01" : "",
|
|
26
29
|
n
|
|
27
30
|
].filter(Boolean).join(" ");
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
31
|
+
return /* @__PURE__ */ e(
|
|
32
|
+
N,
|
|
30
33
|
{
|
|
31
|
-
$clickable:
|
|
32
|
-
$color:
|
|
33
|
-
$disabled:
|
|
34
|
-
$hoverColor:
|
|
35
|
-
$rotation:
|
|
36
|
-
$secondaryColor:
|
|
37
|
-
$secondaryOpacity:
|
|
34
|
+
$clickable: s,
|
|
35
|
+
$color: l,
|
|
36
|
+
$disabled: d,
|
|
37
|
+
$hoverColor: i,
|
|
38
|
+
$rotation: $,
|
|
39
|
+
$secondaryColor: I,
|
|
40
|
+
$secondaryOpacity: p,
|
|
38
41
|
$size: f,
|
|
39
|
-
className:
|
|
40
|
-
"data-testid": `${
|
|
41
|
-
onClick:
|
|
42
|
+
className: m,
|
|
43
|
+
"data-testid": `${a}-icon`,
|
|
44
|
+
onClick: c,
|
|
42
45
|
ref: C,
|
|
43
|
-
...
|
|
44
|
-
children: /* @__PURE__ */
|
|
46
|
+
...v,
|
|
47
|
+
children: /* @__PURE__ */ e(
|
|
45
48
|
"i",
|
|
46
49
|
{
|
|
47
|
-
className:
|
|
50
|
+
className: k,
|
|
48
51
|
...r !== void 0 ? { "data-fa-mask": r } : {},
|
|
49
|
-
...
|
|
52
|
+
...t !== void 0 ? { "data-fa-transform": t } : {}
|
|
50
53
|
}
|
|
51
54
|
)
|
|
52
55
|
},
|
|
53
|
-
`${
|
|
56
|
+
`${o}-${a}`
|
|
54
57
|
);
|
|
55
58
|
});
|
|
56
59
|
export {
|
|
57
|
-
|
|
60
|
+
E as Icon
|
|
58
61
|
};
|
package/package.json
CHANGED