tp-react-elements-dev 1.4.16 → 1.5.1

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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Theme } from "@emotion/react";
2
3
  import { SxProps } from "@mui/material";
3
4
  export declare const renderLabel: (label: string, isRequired?: boolean, alignRight?: boolean) => import("react/jsx-runtime").JSX.Element;
@@ -7,7 +8,7 @@ interface OptionsProps {
7
8
  value: string | number;
8
9
  }
9
10
  interface TextFieldInputProps {
10
- autoComplete: 'new-password' | 'off';
11
+ autoComplete: "new-password" | "off";
11
12
  }
12
13
  export interface FormSectionPropsItem {
13
14
  name: string;
@@ -25,7 +26,7 @@ export interface FormSectionPropsItem {
25
26
  maxDate?: string;
26
27
  placeholder?: string;
27
28
  minRows?: string | number;
28
- CustomProps?: string;
29
+ CustomProps?: any;
29
30
  numberOfColumns?: number;
30
31
  monthSpan?: number;
31
32
  variant?: string;
@@ -33,6 +34,8 @@ export interface FormSectionPropsItem {
33
34
  InputProps?: TextFieldInputProps;
34
35
  customErrorMessage?: string | null;
35
36
  sx?: SxProps<Theme>;
37
+ donotAllowSpace?: boolean;
38
+ onInputProps?: (e: React.FocusEvent<HTMLInputElement>) => void;
36
39
  }
37
40
  export interface FormRenderProps {
38
41
  item: FormSectionPropsItem;
package/dist/index.esm.js CHANGED
@@ -46951,6 +46951,7 @@ const extractValuesToArray = (inputString) => {
46951
46951
  };
46952
46952
  function MultiSelectV1({ props }) {
46953
46953
  var _a;
46954
+ console.log(props, "ksjh");
46954
46955
  const [personName, setPersonName] = React$1.useState(props.getValues(props.item.name)
46955
46956
  ? extractValuesToArray(props.getValues(props.item.name))
46956
46957
  : []);
@@ -47008,7 +47009,7 @@ function MultiSelectV1({ props }) {
47008
47009
  "& .css-kichxs-MuiFormLabel-root-MuiInputLabel-root,.css-1holvmy": {
47009
47010
  top: "-10px",
47010
47011
  },
47011
- } }, { children: [jsxRuntimeExports.jsxs(InputLabel, Object.assign({ id: "demo-multiple-checkbox-label" }, { children: [props.item.label, props.item.required ? ' *' : ''] })), jsxRuntimeExports.jsxs(Select, Object.assign({ labelId: "demo-multiple-checkbox-label", id: "demo-multiple-checkbox", multiple: true, sx: {
47012
+ } }, { children: [jsxRuntimeExports.jsxs(InputLabel, Object.assign({ id: "demo-multiple-checkbox-label" }, { children: [props.item.label, props.item.required ? " *" : ""] })), jsxRuntimeExports.jsxs(Select, Object.assign({ labelId: "demo-multiple-checkbox-label", id: "demo-multiple-checkbox", multiple: true, sx: {
47012
47013
  "& .MuiTypography-root": {
47013
47014
  fontSize: "5px !important",
47014
47015
  },
@@ -47065,7 +47066,7 @@ function MultiSelectV1({ props }) {
47065
47066
  "& span": {
47066
47067
  fontSize: "12px !important",
47067
47068
  },
47068
- } })] }), option.value)))) : (jsxRuntimeExports.jsx(MenuItem, Object.assign({ disabled: true, value: "NA" }, { children: "No data Found" }), "NA"))] })), jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name, render: ({ message }) => (jsxRuntimeExports.jsx(ErrorMessageComponent, { children: message })) })] })) }));
47069
+ } })] }), option.value)))) : (jsxRuntimeExports.jsx(MenuItem, Object.assign({ disabled: true, value: "NA" }, { children: "No data Found" }), "NA"))] })), jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name, render: ({ message }) => (jsxRuntimeExports.jsx(ErrorMessageComponent, { children: message })) })] })) }, props.item.name));
47069
47070
  }
47070
47071
 
