@gnwebsoft/ui 2.18.30 → 2.18.31
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/{chunk-LWAM2GIC.mjs → chunk-34X2YRTY.mjs} +34 -32
- package/dist/{chunk-AZOXVTXB.js → chunk-4E6AXVK7.js} +32 -20
- package/dist/{chunk-LNMCA2OM.js → chunk-7HKMAJKT.js} +68 -24
- package/dist/{chunk-VNMKBB4P.mjs → chunk-M42TPRCN.mjs} +73 -29
- package/dist/{chunk-TXO5AC4B.mjs → chunk-MRZZQRKX.mjs} +40 -28
- package/dist/{chunk-CKJEER4L.js → chunk-STC2BZ2L.js} +28 -26
- package/dist/components/index.d.mts +18 -7
- package/dist/components/index.d.ts +18 -7
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/wrappers/index.js +2 -2
- package/dist/wrappers/index.mjs +1 -1
- package/dist/wrappers2/index.js +2 -2
- package/dist/wrappers2/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
// src/components/ClearButton/ClearButton.tsx
|
|
2
2
|
import { Button } from "@mui/material";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
var ClearButton = ({ isSubmitting, handleClear }) => {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
4
|
+
var ClearButton = ({ isSubmitting, handleClear, sx }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
Button,
|
|
7
|
+
{
|
|
8
|
+
variant: "outlined",
|
|
9
|
+
onClick: handleClear,
|
|
10
|
+
disabled: isSubmitting,
|
|
11
|
+
sx,
|
|
12
|
+
children: "Clear"
|
|
13
|
+
}
|
|
14
|
+
);
|
|
6
15
|
};
|
|
7
16
|
var ClearButton_default = ClearButton;
|
|
8
17
|
|
|
@@ -15,7 +24,8 @@ var FilterButton = ({
|
|
|
15
24
|
isSubmitting,
|
|
16
25
|
show,
|
|
17
26
|
title,
|
|
18
|
-
icon
|
|
27
|
+
icon,
|
|
28
|
+
sx
|
|
19
29
|
}) => {
|
|
20
30
|
return /* @__PURE__ */ jsx2(
|
|
21
31
|
LoadingButton,
|
|
@@ -26,7 +36,8 @@ var FilterButton = ({
|
|
|
26
36
|
disabled: !show,
|
|
27
37
|
disableRipple: true,
|
|
28
38
|
sx: {
|
|
29
|
-
|
|
39
|
+
...sx,
|
|
40
|
+
bgcolor: "primary",
|
|
30
41
|
display: "flex",
|
|
31
42
|
alignItems: "center"
|
|
32
43
|
},
|
|
@@ -49,11 +60,18 @@ import {
|
|
|
49
60
|
} from "@mui/material";
|
|
50
61
|
import ManageSearchIcon from "@mui/icons-material/ManageSearch";
|
|
51
62
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
52
|
-
var FilterWrapper = ({
|
|
63
|
+
var FilterWrapper = ({
|
|
64
|
+
children,
|
|
65
|
+
title,
|
|
66
|
+
cardSx,
|
|
67
|
+
textSx,
|
|
68
|
+
icon
|
|
69
|
+
}) => {
|
|
53
70
|
return /* @__PURE__ */ jsxs(
|
|
54
71
|
Card,
|
|
55
72
|
{
|
|
56
73
|
sx: {
|
|
74
|
+
...cardSx,
|
|
57
75
|
position: "relative",
|
|
58
76
|
borderRadius: "0px",
|
|
59
77
|
mb: 2
|
|
@@ -73,12 +91,12 @@ var FilterWrapper = ({ children, title }) => {
|
|
|
73
91
|
alignItems: "center"
|
|
74
92
|
},
|
|
75
93
|
title: /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
76
|
-
/* @__PURE__ */ jsx3(ManageSearchIcon, { sx: { color: "
|
|
94
|
+
icon ? icon : /* @__PURE__ */ jsx3(ManageSearchIcon, { sx: { color: "primary", height: "2.5rem" } }),
|
|
77
95
|
/* @__PURE__ */ jsx3(
|
|
78
96
|
Typography,
|
|
79
97
|
{
|
|
80
98
|
variant: "h5",
|
|
81
|
-
sx: { color: "
|
|
99
|
+
sx: { ...textSx, color: "primary", fontWeight: "bold" },
|
|
82
100
|
children: title
|
|
83
101
|
}
|
|
84
102
|
)
|
|
@@ -95,6 +113,7 @@ var FilterWrapper_default = FilterWrapper;
|
|
|
95
113
|
|
|
96
114
|
// src/components/FormWrapper/FormWrapper.tsx
|
|
97
115
|
import {
|
|
116
|
+
Box as Box2,
|
|
98
117
|
Card as Card2,
|
|
99
118
|
CardContent as CardContent2,
|
|
100
119
|
CardHeader as CardHeader2,
|
|
@@ -108,7 +127,9 @@ var FormWrapper = ({
|
|
|
108
127
|
title,
|
|
109
128
|
editMode,
|
|
110
129
|
cardSx,
|
|
111
|
-
textSx
|
|
130
|
+
textSx,
|
|
131
|
+
icon,
|
|
132
|
+
actionButton
|
|
112
133
|
}) => {
|
|
113
134
|
return /* @__PURE__ */ jsxs2(
|
|
114
135
|
Card2,
|
|
@@ -131,7 +152,23 @@ var FormWrapper = ({
|
|
|
131
152
|
alignSelf: "center"
|
|
132
153
|
}
|
|
133
154
|
},
|
|
134
|
-
title:
|
|
155
|
+
title: /* @__PURE__ */ jsxs2(
|
|
156
|
+
Box2,
|
|
157
|
+
{
|
|
158
|
+
sx: {
|
|
159
|
+
display: "flex",
|
|
160
|
+
alignItems: "center",
|
|
161
|
+
justifyContent: "space-between"
|
|
162
|
+
},
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsxs2(Box2, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
165
|
+
icon ?? icon,
|
|
166
|
+
/* @__PURE__ */ jsx4(Typography2, { color: "primary", sx: textSx, children: editMode ? `Edit ${title}` : `Create ${title}` })
|
|
167
|
+
] }),
|
|
168
|
+
actionButton
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
)
|
|
135
172
|
}
|
|
136
173
|
),
|
|
137
174
|
/* @__PURE__ */ jsx4(Divider2, { sx: { mt: 0 } }),
|
|
@@ -149,7 +186,9 @@ var LabelText = ({
|
|
|
149
186
|
label,
|
|
150
187
|
value,
|
|
151
188
|
gridSize,
|
|
152
|
-
containerSize
|
|
189
|
+
containerSize,
|
|
190
|
+
labelSx,
|
|
191
|
+
valueSx
|
|
153
192
|
}) => {
|
|
154
193
|
const defaultGridSize = {
|
|
155
194
|
labelSize: { xs: 6, sm: 6, md: 6 },
|
|
@@ -173,6 +212,7 @@ var LabelText = ({
|
|
|
173
212
|
{
|
|
174
213
|
size: size.labelSize,
|
|
175
214
|
sx: {
|
|
215
|
+
...labelSx,
|
|
176
216
|
padding: "5px",
|
|
177
217
|
fontSize: "14px",
|
|
178
218
|
textAlign: { xs: "left", sm: "right", md: "right" }
|
|
@@ -191,9 +231,9 @@ var LabelText = ({
|
|
|
191
231
|
children: /* @__PURE__ */ jsx5(Tooltip, { title: value, arrow: true, children: /* @__PURE__ */ jsx5(
|
|
192
232
|
Typography3,
|
|
193
233
|
{
|
|
194
|
-
color: "#3598dc",
|
|
195
|
-
fontSize: "14px",
|
|
196
234
|
sx: {
|
|
235
|
+
...valueSx,
|
|
236
|
+
fontSize: "14px",
|
|
197
237
|
wordBreak: "break-word",
|
|
198
238
|
overflow: "hidden",
|
|
199
239
|
display: "-webkit-box",
|
|
@@ -214,7 +254,7 @@ var LabelText_default = LabelText;
|
|
|
214
254
|
|
|
215
255
|
// src/components/ListWrapper/ListWrapper.tsx
|
|
216
256
|
import {
|
|
217
|
-
Box as
|
|
257
|
+
Box as Box3,
|
|
218
258
|
Card as Card3,
|
|
219
259
|
CardContent as CardContent3,
|
|
220
260
|
CardHeader as CardHeader3,
|
|
@@ -229,13 +269,18 @@ var ListWrapper = ({
|
|
|
229
269
|
title,
|
|
230
270
|
count,
|
|
231
271
|
show = true,
|
|
232
|
-
actionButton
|
|
272
|
+
actionButton,
|
|
273
|
+
cardSx,
|
|
274
|
+
textSx,
|
|
275
|
+
icon,
|
|
276
|
+
showCount = true
|
|
233
277
|
}) => {
|
|
234
278
|
if (!show) return /* @__PURE__ */ jsx6(Fragment, {});
|
|
235
279
|
return /* @__PURE__ */ jsxs4(
|
|
236
280
|
Card3,
|
|
237
281
|
{
|
|
238
282
|
sx: {
|
|
283
|
+
...cardSx,
|
|
239
284
|
position: "relative",
|
|
240
285
|
borderRadius: "0px"
|
|
241
286
|
},
|
|
@@ -254,7 +299,7 @@ var ListWrapper = ({
|
|
|
254
299
|
alignItems: "center"
|
|
255
300
|
},
|
|
256
301
|
title: /* @__PURE__ */ jsxs4(
|
|
257
|
-
|
|
302
|
+
Box3,
|
|
258
303
|
{
|
|
259
304
|
sx: {
|
|
260
305
|
display: "flex",
|
|
@@ -262,14 +307,18 @@ var ListWrapper = ({
|
|
|
262
307
|
justifyContent: "space-between"
|
|
263
308
|
},
|
|
264
309
|
children: [
|
|
265
|
-
/* @__PURE__ */ jsxs4(
|
|
266
|
-
/* @__PURE__ */ jsx6(ManageSearchIcon2, { sx: { color: "
|
|
267
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ jsxs4(Box3, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
311
|
+
icon ? icon : /* @__PURE__ */ jsx6(ManageSearchIcon2, { sx: { color: "primary", height: "2.5rem" } }),
|
|
312
|
+
/* @__PURE__ */ jsxs4(
|
|
268
313
|
Typography4,
|
|
269
314
|
{
|
|
270
315
|
variant: "h5",
|
|
271
|
-
sx: { color: "
|
|
272
|
-
children:
|
|
316
|
+
sx: { ...textSx, color: "primary", fontWeight: "bold" },
|
|
317
|
+
children: [
|
|
318
|
+
title,
|
|
319
|
+
" ",
|
|
320
|
+
showCount ? `$(${count ? count : 0})` : /* @__PURE__ */ jsx6(Fragment, {})
|
|
321
|
+
]
|
|
273
322
|
}
|
|
274
323
|
)
|
|
275
324
|
] }),
|
|
@@ -295,7 +344,7 @@ import {
|
|
|
295
344
|
GridToolbarFilterButton,
|
|
296
345
|
GridToolbarQuickFilter
|
|
297
346
|
} from "@mui/x-data-grid";
|
|
298
|
-
import { Box as
|
|
347
|
+
import { Box as Box4 } from "@mui/material";
|
|
299
348
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
300
349
|
var SimpleToolbar = () => /* @__PURE__ */ jsxs5(GridToolbarContainer, { children: [
|
|
301
350
|
/* @__PURE__ */ jsx7(
|
|
@@ -304,22 +353,17 @@ var SimpleToolbar = () => /* @__PURE__ */ jsxs5(GridToolbarContainer, { children
|
|
|
304
353
|
sx: {
|
|
305
354
|
"& .MuiInputBase-root": {
|
|
306
355
|
borderRadius: "8px",
|
|
307
|
-
padding: "6px 10px"
|
|
308
|
-
backgroundColor: "#f6f7f8"
|
|
356
|
+
padding: "6px 10px"
|
|
309
357
|
},
|
|
310
358
|
"& input": {
|
|
311
359
|
fontSize: "14px",
|
|
312
360
|
color: "#333"
|
|
313
361
|
},
|
|
314
|
-
borderRadius: "8px"
|
|
315
|
-
".css-hzgntl-MuiOutlinedInput-notchedOutline": {
|
|
316
|
-
borderRadius: "8px",
|
|
317
|
-
border: "1px solid #efefef !important"
|
|
318
|
-
}
|
|
362
|
+
borderRadius: "8px"
|
|
319
363
|
}
|
|
320
364
|
}
|
|
321
365
|
),
|
|
322
|
-
/* @__PURE__ */ jsx7(
|
|
366
|
+
/* @__PURE__ */ jsx7(Box4, { sx: { flexGrow: 1 } }),
|
|
323
367
|
/* @__PURE__ */ jsx7(GridToolbarColumnsButton, {}),
|
|
324
368
|
/* @__PURE__ */ jsx7(GridToolbarFilterButton, {}),
|
|
325
369
|
/* @__PURE__ */ jsx7(GridToolbarExport, {})
|
|
@@ -45,7 +45,6 @@ var Component = function DatePickerElement(props) {
|
|
|
45
45
|
} = useController({
|
|
46
46
|
name,
|
|
47
47
|
control,
|
|
48
|
-
disabled,
|
|
49
48
|
defaultValue: null
|
|
50
49
|
});
|
|
51
50
|
const { value, onChange } = useTransform({
|
|
@@ -65,6 +64,7 @@ var Component = function DatePickerElement(props) {
|
|
|
65
64
|
...field,
|
|
66
65
|
value,
|
|
67
66
|
label,
|
|
67
|
+
disabled,
|
|
68
68
|
...datePickerProps,
|
|
69
69
|
inputRef: handleInputRef,
|
|
70
70
|
onClose: (...args) => {
|
|
@@ -361,7 +361,8 @@ var RadioButtonGroup_default = RadioButtonGroup2;
|
|
|
361
361
|
import {
|
|
362
362
|
Grid2 as Grid24,
|
|
363
363
|
TextField as TextField2,
|
|
364
|
-
useForkRef as useForkRef3
|
|
364
|
+
useForkRef as useForkRef3,
|
|
365
|
+
useTheme as useTheme2
|
|
365
366
|
} from "@mui/material";
|
|
366
367
|
import {
|
|
367
368
|
useController as useController4
|
|
@@ -397,9 +398,9 @@ var Component4 = function TextFieldElement(props) {
|
|
|
397
398
|
fieldState: { error }
|
|
398
399
|
} = useController4({
|
|
399
400
|
name,
|
|
400
|
-
control
|
|
401
|
-
disabled
|
|
401
|
+
control
|
|
402
402
|
});
|
|
403
|
+
const theme = useTheme2();
|
|
403
404
|
const { value, onChange } = useTransform({
|
|
404
405
|
value: field.value,
|
|
405
406
|
onChange: field.onChange,
|
|
@@ -458,7 +459,8 @@ var Component4 = function TextFieldElement(props) {
|
|
|
458
459
|
"& .MuiInputLabel-asterisk": { color: "red" },
|
|
459
460
|
"& .MuiInputBase-input": {
|
|
460
461
|
cursor: disabled ? "not-allowed" : "default"
|
|
461
|
-
}
|
|
462
|
+
},
|
|
463
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
462
464
|
}
|
|
463
465
|
}
|
|
464
466
|
);
|
|
@@ -602,8 +604,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
602
604
|
fieldState: { error }
|
|
603
605
|
} = useController6({
|
|
604
606
|
name,
|
|
605
|
-
control
|
|
606
|
-
disabled
|
|
607
|
+
control
|
|
607
608
|
});
|
|
608
609
|
const [loading, setLoading] = useState2(false);
|
|
609
610
|
const [selectedOption, setSelectedOption] = useState2(null);
|
|
@@ -819,8 +820,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
819
820
|
fieldState: { error }
|
|
820
821
|
} = useController7({
|
|
821
822
|
name,
|
|
822
|
-
control
|
|
823
|
-
disabled
|
|
823
|
+
control
|
|
824
824
|
});
|
|
825
825
|
const multiSelectRef = useRef2(null);
|
|
826
826
|
const [selectedOptions, setSelectedOptions] = useState3([]);
|
|
@@ -921,6 +921,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
921
921
|
isOptionEqualToValue: (option, val) => option.Value === val.Value,
|
|
922
922
|
options,
|
|
923
923
|
value: selectedOptions,
|
|
924
|
+
disabled,
|
|
924
925
|
filterSelectedOptions: true,
|
|
925
926
|
onChange: handleChange,
|
|
926
927
|
onInputChange: (_2, newInputValue) => {
|
|
@@ -987,11 +988,13 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
987
988
|
import {
|
|
988
989
|
Autocomplete as Autocomplete3,
|
|
989
990
|
Grid2 as Grid28,
|
|
990
|
-
TextField as TextField5
|
|
991
|
+
TextField as TextField5,
|
|
992
|
+
useTheme as useTheme3
|
|
991
993
|
} from "@mui/material";
|
|
992
994
|
import {
|
|
993
995
|
useController as useController8
|
|
994
996
|
} from "react-hook-form";
|
|
997
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
995
998
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
996
999
|
var Component8 = function SelectElement(props) {
|
|
997
1000
|
const {
|
|
@@ -1016,16 +1019,21 @@ var Component8 = function SelectElement(props) {
|
|
|
1016
1019
|
name,
|
|
1017
1020
|
control
|
|
1018
1021
|
});
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
+
const theme = useTheme3();
|
|
1023
|
+
const [hasAutoSelected, setHasAutoSelected] = useState4(false);
|
|
1024
|
+
useEffect4(() => {
|
|
1025
|
+
if (options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1026
|
+
field.onChange(options[0].Value);
|
|
1027
|
+
setHasAutoSelected(true);
|
|
1028
|
+
}
|
|
1029
|
+
}, [options, field.value, field.onChange, hasAutoSelected]);
|
|
1022
1030
|
return /* @__PURE__ */ jsx8(
|
|
1023
1031
|
Autocomplete3,
|
|
1024
1032
|
{
|
|
1025
1033
|
...rest,
|
|
1026
1034
|
value: field.value !== null ? options.find((option) => {
|
|
1027
1035
|
return field.value === option.Value;
|
|
1028
|
-
}) ?? null :
|
|
1036
|
+
}) ?? null : null,
|
|
1029
1037
|
loading,
|
|
1030
1038
|
options,
|
|
1031
1039
|
getOptionLabel: (c) => c.Label,
|
|
@@ -1033,10 +1041,14 @@ var Component8 = function SelectElement(props) {
|
|
|
1033
1041
|
ref: field.ref,
|
|
1034
1042
|
disabled,
|
|
1035
1043
|
onChange: (event, newValue, reason) => {
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1044
|
+
if (reason === "clear") {
|
|
1045
|
+
field.onChange(null);
|
|
1046
|
+
setHasAutoSelected(true);
|
|
1047
|
+
} else {
|
|
1048
|
+
field.onChange(newValue?.Value ?? null);
|
|
1049
|
+
setHasAutoSelected(true);
|
|
1039
1050
|
}
|
|
1051
|
+
onChange?.(event, newValue, reason);
|
|
1040
1052
|
},
|
|
1041
1053
|
onBlur: (event) => {
|
|
1042
1054
|
field.onBlur();
|
|
@@ -1059,7 +1071,8 @@ var Component8 = function SelectElement(props) {
|
|
|
1059
1071
|
...sx,
|
|
1060
1072
|
"& .MuiInputBase-input": {
|
|
1061
1073
|
cursor: disabled ? "not-allowed" : "default"
|
|
1062
|
-
}
|
|
1074
|
+
},
|
|
1075
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
1063
1076
|
}
|
|
1064
1077
|
}
|
|
1065
1078
|
)
|
|
@@ -1088,7 +1101,7 @@ import {
|
|
|
1088
1101
|
import {
|
|
1089
1102
|
useController as useController9
|
|
1090
1103
|
} from "react-hook-form";
|
|
1091
|
-
import { Fragment as Fragment3, useState as
|
|
1104
|
+
import { Fragment as Fragment3, useState as useState5 } from "react";
|
|
1092
1105
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1093
1106
|
var Component9 = function SelectMultiElement(props) {
|
|
1094
1107
|
const {
|
|
@@ -1109,10 +1122,9 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1109
1122
|
fieldState: { error }
|
|
1110
1123
|
} = useController9({
|
|
1111
1124
|
name,
|
|
1112
|
-
control
|
|
1113
|
-
disabled
|
|
1125
|
+
control
|
|
1114
1126
|
});
|
|
1115
|
-
const [selectedOptions, setSelectedOptions] =
|
|
1127
|
+
const [selectedOptions, setSelectedOptions] = useState5([]);
|
|
1116
1128
|
const handleChange = (_2, selectedOptions2, reason) => {
|
|
1117
1129
|
if (reason === "clear") {
|
|
1118
1130
|
setSelectedOptions([]);
|
|
@@ -1186,7 +1198,7 @@ import {
|
|
|
1186
1198
|
Grid2 as Grid210,
|
|
1187
1199
|
TextField as TextField7
|
|
1188
1200
|
} from "@mui/material";
|
|
1189
|
-
import { useEffect as
|
|
1201
|
+
import { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1190
1202
|
import {
|
|
1191
1203
|
useController as useController10
|
|
1192
1204
|
} from "react-hook-form";
|
|
@@ -1221,12 +1233,12 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1221
1233
|
control
|
|
1222
1234
|
});
|
|
1223
1235
|
const parentValueRef = useRef3(dependentField.value ?? null);
|
|
1224
|
-
|
|
1236
|
+
useEffect5(() => {
|
|
1225
1237
|
if (!!dependentField.value && parentValueRef?.current?.Value !== dependentField.value || dependentField.value === null) {
|
|
1226
1238
|
field.onChange(null);
|
|
1227
1239
|
}
|
|
1228
1240
|
}, [dependentField.value]);
|
|
1229
|
-
|
|
1241
|
+
useEffect5(() => {
|
|
1230
1242
|
if (initialValue) {
|
|
1231
1243
|
field.onChange(initialValue);
|
|
1232
1244
|
}
|
|
@@ -1367,7 +1379,7 @@ import {
|
|
|
1367
1379
|
FormHelperText as FormHelperText3,
|
|
1368
1380
|
Grid2 as Grid212
|
|
1369
1381
|
} from "@mui/material";
|
|
1370
|
-
import { useEffect as
|
|
1382
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1371
1383
|
import {
|
|
1372
1384
|
useController as useController12
|
|
1373
1385
|
} from "react-hook-form";
|
|
@@ -1382,10 +1394,10 @@ var Component12 = function CheckboxGroup(props) {
|
|
|
1382
1394
|
control,
|
|
1383
1395
|
disabled: rest.disabled
|
|
1384
1396
|
});
|
|
1385
|
-
const [selectedValues, setSelectedValues] =
|
|
1397
|
+
const [selectedValues, setSelectedValues] = useState6(
|
|
1386
1398
|
options.filter((c) => field.value?.includes(c.Value)).map((c) => c.Value) || []
|
|
1387
1399
|
);
|
|
1388
|
-
|
|
1400
|
+
useEffect6(() => {
|
|
1389
1401
|
field.onChange(selectedValues ? [...selectedValues] : []);
|
|
1390
1402
|
}, [selectedValues]);
|
|
1391
1403
|
const handleChange = (event) => {
|
|
@@ -40,7 +40,6 @@ var Component = function DatePickerElement(props) {
|
|
|
40
40
|
} = _reacthookform.useController.call(void 0, {
|
|
41
41
|
name,
|
|
42
42
|
control,
|
|
43
|
-
disabled,
|
|
44
43
|
defaultValue: null
|
|
45
44
|
});
|
|
46
45
|
const { value, onChange } = _chunk6JZ35VQJjs.useTransform.call(void 0, {
|
|
@@ -60,6 +59,7 @@ var Component = function DatePickerElement(props) {
|
|
|
60
59
|
...field,
|
|
61
60
|
value,
|
|
62
61
|
label,
|
|
62
|
+
disabled,
|
|
63
63
|
...datePickerProps,
|
|
64
64
|
inputRef: handleInputRef,
|
|
65
65
|
onClose: (...args) => {
|
|
@@ -394,8 +394,7 @@ var Component4 = function TextFieldElement(props) {
|
|
|
394
394
|
fieldState: { error }
|
|
395
395
|
} = _reacthookform.useController.call(void 0, {
|
|
396
396
|
name,
|
|
397
|
-
control
|
|
398
|
-
disabled
|
|
397
|
+
control
|
|
399
398
|
});
|
|
400
399
|
const { value, onChange } = _chunk6JZ35VQJjs.useTransform.call(void 0, {
|
|
401
400
|
value: field.value,
|
|
@@ -594,8 +593,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
594
593
|
fieldState: { error }
|
|
595
594
|
} = _reacthookform.useController.call(void 0, {
|
|
596
595
|
name,
|
|
597
|
-
control
|
|
598
|
-
disabled
|
|
596
|
+
control
|
|
599
597
|
});
|
|
600
598
|
const [loading, setLoading] = _react.useState.call(void 0, false);
|
|
601
599
|
const [selectedOption, setSelectedOption] = _react.useState.call(void 0, null);
|
|
@@ -795,8 +793,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
795
793
|
fieldState: { error }
|
|
796
794
|
} = _reacthookform.useController.call(void 0, {
|
|
797
795
|
name,
|
|
798
|
-
control
|
|
799
|
-
disabled
|
|
796
|
+
control
|
|
800
797
|
});
|
|
801
798
|
const multiSelectRef = _react.useRef.call(void 0, null);
|
|
802
799
|
const [selectedOptions, setSelectedOptions] = _react.useState.call(void 0, []);
|
|
@@ -968,6 +965,7 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
968
965
|
|
|
969
966
|
|
|
970
967
|
|
|
968
|
+
|
|
971
969
|
var Component8 = function SelectElement(props) {
|
|
972
970
|
const {
|
|
973
971
|
name,
|
|
@@ -987,19 +985,22 @@ var Component8 = function SelectElement(props) {
|
|
|
987
985
|
fieldState: { error }
|
|
988
986
|
} = _reacthookform.useController.call(void 0, {
|
|
989
987
|
name,
|
|
990
|
-
control
|
|
991
|
-
disabled
|
|
988
|
+
control
|
|
992
989
|
});
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
990
|
+
const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
|
|
991
|
+
_react.useEffect.call(void 0, () => {
|
|
992
|
+
if (options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
993
|
+
field.onChange(options[0].value);
|
|
994
|
+
setHasAutoSelected(true);
|
|
995
|
+
}
|
|
996
|
+
}, [options, field.value, field.onChange, hasAutoSelected]);
|
|
996
997
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
997
998
|
_material.Autocomplete,
|
|
998
999
|
{
|
|
999
1000
|
...rest,
|
|
1000
1001
|
value: field.value !== null ? _nullishCoalesce(options.find((option) => {
|
|
1001
1002
|
return field.value === option.value;
|
|
1002
|
-
}), () => ( null)) :
|
|
1003
|
+
}), () => ( null)) : null,
|
|
1003
1004
|
size: "small",
|
|
1004
1005
|
loading,
|
|
1005
1006
|
options,
|
|
@@ -1008,10 +1009,14 @@ var Component8 = function SelectElement(props) {
|
|
|
1008
1009
|
ref: field.ref,
|
|
1009
1010
|
disabled: field.disabled,
|
|
1010
1011
|
onChange: (event, newValue, reason) => {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1012
|
+
if (reason === "clear") {
|
|
1013
|
+
field.onChange(null);
|
|
1014
|
+
setHasAutoSelected(true);
|
|
1015
|
+
} else {
|
|
1016
|
+
field.onChange(_nullishCoalesce(_optionalChain([newValue, 'optionalAccess', _21 => _21.value]), () => ( null)));
|
|
1017
|
+
setHasAutoSelected(true);
|
|
1014
1018
|
}
|
|
1019
|
+
_optionalChain([onChange, 'optionalCall', _22 => _22(event, newValue, reason)]);
|
|
1015
1020
|
},
|
|
1016
1021
|
onBlur: (event) => {
|
|
1017
1022
|
field.onBlur();
|
|
@@ -1081,8 +1086,7 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1081
1086
|
fieldState: { error }
|
|
1082
1087
|
} = _reacthookform.useController.call(void 0, {
|
|
1083
1088
|
name,
|
|
1084
|
-
control
|
|
1085
|
-
disabled
|
|
1089
|
+
control
|
|
1086
1090
|
});
|
|
1087
1091
|
const [selectedOptions, setSelectedOptions] = _react.useState.call(void 0, []);
|
|
1088
1092
|
const handleChange = (_2, selectedOptions2, reason) => {
|
|
@@ -1104,7 +1108,7 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1104
1108
|
getOptionLabel: (c) => c.Label,
|
|
1105
1109
|
filterSelectedOptions: true,
|
|
1106
1110
|
ref: field.ref,
|
|
1107
|
-
disabled
|
|
1111
|
+
disabled,
|
|
1108
1112
|
onChange: handleChange,
|
|
1109
1113
|
onBlur: (event) => {
|
|
1110
1114
|
field.onBlur();
|
|
@@ -1180,17 +1184,15 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1180
1184
|
fieldState: { error }
|
|
1181
1185
|
} = _reacthookform.useController.call(void 0, {
|
|
1182
1186
|
name,
|
|
1183
|
-
control
|
|
1184
|
-
disabled
|
|
1187
|
+
control
|
|
1185
1188
|
});
|
|
1186
1189
|
const { field: dependentField } = _reacthookform.useController.call(void 0, {
|
|
1187
1190
|
name: dependsOn,
|
|
1188
|
-
control
|
|
1189
|
-
disabled
|
|
1191
|
+
control
|
|
1190
1192
|
});
|
|
1191
1193
|
const parentValueRef = _react.useRef.call(void 0, _nullishCoalesce(dependentField.value, () => ( null)));
|
|
1192
1194
|
_react.useEffect.call(void 0, () => {
|
|
1193
|
-
if (!!dependentField.value && _optionalChain([parentValueRef, 'optionalAccess',
|
|
1195
|
+
if (!!dependentField.value && _optionalChain([parentValueRef, 'optionalAccess', _23 => _23.current, 'optionalAccess', _24 => _24.value]) !== dependentField.value || dependentField.value === null) {
|
|
1194
1196
|
field.onChange(null);
|
|
1195
1197
|
}
|
|
1196
1198
|
}, [dependentField.value]);
|
|
@@ -1212,7 +1214,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1212
1214
|
getOptionLabel: (c) => c.label,
|
|
1213
1215
|
isOptionEqualToValue: (option, value) => option.value === value.value,
|
|
1214
1216
|
ref: field.ref,
|
|
1215
|
-
disabled
|
|
1217
|
+
disabled,
|
|
1216
1218
|
onChange: (event, newValue, reason) => {
|
|
1217
1219
|
field.onChange(newValue ? newValue.value : null);
|
|
1218
1220
|
if (onChange && typeof onChange === "function") {
|
|
@@ -1350,7 +1352,7 @@ var Component12 = function CheckboxGroup(props) {
|
|
|
1350
1352
|
disabled: rest.disabled
|
|
1351
1353
|
});
|
|
1352
1354
|
const [selectedValues, setSelectedValues] = _react.useState.call(void 0,
|
|
1353
|
-
options.filter((c) => _optionalChain([field, 'access',
|
|
1355
|
+
options.filter((c) => _optionalChain([field, 'access', _25 => _25.value, 'optionalAccess', _26 => _26.includes, 'call', _27 => _27(c.value)])).map((c) => c.value) || []
|
|
1354
1356
|
);
|
|
1355
1357
|
_react.useEffect.call(void 0, () => {
|
|
1356
1358
|
field.onChange(selectedValues ? [...selectedValues] : []);
|
|
@@ -6,22 +6,26 @@ import { OverrideProps } from '@mui/material/OverridableComponent';
|
|
|
6
6
|
type ClearButtonProps = {
|
|
7
7
|
isSubmitting: boolean;
|
|
8
8
|
handleClear: () => void;
|
|
9
|
+
sx?: SxProps;
|
|
9
10
|
};
|
|
10
|
-
declare const ClearButton: ({ isSubmitting, handleClear }: ClearButtonProps) => react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare const ClearButton: ({ isSubmitting, handleClear, sx }: ClearButtonProps) => react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
type FilterButtonProps = {
|
|
13
14
|
isSubmitting: boolean;
|
|
14
15
|
show?: boolean;
|
|
15
16
|
title?: string;
|
|
16
17
|
icon?: React.ReactNode;
|
|
18
|
+
sx?: SxProps;
|
|
17
19
|
};
|
|
18
|
-
declare const FilterButton: ({ isSubmitting, show, title, icon, }: FilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare const FilterButton: ({ isSubmitting, show, title, icon, sx, }: FilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
19
21
|
|
|
20
22
|
type FilterWrapperProps = PropsWithChildren<{
|
|
21
23
|
title: string;
|
|
22
24
|
cardSx?: SxProps;
|
|
25
|
+
textSx?: SxProps;
|
|
26
|
+
icon?: ReactNode;
|
|
23
27
|
}>;
|
|
24
|
-
declare const FilterWrapper: ({ children, title }: FilterWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare const FilterWrapper: ({ children, title, cardSx, textSx, icon, }: FilterWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
25
29
|
|
|
26
30
|
type FormWrapper = PropsWithChildren<{
|
|
27
31
|
title: string;
|
|
@@ -29,8 +33,9 @@ type FormWrapper = PropsWithChildren<{
|
|
|
29
33
|
icon?: ReactNode;
|
|
30
34
|
cardSx?: SxProps;
|
|
31
35
|
textSx?: SxProps;
|
|
36
|
+
actionButton?: ReactNode;
|
|
32
37
|
}>;
|
|
33
|
-
declare const FormWrapper: ({ children, title, editMode, cardSx, textSx, }: FormWrapper) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare const FormWrapper: ({ children, title, editMode, cardSx, textSx, icon, actionButton, }: FormWrapper) => react_jsx_runtime.JSX.Element;
|
|
34
39
|
|
|
35
40
|
type LabelTextProps = {
|
|
36
41
|
label: string;
|
|
@@ -52,16 +57,22 @@ type LabelTextProps = {
|
|
|
52
57
|
sm: number;
|
|
53
58
|
md: number;
|
|
54
59
|
};
|
|
60
|
+
labelSx?: SxProps;
|
|
61
|
+
valueSx?: SxProps;
|
|
55
62
|
};
|
|
56
|
-
declare const LabelText: ({ label, value, gridSize, containerSize, }: LabelTextProps) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
declare const LabelText: ({ label, value, gridSize, containerSize, labelSx, valueSx, }: LabelTextProps) => react_jsx_runtime.JSX.Element;
|
|
57
64
|
|
|
58
65
|
type ListWrapperProps = PropsWithChildren<{
|
|
59
66
|
title: string;
|
|
60
67
|
count: number;
|
|
61
68
|
show?: boolean;
|
|
62
|
-
actionButton?:
|
|
69
|
+
actionButton?: ReactNode;
|
|
70
|
+
cardSx?: SxProps;
|
|
71
|
+
textSx?: SxProps;
|
|
72
|
+
icon?: ReactNode;
|
|
73
|
+
showCount?: boolean;
|
|
63
74
|
}>;
|
|
64
|
-
declare const ListWrapper: ({ children, title, count, show, actionButton, }: ListWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
75
|
+
declare const ListWrapper: ({ children, title, count, show, actionButton, cardSx, textSx, icon, showCount, }: ListWrapperProps) => react_jsx_runtime.JSX.Element;
|
|
65
76
|
|
|
66
77
|
declare const SimpleToolbar: () => react_jsx_runtime.JSX.Element;
|
|
67
78
|
|