vueye-table 3.0.0-alpha.3 → 3.0.0-alpha.5

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # vueye-table
2
2
 
3
+ `VueyeTable` and `VueyeGrid` support opt-in virtualization through `virtual`, `height`, `rowHeight` and `overscan`; grids also expose `virtualColumns` and `columnWidth`. Virtual tables default to no paging, with `paginate` available for large pages. The guide and runnable 100k-record example live in `docs/guide/virtualization.md` and `docs/examples/virtual-components.md`.
4
+
3
5
  A Vue framework for data, data tables, and spreadsheets.
4
6
 
5
7
  vueye-table began as a single table component. Version 3 is a rewrite around one idea: a table is
package/dist/index.d.ts CHANGED
@@ -52,6 +52,10 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
52
52
  type: BooleanConstructor;
53
53
  default: boolean;
54
54
  };
55
+ paginate: {
56
+ readonly type: PropType<boolean | undefined>;
57
+ readonly default: undefined;
58
+ };
55
59
  columns: {
56
60
  readonly type: PropType<readonly import("@vueye-table/core").AnyColumnDef[]>;
57
61
  readonly default: undefined;
@@ -132,6 +136,30 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
132
136
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
133
137
  readonly default: "all";
134
138
  };
139
+ virtual: {
140
+ readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
141
+ readonly default: false;
142
+ };
143
+ height: {
144
+ readonly type: PropType<string | undefined>;
145
+ readonly default: undefined;
146
+ };
147
+ rowHeight: {
148
+ readonly type: NumberConstructor;
149
+ readonly default: 40;
150
+ };
151
+ overscan: {
152
+ readonly type: NumberConstructor;
153
+ readonly default: 5;
154
+ };
155
+ virtualColumns: {
156
+ readonly type: BooleanConstructor;
157
+ readonly default: false;
158
+ };
159
+ columnWidth: {
160
+ readonly type: NumberConstructor;
161
+ readonly default: 120;
162
+ };
135
163
  data: {
136
164
  type: PropType<readonly unknown[]>;
137
165
  required: true;
@@ -188,6 +216,10 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
188
216
  type: BooleanConstructor;
189
217
  default: boolean;
190
218
  };
219
+ paginate: {
220
+ readonly type: PropType<boolean | undefined>;
221
+ readonly default: undefined;
222
+ };
191
223
  columns: {
192
224
  readonly type: PropType<readonly import("@vueye-table/core").AnyColumnDef[]>;
193
225
  readonly default: undefined;
@@ -268,6 +300,30 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
268
300
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
269
301
  readonly default: "all";
270
302
  };
303
+ virtual: {
304
+ readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
305
+ readonly default: false;
306
+ };
307
+ height: {
308
+ readonly type: PropType<string | undefined>;
309
+ readonly default: undefined;
310
+ };
311
+ rowHeight: {
312
+ readonly type: NumberConstructor;
313
+ readonly default: 40;
314
+ };
315
+ overscan: {
316
+ readonly type: NumberConstructor;
317
+ readonly default: 5;
318
+ };
319
+ virtualColumns: {
320
+ readonly type: BooleanConstructor;
321
+ readonly default: false;
322
+ };
323
+ columnWidth: {
324
+ readonly type: NumberConstructor;
325
+ readonly default: 120;
326
+ };
271
327
  data: {
272
328
  type: PropType<readonly unknown[]>;
273
329
  required: true;
@@ -287,6 +343,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
287
343
  onExport?: (csv: string) => any;
288
344
  }>, {
289
345
  page: number;
346
+ paginate: boolean | undefined;
290
347
  columns: readonly import("@vueye-table/core").AnyColumnDef[];
291
348
  rowKey: string | ((row: any, index: number) => import("@vueye-table/core").RowKey);
292
349
  caption: string;
@@ -309,6 +366,12 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
309
366
  filters: Readonly<Record<string, unknown>>;
310
367
  hiddenColumns: readonly string[];
311
368
  selectScope: import("@vueye-table/core").SelectScope;
369
+ virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
370
+ height: string | undefined;
371
+ rowHeight: number;
372
+ overscan: number;
373
+ virtualColumns: boolean;
374
+ columnWidth: number;
312
375
  label: string;
313
376
  toolbar: boolean;
314
377
  editable: boolean;
@@ -371,6 +434,10 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
371
434
  type: StringConstructor;
372
435
  default: string;
373
436
  };