47071
47072
  var dayjs_min = {exports: {}};
@@ -52063,7 +52064,7 @@ const SingleSelect = ({ props }) => {
52063
52064
  }, getOptionLabel: (option) => option.label, renderInput: (params) => {
52064
52065
  return (jsxRuntimeExports.jsx(Tooltip, Object.assign({ title: params.inputProps.value && params.inputProps.value }, { children: jsxRuntimeExports.jsx(TextField, Object.assign({}, params, { placeholder: props.item.Placeholder, label: `${props.item.label}${props.item.required ? ' *' : ''}` })) })));
52065
52066
  }, isOptionEqualToValue: isOptionEqualToValue })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }));
52066
- } }));
52067
+ } }, props.item.name));
52067
52068
  };
52068
52069
 
52069
52070
  var Visibility = createSvgIcon$1( /*#__PURE__*/jsxRuntimeExports.jsx("path", {
@@ -52086,6 +52087,11 @@ const PasswordField = ({ props }) => {
52086
52087
  "& .css-kichxs-MuiFormLabel-root-MuiInputLabel-root,.css-1holvmy": {
52087
52088
  top: "-8px",
52088
52089
  },
52090
+ }, inputProps: {
52091
+ maxLength: props.item.maxLength || 100,
52092
+ onInput: (e) => {
52093
+ props.item.onInputProps && props.item.onInputProps(e);
52094
+ },
52089
52095
  }, value: field.value || null, disabled: props.item.disable })), jsxRuntimeExports.jsx(IconButton, Object.assign({ sx: {
52090
52096
  position: "absolute",
52091
52097
  right: "14px",
@@ -52201,23 +52207,27 @@ const DatepickerWrapperV2 = ({ props }) => {
52201
52207
  fontSize: "11px",
52202
52208
  color: "#3651d3",
52203
52209
  } }, { children: ["(", (_f = props === null || props === void 0 ? void 0 : props.item) === null || _f === void 0 ? void 0 : _f.helperText, ")"] }))), !(props === null || props === void 0 ? void 0 : props.getValues(props.item.name)) && (jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) }))] }));
52204
- } }));
52210
+ } }, props.item.name));
52205
52211
  };
52206
52212
 
52207
52213
  const FormRenderFileUpload = ({ props }) => {
52208
52214
  var _a, _b, _c;
52209
- // const getDocument:any=document;
52210
- // useEffect(()=>{
52211
- // if(props.getValues(props.item.name)===null || props.getValues(props.item.name)==undefined){
52212
- // // getDocument.getElementById(props.item.name)?.value=''
52213
- // }
52214
- // },[props.getValues(props.item.name)])
52215
+ useEffect(() => {
52216
+ if (props.getValues(props.item.name) === null || props.getValues(props.item.name) === undefined) {
52217
+ const element = document.getElementById(props.item.name);
52218
+ console.log(element, 'elementelement');
52219
+ if (element) {
52220
+ element.value = ''; // Ensure it's an input element
52221
+ }
52222
+ }
52223
+ }, [props.getValues(props.item.name)]);
52215
52224
  return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Box, Object.assign({ paddingLeft: "4px" }, { children: [((_a = props.item) === null || _a === void 0 ? void 0 : _a.label) && jsxRuntimeExports.jsx(Box, Object.assign({ sx: { fontSize: "10px;" } }, { children: renderLabel((_b = props.item) === null || _b === void 0 ? void 0 : _b.label, (_c = props.item) === null || _c === void 0 ? void 0 : _c.required) })), jsxRuntimeExports.jsx(TextField, { type: "file", id: props.item.name, inputProps: { accept: props.item.fileType === 'excel' ? ".xls, .xlsx" : '' }, onChange: (event) => {
52216
- var _a, _b, _c;
52225
+ var _a, _b, _c, _d, _e;
52217
52226
  const file = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files[0];
52218
52227
  const fileName = file ? file.name : null;
52219
52228
  props.setValue((_b = props.item) === null || _b === void 0 ? void 0 : _b.name, file);
52220
52229
  props.setValue(((_c = props.item) === null || _c === void 0 ? void 0 : _c.name) + "Name", fileName);
52230
+ ((_d = props.item) === null || _d === void 0 ? void 0 : _d.onInputProps) && ((_e = props.item) === null || _e === void 0 ? void 0 : _e.onInputProps(event));
52221
52231
  }, sx: { width: "100%" } })] })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }));
