react-crud-mui 0.2.51 → 0.2.52
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.
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { DefaultValues, FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { ValidationOptions } from '../../form/hooks/useForm';
|
|
4
5
|
interface DetailPageStepContentProps<TModel extends FieldValues> {
|
|
5
6
|
schema?: z.ZodType<TModel>;
|
|
6
7
|
defaultValues?: DefaultValues<TModel>;
|
|
7
8
|
name: Path<TModel>;
|
|
9
|
+
validationOptions?: ValidationOptions;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* This component is used to create a form for each step in the detail page.
|
|
11
13
|
*/
|
|
12
|
-
declare function DetailPageStepForm<TModel extends FieldValues>({ schema, name, children, defaultValues, }: DetailPageStepContentProps<TModel> & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DetailPageStepForm<TModel extends FieldValues>({ schema, name, children, defaultValues, validationOptions, }: DetailPageStepContentProps<TModel> & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default DetailPageStepForm;
|
|
@@ -4,6 +4,7 @@ import { StepProps } from '@mui/material/Step';
|
|
|
4
4
|
import { StepLabelProps } from '@mui/material/StepLabel';
|
|
5
5
|
import { StepperProps } from '@mui/material/Stepper';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
import { ValidationOptions } from '../../form/hooks/useForm';
|
|
7
8
|
export interface DetailPageStepsHeaderProps<TModel extends FieldValues = FieldValues> extends Omit<StepperProps, 'onChange'> {
|
|
8
9
|
items: StepPane<TModel>[];
|
|
9
10
|
status?: StepStatus;
|
|
@@ -15,6 +16,7 @@ export type StepPane<TModel extends FieldValues = FieldValues, TFieldStepName ex
|
|
|
15
16
|
defaultValues?: DefaultValues<PathValue<TModel, TFieldStepName>>;
|
|
16
17
|
label: ReactNode;
|
|
17
18
|
children: ReactNode;
|
|
19
|
+
validationOptions?: ValidationOptions;
|
|
18
20
|
};
|
|
19
21
|
export type StepStatus = 'wait' | 'process' | 'finish' | 'error';
|
|
20
22
|
declare function DetailPageStepsHeader<TModel extends FieldValues = FieldValues>({ activeStep, items, ...stepperProps }: DetailPageStepsHeaderProps<TModel>): import("react/jsx-runtime").JSX.Element;
|