@gnwebsoft/ui 2.18.38 → 2.18.39

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.
@@ -438,6 +438,27 @@ var AuthorizedView = ({ children, show }) => {
438
438
  };
439
439
  var AuthorizedView_default = AuthorizedView;
440
440
 
441
+ // src/components/CancelButton/CancelButton.tsx
442
+ import { Button as Button3 } from "@mui/material";
443
+ import { jsx as jsx10 } from "react/jsx-runtime";
444
+ var CancelButton = ({
445
+ isSubmitting,
446
+ handleCancel,
447
+ sx
448
+ }) => {
449
+ return /* @__PURE__ */ jsx10(
450
+ Button3,
451
+ {
452
+ variant: "outlined",
453
+ onClick: handleCancel,
454
+ disabled: isSubmitting,
455
+ sx,
456
+ children: "Cancel"
457
+ }
458
+ );
459
+ };
460
+ var CancelButton_default = CancelButton;
461
+
441
462
  export {
442
463
  ClearButton_default,
443
464
  FilterButton_default,
@@ -447,5 +468,6 @@ export {
447
468
  ListWrapper_default,
448
469
  SimpleToolbar_default,
449
470
  SimpleButton_default,
450
- AuthorizedView_default
471
+ AuthorizedView_default,
472
+ CancelButton_default
451
473
  };
@@ -438,6 +438,28 @@ var AuthorizedView = ({ children, show }) => {
438
438
  };
439
439
  var AuthorizedView_default = AuthorizedView;
440
440
 
441
+ // src/components/CancelButton/CancelButton.tsx
442
+
443
+
444
+ var CancelButton = ({
445
+ isSubmitting,
446
+ handleCancel,
447
+ sx
448
+ }) => {
449
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
450
+ _material.Button,
451
+ {
452
+ variant: "outlined",
453
+ onClick: handleCancel,
454
+ disabled: isSubmitting,
455
+ sx,
456
+ children: "Cancel"
457
+ }
458
+ );
459
+ };
460
+ var CancelButton_default = CancelButton;
461
+
462
+
441
463
 
442
464
 
443
465
 
@@ -448,4 +470,4 @@ var AuthorizedView_default = AuthorizedView;
448
470
 
449
471
 
450
472
 
451
- exports.ClearButton_default = ClearButton_default; exports.FilterButton_default = FilterButton_default; exports.FilterWrapper_default = FilterWrapper_default; exports.FormWrapper_default = FormWrapper_default; exports.LabelText_default = LabelText_default; exports.ListWrapper_default = ListWrapper_default; exports.SimpleToolbar_default = SimpleToolbar_default; exports.SimpleButton_default = SimpleButton_default; exports.AuthorizedView_default = AuthorizedView_default;
473
+ exports.ClearButton_default = ClearButton_default; exports.FilterButton_default = FilterButton_default; exports.FilterWrapper_default = FilterWrapper_default; exports.FormWrapper_default = FormWrapper_default; exports.LabelText_default = LabelText_default; exports.ListWrapper_default = ListWrapper_default; exports.SimpleToolbar_default = SimpleToolbar_default; exports.SimpleButton_default = SimpleButton_default; exports.AuthorizedView_default = AuthorizedView_default; exports.CancelButton_default = CancelButton_default;
@@ -997,12 +997,6 @@ var AsyncMultiSelect_default = AsyncSelectMultiElement2;
997
997
 
998
998
 
999
999
 
