@stonecrop/atable 0.4.12 → 0.4.13
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/dist/assets/index.css +1 -1
- package/dist/atable.d.ts +415 -111
- package/dist/atable.js +854 -825
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/stores/table.d.ts +110 -83
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +303 -28
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/stores/table.js +19 -1
- package/package.json +3 -3
- package/src/components/AGanttCell.vue +26 -20
- package/src/components/ATable.vue +39 -11
- package/src/index.ts +2 -0
- package/src/stores/table.ts +27 -2
- package/src/types/index.ts +330 -24
package/dist/atable.d.ts
CHANGED
|
@@ -36,13 +36,22 @@ export { ATableModal }
|
|
|
36
36
|
* Table cell context definition.
|
|
37
37
|
* @public
|
|
38
38
|
*/
|
|
39
|
-
export declare
|
|
39
|
+
export declare interface CellContext {
|
|
40
|
+
/**
|
|
41
|
+
* The row object for the current cell.
|
|
42
|
+
*/
|
|
40
43
|
row: TableRow;
|
|
44
|
+
/**
|
|
45
|
+
* The column object for the current cell.
|
|
46
|
+
*/
|
|
41
47
|
column: TableColumn;
|
|
48
|
+
/**
|
|
49
|
+
* The table object for the current cell.
|
|
50
|
+
*/
|
|
42
51
|
table: {
|
|
43
52
|
[key: string]: any;
|
|
44
53
|
};
|
|
45
|
-
}
|
|
54
|
+
}
|
|
46
55
|
|
|
47
56
|
/**
|
|
48
57
|
* Create a table store
|
|
@@ -69,16 +78,16 @@ label?: string | undefined;
|
|
|
69
78
|
type?: string | undefined;
|
|
70
79
|
width?: string | undefined;
|
|
71
80
|
pinned?: boolean | undefined;
|
|
72
|
-
colspan?: number | undefined;
|
|
73
|
-
ganttComponent?: string | undefined;
|
|
74
|
-
isGantt?: boolean | undefined;
|
|
75
|
-
originalIndex?: number | undefined;
|
|
76
81
|
cellComponent?: string | undefined;
|
|
77
82
|
cellComponentProps?: Record<string, any> | undefined;
|
|
78
83
|
modalComponent?: (string | ((context: CellContext) => string)) | undefined;
|
|
79
84
|
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
80
85
|
format?: (string | ((value: any, context: CellContext) => string)) | undefined;
|
|
81
86
|
mask?: ((value: any) => any) | undefined;
|
|
87
|
+
isGantt?: boolean | undefined;
|
|
88
|
+
ganttComponent?: string | undefined;
|
|
89
|
+
colspan?: number | undefined;
|
|
90
|
+
originalIndex?: number | undefined;
|
|
82
91
|
}[], TableColumn[] | {
|
|
83
92
|
name: string;
|
|
84
93
|
align?: CanvasTextAlign | undefined;
|
|
@@ -87,16 +96,16 @@ label?: string | undefined;
|
|
|
87
96
|
type?: string | undefined;
|
|
88
97
|
width?: string | undefined;
|
|
89
98
|
pinned?: boolean | undefined;
|
|
90
|
-
colspan?: number | undefined;
|
|
91
|
-
ganttComponent?: string | undefined;
|
|
92
|
-
isGantt?: boolean | undefined;
|
|
93
|
-
originalIndex?: number | undefined;
|
|
94
99
|
cellComponent?: string | undefined;
|
|
95
100
|
cellComponentProps?: Record<string, any> | undefined;
|
|
96
101
|
modalComponent?: (string | ((context: CellContext) => string)) | undefined;
|
|
97
102
|
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
98
103
|
format?: (string | ((value: any, context: CellContext) => string)) | undefined;
|
|
99
104
|
mask?: ((value: any) => any) | undefined;
|
|
105
|
+
isGantt?: boolean | undefined;
|
|
106
|
+
ganttComponent?: string | undefined;
|
|
107
|
+
colspan?: number | undefined;
|
|
108
|
+
originalIndex?: number | undefined;
|
|
100
109
|
}[]>;
|
|
101
110
|
config: Ref< {
|
|
102
111
|
view?: ("uncounted" | "list" | "list-expansion" | "tree" | "gantt") | undefined;
|
|
@@ -106,61 +115,69 @@ view?: ("uncounted" | "list" | "list-expansion" | "tree" | "gantt") | undefined;
|
|
|
106
115
|
fullWidth?: boolean | undefined;
|
|
107
116
|
}>;
|
|
108
117
|
display: Ref< {
|
|
109
|
-
childrenOpen?: boolean | undefined;
|
|
110
118
|
expanded?: boolean | undefined;
|
|
111
|
-
|
|
119
|
+
childrenOpen?: boolean | undefined;
|
|
112
120
|
isParent?: boolean | undefined;
|
|
113
121
|
isRoot?: boolean | undefined;
|
|
114
122
|
open?: boolean | undefined;
|
|
123
|
+
indent?: number | undefined;
|
|
115
124
|
parent?: number | undefined;
|
|
116
125
|
rowModified?: boolean | undefined;
|
|
117
126
|
}[], TableDisplay[] | {
|
|
118
|
-
childrenOpen?: boolean | undefined;
|
|
119
127
|
expanded?: boolean | undefined;
|
|
120
|
-
|
|
128
|
+
childrenOpen?: boolean | undefined;
|
|
121
129
|
isParent?: boolean | undefined;
|
|
122
130
|
isRoot?: boolean | undefined;
|
|
123
131
|
open?: boolean | undefined;
|
|
132
|
+
indent?: number | undefined;
|
|
124
133
|
parent?: number | undefined;
|
|
125
134
|
rowModified?: boolean | undefined;
|
|
126
135
|
}[]>;
|
|
127
136
|
modal: Ref< {
|
|
128
|
-
|
|
137
|
+
visible?: boolean | undefined;
|
|
129
138
|
cell?: (HTMLTableCellElement | null) | undefined;
|
|
130
|
-
colIndex?: number | undefined;
|
|
131
|
-
event?: string | undefined;
|
|
132
|
-
height?: number | undefined;
|
|
133
|
-
left?: number | undefined;
|
|
134
139
|
parent?: HTMLElement | undefined;
|
|
140
|
+
colIndex?: number | undefined;
|
|
135
141
|
rowIndex?: number | undefined;
|
|
136
|
-
visible?: boolean | undefined;
|
|
137
|
-
width?: number | undefined;
|
|
138
142
|
component?: string | undefined;
|
|
139
143
|
componentProps?: Record<string, any> | undefined;
|
|
140
|
-
}, TableModal | {
|
|
141
144
|
bottom?: number | undefined;
|
|
142
|
-
cell?: (HTMLTableCellElement | null) | undefined;
|
|
143
|
-
colIndex?: number | undefined;
|
|
144
|
-
event?: string | undefined;
|
|
145
145
|
height?: number | undefined;
|
|
146
146
|
left?: number | undefined;
|
|
147
|
+
width?: number | undefined;
|
|
148
|
+
}, TableModal | {
|
|
149
|
+
visible?: boolean | undefined;
|
|
150
|
+
cell?: (HTMLTableCellElement | null) | undefined;
|
|
147
151
|
parent?: HTMLElement | undefined;
|
|
152
|
+
colIndex?: number | undefined;
|
|
148
153
|
rowIndex?: number | undefined;
|
|
149
|
-
visible?: boolean | undefined;
|
|
150
|
-
width?: number | undefined;
|
|
151
154
|
component?: string | undefined;
|
|
152
155
|
componentProps?: Record<string, any> | undefined;
|
|
156
|
+
bottom?: number | undefined;
|
|
157
|
+
height?: number | undefined;
|
|
158
|
+
left?: number | undefined;
|
|
159
|
+
width?: number | undefined;
|
|
153
160
|
}>;
|
|
154
161
|
rows: Ref< {
|
|
155
162
|
[x: string]: any;
|
|
156
163
|
indent?: number | undefined;
|
|
157
164
|
parent?: number | undefined;
|
|
158
|
-
|
|
165
|
+
gantt?: {
|
|
166
|
+
color?: string | undefined;
|
|
167
|
+
startIndex?: number | undefined;
|
|
168
|
+
endIndex?: number | undefined;
|
|
169
|
+
colspan?: number | undefined;
|
|
170
|
+
} | undefined;
|
|
159
171
|
}[], TableRow[] | {
|
|
160
172
|
[x: string]: any;
|
|
161
173
|
indent?: number | undefined;
|
|
162
174
|
parent?: number | undefined;
|
|
163
|
-
|
|
175
|
+
gantt?: {
|
|
176
|
+
color?: string | undefined;
|
|
177
|
+
startIndex?: number | undefined;
|
|
178
|
+
endIndex?: number | undefined;
|
|
179
|
+
colspan?: number | undefined;
|
|
180
|
+
} | undefined;
|
|
164
181
|
}[]>;
|
|
165
182
|
table: Ref< {}, {}>;
|
|
166
183
|
updates: Ref<Record<string, string>, Record<string, string>>;
|
|
@@ -179,6 +196,7 @@ isRowVisible: (rowIndex: number) => boolean | undefined;
|
|
|
179
196
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
180
197
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
181
198
|
toggleRowExpand: (rowIndex: number) => void;
|
|
199
|
+
updateGanttBar: (event: GanttDragEvent) => void;
|
|
182
200
|
}, "columns" | "config" | "display" | "modal" | "rows" | "table" | "updates">, Pick<{
|
|
183
201
|
columns: Ref< {
|
|
184
202
|
name: string;
|
|
@@ -188,16 +206,16 @@ label?: string | undefined;
|
|
|
188
206
|
type?: string | undefined;
|
|
189
207
|
width?: string | undefined;
|
|
190
208
|
pinned?: boolean | undefined;
|
|
191
|
-
colspan?: number | undefined;
|
|
192
|
-
ganttComponent?: string | undefined;
|
|
193
|
-
isGantt?: boolean | undefined;
|
|
194
|
-
originalIndex?: number | undefined;
|
|
195
209
|
cellComponent?: string | undefined;
|
|
196
210
|
cellComponentProps?: Record<string, any> | undefined;
|
|
197
211
|
modalComponent?: (string | ((context: CellContext) => string)) | undefined;
|
|
198
212
|
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
199
213
|
format?: (string | ((value: any, context: CellContext) => string)) | undefined;
|
|
200
214
|
mask?: ((value: any) => any) | undefined;
|
|
215
|
+
isGantt?: boolean | undefined;
|
|
216
|
+
ganttComponent?: string | undefined;
|
|
217
|
+
colspan?: number | undefined;
|
|
218
|
+
originalIndex?: number | undefined;
|
|
201
219
|
}[], TableColumn[] | {
|
|
202
220
|
name: string;
|
|
203
221
|
align?: CanvasTextAlign | undefined;
|
|
@@ -206,16 +224,16 @@ label?: string | undefined;
|
|
|
206
224
|
type?: string | undefined;
|
|
207
225
|
width?: string | undefined;
|
|
208
226
|
pinned?: boolean | undefined;
|
|
209
|
-
colspan?: number | undefined;
|
|
210
|
-
ganttComponent?: string | undefined;
|
|
211
|
-
isGantt?: boolean | undefined;
|
|
212
|
-
originalIndex?: number | undefined;
|
|
213
227
|
cellComponent?: string | undefined;
|
|
214
228
|
cellComponentProps?: Record<string, any> | undefined;
|
|
215
229
|
modalComponent?: (string | ((context: CellContext) => string)) | undefined;
|
|
216
230
|
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
217
231
|
format?: (string | ((value: any, context: CellContext) => string)) | undefined;
|
|
218
232
|
mask?: ((value: any) => any) | undefined;
|
|
233
|
+
isGantt?: boolean | undefined;
|
|
234
|
+
ganttComponent?: string | undefined;
|
|
235
|
+
colspan?: number | undefined;
|
|
236
|
+
originalIndex?: number | undefined;
|
|
219
237
|
}[]>;
|
|
220
238
|
config: Ref< {
|
|
221
239
|
view?: ("uncounted" | "list" | "list-expansion" | "tree" | "gantt") | undefined;
|
|
@@ -225,61 +243,69 @@ view?: ("uncounted" | "list" | "list-expansion" | "tree" | "gantt") | undefined;
|
|
|
225
243
|
fullWidth?: boolean | undefined;
|
|
226
244
|
}>;
|
|
227
245
|
display: Ref< {
|
|
228
|
-
childrenOpen?: boolean | undefined;
|
|
229
246
|
expanded?: boolean | undefined;
|
|
230
|
-
|
|
247
|
+
childrenOpen?: boolean | undefined;
|
|
231
248
|
isParent?: boolean | undefined;
|
|
232
249
|
isRoot?: boolean | undefined;
|
|
233
250
|
open?: boolean | undefined;
|
|
251
|
+
indent?: number | undefined;
|
|
234
252
|
parent?: number | undefined;
|
|
235
253
|
rowModified?: boolean | undefined;
|
|
236
254
|
}[], TableDisplay[] | {
|
|
237
|
-
childrenOpen?: boolean | undefined;
|
|
238
255
|
expanded?: boolean | undefined;
|
|
239
|
-
|
|
256
|
+
childrenOpen?: boolean | undefined;
|
|
240
257
|
isParent?: boolean | undefined;
|
|
241
258
|
isRoot?: boolean | undefined;
|
|
242
259
|
open?: boolean | undefined;
|
|
260
|
+
indent?: number | undefined;
|
|
243
261
|
parent?: number | undefined;
|
|
244
262
|
rowModified?: boolean | undefined;
|
|
245
263
|
}[]>;
|
|
246
264
|
modal: Ref< {
|
|
247
|
-
|
|
265
|
+
visible?: boolean | undefined;
|
|
248
266
|
cell?: (HTMLTableCellElement | null) | undefined;
|
|
249
|
-
colIndex?: number | undefined;
|
|
250
|
-
event?: string | undefined;
|
|
251
|
-
height?: number | undefined;
|
|
252
|
-
left?: number | undefined;
|
|
253
267
|
parent?: HTMLElement | undefined;
|
|
268
|
+
colIndex?: number | undefined;
|
|
254
269
|
rowIndex?: number | undefined;
|
|
255
|
-
visible?: boolean | undefined;
|
|
256
|
-
width?: number | undefined;
|
|
257
270
|
component?: string | undefined;
|
|
258
271
|
componentProps?: Record<string, any> | undefined;
|
|
259
|
-
}, TableModal | {
|
|
260
272
|
bottom?: number | undefined;
|
|
261
|
-
cell?: (HTMLTableCellElement | null) | undefined;
|
|
262
|
-
colIndex?: number | undefined;
|
|
263
|
-
event?: string | undefined;
|
|
264
273
|
height?: number | undefined;
|
|
265
274
|
left?: number | undefined;
|
|
275
|
+
width?: number | undefined;
|
|
276
|
+
}, TableModal | {
|
|
277
|
+
visible?: boolean | undefined;
|
|
278
|
+
cell?: (HTMLTableCellElement | null) | undefined;
|
|
266
279
|
parent?: HTMLElement | undefined;
|
|
280
|
+
colIndex?: number | undefined;
|
|
267
281
|
rowIndex?: number | undefined;
|
|
268
|
-
visible?: boolean | undefined;
|
|
269
|
-
width?: number | undefined;
|
|
270
282
|
component?: string | undefined;
|
|
271
283
|
componentProps?: Record<string, any> | undefined;
|
|
284
|
+
bottom?: number | undefined;
|
|
285
|
+
height?: number | undefined;
|
|
286
|
+
left?: number | undefined;
|
|
287
|
+
width?: number | undefined;
|
|
272
288
|
}>;
|
|
273
289
|
rows: Ref< {
|
|
274
290
|
[x: string]: any;
|
|
275
291
|
indent?: number | undefined;
|
|
276
292
|
parent?: number | undefined;
|
|
277
|
-
|
|
293
|
+
gantt?: {
|
|
294
|
+
color?: string | undefined;
|
|
295
|
+
startIndex?: number | undefined;
|
|
296
|
+
endIndex?: number | undefined;
|
|
297
|
+
colspan?: number | undefined;
|
|
298
|
+
} | undefined;
|
|
278
299
|
}[], TableRow[] | {
|
|
279
300
|
[x: string]: any;
|
|
280
301
|
indent?: number | undefined;
|
|
281
302
|
parent?: number | undefined;
|
|
282
|
-
|
|
303
|
+
gantt?: {
|
|
304
|
+
color?: string | undefined;
|
|
305
|
+
startIndex?: number | undefined;
|
|
306
|
+
endIndex?: number | undefined;
|
|
307
|
+
colspan?: number | undefined;
|
|
308
|
+
} | undefined;
|
|
283
309
|
}[]>;
|
|
284
310
|
table: Ref< {}, {}>;
|
|
285
311
|
updates: Ref<Record<string, string>, Record<string, string>>;
|
|
@@ -298,6 +324,7 @@ isRowVisible: (rowIndex: number) => boolean | undefined;
|
|
|
298
324
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
299
325
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
300
326
|
toggleRowExpand: (rowIndex: number) => void;
|
|
327
|
+
updateGanttBar: (event: GanttDragEvent) => void;
|
|
301
328
|
}, "hasPinnedColumns" | "numberedRowWidth" | "zeroColumn">, Pick<{
|
|
302
329
|
columns: Ref< {
|
|
303
330
|
name: string;
|
|
@@ -307,16 +334,16 @@ label?: string | undefined;
|
|
|
307
334
|
type?: string | undefined;
|
|
308
335
|
width?: string | undefined;
|
|
309
336
|
pinned?: boolean | undefined;
|
|
310
|
-
colspan?: number | undefined;
|
|
311
|
-
ganttComponent?: string | undefined;
|
|
312
|
-
isGantt?: boolean | undefined;
|
|
313
|
-
originalIndex?: number | undefined;
|
|
314
337
|
cellComponent?: string | undefined;
|
|
315
338
|
cellComponentProps?: Record<string, any> | undefined;
|
|
316
339
|
modalComponent?: (string | ((context: CellContext) => string)) | undefined;
|
|
317
340
|
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
318
341
|
format?: (string | ((value: any, context: CellContext) => string)) | undefined;
|
|
319
342
|
mask?: ((value: any) => any) | undefined;
|
|
343
|
+
isGantt?: boolean | undefined;
|
|
344
|
+
ganttComponent?: string | undefined;
|
|
345
|
+
colspan?: number | undefined;
|
|
346
|
+
originalIndex?: number | undefined;
|
|
320
347
|
}[], TableColumn[] | {
|
|
321
348
|
name: string;
|
|
322
349
|
align?: CanvasTextAlign | undefined;
|
|
@@ -325,16 +352,16 @@ label?: string | undefined;
|
|
|
325
352
|
type?: string | undefined;
|
|
326
353
|
width?: string | undefined;
|
|
327
354
|
pinned?: boolean | undefined;
|
|
328
|
-
colspan?: number | undefined;
|
|
329
|
-
ganttComponent?: string | undefined;
|
|
330
|
-
isGantt?: boolean | undefined;
|
|
331
|
-
originalIndex?: number | undefined;
|
|
332
355
|
cellComponent?: string | undefined;
|
|
333
356
|
cellComponentProps?: Record<string, any> | undefined;
|
|
334
357
|
modalComponent?: (string | ((context: CellContext) => string)) | undefined;
|
|
335
358
|
modalComponentExtraProps?: Record<string, any> | undefined;
|
|
336
359
|
format?: (string | ((value: any, context: CellContext) => string)) | undefined;
|
|
337
360
|
mask?: ((value: any) => any) | undefined;
|
|
361
|
+
isGantt?: boolean | undefined;
|
|
362
|
+
ganttComponent?: string | undefined;
|
|
363
|
+
colspan?: number | undefined;
|
|
364
|
+
originalIndex?: number | undefined;
|
|
338
365
|
}[]>;
|
|
339
366
|
config: Ref< {
|
|
340
367
|
view?: ("uncounted" | "list" | "list-expansion" | "tree" | "gantt") | undefined;
|
|
@@ -344,61 +371,69 @@ view?: ("uncounted" | "list" | "list-expansion" | "tree" | "gantt") | undefined;
|
|
|
344
371
|
fullWidth?: boolean | undefined;
|
|
345
372
|
}>;
|
|
346
373
|
display: Ref< {
|
|
347
|
-
childrenOpen?: boolean | undefined;
|
|
348
374
|
expanded?: boolean | undefined;
|
|
349
|
-
|
|
375
|
+
childrenOpen?: boolean | undefined;
|
|
350
376
|
isParent?: boolean | undefined;
|
|
351
377
|
isRoot?: boolean | undefined;
|
|
352
378
|
open?: boolean | undefined;
|
|
379
|
+
indent?: number | undefined;
|
|
353
380
|
parent?: number | undefined;
|
|
354
381
|
rowModified?: boolean | undefined;
|
|
355
382
|
}[], TableDisplay[] | {
|
|
356
|
-
childrenOpen?: boolean | undefined;
|
|
357
383
|
expanded?: boolean | undefined;
|
|
358
|
-
|
|
384
|
+
childrenOpen?: boolean | undefined;
|
|
359
385
|
isParent?: boolean | undefined;
|
|
360
386
|
isRoot?: boolean | undefined;
|
|
361
387
|
open?: boolean | undefined;
|
|
388
|
+
indent?: number | undefined;
|
|
362
389
|
parent?: number | undefined;
|
|
363
390
|
rowModified?: boolean | undefined;
|
|
364
391
|
}[]>;
|
|
365
392
|
modal: Ref< {
|
|
366
|
-
|
|
393
|
+
visible?: boolean | undefined;
|
|
367
394
|
cell?: (HTMLTableCellElement | null) | undefined;
|
|
368
|
-
colIndex?: number | undefined;
|
|
369
|
-
event?: string | undefined;
|
|
370
|
-
height?: number | undefined;
|
|
371
|
-
left?: number | undefined;
|
|
372
395
|
parent?: HTMLElement | undefined;
|
|
396
|
+
colIndex?: number | undefined;
|
|
373
397
|
rowIndex?: number | undefined;
|
|
374
|
-
visible?: boolean | undefined;
|
|
375
|
-
width?: number | undefined;
|
|
376
398
|
component?: string | undefined;
|
|
377
399
|
componentProps?: Record<string, any> | undefined;
|
|
378
|
-
}, TableModal | {
|
|
379
400
|
bottom?: number | undefined;
|
|
380
|
-
cell?: (HTMLTableCellElement | null) | undefined;
|
|
381
|
-
colIndex?: number | undefined;
|
|
382
|
-
event?: string | undefined;
|
|
383
401
|
height?: number | undefined;
|
|
384
402
|
left?: number | undefined;
|
|
403
|
+
width?: number | undefined;
|
|
404
|
+
}, TableModal | {
|
|
405
|
+
visible?: boolean | undefined;
|
|
406
|
+
cell?: (HTMLTableCellElement | null) | undefined;
|
|
385
407
|
parent?: HTMLElement | undefined;
|
|
408
|
+
colIndex?: number | undefined;
|
|
386
409
|
rowIndex?: number | undefined;
|
|
387
|
-
visible?: boolean | undefined;
|
|
388
|
-
width?: number | undefined;
|
|
389
410
|
component?: string | undefined;
|
|
390
411
|
componentProps?: Record<string, any> | undefined;
|
|
412
|
+
bottom?: number | undefined;
|
|
413
|
+
height?: number | undefined;
|
|
414
|
+
left?: number | undefined;
|
|
415
|
+
width?: number | undefined;
|
|
391
416
|
}>;
|
|
392
417
|
rows: Ref< {
|
|
393
418
|
[x: string]: any;
|
|
394
419
|
indent?: number | undefined;
|
|
395
420
|
parent?: number | undefined;
|
|
396
|
-
|
|
421
|
+
gantt?: {
|
|
422
|
+
color?: string | undefined;
|
|
423
|
+
startIndex?: number | undefined;
|
|
424
|
+
endIndex?: number | undefined;
|
|
425
|
+
colspan?: number | undefined;
|
|
426
|
+
} | undefined;
|
|
397
427
|
}[], TableRow[] | {
|
|
398
428
|
[x: string]: any;
|
|
399
429
|
indent?: number | undefined;
|
|
400
430
|
parent?: number | undefined;
|
|
401
|
-
|
|
431
|
+
gantt?: {
|
|
432
|
+
color?: string | undefined;
|
|
433
|
+
startIndex?: number | undefined;
|
|
434
|
+
endIndex?: number | undefined;
|
|
435
|
+
colspan?: number | undefined;
|
|
436
|
+
} | undefined;
|
|
402
437
|
}[]>;
|
|
403
438
|
table: Ref< {}, {}>;
|
|
404
439
|
updates: Ref<Record<string, string>, Record<string, string>>;
|
|
@@ -417,7 +452,51 @@ isRowVisible: (rowIndex: number) => boolean | undefined;
|
|
|
417
452
|
setCellData: (colIndex: number, rowIndex: number, value: any) => void;
|
|
418
453
|
setCellText: (colIndex: number, rowIndex: number, value: string) => void;
|
|
419
454
|
toggleRowExpand: (rowIndex: number) => void;
|
|
420
|
-
|
|
455
|
+
updateGanttBar: (event: GanttDragEvent) => void;
|
|
456
|
+
}, "closeModal" | "getCellData" | "getCellDisplayValue" | "getFormattedValue" | "getHeaderCellStyle" | "getIndent" | "getRowExpandSymbol" | "isRowGantt" | "isRowVisible" | "setCellData" | "setCellText" | "toggleRowExpand" | "updateGanttBar">>;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Gantt table drag event definition.
|
|
460
|
+
* @public
|
|
461
|
+
*/
|
|
462
|
+
export declare type GanttDragEvent = {
|
|
463
|
+
rowIndex: number;
|
|
464
|
+
colIndex: number;
|
|
465
|
+
type: 'bar';
|
|
466
|
+
start: number;
|
|
467
|
+
end: number;
|
|
468
|
+
} | {
|
|
469
|
+
rowIndex: number;
|
|
470
|
+
colIndex: number;
|
|
471
|
+
type: 'resize';
|
|
472
|
+
edge: 'start' | 'end';
|
|
473
|
+
value: number;
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* This interface defines the options for a row when it is being viewed as a Gantt chart.
|
|
478
|
+
* @public
|
|
479
|
+
*/
|
|
480
|
+
export declare interface GanttOptions {
|
|
481
|
+
/**
|
|
482
|
+
* The colour to be applied to the row's gantt bar.
|
|
483
|
+
*/
|
|
484
|
+
color?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The starting column index for the gantt bar.
|
|
487
|
+
*/
|
|
488
|
+
startIndex?: number;
|
|
489
|
+
/**
|
|
490
|
+
* The ending column index for the gantt bar. If the endIndex and colspan are not provided,
|
|
491
|
+
* the bar will stretch to the end of the table.
|
|
492
|
+
*/
|
|
493
|
+
endIndex?: number;
|
|
494
|
+
/**
|
|
495
|
+
* The length of the gantt bar. Useful when only the start index is provided. If the
|
|
496
|
+
* colspan and endIndex are not provided, the bar will stretch to the end of the table.
|
|
497
|
+
*/
|
|
498
|
+
colspan?: number;
|
|
499
|
+
}
|
|
421
500
|
|
|
422
501
|
/**
|
|
423
502
|
* Install all ATable components
|
|
@@ -430,19 +509,67 @@ export declare function install(app: App): void;
|
|
|
430
509
|
* Table column definition.
|
|
431
510
|
* @public
|
|
432
511
|
*/
|
|
433
|
-
export declare
|
|
512
|
+
export declare interface TableColumn {
|
|
513
|
+
/**
|
|
514
|
+
* The key of the column. This is used to identify the column in the table.
|
|
515
|
+
*/
|
|
434
516
|
name: string;
|
|
517
|
+
/**
|
|
518
|
+
* The alignment of the column. Possible values:
|
|
519
|
+
* - `left` - left aligned
|
|
520
|
+
* - `center` - center aligned
|
|
521
|
+
* - `right` - right aligned
|
|
522
|
+
* - `start` - aligned to the start of the column
|
|
523
|
+
* - `end` - aligned to the end of the column
|
|
524
|
+
*
|
|
525
|
+
* @defaultValue 'center'
|
|
526
|
+
*/
|
|
435
527
|
align?: CanvasTextAlign;
|
|
528
|
+
/**
|
|
529
|
+
* Control whether cells for the column is editable.
|
|
530
|
+
*
|
|
531
|
+
* @defaultValue false
|
|
532
|
+
*/
|
|
436
533
|
edit?: boolean;
|
|
534
|
+
/**
|
|
535
|
+
* The label of the column. This is displayed in the table header.
|
|
536
|
+
*
|
|
537
|
+
* @defaultValue If no label is provided, a character will be assigned alphabetically,
|
|
538
|
+
* starting from 'A' for the first column, 'B' for the second column, and so on.
|
|
539
|
+
*/
|
|
437
540
|
label?: string;
|
|
541
|
+
/**
|
|
542
|
+
* The data-type of the column. Possible values:
|
|
543
|
+
* - `Data` - the column contains text data
|
|
544
|
+
* - `Select` - the column contains a select input
|
|
545
|
+
* - `Date` - the column contains a date input
|
|
546
|
+
* - `component` - the column contains a custom component
|
|
547
|
+
*
|
|
548
|
+
* @beta
|
|
549
|
+
*/
|
|
438
550
|
type?: string;
|
|
551
|
+
/**
|
|
552
|
+
* The width of the column. This can be a number (in pixels) or a string (in CSS units).
|
|
553
|
+
*
|
|
554
|
+
* @defaultValue '40ch'
|
|
555
|
+
*/
|
|
439
556
|
width?: string;
|
|
557
|
+
/**
|
|
558
|
+
* Control whether the column should be pinned to the table.
|
|
559
|
+
*
|
|
560
|
+
* @defaultValue false
|
|
561
|
+
*/
|
|
440
562
|
pinned?: boolean;
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
563
|
+
/**
|
|
564
|
+
* The component to use to render the cell for the column. If not provided, the table will
|
|
565
|
+
* render the default `<td>` element.
|
|
566
|
+
*/
|
|
445
567
|
cellComponent?: string;
|
|
568
|
+
/**
|
|
569
|
+
* Additional properties to pass to the table's cell component.
|
|
570
|
+
*
|
|
571
|
+
* Only applicable if the `cellComponent` property is set for the column.
|
|
572
|
+
*/
|
|
446
573
|
cellComponentProps?: Record<string, any>;
|
|
447
574
|
/**
|
|
448
575
|
* The component to use for the modal. If a function is provided, it will be called with the cell context.
|
|
@@ -459,16 +586,63 @@ export declare type TableColumn = {
|
|
|
459
586
|
* - `store` - the table data store
|
|
460
587
|
*/
|
|
461
588
|
modalComponent?: string | ((context: CellContext) => string);
|
|
589
|
+
/**
|
|
590
|
+
* Additional properties to pass to the modal component.
|
|
591
|
+
*
|
|
592
|
+
* Only applicable if the `modalComponent` property is set for the column.
|
|
593
|
+
*/
|
|
462
594
|
modalComponentExtraProps?: Record<string, any>;
|
|
595
|
+
/**
|
|
596
|
+
* The format function to use to format the value of the cell. This can either be a normal or stringified
|
|
597
|
+
* function that takes the value and the cell context and returns a string.
|
|
598
|
+
*/
|
|
463
599
|
format?: string | ((value: any, context: CellContext) => string);
|
|
600
|
+
/**
|
|
601
|
+
* The masking function to use to apply an input mask to the cell. This will accept an input value and
|
|
602
|
+
* return the masked value.
|
|
603
|
+
*/
|
|
464
604
|
mask?: (value: any) => any;
|
|
465
|
-
|
|
605
|
+
/**
|
|
606
|
+
* Whether the column is a Gantt column.
|
|
607
|
+
*
|
|
608
|
+
* Only applicable for Gantt tables.
|
|
609
|
+
*
|
|
610
|
+
* @defaultValue false
|
|
611
|
+
*/
|
|
612
|
+
isGantt?: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* The component to use to render the Gantt bar for the column.
|
|
615
|
+
*
|
|
616
|
+
* Only applicable for Gantt tables.
|
|
617
|
+
*
|
|
618
|
+
* @defaultValue 'AGanttCell'
|
|
619
|
+
*/
|
|
620
|
+
ganttComponent?: string;
|
|
621
|
+
/**
|
|
622
|
+
* The colspan of the Gantt-bar for the column. This is used to determine how many columns
|
|
623
|
+
* the Gantt-bar should span.
|
|
624
|
+
*
|
|
625
|
+
* Only applicable for Gantt tables.
|
|
626
|
+
*
|
|
627
|
+
* @defaultValue The number of columns in the table, excluding any pinned columns.
|
|
628
|
+
*/
|
|
629
|
+
colspan?: number;
|
|
630
|
+
/**
|
|
631
|
+
* The starting column index for the Gantt-bar, excluding any pinned columns. This is
|
|
632
|
+
* evaluated automatically while rendering the table.
|
|
633
|
+
*
|
|
634
|
+
* Only applicable for Gantt tables.
|
|
635
|
+
*
|
|
636
|
+
* @defaultValue 0
|
|
637
|
+
*/
|
|
638
|
+
originalIndex?: number;
|
|
639
|
+
}
|
|
466
640
|
|
|
467
641
|
/**
|
|
468
642
|
* Table configuration definition.
|
|
469
643
|
* @public
|
|
470
644
|
*/
|
|
471
|
-
export declare
|
|
645
|
+
export declare interface TableConfig {
|
|
472
646
|
/**
|
|
473
647
|
* The type of view to display the table in. Possible values:
|
|
474
648
|
* - `uncounted` - row numbers are not displayed in the table
|
|
@@ -477,66 +651,196 @@ export declare type TableConfig = {
|
|
|
477
651
|
* - `tree` - carets are displayed in the number column that expand/collapse grouped rows
|
|
478
652
|
*/
|
|
479
653
|
view?: 'uncounted' | 'list' | 'list-expansion' | 'tree' | 'gantt';
|
|
654
|
+
/**
|
|
655
|
+
* Control whether the table should be allowed to use the full width of its container.
|
|
656
|
+
*
|
|
657
|
+
* @defaultValue false
|
|
658
|
+
*/
|
|
480
659
|
fullWidth?: boolean;
|
|
481
|
-
}
|
|
660
|
+
}
|
|
482
661
|
|
|
483
662
|
/**
|
|
484
663
|
* Table display definition.
|
|
485
664
|
* @public
|
|
486
665
|
*/
|
|
487
|
-
export declare
|
|
488
|
-
|
|
666
|
+
export declare interface TableDisplay {
|
|
667
|
+
/**
|
|
668
|
+
* Indicates whether a row node is expanded or collapsed.
|
|
669
|
+
*
|
|
670
|
+
* Only applicable for list-expansion views.
|
|
671
|
+
*
|
|
672
|
+
* @defaultValue false
|
|
673
|
+
*/
|
|
489
674
|
expanded?: boolean;
|
|
490
|
-
|
|
675
|
+
/**
|
|
676
|
+
* Indicates whether a row node's child nodes are open or closed.
|
|
677
|
+
*
|
|
678
|
+
* Only applicable for tree views.
|
|
679
|
+
*
|
|
680
|
+
* @defaultValue false
|
|
681
|
+
*/
|
|
682
|
+
childrenOpen?: boolean;
|
|
683
|
+
/**
|
|
684
|
+
* Indicates whether a row node is a parent node. This is evaluated automatically
|
|
685
|
+
* while rendering the table.
|
|
686
|
+
*
|
|
687
|
+
* Only applicable for tree views.
|
|
688
|
+
*/
|
|
491
689
|
isParent?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Indicates whether a row node is a root node. This is evaluated automatically
|
|
692
|
+
* while rendering the table.
|
|
693
|
+
*
|
|
694
|
+
* Only applicable for tree views.
|
|
695
|
+
*/
|
|
492
696
|
isRoot?: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* Indicates whether a row node is visible. This is evaluated automatically
|
|
699
|
+
* while rendering the table.
|
|
700
|
+
*
|
|
701
|
+
* Only applicable for tree views.
|
|
702
|
+
*/
|
|
493
703
|
open?: boolean;
|
|
704
|
+
/**
|
|
705
|
+
* The indentation level of the row node.
|
|
706
|
+
*
|
|
707
|
+
* Only applicable for tree and gantt views.
|
|
708
|
+
*
|
|
709
|
+
* @defaultValue 0
|
|
710
|
+
*/
|
|
711
|
+
indent?: number;
|
|
712
|
+
/**
|
|
713
|
+
* The HTML parent element for the row node. This is evaluated automatically while rendering
|
|
714
|
+
* the table.
|
|
715
|
+
*
|
|
716
|
+
* Only applicable for tree and gantt views.
|
|
717
|
+
*/
|
|
494
718
|
parent?: number;
|
|
719
|
+
/**
|
|
720
|
+
* Indicates whether a row node has been modified. This is evaluated automatically when a cell
|
|
721
|
+
* is edited.
|
|
722
|
+
*
|
|
723
|
+
* @defaultValue false
|
|
724
|
+
*/
|
|
495
725
|
rowModified?: boolean;
|
|
496
|
-
}
|
|
726
|
+
}
|
|
497
727
|
|
|
498
728
|
/**
|
|
499
729
|
* Table modal definition.
|
|
500
730
|
* @public
|
|
501
731
|
*/
|
|
502
|
-
export declare
|
|
503
|
-
|
|
732
|
+
export declare interface TableModal {
|
|
733
|
+
/**
|
|
734
|
+
* Indicates whether the table modal is currently visible.
|
|
735
|
+
*
|
|
736
|
+
* @defaultValue false
|
|
737
|
+
*/
|
|
738
|
+
visible?: boolean;
|
|
739
|
+
/**
|
|
740
|
+
* The HTML cell element that the modal is currently being displayed for. The field is unset
|
|
741
|
+
* when the modal is not being displayed.
|
|
742
|
+
*/
|
|
504
743
|
cell?: HTMLTableCellElement | null;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
744
|
+
/**
|
|
745
|
+
* The HTML parent element that the modal is currently being displayed for. The field is unset
|
|
746
|
+
* when the modal is not being displayed.
|
|
747
|
+
*/
|
|
509
748
|
parent?: HTMLElement;
|
|
749
|
+
/**
|
|
750
|
+
* The index of the column that the modal is currently being displayed for. The field is
|
|
751
|
+
* unset when the modal is not being displayed.
|
|
752
|
+
*/
|
|
753
|
+
colIndex?: number;
|
|
754
|
+
/**
|
|
755
|
+
* The index of the row that the modal is currently being displayed for. The field is
|
|
756
|
+
* unset when the modal is not being displayed.
|
|
757
|
+
*/
|
|
510
758
|
rowIndex?: number;
|
|
511
|
-
|
|
512
|
-
|
|
759
|
+
/**
|
|
760
|
+
* The component to use to render the modal. If not provided, the table will
|
|
761
|
+
* try to use the column's `modalComponent` property, if set. If that is not set,
|
|
762
|
+
* the table will not display a modal.
|
|
763
|
+
*
|
|
764
|
+
* @see {@link TableColumn.modalComponent}
|
|
765
|
+
*/
|
|
513
766
|
component?: string;
|
|
767
|
+
/**
|
|
768
|
+
* Additional properties to pass to the table's modal component.
|
|
769
|
+
*/
|
|
514
770
|
componentProps?: Record<string, any>;
|
|
515
|
-
|
|
771
|
+
/**
|
|
772
|
+
* Reactive bottom value for the modal's bounding box. The field is unset when the modal
|
|
773
|
+
* is not being displayed.
|
|
774
|
+
*/
|
|
775
|
+
bottom?: ReturnType<typeof useElementBounding>['bottom'];
|
|
776
|
+
/**
|
|
777
|
+
* Reactive height value for the modal's bounding box. The field is unset when the modal
|
|
778
|
+
* is not being displayed.
|
|
779
|
+
*/
|
|
780
|
+
height?: ReturnType<typeof useElementBounding>['height'];
|
|
781
|
+
/**
|
|
782
|
+
* Reactive left value for the modal's bounding box. The field is unset when the modal
|
|
783
|
+
* is not being displayed.
|
|
784
|
+
*/
|
|
785
|
+
left?: ReturnType<typeof useElementBounding>['left'];
|
|
786
|
+
/**
|
|
787
|
+
* Reactive width value for the modal's bounding box. The field is unset when the modal
|
|
788
|
+
* is not being displayed.
|
|
789
|
+
*/
|
|
790
|
+
width?: ReturnType<typeof useElementBounding>['width'];
|
|
791
|
+
}
|
|
516
792
|
|
|
517
793
|
/**
|
|
518
794
|
* Table modal component props definition.
|
|
519
795
|
* @public
|
|
520
796
|
*/
|
|
521
|
-
export declare
|
|
797
|
+
export declare interface TableModalProps {
|
|
798
|
+
/**
|
|
799
|
+
* Additional arbitrary properties that can be passed to the modal component.
|
|
800
|
+
*/
|
|
522
801
|
[key: string]: any;
|
|
802
|
+
/**
|
|
803
|
+
* The index of the column that the modal is currently being displayed for.
|
|
804
|
+
*/
|
|
523
805
|
colIndex: number;
|
|
806
|
+
/**
|
|
807
|
+
* The index of the row that the modal is currently being displayed for.
|
|
808
|
+
*/
|
|
524
809
|
rowIndex: number;
|
|
810
|
+
/**
|
|
811
|
+
* The store for managing the current table's state.
|
|
812
|
+
*/
|
|
525
813
|
store: ReturnType<typeof createTableStore>;
|
|
526
|
-
}
|
|
814
|
+
}
|
|
527
815
|
|
|
528
816
|
/**
|
|
529
817
|
* Table row definition.
|
|
530
818
|
* @public
|
|
531
819
|
*/
|
|
532
|
-
export declare
|
|
820
|
+
export declare interface TableRow {
|
|
821
|
+
/**
|
|
822
|
+
* Additional arbitrary properties that can be passed to the row object.
|
|
823
|
+
*/
|
|
533
824
|
[key: string]: any;
|
|
825
|
+
/**
|
|
826
|
+
* The indentation level of the row node.
|
|
827
|
+
*
|
|
828
|
+
* Only applicable for tree and gantt views.
|
|
829
|
+
*
|
|
830
|
+
* @defaultValue 0
|
|
831
|
+
*/
|
|
534
832
|
indent?: number;
|
|
833
|
+
/**
|
|
834
|
+
* The HTML parent element for the row node. This is evaluated automatically while rendering
|
|
835
|
+
* the table.
|
|
836
|
+
*
|
|
837
|
+
* Only applicable for tree and gantt views.
|
|
838
|
+
*/
|
|
535
839
|
parent?: number;
|
|
536
840
|
/**
|
|
537
|
-
*
|
|
841
|
+
* The options to use when rendering the row as a Gantt table.
|
|
538
842
|
*/
|
|
539
|
-
|
|
540
|
-
}
|
|
843
|
+
gantt?: GanttOptions;
|
|
844
|
+
}
|
|
541
845
|
|
|
542
846
|
export { }
|