Skip to content

Commit 3a4affd

Browse files
authored
Fix: add sx props to list and container in checkbox list (#568)
Signed-off-by: Seddik Yengui <[email protected]>
1 parent 0e8203d commit 3a4affd

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

src/components/checkBoxList/CheckBoxList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function CheckBoxList<T>({
1616
onDragStart,
1717
onDragEnd,
1818
isDragDisable = false,
19+
sx,
1920
...props
2021
}: CheckboxListProps<T>) {
2122
const [isDragging, setIsDragging] = useState(false);
@@ -24,6 +25,7 @@ export function CheckBoxList<T>({
2425
<CheckBoxListItems
2526
isDndDragAndDropActive={isDndDragAndDropActive}
2627
isDragDisable={isDragDisable || isDragging}
28+
sx={sx}
2729
{...props}
2830
/>
2931
);
@@ -45,7 +47,7 @@ export function CheckBoxList<T>({
4547
>
4648
<Droppable droppableId="droppable-checkbox-list" isDropDisabled={isDragDisable}>
4749
{(provided) => (
48-
<Box {...provided.droppableProps} ref={provided.innerRef}>
50+
<Box {...provided.droppableProps} ref={provided.innerRef} sx={sx?.dragAndDropContainer}>
4951
{checkBoxField}
5052
{provided.placeholder}
5153
</Box>

src/components/checkBoxList/CheckBoxListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function CheckBoxListItem<T>({
2424
return (
2525
<ListItem
2626
secondaryAction={secondaryAction?.(item, hover)}
27-
sx={{ minWidth: 0, ...sx?.checkboxList }}
27+
sx={{ minWidth: 0, ...sx?.checkboxListItem }}
2828
onMouseEnter={() => setHover(getItemId(item))}
2929
onMouseLeave={() => setHover('')}
3030
disablePadding={!isCheckboxClickableOnly}

src/components/checkBoxList/CheckBoxListItems.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function CheckBoxListItems<T>({
9595
);
9696

9797
return (
98-
<List key="droppable-checkbox-list" dense disablePadding {...props}>
98+
<List key="droppable-checkbox-list" sx={sx?.checkboxList} dense disablePadding {...props}>
9999
{addSelectAllCheckbox && (
100100
<ListItem
101101
disablePadding

src/components/checkBoxList/DraggableCheckBoxListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function DraggableCheckBoxListItem<T>({
2626
return (
2727
<ListItem
2828
secondaryAction={secondaryAction?.(item, hover)}
29-
sx={{ minWidth: 0, ...sx?.checkboxList }}
29+
sx={{ minWidth: 0, ...sx?.checkboxListItem }}
3030
onMouseEnter={() => setHover(getItemId(item))}
3131
onMouseLeave={() => setHover('')}
3232
disablePadding={!isCheckboxClickableOnly}

src/components/checkBoxList/checkBoxList.type.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import { SxProps } from '@mui/system';
1212
export interface CheckBoxListItemSxProps {
1313
checkBoxIcon?: SxProps;
1414
label?: SxProps;
15-
checkboxList?: SxProps;
15+
checkboxListItem?: SxProps;
1616
checkboxButton?: SxProps;
1717
checkbox?: SxProps;
18+
dragAndDropContainer?: SxProps;
19+
checkboxList?: SxProps;
1820
}
1921

2022
export interface CheckBoxListItemProps<T> {

0 commit comments

Comments
 (0)