Skip to content

Commit 9abfac8

Browse files
author
xueyuan
committed
fix(types): use Partial<ITextGraphicAttribute> for TextIcon style
The TextIcon.style field was typed as ITextAttribute which: 1. Did not include fill and other graphic attributes from IGraphicAttribute 2. Required all properties to be specified (none were optional) Change to Partial<ITextGraphicAttribute> which extends both IGraphicAttribute and ITextAttribute with all properties optional, allowing partial style definitions with fill support. Closes #3967
1 parent 70fcf08 commit 9abfac8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • packages/vtable/src/ts-types

packages/vtable/src/ts-types/icon.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ****** Icon配置信息,header ,以及列Icon *******9
22

3-
import type { ITextAttribute } from '@src/vrender';
3+
import type { ITextAttribute, ITextGraphicAttribute } from '@src/vrender';
44
import type { Placement } from './table-engine';
55

66
export interface IIconBase {
@@ -79,7 +79,11 @@ export interface IIconBase {
7979
export interface TextIcon extends IIconBase {
8080
type: 'text';
8181
content: string;
82-
style?: ITextAttribute;
82+
/**
83+
* 文字图标的样式,支持 fill、fontSize、underline 等文字及图形属性
84+
* 使用 Partial 以允许只配置需要的属性
85+
*/
86+
style?: Partial<ITextGraphicAttribute>;
8387
}
8488
export interface ImageIcon extends IIconBase {
8589
type: 'image';

0 commit comments

Comments
 (0)