arthub-table 0.0.3
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.
- package/CHANGELOG.md +36 -0
- package/LICENSE +21 -0
- package/README.md +257 -0
- package/dist/arthub-table.common.js +2 -0
- package/dist/arthub-table.common.js.map +1 -0
- package/dist/arthub-table.css +1 -0
- package/dist/arthub-table.umd.js +2 -0
- package/dist/arthub-table.umd.js.map +1 -0
- package/dist/arthub-table.umd.min.js +2 -0
- package/dist/arthub-table.umd.min.js.map +1 -0
- package/dist/demo.html +1 -0
- package/dist/img/ah-icon_audio_pause.55c06fbf.svg +3 -0
- package/dist/img/ah-icon_closeshape.82e52181.svg +3 -0
- package/dist/img/icon_attachment.724d33ba.svg +3 -0
- package/dist/img/icon_default.9ef1a394.svg +5 -0
- package/dist/img/icon_edit.9966e699.svg +3 -0
- package/dist/img/icon_error_dark.2a057cdd.svg +17 -0
- package/dist/img/icon_error_light.ac6763e9.svg +17 -0
- package/dist/img/icon_failure_dark.f68723a7.svg +25 -0
- package/dist/img/icon_failure_light.489a7167.svg +25 -0
- package/dist/img/icon_folder.ea3efcce.svg +11 -0
- package/dist/img/icon_netdisc.d8bbe2e0.svg +4 -0
- package/dist/img/icon_singlearrowright.6adcd336.svg +4 -0
- package/dist/img/icon_totalNum.23a86d16.svg +3 -0
- package/dist/img/icon_transform_dark.033764ea.svg +26 -0
- package/dist/img/icon_transform_light.fa9fbcbd.svg +26 -0
- package/dist/img/img_3d.39b27128.svg +14 -0
- package/dist/img/img_aep.a898e3e7.svg +8 -0
- package/dist/img/img_ai.61f08a0a.svg +8 -0
- package/dist/img/img_audio.e4ada65c.svg +5 -0
- package/dist/img/img_enf.ad88f95d.svg +28 -0
- package/dist/img/img_excel.56663d85.svg +30 -0
- package/dist/img/img_exe.5e3fc198.svg +27 -0
- package/dist/img/img_img.ac2e0d0c.svg +8 -0
- package/dist/img/img_mcp.393ef169.svg +28 -0
- package/dist/img/img_pdf.f4da9922.svg +7 -0
- package/dist/img/img_ppt.d172780f.svg +26 -0
- package/dist/img/img_pxcook.7e9fce57.svg +18 -0
- package/dist/img/img_rarzip7z.e3b1de82.svg +28 -0
- package/dist/img/img_sketch.d49a9bd4.svg +32 -0
- package/dist/img/img_video.b6ac6198.svg +7 -0
- package/dist/img/img_word.0c1d3c88.svg +31 -0
- package/dist/img/img_x2d.6acc94f6.svg +28 -0
- package/dist/img/img_xd.cc23d09a.svg +28 -0
- package/dist/img/matrix-icon_finish.617f5d3e.svg +3 -0
- package/dist/img/matrix-icon_inprogress.3781156a.svg +3 -0
- package/dist/img/matrix-icon_supervise.edae43f0.svg +3 -0
- package/dist/types/assets/icon/iconBase64.d.ts +3 -0
- package/dist/types/components/Icon/index.d.ts +2 -0
- package/dist/types/components/clickoutside.d.ts +3 -0
- package/dist/types/core/Body.d.ts +142 -0
- package/dist/types/core/Cell.d.ts +94 -0
- package/dist/types/core/Clipboard.d.ts +16 -0
- package/dist/types/core/ColumnHeader.d.ts +24 -0
- package/dist/types/core/Context.d.ts +24 -0
- package/dist/types/core/DataGrid.d.ts +749 -0
- package/dist/types/core/EdgeScroller.d.ts +75 -0
- package/dist/types/core/Editor.d.ts +33 -0
- package/dist/types/core/Events.d.ts +25 -0
- package/dist/types/core/Footer.d.ts +37 -0
- package/dist/types/core/GifAnimationManager.d.ts +69 -0
- package/dist/types/core/GifOverlay.d.ts +33 -0
- package/dist/types/core/GroupRow.d.ts +80 -0
- package/dist/types/core/Header.d.ts +40 -0
- package/dist/types/core/History.d.ts +27 -0
- package/dist/types/core/ImageManager.d.ts +94 -0
- package/dist/types/core/NestedGrid.d.ts +177 -0
- package/dist/types/core/Paint.d.ts +101 -0
- package/dist/types/core/PerformanceMonitor.d.ts +96 -0
- package/dist/types/core/Row.d.ts +31 -0
- package/dist/types/core/RowHeader.d.ts +22 -0
- package/dist/types/core/Scroller.d.ts +33 -0
- package/dist/types/core/Selector.d.ts +9 -0
- package/dist/types/core/StyleManager.d.ts +108 -0
- package/dist/types/core/Tooltip.d.ts +28 -0
- package/dist/types/core/Validator.d.ts +26 -0
- package/dist/types/core/config.d.ts +5 -0
- package/dist/types/core/constants.d.ts +39 -0
- package/dist/types/core/element.d.ts +36 -0
- package/dist/types/core/extension-type-mapping.d.ts +5 -0
- package/dist/types/core/footer/utils.d.ts +7 -0
- package/dist/types/core/types.d.ts +399 -0
- package/dist/types/core/util.d.ts +17 -0
- package/dist/types/core/viewers/BooleanViewer.d.ts +46 -0
- package/dist/types/core/viewers/DatetimeViewer.d.ts +33 -0
- package/dist/types/core/viewers/DeliverableReviewViewer.d.ts +87 -0
- package/dist/types/core/viewers/FileStorageSpecViewer.d.ts +37 -0
- package/dist/types/core/viewers/FileViewer.d.ts +118 -0
- package/dist/types/core/viewers/GroupHeaderViewer.d.ts +73 -0
- package/dist/types/core/viewers/HyperlinkTextViewer.d.ts +80 -0
- package/dist/types/core/viewers/ImageViewer.d.ts +31 -0
- package/dist/types/core/viewers/ItfsPathViewer.d.ts +58 -0
- package/dist/types/core/viewers/ModuleViewer.d.ts +53 -0
- package/dist/types/core/viewers/NestedGridViewer.d.ts +47 -0
- package/dist/types/core/viewers/PersonViewer.d.ts +61 -0
- package/dist/types/core/viewers/PivotViewer.d.ts +43 -0
- package/dist/types/core/viewers/PriorityTextViewer.d.ts +35 -0
- package/dist/types/core/viewers/ProgressViewer.d.ts +68 -0
- package/dist/types/core/viewers/PunchTimingViewer.d.ts +42 -0
- package/dist/types/core/viewers/PunchViewer.d.ts +116 -0
- package/dist/types/core/viewers/RichTextViewer.d.ts +83 -0
- package/dist/types/core/viewers/SelectViewer.d.ts +57 -0
- package/dist/types/core/viewers/SeparatorRowViewer.d.ts +25 -0
- package/dist/types/core/viewers/StatusTextViewer.d.ts +40 -0
- package/dist/types/core/viewers/StatusViewer.d.ts +53 -0
- package/dist/types/core/viewers/TableActionButtonViewer.d.ts +77 -0
- package/dist/types/core/viewers/TaskNodeViewer.d.ts +106 -0
- package/dist/types/core/viewers/TextViewer.d.ts +37 -0
- package/dist/types/core/viewers/TextViewerWithSwitcher.d.ts +112 -0
- package/dist/types/core/viewers/ThemeViewer.d.ts +36 -0
- package/dist/types/core/viewers/TreeDropdownViewer.d.ts +55 -0
- package/dist/types/core/viewers/UpstreamViewer.d.ts +79 -0
- package/dist/types/core/viewers/ViewerRegistry.d.ts +76 -0
- package/dist/types/core/viewers/WfStateViewer.d.ts +76 -0
- package/dist/types/core/viewers/WorkflowViewer.d.ts +37 -0
- package/dist/types/core/viewers/index.d.ts +114 -0
- package/dist/types/core/viewers/types.d.ts +1097 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/testing/SnapshotManager.d.ts +55 -0
- package/dist/types/testing/TestHooks.d.ts +275 -0
- package/dist/types/testing/index.d.ts +3 -0
- package/dist/types/testing/installTestHooks.d.ts +16 -0
- package/package.json +126 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import type { ViewerOption } from './viewers/types';
|
|
2
|
+
export interface CellData {
|
|
3
|
+
value?: any;
|
|
4
|
+
text?: string;
|
|
5
|
+
style?: CellStyle;
|
|
6
|
+
merge?: [number, number];
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface CellStyle {
|
|
11
|
+
bgcolor?: string;
|
|
12
|
+
align?: 'left' | 'center' | 'right';
|
|
13
|
+
valign?: 'top' | 'middle' | 'bottom';
|
|
14
|
+
textwrap?: boolean;
|
|
15
|
+
underline?: boolean;
|
|
16
|
+
color?: string;
|
|
17
|
+
bold?: boolean;
|
|
18
|
+
italic?: boolean;
|
|
19
|
+
strike?: boolean;
|
|
20
|
+
font?: {
|
|
21
|
+
name?: string;
|
|
22
|
+
size?: number;
|
|
23
|
+
};
|
|
24
|
+
border?: {
|
|
25
|
+
top?: string[];
|
|
26
|
+
bottom?: string[];
|
|
27
|
+
left?: string[];
|
|
28
|
+
right?: string[];
|
|
29
|
+
};
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export interface RowData {
|
|
33
|
+
cells: {
|
|
34
|
+
[key: number]: CellData;
|
|
35
|
+
};
|
|
36
|
+
height?: number;
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}
|
|
39
|
+
export interface ColData {
|
|
40
|
+
width?: number;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
43
|
+
export interface DataGridOptions {
|
|
44
|
+
rows?: {
|
|
45
|
+
[key: number]: RowData;
|
|
46
|
+
};
|
|
47
|
+
cols?: {
|
|
48
|
+
[key: number]: ColData;
|
|
49
|
+
};
|
|
50
|
+
merges?: string[];
|
|
51
|
+
freeze?: string;
|
|
52
|
+
styles?: CellStyle[];
|
|
53
|
+
validations?: any[];
|
|
54
|
+
autofilter?: any;
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}
|
|
57
|
+
export interface Position {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
}
|
|
61
|
+
export interface Size {
|
|
62
|
+
width: number;
|
|
63
|
+
height: number;
|
|
64
|
+
}
|
|
65
|
+
export interface Rect extends Position, Size {
|
|
66
|
+
}
|
|
67
|
+
export interface Range {
|
|
68
|
+
sri: number;
|
|
69
|
+
sci: number;
|
|
70
|
+
eri: number;
|
|
71
|
+
eci: number;
|
|
72
|
+
}
|
|
73
|
+
export interface CellRange {
|
|
74
|
+
row: number;
|
|
75
|
+
col: number;
|
|
76
|
+
rowspan?: number;
|
|
77
|
+
colspan?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface HistoryItem {
|
|
80
|
+
type: string;
|
|
81
|
+
data: any;
|
|
82
|
+
}
|
|
83
|
+
export interface ValidatorRule {
|
|
84
|
+
type: 'list' | 'number' | 'date' | 'phone' | 'email';
|
|
85
|
+
required?: boolean;
|
|
86
|
+
pattern?: string | RegExp;
|
|
87
|
+
min?: number;
|
|
88
|
+
max?: number;
|
|
89
|
+
options?: string[];
|
|
90
|
+
immediate?: boolean;
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* All supported column types, including built-in types and registered viewer types.
|
|
95
|
+
* Custom viewer types can be registered via ViewerRegistry.register().
|
|
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>);
|
|
98
|
+
export interface ColumnConfig {
|
|
99
|
+
title: string;
|
|
100
|
+
key: string;
|
|
101
|
+
label?: string;
|
|
102
|
+
size?: 'mini' | 'small' | 'medium' | 'large';
|
|
103
|
+
fixed?: 'left' | 'right' | '';
|
|
104
|
+
fixedLeft?: boolean;
|
|
105
|
+
fixedRight?: boolean;
|
|
106
|
+
readonly?: boolean;
|
|
107
|
+
align?: 'left' | 'center' | 'right';
|
|
108
|
+
baseline?: 'top' | 'middle' | 'bottom';
|
|
109
|
+
type?: ColumnType;
|
|
110
|
+
options?: ViewerOption[];
|
|
111
|
+
render?: (value: any) => string;
|
|
112
|
+
rule?: ValidatorRule;
|
|
113
|
+
children?: ColumnConfig[];
|
|
114
|
+
level?: number;
|
|
115
|
+
rowspan?: number;
|
|
116
|
+
colspan?: number;
|
|
117
|
+
index?: number;
|
|
118
|
+
width?: number;
|
|
119
|
+
parentKey?: string;
|
|
120
|
+
nestedKey?: string;
|
|
121
|
+
nestedChildOffset?: number;
|
|
122
|
+
color?: string;
|
|
123
|
+
[key: string]: any;
|
|
124
|
+
}
|
|
125
|
+
export interface SelectorState {
|
|
126
|
+
show: boolean;
|
|
127
|
+
isSelected: boolean;
|
|
128
|
+
xArr: [number, number];
|
|
129
|
+
yArr: [number, number];
|
|
130
|
+
}
|
|
131
|
+
export interface EditorState {
|
|
132
|
+
show: boolean;
|
|
133
|
+
xIndex: number;
|
|
134
|
+
yIndex: number;
|
|
135
|
+
}
|
|
136
|
+
export interface AutofillState {
|
|
137
|
+
enable: boolean;
|
|
138
|
+
xIndex: number;
|
|
139
|
+
yIndex: number;
|
|
140
|
+
xArr: [number, number];
|
|
141
|
+
yArr: [number, number];
|
|
142
|
+
}
|
|
143
|
+
export interface RangeState {
|
|
144
|
+
minX: number;
|
|
145
|
+
minY: number;
|
|
146
|
+
maxY: number;
|
|
147
|
+
maxX?: number;
|
|
148
|
+
}
|
|
149
|
+
export interface DrawOptions {
|
|
150
|
+
borderColor?: string;
|
|
151
|
+
borderWidth?: number;
|
|
152
|
+
fillColor?: string;
|
|
153
|
+
shadowBlur?: number;
|
|
154
|
+
shadowColor?: string;
|
|
155
|
+
shadowOffsetX?: number;
|
|
156
|
+
shadowOffsetY?: number;
|
|
157
|
+
lineDash?: number[];
|
|
158
|
+
lineCap?: CanvasLineCap;
|
|
159
|
+
lineJoin?: CanvasLineJoin;
|
|
160
|
+
}
|
|
161
|
+
export interface TextOptions {
|
|
162
|
+
font?: string;
|
|
163
|
+
color?: string;
|
|
164
|
+
align?: 'left' | 'center' | 'right';
|
|
165
|
+
baseLine?: 'top' | 'middle' | 'bottom';
|
|
166
|
+
icon?: HTMLImageElement | null;
|
|
167
|
+
iconWidth?: number;
|
|
168
|
+
iconHeight?: number;
|
|
169
|
+
iconOffsetX?: number;
|
|
170
|
+
iconOffsetY?: number;
|
|
171
|
+
}
|
|
172
|
+
export interface ClipboardState {
|
|
173
|
+
show: boolean;
|
|
174
|
+
isPaste: boolean;
|
|
175
|
+
xArr: [number, number];
|
|
176
|
+
yArr: [number, number];
|
|
177
|
+
}
|
|
178
|
+
export interface EventHandlers {
|
|
179
|
+
[key: string]: (e: Event) => void;
|
|
180
|
+
}
|
|
181
|
+
export type Direction = 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM';
|
|
182
|
+
export type ScrollDirection = 'HORIZONTAL' | 'VERTICAL';
|
|
183
|
+
/**
|
|
184
|
+
* Group level enumeration for multi-level grouping (max 3 levels)
|
|
185
|
+
* 0 = First level (most prominent)
|
|
186
|
+
* 1 = Second level
|
|
187
|
+
* 2 = Third level
|
|
188
|
+
*/
|
|
189
|
+
export type GroupLevel = 0 | 1 | 2;
|
|
190
|
+
/**
|
|
191
|
+
* Separate row level enumeration
|
|
192
|
+
*/
|
|
193
|
+
export type SeparateLevel = 0 | 1 | 2;
|
|
194
|
+
/**
|
|
195
|
+
* Base interface for all row types in grouped table
|
|
196
|
+
*/
|
|
197
|
+
export interface BaseGroupedRowData {
|
|
198
|
+
id: string | number;
|
|
199
|
+
[key: string]: any;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Group header row data
|
|
203
|
+
* Represents a collapsible group header in the table
|
|
204
|
+
*/
|
|
205
|
+
export interface GroupRowData extends BaseGroupedRowData {
|
|
206
|
+
/** Identifies this row as a group header */
|
|
207
|
+
isGroup: true;
|
|
208
|
+
/** Group name - can be string or array (e.g., list of people) */
|
|
209
|
+
name: string | string[];
|
|
210
|
+
/** Raw group name */
|
|
211
|
+
rawName?: string | string[];
|
|
212
|
+
/** Nesting level of the group (0, 1, or 2) */
|
|
213
|
+
groupLevel: GroupLevel;
|
|
214
|
+
/** Whether the group is expanded */
|
|
215
|
+
expanded: boolean;
|
|
216
|
+
/** Number of items in this group */
|
|
217
|
+
count?: number;
|
|
218
|
+
/** Whether to show the count badge */
|
|
219
|
+
showCount?: boolean;
|
|
220
|
+
/** Whether to show user working hours icon */
|
|
221
|
+
showUserWorkingHours?: boolean;
|
|
222
|
+
/** Whether this group has children */
|
|
223
|
+
hasChildren?: boolean;
|
|
224
|
+
/** Parent group ID */
|
|
225
|
+
parentId?: string | number;
|
|
226
|
+
/** Whether this is a leaf group (no sub-groups) */
|
|
227
|
+
isLeafGroup?: boolean;
|
|
228
|
+
/** Multi-level group name array */
|
|
229
|
+
multiGroupName?: string[];
|
|
230
|
+
/** Multi-level group value array */
|
|
231
|
+
multiValue?: any[];
|
|
232
|
+
/** Group path */
|
|
233
|
+
path?: any[];
|
|
234
|
+
/** Value path */
|
|
235
|
+
valuePath?: any[];
|
|
236
|
+
/** Property name for grouping */
|
|
237
|
+
property?: string;
|
|
238
|
+
/** Group value */
|
|
239
|
+
value?: any;
|
|
240
|
+
/** Custom row height (optional) */
|
|
241
|
+
rowHeight?: number;
|
|
242
|
+
/** Children rows (for nested structure) */
|
|
243
|
+
children?: GroupedTableRowData[];
|
|
244
|
+
/** Separate rows (for nested structure) */
|
|
245
|
+
separate?: SeparateRowData[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Separate row data
|
|
249
|
+
* Represents a visual separator between groups
|
|
250
|
+
*/
|
|
251
|
+
export interface SeparateRowData extends BaseGroupedRowData {
|
|
252
|
+
/** Identifies this row as a separator */
|
|
253
|
+
isSeparateRow: true;
|
|
254
|
+
/** Nesting level of the separator */
|
|
255
|
+
separateLevel: SeparateLevel;
|
|
256
|
+
/** Group level context */
|
|
257
|
+
groupLevel?: GroupLevel;
|
|
258
|
+
/** Whether this is the end level */
|
|
259
|
+
isEndLevel?: boolean;
|
|
260
|
+
/** Row height - typically 12px for separators */
|
|
261
|
+
rowHeight?: number;
|
|
262
|
+
/** Group name context */
|
|
263
|
+
groupName?: {
|
|
264
|
+
multi_group_name: string[];
|
|
265
|
+
multi_value: any[];
|
|
266
|
+
};
|
|
267
|
+
/** Filter match status */
|
|
268
|
+
filterMatched?: boolean;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Normal data row (not a group header or separator)
|
|
272
|
+
*/
|
|
273
|
+
export interface NormalRowData extends BaseGroupedRowData {
|
|
274
|
+
/** Identifies this row as NOT a group header */
|
|
275
|
+
isGroup?: false;
|
|
276
|
+
/** Identifies this row as NOT a separator */
|
|
277
|
+
isSeparateRow?: false;
|
|
278
|
+
/** Proxied data object (contains actual row data) */
|
|
279
|
+
proxyedData?: {
|
|
280
|
+
id: string | number;
|
|
281
|
+
name?: string;
|
|
282
|
+
[key: string]: any;
|
|
283
|
+
};
|
|
284
|
+
/** Custom row height (optional) */
|
|
285
|
+
rowHeight?: number;
|
|
286
|
+
/** Parent ID for grouping context */
|
|
287
|
+
parentId?: string | number;
|
|
288
|
+
/** Group name context */
|
|
289
|
+
groupName?: {
|
|
290
|
+
multi_group_name: string[];
|
|
291
|
+
multi_value: any[];
|
|
292
|
+
};
|
|
293
|
+
/** Filter match status */
|
|
294
|
+
filterMatched?: boolean;
|
|
295
|
+
[key: string]: any;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Union type for all row types in a grouped table
|
|
299
|
+
*/
|
|
300
|
+
export type GroupedTableRowData = GroupRowData | SeparateRowData | NormalRowData;
|
|
301
|
+
/**
|
|
302
|
+
* Type guard to check if a row is a group header
|
|
303
|
+
*/
|
|
304
|
+
export declare function isGroupRow(row: unknown): row is GroupRowData;
|
|
305
|
+
/**
|
|
306
|
+
* Type guard to check if a row is a separator
|
|
307
|
+
*/
|
|
308
|
+
export declare function isSeparateRow(row: unknown): row is SeparateRowData;
|
|
309
|
+
/**
|
|
310
|
+
* Type guard to check if a row is a normal data row
|
|
311
|
+
*/
|
|
312
|
+
export declare function isNormalRow(row: unknown): row is NormalRowData;
|
|
313
|
+
/**
|
|
314
|
+
* Constants for grouped table rendering
|
|
315
|
+
*/
|
|
316
|
+
export declare const GROUP_TABLE_CONSTANTS: {
|
|
317
|
+
/** Default row height for group headers */
|
|
318
|
+
GROUP_HEADER_HEIGHT: number;
|
|
319
|
+
/** Default row height for separators */
|
|
320
|
+
SEPARATOR_HEIGHT: number;
|
|
321
|
+
/** Default row height for normal rows */
|
|
322
|
+
NORMAL_ROW_HEIGHT: number;
|
|
323
|
+
/** Indentation per group level */
|
|
324
|
+
LEVEL_INDENT: number;
|
|
325
|
+
/** Arrow icon size */
|
|
326
|
+
ARROW_SIZE: number;
|
|
327
|
+
/** Padding for group header content */
|
|
328
|
+
GROUP_PADDING: number;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Group row style configuration
|
|
332
|
+
*/
|
|
333
|
+
export interface GroupRowStyle {
|
|
334
|
+
/** Background color for group level 0 */
|
|
335
|
+
level0BgColor: string;
|
|
336
|
+
/** Background color for group level 1 */
|
|
337
|
+
level1BgColor: string;
|
|
338
|
+
/** Background color for group level 2 */
|
|
339
|
+
level2BgColor: string;
|
|
340
|
+
/** Text color for group headers */
|
|
341
|
+
textColor: string;
|
|
342
|
+
/** Font weight for group headers */
|
|
343
|
+
fontWeight: string;
|
|
344
|
+
/** Font size for group headers */
|
|
345
|
+
fontSize: number;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Separator row style configuration
|
|
349
|
+
*/
|
|
350
|
+
export interface SeparatorRowStyle {
|
|
351
|
+
/** Background color for separator level 0 */
|
|
352
|
+
level0BgColor: string;
|
|
353
|
+
/** Background color for separator level 1 */
|
|
354
|
+
level1BgColor: string;
|
|
355
|
+
/** Background color for separator level 2 */
|
|
356
|
+
level2BgColor: string;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Default styles for grouped table
|
|
360
|
+
*/
|
|
361
|
+
export declare const DEFAULT_GROUP_STYLES: GroupRowStyle;
|
|
362
|
+
export declare const DEFAULT_SEPARATOR_STYLES: SeparatorRowStyle;
|
|
363
|
+
/**
|
|
364
|
+
* 统计选项接口
|
|
365
|
+
*/
|
|
366
|
+
export interface StatisticOption {
|
|
367
|
+
key: string;
|
|
368
|
+
label: string;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Footer 单元格数据
|
|
372
|
+
*/
|
|
373
|
+
export interface FooterCellData {
|
|
374
|
+
/** 统计类型标识 */
|
|
375
|
+
statisticType: string;
|
|
376
|
+
/** 格式化后的显示文本,null 表示无数据 */
|
|
377
|
+
value: string | null;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Footer 数据,key 为列的 columnKey
|
|
381
|
+
*/
|
|
382
|
+
export type FooterData = Record<string, FooterCellData>;
|
|
383
|
+
/**
|
|
384
|
+
* Footer 单元格点击回调信息
|
|
385
|
+
*/
|
|
386
|
+
export interface FooterCellClickInfo {
|
|
387
|
+
/** 列标识 */
|
|
388
|
+
columnKey: string;
|
|
389
|
+
/** 列 editor 类型 */
|
|
390
|
+
editor: string;
|
|
391
|
+
/** 当前统计类型 */
|
|
392
|
+
statisticType: string;
|
|
393
|
+
/** 可选统计选项列表 */
|
|
394
|
+
statisticOptions: StatisticOption[];
|
|
395
|
+
/** 点击位置的 clientX */
|
|
396
|
+
clientX: number;
|
|
397
|
+
/** 点击位置的 clientY */
|
|
398
|
+
clientY: number;
|
|
399
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ColumnConfig } from './types';
|
|
2
|
+
interface HeaderConfig extends ColumnConfig {
|
|
3
|
+
children?: HeaderConfig[];
|
|
4
|
+
}
|
|
5
|
+
declare const toLeaf: (arr?: HeaderConfig[]) => HeaderConfig[];
|
|
6
|
+
declare const getMaxRow: (config?: HeaderConfig[]) => number;
|
|
7
|
+
declare const calCrossSpan: (arr?: HeaderConfig[], maxRow?: number, level?: number) => HeaderConfig[];
|
|
8
|
+
declare function getIcon(type: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* 根据文件状态和当前主题获取对应的图标
|
|
11
|
+
* @param fileStatus 文件状态
|
|
12
|
+
* @param format 文件格式
|
|
13
|
+
* @returns 对应的图标
|
|
14
|
+
*/
|
|
15
|
+
declare function getIconByFileStatus(fileStatus: string | number | undefined, format?: string): any;
|
|
16
|
+
export type { HeaderConfig };
|
|
17
|
+
export { toLeaf, getMaxRow, calCrossSpan, getIcon, getIconByFileStatus, };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BooleanViewer - Boolean/Checkbox rendering viewer
|
|
3
|
+
* Handles boolean value display with checkbox, switch, or text styles
|
|
4
|
+
*/
|
|
5
|
+
import type { CellViewer, ViewerRenderContext, BooleanViewerData } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* BooleanViewer renders boolean values in cells
|
|
8
|
+
* Supports checkbox, switch, and text display styles
|
|
9
|
+
*/
|
|
10
|
+
declare class BooleanViewer implements CellViewer<BooleanViewerData> {
|
|
11
|
+
readonly type = "boolean";
|
|
12
|
+
/**
|
|
13
|
+
* Handle click on boolean cell
|
|
14
|
+
* Returns true if the click was on the checkbox/switch area
|
|
15
|
+
*/
|
|
16
|
+
onClick(context: ViewerRenderContext, data: BooleanViewerData, localX: number, localY: number): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Return pointer cursor when hovering over the interactive area
|
|
19
|
+
*/
|
|
20
|
+
getInteractiveCursor(context: ViewerRenderContext, data: BooleanViewerData, localX: number, localY: number): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Draw boolean content in the cell
|
|
23
|
+
*/
|
|
24
|
+
draw(context: ViewerRenderContext, data: BooleanViewerData): void;
|
|
25
|
+
/**
|
|
26
|
+
* Draw checkbox style
|
|
27
|
+
*/
|
|
28
|
+
private drawCheckbox;
|
|
29
|
+
/**
|
|
30
|
+
* Draw switch style
|
|
31
|
+
*/
|
|
32
|
+
private drawSwitch;
|
|
33
|
+
/**
|
|
34
|
+
* Draw text style
|
|
35
|
+
*/
|
|
36
|
+
private drawText;
|
|
37
|
+
/**
|
|
38
|
+
* Draw a filled rounded rectangle
|
|
39
|
+
*/
|
|
40
|
+
private drawRoundedRect;
|
|
41
|
+
/**
|
|
42
|
+
* Draw a stroked rounded rectangle
|
|
43
|
+
*/
|
|
44
|
+
private drawRoundedRectStroke;
|
|
45
|
+
}
|
|
46
|
+
export default BooleanViewer;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatetimeViewer - Date and time rendering viewer
|
|
3
|
+
* Handles date/time display with formatting and icon support
|
|
4
|
+
*/
|
|
5
|
+
import type { CellViewer, ViewerRenderContext, DatetimeViewerData } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* DatetimeViewer renders date and time values in cells
|
|
8
|
+
* Supports various formats and display types
|
|
9
|
+
*/
|
|
10
|
+
declare class DatetimeViewer implements CellViewer<DatetimeViewerData> {
|
|
11
|
+
readonly type = "datetime";
|
|
12
|
+
/**
|
|
13
|
+
* Draw datetime content in the cell
|
|
14
|
+
*/
|
|
15
|
+
draw(context: ViewerRenderContext, data: DatetimeViewerData): void;
|
|
16
|
+
/**
|
|
17
|
+
* Format date based on configuration
|
|
18
|
+
*/
|
|
19
|
+
private formatDate;
|
|
20
|
+
/**
|
|
21
|
+
* Apply format string to date
|
|
22
|
+
*/
|
|
23
|
+
private applyFormat;
|
|
24
|
+
/**
|
|
25
|
+
* Pad number with leading zero
|
|
26
|
+
*/
|
|
27
|
+
private padZero;
|
|
28
|
+
/**
|
|
29
|
+
* Draw date/time icon
|
|
30
|
+
*/
|
|
31
|
+
private drawIcon;
|
|
32
|
+
}
|
|
33
|
+
export default DatetimeViewer;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeliverableReviewViewer - 交付物审核 viewer
|
|
3
|
+
* 用于展示交付物审核文件列表(审核图标 + 文件名),支持多文件展示
|
|
4
|
+
* 参考 AssetMatrix/src/views/components/ProgressPanel/ProgressPropsViewer/deliverableReviewViewer.ts
|
|
5
|
+
*/
|
|
6
|
+
import type { CellViewer, ViewerRenderContext, DeliverableReviewViewerData } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* DeliverableReviewViewer 在单元格中渲染交付物审核文件列表
|
|
9
|
+
* 展示形如 [📄] 文件名1 [📄] 文件名2 的内容
|
|
10
|
+
*/
|
|
11
|
+
declare class DeliverableReviewViewer implements CellViewer<DeliverableReviewViewerData> {
|
|
12
|
+
readonly type = "deliverable-review";
|
|
13
|
+
/** 空值占位符 */
|
|
14
|
+
private readonly emptyValue;
|
|
15
|
+
/** 审核图标颜色 */
|
|
16
|
+
private readonly reviewIconColor;
|
|
17
|
+
/** 普通文件图标颜色 */
|
|
18
|
+
private readonly fileIconColor;
|
|
19
|
+
/** 文件名文字颜色 */
|
|
20
|
+
private readonly nameColor;
|
|
21
|
+
/** 文件名 hover 颜色(可点击文件) */
|
|
22
|
+
private readonly nameHoverColor;
|
|
23
|
+
/** 编辑图标颜色 */
|
|
24
|
+
private readonly editIconColor;
|
|
25
|
+
/**
|
|
26
|
+
* 绘制交付物审核内容
|
|
27
|
+
*/
|
|
28
|
+
draw(context: ViewerRenderContext, data: DeliverableReviewViewerData): void;
|
|
29
|
+
/**
|
|
30
|
+
* 处理点击事件
|
|
31
|
+
*/
|
|
32
|
+
onClick(context: ViewerRenderContext, data: DeliverableReviewViewerData, localX: number, localY: number): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 获取交互区域光标
|
|
35
|
+
*/
|
|
36
|
+
getInteractiveCursor(context: ViewerRenderContext, data: DeliverableReviewViewerData, localX: number, localY: number): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* 解析审核文件项列表
|
|
39
|
+
*/
|
|
40
|
+
private parseReviewItems;
|
|
41
|
+
/**
|
|
42
|
+
* 绘制审核文件项列表
|
|
43
|
+
*/
|
|
44
|
+
private drawReviewItems;
|
|
45
|
+
/**
|
|
46
|
+
* 绘制空值占位文本
|
|
47
|
+
*/
|
|
48
|
+
private drawEmptyText;
|
|
49
|
+
/**
|
|
50
|
+
* 绘制文件图标
|
|
51
|
+
* 审核类型显示蓝色审核图标,普通文件显示灰色文件图标
|
|
52
|
+
*/
|
|
53
|
+
private drawFileIcon;
|
|
54
|
+
/**
|
|
55
|
+
* 绘制审核图标(文件 + 对勾标记)
|
|
56
|
+
*/
|
|
57
|
+
private drawReviewIcon;
|
|
58
|
+
/**
|
|
59
|
+
* 绘制普通文件图标
|
|
60
|
+
*/
|
|
61
|
+
private drawDocumentIcon;
|
|
62
|
+
/**
|
|
63
|
+
* 绘制编辑按钮(铅笔图标)
|
|
64
|
+
*/
|
|
65
|
+
private drawEditButton;
|
|
66
|
+
/**
|
|
67
|
+
* 绘制铅笔编辑图标
|
|
68
|
+
*/
|
|
69
|
+
private drawPencilIcon;
|
|
70
|
+
/**
|
|
71
|
+
* 绘制错误指示器(右上角红色三角)
|
|
72
|
+
*/
|
|
73
|
+
private drawErrorIndicator;
|
|
74
|
+
/**
|
|
75
|
+
* 绘制删除线
|
|
76
|
+
*/
|
|
77
|
+
private drawStrikethrough;
|
|
78
|
+
/**
|
|
79
|
+
* 绘制圆角矩形
|
|
80
|
+
*/
|
|
81
|
+
private drawRoundedRect;
|
|
82
|
+
/**
|
|
83
|
+
* 截断文本并添加省略号
|
|
84
|
+
*/
|
|
85
|
+
private truncateText;
|
|
86
|
+
}
|
|
87
|
+
export default DeliverableReviewViewer;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileStorageSpecViewer - 交付地址 Viewer
|
|
3
|
+
* 在 canvas 单元格中渲染交付存储地址,支持悬停下划线和双击交互
|
|
4
|
+
*/
|
|
5
|
+
import type { CellViewer, ViewerRenderContext, FileStorageSpecViewerData } from './types';
|
|
6
|
+
declare class FileStorageSpecViewer implements CellViewer<FileStorageSpecViewerData> {
|
|
7
|
+
readonly type = "file-storage-spec";
|
|
8
|
+
/**
|
|
9
|
+
* 解析 value,返回有效的显示文本或 null
|
|
10
|
+
*/
|
|
11
|
+
private parseValue;
|
|
12
|
+
/**
|
|
13
|
+
* 绘制单元格内容
|
|
14
|
+
*/
|
|
15
|
+
draw(context: ViewerRenderContext, data: FileStorageSpecViewerData): void;
|
|
16
|
+
/**
|
|
17
|
+
* 处理双击事件
|
|
18
|
+
*/
|
|
19
|
+
onDblClick(context: ViewerRenderContext, data: FileStorageSpecViewerData, localX: number, localY: number): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 获取交互光标
|
|
22
|
+
*/
|
|
23
|
+
getInteractiveCursor(context: ViewerRenderContext, data: FileStorageSpecViewerData, localX: number, localY: number): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* 绘制占位符文本
|
|
26
|
+
*/
|
|
27
|
+
private drawPlaceholder;
|
|
28
|
+
/**
|
|
29
|
+
* 截断文字并添加省略号
|
|
30
|
+
*/
|
|
31
|
+
private truncateText;
|
|
32
|
+
/**
|
|
33
|
+
* 估算文字宽度(用于交互区域判断,不依赖 ctx)
|
|
34
|
+
*/
|
|
35
|
+
private estimateTextWidth;
|
|
36
|
+
}
|
|
37
|
+
export default FileStorageSpecViewer;
|