@ahmadmubarak98/namozaj 1.6.67 → 1.6.68
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/main.d.ts +12 -8
- package/dist/namozaj.js +1 -2
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare type BaseFieldConfig = {
|
|
|
30
30
|
visibilityRules?: VisibilityRule[];
|
|
31
31
|
dependencies?: FieldDependency[];
|
|
32
32
|
onValueChange?: (value: FieldValueType, formMethods: any) => void;
|
|
33
|
-
compute?: (data: any, formMethods:
|
|
33
|
+
compute?: (data: any, formMethods: RHFFormMethods) => FieldValueType;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -93,12 +93,12 @@ export declare type DateFieldConfig = BaseFieldConfig & {
|
|
|
93
93
|
export declare type DateMinMaxValue = {
|
|
94
94
|
date: Date | null;
|
|
95
95
|
errorMessage?: string;
|
|
96
|
-
} | ((data: any, formMethods:
|
|
96
|
+
} | ((data: any, formMethods: RHFFormMethods) => {
|
|
97
97
|
date: Date | null;
|
|
98
98
|
errorMessage?: string;
|
|
99
99
|
} | null);
|
|
100
100
|
|
|
101
|
-
export declare type EliminatedOptionValues = string[] | number[] | ((formMethods:
|
|
101
|
+
export declare type EliminatedOptionValues = string[] | number[] | ((formMethods: RHFFormMethods) => string[] | number[]);
|
|
102
102
|
|
|
103
103
|
export declare type FieldArrayFieldConfig = BaseFieldConfig & {
|
|
104
104
|
type: "field-array";
|
|
@@ -165,14 +165,14 @@ export declare type FileFieldConfig = BaseFieldConfig & {
|
|
|
165
165
|
minSize?: number | {
|
|
166
166
|
value: number | null;
|
|
167
167
|
errorMessage?: string;
|
|
168
|
-
} | ((data: any, formMethods:
|
|
168
|
+
} | ((data: any, formMethods: RHFFormMethods) => {
|
|
169
169
|
value: number | null;
|
|
170
170
|
errorMessage?: string;
|
|
171
171
|
} | null);
|
|
172
172
|
maxSize?: number | {
|
|
173
173
|
value: number | null;
|
|
174
174
|
errorMessage?: string;
|
|
175
|
-
} | ((data: any, formMethods:
|
|
175
|
+
} | ((data: any, formMethods: RHFFormMethods) => {
|
|
176
176
|
value: number | null;
|
|
177
177
|
errorMessage?: string;
|
|
178
178
|
} | null);
|
|
@@ -267,7 +267,9 @@ export declare const Namozaj: default_2.ForwardRefExoticComponent<NamozajProps &
|
|
|
267
267
|
|
|
268
268
|
export declare type NamozajField = TextFieldConfig | NumberFieldConfig | SliderFieldConfig | PhoneFieldConfig | GroupFieldConfig | SelectFieldConfig | MultiSelectFieldConfig | CheckBoxGroupFieldConfig | RadioGroupFieldConfig | SwitchFieldConfig | CheckboxFieldConfig | DateFieldConfig | FileFieldConfig | ComputedFieldConfig | SectionFieldConfig | ButtonFieldConfig | RepeaterFieldConfig | FieldArrayFieldConfig;
|
|
269
269
|
|
|
270
|
-
export declare type NamozajFormMethods =
|
|
270
|
+
export declare type NamozajFormMethods = RHFFormMethods & {
|
|
271
|
+
validateForm: () => Promise<boolean>;
|
|
272
|
+
};
|
|
271
273
|
|
|
272
274
|
export declare interface NamozajLocalizationOptions {
|
|
273
275
|
locales: string[];
|
|
@@ -307,7 +309,7 @@ export declare interface NamozajProps {
|
|
|
307
309
|
formFooter?: {
|
|
308
310
|
className?: string;
|
|
309
311
|
style?: React.CSSProperties;
|
|
310
|
-
renderActions?: ((submitBtnNode: React.ReactNode, resetBtnNode: React.ReactNode, formMethods:
|
|
312
|
+
renderActions?: ((submitBtnNode: React.ReactNode, resetBtnNode: React.ReactNode, formMethods: RHFFormMethods, isDirtyLocked: boolean) => React.ReactNode);
|
|
311
313
|
};
|
|
312
314
|
};
|
|
313
315
|
onSubmit?: (data: any) => void;
|
|
@@ -348,7 +350,7 @@ export declare type NumberFieldConfig = BaseFieldConfig & {
|
|
|
348
350
|
export declare type NumberMinMaxValue = number | {
|
|
349
351
|
value: number | null;
|
|
350
352
|
errorMessage?: string;
|
|
351
|
-
} | ((data: any, formMethods:
|
|
353
|
+
} | ((data: any, formMethods: RHFFormMethods) => {
|
|
352
354
|
value: number | null;
|
|
353
355
|
errorMessage?: string;
|
|
354
356
|
} | null);
|
|
@@ -419,6 +421,8 @@ export declare type RepeaterFieldConfig = BaseFieldConfig & {
|
|
|
419
421
|
};
|
|
420
422
|
};
|
|
421
423
|
|
|
424
|
+
export declare type RHFFormMethods = UseFormReturn<FieldValues, any, FieldValues>;
|
|
425
|
+
|
|
422
426
|
export declare type SectionFieldConfig = BaseFieldConfig & {
|
|
423
427
|
type: "section";
|
|
424
428
|
meta: BaseFieldConfig["meta"] & {
|
package/dist/namozaj.js
CHANGED
|
@@ -86012,8 +86012,7 @@ const Form = React__default.forwardRef(
|
|
|
86012
86012
|
}, [p.watch]), useImperativeHandle(
|
|
86013
86013
|
t,
|
|
86014
86014
|
() => ({
|
|
86015
|
-
|
|
86016
|
-
submit: p.handleSubmit(b),
|
|
86015
|
+
...p,
|
|
86017
86016
|
validateForm: h
|
|
86018
86017
|
}),
|
|
86019
86018
|
[p]
|