vueye-table 3.0.0-beta.1 → 3.0.0-beta.2

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 CHANGED
@@ -1,13 +1,19 @@
1
- import { CellChange, EditResult, RowKey, TableIssue, TableRow, TableState } from "@vueye-table/core";
1
+ import { CellChange, EditResult, RowKey, SortInfo, TableIssue, TableRow, TableState } from "@vueye-table/core";
2
2
  import { CellEditorSlotProps, DetailSlotProps, GridCellSlotProps, TableStatusSlotProps } from "@vueye-table/headless";
3
+ import { DataTableBinding, TableLocaleOptions } from "@vueye-table/vue";
3
4
  import { Plugin, PropType, SlotsType, VNode } from "vue";
4
5
  export * from "@vueye-table/core";
5
6
  export * from "@vueye-table/headless";
6
7
  export * from "@vueye-table/styled";
7
8
  export * from "@vueye-table/vue";
8
9
  //#region src/plugin.d.ts
9
- /** Register `<VueyeTable>` and `<VueyeGrid>` globally. */
10
- declare const VueyeTablePlugin: Plugin;
10
+ /** Options of `VueyeTablePlugin`: the application's language, which every table speaks. */
11
+ type VueyeTablePluginOptions = TableLocaleOptions;
12
+ /**
13
+ * Register `<VueyeTable>` and `<VueyeGrid>` globally. A `locale` and `messages` given here are
14
+ * the default of every table in the application; a table's own props win over them.
15
+ */
16
+ declare const VueyeTablePlugin: Plugin<[VueyeTablePluginOptions?]>;
11
17
  //#endregion
12
18
  //#region src/vueye-grid.d.ts
13
19
  /**
@@ -43,9 +49,10 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
43
49
  type: BooleanConstructor;
44
50
  default: boolean;
45
51
  };
52
+ /** The grid's accessible name. Defaults to the messages' `spreadsheet`. */
46
53
  label: {
47
- type: StringConstructor;
48
- default: string;
54
+ type: PropType<string | undefined>;
55
+ default: undefined;
49
56
  };
50
57
  /** Show undo, redo, and CSV export buttons. */
51
58
  toolbar: {
@@ -153,7 +160,19 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
153
160
  readonly default: false;
154
161
  };
155
162
  theme: {
156
- readonly type: PropType<"light" | "dark">;
163
+ readonly type: PropType<"light" | "dark" | "inherit">;
164
+ readonly default: undefined;
165
+ };
166
+ locale: {
167
+ readonly type: PropType<string | undefined>;
168
+ readonly default: undefined;
169
+ };
170
+ messages: {
171
+ readonly type: PropType<Partial<import("@vueye-table/core").TableMessages> | undefined>;
172
+ readonly default: undefined;
173
+ };
174
+ normalizeText: {
175
+ readonly type: PropType<import("@vueye-table/core").TextNormalizer | undefined>;
157
176
  readonly default: undefined;
158
177
  };
159
178
  maxHeight: {
@@ -161,8 +180,8 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
161
180
  readonly default: undefined;
162
181
  };
163
182
  searchPlaceholder: {
164
- readonly type: StringConstructor;
165
- readonly default: "Search…";
183
+ readonly type: PropType<string | undefined>;
184
+ readonly default: undefined;
166
185
  };
167
186
  pageSizeOptions: {
168
187
  readonly type: PropType<readonly number[]>;
@@ -259,29 +278,24 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
259
278
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
260
279
  [key: string]: any;
261
280
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
262
- "update:page": null;
263
- "update:pageSize": null;
264
- "update:sorting": null;
265
- "update:search": null;
266
- "update:filters": null;
267
- "update:hiddenColumns": null;
268
- "update:selected": null;
269
- "update:expanded": null;
270
- } & {
271
- "update:data": (_data: readonly unknown[]) => boolean;
272
- edit: (_changes: readonly CellChange<unknown>[]) => boolean;
281
+ "state-change": (_state: TableState) => true;
282
+ "update:data": (_data: readonly unknown[]) => true;
283
+ edit: (_changes: readonly CellChange<unknown>[]) => true;
284
+ "edit-error": (_issues: readonly TableIssue[]) => true;
285
+ export: (_csv: string) => true;
286
+ expand: (_item: unknown, _row: TableRow<unknown>) => true;
287
+ collapse: (_item: unknown, _row: TableRow<unknown>) => true;
288
+ "update:page": (_page: number) => boolean;
289
+ "update:pageSize": (_pageSize: number) => boolean;
290
+ "update:sorting": (_sorting: readonly import("@vueye-table/core").SortRule[]) => boolean;
291
+ "update:search": (_search: string) => boolean;
292
+ "update:filters": (_filters: Readonly<Record<string, unknown>>) => boolean;
293
+ "update:hiddenColumns": (_hiddenColumns: readonly string[]) => boolean;
294
+ "update:selected": (_selected: readonly import("@vueye-table/core").RowKey[]) => boolean;
295
+ "update:expanded": (_expanded: import("@vueye-table/core").ExpandedState) => boolean;
273
296
  save: (_result: EditResult<unknown>) => boolean;
274
297
  cancel: (_key: import("@vueye-table/core").RowKey) => boolean;
275
298
  "edit-issues": (_issues: readonly TableIssue[]) => boolean;
276
- "edit-error": (_issues: readonly TableIssue[]) => boolean;
277
- } & {
278
- "state-change": (state: TableState) => boolean;
279
- "update:data": (data: readonly unknown[]) => boolean;
280
- edit: (changes: readonly CellChange<unknown>[]) => boolean;
281
- "edit-error": (issues: readonly TableIssue[]) => boolean;
282
- export: (csv: string) => boolean;
283
- expand: (item: unknown, row: TableRow<unknown>) => boolean;
284
- collapse: (item: unknown, row: TableRow<unknown>) => boolean;
285
299
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
286
300
  searchable: {
287
301
  type: BooleanConstructor;
@@ -309,9 +323,10 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
309
323
  type: BooleanConstructor;
310
324
  default: boolean;
311
325
  };
326
+ /** The grid's accessible name. Defaults to the messages' `spreadsheet`. */
312
327
  label: {
313
- type: StringConstructor;
314
- default: string;
328
+ type: PropType<string | undefined>;
329
+ default: undefined;
315
330
  };
316
331
  /** Show undo, redo, and CSV export buttons. */
317
332
  toolbar: {
@@ -419,7 +434,19 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
419
434
  readonly default: false;
420
435
  };
421
436
  theme: {
422
- readonly type: PropType<"light" | "dark">;
437
+ readonly type: PropType<"light" | "dark" | "inherit">;
438
+ readonly default: undefined;
439
+ };
440
+ locale: {
441
+ readonly type: PropType<string | undefined>;
442
+ readonly default: undefined;
443
+ };
444
+ messages: {
445
+ readonly type: PropType<Partial<import("@vueye-table/core").TableMessages> | undefined>;
446
+ readonly default: undefined;
447
+ };
448
+ normalizeText: {
449
+ readonly type: PropType<import("@vueye-table/core").TextNormalizer | undefined>;
423
450
  readonly default: undefined;
424
451
  };
425
452
  maxHeight: {
@@ -427,8 +454,8 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
427
454
  readonly default: undefined;
428
455
  };
429
456
  searchPlaceholder: {
430
- readonly type: StringConstructor;
431
- readonly default: "Search…";
457
+ readonly type: PropType<string | undefined>;
458
+ readonly default: undefined;
432
459
  };
433
460
  pageSizeOptions: {
434
461
  readonly type: PropType<readonly number[]>;
@@ -523,24 +550,24 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
523
550
  default: () => never[];
524
551
  };
525
552
  }>> & Readonly<{
526
- "onUpdate:page"?: (...args: any[]) => any;
527
- "onUpdate:pageSize"?: (...args: any[]) => any;
528
- "onUpdate:sorting"?: (...args: any[]) => any;
529
- "onUpdate:search"?: (...args: any[]) => any;
530
- "onUpdate:filters"?: (...args: any[]) => any;
531
- "onUpdate:hiddenColumns"?: (...args: any[]) => any;
532
- "onUpdate:selected"?: (...args: any[]) => any;
533
- "onUpdate:expanded"?: (...args: any[]) => any;
553
+ "onState-change"?: (_state: TableState) => any;
554
+ onExpand?: (_item: unknown, _row: TableRow<unknown>) => any;
555
+ onCollapse?: (_item: unknown, _row: TableRow<unknown>) => any;
556
+ onCancel?: (_key: import("@vueye-table/core").RowKey) => any;
557
+ "onUpdate:page"?: (_page: number) => any;
558
+ "onUpdate:pageSize"?: (_pageSize: number) => any;
559
+ "onUpdate:sorting"?: (_sorting: readonly import("@vueye-table/core").SortRule[]) => any;
560
+ "onUpdate:search"?: (_search: string) => any;
561
+ "onUpdate:filters"?: (_filters: Readonly<Record<string, unknown>>) => any;
562
+ "onUpdate:hiddenColumns"?: (_hiddenColumns: readonly string[]) => any;
563
+ "onUpdate:selected"?: (_selected: readonly import("@vueye-table/core").RowKey[]) => any;
564
+ "onUpdate:expanded"?: (_expanded: import("@vueye-table/core").ExpandedState) => any;
534
565
  "onUpdate:data"?: (_data: readonly unknown[]) => any;
535
566
  onEdit?: (_changes: readonly CellChange<unknown>[]) => any;
536
567
  onSave?: (_result: EditResult<unknown>) => any;
537
- onCancel?: (_key: import("@vueye-table/core").RowKey) => any;
538
568
  "onEdit-issues"?: (_issues: readonly TableIssue[]) => any;
539
569
  "onEdit-error"?: (_issues: readonly TableIssue[]) => any;
540
- "onState-change"?: (state: TableState) => any;
541
- onExpand?: (item: unknown, row: TableRow<unknown>) => any;
542
- onCollapse?: (item: unknown, row: TableRow<unknown>) => any;
543
- onExport?: (csv: string) => any;
570
+ onExport?: (_csv: string) => any;
544
571
  }>, {
545
572
  validateRow: ((next: any, previous: any) => import("@vueye-table/core").ValidationResult | Promise<import("@vueye-table/core").ValidationResult>) | undefined;
546
573
  setParentKey: ((row: any, parent: import("@vueye-table/core").RowKey | undefined) => any) | undefined;
@@ -571,16 +598,20 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
571
598
  bordered: boolean;
572
599
  hover: boolean;
573
600
  stickyHeader: boolean;
574
- theme: "light" | "dark";
601
+ theme: "light" | "dark" | "inherit";
602
+ locale: string | undefined;
603
+ messages: Partial<import("@vueye-table/core").TableMessages> | undefined;
604
+ search: string;
605
+ searchPlaceholder: string | undefined;
606
+ pagination: boolean;
607
+ addRow: boolean;
608
+ normalizeText: import("@vueye-table/core").TextNormalizer | undefined;
575
609
  maxHeight: string;
576
610
  searchable: boolean;
577
- searchPlaceholder: string;
578
611
  columnToggle: boolean;
579
- pagination: boolean;
580
612
  pageSizeOptions: readonly number[];
581
613
  pageSize: number;
582
614
  sorting: readonly import("@vueye-table/core").SortRule[];
583
- search: string;
584
615
  filters: Readonly<Record<string, unknown>>;
585
616
  hiddenColumns: readonly string[];
586
617
  selectScope: import("@vueye-table/core").SelectScope;
@@ -594,10 +625,9 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
594
625
  columnWidth: number;
595
626
  asyncValidation: "held" | "optimistic" | undefined;
596
627
  createRow: (() => any) | undefined;
597
- addRow: boolean;
598
628
  removeRows: boolean;
599
629
  toolbar: boolean;
600
- label: string;
630
+ label: string | undefined;
601
631
  editable: boolean;
602
632
  rowNumbers: boolean;
603
633
  columnLetters: boolean;
@@ -624,8 +654,27 @@ interface CellSlotProps {
624
654
  readonly header: string;
625
655
  };
626
656
  }
