diff --git a/src/components/useList/__stories__/components/ListWithDnd.tsx b/src/components/useList/__stories__/components/ListWithDnd.tsx index d2fad034a..1b2184801 100644 --- a/src/components/useList/__stories__/components/ListWithDnd.tsx +++ b/src/components/useList/__stories__/components/ListWithDnd.tsx @@ -81,11 +81,6 @@ export const ListWithDnd = ({size, itemsCount, 'aria-label': ariaLabel}: ListWit list, }); - console.log( - '🚀 ~ {list.structure.visibleFlattenIds.map ~ props:', - props, - ); - return ( { | dragging | manage view of dragging element. Required for draggable list implementation | `boolean` | | | indentation | Affects the visual indentation of the element content | `number ` | | | hasSelectionIcon | Show selected icon if selected and reserve space for this icon | `boolean ` | | -| endSlot | Custom slot before `title` | `React.ReactNode` | | -| expanded | Adds a visual representation of a group element if the value is different from `undefined` | `string \| undefined` | | +| isGroup | Applies group styles view to list element | `boolean` | | +| expanded | Control group item view state expended/closed | `string \| undefined` | | | startSlot | Custom slot before `title` | `React.ReactNode` | | +| endSlot | Custom slot after `title` | `React.ReactNode` | | diff --git a/src/components/useList/migration-guide.md b/src/components/useList/migration-guide.md new file mode 100644 index 000000000..7985e60b1 --- /dev/null +++ b/src/components/useList/migration-guide.md @@ -0,0 +1,78 @@ +# 6.23 + +## ListItemView: + +- changed prop `hasSelectionIcon?: boolean` to prop `selectionViewType?: 'multiple' | 'single'` with default value `multiple`; +- now mix of ccs class works that applied at root of component; +- ability to set item height by css custom property `--g-list-item-height`; +- new ability to pass custom react node as `content` prop; + +```diff + +``` + +## TreeList: + +- changed `mapItemDataToProps` prop name to `mapItemDataToContentProps`: + +```diff + + size="l" + list={list} +- mapItemDataToProps={item => ({title: item.text})} ++ mapItemDataToContentProps={item => ({title: item.text})} + multiple={multiple} + renderItem={({props, context: {childrenIds}}) => { + return ( + {childrenIds.length} : undefined} ++ content={{ ++ ...props.content, ++ endSlot: childrenIds ? ( ++ ++ ) : undefined, + }} + /> + ) + })} + /> +``` + +## getItemRenderState: + +- changed `mapItemDataToProps` prop name to `mapItemDataToContentProps`: + +```diff +const {props, context} = getItemRenderState({ + id, + size, + onItemClick, +- mapItemDataToProps: (x) => x, ++ mapItemDataToContentProps: (x) => x, + list, +}); +```