52222
52232
  };
52223
52233
 
@@ -52237,14 +52247,14 @@ const SingleSelectNonAutoComplete = ({ props }) => {
52237
52247
  useStyles();
52238
52248
  return (jsxRuntimeExports.jsxs(FormControl, Object.assign({ fullWidth: true, sx: { position: "relative" } }, { children: [jsxRuntimeExports.jsx(InputLabel, Object.assign({ id: "demo-simple-select-label" }, { children: props.item.label })), jsxRuntimeExports.jsx(Select, Object.assign({ labelId: "demo-simple-select-label", id: "demo-simple-select",
52239
52249
  // {...props.register(props.item.name)}
52240
- value: props.getValues(props.item.name), label: `${props.item.label}${props.item.required ? ' *' : ''}`, onChange: (e) => props.setValue(props.item.name, e.target.value), onBlur: (e) => {
52250
+ value: props.getValues(props.item.name), label: `${props.item.label}${props.item.required ? " *" : ""}`, onChange: (e) => props.setValue(props.item.name, e.target.value), onBlur: (e) => {
52241
52251
  var _a, _b;
52242
52252
  ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.onBlurFn) && ((_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.onBlurFn(e));
52243
52253
  } }, { children: props.item.options.map((item) => (jsxRuntimeExports.jsx(MenuItem, Object.assign({ sx: {
52244
52254
  fontSize: "11px",
52245
52255
  fontFamily: "Roboto-Reg",
52246
52256
  zIndex: 2000,
52247
- }, value: item.value }, { children: item.label })))) })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })));
52257
+ }, value: item.value }, { children: item.label })))) })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }), props.item.name));
52248
52258
  };
52249
52259
 
52250
52260
  const FormActiveSwitch = ({ props }) => {
@@ -52274,8 +52284,8 @@ const renderLabel = (label, isRequired, alignRight) => {
52274
52284
  };
52275
52285
  function formatDateMonthAndYear(date) {
52276
52286
  // Check if date is a string
52277
- if (typeof date !== 'string') {
52278
- throw new TypeError('Expected a string');
52287
+ if (typeof date !== "string") {
52288
+ throw new TypeError("Expected a string");
52279
52289
  }
52280
52290
  // Split the date string into month and year
52281
52291
  const [month, year] = date.split("/");
@@ -52286,6 +52296,7 @@ function formatDateMonthAndYear(date) {
52286
52296
  }
52287
52297
  const RenderForm = (props) => {
52288
52298
  var _a, _b;
52299
+ console.log(props, "propsprops", props.item.inputType);
52289
52300
  switch ((_a = props.item) === null || _a === void 0 ? void 0 : _a.inputType) {
52290
52301
  case "text":
52291
52302
  case "email":
@@ -52293,7 +52304,7 @@ const RenderForm = (props) => {
52293
52304
  var _a, _b;
52294
52305
  return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { fullWidth: true,
52295
52306
  // error={props.errors}
52296
- label: `${props.item.label}${props.item.required ? ' *' : ''}`, placeholder: props.item.placeholder || "", InputProps: {
52307
+ label: `${props.item.label}${props.item.required ? " *" : ""}`, placeholder: props.item.placeholder || "", InputProps: {
52297
52308
  style: {
52298
52309
  fontFamily: "Roboto-Reg",
52299
52310
  border: "none",
@@ -52320,8 +52331,12 @@ const RenderForm = (props) => {
52320
52331
  }, inputProps: {
52321
52332
  maxLength: props.item.maxLength || 100,
52322
52333
  onInput: (e) => {
52323
- var _a;
52324
- if (!((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.allowSpecialChars)) {
52334
+ var _a, _b;
52335
+ if ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.donotAllowSpace) {
52336
+ const value = e.target.value;
52337
+ e.target.value = value.replace(" ", "");
52338
+ }
52339
+ if (!((_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.allowSpecialChars)) {
52325
52340
  const value = e.target.value;
52326
52341
  e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, "");
52327
52342
  } // Allow only alphanumeric and space
@@ -52329,20 +52344,21 @@ const RenderForm = (props) => {
52329
52344
  e.target.value === " ") {
52330
52345
  e.target.value = "";
52331
52346
  }
52347
+ props.item.onInputProps && props.item.onInputProps(e);
52332
52348
  },
52333
52349
  } })), ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.helperText) && (jsxRuntimeExports.jsxs("span", Object.assign({ style: {
52334
52350
  fontFamily: "Roboto-Reg",
52335
52351
  fontSize: "11px",
52336
52352
  color: "#3651d3",
52337
52353
  } }, { children: ["(", (_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.helperText, ")"] }))), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }));
52338
- } }) }));
52354
+ } }, props.item.name) }));
52339
52355
  case "register-number":
