diff --git a/src/components/TreeList/TreeList.tsx b/src/components/TreeList/TreeList.tsx index 69c6347a86..0311d6eb2c 100644 --- a/src/components/TreeList/TreeList.tsx +++ b/src/components/TreeList/TreeList.tsx @@ -17,7 +17,7 @@ import type {TreeListContainerProps, TreeListProps} from './types'; const b = block('tree-list'); -export const TreeList = ({ +export const TreeList = ({ qa, id, size = 'm', @@ -29,7 +29,7 @@ export const TreeList = ({ renderContainer = ListContainer, onItemClick: propsOnItemClick, mapItemDataToContentProps, -}: TreeListProps) => { +}: TreeListProps) => { const uniqId = useUniqId(); const treeListId = id ?? uniqId; const containerRefLocal = React.useRef(null); @@ -61,12 +61,12 @@ export const TreeList = ({ list, }); - const renderItem: TreeListContainerProps['renderItem'] = ( + const renderItem: TreeListContainerProps['renderItem'] = ( itemId, index, renderContainerProps, ) => { - const renderState = getItemRenderState({ + const renderState = getItemRenderState({ qa, id: itemId, size, diff --git a/src/components/TreeList/types.ts b/src/components/TreeList/types.ts index d74241d5c3..2bf5c5ac65 100644 --- a/src/components/TreeList/types.ts +++ b/src/components/TreeList/types.ts @@ -23,7 +23,7 @@ export type TreeListRenderItem = (props: { renderContainerProps?: P; }) => React.JSX.Element; -export type TreeListContainerProps = ListContainerProps & { +export type TreeListContainerProps = ListContainerProps & { size: ListItemSize; }; diff --git a/src/components/TreeSelect/TreeSelect.tsx b/src/components/TreeSelect/TreeSelect.tsx index 01dafa08b0..2864ba3f47 100644 --- a/src/components/TreeSelect/TreeSelect.tsx +++ b/src/components/TreeSelect/TreeSelect.tsx @@ -25,7 +25,7 @@ const defaultItemRenderer: TreeListRenderItem = (renderState) => { return ; }; -export const TreeSelect = React.forwardRef(function TreeSelect( +export const TreeSelect = React.forwardRef(function TreeSelect( { id, qa, @@ -55,14 +55,14 @@ export const TreeSelect = React.forwardRef(function TreeSelect( onOpenChange, onUpdate, renderControl, - renderItem = defaultItemRenderer as TreeListRenderItem, + renderItem = defaultItemRenderer as TreeListRenderItem, renderContainer, mapItemDataToContentProps, onFocus, onBlur, getItemId, onItemClick, - }: TreeSelectProps, + }: TreeSelectProps, ref: React.Ref, ) { const mobile = useMobile(); @@ -218,7 +218,7 @@ export const TreeSelect = React.forwardRef(function TreeSelect( > {slotBeforeListBody} - + list={list} size={size} className={b('list', containerClassName)} diff --git a/src/components/useList/components/ListContainer/ListContainer.tsx b/src/components/useList/components/ListContainer/ListContainer.tsx index 4f7cde3368..60ae982c48 100644 --- a/src/components/useList/components/ListContainer/ListContainer.tsx +++ b/src/components/useList/components/ListContainer/ListContainer.tsx @@ -5,7 +5,7 @@ import {ListContainerView} from '../ListContainerView'; import type {ListContainerViewProps} from '../ListContainerView/ListContainerView'; import {ListItemRecursiveRenderer} from '../ListRecursiveRenderer/ListRecursiveRenderer'; -export type ListContainerProps = Omit & { +export type ListContainerProps = Omit & { list: UseListResult; containerRef?: React.RefObject; renderItem( @@ -14,16 +14,16 @@ export type ListContainerProps = Omit & { /** * Ability to transfer props from an overridden container render */ - renderContainerProps?: Object, + renderContainerProps?: P, ): React.JSX.Element; }; -export function ListContainer({ +export function ListContainer({ containerRef, renderItem, list, ...props -}: ListContainerProps) { +}: ListContainerProps) { return ( {list.structure.items.map((item, index) => (