vueye-table 3.0.0-alpha.7 → 3.0.0-alpha.8
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 +113 -44
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -24
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CellChange, RowKey, TableIssue, TableRow, TableState } from "@vueye-table/core";
|
|
2
|
-
import { GridCellSlotProps } from "@vueye-table/headless";
|
|
2
|
+
import { GridCellSlotProps, TableStatusSlotProps } from "@vueye-table/headless";
|
|
3
3
|
import { Plugin, PropType, SlotsType, VNode } from "vue";
|
|
4
4
|
export * from "@vueye-table/core";
|
|
5
5
|
export * from "@vueye-table/headless";
|
|
@@ -52,6 +52,26 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
52
52
|
type: BooleanConstructor;
|
|
53
53
|
default: boolean;
|
|
54
54
|
};
|
|
55
|
+
source: {
|
|
56
|
+
readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
|
|
57
|
+
readonly default: undefined;
|
|
58
|
+
};
|
|
59
|
+
loadMore: {
|
|
60
|
+
readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
|
|
61
|
+
readonly default: undefined;
|
|
62
|
+
};
|
|
63
|
+
endThreshold: {
|
|
64
|
+
readonly type: NumberConstructor;
|
|
65
|
+
readonly default: 5;
|
|
66
|
+
};
|
|
67
|
+
manual: {
|
|
68
|
+
readonly type: PropType<boolean | undefined>;
|
|
69
|
+
readonly default: undefined;
|
|
70
|
+
};
|
|
71
|
+
rowCount: {
|
|
72
|
+
readonly type: PropType<number | undefined>;
|
|
73
|
+
readonly default: undefined;
|
|
74
|
+
};
|
|
55
75
|
paginate: {
|
|
56
76
|
readonly type: PropType<boolean | undefined>;
|
|
57
77
|
readonly default: undefined;
|
|
@@ -162,7 +182,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
162
182
|
};
|
|
163
183
|
data: {
|
|
164
184
|
type: PropType<readonly unknown[]>;
|
|
165
|
-
|
|
185
|
+
default: () => never[];
|
|
166
186
|
};
|
|
167
187
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
168
188
|
[key: string]: any;
|
|
@@ -216,6 +236,26 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
216
236
|
type: BooleanConstructor;
|
|
217
237
|
default: boolean;
|
|
218
238
|
};
|
|
239
|
+
source: {
|
|
240
|
+
readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
|
|
241
|
+
readonly default: undefined;
|
|
242
|
+
};
|
|
243
|
+
loadMore: {
|
|
244
|
+
readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
|
|
245
|
+
readonly default: undefined;
|
|
246
|
+
};
|
|
247
|
+
endThreshold: {
|
|
248
|
+
readonly type: NumberConstructor;
|
|
249
|
+
readonly default: 5;
|
|
250
|
+
};
|
|
251
|
+
manual: {
|
|
252
|
+
readonly type: PropType<boolean | undefined>;
|
|
253
|
+
readonly default: undefined;
|
|
254
|
+
};
|
|
255
|
+
rowCount: {
|
|
256
|
+
readonly type: PropType<number | undefined>;
|
|
257
|
+
readonly default: undefined;
|
|
258
|
+
};
|
|
219
259
|
paginate: {
|
|
220
260
|
readonly type: PropType<boolean | undefined>;
|
|
221
261
|
readonly default: undefined;
|
|
@@ -326,7 +366,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
326
366
|
};
|
|
327
367
|
data: {
|
|
328
368
|
type: PropType<readonly unknown[]>;
|
|
329
|
-
|
|
369
|
+
default: () => never[];
|
|
330
370
|
};
|
|
331
371
|
}>> & Readonly<{
|
|
332
372
|
"onUpdate:page"?: (...args: any[]) => any;
|
|
@@ -337,12 +377,26 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
337
377
|
"onUpdate:hiddenColumns"?: (...args: any[]) => any;
|
|
338
378
|
"onUpdate:selected"?: (...args: any[]) => any;
|
|
339
379
|
"onState-change"?: (state: TableState) => any;
|
|
340
|
-
onEdit?: (changes: readonly CellChange<unknown>[]) => any;
|
|
341
380
|
"onUpdate:data"?: (data: readonly unknown[]) => any;
|
|
381
|
+
onEdit?: (changes: readonly CellChange<unknown>[]) => any;
|
|
342
382
|
"onEdit-error"?: (issues: readonly TableIssue[]) => any;
|
|
343
383
|
onExport?: (csv: string) => any;
|
|
344
384
|
}>, {
|
|
345
385
|
page: number;
|
|
386
|
+
data: readonly unknown[];
|
|
387
|
+
searchable: boolean;
|
|
388
|
+
columnToggle: boolean;
|
|
389
|
+
pagination: boolean;
|
|
390
|
+
editable: boolean;
|
|
391
|
+
rowNumbers: boolean;
|
|
392
|
+
columnLetters: boolean;
|
|
393
|
+
label: string;
|
|
394
|
+
toolbar: boolean;
|
|
395
|
+
source: import("@vueye-table/vue").TableSource<unknown> | undefined;
|
|
396
|
+
loadMore: import("@vueye-table/vue").LoadMore<unknown> | undefined;
|
|
397
|
+
endThreshold: number;
|
|
398
|
+
manual: boolean | undefined;
|
|
399
|
+
rowCount: number | undefined;
|
|
346
400
|
paginate: boolean | undefined;
|
|
347
401
|
columns: readonly import("@vueye-table/core").AnyColumnDef[];
|
|
348
402
|
rowKey: string | ((row: any, index: number) => import("@vueye-table/core").RowKey);
|
|
@@ -355,10 +409,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
355
409
|
stickyHeader: boolean;
|
|
356
410
|
theme: "light" | "dark";
|
|
357
411
|
maxHeight: string;
|
|
358
|
-
searchable: boolean;
|
|
359
412
|
searchPlaceholder: string;
|
|
360
|
-
columnToggle: boolean;
|
|
361
|
-
pagination: boolean;
|
|
362
413
|
pageSizeOptions: readonly number[];
|
|
363
414
|
pageSize: number;
|
|
364
415
|
sorting: readonly import("@vueye-table/core").SortRule[];
|
|
@@ -372,17 +423,13 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
372
423
|
overscan: number;
|
|
373
424
|
virtualColumns: boolean;
|
|
374
425
|
columnWidth: number;
|
|
375
|
-
label: string;
|
|
376
|
-
toolbar: boolean;
|
|
377
|
-
editable: boolean;
|
|
378
|
-
rowNumbers: boolean;
|
|
379
|
-
columnLetters: boolean;
|
|
380
426
|
}, SlotsType<{
|
|
381
427
|
[key: `cell.${string}`]: GridCellSlotProps & {
|
|
382
428
|
readonly item: unknown;
|
|
383
429
|
};
|
|
384
430
|
} & {
|
|
385
431
|
default?: (props: Record<string, unknown>) => VNode[];
|
|
432
|
+
status?: (props: TableStatusSlotProps) => VNode[];
|
|
386
433
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
387
434
|
//#endregion
|
|
388
435
|
//#region src/vueye-table.d.ts
|
|
@@ -398,13 +445,7 @@ interface CellSlotProps {
|
|
|
398
445
|
};
|
|
399
446
|
}
|
|
400
447
|
/** Slot props of `status`, the "1–10 of 57 rows" line. */
|
|
401
|
-
|
|
402
|
-
readonly start: number;
|
|
403
|
-
readonly end: number;
|
|
404
|
-
readonly rowCount: number;
|
|
405
|
-
readonly totalRowCount: number;
|
|
406
|
-
readonly selectedCount: number;
|
|
407
|
-
}
|
|
448
|
+
type StatusSlotProps = TableStatusSlotProps;
|
|
408
449
|
/**
|
|
409
450
|
* A complete data table: search, column visibility, sorting, selection, pagination, a live
|
|
410
451
|
* status line, loading and empty states, and theming. Every piece of state is available as a
|
|
@@ -421,19 +462,31 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
421
462
|
default: undefined;
|
|
422
463
|
};
|
|
423
464
|
/** The data is one page from a server; `rowCount` is the total. */
|
|
424
|
-
manual: {
|
|
425
|
-
type: BooleanConstructor;
|
|
426
|
-
default: boolean;
|
|
427
|
-
};
|
|
428
|
-
rowCount: {
|
|
429
|
-
type: PropType<number | undefined>;
|
|
430
|
-
default: undefined;
|
|
431
|
-
};
|
|
432
465
|
/** Shown instead of the empty state while `loading` and there are no rows yet. */
|
|
433
466
|
loadingText: {
|
|
434
467
|
type: StringConstructor;
|
|
435
468
|
default: string;
|
|
436
469
|
};
|
|
470
|
+
source: {
|
|
471
|
+
readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
|
|
472
|
+
readonly default: undefined;
|
|
473
|
+
};
|
|
474
|
+
loadMore: {
|
|
475
|
+
readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
|
|
476
|
+
readonly default: undefined;
|
|
477
|
+
};
|
|
478
|
+
endThreshold: {
|
|
479
|
+
readonly type: NumberConstructor;
|
|
480
|
+
readonly default: 5;
|
|
481
|
+
};
|
|
482
|
+
manual: {
|
|
483
|
+
readonly type: PropType<boolean | undefined>;
|
|
484
|
+
readonly default: undefined;
|
|
485
|
+
};
|
|
486
|
+
rowCount: {
|
|
487
|
+
readonly type: PropType<number | undefined>;
|
|
488
|
+
readonly default: undefined;
|
|
489
|
+
};
|
|
437
490
|
paginate: {
|
|
438
491
|
readonly type: PropType<boolean | undefined>;
|
|
439
492
|
readonly default: undefined;
|
|
@@ -556,7 +609,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
556
609
|
};
|
|
557
610
|
data: {
|
|
558
611
|
type: PropType<readonly unknown[]>;
|
|
559
|
-
|
|
612
|
+
default: () => never[];
|
|
560
613
|
};
|
|
561
614
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
562
615
|
[key: string]: any;
|
|
@@ -582,19 +635,31 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
582
635
|
default: undefined;
|
|
583
636
|
};
|
|
584
637
|
/** The data is one page from a server; `rowCount` is the total. */
|
|
585
|
-
manual: {
|
|
586
|
-
type: BooleanConstructor;
|
|
587
|
-
default: boolean;
|
|
588
|
-
};
|
|
589
|
-
rowCount: {
|
|
590
|
-
type: PropType<number | undefined>;
|
|
591
|
-
default: undefined;
|
|
592
|
-
};
|
|
593
638
|
/** Shown instead of the empty state while `loading` and there are no rows yet. */
|
|
594
639
|
loadingText: {
|
|
595
640
|
type: StringConstructor;
|
|
596
641
|
default: string;
|
|
597
642
|
};
|
|
643
|
+
source: {
|
|
644
|
+
readonly type: PropType<import("@vueye-table/vue").TableSource<unknown> | undefined>;
|
|
645
|
+
readonly default: undefined;
|
|
646
|
+
};
|
|
647
|
+
loadMore: {
|
|
648
|
+
readonly type: PropType<import("@vueye-table/vue").LoadMore<unknown> | undefined>;
|
|
649
|
+
readonly default: undefined;
|
|
650
|
+
};
|
|
651
|
+
endThreshold: {
|
|
652
|
+
readonly type: NumberConstructor;
|
|
653
|
+
readonly default: 5;
|
|
654
|
+
};
|
|
655
|
+
manual: {
|
|
656
|
+
readonly type: PropType<boolean | undefined>;
|
|
657
|
+
readonly default: undefined;
|
|
658
|
+
};
|
|
659
|
+
rowCount: {
|
|
660
|
+
readonly type: PropType<number | undefined>;
|
|
661
|
+
readonly default: undefined;
|
|
662
|
+
};
|
|
598
663
|
paginate: {
|
|
599
664
|
readonly type: PropType<boolean | undefined>;
|
|
600
665
|
readonly default: undefined;
|
|
@@ -717,7 +782,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
717
782
|
};
|
|
718
783
|
data: {
|
|
719
784
|
type: PropType<readonly unknown[]>;
|
|
720
|
-
|
|
785
|
+
default: () => never[];
|
|
721
786
|
};
|
|
722
787
|
}>> & Readonly<{
|
|
723
788
|
"onUpdate:page"?: (...args: any[]) => any;
|
|
@@ -731,11 +796,15 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
731
796
|
"onRow-click"?: (item: unknown, row: TableRow<unknown>) => any;
|
|
732
797
|
}>, {
|
|
733
798
|
page: number;
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
799
|
+
data: readonly unknown[];
|
|
800
|
+
searchable: boolean;
|
|
801
|
+
columnToggle: boolean;
|
|
802
|
+
pagination: boolean;
|
|
803
|
+
source: import("@vueye-table/vue").TableSource<unknown> | undefined;
|
|
804
|
+
loadMore: import("@vueye-table/vue").LoadMore<unknown> | undefined;
|
|
805
|
+
endThreshold: number;
|
|
806
|
+
manual: boolean | undefined;
|
|
737
807
|
rowCount: number | undefined;
|
|
738
|
-
loadingText: string;
|
|
739
808
|
paginate: boolean | undefined;
|
|
740
809
|
columns: readonly import("@vueye-table/core").AnyColumnDef[];
|
|
741
810
|
rowKey: string | ((row: any, index: number) => RowKey);
|
|
@@ -748,10 +817,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
748
817
|
stickyHeader: boolean;
|
|
749
818
|
theme: "light" | "dark";
|
|
750
819
|
maxHeight: string;
|
|
751
|
-
searchable: boolean;
|
|
752
820
|
searchPlaceholder: string;
|
|
753
|
-
columnToggle: boolean;
|
|
754
|
-
pagination: boolean;
|
|
755
821
|
pageSizeOptions: readonly number[];
|
|
756
822
|
pageSize: number;
|
|
757
823
|
sorting: readonly import("@vueye-table/core").SortRule[];
|
|
@@ -765,6 +831,9 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
765
831
|
overscan: number;
|
|
766
832
|
virtualColumns: boolean;
|
|
767
833
|
columnWidth: number;
|
|
834
|
+
selected: readonly RowKey[];
|
|
835
|
+
selectable: boolean | "single" | "multiple";
|
|
836
|
+
loadingText: string;
|
|
768
837
|
}, SlotsType<{
|
|
769
838
|
[key: `cell.${string}`]: CellSlotProps;
|
|
770
839
|
[key: `header.${string}`]: {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/index.ts"],"mappings":";;;;;;;;;cA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AAK;;;;IAhBL,MAAA;;;;IAGF,MAAA,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAPtB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyBgB;MAAE;MAAY;;;;EAE1C;IAAE;;EACJ,OAAA;EACE,SAAA;EACD;IAAE;;EACF,QAAA;kCAuNZ;;;;YChSiB;IACf,mBAAmB;IACnB,kBAAkB"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inferColumns } from "@vueye-table/core";
|
|
2
2
|
import { DataTableBody, DataTableCaption, DataTableCell, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, virtualProps } from "@vueye-table/headless";
|
|
3
|
-
import { VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtPageSize, VtPagination, VtSearch, VtStatus, VtToolbar } from "@vueye-table/styled";
|
|
3
|
+
import { VtColumnVisibility, VtEmpty, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtSearch, VtStatus, VtToolbar } from "@vueye-table/styled";
|
|
4
4
|
import { provideDataTable, useDataTable } from "@vueye-table/vue";
|
|
5
5
|
import { computed, defineComponent, h } from "vue";
|
|
6
6
|
|
|
@@ -16,6 +16,26 @@ export * from "@vueye-table/vue"
|
|
|
16
16
|
/** Props both full components share. */
|
|
17
17
|
const commonProps = {
|
|
18
18
|
...virtualProps,
|
|
19
|
+
source: {
|
|
20
|
+
type: [Object, Function],
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
loadMore: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
endThreshold: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 5
|
|
30
|
+
},
|
|
31
|
+
manual: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
rowCount: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
19
39
|
/** Override the virtual default of no pagination; permits virtualizing a large page. */
|
|
20
40
|
paginate: {
|
|
21
41
|
type: Boolean,
|
|
@@ -190,7 +210,7 @@ const VueyeGrid = defineComponent({
|
|
|
190
210
|
props: {
|
|
191
211
|
data: {
|
|
192
212
|
type: Array,
|
|
193
|
-
|
|
213
|
+
default: () => []
|
|
194
214
|
},
|
|
195
215
|
...commonProps,
|
|
196
216
|
searchable: {
|
|
@@ -251,9 +271,14 @@ const VueyeGrid = defineComponent({
|
|
|
251
271
|
let binding;
|
|
252
272
|
const table = useDataTable({
|
|
253
273
|
data: () => props.data,
|
|
274
|
+
source: computed(() => props.source),
|
|
275
|
+
loadMore: computed(() => props.loadMore),
|
|
276
|
+
endThreshold: props.endThreshold,
|
|
277
|
+
manual: props.manual,
|
|
278
|
+
rowCount: () => props.rowCount,
|
|
254
279
|
columns,
|
|
255
280
|
rowKey: props.rowKey,
|
|
256
|
-
paginate: props.paginate ?? (props.virtual ? props.pagination : true),
|
|
281
|
+
paginate: props.paginate ?? (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),
|
|
257
282
|
selectionMode: "none",
|
|
258
283
|
initialState: { pagination: initialPagination },
|
|
259
284
|
state: () => {
|
|
@@ -285,10 +310,13 @@ const VueyeGrid = defineComponent({
|
|
|
285
310
|
const gridSlots = () => {
|
|
286
311
|
const forwarded = {};
|
|
287
312
|
for (const [name, slot] of Object.entries(slots)) if (name === "default" && slot) forwarded[name] = slot;
|
|
288
|
-
else if (name.startsWith("cell.")
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
313
|
+
else if (name.startsWith("cell.")) {
|
|
314
|
+
const cellSlot = slots[name];
|
|
315
|
+
forwarded[name] = (cellProps) => cellSlot?.({
|
|
316
|
+
...cellProps,
|
|
317
|
+
item: cellProps.row.original
|
|
318
|
+
});
|
|
319
|
+
}
|
|
292
320
|
return forwarded;
|
|
293
321
|
};
|
|
294
322
|
const button = (label, disabled, onClick) => h("button", {
|
|
@@ -321,7 +349,7 @@ const VueyeGrid = defineComponent({
|
|
|
321
349
|
bordered: props.bordered,
|
|
322
350
|
hover: false,
|
|
323
351
|
stickyHeader: props.stickyHeader,
|
|
324
|
-
loading: props.loading,
|
|
352
|
+
loading: props.loading || table.loadState === "loading" || table.loadState === "streaming",
|
|
325
353
|
theme: props.theme,
|
|
326
354
|
virtual: props.virtual,
|
|
327
355
|
virtualColumns: props.virtualColumns,
|
|
@@ -331,7 +359,11 @@ const VueyeGrid = defineComponent({
|
|
|
331
359
|
columnWidth: props.columnWidth,
|
|
332
360
|
...props.maxHeight ? { style: { "--vt-max-height": props.maxHeight } } : {}
|
|
333
361
|
}, gridSlots()),
|
|
334
|
-
props.pagination ? h(VtToolbar, { class: "vt-footer" }, () => [
|
|
362
|
+
props.pagination || table.loadingMode || slots.status ? h(VtToolbar, { class: "vt-footer" }, () => [
|
|
363
|
+
h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : void 0),
|
|
364
|
+
...table.loadingMode ? [h(VtLoadMore)] : [],
|
|
365
|
+
props.pagination && table.paginate ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
|
|
366
|
+
]) : null
|
|
335
367
|
]);
|
|
336
368
|
}
|
|
337
369
|
});
|
|
@@ -348,7 +380,7 @@ const VueyeTable = defineComponent({
|
|
|
348
380
|
props: {
|
|
349
381
|
data: {
|
|
350
382
|
type: Array,
|
|
351
|
-
|
|
383
|
+
default: () => []
|
|
352
384
|
},
|
|
353
385
|
...commonProps,
|
|
354
386
|
/** `true` or `"multiple"` for checkboxes, `"single"` for one row at a time. */
|
|
@@ -361,14 +393,6 @@ const VueyeTable = defineComponent({
|
|
|
361
393
|
default: void 0
|
|
362
394
|
},
|
|
363
395
|
/** The data is one page from a server; `rowCount` is the total. */
|
|
364
|
-
manual: {
|
|
365
|
-
type: Boolean,
|
|
366
|
-
default: false
|
|
367
|
-
},
|
|
368
|
-
rowCount: {
|
|
369
|
-
type: Number,
|
|
370
|
-
default: void 0
|
|
371
|
-
},
|
|
372
396
|
/** Shown instead of the empty state while `loading` and there are no rows yet. */
|
|
373
397
|
loadingText: {
|
|
374
398
|
type: String,
|
|
@@ -391,10 +415,13 @@ const VueyeTable = defineComponent({
|
|
|
391
415
|
let binding;
|
|
392
416
|
const table = useDataTable({
|
|
393
417
|
data: () => props.data,
|
|
418
|
+
source: computed(() => props.source),
|
|
419
|
+
loadMore: computed(() => props.loadMore),
|
|
420
|
+
endThreshold: props.endThreshold,
|
|
394
421
|
columns: () => resolveColumns(props.columns, props.data),
|
|
395
422
|
rowKey: props.rowKey,
|
|
396
423
|
manual: props.manual,
|
|
397
|
-
paginate: props.paginate ?? !props.virtual,
|
|
424
|
+
paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),
|
|
398
425
|
rowCount: () => props.rowCount,
|
|
399
426
|
selectionMode: selectionMode.value,
|
|
400
427
|
selectScope: props.selectScope,
|
|
@@ -408,6 +435,7 @@ const VueyeTable = defineComponent({
|
|
|
408
435
|
binding = table;
|
|
409
436
|
provideDataTable(table);
|
|
410
437
|
expose({ table });
|
|
438
|
+
const busy = () => props.loading || table.loadState === "loading" || table.loadState === "streaming";
|
|
411
439
|
const selectable = () => selectionMode.value !== "none";
|
|
412
440
|
const cell = (row, column) => {
|
|
413
441
|
const slot = slots[`cell.${column.id}`];
|
|
@@ -426,7 +454,7 @@ const VueyeTable = defineComponent({
|
|
|
426
454
|
const body = (rows = table.rows) => {
|
|
427
455
|
const width = table.columns.length + (selectable() ? 1 : 0);
|
|
428
456
|
if (table.rows.length === 0) {
|
|
429
|
-
const content =
|
|
457
|
+
const content = busy() ? slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }) : slots.empty?.({}) ?? h(VtEmpty, { text: table.loadingMode && table.loadState === "error" ? "Could not load rows." : "No matching rows" });
|
|
430
458
|
return h("tr", { "data-empty": "" }, [h("td", { colspan: Math.max(1, width) }, content)]);
|
|
431
459
|
}
|
|
432
460
|
return rows.map((row) => h(DataTableRow, {
|
|
@@ -474,7 +502,8 @@ const VueyeTable = defineComponent({
|
|
|
474
502
|
}, children) }) : h("div", { class: "vt-scroll" }, [h("table", {
|
|
475
503
|
class: "vt-table",
|
|
476
504
|
"aria-rowcount": table.rowCount + 1,
|
|
477
|
-
"aria-colcount": table.columns.length
|
|
505
|
+
"aria-colcount": table.columns.length,
|
|
506
|
+
"aria-busy": busy() ? "true" : void 0
|
|
478
507
|
}, children())]);
|
|
479
508
|
};
|
|
480
509
|
return () => h("div", {
|
|
@@ -485,7 +514,7 @@ const VueyeTable = defineComponent({
|
|
|
485
514
|
"data-hover": props.hover ? "" : void 0,
|
|
486
515
|
"data-sticky-header": props.stickyHeader || props.virtual ? "" : void 0,
|
|
487
516
|
"data-virtual": props.virtual ? "" : void 0,
|
|
488
|
-
"data-loading":
|
|
517
|
+
"data-loading": busy() ? "" : void 0,
|
|
489
518
|
"data-vt-theme": props.theme,
|
|
490
519
|
"aria-busy": props.loading ? "true" : void 0,
|
|
491
520
|
style: props.maxHeight ? { "--vt-max-height": props.maxHeight } : void 0
|
|
@@ -501,10 +530,11 @@ const VueyeTable = defineComponent({
|
|
|
501
530
|
role: "presentation"
|
|
502
531
|
}),
|
|
503
532
|
tableContent(),
|
|
504
|
-
props.pagination && (!props.virtual || table.paginate) || slots.footer ? h(VtToolbar, { class: "vt-footer" }, () => [
|
|
533
|
+
props.pagination && (!props.virtual || table.paginate) || slots.footer || slots.status || table.loadingMode ? h(VtToolbar, { class: "vt-footer" }, () => [
|
|
505
534
|
h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : props.loading && table.rows.length === 0 ? { default: () => props.loadingText } : void 0),
|
|
535
|
+
...table.loadingMode ? [h(VtLoadMore)] : [],
|
|
506
536
|
slots.footer?.({ table }),
|
|
507
|
-
props.pagination && (!props.virtual || table.paginate) ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
|
|
537
|
+
props.pagination && table.paginate && (!props.virtual || table.paginate) ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
|
|
508
538
|
]) : null
|
|
509
539
|
])]);
|
|
510
540
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/shared.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/plugin.ts"],"sourcesContent":["import {\n inferColumns,\n type AnyColumnDef,\n type PaginationState,\n type RowKey,\n type SelectScope,\n type SortRule,\n type TableState,\n type TableStatePatch,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { PropType } from \"vue\";\n\n/** Props both full components share. */\nexport const commonProps = {\n ...virtualProps,\n /** Override the virtual default of no pagination; permits virtualizing a large page. */\n paginate: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Column definitions. Without them, columns are inferred from the data. */\n columns: { type: Array as PropType<readonly AnyColumnDef[]>, default: undefined },\n /** A path into each row, or a function, giving its key. Defaults to `id`, then position. */\n rowKey: {\n type: [String, Function] as PropType<string | ((row: any, index: number) => RowKey)>,\n default: undefined,\n },\n caption: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n density: { type: String as PropType<Density>, default: \"comfortable\" },\n striped: { type: Boolean, default: false },\n bordered: { type: Boolean, default: false },\n hover: { type: Boolean, default: true },\n stickyHeader: { type: Boolean, default: false },\n theme: { type: String as PropType<\"light\" | \"dark\">, default: undefined },\n /** A CSS height that makes the body scroll, such as `\"24rem\"`. */\n maxHeight: { type: String, default: undefined },\n\n searchable: { type: Boolean, default: true },\n searchPlaceholder: { type: String, default: \"Search…\" },\n columnToggle: { type: Boolean, default: true },\n pagination: { type: Boolean, default: true },\n pageSizeOptions: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n\n page: { type: Number, default: undefined },\n pageSize: { type: Number, default: undefined },\n sorting: { type: Array as PropType<readonly SortRule[]>, default: undefined },\n search: { type: String, default: undefined },\n filters: { type: Object as PropType<Readonly<Record<string, unknown>>>, default: undefined },\n hiddenColumns: { type: Array as PropType<readonly string[]>, default: undefined },\n selectScope: { type: String as PropType<SelectScope>, default: \"all\" },\n} as const;\n\nexport const stateEmits = [\n \"update:page\",\n \"update:pageSize\",\n \"update:sorting\",\n \"update:search\",\n \"update:filters\",\n \"update:hiddenColumns\",\n \"update:selected\",\n] as const;\n\ninterface ControlledProps {\n readonly page: number | undefined;\n readonly pageSize: number | undefined;\n readonly sorting: readonly SortRule[] | undefined;\n readonly search: string | undefined;\n readonly filters: Readonly<Record<string, unknown>> | undefined;\n readonly hiddenColumns: readonly string[] | undefined;\n readonly selected?: readonly RowKey[] | undefined;\n}\n\n/** The state a parent controls through `v-model`, as a table state patch. */\nexport function controlledState(props: ControlledProps, current: PaginationState): TableStatePatch {\n return {\n sorting: props.sorting,\n search: props.search,\n filters: props.filters,\n hiddenColumns: props.hiddenColumns,\n selection: props.selected,\n pagination:\n props.page !== undefined || props.pageSize !== undefined\n ? { page: props.page ?? current.page, pageSize: props.pageSize ?? current.pageSize }\n : undefined,\n };\n}\n\n/**\n * Emit a `v-model` update for each piece of state that changed. The state is frozen and replaced\n * piece by piece, so identity tells what changed.\n */\nexport function emitStateChanges(\n emit: (event: (typeof stateEmits)[number], value: unknown) => void,\n state: TableState,\n previous: TableState,\n): void {\n if (state.pagination.page !== previous.pagination.page) {\n emit(\"update:page\", state.pagination.page);\n }\n if (state.pagination.pageSize !== previous.pagination.pageSize) {\n emit(\"update:pageSize\", state.pagination.pageSize);\n }\n if (state.sorting !== previous.sorting) {\n emit(\"update:sorting\", state.sorting);\n }\n if (state.search !== previous.search) {\n emit(\"update:search\", state.search);\n }\n if (state.filters !== previous.filters) {\n emit(\"update:filters\", state.filters);\n }\n if (state.hiddenColumns !== previous.hiddenColumns) {\n emit(\"update:hiddenColumns\", state.hiddenColumns);\n }\n if (state.selection !== previous.selection) {\n emit(\"update:selected\", state.selection);\n }\n}\n\n/**\n * The given columns, or columns inferred from the data. Inferred columns are reused while the\n * data keeps the same fields, so an edit that replaces the array does not rebuild every row.\n */\nexport function createColumnResolver(): (\n columns: readonly AnyColumnDef[] | undefined,\n data: readonly unknown[],\n) => readonly AnyColumnDef[] {\n let inferred:\n | { readonly signature: string; readonly columns: readonly AnyColumnDef[] }\n | undefined;\n return (columns, data) => {\n if (columns) {\n return columns;\n }\n const next = inferColumns(data);\n const signature = next.map((column) => column.id).join(\"\\u0000\");\n if (inferred?.signature !== signature) {\n inferred = { signature, columns: next };\n }\n return inferred.columns;\n };\n}\n","import type { CellChange, ColumnDef, TableIssue, TableState } from \"@vueye-table/core\";\nimport type { GridCellSlotProps } from \"@vueye-table/headless\";\nimport {\n VtGrid,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNode } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n} from \"./shared\";\n\n/**\n * An editable spreadsheet over an array. Cells are edited in place with the keyboard or a double\n * click, ranges are selected with Shift or by dragging, and copy, cut, paste, clear, undo, and\n * redo work like a spreadsheet application. Every edit produces a new array through\n * `update:data`; the array passed in is never mutated.\n */\nexport const VueyeGrid = defineComponent({\n name: \"VueyeGrid\",\n slots: Object as SlotsType<\n { [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown } } & {\n default?: (props: Record<string, unknown>) => VNode[];\n }\n >,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, required: true },\n ...commonProps,\n searchable: { type: Boolean, default: false },\n columnToggle: { type: Boolean, default: false },\n /** Page the grid. By default every row is on one page. */\n pagination: { type: Boolean, default: false },\n /** Columns are editable unless their definition says otherwise. Set `false` to lock all. */\n editable: { type: Boolean, default: true },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n label: { type: String, default: \"Spreadsheet\" },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n export: (_csv: string) => true,\n } as { [K in (typeof stateEmits)[number]]: null } & {\n \"state-change\": (state: TableState) => boolean;\n \"update:data\": (data: readonly unknown[]) => boolean;\n edit: (changes: readonly CellChange<unknown>[]) => boolean;\n \"edit-error\": (issues: readonly TableIssue[]) => boolean;\n export: (csv: string) => boolean;\n },\n setup(props, { emit, slots, expose, attrs }) {\n const resolveColumns = createColumnResolver();\n const columns = computed(() =>\n resolveColumns(props.columns, props.data).map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n ),\n );\n const everyRow = (): number => Math.max(1, props.data.length);\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pagination ? (props.pageSize ?? props.pageSizeOptions[0] ?? 10) : everyRow(),\n };\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n data: () => props.data,\n columns,\n rowKey: props.rowKey as never,\n paginate: props.paginate ?? (props.virtual ? props.pagination : true),\n selectionMode: \"none\",\n initialState: { pagination: initialPagination },\n state: () => {\n const controlled = controlledState(\n props,\n binding?.table.getState().pagination ?? initialPagination,\n );\n return {\n ...controlled,\n selection: undefined,\n pagination: props.pagination ? controlled.pagination : { page: 1, pageSize: everyRow() },\n };\n },\n onEditIssues(issues) {\n emit(\"edit-error\", issues);\n },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n // `cell.<id>` slots also receive the row's data as `item`, as they do on `<VueyeTable>`.\n const gridSlots = (): Record<string, unknown> => {\n const forwarded: Record<string, unknown> = {};\n for (const [name, slot] of Object.entries(slots)) {\n if (name === \"default\" && slot) {\n forwarded[name] = slot;\n } else if (name.startsWith(\"cell.\") && slot) {\n forwarded[name] = (cellProps: GridCellSlotProps) =>\n slot({ ...cellProps, item: cellProps.row.original });\n }\n }\n return forwarded;\n };\n\n const button = (label: string, disabled: boolean, onClick: () => void) =>\n h(\"button\", { type: \"button\", class: \"vt-button\", disabled, onClick }, label);\n\n return () =>\n h(\"div\", { class: \"vt-theme vueye-grid\", \"data-vt-theme\": props.theme }, [\n props.toolbar || props.searchable\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(\"Undo\", !table.canUndo, () => table.undo()),\n button(\"Redo\", !table.canRedo, () => table.redo()),\n button(\"Export CSV\", false, () => emit(\"export\", table.exportRows())),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n columnLetters: props.columnLetters,\n density: props.density,\n striped: props.striped,\n bordered: props.bordered,\n hover: false,\n stickyHeader: props.stickyHeader,\n loading: props.loading,\n theme: props.theme,\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n height: props.height,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(VtStatus),\n h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ]),\n ])\n : null,\n ]);\n },\n});\n","import type { ColumnDef, RowKey, TableRow, TableState } from \"@vueye-table/core\";\nimport {\n DataTableBody,\n DataTableCaption,\n DataTableCell,\n DataTableRow,\n DataTableSelectAll,\n DataTableSelectRow,\n DataTableRoot,\n DataTableViewport,\n} from \"@vueye-table/headless\";\nimport {\n VtColumnVisibility,\n VtEmpty,\n VtHeader,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNodeChild } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n} from \"./shared\";\n\n/** Slot props of `cell.<column id>` and `cell`. */\nexport interface CellSlotProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly column: { readonly id: string; readonly header: string };\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport interface StatusSlotProps {\n readonly start: number;\n readonly end: number;\n readonly rowCount: number;\n readonly totalRowCount: number;\n readonly selectedCount: number;\n}\n\n/**\n * A complete data table: search, column visibility, sorting, selection, pagination, a live\n * status line, loading and empty states, and theming. Every piece of state is available as a\n * `v-model`, and `manual` hands searching, sorting, and paging to a server.\n */\nexport const VueyeTable = defineComponent({\n name: \"VueyeTable\",\n props: {\n data: { type: Array as PropType<readonly unknown[]>, required: true },\n ...commonProps,\n /** `true` or `\"multiple\"` for checkboxes, `\"single\"` for one row at a time. */\n selectable: {\n type: [Boolean, String] as PropType<boolean | \"single\" | \"multiple\">,\n default: false,\n },\n selected: { type: Array as PropType<readonly RowKey[]>, default: undefined },\n /** The data is one page from a server; `rowCount` is the total. */\n manual: { type: Boolean, default: false },\n rowCount: { type: Number as PropType<number | undefined>, default: undefined },\n /** Shown instead of the empty state while `loading` and there are no rows yet. */\n loadingText: { type: String, default: \"Loading…\" },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n } as {\n [K in (typeof stateEmits)[number]]: null;\n } & {\n \"state-change\": (state: TableState) => boolean;\n \"row-click\": (item: unknown, row: TableRow<unknown>) => boolean;\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `header.${string}`]: { column: { id: string; header: string } };\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n }\n >,\n setup(props, { emit, slots, expose }) {\n const selectionMode = computed(() =>\n props.selectable === false ? \"none\" : props.selectable === \"single\" ? \"single\" : \"multiple\",\n );\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pageSize ?? props.pageSizeOptions[0] ?? 10,\n };\n const resolveColumns = createColumnResolver();\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n data: () => props.data,\n columns: () => resolveColumns(props.columns, props.data) as readonly ColumnDef<unknown>[],\n rowKey: props.rowKey as never,\n manual: props.manual,\n paginate: props.paginate ?? !props.virtual,\n rowCount: () => props.rowCount,\n selectionMode: selectionMode.value,\n selectScope: props.selectScope,\n initialState: { pagination: initialPagination },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n const selectable = (): boolean => selectionMode.value !== \"none\";\n\n const cell = (row: TableRow<unknown>, column: (typeof table.columns)[number]): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n return h(\n DataTableCell,\n { key: column.id, row, column },\n slot\n ? {\n default: ({ value, display }: { value: unknown; display: string }) =>\n slot({ item: row.original, row, value, display, column }),\n }\n : undefined,\n );\n };\n\n const body = (rows: readonly TableRow<unknown>[] = table.rows): VNodeChild => {\n const width = table.columns.length + (selectable() ? 1 : 0);\n if (table.rows.length === 0) {\n // While the first page is loading there is nothing to match yet, so say that instead.\n const content = props.loading\n ? (slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }))\n : (slots.empty?.({}) ?? h(VtEmpty));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width) }, content)]);\n }\n return rows.map((row) =>\n h(\n DataTableRow,\n { key: row.key, row, onClick: () => emit(\"row-click\", row.original, row) },\n () => [\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column)),\n ],\n ),\n );\n };\n\n const headerSlots = () => {\n const forwarded: Record<string, unknown> = {};\n for (const column of table.columns) {\n const slot = slots[`header.${column.id}`];\n if (slot) {\n forwarded[`header.${column.id}`] = () => slot({ column });\n }\n }\n return {\n ...forwarded,\n before: () =>\n selectable()\n ? h(\n \"th\",\n { class: \"vt-selection-cell\", scope: \"col\" },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n };\n };\n\n const tableContent = (): VNodeChild => {\n const children = () => [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(\n DataTableBody,\n { class: \"vt-body\", colspan: table.columns.length + (selectable() ? 1 : 0) },\n { default: ({ rows }: { rows: readonly TableRow<unknown>[] }) => body(rows) },\n ),\n ];\n return props.virtual\n ? h(\n DataTableViewport,\n {\n class: \"vt-scroll\",\n height: props.height ?? \"24rem\",\n style: { \"--vt-row-height\": `${props.rowHeight}px` },\n },\n {\n default: () =>\n h(\n DataTableRoot,\n {\n table,\n class: \"vt-table\",\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n \"table\",\n {\n class: \"vt-table\",\n \"aria-rowcount\": table.rowCount + 1,\n \"aria-colcount\": table.columns.length,\n },\n children(),\n ),\n ]);\n };\n\n return () =>\n h(\n \"div\",\n {\n class: \"vt-surface vueye-table\",\n \"data-density\": props.density,\n \"data-striped\": props.striped ? \"\" : undefined,\n \"data-bordered\": props.bordered ? \"\" : undefined,\n \"data-hover\": props.hover ? \"\" : undefined,\n \"data-sticky-header\": props.stickyHeader || props.virtual ? \"\" : undefined,\n \"data-virtual\": props.virtual ? \"\" : undefined,\n \"data-loading\": props.loading ? \"\" : undefined,\n \"data-vt-theme\": props.theme,\n \"aria-busy\": props.loading ? \"true\" : undefined,\n style: props.maxHeight ? { \"--vt-max-height\": props.maxHeight } : undefined,\n },\n [\n h(\"div\", { class: \"vt-root\" }, [\n props.searchable || props.columnToggle || slots.toolbar\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n slots.toolbar?.({ table }),\n props.columnToggle ? h(VtColumnVisibility) : null,\n ])\n : null,\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n tableContent(),\n (props.pagination && (!props.virtual || table.paginate)) || slots.footer\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: StatusSlotProps) => slots.status?.(status) }\n : props.loading && table.rows.length === 0\n ? { default: () => props.loadingText }\n : undefined,\n ),\n slots.footer?.({ table }),\n props.pagination && (!props.virtual || table.paginate)\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]),\n ],\n );\n },\n});\n","import type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Register `<VueyeTable>` and `<VueyeGrid>` globally. */\nexport const VueyeTablePlugin: Plugin = {\n install(app: App): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,cAAc;CACzB,GAAG;;CAEH,UAAU;EAAE,MAAM;EAA0C,SAAS;CAAU;;CAE/E,SAAS;EAAE,MAAM;EAA4C,SAAS;CAAU;;CAEhF,QAAQ;EACN,MAAM,CAAC,QAAQ,QAAQ;EACvB,SAAS;CACX;CACA,SAAS;EAAE,MAAM;EAAQ,SAAS;CAAU;CAC5C,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,SAAS;EAAE,MAAM;EAA6B,SAAS;CAAc;CACrE,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,UAAU;EAAE,MAAM;EAAS,SAAS;CAAM;CAC1C,OAAO;EAAE,MAAM;EAAS,SAAS;CAAK;CACtC,cAAc;EAAE,MAAM;EAAS,SAAS;CAAM;CAC9C,OAAO;EAAE,MAAM;EAAsC,SAAS;CAAU;;CAExE,WAAW;EAAE,MAAM;EAAQ,SAAS;CAAU;CAE9C,YAAY;EAAE,MAAM;EAAS,SAAS;CAAK;CAC3C,mBAAmB;EAAE,MAAM;EAAQ,SAAS;CAAU;CACtD,cAAc;EAAE,MAAM;EAAS,SAAS;CAAK;CAC7C,YAAY;EAAE,MAAM;EAAS,SAAS;CAAK;CAC3C,iBAAiB;EAAE,MAAM;EAAsC,eAAe;GAAC;GAAG;GAAI;GAAI;EAAE;CAAE;CAE9F,MAAM;EAAE,MAAM;EAAQ,SAAS;CAAU;CACzC,UAAU;EAAE,MAAM;EAAQ,SAAS;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ACJ,EAAE,OAAO;IAAE,OAAO;IAAe,MAAM;GAAe,CAAC;GACvD,aAAa;GACZ,MAAM,eAAe,CAAC,MAAM,WAAW,MAAM,aAAc,MAAM,SAC9D,EAAE,WAAW,EAAE,OAAO,YAAY,SAAS;IACzC,EACE,UACA,MACA,MAAM,SACF,EAAE,UAAU,WAA4B,MAAM,SAAS,MAAM,EAAE,IAC/D,MAAM,WAAW,MAAM,KAAK,WAAW,IACrC,EAAE,eAAe,MAAM,YAAY,IACnC,MACR;IACA,MAAM,SAAS,EAAE,MAAM,CAAC;IACxB,MAAM,eAAe,CAAC,MAAM,WAAW,MAAM,YACzC,EAAE,OAAO,EAAE,OAAO,qBAAqB,GAAG,CACxC,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;CACJ;AACF,CAAC;;;;;AC5RD,MAAa,mBAA2B,EACtC,QAAQ,KAAgB;CACtB,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;AACtC,EACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/shared.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/plugin.ts"],"sourcesContent":["import {\n inferColumns,\n type AnyColumnDef,\n type PaginationState,\n type RowKey,\n type SelectScope,\n type SortRule,\n type TableState,\n type TableStatePatch,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { TableSource, LoadMore } from \"@vueye-table/vue\";\nimport type { PropType } from \"vue\";\n\n/** Props both full components share. */\nexport const commonProps = {\n ...virtualProps,\n source: {\n type: [Object, Function] as PropType<TableSource<unknown> | undefined>,\n default: undefined,\n },\n loadMore: { type: Function as PropType<LoadMore<unknown> | undefined>, default: undefined },\n endThreshold: { type: Number, default: 5 },\n manual: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n rowCount: { type: Number as PropType<number | undefined>, default: undefined },\n /** Override the virtual default of no pagination; permits virtualizing a large page. */\n paginate: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Column definitions. Without them, columns are inferred from the data. */\n columns: { type: Array as PropType<readonly AnyColumnDef[]>, default: undefined },\n /** A path into each row, or a function, giving its key. Defaults to `id`, then position. */\n rowKey: {\n type: [String, Function] as PropType<string | ((row: any, index: number) => RowKey)>,\n default: undefined,\n },\n caption: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n density: { type: String as PropType<Density>, default: \"comfortable\" },\n striped: { type: Boolean, default: false },\n bordered: { type: Boolean, default: false },\n hover: { type: Boolean, default: true },\n stickyHeader: { type: Boolean, default: false },\n theme: { type: String as PropType<\"light\" | \"dark\">, default: undefined },\n /** A CSS height that makes the body scroll, such as `\"24rem\"`. */\n maxHeight: { type: String, default: undefined },\n\n searchable: { type: Boolean, default: true },\n searchPlaceholder: { type: String, default: \"Search…\" },\n columnToggle: { type: Boolean, default: true },\n pagination: { type: Boolean, default: true },\n pageSizeOptions: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n\n page: { type: Number, default: undefined },\n pageSize: { type: Number, default: undefined },\n sorting: { type: Array as PropType<readonly SortRule[]>, default: undefined },\n search: { type: String, default: undefined },\n filters: { type: Object as PropType<Readonly<Record<string, unknown>>>, default: undefined },\n hiddenColumns: { type: Array as PropType<readonly string[]>, default: undefined },\n selectScope: { type: String as PropType<SelectScope>, default: \"all\" },\n} as const;\n\nexport const stateEmits = [\n \"update:page\",\n \"update:pageSize\",\n \"update:sorting\",\n \"update:search\",\n \"update:filters\",\n \"update:hiddenColumns\",\n \"update:selected\",\n] as const;\n\ninterface ControlledProps {\n readonly page: number | undefined;\n readonly pageSize: number | undefined;\n readonly sorting: readonly SortRule[] | undefined;\n readonly search: string | undefined;\n readonly filters: Readonly<Record<string, unknown>> | undefined;\n readonly hiddenColumns: readonly string[] | undefined;\n readonly selected?: readonly RowKey[] | undefined;\n}\n\n/** The state a parent controls through `v-model`, as a table state patch. */\nexport function controlledState(props: ControlledProps, current: PaginationState): TableStatePatch {\n return {\n sorting: props.sorting,\n search: props.search,\n filters: props.filters,\n hiddenColumns: props.hiddenColumns,\n selection: props.selected,\n pagination:\n props.page !== undefined || props.pageSize !== undefined\n ? { page: props.page ?? current.page, pageSize: props.pageSize ?? current.pageSize }\n : undefined,\n };\n}\n\n/**\n * Emit a `v-model` update for each piece of state that changed. The state is frozen and replaced\n * piece by piece, so identity tells what changed.\n */\nexport function emitStateChanges(\n emit: (event: (typeof stateEmits)[number], value: unknown) => void,\n state: TableState,\n previous: TableState,\n): void {\n if (state.pagination.page !== previous.pagination.page) {\n emit(\"update:page\", state.pagination.page);\n }\n if (state.pagination.pageSize !== previous.pagination.pageSize) {\n emit(\"update:pageSize\", state.pagination.pageSize);\n }\n if (state.sorting !== previous.sorting) {\n emit(\"update:sorting\", state.sorting);\n }\n if (state.search !== previous.search) {\n emit(\"update:search\", state.search);\n }\n if (state.filters !== previous.filters) {\n emit(\"update:filters\", state.filters);\n }\n if (state.hiddenColumns !== previous.hiddenColumns) {\n emit(\"update:hiddenColumns\", state.hiddenColumns);\n }\n if (state.selection !== previous.selection) {\n emit(\"update:selected\", state.selection);\n }\n}\n\n/**\n * The given columns, or columns inferred from the data. Inferred columns are reused while the\n * data keeps the same fields, so an edit that replaces the array does not rebuild every row.\n */\nexport function createColumnResolver(): (\n columns: readonly AnyColumnDef[] | undefined,\n data: readonly unknown[],\n) => readonly AnyColumnDef[] {\n let inferred:\n | { readonly signature: string; readonly columns: readonly AnyColumnDef[] }\n | undefined;\n return (columns, data) => {\n if (columns) {\n return columns;\n }\n const next = inferColumns(data);\n const signature = next.map((column) => column.id).join(\"\\u0000\");\n if (inferred?.signature !== signature) {\n inferred = { signature, columns: next };\n }\n return inferred.columns;\n };\n}\n","import type { CellChange, ColumnDef, TableIssue, TableState } from \"@vueye-table/core\";\nimport type { GridCellSlotProps, TableStatusSlotProps } from \"@vueye-table/headless\";\nimport {\n VtGrid,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNode } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n} from \"./shared\";\n\n/**\n * An editable spreadsheet over an array. Cells are edited in place with the keyboard or a double\n * click, ranges are selected with Shift or by dragging, and copy, cut, paste, clear, undo, and\n * redo work like a spreadsheet application. Every edit produces a new array through\n * `update:data`; the array passed in is never mutated.\n */\nexport const VueyeGrid = defineComponent({\n name: \"VueyeGrid\",\n slots: Object as SlotsType<\n { [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown } } & {\n default?: (props: Record<string, unknown>) => VNode[];\n status?: (props: TableStatusSlotProps) => VNode[];\n }\n >,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n searchable: { type: Boolean, default: false },\n columnToggle: { type: Boolean, default: false },\n /** Page the grid. By default every row is on one page. */\n pagination: { type: Boolean, default: false },\n /** Columns are editable unless their definition says otherwise. Set `false` to lock all. */\n editable: { type: Boolean, default: true },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n label: { type: String, default: \"Spreadsheet\" },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n export: (_csv: string) => true,\n } as { [K in (typeof stateEmits)[number]]: null } & {\n \"state-change\": (state: TableState) => boolean;\n \"update:data\": (data: readonly unknown[]) => boolean;\n edit: (changes: readonly CellChange<unknown>[]) => boolean;\n \"edit-error\": (issues: readonly TableIssue[]) => boolean;\n export: (csv: string) => boolean;\n },\n setup(props, { emit, slots, expose, attrs }) {\n const resolveColumns = createColumnResolver();\n const columns = computed(() =>\n resolveColumns(props.columns, props.data).map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n ),\n );\n const everyRow = (): number => Math.max(1, props.data.length);\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pagination ? (props.pageSize ?? props.pageSizeOptions[0] ?? 10) : everyRow(),\n };\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n manual: props.manual,\n rowCount: () => props.rowCount,\n columns,\n rowKey: props.rowKey as never,\n paginate:\n props.paginate ??\n (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),\n selectionMode: \"none\",\n initialState: { pagination: initialPagination },\n state: () => {\n const controlled = controlledState(\n props,\n binding?.table.getState().pagination ?? initialPagination,\n );\n return {\n ...controlled,\n selection: undefined,\n pagination: props.pagination ? controlled.pagination : { page: 1, pageSize: everyRow() },\n };\n },\n onEditIssues(issues) {\n emit(\"edit-error\", issues);\n },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n // `cell.<id>` slots also receive the row's data as `item`, as they do on `<VueyeTable>`.\n const gridSlots = (): Record<string, unknown> => {\n const forwarded: Record<string, unknown> = {};\n for (const [name, slot] of Object.entries(slots)) {\n if (name === \"default\" && slot) {\n forwarded[name] = slot;\n } else if (name.startsWith(\"cell.\")) {\n const cellSlot = slots[name as `cell.${string}`];\n forwarded[name] = (cellProps: GridCellSlotProps) =>\n cellSlot?.({ ...cellProps, item: cellProps.row.original });\n }\n }\n return forwarded;\n };\n\n const button = (label: string, disabled: boolean, onClick: () => void) =>\n h(\"button\", { type: \"button\", class: \"vt-button\", disabled, onClick }, label);\n\n return () =>\n h(\"div\", { class: \"vt-theme vueye-grid\", \"data-vt-theme\": props.theme }, [\n props.toolbar || props.searchable\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(\"Undo\", !table.canUndo, () => table.undo()),\n button(\"Redo\", !table.canRedo, () => table.redo()),\n button(\"Export CSV\", false, () => emit(\"export\", table.exportRows())),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n columnLetters: props.columnLetters,\n density: props.density,\n striped: props.striped,\n bordered: props.bordered,\n hover: false,\n stickyHeader: props.stickyHeader,\n loading:\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\",\n theme: props.theme,\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n height: props.height,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination || table.loadingMode || slots.status\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: TableStatusSlotProps) => slots.status?.(status) }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n props.pagination && table.paginate\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]);\n },\n});\n","import type { ColumnDef, RowKey, TableRow, TableState } from \"@vueye-table/core\";\nimport {\n DataTableBody,\n DataTableCaption,\n DataTableCell,\n DataTableRow,\n DataTableSelectAll,\n DataTableSelectRow,\n DataTableRoot,\n DataTableViewport,\n type TableStatusSlotProps,\n} from \"@vueye-table/headless\";\nimport {\n VtColumnVisibility,\n VtEmpty,\n VtHeader,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNodeChild } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n} from \"./shared\";\n\n/** Slot props of `cell.<column id>` and `cell`. */\nexport interface CellSlotProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly column: { readonly id: string; readonly header: string };\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport type StatusSlotProps = TableStatusSlotProps;\n\n/**\n * A complete data table: search, column visibility, sorting, selection, pagination, a live\n * status line, loading and empty states, and theming. Every piece of state is available as a\n * `v-model`, and `manual` hands searching, sorting, and paging to a server.\n */\nexport const VueyeTable = defineComponent({\n name: \"VueyeTable\",\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n /** `true` or `\"multiple\"` for checkboxes, `\"single\"` for one row at a time. */\n selectable: {\n type: [Boolean, String] as PropType<boolean | \"single\" | \"multiple\">,\n default: false,\n },\n selected: { type: Array as PropType<readonly RowKey[]>, default: undefined },\n /** The data is one page from a server; `rowCount` is the total. */\n /** Shown instead of the empty state while `loading` and there are no rows yet. */\n loadingText: { type: String, default: \"Loading…\" },\n },\n emits: {\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n } as {\n [K in (typeof stateEmits)[number]]: null;\n } & {\n \"state-change\": (state: TableState) => boolean;\n \"row-click\": (item: unknown, row: TableRow<unknown>) => boolean;\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `header.${string}`]: { column: { id: string; header: string } };\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n }\n >,\n setup(props, { emit, slots, expose }) {\n const selectionMode = computed(() =>\n props.selectable === false ? \"none\" : props.selectable === \"single\" ? \"single\" : \"multiple\",\n );\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pageSize ?? props.pageSizeOptions[0] ?? 10,\n };\n const resolveColumns = createColumnResolver();\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n columns: () => resolveColumns(props.columns, props.data) as readonly ColumnDef<unknown>[],\n rowKey: props.rowKey as never,\n manual: props.manual,\n paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),\n rowCount: () => props.rowCount,\n selectionMode: selectionMode.value,\n selectScope: props.selectScope,\n initialState: { pagination: initialPagination },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n const busy = (): boolean =>\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\";\n\n const selectable = (): boolean => selectionMode.value !== \"none\";\n\n const cell = (row: TableRow<unknown>, column: (typeof table.columns)[number]): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n return h(\n DataTableCell,\n { key: column.id, row, column },\n slot\n ? {\n default: ({ value, display }: { value: unknown; display: string }) =>\n slot({ item: row.original, row, value, display, column }),\n }\n : undefined,\n );\n };\n\n const body = (rows: readonly TableRow<unknown>[] = table.rows): VNodeChild => {\n const width = table.columns.length + (selectable() ? 1 : 0);\n if (table.rows.length === 0) {\n // While the first page is loading there is nothing to match yet, so say that instead.\n const content = busy()\n ? (slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }))\n : (slots.empty?.({}) ??\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"error\"\n ? \"Could not load rows.\"\n : \"No matching rows\",\n }));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width) }, content)]);\n }\n return rows.map((row) =>\n h(\n DataTableRow,\n { key: row.key, row, onClick: () => emit(\"row-click\", row.original, row) },\n () => [\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column)),\n ],\n ),\n );\n };\n\n const headerSlots = () => {\n const forwarded: Record<string, unknown> = {};\n for (const column of table.columns) {\n const slot = slots[`header.${column.id}`];\n if (slot) {\n forwarded[`header.${column.id}`] = () => slot({ column });\n }\n }\n return {\n ...forwarded,\n before: () =>\n selectable()\n ? h(\n \"th\",\n { class: \"vt-selection-cell\", scope: \"col\" },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n };\n };\n\n const tableContent = (): VNodeChild => {\n const children = () => [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(\n DataTableBody,\n { class: \"vt-body\", colspan: table.columns.length + (selectable() ? 1 : 0) },\n { default: ({ rows }: { rows: readonly TableRow<unknown>[] }) => body(rows) },\n ),\n ];\n return props.virtual\n ? h(\n DataTableViewport,\n {\n class: \"vt-scroll\",\n height: props.height ?? \"24rem\",\n style: { \"--vt-row-height\": `${props.rowHeight}px` },\n },\n {\n default: () =>\n h(\n DataTableRoot,\n {\n table,\n class: \"vt-table\",\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n \"table\",\n {\n class: \"vt-table\",\n \"aria-rowcount\": table.rowCount + 1,\n \"aria-colcount\": table.columns.length,\n \"aria-busy\": busy() ? \"true\" : undefined,\n },\n children(),\n ),\n ]);\n };\n\n return () =>\n h(\n \"div\",\n {\n class: \"vt-surface vueye-table\",\n \"data-density\": props.density,\n \"data-striped\": props.striped ? \"\" : undefined,\n \"data-bordered\": props.bordered ? \"\" : undefined,\n \"data-hover\": props.hover ? \"\" : undefined,\n \"data-sticky-header\": props.stickyHeader || props.virtual ? \"\" : undefined,\n \"data-virtual\": props.virtual ? \"\" : undefined,\n \"data-loading\": busy() ? \"\" : undefined,\n \"data-vt-theme\": props.theme,\n \"aria-busy\": props.loading ? \"true\" : undefined,\n style: props.maxHeight ? { \"--vt-max-height\": props.maxHeight } : undefined,\n },\n [\n h(\"div\", { class: \"vt-root\" }, [\n props.searchable || props.columnToggle || slots.toolbar\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n slots.toolbar?.({ table }),\n props.columnToggle ? h(VtColumnVisibility) : null,\n ])\n : null,\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n tableContent(),\n (props.pagination && (!props.virtual || table.paginate)) ||\n slots.footer ||\n slots.status ||\n table.loadingMode\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: StatusSlotProps) => slots.status?.(status) }\n : props.loading && table.rows.length === 0\n ? { default: () => props.loadingText }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n slots.footer?.({ table }),\n props.pagination && table.paginate && (!props.virtual || table.paginate)\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]),\n ],\n );\n },\n});\n","import type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Register `<VueyeTable>` and `<VueyeGrid>` globally. */\nexport const VueyeTablePlugin: Plugin = {\n install(app: App): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAa,cAAc;CACzB,GAAG;CACH,QAAQ;EACN,MAAM,CAAC,QAAQ,QAAQ;EACvB,SAAS;CACX;CACA,UAAU;EAAE,MAAM;EAAqD,SAAS;CAAU;CAC1F,cAAc;EAAE,MAAM;EAAQ,SAAS;CAAE;CACzC,QAAQ;EAAE,MAAM;EAA0C,SAAS;CAAU;CAC7E,UAAU;EAAE,MAAM;EAAwC,SAAS;CAAU;;CAE7E,UAAU;EAAE,MAAM;EAA0C,SAAS;CAAU;;CAE/E,SAAS;EAAE,MAAM;EAA4C,SAAS;CAAU;;CAEhF,QAAQ;EACN,MAAM,CAAC,QAAQ,QAAQ;EACvB,SAAS;CACX;CACA,SAAS;EAAE,MAAM;EAAQ,SAAS;CAAU;CAC5C,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,SAAS;EAAE,MAAM;EAA6B,SAAS;CAAc;CACrE,SAAS;EAAE,MAAM;EAAS,SAAS;CAAM;CACzC,UAAU;EAAE,MAAM;EAAS,SAAS;CAAM;CAC1C,OAAO;EAAE,MAAM;EAAS,SAAS;CAAK;CACtC,cAAc;EAAE,MAAM;EAAS,SAAS;CAAM;CAC9C,OAAO;EAAE,MAAM;EAAsC,SAAS;CAAU;;CAExE,WAAW;EAAE,MAAM;EAAQ,SAAS;CAAU;CAE9C,YAAY;EAAE,MAAM;EAAS,SAAS;CAAK;CAC3C,mBAAmB;EAAE,MAAM;EAAQ,SAAS;CAAU;CACtD,cAAc;EAAE,MAAM;EAAS,SAAS;CAAK;CAC7C,YAAY;EAAE,MAAM;EAAS,SAAS;CAAK;CAC3C,iBAAiB;EAAE,MAAM;EAAsC,eAA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C,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;CACJ;AACF,CAAC;;;;;ACtSD,MAAa,mBAA2B,EACtC,QAAQ,KAAgB;CACtB,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;AACtC,EACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueye-table",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.8",
|
|
4
4
|
"description": "A Vue framework for data tables and spreadsheets: a complete, themeable data table and grid, plus every layer beneath them.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-grid",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"provenance": true
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vueye-table/core": "3.0.0-alpha.
|
|
46
|
-
"@vueye-table/headless": "3.0.0-alpha.
|
|
47
|
-
"@vueye-table/
|
|
48
|
-
"@vueye-table/
|
|
45
|
+
"@vueye-table/core": "3.0.0-alpha.8",
|
|
46
|
+
"@vueye-table/headless": "3.0.0-alpha.8",
|
|
47
|
+
"@vueye-table/styled": "3.0.0-alpha.8",
|
|
48
|
+
"@vueye-table/vue": "3.0.0-alpha.8"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"vue": "3.5.43",
|