-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(packages): some the antd component and the react component
- Loading branch information
zsirfs
committed
Apr 26, 2019
1 parent
66a0d12
commit c663abc
Showing
5 changed files
with
147 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { ButtonProps } from 'antd/lib/button'; | ||
|
||
declare type SumbitProps = { | ||
status: 'submitting' | string; | ||
} & ButtonProps; | ||
|
||
export function Submit( | ||
props: React.ComponentPropsWithRef<SubmitProps> | ||
): React.ComponentType<SubmitProps>; | ||
|
||
declare type ResetProps = { | ||
reset: (event: React.MouseEvent<any, MouseEvent>) => void; | ||
} & ButtonProps; | ||
|
||
export function Reset(props: React.PropsWithChildren<ResetProps>): React.ComponentType<ResetProps>; | ||
|
||
declare type FormButtonGroupProps = { | ||
itemStyle: React.CSSProperties; | ||
}; | ||
|
||
export function FormButtonGroup( | ||
props: FormButtonGroupProps | ||
): React.ComponentType<FormButtonGroupProps>; | ||
|
||
declare type RowProps = { | ||
prefix?: string; | ||
pure?: boolean; | ||
fixed?: boolean; | ||
gutter?: number; | ||
wrap?: boolean; | ||
component?: string; | ||
fixedWidth?: number; | ||
align?: string; | ||
justify?: string; | ||
hidden?: boolean; | ||
className?: string; | ||
[x: string]: any; | ||
}; | ||
|
||
export class Row extends React.Component<RowProps> { | ||
static defaultProps: { | ||
prefix: string; | ||
pure: boolean; | ||
fixed: boolean; | ||
gutter: number; | ||
wrap: boolean; | ||
component: string; | ||
}; | ||
|
||
render(): JSX.Element; | ||
} | ||
|
||
type PointType = | ||
| { | ||
span?: string | number; | ||
offset?: string | number; | ||
} | ||
| string | ||
| number; | ||
|
||
declare type ColProps = { | ||
prefix?: string; | ||
pure?: boolean; | ||
component?: string; | ||
span?: string | number; | ||
offset?: string | number; | ||
fixedSpan?: string | number; | ||
align?: string | number; | ||
hidden?: boolean; | ||
xxs?: PointType; | ||
xs?: PointType; | ||
s?: PointType; | ||
m?: PointType; | ||
l?: PointType; | ||
xl?: PointType; | ||
}; | ||
|
||
export class Col extends React.Component<ColProps> { | ||
static isNextCol: boolean; | ||
static defaultProps: { | ||
prefix: string; | ||
pure: boolean; | ||
component: string; | ||
}; | ||
|
||
render(): JSX.Element; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
export type SchemaFormProps = { | ||
className?: string; | ||
[x: string]: any; | ||
}; | ||
|
||
export const SchemaForm: React.SFC<SchemaFormProps>; | ||
|
||
export type SchemaFieldProps = { | ||
[x: string]: any; | ||
}; | ||
|
||
type ParamsWithContext<P extends any = any, C extends any = any> = ( | ||
props: React.PropsWithChildren<P>, | ||
context: React.Context<C> | ||
) => JSX.Element; | ||
|
||
export const Field: ParamsWithContext<SchemaFieldProps>; | ||
|
||
/** | ||
* set the validation internationalization | ||
*/ | ||
export const setValidationLocale: (locale: Record<string, any>) => void; | ||
|
||
/** | ||
* set the validation langage | ||
*/ | ||
export const setValidationLanguage: (lang: string) => void; | ||
|
||
declare type FormActionType = { | ||
getFormState: (callback?: any) => any; | ||
getFieldState: (path?: string, callback: any) => any; | ||
setFormState: (callback?: any) => any; | ||
setFieldState: (path?: string, buffer?: any, callback?: any) => any; | ||
getSchema: (path?: string) => any; | ||
reset: (forceClear?: boolean) => void; | ||
submit: () => Promise<any>; | ||
validate: () => Promise<any>; | ||
dispatch: (type: string, payload?: any) => void; | ||
}; | ||
|
||
export const createFormActions: () => FormActionType; | ||
|
||
declare type FormAsyncActionType = { | ||
getFormState: (callback?: any) => Promise<any>; | ||
getFieldState: (path?: string, callback: any) => Promise<any>; | ||
setFormState: (callback?: any) => Promise<any>; | ||
setFieldState: (path?: string, buffer?: any, callback?: any) => Promise<any>; | ||
getSchema: (path?: string) => Promise<any>; | ||
reset: (forceClear?: boolean) => Promise<any>; | ||
submit: () => Promise<any>; | ||
validate: () => Promise<any>; | ||
dispatch: (type: string, payload?: any) => Promise<any>; | ||
}; | ||
|
||
export const createAsyncFormActions: () => FormAsyncActionType; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters