vueye-table 3.0.0-alpha.7 → 3.0.0-alpha.9

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CellChange, RowKey, TableIssue, TableRow, TableState } from "@vueye-table/core";
2
- import { GridCellSlotProps } from "@vueye-table/headless";
2
+ import { DetailSlotProps, GridCellSlotProps, TableStatusSlotProps } from "@vueye-table/headless";
3
3
  import { Plugin, PropType, SlotsType, VNode } from "vue";
4
4
  export * from "@vueye-table/core";
5
5
  export * from "@vueye-table/headless";
@@ -52,6 +52,66 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
52
52
  type: BooleanConstructor;
53
53
  default: boolean;
54
54
  };
55
+ rowCanExpand: {
56
+ readonly type: PropType<((row: any) => boolean) | undefined>;
57
+ readonly default: undefined;
58
+ };
59
+ expandMode: {
60
+ readonly type: PropType<import("@vueye-table/core").ExpandMode>;
61
+ readonly default: "multiple";
62
+ };
63
+ expanded: {
64
+ readonly type: PropType<import("@vueye-table/core").ExpandedState | undefined>;
65
+ readonly default: undefined;
66
+ };
67
+ getChildren: {
68
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getChildren"]>;
69
+ readonly default: undefined;
70
+ };
71
+ setChildren: {
72
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["setChildren"]>;
73
+ readonly default: undefined;
74
+ };
75
+ getParentKey: {
76
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getParentKey"]>;
77
+ readonly default: undefined;
78
+ };
79
+ hasChildren: {
80
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["hasChildren"]>;
81
+ readonly default: undefined;
82
+ };
83
+ loadChildren: {
84
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any, AbortSignal>["loadChildren"]>;
85
+ readonly default: undefined;
86
+ };
87
+ treeFilter: {
88
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["treeFilter"]>;
89
+ readonly default: undefined;
90
+ };
91
+ paginateBy: {
92
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["paginateBy"]>;
93
+ readonly default: undefined;
94
+ };
95
+ source: {
96
+ readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
97
+ readonly default: undefined;
98
+ };
99
+ loadMore: {
100
+ readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
101
+ readonly default: undefined;
102
+ };
103
+ endThreshold: {
104
+ readonly type: NumberConstructor;
105
+ readonly default: 5;
106
+ };
107
+ manual: {
108
+ readonly type: PropType<boolean | undefined>;
109
+ readonly default: undefined;
110
+ };
111
+ rowCount: {
112
+ readonly type: PropType<number | undefined>;
113
+ readonly default: undefined;
114
+ };
55
115
  paginate: {
56
116
  readonly type: PropType<boolean | undefined>;
57
117
  readonly default: undefined;
@@ -136,6 +196,14 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
136
196
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
137
197
  readonly default: "all";
138
198
  };
199
+ treeColumn: {
200
+ readonly type: PropType<string | undefined>;
201
+ readonly default: undefined;
202
+ };
203
+ keepAliveDetail: {
204
+ readonly type: BooleanConstructor;
205
+ readonly default: false;
206
+ };
139
207
  virtual: {
140
208
  readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
141
209
  readonly default: false;
@@ -162,7 +230,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
162
230
  };
163
231
  data: {
164
232
  type: PropType<readonly unknown[]>;
165
- required: true;
233
+ default: () => never[];
166
234
  };
167
235
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
168
236
  [key: string]: any;
@@ -174,12 +242,15 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
174
242
  "update:filters": null;
175
243
  "update:hiddenColumns": null;
176
244
  "update:selected": null;
245
+ "update:expanded": null;
177
246
  } & {
178
247
  "state-change": (state: TableState) => boolean;
179
248
  "update:data": (data: readonly unknown[]) => boolean;
180
249
  edit: (changes: readonly CellChange<unknown>[]) => boolean;
181
250
  "edit-error": (issues: readonly TableIssue[]) => boolean;
182
251
  export: (csv: string) => boolean;
252
+ expand: (item: unknown, row: TableRow<unknown>) => boolean;
253
+ collapse: (item: unknown, row: TableRow<unknown>) => boolean;
183
254
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
184
255
  searchable: {
185
256
  type: BooleanConstructor;
@@ -216,6 +287,66 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
216
287
  type: BooleanConstructor;
217
288
  default: boolean;
218
289
  };
290
+ rowCanExpand: {
291
+ readonly type: PropType<((row: any) => boolean) | undefined>;
292
+ readonly default: undefined;
293
+ };
294
+ expandMode: {
295
+ readonly type: PropType<import("@vueye-table/core").ExpandMode>;
296
+ readonly default: "multiple";
297
+ };
298
+ expanded: {
299
+ readonly type: PropType<import("@vueye-table/core").ExpandedState | undefined>;
300
+ readonly default: undefined;
301
+ };
302
+ getChildren: {
303
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getChildren"]>;
304
+ readonly default: undefined;
305
+ };
306
+ setChildren: {
307
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["setChildren"]>;
308
+ readonly default: undefined;
309
+ };
310
+ getParentKey: {
311
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getParentKey"]>;
312
+ readonly default: undefined;
313
+ };
314
+ hasChildren: {
315
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["hasChildren"]>;
316
+ readonly default: undefined;
317
+ };
318
+ loadChildren: {
319
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any, AbortSignal>["loadChildren"]>;
320
+ readonly default: undefined;
321
+ };
322
+ treeFilter: {
323
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["treeFilter"]>;
324
+ readonly default: undefined;
325
+ };
326
+ paginateBy: {
327
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["paginateBy"]>;
328
+ readonly default: undefined;
329
+ };
330
+ source: {
331
+ readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
332
+ readonly default: undefined;
333
+ };
334
+ loadMore: {
335
+ readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
336
+ readonly default: undefined;
337
+ };
338
+ endThreshold: {
339
+ readonly type: NumberConstructor;
340
+ readonly default: 5;
341
+ };
342
+ manual: {
343
+ readonly type: PropType<boolean | undefined>;
344
+ readonly default: undefined;
345
+ };
346
+ rowCount: {
347
+ readonly type: PropType<number | undefined>;
348
+ readonly default: undefined;
349
+ };
219
350
  paginate: {
220
351
  readonly type: PropType<boolean | undefined>;
221
352
  readonly default: undefined;
@@ -300,6 +431,14 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
300
431
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
301
432
  readonly default: "all";
302
433
  };
434
+ treeColumn: {
435
+ readonly type: PropType<string | undefined>;
436
+ readonly default: undefined;
437
+ };
438
+ keepAliveDetail: {
439
+ readonly type: BooleanConstructor;
440
+ readonly default: false;
441
+ };
303
442
  virtual: {
304
443
  readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
305
444
  readonly default: false;
@@ -326,7 +465,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
326
465
  };
327
466
  data: {
328
467
  type: PropType<readonly unknown[]>;
329
- required: true;
468
+ default: () => never[];
330
469
  };
331
470
  }>> & Readonly<{
332
471
  "onUpdate:page"?: (...args: any[]) => any;
@@ -336,13 +475,32 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
336
475
  "onUpdate:filters"?: (...args: any[]) => any;
337
476
  "onUpdate:hiddenColumns"?: (...args: any[]) => any;
338
477
  "onUpdate:selected"?: (...args: any[]) => any;
478
+ "onUpdate:expanded"?: (...args: any[]) => any;
339
479
  "onState-change"?: (state: TableState) => any;
480
+ onExpand?: (item: unknown, row: TableRow<unknown>) => any;
481
+ onCollapse?: (item: unknown, row: TableRow<unknown>) => any;
340
482
  onEdit?: (changes: readonly CellChange<unknown>[]) => any;
341
483
  "onUpdate:data"?: (data: readonly unknown[]) => any;
342
484
  "onEdit-error"?: (issues: readonly TableIssue[]) => any;
343
485
  onExport?: (csv: string) => any;
344
486
  }>, {
487
+ getChildren: ((row: any) => readonly any[] | undefined) | undefined;
488
+ setChildren: ((row: any, children: readonly any[]) => any) | undefined;
489
+ getParentKey: ((row: any) => import("@vueye-table/core").RowKey | null | undefined) | undefined;
490
+ hasChildren: ((row: any) => boolean) | undefined;
491
+ loadChildren: ((row: TableRow<any>, signal: AbortSignal) => Promise<readonly any[]>) | undefined;
492
+ treeFilter: import("@vueye-table/core").TreeFilter | undefined;
493
+ paginateBy: import("@vueye-table/core").TreePagination | undefined;
345
494
  page: number;
495
+ data: readonly unknown[];
496
+ rowCanExpand: ((row: any) => boolean) | undefined;
497
+ expandMode: import("@vueye-table/core").ExpandMode;
498
+ expanded: import("@vueye-table/core").ExpandedState | undefined;
499
+ source: import("@vueye-table/vue").TableSource<unknown> | undefined;
500
+ loadMore: import("@vueye-table/vue").LoadMore<unknown> | undefined;
501
+ endThreshold: number;
502
+ manual: boolean | undefined;
503
+ rowCount: number | undefined;
346
504
  paginate: boolean | undefined;
347
505
  columns: readonly import("@vueye-table/core").AnyColumnDef[];
348
506
  rowKey: string | ((row: any, index: number) => import("@vueye-table/core").RowKey);
@@ -366,6 +524,8 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
366
524
  filters: Readonly<Record<string, unknown>>;
367
525
  hiddenColumns: readonly string[];
368
526
  selectScope: import("@vueye-table/core").SelectScope;
527
+ treeColumn: string | undefined;
528
+ keepAliveDetail: boolean;
369
529
  virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
370
530
  height: string | undefined;
371
531
  rowHeight: number;
@@ -383,6 +543,8 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
383
543
  };
384
544
  } & {
385
545
  default?: (props: Record<string, unknown>) => VNode[];
546
+ status?: (props: TableStatusSlotProps) => VNode[];
547
+ expanded?: (props: DetailSlotProps) => VNode[];
386
548
  }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
387
549
  //#endregion
388
550
  //#region src/vueye-table.d.ts
@@ -398,13 +560,7 @@ interface CellSlotProps {
398
560
  };
399
561
  }
400
562
  /** Slot props of `status`, the "1–10 of 57 rows" line. */
401
- interface StatusSlotProps {
402
- readonly start: number;
403
- readonly end: number;
404
- readonly rowCount: number;
405
- readonly totalRowCount: number;
406
- readonly selectedCount: number;
407
- }
563
+ type StatusSlotProps = TableStatusSlotProps;
408
564
  /**
409
565
  * A complete data table: search, column visibility, sorting, selection, pagination, a live
410
566
  * status line, loading and empty states, and theming. Every piece of state is available as a
@@ -421,19 +577,71 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
421
577
  default: undefined;
422
578
  };
423
579
  /** The data is one page from a server; `rowCount` is the total. */
