@vueye-table/styled 3.0.0-beta.1 → 3.0.0-beta.3
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 +69 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -16
- package/dist/index.js.map +1 -1
- package/dist/style.css +43 -17
- 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 { CellEditorSlotProps, DetailSlotProps, GridCellSlotProps } from "@vueye-table/headless";
|
|
2
|
+
import { AnyRowAttrs, 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
|
|
@@ -32,8 +32,14 @@ declare const VtHeader: import("vue").DefineComponent<{}, () => VNode<import("vu
|
|
|
32
32
|
} & {
|
|
33
33
|
before?: () => VNode[];
|
|
34
34
|
after?: () => VNode[];
|
|
35
|
+
/**
|
|
36
|
+
* The content of every header cell, inside the sort button of a sortable column, so a custom
|
|
37
|
+
* header keeps click-to-sort and its indicator.
|
|
38
|
+
*/
|
|
35
39
|
header?: (props: {
|
|
36
40
|
column: TableColumn<unknown>;
|
|
41
|
+
sort: SortInfo | undefined;
|
|
42
|
+
toggleSort: (multi?: boolean) => void;
|
|
37
43
|
}) => VNodeChild;
|
|
38
44
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
45
|
/**
|
|
@@ -66,7 +72,7 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
66
72
|
readonly default: false;
|
|
67
73
|
};
|
|
68
74
|
theme: {
|
|
69
|
-
readonly type: PropType<"light" | "dark" | undefined>;
|
|
75
|
+
readonly type: PropType<"light" | "dark" | "inherit" | undefined>;
|
|
70
76
|
readonly default: undefined;
|
|
71
77
|
};
|
|
72
78
|
treeColumn: {
|
|
@@ -137,7 +143,7 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
137
143
|
readonly default: false;
|
|
138
144
|
};
|
|
139
145
|
theme: {
|
|
140
|
-
readonly type: PropType<"light" | "dark" | undefined>;
|
|
146
|
+
readonly type: PropType<"light" | "dark" | "inherit" | undefined>;
|
|
141
147
|
readonly default: undefined;
|
|
142
148
|
};
|
|
143
149
|
treeColumn: {
|
|
@@ -188,7 +194,7 @@ declare const VtTable: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
188
194
|
hover: boolean;
|
|
189
195
|
stickyHeader: boolean;
|
|
190
196
|
loading: boolean;
|
|
191
|
-
theme: "light" | "dark" | undefined;
|
|
197
|
+
theme: "light" | "dark" | "inherit" | undefined;
|
|
192
198
|
treeColumn: string | undefined;
|
|
193
199
|
keepAliveDetail: boolean;
|
|
194
200
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
@@ -283,18 +289,18 @@ declare const VtBody: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
283
289
|
/** The default empty state. */
|
|
284
290
|
declare const VtEmpty: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
285
291
|
text: {
|
|
286
|
-
type:
|
|
287
|
-
default:
|
|
292
|
+
type: PropType<string | undefined>;
|
|
293
|
+
default: undefined;
|
|
288
294
|
};
|
|
289
295
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
290
296
|
[key: string]: any;
|
|
291
297
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
292
298
|
text: {
|
|
293
|
-
type:
|
|
294
|
-
default:
|
|
299
|
+
type: PropType<string | undefined>;
|
|
300
|
+
default: undefined;
|
|
295
301
|
};
|
|
296
302
|
}>> & Readonly<{}>, {
|
|
297
|
-
text: string;
|
|
303
|
+
text: string | undefined;
|
|
298
304
|
}, SlotsType<{
|
|
299
305
|
default?: () => VNode[];
|
|
300
306
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -309,8 +315,8 @@ declare const VtPageSize: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
309
315
|
default: () => number[];
|
|
310
316
|
};
|
|
311
317
|
label: {
|
|
312
|
-
type:
|
|
313
|
-
default:
|
|
318
|
+
type: PropType<string | undefined>;
|
|
319
|
+
default: undefined;
|
|
314
320
|
};
|
|
315
321
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
316
322
|
[key: string]: any;
|
|
@@ -320,11 +326,11 @@ declare const VtPageSize: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
320
326
|
default: () => number[];
|
|
321
327
|
};
|
|
322
328
|
label: {
|
|
323
|
-
type:
|
|
324
|
-
default:
|
|
329
|
+
type: PropType<string | undefined>;
|
|
330
|
+
default: undefined;
|
|
325
331
|
};
|
|
326
332
|
}>> & Readonly<{}>, {
|
|
327
|
-
label: string;
|
|
333
|
+
label: string | undefined;
|
|
328
334
|
options: readonly number[];
|
|
329
335
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
330
336
|
/**
|
|
@@ -333,18 +339,18 @@ declare const VtPageSize: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
333
339
|
*/
|
|
334
340
|
declare const VtColumnVisibility: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
335
341
|
label: {
|
|
336
|
-
type:
|
|
337
|
-
default:
|
|
342
|
+
type: PropType<string | undefined>;
|
|
343
|
+
default: undefined;
|
|
338
344
|
};
|
|
339
345
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
340
346
|
[key: string]: any;
|
|
341
347
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
342
348
|
label: {
|
|
343
|
-
type:
|
|
344
|
-
default:
|
|
349
|
+
type: PropType<string | undefined>;
|
|
350
|
+
default: undefined;
|
|
345
351
|
};
|
|
346
352
|
}>> & Readonly<{}>, {
|
|
347
|
-
label: string;
|
|
353
|
+
label: string | undefined;
|
|
348
354
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
349
355
|
declare const VtPagination: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
350
356
|
as: {
|
|
@@ -352,8 +358,8 @@ declare const VtPagination: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
352
358
|
readonly default: string;
|
|
353
359
|
};
|
|
354
360
|
label: {
|
|
355
|
-
type:
|
|
356
|
-
default:
|
|
361
|
+
type: PropType<string | undefined>;
|
|
362
|
+
default: undefined;
|
|
357
363
|
};
|
|
358
364
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
359
365
|
[key: string]: any;
|
|
@@ -363,11 +369,11 @@ declare const VtPagination: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
363
369
|
readonly default: string;
|
|
364
370
|
};
|
|
365
371
|
label: {
|
|
366
|
-
type:
|
|
367
|
-
default:
|
|
372
|
+
type: PropType<string | undefined>;
|
|
373
|
+
default: undefined;
|
|
368
374
|
};
|
|
369
375
|
}>> & Readonly<{}>, {
|
|
370
|
-
label: string;
|
|
376
|
+
label: string | undefined;
|
|
371
377
|
as: string;
|
|
372
378
|
}, SlotsType<{
|
|
373
379
|
default?: (props: {
|
|
@@ -400,36 +406,36 @@ declare const VtStatus: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
400
406
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
401
407
|
declare const VtLoadMore: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
402
408
|
label: {
|
|
403
|
-
type:
|
|
404
|
-
default:
|
|
409
|
+
type: PropType<string | undefined>;
|
|
410
|
+
default: undefined;
|
|
405
411
|
};
|
|
406
412
|
retryLabel: {
|
|
407
|
-
type:
|
|
408
|
-
default:
|
|
413
|
+
type: PropType<string | undefined>;
|
|
414
|
+
default: undefined;
|
|
409
415
|
};
|
|
410
416
|
loadingLabel: {
|
|
411
|
-
type:
|
|
412
|
-
default:
|
|
417
|
+
type: PropType<string | undefined>;
|
|
418
|
+
default: undefined;
|
|
413
419
|
};
|
|
414
420
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
415
421
|
[key: string]: any;
|
|
416
422
|
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
417
423
|
label: {
|
|
418
|
-
type:
|
|
419
|
-
default:
|
|
424
|
+
type: PropType<string | undefined>;
|
|
425
|
+
default: undefined;
|
|
420
426
|
};
|
|
421
427
|
retryLabel: {
|
|
422
|
-
type:
|
|
423
|
-
default:
|
|
428
|
+
type: PropType<string | undefined>;
|
|
429
|
+
default: undefined;
|
|
424
430
|
};
|
|
425
431
|
loadingLabel: {
|
|
426
|
-
type:
|
|
427
|
-
default:
|
|
432
|
+
type: PropType<string | undefined>;
|
|
433
|
+
default: undefined;
|
|
428
434
|
};
|
|
429
435
|
}>> & Readonly<{}>, {
|
|
430
|
-
label: string;
|
|
431
|
-
retryLabel: string;
|
|
432
|
-
loadingLabel: string;
|
|
436
|
+
label: string | undefined;
|
|
437
|
+
retryLabel: string | undefined;
|
|
438
|
+
loadingLabel: string | undefined;
|
|
433
439
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
434
440
|
declare const VtDetailRow: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
435
441
|
row: {
|
|
@@ -486,12 +492,12 @@ declare const VtExpandToggle: import("vue").DefineComponent<import("vue").Extrac
|
|
|
486
492
|
readonly default: undefined;
|
|
487
493
|
};
|
|
488
494
|
readonly expandLabel: {
|
|
489
|
-
readonly type:
|
|
490
|
-
readonly default:
|
|
495
|
+
readonly type: PropType<string | undefined>;
|
|
496
|
+
readonly default: undefined;
|
|
491
497
|
};
|
|
492
498
|
readonly collapseLabel: {
|
|
493
|
-
readonly type:
|
|
494
|
-
readonly default:
|
|
499
|
+
readonly type: PropType<string | undefined>;
|
|
500
|
+
readonly default: undefined;
|
|
495
501
|
};
|
|
496
502
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
497
503
|
[key: string]: any;
|
|
@@ -505,17 +511,17 @@ declare const VtExpandToggle: import("vue").DefineComponent<import("vue").Extrac
|
|
|
505
511
|
readonly default: undefined;
|
|
506
512
|
};
|
|
507
513
|
readonly expandLabel: {
|
|
508
|
-
readonly type:
|
|
509
|
-
readonly default:
|
|
514
|
+
readonly type: PropType<string | undefined>;
|
|
515
|
+
readonly default: undefined;
|
|
510
516
|
};
|
|
511
517
|
readonly collapseLabel: {
|
|
512
|
-
readonly type:
|
|
513
|
-
readonly default:
|
|
518
|
+
readonly type: PropType<string | undefined>;
|
|
519
|
+
readonly default: undefined;
|
|
514
520
|
};
|
|
515
521
|
}>> & Readonly<{}>, {
|
|
516
522
|
readonly controls: string | undefined;
|
|
517
|
-
readonly expandLabel: string;
|
|
518
|
-
readonly collapseLabel: string;
|
|
523
|
+
readonly expandLabel: string | undefined;
|
|
524
|
+
readonly collapseLabel: string | undefined;
|
|
519
525
|
}, SlotsType<{
|
|
520
526
|
default?: (props: {
|
|
521
527
|
row: TableRow<unknown>;
|
|
@@ -664,6 +670,11 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
664
670
|
type: BooleanConstructor;
|
|
665
671
|
default: boolean;
|
|
666
672
|
};
|
|
673
|
+
/** A page's own class, style, `data-*` and `aria-*` attributes for each body row. */
|
|
674
|
+
rowAttrs: {
|
|
675
|
+
type: PropType<AnyRowAttrs | undefined>;
|
|
676
|
+
default: undefined;
|
|
677
|
+
};
|
|
667
678
|
density: {
|
|
668
679
|
readonly type: PropType<Density>;
|
|
669
680
|
readonly default: "comfortable";
|
|
@@ -689,7 +700,7 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
689
700
|
readonly default: false;
|
|
690
701
|
};
|
|
691
702
|
theme: {
|
|
692
|
-
readonly type: PropType<"light" | "dark" | undefined>;
|
|
703
|
+
readonly type: PropType<"light" | "dark" | "inherit" | undefined>;
|
|
693
704
|
readonly default: undefined;
|
|
694
705
|
};
|
|
695
706
|
treeColumn: {
|
|
@@ -754,6 +765,11 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
754
765
|
type: BooleanConstructor;
|
|
755
766
|
default: boolean;
|
|
756
767
|
};
|
|
768
|
+
/** A page's own class, style, `data-*` and `aria-*` attributes for each body row. */
|
|
769
|
+
rowAttrs: {
|
|
770
|
+
type: PropType<AnyRowAttrs | undefined>;
|
|
771
|
+
default: undefined;
|
|
772
|
+
};
|
|
757
773
|
density: {
|
|
758
774
|
readonly type: PropType<Density>;
|
|
759
775
|
readonly default: "comfortable";
|
|
@@ -779,7 +795,7 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
779
795
|
readonly default: false;
|
|
780
796
|
};
|
|
781
797
|
theme: {
|
|
782
|
-
readonly type: PropType<"light" | "dark" | undefined>;
|
|
798
|
+
readonly type: PropType<"light" | "dark" | "inherit" | undefined>;
|
|
783
799
|
readonly default: undefined;
|
|
784
800
|
};
|
|
785
801
|
treeColumn: {
|
|
@@ -841,7 +857,7 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
841
857
|
hover: boolean;
|
|
842
858
|
stickyHeader: boolean;
|
|
843
859
|
loading: boolean;
|
|
844
|
-
theme: "light" | "dark" | undefined;
|
|
860
|
+
theme: "light" | "dark" | "inherit" | undefined;
|
|
845
861
|
treeColumn: string | undefined;
|
|
846
862
|
keepAliveDetail: boolean;
|
|
847
863
|
virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
|
|
@@ -854,6 +870,7 @@ declare const VtGrid: import("vue").DefineComponent<import("vue").ExtractPropTyp
|
|
|
854
870
|
rowNumbers: boolean;
|
|
855
871
|
columnLetters: boolean;
|
|
856
872
|
rowActions: boolean;
|
|
873
|
+
rowAttrs: AnyRowAttrs | undefined;
|
|
857
874
|
}, SlotsType<{
|
|
858
875
|
[key: `cell.${string}`]: GridCellSlotProps;
|
|
859
876
|
[key: `editor.${string}`]: CellEditorSlotProps;
|
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":";;;;;KAuDY;;cAiEC,+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;;;;;EAKL,UAAC;IACR,QAAQ;IACR,MAAM;IACN,aAAa;QACT;kCAmDV;;;;;cAMW,uBAAO,8BAAA;;aAxJS,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAUX,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqJE,MAAA,SAAS;;;;;;;;;;;aA/JT,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAUX,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqJE,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;EAJxB,WAAC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;;;;;;;;;;aAAA,MAAA,WAAA;;;;;;;;;;;;;;;;;;;;;qCAqZhC;cACW,4BAAY,8BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAAmE;;;;;cAyE/E,sBAAM,8BAAA;;;;;;;;;;;IAoBe,MAAA,SAAS;;;;aA7fd,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAUX,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2eE,MAAA,SAAS;;;;IACT,MAAA;;;;;;;;;;;;;;EASF,OAAA;EAAiC,SAAA;;;;;;;;;;;;IAF1B,MAAA,SAAS;;;;aA7fd,MAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;aAUX,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2eE,MAAA,SAAS;;;;IACT,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EANb,WAAC,OAAO,4BAA4B;EACnC,YAAC,OAAO,oBAAoB;kCA4H3C;;;cCxqBI;;;;;;;;;;KAWM,wBAAwB;;iBAGpB,KAAK,MAAM,UAAU,qBAAwB;;;;;;;iBCV7C,UAAU,mBAAmB,WAC3C,WAAW,YACX,mBACA,eACC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { columnLabel } from "@vueye-table/core";
|
|
2
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
|
-
import { injectDataTable } from "@vueye-table/vue";
|
|
3
|
+
import { injectDataTable, useTableLocale } from "@vueye-table/vue";
|
|
4
4
|
import { defineComponent, h, mergeProps } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/icons.ts
|
|
@@ -74,7 +74,10 @@ const surfaceProps = {
|
|
|
74
74
|
type: Boolean,
|
|
75
75
|
default: false
|
|
76
76
|
},
|
|
77
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Force a theme; by default the table follows `prefers-color-scheme`. `"inherit"` declares no
|
|
79
|
+
* palette, so the host's `--vt-*` tokens apply.
|
|
80
|
+
*/
|
|
78
81
|
theme: {
|
|
79
82
|
type: String,
|
|
80
83
|
default: void 0
|
|
@@ -122,6 +125,11 @@ const VtHeader = defineComponent({
|
|
|
122
125
|
slots: Object,
|
|
123
126
|
setup(_props, { slots }) {
|
|
124
127
|
const table = injectDataTable("<VtHeader>");
|
|
128
|
+
const content = (column, sort) => slots.header?.({
|
|
129
|
+
column,
|
|
130
|
+
sort,
|
|
131
|
+
toggleSort: (multi = false) => table.toggleSort(column.id, { multi })
|
|
132
|
+
}) ?? column.header;
|
|
125
133
|
const virtual = injectVirtualRenderer();
|
|
126
134
|
const headerCell = (column) => h(DataTableHeaderCell, {
|
|
127
135
|
key: column.id,
|
|
@@ -130,9 +138,9 @@ const VtHeader = defineComponent({
|
|
|
130
138
|
column,
|
|
131
139
|
class: "vt-sort-button"
|
|
132
140
|
}, {
|
|
133
|
-
default: () => [
|
|
141
|
+
default: ({ sort }) => [content(column, sort)],
|
|
134
142
|
indicator: ({ sort }) => [h(VtSortIndicator, { sort })]
|
|
135
|
-
}) : [
|
|
143
|
+
}) : [content(column, void 0)]) });
|
|
136
144
|
return () => h(DataTableHeader, { class: "vt-head" }, () => h(DataTableHeaderRow, () => [
|
|
137
145
|
slots.before?.(),
|
|
138
146
|
...virtual?.columns ? [h(DataTableVirtualColumns, null, { default: ({ column }) => [headerCell(column)] })] : table.columns.map(headerCell),
|
|
@@ -190,6 +198,7 @@ const VtBody = defineComponent({
|
|
|
190
198
|
},
|
|
191
199
|
setup(props, { slots }) {
|
|
192
200
|
const table = injectDataTable("<VtBody>");
|
|
201
|
+
const locale = useTableLocale();
|
|
193
202
|
return () => h(DataTableBody, {
|
|
194
203
|
class: "vt-body",
|
|
195
204
|
...props
|
|
@@ -211,7 +220,7 @@ const VtBody = defineComponent({
|
|
|
211
220
|
})),
|
|
212
221
|
$stable: true
|
|
213
222
|
})),
|
|
214
|
-
empty: slots.empty ?? (() => h(VtEmpty, { text: table.loadingMode && table.loadState === "loading" ?
|
|
223
|
+
empty: slots.empty ?? (() => h(VtEmpty, { text: table.loadingMode && table.loadState === "loading" ? locale().messages.loadingRows : table.loadingMode && table.loadState === "error" ? locale().messages.couldNotLoadRows : locale().messages.noMatchingRows }))
|
|
215
224
|
});
|
|
216
225
|
}
|
|
217
226
|
});
|
|
@@ -221,10 +230,11 @@ const VtEmpty = defineComponent({
|
|
|
221
230
|
slots: Object,
|
|
222
231
|
props: { text: {
|
|
223
232
|
type: String,
|
|
224
|
-
default:
|
|
233
|
+
default: void 0
|
|
225
234
|
} },
|
|
226
235
|
setup(props, { slots }) {
|
|
227
|
-
|
|
236
|
+
const locale = useTableLocale();
|
|
237
|
+
return () => h("div", { class: "vt-empty" }, [icon("empty", "vt-empty-icon"), slots.default?.() ?? props.text ?? locale().messages.noMatchingRows]);
|
|
228
238
|
}
|
|
229
239
|
});
|
|
230
240
|
/** A search field with an icon. */
|
|
@@ -250,14 +260,18 @@ const VtPageSize = defineComponent({
|
|
|
250
260
|
},
|
|
251
261
|
label: {
|
|
252
262
|
type: String,
|
|
253
|
-
default:
|
|
263
|
+
default: void 0
|
|
254
264
|
}
|
|
255
265
|
},
|
|
256
266
|
setup(props) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
label
|
|
260
|
-
|
|
267
|
+
const locale = useTableLocale();
|
|
268
|
+
return () => {
|
|
269
|
+
const label = props.label ?? locale().messages.rowsPerPage;
|
|
270
|
+
return h("label", { class: "vt-page-size" }, [h("span", label), h(DataTablePageSize, {
|
|
271
|
+
options: props.options,
|
|
272
|
+
label
|
|
273
|
+
})]);
|
|
274
|
+
};
|
|
261
275
|
}
|
|
262
276
|
});
|
|
263
277
|
/**
|
|
@@ -268,9 +282,10 @@ const VtColumnVisibility = defineComponent({
|
|
|
268
282
|
name: "VtColumnVisibility",
|
|
269
283
|
props: { label: {
|
|
270
284
|
type: String,
|
|
271
|
-
default:
|
|
285
|
+
default: void 0
|
|
272
286
|
} },
|
|
273
287
|
setup(props) {
|
|
288
|
+
const locale = useTableLocale();
|
|
274
289
|
const close = (menu, refocus) => {
|
|
275
290
|
if (!menu.open) return;
|
|
276
291
|
menu.open = false;
|
|
@@ -289,7 +304,7 @@ const VtColumnVisibility = defineComponent({
|
|
|
289
304
|
const next = event.relatedTarget;
|
|
290
305
|
if (next !== null && !menu.contains(next)) close(menu, false);
|
|
291
306
|
}
|
|
292
|
-
}, [h("summary", { class: "vt-button" }, [icon("columns"), props.label]), h(DataTableColumnVisibility, {
|
|
307
|
+
}, [h("summary", { class: "vt-button" }, [icon("columns"), props.label ?? locale().messages.columns]), h(DataTableColumnVisibility, {
|
|
293
308
|
as: "div",
|
|
294
309
|
class: "vt-menu-panel"
|
|
295
310
|
})]);
|
|
@@ -374,6 +389,10 @@ const GridBody = defineComponent({
|
|
|
374
389
|
removable: {
|
|
375
390
|
type: Boolean,
|
|
376
391
|
default: false
|
|
392
|
+
},
|
|
393
|
+
rowAttrs: {
|
|
394
|
+
type: Function,
|
|
395
|
+
default: void 0
|
|
377
396
|
}
|
|
378
397
|
},
|
|
379
398
|
setup(props) {
|
|
@@ -384,6 +403,7 @@ const GridBody = defineComponent({
|
|
|
384
403
|
return h(DataGridBody, {
|
|
385
404
|
class: "vt-body",
|
|
386
405
|
treeCell: false,
|
|
406
|
+
rowAttrs: props.rowAttrs,
|
|
387
407
|
colspan: table.columns.length + (props.rowNumbers || details || props.rowActions ? 1 : 0)
|
|
388
408
|
}, {
|
|
389
409
|
detail: props.detail,
|
|
@@ -446,6 +466,11 @@ const VtGrid = defineComponent({
|
|
|
446
466
|
removable: {
|
|
447
467
|
type: Boolean,
|
|
448
468
|
default: false
|
|
469
|
+
},
|
|
470
|
+
/** A page's own class, style, `data-*` and `aria-*` attributes for each body row. */
|
|
471
|
+
rowAttrs: {
|
|
472
|
+
type: Function,
|
|
473
|
+
default: void 0
|
|
449
474
|
}
|
|
450
475
|
},
|
|
451
476
|
emits: {
|
|
@@ -453,6 +478,7 @@ const VtGrid = defineComponent({
|
|
|
453
478
|
cancel: (_key) => true
|
|
454
479
|
},
|
|
455
480
|
setup(props, { slots, attrs, emit }) {
|
|
481
|
+
const locale = useTableLocale();
|
|
456
482
|
const details = () => !!slots.expanded && !props.table.tree;
|
|
457
483
|
const cellSlots = () => {
|
|
458
484
|
const found = {};
|
|
@@ -471,7 +497,7 @@ const VtGrid = defineComponent({
|
|
|
471
497
|
before: () => props.rowNumbers || details() || props.rowActions ? h("th", {
|
|
472
498
|
class: "vt-row-number",
|
|
473
499
|
"aria-colindex": 1,
|
|
474
|
-
"aria-label": props.rowActions ?
|
|
500
|
+
"aria-label": props.rowActions ? locale().messages.rowActions : details() ? locale().messages.details : locale().messages.rowNumber
|
|
475
501
|
}) : null,
|
|
476
502
|
header: ({ column }) => props.columnLetters ? [h("span", { class: "vt-column-letter" }, columnLabel(props.table.columns.indexOf(column))), column.header] : column.header
|
|
477
503
|
});
|
|
@@ -504,7 +530,8 @@ const VtGrid = defineComponent({
|
|
|
504
530
|
rowActions: props.rowActions,
|
|
505
531
|
removable: props.removable,
|
|
506
532
|
treeColumn: props.treeColumn,
|
|
507
|
-
detail: slots.expanded
|
|
533
|
+
detail: slots.expanded,
|
|
534
|
+
rowAttrs: props.rowAttrs
|
|
508
535
|
})] })])]);
|
|
509
536
|
}
|
|
510
537
|
});
|
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 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.removable,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,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"}
|
|
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 type AnyRowAttrs,\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 {\n injectDataTable,\n useTableLocale,\n type AnyDataTableBinding,\n type DataTableBinding,\n} 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 /**\n * Force a theme; by default the table follows `prefers-color-scheme`. `\"inherit\"` declares no\n * palette, so the host's `--vt-*` tokens apply.\n */\n theme: { type: String as PropType<\"light\" | \"dark\" | \"inherit\" | 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\" | \"inherit\" | 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 /**\n * The content of every header cell, inside the sort button of a sortable column, so a custom\n * header keeps click-to-sort and its indicator.\n */\n header?: (props: {\n column: TableColumn<unknown>;\n sort: SortInfo | undefined;\n toggleSort: (multi?: boolean) => void;\n }) => VNodeChild;\n }\n >,\n setup(_props, { slots }) {\n const table = injectDataTable(\"<VtHeader>\");\n const content = (column: TableColumn<unknown>, sort: SortInfo | undefined): VNodeChild =>\n slots.header?.({\n column,\n sort,\n toggleSort: (multi = false) => table.toggleSort(column.id, { multi }),\n }) ?? column.header;\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: ({ sort }: { sort: SortInfo | undefined }) => [\n content(column, sort),\n ],\n indicator: ({ sort }: { sort: SortInfo | undefined }) => [\n h(VtSortIndicator, { sort }),\n ],\n },\n )\n : [content(column, undefined)]),\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 const locale = useTableLocale();\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 ? locale().messages.loadingRows\n : table.loadingMode && table.loadState === \"error\"\n ? locale().messages.couldNotLoadRows\n : locale().messages.noMatchingRows,\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 as PropType<string | undefined>, default: undefined } },\n setup(props, { slots }) {\n const locale = useTableLocale();\n return () =>\n h(\"div\", { class: \"vt-empty\" }, [\n icon(\"empty\", \"vt-empty-icon\"),\n slots.default?.() ?? props.text ?? locale().messages.noMatchingRows,\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 as PropType<string | undefined>, default: undefined },\n },\n setup(props) {\n const locale = useTableLocale();\n return () => {\n const label = props.label ?? locale().messages.rowsPerPage;\n return h(\"label\", { class: \"vt-page-size\" }, [\n h(\"span\", label),\n h(DataTablePageSize, { options: props.options, label }),\n ]);\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 as PropType<string | undefined>, default: undefined } },\n setup(props) {\n const locale = useTableLocale();\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\" }, [\n icon(\"columns\"),\n props.label ?? locale().messages.columns,\n ]),\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 rowAttrs: { type: Function as PropType<AnyRowAttrs | undefined>, default: undefined },\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 rowAttrs: props.rowAttrs,\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 /** A page's own class, style, `data-*` and `aria-*` attributes for each body row. */\n rowAttrs: { type: Function as PropType<AnyRowAttrs | undefined>, default: undefined },\n },\n emits: { save: (_result: unknown) => true, cancel: (_key: unknown) => true },\n setup(props, { slots, attrs, emit }) {\n const locale = useTableLocale();\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 ? locale().messages.rowActions\n : details()\n ? locale().messages.details\n : locale().messages.rowNumber,\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.removable,\n treeColumn: props.treeColumn,\n detail: slots.expanded,\n rowAttrs: props.rowAttrs,\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,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;;;;;;;;AC5BA,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;;;;;AC0CA,MAAM,eAAe;CACnB,GAAG;CACH,GAAG;CACH,SAAS;EAAE,MAAM;EAA6B,SAAS;CAAc;CACrE,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,UAAU;EAAE,MAAM;EAAS,SAAS;CAAM;CAC1C,OAAO;EAAE,MAAM;EAAS,SAAS;CAAK;CACtC,cAAc;EAAE,MAAM;EAAS,SAAS;CAAM;CAC9C,SA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Q,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;GACd,UAAU,MAAM;EAClB,CAAC,CACH,EACJ,CACF,CACF,CAAC,CACH,CACF;CACJ;AACF,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* vueye-table styled theme.
|
|
3
3
|
*
|
|
4
|
-
* Every color, size, and radius is a custom property
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Every color, size, and radius is a custom property. The defaults below are declared once, on the
|
|
5
|
+
* outermost themed element (a table surface, a grid, or a standalone .vt-theme control), and at
|
|
6
|
+
* zero specificity: toolbars, menus and footers inside a table inherit the table's tokens, and any
|
|
7
|
+
* host rule that sets a token wins over the default without a specificity fight.
|
|
8
|
+
*
|
|
9
|
+
* Dark colors apply under prefers-color-scheme unless a surface is forced light, and always under
|
|
10
|
+
* data-vt-theme="dark". data-vt-theme="inherit" declares no colors at all: the host sets them on
|
|
11
|
+
* an ancestor, in its own light and dark themes. Sizes keep their defaults unless the host sets
|
|
12
|
+
* them too.
|
|
8
13
|
*/
|
|
9
14
|
|
|
10
|
-
.vt-surface,
|
|
11
|
-
.vt-theme {
|
|
15
|
+
:where(.vt-surface, .vt-theme):where(:not(:is(.vt-surface, .vt-theme) *)) {
|
|
12
16
|
--vt-font: inherit;
|
|
13
17
|
--vt-font-size: 0.875rem;
|
|
18
|
+
--vt-radius: 8px;
|
|
19
|
+
--vt-control-radius: 6px;
|
|
20
|
+
--vt-cell-x: 0.75rem;
|
|
21
|
+
--vt-cell-y: 0.625rem;
|
|
22
|
+
--vt-tree-indent: 1.25rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where(.vt-surface, .vt-theme):where(:not(:is(.vt-surface, .vt-theme) *)):where(
|
|
26
|
+
:not([data-vt-theme="inherit"])
|
|
27
|
+
) {
|
|
14
28
|
--vt-bg: #ffffff;
|
|
15
29
|
--vt-fg: #1f2328;
|
|
16
30
|
--vt-muted: #656d76;
|
|
@@ -24,13 +38,11 @@
|
|
|
24
38
|
--vt-range: rgb(59 91 219 / 0.1);
|
|
25
39
|
--vt-focus: #3b5bdb;
|
|
26
40
|
--vt-danger: #cf222e;
|
|
27
|
-
--vt-radius: 8px;
|
|
28
|
-
--vt-control-radius: 6px;
|
|
29
|
-
--vt-cell-x: 0.75rem;
|
|
30
|
-
--vt-cell-y: 0.625rem;
|
|
31
41
|
--vt-shadow: 0 8px 24px rgb(31 35 40 / 0.12);
|
|
32
|
-
|
|
42
|
+
}
|
|
33
43
|
|
|
44
|
+
.vt-surface,
|
|
45
|
+
.vt-theme {
|
|
34
46
|
font-family: var(--vt-font);
|
|
35
47
|
font-size: var(--vt-font-size);
|
|
36
48
|
color: var(--vt-fg);
|
|
@@ -59,18 +71,20 @@
|
|
|
59
71
|
border-end-end-radius: calc(var(--vt-radius) - 1px);
|
|
60
72
|
}
|
|
61
73
|
|
|
62
|
-
:
|
|
74
|
+
:where(.vt-surface, .vt-theme):where([data-density="compact"]) {
|
|
63
75
|
--vt-cell-x: 0.5rem;
|
|
64
76
|
--vt-cell-y: 0.3rem;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
|
-
:
|
|
79
|
+
:where(.vt-surface, .vt-theme):where([data-density="spacious"]) {
|
|
68
80
|
--vt-cell-x: 1rem;
|
|
69
81
|
--vt-cell-y: 0.9rem;
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
@media (prefers-color-scheme: dark) {
|
|
73
|
-
:
|
|
85
|
+
:where(.vt-surface, .vt-theme):where(:not(:is(.vt-surface, .vt-theme) *)):where(
|
|
86
|
+
:not([data-vt-theme="light"], [data-vt-theme="inherit"])
|
|
87
|
+
) {
|
|
74
88
|
--vt-bg: #0d1117;
|
|
75
89
|
--vt-fg: #e6edf3;
|
|
76
90
|
--vt-muted: #8d96a0;
|
|
@@ -88,7 +102,7 @@
|
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
|
|
91
|
-
:
|
|
105
|
+
:where(.vt-surface, .vt-theme):where([data-vt-theme="dark"]) {
|
|
92
106
|
--vt-bg: #0d1117;
|
|
93
107
|
--vt-fg: #e6edf3;
|
|
94
108
|
--vt-muted: #8d96a0;
|
|
@@ -105,6 +119,11 @@
|
|
|
105
119
|
--vt-shadow: 0 8px 24px rgb(0 0 0 / 0.5);
|
|
106
120
|
}
|
|
107
121
|
|
|
122
|
+
/* Right to left, a collapsed row's chevron points into the row, at the reader's next column. */
|
|
123
|
+
:where([dir="rtl"]) .vt-expand-toggle[aria-expanded="false"] .vt-icon {
|
|
124
|
+
transform: scaleX(-1);
|
|
125
|
+
}
|
|
126
|
+
|
|
108
127
|
.vt-scroll {
|
|
109
128
|
overflow: auto;
|
|
110
129
|
max-height: var(--vt-max-height, none);
|
|
@@ -279,6 +298,13 @@
|
|
|
279
298
|
animation: vt-progress 1.1s ease-in-out infinite;
|
|
280
299
|
}
|
|
281
300
|
|
|
301
|
+
/* Right to left, the bar starts at the right edge and runs toward the left. */
|
|
302
|
+
:where([dir="rtl"]) .vt-surface[data-loading] .vt-progress::after {
|
|
303
|
+
inset-inline-start: 0;
|
|
304
|
+
inset-inline-end: auto;
|
|
305
|
+
--vt-progress-sign: -1;
|
|
306
|
+
}
|
|
307
|
+
|
|
282
308
|
.vt-surface[data-loading] .vt-body {
|
|
283
309
|
opacity: 0.55;
|
|
284
310
|
transition: opacity 0.15s;
|
|
@@ -286,10 +312,10 @@
|
|
|
286
312
|
|
|
287
313
|
@keyframes vt-progress {
|
|
288
314
|
from {
|
|
289
|
-
transform: translateX(-100%);
|
|
315
|
+
transform: translateX(calc(-100% * var(--vt-progress-sign, 1)));
|
|
290
316
|
}
|
|
291
317
|
to {
|
|
292
|
-
transform: translateX(250%);
|
|
318
|
+
transform: translateX(calc(250% * var(--vt-progress-sign, 1)));
|
|
293
319
|
}
|
|
294
320
|
}
|
|
295
321
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueye-table/styled",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.3",
|
|
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-beta.
|
|
45
|
-
"@vueye-table/headless": "3.0.0-beta.
|
|
46
|
-
"@vueye-table/vue": "3.0.0-beta.
|
|
44
|
+
"@vueye-table/core": "3.0.0-beta.3",
|
|
45
|
+
"@vueye-table/headless": "3.0.0-beta.3",
|
|
46
|
+
"@vueye-table/vue": "3.0.0-beta.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"vue": "3.5.43",
|