跳到主要内容

xph-crud

References

IActionsProps

Renames and re-exports IXphActionsProps


IAuthProps

Renames and re-exports IXphAuthProps


ICrudFormDialogActionType

Renames and re-exports IXphCrudFormDialogActionType


IDialogActionType

Renames and re-exports IXphDialogActionType


IDialogProps

Renames and re-exports IXphDialogProps


IFormActionType

Renames and re-exports IXphFormActionType


IFormProps

Renames and re-exports IXphFormProps


IMainProps

Renames and re-exports IXphMainProps


TActionItemProps

Renames and re-exports TXphActionItemProps


TApiTableProps

Renames and re-exports TXphApiTableProps


TColumnProps

Renames and re-exports TXphColumnProps


TCrudFormDialogProps

Renames and re-exports TXphCrudFormDialogProps


TDataSourceItem

Renames and re-exports TXphDataSourceItem


TFormItemProps

Renames and re-exports TXphFormItemProps


TSearchFormProps

Renames and re-exports TXphSearchFormProps


TTableActionType

Renames and re-exports TXphTableActionType


TTableProps

Renames and re-exports TXphTableProps

Functions

buildUUID()

buildUUID(): string

Returns

string

Description

生成随机数

Defined in

packages/common/src/utils/uuid.ts:9


getValueByPath()

getValueByPath(obj, path): any

Parameters

ParameterType
objRecord<string, any>
pathstring

Returns

any

Description

Helper function to get value by path

Defined in

packages/common/src/utils/getValueByPath.ts:4


getValuesByPathObj()

getValuesByPathObj(fields, values): Record<string, any>

Parameters

ParameterType
fieldsRecord<string, string>
valuesRecord<string, any>

Returns

Record<string, any>

Description

通过属性为包含.的字符串的对象从值对象中获取值

Example

fields { current: 'data.current', pageSize: 'data.pageSize' }
values { data: { current: 1, pageSize: 10 } }
return { current: 1, pageSize: 10 }

Defined in

packages/common/src/utils/getValueByPath.ts:24


isChildrenColumnProps()

isChildrenColumnProps<T>(column): column is IGroupColumnProps<T, Object, Object>

Type Parameters

Type Parameter
T

Parameters

ParameterType
columnIComponentColumnProps<T, object, object> | IRenderColumnProps<T> | IGroupColumnProps<T, object, object> | Without<IComponentColumnProps<T, object, object>, keyof IRenderColumnProps<T>> & IRenderColumnProps<T> | Without<IRenderColumnProps<T>, keyof IComponentColumnProps<T, J, K>> & IComponentColumnProps<T, object, object> | Without<IComponentColumnProps<T, object, object> | IRenderColumnProps<T>, keyof IGroupColumnProps<T, J, K>> & IGroupColumnProps<T, object, object> | Without<IGroupColumnProps<T, {}, {}>, "key" | "className" | "hidden" | "title" | "fixed" | "width" | "responsive" | "colSpan" | "dataIndex" | "shouldCellUpdate" | ... 28 more ... | "onFilterDropdownVisibleChange"> & (IComponentColumnProps<...> | IRenderColumnProps<...>)

Returns

column is IGroupColumnProps<T, Object, Object>

Defined in

packages/table/src/types/column.ts:68


isComponentActionItemProps()

isComponentActionItemProps(item): item is IComponentActionProps<"Button", Object>

Parameters

ParameterType
itemIRenderActionProps | TMapComponentActionProps<object> | Without<TMapComponentActionProps<object>, keyof IRenderActionProps> & IRenderActionProps | Without<IRenderActionProps, "key" | "component" | "componentProps" | "ifShow" | "auth"> & TMapComponentActionProps<{}>

Returns

item is IComponentActionProps<"Button", Object>

Description

判断是否为组件类型action

Defined in

packages/common/src/components/actions/types/actionItem.ts:134


isComponentColumnProps()

isComponentColumnProps<T>(column): column is IComponentColumnProps<T, Object, Object>

Type Parameters

Type Parameter
T

Parameters

ParameterType
columnIComponentColumnProps<T, object, object> | IRenderColumnProps<T> | IGroupColumnProps<T, object, object> | Without<IComponentColumnProps<T, object, object>, keyof IRenderColumnProps<T>> & IRenderColumnProps<T> | Without<IRenderColumnProps<T>, keyof IComponentColumnProps<T, J, K>> & IComponentColumnProps<T, object, object> | Without<IComponentColumnProps<T, object, object> | IRenderColumnProps<T>, keyof IGroupColumnProps<T, J, K>> & IGroupColumnProps<T, object, object> | Without<IGroupColumnProps<T, {}, {}>, "key" | "className" | "hidden" | "title" | "fixed" | "width" | "responsive" | "colSpan" | "dataIndex" | "shouldCellUpdate" | ... 28 more ... | "onFilterDropdownVisibleChange"> & (IComponentColumnProps<...> | IRenderColumnProps<...>)

Returns

column is IComponentColumnProps<T, Object, Object>

Defined in

packages/table/src/types/column.ts:62


isComponentFormItemProps()

isComponentFormItemProps(item): item is IComponentFormItemProps<Object>

Parameters

