arthub-table 0.2.73 → 0.2.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,7 @@ export interface ITableHeader {
51
51
  showFilterIcon?: boolean;
52
52
  /** 筛选命中该列时为 true:筛选图标常驻显示且显示激活色 */
53
53
  filterIconActive?: boolean;
54
+ viewerConfig?: Record<string, any>;
54
55
  }
55
56
  /**
56
57
  * AssetMatrix ViewerNames 到 DataGrid ColumnType 的映射表
@@ -3,7 +3,7 @@
3
3
  * Displays task names with tree hierarchy, expand/collapse buttons,
4
4
  * task icons, child count badges, and error/warning indicators
5
5
  */
6
- import type { CellViewer, ViewerRenderContext, TextViewerWithSwitcherData } from './types';
6
+ import type { CellViewer, TextViewerWithSwitcherData, ViewerRenderContext } from './types';
7
7
  /**
8
8
  * TextViewerWithSwitcher renders task names with tree hierarchy
9
9
  * Supports expand/collapse, task icons, child count, error indicators
@@ -23,6 +23,7 @@ declare class TextViewerWithSwitcher implements CellViewer<TextViewerWithSwitche
23
23
  private _sm;
24
24
  private arrowColoredCanvas;
25
25
  private arrowColoredColor;
26
+ private childCountIconColoredCanvases;
26
27
  constructor();
27
28
  /**
28
29
  * Preload SVG icons
@@ -108,6 +109,10 @@ declare class TextViewerWithSwitcher implements CellViewer<TextViewerWithSwitche
108
109
  * Calculate right reserved width for totalNum, downstream, and error icons
109
110
  */
110
111
  private calcRightReservedWidth;
112
+ private normalizeOpacity;
113
+ private normalizeChildCountTextPart;
114
+ private resolveChildCountRender;
115
+ private calcChildCountRenderWidth;
111
116
  /**
112
117
  * Draw right area: totalNum icon, downstream indicator, error/warning icon
113
118
  */
@@ -122,6 +127,9 @@ declare class TextViewerWithSwitcher implements CellViewer<TextViewerWithSwitche
122
127
  * @returns New right X position (moving leftward)
123
128
  */
124
129
  private drawTotalNum;
130
+ private drawCustomTotalNum;
131
+ private drawChildCountTextPart;
132
+ private drawChildCountIcon;
125
133
  /**
126
134
  * Draw downstream node indicator (icon_history1.svg, colored #ffb74d, 16x16)
127
135
  * @returns New right X position (moving leftward)
@@ -660,6 +660,26 @@ export interface ModuleViewerData extends CellViewerData {
660
660
  /**
661
661
  * Text viewer with switcher data (tree expand/collapse + task name)
662
662
  */