424
- manual: {
425
- type: BooleanConstructor;
426
- default: boolean;
427
- };
428
- rowCount: {
429
- type: PropType<number | undefined>;
430
- default: undefined;
431
- };
432
580
  /** Shown instead of the empty state while `loading` and there are no rows yet. */
433
581
  loadingText: {
434
582
  type: StringConstructor;
435
583
  default: string;
436
584
  };
585
+ rowCanExpand: {
586
+ readonly type: PropType<((row: any) => boolean) | undefined>;
587
+ readonly default: undefined;
588
+ };
589
+ expandMode: {
590
+ readonly type: PropType<import("@vueye-table/core").ExpandMode>;
591
+ readonly default: "multiple";
592
+ };
593
+ expanded: {
594
+ readonly type: PropType<import("@vueye-table/core").ExpandedState | undefined>;
595
+ readonly default: undefined;
596
+ };
597
+ getChildren: {
598
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getChildren"]>;
599
+ readonly default: undefined;
600
+ };
601
+ setChildren: {
602
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["setChildren"]>;
603
+ readonly default: undefined;
604
+ };
605
+ getParentKey: {
606
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getParentKey"]>;
607
+ readonly default: undefined;
608
+ };
609
+ hasChildren: {
610
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["hasChildren"]>;
611
+ readonly default: undefined;
612
+ };
613
+ loadChildren: {
614
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any, AbortSignal>["loadChildren"]>;
615
+ readonly default: undefined;
616
+ };
617
+ treeFilter: {
618
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["treeFilter"]>;
619
+ readonly default: undefined;
620
+ };
621
+ paginateBy: {
622
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["paginateBy"]>;
623
+ readonly default: undefined;
624
+ };
625
+ source: {
626
+ readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
627
+ readonly default: undefined;
628
+ };
629
+ loadMore: {
630
+ readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
631
+ readonly default: undefined;
632
+ };
633
+ endThreshold: {
634
+ readonly type: NumberConstructor;
635
+ readonly default: 5;
636
+ };
637
+ manual: {
638
+ readonly type: PropType<boolean | undefined>;
639
+ readonly default: undefined;
640
+ };
641
+ rowCount: {
642
+ readonly type: PropType<number | undefined>;
643
+ readonly default: undefined;
644
+ };
437
645
  paginate: {
438
646
  readonly type: PropType<boolean | undefined>;
439
647
  readonly default: undefined;
@@ -530,6 +738,14 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
530
738
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
531
739
  readonly default: "all";
532
740
  };
741
+ treeColumn: {
742
+ readonly type: PropType<string | undefined>;
743
+ readonly default: undefined;
744
+ };
745
+ keepAliveDetail: {
746
+ readonly type: BooleanConstructor;
747
+ readonly default: false;
748
+ };
533
749
  virtual: {
534
750
  readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
535
751
  readonly default: false;
@@ -556,7 +772,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
556
772
  };
557
773
  data: {
558
774
  type: PropType<readonly unknown[]>;
559
- required: true;
775
+ default: () => never[];
560
776
  };
561
777
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
562
778
  [key: string]: any;
@@ -568,9 +784,12 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
568
784
  "update:filters": null;
569
785
  "update:hiddenColumns": null;
570
786
  "update:selected": null;
787
+ "update:expanded": null;
571
788
  } & {
572
789
  "state-change": (state: TableState) => boolean;
573
790
  "row-click": (item: unknown, row: TableRow<unknown>) => boolean;
791
+ expand: (item: unknown, row: TableRow<unknown>) => boolean;
792
+ collapse: (item: unknown, row: TableRow<unknown>) => boolean;
574
793
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
575
794
  /** `true` or `"multiple"` for checkboxes, `"single"` for one row at a time. */
576
795
  selectable: {
@@ -582,19 +801,71 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
582
801
  default: undefined;
583
802
  };
584
803
  /** The data is one page from a server; `rowCount` is the total. */
585
- manual: {
586
- type: BooleanConstructor;
587
- default: boolean;
588
- };
589
- rowCount: {
590
- type: PropType<number | undefined>;
591
- default: undefined;
592
- };
593
804
  /** Shown instead of the empty state while `loading` and there are no rows yet. */
594
805
  loadingText: {
595
806
  type: StringConstructor;
596
807
  default: string;
597
808
  };
809
+ rowCanExpand: {
810
+ readonly type: PropType<((row: any) => boolean) | undefined>;
811
+ readonly default: undefined;
812
+ };
813
+ expandMode: {
814
+ readonly type: PropType<import("@vueye-table/core").ExpandMode>;
815
+ readonly default: "multiple";
816
+ };
817
+ expanded: {
818
+ readonly type: PropType<import("@vueye-table/core").ExpandedState | undefined>;
819
+ readonly default: undefined;
820
+ };
821
+ getChildren: {
822
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getChildren"]>;
823
+ readonly default: undefined;
824
+ };
825
+ setChildren: {
826
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["setChildren"]>;
827
+ readonly default: undefined;
828
+ };
829
+ getParentKey: {
830
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["getParentKey"]>;
831
+ readonly default: undefined;
832
+ };
833
+ hasChildren: {
834
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any>["hasChildren"]>;
835
+ readonly default: undefined;
836
+ };
837
+ loadChildren: {
838
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<any, AbortSignal>["loadChildren"]>;
839
+ readonly default: undefined;
840
+ };
841
+ treeFilter: {
842
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["treeFilter"]>;
843
+ readonly default: undefined;
844
+ };
845
+ paginateBy: {
846
+ readonly type: PropType<import("@vueye-table/core").TreeOptions<unknown>["paginateBy"]>;
847
+ readonly default: undefined;
848
+ };
849
+ source: {
850
+ readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
851
+ readonly default: undefined;
852
+ };
853
+ loadMore: {
854
+ readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
855
+ readonly default: undefined;
856
+ };
857
+ endThreshold: {
858
+ readonly type: NumberConstructor;
859
+ readonly default: 5;
860
+ };
861
+ manual: {
862
+ readonly type: PropType<boolean | undefined>;
863
+ readonly default: undefined;
864
+ };
865
+ rowCount: {
866
+ readonly type: PropType<number | undefined>;
867
+ readonly default: undefined;
868
+ };
598
869
  paginate: {
599
870
  readonly type: PropType<boolean | undefined>;
600
871
  readonly default: undefined;
@@ -691,6 +962,14 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
691
962
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
692
963
  readonly default: "all";
693
964
  };
965
+ treeColumn: {
966
+ readonly type: PropType<string | undefined>;
967
+ readonly default: undefined;
968
+ };
969
+ keepAliveDetail: {
970
+ readonly type: BooleanConstructor;
971
+ readonly default: false;
972
+ };
694
973
  virtual: {
695
974
  readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
696
975
  readonly default: false;
@@ -717,7 +996,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
717
996
  };
718
997
  data: {
719
998
  type: PropType<readonly unknown[]>;
720
- required: true;
999
+ default: () => never[];
721
1000
  };
722
1001
  }>> & Readonly<{
723
1002
  "onUpdate:page"?: (...args: any[]) => any;
@@ -727,15 +1006,32 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
727
1006
  "onUpdate:filters"?: (...args: any[]) => any;
728
1007
  "onUpdate:hiddenColumns"?: (...args: any[]) => any;
729
1008
  "onUpdate:selected"?: (...args: any[]) => any;
1009
+ "onUpdate:expanded"?: (...args: any[]) => any;
730
1010
  "onState-change"?: (state: TableState) => any;
731
1011
  "onRow-click"?: (item: unknown, row: TableRow<unknown>) => any;
1012
+ onExpand?: (item: unknown, row: TableRow<unknown>) => any;
1013
+ onCollapse?: (item: unknown, row: TableRow<unknown>) => any;
732
1014
  }>, {
1015
+ getChildren: ((row: any) => readonly any[] | undefined) | undefined;
1016
+ setChildren: ((row: any, children: readonly any[]) => any) | undefined;
1017
+ getParentKey: ((row: any) => RowKey | null | undefined) | undefined;
1018
+ hasChildren: ((row: any) => boolean) | undefined;
1019
+ loadChildren: ((row: TableRow<any>, signal: AbortSignal) => Promise<readonly any[]>) | undefined;
1020
+ treeFilter: import("@vueye-table/core").TreeFilter | undefined;
1021
+ paginateBy: import("@vueye-table/core").TreePagination | undefined;
733
1022
  page: number;
1023
+ data: readonly unknown[];
734
1024
  selectable: boolean | "single" | "multiple";
735
1025
  selected: readonly RowKey[];
736
- manual: boolean;
737
- rowCount: number | undefined;
738
1026
  loadingText: string;
1027
+ rowCanExpand: ((row: any) => boolean) | undefined;
1028
+ expandMode: import("@vueye-table/core").ExpandMode;
1029
+ expanded: import("@vueye-table/core").ExpandedState | undefined;
1030
+ source: import("@vueye-table/vue").TableSource<unknown> | undefined;
1031
+ loadMore: import("@vueye-table/vue").LoadMore<unknown> | undefined;
1032
+ endThreshold: number;
1033
+ manual: boolean | undefined;
1034
+ rowCount: number | undefined;
739
1035
  paginate: boolean | undefined;
740
1036
  columns: readonly import("@vueye-table/core").AnyColumnDef[];
741
1037
  rowKey: string | ((row: any, index: number) => RowKey);
@@ -759,6 +1055,8 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
759
1055
  filters: Readonly<Record<string, unknown>>;
760
1056
  hiddenColumns: readonly string[];
761
1057
  selectScope: import("@vueye-table/core").SelectScope;
1058
+ treeColumn: string | undefined;
1059
+ keepAliveDetail: boolean;
762
1060
  virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
763
1061
  height: string | undefined;
764
1062
  rowHeight: number;
@@ -783,6 +1081,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
783
1081
  table: unknown;
784
1082
  };
785
1083
  status: StatusSlotProps;
1084
+ expanded: DetailSlotProps;
786
1085
  }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
787
1086
  //#endregion
