fix(striker-ui): add form dialog open setters to CRUD list form tools

main
Tsu-ba-me 11 months ago
parent b4408e78ce
commit 7687803148
  1. 8
      striker-ui/components/CrudList.tsx
  2. 8
      striker-ui/types/CrudList.d.ts

@ -87,12 +87,18 @@ const CrudList = <
const formTools = useMemo<CrudListFormTools>(
() => ({
add: {
open: (v = true) => addDialogRef?.current?.setOpen(v),
},
confirm: {
finish: finishConfirm,
loading: setConfirmDialogLoading,
open: setConfirmDialogOpen,
open: (v = true) => setConfirmDialogOpen(v),
prepare: setConfirmDialogProps,
},
edit: {
open: (v = true) => editDialogRef?.current?.setOpen(v),
},
}),
[
finishConfirm,

@ -2,9 +2,15 @@ type CrudListFormTools = {
confirm: {
finish: (header: React.ReactNode, message: Message) => void;
loading: (value: boolean) => void;
open: (value: boolean) => void;
open: (value?: boolean) => void;
prepare: (value: React.SetStateAction<ConfirmDialogProps>) => void;
};
add: {
open: (value?: boolean) => void;
};
edit: {
open: (value?: boolean) => void;
};
};
type CrudListItemClickHandler = Exclude<

Loading…
Cancel
Save