52340
52356
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {
52341
52357
  var _a, _b;
52342
52358
  return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { fullWidth: true, onBlur: (e) => {
52343
52359
  var _a, _b;
52344
52360
  ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.onBlurFn) && ((_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.onBlurFn(e));
52345
- }, label: `${props.item.label}${props.item.required ? ' *' : ''}`, InputProps: {
52361
+ }, label: `${props.item.label}${props.item.required ? " *" : ""}`, InputProps: {
52346
52362
  style: {
52347
52363
  fontFamily: "Roboto-Reg",
52348
52364
  border: "none",
@@ -52351,6 +52367,7 @@ const RenderForm = (props) => {
52351
52367
  e.target.value = e.target.value
52352
52368
  .replace(/\s/g, "")
52353
52369
  .replace(/[^a-zA-Z0-9!@#$%^&*()_+{}\[\]:;<>,.?/~`|\\-]/g, "");
52370
+ props.item.onInputProps && props.item.onInputProps(e);
52354
52371
  }, sx: Object.assign({ fontFamily: "Roboto-Reg", "& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
52355
52372
  top: "-10px",
52356
52373
  // fontSize:'14px !important'
@@ -52372,9 +52389,9 @@ const RenderForm = (props) => {
52372
52389
  fontSize: "11px",
52373
52390
  color: "#3651d3",
52374
52391
  } }, { children: ["(", (_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.helperText, ")"] }))), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }));
52375
- } }) }));
52392
+ } }, props.item.name) }));
52376
52393
  case "password":
52377
- return (jsxRuntimeExports.jsx(Box, Object.assign({ position: "relative" }, { children: jsxRuntimeExports.jsx(PasswordField, { props: props }) })));
52394
+ return (jsxRuntimeExports.jsx(Box, Object.assign({ position: "relative" }, { children: jsxRuntimeExports.jsx(PasswordField, { props: props }) }), props.item.name));
52378
52395
  case "select":
52379
52396
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(SingleSelect, { props: props }) }));
52380
52397
  case "select-v2":
@@ -52389,7 +52406,7 @@ const RenderForm = (props) => {
52389
52406
  case "pincode":
52390
52407
  case "phoneNumber":
52391
52408
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {
52392
- return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { size: "small", label: `${props.item.label}${props.item.required ? ' *' : ''}`, value: props.getValues(props.item.name) || "", defaultValue: props.getValues(props.item.name) || null, onInput: (e) => {
52409
+ return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { size: "small", label: `${props.item.label}${props.item.required ? " *" : ""}`, value: props.getValues(props.item.name) || "", defaultValue: props.getValues(props.item.name) || null, onInput: (e) => {
52393
52410
  var _a, _b;
52394
52411
  e.target.value = e.target.value.replace(/[^0-9]/g, "");
52395
52412
  if (e.target.value === "") {
@@ -52408,10 +52425,26 @@ const RenderForm = (props) => {
52408
52425
  }, inputProps: {
52409
52426
  pattern: "[0-9]*",
52410
52427
  maxLength: props.item.maxLength || 20,
52428
+ onInput: (e) => {
52429
+ var _a, _b;
52430
+ if ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.donotAllowSpace) {
52431
+ const value = e.target.value;
52432
+ e.target.value = value.replace(" ", "");
52433
+ }
52434
+ if (!((_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.allowSpecialChars)) {
52435
+ const value = e.target.value;
52436
+ e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, "");
52437
+ } // Allow only alphanumeric and space
52438
+ if (e.target.value.length === 1 &&
52439
+ e.target.value === " ") {
52440
+ e.target.value = "";
52441
+ }
52442
+ props.item.onInputProps && props.item.onInputProps(e);
52443
+ },
52411
52444
  }, disabled: props.item.disable })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }));
52412
- } }) }));
52445
+ } }, props.item.name) }));
52413
52446
  case "decimal":