788
1087
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/index.ts"],"mappings":";;;;;;;;;cAMa,kBAAkB;;;;;;;;;cCqBlB,yBAAS,8BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQK,MAAA;;;;;;;;;;;;;;EAsBP,iBAAC,OAAO;EACT,gBAAC;EACV,OAAC,kBAAkB;EACX,eAAC,iBAAiB;EACxB,SAAC;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAPtB,MAAA;;;;;;;;;;;;;;;EAqBP,iBAAC,OAAO;EACX,cAAC,eAAe,KAAK;EAC1B,SAAC,eAAe,KAAK;EACnB,WAAC,eAAe,KAAK;;;;IApBF,MAAA;;;;IAGF,MAAA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAPtB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BgB;MAAE;MAAY;;;;EAE1C;IAAE;;EACJ,OAAA;EACE,SAAA;EACD;IAAE;;EACF,QAAA;EACE,UAAA;kCA+Od;;;;YCpUiB;IACf,mBAAmB;IACnB,kBAAkB"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { inferColumns } from "@vueye-table/core";
2
- import { DataTableBody, DataTableCaption, DataTableCell, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, virtualProps } from "@vueye-table/headless";
3
- import { VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtPageSize, VtPagination, VtSearch, VtStatus, VtToolbar } from "@vueye-table/styled";
2
+ import { DataTableBody, DataTableCaption, DataTableCell, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, hierarchyProps, resolveTreeColumn, virtualProps } from "@vueye-table/headless";
3
+ import { VtColumnVisibility, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtStatus, VtToolbar, VtTreeCell } from "@vueye-table/styled";
4
4
  import { provideDataTable, useDataTable } from "@vueye-table/vue";
5
5
  import { computed, defineComponent, h } from "vue";
6
6
 
@@ -13,9 +13,110 @@ export * from "@vueye-table/styled"
13
13
  export * from "@vueye-table/vue"
14
14
 
15
15
  //#region src/shared.ts
16
+ /** Isolate application cell slots from unrelated table/grid navigation updates. */
17
+ const CellContent = defineComponent({
18
+ name: "VueyeCellContent",
19
+ props: {
20
+ row: {
21
+ type: Object,
22
+ required: true
23
+ },
24
+ column: {
25
+ type: Object,
26
+ required: true
27
+ },
28
+ value: {
29
+ type: null,
30
+ required: true
31
+ },
32
+ display: {
33
+ type: String,
34
+ required: true
35
+ },
36
+ editable: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ render: {
41
+ type: Function,
42
+ required: true
43
+ }
44
+ },
45
+ setup(props) {
46
+ return () => props.render({
47
+ item: props.row.original,
48
+ row: props.row,
49
+ column: props.column,
50
+ value: props.value,
51
+ display: props.display,
52
+ editable: props.editable
53
+ });
54
+ }
55
+ });
16
56
  /** Props both full components share. */
