tp-react-elements-dev 1.4.8 → 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
@@ -52333,6 +52333,19 @@ const RenderForm = (props) => {
52333
52333
  value: field.value || "", size: "small", disabled: props.item.disable, onBlur: (e) => {
52334
52334
  var _a, _b;
52335
52335
  ((_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));
52336
+ }, inputProps: {
52337
+ maxLength: props.item.maxLength || 100,
52338
+ onInput: (e) => {
52339
+ var _a;
52340
+ if (!((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.allowSpecialChars)) {
52341
+ const value = e.target.value;
52342
+ e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, "");
52343
+ } // Allow only alphanumeric and space
52344
+ if (e.target.value.length === 1 &&
52345
+ e.target.value === " ") {
52346
+ e.target.value = "";
52347
+ }
52348
+ },
52336
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: {
52337
52350
  fontFamily: "Roboto-Reg",
52338
52351
  fontSize: "11px",
@@ -52707,7 +52720,19 @@ const RenderForm = (props) => {
52707
52720
  },
52708
52721
  }, minRows: props.item.minRows || 1,
52709
52722
  // maxRows={2}
52710
- 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 }) })] })) }) }));
52711
52736
  // case "textarea-normal":
52712
52737
  // return (
52713
52738
  // <>