|
|
@ -14,7 +14,6 @@ import { |
|
|
|
Theme, |
|
|
|
Theme, |
|
|
|
} from '@mui/material'; |
|
|
|
} from '@mui/material'; |
|
|
|
import { FC, forwardRef, useCallback, useMemo } from 'react'; |
|
|
|
import { FC, forwardRef, useCallback, useMemo } from 'react'; |
|
|
|
import { v4 as uuidv4 } from 'uuid'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { BLUE, BORDER_RADIUS, GREY, RED } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
import { BLUE, BORDER_RADIUS, GREY, RED } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
|
|
|
|
|
|
|
@ -40,7 +39,7 @@ const List = forwardRef( |
|
|
|
insertHeader: isInsertHeader = true, |
|
|
|
insertHeader: isInsertHeader = true, |
|
|
|
listEmpty, |
|
|
|
listEmpty, |
|
|
|
listItemIconMinWidth = '56px', |
|
|
|
listItemIconMinWidth = '56px', |
|
|
|
listItemKeyPrefix = uuidv4(), |
|
|
|
listItemKeyPrefix = 'list', |
|
|
|
listItemProps: { sx: listItemSx, ...restListItemProps } = {}, |
|
|
|
listItemProps: { sx: listItemSx, ...restListItemProps } = {}, |
|
|
|
listItems, |
|
|
|
listItems, |
|
|
|
listProps: { sx: listSx, ...restListProps } = {}, |
|
|
|
listProps: { sx: listSx, ...restListProps } = {}, |
|
|
@ -226,18 +225,18 @@ const List = forwardRef( |
|
|
|
); |
|
|
|
); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
loading, |
|
|
|
getListItemCheckboxProps, |
|
|
|
listItems, |
|
|
|
isAllowItemButton, |
|
|
|
listEmptyElement, |
|
|
|
listEmptyElement, |
|
|
|
renderListItem, |
|
|
|
listItemCheckbox, |
|
|
|
restListItemProps, |
|
|
|
|
|
|
|
listItemKeyPrefix, |
|
|
|
listItemKeyPrefix, |
|
|
|
listItemSx, |
|
|
|
listItemSx, |
|
|
|
listItemCheckbox, |
|
|
|
listItems, |
|
|
|
renderListItemCheckboxState, |
|
|
|
loading, |
|
|
|
getListItemCheckboxProps, |
|
|
|
|
|
|
|
isAllowItemButton, |
|
|
|
|
|
|
|
onItemClick, |
|
|
|
onItemClick, |
|
|
|
|
|
|
|
renderListItem, |
|
|
|
|
|
|
|
renderListItemCheckboxState, |
|
|
|
|
|
|
|
restListItemProps, |
|
|
|
]); |
|
|
|
]); |
|
|
|
const listScrollSx: SxProps<Theme> | undefined = useMemo( |
|
|
|
const listScrollSx: SxProps<Theme> | undefined = useMemo( |
|
|
|
() => (isScroll ? { maxHeight: '100%', overflowY: 'scroll' } : undefined), |
|
|
|
() => (isScroll ? { maxHeight: '100%', overflowY: 'scroll' } : undefined), |
|
|
|