tp-react-elements-dev 1.4.7 → 1.4.9
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/components/Form/FormRender.d.ts +2 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +13 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ interface OptionsProps {
|
|
|
7
7
|
export interface FormSectionPropsItem {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
|
-
inputType: "text" | "password" | "number" | "select" | "datepicker" | "multiselect" | "select-v2" | "register-number" | "decimal" | "alpha-numerical" | "yearpicker" | "dateRangePicker" | "monthpicker" | "multiselect" | "file" | "textarea" | "phoneNumber" | "pincode" | "email" | "toggleSwitch";
|
|
10
|
+
inputType: "text" | "password" | "number" | "select" | "datepicker" | "multiselect" | "select-v2" | "register-number" | "decimal" | "alpha-numerical" | "yearpicker" | "dateRangePicker" | "monthpicker" | "multiselect" | "file" | "textarea" | "phoneNumber" | "pincode" | "email" | "toggleSwitch" | "";
|
|
11
11
|
options?: OptionsProps[];
|
|
12
12
|
required?: boolean;
|
|
13
13
|
errorMessage?: string;
|
|
@@ -24,6 +24,7 @@ export interface FormSectionPropsItem {
|
|
|
24
24
|
numberOfColumns?: number;
|
|
25
25
|
monthSpan?: number;
|
|
26
26
|
variant?: string;
|
|
27
|
+
allowSpecialChars?: boolean;
|
|
27
28
|
}
|
|
28
29
|
export interface FormRenderProps {
|
|
29
30
|
item: FormSectionPropsItem;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useForm
|
|
1
|
+
import { useForm } from "react-hook-form";
|
|
2
2
|
export { default as RenderForm } from "./components/Form/FormRenderWrapper";
|
|
3
3
|
export { default as useFormValidatingContext } from "./components/Form/FormConstants";
|
|
4
4
|
export { default as DeleteField } from "./components/DeleteComponent/DeleteField";
|
|
5
5
|
export { default as SessionTimeoutField } from "./components/SessionTimeOut/SessionTimeOut";
|
|
6
|
-
export { useFormElement };
|
|
6
|
+
export { useForm as useFormElement };
|
package/dist/index.esm.js
CHANGED
|
@@ -52313,6 +52313,19 @@ const RenderForm = (props) => {
|
|
|
52313
52313
|
value: field.value || "", size: "small", disabled: props.item.disable, onBlur: (e) => {
|
|
52314
52314
|
var _a, _b;
|
|
52315
52315
|
((_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));
|
|
52316
|
+
}, inputProps: {
|
|
52317
|
+
maxLength: props.item.maxLength || 100,
|
|
52318
|
+
onInput: (e) => {
|
|
52319
|
+
var _a;
|
|
52320
|
+
if (!((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.allowSpecialChars)) {
|
|
52321
|
+
const value = e.target.value;
|
|
52322
|
+
e.target.value = value.replace(/[^a-zA-Z0-9 ]/g, "");
|
|
52323
|
+
} // Allow only alphanumeric and space
|
|
52324
|
+
if (e.target.value.length === 1 &&
|
|
52325
|
+
e.target.value === " ") {
|
|
52326
|
+
e.target.value = "";
|
|
52327
|
+
}
|
|
52328
|
+
},
|
|
52316
52329
|
} })), ((_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.helperText) && (jsxRuntimeExports.jsxs("span", Object.assign({ style: {
|
|
52317
52330
|
fontFamily: "Roboto-Reg",
|
|
52318
52331
|
fontSize: "11px",
|