arthub-table 0.1.0-beta.2 → 0.1.0-beta.21

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.
Files changed (37) hide show
  1. package/dist/arthub-table.common.js +1 -1
  2. package/dist/arthub-table.common.js.map +1 -1
  3. package/dist/arthub-table.umd.js +1 -1
  4. package/dist/arthub-table.umd.js.map +1 -1
  5. package/dist/arthub-table.umd.min.js +1 -1
  6. package/dist/arthub-table.umd.min.js.map +1 -1
  7. package/dist/types/adapters/DataGridIntegration.d.ts +128 -0
  8. package/dist/types/adapters/index.d.ts +2 -2
  9. package/dist/types/adapters/rowDataAdapter.d.ts +80 -47
  10. package/dist/types/adapters/styleAdapter.d.ts +2 -0
  11. package/dist/types/assets/icon/defaultAvatar.d.ts +1 -1
  12. package/dist/types/core/Body.d.ts +7 -1
  13. package/dist/types/core/Cell.d.ts +16 -3
  14. package/dist/types/core/ColumnHeader.d.ts +16 -0
  15. package/dist/types/core/DataGrid.d.ts +325 -3
  16. package/dist/types/core/Footer.d.ts +29 -2
  17. package/dist/types/core/GroupRow.d.ts +83 -12
  18. package/dist/types/core/Header.d.ts +9 -0
  19. package/dist/types/core/ImageManager.d.ts +23 -0
  20. package/dist/types/core/NestedGrid.d.ts +21 -0
  21. package/dist/types/core/Paint.d.ts +26 -0
  22. package/dist/types/core/Row.d.ts +2 -2
  23. package/dist/types/core/RowHeader.d.ts +37 -0
  24. package/dist/types/core/StyleManager.d.ts +20 -0
  25. package/dist/types/core/constants.d.ts +3 -2
  26. package/dist/types/core/types.d.ts +83 -3
  27. package/dist/types/core/viewers/BooleanViewer.d.ts +1 -0
  28. package/dist/types/core/viewers/FileViewer.d.ts +1 -0
  29. package/dist/types/core/viewers/GroupNameViewer.d.ts +56 -0
  30. package/dist/types/core/viewers/PersonViewer.d.ts +6 -0
  31. package/dist/types/core/viewers/PriorityTextViewer.d.ts +0 -4
  32. package/dist/types/core/viewers/TaskNodeViewer.d.ts +5 -1
  33. package/dist/types/core/viewers/TextViewerWithSwitcher.d.ts +15 -1
  34. package/dist/types/core/viewers/index.d.ts +3 -3
  35. package/dist/types/core/viewers/types.d.ts +83 -1
  36. package/dist/types/index.d.ts +4 -4
  37. package/package.json +1 -1
