@gnwebsoft/ui 2.18.40 → 2.18.41

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.
@@ -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 };
@@ -3,7 +3,7 @@
3
3
  var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
4
4
 
5
5
 
6
- var _chunkDKBPCLECjs = require('./chunk-DKBPCLEC.js');
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);
@@ -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) => _chunkDKBPCLECjs.readValueAsDate.call(void 0, adapter, 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
  });
@@ -581,20 +581,13 @@ var TimePickerElement2 = ({
581
581
  TimePickerElement2.displayName = "TimePickerElement";
582
582
  var TimePickerElement_default = TimePickerElement2;
583
583
 
584
- // src/wrappers/AsyncSelect/AsyncSelect.tsx
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 && initialValue > 0)
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, callback) => {
639
- queryFn(payload).then((c) => callback(c));
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 (!!fieldValue.current) {
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, selectedOption2, reason) => {
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 (selectedOption2) {
714
- setSelectedOption(selectedOption2);
715
- field.onChange(selectedOption2.Value);
716
- fieldValue.current = selectedOption2.Value;
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: (option) => option.Label,
738
- getOptionKey: (option) => option.Value,
739
- isOptionEqualToValue: (option, val) => option.Value === val.Value,
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: (props2, option) => {
779
- const { key, ...optionProps } = props2;
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
  }
@@ -792,7 +790,7 @@ var AsyncSelectElement2 = ({
792
790
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component6, { ...props });
793
791
  };
794
792
  AsyncSelectElement2.displayName = "AsyncSelectElement";
795
- var AsyncSelect_default = AsyncSelectElement2;
793
+ var AsyncSelectElement_default = AsyncSelectElement2;
796
794
 
797
795
  // src/wrappers/AsyncMultiSelect/AsyncMultiSelect.tsx
798
796
  var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);
@@ -1243,7 +1241,7 @@ var SelectMultiElement_default = SelectMultiElement2;
1243
1241
 
1244
1242
 
1245
1243
 
1246
- var Component10 = function SelectCascadeElement2(props) {
1244
+ var Component10 = function SelectCascadeElement(props) {
1247
1245
  const {
1248
1246
  labelKey = "Label",
1249
1247
  valueKey = "Value",
@@ -1293,12 +1291,13 @@ var Component10 = function SelectCascadeElement2(props) {
1293
1291
  control
1294
1292
  });
1295
1293
  const parentValueRef = _react.useRef.call(void 0, _nullishCoalesce(dependentField.value, () => ( null)));
1294
+ const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
1296
1295
  _react.useEffect.call(void 0, () => {
1297
1296
  if (!!dependentField.value && _optionalChain([parentValueRef, 'optionalAccess', _24 => _24.current]) !== dependentField.value || dependentField.value === null) {
1298
1297
  field.onChange(null);
1298
+ setHasAutoSelected(false);
1299
1299
  }
1300
- }, [dependentField.value, field]);
1301
- const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
1300
+ }, [dependentField.value]);
1302
1301
  _react.useEffect.call(void 0, () => {
1303
1302
  if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
1304
1303
  field.onChange(getOptionKey(options[0]));
@@ -1317,7 +1316,8 @@ var Component10 = function SelectCascadeElement2(props) {
1317
1316
  isEdit,
1318
1317
  disabled,
1319
1318
  field,
1320
- getOptionKey
1319
+ getOptionKey,
1320
+ dependentField.onChange
1321
1321
  ]);
1322
1322
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1323
1323
  _material.Autocomplete,
@@ -1331,7 +1331,7 @@ var Component10 = function SelectCascadeElement2(props) {
1331
1331
  getOptionLabel,
1332
1332
  isOptionEqualToValue,
1333
1333
  ref: field.ref,
1334
- disabled,
1334
+ disabled: dependentField.value == null || disabled,
1335
1335
  onChange: (event, newValue, reason) => {
1336
1336
  field.onChange(newValue ? getOptionKey(newValue) : null);
1337
1337
  if (onChange && typeof onChange === "function") {
@@ -1358,11 +1358,11 @@ var Component10 = function SelectCascadeElement2(props) {
1358
1358
  variant: variant ? variant : "outlined",
1359
1359
  sx: {
1360
1360
  "& .MuiOutlinedInput-root": {
1361
- bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
1361
+ bgcolor: disabled || dependentField.value == null ? theme.palette.action.disabledBackground : "transparent"
1362
1362
  },
1363
1363
  "& .MuiInputLabel-asterisk": { color: "red" },
1364
1364
  "& .MuiInputBase-input": {
1365
- cursor: disabled ? "not-allowed" : "default"
1365
+ cursor: disabled || dependentField.value == null ? "not-allowed" : "default"
1366
1366
  },
1367
1367
  ...sx
1368
1368
  }
@@ -1371,7 +1371,7 @@ var Component10 = function SelectCascadeElement2(props) {
1371
1371
  }
1372
1372
  );
1373
1373
  };
1374
- var SelectCascadeElement = ({
1374
+ var SelectCascadeElement2 = ({
1375
1375
  gridProps,
1376
1376
  ...props
1377
1377
  }) => {
@@ -1380,8 +1380,8 @@ var SelectCascadeElement = ({
1380
1380
  }
1381
1381
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component10, { ...props });
1382
1382
  };
1383
- SelectCascadeElement.displayName = "SelectCascadeElement";
1384
- var SelectCascadeElement_default = SelectCascadeElement;
1383
+ SelectCascadeElement2.displayName = "SelectCascadeElement";
1384
+ var SelectCascadeElement_default = SelectCascadeElement2;
1385
1385
 
1386
1386
  // src/wrappers/CheckboxElement/CheckboxElement.tsx
1387
1387
 
@@ -1539,7 +1539,7 @@ var Field = {
1539
1539
  Select: SelectElement_default,
1540
1540
  SelectMulti: SelectMultiElement_default,
1541
1541
  SelectCascade: SelectCascadeElement_default,
1542
- AsyncSelect: AsyncSelect_default,
1542
+ AsyncSelect: AsyncSelectElement_default,
1543
1543
  AsyncMultiSelect: AsyncMultiSelect_default,
1544
1544
  CheckboxGroup: CheckboxGroup_default
1545
1545
  };
@@ -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 @@ import {
3
3
  } from "./chunk-GFSTK7KN.mjs";
4
4
  import {
5
5
  readValueAsDate
6
- } from "./chunk-AVNKSUE5.mjs";
6
+ } from "./chunk-GAYZ4QSD.mjs";
7
7
 
8
8
  // src/wrappers/DatePickerElement/DatePickerElement.tsx
9
9
  import { useMemo, useCallback } from "react";
@@ -581,21 +581,14 @@ var TimePickerElement2 = ({
581
581
  TimePickerElement2.displayName = "TimePickerElement";
582
582
  var TimePickerElement_default = TimePickerElement2;
583
583
 
584
- // src/wrappers/AsyncSelect/AsyncSelect.tsx
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 { debounce } from "@mui/material/utils";
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 && initialValue > 0)
625
+ !initialValue ? true : !(initialValue != null)
634
626
  );
635
627
  const fieldValue = useRef(field.value);
636
628
  const fetchData = useMemo2(
637
- () => debounce(
638
- (payload, callback) => {
639
- queryFn(payload).then((c) => callback(c));
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 (!!fieldValue.current) {
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, selectedOption2, reason) => {
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 (selectedOption2) {
714
- setSelectedOption(selectedOption2);
715
- field.onChange(selectedOption2.Value);
716
- fieldValue.current = selectedOption2.Value;
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: (option) => option.Label,
738
- getOptionKey: (option) => option.Value,
739
- isOptionEqualToValue: (option, val) => option.Value === val.Value,
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: (props2, option) => {
779
- const { key, ...optionProps } = props2;
776
+ renderOption: (renderProps, option) => {
777
+ const { key, ...optionProps } = renderProps;
780
778
  return /* @__PURE__ */ jsx6("li", { ...optionProps, children: option.Label }, key);
781
779
  }
782
780
  }
@@ -792,7 +790,7 @@ var AsyncSelectElement2 = ({
792
790
  return /* @__PURE__ */ jsx6(Component6, { ...props });
793
791
  };
794
792
  AsyncSelectElement2.displayName = "AsyncSelectElement";
795
- var AsyncSelect_default = AsyncSelectElement2;
793
+ var AsyncSelectElement_default = AsyncSelectElement2;
796
794
 
797
795
  // src/wrappers/AsyncMultiSelect/AsyncMultiSelect.tsx
798
796
  import _ from "lodash";
@@ -1243,7 +1241,7 @@ import {
1243
1241
  Autocomplete as Autocomplete5
1244
1242
  } from "@mui/material";
1245
1243
  import { jsx as jsx10 } from "react/jsx-runtime";
1246
- var Component10 = function SelectCascadeElement2(props) {
1244
+ var Component10 = function SelectCascadeElement(props) {
1247
1245
  const {
1248
1246
  labelKey = "Label",
1249
1247
  valueKey = "Value",
@@ -1293,12 +1291,13 @@ var Component10 = function SelectCascadeElement2(props) {
1293
1291
  control
1294
1292
  });
1295
1293
  const parentValueRef = useRef3(dependentField.value ?? null);
1294
+ const [hasAutoSelected, setHasAutoSelected] = useState4(false);
1296
1295
  useEffect5(() => {
1297
1296
  if (!!dependentField.value && parentValueRef?.current !== dependentField.value || dependentField.value === null) {
1298
1297
  field.onChange(null);
1298
+ setHasAutoSelected(false);
1299
1299
  }
1300
- }, [dependentField.value, field]);
1301
- const [hasAutoSelected, setHasAutoSelected] = useState4(false);
1300
+ }, [dependentField.value]);
1302
1301
  useEffect5(() => {
1303
1302
  if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
1304
1303
  field.onChange(getOptionKey(options[0]));
@@ -1317,7 +1316,8 @@ var Component10 = function SelectCascadeElement2(props) {
1317
1316
  isEdit,
1318
1317
  disabled,
1319
1318
  field,
1320
- getOptionKey
1319
+ getOptionKey,
1320
+ dependentField.onChange
1321
1321
  ]);
1322
1322
  return /* @__PURE__ */ jsx10(
1323
1323
  Autocomplete5,
@@ -1331,7 +1331,7 @@ var Component10 = function SelectCascadeElement2(props) {
1331
1331
  getOptionLabel,
1332
1332
  isOptionEqualToValue,
1333
1333
  ref: field.ref,
1334
- disabled,
1334
+ disabled: dependentField.value == null || disabled,
1335
1335
  onChange: (event, newValue, reason) => {
1336
1336
  field.onChange(newValue ? getOptionKey(newValue) : null);
1337
1337
  if (onChange && typeof onChange === "function") {
@@ -1358,11 +1358,11 @@ var Component10 = function SelectCascadeElement2(props) {
1358
1358
  variant: variant ? variant : "outlined",
1359
1359
  sx: {
1360
1360
  "& .MuiOutlinedInput-root": {
1361
- bgcolor: disabled ? theme.palette.action.disabledBackground : "transparent"
1361
+ bgcolor: disabled || dependentField.value == null ? theme.palette.action.disabledBackground : "transparent"
1362
1362
  },
1363
1363
  "& .MuiInputLabel-asterisk": { color: "red" },
1364
1364
  "& .MuiInputBase-input": {
1365
- cursor: disabled ? "not-allowed" : "default"
1365
+ cursor: disabled || dependentField.value == null ? "not-allowed" : "default"
1366
1366
  },
1367
1367
  ...sx
1368
1368
  }
@@ -1371,7 +1371,7 @@ var Component10 = function SelectCascadeElement2(props) {
1371
1371
  }
1372
1372
  );
1373
1373
  };
1374
- var SelectCascadeElement = ({
1374
+ var SelectCascadeElement2 = ({
1375
1375
  gridProps,
1376
1376
  ...props
1377
1377
  }) => {
@@ -1380,8 +1380,8 @@ var SelectCascadeElement = ({
1380
1380
  }
1381
1381
  return /* @__PURE__ */ jsx10(Component10, { ...props });
1382
1382
  };
1383
- SelectCascadeElement.displayName = "SelectCascadeElement";
1384
- var SelectCascadeElement_default = SelectCascadeElement;
1383
+ SelectCascadeElement2.displayName = "SelectCascadeElement";
1384
+ var SelectCascadeElement_default = SelectCascadeElement2;
1385
1385
 
1386
1386
  // src/wrappers/CheckboxElement/CheckboxElement.tsx
1387
1387
  import {
@@ -1539,7 +1539,7 @@ var Field = {
1539
1539
  Select: SelectElement_default,
1540
1540
  SelectMulti: SelectMultiElement_default,
1541
1541
  SelectCascade: SelectCascadeElement_default,
1542
- AsyncSelect: AsyncSelect_default,
1542
+ AsyncSelect: AsyncSelectElement_default,
1543
1543
  AsyncMultiSelect: AsyncMultiSelect_default,
1544
1544
  CheckboxGroup: CheckboxGroup_default
1545
1545
  };
@@ -3,7 +3,7 @@
3
3
  var _chunk6JZ35VQJjs = require('./chunk-6JZ35VQJ.js');
4
4
 
5
5
 
6
- var _chunkDKBPCLECjs = require('./chunk-DKBPCLEC.js');
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) => _chunkDKBPCLECjs.readValueAsDate.call(void 0, adapter, 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) => _chunkDKBPCLECjs.readValueAsDate.call(void 0, adapter, 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-AVNKSUE5.mjs";
6
+ } from "./chunk-GAYZ4QSD.mjs";
7
7
 
8
8
  // src/wrappers2/DatePickerElement/DatePickerElement.tsx
9
9
  import {
package/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ 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-CiwoX8EE.mjs';
7
+ export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.mjs';
8
8
  export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-BSg3KSRJ.mjs';
9
9
  import 'react/jsx-runtime';
10
10
  import '@mui/material';
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ 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-CiwoX8EE.js';
7
+ export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.js';
8
8
  export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-BSg3KSRJ.js';
9
9
  import 'react/jsx-runtime';
10
10
  import '@mui/material';
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 _chunkVNU4ZOUEjs = require('./chunk-VNU4ZOUE.js');
17
+ var _chunk4XSPG2IFjs = require('./chunk-4XSPG2IF.js');
18
18
 
19
19
 
20
- var _chunkSTC2BZ2Ljs = require('./chunk-STC2BZ2L.js');
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 _chunkDKBPCLECjs = require('./chunk-DKBPCLEC.js');
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 = _chunkVNU4ZOUEjs.Field_default; exports.Field2 = _chunkSTC2BZ2Ljs.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 = _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;
58
+ exports.AuthorizedView = _chunkJKUOV3MNjs.AuthorizedView_default; exports.CancelButton = _chunkJKUOV3MNjs.CancelButton_default; exports.ClearButton = _chunkJKUOV3MNjs.ClearButton_default; exports.Field = _chunk4XSPG2IFjs.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-RVKKPXZC.mjs";
17
+ } from "./chunk-H7MQZPJ6.mjs";
18
18
  import {
19
19
  Field_default as Field_default2
20
- } from "./chunk-34X2YRTY.mjs";
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-AVNKSUE5.mjs";
34
+ } from "./chunk-GAYZ4QSD.mjs";
35
35
  export {
36
36
  AuthorizedView_default as AuthorizedView,
37
37
  CancelButton_default as CancelButton,
@@ -1,5 +1,5 @@
1
1
  import { GridSortModel } from '@mui/x-data-grid';
2
- export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.mjs';
2
+ export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.mjs';
3
3
  export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-BSg3KSRJ.mjs';
4
4
 
5
5
  type ValidationErrors = {
@@ -1,5 +1,5 @@
1
1
  import { GridSortModel } from '@mui/x-data-grid';
2
- export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.js';
2
+ export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from '../AsyncSelectPayload-Cz4bgak0.js';
3
3
  export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from '../OptionItem-BSg3KSRJ.js';
4
4
 
5
5
  type ValidationErrors = {
@@ -4,7 +4,7 @@ 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-CiwoX8EE.mjs';
7
+ import '../AsyncSelectPayload-Cz4bgak0.mjs';
8
8
  import '../OptionItem-BSg3KSRJ.mjs';
9
9
 
10
10
  declare class api {
@@ -4,7 +4,7 @@ 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-CiwoX8EE.js';
7
+ import '../AsyncSelectPayload-Cz4bgak0.js';
8
8
  import '../OptionItem-BSg3KSRJ.js';
9
9
 
10
10
  declare class api {
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkDKBPCLECjs = require('../chunk-DKBPCLEC.js');
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 = _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;
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;
@@ -8,7 +8,7 @@ import {
8
8
  readValueAsDate,
9
9
  removeLeadingTrailingSlashes,
10
10
  schemaTools
11
- } from "../chunk-AVNKSUE5.mjs";
11
+ } from "../chunk-GAYZ4QSD.mjs";
12
12
  export {
13
13
  api,
14
14
  api2,
@@ -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-CiwoX8EE.mjs';
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> = FieldPath<TFieldValues>, TValue extends {
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?: number | null;
35
- queryFn: (data: AsyncSelectPayload) => Promise<TValue[] | undefined>;
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'> & {
@@ -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.FieldPath<TFieldValues>, TValue extends {
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
  };
@@ -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-CiwoX8EE.js';
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> = FieldPath<TFieldValues>, TValue extends {
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?: number | null;
35
- queryFn: (data: AsyncSelectPayload) => Promise<TValue[] | undefined>;
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'> & {
@@ -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.FieldPath<TFieldValues>, TValue extends {
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
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVNU4ZOUEjs = require('../chunk-VNU4ZOUE.js');
3
+ var _chunk4XSPG2IFjs = require('../chunk-4XSPG2IF.js');
4
4
  require('../chunk-6JZ35VQJ.js');
5
- require('../chunk-DKBPCLEC.js');
5
+ require('../chunk-FYN7F5WJ.js');
6
6
 
7
7
 
8
- exports.Field = _chunkVNU4ZOUEjs.Field_default;
8
+ exports.Field = _chunk4XSPG2IFjs.Field_default;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Field_default
3
- } from "../chunk-RVKKPXZC.mjs";
3
+ } from "../chunk-H7MQZPJ6.mjs";
4
4
  import "../chunk-GFSTK7KN.mjs";
5
- import "../chunk-AVNKSUE5.mjs";
5
+ import "../chunk-GAYZ4QSD.mjs";
6
6
  export {
7
7
  Field_default as Field
8
8
  };
@@ -2,7 +2,7 @@ import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, Autocomp
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
4
  import { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-BSg3KSRJ.mjs';
5
- import { A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.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';
@@ -2,7 +2,7 @@ import { CheckboxProps, FormControlLabelProps, Grid2Props, ChipTypeMap, Autocomp
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
4
  import { A as AsyncMultiSelectPayload, O as OptionItem } from '../OptionItem-BSg3KSRJ.js';
5
- import { A as AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.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';
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkSTC2BZ2Ljs = require('../chunk-STC2BZ2L.js');
3
+ var _chunkIZSKZD5Mjs = require('../chunk-IZSKZD5M.js');
4
4
  require('../chunk-6JZ35VQJ.js');
5
- require('../chunk-DKBPCLEC.js');
5
+ require('../chunk-FYN7F5WJ.js');
6
6
 
7
7
 
8
- exports.Field2 = _chunkSTC2BZ2Ljs.Field_default;
8
+ exports.Field2 = _chunkIZSKZD5Mjs.Field_default;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Field_default
3
- } from "../chunk-34X2YRTY.mjs";
3
+ } from "../chunk-MM6OQZAY.mjs";
4
4
  import "../chunk-GFSTK7KN.mjs";
5
- import "../chunk-AVNKSUE5.mjs";
5
+ import "../chunk-GAYZ4QSD.mjs";
6
6
  export {
7
7
  Field_default as Field2
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnwebsoft/ui",
3
- "version": "2.18.40",
3
+ "version": "2.18.41",
4
4
  "description": "A set of reusable wrappers for MUI v6",
5
5
  "author": "GNWebsoft Private Limited",
6
6
  "license": "",