@foi/design-system 0.0.18 → 0.0.19
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/README.md +658 -63
- package/dist/{DatePicker.utils-ytCEcs6T.js → DatePicker.utils-BAUVa26Q.js} +2 -2
- package/dist/{DatePicker.utils-ytCEcs6T.js.map → DatePicker.utils-BAUVa26Q.js.map} +1 -1
- package/dist/{emotion-react-jsx-runtime.browser.esm-Ct_bZ5JG.js → IconButton-C3x-E-ot.js} +458 -248
- package/dist/IconButton-C3x-E-ot.js.map +1 -0
- package/dist/{RadioGroup-D_R-nwCD.js → RadioGroup-Cvt9MtvM.js} +71 -71
- package/dist/{RadioGroup-D_R-nwCD.js.map → RadioGroup-Cvt9MtvM.js.map} +1 -1
- package/dist/RadioGroup.context-v_CCYB7_.js +392 -0
- package/dist/RadioGroup.context-v_CCYB7_.js.map +1 -0
- package/dist/{Switch-DK5hEXUS.js → Switch-6eNmT34-.js} +315 -315
- package/dist/{Switch-DK5hEXUS.js.map → Switch-6eNmT34-.js.map} +1 -1
- package/dist/{ThemeProvider-BlqXHfU_.js → ThemeProvider-C_PzAJz3.js} +11 -6
- package/dist/{ThemeProvider-BlqXHfU_.js.map → ThemeProvider-C_PzAJz3.js.map} +1 -1
- package/dist/Toast-_9W7YGxS.js +146 -0
- package/dist/Toast-_9W7YGxS.js.map +1 -0
- package/dist/atoms.mjs +4 -3
- package/dist/components/atoms/Button/Button.interface.d.ts +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.interface.d.ts +3 -3
- package/dist/components/atoms/Chip/Chip.d.ts +4 -0
- package/dist/components/atoms/Chip/Chip.emotion.d.ts +2 -0
- package/dist/components/atoms/Chip/Chip.interface.d.ts +14 -0
- package/dist/components/atoms/Chip/index.d.ts +5 -0
- package/dist/components/atoms/DatePicker/DatePicker.interface.d.ts +2 -2
- package/dist/components/atoms/DatePicker/DatePickerMenu/DatePickerMenu.interface.d.ts +3 -3
- package/dist/components/atoms/IconButton/IconButton.interface.d.ts +2 -2
- package/dist/components/atoms/NumberField/NumberField.interface.d.ts +2 -2
- package/dist/components/atoms/Radio/Radio.interface.d.ts +2 -2
- package/dist/components/atoms/Select/Select.interface.d.ts +2 -2
- package/dist/components/atoms/Select/SelectMenu/SelectMenu.interface.d.ts +1 -1
- package/dist/components/atoms/Slider/Slider.interface.d.ts +4 -4
- package/dist/components/atoms/Switch/Switch.interface.d.ts +1 -1
- package/dist/components/atoms/TextField/TextField.interface.d.ts +2 -2
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.interface.d.ts +2 -2
- package/dist/components/molecules/CheckboxTree/CheckboxTree.interface.d.ts +2 -2
- package/dist/components/molecules/Modal/Modal.interface.d.ts +4 -4
- package/dist/components/molecules/RadioGroup/RadioGroup.interface.d.ts +2 -2
- package/dist/components/molecules/Toast/Toast.context.d.ts +2 -0
- package/dist/components/molecules/Toast/Toast.d.ts +4 -0
- package/dist/components/molecules/Toast/Toast.emotion.d.ts +4 -0
- package/dist/components/molecules/Toast/Toast.hook.d.ts +1 -0
- package/dist/components/molecules/Toast/Toast.interface.d.ts +33 -0
- package/dist/components/molecules/Toast/Toast.provider.d.ts +3 -0
- package/dist/components/molecules/Toast/index.d.ts +3 -0
- package/dist/components/organisms/DataGrid/DataGrid.interface.d.ts +3 -3
- package/dist/components/organisms/DataGrid/DataGridMenu/DataGridMenu.interface.d.ts +1 -1
- package/dist/hocs/ThemeProvider/ThemeProvider.interface.d.ts +6 -0
- package/dist/hocs/ThemeProvider/components/{Button.d.ts → atoms/Button.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Checkbox.d.ts → atoms/Checkbox.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/atoms/Chip.d.ts +13 -0
- package/dist/hocs/ThemeProvider/components/{DatePicker.d.ts → atoms/DatePicker.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{DatePickerMenu.d.ts → atoms/DatePickerMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{IconButton.d.ts → atoms/IconButton.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{NumberField.d.ts → atoms/NumberField.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Pagination.d.ts → atoms/Pagination.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{PaginationMenu.d.ts → atoms/PaginationMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Radio.d.ts → atoms/Radio.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Select.d.ts → atoms/Select.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{SelectMenu.d.ts → atoms/SelectMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Slider.d.ts → atoms/Slider.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Switch.d.ts → atoms/Switch.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{TextField.d.ts → atoms/TextField.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/index.d.ts +23 -17
- package/dist/hocs/ThemeProvider/components/{CheckboxGroup.d.ts → molecules/CheckboxGroup.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{CheckboxTree.d.ts → molecules/CheckboxTree.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{Modal.d.ts → molecules/Modal.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{RadioGroup.d.ts → molecules/RadioGroup.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/molecules/Toast.d.ts +16 -0
- package/dist/hocs/ThemeProvider/components/{DataGrid.d.ts → organisms/DataGrid.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/components/{DataGridMenu.d.ts → organisms/DataGridMenu.d.ts} +1 -1
- package/dist/hocs/ThemeProvider/interfaces/Components.interface.d.ts +2 -0
- package/dist/hocs.mjs +1 -1
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +247 -239
- package/dist/index.mjs.map +1 -1
- package/dist/molecules.d.ts +2 -0
- package/dist/molecules.mjs +3 -2
- package/dist/theme/dark/components/atoms/Chip.d.ts +13 -0
- package/dist/theme/dark/components/index.d.ts +287 -263
- package/dist/theme/dark/components/molecules/Toast.d.ts +17 -0
- package/dist/theme/dark/index.d.ts +287 -263
- package/dist/theme/index.d.ts +287 -263
- package/dist/{theme-CLkxVsoE.js → theme-BjrtNRDQ.js} +230 -218
- package/dist/theme-BjrtNRDQ.js.map +1 -0
- package/dist/theme.mjs +1 -1
- package/dist/utilities.mjs +1 -1
- package/package.json +1 -1
- package/dist/RadioGroup.context-CdFGi5z1.js +0 -601
- package/dist/RadioGroup.context-CdFGi5z1.js.map +0 -1
- package/dist/emotion-react-jsx-runtime.browser.esm-Ct_bZ5JG.js.map +0 -1
- package/dist/theme-CLkxVsoE.js.map +0 -1
- /package/dist/theme/dark/components/{Button.d.ts → atoms/Button.d.ts} +0 -0
- /package/dist/theme/dark/components/{Checkbox.d.ts → atoms/Checkbox.d.ts} +0 -0
- /package/dist/theme/dark/components/{DatePicker.d.ts → atoms/DatePicker.d.ts} +0 -0
- /package/dist/theme/dark/components/{DatePickerMenu.d.ts → atoms/DatePickerMenu.d.ts} +0 -0
- /package/dist/theme/dark/components/{IconButton.d.ts → atoms/IconButton.d.ts} +0 -0
- /package/dist/theme/dark/components/{NumberField.d.ts → atoms/NumberField.d.ts} +0 -0
- /package/dist/theme/dark/components/{Pagination.d.ts → atoms/Pagination.d.ts} +0 -0
- /package/dist/theme/dark/components/{PaginationMenu.d.ts → atoms/PaginationMenu.d.ts} +0 -0
- /package/dist/theme/dark/components/{Radio.d.ts → atoms/Radio.d.ts} +0 -0
- /package/dist/theme/dark/components/{Select.d.ts → atoms/Select.d.ts} +0 -0
- /package/dist/theme/dark/components/{SelectMenu.d.ts → atoms/SelectMenu.d.ts} +0 -0
- /package/dist/theme/dark/components/{Slider.d.ts → atoms/Slider.d.ts} +0 -0
- /package/dist/theme/dark/components/{Switch.d.ts → atoms/Switch.d.ts} +0 -0
- /package/dist/theme/dark/components/{TextField.d.ts → atoms/TextField.d.ts} +0 -0
- /package/dist/theme/dark/components/{CheckboxGroup.d.ts → molecules/CheckboxGroup.d.ts} +0 -0
- /package/dist/theme/dark/components/{CheckboxTree.d.ts → molecules/CheckboxTree.d.ts} +0 -0
- /package/dist/theme/dark/components/{Modal.d.ts → molecules/Modal.d.ts} +0 -0
- /package/dist/theme/dark/components/{RadioGroup.d.ts → molecules/RadioGroup.d.ts} +0 -0
- /package/dist/theme/dark/components/{DataGrid.d.ts → organisms/DataGrid.d.ts} +0 -0
- /package/dist/theme/dark/components/{DataGridMenu.d.ts → organisms/DataGridMenu.d.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { i as v, n as y, r as b, t as x } from "./RadioGroup-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import k from "react
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./IconButton-C3x-E-ot.js";
|
|
2
|
+
import { n as s, r as c } from "./theme-BjrtNRDQ.js";
|
|
3
|
+
import { a as l, c as u, i as d, n as f, o as p, r as m, s as h, t as g } from "./Switch-6eNmT34-.js";
|
|
4
|
+
import { n as _ } from "./RadioGroup.context-v_CCYB7_.js";
|
|
5
|
+
import { i as v, n as y, r as b, t as x } from "./RadioGroup-Cvt9MtvM.js";
|
|
6
|
+
import { n as S } from "./Toast-_9W7YGxS.js";
|
|
7
|
+
import { t as C } from "./ThemeProvider-C_PzAJz3.js";
|
|
8
|
+
import { useCallback as ee, useEffect as w, useLayoutEffect as T, useMemo as E, useRef as D, useState as O } from "react";
|
|
9
|
+
import { css as k, keyframes as A } from "@emotion/react";
|
|
10
|
+
import te from "react-dom";
|
|
10
11
|
//#region src/components/atoms/Skeleton/Skeleton.emotion.ts
|
|
11
|
-
var
|
|
12
|
+
var j = k`
|
|
12
13
|
&.--SKELETON {
|
|
13
14
|
display: block;
|
|
14
15
|
background: linear-gradient(
|
|
@@ -18,7 +19,7 @@ var A = O`
|
|
|
18
19
|
rgba(255, 255, 255, 0.05) 100%
|
|
19
20
|
);
|
|
20
21
|
background-size: 200% 100%;
|
|
21
|
-
animation: ${
|
|
22
|
+
animation: ${A`
|
|
22
23
|
0% { background-position: 200% center; }
|
|
23
24
|
100% { background-position: -200% center; }
|
|
24
25
|
`} 1.4s ease infinite;
|
|
@@ -31,28 +32,28 @@ var A = O`
|
|
|
31
32
|
border-radius: 4px;
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
`,
|
|
35
|
+
`, M = ({ variant: e = "rectangular", width: n, height: r, className: i }) => /* @__PURE__ */ t("span", {
|
|
35
36
|
className: [
|
|
36
37
|
"--SKELETON",
|
|
37
38
|
`--SKELETON--${e}`,
|
|
38
39
|
i || ""
|
|
39
40
|
].filter(Boolean).join(" "),
|
|
40
|
-
css:
|
|
41
|
+
css: j,
|
|
41
42
|
style: {
|
|
42
43
|
width: n,
|
|
43
44
|
height: r
|
|
44
45
|
},
|
|
45
46
|
"aria-hidden": "true"
|
|
46
|
-
}), ne = (e) =>
|
|
47
|
+
}), ne = (e) => k`
|
|
47
48
|
&.--DATAGRID {
|
|
48
49
|
width: 100%;
|
|
49
50
|
box-sizing: border-box;
|
|
50
51
|
|
|
51
|
-
${
|
|
52
|
-
${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
${
|
|
52
|
+
${c(e, "background-color", "--DATAGRID-ROOT-BACKGROUND-COLOR")};
|
|
53
|
+
${c(e, "border-color", "--DATAGRID-ROOT-BORDER-COLOR")};
|
|
54
|
+
${c(e, "border-width", "--DATAGRID-ROOT-BORDER-WIDTH")};
|
|
55
|
+
${c(e, "border-radius", "--DATAGRID-ROOT-BORDER-RADIUS")};
|
|
56
|
+
${c(e, "border-style", "--DATAGRID-ROOT-BORDER-STYLE")};
|
|
56
57
|
|
|
57
58
|
.--DATAGRID-tableContainer {
|
|
58
59
|
width: 100%;
|
|
@@ -87,15 +88,15 @@ var A = O`
|
|
|
87
88
|
height: 48px;
|
|
88
89
|
|
|
89
90
|
.--DATAGRID-th {
|
|
90
|
-
${
|
|
91
|
+
${c(e, "background-color", "--DATAGRID-ROOT-BACKGROUND-COLOR")};
|
|
91
92
|
|
|
92
93
|
padding: 8px 16px;
|
|
93
94
|
text-align: left;
|
|
94
95
|
white-space: nowrap;
|
|
95
96
|
|
|
96
|
-
${
|
|
97
|
-
${
|
|
98
|
-
${
|
|
97
|
+
${c(e, "border-bottom-color", "--DATAGRID-ROOT-BORDER-COLOR")};
|
|
98
|
+
${c(e, "border-bottom-width", "--DATAGRID-ROOT-BORDER-WIDTH")};
|
|
99
|
+
${c(e, "border-bottom-style", "--DATAGRID-ROOT-BORDER-STYLE")};
|
|
99
100
|
|
|
100
101
|
&.--DATAGRID-thOptions {
|
|
101
102
|
width: 80px;
|
|
@@ -115,11 +116,11 @@ var A = O`
|
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
.--DATAGRID-filterActive {
|
|
118
|
-
${
|
|
119
|
+
${c(e, "color", "--DATAGRID-EVENTS-ENABLED-ICON-COLOR")};
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
.--DATAGRID-thLabel {
|
|
122
|
-
${
|
|
123
|
+
${c(e, "color", "--DATAGRID-EVENTS-ENABLED-COLOR-SECONDARY")};
|
|
123
124
|
|
|
124
125
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
125
126
|
font-size: 0.875rem;
|
|
@@ -135,7 +136,7 @@ var A = O`
|
|
|
135
136
|
gap: 4px;
|
|
136
137
|
|
|
137
138
|
.--DATAGRID-filterLabel {
|
|
138
|
-
${
|
|
139
|
+
${c(e, "color", "--DATAGRID-EVENTS-ENABLED-COLOR-SECONDARY")};
|
|
139
140
|
|
|
140
141
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
141
142
|
font-size: 0.75rem;
|
|
@@ -153,12 +154,12 @@ var A = O`
|
|
|
153
154
|
height: 48px;
|
|
154
155
|
transition: background-color 150ms;
|
|
155
156
|
|
|
156
|
-
${
|
|
157
|
-
${
|
|
158
|
-
${
|
|
157
|
+
${c(e, "border-bottom-color", "--DATAGRID-ROOT-BORDER-COLOR")};
|
|
158
|
+
${c(e, "border-bottom-width", "--DATAGRID-ROOT-BORDER-WIDTH")};
|
|
159
|
+
${c(e, "border-bottom-style", "--DATAGRID-ROOT-BORDER-STYLE")};
|
|
159
160
|
|
|
160
161
|
&:hover {
|
|
161
|
-
${
|
|
162
|
+
${c(e, "background-color", "--DATAGRID-EVENTS-HOVER-BACKGROUND-COLOR")};
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
&:last-child {
|
|
@@ -167,7 +168,7 @@ var A = O`
|
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
.--DATAGRID-td {
|
|
170
|
-
${
|
|
171
|
+
${c(e, "color", "--DATAGRID-EVENTS-ENABLED-COLOR-PRIMARY")};
|
|
171
172
|
|
|
172
173
|
padding: 8px 16px;
|
|
173
174
|
vertical-align: middle;
|
|
@@ -183,7 +184,7 @@ var A = O`
|
|
|
183
184
|
text-align: center;
|
|
184
185
|
vertical-align: middle;
|
|
185
186
|
|
|
186
|
-
${
|
|
187
|
+
${c(e, "color", "--DATAGRID-EVENTS-ENABLED-COLOR-SECONDARY")};
|
|
187
188
|
|
|
188
189
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
189
190
|
font-size: 0.875rem;
|
|
@@ -196,7 +197,7 @@ var A = O`
|
|
|
196
197
|
height: 48px;
|
|
197
198
|
vertical-align: middle;
|
|
198
199
|
|
|
199
|
-
${
|
|
200
|
+
${c(e, "color", "--DATAGRID-EVENTS-ENABLED-COLOR-SECONDARY")};
|
|
200
201
|
|
|
201
202
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
202
203
|
font-size: 0.875rem;
|
|
@@ -213,16 +214,16 @@ var A = O`
|
|
|
213
214
|
padding: 12px 16px !important;
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
`,
|
|
217
|
+
`, re = (e, t) => `
|
|
217
218
|
// BACKGROUNDS
|
|
218
|
-
${
|
|
219
|
+
${c(e, "background-color", `--DATAGRIDMENU-${t}-BACKGROUND-COLOR`)}
|
|
219
220
|
|
|
220
221
|
// BORDERS
|
|
221
|
-
${
|
|
222
|
-
${
|
|
223
|
-
${
|
|
224
|
-
${
|
|
225
|
-
`, N = (e) =>
|
|
222
|
+
${c(e, "border-color", `--DATAGRIDMENU-${t}-BORDER-COLOR`)}
|
|
223
|
+
${c(e, "border-width", `--DATAGRIDMENU-${t}-BORDER-WIDTH`)}
|
|
224
|
+
${c(e, "border-style", `--DATAGRIDMENU-${t}-BORDER-STYLE`)}
|
|
225
|
+
${c(e, "border-radius", `--DATAGRIDMENU-${t}-BORDER-RADIUS`)}
|
|
226
|
+
`, N = (e) => k`
|
|
226
227
|
&.--DATAGRIDMENU {
|
|
227
228
|
position: fixed;
|
|
228
229
|
z-index: 200;
|
|
@@ -236,7 +237,7 @@ var A = O`
|
|
|
236
237
|
rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
|
|
237
238
|
rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
|
|
238
239
|
|
|
239
|
-
${
|
|
240
|
+
${re(e, "ROOT")}
|
|
240
241
|
|
|
241
242
|
.--DATAGRIDMENU-header {
|
|
242
243
|
display: flex;
|
|
@@ -244,7 +245,7 @@ var A = O`
|
|
|
244
245
|
justify-content: space-between;
|
|
245
246
|
|
|
246
247
|
.--DATAGRIDMENU-headerTitle {
|
|
247
|
-
${
|
|
248
|
+
${c(e, "color", "--DATAGRIDMENU-EVENTS-ENABLED-COLOR-PRIMARY")};
|
|
248
249
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
249
250
|
font-size: 0.875rem;
|
|
250
251
|
font-weight: 600;
|
|
@@ -300,57 +301,57 @@ var A = O`
|
|
|
300
301
|
justify-content: flex-end;
|
|
301
302
|
}
|
|
302
303
|
}
|
|
303
|
-
`, P = "--DATAGRIDMENU", F = ({ columnKey: e, pendingSearch:
|
|
304
|
+
`, P = "--DATAGRIDMENU", F = ({ columnKey: e, pendingSearch: r, onSearchChange: i, searchLabel: a = "Search" }) => /* @__PURE__ */ t("div", {
|
|
304
305
|
className: `${P}-searchInput`,
|
|
305
|
-
children: /* @__PURE__ */ t(
|
|
306
|
+
children: /* @__PURE__ */ t(p, {
|
|
306
307
|
name: `search-${e}`,
|
|
307
|
-
label:
|
|
308
|
-
value:
|
|
309
|
-
onValueChange:
|
|
308
|
+
label: a,
|
|
309
|
+
value: r,
|
|
310
|
+
onValueChange: i,
|
|
310
311
|
showErrorText: !1,
|
|
311
312
|
width: "full",
|
|
312
313
|
autoFocus: !0,
|
|
313
314
|
"data-testid": `${P}-searchInput-${e}`,
|
|
314
|
-
startAdornment: /* @__PURE__ */ t(
|
|
315
|
+
startAdornment: /* @__PURE__ */ t(n, {
|
|
315
316
|
name: "search",
|
|
316
317
|
style: { color: "white" }
|
|
317
318
|
})
|
|
318
319
|
})
|
|
319
|
-
}), I = "--DATAGRIDMENU", L = ({ filterType:
|
|
320
|
-
let
|
|
321
|
-
return /* @__PURE__ */
|
|
320
|
+
}), I = "--DATAGRIDMENU", L = ({ filterType: n, columnKey: r, options: a, pendingMulti: o, onMultiChange: s, multiSearch: c, onMultiSearchChange: l }) => {
|
|
321
|
+
let u = n === "multiselect-search", d = a.filter((e) => !c || e.label.toLowerCase().includes(c.toLowerCase()));
|
|
322
|
+
return /* @__PURE__ */ e(i, { children: [u && /* @__PURE__ */ t("div", {
|
|
322
323
|
className: `${I}-searchInput`,
|
|
323
|
-
children: /* @__PURE__ */ t(
|
|
324
|
-
name: `multiSearch-${
|
|
324
|
+
children: /* @__PURE__ */ t(p, {
|
|
325
|
+
name: `multiSearch-${r}`,
|
|
325
326
|
label: "Search options",
|
|
326
|
-
value:
|
|
327
|
-
onValueChange:
|
|
327
|
+
value: c,
|
|
328
|
+
onValueChange: l,
|
|
328
329
|
showErrorText: !1,
|
|
329
330
|
width: "full",
|
|
330
331
|
autoFocus: !0,
|
|
331
|
-
"data-testid": `${I}-multiSearch-${
|
|
332
|
+
"data-testid": `${I}-multiSearch-${r}`
|
|
332
333
|
})
|
|
333
334
|
}), /* @__PURE__ */ t("div", {
|
|
334
335
|
className: `${I}-optionsList`,
|
|
335
|
-
"data-testid": `${I}-optionsList-${
|
|
336
|
-
children:
|
|
336
|
+
"data-testid": `${I}-optionsList-${r}`,
|
|
337
|
+
children: d.map((n) => /* @__PURE__ */ e("div", {
|
|
337
338
|
className: `${I}-optionRow`,
|
|
338
|
-
children: [
|
|
339
|
+
children: [n.color && /* @__PURE__ */ t("span", {
|
|
339
340
|
className: `${I}-optionDot`,
|
|
340
|
-
style: { backgroundColor:
|
|
341
|
+
style: { backgroundColor: n.color },
|
|
341
342
|
"aria-hidden": "true"
|
|
342
|
-
}), /* @__PURE__ */ t(
|
|
343
|
-
checked: o.includes(
|
|
344
|
-
onChecked: (
|
|
345
|
-
label:
|
|
343
|
+
}), /* @__PURE__ */ t(_, {
|
|
344
|
+
checked: o.includes(n.value),
|
|
345
|
+
onChecked: (e) => s(e ? [...o, n.value] : o.filter((e) => e !== n.value)),
|
|
346
|
+
label: n.label,
|
|
346
347
|
showErrorText: !1,
|
|
347
|
-
"data-testid": `${I}-option-${
|
|
348
|
+
"data-testid": `${I}-option-${r}-${n.value}`
|
|
348
349
|
})]
|
|
349
|
-
},
|
|
350
|
+
}, n.value))
|
|
350
351
|
})] });
|
|
351
|
-
}, R = "--DATAGRIDMENU", z = ({ filterType:
|
|
352
|
-
let C =
|
|
353
|
-
return
|
|
352
|
+
}, R = "--DATAGRIDMENU", z = ({ filterType: r, options: i, columnKey: a, filterTitle: s, searchLabel: c, cancelLabel: l = "Cancel", applyLabel: d = "Apply", pendingSearch: f, onSearchChange: p, pendingMulti: m, onMultiChange: h, multiSearch: g, onMultiSearchChange: _, onCancel: v, onApply: y, onClear: b, anchorEl: x, style: S }) => {
|
|
353
|
+
let C = D(null);
|
|
354
|
+
return T(() => {
|
|
354
355
|
if (!x) return;
|
|
355
356
|
let e = () => {
|
|
356
357
|
if (!C.current) return;
|
|
@@ -360,83 +361,83 @@ var A = O`
|
|
|
360
361
|
return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
361
362
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
362
363
|
};
|
|
363
|
-
}, [x]),
|
|
364
|
+
}, [x]), te.createPortal(/* @__PURE__ */ e("div", {
|
|
364
365
|
ref: C,
|
|
365
366
|
className: R,
|
|
366
367
|
css: N(S),
|
|
367
|
-
"data-popover-key":
|
|
368
|
-
"data-testid": `${R}-${
|
|
368
|
+
"data-popover-key": a,
|
|
369
|
+
"data-testid": `${R}-${a}`,
|
|
369
370
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ e("div", {
|
|
371
372
|
className: `${R}-header`,
|
|
372
373
|
children: [/* @__PURE__ */ t("span", {
|
|
373
374
|
className: `${R}-headerTitle`,
|
|
374
|
-
children:
|
|
375
|
+
children: s
|
|
375
376
|
}), /* @__PURE__ */ t(o, {
|
|
376
|
-
icon: /* @__PURE__ */ t(
|
|
377
|
+
icon: /* @__PURE__ */ t(n, {
|
|
377
378
|
name: "delete_outline",
|
|
378
379
|
size: "sm"
|
|
379
380
|
}),
|
|
380
381
|
onClick: b,
|
|
381
382
|
"aria-label": "Clear filter",
|
|
382
|
-
"data-testid": `${R}-clearBtn-${
|
|
383
|
+
"data-testid": `${R}-clearBtn-${a}`
|
|
383
384
|
})]
|
|
384
385
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ e("div", {
|
|
386
387
|
className: `${R}-content`,
|
|
387
|
-
children: [
|
|
388
|
-
columnKey:
|
|
388
|
+
children: [r === "search" && /* @__PURE__ */ t(F, {
|
|
389
|
+
columnKey: a,
|
|
389
390
|
pendingSearch: f,
|
|
390
391
|
onSearchChange: p,
|
|
391
392
|
searchLabel: c
|
|
392
|
-
}), (
|
|
393
|
-
filterType:
|
|
394
|
-
columnKey:
|
|
395
|
-
options:
|
|
393
|
+
}), (r === "multiselect" || r === "multiselect-search") && /* @__PURE__ */ t(L, {
|
|
394
|
+
filterType: r,
|
|
395
|
+
columnKey: a,
|
|
396
|
+
options: i ?? [],
|
|
396
397
|
pendingMulti: m,
|
|
397
398
|
onMultiChange: h,
|
|
398
399
|
multiSearch: g,
|
|
399
400
|
onMultiSearchChange: _
|
|
400
401
|
})]
|
|
401
402
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ e("div", {
|
|
403
404
|
className: `${R}-actions`,
|
|
404
|
-
children: [/* @__PURE__ */ t(
|
|
405
|
+
children: [/* @__PURE__ */ t(u, {
|
|
405
406
|
onClick: v,
|
|
406
|
-
"data-testid": `${R}-cancelBtn-${
|
|
407
|
+
"data-testid": `${R}-cancelBtn-${a}`,
|
|
407
408
|
variant: "ghost",
|
|
408
409
|
children: l
|
|
409
|
-
}), /* @__PURE__ */ t(
|
|
410
|
+
}), /* @__PURE__ */ t(u, {
|
|
410
411
|
onClick: y,
|
|
411
|
-
"data-testid": `${R}-applyBtn-${
|
|
412
|
-
children:
|
|
412
|
+
"data-testid": `${R}-applyBtn-${a}`,
|
|
413
|
+
children: d
|
|
413
414
|
})]
|
|
414
415
|
})
|
|
415
416
|
]
|
|
416
417
|
}), document.body);
|
|
417
|
-
},
|
|
418
|
-
let { componentStyles:
|
|
418
|
+
}, ie = ({ theme: e, variant: n = "default", ...i }) => {
|
|
419
|
+
let { componentStyles: o } = a([r.DATAGRIDMENU], e, n.toUpperCase());
|
|
419
420
|
return /* @__PURE__ */ t(z, {
|
|
420
421
|
...i,
|
|
421
|
-
style:
|
|
422
|
+
style: o
|
|
422
423
|
});
|
|
423
|
-
}, B = "--DATAGRID",
|
|
424
|
-
let
|
|
425
|
-
return /* @__PURE__ */ t(
|
|
424
|
+
}, B = "--DATAGRID", ae = ({ columns: e, pageSize: n }) => {
|
|
425
|
+
let r = E(() => Array.from({ length: n }, () => e.map((e) => e.type === "options" ? null : `${Math.floor(Math.random() * 51) + 40}%`)), [n, e.length]);
|
|
426
|
+
return /* @__PURE__ */ t(i, { children: Array.from({ length: n }).map((n, i) => /* @__PURE__ */ t("tr", {
|
|
426
427
|
className: `${B}-row`,
|
|
427
428
|
children: e.map((e, n) => /* @__PURE__ */ t("td", {
|
|
428
429
|
className: [`${B}-td`, e.type === "options" ? `${B}-tdOptions` : ""].filter(Boolean).join(" "),
|
|
429
|
-
children: e.type === "options" ? /* @__PURE__ */ t(
|
|
430
|
+
children: e.type === "options" ? /* @__PURE__ */ t(M, {
|
|
430
431
|
variant: "circular",
|
|
431
432
|
width: 24,
|
|
432
433
|
height: 24
|
|
433
|
-
}) : /* @__PURE__ */ t(
|
|
434
|
+
}) : /* @__PURE__ */ t(M, {
|
|
434
435
|
height: 16,
|
|
435
|
-
width: i
|
|
436
|
+
width: r[i][n] ?? void 0
|
|
436
437
|
})
|
|
437
438
|
}, e.key))
|
|
438
|
-
},
|
|
439
|
-
}, V = (e) =>
|
|
439
|
+
}, i)) });
|
|
440
|
+
}, V = (e) => k`
|
|
440
441
|
&.--PAGINATION {
|
|
441
442
|
display: flex;
|
|
442
443
|
align-items: center;
|
|
@@ -451,7 +452,7 @@ var A = O`
|
|
|
451
452
|
gap: 8px;
|
|
452
453
|
|
|
453
454
|
.--PAGINATION-rowsSize {
|
|
454
|
-
${
|
|
455
|
+
${c(e, "color", "--PAGINATION-EVENTS-ENABLED-COLOR-SECONDARY")};
|
|
455
456
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
456
457
|
font-size: 0.8125rem;
|
|
457
458
|
user-select: none;
|
|
@@ -466,7 +467,7 @@ var A = O`
|
|
|
466
467
|
gap: 8px;
|
|
467
468
|
|
|
468
469
|
.--PAGINATION-info {
|
|
469
|
-
${
|
|
470
|
+
${c(e, "color", "--PAGINATION-EVENTS-ENABLED-COLOR-SECONDARY")};
|
|
470
471
|
font-family: ${e["--FONTFAMILY-PRIMARY"]};
|
|
471
472
|
font-size: 0.8125rem;
|
|
472
473
|
user-select: none;
|
|
@@ -475,27 +476,27 @@ var A = O`
|
|
|
475
476
|
}
|
|
476
477
|
`, H = (e, t) => `
|
|
477
478
|
// BACKGROUNDS
|
|
478
|
-
${
|
|
479
|
+
${c(e, "background-color", `--PAGINATIONMENU-EVENTS-${t}-BACKGROUND-COLOR`)}
|
|
479
480
|
|
|
480
481
|
// BORDERS
|
|
481
|
-
${
|
|
482
|
-
${
|
|
483
|
-
${
|
|
484
|
-
${
|
|
482
|
+
${c(e, "border-color", `--PAGINATIONMENU-EVENTS-${t}-BORDER-COLOR`)}
|
|
483
|
+
${c(e, "border-width", `--PAGINATIONMENU-EVENTS-${t}-BORDER-WIDTH`)}
|
|
484
|
+
${c(e, "border-style", `--PAGINATIONMENU-EVENTS-${t}-BORDER-STYLE`)}
|
|
485
|
+
${c(e, "border-radius", `--PAGINATIONMENU-EVENTS-${t}-BORDER-RADIUS`)}
|
|
485
486
|
`, U = (e, t) => `
|
|
486
487
|
// TYPOGRAPHY
|
|
487
|
-
${
|
|
488
|
-
${
|
|
488
|
+
${c(e, "color", `--PAGINATIONMENU-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
489
|
+
${c(e, "caret-color", `--PAGINATIONMENU-EVENTS-${t}-COLOR-PRIMARY`)};
|
|
489
490
|
`, W = (e, t) => `
|
|
490
491
|
// BACKGROUNDS
|
|
491
|
-
${
|
|
492
|
+
${c(e, "background-color", `--PAGINATIONMENU-${t}-BACKGROUND-COLOR`)}
|
|
492
493
|
|
|
493
494
|
// BORDERS
|
|
494
|
-
${
|
|
495
|
-
${
|
|
496
|
-
${
|
|
497
|
-
${
|
|
498
|
-
`, G = (e) =>
|
|
495
|
+
${c(e, "border-color", `--PAGINATIONMENU-${t}-BORDER-COLOR`)}
|
|
496
|
+
${c(e, "border-width", `--PAGINATIONMENU-${t}-BORDER-WIDTH`)}
|
|
497
|
+
${c(e, "border-style", `--PAGINATIONMENU-${t}-BORDER-STYLE`)}
|
|
498
|
+
${c(e, "border-radius", `--PAGINATIONMENU-${t}-BORDER-RADIUS`)}
|
|
499
|
+
`, G = (e) => k`
|
|
499
500
|
&.--PAGINATIONMENU {
|
|
500
501
|
position: absolute;
|
|
501
502
|
bottom: calc(100% + ${e["--PAGINATIONMENU-ROOT-BOTTOM"] || ""});
|
|
@@ -569,14 +570,14 @@ var A = O`
|
|
|
569
570
|
children: e
|
|
570
571
|
}, e);
|
|
571
572
|
})
|
|
572
|
-
}), J = ({ theme:
|
|
573
|
-
let { componentStyles:
|
|
573
|
+
}), J = ({ theme: e, variant: n = "default", ...i }) => {
|
|
574
|
+
let { componentStyles: o } = a([r.PAGINATIONMENU], e, n.toUpperCase());
|
|
574
575
|
return /* @__PURE__ */ t(q, {
|
|
575
576
|
...i,
|
|
576
|
-
style:
|
|
577
|
+
style: o
|
|
577
578
|
});
|
|
578
|
-
}, Y = "--PAGINATION", X = ({ page:
|
|
579
|
-
let [p, m] =
|
|
579
|
+
}, Y = "--PAGINATION", X = ({ page: r, total: i, pageSize: a, onPageChange: s, pageSizeOptions: c, onPageSizeChange: l, loading: u, className: d, style: f }) => {
|
|
580
|
+
let [p, m] = O(!1), [h, g] = O(-1), _ = Math.max(1, Math.ceil(i / a)), v = r * a + 1, y = Math.min((r + 1) * a, i), b = r === 0, x = r >= _ - 1, S = () => {
|
|
580
581
|
m(!1), g(-1);
|
|
581
582
|
};
|
|
582
583
|
return w(() => {
|
|
@@ -585,15 +586,15 @@ var A = O`
|
|
|
585
586
|
e.target.closest(`.${Y}-rowsControl`) || (m(!1), g(-1));
|
|
586
587
|
};
|
|
587
588
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
588
|
-
}, [p]), /* @__PURE__ */
|
|
589
|
+
}, [p]), /* @__PURE__ */ e("div", {
|
|
589
590
|
className: [Y, d || ""].filter(Boolean).join(" "),
|
|
590
591
|
css: V(f ?? {}),
|
|
591
|
-
children: [c && c.length > 0 && /* @__PURE__ */
|
|
592
|
+
children: [c && c.length > 0 && /* @__PURE__ */ e("div", {
|
|
592
593
|
className: `${Y}-rowsControl`,
|
|
593
594
|
children: [
|
|
594
595
|
p && /* @__PURE__ */ t(J, {
|
|
595
596
|
options: c,
|
|
596
|
-
activeOption:
|
|
597
|
+
activeOption: a,
|
|
597
598
|
onSelect: (e) => {
|
|
598
599
|
l?.(e), S();
|
|
599
600
|
},
|
|
@@ -601,10 +602,10 @@ var A = O`
|
|
|
601
602
|
}),
|
|
602
603
|
/* @__PURE__ */ t("span", {
|
|
603
604
|
className: `${Y}-rowsSize`,
|
|
604
|
-
children:
|
|
605
|
+
children: a
|
|
605
606
|
}),
|
|
606
607
|
/* @__PURE__ */ t(o, {
|
|
607
|
-
icon: /* @__PURE__ */ t(
|
|
608
|
+
icon: /* @__PURE__ */ t(n, {
|
|
608
609
|
name: "arrow_drop_up",
|
|
609
610
|
size: "sm"
|
|
610
611
|
}),
|
|
@@ -623,55 +624,55 @@ var A = O`
|
|
|
623
624
|
"data-testid": `${Y}-rowsBtn`
|
|
624
625
|
})
|
|
625
626
|
]
|
|
626
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ e("div", {
|
|
627
628
|
className: `${Y}-controls`,
|
|
628
629
|
children: [
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ e("span", {
|
|
630
631
|
className: `${Y}-info`,
|
|
631
632
|
children: [
|
|
632
633
|
v,
|
|
633
634
|
"-",
|
|
634
635
|
y,
|
|
635
636
|
" of ",
|
|
636
|
-
|
|
637
|
+
i
|
|
637
638
|
]
|
|
638
639
|
}),
|
|
639
640
|
/* @__PURE__ */ t(o, {
|
|
640
|
-
icon: /* @__PURE__ */ t(
|
|
641
|
+
icon: /* @__PURE__ */ t(n, {
|
|
641
642
|
name: "first_page",
|
|
642
643
|
size: "sm"
|
|
643
644
|
}),
|
|
644
|
-
onClick: () =>
|
|
645
|
+
onClick: () => s(0),
|
|
645
646
|
disabled: u || b,
|
|
646
647
|
"aria-label": "First page",
|
|
647
648
|
"data-testid": `${Y}-first`
|
|
648
649
|
}),
|
|
649
650
|
/* @__PURE__ */ t(o, {
|
|
650
|
-
icon: /* @__PURE__ */ t(
|
|
651
|
+
icon: /* @__PURE__ */ t(n, {
|
|
651
652
|
name: "chevron_left",
|
|
652
653
|
size: "sm"
|
|
653
654
|
}),
|
|
654
|
-
onClick: () =>
|
|
655
|
+
onClick: () => s(r - 1),
|
|
655
656
|
disabled: u || b,
|
|
656
657
|
"aria-label": "Previous page",
|
|
657
658
|
"data-testid": `${Y}-prev`
|
|
658
659
|
}),
|
|
659
660
|
/* @__PURE__ */ t(o, {
|
|
660
|
-
icon: /* @__PURE__ */ t(
|
|
661
|
+
icon: /* @__PURE__ */ t(n, {
|
|
661
662
|
name: "chevron_right",
|
|
662
663
|
size: "sm"
|
|
663
664
|
}),
|
|
664
|
-
onClick: () =>
|
|
665
|
+
onClick: () => s(r + 1),
|
|
665
666
|
disabled: u || x,
|
|
666
667
|
"aria-label": "Next page",
|
|
667
668
|
"data-testid": `${Y}-next`
|
|
668
669
|
}),
|
|
669
670
|
/* @__PURE__ */ t(o, {
|
|
670
|
-
icon: /* @__PURE__ */ t(
|
|
671
|
+
icon: /* @__PURE__ */ t(n, {
|
|
671
672
|
name: "last_page",
|
|
672
673
|
size: "sm"
|
|
673
674
|
}),
|
|
674
|
-
onClick: () =>
|
|
675
|
+
onClick: () => s(_ - 1),
|
|
675
676
|
disabled: u || x,
|
|
676
677
|
"aria-label": "Last page",
|
|
677
678
|
"data-testid": `${Y}-last`
|
|
@@ -679,38 +680,44 @@ var A = O`
|
|
|
679
680
|
]
|
|
680
681
|
})]
|
|
681
682
|
});
|
|
682
|
-
},
|
|
683
|
-
let { componentStyles:
|
|
683
|
+
}, oe = ({ theme: e, variant: n = "default", ...i }) => {
|
|
684
|
+
let { componentStyles: o } = a([r.PAGINATION], e, n.toUpperCase());
|
|
684
685
|
return /* @__PURE__ */ t(X, {
|
|
685
686
|
...i,
|
|
686
|
-
style:
|
|
687
|
+
style: o
|
|
687
688
|
});
|
|
688
|
-
}, Z = "--DATAGRID",
|
|
689
|
-
let [m, h] =
|
|
689
|
+
}, Z = "--DATAGRID", se = 10, Q = ({ columns: r, onFetch: a, paginationType: s = "pagination", pageSize: c = se, pageSizeOptions: l, emptyContent: u = /* @__PURE__ */ t("span", { children: "No se han encontrado resultados" }), loadingMoreContent: d = /* @__PURE__ */ t("span", { children: "Cargando..." }), className: f, style: p }) => {
|
|
690
|
+
let [m, h] = O([]), [g, _] = O(0), [v, y] = O(0), [b, x] = O(c), [S, C] = O(!0), [E, k] = O(null), [A, te] = O({}), [j, M] = O(null), [re, N] = O(null), [P, F] = O(""), [I, L] = O([]), [R, z] = O(""), [B, V] = O([]), [H, U] = O(0), W = D({}), G = D(null), K = D(null), q = D(null);
|
|
690
691
|
w(() => {
|
|
691
692
|
let e = !1;
|
|
692
|
-
return
|
|
693
|
+
return a({
|
|
693
694
|
page: v,
|
|
694
695
|
pageSize: b,
|
|
695
|
-
filters:
|
|
696
|
-
sort:
|
|
696
|
+
filters: A,
|
|
697
|
+
sort: E ?? void 0
|
|
697
698
|
}).then((t) => {
|
|
698
|
-
e || (h((e) =>
|
|
699
|
+
e || (h((e) => s === "scroll" && v > 0 ? [...e, ...t.data] : t.data), _(t.total), C(!1));
|
|
699
700
|
}), () => {
|
|
700
701
|
e = !0;
|
|
701
702
|
};
|
|
702
703
|
}, [
|
|
703
704
|
v,
|
|
704
705
|
b,
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
]),
|
|
710
|
-
|
|
706
|
+
A,
|
|
707
|
+
E,
|
|
708
|
+
s,
|
|
709
|
+
a
|
|
710
|
+
]), T(() => {
|
|
711
|
+
if (s !== "scroll" || !G.current || !q.current || !K.current) return;
|
|
712
|
+
let e = () => {
|
|
713
|
+
!G.current || !q.current || (V(Array.from(G.current.querySelectorAll(`th:not(.${Z}-thScrollbarSpacer)`)).map((e) => e.getBoundingClientRect().width)), U(q.current.offsetWidth - q.current.clientWidth));
|
|
714
|
+
};
|
|
715
|
+
e();
|
|
716
|
+
let t = new ResizeObserver(e);
|
|
717
|
+
return t.observe(K.current), () => t.disconnect();
|
|
711
718
|
}, [
|
|
712
|
-
|
|
713
|
-
|
|
719
|
+
s,
|
|
720
|
+
r.length,
|
|
714
721
|
S
|
|
715
722
|
]), w(() => {
|
|
716
723
|
if (!j) return;
|
|
@@ -722,122 +729,123 @@ var A = O`
|
|
|
722
729
|
let J = (e) => {
|
|
723
730
|
if (!e.filter) return;
|
|
724
731
|
if (j === e.key) {
|
|
725
|
-
M(null),
|
|
732
|
+
M(null), N(null);
|
|
726
733
|
return;
|
|
727
734
|
}
|
|
728
|
-
let t =
|
|
729
|
-
e.filter.type === "search" ?
|
|
735
|
+
let t = A[e.key];
|
|
736
|
+
e.filter.type === "search" ? F(typeof t == "string" ? t : "") : (L(Array.isArray(t) ? t : []), z("")), N(W.current[e.key] ?? null), M(e.key);
|
|
730
737
|
}, Y = (e) => {
|
|
731
738
|
if (!e.filter) return;
|
|
732
|
-
let t = e.filter.type === "search" ?
|
|
733
|
-
|
|
739
|
+
let t = e.filter.type === "search" ? P : I;
|
|
740
|
+
C(!0), te((n) => ({
|
|
734
741
|
...n,
|
|
735
742
|
[e.key]: t
|
|
736
743
|
})), y(0), M(null);
|
|
737
744
|
}, X = (e) => {
|
|
738
|
-
let t =
|
|
745
|
+
let t = A[e];
|
|
739
746
|
return t == null ? !1 : Array.isArray(t) ? t.length > 0 : t !== "";
|
|
740
|
-
},
|
|
741
|
-
|
|
747
|
+
}, Q = (e) => {
|
|
748
|
+
C(!0), k((t) => t?.key === e ? {
|
|
742
749
|
key: e,
|
|
743
750
|
direction: t.direction === "asc" ? "desc" : "asc"
|
|
744
751
|
} : {
|
|
745
752
|
key: e,
|
|
746
753
|
direction: "asc"
|
|
747
754
|
}), y(0);
|
|
748
|
-
}, Q = (e) => {
|
|
749
|
-
T(!0), y(e);
|
|
750
755
|
}, ce = (e) => {
|
|
751
|
-
|
|
752
|
-
}, le =
|
|
753
|
-
|
|
756
|
+
C(!0), y(e);
|
|
757
|
+
}, le = (e) => {
|
|
758
|
+
C(!0), x(e), y(0);
|
|
759
|
+
}, ue = ee((e) => {
|
|
760
|
+
if (s !== "scroll" || S || m.length >= g) return;
|
|
754
761
|
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e.currentTarget;
|
|
755
|
-
n - t - r < 48 && (
|
|
762
|
+
n - t - r < 48 && (C(!0), y((e) => e + 1));
|
|
756
763
|
}, [
|
|
757
|
-
|
|
764
|
+
s,
|
|
758
765
|
S,
|
|
759
766
|
m.length,
|
|
760
767
|
g
|
|
761
|
-
]),
|
|
762
|
-
className: [`${Z}-th`,
|
|
763
|
-
style:
|
|
764
|
-
children: /* @__PURE__ */
|
|
768
|
+
]), de = r.length, $ = j ? r.find((e) => e.key === j) : void 0, fe = b * 48, pe = !S && m.length === 0, me = r.map((r) => /* @__PURE__ */ t("th", {
|
|
769
|
+
className: [`${Z}-th`, r.type === "options" ? `${Z}-thOptions` : ""].join(" "),
|
|
770
|
+
style: r.width ? { width: r.width } : void 0,
|
|
771
|
+
children: /* @__PURE__ */ e("div", {
|
|
765
772
|
className: `${Z}-thInner`,
|
|
766
|
-
"data-testid": `${Z}-th-${
|
|
767
|
-
children: [typeof
|
|
773
|
+
"data-testid": `${Z}-th-${r.key}`,
|
|
774
|
+
children: [typeof r.label == "string" ? /* @__PURE__ */ t("span", {
|
|
768
775
|
className: `${Z}-thLabel`,
|
|
769
|
-
children:
|
|
770
|
-
}) :
|
|
776
|
+
children: r.label
|
|
777
|
+
}) : r.label, r.type !== "options" && /* @__PURE__ */ e("div", {
|
|
771
778
|
className: `${Z}-thActions`,
|
|
772
|
-
children: [
|
|
779
|
+
children: [r.filter && /* @__PURE__ */ t("div", {
|
|
773
780
|
className: `${Z}-filterContainer`,
|
|
774
|
-
"data-popover-key":
|
|
781
|
+
"data-popover-key": r.key,
|
|
775
782
|
children: /* @__PURE__ */ t("span", {
|
|
776
|
-
ref: (
|
|
777
|
-
|
|
783
|
+
ref: (e) => {
|
|
784
|
+
W.current[r.key] = e;
|
|
778
785
|
},
|
|
779
786
|
children: /* @__PURE__ */ t(o, {
|
|
780
|
-
icon: /* @__PURE__ */ t(
|
|
781
|
-
name: X(
|
|
787
|
+
icon: /* @__PURE__ */ t(n, {
|
|
788
|
+
name: X(r.key) ? "filter_alt" : "filter_list",
|
|
782
789
|
size: "sm",
|
|
783
|
-
style: { color: X(
|
|
790
|
+
style: { color: X(r.key) ? "white" : "" }
|
|
784
791
|
}),
|
|
785
|
-
onClick: () => J(
|
|
786
|
-
"data-testid": `${Z}-filterBtn-${
|
|
787
|
-
"aria-label": `Filter ${
|
|
792
|
+
onClick: () => J(r),
|
|
793
|
+
"data-testid": `${Z}-filterBtn-${r.key}`,
|
|
794
|
+
"aria-label": `Filter ${r.label}`
|
|
788
795
|
})
|
|
789
796
|
})
|
|
790
|
-
}),
|
|
791
|
-
icon: /* @__PURE__ */ t(
|
|
792
|
-
name:
|
|
797
|
+
}), r.sortable !== !1 && /* @__PURE__ */ t(o, {
|
|
798
|
+
icon: /* @__PURE__ */ t(n, {
|
|
799
|
+
name: E?.key === r.key ? E.direction === "asc" ? "arrow_upward" : "arrow_downward" : "unfold_more",
|
|
793
800
|
size: "sm",
|
|
794
|
-
style: { color:
|
|
801
|
+
style: { color: E?.key === r.key ? "white" : "" }
|
|
795
802
|
}),
|
|
796
|
-
onClick: () =>
|
|
797
|
-
"data-testid": `${Z}-sortBtn-${
|
|
798
|
-
"aria-label": `Sort ${
|
|
803
|
+
onClick: () => Q(r.key),
|
|
804
|
+
"data-testid": `${Z}-sortBtn-${r.key}`,
|
|
805
|
+
"aria-label": `Sort ${r.label}`
|
|
799
806
|
})]
|
|
800
807
|
})]
|
|
801
808
|
})
|
|
802
|
-
},
|
|
803
|
-
columns:
|
|
809
|
+
}, r.key)), he = S && (s !== "scroll" || m.length === 0) ? /* @__PURE__ */ t(ae, {
|
|
810
|
+
columns: r,
|
|
804
811
|
pageSize: b
|
|
805
|
-
}) :
|
|
806
|
-
colSpan:
|
|
812
|
+
}) : pe ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
813
|
+
colSpan: de,
|
|
807
814
|
className: `${Z}-emptyCell`,
|
|
808
|
-
style: { height: `${
|
|
815
|
+
style: { height: `${fe}px` },
|
|
809
816
|
children: u
|
|
810
|
-
}) }) : /* @__PURE__ */
|
|
817
|
+
}) }) : /* @__PURE__ */ e(i, { children: [m.map((e, n) => /* @__PURE__ */ t("tr", {
|
|
811
818
|
className: `${Z}-row`,
|
|
812
|
-
"data-testid": `${Z}-row-${
|
|
813
|
-
children:
|
|
814
|
-
let i =
|
|
819
|
+
"data-testid": `${Z}-row-${n}`,
|
|
820
|
+
children: r.map((r) => {
|
|
821
|
+
let i = e[r.key];
|
|
815
822
|
return /* @__PURE__ */ t("td", {
|
|
816
|
-
className: [`${Z}-td`,
|
|
817
|
-
"data-testid": `${Z}-cell-${
|
|
818
|
-
children:
|
|
819
|
-
},
|
|
823
|
+
className: [`${Z}-td`, r.type === "options" ? `${Z}-tdOptions` : ""].filter(Boolean).join(" "),
|
|
824
|
+
"data-testid": `${Z}-cell-${r.key}-${n}`,
|
|
825
|
+
children: r.render ? r.render(i, e) : String(i ?? "")
|
|
826
|
+
}, r.key);
|
|
820
827
|
})
|
|
821
|
-
},
|
|
822
|
-
colSpan:
|
|
828
|
+
}, n)), s === "scroll" && S && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
829
|
+
colSpan: de,
|
|
823
830
|
className: `${Z}-loadingMore`,
|
|
824
831
|
children: d
|
|
825
832
|
}) })] });
|
|
826
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ e("div", {
|
|
827
834
|
className: [Z, f || ""].join(" "),
|
|
828
835
|
css: ne(p),
|
|
829
836
|
"data-testid": Z,
|
|
830
837
|
children: [
|
|
831
838
|
/* @__PURE__ */ t("div", {
|
|
832
839
|
className: `${Z}-tableContainer`,
|
|
833
|
-
children:
|
|
840
|
+
children: s === "scroll" ? /* @__PURE__ */ e(i, { children: [/* @__PURE__ */ e("table", {
|
|
841
|
+
ref: K,
|
|
834
842
|
className: `${Z}-table`,
|
|
835
|
-
children: [/* @__PURE__ */
|
|
836
|
-
ref:
|
|
843
|
+
children: [/* @__PURE__ */ e("colgroup", { children: [r.map((e) => /* @__PURE__ */ t("col", { style: e.width ? { width: e.width } : void 0 }, e.key)), /* @__PURE__ */ t("col", { style: { width: H || 0 } })] }), /* @__PURE__ */ t("thead", {
|
|
844
|
+
ref: G,
|
|
837
845
|
className: `${Z}-thead`,
|
|
838
|
-
children: /* @__PURE__ */
|
|
846
|
+
children: /* @__PURE__ */ e("tr", {
|
|
839
847
|
className: `${Z}-headerRow`,
|
|
840
|
-
children: [
|
|
848
|
+
children: [me, /* @__PURE__ */ t("th", {
|
|
841
849
|
"aria-hidden": "true",
|
|
842
850
|
className: `${Z}-thScrollbarSpacer`,
|
|
843
851
|
style: { padding: 0 }
|
|
@@ -849,44 +857,44 @@ var A = O`
|
|
|
849
857
|
className: `${Z}-bodyContainer`,
|
|
850
858
|
style: {
|
|
851
859
|
overflowY: "auto",
|
|
852
|
-
maxHeight: `${
|
|
860
|
+
maxHeight: `${fe}px`
|
|
853
861
|
},
|
|
854
|
-
onScroll:
|
|
855
|
-
children: /* @__PURE__ */
|
|
862
|
+
onScroll: ue,
|
|
863
|
+
children: /* @__PURE__ */ e("table", {
|
|
856
864
|
className: `${Z}-table`,
|
|
857
865
|
style: {
|
|
858
866
|
tableLayout: "fixed",
|
|
859
867
|
width: "100%"
|
|
860
868
|
},
|
|
861
|
-
children: [/* @__PURE__ */ t("colgroup", { children:
|
|
869
|
+
children: [/* @__PURE__ */ t("colgroup", { children: r.map((e, n) => /* @__PURE__ */ t("col", { style: { width: B[n] === void 0 ? e.width ?? "auto" : B[n] } }, e.key)) }), /* @__PURE__ */ t("tbody", {
|
|
862
870
|
className: `${Z}-tbody`,
|
|
863
|
-
children:
|
|
871
|
+
children: he
|
|
864
872
|
})]
|
|
865
873
|
})
|
|
866
|
-
})] }) : /* @__PURE__ */
|
|
874
|
+
})] }) : /* @__PURE__ */ e("table", {
|
|
867
875
|
className: `${Z}-table`,
|
|
868
876
|
children: [/* @__PURE__ */ t("thead", {
|
|
869
877
|
className: `${Z}-thead`,
|
|
870
878
|
children: /* @__PURE__ */ t("tr", {
|
|
871
879
|
className: `${Z}-headerRow`,
|
|
872
|
-
children:
|
|
880
|
+
children: me
|
|
873
881
|
})
|
|
874
882
|
}), /* @__PURE__ */ t("tbody", {
|
|
875
883
|
className: `${Z}-tbody`,
|
|
876
|
-
children:
|
|
884
|
+
children: he
|
|
877
885
|
})]
|
|
878
886
|
})
|
|
879
887
|
}),
|
|
880
|
-
|
|
888
|
+
s === "pagination" && /* @__PURE__ */ t(oe, {
|
|
881
889
|
page: v,
|
|
882
890
|
total: g,
|
|
883
891
|
pageSize: b,
|
|
884
|
-
onPageChange:
|
|
892
|
+
onPageChange: ce,
|
|
885
893
|
pageSizeOptions: l,
|
|
886
|
-
onPageSizeChange:
|
|
894
|
+
onPageSizeChange: le,
|
|
887
895
|
loading: S
|
|
888
896
|
}),
|
|
889
|
-
$?.filter && /* @__PURE__ */ t(
|
|
897
|
+
$?.filter && /* @__PURE__ */ t(ie, {
|
|
890
898
|
filterType: $.filter.type,
|
|
891
899
|
options: $.filter.options,
|
|
892
900
|
columnKey: $.key,
|
|
@@ -894,29 +902,29 @@ var A = O`
|
|
|
894
902
|
searchLabel: $.filter.label,
|
|
895
903
|
cancelLabel: $.filter.cancelLabel,
|
|
896
904
|
applyLabel: $.filter.applyLabel,
|
|
897
|
-
pendingSearch:
|
|
898
|
-
onSearchChange:
|
|
899
|
-
pendingMulti:
|
|
900
|
-
onMultiChange:
|
|
901
|
-
multiSearch:
|
|
902
|
-
onMultiSearchChange:
|
|
905
|
+
pendingSearch: P,
|
|
906
|
+
onSearchChange: F,
|
|
907
|
+
pendingMulti: I,
|
|
908
|
+
onMultiChange: L,
|
|
909
|
+
multiSearch: R,
|
|
910
|
+
onMultiSearchChange: z,
|
|
903
911
|
onCancel: () => M(null),
|
|
904
912
|
onApply: () => Y($),
|
|
905
913
|
onClear: () => {
|
|
906
|
-
$.filter?.type === "search" ?
|
|
914
|
+
$.filter?.type === "search" ? F("") : (L([]), z(""));
|
|
907
915
|
},
|
|
908
|
-
anchorEl:
|
|
916
|
+
anchorEl: re
|
|
909
917
|
})
|
|
910
918
|
]
|
|
911
919
|
});
|
|
912
|
-
},
|
|
913
|
-
let { componentStyles:
|
|
914
|
-
return /* @__PURE__ */ t(
|
|
920
|
+
}, ce = ({ theme: e, variant: n = "default", ...i }) => {
|
|
921
|
+
let { componentStyles: o } = a([r.DATAGRID], e, n.toUpperCase());
|
|
922
|
+
return /* @__PURE__ */ t(Q, {
|
|
915
923
|
...i,
|
|
916
|
-
style:
|
|
924
|
+
style: o
|
|
917
925
|
});
|
|
918
926
|
};
|
|
919
927
|
//#endregion
|
|
920
|
-
export {
|
|
928
|
+
export { u as Button, _ as Checkbox, v as CheckboxGroup, b as CheckboxTree, ce as DataGrid, h as DatePicker, n as Icon, o as IconButton, y as Modal, l as NumberField, oe as Pagination, d as Radio, x as RadioGroup, m as Select, M as Skeleton, f as Slider, g as Switch, p as TextField, C as ThemeProvider, S as ToastProvider, s as darkTheme };
|
|
921
929
|
|
|
922
930
|
//# sourceMappingURL=index.mjs.map
|