@gnwebsoft/ui 2.18.33 → 2.18.35
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/AsyncSelectPayload-CiwoX8EE.d.mts +10 -0
- package/dist/AsyncSelectPayload-CiwoX8EE.d.ts +10 -0
- package/dist/OptionItem-BSg3KSRJ.d.mts +14 -0
- package/dist/OptionItem-BSg3KSRJ.d.ts +14 -0
- package/dist/{chunk-4E6AXVK7.js → chunk-F5QWH3Y5.js} +66 -71
- package/dist/{chunk-MRZZQRKX.mjs → chunk-TMGF3IR4.mjs} +72 -77
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/wrappers/index.d.mts +8 -41
- package/dist/wrappers/index.d.ts +8 -41
- package/dist/wrappers/index.js +2 -2
- package/dist/wrappers/index.mjs +1 -1
- package/dist/wrappers2/index.d.mts +2 -1
- package/dist/wrappers2/index.d.ts +2 -1
- package/package.json +9 -13
- package/dist/OptionItem-CzX7oHfv.d.mts +0 -23
- package/dist/OptionItem-CzX7oHfv.d.ts +0 -23
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type AsyncSelectPayload = {
|
|
2
|
+
query: string | null;
|
|
3
|
+
initialValue?: number | null;
|
|
4
|
+
};
|
|
5
|
+
type AsyncSelectMultiPayload = {
|
|
6
|
+
query: string | null;
|
|
7
|
+
initialValues?: number[] | null;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type { AsyncSelectPayload as A, AsyncSelectMultiPayload as a };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type AsyncSelectPayload = {
|
|
2
|
+
query: string | null;
|
|
3
|
+
initialValue?: number | null;
|
|
4
|
+
};
|
|
5
|
+
type AsyncSelectMultiPayload = {
|
|
6
|
+
query: string | null;
|
|
7
|
+
initialValues?: number[] | null;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type { AsyncSelectPayload as A, AsyncSelectMultiPayload as a };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type OptionItem = {
|
|
2
|
+
Label: string;
|
|
3
|
+
Value: string;
|
|
4
|
+
};
|
|
5
|
+
type AsyncMultiSelectPayload = {
|
|
6
|
+
query: string | null;
|
|
7
|
+
initialValues?: number[] | null;
|
|
8
|
+
};
|
|
9
|
+
type OptionItem2 = {
|
|
10
|
+
Label: string;
|
|
11
|
+
Value: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type { AsyncMultiSelectPayload as A, OptionItem as O, OptionItem2 as a };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type OptionItem = {
|
|
2
|
+
Label: string;
|
|
3
|
+
Value: string;
|
|
4
|
+
};
|
|
5
|
+
type AsyncMultiSelectPayload = {
|
|
6
|
+
query: string | null;
|
|
7
|
+
initialValues?: number[] | null;
|
|
8
|
+
};
|
|
9
|
+
type OptionItem2 = {
|
|
10
|
+
Label: string;
|
|
11
|
+
Value: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type { AsyncMultiSelectPayload as A, OptionItem as O, OptionItem2 as a };
|
|
@@ -455,12 +455,12 @@ var Component4 = function TextFieldElement(props) {
|
|
|
455
455
|
variant: variant ? variant : "outlined",
|
|
456
456
|
size: "small",
|
|
457
457
|
sx: {
|
|
458
|
-
...sx,
|
|
459
458
|
"& .MuiInputLabel-asterisk": { color: "red" },
|
|
460
459
|
"& .MuiInputBase-input": {
|
|
461
460
|
cursor: disabled ? "not-allowed" : "default"
|
|
462
461
|
},
|
|
463
|
-
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
462
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
463
|
+
...sx
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
);
|
|
@@ -606,6 +606,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
606
606
|
name,
|
|
607
607
|
control
|
|
608
608
|
});
|
|
609
|
+
const theme = _material.useTheme.call(void 0, );
|
|
609
610
|
const [loading, setLoading] = _react.useState.call(void 0, false);
|
|
610
611
|
const [selectedOption, setSelectedOption] = _react.useState.call(void 0, null);
|
|
611
612
|
const [inputValue, setInputValue] = _react.useState.call(void 0, "");
|
|
@@ -753,10 +754,11 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
753
754
|
},
|
|
754
755
|
variant: variant ? variant : "outlined",
|
|
755
756
|
sx: {
|
|
756
|
-
...sx,
|
|
757
757
|
"& .MuiInputBase-input": {
|
|
758
758
|
cursor: disabled ? "not-allowed" : "default"
|
|
759
|
-
}
|
|
759
|
+
},
|
|
760
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
761
|
+
...sx
|
|
760
762
|
}
|
|
761
763
|
}
|
|
762
764
|
),
|
|
@@ -797,6 +799,7 @@ var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);
|
|
|
797
799
|
|
|
798
800
|
|
|
799
801
|
|
|
802
|
+
|
|
800
803
|
var _match = require('autosuggest-highlight/match'); var _match2 = _interopRequireDefault(_match);
|
|
801
804
|
var _parse = require('autosuggest-highlight/parse'); var _parse2 = _interopRequireDefault(_parse);
|
|
802
805
|
|
|
@@ -822,6 +825,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
822
825
|
name,
|
|
823
826
|
control
|
|
824
827
|
});
|
|
828
|
+
const theme = _material.useTheme.call(void 0, );
|
|
825
829
|
const multiSelectRef = _react.useRef.call(void 0, null);
|
|
826
830
|
const [selectedOptions, setSelectedOptions] = _react.useState.call(void 0, []);
|
|
827
831
|
const [inputValue, setInputValue] = _react.useState.call(void 0, "");
|
|
@@ -946,10 +950,11 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
946
950
|
},
|
|
947
951
|
variant: variant ? variant : "outlined",
|
|
948
952
|
sx: {
|
|
949
|
-
...sx,
|
|
950
953
|
"& .MuiInputBase-input": {
|
|
951
954
|
cursor: disabled ? "not-allowed" : "default"
|
|
952
|
-
}
|
|
955
|
+
},
|
|
956
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
957
|
+
...sx
|
|
953
958
|
}
|
|
954
959
|
}
|
|
955
960
|
),
|
|
@@ -995,87 +1000,61 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
995
1000
|
|
|
996
1001
|
|
|
997
1002
|
|
|
998
|
-
|
|
1003
|
+
function isOptionType(option, key) {
|
|
1004
|
+
return typeof option === "object" && option !== null && key in option;
|
|
1005
|
+
}
|
|
999
1006
|
var Component8 = function SelectElement(props) {
|
|
1000
1007
|
const {
|
|
1001
1008
|
name,
|
|
1002
|
-
|
|
1009
|
+
control,
|
|
1003
1010
|
onChange,
|
|
1004
|
-
|
|
1011
|
+
isEdit,
|
|
1005
1012
|
options,
|
|
1006
|
-
control,
|
|
1007
|
-
gridProps,
|
|
1008
|
-
loading = false,
|
|
1009
|
-
placeholder,
|
|
1010
1013
|
label,
|
|
1011
|
-
|
|
1012
|
-
|
|
1014
|
+
labelKey,
|
|
1015
|
+
valueKey,
|
|
1013
1016
|
...rest
|
|
1014
1017
|
} = props;
|
|
1015
|
-
const {
|
|
1016
|
-
field,
|
|
1017
|
-
fieldState: { error }
|
|
1018
|
-
} = _reacthookform.useController.call(void 0, {
|
|
1018
|
+
const { field } = _reacthookform.useController.call(void 0, {
|
|
1019
1019
|
name,
|
|
1020
1020
|
control
|
|
1021
1021
|
});
|
|
1022
|
-
const theme = _material.useTheme.call(void 0, );
|
|
1023
1022
|
const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
|
|
1024
|
-
|
|
1025
|
-
if (
|
|
1026
|
-
field.onChange(
|
|
1023
|
+
const handleChange = (event, newValue, reason) => {
|
|
1024
|
+
if (reason === "clear") {
|
|
1025
|
+
field.onChange(null);
|
|
1027
1026
|
setHasAutoSelected(true);
|
|
1027
|
+
} else {
|
|
1028
|
+
const option = newValue;
|
|
1029
|
+
field.onChange(_nullishCoalesce(option[valueKey], () => ( null)));
|
|
1030
|
+
setHasAutoSelected(true);
|
|
1031
|
+
}
|
|
1032
|
+
_optionalChain([onChange, 'optionalCall', _21 => _21(event, newValue, reason)]);
|
|
1033
|
+
};
|
|
1034
|
+
_react.useEffect.call(void 0, () => {
|
|
1035
|
+
if (isEdit) {
|
|
1036
|
+
return;
|
|
1037
|
+
} else {
|
|
1038
|
+
if (options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1039
|
+
const option = options[0];
|
|
1040
|
+
field.onChange(option);
|
|
1041
|
+
setHasAutoSelected(true);
|
|
1042
|
+
}
|
|
1028
1043
|
}
|
|
1029
1044
|
}, [options, field.value, field.onChange, hasAutoSelected]);
|
|
1030
1045
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1031
1046
|
_material.Autocomplete,
|
|
1032
1047
|
{
|
|
1033
1048
|
...rest,
|
|
1034
|
-
|
|
1035
|
-
return field.value === option.Value;
|
|
1036
|
-
}), () => ( null)) : null,
|
|
1037
|
-
loading,
|
|
1049
|
+
filterSelectedOptions: false,
|
|
1038
1050
|
options,
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
setHasAutoSelected(true);
|
|
1047
|
-
} else {
|
|
1048
|
-
field.onChange(_nullishCoalesce(_optionalChain([newValue, 'optionalAccess', _21 => _21.Value]), () => ( null)));
|
|
1049
|
-
setHasAutoSelected(true);
|
|
1050
|
-
}
|
|
1051
|
-
_optionalChain([onChange, 'optionalCall', _22 => _22(event, newValue, reason)]);
|
|
1052
|
-
},
|
|
1053
|
-
onBlur: (event) => {
|
|
1054
|
-
field.onBlur();
|
|
1055
|
-
if (typeof onBlur === "function") {
|
|
1056
|
-
onBlur(event);
|
|
1057
|
-
}
|
|
1058
|
-
},
|
|
1059
|
-
fullWidth: true,
|
|
1060
|
-
renderInput: (params) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1061
|
-
_material.TextField,
|
|
1062
|
-
{
|
|
1063
|
-
...params,
|
|
1064
|
-
fullWidth: true,
|
|
1065
|
-
error: !!error,
|
|
1066
|
-
helperText: error ? error.message : "",
|
|
1067
|
-
placeholder,
|
|
1068
|
-
label,
|
|
1069
|
-
variant: variant ? variant : "outlined",
|
|
1070
|
-
sx: {
|
|
1071
|
-
...sx,
|
|
1072
|
-
"& .MuiInputBase-input": {
|
|
1073
|
-
cursor: disabled ? "not-allowed" : "default"
|
|
1074
|
-
},
|
|
1075
|
-
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
)
|
|
1051
|
+
value: field.value !== null ? _nullishCoalesce(options.find(
|
|
1052
|
+
(option) => isOptionType(option, valueKey) && field.value === option[valueKey]
|
|
1053
|
+
), () => ( null)) : null,
|
|
1054
|
+
onChange: handleChange,
|
|
1055
|
+
getOptionLabel: (option) => isOptionType(option, labelKey) ? String(option[labelKey]) : typeof option === "string" ? option : "",
|
|
1056
|
+
isOptionEqualToValue: (option, value) => isOptionType(option, valueKey) && isOptionType(value, valueKey) ? option[valueKey] === value[valueKey] : false,
|
|
1057
|
+
renderInput: (params) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.TextField, { ...params, label })
|
|
1079
1058
|
}
|
|
1080
1059
|
);
|
|
1081
1060
|
};
|
|
@@ -1203,6 +1182,7 @@ var SelectMultiElement_default = SelectMultiElement2;
|
|
|
1203
1182
|
|
|
1204
1183
|
|
|
1205
1184
|
|
|
1185
|
+
|
|
1206
1186
|
var Component10 = function SelectCascadeElement(props) {
|
|
1207
1187
|
const {
|
|
1208
1188
|
name,
|
|
@@ -1219,6 +1199,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1219
1199
|
initialValue,
|
|
1220
1200
|
variant,
|
|
1221
1201
|
sx,
|
|
1202
|
+
isEdit = false,
|
|
1222
1203
|
...rest
|
|
1223
1204
|
} = props;
|
|
1224
1205
|
const {
|
|
@@ -1228,13 +1209,14 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1228
1209
|
name,
|
|
1229
1210
|
control
|
|
1230
1211
|
});
|
|
1212
|
+
const theme = _material.useTheme.call(void 0, );
|
|
1231
1213
|
const { field: dependentField } = _reacthookform.useController.call(void 0, {
|
|
1232
1214
|
name: dependsOn,
|
|
1233
1215
|
control
|
|
1234
1216
|
});
|
|
1235
1217
|
const parentValueRef = _react.useRef.call(void 0, _nullishCoalesce(dependentField.value, () => ( null)));
|
|
1236
1218
|
_react.useEffect.call(void 0, () => {
|
|
1237
|
-
if (!!dependentField.value && _optionalChain([parentValueRef, 'optionalAccess',
|
|
1219
|
+
if (!!dependentField.value && _optionalChain([parentValueRef, 'optionalAccess', _22 => _22.current, 'optionalAccess', _23 => _23.Value]) !== dependentField.value || dependentField.value === null) {
|
|
1238
1220
|
field.onChange(null);
|
|
1239
1221
|
}
|
|
1240
1222
|
}, [dependentField.value]);
|
|
@@ -1243,6 +1225,18 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1243
1225
|
field.onChange(initialValue);
|
|
1244
1226
|
}
|
|
1245
1227
|
}, [initialValue]);
|
|
1228
|
+
const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
|
|
1229
|
+
_react.useEffect.call(void 0, () => {
|
|
1230
|
+
if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1231
|
+
field.onChange(options[0].Value);
|
|
1232
|
+
setHasAutoSelected(true);
|
|
1233
|
+
} else {
|
|
1234
|
+
if (options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1235
|
+
field.onChange(options[0].Value);
|
|
1236
|
+
setHasAutoSelected(true);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}, [options, field.value, field.onChange, hasAutoSelected, isEdit]);
|
|
1246
1240
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1247
1241
|
_material.Autocomplete,
|
|
1248
1242
|
{
|
|
@@ -1281,10 +1275,11 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1281
1275
|
label,
|
|
1282
1276
|
variant: variant ? variant : "outlined",
|
|
1283
1277
|
sx: {
|
|
1284
|
-
...sx,
|
|
1285
1278
|
"& .MuiInputBase-input": {
|
|
1286
1279
|
cursor: disabled ? "not-allowed" : "default"
|
|
1287
|
-
}
|
|
1280
|
+
},
|
|
1281
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
1282
|
+
...sx
|
|
1288
1283
|
}
|
|
1289
1284
|
}
|
|
1290
1285
|
)
|
|
@@ -1395,7 +1390,7 @@ var Component12 = function CheckboxGroup(props) {
|
|
|
1395
1390
|
disabled: rest.disabled
|
|
1396
1391
|
});
|
|
1397
1392
|
const [selectedValues, setSelectedValues] = _react.useState.call(void 0,
|
|
1398
|
-
options.filter((c) => _optionalChain([field, 'access',
|
|
1393
|
+
options.filter((c) => _optionalChain([field, 'access', _24 => _24.value, 'optionalAccess', _25 => _25.includes, 'call', _26 => _26(c.Value)])).map((c) => c.Value) || []
|
|
1399
1394
|
);
|
|
1400
1395
|
_react.useEffect.call(void 0, () => {
|
|
1401
1396
|
field.onChange(selectedValues ? [...selectedValues] : []);
|
|
@@ -455,12 +455,12 @@ var Component4 = function TextFieldElement(props) {
|
|
|
455
455
|
variant: variant ? variant : "outlined",
|
|
456
456
|
size: "small",
|
|
457
457
|
sx: {
|
|
458
|
-
...sx,
|
|
459
458
|
"& .MuiInputLabel-asterisk": { color: "red" },
|
|
460
459
|
"& .MuiInputBase-input": {
|
|
461
460
|
cursor: disabled ? "not-allowed" : "default"
|
|
462
461
|
},
|
|
463
|
-
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
462
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
463
|
+
...sx
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
);
|
|
@@ -582,7 +582,7 @@ import {
|
|
|
582
582
|
useState as useState2
|
|
583
583
|
} from "react";
|
|
584
584
|
import { useController as useController6 } from "react-hook-form";
|
|
585
|
-
import { CircularProgress, Grid2 as Grid26 } from "@mui/material";
|
|
585
|
+
import { CircularProgress, Grid2 as Grid26, useTheme as useTheme3 } from "@mui/material";
|
|
586
586
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
587
587
|
var Component6 = function AsyncSelectElement(props) {
|
|
588
588
|
const {
|
|
@@ -606,6 +606,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
606
606
|
name,
|
|
607
607
|
control
|
|
608
608
|
});
|
|
609
|
+
const theme = useTheme3();
|
|
609
610
|
const [loading, setLoading] = useState2(false);
|
|
610
611
|
const [selectedOption, setSelectedOption] = useState2(null);
|
|
611
612
|
const [inputValue, setInputValue] = useState2("");
|
|
@@ -753,10 +754,11 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
753
754
|
},
|
|
754
755
|
variant: variant ? variant : "outlined",
|
|
755
756
|
sx: {
|
|
756
|
-
...sx,
|
|
757
757
|
"& .MuiInputBase-input": {
|
|
758
758
|
cursor: disabled ? "not-allowed" : "default"
|
|
759
|
-
}
|
|
759
|
+
},
|
|
760
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
761
|
+
...sx
|
|
760
762
|
}
|
|
761
763
|
}
|
|
762
764
|
),
|
|
@@ -794,7 +796,8 @@ import {
|
|
|
794
796
|
Autocomplete as Autocomplete2,
|
|
795
797
|
CircularProgress as CircularProgress2,
|
|
796
798
|
Grid2 as Grid27,
|
|
797
|
-
TextField as TextField4
|
|
799
|
+
TextField as TextField4,
|
|
800
|
+
useTheme as useTheme4
|
|
798
801
|
} from "@mui/material";
|
|
799
802
|
import { useController as useController7 } from "react-hook-form";
|
|
800
803
|
import match from "autosuggest-highlight/match";
|
|
@@ -822,6 +825,7 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
822
825
|
name,
|
|
823
826
|
control
|
|
824
827
|
});
|
|
828
|
+
const theme = useTheme4();
|
|
825
829
|
const multiSelectRef = useRef2(null);
|
|
826
830
|
const [selectedOptions, setSelectedOptions] = useState3([]);
|
|
827
831
|
const [inputValue, setInputValue] = useState3("");
|
|
@@ -946,10 +950,11 @@ var Component7 = function AsyncSelectMultiElement(props) {
|
|
|
946
950
|
},
|
|
947
951
|
variant: variant ? variant : "outlined",
|
|
948
952
|
sx: {
|
|
949
|
-
...sx,
|
|
950
953
|
"& .MuiInputBase-input": {
|
|
951
954
|
cursor: disabled ? "not-allowed" : "default"
|
|
952
|
-
}
|
|
955
|
+
},
|
|
956
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
957
|
+
...sx
|
|
953
958
|
}
|
|
954
959
|
}
|
|
955
960
|
),
|
|
@@ -987,95 +992,69 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
987
992
|
// src/wrappers/SelectElement/SelectElement.tsx
|
|
988
993
|
import {
|
|
989
994
|
Autocomplete as Autocomplete3,
|
|
990
|
-
Grid2 as Grid28,
|
|
991
995
|
TextField as TextField5,
|
|
992
|
-
|
|
996
|
+
Grid2 as Grid28
|
|
993
997
|
} from "@mui/material";
|
|
998
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
994
999
|
import {
|
|
995
1000
|
useController as useController8
|
|
996
1001
|
} from "react-hook-form";
|
|
997
|
-
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
998
1002
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1003
|
+
function isOptionType(option, key) {
|
|
1004
|
+
return typeof option === "object" && option !== null && key in option;
|
|
1005
|
+
}
|
|
999
1006
|
var Component8 = function SelectElement(props) {
|
|
1000
1007
|
const {
|
|
1001
1008
|
name,
|
|
1002
|
-
|
|
1009
|
+
control,
|
|
1003
1010
|
onChange,
|
|
1004
|
-
|
|
1011
|
+
isEdit,
|
|
1005
1012
|
options,
|
|
1006
|
-
control,
|
|
1007
|
-
gridProps,
|
|
1008
|
-
loading = false,
|
|
1009
|
-
placeholder,
|
|
1010
1013
|
label,
|
|
1011
|
-
|
|
1012
|
-
|
|
1014
|
+
labelKey,
|
|
1015
|
+
valueKey,
|
|
1013
1016
|
...rest
|
|
1014
1017
|
} = props;
|
|
1015
|
-
const {
|
|
1016
|
-
field,
|
|
1017
|
-
fieldState: { error }
|
|
1018
|
-
} = useController8({
|
|
1018
|
+
const { field } = useController8({
|
|
1019
1019
|
name,
|
|
1020
1020
|
control
|
|
1021
1021
|
});
|
|
1022
|
-
const theme = useTheme3();
|
|
1023
1022
|
const [hasAutoSelected, setHasAutoSelected] = useState4(false);
|
|
1024
|
-
|
|
1025
|
-
if (
|
|
1026
|
-
field.onChange(
|
|
1023
|
+
const handleChange = (event, newValue, reason) => {
|
|
1024
|
+
if (reason === "clear") {
|
|
1025
|
+
field.onChange(null);
|
|
1026
|
+
setHasAutoSelected(true);
|
|
1027
|
+
} else {
|
|
1028
|
+
const option = newValue;
|
|
1029
|
+
field.onChange(option[valueKey] ?? null);
|
|
1027
1030
|
setHasAutoSelected(true);
|
|
1028
1031
|
}
|
|
1032
|
+
onChange?.(event, newValue, reason);
|
|
1033
|
+
};
|
|
1034
|
+
useEffect4(() => {
|
|
1035
|
+
if (isEdit) {
|
|
1036
|
+
return;
|
|
1037
|
+
} else {
|
|
1038
|
+
if (options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1039
|
+
const option = options[0];
|
|
1040
|
+
field.onChange(option);
|
|
1041
|
+
setHasAutoSelected(true);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1029
1044
|
}, [options, field.value, field.onChange, hasAutoSelected]);
|
|
1030
1045
|
return /* @__PURE__ */ jsx8(
|
|
1031
1046
|
Autocomplete3,
|
|
1032
1047
|
{
|
|
1033
1048
|
...rest,
|
|
1034
|
-
|
|
1035
|
-
return field.value === option.Value;
|
|
1036
|
-
}) ?? null : null,
|
|
1037
|
-
loading,
|
|
1049
|
+
filterSelectedOptions: false,
|
|
1038
1050
|
options,
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
setHasAutoSelected(true);
|
|
1047
|
-
} else {
|
|
1048
|
-
field.onChange(newValue?.Value ?? null);
|
|
1049
|
-
setHasAutoSelected(true);
|
|
1050
|
-
}
|
|
1051
|
-
onChange?.(event, newValue, reason);
|
|
1052
|
-
},
|
|
1053
|
-
onBlur: (event) => {
|
|
1054
|
-
field.onBlur();
|
|
1055
|
-
if (typeof onBlur === "function") {
|
|
1056
|
-
onBlur(event);
|
|
1057
|
-
}
|
|
1058
|
-
},
|
|
1059
|
-
fullWidth: true,
|
|
1060
|
-
renderInput: (params) => /* @__PURE__ */ jsx8(
|
|
1061
|
-
TextField5,
|
|
1062
|
-
{
|
|
1063
|
-
...params,
|
|
1064
|
-
fullWidth: true,
|
|
1065
|
-
error: !!error,
|
|
1066
|
-
helperText: error ? error.message : "",
|
|
1067
|
-
placeholder,
|
|
1068
|
-
label,
|
|
1069
|
-
variant: variant ? variant : "outlined",
|
|
1070
|
-
sx: {
|
|
1071
|
-
...sx,
|
|
1072
|
-
"& .MuiInputBase-input": {
|
|
1073
|
-
cursor: disabled ? "not-allowed" : "default"
|
|
1074
|
-
},
|
|
1075
|
-
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
)
|
|
1051
|
+
value: field.value !== null ? options.find(
|
|
1052
|
+
(option) => isOptionType(option, valueKey) && field.value === option[valueKey]
|
|
1053
|
+
) ?? null : null,
|
|
1054
|
+
onChange: handleChange,
|
|
1055
|
+
getOptionLabel: (option) => isOptionType(option, labelKey) ? String(option[labelKey]) : typeof option === "string" ? option : "",
|
|
1056
|
+
isOptionEqualToValue: (option, value) => isOptionType(option, valueKey) && isOptionType(value, valueKey) ? option[valueKey] === value[valueKey] : false,
|
|
1057
|
+
renderInput: (params) => /* @__PURE__ */ jsx8(TextField5, { ...params, label })
|
|
1079
1058
|
}
|
|
1080
1059
|
);
|
|
1081
1060
|
};
|
|
@@ -1196,9 +1175,10 @@ var SelectMultiElement_default = SelectMultiElement2;
|
|
|
1196
1175
|
import {
|
|
1197
1176
|
Autocomplete as Autocomplete5,
|
|
1198
1177
|
Grid2 as Grid210,
|
|
1199
|
-
TextField as TextField7
|
|
1178
|
+
TextField as TextField7,
|
|
1179
|
+
useTheme as useTheme5
|
|
1200
1180
|
} from "@mui/material";
|
|
1201
|
-
import { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1181
|
+
import { useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
|
|
1202
1182
|
import {
|
|
1203
1183
|
useController as useController10
|
|
1204
1184
|
} from "react-hook-form";
|
|
@@ -1219,6 +1199,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1219
1199
|
initialValue,
|
|
1220
1200
|
variant,
|
|
1221
1201
|
sx,
|
|
1202
|
+
isEdit = false,
|
|
1222
1203
|
...rest
|
|
1223
1204
|
} = props;
|
|
1224
1205
|
const {
|
|
@@ -1228,6 +1209,7 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1228
1209
|
name,
|
|
1229
1210
|
control
|
|
1230
1211
|
});
|
|
1212
|
+
const theme = useTheme5();
|
|
1231
1213
|
const { field: dependentField } = useController10({
|
|
1232
1214
|
name: dependsOn,
|
|
1233
1215
|
control
|
|
@@ -1243,6 +1225,18 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1243
1225
|
field.onChange(initialValue);
|
|
1244
1226
|
}
|
|
1245
1227
|
}, [initialValue]);
|
|
1228
|
+
const [hasAutoSelected, setHasAutoSelected] = useState6(false);
|
|
1229
|
+
useEffect5(() => {
|
|
1230
|
+
if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1231
|
+
field.onChange(options[0].Value);
|
|
1232
|
+
setHasAutoSelected(true);
|
|
1233
|
+
} else {
|
|
1234
|
+
if (options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1235
|
+
field.onChange(options[0].Value);
|
|
1236
|
+
setHasAutoSelected(true);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}, [options, field.value, field.onChange, hasAutoSelected, isEdit]);
|
|
1246
1240
|
return /* @__PURE__ */ jsx10(
|
|
1247
1241
|
Autocomplete5,
|
|
1248
1242
|
{
|
|
@@ -1281,10 +1275,11 @@ var Component10 = function SelectCascadeElement(props) {
|
|
|
1281
1275
|
label,
|
|
1282
1276
|
variant: variant ? variant : "outlined",
|
|
1283
1277
|
sx: {
|
|
1284
|
-
...sx,
|
|
1285
1278
|
"& .MuiInputBase-input": {
|
|
1286
1279
|
cursor: disabled ? "not-allowed" : "default"
|
|
1287
|
-
}
|
|
1280
|
+
},
|
|
1281
|
+
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent",
|
|
1282
|
+
...sx
|
|
1288
1283
|
}
|
|
1289
1284
|
}
|
|
1290
1285
|
)
|
|
@@ -1379,7 +1374,7 @@ import {
|
|
|
1379
1374
|
FormHelperText as FormHelperText3,
|
|
1380
1375
|
Grid2 as Grid212
|
|
1381
1376
|
} from "@mui/material";
|
|
1382
|
-
import { useEffect as useEffect6, useState as
|
|
1377
|
+
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
1383
1378
|
import {
|
|
1384
1379
|
useController as useController12
|
|
1385
1380
|
} from "react-hook-form";
|
|
@@ -1394,7 +1389,7 @@ var Component12 = function CheckboxGroup(props) {
|
|
|
1394
1389
|
control,
|
|
1395
1390
|
disabled: rest.disabled
|
|
1396
1391
|
});
|
|
1397
|
-
const [selectedValues, setSelectedValues] =
|
|
1392
|
+
const [selectedValues, setSelectedValues] = useState7(
|
|
1398
1393
|
options.filter((c) => field.value?.includes(c.Value)).map((c) => c.Value) || []
|
|
1399
1394
|
);
|
|
1400
1395
|
useEffect6(() => {
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,8 @@ export { ApiResponse, ListResponse, OperationResponse, PostModel, ValidationErro
|
|
|
4
4
|
export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools } from './utils/index.mjs';
|
|
5
5
|
export { Field } from './wrappers/index.mjs';
|
|
6
6
|
export { Field2 } from './wrappers2/index.mjs';
|
|
7
|
-
export {
|
|
7
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-CiwoX8EE.mjs';
|
|
8
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-BSg3KSRJ.mjs';
|
|
8
9
|
import 'react/jsx-runtime';
|
|
9
10
|
import '@mui/material';
|
|
10
11
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export { ApiResponse, ListResponse, OperationResponse, PostModel, ValidationErro
|
|
|
4
4
|
export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools } from './utils/index.js';
|
|
5
5
|
export { Field } from './wrappers/index.js';
|
|
6
6
|
export { Field2 } from './wrappers2/index.js';
|
|
7
|
-
export {
|
|
7
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-CiwoX8EE.js';
|
|
8
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-BSg3KSRJ.js';
|
|
8
9
|
import 'react/jsx-runtime';
|
|
9
10
|
import '@mui/material';
|
|
10
11
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -13,10 +13,10 @@ require('./chunk-7M2VOCYN.js');
|
|
|
13
13
|
require('./chunk-6BGQA4BQ.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkSTC2BZ2Ljs = require('./chunk-STC2BZ2L.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkF5QWH3Y5js = require('./chunk-F5QWH3Y5.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
|
|
@@ -53,4 +53,4 @@ var _chunkDKBPCLECjs = require('./chunk-DKBPCLEC.js');
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
exports.AuthorizedView = _chunkWEPRO2OOjs.AuthorizedView_default; exports.ClearButton = _chunkWEPRO2OOjs.ClearButton_default; exports.Field =
|
|
56
|
+
exports.AuthorizedView = _chunkWEPRO2OOjs.AuthorizedView_default; exports.ClearButton = _chunkWEPRO2OOjs.ClearButton_default; exports.Field = _chunkF5QWH3Y5js.Field_default; exports.Field2 = _chunkSTC2BZ2Ljs.Field_default; exports.FilterButton = _chunkWEPRO2OOjs.FilterButton_default; exports.FilterWrapper = _chunkWEPRO2OOjs.FilterWrapper_default; exports.FormWrapper = _chunkWEPRO2OOjs.FormWrapper_default; exports.LabelText = _chunkWEPRO2OOjs.LabelText_default; exports.ListWrapper = _chunkWEPRO2OOjs.ListWrapper_default; exports.SimpleButton = _chunkWEPRO2OOjs.SimpleButton_default; exports.SimpleToolbar = _chunkWEPRO2OOjs.SimpleToolbar_default; exports.api = _chunkDKBPCLECjs.api; exports.api2 = _chunkDKBPCLECjs.api2; exports.flattenObjectKeys = _chunkDKBPCLECjs.flattenObjectKeys; exports.getTimezone = _chunkDKBPCLECjs.getTimezone; exports.handleServerErrors = _chunkDKBPCLECjs.handleServerErrors; exports.propertyExists = _chunkDKBPCLECjs.propertyExists; exports.readValueAsDate = _chunkDKBPCLECjs.readValueAsDate; exports.removeLeadingTrailingSlashes = _chunkDKBPCLECjs.removeLeadingTrailingSlashes; exports.schemaTools = _chunkDKBPCLECjs.schemaTools; exports.useTransform = _chunk6JZ35VQJjs.useTransform;
|
package/dist/index.mjs
CHANGED
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
} from "./chunk-KM5TYX5L.mjs";
|
|
12
12
|
import "./chunk-2JFL7TS5.mjs";
|
|
13
13
|
import "./chunk-EVPUCTZA.mjs";
|
|
14
|
-
import {
|
|
15
|
-
Field_default
|
|
16
|
-
} from "./chunk-MRZZQRKX.mjs";
|
|
17
14
|
import {
|
|
18
15
|
Field_default as Field_default2
|
|
19
16
|
} from "./chunk-34X2YRTY.mjs";
|
|
17
|
+
import {
|
|
18
|
+
Field_default
|
|
19
|
+
} from "./chunk-TMGF3IR4.mjs";
|
|
20
20
|
import {
|
|
21
21
|
useTransform
|
|
22
22
|
} from "./chunk-GFSTK7KN.mjs";
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GridSortModel } from '@mui/x-data-grid';
|
|
2
|
-
export {
|
|
2
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.mjs';
|
|
3
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-BSg3KSRJ.mjs';
|
|
3
4
|
|
|
4
5
|
type ValidationErrors = {
|
|
5
6
|
[field: string]: string | string[] | boolean | {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GridSortModel } from '@mui/x-data-grid';
|
|
2
|
-
export {
|
|
2
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.js';
|
|
3
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-BSg3KSRJ.js';
|
|
3
4
|
|
|
4
5
|
type ValidationErrors = {
|
|
5
6
|
[field: string]: string | string[] | boolean | {
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -4,7 +4,8 @@ import { useLocalizationContext } from '@mui/x-date-pickers/internals';
|
|
|
4
4
|
import { FieldValues, UseFormSetError } from 'react-hook-form';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import '@mui/x-data-grid';
|
|
7
|
-
import '../
|
|
7
|
+
import '../AsyncSelectPayload-CiwoX8EE.mjs';
|
|
8
|
+
import '../OptionItem-BSg3KSRJ.mjs';
|
|
8
9
|
|
|
9
10
|
declare class api {
|
|
10
11
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { useLocalizationContext } from '@mui/x-date-pickers/internals';
|
|
|
4
4
|
import { FieldValues, UseFormSetError } from 'react-hook-form';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import '@mui/x-data-grid';
|
|
7
|
-
import '../
|
|
7
|
+
import '../AsyncSelectPayload-CiwoX8EE.js';
|
|
8
|
+
import '../OptionItem-BSg3KSRJ.js';
|
|
8
9
|
|
|
9
10
|
declare class api {
|
|
10
11
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, AutocompleteProps, TextFieldVariants as TextFieldVariants$1, SxProps as SxProps$1, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, TextField } from '@mui/material';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
3
|
import { FieldValues, FieldPath, Control, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.mjs';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { ReactNode, ChangeEvent } from 'react';
|
|
7
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
7
|
import { TimePickerProps, TimePickerSlotProps, PickerChangeHandlerContext, TimeValidationError, DateValidationError, DatePickerSlotProps, DatePickerProps } from '@mui/x-date-pickers';
|
|
9
8
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
10
9
|
|
|
@@ -20,24 +19,6 @@ type CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName ex
|
|
|
20
19
|
}[];
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
type AsyncMultiSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends {
|
|
24
|
-
Value: number;
|
|
25
|
-
Label: string;
|
|
26
|
-
} = {
|
|
27
|
-
Value: number;
|
|
28
|
-
Label: string;
|
|
29
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "control" | "ref" | "multiple" | "loading" | "getOptionLabel" | "getOptionKey" | "isOptionEqualToValue" | "options" | "value" | "filterSelectedOptions" | "filterOptions" | "onChange" | "onInputChange" | "renderInput"> & {
|
|
30
|
-
name: TName;
|
|
31
|
-
control?: Control<TFieldValues>;
|
|
32
|
-
gridProps?: Grid2Props;
|
|
33
|
-
placeholder?: string;
|
|
34
|
-
label?: string;
|
|
35
|
-
initialValues: number[] | null;
|
|
36
|
-
queryFn: (data: AsyncMultiSelectPayload) => Promise<OptionItem[] | undefined>;
|
|
37
|
-
variant?: TextFieldVariants$1;
|
|
38
|
-
sx?: SxProps$1;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
22
|
type AsyncSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends {
|
|
42
23
|
Value: number;
|
|
43
24
|
Label: string;
|
|
@@ -73,6 +54,7 @@ type SelectCascadeElementProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
73
54
|
initialValue?: number | null;
|
|
74
55
|
variant?: TextFieldVariants$1;
|
|
75
56
|
sx?: SxProps$1;
|
|
57
|
+
isEdit?: boolean;
|
|
76
58
|
};
|
|
77
59
|
|
|
78
60
|
type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends {
|
|
@@ -92,13 +74,7 @@ type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
92
74
|
sx?: SxProps;
|
|
93
75
|
};
|
|
94
76
|
|
|
95
|
-
type SelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
96
|
-
Value: number;
|
|
97
|
-
Label: string;
|
|
98
|
-
} = {
|
|
99
|
-
Value: number;
|
|
100
|
-
Label: string;
|
|
101
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
|
|
77
|
+
type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
|
|
102
78
|
rules?: UseControllerProps<TFieldValues, TName>["rules"];
|
|
103
79
|
name: TName;
|
|
104
80
|
control?: Control<TFieldValues>;
|
|
@@ -107,6 +83,9 @@ type SelectElementProps<TFieldValues extends FieldValues = FieldValues, TName ex
|
|
|
107
83
|
label?: string;
|
|
108
84
|
variant?: TextFieldVariants$1;
|
|
109
85
|
sx?: SxProps$1;
|
|
86
|
+
isEdit?: boolean;
|
|
87
|
+
labelKey: keyof TOption;
|
|
88
|
+
valueKey: keyof TOption;
|
|
110
89
|
};
|
|
111
90
|
|
|
112
91
|
type TimePickerElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends PickerValidDate = PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = Omit<TimePickerProps<TValue>, "value" | "renderInput"> & {
|
|
@@ -219,13 +198,7 @@ declare const Field: {
|
|
|
219
198
|
RadioGroup: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue = unknown>(props: RadioButtonGroupProps<TFieldValues, TName, TValue>) => JSX.Element;
|
|
220
199
|
Password: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>>(props: PasswordElementProps<TFieldValues, TName>) => JSX.Element;
|
|
221
200
|
Time: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends unknown = any>(props: TimePickerElementProps<TFieldValues, TName, TValue>) => JSX.Element;
|
|
222
|
-
Select: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>,
|
|
223
|
-
Value: number;
|
|
224
|
-
Label: string;
|
|
225
|
-
} = {
|
|
226
|
-
Value: number;
|
|
227
|
-
Label: string;
|
|
228
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectElementProps<TFieldValues, TName, TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
|
|
201
|
+
Select: <TOption, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
229
202
|
SelectMulti: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends {
|
|
230
203
|
Value: number;
|
|
231
204
|
Label: string;
|
|
@@ -247,13 +220,7 @@ declare const Field: {
|
|
|
247
220
|
Value: number;
|
|
248
221
|
Label: string;
|
|
249
222
|
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: AsyncSelectElementProps<TFieldValues, TName, TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
250
|
-
AsyncMultiSelect:
|
|
251
|
-
Value: number;
|
|
252
|
-
Label: string;
|
|
253
|
-
} = {
|
|
254
|
-
Value: number;
|
|
255
|
-
Label: string;
|
|
256
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: AsyncMultiSelectElementProps<TFieldValues, TName, TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>) => JSX.Element;
|
|
223
|
+
AsyncMultiSelect: any;
|
|
257
224
|
CheckboxGroup: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends number[] = number[]>(props: CheckboxGroupProps<TFieldValues, TName, TValue>) => JSX.Element;
|
|
258
225
|
};
|
|
259
226
|
|
package/dist/wrappers/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, AutocompleteProps, TextFieldVariants as TextFieldVariants$1, SxProps as SxProps$1, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, TextField } from '@mui/material';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
3
|
import { FieldValues, FieldPath, Control, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { ReactNode, ChangeEvent } from 'react';
|
|
7
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
7
|
import { TimePickerProps, TimePickerSlotProps, PickerChangeHandlerContext, TimeValidationError, DateValidationError, DatePickerSlotProps, DatePickerProps } from '@mui/x-date-pickers';
|
|
9
8
|
import { PickerValidDate } from '@mui/x-date-pickers/models';
|
|
10
9
|
|
|
@@ -20,24 +19,6 @@ type CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName ex
|
|
|
20
19
|
}[];
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
type AsyncMultiSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends {
|
|
24
|
-
Value: number;
|
|
25
|
-
Label: string;
|
|
26
|
-
} = {
|
|
27
|
-
Value: number;
|
|
28
|
-
Label: string;
|
|
29
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "control" | "ref" | "multiple" | "loading" | "getOptionLabel" | "getOptionKey" | "isOptionEqualToValue" | "options" | "value" | "filterSelectedOptions" | "filterOptions" | "onChange" | "onInputChange" | "renderInput"> & {
|
|
30
|
-
name: TName;
|
|
31
|
-
control?: Control<TFieldValues>;
|
|
32
|
-
gridProps?: Grid2Props;
|
|
33
|
-
placeholder?: string;
|
|
34
|
-
label?: string;
|
|
35
|
-
initialValues: number[] | null;
|
|
36
|
-
queryFn: (data: AsyncMultiSelectPayload) => Promise<OptionItem[] | undefined>;
|
|
37
|
-
variant?: TextFieldVariants$1;
|
|
38
|
-
sx?: SxProps$1;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
22
|
type AsyncSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends {
|
|
42
23
|
Value: number;
|
|
43
24
|
Label: string;
|
|
@@ -73,6 +54,7 @@ type SelectCascadeElementProps<TFieldValues extends FieldValues = FieldValues, T
|
|
|
73
54
|
initialValue?: number | null;
|
|
74
55
|
variant?: TextFieldVariants$1;
|
|
75
56
|
sx?: SxProps$1;
|
|
57
|
+
isEdit?: boolean;
|
|
76
58
|
};
|
|
77
59
|
|
|
78
60
|
type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends {
|
|
@@ -92,13 +74,7 @@ type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
92
74
|
sx?: SxProps;
|
|
93
75
|
};
|
|
94
76
|
|
|
95
|
-
type SelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
96
|
-
Value: number;
|
|
97
|
-
Label: string;
|
|
98
|
-
} = {
|
|
99
|
-
Value: number;
|
|
100
|
-
Label: string;
|
|
101
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
|
|
77
|
+
type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
|
|
102
78
|
rules?: UseControllerProps<TFieldValues, TName>["rules"];
|
|
103
79
|
name: TName;
|
|
104
80
|
control?: Control<TFieldValues>;
|
|
@@ -107,6 +83,9 @@ type SelectElementProps<TFieldValues extends FieldValues = FieldValues, TName ex
|
|
|
107
83
|
label?: string;
|
|
108
84
|
variant?: TextFieldVariants$1;
|
|
109
85
|
sx?: SxProps$1;
|
|
86
|
+
isEdit?: boolean;
|
|
87
|
+
labelKey: keyof TOption;
|
|
88
|
+
valueKey: keyof TOption;
|
|
110
89
|
};
|
|
111
90
|
|
|
112
91
|
type TimePickerElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends PickerValidDate = PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = Omit<TimePickerProps<TValue>, "value" | "renderInput"> & {
|
|
@@ -219,13 +198,7 @@ declare const Field: {
|
|
|
219
198
|
RadioGroup: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue = unknown>(props: RadioButtonGroupProps<TFieldValues, TName, TValue>) => JSX.Element;
|
|
220
199
|
Password: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>>(props: PasswordElementProps<TFieldValues, TName>) => JSX.Element;
|
|
221
200
|
Time: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends unknown = any>(props: TimePickerElementProps<TFieldValues, TName, TValue>) => JSX.Element;
|
|
222
|
-
Select: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>,
|
|
223
|
-
Value: number;
|
|
224
|
-
Label: string;
|
|
225
|
-
} = {
|
|
226
|
-
Value: number;
|
|
227
|
-
Label: string;
|
|
228
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectElementProps<TFieldValues, TName, TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react_jsx_runtime.JSX.Element;
|
|
201
|
+
Select: <TOption, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
229
202
|
SelectMulti: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends {
|
|
230
203
|
Value: number;
|
|
231
204
|
Label: string;
|
|
@@ -247,13 +220,7 @@ declare const Field: {
|
|
|
247
220
|
Value: number;
|
|
248
221
|
Label: string;
|
|
249
222
|
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: AsyncSelectElementProps<TFieldValues, TName, TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
250
|
-
AsyncMultiSelect:
|
|
251
|
-
Value: number;
|
|
252
|
-
Label: string;
|
|
253
|
-
} = {
|
|
254
|
-
Value: number;
|
|
255
|
-
Label: string;
|
|
256
|
-
}, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: AsyncMultiSelectElementProps<TFieldValues, TName, TValue, Multiple, DisableClearable, FreeSolo, ChipComponent>) => JSX.Element;
|
|
223
|
+
AsyncMultiSelect: any;
|
|
257
224
|
CheckboxGroup: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends number[] = number[]>(props: CheckboxGroupProps<TFieldValues, TName, TValue>) => JSX.Element;
|
|
258
225
|
};
|
|
259
226
|
|
package/dist/wrappers/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkF5QWH3Y5js = require('../chunk-F5QWH3Y5.js');
|
|
4
4
|
require('../chunk-6JZ35VQJ.js');
|
|
5
5
|
require('../chunk-DKBPCLEC.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Field =
|
|
8
|
+
exports.Field = _chunkF5QWH3Y5js.Field_default;
|
package/dist/wrappers/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, AutocompleteProps, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, TextField } from '@mui/material';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
3
|
import { FieldValues, FieldPath, Control, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-BSg3KSRJ.mjs';
|
|
5
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.mjs';
|
|
5
6
|
import * as react from 'react';
|
|
6
7
|
import { ReactNode, ChangeEvent } from 'react';
|
|
7
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, AutocompleteProps, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, TextField } from '@mui/material';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
3
|
import { FieldValues, FieldPath, Control, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-BSg3KSRJ.js';
|
|
5
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.js';
|
|
5
6
|
import * as react from 'react';
|
|
6
7
|
import { ReactNode, ChangeEvent } from 'react';
|
|
7
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnwebsoft/ui",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.35",
|
|
4
4
|
"description": "A set of reusable wrappers for MUI v6",
|
|
5
5
|
"author": "GNWebsoft Private Limited",
|
|
6
6
|
"license": "",
|
|
@@ -71,26 +71,22 @@
|
|
|
71
71
|
"@emotion/cache": "^11.14.0",
|
|
72
72
|
"@emotion/react": "^11.14.0",
|
|
73
73
|
"@emotion/styled": "^11.14.0",
|
|
74
|
-
"@fontsource/roboto": "^5.1.1",
|
|
75
74
|
"@hookform/resolvers": "^3.9.1",
|
|
76
75
|
"@mui/icons-material": "^6.4.11",
|
|
77
76
|
"@mui/lab": "^6.0.0-beta.21",
|
|
78
|
-
"@mui/material": "6.
|
|
79
|
-
"@mui/x-data-grid": "^7.
|
|
80
|
-
"@mui/x-date-pickers": "^7.
|
|
81
|
-
"@mui/x-tree-view": "^7.23.2",
|
|
77
|
+
"@mui/material": "^6.5.0",
|
|
78
|
+
"@mui/x-data-grid": "^7.29.8",
|
|
79
|
+
"@mui/x-date-pickers": "^7.29.4",
|
|
82
80
|
"autosuggest-highlight": "^3.3.4",
|
|
83
|
-
"axios": "^1.
|
|
81
|
+
"axios": "^1.10.0",
|
|
84
82
|
"dayjs": "^1.11.13",
|
|
85
|
-
"es-toolkit": "^1.
|
|
83
|
+
"es-toolkit": "^1.39.7",
|
|
86
84
|
"lodash": "^4.17.21",
|
|
87
85
|
"react": "^18.3.1",
|
|
88
86
|
"react-dom": "^18.3.1",
|
|
89
|
-
"react-hook-form": "^7.
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"typescript": "5.8.3",
|
|
93
|
-
"zod": "^3.24.1",
|
|
87
|
+
"react-hook-form": "^7.60.0",
|
|
88
|
+
"typescript": "^5.7.2",
|
|
89
|
+
"zod": "^3.25.76",
|
|
94
90
|
"zustand": "^5.0.2"
|
|
95
91
|
}
|
|
96
92
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type AsyncSelectPayload = {
|
|
2
|
-
query: string | null;
|
|
3
|
-
initialValue?: number | null;
|
|
4
|
-
};
|
|
5
|
-
type AsyncSelectMultiPayload = {
|
|
6
|
-
query: string | null;
|
|
7
|
-
initialValues?: number[] | null;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type OptionItem = {
|
|
11
|
-
Label: string;
|
|
12
|
-
Value: string;
|
|
13
|
-
};
|
|
14
|
-
type AsyncMultiSelectPayload = {
|
|
15
|
-
query: string | null;
|
|
16
|
-
initialValues?: number[] | null;
|
|
17
|
-
};
|
|
18
|
-
type OptionItem2 = {
|
|
19
|
-
Label: string;
|
|
20
|
-
Value: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type { AsyncSelectPayload as A, OptionItem as O, AsyncSelectMultiPayload as a, AsyncMultiSelectPayload as b, OptionItem2 as c };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type AsyncSelectPayload = {
|
|
2
|
-
query: string | null;
|
|
3
|
-
initialValue?: number | null;
|
|
4
|
-
};
|
|
5
|
-
type AsyncSelectMultiPayload = {
|
|
6
|
-
query: string | null;
|
|
7
|
-
initialValues?: number[] | null;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type OptionItem = {
|
|
11
|
-
Label: string;
|
|
12
|
-
Value: string;
|
|
13
|
-
};
|
|
14
|
-
type AsyncMultiSelectPayload = {
|
|
15
|
-
query: string | null;
|
|
16
|
-
initialValues?: number[] | null;
|
|
17
|
-
};
|
|
18
|
-
type OptionItem2 = {
|
|
19
|
-
Label: string;
|
|
20
|
-
Value: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type { AsyncSelectPayload as A, OptionItem as O, AsyncSelectMultiPayload as a, AsyncMultiSelectPayload as b, OptionItem2 as c };
|