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,1097 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas-Table Viewer Type System
|
|
3
|
+
* Data-driven cell viewer interfaces and types
|
|
4
|
+
*/
|
|
5
|
+
import type Paint from '../Paint';
|
|
6
|
+
import type DataGrid from '../DataGrid';
|
|
7
|
+
/**
|
|
8
|
+
* Bounds of a cell for rendering
|
|
9
|
+
*/
|
|
10
|
+
export interface CellBounds {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Render context passed to viewers
|
|
18
|
+
*/
|
|
19
|
+
export interface ViewerRenderContext {
|
|
20
|
+
/** Canvas 2D rendering context */
|
|
21
|
+
ctx: CanvasRenderingContext2D;
|
|
22
|
+
/** Painter utility for drawing */
|
|
23
|
+
painter: Paint;
|
|
24
|
+
/** Parent grid reference */
|
|
25
|
+
grid: DataGrid;
|
|
26
|
+
/** Cell bounds */
|
|
27
|
+
bounds: CellBounds;
|
|
28
|
+
/** Row index */
|
|
29
|
+
rowIndex: number;
|
|
30
|
+
/** Column index */
|
|
31
|
+
colIndex: number;
|
|
32
|
+
/** Whether the cell is readonly */
|
|
33
|
+
readonly: boolean;
|
|
34
|
+
/** Whether the row is hovered */
|
|
35
|
+
isHoverRow: boolean;
|
|
36
|
+
/** Whether the cell is hovered */
|
|
37
|
+
isHoverCell: boolean;
|
|
38
|
+
/** Whether the cell is being edited */
|
|
39
|
+
isEditing: boolean;
|
|
40
|
+
/** Whether the row is checked/selected */
|
|
41
|
+
isChecked: boolean;
|
|
42
|
+
/** Cell background color */
|
|
43
|
+
fillColor: string;
|
|
44
|
+
/** Callback to request redraw */
|
|
45
|
+
requestRedraw: () => void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Viewer interaction state for drag operations
|
|
49
|
+
*/
|
|
50
|
+
export interface ViewerDragState {
|
|
51
|
+
/** Whether the viewer is currently being dragged */
|
|
52
|
+
isDragging: boolean;
|
|
53
|
+
/** Starting X position of the drag */
|
|
54
|
+
startX: number;
|
|
55
|
+
/** Starting Y position of the drag */
|
|
56
|
+
startY: number;
|
|
57
|
+
/** Original value before drag started */
|
|
58
|
+
startValue: any;
|
|
59
|
+
/** Current cell bounds */
|
|
60
|
+
bounds: CellBounds;
|
|
61
|
+
/** Current viewer data */
|
|
62
|
+
data: CellViewerData;
|
|
63
|
+
/** Row index */
|
|
64
|
+
rowIndex: number;
|
|
65
|
+
/** Column index */
|
|
66
|
+
colIndex: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Base cell viewer interface
|
|
70
|
+
* All viewers must implement this interface
|
|
71
|
+
*/
|
|
72
|
+
export interface CellViewer<T extends CellViewerData = CellViewerData> {
|
|
73
|
+
/** Viewer type identifier */
|
|
74
|
+
readonly type: string;
|
|
75
|
+
/**
|
|
76
|
+
* Draw the cell content
|
|
77
|
+
* @param context Render context
|
|
78
|
+
* @param data Cell data
|
|
79
|
+
*/
|
|
80
|
+
draw(context: ViewerRenderContext, data: T): void;
|
|
81
|
+
/**
|
|
82
|
+
* Optional: Handle click events on the cell
|
|
83
|
+
* @param context Render context
|
|
84
|
+
* @param data Cell data
|
|
85
|
+
* @param localX Click X position relative to cell
|
|
86
|
+
* @param localY Click Y position relative to cell
|
|
87
|
+
* @returns true if the event was handled
|
|
88
|
+
*/
|
|
89
|
+
onClick?(context: ViewerRenderContext, data: T, localX: number, localY: number): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Optional: Handle double click events on the cell
|
|
92
|
+
* @param context Render context
|
|
93
|
+
* @param data Cell data
|
|
94
|
+
* @param localX Double click X position relative to cell
|
|
95
|
+
* @param localY Double click Y position relative to cell
|
|
96
|
+
* @returns true if the event was handled (prevents default edit behavior)
|
|
97
|
+
*/
|
|
98
|
+
onDblClick?(context: ViewerRenderContext, data: T, localX: number, localY: number): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Optional: Get the preferred height for this cell
|
|
101
|
+
* @param context Render context
|
|
102
|
+
* @param data Cell data
|
|
103
|
+
* @returns Preferred height in pixels
|
|
104
|
+
*/
|
|
105
|
+
getPreferredHeight?(context: ViewerRenderContext, data: T): number;
|
|
106
|
+
/**
|
|
107
|
+
* Optional: Check if mouse is over an interactive area (e.g., drag handle)
|
|
108
|
+
* @param context Render context
|
|
109
|
+
* @param data Cell data
|
|
110
|
+
* @param localX Mouse X position relative to cell
|
|
111
|
+
* @param localY Mouse Y position relative to cell
|
|
112
|
+
* @returns Cursor style if over interactive area, null otherwise
|
|
113
|
+
*/
|
|
114
|
+
getInteractiveCursor?(context: ViewerRenderContext, data: T, localX: number, localY: number): string | null;
|
|
115
|
+
/**
|
|
116
|
+
* Optional: Handle mouse down for drag operations
|
|
117
|
+
* @param context Render context
|
|
118
|
+
* @param data Cell data
|
|
119
|
+
* @param localX Mouse X position relative to cell
|
|
120
|
+
* @param localY Mouse Y position relative to cell
|
|
121
|
+
* @returns true if drag operation started
|
|
122
|
+
*/
|
|
123
|
+
onDragStart?(context: ViewerRenderContext, data: T, localX: number, localY: number): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Optional: Handle drag move
|
|
126
|
+
* @param context Render context
|
|
127
|
+
* @param data Cell data
|
|
128
|
+
* @param localX Current mouse X position relative to cell
|
|
129
|
+
* @param localY Current mouse Y position relative to cell
|
|
130
|
+
* @param startX Starting mouse X position
|
|
131
|
+
* @param startY Starting mouse Y position
|
|
132
|
+
* @returns New value if changed, undefined otherwise
|
|
133
|
+
*/
|
|
134
|
+
onDragMove?(context: ViewerRenderContext, data: T, localX: number, localY: number, startX: number, startY: number): any;
|
|
135
|
+
/**
|
|
136
|
+
* Optional: Handle drag end
|
|
137
|
+
* @param context Render context
|
|
138
|
+
* @param data Cell data
|
|
139
|
+
* @param newValue The final value after dragging
|
|
140
|
+
*/
|
|
141
|
+
onDragEnd?(context: ViewerRenderContext, data: T, newValue: any): void;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Base cell viewer data interface
|
|
145
|
+
* All specific data types extend this interface
|
|
146
|
+
*/
|
|
147
|
+
export interface CellViewerData {
|
|
148
|
+
/** Raw value stored in the cell */
|
|
149
|
+
value: any;
|
|
150
|
+
/** Display label (may differ from value) */
|
|
151
|
+
label?: string;
|
|
152
|
+
/** Options for select-type viewers */
|
|
153
|
+
options?: ViewerOption[];
|
|
154
|
+
/** Custom style overrides */
|
|
155
|
+
style?: ViewerStyle;
|
|
156
|
+
/** Extra data for specific viewers */
|
|
157
|
+
extra?: Record<string, any>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Option item for select-type viewers
|
|
161
|
+
*/
|
|
162
|
+
export interface ViewerOption {
|
|
163
|
+
value: any;
|
|
164
|
+
label: string;
|
|
165
|
+
color?: string;
|
|
166
|
+
backgroundColor?: string;
|
|
167
|
+
icon?: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Style configuration for viewers
|
|
171
|
+
*/
|
|
172
|
+
export interface ViewerStyle {
|
|
173
|
+
color?: string;
|
|
174
|
+
backgroundColor?: string;
|
|
175
|
+
borderColor?: string;
|
|
176
|
+
fontSize?: number;
|
|
177
|
+
fontWeight?: 'normal' | 'bold';
|
|
178
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
179
|
+
textBaseline?: 'top' | 'middle' | 'bottom';
|
|
180
|
+
padding?: number;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Text viewer data
|
|
184
|
+
*/
|
|
185
|
+
export interface TextViewerData extends CellViewerData {
|
|
186
|
+
value: string | number | null;
|
|
187
|
+
/** Text alignment */
|
|
188
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
189
|
+
/** Background color for label mode */
|
|
190
|
+
backgroundColor?: string;
|
|
191
|
+
/** Whether to render as a tag/badge */
|
|
192
|
+
asTag?: boolean;
|
|
193
|
+
/** Tag border radius */
|
|
194
|
+
tagRadius?: number;
|
|
195
|
+
/** Rich text HTML content */
|
|
196
|
+
richText?: string;
|
|
197
|
+
/** Placeholder for empty values */
|
|
198
|
+
placeholder?: string;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Select viewer data (single/multi select)
|
|
202
|
+
*/
|
|
203
|
+
export interface SelectViewerData extends CellViewerData {
|
|
204
|
+
value: any | any[];
|
|
205
|
+
/** Available options */
|
|
206
|
+
options: ViewerOption[];
|
|
207
|
+
/** Whether multiple selection is allowed */
|
|
208
|
+
multiple?: boolean;
|
|
209
|
+
/** Show dropdown arrow */
|
|
210
|
+
showArrow?: boolean;
|
|
211
|
+
/** Max tags to display (for multiple mode) */
|
|
212
|
+
maxTags?: number;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Image viewer data
|
|
216
|
+
*/
|
|
217
|
+
export interface ImageViewerData extends CellViewerData {
|
|
218
|
+
value: string | null;
|
|
219
|
+
/** Alternative text */
|
|
220
|
+
alt?: string;
|
|
221
|
+
/** Placeholder image URL */
|
|
222
|
+
placeholder?: string;
|
|
223
|
+
/** Image fit mode */
|
|
224
|
+
fit?: 'contain' | 'cover' | 'fill';
|
|
225
|
+
/** Border radius */
|
|
226
|
+
borderRadius?: number;
|
|
227
|
+
/** Whether the image is animated (GIF) */
|
|
228
|
+
animated?: boolean;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Person/User viewer data
|
|
232
|
+
*/
|
|
233
|
+
export interface PersonViewerData extends CellViewerData {
|
|
234
|
+
value: PersonInfo | PersonInfo[] | null;
|
|
235
|
+
/** Display mode */
|
|
236
|
+
mode?: 'avatar' | 'name' | 'both';
|
|
237
|
+
/** Avatar size */
|
|
238
|
+
avatarSize?: number;
|
|
239
|
+
/** Max persons to display */
|
|
240
|
+
maxDisplay?: number;
|
|
241
|
+
/** Placeholder text for empty */
|
|
242
|
+
placeholder?: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Person information
|
|
246
|
+
*/
|
|
247
|
+
export interface PersonInfo {
|
|
248
|
+
id: string | number;
|
|
249
|
+
name: string;
|
|
250
|
+
avatar?: string;
|
|
251
|
+
email?: string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Progress viewer data
|
|
255
|
+
*/
|
|
256
|
+
export interface ProgressViewerData extends CellViewerData {
|
|
257
|
+
value: number;
|
|
258
|
+
/** Minimum value (default 0) */
|
|
259
|
+
min?: number;
|
|
260
|
+
/** Maximum value (default 100) */
|
|
261
|
+
max?: number;
|
|
262
|
+
/** Progress bar height */
|
|
263
|
+
barHeight?: number;
|
|
264
|
+
/** Show percentage text */
|
|
265
|
+
showText?: boolean;
|
|
266
|
+
/** Text position */
|
|
267
|
+
textPosition?: 'inside' | 'outside' | 'right';
|
|
268
|
+
/** Progress color (or auto based on value) */
|
|
269
|
+
color?: string;
|
|
270
|
+
/** Track/background color */
|
|
271
|
+
trackColor?: string;
|
|
272
|
+
/** Color thresholds for automatic coloring */
|
|
273
|
+
colorThresholds?: Array<{
|
|
274
|
+
value: number;
|
|
275
|
+
color: string;
|
|
276
|
+
}>;
|
|
277
|
+
/** Whether the progress bar is draggable to change value */
|
|
278
|
+
draggable?: boolean;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Datetime viewer data
|
|
282
|
+
*/
|
|
283
|
+
export interface DatetimeViewerData extends CellViewerData {
|
|
284
|
+
value: string | number | Date | null;
|
|
285
|
+
/** Date format string */
|
|
286
|
+
format?: string;
|
|
287
|
+
/** Display type */
|
|
288
|
+
displayType?: 'date' | 'time' | 'datetime' | 'month';
|
|
289
|
+
/** Show icon */
|
|
290
|
+
showIcon?: boolean;
|
|
291
|
+
/** Placeholder for invalid/empty dates */
|
|
292
|
+
placeholder?: string;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Boolean/Checkbox viewer data
|
|
296
|
+
*/
|
|
297
|
+
export interface BooleanViewerData extends CellViewerData {
|
|
298
|
+
value: boolean | null;
|
|
299
|
+
/** Display style */
|
|
300
|
+
displayStyle?: 'checkbox' | 'switch' | 'text';
|
|
301
|
+
/** Text for true value */
|
|
302
|
+
trueText?: string;
|
|
303
|
+
/** Text for false value */
|
|
304
|
+
falseText?: string;
|
|
305
|
+
/** Text for null/indeterminate value */
|
|
306
|
+
nullText?: string;
|
|
307
|
+
/** Check icon color */
|
|
308
|
+
checkedColor?: string;
|
|
309
|
+
/** Uncheck icon color */
|
|
310
|
+
uncheckedColor?: string;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Status viewer data
|
|
314
|
+
*/
|
|
315
|
+
export interface StatusViewerData extends CellViewerData {
|
|
316
|
+
value: string | number;
|
|
317
|
+
/** Status configurations */
|
|
318
|
+
options: StatusOption[];
|
|
319
|
+
/** Show status icon */
|
|
320
|
+
showIcon?: boolean;
|
|
321
|
+
/** Show as tag/badge */
|
|
322
|
+
asTag?: boolean;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Status option configuration
|
|
326
|
+
*/
|
|
327
|
+
export interface StatusOption extends ViewerOption {
|
|
328
|
+
/** Status icon */
|
|
329
|
+
icon?: 'dot' | 'check' | 'cross' | 'warning' | 'info' | string;
|
|
330
|
+
/** Status type for automatic styling */
|
|
331
|
+
type?: 'success' | 'warning' | 'error' | 'info' | 'default';
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Group header viewer data
|
|
335
|
+
*/
|
|
336
|
+
export interface GroupHeaderViewerData extends CellViewerData {
|
|
337
|
+
value: string;
|
|
338
|
+
/** Group display label */
|
|
339
|
+
label: string;
|
|
340
|
+
/** Number of records in group */
|
|
341
|
+
count?: number;
|
|
342
|
+
/** Whether the group is expanded */
|
|
343
|
+
expanded?: boolean;
|
|
344
|
+
/** Nesting level (for multi-level groups) */
|
|
345
|
+
level?: number;
|
|
346
|
+
/** Group type */
|
|
347
|
+
groupType?: 'text' | 'person' | 'status' | 'date';
|
|
348
|
+
/** Group icon */
|
|
349
|
+
icon?: string;
|
|
350
|
+
/** Person info for person-type groups */
|
|
351
|
+
person?: PersonInfo;
|
|
352
|
+
/** Whether to show count badge */
|
|
353
|
+
showCount?: boolean;
|
|
354
|
+
/** Whether to show working hours icon */
|
|
355
|
+
showUserWorkingHours?: boolean;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Separator row viewer data
|
|
359
|
+
*/
|
|
360
|
+
export interface SeparatorRowViewerData extends CellViewerData {
|
|
361
|
+
value: null | undefined;
|
|
362
|
+
/** Separator nesting level */
|
|
363
|
+
separateLevel?: number;
|
|
364
|
+
/** Group level context */
|
|
365
|
+
groupLevel?: number;
|
|
366
|
+
/** Whether this is the end level */
|
|
367
|
+
isEndLevel?: boolean;
|
|
368
|
+
/** Row height override */
|
|
369
|
+
rowHeight?: number;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Tree node item for tree dropdown
|
|
373
|
+
*/
|
|
374
|
+
export interface TreeNodeItem {
|
|
375
|
+
value: string | number;
|
|
376
|
+
label: string;
|
|
377
|
+
path?: string;
|
|
378
|
+
children?: TreeNodeItem[];
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Tree dropdown viewer data
|
|
382
|
+
*/
|
|
383
|
+
export interface TreeDropdownViewerData extends CellViewerData {
|
|
384
|
+
value: string | string[] | TreeNodeItem[] | null;
|
|
385
|
+
/** Path separator character */
|
|
386
|
+
pathSeparator?: string;
|
|
387
|
+
/** Whether to show full path or only the last segment */
|
|
388
|
+
showFullPath?: boolean;
|
|
389
|
+
/** Max tags to display */
|
|
390
|
+
maxTags?: number;
|
|
391
|
+
/** Placeholder for empty values */
|
|
392
|
+
placeholder?: string;
|
|
393
|
+
/** Tag background color */
|
|
394
|
+
tagBackgroundColor?: string;
|
|
395
|
+
/** Tag border color */
|
|
396
|
+
tagBorderColor?: string;
|
|
397
|
+
/** Tag text color */
|
|
398
|
+
tagColor?: string;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Punch (打卡进度) viewer data
|
|
402
|
+
*/
|
|
403
|
+
export interface PunchViewerData extends CellViewerData {
|
|
404
|
+
value: PunchValue | null;
|
|
405
|
+
/** 数据行 ID */
|
|
406
|
+
id?: string | number;
|
|
407
|
+
/** 属性 key */
|
|
408
|
+
key?: string;
|
|
409
|
+
/** 是否可编辑 */
|
|
410
|
+
canEdit?: boolean;
|
|
411
|
+
/** 是否显示删除线 */
|
|
412
|
+
showLineThrow?: boolean;
|
|
413
|
+
/** 日期显示模式 */
|
|
414
|
+
datePattern?: string;
|
|
415
|
+
/** 是否关联属性 */
|
|
416
|
+
isLink?: boolean;
|
|
417
|
+
/** 关联 key */
|
|
418
|
+
linkKey?: string;
|
|
419
|
+
/** 是否有错误 */
|
|
420
|
+
error?: {
|
|
421
|
+
errorProperty?: string;
|
|
422
|
+
errorMessage?: string;
|
|
423
|
+
} | null;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* 打卡值
|
|
427
|
+
*/
|
|
428
|
+
export interface PunchValue {
|
|
429
|
+
/** 打卡记录 ID,> 0 表示已打卡 */
|
|
430
|
+
punch_id?: number;
|
|
431
|
+
/** 打卡日期时间戳 */
|
|
432
|
+
created_date?: number;
|
|
433
|
+
/** 进度 0~1 */
|
|
434
|
+
progress?: number;
|
|
435
|
+
/** 审批状态 */
|
|
436
|
+
review_status?: number | string;
|
|
437
|
+
/** 是否已读 */
|
|
438
|
+
is_read?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Module information
|
|
442
|
+
*/
|
|
443
|
+
export interface ModuleInfo {
|
|
444
|
+
/** Module unique identifier */
|
|
445
|
+
id: string;
|
|
446
|
+
/** Module display name */
|
|
447
|
+
name: string;
|
|
448
|
+
/** Module color for tag background (optional) */
|
|
449
|
+
color?: string;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Module viewer data
|
|
453
|
+
*/
|
|
454
|
+
export interface ModuleViewerData extends CellViewerData {
|
|
455
|
+
/** Module(s) - ModuleInfo object(s), string ID(s) as fallback, or null */
|
|
456
|
+
value: ModuleInfo | ModuleInfo[] | string | string[] | null;
|
|
457
|
+
/** Whether to show colored tags (default true) */
|
|
458
|
+
showColor?: boolean;
|
|
459
|
+
/** Maximum number of modules to display (default 3) */
|
|
460
|
+
maxDisplay?: number;
|
|
461
|
+
/** Placeholder text for empty values (default '-') */
|
|
462
|
+
placeholder?: string;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Text viewer with switcher data (tree expand/collapse + task name)
|
|
466
|
+
*/
|
|
467
|
+
export interface TextViewerWithSwitcherData extends CellViewerData {
|
|
468
|
+
value: string | number | null;
|
|
469
|
+
/** Display label (overrides value when present) */
|
|
470
|
+
label?: string;
|
|
471
|
+
/** Custom text color (default '#333') */
|
|
472
|
+
color?: string;
|
|
473
|
+
/** Whether the node is expanded */
|
|
474
|
+
expanded?: boolean;
|
|
475
|
+
/** Whether the node has children */
|
|
476
|
+
hasChildren?: boolean;
|
|
477
|
+
/** Whether the node is loading children */
|
|
478
|
+
loading?: boolean;
|
|
479
|
+
/** Tree indentation level (0 = root) */
|
|
480
|
+
tableTreeLevel?: number;
|
|
481
|
+
/** Array indicating whether each ancestor is the last leaf at its level */
|
|
482
|
+
isLastLeafArr?: boolean[];
|
|
483
|
+
/** Task icon file URL (dynamically loaded from data source) */
|
|
484
|
+
iconFile?: string;
|
|
485
|
+
/** Child node count */
|
|
486
|
+
count?: number;
|
|
487
|
+
/** Whether the node has downstream nodes */
|
|
488
|
+
hasDownstreamNode?: boolean;
|
|
489
|
+
/** Rich text HTML content */
|
|
490
|
+
richText?: string;
|
|
491
|
+
/** Placeholder for empty values */
|
|
492
|
+
placeholder?: string;
|
|
493
|
+
/** Whether this is a linked task */
|
|
494
|
+
isLinkTask?: boolean;
|
|
495
|
+
/** Linked task icon file URL */
|
|
496
|
+
linkIconFile?: string;
|
|
497
|
+
/** Whether to show strikethrough on text */
|
|
498
|
+
showLineThrough?: boolean;
|
|
499
|
+
/** Whether to show weakened (dimmed) text */
|
|
500
|
+
weakenWord?: boolean;
|
|
501
|
+
/** Text alignment */
|
|
502
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
503
|
+
/** Error/warning state */
|
|
504
|
+
error?: {
|
|
505
|
+
errorProperty?: string;
|
|
506
|
+
errorMessage?: string;
|
|
507
|
+
is_warning?: boolean;
|
|
508
|
+
is_level_1_error?: boolean;
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* 文件项信息
|
|
513
|
+
*/
|
|
514
|
+
export interface FileItem {
|
|
515
|
+
/** 文件名 */
|
|
516
|
+
name: string;
|
|
517
|
+
/** 文件格式/后缀 */
|
|
518
|
+
fileFormat?: string;
|
|
519
|
+
/** 预览图片 URL */
|
|
520
|
+
previewUrl?: string;
|
|
521
|
+
/** 是否正在上传/处理中 */
|
|
522
|
+
doing?: boolean;
|
|
523
|
+
/** 文件资产 ID */
|
|
524
|
+
assetId?: number;
|
|
525
|
+
/** 文件状态 */
|
|
526
|
+
status?: number;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* 文件 Viewer 数据接口
|
|
530
|
+
*/
|
|
531
|
+
export interface FileViewerData extends CellViewerData {
|
|
532
|
+
/** 文件列表 */
|
|
533
|
+
value: FileItem[] | null;
|
|
534
|
+
/** 数据行 ID */
|
|
535
|
+
id?: string | number;
|
|
536
|
+
/** 属性 key */
|
|
537
|
+
key?: string;
|
|
538
|
+
/** 是否可编辑 */
|
|
539
|
+
canEdit?: boolean;
|
|
540
|
+
/** 是否显示删除线 */
|
|
541
|
+
showLineThrow?: boolean;
|
|
542
|
+
/** 是否关联属性 */
|
|
543
|
+
isLink?: boolean;
|
|
544
|
+
/** 关联 key */
|
|
545
|
+
linkKey?: string;
|
|
546
|
+
/** 关联数据行 ID */
|
|
547
|
+
linkedId?: string | number;
|
|
548
|
+
/** 文件元数据 key */
|
|
549
|
+
fileMeta?: string;
|
|
550
|
+
/** 是否有错误 */
|
|
551
|
+
error?: {
|
|
552
|
+
errorProperty?: string;
|
|
553
|
+
errorMessage?: string;
|
|
554
|
+
} | null;
|
|
555
|
+
/** 是否仅显示缩略图(隐藏文件名) */
|
|
556
|
+
isDisplayThumbnail?: boolean;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* HyperLink text viewer data (超链接文本)
|
|
560
|
+
*/
|
|
561
|
+
export interface HyperlinkTextViewerData extends CellViewerData {
|
|
562
|
+
/** 值格式:[显示文本, 链接URL] 或 null */
|
|
563
|
+
value: [string, string] | null;
|
|
564
|
+
/** 数据行 ID */
|
|
565
|
+
id?: string | number;
|
|
566
|
+
/** 属性 key */
|
|
567
|
+
key?: string;
|
|
568
|
+
/** 是否可编辑 */
|
|
569
|
+
canEdit?: boolean;
|
|
570
|
+
/** 是否显示删除线 */
|
|
571
|
+
showLineThrow?: boolean;
|
|
572
|
+
/** 是否关联属性 */
|
|
573
|
+
isLink?: boolean;
|
|
574
|
+
/** 关联 key */
|
|
575
|
+
linkKey?: string;
|
|
576
|
+
/** 是否有错误 */
|
|
577
|
+
error?: {
|
|
578
|
+
errorProperty?: string;
|
|
579
|
+
errorMessage?: string;
|
|
580
|
+
} | null;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* 工作流状态 Viewer 数据接口
|
|
584
|
+
*/
|
|
585
|
+
export interface WfStateViewerData extends CellViewerData {
|
|
586
|
+
/** 工作流状态 ID,支持数字、包含 id 的对象、或 null */
|
|
587
|
+
value: number | {
|
|
588
|
+
id: number;
|
|
589
|
+
} | null;
|
|
590
|
+
/** 状态显示名称 */
|
|
591
|
+
displayName?: string;
|
|
592
|
+
/** 状态大类(如 'toStart' | 'inProgress' | 'complete' | 'rejected' | 'paused') */
|
|
593
|
+
stateType?: string;
|
|
594
|
+
/** 图标颜色 */
|
|
595
|
+
iconColor?: string;
|
|
596
|
+
/** 文字颜色 */
|
|
597
|
+
color?: string;
|
|
598
|
+
/** 图标类型标识 */
|
|
599
|
+
icon?: string;
|
|
600
|
+
/** 额外信息,非空时显示角标 */
|
|
601
|
+
extraInfo?: Record<string, any> | null;
|
|
602
|
+
/** 空值时的占位文本 */
|
|
603
|
+
placeholder?: string;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Module info for an upstream field item
|
|
607
|
+
*/
|
|
608
|
+
export interface IUpstreamModule {
|
|
609
|
+
/** Module display name (e.g. '原画', '建模') */
|
|
610
|
+
displayName: string;
|
|
611
|
+
/** Module tag background color */
|
|
612
|
+
bgColor: string;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Reminder properties for an incomplete upstream field item
|
|
616
|
+
*/
|
|
617
|
+
export interface IUpstreamReminderProperties {
|
|
618
|
+
/** Reminder display text (e.g. '等待上游', '已超期') */
|
|
619
|
+
displayName: string;
|
|
620
|
+
/** Optional background color for the reminder tag */
|
|
621
|
+
bgColor?: string;
|
|
622
|
+
/** Whether this is a first-edition completion time */
|
|
623
|
+
isFirstEditionTime?: boolean;
|
|
624
|
+
[key: string]: any;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Sync property representing a single resource preview
|
|
628
|
+
*/
|
|
629
|
+
export interface IUpstreamSyncProperty {
|
|
630
|
+
/** Resource asset ID */
|
|
631
|
+
assetId: number;
|
|
632
|
+
/** Resource display name (e.g. 'asset_001.png') */
|
|
633
|
+
displayName: string;
|
|
634
|
+
/** File format extension (e.g. 'png', 'psd', 'fbx') */
|
|
635
|
+
fileFormat: string;
|
|
636
|
+
/** Preview image URL (empty string if no preview available) */
|
|
637
|
+
imageUrl: string;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* A single upstream field view item representing one upstream dependency
|
|
641
|
+
*/
|
|
642
|
+
export interface IUpstreamFieldViewItem {
|
|
643
|
+
/** Unique node identifier */
|
|
644
|
+
nodeId: number;
|
|
645
|
+
/** Module info with display name and color */
|
|
646
|
+
module: IUpstreamModule;
|
|
647
|
+
/** Whether the upstream dependency is completed */
|
|
648
|
+
isAvailable: boolean;
|
|
649
|
+
/** Reminder properties (present when isAvailable is false) */
|
|
650
|
+
reminderProperties?: IUpstreamReminderProperties;
|
|
651
|
+
/** Sync resource previews (present when isAvailable is true) */
|
|
652
|
+
syncProperties?: IUpstreamSyncProperty[];
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Upstream viewer data - displays upstream dependency status
|
|
656
|
+
*/
|
|
657
|
+
export interface UpstreamViewerData extends CellViewerData {
|
|
658
|
+
/** Array of upstream field view items */
|
|
659
|
+
value: IUpstreamFieldViewItem[];
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* 任务节点项信息
|
|
663
|
+
*/
|
|
664
|
+
export interface TaskNodeItem {
|
|
665
|
+
/** 任务节点 ID */
|
|
666
|
+
id: number;
|
|
667
|
+
/** 任务节点名称 */
|
|
668
|
+
name: string;
|
|
669
|
+
/** 任务图标文件名(可选,无时显示默认图标) */
|
|
670
|
+
iconFile?: string;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* 任务节点 Viewer 数据接口
|
|
674
|
+
*/
|
|
675
|
+
export interface TaskNodeViewerData extends CellViewerData {
|
|
676
|
+
/** 任务节点数据,支持数组、逗号分隔字符串、单个数字 */
|
|
677
|
+
value: TaskNodeItem[] | string | number | null;
|
|
678
|
+
/** 数据行 ID */
|
|
679
|
+
id?: string | number;
|
|
680
|
+
/** 属性 key */
|
|
681
|
+
key?: string;
|
|
682
|
+
/** 是否可编辑 */
|
|
683
|
+
canEdit?: boolean;
|
|
684
|
+
/** 是否为关联属性 */
|
|
685
|
+
isLink?: boolean;
|
|
686
|
+
/** 关联属性 key */
|
|
687
|
+
linkKey?: string;
|
|
688
|
+
/** 是否显示删除线 */
|
|
689
|
+
showLineThrow?: boolean;
|
|
690
|
+
/** 错误信息 */
|
|
691
|
+
error?: {
|
|
692
|
+
errorProperty?: string;
|
|
693
|
+
errorMessage?: string;
|
|
694
|
+
is_warning?: boolean;
|
|
695
|
+
} | null;
|
|
696
|
+
/** 自定义任务节点信息映射 */
|
|
697
|
+
customTaskNodeInfo?: Record<number, {
|
|
698
|
+
name: string;
|
|
699
|
+
iconFile?: string;
|
|
700
|
+
}>;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* ITFS path viewer data
|
|
704
|
+
*/
|
|
705
|
+
export interface ItfsPathViewerData extends CellViewerData {
|
|
706
|
+
value: string | Record<string, any> | null;
|
|
707
|
+
/** Path text color (default: #268bfb) */
|
|
708
|
+
pathColor?: string;
|
|
709
|
+
/** Icon color (default: #8e8e8e) */
|
|
710
|
+
iconColor?: string;
|
|
711
|
+
/** Whether to show netdisc icon (default: true) */
|
|
712
|
+
showIcon?: boolean;
|
|
713
|
+
/** Placeholder for empty values */
|
|
714
|
+
placeholder?: string;
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Nested grid viewer data
|
|
718
|
+
*/
|
|
719
|
+
export interface NestedGridViewerData extends CellViewerData {
|
|
720
|
+
value: any[];
|
|
721
|
+
/** Nested grid columns */
|
|
722
|
+
columns: NestedColumnConfig[];
|
|
723
|
+
/** Whether to show expand all button */
|
|
724
|
+
showExpandAll?: boolean;
|
|
725
|
+
/** Default display rows when collapsed */
|
|
726
|
+
displayRows?: number;
|
|
727
|
+
/** Whether currently expanded */
|
|
728
|
+
expanded?: boolean;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Nested column configuration
|
|
732
|
+
*/
|
|
733
|
+
export interface NestedColumnConfig {
|
|
734
|
+
key: string;
|
|
735
|
+
title: string;
|
|
736
|
+
width?: number;
|
|
737
|
+
type?: string;
|
|
738
|
+
align?: 'left' | 'center' | 'right';
|
|
739
|
+
[key: string]: any;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Viewer class constructor type
|
|
743
|
+
*/
|
|
744
|
+
export type ViewerConstructor<T extends CellViewerData = CellViewerData> = new () => CellViewer<T>;
|
|
745
|
+
/**
|
|
746
|
+
* Viewer factory function type
|
|
747
|
+
*/
|
|
748
|
+
export type ViewerFactory<T extends CellViewerData = CellViewerData> = () => CellViewer<T>;
|
|
749
|
+
/**
|
|
750
|
+
* Viewer type mapping
|
|
751
|
+
*/
|
|
752
|
+
export interface ViewerTypeMap {
|
|
753
|
+
text: TextViewerData;
|
|
754
|
+
select: SelectViewerData;
|
|
755
|
+
image: ImageViewerData;
|
|
756
|
+
person: PersonViewerData;
|
|
757
|
+
progress: ProgressViewerData;
|
|
758
|
+
datetime: DatetimeViewerData;
|
|
759
|
+
date: DatetimeViewerData;
|
|
760
|
+
time: DatetimeViewerData;
|
|
761
|
+
month: DatetimeViewerData;
|
|
762
|
+
boolean: BooleanViewerData;
|
|
763
|
+
checkbox: BooleanViewerData;
|
|
764
|
+
status: StatusViewerData;
|
|
765
|
+
'group-header': GroupHeaderViewerData;
|
|
766
|
+
'separator-row': SeparatorRowViewerData;
|
|
767
|
+
nested: NestedGridViewerData;
|
|
768
|
+
'tree-dropdown': TreeDropdownViewerData;
|
|
769
|
+
punch: PunchViewerData;
|
|
770
|
+
'punch-timing': PunchTimingViewerData;
|
|
771
|
+
hyperlink: HyperlinkTextViewerData;
|
|
772
|
+
file: FileViewerData;
|
|
773
|
+
'task-node': TaskNodeViewerData;
|
|
774
|
+
'wf-state': WfStateViewerData;
|
|
775
|
+
workflow: WorkflowViewerData;
|
|
776
|
+
'file-storage-spec': FileStorageSpecViewerData;
|
|
777
|
+
pivot: PivotViewerData;
|
|
778
|
+
module: ModuleViewerData;
|
|
779
|
+
'text-with-switcher': TextViewerWithSwitcherData;
|
|
780
|
+
upstream: UpstreamViewerData;
|
|
781
|
+
'table-action-button': TableActionButtonViewerData;
|
|
782
|
+
'priority-text': PriorityTextViewerData;
|
|
783
|
+
'status-text': StatusTextViewerData;
|
|
784
|
+
theme: ThemeViewerData;
|
|
785
|
+
'itfs-path': ItfsPathViewerData;
|
|
786
|
+
'deliverable-review': DeliverableReviewViewerData;
|
|
787
|
+
'rich-text': RichTextViewerData;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* All supported viewer types
|
|
791
|
+
*/
|
|
792
|
+
export type ViewerType = keyof ViewerTypeMap;
|
|
793
|
+
/**
|
|
794
|
+
* Cell data with viewer type
|
|
795
|
+
*/
|
|
796
|
+
export interface TypedCellData<T extends ViewerType = ViewerType> {
|
|
797
|
+
viewerType: T;
|
|
798
|
+
data: ViewerTypeMap[T];
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Type guard for viewer data
|
|
802
|
+
*/
|
|
803
|
+
export declare function isTextViewerData(data: CellViewerData): data is TextViewerData;
|
|
804
|
+
export declare function isSelectViewerData(data: CellViewerData): data is SelectViewerData;
|
|
805
|
+
export declare function isPersonViewerData(data: CellViewerData): data is PersonViewerData;
|
|
806
|
+
export declare function isProgressViewerData(data: CellViewerData): data is ProgressViewerData;
|
|
807
|
+
export declare function isNestedGridViewerData(data: CellViewerData): data is NestedGridViewerData;
|
|
808
|
+
/**
|
|
809
|
+
* 交付地址 Viewer 数据接口
|
|
810
|
+
* 接收业务层已处理好的地址字符串(URL 格式转换和权限脱敏由业务层完成)
|
|
811
|
+
*/
|
|
812
|
+
export interface FileStorageSpecViewerData extends CellViewerData {
|
|
813
|
+
/** 交付地址显示文本(业务层将原始 URL 经过格式转换和权限脱敏后传入) */
|
|
814
|
+
value: string | null;
|
|
815
|
+
/** 空值时的占位文本(默认 '-') */
|
|
816
|
+
placeholder?: string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* 引用类型 Viewer 数据接口
|
|
820
|
+
* 接收业务层将引用属性值格式化后传入的显示文本
|
|
821
|
+
*/
|
|
822
|
+
export interface PivotViewerData extends CellViewerData {
|
|
823
|
+
/** 引用属性的格式化显示文本(由业务层将 pivotField 解析后传入) */
|
|
824
|
+
value: string | null;
|
|
825
|
+
/** 空值时的占位文本(默认 '-') */
|
|
826
|
+
placeholder?: string;
|
|
827
|
+
/** 是否为关联属性(为 true 时显示关联图标) */
|
|
828
|
+
isLink?: boolean;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* 工作流 Viewer 数据接口
|
|
832
|
+
* 接收业务层已转换好的工作流显示名称数组
|
|
833
|
+
*/
|
|
834
|
+
export interface WorkflowViewerData extends CellViewerData {
|
|
835
|
+
/** 工作流显示名称数组(由业务层将工作流 ID 通过 wfStateManager 转换后传入) */
|
|
836
|
+
value: string[];
|
|
837
|
+
/** 空值时的占位文本(默认 '-') */
|
|
838
|
+
placeholder?: string;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Single button option for table action button viewer
|
|
842
|
+
*/
|
|
843
|
+
export interface TableActionButtonOption {
|
|
844
|
+
/** Button unique identifier */
|
|
845
|
+
name: string;
|
|
846
|
+
/** Button display text */
|
|
847
|
+
displayName: string;
|
|
848
|
+
/** Whether this is a super admin button (orange style) */
|
|
849
|
+
isSuperBtn?: boolean;
|
|
850
|
+
/** Whether this is an operation button (blue style) */
|
|
851
|
+
isOperationBtn?: boolean;
|
|
852
|
+
/** Custom background color */
|
|
853
|
+
backgroundColor?: string;
|
|
854
|
+
/** Custom text color */
|
|
855
|
+
color?: string;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Table action button viewer data
|
|
859
|
+
*/
|
|
860
|
+
export interface TableActionButtonViewerData extends CellViewerData {
|
|
861
|
+
/** Array of button options */
|
|
862
|
+
value: TableActionButtonOption[] | null;
|
|
863
|
+
/** Data row ID */
|
|
864
|
+
id?: string | number;
|
|
865
|
+
/** Property key */
|
|
866
|
+
key?: string;
|
|
867
|
+
/** Whether the buttons are editable/clickable */
|
|
868
|
+
canEdit?: boolean;
|
|
869
|
+
/** Whether this is a linked task (shows link icon, no buttons) */
|
|
870
|
+
isLinkTask?: boolean;
|
|
871
|
+
/** Whether to show link icon */
|
|
872
|
+
isLink?: boolean;
|
|
873
|
+
/** Link key */
|
|
874
|
+
linkKey?: string;
|
|
875
|
+
/** Button click callback */
|
|
876
|
+
onButtonClick?: (event: MouseEvent, payload: {
|
|
877
|
+
id: string | number;
|
|
878
|
+
operation: TableActionButtonOption;
|
|
879
|
+
}) => void;
|
|
880
|
+
/** Operation button click callback */
|
|
881
|
+
onOperationBtnClick?: (event: MouseEvent, payload: {
|
|
882
|
+
id: string | number;
|
|
883
|
+
data: TableActionButtonViewerData;
|
|
884
|
+
}) => void;
|
|
885
|
+
/** "More" button click callback */
|
|
886
|
+
onAfterClick?: (event: MouseEvent, payload: {
|
|
887
|
+
data: TableActionButtonViewerData;
|
|
888
|
+
position: {
|
|
889
|
+
x: number;
|
|
890
|
+
y: number;
|
|
891
|
+
};
|
|
892
|
+
}) => void;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* 打卡时间查看器数据接口
|
|
896
|
+
* 用于显示打卡的时间信息,如00:00:00格式的时间显示
|
|
897
|
+
*/
|
|
898
|
+
export interface PunchTimingViewerData extends CellViewerData {
|
|
899
|
+
/** 时间值,支持字符串格式如'00:00:00'或时间戳 */
|
|
900
|
+
value: string | number | null;
|
|
901
|
+
/** 数据行 ID */
|
|
902
|
+
id?: string | number;
|
|
903
|
+
/** 属性 key */
|
|
904
|
+
key?: string;
|
|
905
|
+
/** 是否可编辑 */
|
|
906
|
+
canEdit?: boolean;
|
|
907
|
+
/** 是否显示删除线 */
|
|
908
|
+
showLineThrow?: boolean;
|
|
909
|
+
/** 是否关联属性 */
|
|
910
|
+
isLink?: boolean;
|
|
911
|
+
/** 关联 key */
|
|
912
|
+
linkKey?: string;
|
|
913
|
+
/** 是否有错误 */
|
|
914
|
+
error?: {
|
|
915
|
+
errorProperty?: string;
|
|
916
|
+
errorMessage?: string;
|
|
917
|
+
} | null;
|
|
918
|
+
/** 时间格式,默认'HH:mm:ss' */
|
|
919
|
+
timeFormat?: string;
|
|
920
|
+
/** 是否显示为24小时制 */
|
|
921
|
+
is24Hour?: boolean;
|
|
922
|
+
/** 是否显示毫秒 */
|
|
923
|
+
showMilliseconds?: boolean;
|
|
924
|
+
/** 占位符文本,默认'-' */
|
|
925
|
+
placeholder?: string;
|
|
926
|
+
/** 文本对齐方式 */
|
|
927
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
928
|
+
/** 字体大小 */
|
|
929
|
+
fontSize?: number;
|
|
930
|
+
/** 字体颜色 */
|
|
931
|
+
color?: string;
|
|
932
|
+
/** 背景颜色 */
|
|
933
|
+
backgroundColor?: string;
|
|
934
|
+
/** 计时器状态 */
|
|
935
|
+
timerState?: {
|
|
936
|
+
/** 计时器ID */
|
|
937
|
+
timerId: number | null;
|
|
938
|
+
/** 开始时间戳 */
|
|
939
|
+
startTime: number | null;
|
|
940
|
+
/** 当前显示时间 */
|
|
941
|
+
currentTime: string;
|
|
942
|
+
/** 计时器状态 */
|
|
943
|
+
status: 'start' | 'pause';
|
|
944
|
+
/** 是否正在计时 */
|
|
945
|
+
isTiming: boolean;
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* 优先级文本 viewer 数据
|
|
950
|
+
* 用于展示优先级标签(P0-P4+),带有对应的颜色和背景色
|
|
951
|
+
*/
|
|
952
|
+
export interface PriorityTextViewerData extends CellViewerData {
|
|
953
|
+
/** 优先级值,支持数字或字符串(如 0, 1, 2, '0', '1') */
|
|
954
|
+
value: string | number | null;
|
|
955
|
+
/** 文本对齐方式,默认 'center' */
|
|
956
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
957
|
+
/** 标签圆角半径,默认 2 */
|
|
958
|
+
tagRadius?: number;
|
|
959
|
+
/** 占位符文本,默认 '-' */
|
|
960
|
+
placeholder?: string;
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* 状态枚举项
|
|
964
|
+
*/
|
|
965
|
+
export interface StatusTextEnum {
|
|
966
|
+
/** 状态值标识(如 'toStart', 'inProgress', 'complete') */
|
|
967
|
+
value: string;
|
|
968
|
+
/** 状态显示名称(如 '未开始', '进行中', '已完成') */
|
|
969
|
+
name: string;
|
|
970
|
+
/** 文字颜色 */
|
|
971
|
+
color: string;
|
|
972
|
+
/** 图标类型('circle' | 'pause' | 'progress' | 'check' 或自定义字符串) */
|
|
973
|
+
icon: string;
|
|
974
|
+
/** 图标颜色 */
|
|
975
|
+
iconColor: string;
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* 状态文本 viewer 数据
|
|
979
|
+
* 用于展示状态标签(图标 + 状态名称),如 [●] 进行中
|
|
980
|
+
*/
|
|
981
|
+
export interface StatusTextViewerData extends CellViewerData {
|
|
982
|
+
/** 状态名称(匹配 statusList 中的 name 字段) */
|
|
983
|
+
value: string | null;
|
|
984
|
+
/** 自定义状态枚举列表,不传则使用默认状态列表 */
|
|
985
|
+
statusList?: StatusTextEnum[];
|
|
986
|
+
/** 是否显示图标,默认 true */
|
|
987
|
+
showIcon?: boolean;
|
|
988
|
+
/** 图标大小,默认 14 */
|
|
989
|
+
iconSize?: number;
|
|
990
|
+
/** 是否显示角标指示器,默认 false */
|
|
991
|
+
showCorner?: boolean;
|
|
992
|
+
/** 额外信息(当存在时且 showCorner 为 true 显示角标) */
|
|
993
|
+
extraInfo?: Record<string, any>;
|
|
994
|
+
/** 占位符文本,默认 '-' */
|
|
995
|
+
placeholder?: string;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* 主题项信息
|
|
999
|
+
*/
|
|
1000
|
+
export interface ThemeItem {
|
|
1001
|
+
/** 主题唯一标识 */
|
|
1002
|
+
id: string;
|
|
1003
|
+
/** 主题显示标题 */
|
|
1004
|
+
title: string;
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* 主题文本 viewer 数据
|
|
1008
|
+
* 用于展示主题标签(图标 + 主题名称 + 后缀),如 [🎨] 主题A 等2个
|
|
1009
|
+
*/
|
|
1010
|
+
export interface ThemeViewerData extends CellViewerData {
|
|
1011
|
+
/** 主题列表,支持 ThemeItem[] 或 string[] */
|
|
1012
|
+
value: ThemeItem[] | string[] | null;
|
|
1013
|
+
/** 是否显示图标,默认 true */
|
|
1014
|
+
showIcon?: boolean;
|
|
1015
|
+
/** 图标大小,默认 14 */
|
|
1016
|
+
iconSize?: number;
|
|
1017
|
+
/** 图标颜色,默认 '#8c8c8c' */
|
|
1018
|
+
iconColor?: string;
|
|
1019
|
+
/** 后缀文字颜色,默认 '#999' */
|
|
1020
|
+
suffixColor?: string;
|
|
1021
|
+
/** 占位符文本,默认 '-' */
|
|
1022
|
+
placeholder?: string;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* 交付物审核文件项
|
|
1026
|
+
*/
|
|
1027
|
+
export interface DeliverableReviewItem {
|
|
1028
|
+
/** 文件名 */
|
|
1029
|
+
name: string;
|
|
1030
|
+
/** 文件格式/后缀 */
|
|
1031
|
+
file_format?: string;
|
|
1032
|
+
/** 预览图片 URL */
|
|
1033
|
+
preview_url?: string;
|
|
1034
|
+
/** 资产 ID */
|
|
1035
|
+
asset_id?: number;
|
|
1036
|
+
/** 审核 ID(> 0 表示为审核类型文件) */
|
|
1037
|
+
review_id?: number;
|
|
1038
|
+
/** 是否为审核类型 */
|
|
1039
|
+
isReview?: boolean;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* 交付物审核 viewer 数据
|
|
1043
|
+
* 用于展示交付物审核文件列表(审核图标 + 文件名)
|
|
1044
|
+
*/
|
|
1045
|
+
export interface DeliverableReviewViewerData extends CellViewerData {
|
|
1046
|
+
/** 审核文件列表 */
|
|
1047
|
+
value: DeliverableReviewItem[] | null;
|
|
1048
|
+
/** 数据行 ID */
|
|
1049
|
+
id?: string | number;
|
|
1050
|
+
/** 属性 key */
|
|
1051
|
+
key?: string;
|
|
1052
|
+
/** 是否可编辑 */
|
|
1053
|
+
canEdit?: boolean;
|
|
1054
|
+
/** 是否显示删除线 */
|
|
1055
|
+
showLineThrow?: boolean;
|
|
1056
|
+
/** 是否关联属性 */
|
|
1057
|
+
isLink?: boolean;
|
|
1058
|
+
/** 关联 key */
|
|
1059
|
+
linkKey?: string;
|
|
1060
|
+
/** 文件元数据 key */
|
|
1061
|
+
fileMeta?: string;
|
|
1062
|
+
/** 是否有错误 */
|
|
1063
|
+
error?: {
|
|
1064
|
+
errorProperty?: string;
|
|
1065
|
+
errorMessage?: string;
|
|
1066
|
+
} | null;
|
|
1067
|
+
/** 占位符文本,默认 '-' */
|
|
1068
|
+
placeholder?: string;
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* 富文本 viewer 数据
|
|
1072
|
+
* 用于展示富文本内容,去除 HTML 标签后渲染纯文本
|
|
1073
|
+
* <img> 标签显示为 [图片],<video> 标签显示为 [视频]
|
|
1074
|
+
*/
|
|
1075
|
+
export interface RichTextViewerData extends CellViewerData {
|
|
1076
|
+
/** HTML 富文本内容或纯文本 */
|
|
1077
|
+
value: string | null;
|
|
1078
|
+
/** 数据行 ID */
|
|
1079
|
+
id?: string | number;
|
|
1080
|
+
/** 属性 key */
|
|
1081
|
+
key?: string;
|
|
1082
|
+
/** 是否可编辑 */
|
|
1083
|
+
canEdit?: boolean;
|
|
1084
|
+
/** 是否显示删除线 */
|
|
1085
|
+
showLineThrow?: boolean;
|
|
1086
|
+
/** 是否关联属性 */
|
|
1087
|
+
isLink?: boolean;
|
|
1088
|
+
/** 关联 key */
|
|
1089
|
+
linkKey?: string;
|
|
1090
|
+
/** 是否有错误 */
|
|
1091
|
+
error?: {
|
|
1092
|
+
errorProperty?: string;
|
|
1093
|
+
errorMessage?: string;
|
|
1094
|
+
} | null;
|
|
1095
|
+
/** 占位符文本,默认 '-' */
|
|
1096
|
+
placeholder?: string;
|
|
1097
|
+
}
|