tp-react-elements-dev 1.4.9 → 1.4.10

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
@@ -52720,7 +52720,19 @@ const RenderForm = (props) => {
52720
52720
  },
52721
52721
  }, minRows: props.item.minRows || 1,
52722
52722
  // maxRows={2}
52723
- placeholder: props.item.placeholder || "Type Something..." }, field, { label: `${props.item.label}${props.item.required ? ' *' : ''}`, value: field.value || "", disabled: props.item.disable })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }) }));
52723
+ placeholder: props.item.placeholder || "Type Something..." }, field, { label: `${props.item.label}${props.item.required ? ' *' : ''}`, value: field.value || "", disabled: props.item.disable, inputProps: {
52724
+ onInput: (e) => {
52725
+ var _a;
52726
+ if (!((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.allowSpecialChars)) {
52727
+ const value = e.target.value;
52728
+ e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, "");
52729
+ } // Allow only alphanumeric and space
52730
+ if (e.target.value.length === 1 &&
52731
+ e.target.value === " ") {
52732
+ e.target.value = "";
52733
+ }
52734
+ },
52735
+ } })), jsxRuntimeExports.jsx(ErrorMessageComponent, { children: jsxRuntimeExports.jsx(s, { errors: props.errors, name: props.item.name }) })] })) }) }));
52724
52736
  // case "textarea-normal":
52725
52737
  // return (
52726
52738
  // <>