437
+ paginate: {
438
+ readonly type: PropType<boolean | undefined>;
439
+ readonly default: undefined;
440
+ };
374
441
  columns: {
375
442
  readonly type: PropType<readonly import("@vueye-table/core").AnyColumnDef[]>;
376
443
  readonly default: undefined;
@@ -463,6 +530,30 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
463
530
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
464
531
  readonly default: "all";
465
532
  };
533
+ virtual: {
534
+ readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
535
+ readonly default: false;
536
+ };
537
+ height: {
538
+ readonly type: PropType<string | undefined>;
539
+ readonly default: undefined;
540
+ };
541
+ rowHeight: {
542
+ readonly type: NumberConstructor;
543
+ readonly default: 40;
544
+ };
545
+ overscan: {
546
+ readonly type: NumberConstructor;
547
+ readonly default: 5;
548
+ };
549
+ virtualColumns: {
550
+ readonly type: BooleanConstructor;
551
+ readonly default: false;
552
+ };
553
+ columnWidth: {
554
+ readonly type: NumberConstructor;
555
+ readonly default: 120;
556
+ };
466
557
  data: {
467
558
  type: PropType<readonly unknown[]>;
468
559
  required: true;
@@ -504,6 +595,10 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
504
595
  type: StringConstructor;
505
596
  default: string;
506
597
  };
598
+ paginate: {
599
+ readonly type: PropType<boolean | undefined>;
600
+ readonly default: undefined;
601
+ };
507
602
  columns: {
508
603
  readonly type: PropType<readonly import("@vueye-table/core").AnyColumnDef[]>;
509
604
  readonly default: undefined;
@@ -596,6 +691,30 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
596
691
  readonly type: PropType<import("@vueye-table/core").SelectScope>;
597
692
  readonly default: "all";
598
693
  };