1000
-
1001
-
1002
-
1003
- function isOptionType(option, key) {
1004
- return typeof option === "object" && option !== null && key in option;
1005
- }
1006
1000
  var Component8 = function SelectElement(props) {
1007
1001
  const {
1008
1002
  name,
@@ -1013,48 +1007,70 @@ var Component8 = function SelectElement(props) {
1013
1007
  label,
1014
1008
  labelKey = "Label",
1015
1009
  valueKey = "Value",
1010
+ textFieldProps = {},
1016
1011
  ...rest
1017
1012
  } = props;
1013
+ const { required, disabled } = textFieldProps;
1018
1014
  const { field } = _reacthookform.useController.call(void 0, {
1019
1015
  name,
1020
1016
  control
1021
1017
  });
1022
- const [hasAutoSelected, setHasAutoSelected] = _react.useState.call(void 0, false);
1018
+ const getOptionValue = _react.useCallback.call(void 0,
1019
+ (option) => {
1020
+ if (typeof option === "string") return option;
1021
+ return option ? option[valueKey] : null;
1022
+ },
1023
+ [valueKey]
1024
+ );
1025
+ const getOptionLabel = _react.useCallback.call(void 0,
1026
+ (option) => {
1027
+ if (typeof option === "string") return option;
1028
+ return option ? String(option[labelKey]) : "";
1029
+ },
1030
+ [labelKey]
1031
+ );
1023
1032
  const handleChange = (event, newValue, reason) => {
1024
- if (reason === "clear") {
1025
- field.onChange(null);
1026
- setHasAutoSelected(true);
1027
- } else {
1028
- const option = newValue;
1029
- field.onChange(_nullishCoalesce(option[valueKey], () => ( null)));
1030
- setHasAutoSelected(true);
1031
- }
1033
+ const option = newValue;
1034
+ field.onChange(option ? getOptionValue(option) : null);
1032
1035
  _optionalChain([onChange, 'optionalCall', _21 => _21(event, newValue, reason)]);
1033
1036
  };
1034
1037
  _react.useEffect.call(void 0, () => {
1035
- if (isEdit) {
1036
- return;
1037
- } else {
1038
- if (options.length === 1 && field.value == null && !hasAutoSelected) {
1039
- const option = options[0];
1040
- field.onChange(option);
1041
- setHasAutoSelected(true);
1042
- }
1038
+ if (!isEdit && options.length === 1 && (field.value == null || field.value == void 0 || field.value === "")) {
1039
+ const defaultOption = options[0];
1040
+ const defaultValue = getOptionValue(defaultOption);
1041
+ field.onChange(defaultValue);
1043
1042
  }
1044
- }, [options, field.value, field.onChange, hasAutoSelected]);
1043
+ }, [isEdit, options, field.value, field.onChange, getOptionValue, field]);
1044
+ const autocompleteValue = _react.useMemo.call(void 0,
1045
+ () => _nullishCoalesce(options.find((option) => getOptionValue(option) === field.value), () => ( null)),
1046
+ [field.value, options, getOptionValue]
1047
+ );
1045
1048
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1046
1049
  _material.Autocomplete,
1047
1050
  {
1048
1051
  ...rest,
1049
1052
  filterSelectedOptions: false,
1050
1053
  options,
1051
- value: field.value !== null ? _nullishCoalesce(options.find(
1052
- (option) => isOptionType(option, valueKey) && field.value === option[valueKey]
1053
- ), () => ( null)) : null,
1054
+ value: autocompleteValue,
1054
1055
  onChange: handleChange,
1055
- getOptionLabel: (option) => isOptionType(option, labelKey) ? String(option[labelKey]) : typeof option === "string" ? option : "",
1056
- isOptionEqualToValue: (option, value) => isOptionType(option, valueKey) && isOptionType(value, valueKey) ? option[valueKey] === value[valueKey] : false,
1057
- renderInput: (params) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.TextField, { ...params, label })
1056
+ getOptionLabel: (option) => getOptionLabel(option),
1057
+ isOptionEqualToValue: (option, value) => getOptionValue(option) === getOptionValue(value),
1058
+ renderInput: (params) => {
1059
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1060
+ _material.TextField,
1061
+ {
1062
+ ...params,
1063
+ required,
1064
+ label,
1065
+ sx: {
1066
+ "& .MuiInputLabel-asterisk": { color: "red" },
1067
+ "& .MuiInputBase-input": {
1068
+ cursor: disabled ? "not-allowed" : "default"
1069
+ }
1070
+ }
1071
+ }
1072
+ );
1073
+ }
1058
1074
  }
1059
1075
  );
1060
1076
  };
@@ -990,19 +990,13 @@ AsyncSelectMultiElement2.displayName = "AsyncSelectMulti";
990
990
  var AsyncMultiSelect_default = AsyncSelectMultiElement2;
991
991
 
992
992
  // src/wrappers/SelectElement/SelectElement.tsx