52414
- return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(Controller, { name: props.item.name, control: props.control, disabled: (_b = props.item) === null || _b === void 0 ? void 0 : _b.disable, render: ({ field }) => (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({ type: "text", size: "small", label: `${props.item.label}${props.item.required ? ' *' : ''}` }, field, { onChange: (e) => (props === null || props === void 0 ? void 0 : props.clearErrors) && (props === null || props === void 0 ? void 0 : props.clearErrors(props.item.name)), sx: {
52447
+ return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(Controller, { name: props.item.name, control: props.control, disabled: (_b = props.item) === null || _b === void 0 ? void 0 : _b.disable, render: ({ field }) => (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({ type: "text", size: "small", label: `${props.item.label}${props.item.required ? " *" : ""}` }, field, { onChange: (e) => (props === null || props === void 0 ? void 0 : props.clearErrors) && (props === null || props === void 0 ? void 0 : props.clearErrors(props.item.name)), sx: {
52415
52448
  "& input": {
52416
52449
  textAlign: "right",
52417
52450
  },
@@ -52439,7 +52472,7 @@ const RenderForm = (props) => {
52439
52472
  pattern: "[1-9]",
52440
52473
  maxLength: 7,
52441
52474
  },
52442
- } })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }) }));
52475
+ } })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }, props.item.name) }));
52443
52476
  // case "alpha-numerical":
52444
52477
  // return (
52445
52478
  // <>
@@ -52646,14 +52679,14 @@ const RenderForm = (props) => {
52646
52679
  "& .css-1holvmy, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
52647
52680
  top: "-10px",
52648
52681
  },
52649
- }, label: `${props.item.label}${props.item.required ? ' *' : ''}`, views: ["year"], value: field.value ? dayjs(field.value) : null, onChange: (date) => field.onChange(date),
52682
+ }, label: `${props.item.label}${props.item.required ? " *" : ""}`, views: ["year"], value: field.value ? dayjs(field.value) : null, onChange: (date) => field.onChange(date),
52650
52683
  // minDate={}
52651
52684
  slots: {
52652
52685
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
52653
52686
  textField: (textFieldProps) => (jsxRuntimeExports.jsx(TextField, Object.assign({}, textFieldProps, { fullWidth: true, disabled: props.item.disable || false, InputLabelProps: {
52654
52687
  shrink: true,
52655
52688
  } }))),
52656
- } }) })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }) }));
52689
+ } }) })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }, props.item.name) }));
52657
52690
  case "dateRangePicker":
52658
52691
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(DateRangePickerComponent, { props: props }) }));
52659
52692
  case "monthpicker":
@@ -52668,36 +52701,33 @@ const RenderForm = (props) => {
52668
52701
  fontFamily: "Roboto-Reg",
52669
52702
  border: "none",
52670
52703
  },