@@ -15,6 +15,8 @@ declare class GroupRow extends Context {
15
15
  isGroupHeader: boolean;
16
16
  isSeparator: boolean;
17
17
  hoverColIndex: number;
18
+ /** 当 hover 列为 nested 父列时,记录鼠标所在的子列偏移索引(-1 表示不在子列上) */
19
+ hoverSubColIndex: number;
18
20
  /** 鼠标是否 hover 在当前组头行上 */
19
21
  isHovered: boolean;
20
22
  /** 鼠标是否 hover 在展开箭头区域附近(包括 checkbox 区域) */
@@ -24,12 +26,22 @@ declare class GroupRow extends Context {
24
26
  * Draw the group row
25
27
  */
26
28
  draw(): void;
29
+ /**
30
+ * 获取指定 groupLevel 的水平缩进量(非线性)
31
+ * level 0: 0px(无缩进)
32
+ * level 1: 18px
33
+ * level 2+: 18px(与 level 1 相同,避免叶子分组过度靠右)
34
+ */
35
+ private getLevelIndent;
27
36
  /**
28
37
  * Draw group header row
29
38
  */
30
39
  private drawGroupHeader;
31
40
  /**
32
- * Draw expand/collapse arrow
41
+ * Draw expand/collapse arrow using SVG path from icon_singlearrowright.svg
42
+ * SVG viewBox: 0 0 32 32, rendered at 16x16 (scale 0.5)
43
+ * Collapsed: right arrow (original orientation)
44
+ * Expanded: rotated 90° clockwise → down arrow
33
45
  */
34
46
  private drawExpandArrow;
35
47
  /**
@@ -38,14 +50,13 @@ declare class GroupRow extends Context {
38
50
  private drawGroupName;
39
51
  /**
40
52
  * 解析分组名称应使用的 viewer 类型和数据
41
- * 优先使用外部显式传入的 groupNameViewerType + groupNameViewerData
42
- * 否则根据 data.property 从列配置中自动推断 viewerType,用 data.value 构建 viewerData
53
+ * 使用外部显式传入的 groupNameViewerType + groupNameViewerData(由 AssetMatrix buildGroupNameViewerData 构建),
54
+ * 否则回退到文本渲染
43
55
  */
44
56
  private resolveGroupNameViewer;
45
57
  /**
46
58
  * 根据列 key 从 grid.columns 中查找列配置
47
59
  */
48
- private findColumnConfigByKey;
49
60
  /**
50
61
  * 使用 viewer 绘制分组名称区域
51
62
  * 根据 viewerType 从 ViewerRegistry 获取对应的 viewer 实例来渲染,
@@ -69,32 +80,37 @@ declare class GroupRow extends Context {
69
80
  */
70
81
  private getValidationStyle;
71
82
  /**
72
- * 在展开箭头左边绘制校验图标或 checkbox
73
- * 参考旧表格 table-switcher-cell.ts 的 .before 布局:
74
- * .before { display: flex; gap: 5px; } 内含 checked-done + cell-switcher
83
+ * 在展开箭头右边绘制校验图标或 checkbox
84
+ * 参考旧表格 table-switcher-cell.ts 的布局:
85
+ * .before (展开箭头) 在左,.middle (checkbox) 在右
75
86
  * 交互逻辑:
76
87
  * - 有 validation 数据且未 checked 且未 hover → 显示校验图标(✅)
77
88
  * - hover 展开箭头区域时 → 校验图标变成 checkbox
78
89
  * - 无 validation 数据时 hover → 显示 checkbox
79
- * @returns 绘制后的 X 坐标(展开箭头的起始位置)
90
+ * @returns 绘制后的 X 坐标
80
91
  */
81
92
  private drawGroupValidationOrCheckbox;
82
93
  /**
83
- * 在展开箭头左边内联绘制 checkbox
94
+ * 在展开箭头右边内联绘制 checkbox
84
95
  * @returns 绘制后的 X 坐标
85
96
  */
86
97
  private drawInlineCheckbox;
87
98
  /**
88
- * 在展开箭头左边内联绘制校验图标(绿色勾选圆圈)
99
+ * 在展开箭头右边内联绘制校验图标(绿色勾选圆圈)
89
100
  * 与旧表格 .before 内 .checked-done { font-size: 17px; color: #00bd77; } 对齐
90
101
  * @returns 绘制后的 X 坐标
91
102
  */
92
103
  private drawInlineValidationIcon;
93
104
  /**
94
105
  * 检测点击是否在校验图标/checkbox 区域内
95
- * 区域范围:展开箭头左边的校验图标/checkbox 所在位置
106
+ * 区域范围:展开箭头右侧的校验图标/checkbox 所在位置
96
107
  */
97
108
  private isInsideCheckboxArea;
109
+ /**
110
+ * 检测点击是否在整个 index 列区域内(序号列区域)
111
+ * 用于一维分组下判断鼠标是否在 index 列 hover
112
+ */
113
+ private isInsideIndexColumnArea;
98
114
  /**
99
115
  * 获取第一个有 colKey 的数据列(即第一个非系统列)
100
116
  * 用于定位分组名称的起始位置
@@ -107,6 +123,14 @@ declare class GroupRow extends Context {
107
123
  private drawInlineStatValue;
108
124
  /**
109
125
  * Draw separator row
126
+ *
127
+ * 背景色逻辑与 DOM 模式对齐:
128
+ * - _separatorStyle === 'gray':最外层分组之间的间隙,使用灰色(#e6eaf0)
129
+ * - _separatorStyle === 'white':内层组间间隙,使用白色(#fff)
130
+ * - 未设置 _separatorStyle 时(兼容旧数据):回退到按 separateLevel 选择颜色
131
+ *
132
+ * 序号列分层背景色:与数据行 RowHeader 的分层效果一致,
133
+ * 根据 _parentGroupLevel 在最左侧绘制 level0/level1 的缩进色块
110
134
  */
111
135
  private drawSeparator;
112
136
  /**
@@ -118,17 +142,39 @@ declare class GroupRow extends Context {
118
142
  */
119
143
  private getColumnScreenX;
120
144
  /**
121
- * 获取鼠标悬停所在的列索引(考虑固定列和滚动偏移)
145
+ * 获取鼠标悬停所在的列索引(考虑固定列和滚动偏移),同时更新 hoverSubColIndex
122
146
  */
123
147
  getHoverColumnIndex(mouseX: number): number;
148
+ /** 获取指定 nested 父列的所有子列列头 */
149
+ private getNestedChildHeaders;
150
+ /** 安全获取 canvas 元素的视口边界(测试环境中 target 可能不存在) */
151
+ private getCanvasRect;
124
152
  /**
125
153
  * 绘制单个统计单元格
126
154
  */
127
155
  private drawStatCell;
156
+ /**
157
+ * 绘制 nested 列的子统计单元格拆分渲染
158
+ */
159
+ private drawNestedStatCell;
128
160
  /**
129
161
  * 绘制 "数据统计" 提示文字
130
162
  */
131
163
  private drawHintText;
164
+ /**
165
+ * 绘制 "数据统计" 提示文字(指定最大宽度)
166
+ */
167
+ private drawHintTextWithMaxWidth;
168
+ /**
169
+ * 绘制刷新图标(icon_backtodefault)
170
+ * @param x 刷新图标区域左边界(包含 padding)
171
+ */
172
+ private drawRefreshIcon;
173
+ /**
174
+ * 绘制 loading 旋转图标(替代刷新icon位置)
175
+ * @param x loading 图标区域左边界(包含 padding,与刷新icon位置对齐)
176
+ */
177
+ private drawLoadingIcon;
132
178
  /**
133
179
  * 截断文字并添加省略号,不压缩文字宽度
134
180
  */
@@ -149,6 +195,25 @@ declare class GroupRow extends Context {
149
195
  * Check if mouse is inside vertical body boundary
150
196
  */
151
197
  isInsideVerticaBodyBoundary(mouseX: number, mouseY: number): boolean;
198
+ /**
199
+ * Get the group name viewer area bounds for hit testing
200
+ * Returns the viewer bounds (x, y, width) and the resolved viewer + data, or null if no viewer
201
+ */
202
+ private getGroupNameViewerInfo;
203
+ /**
204
+ * Check viewer hover state for group name area (e.g. person name underline on hover)
205
+ * Called from mouseMove to update viewer's internal hover tracking
206
+ */
207
+ private checkGroupNameViewerHover;
208
+ /**
209
+ * Handle click on group name viewer area (e.g. person name click-to-jump)
210
+ * Returns true if the click was handled by the viewer
211
+ */
212
+ private handleGroupNameViewerClick;
213
+ /**
214
+ * Reset group name viewer hover state (called when mouse leaves this GroupRow)
215
+ */
216
+ resetGroupNameViewerHover(): void;
152
217
  /**
153
218
  * Handle click on group row
154
219
  */
@@ -180,6 +245,12 @@ declare class GroupRow extends Context {
180
245
  mouseMove(x: number, y: number): void;
181
246
  mouseDown(_x: number, _y: number): void;
182
247
  click(x: number, y: number, clientX?: number, clientY?: number): void;
248
+ /** 处理 nested 子列点击 */
249
+ private onNestedChildClick;
250
+ /**
251
+ * 检测鼠标是否在嵌套子列的刷新图标区域内
252
+ */
253
+ private isInsideNestedRefreshIcon;
183
254
  /**
184
255
  * 从列配置中查找指定索引的列
185
256
  */
@@ -16,6 +16,7 @@ declare class Header extends Context {
16
16
  resizeOriginalWidth: number;
17
17
  resizeStartX: number;
18
18
  isResizing: boolean;
19
+ resizeMousedownTime: number;
19
20
  constructor(grid: DataGrid, x: number, y: number);
20
21
  paint(): void;
21
22
  mouseDown(x: number, y: number, e?: {
@@ -25,6 +26,14 @@ declare class Header extends Context {
25
26
  }): void;
26
27
  resizing(x: number, _y: number): void;
27
28
  endResize(): void;
29
+ /**
30
+ * Double-click on column resize border: toggle between min and max width
31
+ * Aligned with DOM table behavior (onHeaderResizeDblclick):
32
+ * - If maxWidth === 'unset', do nothing
33
+ * - If current width < max, set to max
34
+ * - If current width === max, set to min (originWidth fallback)
35
+ */
36
+ private onHeaderResizeDblclick;
28
37
  /**
29
38
  * 一次性调整嵌套子列宽度:只修改被拖拽的子列和其父列
30
39
  */
@@ -25,6 +25,8 @@ declare class ImageManager {
25
25
  private linkIcon;
26
26
  private linkIconCanvas;
27
27
  private linkIconHeaderCanvas;
28
+ private upArrowIconCanvas;
29
+ private downArrowIconCanvas;
28
30
  private defaultAvatarImage;
29
31
  private constructor();
30
32
  /**
@@ -138,6 +140,22 @@ declare class ImageManager {
138
140
  * @returns HTMLCanvasElement or null if not loaded
139
141
  */
140
142
  getLinkIconForHeader(): HTMLCanvasElement | null;
143
+ /** Sort arrow icon color (#3f9eff blue, matching DOM version) */
144
+ private static SORT_ARROW_COLOR;
145
+ /**
146
+ * Load sort arrow icons (up/down) and recolor to blue (#3f9eff)
147
+ */
148
+ private loadSortArrowIcons;
149
+ /**
150
+ * Get sort up arrow icon (recolored to #3f9eff)
151
+ * @returns HTMLCanvasElement or null if not loaded
152
+ */
153
+ getSortUpArrowIcon(): HTMLCanvasElement | null;
154
+ /**
155
+ * Get sort down arrow icon (recolored to #3f9eff)
156
+ * @returns HTMLCanvasElement or null if not loaded
157
+ */
158
+ getSortDownArrowIcon(): HTMLCanvasElement | null;
141
159
  /**
142
160
  * Load default avatar (base64 PNG, used as fallback when person avatar fails to load)
143
161
  */
@@ -172,6 +190,11 @@ declare class ImageManager {
172
190
  * @returns true if image is cached
173
191
  */
174
192
  isCached(src: string): boolean;
193
+ /**
194
+ * 提取 URL 的基础部分(去掉查询参数和 hash),用于模糊匹配
195
+ * 例如 "https://cdn.example.com/img.jpg?sign=abc&t=123" → "https://cdn.example.com/img.jpg"
196
+ */
197
+ private getBaseUrl;
175
198
  /**
176
199
  * Clear all cached images
177
200
  */
@@ -44,6 +44,7 @@ interface NestedGridOptions {
44
44
  parentGrid: DataGrid;
45
45
  parentCell: any;
46
46
  displayRows?: number;
47
+ hasMore?: boolean;
47
48
  }
48
49
  declare class NestedGrid {
49
50
  columns: NestedColumn[];
@@ -74,6 +75,7 @@ declare class NestedGrid {
74
75
  expanded: boolean;
75
76
  expandButtonHeight: number;
76
77
  expandButtonHovered: boolean;
78
+ hasMore: boolean;
77
79
  private redrawScheduled;
78
80
  private redrawTimer;
79
81
  selectionRange: SelectionRange | null;
@@ -85,6 +87,8 @@ declare class NestedGrid {
85
87
  enable: boolean;
86
88
  /** autofill 拖拽区域范围 */
87
89
  range: SelectionRange | null;
90
+ /** 是否为主动发起 autofill 的子表(区分跨子表场景中被动设置的子表) */
91
+ isSource: boolean;
88
92
  };
89
93
  /** 标记刚刚完成了 autofill 拖拽,用于跳过紧接着的 click 事件触发的编辑 */
90
94
  justFinishedAutofill: boolean;
@@ -220,6 +224,14 @@ declare class NestedGrid {
220
224
  */
221
225
  drawOverlays(): void;
222
226
  clearOtherNestedGridsSelection(): void;
227
+ /**
228
+ * 收集同列所有有选区的嵌套子表信息,触发 onNestedSelectionChange 回调
229
+ */
230
+ notifySelectionChange(): void;
231
+ /**
232
+ * 外部设置选区(跨子表框选时由 Events.ts 调用)
233
+ */
234
+ setExternalSelection(range: SelectionRange): void;
223
235
  /**
224
236
  * 清除当前子表格的所有选中状态
225
237
  */
@@ -253,6 +265,15 @@ declare class NestedGrid {
253
265
  * 清除 autofill 状态
254
266
  */
255
267
  clearAutofill(): void;
268
+ /**
269
+ * 外部设置 autofill 范围(跨子表 autofill 拖拽时由 Events.ts 调用)。
270
+ * 会同时设置 autofill.enable = true,这样绘制逻辑会渲染虚线边框和浅色高亮。
271
+ */
272
+ setExternalAutofill(range: SelectionRange): void;
273
+ /**
274
+ * 清除外部设置的 autofill 范围,同时重置 enable 标记
275
+ */
276
+ clearExternalAutofill(): void;
256
277
  /**
257
278
  * 判断某个 (row, col) 是否在选区内(矩形范围 或 散点多选)
258
279
  */
@@ -34,6 +34,8 @@ interface DrawRectOptions {
34
34
  shadowOffsetY?: number;
35
35
  shadowBlur?: number;
36
36
  shadowColor?: string;
37
+ /** Which sides to draw borders on. 'all' = strokeRect (default), 'right-bottom' = only right and bottom edges */
38
+ borderSides?: 'all' | 'right-bottom';
37
39
  }
38
40
  interface DrawIconOptions extends DrawTextOptions {
39
41
  }
@@ -85,6 +87,30 @@ declare class Paint {
85
87
  drawImage(img: HTMLImageElement | HTMLCanvasElement | {
86
88
  src: string;
87
89
  }, x: number, y: number, width: number, height: number): void;
90
+ /**
91
+ * 用 Canvas API 绘制 checkbox(替代 PNG 图片缩放)
92
+ * 精确控制线宽和尺寸,视觉效果与浏览器原生 checkbox 一致
93
+ *
94
+ * @param x - checkbox 左上角 X 坐标
95
+ * @param y - checkbox 左上角 Y 坐标
96
+ * @param size - checkbox 尺寸(宽=高),默认 14
97
+ * @param checked - 是否选中
98
+ * @param options - 可选的颜色配置
99
+ */
100
+ drawCheckbox(x: number, y: number, size?: number, checked?: boolean, options?: {
101
+ /** 选中时的背景色,默认 #1890ff */
102
+ checkedBgColor?: string;
103
+ /** 未选中时的边框色,默认 #d9d9d9 */
104
+ borderColor?: string;
105
+ /** 未选中时的背景色,默认 #fff */
106
+ bgColor?: string;
107
+ /** 勾选标记色,默认 #fff */
108
+ checkmarkColor?: string;
109
+ /** 圆角半径,默认 2 */
110
+ borderRadius?: number;
111
+ /** 半选状态(indeterminate),蓝色背景 + 白色横线 */
112
+ indeterminate?: boolean;
113
+ }): void;
88
114
  clearCanvas(x?: number, y?: number, width?: number, height?: number): void;
89
115
  /**
90
116
  * 计算长文本自动换行
@@ -16,12 +16,12 @@ declare class Row extends Context {
16
16
  rowHeader: RowHeader;
17
17
  constructor(grid: DataGrid, rowIndex: number, x: number, y: number, height: number, data: RowData);
18
18
  isInVerticalAutofill(mouseX: number, mouseY: number): boolean;
19
- handleCheck(checked?: boolean): void;
19
+ handleCheck(checked?: boolean, event?: MouseEvent): void;
20
20
  mouseDown(x: number, y: number): void;
21
21
  mouseMove(mouseX: number, mouseY: number): void;
22
22
  handleAutofill(x: number, y: number): void;
23
23
  handleStartAutofill(x: number, y: number, shiftKey?: boolean): void;
24
- click(x: number, y: number): void;
24
+ click(x: number, y: number, event?: MouseEvent): void;
25
25
  dbClick(x: number, y: number): void;
26
26
  resizeColumn(colIndex: number, diffWidth: number): void;
27
27
  resizeRow(rowIndex: number, height: number): void;
@@ -8,6 +8,8 @@ interface RowHeaderOptions {
8
8
  checked?: boolean;
9
9
  /** 数据驱动模式下的序号值(undefined 表示不显示序号) */
10
10
  dataIndex?: number | string;
11
+ /** 父级分组层级(0/1/2),用于序号列分层背景色 */
12
+ parentGroupLevel?: number;
11
13
  }
12
14
  declare class RowHeader extends Context {
13
15
  rowIndex: number;
@@ -17,8 +19,43 @@ declare class RowHeader extends Context {
17
19
  fillColor?: string;
18
20
  borderWidth?: number;
19
21
  color?: string;
22
+ /** 父级分组层级(0/1/2),用于序号列分层背景色 */
23
+ parentGroupLevel?: number;
20
24
  constructor(grid: DataGrid, rowIndex: number, x: number, y: number, width: number, height: number, options?: RowHeaderOptions);
21
25
  handleCheck(val: boolean): void;
26
+ /**
27
+ * Get the checkbox X offset for this row header.
28
+ * In grouped mode, align with the leaf group header's checkbox position.
29
+ * Group header checkbox formula: this.x + 18 + getLevelIndent(groupLevel)
30
+ * where getLevelIndent(0) = 0, getLevelIndent(1+) = LEVEL0_WIDTH (6px)
31
+ */
32
+ private getCheckboxLeftOffset;
33
+ /**
34
+ * Override checkbox boundary detection to match the actual checkbox position
35
+ * in grouped table mode (aligned with group header checkbox).
36
+ */
37
+ isInsideCheckboxBoundary(mouseX: number, _mouseY: number): boolean;
38
+ /**
39
+ * Override index boundary detection to account for shifted checkbox position
40
+ * in grouped table mode.
41
+ */
42
+ isInsideIndexBoundary(mouseX: number, _mouseY: number): boolean;
43
+ /**
44
+ * Draw border lines only in the data area (right of color bars).
45
+ * Color bar area should NOT have cell borders to preserve visual hierarchy.
46
+ *
47
+ * NOTE: fillRect uses +0.5 Y offset (matching Cell's drawRect pattern) so that
48
+ * the next row's fill starts at (y + height + 0.5), only covering the bottom
49
+ * half of this row's bottom border — keeping the top half visible (consistent
50
+ * with how Cell borders work).
51
+ *
52
+ * @param ctx - Canvas context
53
+ * @param cellX - Cell left edge X
54
+ * @param cellY - Cell top edge Y (already includes +0.5 offset)
55
+ * @param cellWidth - Total cell width
56
+ * @param barWidth - Total width of color bars (left side to skip)
57
+ */
58
+ private drawDataAreaBorder;
22
59
  draw(): void;
23
60
  }
24
61
  export default RowHeader;
@@ -167,6 +167,22 @@ export interface ThemeTokens {
167
167
  bgTagDefault: string;
168
168
  /** 进度条轨道色 */
169
169
  bgProgressTrack: string;
170
+ /** 顶层实体行背景色(path_id.length === 2 的 Entity 行) */
171
+ bgTopLevelEntity: string;
172
+ /** 顶层实体行 hover 背景色 */
173
+ bgTopLevelEntityHover: string;
174
+ /** 需求变更-新增需求背景色 */
175
+ bgDemandChangeAdd: string;
176
+ /** 需求变更-新增需求 hover 背景色 */
177
+ bgDemandChangeAddHover: string;
178
+ /** 需求变更-取消需求背景色 */
179
+ bgDemandChangeCancel: string;
180
+ /** 需求变更-取消需求 hover 背景色 */
181
+ bgDemandChangeCancelHover: string;
182
+ /** 嵌套列父表头默认背景色(无自定义 color 时使用) */
183
+ bgNestedHeaderDefault: string;
184
+ /** 嵌套列子表头之间的分割线颜色 */
185
+ nestedChildDivider: string;
170
186
  /** 默认边框色 */
171
187
  borderDefault: string;
172
188
  /** 搜索匹配边框色 */
@@ -251,6 +267,10 @@ export interface ThemeTokens {
251
267
  groupLevel2Bg: string;
252
268
  /** 分组行文本色 */
253
269
  groupTextColor: string;
270
+ /** 分组名称文本色(对齐 DOM --am-table-cell-text-color) */
271
+ groupNameTextColor: string;
272
+ /** 分组色条右边缘竖线颜色 */
273
+ groupBarBorder: string;
254
274
  /** 分隔行 level0 背景 */
255
275
  separatorLevel0Bg: string;
256
276
  /** 分隔行 level1 背景 */
@@ -1,10 +1,10 @@
1
1
  export declare const CSS_PREFIX = "xs-data-grid";
2
- export declare const HEADER_HEIGHT = 36;
2
+ export declare const HEADER_HEIGHT = 34;
3
3
  export declare const FOOTER_HEIGHT = 36;
4
4
  export declare const ROW_INDEX_WIDTH = 36;
5
5
  export declare const CHECK_BOX_WIDTH = 36;
6
6
  export declare const CELL_HEIGHT = 36;
7
- export declare const MIN_CELL_WIDTH = 100;
7
+ export declare const MIN_CELL_WIDTH = 50;
8
8
  export declare const MIN_CELL_HEIGHT = 36;
9
9
  export declare const SCROLLER_TRACK_SIZE = 16;
10
10
  export declare const SCROLLER_SIZE = 8;
@@ -33,6 +33,7 @@ export declare const HEADER_TEXT_COLOR: string;
33
33
  export declare const HEADER_ICON_SIZE = 14;
34
34
  export declare const HEADER_SETTINGS_ICON_SIZE = 14;
35
35
  export declare const HEADER_ICON_PADDING = 4;
36
+ export declare const HEADER_NESTED_SETTINGS_PADDING = 8;
36
37
  export declare const HEADER_ICON_RIGHT_MARGIN = 14;
37
38
  export declare const HEADER_ICON_GAP = 0;
38
39
  export declare const HEADER_BUSINESS_ICON_SIZE = 14;
@@ -94,7 +94,7 @@ export interface ValidatorRule {
94
94
  * All supported column types, including built-in types and registered viewer types.
95
95
  * Custom viewer types can be registered via ViewerRegistry.register().
96
96
  */
97
- export type ColumnType = 'text' | 'number' | 'select' | 'date' | 'datetime' | 'month' | 'time' | 'image' | 'nested' | 'nested-child' | 'person' | 'progress' | 'boolean' | 'checkbox' | 'status' | 'group-header' | 'separator-row' | 'punch' | 'hyperlink' | 'file' | 'task-node' | 'module' | 'text-with-switcher' | 'upstream' | 'table-action-button' | (string & Record<string, never>);
97
+ export type ColumnType = 'text' | 'number' | 'select' | 'date' | 'datetime' | 'month' | 'time' | 'image' | 'nested' | 'nested-child' | 'person' | 'progress' | 'boolean' | 'checkbox' | 'status' | 'group-header' | 'group-name' | 'separator-row' | 'punch' | 'hyperlink' | 'file' | 'task-node' | 'module' | 'text-with-switcher' | 'upstream' | 'table-action-button' | (string & Record<string, never>);
98
98
  export interface ColumnConfig {
99
99
  title: string;
100
100
  key: string;
@@ -116,6 +116,9 @@ export interface ColumnConfig {
116
116
  colspan?: number;
117
117
  index?: number;
118
118
  width?: number;
119
+ minWidth?: number;
120
+ maxWidth?: number | 'unset';
121
+ originWidth?: number;
119
122
  parentKey?: string;
120
123
  nestedKey?: string;
121
124
  nestedChildOffset?: number;
@@ -339,12 +342,18 @@ export declare const GROUP_TABLE_CONSTANTS: {
339
342
  SEPARATOR_HEIGHT: number;
340
343
  /** Default row height for normal rows */
341
344
  NORMAL_ROW_HEIGHT: number;
342
- /** Indentation per group level */
345
+ /** @deprecated Use LEVEL0_WIDTH / LEVEL1_WIDTH instead */
343
346
  LEVEL_INDENT: number;
344
- /** Arrow icon size */
347
+ /** Level 0 color bar width (px) — matches DOM nested div width */
348
+ LEVEL0_WIDTH: number;
349
+ /** Level 1 color bar width (px) — matches DOM nested div width */
350
+ LEVEL1_WIDTH: number;
351
+ /** Arrow icon size (16x16, matching DOM version's i.ah-icon_singlearrowright) */
345
352
  ARROW_SIZE: number;
346
353
  /** Padding for group header content */
347
354
  GROUP_PADDING: number;
355
+ /** 组头 checkbox 尺寸(hover 时显示) */
356
+ GROUP_CHECKBOX_SIZE: number;
348
357
  };
349
358
  /**
350
359
  * Group row style configuration
@@ -358,6 +367,8 @@ export interface GroupRowStyle {
358
367
  level2BgColor: string;
359
368
  /** Text color for group headers */
360
369
  textColor: string;
370
+ /** Border color for group color bar right edge */
371
+ barBorderColor: string;
361
372
  /** Font weight for group headers */
362
373
  fontWeight: string;
363
374
  /** Font size for group headers */
@@ -376,9 +387,20 @@ export interface SeparatorRowStyle {
376
387
  }
377
388
  /**
378
389
  * Default styles for grouped table
390
+ * 注意:使用 defaultStyleManager(静态单例,永远绑定 default 主题),
391
+ * 仅作为回退值。运行时应使用 getGroupStyles(grid.styleManager) 获取当前主题色。
379
392
  */
380
393
  export declare const DEFAULT_GROUP_STYLES: GroupRowStyle;
381
394
  export declare const DEFAULT_SEPARATOR_STYLES: SeparatorRowStyle;
395
+ /**
396
+ * 运行时获取分组样式(根据当前主题动态计算)
397
+ * 在 GroupRow / RowHeader / AddTaskRow 中应优先使用此函数
398
+ */
399
+ export declare function getGroupStyles(sm: import('./StyleManager').StyleManager): GroupRowStyle;
400
+ /**
401
+ * 运行时获取分隔行样式(根据当前主题动态计算)
402
+ */
403
+ export declare function getSeparatorStyles(sm: import('./StyleManager').StyleManager): SeparatorRowStyle;
382
404
  /**
383
405
  * 统计选项接口
384
406
  */
@@ -394,6 +416,8 @@ export interface FooterCellData {
394
416
  statisticType: string;
395
417
  /** 格式化后的显示文本,null 表示无数据 */
396
418
  value: string | null;
419
+ /** 是否处于 loading 状态(刷新中),控制旋转动画 */
420
+ loading?: boolean;
397
421
  }
398
422
  /**
399
423
  * Footer 数据,key 为列的 columnKey
@@ -419,6 +443,53 @@ export interface GroupHeaderCellClickInfo {
419
443
  clientX: number;
420
444
  /** 点击位置的 clientY */
421
445
  clientY: number;
446
+ /** 管线父列 key(仅 nested 子列点击时有值) */
447
+ moduleColKey?: string;
448
+ /** 单元格在视口中的边界(用于弹窗定位) */
449
+ cellBounds?: {
450
+ left: number;
451
+ top: number;
452
+ width: number;
453
+ height: number;
454
+ };
455
+ }
456
+ /**
457
+ * Footer 嵌套列统计刷新回调信息
458
+ */
459
+ export interface FooterStatRefreshInfo {
460
+ /** 嵌套子列的列标识 */
461
+ columnKey: string;
462
+ /** 列 editor 类型 */
463
+ editor: string;
464
+ /** 当前统计类型 */
465
+ statisticType: string;
466
+ /** 管线父列 key */
467
+ moduleColKey: string;
468
+ /** 点击位置的 clientX */
469
+ clientX: number;
470
+ /** 点击位置的 clientY */
471
+ clientY: number;
472
+ }
473
+ /**
474
+ * 组头嵌套列统计刷新回调信息
475
+ */
476
+ export interface GroupHeaderStatRefreshInfo {
477
+ /** 嵌套子列的列标识 */
478
+ columnKey: string;
479
+ /** 列 editor 类型 */
480
+ editor: string;
481
+ /** 当前统计类型 */
482
+ statisticType: string;
483
+ /** 管线父列 key */
484
+ moduleColKey: string;
485
+ /** 分组唯一标识 */
486
+ groupId: string | number;
487
+ /** 多级分组值数组 */
488
+ multiValue: any[];
489
+ /** 点击位置的 clientX */
490
+ clientX: number;
491
+ /** 点击位置的 clientY */
492
+ clientY: number;
422
493
  }
423
494
  /**
424
495
  * Footer 单元格点击回调信息
@@ -436,4 +507,13 @@ export interface FooterCellClickInfo {
436
507
  clientX: number;
437
508
  /** 点击位置的 clientY */
438
509
  clientY: number;
510
+ /** 管线父列 key(仅 nested 子列点击时有值) */
511
+ moduleColKey?: string;
512
+ /** 单元格在视口中的边界(用于弹窗定位) */
513
+ cellBounds?: {
514
+ left: number;
515
+ top: number;
516
+ width: number;
517
+ height: number;
518
+ };
439
519
  }
@@ -9,6 +9,7 @@ import type { CellViewer, ViewerRenderContext, BooleanViewerData } from './types
9
9
  */
10
10
  declare class BooleanViewer implements CellViewer<BooleanViewerData> {
11
11
  readonly type = "boolean";
12
+ readonly hideEditIcon = true;
12
13
  /**
13
14
  * Handle click on boolean cell
14
15
  * Returns true if the click was on the checkbox/switch area
@@ -53,6 +53,7 @@ declare class FileViewer implements CellViewer<FileViewerData> {
53
53
  /**
54
54
  * 缩略图模式布局(参考 ImageViewer):图片高度占满行高,宽度根据原图宽高比自适应
55
55
  * 如果图片尚未加载完成(不知道宽高比),先用正方形占位
56
+ * 如果所有图片总宽度超出可用宽度,等比缩放所有图片(与 ImageViewer.drawMultipleImages 一致)
56
57
  */
57
58
  private calculateThumbnailModeLayout;
58
59
  /**