993
- import {
994
- Autocomplete as Autocomplete3,
995
- TextField as TextField5,
996
- Grid2 as Grid28
997
- } from "@mui/material";
998
- import { useEffect as useEffect4, useState as useState4 } from "react";
993
+ import { useMemo as useMemo3, useCallback as useCallback3 } from "react";
994
+ import { useEffect as useEffect4 } from "react";
999
995
  import {
1000
996
  useController as useController8
1001
997
  } from "react-hook-form";
998
+ import { Grid2 as Grid28, TextField as TextField5, Autocomplete as Autocomplete3 } from "@mui/material";
1002
999
  import { jsx as jsx8 } from "react/jsx-runtime";
1003
- function isOptionType(option, key) {
1004
- return typeof option === "object" && option !== null && key in option;
1005
- }
1006
1000
  var Component8 = function SelectElement(props) {
1007
1001
  const {
1008
1002
  name,
@@ -1013,48 +1007,70 @@ var Component8 = function SelectElement(props) {
1013
1007
  label,
1014
1008
  labelKey = "Label",
1015
1009
  valueKey = "Value",
1010
+ textFieldProps = {},
1016
1011
  ...rest
1017
1012
  } = props;
1013
+ const { required, disabled } = textFieldProps;
1018
1014
  const { field } = useController8({
1019
1015
  name,
1020
1016
  control
1021
1017
  });
1022
- const [hasAutoSelected, setHasAutoSelected] = useState4(false);
1018
+ const getOptionValue = useCallback3(
1019
+ (option) => {
1020
+ if (typeof option === "string") return option;
1021
+ return option ? option[valueKey] : null;
1022
+ },
1023
+ [valueKey]
1024
+ );
1025
+ const getOptionLabel = useCallback3(
1026
+ (option) => {
1027
+ if (typeof option === "string") return option;
1028
+ return option ? String(option[labelKey]) : "";
1029
+ },
1030
+ [labelKey]
1031
+ );
1023
1032
  const handleChange = (event, newValue, reason) => {
1024
- if (reason === "clear") {
1025
- field.onChange(null);
1026
- setHasAutoSelected(true);
1027
- } else {
1028
- const option = newValue;
1029
- field.onChange(option[valueKey] ?? null);
1030
- setHasAutoSelected(true);
1031
- }
1033
+ const option = newValue;
1034
+ field.onChange(option ? getOptionValue(option) : null);
1032
1035
  onChange?.(event, newValue, reason);
1033
1036
  };
1034
1037
  useEffect4(() => {
1035
- if (isEdit) {
1036
- return;
1037
- } else {
1038
- if (options.length === 1 && field.value == null && !hasAutoSelected) {
1039
- const option = options[0];
1040
- field.onChange(option);
1041
- setHasAutoSelected(true);
1042
- }
1038
+ if (!isEdit && options.length === 1 && (field.value == null || field.value == void 0 || field.value === "")) {
1039
+ const defaultOption = options[0];
1040
+ const defaultValue = getOptionValue(defaultOption);
1041
+ field.onChange(defaultValue);
1043
1042
  }
1044
- }, [options, field.value, field.onChange, hasAutoSelected]);
1043
+ }, [isEdit, options, field.value, field.onChange, getOptionValue, field]);
1044
+ const autocompleteValue = useMemo3(
1045
+ () => options.find((option) => getOptionValue(option) === field.value) ?? null,
1046
+ [field.value, options, getOptionValue]
1047
+ );
1045
1048
  return /* @__PURE__ */ jsx8(
1046
1049
  Autocomplete3,
1047
1050
  {
1048
1051
  ...rest,
1049
1052
  filterSelectedOptions: false,
1050
1053
  options,
1051
- value: field.value !== null ? options.find(
1052
- (option) => isOptionType(option, valueKey) && field.value === option[valueKey]
1053
- ) ?? null : null,
1054
+ value: autocompleteValue,
1054
1055
  onChange: handleChange,
1055
- getOptionLabel: (option) => isOptionType(option, labelKey) ? String(option[labelKey]) : typeof option === "string" ? option : "",
1056
- isOptionEqualToValue: (option, value) => isOptionType(option, valueKey) && isOptionType(value, valueKey) ? option[valueKey] === value[valueKey] : false,
1057
- renderInput: (params) => /* @__PURE__ */ jsx8(TextField5, { ...params, label })
1056
+ getOptionLabel: (option) => getOptionLabel(option),
1057
+ isOptionEqualToValue: (option, value) => getOptionValue(option) === getOptionValue(value),
1058
+ renderInput: (params) => {
1059
+ return /* @__PURE__ */ jsx8(
1060
+ TextField5,
1061
+ {
1062
+ ...params,
1063
+ required,
1064
+ label,
1065
+ sx: {
1066
+ "& .MuiInputLabel-asterisk": { color: "red" },
1067
+ "& .MuiInputBase-input": {
1068
+ cursor: disabled ? "not-allowed" : "default"
1069
+ }
1070
+ }
1071
+ }
1072
+ );
1073
+ }
1058
1074
  }
1059
1075
  );
1060
1076
  };
@@ -1080,7 +1096,7 @@ import {
1080
1096
  import {
1081
1097
  useController as useController9
1082
1098
  } from "react-hook-form";
1083
- import { Fragment as Fragment3, useState as useState5 } from "react";
1099
+ import { Fragment as Fragment3, useState as useState4 } from "react";
1084
1100
  import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
1085
1101
  var Component9 = function SelectMultiElement(props) {
1086
1102
  const {
@@ -1103,7 +1119,7 @@ var Component9 = function SelectMultiElement(props) {
1103
1119
  name,
1104
1120
  control
1105
1121
  });
1106
- const [selectedOptions, setSelectedOptions] = useState5([]);
1122
+ const [selectedOptions, setSelectedOptions] = useState4([]);
1107
1123
  const handleChange = (_2, selectedOptions2, reason) => {
1108
1124
  if (reason === "clear") {
1109
1125
  setSelectedOptions([]);
@@ -1178,7 +1194,7 @@ import {
1178
1194
  TextField as TextField7,
1179
1195
  useTheme as useTheme5
1180
1196
  } from "@mui/material";
1181
- import { useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
1197
+ import { useEffect as useEffect5, useRef as useRef3, useState as useState5 } from "react";
1182
1198
  import {
1183
1199
  useController as useController10
1184
1200
  } from "react-hook-form";
@@ -1225,7 +1241,7 @@ var Component10 = function SelectCascadeElement(props) {
1225
1241
  field.onChange(initialValue);
1226
1242
  }
1227
1243
  }, [initialValue]);
1228
- const [hasAutoSelected, setHasAutoSelected] = useState6(false);
1244
+ const [hasAutoSelected, setHasAutoSelected] = useState5(false);
1229
1245
  useEffect5(() => {
1230
1246
  if (isEdit && !disabled && options.length === 1 && field.value == null && !hasAutoSelected) {
1231
1247
  field.onChange(options[0].Value);
@@ -1374,7 +1390,7 @@ import {
1374
1390
  FormHelperText as FormHelperText3,
1375
1391
  Grid2 as Grid212
1376
1392
  } from "@mui/material";
1377
- import { useEffect as useEffect6, useState as useState7 } from "react";
1393
+ import { useEffect as useEffect6, useState as useState6 } from "react";
1378
1394
  import {
1379
1395
  useController as useController12
1380
1396
  } from "react-hook-form";
@@ -1389,7 +1405,7 @@ var Component12 = function CheckboxGroup(props) {
1389
1405
  control,
1390
1406
  disabled: rest.disabled
1391
1407
  });
1392
- const [selectedValues, setSelectedValues] = useState7(
1408
+ const [selectedValues, setSelectedValues] = useState6(
1393
1409
  options.filter((c) => field.value?.includes(c.Value)).map((c) => c.Value) || []
1394
1410
  );
1395
1411
  useEffect6(() => {
@@ -93,4 +93,11 @@ type AuthorizedViewProps = PropsWithChildren & {
93
93
  };
94
94
  declare const AuthorizedView: ({ children, show }: AuthorizedViewProps) => react_jsx_runtime.JSX.Element;
95
95
 
96
- export { AuthorizedView, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };
96
+ type CancelButtonProps = {
97
+ isSubmitting: boolean;
98
+ handleCancel: () => void;
99
+ sx?: SxProps;
100
+ };
101
+ declare const CancelButton: ({ isSubmitting, handleCancel, sx, }: CancelButtonProps) => react_jsx_runtime.JSX.Element;
102
+
103
+ export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };
@@ -93,4 +93,11 @@ type AuthorizedViewProps = PropsWithChildren & {
93
93
  };
94
94
  declare const AuthorizedView: ({ children, show }: AuthorizedViewProps) => react_jsx_runtime.JSX.Element;
95
95
 
96
- export { AuthorizedView, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };
96
+ type CancelButtonProps = {
97
+ isSubmitting: boolean;
98
+ handleCancel: () => void;
99
+ sx?: SxProps;
100
+ };
101
+ declare const CancelButton: ({ isSubmitting, handleCancel, sx, }: CancelButtonProps) => react_jsx_runtime.JSX.Element;
102
+
103
+ export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar };
@@ -8,8 +8,8 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkRWMC36UOjs = require('../chunk-RWMC36UO.js');
12
11
 
12
+ var _chunkJKUOV3MNjs = require('../chunk-JKUOV3MN.js');
13
13
 
14
14
 
15
15
 
@@ -19,4 +19,6 @@ var _chunkRWMC36UOjs = require('../chunk-RWMC36UO.js');
19
19
 
20
20
 
21
21
 
22
- exports.AuthorizedView = _chunkRWMC36UOjs.AuthorizedView_default; exports.ClearButton = _chunkRWMC36UOjs.ClearButton_default; exports.FilterButton = _chunkRWMC36UOjs.FilterButton_default; exports.FilterWrapper = _chunkRWMC36UOjs.FilterWrapper_default; exports.FormWrapper = _chunkRWMC36UOjs.FormWrapper_default; exports.LabelText = _chunkRWMC36UOjs.LabelText_default; exports.ListWrapper = _chunkRWMC36UOjs.ListWrapper_default; exports.SimpleButton = _chunkRWMC36UOjs.SimpleButton_default; exports.SimpleToolbar = _chunkRWMC36UOjs.SimpleToolbar_default;
22
+
23
+
24
+ exports.AuthorizedView = _chunkJKUOV3MNjs.AuthorizedView_default; exports.CancelButton = _chunkJKUOV3MNjs.CancelButton_default; exports.ClearButton = _chunkJKUOV3MNjs.ClearButton_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;
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  AuthorizedView_default,
3
+ CancelButton_default,
3
4
  ClearButton_default,
4
5
  FilterButton_default,
5
6
  FilterWrapper_default,
@@ -8,9 +9,10 @@ import {
8
9
  ListWrapper_default,
9
10
  SimpleButton_default,
10
11
  SimpleToolbar_default
11
- } from "../chunk-KADZH5FM.mjs";
12
+ } from "../chunk-FSU3H777.mjs";
12
13
  export {
13
14
  AuthorizedView_default as AuthorizedView,
15
+ CancelButton_default as CancelButton,
14
16
  ClearButton_default as ClearButton,
15
17
  FilterButton_default as FilterButton,
16
18
  FilterWrapper_default as FilterWrapper,
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthorizedView, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.mjs';
1
+ export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.mjs';
2
2
  export { UseTransformOptions, UseTransformReturn, useTransform } from './hooks/index.mjs';
3
3
  export { ApiResponse, ListResponse, OperationResponse, PostModel, ValidationErrors, ValueLabel } from './types/index.mjs';
4
4
  export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools } from './utils/index.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthorizedView, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.js';
1
+ export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.js';
2
2
  export { UseTransformOptions, UseTransformReturn, useTransform } from './hooks/index.js';
3
3
  export { ApiResponse, ListResponse, OperationResponse, PostModel, ValidationErrors, ValueLabel } from './types/index.js';
4
4
  export { api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools } from './utils/index.js';
package/dist/index.js CHANGED
@@ -8,12 +8,13 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkRWMC36UOjs = require('./chunk-RWMC36UO.js');
11
+
12
+ var _chunkJKUOV3MNjs = require('./chunk-JKUOV3MN.js');
12
13
  require('./chunk-7M2VOCYN.js');
13
14
  require('./chunk-6BGQA4BQ.js');
14
15
 
15
16
 
16
- var _chunkDIGNPXO5js = require('./chunk-DIGNPXO5.js');
17
+ var _chunkNTUP43A7js = require('./chunk-NTUP43A7.js');
17
18
 
18
19
 
19
20
  var _chunkSTC2BZ2Ljs = require('./chunk-STC2BZ2L.js');
@@ -53,4 +54,5 @@ var _chunkDKBPCLECjs = require('./chunk-DKBPCLEC.js');
53
54
 
54
55
 
55
56
 
56
- exports.AuthorizedView = _chunkRWMC36UOjs.AuthorizedView_default; exports.ClearButton = _chunkRWMC36UOjs.ClearButton_default; exports.Field = _chunkDIGNPXO5js.Field_default; exports.Field2 = _chunkSTC2BZ2Ljs.Field_default; exports.FilterButton = _chunkRWMC36UOjs.FilterButton_default; exports.FilterWrapper = _chunkRWMC36UOjs.FilterWrapper_default; exports.FormWrapper = _chunkRWMC36UOjs.FormWrapper_default; exports.LabelText = _chunkRWMC36UOjs.LabelText_default; exports.ListWrapper = _chunkRWMC36UOjs.ListWrapper_default; exports.SimpleButton = _chunkRWMC36UOjs.SimpleButton_default; exports.SimpleToolbar = _chunkRWMC36UOjs.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;
57
+
58
+ exports.AuthorizedView = _chunkJKUOV3MNjs.AuthorizedView_default; exports.CancelButton = _chunkJKUOV3MNjs.CancelButton_default; exports.ClearButton = _chunkJKUOV3MNjs.ClearButton_default; exports.Field = _chunkNTUP43A7js.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;
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  AuthorizedView_default,
3
+ CancelButton_default,
3
4
  ClearButton_default,
4
5
  FilterButton_default,
5
6
  FilterWrapper_default,
@@ -8,12 +9,12 @@ import {
8
9
  ListWrapper_default,
9
10
  SimpleButton_default,
10
11
  SimpleToolbar_default
11
- } from "./chunk-KADZH5FM.mjs";
12
+ } from "./chunk-FSU3H777.mjs";
12
13
  import "./chunk-2JFL7TS5.mjs";
13
14
  import "./chunk-EVPUCTZA.mjs";
14
15
  import {
15
16
  Field_default
16
- } from "./chunk-VOOWINZA.mjs";
17
+ } from "./chunk-OHRT3LMC.mjs";
17
18
  import {
18
19
  Field_default as Field_default2
19
20
  } from "./chunk-34X2YRTY.mjs";
@@ -33,6 +34,7 @@ import {
33
34
  } from "./chunk-AVNKSUE5.mjs";
34
35
  export {
35
36
  AuthorizedView_default as AuthorizedView,
37
+ CancelButton_default as CancelButton,
36
38
  ClearButton_default as ClearButton,
37
39
  Field_default as Field,
38
40
  Field_default2 as Field2,
@@ -3,7 +3,7 @@ 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 AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.mjs';
5
5
  import * as react from 'react';
6
- import { ReactNode, ChangeEvent } from 'react';
6
+ import react__default, { ReactNode, ChangeEvent } from 'react';
7
7
  import { TimePickerProps, TimePickerSlotProps, PickerChangeHandlerContext, TimeValidationError, DateValidationError, DatePickerSlotProps, DatePickerProps } from '@mui/x-date-pickers';
8
8
  import { PickerValidDate } from '@mui/x-date-pickers/models';
9
9
 
@@ -74,7 +74,7 @@ type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TNa
74
74
  sx?: SxProps;
75
75
  };
76
76
 
77
- type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
77
+ type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends react__default.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
78
78
  rules?: UseControllerProps<TFieldValues, TName>["rules"];
79
79
  name: TName;
80
80
  control?: Control<TFieldValues>;
@@ -84,8 +84,9 @@ type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues,
84
84
  variant?: TextFieldVariants$1;
85
85
  sx?: SxProps$1;
86
86
  isEdit?: boolean;
87
- labelKey?: keyof TOption;
87
+ labelKey?: string;
88
88
  valueKey?: keyof TOption;
89
+ textFieldProps?: Omit<TextFieldProps, "name">;
89
90
  };
90
91
 
91
92
  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"> & {
@@ -198,7 +199,7 @@ declare const Field: {
198
199
  RadioGroup: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue = unknown>(props: RadioButtonGroupProps<TFieldValues, TName, TValue>) => JSX.Element;
199
200
  Password: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>>(props: PasswordElementProps<TFieldValues, TName>) => JSX.Element;
200
201
  Time: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends unknown = any>(props: TimePickerElementProps<TFieldValues, TName, TValue>) => JSX.Element;
201
- Select: <TOption, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
202
+ 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;
202
203
  SelectMulti: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends {
203
204
  Value: number;
204
205
  Label: string;
@@ -3,7 +3,7 @@ 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 AsyncSelectPayload } from '../AsyncSelectPayload-CiwoX8EE.js';
5
5
  import * as react from 'react';
6
- import { ReactNode, ChangeEvent } from 'react';
6
+ import react__default, { ReactNode, ChangeEvent } from 'react';
7
7
  import { TimePickerProps, TimePickerSlotProps, PickerChangeHandlerContext, TimeValidationError, DateValidationError, DatePickerSlotProps, DatePickerProps } from '@mui/x-date-pickers';
8
8
  import { PickerValidDate } from '@mui/x-date-pickers/models';
9
9
 
@@ -74,7 +74,7 @@ type SelectMultiElementProps<TFieldValues extends FieldValues = FieldValues, TNa
74
74
  sx?: SxProps;
75
75
  };
76
76
 
77
- type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
77
+ type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends react__default.ElementType = ChipTypeMap["defaultComponent"]> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, "name" | "renderInput" | "isOptionEqualToValue" | "getOptionLabel"> & {
78
78
  rules?: UseControllerProps<TFieldValues, TName>["rules"];
79
79
  name: TName;
80
80
  control?: Control<TFieldValues>;
@@ -84,8 +84,9 @@ type SelectElementProps<TOption, TFieldValues extends FieldValues = FieldValues,
84
84
  variant?: TextFieldVariants$1;
85
85
  sx?: SxProps$1;
86
86
  isEdit?: boolean;
87
- labelKey?: keyof TOption;
87
+ labelKey?: string;
88
88
  valueKey?: keyof TOption;
89
+ textFieldProps?: Omit<TextFieldProps, "name">;
89
90
  };
90
91
 
91
92
  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"> & {
@@ -198,7 +199,7 @@ declare const Field: {
198
199
  RadioGroup: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue = unknown>(props: RadioButtonGroupProps<TFieldValues, TName, TValue>) => JSX.Element;
199
200
  Password: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>>(props: PasswordElementProps<TFieldValues, TName>) => JSX.Element;
200
201
  Time: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends unknown = any>(props: TimePickerElementProps<TFieldValues, TName, TValue>) => JSX.Element;
201
- Select: <TOption, TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = "div">(props: SelectElementProps<TOption, TFieldValues, TName, Multiple, DisableClearable, FreeSolo, ChipComponent>) => react.JSX.Element;
202
+ 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;
202
203
  SelectMulti: <TFieldValues extends react_hook_form.FieldValues = react_hook_form.FieldValues, TName extends react_hook_form.FieldPath<TFieldValues> = react_hook_form.FieldPath<TFieldValues>, TValue extends {
203
204
  Value: number;
204
205
  Label: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDIGNPXO5js = require('../chunk-DIGNPXO5.js');
3
+ var _chunkNTUP43A7js = require('../chunk-NTUP43A7.js');
4
4
  require('../chunk-6JZ35VQJ.js');
5
5
  require('../chunk-DKBPCLEC.js');
6
6
 
7
7
 
8
- exports.Field = _chunkDIGNPXO5js.Field_default;
8
+ exports.Field = _chunkNTUP43A7js.Field_default;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Field_default
3
- } from "../chunk-VOOWINZA.mjs";
3
+ } from "../chunk-OHRT3LMC.mjs";
4
4
  import "../chunk-GFSTK7KN.mjs";
5
5
  import "../chunk-AVNKSUE5.mjs";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnwebsoft/ui",
3
- "version": "2.18.38",
3
+ "version": "2.18.39",
4
4
  "description": "A set of reusable wrappers for MUI v6",
5
5
  "author": "GNWebsoft Private Limited",
6
6
  "license": "",