@gnwebsoft/ui 2.18.29 → 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-A6OSZDDG.mjs → chunk-34X2YRTY.mjs} +42 -46
- package/dist/{chunk-JP67273T.js → chunk-4E6AXVK7.js} +70 -33
- package/dist/{chunk-QA44AL2X.js → chunk-7HKMAJKT.js} +75 -24
- package/dist/{chunk-N3AI2OIO.mjs → chunk-M42TPRCN.mjs} +80 -29
- package/dist/{chunk-6Q6446Q3.mjs → chunk-MRZZQRKX.mjs} +79 -42
- package/dist/{chunk-IXBVE2GN.js → chunk-STC2BZ2L.js} +36 -40
- package/dist/components/index.d.mts +24 -9
- package/dist/components/index.d.ts +24 -9
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +5 -5
- package/dist/wrappers/index.d.mts +15 -1
- package/dist/wrappers/index.d.ts +15 -1
- package/dist/wrappers/index.js +2 -2
- package/dist/wrappers/index.mjs +1 -1
- package/dist/wrappers2/index.d.mts +4 -4
- package/dist/wrappers2/index.d.ts +4 -4
- package/dist/wrappers2/index.js +2 -2
- package/dist/wrappers2/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
useController
|
|
11
11
|
} from "react-hook-form";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
Grid2,
|
|
14
|
+
useForkRef
|
|
15
|
+
} from "@mui/material";
|
|
13
16
|
import {
|
|
14
17
|
DatePicker
|
|
15
18
|
} from "@mui/x-date-pickers";
|
|
@@ -30,6 +33,8 @@ var Component = function DatePickerElement(props) {
|
|
|
30
33
|
slotProps,
|
|
31
34
|
transform,
|
|
32
35
|
datePickerProps = {},
|
|
36
|
+
variant,
|
|
37
|
+
sx,
|
|
33
38
|
...rest
|
|
34
39
|
} = props;
|
|
35
40
|
const adapter = useLocalizationContext();
|
|
@@ -40,7 +45,6 @@ var Component = function DatePickerElement(props) {
|
|
|
40
45
|
} = useController({
|
|
41
46
|
name,
|
|
42
47
|
control,
|
|
43
|
-
disabled,
|
|
44
48
|
defaultValue: null
|
|
45
49
|
});
|
|
46
50
|
const { value, onChange } = useTransform({
|
|
@@ -60,6 +64,7 @@ var Component = function DatePickerElement(props) {
|
|
|
60
64
|
...field,
|
|
61
65
|
value,
|
|
62
66
|
label,
|
|
67
|
+
disabled,
|
|
63
68
|
...datePickerProps,
|
|
64
69
|
inputRef: handleInputRef,
|
|
65
70
|
onClose: (...args) => {
|
|
@@ -74,6 +79,7 @@ var Component = function DatePickerElement(props) {
|
|
|
74
79
|
datePickerProps.onChange(newValue, context);
|
|
75
80
|
}
|
|
76
81
|
},
|
|
82
|
+
sx,
|
|
77
83
|
slotProps: {
|
|
78
84
|
...slotProps,
|
|
79
85
|
textField: {
|
|
@@ -355,7 +361,8 @@ var RadioButtonGroup_default = RadioButtonGroup2;
|
|
|
355
361
|
import {
|
|
356
362
|
Grid2 as Grid24,
|
|
357
363
|
TextField as TextField2,
|
|
358
|
-
useForkRef as useForkRef3
|
|
364
|
+
useForkRef as useForkRef3,
|
|
365
|
+
useTheme as useTheme2
|
|
359
366
|
} from "@mui/material";
|
|
360
367
|
import {
|
|
361
368
|
useController as useController4
|
|
@@ -373,6 +380,8 @@ var Component4 = function TextFieldElement(props) {
|
|
|
373
380
|
label,
|
|
374
381
|
placeholder,
|
|
375
382
|
textFieldProps = {},
|
|
383
|
+
variant,
|
|
384
|
+
sx,
|
|
376
385
|
...rest
|
|
377
386
|
} = props;
|
|
378
387
|
const {
|
|
@@ -389,9 +398,9 @@ var Component4 = function TextFieldElement(props) {
|
|
|
389
398
|
fieldState: { error }
|
|
390
399
|
} = useController4({
|
|
391
400
|
name,
|
|
392
|
-
control
|
|
393
|
-
disabled
|
|
401
|
+
control
|
|
394
402
|
});
|
|
403
|
+
const theme = useTheme2();
|
|
395
404
|
const { value, onChange } = useTransform({
|
|
396
405
|
value: field.value,
|
|
397
406
|
onChange: field.onChange,
|
|
@@ -443,13 +452,15 @@ var Component4 = function TextFieldElement(props) {
|
|
|
443
452
|
error: !!error,
|
|
444
453
|
helperText: error ? error.message : helperText,
|
|
445
454
|
inputRef: handleInputRef,
|
|
455
|
+
variant: variant ? variant : "outlined",
|
|
446
456
|
size: "small",
|
|
447
457
|
sx: {
|
|
458
|
+
...sx,
|
|
448
459
|
"& .MuiInputLabel-asterisk": { color: "red" },
|
|
449
460
|
"& .MuiInputBase-input": {
|
|
450
461
|
cursor: disabled ? "not-allowed" : "default"
|
|
451
462
|
},
|
|
452
|
-
bgcolor: disabled ?
|
|
463
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
453
464
|
}
|
|
454
465
|
}
|
|
455
466
|
);
|
|
@@ -584,6 +595,8 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
584
595
|
initialValue,
|
|
585
596
|
label,
|
|
586
597
|
queryFn,
|
|
598
|
+
variant,
|
|
599
|
+
sx,
|
|
587
600
|
...rest
|
|
588
601
|
} = props;
|
|
589
602
|
const {
|
|
@@ -591,8 +604,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
591
604
|
fieldState: { error }
|
|
592
605
|
} = useController6({
|
|
593
606
|
name,
|
|
594
|
-
control
|
|
595
|
-
disabled
|
|
607
|
+
control
|
|
596
608
|
});
|
|
597
609
|
const [loading, setLoading] = useState2(false);
|
|
598
610
|
const [selectedOption, setSelectedOption] = useState2(null);
|
|
@@ -739,11 +751,12 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
739
751
|
] })
|
|
740
752
|
}
|
|
741
753
|
},
|
|
754
|
+
variant: variant ? variant : "outlined",
|
|
742
755
|
sx: {
|
|
756
|
+
...sx,
|
|
743
757
|
"& .MuiInputBase-input": {
|
|
744
758
|
cursor: disabled ? "not-allowed" : "default"
|
|
745
|
-
}
|
|
746
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
759
|
+
}
|
|
747
760
|
}
|
|
748
761
|
}
|
|
749
762
|
),
|
|
@@ -798,6 +811,8 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
798
811
|
initialValues,
|
|
799
812
|
label,
|
|
800
813
|
queryFn,
|
|
814
|
+
variant,
|
|
815
|
+
sx,
|
|
801
816
|
...rest
|
|
802
817
|
} = props;
|
|
803
818
|
const {
|
|
@@ -805,8 +820,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
805
820
|
fieldState: { error }
|
|
806
821
|
} = useController7({
|
|
807
822
|
name,
|
|
808
|
-
control
|
|
809
|
-
disabled
|
|
823
|
+
control
|
|
810
824
|
});
|
|
811
825
|
const multiSelectRef = useRef2(null);
|
|
812
826
|
const [selectedOptions, setSelectedOptions] = useState3([]);
|
|
@@ -907,6 +921,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
907
921
|
isOptionEqualToValue: (option, val) => option.Value === val.Value,
|
|
908
922
|
options,
|
|
909
923
|
value: selectedOptions,
|
|
924
|
+
disabled,
|
|
910
925
|
filterSelectedOptions: true,
|
|
911
926
|
onChange: handleChange,
|
|
912
927
|
onInputChange: (_2, newInputValue) => {
|
|
@@ -929,11 +944,12 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
929
944
|
] })
|
|
930
945
|
}
|
|
931
946
|
},
|
|
947
|
+
variant: variant ? variant : "outlined",
|
|
932
948
|
sx: {
|
|
949
|
+
...sx,
|
|
933
950
|
"& .MuiInputBase-input": {
|
|
934
951
|
cursor: disabled ? "not-allowed" : "default"
|
|
935
|
-
}
|
|
936
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
952
|
+
}
|
|
937
953
|
}
|
|
938
954
|
}
|
|
939
955
|
),
|
|
@@ -972,11 +988,13 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
972
988
|
import {
|
|
973
989
|
Autocomplete as Autocomplete3,
|
|
974
990
|
Grid2 as Grid28,
|
|
975
|
-
TextField as TextField5
|
|
991
|
+
TextField as TextField5,
|
|
992
|
+
useTheme as useTheme3
|
|
976
993
|
} from "@mui/material";
|
|
977
994
|
import {
|
|
978
995
|
useController as useController8
|
|
979
996
|
} from "react-hook-form";
|
|
997
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
980
998
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
981
999
|
var Component8 = function SelectElement(props) {
|
|
982
1000
|
const {
|
|
@@ -990,6 +1008,8 @@ var Component8 = function SelectElement(props) {
|
|
|
990
1008
|
loading = false,
|
|
991
1009
|
placeholder,
|
|
992
1010
|
label,
|
|
1011
|
+
variant,
|
|
1012
|
+
sx,
|
|
993
1013
|
...rest
|
|
994
1014
|
} = props;
|
|
995
1015
|
const {
|
|
@@ -997,14 +1017,21 @@ var Component8 = function SelectElement(props) {
|
|
|
997
1017
|
fieldState: { error }
|
|
998
1018
|
} = useController8({
|
|
999
1019
|
name,
|
|
1000
|
-
control
|
|
1001
|
-
disabled
|
|
1020
|
+
control
|
|
1002
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]);
|
|
1003
1030
|
return /* @__PURE__ */ jsx8(
|
|
1004
1031
|
Autocomplete3,
|
|
1005
1032
|
{
|
|
1006
1033
|
...rest,
|
|
1007
|
-
value: field.value ? options.find((option) => {
|
|
1034
|
+
value: field.value !== null ? options.find((option) => {
|
|
1008
1035
|
return field.value === option.Value;
|
|
1009
1036
|
}) ?? null : null,
|
|
1010
1037
|
loading,
|
|
@@ -1012,12 +1039,16 @@ var Component8 = function SelectElement(props) {
|
|
|
1012
1039
|
getOptionLabel: (c) => c.Label,
|
|
1013
1040
|
isOptionEqualToValue: (option, Value) => option.Value === Value.Value,
|
|
1014
1041
|
ref: field.ref,
|
|
1015
|
-
disabled
|
|
1042
|
+
disabled,
|
|
1016
1043
|
onChange: (event, newValue, reason) => {
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1044
|
+
if (reason === "clear") {
|
|
1045
|
+
field.onChange(null);
|
|
1046
|
+
setHasAutoSelected(true);
|
|
1047
|
+
} else {
|
|
1048
|
+
field.onChange(newValue?.Value ?? null);
|
|
1049
|
+
setHasAutoSelected(true);
|
|
1020
1050
|
}
|
|
1051
|
+
onChange?.(event, newValue, reason);
|
|
1021
1052
|
},
|
|
1022
1053
|
onBlur: (event) => {
|
|
1023
1054
|
field.onBlur();
|
|
@@ -1035,12 +1066,13 @@ var Component8 = function SelectElement(props) {
|
|
|
1035
1066
|
helperText: error ? error.message : "",
|
|
1036
1067
|
placeholder,
|
|
1037
1068
|
label,
|
|
1038
|
-
variant: "outlined",
|
|
1069
|
+
variant: variant ? variant : "outlined",
|
|
1039
1070
|
sx: {
|
|
1071
|
+
...sx,
|
|
1040
1072
|
"& .MuiInputBase-input": {
|
|
1041
1073
|
cursor: disabled ? "not-allowed" : "default"
|
|
1042
1074
|
},
|
|
1043
|
-
bgcolor: disabled ?
|
|
1075
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
1044
1076
|
}
|
|
1045
1077
|
}
|
|
1046
1078
|
)
|
|
@@ -1069,7 +1101,7 @@ import {
|
|
|
1069
1101
|
import {
|
|
1070
1102
|
useController as useController9
|
|
1071
1103
|
} from "react-hook-form";
|
|
1072
|
-
import { Fragment as Fragment3, useState as
|
|
1104
|
+
import { Fragment as Fragment3, useState as useState5 } from "react";
|
|
1073
1105
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1074
1106
|
var Component9 = function SelectMultiElement(props) {
|
|
1075
1107
|
const {
|
|
@@ -1081,6 +1113,8 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1081
1113
|
loading = false,
|
|
1082
1114
|
placeholder,
|
|
1083
1115
|
label,
|
|
1116
|
+
variant,
|
|
1117
|
+
sx,
|
|
1084
1118
|
...rest
|
|
1085
1119
|
} = props;
|
|
1086
1120
|
const {
|
|
@@ -1088,10 +1122,9 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1088
1122
|
fieldState: { error }
|
|
1089
1123
|
} = useController9({
|
|
1090
1124
|
name,
|
|
1091
|
-
control
|
|
1092
|
-
disabled
|
|
1125
|
+
control
|
|
1093
1126
|
});
|
|
1094
|
-
const [selectedOptions, setSelectedOptions] =
|
|
1127
|
+
const [selectedOptions, setSelectedOptions] = useState5([]);
|
|
1095
1128
|
const handleChange = (_2, selectedOptions2, reason) => {
|
|
1096
1129
|
if (reason === "clear") {
|
|
1097
1130
|
setSelectedOptions([]);
|
|
@@ -1136,6 +1169,10 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1136
1169
|
params.InputProps.endAdornment
|
|
1137
1170
|
] })
|
|
1138
1171
|
}
|
|
1172
|
+
},
|
|
1173
|
+
variant: variant ? variant : "outlined",
|
|
1174
|
+
sx: {
|
|
1175
|
+
...sx
|
|
1139
1176
|
}
|
|
1140
1177
|
}
|
|
1141
1178
|
),
|
|
@@ -1161,7 +1198,7 @@ import {
|
|
|
1161
1198
|
Grid2 as Grid210,
|
|
1162
1199
|
TextField as TextField7
|
|
1163
1200
|
} from "@mui/material";
|
|
1164
|
-
import { useEffect as
|
|
1201
|
+
import { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1165
1202
|
import {
|
|
1166
1203
|
useController as useController10
|
|
1167
1204
|
} from "react-hook-form";
|
|
@@ -1180,6 +1217,8 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1180
1217
|
label,
|
|
1181
1218
|
dependsOn,
|
|
1182
1219
|
initialValue,
|
|
1220
|
+
variant,
|
|
1221
|
+
sx,
|
|
1183
1222
|
...rest
|
|
1184
1223
|
} = props;
|
|
1185
1224
|
const {
|
|
@@ -1187,21 +1226,19 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1187
1226
|
fieldState: { error }
|
|
1188
1227
|
} = useController10({
|
|
1189
1228
|
name,
|
|
1190
|
-
control
|
|
1191
|
-
disabled
|
|
1229
|
+
control
|
|
1192
1230
|
});
|
|
1193
1231
|
const { field: dependentField } = useController10({
|
|
1194
1232
|
name: dependsOn,
|
|
1195
|
-
control
|
|
1196
|
-
disabled
|
|
1233
|
+
control
|
|
1197
1234
|
});
|
|
1198
1235
|
const parentValueRef = useRef3(dependentField.value ?? null);
|
|
1199
|
-
|
|
1236
|
+
useEffect5(() => {
|
|
1200
1237
|
if (!!dependentField.value && parentValueRef?.current?.Value !== dependentField.value || dependentField.value === null) {
|
|
1201
1238
|
field.onChange(null);
|
|
1202
1239
|
}
|
|
1203
1240
|
}, [dependentField.value]);
|
|
1204
|
-
|
|
1241
|
+
useEffect5(() => {
|
|
1205
1242
|
if (initialValue) {
|
|
1206
1243
|
field.onChange(initialValue);
|
|
1207
1244
|
}
|
|
@@ -1219,7 +1256,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1219
1256
|
getOptionLabel: (c) => c.Label,
|
|
1220
1257
|
isOptionEqualToValue: (option, value) => option.Value === value.Value,
|
|
1221
1258
|
ref: field.ref,
|
|
1222
|
-
disabled
|
|
1259
|
+
disabled,
|
|
1223
1260
|
onChange: (event, newValue, reason) => {
|
|
1224
1261
|
field.onChange(newValue ? newValue.Value : null);
|
|
1225
1262
|
if (onChange && typeof onChange === "function") {
|
|
@@ -1242,12 +1279,12 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1242
1279
|
helperText: error ? error.message : "",
|
|
1243
1280
|
placeholder,
|
|
1244
1281
|
label,
|
|
1245
|
-
variant: "outlined",
|
|
1282
|
+
variant: variant ? variant : "outlined",
|
|
1246
1283
|
sx: {
|
|
1284
|
+
...sx,
|
|
1247
1285
|
"& .MuiInputBase-input": {
|
|
1248
1286
|
cursor: disabled ? "not-allowed" : "default"
|
|
1249
|
-
}
|
|
1250
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
1287
|
+
}
|
|
1251
1288
|
}
|
|
1252
1289
|
}
|
|
1253
1290
|
)
|
|
@@ -1342,7 +1379,7 @@ import {
|
|
|
1342
1379
|
FormHelperText as FormHelperText3,
|
|
1343
1380
|
Grid2 as Grid212
|
|
1344
1381
|
} from "@mui/material";
|
|
1345
|
-
import { useEffect as
|
|
1382
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1346
1383
|
import {
|
|
1347
1384
|
useController as useController12
|
|
1348
1385
|
} from "react-hook-form";
|
|
@@ -1357,10 +1394,10 @@ var Component12 = function CheckboxGroup(props) {
|
|
|
1357
1394
|
control,
|
|
1358
1395
|
disabled: rest.disabled
|
|
1359
1396
|
});
|
|
1360
|
-
const [selectedValues, setSelectedValues] =
|
|
1397
|
+
const [selectedValues, setSelectedValues] = useState6(
|
|
1361
1398
|
options.filter((c) => field.value?.includes(c.Value)).map((c) => c.Value) || []
|
|
1362
1399
|
);
|
|
1363
|
-
|
|
1400
|
+
useEffect6(() => {
|
|
1364
1401
|
field.onChange(selectedValues ? [...selectedValues] : []);
|
|
1365
1402
|
}, [selectedValues]);
|
|
1366
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) => {
|
|
@@ -77,8 +77,7 @@ var Component = function DatePickerElement(props) {
|
|
|
77
77
|
sx: {
|
|
78
78
|
"& .MuiInputBase-input": {
|
|
79
79
|
cursor: disabled ? "not-allowed" : "default"
|
|
80
|
-
}
|
|
81
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
80
|
+
}
|
|
82
81
|
},
|
|
83
82
|
slotProps: {
|
|
84
83
|
...slotProps,
|
|
@@ -395,8 +394,7 @@ var Component4 = function TextFieldElement(props) {
|
|
|
395
394
|
fieldState: { error }
|
|
396
395
|
} = _reacthookform.useController.call(void 0, {
|
|
397
396
|
name,
|
|
398
|
-
control
|
|
399
|
-
disabled
|
|
397
|
+
control
|
|
400
398
|
});
|
|
401
399
|
const { value, onChange } = _chunk6JZ35VQJjs.useTransform.call(void 0, {
|
|
402
400
|
value: field.value,
|
|
@@ -453,8 +451,7 @@ var Component4 = function TextFieldElement(props) {
|
|
|
453
451
|
sx: {
|
|
454
452
|
"& .MuiInputBase-input": {
|
|
455
453
|
cursor: disabled ? "not-allowed" : "default"
|
|
456
|
-
}
|
|
457
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
454
|
+
}
|
|
458
455
|
}
|
|
459
456
|
}
|
|
460
457
|
);
|
|
@@ -596,8 +593,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
596
593
|
fieldState: { error }
|
|
597
594
|
} = _reacthookform.useController.call(void 0, {
|
|
598
595
|
name,
|
|
599
|
-
control
|
|
600
|
-
disabled
|
|
596
|
+
control
|
|
601
597
|
});
|
|
602
598
|
const [loading, setLoading] = _react.useState.call(void 0, false);
|
|
603
599
|
const [selectedOption, setSelectedOption] = _react.useState.call(void 0, null);
|
|
@@ -702,7 +698,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
702
698
|
ref: selectRef,
|
|
703
699
|
fullWidth: true,
|
|
704
700
|
loading,
|
|
705
|
-
getOptionLabel: (option) => option.
|
|
701
|
+
getOptionLabel: (option) => option.label,
|
|
706
702
|
getOptionKey: (option) => option.value,
|
|
707
703
|
isOptionEqualToValue: (option, val) => option.value === val.value,
|
|
708
704
|
autoComplete: true,
|
|
@@ -735,14 +731,13 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
735
731
|
sx: {
|
|
736
732
|
"& .MuiInputBase-input": {
|
|
737
733
|
cursor: disabled ? "not-allowed" : "default"
|
|
738
|
-
}
|
|
739
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
734
|
+
}
|
|
740
735
|
}
|
|
741
736
|
}
|
|
742
737
|
),
|
|
743
738
|
renderOption: (props2, option) => {
|
|
744
739
|
const { key, ...optionProps } = props2;
|
|
745
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { ...optionProps, children: option.
|
|
740
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { ...optionProps, children: option.label }, key);
|
|
746
741
|
}
|
|
747
742
|
}
|
|
748
743
|
);
|
|
@@ -798,8 +793,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
798
793
|
fieldState: { error }
|
|
799
794
|
} = _reacthookform.useController.call(void 0, {
|
|
800
795
|
name,
|
|
801
|
-
control
|
|
802
|
-
disabled
|
|
796
|
+
control
|
|
803
797
|
});
|
|
804
798
|
const multiSelectRef = _react.useRef.call(void 0, null);
|
|
805
799
|
const [selectedOptions, setSelectedOptions] = _react.useState.call(void 0, []);
|
|
@@ -926,8 +920,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
926
920
|
sx: {
|
|
927
921
|
"& .MuiInputBase-input": {
|
|
928
922
|
cursor: disabled ? "not-allowed" : "default"
|
|
929
|
-
}
|
|
930
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
923
|
+
}
|
|
931
924
|
}
|
|
932
925
|
}
|
|
933
926
|
),
|
|
@@ -972,6 +965,7 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
972
965
|
|
|
973
966
|
|
|
974
967
|
|
|
968
|
+
|
|
975
969
|
var Component8 = function SelectElement(props) {
|
|
976
970
|
const {
|
|
977
971
|
name,
|
|
@@ -991,19 +985,22 @@ var Component8 = function SelectElement(props) {
|
|
|
991
985
|
fieldState: { error }
|
|
992
986
|
} = _reacthookform.useController.call(void 0, {
|
|
993
987
|
name,
|
|
994
|
-
control
|
|
995
|
-
disabled
|
|
988
|
+
control
|
|
996
989
|
});
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
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]);
|
|
1000
997
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1001
998
|
_material.Autocomplete,
|
|
1002
999
|
{
|
|
1003
1000
|
...rest,
|
|
1004
1001
|
value: field.value !== null ? _nullishCoalesce(options.find((option) => {
|
|
1005
1002
|
return field.value === option.value;
|
|
1006
|
-
}), () => ( null)) :
|
|
1003
|
+
}), () => ( null)) : null,
|
|
1007
1004
|
size: "small",
|
|
1008
1005
|
loading,
|
|
1009
1006
|
options,
|
|
@@ -1012,10 +1009,14 @@ var Component8 = function SelectElement(props) {
|
|
|
1012
1009
|
ref: field.ref,
|
|
1013
1010
|
disabled: field.disabled,
|
|
1014
1011
|
onChange: (event, newValue, reason) => {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
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);
|
|
1018
1018
|
}
|
|
1019
|
+
_optionalChain([onChange, 'optionalCall', _22 => _22(event, newValue, reason)]);
|
|
1019
1020
|
},
|
|
1020
1021
|
onBlur: (event) => {
|
|
1021
1022
|
field.onBlur();
|
|
@@ -1037,8 +1038,7 @@ var Component8 = function SelectElement(props) {
|
|
|
1037
1038
|
sx: {
|
|
1038
1039
|
"& .MuiInputBase-input": {
|
|
1039
1040
|
cursor: disabled ? "not-allowed" : "default"
|
|
1040
|
-
}
|
|
1041
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
1041
|
+
}
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
)
|
|
@@ -1086,8 +1086,7 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1086
1086
|
fieldState: { error }
|
|
1087
1087
|
} = _reacthookform.useController.call(void 0, {
|
|
1088
1088
|
name,
|
|
1089
|
-
control
|
|
1090
|
-
disabled
|
|
1089
|
+
control
|
|
1091
1090
|
});
|
|
1092
1091
|
const [selectedOptions, setSelectedOptions] = _react.useState.call(void 0, []);
|
|
1093
1092
|
const handleChange = (_2, selectedOptions2, reason) => {
|
|
@@ -1109,7 +1108,7 @@ var Component9 = function SelectMultiElement(props) {
|
|
|
1109
1108
|
getOptionLabel: (c) => c.Label,
|
|
1110
1109
|
filterSelectedOptions: true,
|
|
1111
1110
|
ref: field.ref,
|
|
1112
|
-
disabled
|
|
1111
|
+
disabled,
|
|
1113
1112
|
onChange: handleChange,
|
|
1114
1113
|
onBlur: (event) => {
|
|
1115
1114
|
field.onBlur();
|
|
@@ -1185,17 +1184,15 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1185
1184
|
fieldState: { error }
|
|
1186
1185
|
} = _reacthookform.useController.call(void 0, {
|
|
1187
1186
|
name,
|
|
1188
|
-
control
|
|
1189
|
-
disabled
|
|
1187
|
+
control
|
|
1190
1188
|
});
|
|
1191
1189
|
const { field: dependentField } = _reacthookform.useController.call(void 0, {
|
|
1192
1190
|
name: dependsOn,
|
|
1193
|
-
control
|
|
1194
|
-
disabled
|
|
1191
|
+
control
|
|
1195
1192
|
});
|
|
1196
1193
|
const parentValueRef = _react.useRef.call(void 0, _nullishCoalesce(dependentField.value, () => ( null)));
|
|
1197
1194
|
_react.useEffect.call(void 0, () => {
|
|
1198
|
-
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) {
|
|
1199
1196
|
field.onChange(null);
|
|
1200
1197
|
}
|
|
1201
1198
|
}, [dependentField.value]);
|
|
@@ -1217,7 +1214,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1217
1214
|
getOptionLabel: (c) => c.label,
|
|
1218
1215
|
isOptionEqualToValue: (option, value) => option.value === value.value,
|
|
1219
1216
|
ref: field.ref,
|
|
1220
|
-
disabled
|
|
1217
|
+
disabled,
|
|
1221
1218
|
onChange: (event, newValue, reason) => {
|
|
1222
1219
|
field.onChange(newValue ? newValue.value : null);
|
|
1223
1220
|
if (onChange && typeof onChange === "function") {
|
|
@@ -1244,8 +1241,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1244
1241
|
sx: {
|
|
1245
1242
|
"& .MuiInputBase-input": {
|
|
1246
1243
|
cursor: disabled ? "not-allowed" : "default"
|
|
1247
|
-
}
|
|
1248
|
-
bgcolor: disabled ? "#EEF1F5" : "transparent"
|
|
1244
|
+
}
|
|
1249
1245
|
}
|
|
1250
1246
|
}
|
|
1251
1247
|
)
|
|
@@ -1356,7 +1352,7 @@ var Component12 = function CheckboxGroup(props) {
|
|
|
1356
1352
|
disabled: rest.disabled
|
|
1357
1353
|
});
|
|
1358
1354
|
const [selectedValues, setSelectedValues] = _react.useState.call(void 0,
|
|
1359
|
-
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) || []
|
|
1360
1356
|
);
|
|
1361
1357
|
_react.useEffect.call(void 0, () => {
|
|
1362
1358
|
field.onChange(selectedValues ? [...selectedValues] : []);
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SxProps, ButtonTypeMap } from '@mui/material';
|
|
3
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
4
4
|
import { OverrideProps } from '@mui/material/OverridableComponent';
|
|
5
5
|
|
|
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;
|
|
24
|
+
cardSx?: SxProps;
|
|
25
|
+
textSx?: SxProps;
|
|
26
|
+
icon?: ReactNode;
|
|
22
27
|
}>;
|
|
23
|
-
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;
|
|
24
29
|
|
|
25
30
|
type FormWrapper = PropsWithChildren<{
|
|
26
31
|
title: string;
|
|
27
32
|
editMode: boolean;
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
cardSx?: SxProps;
|
|
35
|
+
textSx?: SxProps;
|
|
36
|
+
actionButton?: ReactNode;
|
|
28
37
|
}>;
|
|
29
|
-
declare const FormWrapper: ({ children, title, editMode }: FormWrapper) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare const FormWrapper: ({ children, title, editMode, cardSx, textSx, icon, actionButton, }: FormWrapper) => react_jsx_runtime.JSX.Element;
|
|
30
39
|
|
|
31
40
|
type LabelTextProps = {
|
|
32
41
|
label: string;
|
|
@@ -48,16 +57,22 @@ type LabelTextProps = {
|
|
|
48
57
|
sm: number;
|
|
49
58
|
md: number;
|
|
50
59
|
};
|
|
60
|
+
labelSx?: SxProps;
|
|
61
|
+
valueSx?: SxProps;
|
|
51
62
|
};
|
|
52
|
-
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;
|
|
53
64
|
|
|
54
65
|
type ListWrapperProps = PropsWithChildren<{
|
|
55
66
|
title: string;
|
|
56
67
|
count: number;
|
|
57
68
|
show?: boolean;
|
|
58
|
-
actionButton?:
|
|
69
|
+
actionButton?: ReactNode;
|
|
70
|
+
cardSx?: SxProps;
|
|
71
|
+
textSx?: SxProps;
|
|
72
|
+
icon?: ReactNode;
|
|
73
|
+
showCount?: boolean;
|
|
59
74
|
}>;
|
|
60
|
-
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;
|
|
61
76
|
|
|
62
77
|
declare const SimpleToolbar: () => react_jsx_runtime.JSX.Element;
|
|
63
78
|
|