@stonecrop/atable 0.4.23 → 0.4.24
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 +511 -25
- package/dist/atable.js +1301 -1039
- 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 +370 -16
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +138 -10
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/stores/table.js +111 -13
- package/package.json +3 -3
- package/src/components/AGanttCell.vue +444 -170
- package/src/components/AGanttConnection.vue +164 -0
- package/src/components/ARow.vue +1 -1
- package/src/components/ATable.vue +96 -71
- package/src/components/ATableHeader.vue +1 -1
- package/src/index.ts +4 -0
- package/src/stores/table.ts +129 -13
- package/src/types/index.ts +159 -10
package/src/types/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useElementBounding } from '@vueuse/core'
|
|
2
|
+
import type { Ref, ShallowRef } from 'vue'
|
|
2
3
|
|
|
3
4
|
import { createTableStore } from '../stores/table'
|
|
4
5
|
|
|
@@ -133,8 +134,8 @@ export interface TableColumn {
|
|
|
133
134
|
ganttComponent?: string
|
|
134
135
|
|
|
135
136
|
/**
|
|
136
|
-
* The colspan of the Gantt
|
|
137
|
-
* the Gantt
|
|
137
|
+
* The colspan of the Gantt bar for the column. This determines how many columns
|
|
138
|
+
* the Gantt bar should span across.
|
|
138
139
|
*
|
|
139
140
|
* Only applicable for Gantt tables.
|
|
140
141
|
*
|
|
@@ -143,8 +144,8 @@ export interface TableColumn {
|
|
|
143
144
|
colspan?: number
|
|
144
145
|
|
|
145
146
|
/**
|
|
146
|
-
* The
|
|
147
|
-
* evaluated automatically while rendering the table.
|
|
147
|
+
* The original column index for the Gantt bar, excluding any pinned columns.
|
|
148
|
+
* This is evaluated automatically while rendering the table.
|
|
148
149
|
*
|
|
149
150
|
* Only applicable for Gantt tables.
|
|
150
151
|
*
|
|
@@ -185,8 +186,10 @@ export interface TableConfig {
|
|
|
185
186
|
* - `list` - row numbers are displayed in the table
|
|
186
187
|
* - `list-expansion` - carets are displayed in the number column that expand/collapse the row inline
|
|
187
188
|
* - `tree` - carets are displayed in the number column that expand/collapse grouped rows
|
|
189
|
+
* - `gantt` - view that allows specific rows to be displayed with Gantt functionality
|
|
190
|
+
* - `tree-gantt` - similar to `gantt`, but allows for tree functionality as well
|
|
188
191
|
*/
|
|
189
|
-
view?: 'uncounted' | 'list' | 'list-expansion' | 'tree' | 'gantt'
|
|
192
|
+
view?: 'uncounted' | 'list' | 'list-expansion' | 'tree' | 'gantt' | 'tree-gantt'
|
|
190
193
|
|
|
191
194
|
/**
|
|
192
195
|
* Control whether the table should be allowed to use the full width of its container.
|
|
@@ -303,29 +306,33 @@ export interface TableRow {
|
|
|
303
306
|
}
|
|
304
307
|
|
|
305
308
|
/**
|
|
306
|
-
*
|
|
309
|
+
* Gantt chart options for table rows.
|
|
307
310
|
* @public
|
|
308
311
|
*/
|
|
309
312
|
export interface GanttOptions {
|
|
310
313
|
/**
|
|
311
|
-
* The
|
|
314
|
+
* The color to be applied to the row's gantt bar.
|
|
315
|
+
*
|
|
316
|
+
* @defaultValue '#cccccc'
|
|
312
317
|
*/
|
|
313
318
|
color?: string
|
|
314
319
|
|
|
315
320
|
/**
|
|
316
321
|
* The starting column index for the gantt bar.
|
|
322
|
+
*
|
|
323
|
+
* @defaultValue 0
|
|
317
324
|
*/
|
|
318
325
|
startIndex?: number
|
|
319
326
|
|
|
320
327
|
/**
|
|
321
|
-
* The ending column index for the gantt bar. If
|
|
328
|
+
* The ending column index for the gantt bar. If endIndex and colspan are not provided,
|
|
322
329
|
* the bar will stretch to the end of the table.
|
|
323
330
|
*/
|
|
324
331
|
endIndex?: number
|
|
325
332
|
|
|
326
333
|
/**
|
|
327
|
-
* The length of the gantt bar. Useful when only the start index is provided.
|
|
328
|
-
* colspan and endIndex are not provided, the bar will stretch to the end of the table.
|
|
334
|
+
* The length of the gantt bar in columns. Useful when only the start index is provided.
|
|
335
|
+
* If colspan and endIndex are not provided, the bar will stretch to the end of the table.
|
|
329
336
|
*/
|
|
330
337
|
colspan?: number
|
|
331
338
|
}
|
|
@@ -468,3 +475,145 @@ export interface TableModalProps {
|
|
|
468
475
|
*/
|
|
469
476
|
store: ReturnType<typeof createTableStore>
|
|
470
477
|
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Gantt bar information for VueFlow integration.
|
|
481
|
+
* @public
|
|
482
|
+
*/
|
|
483
|
+
export interface GanttBarInfo {
|
|
484
|
+
/**
|
|
485
|
+
* Unique identifier for the gantt bar.
|
|
486
|
+
*/
|
|
487
|
+
id: string
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* The row index of the gantt bar.
|
|
491
|
+
*/
|
|
492
|
+
rowIndex: number
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* The primary column index of the gantt bar (typically the start index).
|
|
496
|
+
*/
|
|
497
|
+
colIndex: number
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Starting column index of the gantt bar.
|
|
501
|
+
*/
|
|
502
|
+
startIndex: Ref<number>
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Ending column index of the gantt bar.
|
|
506
|
+
*/
|
|
507
|
+
endIndex: Ref<number>
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Color of the gantt bar.
|
|
511
|
+
*/
|
|
512
|
+
color: Ref<string>
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* The position of the gantt bar in the ATable component.
|
|
516
|
+
*/
|
|
517
|
+
position: {
|
|
518
|
+
x: ShallowRef<number>
|
|
519
|
+
y: ShallowRef<number>
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Display label for the gantt bar.
|
|
524
|
+
*/
|
|
525
|
+
label?: string
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Connection handle information for gantt bar connections.
|
|
530
|
+
* @public
|
|
531
|
+
*/
|
|
532
|
+
export interface ConnectionHandle {
|
|
533
|
+
/**
|
|
534
|
+
* Unique identifier for the connection handle.
|
|
535
|
+
*/
|
|
536
|
+
id: string
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* The row index of the gantt bar this handle belongs to.
|
|
540
|
+
*/
|
|
541
|
+
rowIndex: number
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The column index of the gantt bar this handle belongs to.
|
|
545
|
+
*/
|
|
546
|
+
colIndex: number
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* The side of the gantt bar where this handle is located.
|
|
550
|
+
*/
|
|
551
|
+
side: 'left' | 'right'
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* The position of the connection handle.
|
|
555
|
+
*/
|
|
556
|
+
position: {
|
|
557
|
+
x: ShallowRef<number>
|
|
558
|
+
y: ShallowRef<number>
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Whether the handle is currently visible (on hover).
|
|
563
|
+
*/
|
|
564
|
+
visible: Ref<boolean>
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Reference to the gantt bar this handle belongs to.
|
|
568
|
+
*/
|
|
569
|
+
barId: string
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Connection path between two gantt bars.
|
|
574
|
+
* @public
|
|
575
|
+
*/
|
|
576
|
+
export interface ConnectionPath {
|
|
577
|
+
/**
|
|
578
|
+
* Unique identifier for the connection path.
|
|
579
|
+
*/
|
|
580
|
+
id: string
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* The source connection handle.
|
|
584
|
+
*/
|
|
585
|
+
from: {
|
|
586
|
+
barId: string
|
|
587
|
+
side: 'left' | 'right'
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* The target connection handle.
|
|
592
|
+
*/
|
|
593
|
+
to: {
|
|
594
|
+
barId: string
|
|
595
|
+
side: 'left' | 'right'
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Optional styling for the connection path.
|
|
600
|
+
*/
|
|
601
|
+
style?: {
|
|
602
|
+
color?: string
|
|
603
|
+
width?: number
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Optional label for the connection.
|
|
608
|
+
*/
|
|
609
|
+
label?: string
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Connection event for handling connection creation/deletion.
|
|
614
|
+
* @public
|
|
615
|
+
*/
|
|
616
|
+
export type ConnectionEvent = {
|
|
617
|
+
type: 'create' | 'delete'
|
|
618
|
+
connection: ConnectionPath
|
|
619
|
+
}
|