From e1e03ba7f95d3d08d5fc48b6bdec20bea31ba52c Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Sat, 17 Jun 2023 01:51:28 -0400 Subject: [PATCH] fix(striker-ui): add get list item checkbox props callback to List --- striker-ui/components/List.tsx | 6 +++++- striker-ui/types/List.d.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/striker-ui/components/List.tsx b/striker-ui/components/List.tsx index 084c1039..01ec1b07 100644 --- a/striker-ui/components/List.tsx +++ b/striker-ui/components/List.tsx @@ -40,6 +40,7 @@ const List = forwardRef( allowItemButton: isAllowItemButton = false, edit: isEdit = false, flexBoxProps, + getListItemCheckboxProps, header, headerSpacing = '.3em', initialCheckAll = false, @@ -184,7 +185,7 @@ const List = forwardRef( ); const listItemCheckbox = useCallback( - (key: string, checked?: boolean) => + (key: string, checked?: boolean, props?: CheckboxProps) => isEdit && isAllowCheckItem ? ( onItemCheckboxChange?.call(null, key, ...args) } + {...props} /> ) : undefined, @@ -218,6 +220,7 @@ const List = forwardRef( {listItemCheckbox( key, renderListItemCheckboxState?.call(null, key, value), + getListItemCheckboxProps?.call(null, key, value), )} {isAllowItemButton ? ( = { allowItemButton?: boolean; edit?: boolean; flexBoxProps?: import('../components/FlexBox').FlexBoxProps; + getListItemCheckboxProps?: (key: string, value: T) => CheckboxProps; header?: import('react').ReactNode; headerSpacing?: number | string; initialCheckAll?: boolean;