17
57
  const commonProps = {
18
58
  ...virtualProps,
59
+ ...hierarchyProps,
60
+ rowCanExpand: {
61
+ type: Function,
62
+ default: void 0
63
+ },
64
+ expandMode: {
65
+ type: String,
66
+ default: "multiple"
67
+ },
68
+ expanded: {
69
+ type: [Boolean, Array],
70
+ default: void 0
71
+ },
72
+ getChildren: {
73
+ type: Function,
74
+ default: void 0
75
+ },
76
+ setChildren: {
77
+ type: Function,
78
+ default: void 0
79
+ },
80
+ getParentKey: {
81
+ type: Function,
82
+ default: void 0
83
+ },
84
+ hasChildren: {
85
+ type: Function,
86
+ default: void 0
87
+ },
88
+ loadChildren: {
89
+ type: Function,
90
+ default: void 0
91
+ },
92
+ treeFilter: {
93
+ type: String,
94
+ default: void 0
95
+ },
96
+ paginateBy: {
97
+ type: String,
98
+ default: void 0
99
+ },
100
+ source: {
101
+ type: [Object, Function],
102
+ default: void 0
103
+ },
104
+ loadMore: {
105
+ type: Function,
106
+ default: void 0
107
+ },
108
+ endThreshold: {
109
+ type: Number,
110
+ default: 5
111
+ },
112
+ manual: {
113
+ type: Boolean,
114
+ default: void 0
115
+ },
116
+ rowCount: {
117
+ type: Number,
118
+ default: void 0
119
+ },
19
120
  /** Override the virtual default of no pagination; permits virtualizing a large page. */
20
121
  paginate: {
21
122
  type: Boolean,
@@ -129,7 +230,8 @@ const stateEmits = [
129
230
  "update:search",
130
231
  "update:filters",
131
232
  "update:hiddenColumns",
132
- "update:selected"
233
+ "update:selected",
234
+ "update:expanded"
133
235
  ];
134
236
  /** The state a parent controls through `v-model`, as a table state patch. */
135
237
  function controlledState(props, current) {
@@ -139,6 +241,7 @@ function controlledState(props, current) {
139
241
  filters: props.filters,
140
242
  hiddenColumns: props.hiddenColumns,
141
243
  selection: props.selected,
244
+ expanded: props.expanded,
142
245
  pagination: props.page !== void 0 || props.pageSize !== void 0 ? {
143
246
  page: props.page ?? current.page,
144
247
  pageSize: props.pageSize ?? current.pageSize
@@ -157,6 +260,37 @@ function emitStateChanges(emit, state, previous) {
157
260
  if (state.filters !== previous.filters) emit("update:filters", state.filters);
158
261
  if (state.hiddenColumns !== previous.hiddenColumns) emit("update:hiddenColumns", state.hiddenColumns);
159
262
  if (state.selection !== previous.selection) emit("update:selected", state.selection);
263
+ if (state.expanded !== previous.expanded) emit("update:expanded", state.expanded);
264
+ }
265
+ function expansionOptions(props, detail) {
266
+ return {
267
+ getRowCanExpand: props.rowCanExpand ?? (detail ? () => true : void 0),
268
+ expandMode: props.expandMode,
269
+ getChildren: props.getChildren,
270
+ setChildren: props.setChildren,
271
+ getParentKey: props.getParentKey,
272
+ hasChildren: props.hasChildren,
273
+ loadChildren: props.loadChildren,
274
+ treeFilter: props.treeFilter,
275
+ paginateBy: props.paginateBy
276
+ };
277
+ }
278
+ function emitExpansionChanges(emit, state, previous, table) {
279
+ if (!table || state.expanded === previous.expanded) return;
280
+ const keys = /* @__PURE__ */ new Set([
281
+ ...table.processedRows.map((row) => row.key),
282
+ ...state.expanded === true ? [] : state.expanded,
283
+ ...previous.expanded === true ? [] : previous.expanded
284
+ ]);
285
+ for (const key of keys) {
286
+ const before = previous.expanded === true || previous.expanded.includes(key);
287
+ const after = state.expanded === true || state.expanded.includes(key);
288
+ const row = table.getRow(key);
289
+ if (row?.canExpand && before !== after) {
290
+ if (after) emit("expand", row.original, row);
291
+ else emit("collapse", row.original, row);
292
+ }
293
+ }
160
294
  }
161
295
  /**
162
296
  * The given columns, or columns inferred from the data. Inferred columns are reused while the
@@ -190,7 +324,7 @@ const VueyeGrid = defineComponent({
190
324
  props: {
191
325
  data: {
192
326
  type: Array,
193
- required: true
327
+ default: () => []
194
328
  },
195
329
  ...commonProps,
196
330
  searchable: {
@@ -235,7 +369,9 @@ const VueyeGrid = defineComponent({
235
369
  "update:data": (_data) => true,
236
370
  edit: (_changes) => true,
237
371
  "edit-error": (_issues) => true,
238
- export: (_csv) => true
372
+ export: (_csv) => true,
373
+ expand: (_item, _row) => true,
374
+ collapse: (_item, _row) => true
239
375
  },
240
376
  setup(props, { emit, slots, expose, attrs }) {
241
377
  const resolveColumns = createColumnResolver();
@@ -250,10 +386,16 @@ const VueyeGrid = defineComponent({
250
386
  };
251
387
  let binding;
252
388
  const table = useDataTable({
389
+ ...expansionOptions(props, !!slots.expanded),
253
390
  data: () => props.data,
391
+ source: computed(() => props.source),
392
+ loadMore: computed(() => props.loadMore),
393
+ endThreshold: props.endThreshold,
394
+ manual: props.manual,
395
+ rowCount: () => props.rowCount,
254
396
  columns,
255
397
  rowKey: props.rowKey,
256
- paginate: props.paginate ?? (props.virtual ? props.pagination : true),
398
+ paginate: props.paginate ?? (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),
257
399
  selectionMode: "none",
258
400
  initialState: { pagination: initialPagination },
259
401
  state: () => {
@@ -276,6 +418,7 @@ const VueyeGrid = defineComponent({
276
418
  },
277
419
  onStateChange(state, previous) {
278
420
  emitStateChanges(emit, state, previous);
421
+ emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());
279
422
  emit("state-change", state);
280
423
  }
281
424
  });
@@ -284,11 +427,15 @@ const VueyeGrid = defineComponent({
284
427
  expose({ table });
285
428
  const gridSlots = () => {
286
429
  const forwarded = {};
430
+ if (slots.expanded) forwarded["expanded"] = slots.expanded;
287
431
  for (const [name, slot] of Object.entries(slots)) if (name === "default" && slot) forwarded[name] = slot;
288
- else if (name.startsWith("cell.") && slot) forwarded[name] = (cellProps) => slot({
289
- ...cellProps,
290
- item: cellProps.row.original
291
- });
432
+ else if (name.startsWith("cell.")) {
433
+ const cellSlot = slots[name];
434
+ forwarded[name] = (cellProps) => cellSlot ? h(CellContent, {
435
+ ...cellProps,
436
+ render: cellSlot
437
+ }) : cellProps.display;
438
+ }
292
439
  return forwarded;
293
440
  };
294
441
  const button = (label, disabled, onClick) => h("button", {
@@ -321,7 +468,7 @@ const VueyeGrid = defineComponent({
321
468
  bordered: props.bordered,
322
469
  hover: false,
323
470
  stickyHeader: props.stickyHeader,
324
- loading: props.loading,
471
+ loading: props.loading || table.loadState === "loading" || table.loadState === "streaming",
325
472
  theme: props.theme,
326
473
  virtual: props.virtual,
327
474
  virtualColumns: props.virtualColumns,
@@ -329,9 +476,15 @@ const VueyeGrid = defineComponent({
329
476
  rowHeight: props.rowHeight,
330
477
  overscan: props.overscan,
331
478
  columnWidth: props.columnWidth,
479
+ treeColumn: props.treeColumn,
480
+ keepAliveDetail: props.keepAliveDetail,
332
481
  ...props.maxHeight ? { style: { "--vt-max-height": props.maxHeight } } : {}
333
482
  }, gridSlots()),
334
- props.pagination ? h(VtToolbar, { class: "vt-footer" }, () => [h(VtStatus), h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)])]) : null
483
+ props.pagination || table.loadingMode || slots.status || table.tree ? h(VtToolbar, { class: "vt-footer" }, () => [
484
+ h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : void 0),
485
+ ...table.loadingMode ? [h(VtLoadMore)] : [],
486
+ props.pagination && table.paginate ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
487
+ ]) : null
335
488
  ]);
336
489
  }
337
490
  });
@@ -348,7 +501,7 @@ const VueyeTable = defineComponent({
348
501
  props: {
349
502
  data: {
350
503
  type: Array,
351
- required: true
504
+ default: () => []
352
505
  },
353
506
  ...commonProps,
354
507
  /** `true` or `"multiple"` for checkboxes, `"single"` for one row at a time. */
@@ -361,14 +514,6 @@ const VueyeTable = defineComponent({
361
514
  default: void 0
362
515
  },
363
516
  /** The data is one page from a server; `rowCount` is the total. */
364
- manual: {
365
- type: Boolean,
366
- default: false
367
- },
368
- rowCount: {
369
- type: Number,
370
- default: void 0
371
- },
372
517
  /** Shown instead of the empty state while `loading` and there are no rows yet. */
373
518
  loadingText: {
374
519
  type: String,
@@ -378,7 +523,9 @@ const VueyeTable = defineComponent({
378
523
  emits: {
379
524
  ...Object.fromEntries(stateEmits.map((name) => [name, null])),
380
525
  "state-change": (_state) => true,
381
- "row-click": (_item, _row) => true
526
+ "row-click": (_item, _row) => true,
527
+ expand: (_item, _row) => true,
528
+ collapse: (_item, _row) => true
382
529
  },
383
530
  slots: Object,
384
531
  setup(props, { emit, slots, expose }) {
@@ -390,11 +537,15 @@ const VueyeTable = defineComponent({
390
537
  const resolveColumns = createColumnResolver();
391
538
  let binding;
392
539
  const table = useDataTable({
540
+ ...expansionOptions(props, !!slots.expanded),
393
541
  data: () => props.data,
542
+ source: computed(() => props.source),
543
+ loadMore: computed(() => props.loadMore),
544
+ endThreshold: props.endThreshold,
394
545
  columns: () => resolveColumns(props.columns, props.data),
395
546
  rowKey: props.rowKey,
396
547
  manual: props.manual,
397
- paginate: props.paginate ?? !props.virtual,
548
+ paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),
398
549
  rowCount: () => props.rowCount,
399
550
  selectionMode: selectionMode.value,
400
551
  selectScope: props.selectScope,
@@ -402,42 +553,65 @@ const VueyeTable = defineComponent({
402
553
  state: () => controlledState(props, binding?.table.getState().pagination ?? initialPagination),
403
554
  onStateChange(state, previous) {
404
555
  emitStateChanges(emit, state, previous);
556
+ emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());
405
557
  emit("state-change", state);
406
558
  }
407
559
  });
408
560
  binding = table;
409
561
  provideDataTable(table);
410
562
  expose({ table });
563
+ const busy = () => props.loading || table.loadState === "loading" || table.loadState === "streaming";
411
564
  const selectable = () => selectionMode.value !== "none";
412
565
  const cell = (row, column) => {
413
566
  const slot = slots[`cell.${column.id}`];
567
+ const treeCell = table.tree && column.id === resolveTreeColumn(table, props.treeColumn);
414
568
  return h(DataTableCell, {
415
569
  key: column.id,
416
570
  row,
417
- column
418
- }, slot ? { default: ({ value, display }) => slot({
419
- item: row.original,
420
- row,
421
- value,
422
- display,
423
- column
424
- }) } : void 0);
571
+ column,
572
+ tree: false
573
+ }, {
574
+ default: ({ value, display }) => {
575
+ const content = () => slot ? h(CellContent, {
576
+ row,
577
+ column,
578
+ value,
579
+ display,
580
+ render: slot
581
+ }) : display;
582
+ return treeCell ? h(VtTreeCell, { row }, { default: content }) : content();
583
+ },
584
+ $stable: true
585
+ });
425
586
  };
426
- const body = (rows = table.rows) => {
427
- const width = table.columns.length + (selectable() ? 1 : 0);
587
+ const hasDetails = () => !!slots.expanded && !table.tree;
588
+ const width = () => table.columns.length + (selectable() ? 1 : 0) + (hasDetails() ? 1 : 0);
589
+ const emptyBody = () => {
428
590
  if (table.rows.length === 0) {
429
- const content = props.loading ? slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }) : slots.empty?.({}) ?? h(VtEmpty);
430
- return h("tr", { "data-empty": "" }, [h("td", { colspan: Math.max(1, width) }, content)]);
591
+ const content = busy() ? slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }) : slots.empty?.({}) ?? h(VtEmpty, { text: table.loadingMode && table.loadState === "error" ? "Could not load rows." : "No matching rows" });
592
+ return h("tr", { "data-empty": "" }, [h("td", { colspan: Math.max(1, width()) }, content)]);
431
593
  }
432
- return rows.map((row) => h(DataTableRow, {
433
- key: row.key,
434
- row,
435
- onClick: () => emit("row-click", row.original, row)
436
- }, () => [selectable() ? h("td", {
437
- class: "vt-selection-cell",
438
- onClick: (event) => event.stopPropagation()
439
- }, [h(DataTableSelectRow, { row })]) : null, ...table.columns.map((column) => cell(row, column))]));
594
+ return null;
595
+ };
596
+ const cells = (row) => {
597
+ return [
598
+ hasDetails() ? h("td", { class: "vt-expansion-cell" }, [h(VtExpandToggle, { row })]) : null,
599
+ selectable() ? h("td", {
600
+ class: "vt-selection-cell",
601
+ onClick: (event) => event.stopPropagation()
602
+ }, [h(DataTableSelectRow, { row })]) : null,
603
+ ...table.columns.map((column) => cell(row, column))
604
+ ];
440
605
  };
606
+ const bodyRow = ({ row, rowIndex }) => h(DataTableRow, {
607
+ key: row.key,
608
+ row,
609
+ rowIndex,
610
+ onClick: () => emit("row-click", row.original, row)
611
+ }, {
612
+ default: () => cells(row),
613
+ $stable: true
614
+ });
441
615
  const headerSlots = () => {
442
616
  const forwarded = {};
443
617
  for (const column of table.columns) {
@@ -446,10 +620,14 @@ const VueyeTable = defineComponent({
446
620
  }
447
621
  return {
448
622
  ...forwarded,
449
- before: () => selectable() ? h("th", {
623
+ before: () => [hasDetails() ? h("th", {
624
+ class: "vt-expansion-cell",
625
+ scope: "col",
626
+ "aria-label": "Details"
627
+ }) : null, selectable() ? h("th", {
450
628
  class: "vt-selection-cell",
451
629
  scope: "col"
452
- }, selectionMode.value === "multiple" ? [h(DataTableSelectAll)] : []) : null
630
+ }, selectionMode.value === "multiple" ? [h(DataTableSelectAll)] : []) : null]
453
631
  };
454
632
  };
455
633
  const tableContent = () => {
@@ -458,8 +636,12 @@ const VueyeTable = defineComponent({
458
636
  h(VtHeader, null, headerSlots()),
459
637
  h(DataTableBody, {
460
638
  class: "vt-body",
461
- colspan: table.columns.length + (selectable() ? 1 : 0)
462
- }, { default: ({ rows }) => body(rows) })
639
+ colspan: width()
640
+ }, {
641
+ ...table.rows.length === 0 ? { default: emptyBody } : {},
642
+ row: bodyRow,
643
+ detail: slots.expanded ? (detail) => slots.expanded?.(detail) : void 0
644
+ })
463
645
  ];
464
646
  return props.virtual ? h(DataTableViewport, {
465
647
  class: "vt-scroll",
@@ -470,12 +652,17 @@ const VueyeTable = defineComponent({
470
652
  class: "vt-table",
471
653
  virtual: props.virtual,
472
654
  rowHeight: props.rowHeight,
473
- overscan: props.overscan
474
- }, children) }) : h("div", { class: "vt-scroll" }, [h("table", {
655
+ overscan: props.overscan,
656
+ treeColumn: props.treeColumn,
657
+ keepAliveDetail: props.keepAliveDetail
658
+ }, children) }) : h("div", { class: "vt-scroll" }, [h(DataTableRoot, {
659
+ table,
660
+ treeColumn: props.treeColumn,
661
+ keepAliveDetail: props.keepAliveDetail,
475
662
  class: "vt-table",
476
- "aria-rowcount": table.rowCount + 1,
477
- "aria-colcount": table.columns.length
478
- }, children())]);
663
+ "aria-colcount": table.columns.length,
664
+ "aria-busy": busy() ? "true" : void 0
665
+ }, children)]);
479
666
  };
480
667
  return () => h("div", {
481
668
  class: "vt-surface vueye-table",
@@ -485,7 +672,7 @@ const VueyeTable = defineComponent({
485
672
  "data-hover": props.hover ? "" : void 0,
486
673
  "data-sticky-header": props.stickyHeader || props.virtual ? "" : void 0,
487
674
  "data-virtual": props.virtual ? "" : void 0,
488
- "data-loading": props.loading ? "" : void 0,
675
+ "data-loading": busy() ? "" : void 0,
489
676
  "data-vt-theme": props.theme,
490
677
  "aria-busy": props.loading ? "true" : void 0,
491
678
  style: props.maxHeight ? { "--vt-max-height": props.maxHeight } : void 0
@@ -501,10 +688,11 @@ const VueyeTable = defineComponent({
501
688
  role: "presentation"
502
689
  }),
503
690
  tableContent(),
504
- props.pagination && (!props.virtual || table.paginate) || slots.footer ? h(VtToolbar, { class: "vt-footer" }, () => [
691
+ props.pagination && (!props.virtual || table.paginate) || slots.footer || slots.status || table.tree || table.loadingMode ? h(VtToolbar, { class: "vt-footer" }, () => [
505
692
  h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : props.loading && table.rows.length === 0 ? { default: () => props.loadingText } : void 0),
693
+ ...table.loadingMode ? [h(VtLoadMore)] : [],
506
694
  slots.footer?.({ table }),
507
- props.pagination && (!props.virtual || table.paginate) ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
695
+ props.pagination && table.paginate && (!props.virtual || table.paginate) ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
508
696
  ]) : null
509
697
  ])]);
510
698
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/shared.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/plugin.ts"],"sourcesContent":["import {\n inferColumns,\n type AnyColumnDef,\n type PaginationState,\n type RowKey,\n type SelectScope,\n type SortRule,\n type TableState,\n type TableStatePatch,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { PropType } from \"vue\";\n\n/** Props both full components share. */\nexport const commonProps = {\n ...virtualProps,\n /** Override the virtual default of no pagination; permits virtualizing a large page. */\n paginate: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Column definitions. Without them, columns are inferred from the data. */\n columns: { type: Array as PropType<readonly AnyColumnDef[]>, default: undefined },\n /** A path into each row, or a function, giving its key. Defaults to `id`, then position. */\n rowKey: {\n type: [String, Function] as PropType<string | ((row: any, index: number) => RowKey)>,\n default: undefined,\n },\n caption: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n density: { type: String as PropType<Density>, default: \"comfortable\" },\n striped: { type: Boolean, default: false },\n bordered: { type: Boolean, default: false },\n hover: { type: Boolean, default: true },\n stickyHeader: { type: Boolean, default: false },\n theme: { type: String as PropType<\"light\" | \"dark\">, default: undefined },\n /** A CSS height that makes the body scroll, such as `\"24rem\"`. */\n maxHeight: { type: String, default: undefined },\n\n searchable: { type: Boolean, default: true },\n searchPlaceholder: { type: String, default: \"Search…\" },\n columnToggle: { type: Boolean, default: true },\n pagination: { type: Boolean, default: true },\n pageSizeOptions: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n\n page: { type: Number, default: undefined },\n pageSize: { type: Number, default: undefined },\n sorting: { type: Array as PropType<readonly SortRule[]>, default: undefined },\n search: { type: String, default: undefined },\n filters: { type: Object as PropType<Readonly<Record<string, unknown>>>, default: undefined },\n hiddenColumns: { type: Array as PropType<readonly string[]>, default: undefined },\n selectScope: { type: String as PropType<SelectScope>, default: \"all\" },\n} as const;\n\nexport const stateEmits = [\n \"update:page\",\n \"update:pageSize\",\n \"update:sorting\",\n \"update:search\",\n \"update:filters\",\n \"update:hiddenColumns\",\n \"update:selected\",\n] as const;\n\ninterface ControlledProps {\n readonly page: number | undefined;\n readonly pageSize: number | undefined;\n readonly sorting: readonly SortRule[] | undefined;\n readonly search: string | undefined;\n readonly filters: Readonly<Record<string, unknown>> | undefined;\n readonly hiddenColumns: readonly string[] | undefined;\n readonly selected?: readonly RowKey[] | undefined;\n}\n\n/** The state a parent controls through `v-model`, as a table state patch. */\nexport function controlledState(props: ControlledProps, current: PaginationState): TableStatePatch {\n return {\n sorting: props.sorting,\n search: props.search,\n filters: props.filters,\n hiddenColumns: props.hiddenColumns,\n selection: props.selected,\n pagination:\n props.page !== undefined || props.pageSize !== undefined\n ? { page: props.page ?? current.page, pageSize: props.pageSize ?? current.pageSize }\n : undefined,\n };\n}\n\n/**\n * Emit a `v-model` update for each piece of state that changed. The state is frozen and replaced\n * piece by piece, so identity tells what changed.\n */\nexport function emitStateChanges(\n emit: (event: (typeof stateEmits)[number], value: unknown) => void,\n state: TableState,\n previous: TableState,\n): void {\n if (state.pagination.page !== previous.pagination.page) {\n emit(\"update:page\", state.pagination.page);\n }\n if (state.pagination.pageSize !== previous.pagination.pageSize) {\n emit(\"update:pageSize\", state.pagination.pageSize);\n }\n if (state.sorting !== previous.sorting) {\n emit(\"update:sorting\", state.sorting);\n }\n if (state.search !== previous.search) {\n emit(\"update:search\", state.search);\n }\n if (state.filters !== previous.filters) {\n emit(\"update:filters\", state.filters);\n }\n if (state.hiddenColumns !== previous.hiddenColumns) {\n emit(\"update:hiddenColumns\", state.hiddenColumns);\n }\n if (state.selection !== previous.selection) {\n emit(\"update:selected\", state.selection);\n }\n}\n\n/**\n * The given columns, or columns inferred from the data. Inferred columns are reused while the\n * data keeps the same fields, so an edit that replaces the array does not rebuild every row.\n */\nexport function createColumnResolver(): (\n columns: readonly AnyColumnDef[] | undefined,\n data: readonly unknown[],\n) => readonly AnyColumnDef[] {\n let inferred:\n | { readonly signature: string; readonly columns: readonly AnyColumnDef[] }\n | undefined;\n return (columns, data) => {\n if (columns) {\n return columns;\n }\n const next = inferColumns(data);\n const signature = next.map((column) => column.id).join(\"\\u0000\");\n if (inferred?.signature !== signature) {\n inferred = { signature, columns: next };\n }\n return inferred.columns;\n };\n}\n","import type { CellChange, ColumnDef, TableIssue, TableState } from \"@vueye-table/core\";\nimport type { GridCellSlotProps } from \"@vueye-table/headless\";\nimport {\n VtGrid,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNode } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n} from \"./shared\";\n\n/**\n * An editable spreadsheet over an array. Cells are edited in place with the keyboard or a double\n * click, ranges are selected with Shift or by dragging, and copy, cut, paste, clear, undo, and\n * redo work like a spreadsheet application. Every edit produces a new array through\n * `update:data`; the array passed in is never mutated.\n */\nexport const VueyeGrid = defineComponent({\n name: \"VueyeGrid\",\n slots: Object as SlotsType<\n { [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown } } & {\n default?: (props: Record<string, unknown>) => VNode[];\n }\n >,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, required: true },\n ...commonProps,\n searchable: { type: Boolean, default: false },\n columnToggle: { type: Boolean, default: false },\n /** Page the grid. By default every row is on one page. */\n pagination: { type: Boolean, default: false },\n /** Columns are editable unless their definition says otherwise. Set `false` to lock all. */\n editable: { type: Boolean, default: true },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n label: { type: String, default: \"Spreadsheet\" },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n export: (_csv: string) => true,\n } as { [K in (typeof stateEmits)[number]]: null } & {\n \"state-change\": (state: TableState) => boolean;\n \"update:data\": (data: readonly unknown[]) => boolean;\n edit: (changes: readonly CellChange<unknown>[]) => boolean;\n \"edit-error\": (issues: readonly TableIssue[]) => boolean;\n export: (csv: string) => boolean;\n },\n setup(props, { emit, slots, expose, attrs }) {\n const resolveColumns = createColumnResolver();\n const columns = computed(() =>\n resolveColumns(props.columns, props.data).map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n ),\n );\n const everyRow = (): number => Math.max(1, props.data.length);\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pagination ? (props.pageSize ?? props.pageSizeOptions[0] ?? 10) : everyRow(),\n };\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n data: () => props.data,\n columns,\n rowKey: props.rowKey as never,\n paginate: props.paginate ?? (props.virtual ? props.pagination : true),\n selectionMode: \"none\",\n initialState: { pagination: initialPagination },\n state: () => {\n const controlled = controlledState(\n props,\n binding?.table.getState().pagination ?? initialPagination,\n );\n return {\n ...controlled,\n selection: undefined,\n pagination: props.pagination ? controlled.pagination : { page: 1, pageSize: everyRow() },\n };\n },\n onEditIssues(issues) {\n emit(\"edit-error\", issues);\n },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n // `cell.<id>` slots also receive the row's data as `item`, as they do on `<VueyeTable>`.\n const gridSlots = (): Record<string, unknown> => {\n const forwarded: Record<string, unknown> = {};\n for (const [name, slot] of Object.entries(slots)) {\n if (name === \"default\" && slot) {\n forwarded[name] = slot;\n } else if (name.startsWith(\"cell.\") && slot) {\n forwarded[name] = (cellProps: GridCellSlotProps) =>\n slot({ ...cellProps, item: cellProps.row.original });\n }\n }\n return forwarded;\n };\n\n const button = (label: string, disabled: boolean, onClick: () => void) =>\n h(\"button\", { type: \"button\", class: \"vt-button\", disabled, onClick }, label);\n\n return () =>\n h(\"div\", { class: \"vt-theme vueye-grid\", \"data-vt-theme\": props.theme }, [\n props.toolbar || props.searchable\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(\"Undo\", !table.canUndo, () => table.undo()),\n button(\"Redo\", !table.canRedo, () => table.redo()),\n button(\"Export CSV\", false, () => emit(\"export\", table.exportRows())),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n columnLetters: props.columnLetters,\n density: props.density,\n striped: props.striped,\n bordered: props.bordered,\n hover: false,\n stickyHeader: props.stickyHeader,\n loading: props.loading,\n theme: props.theme,\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n height: props.height,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(VtStatus),\n h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ]),\n ])\n : null,\n ]);\n },\n});\n","import type { ColumnDef, RowKey, TableRow, TableState } from \"@vueye-table/core\";\nimport {\n DataTableBody,\n DataTableCaption,\n DataTableCell,\n DataTableRow,\n DataTableSelectAll,\n DataTableSelectRow,\n DataTableRoot,\n DataTableViewport,\n} from \"@vueye-table/headless\";\nimport {\n VtColumnVisibility,\n VtEmpty,\n VtHeader,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNodeChild } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n} from \"./shared\";\n\n/** Slot props of `cell.<column id>` and `cell`. */\nexport interface CellSlotProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly column: { readonly id: string; readonly header: string };\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport interface StatusSlotProps {\n readonly start: number;\n readonly end: number;\n readonly rowCount: number;\n readonly totalRowCount: number;\n readonly selectedCount: number;\n}\n\n/**\n * A complete data table: search, column visibility, sorting, selection, pagination, a live\n * status line, loading and empty states, and theming. Every piece of state is available as a\n * `v-model`, and `manual` hands searching, sorting, and paging to a server.\n */\nexport const VueyeTable = defineComponent({\n name: \"VueyeTable\",\n props: {\n data: { type: Array as PropType<readonly unknown[]>, required: true },\n ...commonProps,\n /** `true` or `\"multiple\"` for checkboxes, `\"single\"` for one row at a time. */\n selectable: {\n type: [Boolean, String] as PropType<boolean | \"single\" | \"multiple\">,\n default: false,\n },\n selected: { type: Array as PropType<readonly RowKey[]>, default: undefined },\n /** The data is one page from a server; `rowCount` is the total. */\n manual: { type: Boolean, default: false },\n rowCount: { type: Number as PropType<number | undefined>, default: undefined },\n /** Shown instead of the empty state while `loading` and there are no rows yet. */\n loadingText: { type: String, default: \"Loading…\" },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n } as {\n [K in (typeof stateEmits)[number]]: null;\n } & {\n \"state-change\": (state: TableState) => boolean;\n \"row-click\": (item: unknown, row: TableRow<unknown>) => boolean;\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `header.${string}`]: { column: { id: string; header: string } };\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n }\n >,\n setup(props, { emit, slots, expose }) {\n const selectionMode = computed(() =>\n props.selectable === false ? \"none\" : props.selectable === \"single\" ? \"single\" : \"multiple\",\n );\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pageSize ?? props.pageSizeOptions[0] ?? 10,\n };\n const resolveColumns = createColumnResolver();\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n data: () => props.data,\n columns: () => resolveColumns(props.columns, props.data) as readonly ColumnDef<unknown>[],\n rowKey: props.rowKey as never,\n manual: props.manual,\n paginate: props.paginate ?? !props.virtual,\n rowCount: () => props.rowCount,\n selectionMode: selectionMode.value,\n selectScope: props.selectScope,\n initialState: { pagination: initialPagination },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n const selectable = (): boolean => selectionMode.value !== \"none\";\n\n const cell = (row: TableRow<unknown>, column: (typeof table.columns)[number]): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n return h(\n DataTableCell,\n { key: column.id, row, column },\n slot\n ? {\n default: ({ value, display }: { value: unknown; display: string }) =>\n slot({ item: row.original, row, value, display, column }),\n }\n : undefined,\n );\n };\n\n const body = (rows: readonly TableRow<unknown>[] = table.rows): VNodeChild => {\n const width = table.columns.length + (selectable() ? 1 : 0);\n if (table.rows.length === 0) {\n // While the first page is loading there is nothing to match yet, so say that instead.\n const content = props.loading\n ? (slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }))\n : (slots.empty?.({}) ?? h(VtEmpty));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width) }, content)]);\n }\n return rows.map((row) =>\n h(\n DataTableRow,\n { key: row.key, row, onClick: () => emit(\"row-click\", row.original, row) },\n () => [\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column)),\n ],\n ),\n );\n };\n\n const headerSlots = () => {\n const forwarded: Record<string, unknown> = {};\n for (const column of table.columns) {\n const slot = slots[`header.${column.id}`];\n if (slot) {\n forwarded[`header.${column.id}`] = () => slot({ column });\n }\n }\n return {\n ...forwarded,\n before: () =>\n selectable()\n ? h(\n \"th\",\n { class: \"vt-selection-cell\", scope: \"col\" },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n };\n };\n\n const tableContent = (): VNodeChild => {\n const children = () => [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(\n DataTableBody,\n { class: \"vt-body\", colspan: table.columns.length + (selectable() ? 1 : 0) },\n { default: ({ rows }: { rows: readonly TableRow<unknown>[] }) => body(rows) },\n ),\n ];\n return props.virtual\n ? h(\n DataTableViewport,\n {\n class: \"vt-scroll\",\n height: props.height ?? \"24rem\",\n style: { \"--vt-row-height\": `${props.rowHeight}px` },\n },\n {\n default: () =>\n h(\n DataTableRoot,\n {\n table,\n class: \"vt-table\",\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n \"table\",\n {\n class: \"vt-table\",\n \"aria-rowcount\": table.rowCount + 1,\n \"aria-colcount\": table.columns.length,\n },\n children(),\n ),\n ]);\n };\n\n return () =>\n h(\n \"div\",\n {\n class: \"vt-surface vueye-table\",\n \"data-density\": props.density,\n \"data-striped\": props.striped ? \"\" : undefined,\n \"data-bordered\": props.bordered ? \"\" : undefined,\n \"data-hover\": props.hover ? \"\" : undefined,\n \"data-sticky-header\": props.stickyHeader || props.virtual ? \"\" : undefined,\n \"data-virtual\": props.virtual ? \"\" : undefined,\n \"data-loading\": props.loading ? \"\" : undefined,\n \"data-vt-theme\": props.theme,\n \"aria-busy\": props.loading ? \"true\" : undefined,\n style: props.maxHeight ? { \"--vt-max-height\": props.maxHeight } : undefined,\n },\n [\n h(\"div\", { class: \"vt-root\" }, [\n props.searchable || props.columnToggle || slots.toolbar\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n slots.toolbar?.({ table }),\n props.columnToggle ? h(VtColumnVisibility) : null,\n ])\n : null,\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n tableContent(),\n (props.pagination && (!props.virtual || table.paginate)) || slots.footer\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: StatusSlotProps) => slots.status?.(status) }\n : props.loading && table.rows.length === 0\n ? { default: () => props.loadingText }\n : undefined,\n ),\n slots.footer?.({ table }),\n props.pagination && (!props.virtual || table.paginate)\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]),\n ],\n );\n },\n});\n","import type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Register `<VueyeTable>` and `<VueyeGrid>` globally. */\nexport const VueyeTablePlugin: Plugin = {\n install(app: App): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,cAAc;CACzB,GAAG;;CAEH,UAAU;EAAE,MAAM;EAA0C,SAAS;CAAU;;CAE/E,SAAS;EAAE,MAAM;EAA4C,SAAS;CAAU;;CAEhF,QAAQ;EACN,MAAM,CAAC,QAAQ,QAAQ;EACvB,SAAS;CACX;CACA,SAAS;EAAE,MAAM;EAAQ,SAAS;CAAU;CAC5C,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,SAAS;EAAE,MAAM;EAA6B,SAAS;CAAc;CACrE,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,UAAU;EAAE,MAAM;EAAS,SAAS;CAAM;CAC1C,OAAO;EAAE,MAAM;EAAS,SAAS;CAAK;CACtC,cAAc;EAAE,MAAM;EAAS,SAAS;CAAM;CAC9C,OAAO;EAAE,MAAM;EAAsC,SAAS;CAAU;;CAExE,WAAW;EAAE,MAAM;EAAQ,SAAS;CAAU;CAE9C,YAAY;EAAE,MAAM;EAAS,SAAS;CAAK;CAC3C,mBAAmB;EAAE,MAAM;EAAQ,SAAS;CAAU;CACtD,cAAc;EAAE,MAAM;EAAS,SAAS;CAAK;CAC7C,YAAY;EAAE,MAAM;EAAS,SAAS;CAAK;CAC3C,iBAAiB;EAAE,MAAM;EAAsC,eAAe;GAAC;GAAG;GAAI;GAAI;EAAE;CAAE;CAE9F,MAAM;EAAE,MAAM;EAAQ,SAAS;CAAU;CACzC,U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AkB,IAAI;GAC/C,CAAC,IACD;GACJ,EAAE,OAAO;IAAE,OAAO;IAAe,MAAM;GAAe,CAAC;GACvD,aAAa;GACZ,MAAM,eAAe,CAAC,MAAM,WAAW,MAAM,aAAc,MAAM,SAC9D,EAAE,WAAW,EAAE,OAAO,YAAY,SAAS;IACzC,EACE,UACA,MACA,MAAM,SACF,EAAE,UAAU,WAA4B,MAAM,SAAS,MAAM,EAAE,IAC/D,MAAM,WAAW,MAAM,KAAK,WAAW,IACrC,EAAE,eAAe,MAAM,YAAY,IACnC,MACR;IACA,MAAM,SAAS,EAAE,MAAM,CAAC;IACxB,MAAM,eAAe,CAAC,MAAM,WAAW,MAAM,YACzC,EAAE,OAAO,EAAE,OAAO,qBAAqB,GAAG,CACxC,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;CACJ;AACF,CAAC;;;;;AC5RD,MAAa,mBAA2B,EACtC,QAAQ,KAAgB;CACtB,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;AACtC,EACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/shared.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/plugin.ts"],"sourcesContent":["import {\n inferColumns,\n type AnyColumnDef,\n type PaginationState,\n type RowKey,\n type SelectScope,\n type SortRule,\n type TableState,\n type TableStatePatch,\n type ExpandedState,\n type ExpandMode,\n type TreeOptions,\n type TableRow,\n type TableColumn,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport { hierarchyProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { TableSource, LoadMore } from \"@vueye-table/vue\";\nimport { defineComponent, type PropType, type VNodeChild } from \"vue\";\n\ninterface ContentProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly column: TableColumn<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly editable: boolean;\n}\n/** Isolate application cell slots from unrelated table/grid navigation updates. */\nexport const CellContent = defineComponent({\n name: \"VueyeCellContent\",\n props: {\n row: { type: Object as PropType<TableRow<unknown>>, required: true },\n column: { type: Object as PropType<TableColumn<unknown>>, required: true },\n value: { type: null as unknown as PropType<unknown>, required: true },\n display: { type: String, required: true },\n editable: { type: Boolean, default: false },\n render: { type: Function as PropType<(props: ContentProps) => VNodeChild>, required: true },\n },\n setup(props) {\n return () =>\n props.render({\n item: props.row.original,\n row: props.row,\n column: props.column,\n value: props.value,\n display: props.display,\n editable: props.editable,\n });\n },\n});\n\n/** Props both full components share. */\nexport const commonProps = {\n ...virtualProps,\n ...hierarchyProps,\n rowCanExpand: {\n type: Function as PropType<((row: any) => boolean) | undefined>,\n default: undefined,\n },\n expandMode: { type: String as PropType<ExpandMode>, default: \"multiple\" },\n expanded: { type: [Boolean, Array] as PropType<ExpandedState | undefined>, default: undefined },\n getChildren: { type: Function as PropType<TreeOptions<any>[\"getChildren\"]>, default: undefined },\n setChildren: { type: Function as PropType<TreeOptions<any>[\"setChildren\"]>, default: undefined },\n getParentKey: {\n type: Function as PropType<TreeOptions<any>[\"getParentKey\"]>,\n default: undefined,\n },\n hasChildren: { type: Function as PropType<TreeOptions<any>[\"hasChildren\"]>, default: undefined },\n loadChildren: {\n type: Function as PropType<TreeOptions<any, AbortSignal>[\"loadChildren\"]>,\n default: undefined,\n },\n treeFilter: { type: String as PropType<TreeOptions<unknown>[\"treeFilter\"]>, default: undefined },\n paginateBy: { type: String as PropType<TreeOptions<unknown>[\"paginateBy\"]>, default: undefined },\n source: {\n type: [Object, Function] as PropType<TableSource<unknown> | undefined>,\n default: undefined,\n },\n loadMore: { type: Function as PropType<LoadMore<unknown> | undefined>, default: undefined },\n endThreshold: { type: Number, default: 5 },\n manual: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n rowCount: { type: Number as PropType<number | undefined>, default: undefined },\n /** Override the virtual default of no pagination; permits virtualizing a large page. */\n paginate: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Column definitions. Without them, columns are inferred from the data. */\n columns: { type: Array as PropType<readonly AnyColumnDef[]>, default: undefined },\n /** A path into each row, or a function, giving its key. Defaults to `id`, then position. */\n rowKey: {\n type: [String, Function] as PropType<string | ((row: any, index: number) => RowKey)>,\n default: undefined,\n },\n caption: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n density: { type: String as PropType<Density>, default: \"comfortable\" },\n striped: { type: Boolean, default: false },\n bordered: { type: Boolean, default: false },\n hover: { type: Boolean, default: true },\n stickyHeader: { type: Boolean, default: false },\n theme: { type: String as PropType<\"light\" | \"dark\">, default: undefined },\n /** A CSS height that makes the body scroll, such as `\"24rem\"`. */\n maxHeight: { type: String, default: undefined },\n\n searchable: { type: Boolean, default: true },\n searchPlaceholder: { type: String, default: \"Search…\" },\n columnToggle: { type: Boolean, default: true },\n pagination: { type: Boolean, default: true },\n pageSizeOptions: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n\n page: { type: Number, default: undefined },\n pageSize: { type: Number, default: undefined },\n sorting: { type: Array as PropType<readonly SortRule[]>, default: undefined },\n search: { type: String, default: undefined },\n filters: { type: Object as PropType<Readonly<Record<string, unknown>>>, default: undefined },\n hiddenColumns: { type: Array as PropType<readonly string[]>, default: undefined },\n selectScope: { type: String as PropType<SelectScope>, default: \"all\" },\n} as const;\n\nexport const stateEmits = [\n \"update:page\",\n \"update:pageSize\",\n \"update:sorting\",\n \"update:search\",\n \"update:filters\",\n \"update:hiddenColumns\",\n \"update:selected\",\n \"update:expanded\",\n] as const;\n\ninterface ControlledProps {\n readonly page: number | undefined;\n readonly pageSize: number | undefined;\n readonly sorting: readonly SortRule[] | undefined;\n readonly search: string | undefined;\n readonly filters: Readonly<Record<string, unknown>> | undefined;\n readonly hiddenColumns: readonly string[] | undefined;\n readonly selected?: readonly RowKey[] | undefined;\n readonly expanded?: ExpandedState | undefined;\n}\n\n/** The state a parent controls through `v-model`, as a table state patch. */\nexport function controlledState(props: ControlledProps, current: PaginationState): TableStatePatch {\n return {\n sorting: props.sorting,\n search: props.search,\n filters: props.filters,\n hiddenColumns: props.hiddenColumns,\n selection: props.selected,\n expanded: props.expanded,\n pagination:\n props.page !== undefined || props.pageSize !== undefined\n ? { page: props.page ?? current.page, pageSize: props.pageSize ?? current.pageSize }\n : undefined,\n };\n}\n\n/**\n * Emit a `v-model` update for each piece of state that changed. The state is frozen and replaced\n * piece by piece, so identity tells what changed.\n */\nexport function emitStateChanges(\n emit: (event: (typeof stateEmits)[number], value: unknown) => void,\n state: TableState,\n previous: TableState,\n): void {\n if (state.pagination.page !== previous.pagination.page) {\n emit(\"update:page\", state.pagination.page);\n }\n if (state.pagination.pageSize !== previous.pagination.pageSize) {\n emit(\"update:pageSize\", state.pagination.pageSize);\n }\n if (state.sorting !== previous.sorting) {\n emit(\"update:sorting\", state.sorting);\n }\n if (state.search !== previous.search) {\n emit(\"update:search\", state.search);\n }\n if (state.filters !== previous.filters) {\n emit(\"update:filters\", state.filters);\n }\n if (state.hiddenColumns !== previous.hiddenColumns) {\n emit(\"update:hiddenColumns\", state.hiddenColumns);\n }\n if (state.selection !== previous.selection) {\n emit(\"update:selected\", state.selection);\n }\n if (state.expanded !== previous.expanded) emit(\"update:expanded\", state.expanded);\n}\n\nexport function expansionOptions(\n props: {\n readonly rowCanExpand: ((row: any) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n } & TreeOptions<unknown, AbortSignal>,\n detail: boolean,\n): TreeOptions<unknown, AbortSignal> & {\n readonly getRowCanExpand: ((row: unknown) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n} {\n return {\n getRowCanExpand: props.rowCanExpand ?? (detail ? () => true : undefined),\n expandMode: props.expandMode,\n getChildren: props.getChildren,\n setChildren: props.setChildren,\n getParentKey: props.getParentKey,\n hasChildren: props.hasChildren,\n loadChildren: props.loadChildren,\n treeFilter: props.treeFilter,\n paginateBy: props.paginateBy,\n };\n}\n\nexport function emitExpansionChanges(\n emit: {\n (event: \"expand\", item: unknown, row: TableRow<unknown>): void;\n (event: \"collapse\", item: unknown, row: TableRow<unknown>): void;\n },\n state: TableState,\n previous: TableState,\n table:\n | {\n readonly processedRows: readonly TableRow<unknown>[];\n getRow(key: RowKey): TableRow<unknown> | undefined;\n }\n | undefined,\n): void {\n if (!table || state.expanded === previous.expanded) return;\n const keys = new Set([\n ...table.processedRows.map((row) => row.key),\n ...(state.expanded === true ? [] : state.expanded),\n ...(previous.expanded === true ? [] : previous.expanded),\n ]);\n for (const key of keys) {\n const before = previous.expanded === true || previous.expanded.includes(key);\n const after = state.expanded === true || state.expanded.includes(key);\n const row = table.getRow(key);\n if (row?.canExpand && before !== after) {\n if (after) emit(\"expand\", row.original, row);\n else emit(\"collapse\", row.original, row);\n }\n }\n}\n\n/**\n * The given columns, or columns inferred from the data. Inferred columns are reused while the\n * data keeps the same fields, so an edit that replaces the array does not rebuild every row.\n */\nexport function createColumnResolver(): (\n columns: readonly AnyColumnDef[] | undefined,\n data: readonly unknown[],\n) => readonly AnyColumnDef[] {\n let inferred:\n | { readonly signature: string; readonly columns: readonly AnyColumnDef[] }\n | undefined;\n return (columns, data) => {\n if (columns) {\n return columns;\n }\n const next = inferColumns(data);\n const signature = next.map((column) => column.id).join(\"\\u0000\");\n if (inferred?.signature !== signature) {\n inferred = { signature, columns: next };\n }\n return inferred.columns;\n };\n}\n","import type { CellChange, ColumnDef, TableIssue, TableState, TableRow } from \"@vueye-table/core\";\nimport type {\n GridCellSlotProps,\n TableStatusSlotProps,\n DetailSlotProps,\n} from \"@vueye-table/headless\";\nimport {\n VtGrid,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNode } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n} from \"./shared\";\n\n/**\n * An editable spreadsheet over an array. Cells are edited in place with the keyboard or a double\n * click, ranges are selected with Shift or by dragging, and copy, cut, paste, clear, undo, and\n * redo work like a spreadsheet application. Every edit produces a new array through\n * `update:data`; the array passed in is never mutated.\n */\nexport const VueyeGrid = defineComponent({\n name: \"VueyeGrid\",\n slots: Object as SlotsType<\n { [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown } } & {\n default?: (props: Record<string, unknown>) => VNode[];\n status?: (props: TableStatusSlotProps) => VNode[];\n expanded?: (props: DetailSlotProps) => VNode[];\n }\n >,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n searchable: { type: Boolean, default: false },\n columnToggle: { type: Boolean, default: false },\n /** Page the grid. By default every row is on one page. */\n pagination: { type: Boolean, default: false },\n /** Columns are editable unless their definition says otherwise. Set `false` to lock all. */\n editable: { type: Boolean, default: true },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n label: { type: String, default: \"Spreadsheet\" },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n export: (_csv: string) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n } as { [K in (typeof stateEmits)[number]]: null } & {\n \"state-change\": (state: TableState) => boolean;\n \"update:data\": (data: readonly unknown[]) => boolean;\n edit: (changes: readonly CellChange<unknown>[]) => boolean;\n \"edit-error\": (issues: readonly TableIssue[]) => boolean;\n export: (csv: string) => boolean;\n expand: (item: unknown, row: TableRow<unknown>) => boolean;\n collapse: (item: unknown, row: TableRow<unknown>) => boolean;\n },\n setup(props, { emit, slots, expose, attrs }) {\n const resolveColumns = createColumnResolver();\n const columns = computed(() =>\n resolveColumns(props.columns, props.data).map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n ),\n );\n const everyRow = (): number => Math.max(1, props.data.length);\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pagination ? (props.pageSize ?? props.pageSizeOptions[0] ?? 10) : everyRow(),\n };\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n ...expansionOptions(props, !!slots.expanded),\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n manual: props.manual,\n rowCount: () => props.rowCount,\n columns,\n rowKey: props.rowKey as never,\n paginate:\n props.paginate ??\n (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),\n selectionMode: \"none\",\n initialState: { pagination: initialPagination },\n state: () => {\n const controlled = controlledState(\n props,\n binding?.table.getState().pagination ?? initialPagination,\n );\n return {\n ...controlled,\n selection: undefined,\n pagination: props.pagination ? controlled.pagination : { page: 1, pageSize: everyRow() },\n };\n },\n onEditIssues(issues) {\n emit(\"edit-error\", issues);\n },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n // `cell.<id>` slots also receive the row's data as `item`, as they do on `<VueyeTable>`.\n const gridSlots = (): Record<string, unknown> => {\n const forwarded: Record<string, unknown> = {};\n if (slots.expanded) forwarded[\"expanded\"] = slots.expanded;\n for (const [name, slot] of Object.entries(slots)) {\n if (name === \"default\" && slot) {\n forwarded[name] = slot;\n } else if (name.startsWith(\"cell.\")) {\n const cellSlot = slots[name as `cell.${string}`];\n forwarded[name] = (cellProps: GridCellSlotProps) =>\n cellSlot ? h(CellContent, { ...cellProps, render: cellSlot }) : cellProps.display;\n }\n }\n return forwarded;\n };\n\n const button = (label: string, disabled: boolean, onClick: () => void) =>\n h(\"button\", { type: \"button\", class: \"vt-button\", disabled, onClick }, label);\n\n return () =>\n h(\"div\", { class: \"vt-theme vueye-grid\", \"data-vt-theme\": props.theme }, [\n props.toolbar || props.searchable\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(\"Undo\", !table.canUndo, () => table.undo()),\n button(\"Redo\", !table.canRedo, () => table.redo()),\n button(\"Export CSV\", false, () => emit(\"export\", table.exportRows())),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n columnLetters: props.columnLetters,\n density: props.density,\n striped: props.striped,\n bordered: props.bordered,\n hover: false,\n stickyHeader: props.stickyHeader,\n loading:\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\",\n theme: props.theme,\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n height: props.height,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination || table.loadingMode || slots.status || table.tree\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: TableStatusSlotProps) => slots.status?.(status) }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n props.pagination && table.paginate\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]);\n },\n});\n","import type { ColumnDef, RowKey, TableRow, TableState } from \"@vueye-table/core\";\nimport {\n DataTableBody,\n DataTableCaption,\n DataTableCell,\n DataTableRow,\n DataTableSelectAll,\n DataTableSelectRow,\n DataTableRoot,\n DataTableViewport,\n type TableStatusSlotProps,\n type DetailSlotProps,\n resolveTreeColumn,\n} from \"@vueye-table/headless\";\nimport {\n VtColumnVisibility,\n VtEmpty,\n VtHeader,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n VtExpandToggle,\n VtTreeCell,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNodeChild } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n} from \"./shared\";\n\n/** Slot props of `cell.<column id>` and `cell`. */\nexport interface CellSlotProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly column: { readonly id: string; readonly header: string };\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport type StatusSlotProps = TableStatusSlotProps;\n\n/**\n * A complete data table: search, column visibility, sorting, selection, pagination, a live\n * status line, loading and empty states, and theming. Every piece of state is available as a\n * `v-model`, and `manual` hands searching, sorting, and paging to a server.\n */\nexport const VueyeTable = defineComponent({\n name: \"VueyeTable\",\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n /** `true` or `\"multiple\"` for checkboxes, `\"single\"` for one row at a time. */\n selectable: {\n type: [Boolean, String] as PropType<boolean | \"single\" | \"multiple\">,\n default: false,\n },\n selected: { type: Array as PropType<readonly RowKey[]>, default: undefined },\n /** The data is one page from a server; `rowCount` is the total. */\n /** Shown instead of the empty state while `loading` and there are no rows yet. */\n loadingText: { type: String, default: \"Loading…\" },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n } as {\n [K in (typeof stateEmits)[number]]: null;\n } & {\n \"state-change\": (state: TableState) => boolean;\n \"row-click\": (item: unknown, row: TableRow<unknown>) => boolean;\n expand: (item: unknown, row: TableRow<unknown>) => boolean;\n collapse: (item: unknown, row: TableRow<unknown>) => boolean;\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `header.${string}`]: { column: { id: string; header: string } };\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n expanded: DetailSlotProps;\n }\n >,\n setup(props, { emit, slots, expose }) {\n const selectionMode = computed(() =>\n props.selectable === false ? \"none\" : props.selectable === \"single\" ? \"single\" : \"multiple\",\n );\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pageSize ?? props.pageSizeOptions[0] ?? 10,\n };\n const resolveColumns = createColumnResolver();\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n ...expansionOptions(props, !!slots.expanded),\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n columns: () => resolveColumns(props.columns, props.data) as readonly ColumnDef<unknown>[],\n rowKey: props.rowKey as never,\n manual: props.manual,\n paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),\n rowCount: () => props.rowCount,\n selectionMode: selectionMode.value,\n selectScope: props.selectScope,\n initialState: { pagination: initialPagination },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n const busy = (): boolean =>\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\";\n\n const selectable = (): boolean => selectionMode.value !== \"none\";\n\n const cell = (row: TableRow<unknown>, column: (typeof table.columns)[number]): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n const treeCell = table.tree && column.id === resolveTreeColumn(table, props.treeColumn);\n return h(\n DataTableCell,\n { key: column.id, row, column, tree: false },\n {\n default: ({ value, display }: { value: unknown; display: string }) => {\n const content = () =>\n slot ? h(CellContent, { row, column, value, display, render: slot }) : display;\n return treeCell ? h(VtTreeCell, { row }, { default: content }) : content();\n },\n $stable: true,\n },\n );\n };\n\n const hasDetails = (): boolean => !!slots.expanded && !table.tree;\n const width = (): number =>\n table.columns.length + (selectable() ? 1 : 0) + (hasDetails() ? 1 : 0);\n const emptyBody = (): VNodeChild => {\n if (table.rows.length === 0) {\n // While the first page is loading there is nothing to match yet, so say that instead.\n const content = busy()\n ? (slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }))\n : (slots.empty?.({}) ??\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"error\"\n ? \"Could not load rows.\"\n : \"No matching rows\",\n }));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width()) }, content)]);\n }\n return null;\n };\n const cells = (row: TableRow<unknown>): VNodeChild[] => {\n const result = [\n hasDetails() ? h(\"td\", { class: \"vt-expansion-cell\" }, [h(VtExpandToggle, { row })]) : null,\n selectable()\n ? h(\n \"td\",\n { class: \"vt-selection-cell\", onClick: (event: Event) => event.stopPropagation() },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column)),\n ];\n return result;\n };\n const bodyRow = ({ row, rowIndex }: DetailSlotProps): VNodeChild =>\n h(\n DataTableRow,\n { key: row.key, row, rowIndex, onClick: () => emit(\"row-click\", row.original, row) },\n { default: () => cells(row), $stable: true },\n );\n\n const headerSlots = () => {\n const forwarded: Record<string, unknown> = {};\n for (const column of table.columns) {\n const slot = slots[`header.${column.id}`];\n if (slot) {\n forwarded[`header.${column.id}`] = () => slot({ column });\n }\n }\n return {\n ...forwarded,\n before: () => [\n hasDetails()\n ? h(\"th\", { class: \"vt-expansion-cell\", scope: \"col\", \"aria-label\": \"Details\" })\n : null,\n selectable()\n ? h(\n \"th\",\n { class: \"vt-selection-cell\", scope: \"col\" },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n ],\n };\n };\n\n const tableContent = (): VNodeChild => {\n const children = () => [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(\n DataTableBody,\n { class: \"vt-body\", colspan: width() },\n {\n ...(table.rows.length === 0 ? { default: emptyBody } : {}),\n row: bodyRow,\n detail: slots.expanded\n ? (detail: DetailSlotProps) => slots.expanded?.(detail)\n : undefined,\n },\n ),\n ];\n return props.virtual\n ? h(\n DataTableViewport,\n {\n class: \"vt-scroll\",\n height: props.height ?? \"24rem\",\n style: { \"--vt-row-height\": `${props.rowHeight}px` },\n },\n {\n default: () =>\n h(\n DataTableRoot,\n {\n table,\n class: \"vt-table\",\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n DataTableRoot,\n {\n table,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n class: \"vt-table\",\n \"aria-colcount\": table.columns.length,\n \"aria-busy\": busy() ? \"true\" : undefined,\n },\n children,\n ),\n ]);\n };\n\n return () =>\n h(\n \"div\",\n {\n class: \"vt-surface vueye-table\",\n \"data-density\": props.density,\n \"data-striped\": props.striped ? \"\" : undefined,\n \"data-bordered\": props.bordered ? \"\" : undefined,\n \"data-hover\": props.hover ? \"\" : undefined,\n \"data-sticky-header\": props.stickyHeader || props.virtual ? \"\" : undefined,\n \"data-virtual\": props.virtual ? \"\" : undefined,\n \"data-loading\": busy() ? \"\" : undefined,\n \"data-vt-theme\": props.theme,\n \"aria-busy\": props.loading ? \"true\" : undefined,\n style: props.maxHeight ? { \"--vt-max-height\": props.maxHeight } : undefined,\n },\n [\n h(\"div\", { class: \"vt-root\" }, [\n props.searchable || props.columnToggle || slots.toolbar\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n slots.toolbar?.({ table }),\n props.columnToggle ? h(VtColumnVisibility) : null,\n ])\n : null,\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n tableContent(),\n (props.pagination && (!props.virtual || table.paginate)) ||\n slots.footer ||\n slots.status ||\n table.tree ||\n table.loadingMode\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: StatusSlotProps) => slots.status?.(status) }\n : props.loading && table.rows.length === 0\n ? { default: () => props.loadingText }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n slots.footer?.({ table }),\n props.pagination && table.paginate && (!props.virtual || table.paginate)\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]),\n ],\n );\n },\n});\n","import type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Register `<VueyeTable>` and `<VueyeGrid>` globally. */\nexport const VueyeTablePlugin: Plugin = {\n install(app: App): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,MAAa,cAAc,gBAAgB;CACzC,MAAM;CACN,OAAO;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MAAM,SAAS,MAAM,EAAE,IAC/D,MAAM,WAAW,MAAM,KAAK,WAAW,IACrC,EAAE,eAAe,MAAM,YAAY,IACnC,MACR;IACA,GAAI,MAAM,cAAc,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAC3C,MAAM,SAAS,EAAE,MAAM,CAAC;IACxB,MAAM,cAAc,MAAM,aAAa,CAAC,MAAM,WAAW,MAAM,YAC3D,EAAE,OAAO,EAAE,OAAO,qBAAqB,GAAG,CACxC,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;CACJ;AACF,CAAC;;;;;AC1UD,MAAa,mBAA2B,EACtC,QAAQ,KAAgB;CACtB,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;AACtC,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueye-table",
3
- "version": "3.0.0-alpha.7",
3
+ "version": "3.0.0-alpha.9",
4
4
  "description": "A Vue framework for data tables and spreadsheets: a complete, themeable data table and grid, plus every layer beneath them.",
5
5
  "keywords": [
6
6
  "data-grid",
@@ -42,10 +42,10 @@
42
42
  "provenance": true
43
43
  },
44
44
  "dependencies": {
45
- "@vueye-table/core": "3.0.0-alpha.7",
46
- "@vueye-table/headless": "3.0.0-alpha.7",
47
- "@vueye-table/vue": "3.0.0-alpha.7",
48
- "@vueye-table/styled": "3.0.0-alpha.7"
45
+ "@vueye-table/core": "3.0.0-alpha.9",
46
+ "@vueye-table/headless": "3.0.0-alpha.9",
47
+ "@vueye-table/styled": "3.0.0-alpha.9",
48
+ "@vueye-table/vue": "3.0.0-alpha.9"
49
49
  },
50
50
  "devDependencies": {
51
51
  "vue": "3.5.43",