657
+ /**
658
+ * What a `<VueyeTable>` exposes on its template ref: the table binding, with every snapshot field
659
+ * and operation. `useTemplateRef<VueyeTableExposed>("table")` reads it typed.
660
+ */
661
+ interface VueyeTableExposed {
662
+ readonly table: DataTableBinding<unknown>;
663
+ }
627
664
  /** Slot props of `status`, the "1–10 of 57 rows" line. */
628
665
  type StatusSlotProps = TableStatusSlotProps;
666
+ /**
667
+ * Slot props of `header.<column id>`. The slot fills the header cell; on a sortable column it sits
668
+ * inside the sort button, so the header still sorts on click and shows its indicator.
669
+ */
670
+ interface HeaderSlotProps {
671
+ readonly column: {
672
+ readonly id: string;
673
+ readonly header: string;
674
+ };
675
+ readonly sort: SortInfo | undefined;
676
+ readonly toggleSort: (multi?: boolean) => void;
677
+ }
629
678
  /**
630
679
  * A complete data table: search, column visibility, sorting, selection, pagination, a live
631
680
  * status line, loading and empty states, and theming. Every piece of state is available as a
@@ -648,8 +697,8 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
648
697
  /** The data is one page from a server; `rowCount` is the total. */
649
698
  /** Shown instead of the empty state while `loading` and there are no rows yet. */
650
699
  loadingText: {
651
- type: StringConstructor;
652
- default: string;
700
+ type: PropType<string | undefined>;
701
+ default: undefined;
653
702
  };
654
703
  rowCanExpand: {
655
704
  readonly type: PropType<((row: any) => boolean) | undefined>;
@@ -752,7 +801,19 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
752
801
  readonly default: false;
753
802
  };
754
803
  theme: {
755
- readonly type: PropType<"light" | "dark">;
804
+ readonly type: PropType<"light" | "dark" | "inherit">;
805
+ readonly default: undefined;
806
+ };
807
+ locale: {
808
+ readonly type: PropType<string | undefined>;
809
+ readonly default: undefined;
810
+ };
811
+ messages: {
812
+ readonly type: PropType<Partial<import("@vueye-table/core").TableMessages> | undefined>;
813
+ readonly default: undefined;
814
+ };
815
+ normalizeText: {
816
+ readonly type: PropType<import("@vueye-table/core").TextNormalizer | undefined>;
756
817
  readonly default: undefined;
757
818
  };
758
819
  maxHeight: {
@@ -764,8 +825,8 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
764
825
  readonly default: true;
765
826
  };
766
827
  searchPlaceholder: {
767
- readonly type: StringConstructor;
768
- readonly default: "Search…";
828
+ readonly type: PropType<string | undefined>;
829
+ readonly default: undefined;
769
830
  };
