react-form-manage 1.0.4 → 1.0.6-beta.0

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/App.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export default App;
2
+ declare function App(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ declare const FormCleanUp: () => import("react/jsx-runtime").JSX.Element;
2
+ export default FormCleanUp;
@@ -0,0 +1,18 @@
1
+ export default function FormItem({ children, name, formName, initialValue, formItemId: externalFormItemId, rules, valuePropName, getValueFromEvent, }: {
2
+ children: any;
3
+ name: any;
4
+ formName: any;
5
+ initialValue: any;
6
+ formItemId: any;
7
+ rules: any;
8
+ valuePropName?: string;
9
+ getValueFromEvent: any;
10
+ }): import("react").DetailedReactHTMLElement<{
11
+ [valuePropName]: any;
12
+ onChange: (e: any) => void;
13
+ isDirty: boolean;
14
+ errors: any;
15
+ onFocus: () => void;
16
+ validateState: any;
17
+ ref: import("react").RefObject<any>;
18
+ }, HTMLElement>;
@@ -0,0 +1,8 @@
1
+ declare const FormList: ({ name, initialValues, form, formName, children }: {
2
+ name: any;
3
+ initialValues: any;
4
+ form: any;
5
+ formName: any;
6
+ children: any;
7
+ }) => any;
8
+ export default FormList;
@@ -0,0 +1,6 @@
1
+ declare const InputWrapper: ({ children, errors, ...props }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ errors?: any[];
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default InputWrapper;
@@ -0,0 +1,6 @@
1
+ export default Input;
2
+ declare function Input({ onChange, ref, ...props }: {
3
+ [x: string]: any;
4
+ onChange: any;
5
+ ref: any;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ export declare const IS_STRING_NUMBER_REGEX: RegExp;
2
+ export declare const IS_USERNAME_REGEX: RegExp;
3
+ export declare const IS_PASSWORD_REGEX: RegExp;
4
+ export declare const IS_POSITIVE_STRING_NUMBER_REGEX: RegExp;
5
+ export declare const IS_POSITIVE_INTEGER_STRING_NUMBER_REGEX: RegExp;
6
+ export declare const IS_VIETNAMESE_PHONE_NUMBER_REGEX: RegExp;
7
+ export declare const IS_EMAIL_REGEX: RegExp;
8
+ export declare const IS_NAME_REGEX: RegExp;
9
+ export declare const IS_NOSPACE_STRING_AND_NUMBER_REGEX: RegExp;
10
+ export declare const IS_STRING_AND_NUMBER_REGEX: RegExp;
11
+ export declare const IS_NO_SPACE_ALPHABET_STRING_AND_NUMBER_REGEX: RegExp;
12
+ export declare const IS_ALPHABET_STRING_AND_NUMBER_REGEX: RegExp;
13
+ export declare const IS_NO_SPACE_ALPHABET_STRING_REGEX: RegExp;
14
+ export declare const HANDLER_INVALID_MESSAGE = "Invalid value!";
15
+ export declare const MIN_INVALID_MESSAGE = "Min value invalid!";
16
+ export declare const MAX_INVALID_MESSAGE = "Max value invalid!";
17
+ export declare const MIN_INVALID_LENGTH_MESSAGE = "Max length invalid!";
18
+ export declare const MAX_INVALID_LENGTH_MESSAGE = "Max length invalid!";
19
+ export declare const IS_STRING_NUMBER_INVALID_MESSAGE = "Must be number!";
20
+ export declare const IS_USERNAME_INVALID_MESSAGE = "Username must be containes string, number, '.' or '_'!";
21
+ export declare const IS_PASSWORD_INVALID_MESSAGE = "Password must be contains Minimum 8 characters, with uppercase, lowercase, number, special character!";
22
+ export declare const IS_POSITIVE_STRING_NUMBER_INVALID_MESSAGE = "Must be positive number!";
23
+ export declare const IS_POSITIVE_INTEGER_STRING_NUMBER_INVALID_MESSAGE = "Must be positive integer number!";
24
+ export declare const IS_VIETNAMESE_PHONE_NUMBER_INVALID_MESSAGE = "Invalid phone number format!";
25
+ export declare const IS_EMAIL_INVALID_MESSAGE = "Invalid email format!";
26
+ export declare const IS_NAME_INVALID_MESSAGE = "Invalid name format!";
27
+ export declare const IS_NOSPACE_STRING_AND_NUMBER_MESSAGE = "String must only includes string and number without whitespace!";
28
+ export declare const IS_STRING_AND_NUMBER_MESSAGE = "String must only includes string, number and whitespace!";
29
+ export declare const IS_NO_SPACE_ALPHABET_STRING_AND_NUMBER_MESSAGE = "String must only includes alphabet characters and numbers!";
30
+ export declare const IS_ALPHABET_STRING_AND_NUMBER_MESSAGE = "String must only includes alphabet charaters, numbers and whitespace";
31
+ export declare const IS_NO_SPACE_ALPHABET_STRING_MESSAGE = "String must only includes alphabet";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("react").Context<any>;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { type RefObject } from "react";
2
+ import type { FormInstance } from "../stores/formStore";
3
+ type AnyObject = Record<string, any>;
4
+ interface UseFormItemControlProps {
5
+ formName?: string;
6
+ form?: FormInstance;
7
+ name?: string;
8
+ initialValue?: any;
9
+ formItemId?: string;
10
+ rules?: any[];
11
+ elementRef?: RefObject<any> | null;
12
+ }
13
+ interface UseFormItemControlReturn {
14
+ value: any;
15
+ onChange: (value: any, options?: AnyObject) => void;
16
+ state: any;
17
+ errors: any;
18
+ onFocus: () => void;
19
+ isDirty?: boolean;
20
+ }
21
+ export default function useFormItemControl<T = any>({ formName, form, name, initialValue, formItemId, rules, elementRef, }: UseFormItemControlProps): UseFormItemControlReturn;
22
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { FormInstance } from "../stores/formStore";
2
+ type ListField = {
3
+ name: string;
4
+ key: string;
5
+ };
6
+ interface UseFormListControlProps {
7
+ name?: string;
8
+ form?: FormInstance;
9
+ initialValues?: any[];
10
+ formName?: string;
11
+ }
12
+ interface UseFormListControlReturn {
13
+ listFields: ListField[];
14
+ move: (opts: {
15
+ from?: number;
16
+ fromKey?: string;
17
+ to: number;
18
+ }) => void;
19
+ add: (index: number) => void;
20
+ remove: (opts: {
21
+ index?: number;
22
+ key?: string;
23
+ }) => void;
24
+ }
25
+ export default function useFormListControl<T = any>({ name, form, initialValues, formName, }: UseFormListControlProps): UseFormListControlReturn;
26
+ export {};