From 239187ebef8aabdf9eb81da581d1d732e2595e6f Mon Sep 17 00:00:00 2001 From: sunhao Date: Thu, 12 Sep 2024 15:36:06 +0800 Subject: [PATCH] * list: support for setting icon class. --- lib/list/src/component/listitem.tsx | 6 ++++-- lib/list/src/types/listitem-props.ts | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/list/src/component/listitem.tsx b/lib/list/src/component/listitem.tsx index fbdcd842ae..5292736f43 100644 --- a/lib/list/src/component/listitem.tsx +++ b/lib/list/src/component/listitem.tsx @@ -11,6 +11,7 @@ export class Listitem

extends H protected _renderLeading(props: RenderableProps

): ComponentChild[] { const { icon, + iconClass, avatar, toggleIcon, leading, @@ -27,7 +28,7 @@ export class Listitem

extends H contents.push(); } if (icon) { - contents.push(); + contents.push(); } if (avatar) { const avatarProps = typeof avatar === 'function' ? avatar.call(this, props) : avatar; @@ -84,11 +85,12 @@ export class Listitem

extends H trailing, trailingClass, trailingIcon, + trailingIconClass, actions, } = props; const contents: ComponentChild[] = []; if (trailingIcon) { - contents.push(); + contents.push(); } if (actions) { contents.push(Toolbar.render(actions, [props], {key: 'actions', relativeTarget: props, size: 'sm'}, this)); diff --git a/lib/list/src/types/listitem-props.ts b/lib/list/src/types/listitem-props.ts index 11f40ee1ad..8eac4de827 100644 --- a/lib/list/src/types/listitem-props.ts +++ b/lib/list/src/types/listitem-props.ts @@ -17,6 +17,7 @@ export interface ListitemProps extends Item { divider?: boolean; toggleIcon?: CustomContentType; icon?: IconType; + iconClass?: ClassNameLike; selected?: boolean; avatar?: AvatarOptions | ((item: Item) => AvatarOptions); leading?: CustomContentType; @@ -33,6 +34,7 @@ export interface ListitemProps extends Item { trailing?: CustomContentType; trailingClass?: ClassNameLike; trailingIcon?: IconType; + trailingIconClass?: ClassNameLike; actions?: ToolbarSetting<[Item]>; contentClass?: ClassNameLike; content?: CustomContentType;