fix(striker-ui): expose form dialog props in crud list

This commit is contained in:
Tsu-ba-me 2024-05-22 14:48:02 -04:00
parent fcfb410a97
commit f4da1e8d14
2 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,7 @@ const CrudList = <
addHeader: rAddHeader,
editHeader: rEditHeader,
entriesUrl,
formDialogProps,
getAddLoading,
getDeleteErrorMessage,
getDeleteHeader,
@ -184,6 +185,8 @@ const CrudList = <
loading={getAddLoading?.call(null)}
ref={addDialogRef}
showClose
{...formDialogProps?.common}
{...formDialogProps?.add}
>
{renderAddForm(formTools)}
</DialogWithHeader>
@ -192,6 +195,8 @@ const CrudList = <
loading={getEditLoading(loadingEntry)}
ref={editDialogRef}
showClose
{...formDialogProps?.common}
{...formDialogProps?.edit}
>
{renderEditForm(formTools, entry)}
</DialogWithHeader>

View File

@ -25,6 +25,9 @@ type DeletePromiseChainGetter<T> = (
type CrudListOptionalProps<Overview> = {
entryUrlPrefix?: string;
formDialogProps?: Partial<
Record<'add' | 'common' | 'edit', Partial<DialogWithHeaderProps>>
>;
getAddLoading?: (previous?: boolean) => boolean;
getDeletePromiseChain?: <T>(
base: DeletePromiseChainGetter<T>,