663
+ export interface TextViewerChildCountTextPart {
664
+ text: string | number;
665
+ color?: string;
666
+ opacity?: number;
667
+ }
668
+ export interface TextViewerChildCountIconPart {
669
+ color?: string;
670
+ opacity?: number;
671
+ }
672
+ export interface TextViewerChildCountRenderResult {
673
+ text?: string | number | TextViewerChildCountTextPart;
674
+ prefix?: string | number | TextViewerChildCountTextPart;
675
+ icon?: TextViewerChildCountIconPart;
676
+ }
677
+ export type TextViewerChildCountRenderer = (params: {
678
+ data: CellViewerData & Record<string, any>;
679
+ rowData?: Record<string, any>;
680
+ count: number;
681
+ defaultText: string;
682
+ }) => TextViewerChildCountRenderResult | string | number | null | undefined;
663
683
  export interface TextViewerWithSwitcherData extends CellViewerData {
664
684
  value: string | number | null;
665
685
  /** Display label (overrides value when present) */
@@ -682,6 +702,8 @@ export interface TextViewerWithSwitcherData extends CellViewerData {
682
702
  iconFile?: string;
683
703
  /** Child node count */
684
704
  count?: number;
705
+ /** Optional column-level child-count render resolver. Defaults to the existing icon + count. */
706
+ renderChildCount?: TextViewerChildCountRenderer;
685
707
  /** Whether the node has downstream nodes */
686
708
  hasDownstreamNode?: boolean;
687
709
  /** Rich text HTML content */
@@ -10,7 +10,7 @@ export { install };
10
10
  export default DataGrid;
11
11
  export type { CellData, CellStyle, RowData, ColData, DataGridOptions, Position, Size, Rect, Range, CellRange, HistoryItem, ValidatorRule, ColumnType, ColumnConfig, SelectorState, EditorState, AutofillState, RangeState, DrawOptions, TextOptions, ClipboardState, EventHandlers, Direction, ScrollDirection, GroupLevel, SeparateLevel, BaseGroupedRowData, GroupRowData, SeparateRowData, NormalRowData, GroupedTableRowData, GroupRowStyle, SeparatorRowStyle, StatisticOption, FooterCellData, FooterData, FooterCellClickInfo, } from './core/types';
12
12
  export { isGroupRow, isSeparateRow, isNormalRow, isRowSelectable, GROUP_TABLE_CONSTANTS, DEFAULT_GROUP_STYLES, DEFAULT_SEPARATOR_STYLES, } from './core/types';
13
- export type { CellBounds, ViewerRenderContext, ViewerDragState, CellViewer, CellViewerData, ViewerOption, ViewerStyle, TextViewerData, DropdownViewerData, ImageViewerData, PreImageViewerData, PersonViewerData, PersonInfo, ProgressViewerData, DatetimeViewerData, BooleanViewerData, StatusViewerData, StatusOption, GroupHeaderViewerData, GroupNameViewerData, GroupNameTagItem, GroupNamePersonItem, SeparatorRowViewerData, PunchViewerData, PunchValue, ModuleInfo, ModuleViewerData, TextViewerWithSwitcherData, FileItem, FileViewerData, HyperlinkTextViewerData, IUpstreamModule, IUpstreamReminderProperties, IUpstreamSyncProperty, IUpstreamFieldViewItem, UpstreamViewerData, TaskNodeItem, TaskNodeViewerData, NestedGridViewerData, NestedColumnConfig, ViewerConstructor, ViewerFactory, ViewerTypeMap, ViewerType, TypedCellData, TableActionButtonOption, TableActionButtonViewerData, } from './core/viewers/types';
13
+ export type { CellBounds, ViewerRenderContext, ViewerDragState, CellViewer, CellViewerData, ViewerOption, ViewerStyle, TextViewerData, DropdownViewerData, ImageViewerData, PreImageViewerData, PersonViewerData, PersonInfo, ProgressViewerData, DatetimeViewerData, BooleanViewerData, StatusViewerData, StatusOption, GroupHeaderViewerData, GroupNameViewerData, GroupNameTagItem, GroupNamePersonItem, SeparatorRowViewerData, PunchViewerData, PunchValue, ModuleInfo, ModuleViewerData, TextViewerChildCountTextPart, TextViewerChildCountIconPart, TextViewerChildCountRenderResult, TextViewerChildCountRenderer, TextViewerWithSwitcherData, FileItem, FileViewerData, HyperlinkTextViewerData, IUpstreamModule, IUpstreamReminderProperties, IUpstreamSyncProperty, IUpstreamFieldViewItem, UpstreamViewerData, TaskNodeItem, TaskNodeViewerData, NestedGridViewerData, NestedColumnConfig, ViewerConstructor, ViewerFactory, ViewerTypeMap, ViewerType, TypedCellData, TableActionButtonOption, TableActionButtonViewerData, } from './core/viewers/types';
14
14
  export { isTextViewerData, isDropdownViewerData, isPersonViewerData, isProgressViewerData, isNestedGridViewerData, } from './core/viewers/types';
15
15
  export { default as ViewerRegistry, getViewerRegistry, } from './core/viewers/ViewerRegistry';
16
16
  export { registerDefaultViewers, defaultViewers } from './core/viewers/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arthub-table",
3
- "version": "0.2.73",
3
+ "version": "0.2.75",
4
4
  "description": "High-performance canvas-based table/grid component for Vue 3 with TypeScript support, featuring virtual scrolling, cell viewers, grouped rows, and nested grids.",
5
5
  "main": "dist/arthub-table.common.js",
6
6
  "module": "dist/arthub-table.umd.min.js",