@vueye-table/styled 3.0.0-alpha.8 → 3.0.0-beta.1
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 +303 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +158 -20
- package/dist/index.js.map +1 -1
- package/dist/style.css +187 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SortInfo, TableColumn, TableRow } from "@vueye-table/core";
|
|
2
|
-
import { GridCellSlotProps } from "@vueye-table/headless";
|
|
2
|
+
import { CellEditorSlotProps, DetailSlotProps, GridCellSlotProps } from "@vueye-table/headless";
|
|
3
3
|
import { AnyDataTableBinding, DataTableBinding } from "@vueye-table/vue";
|
|
4
4
|
import { Component, PropType, SlotsType, VNode, VNodeChild } from "vue";
|
|
5
5
|
//#region src/components.d.ts
|
|
@@ -69,6 +69,14 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
69
69
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
70
70
|
readonly default: undefined;
|
|
71
71
|
};
|
|
72
|
+
treeColumn: {
|
|
73
|
+
readonly type: PropType<string | undefined>;
|
|
74
|
+
readonly default: undefined;
|
|
75
|
+
};
|
|
76
|
+
keepAliveDetail: {
|
|
77
|
+
readonly type: BooleanConstructor;
|
|
78
|
+
readonly default: false;
|
|
79
|
+
};
|
|
72
80
|
virtual: {
|
|
73
81
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
74
82
|
readonly default: false;
|
|
@@ -97,6 +105,10 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
97
105
|
type: PropType<AnyDataTableBinding>;
|
|
98
106
|
required: true;
|
|
99
107
|
};
|
|
108
|
+
leadingColumns: {
|
|
109
|
+
type: NumberConstructor;
|
|
110
|
+
default: number;
|
|
111
|
+
};
|
|
100
112
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
101
113
|
[key: string]: any;
|
|
102
114
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -128,6 +140,14 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
128
140
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
129
141
|
readonly default: undefined;
|
|
130
142
|
};
|
|
143
|
+
treeColumn: {
|
|
144
|
+
readonly type: PropType<string | undefined>;
|
|
145
|
+
readonly default: undefined;
|
|
146
|
+
};
|
|
147
|
+
keepAliveDetail: {
|
|
148
|
+
readonly type: BooleanConstructor;
|
|
149
|
+
readonly default: false;
|
|
150
|
+
};
|
|
131
151
|
virtual: {
|
|
132
152
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
133
153
|
readonly default: false;
|
|
@@ -156,7 +176,12 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
156
176
|
type: PropType<AnyDataTableBinding>;
|
|
157
177
|
required: true;
|
|
158
178
|
};
|
|
179
|
+
leadingColumns: {
|
|
180
|
+
type: NumberConstructor;
|
|
181
|
+
default: number;
|
|
182
|
+
};
|
|
159
183
|
}>> & Readonly<{}>, {
|
|
184
|
+
leadingColumns: number;
|
|
160
185
|
density: Density;
|
|
161
186
|
striped: boolean;
|
|
162
187
|
bordered: boolean;
|
|
@@ -164,6 +189,8 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
164
189
|
stickyHeader: boolean;
|
|
165
190
|
loading: boolean;
|
|
166
191
|
theme: "light" | "dark" | undefined;
|
|
192
|
+
treeColumn: string | undefined;
|
|
193
|
+
keepAliveDetail: boolean;
|
|
167
194
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
168
195
|
height: string | undefined;
|
|
169
196
|
rowHeight: number;
|
|
@@ -174,9 +201,14 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
174
201
|
default?: (props: {
|
|
175
202
|
table: DataTableBinding<unknown>;
|
|
176
203
|
}) => VNode[];
|
|
204
|
+
expanded?: (props: DetailSlotProps) => VNodeChild;
|
|
177
205
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
178
206
|
/** The styled body, with the empty state in a full-width row. */
|
|
179
207
|
declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
208
|
+
treeColumn: {
|
|
209
|
+
type: PropType<string | undefined>;
|
|
210
|
+
default: undefined;
|
|
211
|
+
};
|
|
180
212
|
virtual: {
|
|
181
213
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
182
214
|
readonly default: false;
|
|
@@ -204,6 +236,10 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
204
236
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
205
237
|
[key: string]: any;
|
|
206
238
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
239
|
+
treeColumn: {
|
|
240
|
+
type: PropType<string | undefined>;
|
|
241
|
+
default: undefined;
|
|
242
|
+
};
|
|
207
243
|
virtual: {
|
|
208
244
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
209
245
|
readonly default: false;
|
|
@@ -229,6 +265,7 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
229
265
|
readonly default: 120;
|
|
230
266
|
};
|
|
231
267
|
}>> & Readonly<{}>, {
|
|
268
|
+
treeColumn: string | undefined;
|
|
232
269
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
233
270
|
height: string | undefined;
|
|
234
271
|
rowHeight: number;
|
|
@@ -240,6 +277,8 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
240
277
|
rows: readonly TableRow<unknown>[];
|
|
241
278
|
}) => VNode[];
|
|
242
279
|
empty?: () => VNode[];
|
|
280
|
+
detail?: (props: DetailSlotProps) => VNodeChild;
|
|
281
|
+
row?: (props: DetailSlotProps) => VNodeChild;
|
|
243
282
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
244
283
|
/** The default empty state. */
|
|
245
284
|
declare const VtEmpty: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -392,17 +431,239 @@ declare const VtLoadMore: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
392
431
|
retryLabel: string;
|
|
393
432
|
loadingLabel: string;
|
|
394
433
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
434
|
+
declare const VtDetailRow: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
435
|
+
row: {
|
|
436
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
437
|
+
readonly required: true;
|
|
438
|
+
};
|
|
439
|
+
colspan: {
|
|
440
|
+
type: NumberConstructor;
|
|
441
|
+
default: undefined;
|
|
442
|
+
};
|
|
443
|
+
hidden: {
|
|
444
|
+
type: BooleanConstructor;
|
|
445
|
+
default: boolean;
|
|
446
|
+
};
|
|
447
|
+
keepAlive: {
|
|
448
|
+
type: PropType<boolean | undefined>;
|
|
449
|
+
default: undefined;
|
|
450
|
+
};
|
|
451
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
452
|
+
[key: string]: any;
|
|
453
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
454
|
+
row: {
|
|
455
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
456
|
+
readonly required: true;
|
|
457
|
+
};
|
|
458
|
+
colspan: {
|
|
459
|
+
type: NumberConstructor;
|
|
460
|
+
default: undefined;
|
|
461
|
+
};
|
|
462
|
+
hidden: {
|
|
463
|
+
type: BooleanConstructor;
|
|
464
|
+
default: boolean;
|
|
465
|
+
};
|
|
466
|
+
keepAlive: {
|
|
467
|
+
type: PropType<boolean | undefined>;
|
|
468
|
+
default: undefined;
|
|
469
|
+
};
|
|
470
|
+
}>> & Readonly<{}>, {
|
|
471
|
+
colspan: number;
|
|
472
|
+
hidden: boolean;
|
|
473
|
+
keepAlive: boolean | undefined;
|
|
474
|
+
}, SlotsType<{
|
|
475
|
+
default?: (props: {
|
|
476
|
+
row: TableRow<unknown>;
|
|
477
|
+
}) => VNodeChild;
|
|
478
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
479
|
+
declare const VtExpandToggle: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
480
|
+
readonly row: {
|
|
481
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
482
|
+
readonly required: true;
|
|
483
|
+
};
|
|
484
|
+
readonly controls: {
|
|
485
|
+
readonly type: PropType<string | undefined>;
|
|
486
|
+
readonly default: undefined;
|
|
487
|
+
};
|
|
488
|
+
readonly expandLabel: {
|
|
489
|
+
readonly type: StringConstructor;
|
|
490
|
+
readonly default: "Expand row";
|
|
491
|
+
};
|
|
492
|
+
readonly collapseLabel: {
|
|
493
|
+
readonly type: StringConstructor;
|
|
494
|
+
readonly default: "Collapse row";
|
|
495
|
+
};
|
|
496
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
497
|
+
[key: string]: any;
|
|
498
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
499
|
+
readonly row: {
|
|
500
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
501
|
+
readonly required: true;
|
|
502
|
+
};
|
|
503
|
+
readonly controls: {
|
|
504
|
+
readonly type: PropType<string | undefined>;
|
|
505
|
+
readonly default: undefined;
|
|
506
|
+
};
|
|
507
|
+
readonly expandLabel: {
|
|
508
|
+
readonly type: StringConstructor;
|
|
509
|
+
readonly default: "Expand row";
|
|
510
|
+
};
|
|
511
|
+
readonly collapseLabel: {
|
|
512
|
+
readonly type: StringConstructor;
|
|
513
|
+
readonly default: "Collapse row";
|
|
514
|
+
};
|
|
515
|
+
}>> & Readonly<{}>, {
|
|
516
|
+
readonly controls: string | undefined;
|
|
517
|
+
readonly expandLabel: string;
|
|
518
|
+
readonly collapseLabel: string;
|
|
519
|
+
}, SlotsType<{
|
|
520
|
+
default?: (props: {
|
|
521
|
+
row: TableRow<unknown>;
|
|
522
|
+
expanded: boolean;
|
|
523
|
+
}) => VNodeChild;
|
|
524
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
525
|
+
declare const VtTreeCell: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
526
|
+
readonly row: {
|
|
527
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
528
|
+
readonly required: true;
|
|
529
|
+
};
|
|
530
|
+
readonly as: {
|
|
531
|
+
readonly type: StringConstructor;
|
|
532
|
+
readonly default: string;
|
|
533
|
+
};
|
|
534
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
535
|
+
[key: string]: any;
|
|
536
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
537
|
+
readonly row: {
|
|
538
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
539
|
+
readonly required: true;
|
|
540
|
+
};
|
|
541
|
+
readonly as: {
|
|
542
|
+
readonly type: StringConstructor;
|
|
543
|
+
readonly default: string;
|
|
544
|
+
};
|
|
545
|
+
}>> & Readonly<{}>, {
|
|
546
|
+
readonly as: string;
|
|
547
|
+
}, SlotsType<{
|
|
548
|
+
default?: () => VNodeChild;
|
|
549
|
+
toggle?: (props: {
|
|
550
|
+
row: TableRow<unknown>;
|
|
551
|
+
}) => VNodeChild;
|
|
552
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
395
553
|
/** A horizontal bar for controls above or below a table. */
|
|
396
554
|
declare const VtToolbar: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
397
555
|
[key: string]: any;
|
|
398
556
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
399
557
|
default?: () => VNode[];
|
|
400
558
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
559
|
+
declare const VtCellEditor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
560
|
+
readonly editor: {
|
|
561
|
+
readonly type: PropType<CellEditorSlotProps>;
|
|
562
|
+
readonly required: true;
|
|
563
|
+
};
|
|
564
|
+
readonly spec: {
|
|
565
|
+
readonly type: PropType<import("@vueye-table/core").EditorSpec>;
|
|
566
|
+
readonly default: () => {
|
|
567
|
+
kind: string;
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
readonly finish: {
|
|
571
|
+
readonly type: PropType<((direction?: "up" | "down" | "left" | "right") => void) | undefined>;
|
|
572
|
+
readonly default: undefined;
|
|
573
|
+
};
|
|
574
|
+
readonly autofocus: {
|
|
575
|
+
readonly type: BooleanConstructor;
|
|
576
|
+
readonly default: true;
|
|
577
|
+
};
|
|
578
|
+
readonly blurCommit: {
|
|
579
|
+
readonly type: BooleanConstructor;
|
|
580
|
+
readonly default: true;
|
|
581
|
+
};
|
|
582
|
+
readonly tabCommit: {
|
|
583
|
+
readonly type: BooleanConstructor;
|
|
584
|
+
readonly default: true;
|
|
585
|
+
};
|
|
586
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
587
|
+
[key: string]: any;
|
|
588
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
589
|
+
readonly editor: {
|
|
590
|
+
readonly type: PropType<CellEditorSlotProps>;
|
|
591
|
+
readonly required: true;
|
|
592
|
+
};
|
|
593
|
+
readonly spec: {
|
|
594
|
+
readonly type: PropType<import("@vueye-table/core").EditorSpec>;
|
|
595
|
+
readonly default: () => {
|
|
596
|
+
kind: string;
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
readonly finish: {
|
|
600
|
+
readonly type: PropType<((direction?: "up" | "down" | "left" | "right") => void) | undefined>;
|
|
601
|
+
readonly default: undefined;
|
|
602
|
+
};
|
|
603
|
+
readonly autofocus: {
|
|
604
|
+
readonly type: BooleanConstructor;
|
|
605
|
+
readonly default: true;
|
|
606
|
+
};
|
|
607
|
+
readonly blurCommit: {
|
|
608
|
+
readonly type: BooleanConstructor;
|
|
609
|
+
readonly default: true;
|
|
610
|
+
};
|
|
611
|
+
readonly tabCommit: {
|
|
612
|
+
readonly type: BooleanConstructor;
|
|
613
|
+
readonly default: true;
|
|
614
|
+
};
|
|
615
|
+
}>> & Readonly<{}>, {
|
|
616
|
+
readonly spec: import("@vueye-table/core").EditorSpec;
|
|
617
|
+
readonly finish: ((direction?: "up" | "down" | "left" | "right") => void) | undefined;
|
|
618
|
+
readonly autofocus: boolean;
|
|
619
|
+
readonly blurCommit: boolean;
|
|
620
|
+
readonly tabCommit: boolean;
|
|
621
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
622
|
+
declare const VtRowActions: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
623
|
+
row: {
|
|
624
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
625
|
+
readonly required: true;
|
|
626
|
+
};
|
|
627
|
+
editable: {
|
|
628
|
+
type: BooleanConstructor;
|
|
629
|
+
default: boolean;
|
|
630
|
+
};
|
|
631
|
+
removable: {
|
|
632
|
+
type: BooleanConstructor;
|
|
633
|
+
default: boolean;
|
|
634
|
+
};
|
|
635
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
636
|
+
[key: string]: any;
|
|
637
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
638
|
+
row: {
|
|
639
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
640
|
+
readonly required: true;
|
|
641
|
+
};
|
|
642
|
+
editable: {
|
|
643
|
+
type: BooleanConstructor;
|
|
644
|
+
default: boolean;
|
|
645
|
+
};
|
|
646
|
+
removable: {
|
|
647
|
+
type: BooleanConstructor;
|
|
648
|
+
default: boolean;
|
|
649
|
+
};
|
|
650
|
+
}>> & Readonly<{}>, {
|
|
651
|
+
editable: boolean;
|
|
652
|
+
removable: boolean;
|
|
653
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
401
654
|
/**
|
|
402
655
|
* The styled spreadsheet grid, with optional row numbers and A, B, C column letters. A
|
|
403
656
|
* `cell.<column id>` slot draws that column's cells while they are not being edited.
|
|
404
657
|
*/
|
|
405
658
|
declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
659
|
+
rowActions: {
|
|
660
|
+
type: BooleanConstructor;
|
|
661
|
+
default: boolean;
|
|
662
|
+
};
|
|
663
|
+
removable: {
|
|
664
|
+
type: BooleanConstructor;
|
|
665
|
+
default: boolean;
|
|
666
|
+
};
|
|
406
667
|
density: {
|
|
407
668
|
readonly type: PropType<Density>;
|
|
408
669
|
readonly default: "comfortable";
|
|
@@ -431,6 +692,14 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
431
692
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
432
693
|
readonly default: undefined;
|
|
433
694
|
};
|
|
695
|
+
treeColumn: {
|
|
696
|
+
readonly type: PropType<string | undefined>;
|
|
697
|
+
readonly default: undefined;
|
|
698
|
+
};
|
|
699
|
+
keepAliveDetail: {
|
|
700
|
+
readonly type: BooleanConstructor;
|
|
701
|
+
readonly default: false;
|
|
702
|
+
};
|
|
434
703
|
virtual: {
|
|
435
704
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
436
705
|
readonly default: false;
|
|
@@ -473,7 +742,18 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
473
742
|
};
|
|
474
743
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
475
744
|
[key: string]: any;
|
|
476
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
745
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
746
|
+
save: (_result: unknown) => true;
|
|
747
|
+
cancel: (_key: unknown) => true;
|
|
748
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
749
|
+
rowActions: {
|
|
750
|
+
type: BooleanConstructor;
|
|
751
|
+
default: boolean;
|
|
752
|
+
};
|
|
753
|
+
removable: {
|
|
754
|
+
type: BooleanConstructor;
|
|
755
|
+
default: boolean;
|
|
756
|
+
};
|
|
477
757
|
density: {
|
|
478
758
|
readonly type: PropType<Density>;
|
|
479
759
|
readonly default: "comfortable";
|
|
@@ -502,6 +782,14 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
502
782
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
503
783
|
readonly default: undefined;
|
|
504
784
|
};
|
|
785
|
+
treeColumn: {
|
|
786
|
+
readonly type: PropType<string | undefined>;
|
|
787
|
+
readonly default: undefined;
|
|
788
|
+
};
|
|
789
|
+
keepAliveDetail: {
|
|
790
|
+
readonly type: BooleanConstructor;
|
|
791
|
+
readonly default: false;
|
|
792
|
+
};
|
|
505
793
|
virtual: {
|
|
506
794
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
507
795
|
readonly default: false;
|
|
@@ -542,7 +830,10 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
542
830
|
type: BooleanConstructor;
|
|
543
831
|
default: boolean;
|
|
544
832
|
};
|
|
545
|
-
}>> & Readonly<{
|
|
833
|
+
}>> & Readonly<{
|
|
834
|
+
onCancel?: (_key: unknown) => any;
|
|
835
|
+
onSave?: (_result: unknown) => any;
|
|
836
|
+
}>, {
|
|
546
837
|
label: string | undefined;
|
|
547
838
|
density: Density;
|
|
548
839
|
striped: boolean;
|
|
@@ -551,18 +842,24 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
551
842
|
stickyHeader: boolean;
|
|
552
843
|
loading: boolean;
|
|
553
844
|
theme: "light" | "dark" | undefined;
|
|
845
|
+
treeColumn: string | undefined;
|
|
846
|
+
keepAliveDetail: boolean;
|
|
554
847
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
555
848
|
height: string | undefined;
|
|
556
849
|
rowHeight: number;
|
|
557
850
|
overscan: number;
|
|
558
851
|
virtualColumns: boolean;
|
|
559
852
|
columnWidth: number;
|
|
853
|
+
removable: boolean;
|
|
560
854
|
rowNumbers: boolean;
|
|
561
855
|
columnLetters: boolean;
|
|
856
|
+
rowActions: boolean;
|
|
562
857
|
}, SlotsType<{
|
|
563
858
|
[key: `cell.${string}`]: GridCellSlotProps;
|
|
859
|
+
[key: `editor.${string}`]: CellEditorSlotProps;
|
|
564
860
|
} & {
|
|
565
861
|
default?: (props: Record<string, unknown>) => VNode[];
|
|
862
|
+
expanded?: (props: DetailSlotProps) => VNodeChild;
|
|
566
863
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
567
864
|
//#endregion
|
|
568
865
|
//#region src/icons.d.ts
|
|
@@ -573,6 +870,8 @@ declare const paths: {
|
|
|
573
870
|
readonly search: "M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm10 2-4.35-4.35";
|
|
574
871
|
readonly columns: "M4 4h6v16H4zM14 4h6v16h-6z";
|
|
575
872
|
readonly empty: "M3 7h18M3 12h18M3 17h10";
|
|
873
|
+
readonly expand: "M9 5l7 7-7 7";
|
|
874
|
+
readonly collapse: "M5 9l7 7 7-7";
|
|
576
875
|
};
|
|
577
876
|
type IconName = keyof typeof paths;
|
|
578
877
|
/** A 24-pixel stroke icon that inherits the text color. */
|
|
@@ -585,5 +884,5 @@ declare function icon(name: IconName, className?: string): VNode;
|
|
|
585
884
|
*/
|
|
586
885
|
declare function withClass<TComponent extends Component>(component: TComponent, className: string, name: string): TComponent;
|
|
587
886
|
//#endregion
|
|
588
|
-
export { type Density, type IconName, VtBody, VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, icon, withClass };
|
|
887
|
+
export { type Density, type IconName, VtBody, VtCellEditor, VtColumnVisibility, VtDetailRow, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtRowActions, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, VtTreeCell, icon, withClass };
|
|
589
888
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components.ts","../src/icons.ts","../src/with-class.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components.ts","../src/icons.ts","../src/with-class.ts"],"mappings":";;;;;KAiDY;;cA8DC,+BAAe,8BAAA;;IAEO,MAAA,SAAS;;;;;;;IAAT,MAAA,SAAS;;;;;qCAW1C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|
2
|
-
import { DataGridBody, DataGridRoot, DataTableBody, DataTableColumnVisibility, DataTableHeader, DataTableHeaderCell, DataTableHeaderRow, DataTableLoadMore, DataTablePageSize, DataTablePagination, DataTableRoot, DataTableSearch, DataTableSortButton, DataTableStatus, DataTableViewport, DataTableVirtualColumns, injectVirtualRenderer, virtualProps } from "@vueye-table/headless";
|
|
2
|
+
import { DataCellEditor, DataGridBody, DataGridRoot, DataTableBody, DataTableCell, DataTableColumnVisibility, DataTableDetailRow, DataTableExpandToggle, DataTableHeader, DataTableHeaderCell, DataTableHeaderRow, DataTableLoadMore, DataTablePageSize, DataTablePagination, DataTableRoot, DataTableRow, DataTableRowActions, DataTableSearch, DataTableSortButton, DataTableStatus, DataTableTreeCell, DataTableViewport, DataTableVirtualColumns, cellEditorProps, expandToggleProps, hierarchyProps, injectVirtualRenderer, resolveTreeColumn, treeCellProps, virtualProps } from "@vueye-table/headless";
|
|
3
3
|
import { injectDataTable } from "@vueye-table/vue";
|
|
4
4
|
import { defineComponent, h, mergeProps } from "vue";
|
|
5
5
|
|
|
@@ -10,7 +10,9 @@ const paths = {
|
|
|
10
10
|
sortDesc: "M7 10l5 5 5-5",
|
|
11
11
|
search: "M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm10 2-4.35-4.35",
|
|
12
12
|
columns: "M4 4h6v16H4zM14 4h6v16h-6z",
|
|
13
|
-
empty: "M3 7h18M3 12h18M3 17h10"
|
|
13
|
+
empty: "M3 7h18M3 12h18M3 17h10",
|
|
14
|
+
expand: "M9 5l7 7-7 7",
|
|
15
|
+
collapse: "M5 9l7 7 7-7"
|
|
14
16
|
};
|
|
15
17
|
/** A 24-pixel stroke icon that inherits the text color. */
|
|
16
18
|
function icon(name, className = "vt-icon") {
|
|
@@ -47,6 +49,7 @@ function withClass(component, className, name) {
|
|
|
47
49
|
/** Visual options shared by the styled table and grid. */
|
|
48
50
|
const surfaceProps = {
|
|
49
51
|
...virtualProps,
|
|
52
|
+
...hierarchyProps,
|
|
50
53
|
density: {
|
|
51
54
|
type: String,
|
|
52
55
|
default: "comfortable"
|
|
@@ -149,6 +152,10 @@ const VtTable = defineComponent({
|
|
|
149
152
|
type: Object,
|
|
150
153
|
required: true
|
|
151
154
|
},
|
|
155
|
+
leadingColumns: {
|
|
156
|
+
type: Number,
|
|
157
|
+
default: 0
|
|
158
|
+
},
|
|
152
159
|
...surfaceProps
|
|
153
160
|
},
|
|
154
161
|
setup(props, { slots }) {
|
|
@@ -161,17 +168,26 @@ const VtTable = defineComponent({
|
|
|
161
168
|
}), scroller(props, [h(DataTableRoot, {
|
|
162
169
|
table: props.table,
|
|
163
170
|
class: "vt-table",
|
|
171
|
+
leadingColumns: props.leadingColumns,
|
|
164
172
|
virtual: props.virtual,
|
|
165
173
|
rowHeight: props.rowHeight,
|
|
166
|
-
overscan: props.overscan
|
|
167
|
-
|
|
174
|
+
overscan: props.overscan,
|
|
175
|
+
treeColumn: props.treeColumn,
|
|
176
|
+
keepAliveDetail: props.keepAliveDetail
|
|
177
|
+
}, { default: () => slots.default?.({ table: props.table }) ?? [h(VtHeader), h(VtBody, { treeColumn: props.treeColumn }, { detail: slots.expanded })] })])]);
|
|
168
178
|
}
|
|
169
179
|
});
|
|
170
180
|
/** The styled body, with the empty state in a full-width row. */
|
|
171
181
|
const VtBody = defineComponent({
|
|
172
182
|
name: "VtBody",
|
|
173
183
|
slots: Object,
|
|
174
|
-
props: {
|
|
184
|
+
props: {
|
|
185
|
+
...virtualProps,
|
|
186
|
+
treeColumn: {
|
|
187
|
+
type: String,
|
|
188
|
+
default: void 0
|
|
189
|
+
}
|
|
190
|
+
},
|
|
175
191
|
setup(props, { slots }) {
|
|
176
192
|
const table = injectDataTable("<VtBody>");
|
|
177
193
|
return () => h(DataTableBody, {
|
|
@@ -179,6 +195,22 @@ const VtBody = defineComponent({
|
|
|
179
195
|
...props
|
|
180
196
|
}, {
|
|
181
197
|
...slots,
|
|
198
|
+
row: slots.row ?? (({ row, rowIndex }) => h(DataTableRow, {
|
|
199
|
+
key: row.key,
|
|
200
|
+
row,
|
|
201
|
+
rowIndex
|
|
202
|
+
}, {
|
|
203
|
+
default: () => table.columns.map((column) => h(DataTableCell, {
|
|
204
|
+
key: column.id,
|
|
205
|
+
row,
|
|
206
|
+
column,
|
|
207
|
+
tree: false
|
|
208
|
+
}, {
|
|
209
|
+
default: () => table.tree && column.id === resolveTreeColumn(table, props.treeColumn) ? h(VtTreeCell, { row }, () => row.getDisplay(column.id)) : row.getDisplay(column.id),
|
|
210
|
+
$stable: true
|
|
211
|
+
})),
|
|
212
|
+
$stable: true
|
|
213
|
+
})),
|
|
182
214
|
empty: slots.empty ?? (() => h(VtEmpty, { text: table.loadingMode && table.loadState === "loading" ? "Loading rows…" : table.loadingMode && table.loadState === "error" ? "Could not load rows." : "No matching rows" }))
|
|
183
215
|
});
|
|
184
216
|
}
|
|
@@ -266,6 +298,29 @@ const VtColumnVisibility = defineComponent({
|
|
|
266
298
|
const VtPagination = withClass(DataTablePagination, "vt-pagination", "VtPagination");
|
|
267
299
|
const VtStatus = withClass(DataTableStatus, "vt-status", "VtStatus");
|
|
268
300
|
const VtLoadMore = withClass(DataTableLoadMore, "vt-button", "VtLoadMore");
|
|
301
|
+
const VtDetailRow = withClass(DataTableDetailRow, "vt-detail-row", "VtDetailRow");
|
|
302
|
+
const VtExpandToggle = defineComponent({
|
|
303
|
+
name: "VtExpandToggle",
|
|
304
|
+
props: expandToggleProps,
|
|
305
|
+
slots: Object,
|
|
306
|
+
setup(props, { slots }) {
|
|
307
|
+
return () => h(DataTableExpandToggle, {
|
|
308
|
+
...props,
|
|
309
|
+
class: "vt-expand-toggle"
|
|
310
|
+
}, { default: slots.default ?? (({ expanded }) => icon(expanded ? "collapse" : "expand")) });
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
const VtTreeCell = defineComponent({
|
|
314
|
+
name: "VtTreeCell",
|
|
315
|
+
props: treeCellProps,
|
|
316
|
+
slots: Object,
|
|
317
|
+
setup(props, { slots }) {
|
|
318
|
+
return () => h(DataTableTreeCell, props, {
|
|
319
|
+
...slots,
|
|
320
|
+
toggle: slots.toggle ?? (() => h(VtExpandToggle, { row: props.row }))
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
});
|
|
269
324
|
/** A horizontal bar for controls above or below a table. */
|
|
270
325
|
const VtToolbar = defineComponent({
|
|
271
326
|
name: "VtToolbar",
|
|
@@ -277,6 +332,17 @@ const VtToolbar = defineComponent({
|
|
|
277
332
|
}, slots.default?.());
|
|
278
333
|
}
|
|
279
334
|
});
|
|
335
|
+
const VtCellEditor = defineComponent({
|
|
336
|
+
name: "VtCellEditor",
|
|
337
|
+
props: cellEditorProps,
|
|
338
|
+
setup(props) {
|
|
339
|
+
return () => h(DataCellEditor, {
|
|
340
|
+
...props,
|
|
341
|
+
class: "vt-cell-editor"
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
const VtRowActions = withClass(DataTableRowActions, "vt-row-actions", "VtRowActions");
|
|
280
346
|
const GridBody = defineComponent({
|
|
281
347
|
name: "VtGridBody",
|
|
282
348
|
props: {
|
|
@@ -284,26 +350,66 @@ const GridBody = defineComponent({
|
|
|
284
350
|
type: Boolean,
|
|
285
351
|
default: true
|
|
286
352
|
},
|
|
353
|
+
treeColumn: {
|
|
354
|
+
type: String,
|
|
355
|
+
default: void 0
|
|
356
|
+
},
|
|
357
|
+
detail: {
|
|
358
|
+
type: Function,
|
|
359
|
+
default: void 0
|
|
360
|
+
},
|
|
287
361
|
/** Content slots per column id, as `cell.<id>` on `<VtGrid>`. */
|
|
288
362
|
cells: {
|
|
289
363
|
type: Object,
|
|
290
364
|
default: () => ({})
|
|
365
|
+
},
|
|
366
|
+
editors: {
|
|
367
|
+
type: Object,
|
|
368
|
+
default: () => ({})
|
|
369
|
+
},
|
|
370
|
+
rowActions: {
|
|
371
|
+
type: Boolean,
|
|
372
|
+
default: false
|
|
373
|
+
},
|
|
374
|
+
removable: {
|
|
375
|
+
type: Boolean,
|
|
376
|
+
default: false
|
|
291
377
|
}
|
|
292
378
|
},
|
|
293
379
|
setup(props) {
|
|
294
380
|
const table = injectDataTable("<VtGrid>");
|
|
295
381
|
return () => {
|
|
296
382
|
const cellSlots = props.cells;
|
|
297
|
-
const
|
|
298
|
-
return h(DataGridBody, {
|
|
299
|
-
|
|
383
|
+
const details = !!props.detail && !table.tree;
|
|
384
|
+
return h(DataGridBody, {
|
|
385
|
+
class: "vt-body",
|
|
386
|
+
treeCell: false,
|
|
387
|
+
colspan: table.columns.length + (props.rowNumbers || details || props.rowActions ? 1 : 0)
|
|
388
|
+
}, {
|
|
389
|
+
detail: props.detail,
|
|
390
|
+
rowHeader: ({ index }) => props.rowNumbers || details || props.rowActions ? h("th", {
|
|
300
391
|
class: "vt-row-number",
|
|
301
|
-
scope: "row"
|
|
302
|
-
|
|
303
|
-
|
|
392
|
+
scope: "row",
|
|
393
|
+
"aria-colindex": 1
|
|
394
|
+
}, [
|
|
395
|
+
details ? h(VtExpandToggle, { row: table.rows[index] }) : null,
|
|
396
|
+
props.rowNumbers ? String(table.pageStart + index) : null,
|
|
397
|
+
props.rowActions ? h(VtRowActions, {
|
|
398
|
+
row: table.rows[index],
|
|
399
|
+
editable: false,
|
|
400
|
+
removable: props.removable
|
|
401
|
+
}) : null
|
|
402
|
+
]) : null,
|
|
403
|
+
cell: (cellProps) => {
|
|
304
404
|
const slot = cellSlots[cellProps.column.id];
|
|
305
|
-
|
|
306
|
-
|
|
405
|
+
const content = () => slot ? slot(cellProps) : cellProps.display;
|
|
406
|
+
return table.tree && cellProps.column.id === resolveTreeColumn(table, props.treeColumn) ? h(VtTreeCell, { row: cellProps.row }, { default: content }) : content();
|
|
407
|
+
},
|
|
408
|
+
editor: (editor) => props.editors[editor.column.id]?.(editor) ?? h(VtCellEditor, {
|
|
409
|
+
editor,
|
|
410
|
+
spec: editor.spec,
|
|
411
|
+
finish: editor.finish
|
|
412
|
+
})
|
|
307
413
|
});
|
|
308
414
|
};
|
|
309
415
|
}
|
|
@@ -332,18 +438,40 @@ const VtGrid = defineComponent({
|
|
|
332
438
|
type: Boolean,
|
|
333
439
|
default: false
|
|
334
440
|
},
|
|
335
|
-
...surfaceProps
|
|
441
|
+
...surfaceProps,
|
|
442
|
+
rowActions: {
|
|
443
|
+
type: Boolean,
|
|
444
|
+
default: false
|
|
445
|
+
},
|
|
446
|
+
removable: {
|
|
447
|
+
type: Boolean,
|
|
448
|
+
default: false
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
emits: {
|
|
452
|
+
save: (_result) => true,
|
|
453
|
+
cancel: (_key) => true
|
|
336
454
|
},
|
|
337
|
-
setup(props, { slots, attrs }) {
|
|
455
|
+
setup(props, { slots, attrs, emit }) {
|
|
456
|
+
const details = () => !!slots.expanded && !props.table.tree;
|
|
338
457
|
const cellSlots = () => {
|
|
339
458
|
const found = {};
|
|
340
459
|
for (const [name, slot] of Object.entries(slots)) if (name.startsWith("cell.") && slot) found[name.slice(5)] = slot;
|
|
341
460
|
return found;
|
|
342
461
|
};
|
|
462
|
+
const editorSlots = () => {
|
|
463
|
+
const found = {};
|
|
464
|
+
for (const name of Object.keys(slots)) if (name.startsWith("editor.")) {
|
|
465
|
+
const slot = slots[name];
|
|
466
|
+
if (slot) found[name.slice(7)] = slot;
|
|
467
|
+
}
|
|
468
|
+
return found;
|
|
469
|
+
};
|
|
343
470
|
const header = () => h(VtHeader, null, {
|
|
344
|
-
before: () => props.rowNumbers ? h("th", {
|
|
471
|
+
before: () => props.rowNumbers || details() || props.rowActions ? h("th", {
|
|
345
472
|
class: "vt-row-number",
|
|
346
|
-
"aria-
|
|
473
|
+
"aria-colindex": 1,
|
|
474
|
+
"aria-label": props.rowActions ? "Row actions" : details() ? "Details" : "Row number"
|
|
347
475
|
}) : null,
|
|
348
476
|
header: ({ column }) => props.columnLetters ? [h("span", { class: "vt-column-letter" }, columnLabel(props.table.columns.indexOf(column))), column.header] : column.header
|
|
349
477
|
});
|
|
@@ -356,6 +484,7 @@ const VtGrid = defineComponent({
|
|
|
356
484
|
}), scroller(props, [h(DataGridRoot, {
|
|
357
485
|
table: props.table,
|
|
358
486
|
label: props.label,
|
|
487
|
+
leadingColumns: props.rowNumbers || details() || props.rowActions ? 1 : 0,
|
|
359
488
|
"aria-describedby": attrs["aria-describedby"],
|
|
360
489
|
class: "vt-table vt-grid",
|
|
361
490
|
virtual: props.virtual,
|
|
@@ -363,14 +492,23 @@ const VtGrid = defineComponent({
|
|
|
363
492
|
rowHeight: props.rowHeight,
|
|
364
493
|
overscan: props.overscan,
|
|
365
494
|
columnWidth: props.columnWidth,
|
|
366
|
-
gutter: props.rowNumbers ? 48 : 0
|
|
495
|
+
gutter: props.rowActions ? 120 : props.rowNumbers ? details() ? 80 : 48 : details() ? 48 : 0,
|
|
496
|
+
onSave: (result) => emit("save", result),
|
|
497
|
+
onCancel: (key) => emit("cancel", key),
|
|
498
|
+
treeColumn: props.treeColumn,
|
|
499
|
+
keepAliveDetail: props.keepAliveDetail
|
|
367
500
|
}, { default: (slotProps) => slots.default?.(slotProps) ?? [header(), h(GridBody, {
|
|
368
501
|
rowNumbers: props.rowNumbers,
|
|
369
|
-
cells: cellSlots()
|
|
502
|
+
cells: cellSlots(),
|
|
503
|
+
editors: editorSlots(),
|
|
504
|
+
rowActions: props.rowActions,
|
|
505
|
+
removable: props.removable,
|
|
506
|
+
treeColumn: props.treeColumn,
|
|
507
|
+
detail: slots.expanded
|
|
370
508
|
})] })])]);
|
|
371
509
|
}
|
|
372
510
|
});
|
|
373
511
|
|
|
374
512
|
//#endregion
|
|
375
|
-
export { VtBody, VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, icon, withClass };
|
|
513
|
+
export { VtBody, VtCellEditor, VtColumnVisibility, VtDetailRow, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtRowActions, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, VtTreeCell, icon, withClass };
|
|
376
514
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/icons.ts","../src/with-class.ts","../src/components.ts"],"sourcesContent":["import { h, type VNode } from \"vue\";\n\nconst paths = {\n sortNone: \"M7 9l5-5 5 5M7 15l5 5 5-5\",\n sortAsc: \"M7 14l5-5 5 5\",\n sortDesc: \"M7 10l5 5 5-5\",\n search: \"M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm10 2-4.35-4.35\",\n columns: \"M4 4h6v16H4zM14 4h6v16h-6z\",\n empty: \"M3 7h18M3 12h18M3 17h10\",\n} as const;\n\nexport type IconName = keyof typeof paths;\n\n/** A 24-pixel stroke icon that inherits the text color. */\nexport function icon(name: IconName, className = \"vt-icon\"): VNode {\n return h(\n \"svg\",\n {\n class: className,\n viewBox: \"0 0 24 24\",\n width: 16,\n height: 16,\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 2,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n },\n [h(\"path\", { d: paths[name] })],\n );\n}\n","import { h, mergeProps, type Component, type FunctionalComponent } from \"vue\";\n\n/**\n * Wrap a component so it always carries a class. Props, attributes, and slots pass through\n * untouched, so the wrapper keeps the wrapped component's full API.\n */\nexport function withClass<TComponent extends Component>(\n component: TComponent,\n className: string,\n name: string,\n): TComponent {\n const wrapper: FunctionalComponent = (_props, { attrs, slots }) =>\n h(component, mergeProps(attrs, { class: className }), slots);\n wrapper.displayName = name;\n wrapper.inheritAttrs = false;\n return wrapper as unknown as TComponent;\n}\n","import { columnLabel, type SortInfo, type TableColumn, type TableRow } from \"@vueye-table/core\";\nimport {\n DataGridBody,\n DataGridRoot,\n DataTableBody,\n DataTableColumnVisibility,\n DataTableHeader,\n DataTableHeaderCell,\n DataTableHeaderRow,\n DataTablePageSize,\n DataTablePagination,\n DataTableRoot,\n DataTableSearch,\n DataTableSortButton,\n DataTableStatus,\n DataTableLoadMore,\n DataTableViewport,\n DataTableVirtualColumns,\n injectVirtualRenderer,\n virtualProps,\n type GridCellSlotProps,\n} from \"@vueye-table/headless\";\nimport { injectDataTable, type AnyDataTableBinding, type DataTableBinding } from \"@vueye-table/vue\";\nimport {\n defineComponent,\n h,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeChild,\n} from \"vue\";\n\nimport { icon } from \"./icons\";\nimport { withClass } from \"./with-class\";\n\nexport type Density = \"compact\" | \"comfortable\" | \"spacious\";\n\n/** Visual options shared by the styled table and grid. */\nconst surfaceProps = {\n ...virtualProps,\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 loading: { type: Boolean, default: false },\n /** Force a theme; by default the table follows `prefers-color-scheme`. */\n theme: { type: String as PropType<\"light\" | \"dark\" | undefined>, default: undefined },\n} as const;\n\nfunction surfaceAttrs(props: {\n readonly density: Density;\n readonly striped: boolean;\n readonly bordered: boolean;\n readonly hover: boolean;\n readonly stickyHeader: boolean;\n readonly loading: boolean;\n readonly theme: \"light\" | \"dark\" | undefined;\n readonly virtual: boolean | object;\n}) {\n return {\n class: \"vt-surface\",\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 };\n}\n\nfunction scroller(\n props: {\n readonly virtual: boolean | object;\n readonly height: string | undefined;\n readonly rowHeight: number;\n },\n children: VNode[],\n): VNode {\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 { default: () => children },\n )\n : h(\"div\", { class: \"vt-scroll\" }, children);\n}\n\n/** An arrow showing a column's sort direction and, in a multi-column sort, its priority. */\nexport const VtSortIndicator = defineComponent({\n name: \"VtSortIndicator\",\n props: { sort: { type: Object as PropType<SortInfo | undefined>, default: undefined } },\n setup(props) {\n const table = injectDataTable(\"<VtSortIndicator>\");\n return () =>\n h(\"span\", { class: \"vt-sort-indicator\", \"data-active\": props.sort ? \"\" : undefined }, [\n icon(!props.sort ? \"sortNone\" : props.sort.direction === \"asc\" ? \"sortAsc\" : \"sortDesc\"),\n props.sort && table.state.sorting.length > 1\n ? h(\"span\", { class: \"vt-sort-priority\" }, String(props.sort.priority + 1))\n : null,\n ]);\n },\n});\n\n/** A header row of styled header cells with sort indicators. */\nexport const VtHeader = defineComponent({\n name: \"VtHeader\",\n slots: Object as SlotsType<\n {\n [key: `header.${string}`]: (props: {\n column: TableColumn<unknown>;\n sort: SortInfo | undefined;\n toggleSort: (multi?: boolean) => void;\n }) => VNode[];\n } & {\n before?: () => VNode[];\n after?: () => VNode[];\n header?: (props: { column: TableColumn<unknown> }) => VNodeChild;\n }\n >,\n setup(_props, { slots }) {\n const table = injectDataTable(\"<VtHeader>\");\n const virtual = injectVirtualRenderer();\n const headerCell = (column: TableColumn<unknown>) =>\n h(\n DataTableHeaderCell,\n { key: column.id, column },\n {\n default:\n slots[`header.${column.id}`] ??\n (() =>\n column.sortable\n ? h(\n DataTableSortButton,\n { column, class: \"vt-sort-button\" },\n {\n default: () => [slots.header?.({ column }) ?? column.header],\n indicator: ({ sort }: { sort: SortInfo | undefined }) => [\n h(VtSortIndicator, { sort }),\n ],\n },\n )\n : [slots.header?.({ column }) ?? column.header]),\n },\n );\n return () =>\n h(DataTableHeader, { class: \"vt-head\" }, () =>\n h(DataTableHeaderRow, () => [\n slots.before?.(),\n ...(virtual?.columns\n ? [\n h(DataTableVirtualColumns, null, {\n default: ({ column }: { column: TableColumn<unknown> }) => [headerCell(column)],\n }),\n ]\n : table.columns.map(headerCell)),\n slots.after?.(),\n ]),\n );\n },\n});\n\n/**\n * The styled table surface: a scroll container, a loading bar, and the table. Without a default\n * slot it renders a styled header and body.\n */\nexport const VtTable = defineComponent({\n name: \"VtTable\",\n slots: Object as SlotsType<{\n default?: (props: { table: DataTableBinding<unknown> }) => VNode[];\n }>,\n props: {\n table: { type: Object as PropType<AnyDataTableBinding>, required: true },\n ...surfaceProps,\n },\n setup(props, { slots }) {\n return () =>\n h(\n \"div\",\n surfaceAttrs({\n ...props,\n loading:\n props.loading ||\n props.table.loadState === \"loading\" ||\n props.table.loadState === \"streaming\",\n }),\n [\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n scroller(props, [\n h(\n DataTableRoot,\n {\n table: props.table,\n class: \"vt-table\",\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n },\n {\n default: () => slots.default?.({ table: props.table }) ?? [h(VtHeader), h(VtBody)],\n },\n ),\n ]),\n ],\n );\n },\n});\n\n/** The styled body, with the empty state in a full-width row. */\nexport const VtBody = defineComponent({\n name: \"VtBody\",\n slots: Object as SlotsType<{\n default?: (props: { rows: readonly TableRow<unknown>[] }) => VNode[];\n empty?: () => VNode[];\n }>,\n props: { ...virtualProps },\n setup(props, { slots }) {\n const table = injectDataTable(\"<VtBody>\");\n return () =>\n h(\n DataTableBody,\n { class: \"vt-body\", ...props },\n {\n ...slots,\n empty:\n slots.empty ??\n (() =>\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"loading\"\n ? \"Loading rows…\"\n : table.loadingMode && table.loadState === \"error\"\n ? \"Could not load rows.\"\n : \"No matching rows\",\n })),\n },\n );\n },\n});\n\n/** The default empty state. */\nexport const VtEmpty = defineComponent({\n name: \"VtEmpty\",\n slots: Object as SlotsType<{ default?: () => VNode[] }>,\n props: { text: { type: String, default: \"No matching rows\" } },\n setup(props, { slots }) {\n return () =>\n h(\"div\", { class: \"vt-empty\" }, [\n icon(\"empty\", \"vt-empty-icon\"),\n slots.default?.() ?? props.text,\n ]);\n },\n});\n\n/** A search field with an icon. */\nexport const VtSearch = defineComponent({\n name: \"VtSearch\",\n inheritAttrs: false,\n setup(_props, { attrs }) {\n return () => h(\"label\", { class: \"vt-search\" }, [icon(\"search\"), h(DataTableSearch, attrs)]);\n },\n});\n\n/** \"Rows per page\" with a picker. */\nexport const VtPageSize = defineComponent({\n name: \"VtPageSize\",\n props: {\n options: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n label: { type: String, default: \"Rows per page\" },\n },\n setup(props) {\n return () =>\n h(\"label\", { class: \"vt-page-size\" }, [\n h(\"span\", props.label),\n h(DataTablePageSize, { options: props.options, label: props.label }),\n ]);\n },\n});\n\n/**\n * A menu of column checkboxes behind a \"Columns\" button. Escape closes it and returns focus to\n * the button, and so does moving focus out of it.\n */\nexport const VtColumnVisibility = defineComponent({\n name: \"VtColumnVisibility\",\n props: { label: { type: String, default: \"Columns\" } },\n setup(props) {\n const close = (menu: HTMLDetailsElement, refocus: boolean): void => {\n if (!menu.open) {\n return;\n }\n menu.open = false;\n if (refocus) {\n menu.querySelector(\"summary\")?.focus();\n }\n };\n return () =>\n h(\n \"details\",\n {\n class: \"vt-menu\",\n onKeydown: (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n close(event.currentTarget as HTMLDetailsElement, true);\n }\n },\n onFocusout: (event: FocusEvent) => {\n const menu = event.currentTarget as HTMLDetailsElement;\n const next = event.relatedTarget as Node | null;\n // Some browsers move no focus when a checkbox label is clicked; only a known\n // destination outside the menu closes it.\n if (next !== null && !menu.contains(next)) {\n close(menu, false);\n }\n },\n },\n [\n h(\"summary\", { class: \"vt-button\" }, [icon(\"columns\"), props.label]),\n h(DataTableColumnVisibility, { as: \"div\", class: \"vt-menu-panel\" }),\n ],\n );\n },\n});\n\nexport const VtPagination = withClass(DataTablePagination, \"vt-pagination\", \"VtPagination\");\nexport const VtStatus = withClass(DataTableStatus, \"vt-status\", \"VtStatus\");\nexport const VtLoadMore = withClass(DataTableLoadMore, \"vt-button\", \"VtLoadMore\");\n\n/** A horizontal bar for controls above or below a table. */\nexport const VtToolbar = defineComponent({\n name: \"VtToolbar\",\n slots: Object as SlotsType<{ default?: () => VNode[] }>,\n setup(_props, { slots }) {\n return () => h(\"div\", { class: \"vt-theme vt-toolbar\", role: \"toolbar\" }, slots.default?.());\n },\n});\n\ntype CellSlot = (props: GridCellSlotProps) => VNodeChild;\n\nconst GridBody = defineComponent({\n name: \"VtGridBody\",\n props: {\n rowNumbers: { type: Boolean, default: true },\n /** Content slots per column id, as `cell.<id>` on `<VtGrid>`. */\n cells: {\n type: Object as PropType<Readonly<Record<string, CellSlot | undefined>>>,\n default: () => ({}),\n },\n },\n setup(props) {\n const table = injectDataTable(\"<VtGrid>\");\n return () => {\n const cellSlots = props.cells;\n const hasCellSlots = Object.keys(cellSlots).length > 0;\n return h(\n DataGridBody,\n { class: \"vt-body\" },\n {\n rowHeader: ({ index }: { index: number }) =>\n props.rowNumbers\n ? h(\"th\", { class: \"vt-row-number\", scope: \"row\" }, String(table.pageStart + index))\n : null,\n ...(hasCellSlots\n ? {\n cell: (cellProps: GridCellSlotProps) => {\n const slot = cellSlots[cellProps.column.id];\n return slot ? slot(cellProps) : cellProps.display;\n },\n }\n : {}),\n },\n );\n };\n },\n});\n\n/**\n * The styled spreadsheet grid, with optional row numbers and A, B, C column letters. A\n * `cell.<column id>` slot draws that column's cells while they are not being edited.\n */\nexport const VtGrid = defineComponent({\n name: \"VtGrid\",\n slots: Object as SlotsType<\n { [key: `cell.${string}`]: GridCellSlotProps } & {\n default?: (props: Record<string, unknown>) => VNode[];\n }\n >,\n props: {\n table: { type: Object as PropType<AnyDataTableBinding>, required: true },\n label: { type: String as PropType<string | undefined>, default: undefined },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n ...surfaceProps,\n },\n setup(props, { slots, attrs }) {\n const cellSlots = (): Record<string, CellSlot> => {\n const found: Record<string, CellSlot> = {};\n for (const [name, slot] of Object.entries(slots)) {\n if (name.startsWith(\"cell.\") && slot) {\n found[name.slice(\"cell.\".length)] = slot as CellSlot;\n }\n }\n return found;\n };\n const header = () =>\n h(VtHeader, null, {\n before: () =>\n props.rowNumbers ? h(\"th\", { class: \"vt-row-number\", \"aria-hidden\": \"true\" }) : null,\n header: ({ column }: { column: TableColumn<unknown> }) =>\n props.columnLetters\n ? [\n h(\n \"span\",\n { class: \"vt-column-letter\" },\n columnLabel(props.table.columns.indexOf(column)),\n ),\n column.header,\n ]\n : column.header,\n });\n return () =>\n h(\n \"div\",\n surfaceAttrs({\n ...props,\n loading:\n props.loading ||\n props.table.loadState === \"loading\" ||\n props.table.loadState === \"streaming\",\n }),\n [\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n scroller(props, [\n h(\n DataGridRoot,\n {\n table: props.table,\n label: props.label,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n class: \"vt-table vt-grid\",\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n gutter: props.rowNumbers ? 48 : 0,\n },\n {\n default: (slotProps: Record<string, unknown>) =>\n slots.default?.(slotProps) ?? [\n header(),\n h(GridBody, { rowNumbers: props.rowNumbers, cells: cellSlots() }),\n ],\n },\n ),\n ]),\n ],\n );\n },\n});\n"],"mappings":";;;;;;AAEA,MAAM,QAAQ;CACZ,UAAU;CACV,SAAS;CACT,UAAU;CACV,QAAQ;CACR,SAAS;CACT,OAAO;AACT;;AAKA,SAAgB,KAAK,MAAgB,YAAY,WAAkB;CACjE,OAAO,EACL,OACA;EACE,OAAO;EACP,SAAS;EACT,OAAO;EACP,QA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names":[],"sources":["../src/icons.ts","../src/with-class.ts","../src/components.ts"],"sourcesContent":["import { h, type VNode } from \"vue\";\n\nconst paths = {\n sortNone: \"M7 9l5-5 5 5M7 15l5 5 5-5\",\n sortAsc: \"M7 14l5-5 5 5\",\n sortDesc: \"M7 10l5 5 5-5\",\n search: \"M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm10 2-4.35-4.35\",\n columns: \"M4 4h6v16H4zM14 4h6v16h-6z\",\n empty: \"M3 7h18M3 12h18M3 17h10\",\n expand: \"M9 5l7 7-7 7\",\n collapse: \"M5 9l7 7 7-7\",\n} as const;\n\nexport type IconName = keyof typeof paths;\n\n/** A 24-pixel stroke icon that inherits the text color. */\nexport function icon(name: IconName, className = \"vt-icon\"): VNode {\n return h(\n \"svg\",\n {\n class: className,\n viewBox: \"0 0 24 24\",\n width: 16,\n height: 16,\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 2,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n },\n [h(\"path\", { d: paths[name] })],\n );\n}\n","import { h, mergeProps, type Component, type FunctionalComponent } from \"vue\";\n\n/**\n * Wrap a component so it always carries a class. Props, attributes, and slots pass through\n * untouched, so the wrapper keeps the wrapped component's full API.\n */\nexport function withClass<TComponent extends Component>(\n component: TComponent,\n className: string,\n name: string,\n): TComponent {\n const wrapper: FunctionalComponent = (_props, { attrs, slots }) =>\n h(component, mergeProps(attrs, { class: className }), slots);\n wrapper.displayName = name;\n wrapper.inheritAttrs = false;\n return wrapper as unknown as TComponent;\n}\n","import { columnLabel, type SortInfo, type TableColumn, type TableRow } from \"@vueye-table/core\";\nimport {\n DataGridBody,\n DataGridRoot,\n DataTableBody,\n DataTableColumnVisibility,\n DataTableHeader,\n DataTableHeaderCell,\n DataTableHeaderRow,\n DataTablePageSize,\n DataTablePagination,\n DataTableRoot,\n DataTableSearch,\n DataTableSortButton,\n DataTableStatus,\n DataTableLoadMore,\n DataTableViewport,\n DataTableVirtualColumns,\n injectVirtualRenderer,\n virtualProps,\n type GridCellSlotProps,\n DataTableExpandToggle,\n DataTableDetailRow,\n DataTableTreeCell,\n DataTableRow,\n DataTableCell,\n hierarchyProps,\n resolveTreeColumn,\n type DetailSlotProps,\n expandToggleProps,\n treeCellProps,\n DataCellEditor,\n cellEditorProps,\n DataTableRowActions,\n type CellEditorSlotProps,\n} from \"@vueye-table/headless\";\nimport { injectDataTable, type AnyDataTableBinding, type DataTableBinding } from \"@vueye-table/vue\";\nimport {\n defineComponent,\n h,\n type PropType,\n type SlotsType,\n type VNode,\n type VNodeChild,\n} from \"vue\";\n\nimport { icon } from \"./icons\";\nimport { withClass } from \"./with-class\";\n\nexport type Density = \"compact\" | \"comfortable\" | \"spacious\";\n\n/** Visual options shared by the styled table and grid. */\nconst surfaceProps = {\n ...virtualProps,\n ...hierarchyProps,\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 loading: { type: Boolean, default: false },\n /** Force a theme; by default the table follows `prefers-color-scheme`. */\n theme: { type: String as PropType<\"light\" | \"dark\" | undefined>, default: undefined },\n} as const;\n\nfunction surfaceAttrs(props: {\n readonly density: Density;\n readonly striped: boolean;\n readonly bordered: boolean;\n readonly hover: boolean;\n readonly stickyHeader: boolean;\n readonly loading: boolean;\n readonly theme: \"light\" | \"dark\" | undefined;\n readonly virtual: boolean | object;\n}) {\n return {\n class: \"vt-surface\",\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 };\n}\n\nfunction scroller(\n props: {\n readonly virtual: boolean | object;\n readonly height: string | undefined;\n readonly rowHeight: number;\n },\n children: VNode[],\n): VNode {\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 { default: () => children },\n )\n : h(\"div\", { class: \"vt-scroll\" }, children);\n}\n\n/** An arrow showing a column's sort direction and, in a multi-column sort, its priority. */\nexport const VtSortIndicator = defineComponent({\n name: \"VtSortIndicator\",\n props: { sort: { type: Object as PropType<SortInfo | undefined>, default: undefined } },\n setup(props) {\n const table = injectDataTable(\"<VtSortIndicator>\");\n return () =>\n h(\"span\", { class: \"vt-sort-indicator\", \"data-active\": props.sort ? \"\" : undefined }, [\n icon(!props.sort ? \"sortNone\" : props.sort.direction === \"asc\" ? \"sortAsc\" : \"sortDesc\"),\n props.sort && table.state.sorting.length > 1\n ? h(\"span\", { class: \"vt-sort-priority\" }, String(props.sort.priority + 1))\n : null,\n ]);\n },\n});\n\n/** A header row of styled header cells with sort indicators. */\nexport const VtHeader = defineComponent({\n name: \"VtHeader\",\n slots: Object as SlotsType<\n {\n [key: `header.${string}`]: (props: {\n column: TableColumn<unknown>;\n sort: SortInfo | undefined;\n toggleSort: (multi?: boolean) => void;\n }) => VNode[];\n } & {\n before?: () => VNode[];\n after?: () => VNode[];\n header?: (props: { column: TableColumn<unknown> }) => VNodeChild;\n }\n >,\n setup(_props, { slots }) {\n const table = injectDataTable(\"<VtHeader>\");\n const virtual = injectVirtualRenderer();\n const headerCell = (column: TableColumn<unknown>) =>\n h(\n DataTableHeaderCell,\n { key: column.id, column },\n {\n default:\n slots[`header.${column.id}`] ??\n (() =>\n column.sortable\n ? h(\n DataTableSortButton,\n { column, class: \"vt-sort-button\" },\n {\n default: () => [slots.header?.({ column }) ?? column.header],\n indicator: ({ sort }: { sort: SortInfo | undefined }) => [\n h(VtSortIndicator, { sort }),\n ],\n },\n )\n : [slots.header?.({ column }) ?? column.header]),\n },\n );\n return () =>\n h(DataTableHeader, { class: \"vt-head\" }, () =>\n h(DataTableHeaderRow, () => [\n slots.before?.(),\n ...(virtual?.columns\n ? [\n h(DataTableVirtualColumns, null, {\n default: ({ column }: { column: TableColumn<unknown> }) => [headerCell(column)],\n }),\n ]\n : table.columns.map(headerCell)),\n slots.after?.(),\n ]),\n );\n },\n});\n\n/**\n * The styled table surface: a scroll container, a loading bar, and the table. Without a default\n * slot it renders a styled header and body.\n */\nexport const VtTable = defineComponent({\n name: \"VtTable\",\n slots: Object as SlotsType<{\n default?: (props: { table: DataTableBinding<unknown> }) => VNode[];\n expanded?: (props: DetailSlotProps) => VNodeChild;\n }>,\n props: {\n table: { type: Object as PropType<AnyDataTableBinding>, required: true },\n leadingColumns: { type: Number, default: 0 },\n ...surfaceProps,\n },\n setup(props, { slots }) {\n return () =>\n h(\n \"div\",\n surfaceAttrs({\n ...props,\n loading:\n props.loading ||\n props.table.loadState === \"loading\" ||\n props.table.loadState === \"streaming\",\n }),\n [\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n scroller(props, [\n h(\n DataTableRoot,\n {\n table: props.table,\n class: \"vt-table\",\n leadingColumns: props.leadingColumns,\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n {\n default: () =>\n slots.default?.({ table: props.table }) ?? [\n h(VtHeader),\n h(VtBody, { treeColumn: props.treeColumn }, { detail: slots.expanded }),\n ],\n },\n ),\n ]),\n ],\n );\n },\n});\n\n/** The styled body, with the empty state in a full-width row. */\nexport const VtBody = defineComponent({\n name: \"VtBody\",\n slots: Object as SlotsType<{\n default?: (props: { rows: readonly TableRow<unknown>[] }) => VNode[];\n empty?: () => VNode[];\n detail?: (props: DetailSlotProps) => VNodeChild;\n row?: (props: DetailSlotProps) => VNodeChild;\n }>,\n props: {\n ...virtualProps,\n treeColumn: { type: String as PropType<string | undefined>, default: undefined },\n },\n setup(props, { slots }) {\n const table = injectDataTable(\"<VtBody>\");\n return () =>\n h(\n DataTableBody,\n { class: \"vt-body\", ...props },\n {\n ...slots,\n row:\n slots.row ??\n (({ row, rowIndex }: DetailSlotProps) =>\n h(\n DataTableRow,\n { key: row.key, row, rowIndex },\n {\n default: () =>\n table.columns.map((column) =>\n h(\n DataTableCell,\n { key: column.id, row, column, tree: false },\n {\n default: () =>\n table.tree && column.id === resolveTreeColumn(table, props.treeColumn)\n ? h(VtTreeCell, { row }, () => row.getDisplay(column.id))\n : row.getDisplay(column.id),\n $stable: true,\n },\n ),\n ),\n $stable: true,\n },\n )),\n empty:\n slots.empty ??\n (() =>\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"loading\"\n ? \"Loading rows…\"\n : table.loadingMode && table.loadState === \"error\"\n ? \"Could not load rows.\"\n : \"No matching rows\",\n })),\n },\n );\n },\n});\n\n/** The default empty state. */\nexport const VtEmpty = defineComponent({\n name: \"VtEmpty\",\n slots: Object as SlotsType<{ default?: () => VNode[] }>,\n props: { text: { type: String, default: \"No matching rows\" } },\n setup(props, { slots }) {\n return () =>\n h(\"div\", { class: \"vt-empty\" }, [\n icon(\"empty\", \"vt-empty-icon\"),\n slots.default?.() ?? props.text,\n ]);\n },\n});\n\n/** A search field with an icon. */\nexport const VtSearch = defineComponent({\n name: \"VtSearch\",\n inheritAttrs: false,\n setup(_props, { attrs }) {\n return () => h(\"label\", { class: \"vt-search\" }, [icon(\"search\"), h(DataTableSearch, attrs)]);\n },\n});\n\n/** \"Rows per page\" with a picker. */\nexport const VtPageSize = defineComponent({\n name: \"VtPageSize\",\n props: {\n options: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n label: { type: String, default: \"Rows per page\" },\n },\n setup(props) {\n return () =>\n h(\"label\", { class: \"vt-page-size\" }, [\n h(\"span\", props.label),\n h(DataTablePageSize, { options: props.options, label: props.label }),\n ]);\n },\n});\n\n/**\n * A menu of column checkboxes behind a \"Columns\" button. Escape closes it and returns focus to\n * the button, and so does moving focus out of it.\n */\nexport const VtColumnVisibility = defineComponent({\n name: \"VtColumnVisibility\",\n props: { label: { type: String, default: \"Columns\" } },\n setup(props) {\n const close = (menu: HTMLDetailsElement, refocus: boolean): void => {\n if (!menu.open) {\n return;\n }\n menu.open = false;\n if (refocus) {\n menu.querySelector(\"summary\")?.focus();\n }\n };\n return () =>\n h(\n \"details\",\n {\n class: \"vt-menu\",\n onKeydown: (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n close(event.currentTarget as HTMLDetailsElement, true);\n }\n },\n onFocusout: (event: FocusEvent) => {\n const menu = event.currentTarget as HTMLDetailsElement;\n const next = event.relatedTarget as Node | null;\n // Some browsers move no focus when a checkbox label is clicked; only a known\n // destination outside the menu closes it.\n if (next !== null && !menu.contains(next)) {\n close(menu, false);\n }\n },\n },\n [\n h(\"summary\", { class: \"vt-button\" }, [icon(\"columns\"), props.label]),\n h(DataTableColumnVisibility, { as: \"div\", class: \"vt-menu-panel\" }),\n ],\n );\n },\n});\n\nexport const VtPagination = withClass(DataTablePagination, \"vt-pagination\", \"VtPagination\");\nexport const VtStatus = withClass(DataTableStatus, \"vt-status\", \"VtStatus\");\nexport const VtLoadMore = withClass(DataTableLoadMore, \"vt-button\", \"VtLoadMore\");\nexport const VtDetailRow = withClass(DataTableDetailRow, \"vt-detail-row\", \"VtDetailRow\");\nexport const VtExpandToggle = defineComponent({\n name: \"VtExpandToggle\",\n props: expandToggleProps,\n slots: Object as SlotsType<{\n default?: (props: { row: TableRow<unknown>; expanded: boolean }) => VNodeChild;\n }>,\n setup(props, { slots }) {\n return () =>\n h(\n DataTableExpandToggle,\n { ...props, class: \"vt-expand-toggle\" },\n {\n default:\n slots.default ??\n (({ expanded }: { expanded: boolean }) => icon(expanded ? \"collapse\" : \"expand\")),\n },\n );\n },\n});\nexport const VtTreeCell = defineComponent({\n name: \"VtTreeCell\",\n props: treeCellProps,\n slots: Object as SlotsType<{\n default?: () => VNodeChild;\n toggle?: (props: { row: TableRow<unknown> }) => VNodeChild;\n }>,\n setup(props, { slots }) {\n return () =>\n h(DataTableTreeCell, props, {\n ...slots,\n toggle: slots.toggle ?? (() => h(VtExpandToggle, { row: props.row })),\n });\n },\n});\n\n/** A horizontal bar for controls above or below a table. */\nexport const VtToolbar = defineComponent({\n name: \"VtToolbar\",\n slots: Object as SlotsType<{ default?: () => VNode[] }>,\n setup(_props, { slots }) {\n return () => h(\"div\", { class: \"vt-theme vt-toolbar\", role: \"toolbar\" }, slots.default?.());\n },\n});\n\ntype CellSlot = (props: GridCellSlotProps) => VNodeChild;\ntype EditorSlot = (props: CellEditorSlotProps) => VNodeChild;\n\nexport const VtCellEditor = defineComponent({\n name: \"VtCellEditor\",\n props: cellEditorProps,\n setup(props) {\n return () => h(DataCellEditor, { ...props, class: \"vt-cell-editor\" });\n },\n});\nexport const VtRowActions = withClass(DataTableRowActions, \"vt-row-actions\", \"VtRowActions\");\n\nconst GridBody = defineComponent({\n name: \"VtGridBody\",\n props: {\n rowNumbers: { type: Boolean, default: true },\n treeColumn: { type: String as PropType<string | undefined>, default: undefined },\n detail: {\n type: Function as PropType<((props: DetailSlotProps) => VNodeChild) | undefined>,\n default: undefined,\n },\n /** Content slots per column id, as `cell.<id>` on `<VtGrid>`. */\n cells: {\n type: Object as PropType<Readonly<Record<string, CellSlot | undefined>>>,\n default: () => ({}),\n },\n editors: {\n type: Object as PropType<Readonly<Record<string, EditorSlot | undefined>>>,\n default: () => ({}),\n },\n rowActions: { type: Boolean, default: false },\n removable: { type: Boolean, default: false },\n },\n setup(props) {\n const table = injectDataTable(\"<VtGrid>\");\n return () => {\n const cellSlots = props.cells;\n const details = !!props.detail && !table.tree;\n return h(\n DataGridBody,\n {\n class: \"vt-body\",\n treeCell: false,\n colspan: table.columns.length + (props.rowNumbers || details || props.rowActions ? 1 : 0),\n },\n {\n detail: props.detail,\n rowHeader: ({ index }: { index: number }) =>\n props.rowNumbers || details || props.rowActions\n ? h(\"th\", { class: \"vt-row-number\", scope: \"row\", \"aria-colindex\": 1 }, [\n details ? h(VtExpandToggle, { row: table.rows[index]! }) : null,\n props.rowNumbers ? String(table.pageStart + index) : null,\n props.rowActions\n ? h(VtRowActions, {\n row: table.rows[index]!,\n editable: false,\n removable: props.removable,\n })\n : null,\n ])\n : null,\n cell: (cellProps: GridCellSlotProps) => {\n const slot = cellSlots[cellProps.column.id];\n const content = () => (slot ? slot(cellProps) : cellProps.display);\n return table.tree && cellProps.column.id === resolveTreeColumn(table, props.treeColumn)\n ? h(VtTreeCell, { row: cellProps.row }, { default: content })\n : content();\n },\n editor: (editor: CellEditorSlotProps) =>\n props.editors[editor.column.id]?.(editor) ??\n h(VtCellEditor, { editor, spec: editor.spec, finish: editor.finish }),\n },\n );\n };\n },\n});\n\n/**\n * The styled spreadsheet grid, with optional row numbers and A, B, C column letters. A\n * `cell.<column id>` slot draws that column's cells while they are not being edited.\n */\nexport const VtGrid = defineComponent({\n name: \"VtGrid\",\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: GridCellSlotProps;\n [key: `editor.${string}`]: CellEditorSlotProps;\n } & {\n default?: (props: Record<string, unknown>) => VNode[];\n expanded?: (props: DetailSlotProps) => VNodeChild;\n }\n >,\n props: {\n table: { type: Object as PropType<AnyDataTableBinding>, required: true },\n label: { type: String as PropType<string | undefined>, default: undefined },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n ...surfaceProps,\n rowActions: { type: Boolean, default: false },\n removable: { type: Boolean, default: false },\n },\n emits: { save: (_result: unknown) => true, cancel: (_key: unknown) => true },\n setup(props, { slots, attrs, emit }) {\n const details = (): boolean => !!slots.expanded && !props.table.tree;\n const cellSlots = (): Record<string, CellSlot> => {\n const found: Record<string, CellSlot> = {};\n for (const [name, slot] of Object.entries(slots)) {\n if (name.startsWith(\"cell.\") && slot) {\n found[name.slice(\"cell.\".length)] = slot as CellSlot;\n }\n }\n return found;\n };\n const editorSlots = (): Record<string, EditorSlot> => {\n const found: Record<string, EditorSlot> = {};\n for (const name of Object.keys(slots)) {\n if (name.startsWith(\"editor.\")) {\n const slot = slots[name as `editor.${string}`];\n if (slot) found[name.slice(7)] = slot;\n }\n }\n return found;\n };\n const header = () =>\n h(VtHeader, null, {\n before: () =>\n props.rowNumbers || details() || props.rowActions\n ? h(\"th\", {\n class: \"vt-row-number\",\n \"aria-colindex\": 1,\n \"aria-label\": props.rowActions\n ? \"Row actions\"\n : details()\n ? \"Details\"\n : \"Row number\",\n })\n : null,\n header: ({ column }: { column: TableColumn<unknown> }) =>\n props.columnLetters\n ? [\n h(\n \"span\",\n { class: \"vt-column-letter\" },\n columnLabel(props.table.columns.indexOf(column)),\n ),\n column.header,\n ]\n : column.header,\n });\n return () =>\n h(\n \"div\",\n surfaceAttrs({\n ...props,\n loading:\n props.loading ||\n props.table.loadState === \"loading\" ||\n props.table.loadState === \"streaming\",\n }),\n [\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n scroller(props, [\n h(\n DataGridRoot,\n {\n table: props.table,\n label: props.label,\n leadingColumns: props.rowNumbers || details() || props.rowActions ? 1 : 0,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n class: \"vt-table vt-grid\",\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n gutter: props.rowActions\n ? 120\n : props.rowNumbers\n ? details()\n ? 80\n : 48\n : details()\n ? 48\n : 0,\n onSave: (result: unknown) => emit(\"save\", result),\n onCancel: (key: unknown) => emit(\"cancel\", key),\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n {\n default: (slotProps: Record<string, unknown>) =>\n slots.default?.(slotProps) ?? [\n header(),\n h(GridBody, {\n rowNumbers: props.rowNumbers,\n cells: cellSlots(),\n editors: editorSlots(),\n rowActions: props.rowActions,\n removable: props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,CACE,EAAE,OAAO;GAAE,OAAO;GAAe,MAAM;EAAe,CAAC,GACvD,SAAS,OAAO,CACd,EACE,cACA;GACE,OAAO,MAAM;GACb,OAAO,MAAM;GACb,gBAAgB,MAAM,cAAc,QAAQ,KAAK,MAAM,aAAa,IAAI;GACxE,oBAAoB,MAAM;GAC1B,OAAO;GACP,SAAS,MAAM;GACf,gBAAgB,MAAM;GACtB,WAAW,MAAM;GACjB,UAAU,MAAM;GAChB,aAAa,MAAM;GACnB,QAAQ,MAAM,aACV,MACA,MAAM,aACJ,QAAQ,IACN,KACA,KACF,QAAQ,IACN,KACA;GACR,SAAS,WAAoB,KAAK,QAAQ,MAAM;GAChD,WAAW,QAAiB,KAAK,UAAU,GAAG;GAC9C,YAAY,MAAM;GAClB,iBAAiB,MAAM;EACzB,GACA,EACE,UAAU,cACR,MAAM,UAAU,SAAS,KAAK,CAC5B,OAAO,GACP,EAAE,UAAU;GACV,YAAY,MAAM;GAClB,OAAO,UAAU;GACjB,SAAS,YAAY;GACrB,YAAY,MAAM;GAClB,WAAW,MAAM;GACjB,YAAY,MAAM;GAClB,QAAQ,MAAM;EAChB,CAAC,CACH,EACJ,CACF,CACF,CAAC,CACH,CACF;CACJ;AACF,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
--vt-cell-x: 0.75rem;
|
|
30
30
|
--vt-cell-y: 0.625rem;
|
|
31
31
|
--vt-shadow: 0 8px 24px rgb(31 35 40 / 0.12);
|
|
32
|
+
--vt-tree-indent: 1.25rem;
|
|
32
33
|
|
|
33
34
|
font-family: var(--vt-font);
|
|
34
35
|
font-size: var(--vt-font-size);
|
|
@@ -535,6 +536,119 @@
|
|
|
535
536
|
outline: none;
|
|
536
537
|
}
|
|
537
538
|
|
|
539
|
+
.vt-table [data-edit-cell][data-editable] {
|
|
540
|
+
cursor: text;
|
|
541
|
+
}
|
|
542
|
+
.vt-table [data-edit-cell]:focus-visible {
|
|
543
|
+
outline: 2px solid var(--vt-focus);
|
|
544
|
+
outline-offset: -2px;
|
|
545
|
+
}
|
|
546
|
+
.vt-table [data-dirty] {
|
|
547
|
+
background-color: color-mix(in srgb, var(--vt-accent) 6%, var(--vt-bg));
|
|
548
|
+
}
|
|
549
|
+
.vt-table [data-editing] [data-editor],
|
|
550
|
+
.vt-cell-editor,
|
|
551
|
+
.vt-table [data-select-editor] input,
|
|
552
|
+
.vt-table [data-select-editor] select {
|
|
553
|
+
box-sizing: border-box;
|
|
554
|
+
min-width: 6rem;
|
|
555
|
+
max-width: 100%;
|
|
556
|
+
width: 100%;
|
|
557
|
+
padding: 0.5rem;
|
|
558
|
+
color: var(--vt-fg);
|
|
559
|
+
font: inherit;
|
|
560
|
+
background: var(--vt-bg);
|
|
561
|
+
border: 1px solid var(--vt-border);
|
|
562
|
+
border-radius: 4px;
|
|
563
|
+
accent-color: var(--vt-accent);
|
|
564
|
+
caret-color: var(--vt-accent);
|
|
565
|
+
}
|
|
566
|
+
.vt-table [data-editor][type="checkbox"] {
|
|
567
|
+
width: 1.1rem;
|
|
568
|
+
min-width: 1.1rem;
|
|
569
|
+
height: 1.1rem;
|
|
570
|
+
margin: 0.5rem;
|
|
571
|
+
}
|
|
572
|
+
.vt-table [data-editor]:focus-visible,
|
|
573
|
+
.vt-table [data-select-editor] input:focus-visible {
|
|
574
|
+
outline: 2px solid var(--vt-focus);
|
|
575
|
+
outline-offset: -2px;
|
|
576
|
+
}
|
|
577
|
+
.vt-table [aria-invalid="true"] [data-editor],
|
|
578
|
+
.vt-table [data-editor][aria-invalid="true"] {
|
|
579
|
+
border-color: var(--vt-danger);
|
|
580
|
+
}
|
|
581
|
+
.vt-table [data-edit-issues] {
|
|
582
|
+
display: block;
|
|
583
|
+
padding: 0.4rem 0.5rem;
|
|
584
|
+
color: var(--vt-danger);
|
|
585
|
+
font-size: 0.85em;
|
|
586
|
+
white-space: normal;
|
|
587
|
+
}
|
|
588
|
+
.vt-table [aria-busy="true"] [data-edit-issues] {
|
|
589
|
+
color: var(--vt-muted);
|
|
590
|
+
}
|
|
591
|
+
.vt-table [data-select-editor] {
|
|
592
|
+
min-width: 10rem;
|
|
593
|
+
padding: 0.4rem;
|
|
594
|
+
}
|
|
595
|
+
.vt-table [data-editor-hint] {
|
|
596
|
+
display: block;
|
|
597
|
+
padding-top: 0.35rem;
|
|
598
|
+
font-size: 0.8em;
|
|
599
|
+
color: var(--vt-muted);
|
|
600
|
+
}
|
|
601
|
+
.vt-row-controls {
|
|
602
|
+
width: 1%;
|
|
603
|
+
}
|
|
604
|
+
.vt-row-actions {
|
|
605
|
+
display: flex;
|
|
606
|
+
align-items: center;
|
|
607
|
+
flex-wrap: wrap;
|
|
608
|
+
gap: 0.35rem;
|
|
609
|
+
min-width: 5rem;
|
|
610
|
+
max-width: 100%;
|
|
611
|
+
}
|
|
612
|
+
.vt-row-actions details {
|
|
613
|
+
min-width: 0;
|
|
614
|
+
max-width: 100%;
|
|
615
|
+
}
|
|
616
|
+
.vt-row-actions button,
|
|
617
|
+
.vt-row-actions summary {
|
|
618
|
+
padding: 0.3rem 0.5rem;
|
|
619
|
+
border: 1px solid var(--vt-border);
|
|
620
|
+
border-radius: 4px;
|
|
621
|
+
color: var(--vt-fg);
|
|
622
|
+
background: var(--vt-bg);
|
|
623
|
+
font: inherit;
|
|
624
|
+
font-size: 0.85em;
|
|
625
|
+
cursor: pointer;
|
|
626
|
+
white-space: nowrap;
|
|
627
|
+
}
|
|
628
|
+
.vt-row-actions button:disabled {
|
|
629
|
+
color: var(--vt-muted);
|
|
630
|
+
cursor: default;
|
|
631
|
+
}
|
|
632
|
+
.vt-row-actions button:enabled:hover,
|
|
633
|
+
.vt-row-actions summary:hover {
|
|
634
|
+
background: var(--vt-header-bg);
|
|
635
|
+
}
|
|
636
|
+
.vt-row-actions button:focus-visible,
|
|
637
|
+
.vt-row-actions summary:focus-visible {
|
|
638
|
+
outline: 2px solid var(--vt-focus);
|
|
639
|
+
outline-offset: 2px;
|
|
640
|
+
}
|
|
641
|
+
.vt-row-actions [data-row-menu] {
|
|
642
|
+
display: flex;
|
|
643
|
+
flex-wrap: wrap;
|
|
644
|
+
gap: 0.35rem;
|
|
645
|
+
margin-top: 0.35rem;
|
|
646
|
+
}
|
|
647
|
+
.vt-row-actions [data-row-menu] button {
|
|
648
|
+
max-width: 100%;
|
|
649
|
+
white-space: normal;
|
|
650
|
+
}
|
|
651
|
+
|
|
538
652
|
.vt-grid .vt-row-number {
|
|
539
653
|
width: 1%;
|
|
540
654
|
padding-inline: 0.5rem;
|
|
@@ -567,3 +681,76 @@
|
|
|
567
681
|
padding-inline: 0;
|
|
568
682
|
border: 0;
|
|
569
683
|
}
|
|
684
|
+
|
|
685
|
+
.vt-tree-cell {
|
|
686
|
+
display: flex;
|
|
687
|
+
flex-wrap: wrap;
|
|
688
|
+
align-items: center;
|
|
689
|
+
gap: 0.375rem;
|
|
690
|
+
min-width: 0;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.vt-tree-toggle {
|
|
694
|
+
display: inline-flex;
|
|
695
|
+
flex: 0 0 1.75rem;
|
|
696
|
+
justify-content: center;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.vt-expand-toggle {
|
|
700
|
+
display: inline-flex;
|
|
701
|
+
align-items: center;
|
|
702
|
+
justify-content: center;
|
|
703
|
+
width: 1.75rem;
|
|
704
|
+
height: 1.75rem;
|
|
705
|
+
padding: 0;
|
|
706
|
+
color: var(--vt-muted);
|
|
707
|
+
background: transparent;
|
|
708
|
+
border: 0;
|
|
709
|
+
border-radius: var(--vt-control-radius);
|
|
710
|
+
cursor: pointer;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.vt-expand-toggle:hover {
|
|
714
|
+
color: var(--vt-fg);
|
|
715
|
+
background: var(--vt-hover);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.vt-expand-toggle:focus-visible,
|
|
719
|
+
.vt-tree-retry:focus-visible,
|
|
720
|
+
.vt-table tr[tabindex]:focus-visible {
|
|
721
|
+
outline: 2px solid var(--vt-focus);
|
|
722
|
+
outline-offset: -2px;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.vt-tree-loading {
|
|
726
|
+
color: var(--vt-muted);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.vt-tree-error {
|
|
730
|
+
color: var(--vt-danger);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.vt-tree-retry {
|
|
734
|
+
padding: 0.125rem 0.25rem;
|
|
735
|
+
color: inherit;
|
|
736
|
+
font: inherit;
|
|
737
|
+
background: transparent;
|
|
738
|
+
border: 1px solid currentColor;
|
|
739
|
+
border-radius: var(--vt-control-radius);
|
|
740
|
+
cursor: pointer;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.vt-table .vt-expansion-cell {
|
|
744
|
+
width: 2.75rem;
|
|
745
|
+
padding-inline: 0.5rem;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.vt-table .vt-detail-cell {
|
|
749
|
+
padding: 1rem;
|
|
750
|
+
white-space: normal;
|
|
751
|
+
background: var(--vt-header-bg);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.vt-table tr[hidden] {
|
|
755
|
+
display: none;
|
|
756
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueye-table/styled",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"description": "Styled, themeable Vue components for vueye-table, built on the headless layer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-table",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"provenance": true
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@vueye-table/core": "3.0.0-
|
|
45
|
-
"@vueye-table/headless": "3.0.0-
|
|
46
|
-
"@vueye-table/vue": "3.0.0-
|
|
44
|
+
"@vueye-table/core": "3.0.0-beta.1",
|
|
45
|
+
"@vueye-table/headless": "3.0.0-beta.1",
|
|
46
|
+
"@vueye-table/vue": "3.0.0-beta.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"vue": "3.5.43",
|