@gnwebsoft/ui 2.18.40 → 2.18.42
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 → AsyncSelectPayload-Cz4bgak0.d.mts} +2 -2
- package/dist/{AsyncSelectPayload-CiwoX8EE.d.ts → AsyncSelectPayload-Cz4bgak0.d.ts} +2 -2
- package/dist/{OptionItem-BSg3KSRJ.d.mts → OptionItem-8fG5uP-B.d.mts} +1 -1
- package/dist/{OptionItem-BSg3KSRJ.d.ts → OptionItem-8fG5uP-B.d.ts} +1 -1
- package/dist/{chunk-DKBPCLEC.js → chunk-FYN7F5WJ.js} +0 -2
- package/dist/{chunk-AVNKSUE5.mjs → chunk-GAYZ4QSD.mjs} +0 -2
- package/dist/{chunk-STC2BZ2L.js → chunk-IZSKZD5M.js} +3 -3
- package/dist/{chunk-RVKKPXZC.mjs → chunk-KB3ODFZD.mjs} +77 -61
- package/dist/{chunk-34X2YRTY.mjs → chunk-MM6OQZAY.mjs} +1 -1
- package/dist/{chunk-VNU4ZOUE.js → chunk-WCNR24BM.js} +76 -60
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wrappers/index.d.mts +11 -21
- package/dist/wrappers/index.d.ts +11 -21
- package/dist/wrappers/index.js +3 -3
- package/dist/wrappers/index.mjs +2 -2
- package/dist/wrappers2/index.d.mts +2 -2
- package/dist/wrappers2/index.d.ts +2 -2
- package/dist/wrappers2/index.js +3 -3
- package/dist/wrappers2/index.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type AsyncSelectPayload = {
|
|
2
2
|
query: string | null;
|
|
3
|
-
initialValue?: number | null;
|
|
3
|
+
initialValue?: string | number | null;
|
|
4
4
|
};
|
|
5
5
|
type AsyncSelectMultiPayload = {
|
|
6
6
|
query: string | null;
|
|
7
|
-
initialValues?: number[] | null;
|
|
7
|
+
initialValues?: string[] | number[] | null;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export type { AsyncSelectPayload as A, AsyncSelectMultiPayload as a };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type AsyncSelectPayload = {
|
|
2
2
|
query: string | null;
|
|
3
|
-
initialValue?: number | null;
|
|
3
|
+
initialValue?: string | number | null;
|
|
4
4
|
};
|
|
5
5
|
type AsyncSelectMultiPayload = {
|
|
6
6
|
query: string | null;
|
|
7
|
-
initialValues?: number[] | null;
|
|
7
|
+
initialValues?: string[] | number[] | null;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export type { AsyncSelectPayload as A, AsyncSelectMultiPayload as a };
|
|
@@ -86,7 +86,6 @@ var api = class {
|
|
|
86
86
|
...options
|
|
87
87
|
};
|
|
88
88
|
const result = await fetch(url, alteredOptions);
|
|
89
|
-
console.log("result", result);
|
|
90
89
|
return result;
|
|
91
90
|
}
|
|
92
91
|
static async tempFetch(url, options = {}) {
|
|
@@ -200,7 +199,6 @@ var api2 = class {
|
|
|
200
199
|
...options
|
|
201
200
|
};
|
|
202
201
|
const result = await fetch(url, alteredOptions);
|
|
203
|
-
console.log("result", result);
|
|
204
202
|
return result;
|
|
205
203
|
}
|
|
206
204
|
static async tempFetch(url, options = {}) {
|
|
@@ -86,7 +86,6 @@ var api = class {
|
|
|
86
86
|
...options
|
|
87
87
|
};
|
|
88
88
|
const result = await fetch(url, alteredOptions);
|
|
89
|
-
console.log("result", result);
|
|
90
89
|
return result;
|
|
91
90
|
}
|
|
92
91
|
static async tempFetch(url, options = {}) {
|
|
@@ -200,7 +199,6 @@ var api2 = class {
|
|
|
200
199
|
...options
|
|
201
200
|
};
|
|
202
201
|
const result = await fetch(url, alteredOptions);
|
|
203
|
-
console.log("result", result);
|
|
204
202
|
return result;
|
|
205
203
|
}
|
|
206
204
|
static async tempFetch(url, options = {}) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFYN7F5WJjs = require('./chunk-FYN7F5WJ.js');
|
|
7
7
|
|
|
8
8
|
// src/wrappers2/DatePickerElement/DatePickerElement.tsx
|
|
9
9
|
|
|
@@ -46,7 +46,7 @@ var Component = function DatePickerElement(props) {
|
|
|
46
46
|
value: field.value,
|
|
47
47
|
onChange: field.onChange,
|
|
48
48
|
transform: {
|
|
49
|
-
input: typeof _optionalChain([transform, 'optionalAccess', _3 => _3.input]) === "function" ? transform.input : (newValue) =>
|
|
49
|
+
input: typeof _optionalChain([transform, 'optionalAccess', _3 => _3.input]) === "function" ? transform.input : (newValue) => _chunkFYN7F5WJjs.readValueAsDate.call(void 0, adapter, newValue),
|
|
50
50
|
output: typeof _optionalChain([transform, 'optionalAccess', _4 => _4.output]) === "function" ? transform.output : (newValue) => newValue
|
|
51
51
|
}
|
|
52
52
|
});
|
|
@@ -506,7 +506,7 @@ var Component5 = function TimePickerElement(props) {
|
|
|
506
506
|
value: field.value,
|
|
507
507
|
onChange: field.onChange,
|
|
508
508
|
transform: {
|
|
509
|
-
input: typeof _optionalChain([transform, 'optionalAccess', _15 => _15.input]) === "function" ? transform.input : (newValue) =>
|
|
509
|
+
input: typeof _optionalChain([transform, 'optionalAccess', _15 => _15.input]) === "function" ? transform.input : (newValue) => _chunkFYN7F5WJjs.readValueAsDate.call(void 0, adapter, newValue),
|
|
510
510
|
output: typeof _optionalChain([transform, 'optionalAccess', _16 => _16.output]) === "function" ? transform.output : (newValue) => newValue
|
|
511
511
|
}
|
|
512
512
|
});
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-GFSTK7KN.mjs";
|
|
4
4
|
import {
|
|
5
5
|
readValueAsDate
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GAYZ4QSD.mjs";
|
|
7
7
|
|
|
8
8
|
// src/wrappers/DatePickerElement/DatePickerElement.tsx
|
|
9
9
|
import { useMemo, useCallback } from "react";
|
|
@@ -122,7 +122,7 @@ var DatePickerElement2 = ({
|
|
|
122
122
|
...props
|
|
123
123
|
}) => {
|
|
124
124
|
if (gridProps) {
|
|
125
|
-
return /* @__PURE__ */ jsx(Grid2, { ...gridProps, children: /* @__PURE__ */ jsx(Component, { ...props }) });
|
|
125
|
+
return /* @__PURE__ */ jsx(Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx(Component, { ...props }) });
|
|
126
126
|
}
|
|
127
127
|
return /* @__PURE__ */ jsx(Component, { ...props });
|
|
128
128
|
};
|
|
@@ -220,7 +220,7 @@ var PasswordElement = ({
|
|
|
220
220
|
...props
|
|
221
221
|
}) => {
|
|
222
222
|
if (gridProps) {
|
|
223
|
-
return /* @__PURE__ */ jsx2(Grid22, { ...gridProps, children: /* @__PURE__ */ jsx2(Component2, { ...props }) });
|
|
223
|
+
return /* @__PURE__ */ jsx2(Grid22, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx2(Component2, { ...props }) });
|
|
224
224
|
}
|
|
225
225
|
return /* @__PURE__ */ jsx2(Component2, { ...props });
|
|
226
226
|
};
|
|
@@ -363,7 +363,7 @@ var RadioButtonGroup2 = ({
|
|
|
363
363
|
...props
|
|
364
364
|
}) => {
|
|
365
365
|
if (gridProps) {
|
|
366
|
-
return /* @__PURE__ */ jsx3(Grid23, { ...gridProps, children: /* @__PURE__ */ jsx3(Component3, { ...props }) });
|
|
366
|
+
return /* @__PURE__ */ jsx3(Grid23, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx3(Component3, { ...props }) });
|
|
367
367
|
}
|
|
368
368
|
return /* @__PURE__ */ jsx3(Component3, { ...props });
|
|
369
369
|
};
|
|
@@ -483,7 +483,7 @@ var TextFieldElement2 = ({
|
|
|
483
483
|
...props
|
|
484
484
|
}) => {
|
|
485
485
|
if (gridProps) {
|
|
486
|
-
return /* @__PURE__ */ jsx4(Grid24, { ...gridProps, children: /* @__PURE__ */ jsx4(Component4, { ...props }) });
|
|
486
|
+
return /* @__PURE__ */ jsx4(Grid24, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx4(Component4, { ...props }) });
|
|
487
487
|
}
|
|
488
488
|
return /* @__PURE__ */ jsx4(Component4, { ...props });
|
|
489
489
|
};
|
|
@@ -574,28 +574,21 @@ var TimePickerElement2 = ({
|
|
|
574
574
|
...props
|
|
575
575
|
}) => {
|
|
576
576
|
if (gridProps) {
|
|
577
|
-
return /* @__PURE__ */ jsx5(Grid25, { ...gridProps, children: /* @__PURE__ */ jsx5(Component5, { ...props }) });
|
|
577
|
+
return /* @__PURE__ */ jsx5(Grid25, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx5(Component5, { ...props }) });
|
|
578
578
|
}
|
|
579
579
|
return /* @__PURE__ */ jsx5(Component5, { ...props });
|
|
580
580
|
};
|
|
581
581
|
TimePickerElement2.displayName = "TimePickerElement";
|
|
582
582
|
var TimePickerElement_default = TimePickerElement2;
|
|
583
583
|
|
|
584
|
-
// src/wrappers/AsyncSelect/
|
|
584
|
+
// src/wrappers/AsyncSelect/AsyncSelectElement.tsx
|
|
585
585
|
import * as React from "react";
|
|
586
|
+
import { useController as useController6 } from "react-hook-form";
|
|
587
|
+
import { useRef, useMemo as useMemo2, Fragment, useState as useState2, useEffect as useEffect2, useCallback as useCallback2 } from "react";
|
|
588
|
+
import { debounce } from "@mui/material/utils";
|
|
586
589
|
import TextField3 from "@mui/material/TextField";
|
|
587
590
|
import Autocomplete from "@mui/material/Autocomplete";
|
|
588
|
-
import {
|
|
589
|
-
import {
|
|
590
|
-
Fragment,
|
|
591
|
-
useCallback as useCallback2,
|
|
592
|
-
useEffect as useEffect2,
|
|
593
|
-
useMemo as useMemo2,
|
|
594
|
-
useRef,
|
|
595
|
-
useState as useState2
|
|
596
|
-
} from "react";
|
|
597
|
-
import { useController as useController6 } from "react-hook-form";
|
|
598
|
-
import { CircularProgress, Grid2 as Grid26, useTheme as useTheme3 } from "@mui/material";
|
|
591
|
+
import { Grid2 as Grid26, useTheme as useTheme3, CircularProgress } from "@mui/material";
|
|
599
592
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
600
593
|
var Component6 = function AsyncSelectElement(props) {
|
|
601
594
|
const {
|
|
@@ -609,6 +602,8 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
609
602
|
label,
|
|
610
603
|
queryFn,
|
|
611
604
|
variant,
|
|
605
|
+
labelKey = "Label",
|
|
606
|
+
valueKey = "Value",
|
|
612
607
|
sx,
|
|
613
608
|
...rest
|
|
614
609
|
} = props;
|
|
@@ -624,22 +619,16 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
624
619
|
const [selectedOption, setSelectedOption] = useState2(null);
|
|
625
620
|
const [inputValue, setInputValue] = useState2("");
|
|
626
621
|
const inputValue2 = useMemo2(() => inputValue, [inputValue]);
|
|
627
|
-
const setInputValue2 = useCallback2(
|
|
628
|
-
(inputValue3) => setInputValue(inputValue3),
|
|
629
|
-
[]
|
|
630
|
-
);
|
|
622
|
+
const setInputValue2 = useCallback2((newValue) => setInputValue(newValue), []);
|
|
631
623
|
const [options, setOptions] = useState2([]);
|
|
632
624
|
const initialValueLoaded = useRef(
|
|
633
|
-
!initialValue ? true : !(initialValue != null
|
|
625
|
+
!initialValue ? true : !(initialValue != null)
|
|
634
626
|
);
|
|
635
627
|
const fieldValue = useRef(field.value);
|
|
636
628
|
const fetchData = useMemo2(
|
|
637
|
-
() => debounce(
|
|
638
|
-
(payload
|
|
639
|
-
|
|
640
|
-
},
|
|
641
|
-
400
|
|
642
|
-
),
|
|
629
|
+
() => debounce((payload, callback) => {
|
|
630
|
+
queryFn(payload).then((c) => callback(c));
|
|
631
|
+
}, 400),
|
|
643
632
|
[]
|
|
644
633
|
);
|
|
645
634
|
const fillOptions = (results) => {
|
|
@@ -684,7 +673,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
684
673
|
setLoading(false);
|
|
685
674
|
return void 0;
|
|
686
675
|
}
|
|
687
|
-
if (
|
|
676
|
+
if (fieldValue.current) {
|
|
688
677
|
if (field.value === fieldValue.current) {
|
|
689
678
|
return void 0;
|
|
690
679
|
}
|
|
@@ -704,16 +693,16 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
704
693
|
};
|
|
705
694
|
}, [initialValue, inputValue2, fetchData]);
|
|
706
695
|
const selectRef = useRef(null);
|
|
707
|
-
const handleChange = (_2,
|
|
696
|
+
const handleChange = (_2, newSelectedOption, reason) => {
|
|
708
697
|
if (reason === "clear") {
|
|
709
698
|
setSelectedOption(null);
|
|
710
699
|
field.onChange(null);
|
|
711
700
|
setLoading(false);
|
|
712
701
|
} else if (reason === "selectOption" || reason === "removeOption") {
|
|
713
|
-
if (
|
|
714
|
-
setSelectedOption(
|
|
715
|
-
field.onChange(
|
|
716
|
-
fieldValue.current =
|
|
702
|
+
if (newSelectedOption) {
|
|
703
|
+
setSelectedOption(newSelectedOption);
|
|
704
|
+
field.onChange(newSelectedOption.Value);
|
|
705
|
+
fieldValue.current = newSelectedOption.Value;
|
|
717
706
|
setLoading(false);
|
|
718
707
|
}
|
|
719
708
|
}
|
|
@@ -727,6 +716,14 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
727
716
|
setLoading(false);
|
|
728
717
|
}
|
|
729
718
|
}, [field.value]);
|
|
719
|
+
const getOptionValue = (option) => {
|
|
720
|
+
if (typeof option === "string") return option;
|
|
721
|
+
return option ? option[valueKey] : null;
|
|
722
|
+
};
|
|
723
|
+
const getOptionLabel = (option) => {
|
|
724
|
+
if (typeof option === "string") return option;
|
|
725
|
+
return option ? option[labelKey] : "";
|
|
726
|
+
};
|
|
730
727
|
return /* @__PURE__ */ jsx6(
|
|
731
728
|
Autocomplete,
|
|
732
729
|
{
|
|
@@ -734,13 +731,14 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
734
731
|
ref: selectRef,
|
|
735
732
|
fullWidth: true,
|
|
736
733
|
loading,
|
|
737
|
-
getOptionLabel
|
|
738
|
-
getOptionKey:
|
|
739
|
-
isOptionEqualToValue: (option,
|
|
734
|
+
getOptionLabel,
|
|
735
|
+
getOptionKey: getOptionValue,
|
|
736
|
+
isOptionEqualToValue: (option, value) => getOptionValue(option) === getOptionValue(value),
|
|
740
737
|
autoComplete: true,
|
|
741
738
|
disabled,
|
|
742
739
|
includeInputInList: true,
|
|
743
740
|
options,
|
|
741
|
+
filterOptions: (x) => x,
|
|
744
742
|
value: selectedOption,
|
|
745
743
|
filterSelectedOptions: true,
|
|
746
744
|
onChange: handleChange,
|
|
@@ -775,8 +773,8 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
775
773
|
}
|
|
776
774
|
}
|
|
777
775
|
),
|
|
778
|
-
renderOption: (
|
|
779
|
-
const { key, ...optionProps } =
|
|
776
|
+
renderOption: (renderProps, option) => {
|
|
777
|
+
const { key, ...optionProps } = renderProps;
|
|
780
778
|
return /* @__PURE__ */ jsx6("li", { ...optionProps, children: option.Label }, key);
|
|
781
779
|
}
|
|
782
780
|
}
|
|
@@ -787,12 +785,12 @@ var AsyncSelectElement2 = ({
|
|
|
787
785
|
...props
|
|
788
786
|
}) => {
|
|
789
787
|
if (gridProps) {
|
|
790
|
-
return /* @__PURE__ */ jsx6(Grid26, { ...gridProps, children: /* @__PURE__ */ jsx6(Component6, { ...props }) });
|
|
788
|
+
return /* @__PURE__ */ jsx6(Grid26, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx6(Component6, { ...props }) });
|
|
791
789
|
}
|
|
792
790
|
return /* @__PURE__ */ jsx6(Component6, { ...props });
|
|
793
791
|
};
|
|
794
792
|
AsyncSelectElement2.displayName = "AsyncSelectElement";
|
|
795
|
-
var
|
|
793
|
+
var AsyncSelectElement_default = AsyncSelectElement2;
|
|
796
794
|
|
|
797
795
|
// src/wrappers/AsyncMultiSelect/AsyncMultiSelect.tsx
|
|
798
796
|
import _ from "lodash";
|
|
@@ -995,7 +993,13 @@ var AsyncSelectMultiElement2 = ({
|
|
|
995
993
|
...props
|
|
996
994
|
}) => {
|
|
997
995
|
if (gridProps) {
|
|
998
|
-
return /* @__PURE__ */ jsx7(
|
|
996
|
+
return /* @__PURE__ */ jsx7(
|
|
997
|
+
Grid27,
|
|
998
|
+
{
|
|
999
|
+
...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps },
|
|
1000
|
+
children: /* @__PURE__ */ jsx7(Component7, { ...props })
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
999
1003
|
}
|
|
1000
1004
|
return /* @__PURE__ */ jsx7(Component7, { ...props });
|
|
1001
1005
|
};
|
|
@@ -1003,7 +1007,11 @@ AsyncSelectMultiElement2.displayName = "AsyncSelectMulti";
|
|
|
1003
1007
|
var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
1004
1008
|
|
|
1005
1009
|
// src/wrappers/SelectElement/SelectElement.tsx
|
|
1006
|
-
import {
|
|
1010
|
+
import {
|
|
1011
|
+
useMemo as useMemo4,
|
|
1012
|
+
useEffect as useEffect4,
|
|
1013
|
+
useCallback as useCallback4
|
|
1014
|
+
} from "react";
|
|
1007
1015
|
import {
|
|
1008
1016
|
useController as useController8
|
|
1009
1017
|
} from "react-hook-form";
|
|
@@ -1108,7 +1116,13 @@ var SelectElement2 = ({
|
|
|
1108
1116
|
...props
|
|
1109
1117
|
}) => {
|
|
1110
1118
|
if (gridProps) {
|
|
1111
|
-
return /* @__PURE__ */ jsx8(
|
|
1119
|
+
return /* @__PURE__ */ jsx8(
|
|
1120
|
+
Grid28,
|
|
1121
|
+
{
|
|
1122
|
+
...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps },
|
|
1123
|
+
children: /* @__PURE__ */ jsx8(Component8, { ...props })
|
|
1124
|
+
}
|
|
1125
|
+
);
|
|
1112
1126
|
}
|
|
1113
1127
|
return /* @__PURE__ */ jsx8(Component8, { ...props });
|
|
1114
1128
|
};
|
|
@@ -1224,7 +1238,7 @@ var SelectMultiElement2 = ({
|
|
|
1224
1238
|
...props
|
|
1225
1239
|
}) => {
|
|
1226
1240
|
if (gridProps) {
|
|
1227
|
-
return /* @__PURE__ */ jsx9(Grid29, { ...gridProps, children: /* @__PURE__ */ jsx9(Component9, { ...props }) });
|
|
1241
|
+
return /* @__PURE__ */ jsx9(Grid29, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx9(Component9, { ...props }) });
|
|
1228
1242
|
}
|
|
1229
1243
|
return /* @__PURE__ */ jsx9(Component9, { ...props });
|
|
1230
1244
|
};
|
|
@@ -1243,7 +1257,7 @@ import {
|
|
|
1243
1257
|
Autocomplete as Autocomplete5
|
|
1244
1258
|
} from "@mui/material";
|
|
1245
1259
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1246
|
-
var Component10 = function
|
|
1260
|
+
var Component10 = function SelectCascadeElement(props) {
|
|
1247
1261
|
const {
|
|
1248
1262
|
labelKey = "Label",
|
|
1249
1263
|
valueKey = "Value",
|
|
@@ -1293,12 +1307,13 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1293
1307
|
control
|
|
1294
1308
|
});
|
|
1295
1309
|
const parentValueRef = useRef3(dependentField.value ?? null);
|
|
1310
|
+
const [hasAutoSelected, setHasAutoSelected] = useState4(false);
|
|
1296
1311
|
useEffect5(() => {
|
|
1297
1312
|
if (!!dependentField.value && parentValueRef?.current !== dependentField.value || dependentField.value === null) {
|
|
1298
1313
|
field.onChange(null);
|
|
1314
|
+
setHasAutoSelected(false);
|
|
1299
1315
|
}
|
|
1300
|
-
}, [dependentField.value
|
|
1301
|
-
const [hasAutoSelected, setHasAutoSelected] = useState4(false);
|
|
1316
|
+
}, [dependentField.value]);
|
|
1302
1317
|
useEffect5(() => {
|
|
1303
1318
|
if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1304
1319
|
field.onChange(getOptionKey(options[0]));
|
|
@@ -1317,7 +1332,8 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1317
1332
|
isEdit,
|
|
1318
1333
|
disabled,
|
|
1319
1334
|
field,
|
|
1320
|
-
getOptionKey
|
|
1335
|
+
getOptionKey,
|
|
1336
|
+
dependentField.onChange
|
|
1321
1337
|
]);
|
|
1322
1338
|
return /* @__PURE__ */ jsx10(
|
|
1323
1339
|
Autocomplete5,
|
|
@@ -1331,7 +1347,7 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1331
1347
|
getOptionLabel,
|
|
1332
1348
|
isOptionEqualToValue,
|
|
1333
1349
|
ref: field.ref,
|
|
1334
|
-
disabled,
|
|
1350
|
+
disabled: dependentField.value == null || disabled,
|
|
1335
1351
|
onChange: (event, newValue, reason) => {
|
|
1336
1352
|
field.onChange(newValue ? getOptionKey(newValue) : null);
|
|
1337
1353
|
if (onChange && typeof onChange === "function") {
|
|
@@ -1358,11 +1374,11 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1358
1374
|
variant: variant ? variant : "outlined",
|
|
1359
1375
|
sx: {
|
|
1360
1376
|
"& .MuiOutlinedInput-root": {
|
|
1361
|
-
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
1377
|
+
bgcolor: disabled || dependentField.value == null ? theme.palette.action.disabledBackground : "transparent"
|
|
1362
1378
|
},
|
|
1363
1379
|
"& .MuiInputLabel-asterisk": { color: "red" },
|
|
1364
1380
|
"& .MuiInputBase-input": {
|
|
1365
|
-
cursor: disabled ? "not-allowed" : "default"
|
|
1381
|
+
cursor: disabled || dependentField.value == null ? "not-allowed" : "default"
|
|
1366
1382
|
},
|
|
1367
1383
|
...sx
|
|
1368
1384
|
}
|
|
@@ -1371,17 +1387,17 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1371
1387
|
}
|
|
1372
1388
|
);
|
|
1373
1389
|
};
|
|
1374
|
-
var
|
|
1375
|
-
gridProps,
|
|
1390
|
+
var SelectCascadeElement2 = ({
|
|
1391
|
+
gridProps = { size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 } },
|
|
1376
1392
|
...props
|
|
1377
1393
|
}) => {
|
|
1378
1394
|
if (gridProps) {
|
|
1379
|
-
return /* @__PURE__ */ jsx10(Grid210, { ...gridProps, children: /* @__PURE__ */ jsx10(Component10, { ...props }) });
|
|
1395
|
+
return /* @__PURE__ */ jsx10(Grid210, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx10(Component10, { ...props }) });
|
|
1380
1396
|
}
|
|
1381
1397
|
return /* @__PURE__ */ jsx10(Component10, { ...props });
|
|
1382
1398
|
};
|
|
1383
|
-
|
|
1384
|
-
var SelectCascadeElement_default =
|
|
1399
|
+
SelectCascadeElement2.displayName = "SelectCascadeElement";
|
|
1400
|
+
var SelectCascadeElement_default = SelectCascadeElement2;
|
|
1385
1401
|
|
|
1386
1402
|
// src/wrappers/CheckboxElement/CheckboxElement.tsx
|
|
1387
1403
|
import {
|
|
@@ -1443,7 +1459,7 @@ var CheckboxElement2 = ({
|
|
|
1443
1459
|
...props
|
|
1444
1460
|
}) => {
|
|
1445
1461
|
if (gridProps) {
|
|
1446
|
-
return /* @__PURE__ */ jsx11(Grid211, { ...gridProps, children: /* @__PURE__ */ jsx11(Component11, { ...props }) });
|
|
1462
|
+
return /* @__PURE__ */ jsx11(Grid211, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx11(Component11, { ...props }) });
|
|
1447
1463
|
}
|
|
1448
1464
|
return /* @__PURE__ */ jsx11(Component11, { ...props });
|
|
1449
1465
|
};
|
|
@@ -1521,7 +1537,7 @@ var CheckboxGroup2 = ({
|
|
|
1521
1537
|
...props
|
|
1522
1538
|
}) => {
|
|
1523
1539
|
if (gridProps) {
|
|
1524
|
-
return /* @__PURE__ */ jsx12(Grid212, { ...gridProps, children: /* @__PURE__ */ jsx12(Component12, { ...props }) });
|
|
1540
|
+
return /* @__PURE__ */ jsx12(Grid212, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ jsx12(Component12, { ...props }) });
|
|
1525
1541
|
}
|
|
1526
1542
|
return /* @__PURE__ */ jsx12(Component12, { ...props });
|
|
1527
1543
|
};
|
|
@@ -1539,7 +1555,7 @@ var Field = {
|
|
|
1539
1555
|
Select: SelectElement_default,
|
|
1540
1556
|
SelectMulti: SelectMultiElement_default,
|
|
1541
1557
|
SelectCascade: SelectCascadeElement_default,
|
|
1542
|
-
AsyncSelect:
|
|
1558
|
+
AsyncSelect: AsyncSelectElement_default,
|
|
1543
1559
|
AsyncMultiSelect: AsyncMultiSelect_default,
|
|
1544
1560
|
CheckboxGroup: CheckboxGroup_default
|
|
1545
1561
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFYN7F5WJjs = require('./chunk-FYN7F5WJ.js');
|
|
7
7
|
|
|
8
8
|
// src/wrappers/DatePickerElement/DatePickerElement.tsx
|
|
9
9
|
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
@@ -122,7 +122,7 @@ var DatePickerElement2 = ({
|
|
|
122
122
|
...props
|
|
123
123
|
}) => {
|
|
124
124
|
if (gridProps) {
|
|
125
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, { ...props }) });
|
|
125
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, { ...props }) });
|
|
126
126
|
}
|
|
127
127
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, { ...props });
|
|
128
128
|
};
|
|
@@ -220,7 +220,7 @@ var PasswordElement = ({
|
|
|
220
220
|
...props
|
|
221
221
|
}) => {
|
|
222
222
|
if (gridProps) {
|
|
223
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { ...props }) });
|
|
223
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { ...props }) });
|
|
224
224
|
}
|
|
225
225
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { ...props });
|
|
226
226
|
};
|
|
@@ -363,7 +363,7 @@ var RadioButtonGroup2 = ({
|
|
|
363
363
|
...props
|
|
364
364
|
}) => {
|
|
365
365
|
if (gridProps) {
|
|
366
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component3, { ...props }) });
|
|
366
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component3, { ...props }) });
|
|
367
367
|
}
|
|
368
368
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component3, { ...props });
|
|
369
369
|
};
|
|
@@ -483,7 +483,7 @@ var TextFieldElement2 = ({
|
|
|
483
483
|
...props
|
|
484
484
|
}) => {
|
|
485
485
|
if (gridProps) {
|
|
486
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component4, { ...props }) });
|
|
486
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component4, { ...props }) });
|
|
487
487
|
}
|
|
488
488
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component4, { ...props });
|
|
489
489
|
};
|
|
@@ -528,7 +528,7 @@ var Component5 = function TimePickerElement(props) {
|
|
|
528
528
|
value: field.value,
|
|
529
529
|
onChange: field.onChange,
|
|
530
530
|
transform: {
|
|
531
|
-
input: typeof _optionalChain([transform, 'optionalAccess', _17 => _17.input]) === "function" ? transform.input : (newValue) =>
|
|
531
|
+
input: typeof _optionalChain([transform, 'optionalAccess', _17 => _17.input]) === "function" ? transform.input : (newValue) => _chunkFYN7F5WJjs.readValueAsDate.call(void 0, adapter, newValue),
|
|
532
532
|
output: typeof _optionalChain([transform, 'optionalAccess', _18 => _18.output]) === "function" ? transform.output : (newValue) => newValue
|
|
533
533
|
}
|
|
534
534
|
});
|
|
@@ -574,27 +574,20 @@ var TimePickerElement2 = ({
|
|
|
574
574
|
...props
|
|
575
575
|
}) => {
|
|
576
576
|
if (gridProps) {
|
|
577
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component5, { ...props }) });
|
|
577
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component5, { ...props }) });
|
|
578
578
|
}
|
|
579
579
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component5, { ...props });
|
|
580
580
|
};
|
|
581
581
|
TimePickerElement2.displayName = "TimePickerElement";
|
|
582
582
|
var TimePickerElement_default = TimePickerElement2;
|
|
583
583
|
|
|
584
|
-
// src/wrappers/AsyncSelect/
|
|
585
|
-
|
|
586
|
-
var _TextField = require('@mui/material/TextField'); var _TextField2 = _interopRequireDefault(_TextField);
|
|
587
|
-
var _Autocomplete = require('@mui/material/Autocomplete'); var _Autocomplete2 = _interopRequireDefault(_Autocomplete);
|
|
588
|
-
var _utils = require('@mui/material/utils');
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
584
|
+
// src/wrappers/AsyncSelect/AsyncSelectElement.tsx
|
|
595
585
|
|
|
596
586
|
|
|
597
587
|
|
|
588
|
+
var _utils = require('@mui/material/utils');
|
|
589
|
+
var _TextField = require('@mui/material/TextField'); var _TextField2 = _interopRequireDefault(_TextField);
|
|
590
|
+
var _Autocomplete = require('@mui/material/Autocomplete'); var _Autocomplete2 = _interopRequireDefault(_Autocomplete);
|
|
598
591
|
|
|
599
592
|
|
|
600
593
|
var Component6 = function AsyncSelectElement(props) {
|
|
@@ -609,6 +602,8 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
609
602
|
label,
|
|
610
603
|
queryFn,
|
|
611
604
|
variant,
|
|
605
|
+
labelKey = "Label",
|
|
606
|
+
valueKey = "Value",
|
|
612
607
|
sx,
|
|
613
608
|
...rest
|
|
614
609
|
} = props;
|
|
@@ -624,22 +619,16 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
624
619
|
const [selectedOption, setSelectedOption] = _react.useState.call(void 0, null);
|
|
625
620
|
const [inputValue, setInputValue] = _react.useState.call(void 0, "");
|
|
626
621
|
const inputValue2 = _react.useMemo.call(void 0, () => inputValue, [inputValue]);
|
|
627
|
-
const setInputValue2 = _react.useCallback.call(void 0,
|
|
628
|
-
(inputValue3) => setInputValue(inputValue3),
|
|
629
|
-
[]
|
|
630
|
-
);
|
|
622
|
+
const setInputValue2 = _react.useCallback.call(void 0, (newValue) => setInputValue(newValue), []);
|
|
631
623
|
const [options, setOptions] = _react.useState.call(void 0, []);
|
|
632
624
|
const initialValueLoaded = _react.useRef.call(void 0,
|
|
633
|
-
!initialValue ? true : !(initialValue != null
|
|
625
|
+
!initialValue ? true : !(initialValue != null)
|
|
634
626
|
);
|
|
635
627
|
const fieldValue = _react.useRef.call(void 0, field.value);
|
|
636
628
|
const fetchData = _react.useMemo.call(void 0,
|
|
637
|
-
() => _utils.debounce.call(void 0,
|
|
638
|
-
(payload
|
|
639
|
-
|
|
640
|
-
},
|
|
641
|
-
400
|
|
642
|
-
),
|
|
629
|
+
() => _utils.debounce.call(void 0, (payload, callback) => {
|
|
630
|
+
queryFn(payload).then((c) => callback(c));
|
|
631
|
+
}, 400),
|
|
643
632
|
[]
|
|
644
633
|
);
|
|
645
634
|
const fillOptions = (results) => {
|
|
@@ -684,7 +673,7 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
684
673
|
setLoading(false);
|
|
685
674
|
return void 0;
|
|
686
675
|
}
|
|
687
|
-
if (
|
|
676
|
+
if (fieldValue.current) {
|
|
688
677
|
if (field.value === fieldValue.current) {
|
|
689
678
|
return void 0;
|
|
690
679
|
}
|
|
@@ -704,16 +693,16 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
704
693
|
};
|
|
705
694
|
}, [initialValue, inputValue2, fetchData]);
|
|
706
695
|
const selectRef = _react.useRef.call(void 0, null);
|
|
707
|
-
const handleChange = (_2,
|
|
696
|
+
const handleChange = (_2, newSelectedOption, reason) => {
|
|
708
697
|
if (reason === "clear") {
|
|
709
698
|
setSelectedOption(null);
|
|
710
699
|
field.onChange(null);
|
|
711
700
|
setLoading(false);
|
|
712
701
|
} else if (reason === "selectOption" || reason === "removeOption") {
|
|
713
|
-
if (
|
|
714
|
-
setSelectedOption(
|
|
715
|
-
field.onChange(
|
|
716
|
-
fieldValue.current =
|
|
702
|
+
if (newSelectedOption) {
|
|
703
|
+
setSelectedOption(newSelectedOption);
|
|
704
|
+
field.onChange(newSelectedOption.Value);
|
|
705
|
+
fieldValue.current = newSelectedOption.Value;
|
|
717
706
|
setLoading(false);
|
|
718
707
|
}
|
|
719
708
|
}
|
|
@@ -727,6 +716,14 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
727
716
|
setLoading(false);
|
|
728
717
|
}
|
|
729
718
|
}, [field.value]);
|
|
719
|
+
const getOptionValue = (option) => {
|
|
720
|
+
if (typeof option === "string") return option;
|
|
721
|
+
return option ? option[valueKey] : null;
|
|
722
|
+
};
|
|
723
|
+
const getOptionLabel = (option) => {
|
|
724
|
+
if (typeof option === "string") return option;
|
|
725
|
+
return option ? option[labelKey] : "";
|
|
726
|
+
};
|
|
730
727
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
731
728
|
_Autocomplete2.default,
|
|
732
729
|
{
|
|
@@ -734,13 +731,14 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
734
731
|
ref: selectRef,
|
|
735
732
|
fullWidth: true,
|
|
736
733
|
loading,
|
|
737
|
-
getOptionLabel
|
|
738
|
-
getOptionKey:
|
|
739
|
-
isOptionEqualToValue: (option,
|
|
734
|
+
getOptionLabel,
|
|
735
|
+
getOptionKey: getOptionValue,
|
|
736
|
+
isOptionEqualToValue: (option, value) => getOptionValue(option) === getOptionValue(value),
|
|
740
737
|
autoComplete: true,
|
|
741
738
|
disabled,
|
|
742
739
|
includeInputInList: true,
|
|
743
740
|
options,
|
|
741
|
+
filterOptions: (x) => x,
|
|
744
742
|
value: selectedOption,
|
|
745
743
|
filterSelectedOptions: true,
|
|
746
744
|
onChange: handleChange,
|
|
@@ -775,8 +773,8 @@ var Component6 = function AsyncSelectElement(props) {
|
|
|
775
773
|
}
|
|
776
774
|
}
|
|
777
775
|
),
|
|
778
|
-
renderOption: (
|
|
779
|
-
const { key, ...optionProps } =
|
|
776
|
+
renderOption: (renderProps, option) => {
|
|
777
|
+
const { key, ...optionProps } = renderProps;
|
|
780
778
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { ...optionProps, children: option.Label }, key);
|
|
781
779
|
}
|
|
782
780
|
}
|
|
@@ -787,12 +785,12 @@ var AsyncSelectElement2 = ({
|
|
|
787
785
|
...props
|
|
788
786
|
}) => {
|
|
789
787
|
if (gridProps) {
|
|
790
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component6, { ...props }) });
|
|
788
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component6, { ...props }) });
|
|
791
789
|
}
|
|
792
790
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component6, { ...props });
|
|
793
791
|
};
|
|
794
792
|
AsyncSelectElement2.displayName = "AsyncSelectElement";
|
|
795
|
-
var
|
|
793
|
+
var AsyncSelectElement_default = AsyncSelectElement2;
|
|
796
794
|
|
|
797
795
|
// src/wrappers/AsyncMultiSelect/AsyncMultiSelect.tsx
|
|
798
796
|
var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);
|
|
@@ -995,7 +993,13 @@ var AsyncSelectMultiElement2 = ({
|
|
|
995
993
|
...props
|
|
996
994
|
}) => {
|
|
997
995
|
if (gridProps) {
|
|
998
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
996
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
997
|
+
_material.Grid2,
|
|
998
|
+
{
|
|
999
|
+
...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps },
|
|
1000
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component7, { ...props })
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
999
1003
|
}
|
|
1000
1004
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component7, { ...props });
|
|
1001
1005
|
};
|
|
@@ -1009,6 +1013,10 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
|
|
|
1009
1013
|
|
|
1010
1014
|
|
|
1011
1015
|
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1012
1020
|
var Component8 = function SelectElement(props) {
|
|
1013
1021
|
const {
|
|
1014
1022
|
name,
|
|
@@ -1108,7 +1116,13 @@ var SelectElement2 = ({
|
|
|
1108
1116
|
...props
|
|
1109
1117
|
}) => {
|
|
1110
1118
|
if (gridProps) {
|
|
1111
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1119
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1120
|
+
_material.Grid2,
|
|
1121
|
+
{
|
|
1122
|
+
...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps },
|
|
1123
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component8, { ...props })
|
|
1124
|
+
}
|
|
1125
|
+
);
|
|
1112
1126
|
}
|
|
1113
1127
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component8, { ...props });
|
|
1114
1128
|
};
|
|
@@ -1224,7 +1238,7 @@ var SelectMultiElement2 = ({
|
|
|
1224
1238
|
...props
|
|
1225
1239
|
}) => {
|
|
1226
1240
|
if (gridProps) {
|
|
1227
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component9, { ...props }) });
|
|
1241
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component9, { ...props }) });
|
|
1228
1242
|
}
|
|
1229
1243
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component9, { ...props });
|
|
1230
1244
|
};
|
|
@@ -1243,7 +1257,7 @@ var SelectMultiElement_default = SelectMultiElement2;
|
|
|
1243
1257
|
|
|
1244
1258
|
|
|
1245
1259
|
|
|
1246
|
-
var Component10 = function
|
|
1260
|
+
var Component10 = function SelectCascadeElement(props) {
|
|
1247
1261
|
const {
|
|
1248
1262
|
labelKey = "Label",
|
|
1249
1263
|
valueKey = "Value",
|
|
@@ -1293,12 +1307,13 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1293
1307
|
control
|
|
1294
1308
|
});
|
|
1295
1309
|
const parentValueRef = _react.useRef.call(void 0, _nullishCoalesce(dependentField.value, () => ( null)));
|
|
1310
|
+
const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
|
|
1296
1311
|
_react.useEffect.call(void 0, () => {
|
|
1297
1312
|
if (!!dependentField.value && _optionalChain([parentValueRef, 'optionalAccess', _24 => _24.current]) !== dependentField.value || dependentField.value === null) {
|
|
1298
1313
|
field.onChange(null);
|
|
1314
|
+
setHasAutoSelected(false);
|
|
1299
1315
|
}
|
|
1300
|
-
}, [dependentField.value
|
|
1301
|
-
const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
|
|
1316
|
+
}, [dependentField.value]);
|
|
1302
1317
|
_react.useEffect.call(void 0, () => {
|
|
1303
1318
|
if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
|
|
1304
1319
|
field.onChange(getOptionKey(options[0]));
|
|
@@ -1317,7 +1332,8 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1317
1332
|
isEdit,
|
|
1318
1333
|
disabled,
|
|
1319
1334
|
field,
|
|
1320
|
-
getOptionKey
|
|
1335
|
+
getOptionKey,
|
|
1336
|
+
dependentField.onChange
|
|
1321
1337
|
]);
|
|
1322
1338
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1323
1339
|
_material.Autocomplete,
|
|
@@ -1331,7 +1347,7 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1331
1347
|
getOptionLabel,
|
|
1332
1348
|
isOptionEqualToValue,
|
|
1333
1349
|
ref: field.ref,
|
|
1334
|
-
disabled,
|
|
1350
|
+
disabled: dependentField.value == null || disabled,
|
|
1335
1351
|
onChange: (event, newValue, reason) => {
|
|
1336
1352
|
field.onChange(newValue ? getOptionKey(newValue) : null);
|
|
1337
1353
|
if (onChange && typeof onChange === "function") {
|
|
@@ -1358,11 +1374,11 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1358
1374
|
variant: variant ? variant : "outlined",
|
|
1359
1375
|
sx: {
|
|
1360
1376
|
"& .MuiOutlinedInput-root": {
|
|
1361
|
-
bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
|
|
1377
|
+
bgcolor: disabled || dependentField.value == null ? theme.palette.action.disabledBackground : "transparent"
|
|
1362
1378
|
},
|
|
1363
1379
|
"& .MuiInputLabel-asterisk": { color: "red" },
|
|
1364
1380
|
"& .MuiInputBase-input": {
|
|
1365
|
-
cursor: disabled ? "not-allowed" : "default"
|
|
1381
|
+
cursor: disabled || dependentField.value == null ? "not-allowed" : "default"
|
|
1366
1382
|
},
|
|
1367
1383
|
...sx
|
|
1368
1384
|
}
|
|
@@ -1371,17 +1387,17 @@ var Component10 = function SelectCascadeElement2(props) {
|
|
|
1371
1387
|
}
|
|
1372
1388
|
);
|
|
1373
1389
|
};
|
|
1374
|
-
var
|
|
1375
|
-
gridProps,
|
|
1390
|
+
var SelectCascadeElement2 = ({
|
|
1391
|
+
gridProps = { size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 } },
|
|
1376
1392
|
...props
|
|
1377
1393
|
}) => {
|
|
1378
1394
|
if (gridProps) {
|
|
1379
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component10, { ...props }) });
|
|
1395
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component10, { ...props }) });
|
|
1380
1396
|
}
|
|
1381
1397
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component10, { ...props });
|
|
1382
1398
|
};
|
|
1383
|
-
|
|
1384
|
-
var SelectCascadeElement_default =
|
|
1399
|
+
SelectCascadeElement2.displayName = "SelectCascadeElement";
|
|
1400
|
+
var SelectCascadeElement_default = SelectCascadeElement2;
|
|
1385
1401
|
|
|
1386
1402
|
// src/wrappers/CheckboxElement/CheckboxElement.tsx
|
|
1387
1403
|
|
|
@@ -1443,7 +1459,7 @@ var CheckboxElement2 = ({
|
|
|
1443
1459
|
...props
|
|
1444
1460
|
}) => {
|
|
1445
1461
|
if (gridProps) {
|
|
1446
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component11, { ...props }) });
|
|
1462
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component11, { ...props }) });
|
|
1447
1463
|
}
|
|
1448
1464
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component11, { ...props });
|
|
1449
1465
|
};
|
|
@@ -1521,7 +1537,7 @@ var CheckboxGroup2 = ({
|
|
|
1521
1537
|
...props
|
|
1522
1538
|
}) => {
|
|
1523
1539
|
if (gridProps) {
|
|
1524
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...gridProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component12, { ...props }) });
|
|
1540
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid2, { ...{ size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 }, ...gridProps }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component12, { ...props }) });
|
|
1525
1541
|
}
|
|
1526
1542
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component12, { ...props });
|
|
1527
1543
|
};
|
|
@@ -1539,7 +1555,7 @@ var Field = {
|
|
|
1539
1555
|
Select: SelectElement_default,
|
|
1540
1556
|
SelectMulti: SelectMultiElement_default,
|
|
1541
1557
|
SelectCascade: SelectCascadeElement_default,
|
|
1542
|
-
AsyncSelect:
|
|
1558
|
+
AsyncSelect: AsyncSelectElement_default,
|
|
1543
1559
|
AsyncMultiSelect: AsyncMultiSelect_default,
|
|
1544
1560
|
CheckboxGroup: CheckboxGroup_default
|
|
1545
1561
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -4,8 +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 { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-
|
|
8
|
-
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-
|
|
7
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.mjs';
|
|
8
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-8fG5uP-B.mjs';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import '@mui/material';
|
|
11
11
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +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 { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-
|
|
8
|
-
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-
|
|
7
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.js';
|
|
8
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-8fG5uP-B.js';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
import '@mui/material';
|
|
11
11
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -14,10 +14,10 @@ require('./chunk-7M2VOCYN.js');
|
|
|
14
14
|
require('./chunk-6BGQA4BQ.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkWCNR24BMjs = require('./chunk-WCNR24BM.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkIZSKZD5Mjs = require('./chunk-IZSKZD5M.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
|
|
@@ -31,7 +31,7 @@ var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkFYN7F5WJjs = require('./chunk-FYN7F5WJ.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -55,4 +55,4 @@ var _chunkDKBPCLECjs = require('./chunk-DKBPCLEC.js');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
exports.AuthorizedView = _chunkJKUOV3MNjs.AuthorizedView_default; exports.CancelButton = _chunkJKUOV3MNjs.CancelButton_default; exports.ClearButton = _chunkJKUOV3MNjs.ClearButton_default; exports.Field =
|
|
58
|
+
exports.AuthorizedView = _chunkJKUOV3MNjs.AuthorizedView_default; exports.CancelButton = _chunkJKUOV3MNjs.CancelButton_default; exports.ClearButton = _chunkJKUOV3MNjs.ClearButton_default; exports.Field = _chunkWCNR24BMjs.Field_default; exports.Field2 = _chunkIZSKZD5Mjs.Field_default; exports.FilterButton = _chunkJKUOV3MNjs.FilterButton_default; exports.FilterWrapper = _chunkJKUOV3MNjs.FilterWrapper_default; exports.FormWrapper = _chunkJKUOV3MNjs.FormWrapper_default; exports.LabelText = _chunkJKUOV3MNjs.LabelText_default; exports.ListWrapper = _chunkJKUOV3MNjs.ListWrapper_default; exports.SimpleButton = _chunkJKUOV3MNjs.SimpleButton_default; exports.SimpleToolbar = _chunkJKUOV3MNjs.SimpleToolbar_default; exports.api = _chunkFYN7F5WJjs.api; exports.api2 = _chunkFYN7F5WJjs.api2; exports.flattenObjectKeys = _chunkFYN7F5WJjs.flattenObjectKeys; exports.getTimezone = _chunkFYN7F5WJjs.getTimezone; exports.handleServerErrors = _chunkFYN7F5WJjs.handleServerErrors; exports.propertyExists = _chunkFYN7F5WJjs.propertyExists; exports.readValueAsDate = _chunkFYN7F5WJjs.readValueAsDate; exports.removeLeadingTrailingSlashes = _chunkFYN7F5WJjs.removeLeadingTrailingSlashes; exports.schemaTools = _chunkFYN7F5WJjs.schemaTools; exports.useTransform = _chunk6JZ35VQJjs.useTransform;
|
package/dist/index.mjs
CHANGED
|
@@ -14,10 +14,10 @@ import "./chunk-2JFL7TS5.mjs";
|
|
|
14
14
|
import "./chunk-EVPUCTZA.mjs";
|
|
15
15
|
import {
|
|
16
16
|
Field_default
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KB3ODFZD.mjs";
|
|
18
18
|
import {
|
|
19
19
|
Field_default as Field_default2
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MM6OQZAY.mjs";
|
|
21
21
|
import {
|
|
22
22
|
useTransform
|
|
23
23
|
} from "./chunk-GFSTK7KN.mjs";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
readValueAsDate,
|
|
32
32
|
removeLeadingTrailingSlashes,
|
|
33
33
|
schemaTools
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-GAYZ4QSD.mjs";
|
|
35
35
|
export {
|
|
36
36
|
AuthorizedView_default as AuthorizedView,
|
|
37
37
|
CancelButton_default as CancelButton,
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GridSortModel } from '@mui/x-data-grid';
|
|
2
|
-
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-
|
|
3
|
-
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-
|
|
2
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.mjs';
|
|
3
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-8fG5uP-B.mjs';
|
|
4
4
|
|
|
5
5
|
type ValidationErrors = {
|
|
6
6
|
[field: string]: string | string[] | boolean | {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GridSortModel } from '@mui/x-data-grid';
|
|
2
|
-
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-
|
|
3
|
-
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-
|
|
2
|
+
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.js';
|
|
3
|
+
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-8fG5uP-B.js';
|
|
4
4
|
|
|
5
5
|
type ValidationErrors = {
|
|
6
6
|
[field: string]: string | string[] | boolean | {
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -4,8 +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 '../AsyncSelectPayload-
|
|
8
|
-
import '../OptionItem-
|
|
7
|
+
import '../AsyncSelectPayload-Cz4bgak0.mjs';
|
|
8
|
+
import '../OptionItem-8fG5uP-B.mjs';
|
|
9
9
|
|
|
10
10
|
declare class api {
|
|
11
11
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -4,8 +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 '../AsyncSelectPayload-
|
|
8
|
-
import '../OptionItem-
|
|
7
|
+
import '../AsyncSelectPayload-Cz4bgak0.js';
|
|
8
|
+
import '../OptionItem-8fG5uP-B.js';
|
|
9
9
|
|
|
10
10
|
declare class api {
|
|
11
11
|
static filter<T, TFilter>(url: string, postModel: PostModel<TFilter>): Promise<ApiResponse<ListResponse<T>>>;
|
package/dist/utils/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFYN7F5WJjs = require('../chunk-FYN7F5WJ.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -19,4 +19,4 @@ var _chunkDKBPCLECjs = require('../chunk-DKBPCLEC.js');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
exports.api =
|
|
22
|
+
exports.api = _chunkFYN7F5WJjs.api; exports.api2 = _chunkFYN7F5WJjs.api2; exports.flattenObjectKeys = _chunkFYN7F5WJjs.flattenObjectKeys; exports.getTimezone = _chunkFYN7F5WJjs.getTimezone; exports.handleServerErrors = _chunkFYN7F5WJjs.handleServerErrors; exports.propertyExists = _chunkFYN7F5WJjs.propertyExists; exports.readValueAsDate = _chunkFYN7F5WJjs.readValueAsDate; exports.removeLeadingTrailingSlashes = _chunkFYN7F5WJjs.removeLeadingTrailingSlashes; exports.schemaTools = _chunkFYN7F5WJjs.schemaTools;
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, AutocompleteProps, TextFieldVariants, SxProps, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, TextField } from '@mui/material';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
|
-
import { FieldValues, FieldPath, Control, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
-
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-
|
|
3
|
+
import { FieldValues, FieldPath, Control, Path, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.mjs';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { ReactNode, ChangeEvent } from 'react';
|
|
7
7
|
import { TimePickerProps, TimePickerSlotProps, PickerChangeHandlerContext, TimeValidationError, PickerValidDate as PickerValidDate$1, DateValidationError, DatePickerSlotProps, DatePickerProps } from '@mui/x-date-pickers';
|
|
@@ -19,22 +19,18 @@ type CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName ex
|
|
|
19
19
|
}[];
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
type AsyncSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> =
|
|
23
|
-
Value: number;
|
|
24
|
-
Label: string;
|
|
25
|
-
} = {
|
|
26
|
-
Value: number;
|
|
27
|
-
Label: string;
|
|
28
|
-
}, 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"> & {
|
|
22
|
+
type AsyncSelectElementProps<TOption extends Record<string, any> = Record<string, any>, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = Path<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' | 'control' | 'ref' | 'multiple' | 'loading' | 'getOptionLabel' | 'getOptionKey' | 'isOptionEqualToValue' | 'options' | 'value' | 'filterSelectedOptions' | 'filterOptions' | 'onChange' | 'onInputChange' | 'renderInput'> & {
|
|
29
23
|
name: TName;
|
|
30
24
|
control?: Control<TFieldValues>;
|
|
31
25
|
gridProps?: Grid2Props;
|
|
32
26
|
placeholder?: string;
|
|
33
27
|
label?: string;
|
|
34
|
-
initialValue?:
|
|
35
|
-
queryFn: (data: AsyncSelectPayload) => Promise<
|
|
28
|
+
initialValue?: string | null;
|
|
29
|
+
queryFn: (data: AsyncSelectPayload) => Promise<TOption[] | undefined>;
|
|
36
30
|
variant?: TextFieldVariants;
|
|
37
31
|
sx?: SxProps;
|
|
32
|
+
labelKey?: string;
|
|
33
|
+
valueKey?: string;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
type SelectCascadeElementProps<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' | 'disabled'> & {
|
|
@@ -68,8 +64,8 @@ type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
68
64
|
valueKey?: keyof TOption;
|
|
69
65
|
};
|
|
70
66
|
|
|
71
|
-
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[
|
|
72
|
-
rules?: UseControllerProps<TFieldValues, TName>[
|
|
67
|
+
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" | "disabled"> & {
|
|
68
|
+
rules?: UseControllerProps<TFieldValues, TName>["rules"];
|
|
73
69
|
name: TName;
|
|
74
70
|
control?: Control<TFieldValues>;
|
|
75
71
|
gridProps?: Grid2Props;
|
|
@@ -81,7 +77,7 @@ type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues,
|
|
|
81
77
|
disabled?: boolean;
|
|
82
78
|
labelKey?: string;
|
|
83
79
|
valueKey?: keyof TOption;
|
|
84
|
-
textFieldProps?: Omit<TextFieldProps,
|
|
80
|
+
textFieldProps?: Omit<TextFieldProps, "name">;
|
|
85
81
|
};
|
|
86
82
|
|
|
87
83
|
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"> & {
|
|
@@ -197,13 +193,7 @@ declare const Field: {
|
|
|
197
193
|
Select: <TOption extends Record<string, any> = Record<string, any>, 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;
|
|
198
194
|
SelectMulti: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.Path<TFieldValues>, TOption extends Record<string, any> = Record<string, any>, Multiple extends boolean | undefined = true, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectMultiElementProps<TFieldValues, TName, TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
199
195
|
SelectCascade: <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: SelectCascadeElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
200
|
-
AsyncSelect: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.
|
|
201
|
-
Value: number;
|
|
202
|
-
Label: string;
|
|
203
|
-
} = {
|
|
204
|
-
Value: number;
|
|
205
|
-
Label: string;
|
|
206
|
-
}, 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;
|
|
196
|
+
AsyncSelect: <TOption extends Record<string, any> = Record<string, any>, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.Path<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: AsyncSelectElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
207
197
|
AsyncMultiSelect: any;
|
|
208
198
|
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;
|
|
209
199
|
};
|
package/dist/wrappers/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, AutocompleteProps, TextFieldVariants, SxProps, TextFieldProps, IconButtonProps, FormLabelProps, RadioProps, TextField } from '@mui/material';
|
|
2
2
|
import * as react_hook_form from 'react-hook-form';
|
|
3
|
-
import { FieldValues, FieldPath, Control, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
-
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-
|
|
3
|
+
import { FieldValues, FieldPath, Control, Path, UseControllerProps, FieldError, PathValue } from 'react-hook-form';
|
|
4
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import { ReactNode, ChangeEvent } from 'react';
|
|
7
7
|
import { TimePickerProps, TimePickerSlotProps, PickerChangeHandlerContext, TimeValidationError, PickerValidDate as PickerValidDate$1, DateValidationError, DatePickerSlotProps, DatePickerProps } from '@mui/x-date-pickers';
|
|
@@ -19,22 +19,18 @@ type CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName ex
|
|
|
19
19
|
}[];
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
type AsyncSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> =
|
|
23
|
-
Value: number;
|
|
24
|
-
Label: string;
|
|
25
|
-
} = {
|
|
26
|
-
Value: number;
|
|
27
|
-
Label: string;
|
|
28
|
-
}, 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"> & {
|
|
22
|
+
type AsyncSelectElementProps<TOption extends Record<string, any> = Record<string, any>, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = Path<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' | 'control' | 'ref' | 'multiple' | 'loading' | 'getOptionLabel' | 'getOptionKey' | 'isOptionEqualToValue' | 'options' | 'value' | 'filterSelectedOptions' | 'filterOptions' | 'onChange' | 'onInputChange' | 'renderInput'> & {
|
|
29
23
|
name: TName;
|
|
30
24
|
control?: Control<TFieldValues>;
|
|
31
25
|
gridProps?: Grid2Props;
|
|
32
26
|
placeholder?: string;
|
|
33
27
|
label?: string;
|
|
34
|
-
initialValue?:
|
|
35
|
-
queryFn: (data: AsyncSelectPayload) => Promise<
|
|
28
|
+
initialValue?: string | null;
|
|
29
|
+
queryFn: (data: AsyncSelectPayload) => Promise<TOption[] | undefined>;
|
|
36
30
|
variant?: TextFieldVariants;
|
|
37
31
|
sx?: SxProps;
|
|
32
|
+
labelKey?: string;
|
|
33
|
+
valueKey?: string;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
type SelectCascadeElementProps<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' | 'disabled'> & {
|
|
@@ -68,8 +64,8 @@ type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TNa
|
|
|
68
64
|
valueKey?: keyof TOption;
|
|
69
65
|
};
|
|
70
66
|
|
|
71
|
-
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[
|
|
72
|
-
rules?: UseControllerProps<TFieldValues, TName>[
|
|
67
|
+
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" | "disabled"> & {
|
|
68
|
+
rules?: UseControllerProps<TFieldValues, TName>["rules"];
|
|
73
69
|
name: TName;
|
|
74
70
|
control?: Control<TFieldValues>;
|
|
75
71
|
gridProps?: Grid2Props;
|
|
@@ -81,7 +77,7 @@ type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues,
|
|
|
81
77
|
disabled?: boolean;
|
|
82
78
|
labelKey?: string;
|
|
83
79
|
valueKey?: keyof TOption;
|
|
84
|
-
textFieldProps?: Omit<TextFieldProps,
|
|
80
|
+
textFieldProps?: Omit<TextFieldProps, "name">;
|
|
85
81
|
};
|
|
86
82
|
|
|
87
83
|
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"> & {
|
|
@@ -197,13 +193,7 @@ declare const Field: {
|
|
|
197
193
|
Select: <TOption extends Record<string, any> = Record<string, any>, 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;
|
|
198
194
|
SelectMulti: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.Path<TFieldValues>, TOption extends Record<string, any> = Record<string, any>, Multiple extends boolean | undefined = true, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectMultiElementProps<TFieldValues, TName, TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
199
195
|
SelectCascade: <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: SelectCascadeElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
200
|
-
AsyncSelect: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.
|
|
201
|
-
Value: number;
|
|
202
|
-
Label: string;
|
|
203
|
-
} = {
|
|
204
|
-
Value: number;
|
|
205
|
-
Label: string;
|
|
206
|
-
}, 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;
|
|
196
|
+
AsyncSelect: <TOption extends Record<string, any> = Record<string, any>, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.Path<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: AsyncSelectElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
|
|
207
197
|
AsyncMultiSelect: any;
|
|
208
198
|
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;
|
|
209
199
|
};
|
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 _chunkWCNR24BMjs = require('../chunk-WCNR24BM.js');
|
|
4
4
|
require('../chunk-6JZ35VQJ.js');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-FYN7F5WJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Field =
|
|
8
|
+
exports.Field = _chunkWCNR24BMjs.Field_default;
|
package/dist/wrappers/index.mjs
CHANGED
|
@@ -1,8 +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 { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-
|
|
5
|
-
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-
|
|
4
|
+
import { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-8fG5uP-B.mjs';
|
|
5
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.mjs';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import { ReactNode, ChangeEvent } from 'react';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -1,8 +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 { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-
|
|
5
|
-
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-
|
|
4
|
+
import { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-8fG5uP-B.js';
|
|
5
|
+
import { A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.js';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import { ReactNode, ChangeEvent } from 'react';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/wrappers2/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIZSKZD5Mjs = require('../chunk-IZSKZD5M.js');
|
|
4
4
|
require('../chunk-6JZ35VQJ.js');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-FYN7F5WJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Field2 =
|
|
8
|
+
exports.Field2 = _chunkIZSKZD5Mjs.Field_default;
|
package/dist/wrappers2/index.mjs
CHANGED