52671
- }, sx: {
52672
- fontFamily: "Roboto-Reg",
52673
- "& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
52704
+ }, sx: Object.assign({ fontFamily: "Roboto-Reg", "& .css-1holvmy,.css-lqj8pz-MuiFormLabel-root-MuiInputLabel-root, .css-kichxs-MuiFormLabel-root-MuiInputLabel-root": {
52674
52705
  top: "-10px",
52675
- },
52676
- "& input": {
52706
+ }, "& input": {
52677
52707
  fontSize: "11px",
52678
- },
52679
- "& .css-2rul56-MuiFormLabel-root-MuiInputLabel-root": {
52708
+ // textTransform:'uppercase'
52709
+ }, "& .css-2rul56-MuiFormLabel-root-MuiInputLabel-root": {
52680
52710
  top: "-10px",
52681
52711
  fontFamily: "Roboto-Reg",
52682
- },
52683
- "& .css-12ciryo-MuiFormLabel-root-MuiInputLabel-root ": {
52712
+ }, "& .css-12ciryo-MuiFormLabel-root-MuiInputLabel-root ": {
52684
52713
  fontFamily: "Roboto-Reg",
52685
- },
52686
- "& .css-1gq5vhi-MuiInputBase-root-MuiOutlinedInput-root input ": {
52714
+ }, "& .css-1gq5vhi-MuiInputBase-root-MuiOutlinedInput-root input ": {
52687
52715
  outline: "none",
52688
52716
  border: "1px solid #ced4da", // Add this line to set border to none
52689
- },
52690
- "& .css-1gq5vhi-MuiInputBase-root-MuiOutlinedInput-root input:focus ": {
52717
+ }, "& .css-1gq5vhi-MuiInputBase-root-MuiOutlinedInput-root input:focus ": {
52691
52718
  outline: "none",
52692
52719
  border: "none", // Set border to none when input is focused
52693
- },
52694
- "& .css-1y03twt-MuiInputBase-root-MuiOutlinedInput-root": {
52720
+ }, "& .css-1y03twt-MuiInputBase-root-MuiOutlinedInput-root": {
52695
52721
  padding: "5px 5px",
52696
52722
  fontSize: "11px",
52697
- },
52698
- }, minRows: props.item.minRows || 1,
52723
+ }, "& textarea": {
52724
+ fontSize: "11px",
52725
+ // textTransform:'uppercase'
52726
+ maxHeight: "500px !important",
52727
+ overflow: "auto",
52728
+ } }, props.item.sx), minRows: props.item.minRows || 1,
52699
52729
  // maxRows={2}
52700
- placeholder: props.item.placeholder || "Type Something..." }, field, { label: `${props.item.label}${props.item.required ? ' *' : ''}`, value: field.value || "", disabled: props.item.disable, inputProps: {
52730
+ placeholder: props.item.placeholder || "Type Something..." }, field, { label: `${props.item.label}${props.item.required ? " *" : ""}`, value: field.value || "", disabled: props.item.disable, inputProps: {
52701
52731
  onInput: (e) => {
52702
52732
  var _a;
52703
52733
  if (!((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.allowSpecialChars)) {
@@ -52709,7 +52739,7 @@ const RenderForm = (props) => {
52709
52739
  e.target.value = "";
52710
52740
  }
52711
52741
  },
52712
- } })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }) }));
52742
+ } })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }, props.item.name) }));
52713
52743
  // case "textarea-normal":
52714
52744
  // return (
52715
52745
  // <>
@@ -52746,7 +52776,7 @@ const RenderForm = (props) => {
52746
52776
  // </>
52747
52777
  // );
52748
52778
  case "toggleSwitch":
52749
- return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(FormActiveSwitch, { props: props }) }));
52779
+ return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(FormActiveSwitch, { props: props }, props.item.name) }));
52750
52780
  // case "percentage-number":
52751
52781
  // return (
52752
52782
  // <>