ParameterType
itemWithout<IRenderFormItemProps, keyof IComponentFormItemProps<T>> & IComponentFormItemProps<object> | Without<IComponentFormItemProps<object>, keyof IRenderFormItemProps> & IRenderFormItemProps

Returns

item is IComponentFormItemProps<Object>

Defined in

packages/form/src/types/formItem.ts:146


isRenderActionItemProps()

isRenderActionItemProps(item): item is IRenderActionProps

Parameters

ParameterType
itemIRenderActionProps | TMapComponentActionProps<object> | Without<TMapComponentActionProps<object>, keyof IRenderActionProps> & IRenderActionProps | Without<IRenderActionProps, "key" | "component" | "componentProps" | "ifShow" | "auth"> & TMapComponentActionProps<{}>

Returns

item is IRenderActionProps

Description

判断是否为自定义内容action

Defined in

packages/common/src/components/actions/types/actionItem.ts:143


isRenderFormItemProps()

isRenderFormItemProps(item): item is IRenderFormItemProps

Parameters

ParameterType
itemWithout<IRenderFormItemProps, keyof IComponentFormItemProps<T>> & IComponentFormItemProps<object> | Without<IComponentFormItemProps<object>, keyof IRenderFormItemProps> & IRenderFormItemProps

Returns

item is IRenderFormItemProps

Defined in

packages/form/src/types/formItem.ts:152


useAsyncState()

useAsyncState<T>(initialState): [T, (newState) => Promise<void>]

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
initialStateT初始状态

Returns

[T, (newState) => Promise<void>]

[state, setAsyncState] state 是当前状态,setAsyncState 是更新状态的函数

Description

自定义 Hook 用于异步更新状态

Defined in

packages/common/src/hooks/useAsyncState.ts:8


useXphExtendCompProps()

useXphExtendCompProps(): object

提供给使用方来扩展xph的组件/给组件提供默认属性

Returns

object

NameTypeDescription
extendComp?IExtendComp扩展的组件
extendProps?IXphExtendProps扩展的属性

Defined in

packages/common/src/hooks/useExtendCompProps.tsx:59


useXphForm()

useXphForm(): [IRegister, IXphFormActionType]

Returns

[IRegister, IXphFormActionType]

Description

用于注册form的方法 form组件会先于parent组件挂载,挂载完后调用register方法,将methods注册到useForm中给parent使用

Defined in

packages/form/src/hooks/useForm.ts:63


XphActions()

XphActions<T>(props): Element

Type Parameters

Type ParameterDefault type
T extends TXphExtendComponentPropsMapobject

Parameters

ParameterType
propsIXphActionsProps<T>

Returns

Element

Defined in

packages/common/src/components/actions/actions.tsx:7


XphAuth()

XphAuth(props): null | ReactElement<any, string | JSXElementConstructor<any>>

Parameters

ParameterType
propsIXphAuthProps

Returns

null | ReactElement<any, string | JSXElementConstructor<any>>

Defined in

packages/common/src/components/auth/auth.tsx:5


XphCrudFormDialog()

XphCrudFormDialog<T>(props): Element

Type Parameters

Type ParameterDefault type
T extends TXphExtendComponentPropsMapobject

Parameters

ParameterType
propsOmit<IXphDialogProps, "onOk" | "onCancel"> & object & object

Returns

Element

Defined in

packages/table/src/components/crudFormDialog/index.tsx:175


XphDialog()

XphDialog(props): Element

Parameters

ParameterType
propsIXphDialogProps & object

Returns

Element

Defined in

packages/common/src/components/dialog/dialog.tsx:317


XphExtendCompPropsProvider()

XphExtendCompPropsProvider(props): Element

Parameters

ParameterType
propsIXphExtendComponentProps

Returns

Element

Defined in

packages/common/src/hooks/useExtendCompProps.tsx:43


XphForm()

XphForm<T>(props): Element

Type Parameters

Type ParameterDefault type
T extends TXphExtendComponentPropsMapobject

Parameters

ParameterType
propsIXphFormProps<T> & object

Returns

Element

Defined in

packages/form/src/form.tsx:144


XphPortal()

XphPortal(__namedParameters): null | ReactPortal

Parameters

ParameterType
__namedParametersobject
__namedParameters.childrenReactElement<any, string | JSXElementConstructor<any>>
__namedParameters.getPopperContainer() => null | HTMLElement

Returns

null | ReactPortal

Defined in

packages/common/src/components/portal/portal.tsx:5


XphTable()

XphTable<RecordType, CellFuncExtendPropsMap, ActionsExtendPropsMap, ToolbarExtendPropsMap, FormExtendPropsMap>(props): Element

Type Parameters

Type ParameterDefault type
RecordType extends TXphDataSourceItemTXphDataSourceItem
CellFuncExtendPropsMap extends TXphExtendComponentPropsMapobject
ActionsExtendPropsMap extends TXphExtendComponentPropsMapobject
ToolbarExtendPropsMap extends TXphExtendComponentPropsMapobject
FormExtendPropsMap extends TXphExtendComponentPropsMapobject

Parameters

ParameterType
propsTXphTableProps<RecordType, CellFuncExtendPropsMap, ActionsExtendPropsMap, ToolbarExtendPropsMap, FormExtendPropsMap> & object

Returns

Element

Defined in

packages/table/src/table.tsx:53

Interfaces

Type Aliases