tp-react-elements-dev 1.4.11 → 1.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -52102,24 +52102,27 @@ const PasswordField = ({ props }) => {
52102
52102
  const handleTogglePasswordVisibility = () => {
52103
52103
  setShowPassword((prevShowPassword) => !prevShowPassword);
52104
52104
  };
52105
- return (jsxRuntimeExports.jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [" ", jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Box, Object.assign({ sx: { position: "relative" } }, { children: [" ", jsxRuntimeExports.jsx(TextField, Object.assign({ size: "small", type: showPassword ? "text" : "password" }, field, { label: `${props.item.label}${props.item.required ? ' *' : ''}`, sx: {
52106
- width: "100%",
52107
- "& .css-kichxs-MuiFormLabel-root-MuiInputLabel-root,.css-1holvmy": {
52108
- top: "-8px",
52109
- },
52110
- }, value: field.value || null, disabled: props.item.disable })), jsxRuntimeExports.jsx(IconButton, Object.assign({ sx: {
52111
- position: "absolute",
52112
- right: "14px",
52113
- top: "50%",
52114
- transform: "translateY(-50%)",
52115
- width: '25px'
52116
- }, "aria-label": "toggle password visibility", onClick: handleTogglePasswordVisibility, edge: "end" }, { children: showPassword ? (jsxRuntimeExports.jsx(Visibility, { sx: {
52117
- fontSize: "12px",
52118
- position: "absolute",
52119
- } })) : (jsxRuntimeExports.jsx(VisibilityOff, { sx: {
52120
- fontSize: "12px",
52105
+ return (jsxRuntimeExports.jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [" ", jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {
52106
+ var _a, _b;
52107
+ return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Box, Object.assign({ sx: { position: "relative" } }, { children: [" ", jsxRuntimeExports.jsx(TextField, Object.assign({ size: "small", type: showPassword ? "text" : "password", autoComplete: ((_b = (_a = props.item) === null || _a === void 0 ? void 0 : _a.InputProps) === null || _b === void 0 ? void 0 : _b.autoComplete) || 'off', placeholder: props.item.placeholder || "" }, field, { label: `${props.item.label}${props.item.required ? ' *' : ''}`, sx: {
52108
+ width: "100%",
52109
+ "& .css-kichxs-MuiFormLabel-root-MuiInputLabel-root,.css-1holvmy": {
52110
+ top: "-8px",
52111
+ },
52112
+ }, value: field.value || null, disabled: props.item.disable })), jsxRuntimeExports.jsx(IconButton, Object.assign({ sx: {
52121
52113
  position: "absolute",
52122
- } })) }))] })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) })] })));
52114
+ right: "14px",
52115
+ top: "50%",
52116
+ transform: "translateY(-50%)",
52117
+ width: '25px'
52118
+ }, "aria-label": "toggle password visibility", onClick: handleTogglePasswordVisibility, edge: "end" }, { children: showPassword ? (jsxRuntimeExports.jsx(Visibility, { sx: {
52119
+ fontSize: "12px",
52120
+ position: "absolute",
52121
+ } })) : (jsxRuntimeExports.jsx(VisibilityOff, { sx: {
52122
+ fontSize: "12px",
52123
+ position: "absolute",
52124
+ } })) }))] })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] }));
52125
+ } })] })));
52123
52126
  };
52124
52127
 
52125
52128
  const Monthpickerrender = ({ props }) => {
@@ -52313,7 +52316,7 @@ const RenderForm = (props) => {
52313
52316
  var _a, _b;
52314
52317
  return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(TextField, Object.assign({}, field, { fullWidth: true,
52315
52318
  // error={props.errors}
52316
- label: `${props.item.label}${props.item.required ? ' *' : ''}`, InputProps: {
52319
+ label: `${props.item.label}${props.item.required ? ' *' : ''}`, placeholder: props.item.placeholder || "", InputProps: {
52317
52320
  style: {
52318
52321
  fontFamily: "Roboto-Reg",
52319
52322
  border: "none",
@@ -52888,9 +52891,9 @@ const FormRenderWrapper = ({ formArray, name, numberOfColumns = 3, form, }) => {
52888
52891
  // useEffect(() => {
52889
52892
  // // form.reset(initialValues, { resolver: yupResolver(validationSchema) });
52890
52893
  // }, [formArray, validationSchema, initialValues]);
52891
- return (jsxRuntimeExports.jsx(ThemeProvider, Object.assign({ theme: customTheme }, { children: jsxRuntimeExports.jsx(FormComponent, Object.assign({ container: true, margin: "auto" }, { children: formArray.map((item, i) => {
52892
- 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));
52893
- }) })) })));
52894
+ 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) => {
52895
+ 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));
52896
+ }) })) })) })));
52894
52897
  };
52895
52898
 
52896
52899
  /**
@@ -55144,6 +55147,14 @@ const useFormValidatingContext = (formArray) => {
55144
55147
  .required(field.errorMessage);
55145
55148
  }
55146
55149
  break;
55150
+ case "password":
55151
+ initialValues[field.name] = "";
55152
+ if (field.required && field.errorMessage) {
55153
+ validationShape[field.name] = create$6()
55154
+ .typeError(field.errorMessage)
55155
+ .required(field.errorMessage);
55156
+ }
55157
+ break;
55147
55158
  case "email":
55148
55159
  initialValues[field.name] = "";
55149
55160
  if (field.required && field.errorMessage) {
@@ -55223,15 +55234,6 @@ const useFormValidatingContext = (formArray) => {
55223
55234
  });
55224
55235
  }
55225
55236
  break;
55226
- case "password":
55227
- initialValues[field.name] = "";
55228
- if (field.required && field.errorMessage) {
55229
- validationShape[field.name] = create$5()
55230
- .nullable()
55231
- .typeError(`Please enter ${field.label}`)
55232
- .required(field.errorMessage);
55233
- }
55234
- break;
55235
55237
  case "select":
55236
55238
  initialValues[field.name] = "";
55237
55239
  if (field.required && field.errorMessage) {