@@ -52854,9 +52884,9 @@ const FormRenderWrapper = ({ formArray, name, numberOfColumns = 3, form, }) => {
52854
52884
  // useEffect(() => {
52855
52885
  // // form.reset(initialValues, { resolver: yupResolver(validationSchema) });
52856
52886
  // }, [formArray, validationSchema, initialValues]);
52857
- return (jsxRuntimeExports.jsx(ThemeProvider, Object.assign({ theme: customTheme }, { children: jsxRuntimeExports.jsx(Box, Object.assign({ component: 'form', autoComplete: "off" }, { children: jsxRuntimeExports.jsx(FormComponent, Object.assign({ container: true, margin: "auto" }, { children: formArray.map((item, i) => {
52858
- return (jsxRuntimeExports.jsx(Formitem, Object.assign({ container: true, sx: item.CustomProps, noOfColumn: item.numberOfColumns || numberOfColumns }, { children: jsxRuntimeExports.jsx(RenderForm, { item: item, register: form.register, control: form.control, errors: form.formState.errors, getValues: form.getValues, clearErrors: form.clearErrors, setValue: form.setValue }) }), i));
52859
- }) })) })) })));
52887
+ return (jsxRuntimeExports.jsx(ThemeProvider, Object.assign({ theme: customTheme }, { children: jsxRuntimeExports.jsx(FormComponent, Object.assign({ container: true, margin: "auto" }, { children: formArray.map((item, i) => {
52888
+ return (jsxRuntimeExports.jsx(Formitem, Object.assign({ container: true, sx: item.CustomProps, noOfColumn: item.numberOfColumns || numberOfColumns }, { children: jsxRuntimeExports.jsx(RenderForm, { item: item, register: form.register, control: form.control, errors: form.formState.errors, getValues: form.getValues, clearErrors: form.clearErrors, setValue: form.setValue }) }), i));
52889
+ }) })) })));
52860
52890
  };
52861
52891
 
52862
52892
  /**
@@ -55194,9 +55224,42 @@ const useFormValidatingContext = (formArray) => {
55194
55224
  }
55195
55225
  renderCustomError(field);
55196
55226
  break;
55227
+ // case "phoneNumber":
55228
+ // initialValues[field.name] = null;
55229
+ // if (field.required && field.errorMessage) {
55230
+ // validationShape[field.name] = Yup.number()
55231
+ // .nullable()
55232
+ // .typeError(`Please enter Mobile Number`)
55233
+ // .required(field.errorMessage)
55234
+ // .test(
55235
+ // "is-two-digits",
55236
+ // `Please enter a 10-digit Mobile Number`,
55237
+ // (value) => {
55238
+ // if (value) {
55239
+ // const stringValue = value.toString();
55240
+ // return stringValue.length === 2;
55241
+ // }
55242
+ // return false;
55243
+ // }
55244
+ // );
55245
+ // renderCustomError(field)
55246
+ // } else {
55247
+ // validationShape[field.name] = Yup.number()
55248
+ // .nullable()
55249
+ // // .typeError(`Please enter Mobile Number`)
55250
+ // .test(
55251
+ // "is-two-digits",
55252
+ // `Please enter a 10-digit Mobile Number`,
55253
+ // (value: any) => {
55254
+ // return !value || value?.toString().length === 2;
55255
+ // }
55256
+ // );
55257
+ // renderCustomError(field)
55258
+ // }
55259
+ // break;
55197
55260
  case "phoneNumber":
55198
55261
  initialValues[field.name] = null;
55199
- if (field.required && field.errorMessage) {
55262
+ if (field.required) {
55200
55263
  validationShape[field.name] = create$5()
55201
55264
  .nullable()
55202
55265
  .typeError(`Please enter Mobile Number`)
@@ -55204,18 +55267,23 @@ const useFormValidatingContext = (formArray) => {
55204
55267
  .test("is-two-digits", `Please enter a 10-digit Mobile Number`, (value) => {
55205
55268
  if (value) {
55206
55269
  const stringValue = value.toString();
55207
- return stringValue.length === 2;
55270
+ return stringValue.length === 10;
55208
55271
  }
55209
55272
  return false;
55210
55273
  });
55211
55274
  renderCustomError(field);
55212
55275
  }
55213
55276
  else {
55214
- validationShape[field.name] = create$5()
55277
+ validationShape[field.name] = create$6()
55215
55278
  .nullable()
55216
- // .typeError(`Please enter Mobile Number`)
55279
+ .typeError(``)
55217
55280
  .test("is-two-digits", `Please enter a 10-digit Mobile Number`, (value) => {
55218
- return !value || (value === null || value === void 0 ? void 0 : value.toString().length) === 2;
55281
+ if (value) {
55282
+ // Custom validation to check for at least one period after '@'
55283
+ const stringValue = value.toString();
55284
+ return stringValue.length === 10;
55285
+ }
55286
+ return true; // Skip validation if no value is present
55219
55287
  });
55220
55288
  renderCustomError(field);
55221
55289
  }