@vueye-table/styled 3.0.0-alpha.8 → 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 +172 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +87 -17
- package/dist/index.js.map +1 -1
- package/dist/style.css +74 -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 { 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;
|
|
@@ -128,6 +136,14 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
128
136
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
129
137
|
readonly default: undefined;
|
|
130
138
|
};
|
|
139
|
+
treeColumn: {
|
|
140
|
+
readonly type: PropType<string | undefined>;
|
|
141
|
+
readonly default: undefined;
|
|
142
|
+
};
|
|
143
|
+
keepAliveDetail: {
|
|
144
|
+
readonly type: BooleanConstructor;
|
|
145
|
+
readonly default: false;
|
|
146
|
+
};
|
|
131
147
|
virtual: {
|
|
132
148
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
133
149
|
readonly default: false;
|
|
@@ -164,6 +180,8 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
164
180
|
stickyHeader: boolean;
|
|
165
181
|
loading: boolean;
|
|
166
182
|
theme: "light" | "dark" | undefined;
|
|
183
|
+
treeColumn: string | undefined;
|
|
184
|
+
keepAliveDetail: boolean;
|
|
167
185
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
168
186
|
height: string | undefined;
|
|
169
187
|
rowHeight: number;
|
|
@@ -174,9 +192,14 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
174
192
|
default?: (props: {
|
|
175
193
|
table: DataTableBinding<unknown>;
|
|
176
194
|
}) => VNode[];
|
|
195
|
+
expanded?: (props: DetailSlotProps) => VNodeChild;
|
|
177
196
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
178
197
|
/** The styled body, with the empty state in a full-width row. */
|
|
179
198
|
declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
199
|
+
treeColumn: {
|
|
200
|
+
type: PropType<string | undefined>;
|
|
201
|
+
default: undefined;
|
|
202
|
+
};
|
|
180
203
|
virtual: {
|
|
181
204
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
182
205
|
readonly default: false;
|
|
@@ -204,6 +227,10 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
204
227
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
205
228
|
[key: string]: any;
|
|
206
229
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
230
|
+
treeColumn: {
|
|
231
|
+
type: PropType<string | undefined>;
|
|
232
|
+
default: undefined;
|
|
233
|
+
};
|
|
207
234
|
virtual: {
|
|
208
235
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
209
236
|
readonly default: false;
|
|
@@ -229,6 +256,7 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
229
256
|
readonly default: 120;
|
|
230
257
|
};
|
|
231
258
|
}>> & Readonly<{}>, {
|
|
259
|
+
treeColumn: string | undefined;
|
|
232
260
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
233
261
|
height: string | undefined;
|
|
234
262
|
rowHeight: number;
|
|
@@ -240,6 +268,8 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
240
268
|
rows: readonly TableRow<unknown>[];
|
|
241
269
|
}) => VNode[];
|
|
242
270
|
empty?: () => VNode[];
|
|
271
|
+
detail?: (props: DetailSlotProps) => VNodeChild;
|
|
272
|
+
row?: (props: DetailSlotProps) => VNodeChild;
|
|
243
273
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
244
274
|
/** The default empty state. */
|
|
245
275
|
declare const VtEmpty: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -392,6 +422,125 @@ declare const VtLoadMore: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
392
422
|
retryLabel: string;
|
|
393
423
|
loadingLabel: string;
|
|
394
424
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
425
|
+
declare const VtDetailRow: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
426
|
+
row: {
|
|
427
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
428
|
+
readonly required: true;
|
|
429
|
+
};
|
|
430
|
+
colspan: {
|
|
431
|
+
type: NumberConstructor;
|
|
432
|
+
default: undefined;
|
|
433
|
+
};
|
|
434
|
+
hidden: {
|
|
435
|
+
type: BooleanConstructor;
|
|
436
|
+
default: boolean;
|
|
437
|
+
};
|
|
438
|
+
keepAlive: {
|
|
439
|
+
type: PropType<boolean | undefined>;
|
|
440
|
+
default: undefined;
|
|
441
|
+
};
|
|
442
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
443
|
+
[key: string]: any;
|
|
444
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
445
|
+
row: {
|
|
446
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
447
|
+
readonly required: true;
|
|
448
|
+
};
|
|
449
|
+
colspan: {
|
|
450
|
+
type: NumberConstructor;
|
|
451
|
+
default: undefined;
|
|
452
|
+
};
|
|
453
|
+
hidden: {
|
|
454
|
+
type: BooleanConstructor;
|
|
455
|
+
default: boolean;
|
|
456
|
+
};
|
|
457
|
+
keepAlive: {
|
|
458
|
+
type: PropType<boolean | undefined>;
|
|
459
|
+
default: undefined;
|
|
460
|
+
};
|
|
461
|
+
}>> & Readonly<{}>, {
|
|
462
|
+
colspan: number;
|
|
463
|
+
hidden: boolean;
|
|
464
|
+
keepAlive: boolean | undefined;
|
|
465
|
+
}, SlotsType<{
|
|
466
|
+
default?: (props: {
|
|
467
|
+
row: TableRow<unknown>;
|
|
468
|
+
}) => VNodeChild;
|
|
469
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
470
|
+
declare const VtExpandToggle: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
471
|
+
readonly row: {
|
|
472
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
473
|
+
readonly required: true;
|
|
474
|
+
};
|
|
475
|
+
readonly controls: {
|
|
476
|
+
readonly type: PropType<string | undefined>;
|
|
477
|
+
readonly default: undefined;
|
|
478
|
+
};
|
|
479
|
+
readonly expandLabel: {
|
|
480
|
+
readonly type: StringConstructor;
|
|
481
|
+
readonly default: "Expand row";
|
|
482
|
+
};
|
|
483
|
+
readonly collapseLabel: {
|
|
484
|
+
readonly type: StringConstructor;
|
|
485
|
+
readonly default: "Collapse row";
|
|
486
|
+
};
|
|
487
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
488
|
+
[key: string]: any;
|
|
489
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
490
|
+
readonly row: {
|
|
491
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
492
|
+
readonly required: true;
|
|
493
|
+
};
|
|
494
|
+
readonly controls: {
|
|
495
|
+
readonly type: PropType<string | undefined>;
|
|
496
|
+
readonly default: undefined;
|
|
497
|
+
};
|
|
498
|
+
readonly expandLabel: {
|
|
499
|
+
readonly type: StringConstructor;
|
|
500
|
+
readonly default: "Expand row";
|
|
501
|
+
};
|
|
502
|
+
readonly collapseLabel: {
|
|
503
|
+
readonly type: StringConstructor;
|
|
504
|
+
readonly default: "Collapse row";
|
|
505
|
+
};
|
|
506
|
+
}>> & Readonly<{}>, {
|
|
507
|
+
readonly controls: string | undefined;
|
|
508
|
+
readonly expandLabel: string;
|
|
509
|
+
readonly collapseLabel: string;
|
|
510
|
+
}, SlotsType<{
|
|
511
|
+
default?: (props: {
|
|
512
|
+
row: TableRow<unknown>;
|
|
513
|
+
expanded: boolean;
|
|
514
|
+
}) => VNodeChild;
|
|
515
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
516
|
+
declare const VtTreeCell: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
517
|
+
readonly row: {
|
|
518
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
519
|
+
readonly required: true;
|
|
520
|
+
};
|
|
521
|
+
readonly as: {
|
|
522
|
+
readonly type: StringConstructor;
|
|
523
|
+
readonly default: string;
|
|
524
|
+
};
|
|
525
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
526
|
+
[key: string]: any;
|
|
527
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
528
|
+
readonly row: {
|
|
529
|
+
readonly type: PropType<TableRow<unknown>>;
|
|
530
|
+
readonly required: true;
|
|
531
|
+
};
|
|
532
|
+
readonly as: {
|
|
533
|
+
readonly type: StringConstructor;
|
|
534
|
+
readonly default: string;
|
|
535
|
+
};
|
|
536
|
+
}>> & Readonly<{}>, {
|
|
537
|
+
readonly as: string;
|
|
538
|
+
}, SlotsType<{
|
|
539
|
+
default?: () => VNodeChild;
|
|
540
|
+
toggle?: (props: {
|
|
541
|
+
row: TableRow<unknown>;
|
|
542
|
+
}) => VNodeChild;
|
|
543
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
395
544
|
/** A horizontal bar for controls above or below a table. */
|
|
396
545
|
declare const VtToolbar: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
397
546
|
[key: string]: any;
|
|
@@ -431,6 +580,14 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
431
580
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
432
581
|
readonly default: undefined;
|
|
433
582
|
};
|
|
583
|
+
treeColumn: {
|
|
584
|
+
readonly type: PropType<string | undefined>;
|
|
585
|
+
readonly default: undefined;
|
|
586
|
+
};
|
|
587
|
+
keepAliveDetail: {
|
|
588
|
+
readonly type: BooleanConstructor;
|
|
589
|
+
readonly default: false;
|
|
590
|
+
};
|
|
434
591
|
virtual: {
|
|
435
592
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
436
593
|
readonly default: false;
|
|
@@ -502,6 +659,14 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
502
659
|
readonly type: PropType<"light" | "dark" | undefined>;
|
|
503
660
|
readonly default: undefined;
|
|
504
661
|
};
|
|
662
|
+
treeColumn: {
|
|
663
|
+
readonly type: PropType<string | undefined>;
|
|
664
|
+
readonly default: undefined;
|
|
665
|
+
};
|
|
666
|
+
keepAliveDetail: {
|
|
667
|
+
readonly type: BooleanConstructor;
|
|
668
|
+
readonly default: false;
|
|
669
|
+
};
|
|
505
670
|
virtual: {
|
|
506
671
|
readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
|
|
507
672
|
readonly default: false;
|
|
@@ -551,6 +716,8 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
551
716
|
stickyHeader: boolean;
|
|
552
717
|
loading: boolean;
|
|
553
718
|
theme: "light" | "dark" | undefined;
|
|
719
|
+
treeColumn: string | undefined;
|
|
720
|
+
keepAliveDetail: boolean;
|
|
554
721
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
555
722
|
height: string | undefined;
|
|
556
723
|
rowHeight: number;
|
|
@@ -563,6 +730,7 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
563
730
|
[key: `cell.${string}`]: GridCellSlotProps;
|
|
564
731
|
} & {
|
|
565
732
|
default?: (props: Record<string, unknown>) => VNode[];
|
|
733
|
+
expanded?: (props: DetailSlotProps) => VNodeChild;
|
|
566
734
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
567
735
|
//#endregion
|
|
568
736
|
//#region src/icons.d.ts
|
|
@@ -573,6 +741,8 @@ declare const paths: {
|
|
|
573
741
|
readonly search: "M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm10 2-4.35-4.35";
|
|
574
742
|
readonly columns: "M4 4h6v16H4zM14 4h6v16h-6z";
|
|
575
743
|
readonly empty: "M3 7h18M3 12h18M3 17h10";
|
|
744
|
+
readonly expand: "M9 5l7 7-7 7";
|
|
745
|
+
readonly collapse: "M5 9l7 7 7-7";
|
|
576
746
|
};
|
|
577
747
|
type IconName = keyof typeof paths;
|
|
578
748
|
/** A 24-pixel stroke icon that inherits the text color. */
|
|
@@ -585,5 +755,5 @@ declare function icon(name: IconName, className?: string): VNode;
|
|
|
585
755
|
*/
|
|
586
756
|
declare function withClass<TComponent extends Component>(component: TComponent, className: string, name: string): TComponent;
|
|
587
757
|
//#endregion
|
|
588
|
-
export { type Density, type IconName, VtBody, VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, icon, withClass };
|
|
758
|
+
export { type Density, type IconName, VtBody, VtColumnVisibility, VtDetailRow, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, VtTreeCell, icon, withClass };
|
|
589
759
|
//# 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":";;;;;KA6CY;;cA8DC,+BAAe,8BAAA;;IAEO,MAAA,SAAS;;;;;;;IAAT,MAAA,SAAS;;;;;qCAW1C;;cAGW,wBAAQ,0BAAA,oBAAA,4BAAA;;;GAIoB,2BAAA;IACjC,QAAQ;IACR,MAAM;IACN,aAAa;QACT;;EAEG,eAAM;EACP,cAAM;EACL,UAAC;IAAS,QAAQ;QAA2B;kCA2C1D;;;;;cAMW,uBAAO,8BAAA;;aArIS,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAOX,MAAA;;;;;;;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,KAAK;QAAwB;kCASlD;;cAGW,yBAAS,0BAAA,oBAAA,4BAAA;;;EAEmB,gBAAM;kCAI7C;;;;;cAyDW,sBAAM,8BAAA;;aA/aU,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAOX,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAibE,MAAA,SAAS;;;;IACT,MAAA;;;;;;;;;;;;;;;aAzbA,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAOX,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAibE,MAAA,SAAS;;;;IACT,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EANb,WAAC,OAAO,4BAA4B;EACnC,YAAC,OAAO,oBAAoB;kCAyF3C;;;cC9jBI;;;;;;;;;;KAWM,wBAAwB;;iBAGpB,KAAK,MAAM,UAAU,qBAAwB;;;;;;;iBCV7C,UAAU,mBAAmB,WAC3C,WAAW,YACX,mBACA,eACC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { columnLabel } from "@vueye-table/core";
|
|
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 { DataGridBody, DataGridRoot, DataTableBody, DataTableCell, DataTableColumnVisibility, DataTableDetailRow, DataTableExpandToggle, DataTableHeader, DataTableHeaderCell, DataTableHeaderRow, DataTableLoadMore, DataTablePageSize, DataTablePagination, DataTableRoot, DataTableRow, DataTableSearch, DataTableSortButton, DataTableStatus, DataTableTreeCell, DataTableViewport, DataTableVirtualColumns, 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"
|
|
@@ -163,15 +166,23 @@ const VtTable = defineComponent({
|
|
|
163
166
|
class: "vt-table",
|
|
164
167
|
virtual: props.virtual,
|
|
165
168
|
rowHeight: props.rowHeight,
|
|
166
|
-
overscan: props.overscan
|
|
167
|
-
|
|
169
|
+
overscan: props.overscan,
|
|
170
|
+
treeColumn: props.treeColumn,
|
|
171
|
+
keepAliveDetail: props.keepAliveDetail
|
|
172
|
+
}, { default: () => slots.default?.({ table: props.table }) ?? [h(VtHeader), h(VtBody, { treeColumn: props.treeColumn }, { detail: slots.expanded })] })])]);
|
|
168
173
|
}
|
|
169
174
|
});
|
|
170
175
|
/** The styled body, with the empty state in a full-width row. */
|
|
171
176
|
const VtBody = defineComponent({
|
|
172
177
|
name: "VtBody",
|
|
173
178
|
slots: Object,
|
|
174
|
-
props: {
|
|
179
|
+
props: {
|
|
180
|
+
...virtualProps,
|
|
181
|
+
treeColumn: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: void 0
|
|
184
|
+
}
|
|
185
|
+
},
|
|
175
186
|
setup(props, { slots }) {
|
|
176
187
|
const table = injectDataTable("<VtBody>");
|
|
177
188
|
return () => h(DataTableBody, {
|
|
@@ -179,6 +190,22 @@ const VtBody = defineComponent({
|
|
|
179
190
|
...props
|
|
180
191
|
}, {
|
|
181
192
|
...slots,
|
|
193
|
+
row: slots.row ?? (({ row, rowIndex }) => h(DataTableRow, {
|
|
194
|
+
key: row.key,
|
|
195
|
+
row,
|
|
196
|
+
rowIndex
|
|
197
|
+
}, {
|
|
198
|
+
default: () => table.columns.map((column) => h(DataTableCell, {
|
|
199
|
+
key: column.id,
|
|
200
|
+
row,
|
|
201
|
+
column,
|
|
202
|
+
tree: false
|
|
203
|
+
}, {
|
|
204
|
+
default: () => table.tree && column.id === resolveTreeColumn(table, props.treeColumn) ? h(VtTreeCell, { row }, () => row.getDisplay(column.id)) : row.getDisplay(column.id),
|
|
205
|
+
$stable: true
|
|
206
|
+
})),
|
|
207
|
+
$stable: true
|
|
208
|
+
})),
|
|
182
209
|
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
210
|
});
|
|
184
211
|
}
|
|
@@ -266,6 +293,29 @@ const VtColumnVisibility = defineComponent({
|
|
|
266
293
|
const VtPagination = withClass(DataTablePagination, "vt-pagination", "VtPagination");
|
|
267
294
|
const VtStatus = withClass(DataTableStatus, "vt-status", "VtStatus");
|
|
268
295
|
const VtLoadMore = withClass(DataTableLoadMore, "vt-button", "VtLoadMore");
|
|
296
|
+
const VtDetailRow = withClass(DataTableDetailRow, "vt-detail-row", "VtDetailRow");
|
|
297
|
+
const VtExpandToggle = defineComponent({
|
|
298
|
+
name: "VtExpandToggle",
|
|
299
|
+
props: expandToggleProps,
|
|
300
|
+
slots: Object,
|
|
301
|
+
setup(props, { slots }) {
|
|
302
|
+
return () => h(DataTableExpandToggle, {
|
|
303
|
+
...props,
|
|
304
|
+
class: "vt-expand-toggle"
|
|
305
|
+
}, { default: slots.default ?? (({ expanded }) => icon(expanded ? "collapse" : "expand")) });
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
const VtTreeCell = defineComponent({
|
|
309
|
+
name: "VtTreeCell",
|
|
310
|
+
props: treeCellProps,
|
|
311
|
+
slots: Object,
|
|
312
|
+
setup(props, { slots }) {
|
|
313
|
+
return () => h(DataTableTreeCell, props, {
|
|
314
|
+
...slots,
|
|
315
|
+
toggle: slots.toggle ?? (() => h(VtExpandToggle, { row: props.row }))
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
});
|
|
269
319
|
/** A horizontal bar for controls above or below a table. */
|
|
270
320
|
const VtToolbar = defineComponent({
|
|
271
321
|
name: "VtToolbar",
|
|
@@ -284,6 +334,14 @@ const GridBody = defineComponent({
|
|
|
284
334
|
type: Boolean,
|
|
285
335
|
default: true
|
|
286
336
|
},
|
|
337
|
+
treeColumn: {
|
|
338
|
+
type: String,
|
|
339
|
+
default: void 0
|
|
340
|
+
},
|
|
341
|
+
detail: {
|
|
342
|
+
type: Function,
|
|
343
|
+
default: void 0
|
|
344
|
+
},
|
|
287
345
|
/** Content slots per column id, as `cell.<id>` on `<VtGrid>`. */
|
|
288
346
|
cells: {
|
|
289
347
|
type: Object,
|
|
@@ -294,16 +352,22 @@ const GridBody = defineComponent({
|
|
|
294
352
|
const table = injectDataTable("<VtGrid>");
|
|
295
353
|
return () => {
|
|
296
354
|
const cellSlots = props.cells;
|
|
297
|
-
const
|
|
298
|
-
return h(DataGridBody, {
|
|
299
|
-
|
|
355
|
+
const details = !!props.detail && !table.tree;
|
|
356
|
+
return h(DataGridBody, {
|
|
357
|
+
class: "vt-body",
|
|
358
|
+
treeCell: false,
|
|
359
|
+
colspan: table.columns.length + (props.rowNumbers || details ? 1 : 0)
|
|
360
|
+
}, {
|
|
361
|
+
detail: props.detail,
|
|
362
|
+
rowHeader: ({ index }) => props.rowNumbers || details ? h("th", {
|
|
300
363
|
class: "vt-row-number",
|
|
301
364
|
scope: "row"
|
|
302
|
-
}, String(table.pageStart + index)) : null,
|
|
303
|
-
|
|
365
|
+
}, [details ? h(VtExpandToggle, { row: table.rows[index] }) : null, props.rowNumbers ? String(table.pageStart + index) : null]) : null,
|
|
366
|
+
cell: (cellProps) => {
|
|
304
367
|
const slot = cellSlots[cellProps.column.id];
|
|
305
|
-
|
|
306
|
-
|
|
368
|
+
const content = () => slot ? slot(cellProps) : cellProps.display;
|
|
369
|
+
return table.tree && cellProps.column.id === resolveTreeColumn(table, props.treeColumn) ? h(VtTreeCell, { row: cellProps.row }, { default: content }) : content();
|
|
370
|
+
}
|
|
307
371
|
});
|
|
308
372
|
};
|
|
309
373
|
}
|
|
@@ -335,15 +399,17 @@ const VtGrid = defineComponent({
|
|
|
335
399
|
...surfaceProps
|
|
336
400
|
},
|
|
337
401
|
setup(props, { slots, attrs }) {
|
|
402
|
+
const details = () => !!slots.expanded && !props.table.tree;
|
|
338
403
|
const cellSlots = () => {
|
|
339
404
|
const found = {};
|
|
340
405
|
for (const [name, slot] of Object.entries(slots)) if (name.startsWith("cell.") && slot) found[name.slice(5)] = slot;
|
|
341
406
|
return found;
|
|
342
407
|
};
|
|
343
408
|
const header = () => h(VtHeader, null, {
|
|
344
|
-
before: () => props.rowNumbers ? h("th", {
|
|
409
|
+
before: () => props.rowNumbers || details() ? h("th", {
|
|
345
410
|
class: "vt-row-number",
|
|
346
|
-
"aria-hidden": "true"
|
|
411
|
+
"aria-hidden": details() ? void 0 : "true",
|
|
412
|
+
"aria-label": details() ? "Details" : void 0
|
|
347
413
|
}) : null,
|
|
348
414
|
header: ({ column }) => props.columnLetters ? [h("span", { class: "vt-column-letter" }, columnLabel(props.table.columns.indexOf(column))), column.header] : column.header
|
|
349
415
|
});
|
|
@@ -363,14 +429,18 @@ const VtGrid = defineComponent({
|
|
|
363
429
|
rowHeight: props.rowHeight,
|
|
364
430
|
overscan: props.overscan,
|
|
365
431
|
columnWidth: props.columnWidth,
|
|
366
|
-
gutter: props.rowNumbers ? 48 : 0
|
|
432
|
+
gutter: props.rowNumbers ? details() ? 80 : 48 : details() ? 48 : 0,
|
|
433
|
+
treeColumn: props.treeColumn,
|
|
434
|
+
keepAliveDetail: props.keepAliveDetail
|
|
367
435
|
}, { default: (slotProps) => slots.default?.(slotProps) ?? [header(), h(GridBody, {
|
|
368
436
|
rowNumbers: props.rowNumbers,
|
|
369
|
-
cells: cellSlots()
|
|
437
|
+
cells: cellSlots(),
|
|
438
|
+
treeColumn: props.treeColumn,
|
|
439
|
+
detail: slots.expanded
|
|
370
440
|
})] })])]);
|
|
371
441
|
}
|
|
372
442
|
});
|
|
373
443
|
|
|
374
444
|
//#endregion
|
|
375
|
-
export { VtBody, VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, icon, withClass };
|
|
445
|
+
export { VtBody, VtColumnVisibility, VtDetailRow, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtSortIndicator, VtStatus, VtTable, VtToolbar, VtTreeCell, icon, withClass };
|
|
376
446
|
//# 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,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;EACnB,eAAe;EACf,WAAW;CACb,GACA,CAAC,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,CAAC,CAChC;AACF;;;;;;;;AC1BA,SAAgB,UACd,WACA,WACA,MACY;CACZ,MAAM,WAAgC,QAAQ,EAAE,OAAO,YACrD,EAAE,WAAW,WAAW,OAAO,EAAE,OAAO,UAAU,CAAC,GAAG,KAAK;CAC7D,QAAQ,cAAc;CACtB,QAAQ,eAAe;CACvB,OAAO;AACT;;;;;ACsBA,MAAM,eAAe;CACnB,GAAG;CACH,SAAS;EAAE,MAA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O;IAAiB,eAAe;GAAO,CAAC,IAAI;GAClF,SAAS,EAAE,aACT,MAAM,gBACF,CACE,EACE,QACA,EAAE,OAAO,mBAAmB,GAC5B,YAAY,MAAM,MAAM,QAAQ,QAAQ,MAAM,CAAC,CACjD,GACA,OAAO,MACT,IACA,OAAO;EACf,CAAC;EACH,aACE,EACE,OACA,aAAa;GACX,GAAG;GACH,SACE,MAAM,WACN,MAAM,MAAM,cAAc,aAC1B,MAAM,MAAM,cAAc;EAC9B,CAAC,GACD,CACE,EAAE,OAAO;GAAE,OAAO;GAAe,MAAM;EAAe,CAAC,GACvD,SAAS,OAAO,CACd,EACE,cACA;GACE,OAAO,MAAM;GACb,OAAO,MAAM;GACb,oBAAoB,MAAM;GAC1B,OAAO;GACP,SAAS,MAAM;GACf,gBAAgB,MAAM;GACtB,WAAW,MAAM;GACjB,UAAU,MAAM;GAChB,aAAa,MAAM;GACnB,QAAQ,MAAM,aAAa,KAAK;EAClC,GACA,EACE,UAAU,cACR,MAAM,UAAU,SAAS,KAAK,CAC5B,OAAO,GACP,EAAE,UAAU;GAAE,YAAY,MAAM;GAAY,OAAO,UAAU;EAAE,CAAC,CAClE,EACJ,CACF,CACF,CAAC,CACH,CACF;CACJ;AACF,CAAC"}
|
|
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 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} 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 ...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 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;\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 },\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 ? 1 : 0),\n },\n {\n detail: props.detail,\n rowHeader: ({ index }: { index: number }) =>\n props.rowNumbers || details\n ? h(\"th\", { class: \"vt-row-number\", scope: \"row\" }, [\n details ? h(VtExpandToggle, { row: table.rows[index]! }) : null,\n props.rowNumbers ? String(table.pageStart + index) : 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 },\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 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 },\n setup(props, { slots, attrs }) {\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 header = () =>\n h(VtHeader, null, {\n before: () =>\n props.rowNumbers || details()\n ? h(\"th\", {\n class: \"vt-row-number\",\n \"aria-hidden\": details() ? undefined : \"true\",\n \"aria-label\": details() ? \"Details\" : undefined,\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 \"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 ? (details() ? 80 : 48) : details() ? 48 : 0,\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 treeColumn: props.treeColumn,\n detail: slots.expanded,\n }),\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;CACP,QAAQ;CACR,UAAU;AACZ;;AAKA,SAAgB,KAAK,MAAgB,YAAY,WAAkB;CACjE,OAAO,EACL,OACA;EACE,OAAO;EACP,SAAS;EACT,OAAO;EACP,QA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AAoB,MAAM;GAC1B,OAAO;GACP,SAAS,MAAM;GACf,gBAAgB,MAAM;GACtB,WAAW,MAAM;GACjB,UAAU,MAAM;GAChB,aAAa,MAAM;GACnB,QAAQ,MAAM,aAAc,QAAQ,IAAI,KAAK,KAAM,QAAQ,IAAI,KAAK;GACpE,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,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);
|
|
@@ -567,3 +568,76 @@
|
|
|
567
568
|
padding-inline: 0;
|
|
568
569
|
border: 0;
|
|
569
570
|
}
|
|
571
|
+
|
|
572
|
+
.vt-tree-cell {
|
|
573
|
+
display: flex;
|
|
574
|
+
flex-wrap: wrap;
|
|
575
|
+
align-items: center;
|
|
576
|
+
gap: 0.375rem;
|
|
577
|
+
min-width: 0;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.vt-tree-toggle {
|
|
581
|
+
display: inline-flex;
|
|
582
|
+
flex: 0 0 1.75rem;
|
|
583
|
+
justify-content: center;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.vt-expand-toggle {
|
|
587
|
+
display: inline-flex;
|
|
588
|
+
align-items: center;
|
|
589
|
+
justify-content: center;
|
|
590
|
+
width: 1.75rem;
|
|
591
|
+
height: 1.75rem;
|
|
592
|
+
padding: 0;
|
|
593
|
+
color: var(--vt-muted);
|
|
594
|
+
background: transparent;
|
|
595
|
+
border: 0;
|
|
596
|
+
border-radius: var(--vt-control-radius);
|
|
597
|
+
cursor: pointer;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.vt-expand-toggle:hover {
|
|
601
|
+
color: var(--vt-fg);
|
|
602
|
+
background: var(--vt-hover);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.vt-expand-toggle:focus-visible,
|
|
606
|
+
.vt-tree-retry:focus-visible,
|
|
607
|
+
.vt-table tr[tabindex]:focus-visible {
|
|
608
|
+
outline: 2px solid var(--vt-focus);
|
|
609
|
+
outline-offset: -2px;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.vt-tree-loading {
|
|
613
|
+
color: var(--vt-muted);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.vt-tree-error {
|
|
617
|
+
color: var(--vt-danger);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.vt-tree-retry {
|
|
621
|
+
padding: 0.125rem 0.25rem;
|
|
622
|
+
color: inherit;
|
|
623
|
+
font: inherit;
|
|
624
|
+
background: transparent;
|
|
625
|
+
border: 1px solid currentColor;
|
|
626
|
+
border-radius: var(--vt-control-radius);
|
|
627
|
+
cursor: pointer;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.vt-table .vt-expansion-cell {
|
|
631
|
+
width: 2.75rem;
|
|
632
|
+
padding-inline: 0.5rem;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.vt-table .vt-detail-cell {
|
|
636
|
+
padding: 1rem;
|
|
637
|
+
white-space: normal;
|
|
638
|
+
background: var(--vt-header-bg);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.vt-table tr[hidden] {
|
|
642
|
+
display: none;
|
|
643
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueye-table/styled",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.9",
|
|
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-alpha.
|
|
45
|
-
"@vueye-table/headless": "3.0.0-alpha.
|
|
46
|
-
"@vueye-table/vue": "3.0.0-alpha.
|
|
44
|
+
"@vueye-table/core": "3.0.0-alpha.9",
|
|
45
|
+
"@vueye-table/headless": "3.0.0-alpha.9",
|
|
46
|
+
"@vueye-table/vue": "3.0.0-alpha.9"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"vue": "3.5.43",
|