694
+ virtual: {
695
+ readonly type: PropType<boolean | import("@vueye-table/headless").ComponentVirtualOptions>;
696
+ readonly default: false;
697
+ };
698
+ height: {
699
+ readonly type: PropType<string | undefined>;
700
+ readonly default: undefined;
701
+ };
702
+ rowHeight: {
703
+ readonly type: NumberConstructor;
704
+ readonly default: 40;
705
+ };
706
+ overscan: {
707
+ readonly type: NumberConstructor;
708
+ readonly default: 5;
709
+ };
710
+ virtualColumns: {
711
+ readonly type: BooleanConstructor;
712
+ readonly default: false;
713
+ };
714
+ columnWidth: {
715
+ readonly type: NumberConstructor;
716
+ readonly default: 120;
717
+ };
599
718
  data: {
600
719
  type: PropType<readonly unknown[]>;
601
720
  required: true;
@@ -617,6 +736,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
617
736
  manual: boolean;
618
737
  rowCount: number | undefined;
619
738
  loadingText: string;
739
+ paginate: boolean | undefined;
620
740
  columns: readonly import("@vueye-table/core").AnyColumnDef[];
621
741
  rowKey: string | ((row: any, index: number) => RowKey);
622
742
  caption: string;
@@ -639,6 +759,12 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
639
759
  filters: Readonly<Record<string, unknown>>;
640
760
  hiddenColumns: readonly string[];
641
761
  selectScope: import("@vueye-table/core").SelectScope;
762
+ virtual: boolean | import("@vueye-table/headless").ComponentVirtualOptions;
763
+ height: string | undefined;
764
+ rowHeight: number;
765
+ overscan: number;
766
+ virtualColumns: boolean;
767
+ columnWidth: number;
642
768
  }, SlotsType<{
643
769
  [key: `cell.${string}`]: CellSlotProps;
644
770
  [key: `header.${string}`]: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/index.ts"],"mappings":";;;;;;;;;cAMa,kBAAkB;;;;;;;;;cCqBlB,y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AGjB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAVL,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BgB;MAAE;MAAY;;;;EAE1C;IAAE;;EACJ,OAAA;EACE,SAAA;EACD;IAAE;;EACF,QAAA;kCAuMZ;;;;YCtRiB;IACf,mBAAmB;IACnB,kBAAkB"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { inferColumns } from "@vueye-table/core";
2
- import { DataTableBody, DataTableCaption, DataTableCell, DataTableRow, DataTableSelectAll, DataTableSelectRow } from "@vueye-table/headless";
2
+ import { DataTableBody, DataTableCaption, DataTableCell, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, virtualProps } from "@vueye-table/headless";
3
3
  import { VtColumnVisibility, VtEmpty, VtGrid, VtHeader, 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";
@@ -15,6 +15,12 @@ export * from "@vueye-table/vue"
15
15
  //#region src/shared.ts
16
16
  /** Props both full components share. */
17
17
  const commonProps = {
18
+ ...virtualProps,
19
+ /** Override the virtual default of no pagination; permits virtualizing a large page. */
20
+ paginate: {
21
+ type: Boolean,
22
+ default: void 0
23
+ },
18
24
  /** Column definitions. Without them, columns are inferred from the data. */
19
25
  columns: {
20
26
  type: Array,
@@ -231,7 +237,7 @@ const VueyeGrid = defineComponent({
231
237
  "edit-error": (_issues) => true,
232
238
  export: (_csv) => true
233
239
  },
234
- setup(props, { emit, slots, expose }) {
240
+ setup(props, { emit, slots, expose, attrs }) {
235
241
  const resolveColumns = createColumnResolver();
236
242
  const columns = computed(() => resolveColumns(props.columns, props.data).map((column) => ({
237
243
  ...column,
@@ -247,6 +253,7 @@ const VueyeGrid = defineComponent({
247
253
  data: () => props.data,
248
254
  columns,
249
255
  rowKey: props.rowKey,
256
+ paginate: props.paginate ?? (props.virtual ? props.pagination : true),
250
257
  selectionMode: "none",
251
258
  initialState: { pagination: initialPagination },
252
259
  state: () => {
@@ -306,6 +313,7 @@ const VueyeGrid = defineComponent({
306
313
  h(VtGrid, {
307
314
  table,
308
315
  label: props.label,
316
+ "aria-describedby": attrs["aria-describedby"],
309
317
  rowNumbers: props.rowNumbers,
310
318
  columnLetters: props.columnLetters,
311
319
  density: props.density,
@@ -315,6 +323,12 @@ const VueyeGrid = defineComponent({
315
323
  stickyHeader: props.stickyHeader,
316
324
  loading: props.loading,
317
325
  theme: props.theme,
326
+ virtual: props.virtual,
327
+ virtualColumns: props.virtualColumns,
328
+ height: props.height,
329
+ rowHeight: props.rowHeight,
330
+ overscan: props.overscan,
331
+ columnWidth: props.columnWidth,
318
332
  ...props.maxHeight ? { style: { "--vt-max-height": props.maxHeight } } : {}
319
333
  }, gridSlots()),
320
334
  props.pagination ? h(VtToolbar, { class: "vt-footer" }, () => [h(VtStatus), h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)])]) : null
@@ -380,6 +394,7 @@ const VueyeTable = defineComponent({
380
394
  columns: () => resolveColumns(props.columns, props.data),
381
395
  rowKey: props.rowKey,
382
396
  manual: props.manual,
397
+ paginate: props.paginate ?? !props.virtual,
383
398
  rowCount: () => props.rowCount,
384
399
  selectionMode: selectionMode.value,
385
400
  selectScope: props.selectScope,
@@ -408,13 +423,13 @@ const VueyeTable = defineComponent({
408
423
  column
409
424
  }) } : void 0);
410
425
  };
411
- const body = () => {
426
+ const body = (rows = table.rows) => {
412
427
  const width = table.columns.length + (selectable() ? 1 : 0);
413
428
  if (table.rows.length === 0) {
414
429
  const content = props.loading ? slots.loading?.({}) ?? h(VtEmpty, { text: props.loadingText }) : slots.empty?.({}) ?? h(VtEmpty);
415
430
  return h("tr", { "data-empty": "" }, [h("td", { colspan: Math.max(1, width) }, content)]);
416
431
  }
417
- return table.rows.map((row) => h(DataTableRow, {
432
+ return rows.map((row) => h(DataTableRow, {
418
433
  key: row.key,
419
434
  row,
420
435
  onClick: () => emit("row-click", row.original, row)
@@ -437,13 +452,39 @@ const VueyeTable = defineComponent({
437
452
  }, selectionMode.value === "multiple" ? [h(DataTableSelectAll)] : []) : null
438
453
  };
439
454
  };
455
+ const tableContent = () => {
456
+ const children = () => [
457
+ props.caption ? h(DataTableCaption, () => props.caption) : null,
458
+ h(VtHeader, null, headerSlots()),
459
+ h(DataTableBody, {
460
+ class: "vt-body",
461
+ colspan: table.columns.length + (selectable() ? 1 : 0)
462
+ }, { default: ({ rows }) => body(rows) })
463
+ ];
464
+ return props.virtual ? h(DataTableViewport, {
465
+ class: "vt-scroll",
466
+ height: props.height ?? "24rem",
467
+ style: { "--vt-row-height": `${props.rowHeight}px` }
468
+ }, { default: () => h(DataTableRoot, {
469
+ table,
470
+ class: "vt-table",
471
+ virtual: props.virtual,
472
+ rowHeight: props.rowHeight,
473
+ overscan: props.overscan
474
+ }, children) }) : h("div", { class: "vt-scroll" }, [h("table", {
475
+ class: "vt-table",
476
+ "aria-rowcount": table.rowCount + 1,
477
+ "aria-colcount": table.columns.length
478
+ }, children())]);
479
+ };
440
480
  return () => h("div", {
441
481
  class: "vt-surface vueye-table",
442
482
  "data-density": props.density,
443
483
  "data-striped": props.striped ? "" : void 0,
444
484
  "data-bordered": props.bordered ? "" : void 0,
445
485
  "data-hover": props.hover ? "" : void 0,
446
- "data-sticky-header": props.stickyHeader ? "" : void 0,
486
+ "data-sticky-header": props.stickyHeader || props.virtual ? "" : void 0,
487
+ "data-virtual": props.virtual ? "" : void 0,
447
488
  "data-loading": props.loading ? "" : void 0,
448
489
  "data-vt-theme": props.theme,
449
490
  "aria-busy": props.loading ? "true" : void 0,
@@ -459,19 +500,11 @@ const VueyeTable = defineComponent({
459
500
  class: "vt-progress",
460
501
  role: "presentation"
461
502
  }),
462
- h("div", { class: "vt-scroll" }, [h("table", {
463
- class: "vt-table",
464
- "aria-rowcount": table.rowCount + 1,
465
- "aria-colcount": table.columns.length
466
- }, [
467
- props.caption ? h(DataTableCaption, () => props.caption) : null,
468
- h(VtHeader, null, headerSlots()),
469
- h(DataTableBody, { class: "vt-body" }, () => body())
470
- ])]),
471
- props.pagination || slots.footer ? h(VtToolbar, { class: "vt-footer" }, () => [
503
+ tableContent(),
504
+ props.pagination && (!props.virtual || table.paginate) || slots.footer ? h(VtToolbar, { class: "vt-footer" }, () => [
472
505
  h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : props.loading && table.rows.length === 0 ? { default: () => props.loadingText } : void 0),
473
506
  slots.footer?.({ table }),
474
- props.pagination ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
507
+ props.pagination && (!props.virtual || table.paginate) ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
475
508
  ]) : null
476
509
  ])]);
477
510
  }
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 type { Density } from \"@vueye-table/styled\";\nimport type { PropType } from \"vue\";\n\n/** Props both full components share. */\nexport const commonProps = {\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 }) {\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 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 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 ...(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} 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 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 = (): 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 table.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 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 ? \"\" : 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 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 [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(DataTableBody, { class: \"vt-body\" }, () => body()),\n ],\n ),\n ]),\n props.pagination || 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\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":";;;;;;;;;;;;;;;;AAcA,MAAa,cAAc;;CAEzB,SAAS;EAAE,MAAM;EAA4C,SAAS;CAAU;;CAEhF,QAAQ;EACN,MAAM,CAAC,QAAQ,QAAQ;EACvB,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AO,IAAI;IAC3D,EAAE,UAAU,MAAM,YAAY,CAAC;IAC/B,EAAE,eAAe,EAAE,OAAO,UAAU,SAAS,KAAK,CAAC;GACrD,CACF,CACF,CAAC;GACD,MAAM,cAAc,MAAM,SACtB,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,aACF,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;;;;;ACxPD,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 { 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,mBA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AAU,GAAG;GAC7B,MAAM,cAAc,MAAM,gBAAgB,MAAM,UAC5C,EAAE,iBAAiB;IACjB,MAAM,aAAa,EAAE,UAAU,EAAE,aAAa,MAAM,kBAAkB,CAAC,IAAI;IAC3E,EAAE,OAAO,EAAE,OAAO,oBAAoB,CAAC;IACvC,MAAM,UAAU,EAAE,MAAM,CAAC;IACzB,MAAM,eAAe,EAAE,kBAAkB,IAAI;GAC/C,CAAC,IACD;GACJ,EAAE,OAAO;IAAE,OAAO;IAAe,MAAM;GAAe,CAAC;GACvD,aAAa;GACZ,MAAM,eAAe,CAAC,MAAM,WAAW,MAAM,aAAc,MAAM,SAC9D,EAAE,WAAW,EAAE,OAAO,YAAY,SAAS;IACzC,EACE,UACA,MACA,MAAM,SACF,EAAE,UAAU,WAA4B,MAAM,SAAS,MAAM,EAAE,IAC/D,MAAM,WAAW,MAAM,KAAK,WAAW,IACrC,EAAE,eAAe,MAAM,YAAY,IACnC,MACR;IACA,MAAM,SAAS,EAAE,MAAM,CAAC;IACxB,MAAM,eAAe,CAAC,MAAM,WAAW,MAAM,YACzC,EAAE,OAAO,EAAE,OAAO,qBAAqB,GAAG,CACxC,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;CACJ;AACF,CAAC;;;;;AC5RD,MAAa,mBAA2B,EACtC,QAAQ,KAAgB;CACtB,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;AACtC,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueye-table",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.5",
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.3",
46
- "@vueye-table/headless": "3.0.0-alpha.3",
47
- "@vueye-table/styled": "3.0.0-alpha.3",
48
- "@vueye-table/vue": "3.0.0-alpha.3"
45
+ "@vueye-table/core": "3.0.0-alpha.5",
46
+ "@vueye-table/headless": "3.0.0-alpha.5",
47
+ "@vueye-table/styled": "3.0.0-alpha.5",
48
+ "@vueye-table/vue": "3.0.0-alpha.5"
49
49
  },
50
50
  "devDependencies": {
51
51
  "vue": "3.5.43",