770
831
  columnToggle: {
771
832
  readonly type: BooleanConstructor;
@@ -870,26 +931,24 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
870
931
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
871
932
  [key: string]: any;
872
933
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
873
- "update:page": null;
874
- "update:pageSize": null;
875
- "update:sorting": null;
876
- "update:search": null;
877
- "update:filters": null;
878
- "update:hiddenColumns": null;
879
- "update:selected": null;
880
- "update:expanded": null;
881
- } & {
934
+ "state-change": (_state: TableState) => true;
935
+ "row-click": (_item: unknown, _row: TableRow<unknown>) => true;
936
+ expand: (_item: unknown, _row: TableRow<unknown>) => true;
937
+ collapse: (_item: unknown, _row: TableRow<unknown>) => true;
938
+ "update:page": (_page: number) => boolean;
939
+ "update:pageSize": (_pageSize: number) => boolean;
940
+ "update:sorting": (_sorting: readonly import("@vueye-table/core").SortRule[]) => boolean;
941
+ "update:search": (_search: string) => boolean;
942
+ "update:filters": (_filters: Readonly<Record<string, unknown>>) => boolean;
943
+ "update:hiddenColumns": (_hiddenColumns: readonly string[]) => boolean;
944
+ "update:selected": (_selected: readonly RowKey[]) => boolean;
945
+ "update:expanded": (_expanded: import("@vueye-table/core").ExpandedState) => boolean;
882
946
  "update:data": (_data: readonly unknown[]) => boolean;
883
947
  edit: (_changes: readonly import("@vueye-table/core").CellChange<unknown>[]) => boolean;
884
948
  save: (_result: EditResult<unknown>) => boolean;
885
949
  cancel: (_key: RowKey) => boolean;
886
950
  "edit-issues": (_issues: readonly import("@vueye-table/core").TableIssue[]) => boolean;
887
951
  "edit-error": (_issues: readonly import("@vueye-table/core").TableIssue[]) => boolean;
888
- } & {
889
- "state-change": (state: TableState) => boolean;
890
- "row-click": (item: unknown, row: TableRow<unknown>) => boolean;
891
- expand: (item: unknown, row: TableRow<unknown>) => boolean;
892
- collapse: (item: unknown, row: TableRow<unknown>) => boolean;
893
952
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
894
953
  editMode: {
895
954
  type: PropType<"cell" | "row" | undefined>;
@@ -907,8 +966,8 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
907
966
  /** The data is one page from a server; `rowCount` is the total. */
908
967
  /** Shown instead of the empty state while `loading` and there are no rows yet. */
909
968
  loadingText: {
910
- type: StringConstructor;
911
- default: string;
969
+ type: PropType<string | undefined>;
970
+ default: undefined;
912
971
  };
913
972
  rowCanExpand: {
914
973
  readonly type: PropType<((row: any) => boolean) | undefined>;
@@ -1011,7 +1070,19 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1011
1070
  readonly default: false;
1012
1071
  };
1013
1072
  theme: {
1014
- readonly type: PropType<"light" | "dark">;
1073
+ readonly type: PropType<"light" | "dark" | "inherit">;
1074
+ readonly default: undefined;
1075
+ };
1076
+ locale: {
1077
+ readonly type: PropType<string | undefined>;
1078
+ readonly default: undefined;
1079
+ };
1080
+ messages: {
1081
+ readonly type: PropType<Partial<import("@vueye-table/core").TableMessages> | undefined>;
1082
+ readonly default: undefined;
1083
+ };
1084
+ normalizeText: {
1085
+ readonly type: PropType<import("@vueye-table/core").TextNormalizer | undefined>;
1015
1086
  readonly default: undefined;
1016
1087
  };
1017
1088
  maxHeight: {
@@ -1023,8 +1094,8 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1023
1094
  readonly default: true;
1024
1095
  };
1025
1096
  searchPlaceholder: {
1026
- readonly type: StringConstructor;
1027
- readonly default: "Search…";
1097
+ readonly type: PropType<string | undefined>;
1098
+ readonly default: undefined;
1028
1099
  };
1029
1100
  columnToggle: {
1030
1101
  readonly type: BooleanConstructor;
@@ -1127,24 +1198,24 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1127
1198
  default: () => never[];
1128
1199
  };
1129
1200
  }>> & Readonly<{
1130
- "onUpdate:page"?: (...args: any[]) => any;
1131
- "onUpdate:pageSize"?: (...args: any[]) => any;
1132
- "onUpdate:sorting"?: (...args: any[]) => any;
1133
- "onUpdate:search"?: (...args: any[]) => any;
1134
- "onUpdate:filters"?: (...args: any[]) => any;
1135
- "onUpdate:hiddenColumns"?: (...args: any[]) => any;
1136
- "onUpdate:selected"?: (...args: any[]) => any;
1137
- "onUpdate:expanded"?: (...args: any[]) => any;
1201
+ "onState-change"?: (_state: TableState) => any;
1202
+ "onRow-click"?: (_item: unknown, _row: TableRow<unknown>) => any;
1203
+ onExpand?: (_item: unknown, _row: TableRow<unknown>) => any;
1204
+ onCollapse?: (_item: unknown, _row: TableRow<unknown>) => any;
1205
+ onCancel?: (_key: RowKey) => any;
1206
+ "onUpdate:page"?: (_page: number) => any;
1207
+ "onUpdate:pageSize"?: (_pageSize: number) => any;
1208
+ "onUpdate:sorting"?: (_sorting: readonly import("@vueye-table/core").SortRule[]) => any;
1209
+ "onUpdate:search"?: (_search: string) => any;
1210
+ "onUpdate:filters"?: (_filters: Readonly<Record<string, unknown>>) => any;
1211
+ "onUpdate:hiddenColumns"?: (_hiddenColumns: readonly string[]) => any;
1212
+ "onUpdate:selected"?: (_selected: readonly RowKey[]) => any;
1213
+ "onUpdate:expanded"?: (_expanded: import("@vueye-table/core").ExpandedState) => any;
1138
1214
  "onUpdate:data"?: (_data: readonly unknown[]) => any;
1139
1215
  onEdit?: (_changes: readonly import("@vueye-table/core").CellChange<unknown>[]) => any;
1140
1216
  onSave?: (_result: EditResult<unknown>) => any;
1141
- onCancel?: (_key: RowKey) => any;
1142
1217
  "onEdit-issues"?: (_issues: readonly import("@vueye-table/core").TableIssue[]) => any;
1143
1218
  "onEdit-error"?: (_issues: readonly import("@vueye-table/core").TableIssue[]) => any;
1144
- "onState-change"?: (state: TableState) => any;
1145
- "onRow-click"?: (item: unknown, row: TableRow<unknown>) => any;
1146
- onExpand?: (item: unknown, row: TableRow<unknown>) => any;
1147
- onCollapse?: (item: unknown, row: TableRow<unknown>) => any;
1148
1219
  }>, {
1149
1220
  validateRow: ((next: any, previous: any) => import("@vueye-table/core").ValidationResult | Promise<import("@vueye-table/core").ValidationResult>) | undefined;
1150
1221
  setParentKey: ((row: any, parent: RowKey | undefined) => any) | undefined;
@@ -1160,7 +1231,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1160
1231
  editMode: "row" | "cell" | undefined;
1161
1232
  selectable: boolean | "single" | "multiple";
1162
1233
  selected: readonly RowKey[];
1163
- loadingText: string;
1234
+ loadingText: string | undefined;
1164
1235
  rowCanExpand: ((row: any) => boolean) | undefined;
1165
1236
  expandMode: import("@vueye-table/core").ExpandMode;
1166
1237
  expanded: import("@vueye-table/core").ExpandedState | undefined;
@@ -1179,16 +1250,20 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1179
1250
  bordered: boolean;
1180
1251
  hover: boolean;
1181
1252
  stickyHeader: boolean;
1182
- theme: "light" | "dark";
1253
+ theme: "light" | "dark" | "inherit";
1254
+ locale: string | undefined;
1255
+ messages: Partial<import("@vueye-table/core").TableMessages> | undefined;
1256
+ search: string;
1257
+ searchPlaceholder: string | undefined;
1258
+ pagination: boolean;
1259
+ addRow: boolean;
1260
+ normalizeText: import("@vueye-table/core").TextNormalizer | undefined;
1183
1261
  maxHeight: string;
1184
1262
  searchable: boolean;
1185
- searchPlaceholder: string;
1186
1263
  columnToggle: boolean;
1187
- pagination: boolean;
1188
1264
  pageSizeOptions: readonly number[];
1189
1265
  pageSize: number;
1190
1266
  sorting: readonly import("@vueye-table/core").SortRule[];
1191
- search: string;
1192
1267
  filters: Readonly<Record<string, unknown>>;
1193
1268
  hiddenColumns: readonly string[];
1194
1269
  selectScope: import("@vueye-table/core").SelectScope;
@@ -1202,17 +1277,11 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1202
1277
  columnWidth: number;
1203
1278
  asyncValidation: "held" | "optimistic" | undefined;
1204
1279
  createRow: (() => any) | undefined;
1205
- addRow: boolean;
1206
1280
  removeRows: boolean;
1207
1281
  }, SlotsType<{
1208
1282
  [key: `cell.${string}`]: CellSlotProps;
1209
1283
  [key: `editor.${string}`]: CellEditorSlotProps;
1210
- [key: `header.${string}`]: {
1211
- column: {
1212
- id: string;
1213
- header: string;
1214
- };
1215
- };
1284
+ [key: `header.${string}`]: HeaderSlotProps;
1216
1285
  } & {
1217
1286
  toolbar: {
1218
1287
  table: unknown;
@@ -1234,5 +1303,5 @@ declare module "vue" {
1234
1303
  }
1235
1304
  }
1236
1305
  //#endregion
1237
- export { type CellSlotProps, type StatusSlotProps, VueyeGrid, VueyeTable, VueyeTablePlugin };
1306
+ export { type CellSlotProps, type HeaderSlotProps, type StatusSlotProps, VueyeGrid, VueyeTable, type VueyeTableExposed, VueyeTablePlugin, type VueyeTablePluginOptions };
1238
1307
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/index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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAXR,MAAA;;;;;;EAgBE,iBAAA,QAAA;EACJ,cAAA,gBAAO,MAAQ;EACpB,SAAA,gBAAO,MAAQ;EACb,WAAA,gBAAO,MAAQ;;;;;;;;;;;;;;;;;IAjBL,MAAA;;;;;IAGC,MAAA;;;;IAGF,MAAA,kBAAkB;;;;;;IAGd,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAXR,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BZ;IAAE;;EACJ,OAAA;EACE,SAAA;EACD;IAAE;;EACF,QAAA;EACE,UAAA;kCAgVd;;;;YCzciB;IACf,mBAAmB;IACnB,kBAAkB"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { inferColumns } from "@vueye-table/core";
2
2
  import { DataTableBody, DataTableCaption, DataTableCell, DataTableEditCell, DataTableEditRoot, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, hierarchyProps, resolveTreeColumn, virtualProps } from "@vueye-table/headless";
3
3
  import { VtColumnVisibility, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtRowActions, VtSearch, VtStatus, VtToolbar, VtTreeCell } from "@vueye-table/styled";
4
- import { provideDataTable, useDataTable } from "@vueye-table/vue";
4
+ import { provideDataTable, provideTableLocale, tableLocaleKey, useDataTable, useTableLocale } from "@vueye-table/vue";
5
5
  import { computed, defineComponent, h, mergeProps } from "vue";
6
6
 
7
7
  export * from "@vueye-table/core"
@@ -184,10 +184,37 @@ const commonProps = {
184
184
  type: Boolean,
185
185
  default: false
186
186
  },
187
+ /**
188
+ * `"light"` or `"dark"` forces a palette; by default the table follows `prefers-color-scheme`.
189
+ * `"inherit"` uses no built-in palette: the host declares the `--vt-*` tokens on an ancestor,
190
+ * in its own light and dark themes.
191
+ */
187
192
  theme: {
188
193
  type: String,
189
194
  default: void 0
190
195
  },
196
+ /**
197
+ * The BCP 47 locale numbers are written and text is ordered in, such as `"fr"` or `"ar-DZ"`.
198
+ * Defaults to the plugin's, then the runtime's. Ordering reads it once, when the table is
199
+ * created; give the table a new `key` to change it.
200
+ */
201
+ locale: {
202
+ type: String,
203
+ default: void 0
204
+ },
205
+ /** The host's words for what the table shows and announces, over the plugin's and English. */
206
+ messages: {
207
+ type: Object,
208
+ default: void 0
209
+ },
210
+ /**
211
+ * How search and text filters read text. Defaults to `foldText`: case, accents and Arabic
212
+ * letter shapes ignored. Read once, when the table is created.
213
+ */
214
+ normalizeText: {
215
+ type: Function,
216
+ default: void 0
217
+ },
191
218
  /** A CSS height that makes the body scroll, such as `"24rem"`. */
192
219
  maxHeight: {
193
220
  type: String,
@@ -197,9 +224,10 @@ const commonProps = {
197
224
  type: Boolean,
198
225
  default: true
199
226
  },
227
+ /** Defaults to the messages' `searchPlaceholder`. */
200
228
  searchPlaceholder: {
201
229
  type: String,
202
- default: "Search…"
230
+ default: void 0
203
231
  },
204
232
  columnToggle: {
205
233
  type: Boolean,
@@ -263,16 +291,18 @@ function editingOptions(props) {
263
291
  setParentKey: props.setParentKey
264
292
  };
265
293
  }
266
- const stateEmits = [
267
- "update:page",
268
- "update:pageSize",
269
- "update:sorting",
270
- "update:search",
271
- "update:filters",
272
- "update:hiddenColumns",
273
- "update:selected",
274
- "update:expanded"
275
- ];
294
+ /** The `v-model` events of table state, typed by the value each carries. */
295
+ const stateEmitValidators = {
296
+ "update:page": (_page) => true,
297
+ "update:pageSize": (_pageSize) => true,
298
+ "update:sorting": (_sorting) => true,
299
+ "update:search": (_search) => true,
300
+ "update:filters": (_filters) => true,
301
+ "update:hiddenColumns": (_hiddenColumns) => true,
302
+ "update:selected": (_selected) => true,
303
+ "update:expanded": (_expanded) => true
304
+ };
305
+ const stateEmits = Object.keys(stateEmitValidators);
276
306
  /** The state a parent controls through `v-model`, as a table state patch. */
277
307
  function controlledState(props, current) {
278
308
  return {
@@ -393,9 +423,10 @@ const VueyeGrid = defineComponent({
393
423
  type: Boolean,
394
424
  default: false
395
425
  },
426
+ /** The grid's accessible name. Defaults to the messages' `spreadsheet`. */
396
427
  label: {
397
428
  type: String,
398
- default: "Spreadsheet"
429
+ default: void 0
399
430
  },
400
431
  /** Show undo, redo, and CSV export buttons. */
401
432
  toolbar: {
@@ -405,7 +436,7 @@ const VueyeGrid = defineComponent({
405
436
  },
406
437
  emits: {
407
438
  ...editingEmits,
408
- ...Object.fromEntries(stateEmits.map((name) => [name, null])),
439
+ ...stateEmitValidators,
409
440
  "state-change": (_state) => true,
410
441
  "update:data": (_data) => true,
411
442
  edit: (_changes) => true,
@@ -415,6 +446,11 @@ const VueyeGrid = defineComponent({
415
446
  collapse: (_item, _row) => true
416
447
  },
417
448
  setup(props, { emit, slots, expose, attrs }) {
449
+ const inherited = useTableLocale();
450
+ const locale = provideTableLocale(() => ({
451
+ locale: props.locale,
452
+ messages: props.messages
453
+ }));
418
454
  const resolveColumns = createColumnResolver();
419
455
  let previousColumns;
420
456
  const columns = computed(() => {
@@ -448,6 +484,8 @@ const VueyeGrid = defineComponent({
448
484
  rowCount: () => props.rowCount,
449
485
  columns,
450
486
  rowKey: props.rowKey,
487
+ locale: props.locale ?? inherited().locale,
488
+ normalizeText: props.normalizeText,
451
489
  paginate: props.paginate ?? (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),
452
490
  selectionMode: "none",
453
491
  initialState: { pagination: initialPagination },
@@ -503,20 +541,20 @@ const VueyeGrid = defineComponent({
503
541
  "data-vt-theme": props.theme
504
542
  }, [
505
543
  props.toolbar || props.searchable || props.addRow ? h(VtToolbar, () => [
506
- props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,
507
- props.addRow ? button("Add row", false, () => {
544
+ props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder }) : null,
545
+ props.addRow ? button(locale().messages.addRow, false, () => {
508
546
  table.insertRows();
509
547
  }) : null,
510
548
  h("div", { class: "vt-toolbar-spacer" }),
511
549
  props.toolbar ? [
512
- button("Undo", !table.canUndo, () => table.undo()),
513
- button("Redo", !table.canRedo, () => table.redo()),
514
- button("Export CSV", false, () => emit("export", table.exportRows()))
550
+ button(locale().messages.undo, !table.canUndo, () => table.undo()),
551
+ button(locale().messages.redo, !table.canRedo, () => table.redo()),
552
+ button(locale().messages.exportCsv, false, () => emit("export", table.exportRows()))
515
553
  ] : null
516
554
  ]) : null,
517
555
  h(VtGrid, {
518
556
  table,
519
- label: props.label,
557
+ label: props.label ?? locale().messages.spreadsheet,
520
558
  "aria-describedby": attrs["aria-describedby"],
521
559
  rowNumbers: props.rowNumbers,
522
560
  rowActions: props.editable || props.removeRows,
@@ -583,12 +621,12 @@ const VueyeTable = defineComponent({
583
621
  /** Shown instead of the empty state while `loading` and there are no rows yet. */
584
622
  loadingText: {
585
623
  type: String,
586
- default: "Loading…"
624
+ default: void 0
587
625
  }
588
626
  },
589
627
  emits: {
590
628
  ...editingEmits,
591
- ...Object.fromEntries(stateEmits.map((name) => [name, null])),
629
+ ...stateEmitValidators,
592
630
  "state-change": (_state) => true,
593
631
  "row-click": (_item, _row) => true,
594
632
  expand: (_item, _row) => true,
@@ -596,6 +634,12 @@ const VueyeTable = defineComponent({
596
634
  },
597
635
  slots: Object,
598
636
  setup(props, { emit, slots, expose, attrs }) {
637
+ const inherited = useTableLocale();
638
+ const locale = provideTableLocale(() => ({
639
+ locale: props.locale,
640
+ messages: props.messages
641
+ }));
642
+ const loadingText = () => props.loadingText ?? locale().messages.loading;
599
643
  const selectionMode = computed(() => props.selectable === false ? "none" : props.selectable === "single" ? "single" : "multiple");
600
644
  const initialPagination = {
601
645
  page: props.page ?? 1,
@@ -612,6 +656,8 @@ const VueyeTable = defineComponent({
612
656
  endThreshold: props.endThreshold,
613
657
  columns: () => resolveColumns(props.columns, props.data),
614
658
  rowKey: props.rowKey,
659
+ locale: props.locale ?? inherited().locale,
660
+ normalizeText: props.normalizeText,
615
661
  manual: props.manual,
616
662
  paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),
617
663
  rowCount: () => props.rowCount,
@@ -672,7 +718,7 @@ const VueyeTable = defineComponent({
672
718
  const width = () => table.columns.length + (selectable() ? 1 : 0) + (hasDetails() ? 1 : 0) + (hasActions() ? 1 : 0);
673
719
  const emptyBody = () => {
674
720
  if (table.rows.length === 0) {
675
- 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" });
721
+ const content = busy() ? slots.loading?.({}) ?? h(VtEmpty, { text: loadingText() }) : slots.empty?.({}) ?? h(VtEmpty, { text: table.loadingMode && table.loadState === "error" ? locale().messages.couldNotLoadRows : locale().messages.noMatchingRows });
676
722
  return h("tr", { "data-empty": "" }, [h("td", { colspan: Math.max(1, width()) }, content)]);
677
723
  }
678
724
  return null;
@@ -710,24 +756,19 @@ const VueyeTable = defineComponent({
710
756
  $stable: true
711
757
  });
712
758
  const headerSlots = () => {
713
- const forwarded = {};
714
- for (const column of table.columns) {
715
- const slot = slots[`header.${column.id}`];
716
- if (slot) forwarded[`header.${column.id}`] = () => slot({ column });
717
- }
718
759
  return {
719
- ...forwarded,
760
+ header: (header) => slots[`header.${header.column.id}`]?.(header) ?? header.column.header,
720
761
  before: () => [
721
762
  hasActions() ? h("th", {
722
763
  class: "vt-row-controls",
723
764
  scope: "col",
724
765
  "aria-colindex": 1
725
- }, "Row actions") : null,
766
+ }, locale().messages.rowActions) : null,
726
767
  hasDetails() ? h("th", {
727
768
  class: "vt-expansion-cell",
728
769
  scope: "col",
729
770
  "aria-colindex": Number(hasActions()) + 1,
730
- "aria-label": "Details"
771
+ "aria-label": locale().messages.details
731
772
  }) : null,
732
773
  selectable() ? h("th", {
733
774
  class: "vt-selection-cell",
@@ -786,12 +827,12 @@ const VueyeTable = defineComponent({
786
827
  style: props.maxHeight ? { "--vt-max-height": props.maxHeight } : void 0
787
828
  }), [h("div", { class: "vt-root" }, [
788
829
  props.searchable || props.columnToggle || slots.toolbar || props.addRow ? h(VtToolbar, () => [
789
- props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,
830
+ props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder }) : null,
790
831
  props.addRow ? h("button", {
791
832
  type: "button",
792
833
  class: "vt-button",
793
834
  onClick: () => table.insertRows()
794
- }, "Add row") : null,
835
+ }, locale().messages.addRow) : null,
795
836
  h("div", { class: "vt-toolbar-spacer" }),
796
837
  slots.toolbar?.({ table }),
797
838
  props.columnToggle ? h(VtColumnVisibility) : null
@@ -802,7 +843,7 @@ const VueyeTable = defineComponent({
802
843
  }),
803
844
  tableContent(),
804
845
  props.pagination && (!props.virtual || table.paginate) || slots.footer || slots.status || table.tree || table.loadingMode ? h(VtToolbar, { class: "vt-footer" }, () => [
805
- h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : props.loading && table.rows.length === 0 ? { default: () => props.loadingText } : void 0),
846
+ h(VtStatus, null, slots.status ? { default: (status) => slots.status?.(status) } : props.loading && table.rows.length === 0 ? { default: () => loadingText() } : void 0),
806
847
  ...table.loadingMode ? [h(VtLoadMore)] : [],
807
848
  slots.footer?.({ table }),
808
849
  props.pagination && table.paginate && (!props.virtual || table.paginate) ? h("div", { class: "vt-footer-controls" }, [h(VtPageSize, { options: props.pageSizeOptions }), h(VtPagination)]) : null
@@ -819,10 +860,20 @@ const VueyeTable = defineComponent({
819
860
 
820
861
  //#endregion
821
862
  //#region src/plugin.ts
822
- /** Register `<VueyeTable>` and `<VueyeGrid>` globally. */
823
- const VueyeTablePlugin = { install(app) {
863
+ /**
864
+ * Register `<VueyeTable>` and `<VueyeGrid>` globally. A `locale` and `messages` given here are
865
+ * the default of every table in the application; a table's own props win over them.
866
+ */
867
+ const VueyeTablePlugin = { install(app, options) {
824
868
  app.component("VueyeTable", VueyeTable);
825
869
  app.component("VueyeGrid", VueyeGrid);
870
+ if (options?.locale !== void 0 || options?.messages !== void 0) {
871
+ const language = {
872
+ locale: options.locale,
873
+ messages: options.messages
874
+ };
875
+ app.provide(tableLocaleKey, () => language);
876
+ }
826
877
  } };
827
878
 
828
879
  //#endregion
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 type ExpandedState,\n type ExpandMode,\n type TreeOptions,\n type TableRow,\n type TableColumn,\n type TableOptions,\n type EditResult,\n type TableIssue,\n type CellChange,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport { hierarchyProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { TableSource, LoadMore } from \"@vueye-table/vue\";\nimport { defineComponent, type PropType, type VNodeChild } from \"vue\";\n\ninterface ContentProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly column: TableColumn<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly editable: boolean;\n}\n/** Isolate application cell slots from unrelated table/grid navigation updates. */\nexport const CellContent = defineComponent({\n name: \"VueyeCellContent\",\n props: {\n row: { type: Object as PropType<TableRow<unknown>>, required: true },\n column: { type: Object as PropType<TableColumn<unknown>>, required: true },\n value: { type: null as unknown as PropType<unknown>, required: true },\n display: { type: String, required: true },\n editable: { type: Boolean, default: false },\n render: { type: Function as PropType<(props: ContentProps) => VNodeChild>, required: true },\n },\n setup(props) {\n return () =>\n props.render({\n item: props.row.original,\n row: props.row,\n column: props.column,\n value: props.value,\n display: props.display,\n editable: props.editable,\n });\n },\n});\n\n/** Props both full components share. */\nexport const commonProps = {\n validateRow: { type: Function as PropType<TableOptions<any>[\"validateRow\"]>, default: undefined },\n asyncValidation: {\n type: String as PropType<\"held\" | \"optimistic\" | undefined>,\n default: undefined,\n },\n createRow: { type: Function as PropType<(() => any) | undefined>, default: undefined },\n setParentKey: {\n type: Function as PropType<TableOptions<any>[\"setParentKey\"]>,\n default: undefined,\n },\n addRow: { type: Boolean, default: false },\n removeRows: { type: Boolean, default: false },\n ...virtualProps,\n ...hierarchyProps,\n rowCanExpand: {\n type: Function as PropType<((row: any) => boolean) | undefined>,\n default: undefined,\n },\n expandMode: { type: String as PropType<ExpandMode>, default: \"multiple\" },\n expanded: { type: [Boolean, Array] as PropType<ExpandedState | undefined>, default: undefined },\n getChildren: { type: Function as PropType<TreeOptions<any>[\"getChildren\"]>, default: undefined },\n setChildren: { type: Function as PropType<TreeOptions<any>[\"setChildren\"]>, default: undefined },\n getParentKey: {\n type: Function as PropType<TreeOptions<any>[\"getParentKey\"]>,\n default: undefined,\n },\n hasChildren: { type: Function as PropType<TreeOptions<any>[\"hasChildren\"]>, default: undefined },\n loadChildren: {\n type: Function as PropType<TreeOptions<any, AbortSignal>[\"loadChildren\"]>,\n default: undefined,\n },\n treeFilter: { type: String as PropType<TreeOptions<unknown>[\"treeFilter\"]>, default: undefined },\n paginateBy: { type: String as PropType<TreeOptions<unknown>[\"paginateBy\"]>, default: undefined },\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 editingEmits = {\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n save: (_result: EditResult<unknown>) => true,\n cancel: (_key: RowKey) => true,\n \"edit-issues\": (_issues: readonly TableIssue[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n};\n\nexport function editingOptions(\n props: Pick<\n TableOptions<unknown>,\n \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"\n >,\n): Pick<TableOptions<unknown>, \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"> {\n return {\n validateRow: props.validateRow,\n asyncValidation: props.asyncValidation,\n createRow: props.createRow,\n setParentKey: props.setParentKey,\n };\n}\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 \"update:expanded\",\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 readonly expanded?: ExpandedState | 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 expanded: props.expanded,\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 if (state.expanded !== previous.expanded) emit(\"update:expanded\", state.expanded);\n}\n\nexport function expansionOptions(\n props: {\n readonly rowCanExpand: ((row: any) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n } & TreeOptions<unknown, AbortSignal>,\n detail: boolean,\n): Omit<TreeOptions<unknown, AbortSignal>, \"treeFilter\"> & {\n readonly treeFilter: () => TreeOptions<unknown>[\"treeFilter\"];\n readonly getRowCanExpand: ((row: unknown) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n} {\n return {\n getRowCanExpand: props.rowCanExpand ?? (detail ? () => true : undefined),\n expandMode: props.expandMode,\n getChildren: props.getChildren,\n setChildren: props.setChildren,\n getParentKey: props.getParentKey,\n hasChildren: props.hasChildren,\n loadChildren: props.loadChildren,\n treeFilter: () => props.treeFilter,\n paginateBy: props.paginateBy,\n };\n}\n\nexport function emitExpansionChanges(\n emit: {\n (event: \"expand\", item: unknown, row: TableRow<unknown>): void;\n (event: \"collapse\", item: unknown, row: TableRow<unknown>): void;\n },\n state: TableState,\n previous: TableState,\n table:\n | {\n readonly processedRows: readonly TableRow<unknown>[];\n getRow(key: RowKey): TableRow<unknown> | undefined;\n }\n | undefined,\n): void {\n if (!table || state.expanded === previous.expanded) return;\n const keys = new Set([\n ...table.processedRows.map((row) => row.key),\n ...(state.expanded === true ? [] : state.expanded),\n ...(previous.expanded === true ? [] : previous.expanded),\n ]);\n for (const key of keys) {\n const before = previous.expanded === true || previous.expanded.includes(key);\n const after = state.expanded === true || state.expanded.includes(key);\n const row = table.getRow(key);\n if (row?.canExpand && before !== after) {\n if (after) emit(\"expand\", row.original, row);\n else emit(\"collapse\", row.original, row);\n }\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 {\n CellChange,\n ColumnDef,\n TableIssue,\n TableState,\n TableRow,\n EditResult,\n} from \"@vueye-table/core\";\nimport type {\n GridCellSlotProps,\n TableStatusSlotProps,\n DetailSlotProps,\n CellEditorSlotProps,\n} 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 expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingOptions,\n editingEmits,\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 {\n [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown };\n [key: `editor.${string}`]: CellEditorSlotProps;\n } & {\n default?: (props: Record<string, unknown>) => VNode[];\n status?: (props: TableStatusSlotProps) => VNode[];\n expanded?: (props: DetailSlotProps) => 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 ...editingEmits,\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 expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n } as { [K in (typeof stateEmits)[number]]: null } & typeof editingEmits & {\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 expand: (item: unknown, row: TableRow<unknown>) => boolean;\n collapse: (item: unknown, row: TableRow<unknown>) => boolean;\n },\n setup(props, { emit, slots, expose, attrs }) {\n const resolveColumns = createColumnResolver();\n let previousColumns:\n | { source: readonly unknown[]; editable: boolean; columns: readonly ColumnDef<unknown>[] }\n | undefined;\n const columns = computed(() => {\n const source = resolveColumns(props.columns, props.data);\n if (previousColumns?.source === source && previousColumns.editable === props.editable)\n return previousColumns.columns;\n const resolved = source.map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n );\n previousColumns = { source, editable: props.editable, columns: resolved };\n return resolved;\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 ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\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 emit(\"edit-issues\", 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 emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\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 if (slots.expanded) forwarded[\"expanded\"] = slots.expanded;\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 ? h(CellContent, { ...cellProps, render: cellSlot }) : cellProps.display;\n } else if (name.startsWith(\"editor.\")) {\n forwarded[name] = slot;\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 || props.addRow\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n props.addRow\n ? button(\"Add row\", false, () => {\n table.insertRows();\n })\n : 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 rowActions: props.editable || props.removeRows,\n removable: props.removeRows,\n onSave: (result: unknown) => emit(\"save\", result as EditResult<unknown>),\n onCancel: (key: unknown) => emit(\"cancel\", key as string | number),\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 treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination || table.loadingMode || slots.status || table.tree\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, EditResult } 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 type DetailSlotProps,\n resolveTreeColumn,\n DataTableEditRoot,\n DataTableEditCell,\n type CellEditorSlotProps,\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 VtExpandToggle,\n VtTreeCell,\n VtRowActions,\n} from \"@vueye-table/styled\";\nimport { provideDataTable, useDataTable, type DataTableBinding } from \"@vueye-table/vue\";\nimport {\n computed,\n defineComponent,\n h,\n mergeProps,\n type PropType,\n type SlotsType,\n type VNodeChild,\n} from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmits,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingEmits,\n editingOptions,\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 inheritAttrs: false,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n editMode: { type: String as PropType<\"cell\" | \"row\" | undefined>, default: undefined },\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 ...editingEmits,\n ...Object.fromEntries(stateEmits.map((name) => [name, null])),\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n } as {\n [K in (typeof stateEmits)[number]]: null;\n } & typeof editingEmits & {\n \"state-change\": (state: TableState) => boolean;\n \"row-click\": (item: unknown, row: TableRow<unknown>) => boolean;\n expand: (item: unknown, row: TableRow<unknown>) => boolean;\n collapse: (item: unknown, row: TableRow<unknown>) => boolean;\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `editor.${string}`]: CellEditorSlotProps;\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 expanded: DetailSlotProps;\n }\n >,\n setup(props, { emit, slots, expose, attrs }) {\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 ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\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 onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onEditIssues(issues) {\n emit(\"edit-issues\", issues);\n emit(\"edit-error\", issues);\n },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\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 = (\n row: TableRow<unknown>,\n column: (typeof table.columns)[number],\n rowIndex: number,\n ): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n const treeCell = table.tree && column.id === resolveTreeColumn(table, props.treeColumn);\n return h(\n props.editMode ? DataTableEditCell : DataTableCell,\n {\n key: column.id,\n row,\n column,\n tree: false,\n ...(props.editMode\n ? {\n rowIndex,\n onSave: (result: EditResult<unknown>) => emit(\"save\", result),\n onCancel: (key: RowKey) => emit(\"cancel\", key),\n }\n : {}),\n },\n {\n editor: slots[`editor.${column.id}`],\n default: ({ value, display }: { value: unknown; display: string }) => {\n const content = () =>\n slot ? h(CellContent, { row, column, value, display, render: slot }) : display;\n return treeCell ? h(VtTreeCell, { row }, { default: content }) : content();\n },\n $stable: true,\n },\n );\n };\n\n const hasDetails = (): boolean => !!slots.expanded && !table.tree;\n const hasActions = (): boolean => !!props.editMode || props.removeRows;\n const leadingColumns = (): number =>\n Number(hasActions()) + Number(hasDetails()) + Number(selectable());\n const width = (): number =>\n table.columns.length +\n (selectable() ? 1 : 0) +\n (hasDetails() ? 1 : 0) +\n (hasActions() ? 1 : 0);\n const emptyBody = (): VNodeChild => {\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 null;\n };\n const cells = (row: TableRow<unknown>, rowIndex: number): VNodeChild[] => {\n const result = [\n hasActions()\n ? h(\n \"td\",\n {\n class: \"vt-row-controls\",\n \"aria-colindex\": 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [\n h(VtRowActions, {\n row,\n editable: props.editMode === \"row\",\n removable: props.removeRows,\n }),\n ],\n )\n : null,\n hasDetails()\n ? h(\"td\", { class: \"vt-expansion-cell\", \"aria-colindex\": Number(hasActions()) + 1 }, [\n h(VtExpandToggle, { row }),\n ])\n : null,\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column, rowIndex)),\n ];\n return result;\n };\n const bodyRow = ({ row, rowIndex }: DetailSlotProps): VNodeChild =>\n h(\n DataTableRow,\n { key: row.key, row, rowIndex, onClick: () => emit(\"row-click\", row.original, row) },\n { default: () => cells(row, rowIndex), $stable: true },\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 hasActions()\n ? h(\"th\", { class: \"vt-row-controls\", scope: \"col\", \"aria-colindex\": 1 }, \"Row actions\")\n : null,\n hasDetails()\n ? h(\"th\", {\n class: \"vt-expansion-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + 1,\n \"aria-label\": \"Details\",\n })\n : null,\n selectable()\n ? h(\n \"th\",\n {\n class: \"vt-selection-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n ],\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: width() },\n {\n ...(table.rows.length === 0 ? { default: emptyBody } : {}),\n row: bodyRow,\n detail: slots.expanded\n ? (detail: DetailSlotProps) => slots.expanded?.(detail)\n : undefined,\n },\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 leadingColumns: leadingColumns(),\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n DataTableRoot,\n {\n table,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n class: \"vt-table\",\n leadingColumns: leadingColumns(),\n \"aria-busy\": busy() ? \"true\" : undefined,\n },\n children,\n ),\n ]);\n };\n\n const surface = () =>\n h(\n \"div\",\n mergeProps(attrs, {\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 || props.addRow\n ? h(VtToolbar, () => [\n props.searchable ? h(VtSearch, { placeholder: props.searchPlaceholder }) : null,\n props.addRow\n ? h(\n \"button\",\n { type: \"button\", class: \"vt-button\", onClick: () => table.insertRows() },\n \"Add row\",\n )\n : 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.tree ||\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 return () =>\n props.editMode\n ? h(\n DataTableEditRoot,\n {\n table,\n mode: props.editMode,\n onSave: (result) => emit(\"save\", result),\n onCancel: (key) => emit(\"cancel\", key),\n },\n surface,\n )\n : surface();\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":";;;;;;;;;;;;;;;;AAkCA,MAAa,cAAc,gBAAgB;CACzC,MAAM;CACN,OAAO;EACL,KAAK;GAAE,MAAM;GAAuC,UAAU;EAAK;EACnE,QAAQ;GAAE,MAAM;GAA0C,UAAU;EAAK;EACzE,OAAO;GAAE,MAAM;GAAsC,UAAU;EAAK;EACpE,SAAS;GAAE,MAAM;GAAQ,UAAU;EAAK;EACxC,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,QAAQ;GAAE,MAAM;GAA2D,UAAU;EAAK;CAC5F;CACA,MAAM,OAAO;EACX,aACE,MAAM,OAAO;GACX,MAAM,MAAM,IAAI;GAChB,KAAK,MAAM;GACX,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,UAAU,MAAM;EAClB,CAAC;CACL;AACF,CAAC;;AAGD,MAAa,cAAc;CACzB,aAAa;EAAE,MAAM;EAAwD,SAAS;CAAU;CAChG,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;CACA,WAAW;EAAE,MAAM;EAA+C,SAAS;CAAU;CACrF,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,QAAQ;EAAE,MAAM;EAAS,SAAS;CAAM;CACxC,YAAY;EAAE,MAAM;EAAS,SAAS;CAAM;CAC5C,GAAG;CACH,GAAG;CACH,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,YAAY;EAAE,MAAM;EAAgC,SAAS;CAAW;CACxE,UAAU;EAAE,MAAM,CAAC,SAAS,KAAK;EAA0C,SAAS;CAAU;CAC9F,aAAa;EAAE,MAAM;EAAuD,SAAS;CAAU;CAC/F,aAAa;EAAE,MAAM;EAAuD,SAAS;CAAU;CAC/F,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,aAAa;EAAE,MAAM;EAAuD,SAAS;CAAU;CAC/F,cAAc;EACZ,M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W,IACrC,EAAE,eAAe,MAAM,YAAY,IACnC,MACR;IACA,GAAI,MAAM,cAAc,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAC3C,MAAM,SAAS,EAAE,MAAM,CAAC;IACxB,MAAM,cAAc,MAAM,aAAa,CAAC,MAAM,WAAW,MAAM,YAC3D,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;EACF,aACE,MAAM,WACF,EACE,mBACA;GACE;GACA,MAAM,MAAM;GACZ,SAAS,WAAW,KAAK,QAAQ,MAAM;GACvC,WAAW,QAAQ,KAAK,UAAU,GAAG;EACvC,GACA,OACF,IACA,QAAQ;CAChB;AACF,CAAC;;;;;ACtbD,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 type ExpandedState,\n type ExpandMode,\n type TreeOptions,\n type TableRow,\n type TableColumn,\n type TableOptions,\n type EditResult,\n type TableIssue,\n type CellChange,\n type TableMessages,\n type TextNormalizer,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport { hierarchyProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { TableSource, LoadMore } from \"@vueye-table/vue\";\nimport { defineComponent, type PropType, type VNodeChild } from \"vue\";\n\ninterface ContentProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly column: TableColumn<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly editable: boolean;\n}\n/** Isolate application cell slots from unrelated table/grid navigation updates. */\nexport const CellContent = defineComponent({\n name: \"VueyeCellContent\",\n props: {\n row: { type: Object as PropType<TableRow<unknown>>, required: true },\n column: { type: Object as PropType<TableColumn<unknown>>, required: true },\n value: { type: null as unknown as PropType<unknown>, required: true },\n display: { type: String, required: true },\n editable: { type: Boolean, default: false },\n render: { type: Function as PropType<(props: ContentProps) => VNodeChild>, required: true },\n },\n setup(props) {\n return () =>\n props.render({\n item: props.row.original,\n row: props.row,\n column: props.column,\n value: props.value,\n display: props.display,\n editable: props.editable,\n });\n },\n});\n\n/** Props both full components share. */\nexport const commonProps = {\n validateRow: { type: Function as PropType<TableOptions<any>[\"validateRow\"]>, default: undefined },\n asyncValidation: {\n type: String as PropType<\"held\" | \"optimistic\" | undefined>,\n default: undefined,\n },\n createRow: { type: Function as PropType<(() => any) | undefined>, default: undefined },\n setParentKey: {\n type: Function as PropType<TableOptions<any>[\"setParentKey\"]>,\n default: undefined,\n },\n addRow: { type: Boolean, default: false },\n removeRows: { type: Boolean, default: false },\n ...virtualProps,\n ...hierarchyProps,\n rowCanExpand: {\n type: Function as PropType<((row: any) => boolean) | undefined>,\n default: undefined,\n },\n expandMode: { type: String as PropType<ExpandMode>, default: \"multiple\" },\n expanded: { type: [Boolean, Array] as PropType<ExpandedState | undefined>, default: undefined },\n getChildren: { type: Function as PropType<TreeOptions<any>[\"getChildren\"]>, default: undefined },\n setChildren: { type: Function as PropType<TreeOptions<any>[\"setChildren\"]>, default: undefined },\n getParentKey: {\n type: Function as PropType<TreeOptions<any>[\"getParentKey\"]>,\n default: undefined,\n },\n hasChildren: { type: Function as PropType<TreeOptions<any>[\"hasChildren\"]>, default: undefined },\n loadChildren: {\n type: Function as PropType<TreeOptions<any, AbortSignal>[\"loadChildren\"]>,\n default: undefined,\n },\n treeFilter: { type: String as PropType<TreeOptions<unknown>[\"treeFilter\"]>, default: undefined },\n paginateBy: { type: String as PropType<TreeOptions<unknown>[\"paginateBy\"]>, default: undefined },\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 /**\n * `\"light\"` or `\"dark\"` forces a palette; by default the table follows `prefers-color-scheme`.\n * `\"inherit\"` uses no built-in palette: the host declares the `--vt-*` tokens on an ancestor,\n * in its own light and dark themes.\n */\n theme: { type: String as PropType<\"light\" | \"dark\" | \"inherit\">, default: undefined },\n /**\n * The BCP 47 locale numbers are written and text is ordered in, such as `\"fr\"` or `\"ar-DZ\"`.\n * Defaults to the plugin's, then the runtime's. Ordering reads it once, when the table is\n * created; give the table a new `key` to change it.\n */\n locale: { type: String as PropType<string | undefined>, default: undefined },\n /** The host's words for what the table shows and announces, over the plugin's and English. */\n messages: { type: Object as PropType<Partial<TableMessages> | undefined>, default: undefined },\n /**\n * How search and text filters read text. Defaults to `foldText`: case, accents and Arabic\n * letter shapes ignored. Read once, when the table is created.\n */\n normalizeText: { type: Function as PropType<TextNormalizer | undefined>, 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 /** Defaults to the messages' `searchPlaceholder`. */\n searchPlaceholder: { type: String as PropType<string | undefined>, default: undefined },\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 editingEmits = {\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n save: (_result: EditResult<unknown>) => true,\n cancel: (_key: RowKey) => true,\n \"edit-issues\": (_issues: readonly TableIssue[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n};\n\nexport function editingOptions(\n props: Pick<\n TableOptions<unknown>,\n \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"\n >,\n): Pick<TableOptions<unknown>, \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"> {\n return {\n validateRow: props.validateRow,\n asyncValidation: props.asyncValidation,\n createRow: props.createRow,\n setParentKey: props.setParentKey,\n };\n}\n\n/** The `v-model` events of table state, typed by the value each carries. */\nexport const stateEmitValidators = {\n \"update:page\": (_page: number) => true,\n \"update:pageSize\": (_pageSize: number) => true,\n \"update:sorting\": (_sorting: readonly SortRule[]) => true,\n \"update:search\": (_search: string) => true,\n \"update:filters\": (_filters: Readonly<Record<string, unknown>>) => true,\n \"update:hiddenColumns\": (_hiddenColumns: readonly string[]) => true,\n \"update:selected\": (_selected: readonly RowKey[]) => true,\n \"update:expanded\": (_expanded: ExpandedState) => true,\n};\n\nexport const stateEmits = Object.keys(\n stateEmitValidators,\n) as readonly (keyof typeof stateEmitValidators)[];\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 readonly expanded?: ExpandedState | 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 expanded: props.expanded,\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 if (state.expanded !== previous.expanded) emit(\"update:expanded\", state.expanded);\n}\n\nexport function expansionOptions(\n props: {\n readonly rowCanExpand: ((row: any) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n } & TreeOptions<unknown, AbortSignal>,\n detail: boolean,\n): Omit<TreeOptions<unknown, AbortSignal>, \"treeFilter\"> & {\n readonly treeFilter: () => TreeOptions<unknown>[\"treeFilter\"];\n readonly getRowCanExpand: ((row: unknown) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n} {\n return {\n getRowCanExpand: props.rowCanExpand ?? (detail ? () => true : undefined),\n expandMode: props.expandMode,\n getChildren: props.getChildren,\n setChildren: props.setChildren,\n getParentKey: props.getParentKey,\n hasChildren: props.hasChildren,\n loadChildren: props.loadChildren,\n treeFilter: () => props.treeFilter,\n paginateBy: props.paginateBy,\n };\n}\n\nexport function emitExpansionChanges(\n emit: {\n (event: \"expand\", item: unknown, row: TableRow<unknown>): void;\n (event: \"collapse\", item: unknown, row: TableRow<unknown>): void;\n },\n state: TableState,\n previous: TableState,\n table:\n | {\n readonly processedRows: readonly TableRow<unknown>[];\n getRow(key: RowKey): TableRow<unknown> | undefined;\n }\n | undefined,\n): void {\n if (!table || state.expanded === previous.expanded) return;\n const keys = new Set([\n ...table.processedRows.map((row) => row.key),\n ...(state.expanded === true ? [] : state.expanded),\n ...(previous.expanded === true ? [] : previous.expanded),\n ]);\n for (const key of keys) {\n const before = previous.expanded === true || previous.expanded.includes(key);\n const after = state.expanded === true || state.expanded.includes(key);\n const row = table.getRow(key);\n if (row?.canExpand && before !== after) {\n if (after) emit(\"expand\", row.original, row);\n else emit(\"collapse\", row.original, row);\n }\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 {\n CellChange,\n ColumnDef,\n TableIssue,\n TableState,\n TableRow,\n EditResult,\n} from \"@vueye-table/core\";\nimport type {\n GridCellSlotProps,\n TableStatusSlotProps,\n DetailSlotProps,\n CellEditorSlotProps,\n} 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 {\n provideDataTable,\n provideTableLocale,\n useDataTable,\n useTableLocale,\n type DataTableBinding,\n} 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 stateEmitValidators,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingOptions,\n editingEmits,\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 {\n [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown };\n [key: `editor.${string}`]: CellEditorSlotProps;\n } & {\n default?: (props: Record<string, unknown>) => VNode[];\n status?: (props: TableStatusSlotProps) => VNode[];\n expanded?: (props: DetailSlotProps) => 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 /** The grid's accessible name. Defaults to the messages' `spreadsheet`. */\n label: { type: String as PropType<string | undefined>, default: undefined },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...editingEmits,\n ...stateEmitValidators,\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 expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n },\n setup(props, { emit, slots, expose, attrs }) {\n const inherited = useTableLocale();\n const locale = provideTableLocale(() => ({ locale: props.locale, messages: props.messages }));\n const resolveColumns = createColumnResolver();\n let previousColumns:\n | { source: readonly unknown[]; editable: boolean; columns: readonly ColumnDef<unknown>[] }\n | undefined;\n const columns = computed(() => {\n const source = resolveColumns(props.columns, props.data);\n if (previousColumns?.source === source && previousColumns.editable === props.editable)\n return previousColumns.columns;\n const resolved = source.map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n );\n previousColumns = { source, editable: props.editable, columns: resolved };\n return resolved;\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 ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\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 locale: props.locale ?? inherited().locale,\n normalizeText: props.normalizeText,\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 emit(\"edit-issues\", 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 emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\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 if (slots.expanded) forwarded[\"expanded\"] = slots.expanded;\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 ? h(CellContent, { ...cellProps, render: cellSlot }) : cellProps.display;\n } else if (name.startsWith(\"editor.\")) {\n forwarded[name] = slot;\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 || props.addRow\n ? h(VtToolbar, () => [\n props.searchable\n ? h(VtSearch, {\n placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder,\n })\n : null,\n props.addRow\n ? button(locale().messages.addRow, false, () => {\n table.insertRows();\n })\n : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(locale().messages.undo, !table.canUndo, () => table.undo()),\n button(locale().messages.redo, !table.canRedo, () => table.redo()),\n button(locale().messages.exportCsv, false, () =>\n emit(\"export\", table.exportRows()),\n ),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label ?? locale().messages.spreadsheet,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n rowActions: props.editable || props.removeRows,\n removable: props.removeRows,\n onSave: (result: unknown) => emit(\"save\", result as EditResult<unknown>),\n onCancel: (key: unknown) => emit(\"cancel\", key as string | number),\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 treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination || table.loadingMode || slots.status || table.tree\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 {\n ColumnDef,\n RowKey,\n SortInfo,\n TableRow,\n TableState,\n EditResult,\n} 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 type DetailSlotProps,\n resolveTreeColumn,\n DataTableEditRoot,\n DataTableEditCell,\n type CellEditorSlotProps,\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 VtExpandToggle,\n VtTreeCell,\n VtRowActions,\n} from \"@vueye-table/styled\";\nimport {\n provideDataTable,\n provideTableLocale,\n useDataTable,\n useTableLocale,\n type DataTableBinding,\n} from \"@vueye-table/vue\";\nimport {\n computed,\n defineComponent,\n h,\n mergeProps,\n type PropType,\n type SlotsType,\n type VNodeChild,\n} from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmitValidators,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingEmits,\n editingOptions,\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/**\n * What a `<VueyeTable>` exposes on its template ref: the table binding, with every snapshot field\n * and operation. `useTemplateRef<VueyeTableExposed>(\"table\")` reads it typed.\n */\nexport interface VueyeTableExposed {\n readonly table: DataTableBinding<unknown>;\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport type StatusSlotProps = TableStatusSlotProps;\n\n/**\n * Slot props of `header.<column id>`. The slot fills the header cell; on a sortable column it sits\n * inside the sort button, so the header still sorts on click and shows its indicator.\n */\nexport interface HeaderSlotProps {\n readonly column: { readonly id: string; readonly header: string };\n readonly sort: SortInfo | undefined;\n readonly toggleSort: (multi?: boolean) => void;\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 inheritAttrs: false,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n editMode: { type: String as PropType<\"cell\" | \"row\" | undefined>, default: undefined },\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 as PropType<string | undefined>, default: undefined },\n },\n emits: {\n ...editingEmits,\n ...stateEmitValidators,\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `editor.${string}`]: CellEditorSlotProps;\n [key: `header.${string}`]: HeaderSlotProps;\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n expanded: DetailSlotProps;\n }\n >,\n setup(props, { emit, slots, expose, attrs }) {\n const inherited = useTableLocale();\n const locale = provideTableLocale(() => ({ locale: props.locale, messages: props.messages }));\n const loadingText = (): string => props.loadingText ?? locale().messages.loading;\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 ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\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 locale: props.locale ?? inherited().locale,\n normalizeText: props.normalizeText,\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 onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onEditIssues(issues) {\n emit(\"edit-issues\", issues);\n emit(\"edit-error\", issues);\n },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table } satisfies VueyeTableExposed);\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 = (\n row: TableRow<unknown>,\n column: (typeof table.columns)[number],\n rowIndex: number,\n ): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n const treeCell = table.tree && column.id === resolveTreeColumn(table, props.treeColumn);\n return h(\n props.editMode ? DataTableEditCell : DataTableCell,\n {\n key: column.id,\n row,\n column,\n tree: false,\n ...(props.editMode\n ? {\n rowIndex,\n onSave: (result: EditResult<unknown>) => emit(\"save\", result),\n onCancel: (key: RowKey) => emit(\"cancel\", key),\n }\n : {}),\n },\n {\n editor: slots[`editor.${column.id}`],\n default: ({ value, display }: { value: unknown; display: string }) => {\n const content = () =>\n slot ? h(CellContent, { row, column, value, display, render: slot }) : display;\n return treeCell ? h(VtTreeCell, { row }, { default: content }) : content();\n },\n $stable: true,\n },\n );\n };\n\n const hasDetails = (): boolean => !!slots.expanded && !table.tree;\n const hasActions = (): boolean => !!props.editMode || props.removeRows;\n const leadingColumns = (): number =>\n Number(hasActions()) + Number(hasDetails()) + Number(selectable());\n const width = (): number =>\n table.columns.length +\n (selectable() ? 1 : 0) +\n (hasDetails() ? 1 : 0) +\n (hasActions() ? 1 : 0);\n const emptyBody = (): VNodeChild => {\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: loadingText() }))\n : (slots.empty?.({}) ??\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"error\"\n ? locale().messages.couldNotLoadRows\n : locale().messages.noMatchingRows,\n }));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width()) }, content)]);\n }\n return null;\n };\n const cells = (row: TableRow<unknown>, rowIndex: number): VNodeChild[] => {\n const result = [\n hasActions()\n ? h(\n \"td\",\n {\n class: \"vt-row-controls\",\n \"aria-colindex\": 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [\n h(VtRowActions, {\n row,\n editable: props.editMode === \"row\",\n removable: props.removeRows,\n }),\n ],\n )\n : null,\n hasDetails()\n ? h(\"td\", { class: \"vt-expansion-cell\", \"aria-colindex\": Number(hasActions()) + 1 }, [\n h(VtExpandToggle, { row }),\n ])\n : null,\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column, rowIndex)),\n ];\n return result;\n };\n const bodyRow = ({ row, rowIndex }: DetailSlotProps): VNodeChild =>\n h(\n DataTableRow,\n { key: row.key, row, rowIndex, onClick: () => emit(\"row-click\", row.original, row) },\n { default: () => cells(row, rowIndex), $stable: true },\n );\n\n const headerSlots = () => {\n return {\n header: (header: HeaderSlotProps) =>\n slots[`header.${header.column.id}`]?.(header) ?? header.column.header,\n before: () => [\n hasActions()\n ? h(\n \"th\",\n { class: \"vt-row-controls\", scope: \"col\", \"aria-colindex\": 1 },\n locale().messages.rowActions,\n )\n : null,\n hasDetails()\n ? h(\"th\", {\n class: \"vt-expansion-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + 1,\n \"aria-label\": locale().messages.details,\n })\n : null,\n selectable()\n ? h(\n \"th\",\n {\n class: \"vt-selection-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n ],\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: width() },\n {\n ...(table.rows.length === 0 ? { default: emptyBody } : {}),\n row: bodyRow,\n detail: slots.expanded\n ? (detail: DetailSlotProps) => slots.expanded?.(detail)\n : undefined,\n },\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 leadingColumns: leadingColumns(),\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n DataTableRoot,\n {\n table,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n class: \"vt-table\",\n leadingColumns: leadingColumns(),\n \"aria-busy\": busy() ? \"true\" : undefined,\n },\n children,\n ),\n ]);\n };\n\n const surface = () =>\n h(\n \"div\",\n mergeProps(attrs, {\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 || props.addRow\n ? h(VtToolbar, () => [\n props.searchable\n ? h(VtSearch, {\n placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder,\n })\n : null,\n props.addRow\n ? h(\n \"button\",\n { type: \"button\", class: \"vt-button\", onClick: () => table.insertRows() },\n locale().messages.addRow,\n )\n : 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.tree ||\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: () => 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 return () =>\n props.editMode\n ? h(\n DataTableEditRoot,\n {\n table,\n mode: props.editMode,\n onSave: (result) => emit(\"save\", result),\n onCancel: (key) => emit(\"cancel\", key),\n },\n surface,\n )\n : surface();\n },\n});\n","import { tableLocaleKey, type TableLocaleOptions } from \"@vueye-table/vue\";\nimport type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Options of `VueyeTablePlugin`: the application's language, which every table speaks. */\nexport type VueyeTablePluginOptions = TableLocaleOptions;\n\n/**\n * Register `<VueyeTable>` and `<VueyeGrid>` globally. A `locale` and `messages` given here are\n * the default of every table in the application; a table's own props win over them.\n */\nexport const VueyeTablePlugin: Plugin<[VueyeTablePluginOptions?]> = {\n install(app: App, options?: VueyeTablePluginOptions): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n if (options?.locale !== undefined || options?.messages !== undefined) {\n const language: TableLocaleOptions = { locale: options.locale, messages: options.messages };\n app.provide(tableLocaleKey, () => language);\n }\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAa,cAAc,gBAAgB;CACzC,MAAM;CACN,OAAO;EACL,KAAK;GAAE,MAAM;GAAuC,UAAU;EAAK;EACnE,QAAQ;GAAE,MAAM;GAA0C,UAAU;EAAK;EACzE,OAAO;GAAE,MAAM;GAAsC,UAAU;EAAK;EACpE,SAAS;GAAE,MAAM;GAAQ,UAAU;EAAK;EACxC,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,QAAQ;GAAE,MAAM;GAA2D,UAAU;EAAK;CAC5F;CACA,MAAM,OAAO;EACX,aACE,MAAM,OAAO;GACX,MAAM,MAAM,IAAI;GAChB,KAAK,MAAM;GACX,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,UAAU,MAAM;EAClB,CAAC;CACL;AACF,CAAC;;AAGD,MAAa,cAAc;CACzB,aAAa;EAAE,MAAM;EAAwD,SAAS;CAAU;CAChG,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;CACA,WAAW;EAAE,MAAM;EAA+C,SAAS;CAAU;CACrF,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,QAAQ;EAAE,MAAM;EAAS,SAAS;CAAM;CACxC,YAAY;EAAE,MAAM;EAAS,SAAS;CAAM;CAC5C,GAAG;CACH,GAAG;CACH,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,YAAY;EAAE,MAAM;EAAgC,SAAS;CAAW;CACxE,UAAU;EAAE,MAAM,CAAC,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AE,OAAO,qBAAqB,GAAG,CACxC,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;EACF,aACE,MAAM,WACF,EACE,mBACA;GACE;GACA,MAAM,MAAM;GACZ,SAAS,WAAW,KAAK,QAAQ,MAAM;GACvC,WAAW,QAAQ,KAAK,UAAU,GAAG;EACvC,GACA,OACF,IACA,QAAQ;CAChB;AACF,CAAC;;;;;;;;AC9cD,MAAa,mBAAuD,EAClE,QAAQ,KAAU,SAAyC;CACzD,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;CACpC,IAAI,SAAS,WAAW,UAAa,SAAS,aAAa,QAAW;EACpE,MAAM,WAA+B;GAAE,QAAQ,QAAQ;GAAQ,UAAU,QAAQ;EAAS;EAC1F,IAAI,QAAQ,sBAAsB,QAAQ;CAC5C;AACF,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueye-table",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
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-beta.1",
46
- "@vueye-table/headless": "3.0.0-beta.1",
47
- "@vueye-table/vue": "3.0.0-beta.1",
48
- "@vueye-table/styled": "3.0.0-beta.1"
45
+ "@vueye-table/headless": "3.0.0-beta.2",
46
+ "@vueye-table/vue": "3.0.0-beta.2",
47
+ "@vueye-table/core": "3.0.0-beta.2",
48
+ "@vueye-table/styled": "3.0.0-beta.2"
49
49
  },
50
50
  "devDependencies": {
51
51
  "vue": "3.5.43",