@coreui/data-grid 0.1.0-rc.0 → 0.3.0-rc.0

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.
Files changed (166) hide show
  1. package/README.md +9 -6
  2. package/dist/css/data-grid.css +156 -38
  3. package/dist/css/data-grid.css.map +1 -1
  4. package/dist/css/data-grid.min.css +2 -2
  5. package/dist/css/data-grid.min.css.map +1 -1
  6. package/dist/css/data-grid.standalone.css +1066 -0
  7. package/dist/css/data-grid.standalone.css.map +1 -0
  8. package/dist/css/data-grid.standalone.min.css +5 -0
  9. package/dist/css/data-grid.standalone.min.css.map +1 -0
  10. package/dist/js/clipboard.cjs +56 -0
  11. package/dist/js/clipboard.cjs.map +1 -0
  12. package/dist/js/clipboard.mjs +54 -0
  13. package/dist/js/clipboard.mjs.map +1 -0
  14. package/dist/js/csv.cjs +36 -59
  15. package/dist/js/csv.cjs.map +1 -1
  16. package/dist/js/csv.mjs +35 -55
  17. package/dist/js/csv.mjs.map +1 -1
  18. package/dist/js/data-grid.esm.js +14108 -9331
  19. package/dist/js/data-grid.esm.js.map +1 -1
  20. package/dist/js/data-grid.esm.min.js +6 -6
  21. package/dist/js/data-grid.esm.min.js.map +1 -1
  22. package/dist/js/data-grid.js +14408 -9634
  23. package/dist/js/data-grid.js.map +1 -1
  24. package/dist/js/data-grid.lite.esm.js +10507 -0
  25. package/dist/js/data-grid.lite.esm.js.map +1 -0
  26. package/dist/js/data-grid.lite.esm.min.js +8 -0
  27. package/dist/js/data-grid.lite.esm.min.js.map +1 -0
  28. package/dist/js/data-grid.lite.js +10520 -0
  29. package/dist/js/data-grid.lite.js.map +1 -0
  30. package/dist/js/data-grid.lite.min.js +8 -0
  31. package/dist/js/data-grid.lite.min.js.map +1 -0
  32. package/dist/js/data-grid.lite.mjs +10507 -0
  33. package/dist/js/data-grid.lite.mjs.map +1 -0
  34. package/dist/js/data-grid.min.js +6 -6
  35. package/dist/js/data-grid.min.js.map +1 -1
  36. package/dist/js/data-grid.mjs +14108 -9331
  37. package/dist/js/data-grid.mjs.map +1 -1
  38. package/dist/js/direction.cjs +26 -0
  39. package/dist/js/direction.cjs.map +1 -0
  40. package/dist/js/direction.mjs +24 -0
  41. package/dist/js/direction.mjs.map +1 -0
  42. package/dist/js/drag.cjs +467 -0
  43. package/dist/js/drag.cjs.map +1 -0
  44. package/dist/js/drag.mjs +464 -0
  45. package/dist/js/drag.mjs.map +1 -0
  46. package/dist/js/export-table-BdabEbJG.mjs +26 -0
  47. package/dist/js/export-table-BdabEbJG.mjs.map +1 -0
  48. package/dist/js/export-table-D762wrZ1.cjs +55 -0
  49. package/dist/js/export-table-D762wrZ1.cjs.map +1 -0
  50. package/dist/js/filters.cjs +89 -132
  51. package/dist/js/filters.cjs.map +1 -1
  52. package/dist/js/filters.mjs +88 -128
  53. package/dist/js/filters.mjs.map +1 -1
  54. package/dist/js/labels.cjs +65 -70
  55. package/dist/js/labels.cjs.map +1 -1
  56. package/dist/js/labels.mjs +64 -66
  57. package/dist/js/labels.mjs.map +1 -1
  58. package/dist/js/print.cjs +66 -0
  59. package/dist/js/print.cjs.map +1 -0
  60. package/dist/js/print.mjs +64 -0
  61. package/dist/js/print.mjs.map +1 -0
  62. package/dist/js/validate.cjs +43 -0
  63. package/dist/js/validate.cjs.map +1 -0
  64. package/dist/js/validate.mjs +42 -0
  65. package/dist/js/validate.mjs.map +1 -0
  66. package/dist/js/xlsx.cjs +240 -0
  67. package/dist/js/xlsx.cjs.map +1 -0
  68. package/dist/js/xlsx.mjs +238 -0
  69. package/dist/js/xlsx.mjs.map +1 -0
  70. package/dist/types/base-component.d.ts +28 -18
  71. package/dist/types/data-grid.d.ts +26 -13
  72. package/dist/types/dom/data.d.ts +15 -0
  73. package/dist/types/dom/event-handler.d.ts +21 -10
  74. package/dist/types/dom/manipulator.d.ts +15 -8
  75. package/dist/types/engine/active-cell.d.ts +1 -0
  76. package/dist/types/engine/data-source.d.ts +1 -1
  77. package/dist/types/engine/features-lite.d.ts +25 -0
  78. package/dist/types/engine/features.d.ts +35 -0
  79. package/dist/types/engine/table.d.ts +3 -3
  80. package/dist/types/engine/validate.d.mts +1 -0
  81. package/dist/types/engine/validate.d.ts +20 -0
  82. package/dist/types/engine/virtualizer.d.ts +2 -0
  83. package/dist/types/icons.d.ts +6 -4
  84. package/dist/types/index-lite.d.mts +1 -0
  85. package/dist/types/index-lite.d.ts +19 -0
  86. package/dist/types/index.d.ts +11 -2
  87. package/dist/types/types.d.ts +53 -31
  88. package/dist/types/ui/body.d.ts +6 -3
  89. package/dist/types/ui/header.d.ts +3 -2
  90. package/dist/types/ui/loading.d.ts +1 -1
  91. package/dist/types/ui/pinning.d.ts +1 -1
  92. package/dist/types/ui/toolbar.d.ts +10 -2
  93. package/dist/types/util/clipboard.d.mts +1 -0
  94. package/dist/types/util/clipboard.d.ts +29 -0
  95. package/dist/types/util/config.d.ts +27 -10
  96. package/dist/types/util/csv.d.ts +5 -5
  97. package/dist/types/util/direction.d.mts +1 -0
  98. package/dist/types/util/direction.d.ts +17 -0
  99. package/dist/types/util/drag.d.mts +1 -0
  100. package/dist/types/util/drag.d.ts +48 -0
  101. package/dist/types/util/export-table.d.ts +47 -0
  102. package/dist/types/util/index.d.ts +66 -10
  103. package/dist/types/util/print.d.mts +1 -0
  104. package/dist/types/util/print.d.ts +32 -0
  105. package/dist/types/util/sanitizer.d.ts +15 -11
  106. package/dist/types/util/xlsx.d.mts +1 -0
  107. package/dist/types/util/xlsx.d.ts +17 -0
  108. package/dist/types/util/zip.d.ts +11 -0
  109. package/package.json +101 -10
  110. package/scss/_base.scss +13 -0
  111. package/scss/_config.scss +14 -0
  112. package/scss/_functions.scss +1 -0
  113. package/scss/_mixins.scss +1 -0
  114. package/scss/base/_buttons.scss +113 -0
  115. package/scss/base/_forms.scss +157 -0
  116. package/scss/base/_helpers.scss +24 -0
  117. package/scss/base/_pagination.scss +100 -0
  118. package/scss/base/_reboot.scss +93 -0
  119. package/scss/base/_root.scss +85 -0
  120. package/scss/base/_spinner.scss +45 -0
  121. package/scss/base/_table.scss +78 -0
  122. package/scss/components/_data-grid.scss +807 -0
  123. package/scss/data-grid.scss +7 -555
  124. package/scss/data-grid.standalone.scss +16 -0
  125. package/scss/functions/_defaults.scss +25 -0
  126. package/scss/mixins/_tokens.scss +12 -0
  127. package/src/{base-component.js → base-component.ts} +21 -17
  128. package/src/data-grid.ts +523 -201
  129. package/src/dom/{data.js → data.ts} +13 -10
  130. package/src/dom/event-handler.ts +380 -0
  131. package/src/dom/{manipulator.js → manipulator.ts} +11 -11
  132. package/src/engine/active-cell.ts +10 -3
  133. package/src/engine/data-source.ts +7 -3
  134. package/src/engine/features-lite.ts +47 -0
  135. package/src/engine/features.ts +68 -0
  136. package/src/engine/table.ts +86 -45
  137. package/src/engine/validate.ts +64 -0
  138. package/src/engine/virtualizer.ts +17 -1
  139. package/src/icons.ts +11 -5
  140. package/src/index-lite.ts +85 -0
  141. package/src/index.ts +30 -2
  142. package/src/labels.ts +6 -4
  143. package/src/types.ts +87 -32
  144. package/src/ui/body.ts +73 -17
  145. package/src/ui/header.ts +51 -26
  146. package/src/ui/loading.ts +2 -2
  147. package/src/ui/pinning.ts +16 -16
  148. package/src/ui/toolbar.ts +27 -3
  149. package/src/util/clipboard.ts +112 -0
  150. package/src/util/{config.js → config.ts} +25 -11
  151. package/src/util/csv.ts +11 -30
  152. package/src/util/direction.ts +37 -0
  153. package/src/util/drag.ts +832 -0
  154. package/src/util/export-table.ts +86 -0
  155. package/src/util/{index.js → index.ts} +55 -35
  156. package/src/util/print.ts +125 -0
  157. package/src/util/{sanitizer.js → sanitizer.ts} +17 -13
  158. package/src/util/xlsx.ts +183 -0
  159. package/src/util/zip.ts +170 -0
  160. package/src/base-component.d.ts +0 -19
  161. package/src/dom/event-handler.d.ts +0 -11
  162. package/src/dom/event-handler.js +0 -331
  163. package/src/dom/manipulator.d.ts +0 -9
  164. package/src/util/config.d.ts +0 -11
  165. package/src/util/index.d.ts +0 -10
  166. package/src/util/sanitizer.d.ts +0 -11
@@ -4,16 +4,17 @@
4
4
  * License (https://coreui.io/pro/license/)
5
5
  * --------------------------------------------------------------------------
6
6
  */
7
- import type { Table } from '@tanstack/table-core';
8
7
  import BaseComponent from './base-component.js';
9
- import type { DataGridItem, DataGridOptions, DataGridState } from './types';
8
+ import type { ComponentConfig } from './util/config.js';
9
+ import type { DataGridFeatures, DataGridItem, DataGridOptions, DataGridState, DataGridTable, TableFeatures } from './types';
10
10
  import { type CsvDownloadOptions, type CsvOptions } from './util/csv';
11
11
  /**
12
12
  * Class definition
13
13
  */
14
- declare class DataGrid extends BaseComponent {
14
+ declare class DataGrid<TFeatures extends TableFeatures = DataGridFeatures> extends BaseComponent {
15
15
  _config: DataGridOptions;
16
16
  private _table;
17
+ private _unsubscribeState;
17
18
  private _scheduler;
18
19
  private _virtualizer;
19
20
  private _header;
@@ -23,7 +24,11 @@ declare class DataGrid extends BaseComponent {
23
24
  private _emptySlot;
24
25
  private _dataSource;
25
26
  private _loading;
27
+ private _loadingMore;
26
28
  private _loadFailed;
29
+ private _loadedItems;
30
+ private _loadMorePending;
31
+ private _pageResetPending;
27
32
  private _dataVersion;
28
33
  private _viewportElement;
29
34
  private _tableElement;
@@ -42,20 +47,20 @@ declare class DataGrid extends BaseComponent {
42
47
  private _editorErrorElement;
43
48
  private _editorFocusPending;
44
49
  private _columnsByKey;
45
- private _dragColumn;
50
+ private _columnDrag;
51
+ private _rowDrag;
46
52
  private _menu;
47
53
  private _tooltip;
48
54
  private _filterMenu;
49
55
  private _columnChooser;
50
56
  private _toolbarConfig;
51
- constructor(element: Element | string, config?: Partial<DataGridOptions>);
52
- get table(): Table<DataGridItem>;
57
+ constructor(element: Element | string, config?: Partial<DataGridOptions<TFeatures>>);
58
+ get table(): DataGridTable<TFeatures>;
53
59
  static get Default(): DataGridOptions;
54
60
  static get DefaultType(): Record<string, string>;
55
61
  static get NAME(): string;
56
- static getInstance(element: Element | string | null): DataGrid | null;
57
- static getOrCreateInstance(element: Element | string, config?: Partial<DataGridOptions>): DataGrid;
58
62
  getSelectedItems(): DataGridItem[];
63
+ print(): void;
59
64
  getCsv(options?: CsvOptions): string;
60
65
  downloadCsv(options?: CsvDownloadOptions): void;
61
66
  getState(): DataGridState;
@@ -64,9 +69,9 @@ declare class DataGrid extends BaseComponent {
64
69
  redo(): void;
65
70
  private _applyHistoryEntry;
66
71
  setItems(items: DataGridItem[]): void;
67
- update(config: Partial<DataGridOptions>): void;
72
+ update(config: Partial<DataGridOptions<TFeatures>>): void;
68
73
  dispose(): void;
69
- _configAfterMerge(config: DataGridOptions): DataGridOptions;
74
+ _configAfterMerge(config: ComponentConfig): ComponentConfig;
70
75
  private _createTable;
71
76
  private _teardownUi;
72
77
  private _slotContext;
@@ -82,6 +87,7 @@ declare class DataGrid extends BaseComponent {
82
87
  private _navigableCellFromTarget;
83
88
  private _onCellFocusIn;
84
89
  private _onCellNavigationKeydown;
90
+ private _tableCellFromTarget;
85
91
  private _descendIntoCell;
86
92
  private _isColumnEditable;
87
93
  private _startEditing;
@@ -94,19 +100,26 @@ declare class DataGrid extends BaseComponent {
94
100
  private _moveEditing;
95
101
  private _teardownEditor;
96
102
  private _setActiveCell;
103
+ private _printColumns;
104
+ private _clipboardColumns;
105
+ private _copyCellSelection;
97
106
  private _activeCellContext;
98
107
  private _cellElementFor;
99
108
  private _applyCellNavigation;
100
109
  private _getMenuActions;
101
110
  private _orderedLeafIds;
102
111
  private _moveColumn;
103
- private _onColumnDragStart;
104
- private _onColumnDrop;
105
- private _endColumnDrag;
112
+ private _initColumnDrag;
113
+ private _rowIndexOffset;
114
+ private _initRowDrag;
115
+ private _moveRowTo;
116
+ private _moveColumnTo;
106
117
  private _startColumnResize;
107
118
  private _toggleRowSelection;
108
119
  private _initDataSource;
120
+ private _maybeLoadMore;
109
121
  private _visibleLeafColumns;
122
+ private _pinnedRegion;
110
123
  private _chooserColumns;
111
124
  private _visibleColumns;
112
125
  private _getColumnSizes;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI dom/data.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5
+ *
6
+ * This is a modified version of the Bootstrap's dom/data.js
7
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
8
+ * --------------------------------------------------------------------------
9
+ */
10
+ declare const _default: {
11
+ set(element: Element, key: string, instance: unknown): void;
12
+ get(element: Element | null, key: string): any;
13
+ remove(element: Element, key: string): void;
14
+ };
15
+ export default _default;
@@ -1,11 +1,22 @@
1
- // Hand-written types for the vendored event-handler.js (see the provenance header there)
2
- type EventHandlerFunction = (event: Event & Record<string, unknown>) => void
3
-
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI dom/event-handler.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5
+ *
6
+ * This is a modified version of the Bootstrap's dom/event-handler.ts
7
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
8
+ * --------------------------------------------------------------------------
9
+ */
10
+ /**
11
+ * Types
12
+ */
13
+ type CoreUIEvent = Event & Record<string, any>;
14
+ type EventCallable = (this: any, event: CoreUIEvent) => any;
4
15
  declare const EventHandler: {
5
- on(element: Element | Document | Window, event: string, handler: string | EventHandlerFunction, delegationFunction?: EventHandlerFunction): void
6
- one(element: Element | Document | Window, event: string, handler: string | EventHandlerFunction, delegationFunction?: EventHandlerFunction): void
7
- off(element: Element | Document | Window, originalTypeEvent: string, handler?: string | EventHandlerFunction, delegationFunction?: EventHandlerFunction): void
8
- trigger(element: Element | Document | Window, event: string, args?: Record<string, unknown>): (Event & Record<string, unknown>) | null
9
- }
10
-
11
- export default EventHandler
16
+ on(element: EventTarget | null, event: string, handler?: string | EventCallable, delegationFunction?: EventCallable): void;
17
+ one(element: EventTarget | null, event: string, handler?: string | EventCallable, delegationFunction?: EventCallable): void;
18
+ off(element: EventTarget | null, originalTypeEvent: string, handler?: string | EventCallable, delegationFunction?: EventCallable): void;
19
+ trigger(element: EventTarget | null, event: string, args?: Record<string, unknown>): CoreUIEvent | null;
20
+ };
21
+ export default EventHandler;
22
+ export type { CoreUIEvent, EventCallable };
@@ -1,9 +1,16 @@
1
- // Hand-written types for the vendored manipulator.js (see the provenance header there)
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI dom/manipulator.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
5
+ *
6
+ * This is a modified version of the Bootstrap's dom/manipulator.ts
7
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
8
+ * --------------------------------------------------------------------------
9
+ */
2
10
  declare const Manipulator: {
3
- setDataAttribute(element: Element, key: string, value: unknown): void
4
- removeDataAttribute(element: Element, key: string): void
5
- getDataAttributes(element: Element): Record<string, unknown>
6
- getDataAttribute(element: Element, key: string): unknown
7
- }
8
-
9
- export default Manipulator
11
+ setDataAttribute(element: Element, key: string, value: unknown): void;
12
+ removeDataAttribute(element: Element, key: string): void;
13
+ getDataAttributes(element: HTMLElement | null): Record<string, unknown>;
14
+ getDataAttribute(element: Element, key: string): unknown;
15
+ };
16
+ export default Manipulator;
@@ -13,6 +13,7 @@ export interface ActiveCellContext {
13
13
  rowCount: number;
14
14
  pageStep: number;
15
15
  paginated: boolean;
16
+ rtl?: boolean;
16
17
  }
17
18
  export interface NavigationResult {
18
19
  cell: ActiveCell;
@@ -8,7 +8,7 @@ import type { DataGridDataRequest, DataGridDataResponse } from '../types';
8
8
  export interface GridDataSourceContext {
9
9
  getRequest: () => DataGridDataRequest;
10
10
  onError: (error: unknown) => void;
11
- onLoad: (response: DataGridDataResponse) => void;
11
+ onLoad: (response: DataGridDataResponse, request: DataGridDataRequest) => void;
12
12
  onLoadingChange: (loading: boolean) => void;
13
13
  provider: (request: DataGridDataRequest) => Promise<DataGridDataResponse>;
14
14
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI PRO data-grid engine/features-lite.ts
4
+ * License (https://coreui.io/pro/license/)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+ export declare const dataGridLiteFeatures: {
8
+ coreReactivityFeature: import("@tanstack/table-core/reactivity").TableReactivityBindings;
9
+ columnFilteringFeature: import("@tanstack/table-core").TableFeature;
10
+ globalFilteringFeature: import("@tanstack/table-core").TableFeature;
11
+ rowPaginationFeature: import("@tanstack/table-core").TableFeature;
12
+ rowSortingFeature: import("@tanstack/table-core").TableFeature;
13
+ filteredRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
14
+ paginatedRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
15
+ sortedRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
16
+ filterFns: {
17
+ includesString: import("@tanstack/table-core").CreatedFilterFn<any, any>;
18
+ };
19
+ sortFns: {
20
+ alphanumeric: import("@tanstack/table-core").CreatedSortFn<any, any>;
21
+ datetime: import("@tanstack/table-core").CreatedSortFn<any, any>;
22
+ text: import("@tanstack/table-core").CreatedSortFn<any, any>;
23
+ };
24
+ };
25
+ export type DataGridLiteFeatures = typeof dataGridLiteFeatures;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI PRO data-grid engine/features.ts
4
+ * License (https://coreui.io/pro/license/)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+ export declare const dataGridFeatures: {
8
+ coreReactivityFeature: import("@tanstack/table-core/reactivity").TableReactivityBindings;
9
+ cellSelectionFeature: import("@tanstack/table-core").TableFeature;
10
+ columnFilteringFeature: import("@tanstack/table-core").TableFeature;
11
+ globalFilteringFeature: import("@tanstack/table-core").TableFeature;
12
+ columnFacetingFeature: import("@tanstack/table-core").TableFeature;
13
+ columnOrderingFeature: import("@tanstack/table-core").TableFeature;
14
+ columnPinningFeature: import("@tanstack/table-core").TableFeature;
15
+ columnSizingFeature: import("@tanstack/table-core").TableFeature;
16
+ columnResizingFeature: import("@tanstack/table-core").TableFeature;
17
+ columnVisibilityFeature: import("@tanstack/table-core").TableFeature;
18
+ rowPaginationFeature: import("@tanstack/table-core").TableFeature;
19
+ rowSelectionFeature: import("@tanstack/table-core").TableFeature;
20
+ rowSortingFeature: import("@tanstack/table-core").TableFeature;
21
+ facetedRowModel: (table: import("@tanstack/table-core").Table<any, any>, columnId: string) => () => import("@tanstack/table-core").RowModel<any, any>;
22
+ facetedUniqueValues: (table: import("@tanstack/table-core").Table<import("@tanstack/table-core").TableFeatures, any>, columnId: string) => () => Map<any, number>;
23
+ filteredRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
24
+ paginatedRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
25
+ sortedRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
26
+ filterFns: {
27
+ includesString: import("@tanstack/table-core").CreatedFilterFn<any, any>;
28
+ };
29
+ sortFns: {
30
+ alphanumeric: import("@tanstack/table-core").CreatedSortFn<any, any>;
31
+ datetime: import("@tanstack/table-core").CreatedSortFn<any, any>;
32
+ text: import("@tanstack/table-core").CreatedSortFn<any, any>;
33
+ };
34
+ };
35
+ export type DataGridFeatures = typeof dataGridFeatures;
@@ -4,6 +4,6 @@
4
4
  * License (https://coreui.io/pro/license/)
5
5
  * --------------------------------------------------------------------------
6
6
  */
7
- import { type Table, type TableState } from '@tanstack/table-core';
8
- import type { DataGridItem, DataGridOptions } from '../types';
9
- export declare const createGridTable: (options: DataGridOptions, onStateChange: (previous: TableState, next: TableState) => void) => Table<DataGridItem>;
7
+ import type { DataGridOptions, DataGridTable, DataGridTableState } from '../types';
8
+ export declare const createGridTable: (options: DataGridOptions, getElement?: () => Element | null) => DataGridTable;
9
+ export declare const subscribeToTableState: (table: DataGridTable, listener: (previous: DataGridTableState, next: DataGridTableState) => void) => (() => void);
@@ -0,0 +1 @@
1
+ export * from './validate.js'
@@ -0,0 +1,20 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI PRO data-grid engine/validate.ts
4
+ * License (https://coreui.io/pro/license/)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+ export interface FeatureCoverageFlags {
8
+ cellSelection: boolean;
9
+ columnFilters: boolean;
10
+ columnOrder: boolean;
11
+ columnPinning: boolean;
12
+ columnSizing: boolean;
13
+ columnVisibility: boolean;
14
+ globalFilter: boolean;
15
+ pagination: boolean;
16
+ rowSelection: boolean;
17
+ selectFilters: boolean;
18
+ sorting: boolean;
19
+ }
20
+ export declare const assertFeatureCoverage: (componentName: string, features: object, flags: FeatureCoverageFlags) => void;
@@ -9,9 +9,11 @@ export type GridVirtualizerInstance = Virtualizer<HTMLDivElement, Element>;
9
9
  export interface GridVirtualizer {
10
10
  instance: GridVirtualizerInstance;
11
11
  setCount: (count: number) => void;
12
+ remeasure: () => void;
12
13
  destroy: () => void;
13
14
  }
14
15
  export interface GridVirtualizerOptions {
16
+ autoRowHeight: boolean;
15
17
  count: number;
16
18
  getScrollElement: () => HTMLDivElement;
17
19
  onChange: () => void;
@@ -6,16 +6,18 @@
6
6
  */
7
7
  export declare const DEFAULT_COLUMN_MENU_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M204 148a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 264a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 380a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26\"/></svg>";
8
8
  export declare const DEFAULT_FILTER_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M96 197.333h320v32H96zm72 101.334h176v32H168zM216 400h80v32h-80zM48 96h416v32H48z\"/></svg>";
9
+ export declare const DEFAULT_ROW_HANDLE_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M160 96h64v64h-64zm0 128h64v64h-64zm0 128h64v64h-64zM288 96h64v64h-64zm0 128h64v64h-64zm0 128h64v64h-64z\"/></svg>";
9
10
  export declare const DEFAULT_TOOLBAR_COLUMNS_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M16 64v384h480V64Zm304 32v320H192V96ZM48 96h112v320H48Zm416 320H352V96h112Z\"/></svg>";
10
11
  export declare const DEFAULT_TOOLBAR_EXPORT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M16 464h480v32H16zm379.313-164.687-22.626-22.626L280 369.373V16h-32v353.373l-92.687-92.686-22.626 22.626L264 430.627z\"/></svg>";
11
12
  export declare const DEFAULT_TOOLBAR_UNDO_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M495.473 197.262c0-73.061-43.651-136.118-106.242-164.462q-2-.9-4.021-1.762-4.046-1.715-8.19-3.235-2.071-.761-4.167-1.47-4.19-1.422-8.468-2.64a180.95 180.95 0 0 0-98.675 0q-4.278 1.218-8.469 2.64-2.094.71-4.166 1.47-4.143 1.519-8.19 3.235-2.023.857-4.021 1.762c-62.592 28.344-106.242 91.4-106.242 164.462v237.483L38.627 338.75 16 361.377 150.623 496l134.623-134.623-22.627-22.627-96 96V197.263c0-72.891 52.814-133.678 122.186-146.1a149.4 149.4 0 0 1 52.479 0c69.371 12.426 122.186 73.213 122.186 146.1h32Z\"/></svg>";
13
+ export declare const DEFAULT_TOOLBAR_PRINT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M400 144V16H112v128H16v256h96v96h288v-96h96V144ZM144 48h224v96H144Zm224 416H144V304h224Zm96-96h-64V272H112v96H48V176h416Z\"/><path fill=\"currentColor\" d=\"M384 208h32v32h-32z\"/></svg>";
12
14
  export declare const DEFAULT_TOOLBAR_REDO_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M361.376 495.163 226.753 360.54l22.627-22.627 111.996 111.996 111.997-111.996L496 360.54z\"/><path fill=\"currentColor\" d=\"M377.377 472.52h-32V196.426C345.377 114.584 278.794 48 196.952 48c-83.229 0-148.426 63.106-148.426 143.667h-32c0-48.024 18.85-92.569 53.079-125.429C103.35 33.842 148.576 16 196.952 16c99.487 0 180.425 80.938 180.425 180.426Z\"/></svg>";
13
15
  export declare const DEFAULT_SORT_ASCENDING_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M390.624 150.625 256 16 121.376 150.625l22.628 22.627 95.997-95.998v417.982h32V77.257l95.995 95.995z\"/></svg>";
14
16
  export declare const DEFAULT_SORT_DESCENDING_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m367.997 338.75-95.998 95.997V17.503h-32v417.242l-95.996-95.995-22.627 22.627L256 496l134.624-134.623z\"/></svg>";
15
17
  export declare const DEFAULT_SORT_NEUTRAL_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M384 433.373V160h-32v274.51l-69.823-69.823-22.627 22.626 107.882 107.883 107.881-107.883-22.626-22.626zM159.432 17.372 51.55 125.255l22.627 22.627L144 78.059V352h32V79.195l68.687 68.687 22.626-22.627z\"/></svg>";
16
- export declare const DEFAULT_PIN_LEFT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z\"/></svg>";
17
- export declare const DEFAULT_PIN_RIGHT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><g transform=\"translate(512 0) scale(-1 1)\"><path fill=\"currentColor\" d=\"m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z\"/></g></svg>";
18
+ export declare const DEFAULT_PIN_START_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z\"/></svg>";
19
+ export declare const DEFAULT_PIN_END_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><g transform=\"translate(512 0) scale(-1 1)\"><path fill=\"currentColor\" d=\"m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z\"/></g></svg>";
18
20
  export declare const DEFAULT_UNPIN_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m427.314 107.313-22.628-22.626L256 233.373 107.314 84.687l-22.628 22.626L233.373 256 84.686 404.687l22.628 22.626L256 278.627l148.686 148.686 22.628-22.626L278.627 256z\"/></svg>";
19
- export declare const DEFAULT_MOVE_LEFT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M254.625 56h-38.632L16 256.2 216 456h38.623V336h144V176h-144Zm112 152v96h-144v113.384l-161.37-161.21 161.37-161.535V208Zm96-152h32v400h-32z\"/></svg>";
20
- export declare const DEFAULT_MOVE_RIGHT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M296.007 56h-38.632v120h-144v160h144v120H296l200-199.8Zm-6.632 361.384V304h-144v-96h144V94.639l161.37 161.535ZM17.375 56h32v400h-32z\"/></svg>";
21
+ export declare const DEFAULT_MOVE_START_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M254.625 56h-38.632L16 256.2 216 456h38.623V336h144V176h-144Zm112 152v96h-144v113.384l-161.37-161.21 161.37-161.535V208Zm96-152h32v400h-32z\"/></svg>";
22
+ export declare const DEFAULT_MOVE_END_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M296.007 56h-38.632v120h-144v160h144v120H296l200-199.8Zm-6.632 361.384V304h-144v-96h144V94.639l161.37 161.535ZM17.375 56h32v400h-32z\"/></svg>";
21
23
  export declare const DEFAULT_HIDE_COLUMN_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m397.222 131.1-.218-.223c-63.173-63.17-158.534-75.015-233.776-35.531l23.938 23.939c61.571-27.691 136.573-16.327 187.105 34.115L464 246.683v3.107l-71.744 74.585 22.63 22.63L496 262.683V233.79Z\"/><path fill=\"currentColor\" d=\"M352.8 284.33a103.307 103.307 0 0 0-132.893-132.892L246.1 177.63a71.228 71.228 0 0 1 80.507 80.508Zm17.1 62.938-33.831-33.831c.088-.108.179-.212.266-.32l-22.805-22.806q-.126.168-.253.334l-99.681-99.681.334-.253-22.81-22.805c-.108.087-.213.179-.321.266L38.627 16H16v22.627l95.689 95.689L16 233.79v28.893l98.778 102.689.218.222A199.73 199.73 0 0 0 367.372 390l106 106H496v-22.627L392.537 369.911Zm-177.157-131.9 96.128 96.132a71.28 71.28 0 0 1-96.133-96.133Zm-55.014 127.705L48 249.79v-3.107l86.319-89.737 35.065 35.064a103.248 103.248 0 0 0 142.842 142.843l32.007 32.007c-64.51 40.015-150.522 32.095-206.504-23.787\"/></svg>";
@@ -0,0 +1 @@
1
+ export * from './index-lite.js'
@@ -0,0 +1,19 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI PRO data-grid index-lite.ts
4
+ * License (https://coreui.io/pro/license/)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+ import DataGridBase from './data-grid';
8
+ import { type DataGridLiteFeatures } from './engine/features-lite';
9
+ import type { DataGridOptions, TableFeatures } from './types';
10
+ declare class DataGrid<TFeatures extends TableFeatures = DataGridLiteFeatures> extends DataGridBase<TFeatures> {
11
+ static get Default(): DataGridOptions;
12
+ }
13
+ export { DataGrid };
14
+ export { dataGridLiteFeatures } from './engine/features-lite';
15
+ export { DEFAULT_LABELS, interpolate } from './labels';
16
+ export { evaluateColumnFilter, FILTER_OPERATORS, VALUELESS_OPERATORS } from './filters';
17
+ export { downloadCsv, exportCsv } from './util/csv';
18
+ export type { CsvDownloadOptions, CsvOptions } from './util/csv';
19
+ export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, DataGridColumn, DataGridColumnFilterContext, DataGridColumnFilterFactory, DataGridColumnFilterValue, DataGridColumnMenuBuilder, DataGridColumnMenuContext, DataGridColumnSizingOptions, DataGridDataRequest, DataGridDataResponse, DataGridEditableOptions, DataGridEditCommitEvent, DataGridEditor, DataGridEditorContext, DataGridEditorFactory, DataGridEditorType, DataGridFilterCondition, DataGridFilterOperator, DataGridFilterType, DataGridInfiniteScrollOptions, DataGridItem, DataGridLabels, DataGridLiteFeatures, DataGridMenuAction, DataGridOptions, DataGridPaginationInfoState, DataGridPaginationOptions, DataGridRowSelectionOptions, DataGridSlot, DataGridSlotContext, DataGridSlotFactory, DataGridSlots, DataGridSortingOptions, DataGridState, DataGridToolbarOptions, PaginationState, RowSelectionState, SortingState, ColumnVisibilityState, DataGridColumnPinning, DataGridRow, DataGridTable, DataGridTableState, Table, TableFeatures } from './types';
@@ -4,9 +4,18 @@
4
4
  * License (https://coreui.io/pro/license/)
5
5
  * --------------------------------------------------------------------------
6
6
  */
7
- export { default as DataGrid } from './data-grid';
7
+ import DataGridBase from './data-grid';
8
+ import { type DataGridFeatures } from './engine/features';
9
+ import type { DataGridOptions, TableFeatures } from './types';
10
+ declare class DataGrid<TFeatures extends TableFeatures = DataGridFeatures> extends DataGridBase<TFeatures> {
11
+ static get Default(): DataGridOptions;
12
+ }
13
+ export { DataGrid };
14
+ export { dataGridFeatures } from './engine/features';
15
+ export { dataGridLiteFeatures } from './engine/features-lite';
8
16
  export { DEFAULT_LABELS, interpolate } from './labels';
9
17
  export { evaluateColumnFilter, FILTER_OPERATORS, VALUELESS_OPERATORS } from './filters';
10
18
  export { downloadCsv, exportCsv } from './util/csv';
11
19
  export type { CsvDownloadOptions, CsvOptions } from './util/csv';
12
- export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, DataGridColumn, DataGridColumnFilterContext, DataGridColumnFilterFactory, DataGridColumnFilterValue, DataGridColumnMenuBuilder, DataGridColumnMenuContext, DataGridColumnSizingOptions, DataGridDataRequest, DataGridDataResponse, DataGridEditableOptions, DataGridEditCommitEvent, DataGridEditor, DataGridEditorContext, DataGridEditorFactory, DataGridEditorType, DataGridFilterCondition, DataGridFilterOperator, DataGridFilterType, DataGridItem, DataGridLabels, DataGridMenuAction, DataGridOptions, DataGridPaginationInfoState, DataGridPaginationOptions, DataGridRowSelectionOptions, DataGridSlot, DataGridSlotContext, DataGridSlotFactory, DataGridSlots, DataGridSortingOptions, DataGridState, DataGridToolbarOptions, PaginationState, RowSelectionState, SortingState, Table, VisibilityState } from './types';
20
+ export type { DataGridExporter, DataGridExportOptions } from './ui/toolbar';
21
+ export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, DataGridColumn, DataGridColumnFilterContext, DataGridColumnFilterFactory, DataGridColumnFilterValue, DataGridColumnMenuBuilder, DataGridColumnMenuContext, DataGridColumnSizingOptions, DataGridDataRequest, DataGridDataResponse, DataGridEditableOptions, DataGridEditCommitEvent, DataGridEditor, DataGridEditorContext, DataGridEditorFactory, DataGridEditorType, DataGridFeatures, DataGridFilterCondition, DataGridFilterOperator, DataGridFilterType, DataGridInfiniteScrollOptions, DataGridItem, DataGridLabels, DataGridLiteFeatures, DataGridMenuAction, DataGridOptions, DataGridPaginationInfoState, DataGridPaginationOptions, DataGridRowSelectionOptions, DataGridSlot, DataGridSlotContext, DataGridSlotFactory, DataGridSlots, DataGridSortingOptions, DataGridState, DataGridToolbarOptions, PaginationState, RowSelectionState, SortingState, ColumnVisibilityState, DataGridColumnPinning, DataGridRow, DataGridTable, DataGridTableState, Table, TableFeatures } from './types';
@@ -4,16 +4,23 @@
4
4
  * License (https://coreui.io/pro/license/)
5
5
  * --------------------------------------------------------------------------
6
6
  */
7
- import type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, PaginationState, RowSelectionState, SortingState, Table, VisibilityState } from '@tanstack/table-core';
8
- import type { CsvDownloadOptions } from './util/csv';
9
- export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, PaginationState, RowSelectionState, SortingState, Table, VisibilityState } from '@tanstack/table-core';
7
+ import type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, ColumnVisibilityState, PaginationState, Row, RowSelectionState, SortingState, Table, TableFeatures, TableState } from '@tanstack/table-core';
8
+ import type { DataGridFeatures } from './engine/features';
9
+ import type { DataGridExportOptions } from './ui/toolbar';
10
+ export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnPinningPosition, ColumnSizingState, ColumnVisibilityState, PaginationState, RowSelectionState, SortingState, Table, TableFeatures } from '@tanstack/table-core';
11
+ export type { DataGridFeatures } from './engine/features';
12
+ export type { DataGridLiteFeatures } from './engine/features-lite';
10
13
  export type DataGridItem = Record<string, unknown>;
11
- export interface DataGridColumnFilterContext {
12
- column: Column<DataGridItem, unknown>;
13
- table: Table<DataGridItem>;
14
+ export type DataGridTable<TFeatures extends TableFeatures = DataGridFeatures> = Table<TFeatures, DataGridItem>;
15
+ export type DataGridTableState<TFeatures extends TableFeatures = DataGridFeatures> = TableState<TFeatures>;
16
+ export type DataGridRow<TFeatures extends TableFeatures = DataGridFeatures> = Row<TFeatures, DataGridItem>;
17
+ export type DataGridColumnPinning = Partial<ColumnPinningState>;
18
+ export interface DataGridColumnFilterContext<TFeatures extends TableFeatures = DataGridFeatures> {
19
+ column: Column<TFeatures, DataGridItem, unknown>;
20
+ table: DataGridTable<TFeatures>;
14
21
  labels: DataGridLabels;
15
22
  }
16
- export type DataGridColumnFilterFactory = (context: DataGridColumnFilterContext) => DataGridSlot;
23
+ export type DataGridColumnFilterFactory<TFeatures extends TableFeatures = DataGridFeatures> = (context: DataGridColumnFilterContext<TFeatures>) => DataGridSlot;
17
24
  export type DataGridFilterType = 'text' | 'number' | 'date' | 'select';
18
25
  export type DataGridFilterOperator = 'contains' | 'notContains' | 'equals' | 'notEquals' | 'startsWith' | 'endsWith' | 'blank' | 'notBlank' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'between';
19
26
  export interface DataGridFilterCondition {
@@ -62,12 +69,12 @@ export interface DataGridEditCommitEvent {
62
69
  value: unknown;
63
70
  previousValue: unknown;
64
71
  }
65
- export interface DataGridColumn {
72
+ export interface DataGridColumn<TFeatures extends TableFeatures = DataGridFeatures> {
66
73
  key: string;
67
74
  editable?: boolean | DataGridEditableOptions;
68
75
  editor?: DataGridEditorFactory;
69
76
  editValidate?: (value: unknown, item: DataGridItem) => true | string;
70
- filter?: DataGridColumnFilterFactory;
77
+ filter?: DataGridColumnFilterFactory<TFeatures>;
71
78
  filterable?: boolean;
72
79
  filterFn?: (value: unknown, filterValue: unknown, item: DataGridItem) => boolean;
73
80
  filterType?: DataGridFilterType;
@@ -112,8 +119,8 @@ export interface DataGridLabels {
112
119
  lastPage: string;
113
120
  loadError: string;
114
121
  loading: string;
115
- moveLeft: string;
116
- moveRight: string;
122
+ moveEnd: string;
123
+ moveStart: string;
117
124
  nextPage: string;
118
125
  operatorBetween: string;
119
126
  operatorBlank: string;
@@ -130,10 +137,11 @@ export interface DataGridLabels {
130
137
  operatorStartsWith: string;
131
138
  pageSizeLabel: string;
132
139
  paginationLabel: string;
133
- pinLeft: string;
134
- pinRight: string;
140
+ pinEnd: string;
141
+ pinStart: string;
135
142
  previousPage: string;
136
143
  redoneAnnouncement: string;
144
+ reorderRow: string;
137
145
  resetColumns: string;
138
146
  resultsAnnouncement: string;
139
147
  searchValues: string;
@@ -145,6 +153,7 @@ export interface DataGridLabels {
145
153
  sortDescending: string;
146
154
  toolbarColumns: string;
147
155
  toolbarExport: string;
156
+ toolbarPrint: string;
148
157
  toolbarRedo: string;
149
158
  toolbarUndo: string;
150
159
  undoneAnnouncement: string;
@@ -153,8 +162,8 @@ export interface DataGridLabels {
153
162
  export interface DataGridColumnSizingOptions {
154
163
  mode?: 'onChange' | 'onEnd';
155
164
  }
156
- export interface DataGridSlotContext {
157
- table: Table<DataGridItem>;
165
+ export interface DataGridSlotContext<TFeatures extends TableFeatures = DataGridFeatures> {
166
+ table: DataGridTable<TFeatures>;
158
167
  labels: DataGridLabels;
159
168
  }
160
169
  export interface DataGridSlot {
@@ -162,16 +171,17 @@ export interface DataGridSlot {
162
171
  update?: () => void;
163
172
  dispose?: () => void;
164
173
  }
165
- export type DataGridSlotFactory = (context: DataGridSlotContext) => DataGridSlot;
166
- export interface DataGridSlots {
167
- toolbar: DataGridSlotFactory;
168
- pagination: DataGridSlotFactory;
169
- empty: DataGridSlotFactory;
174
+ export type DataGridSlotFactory<TFeatures extends TableFeatures = DataGridFeatures> = (context: DataGridSlotContext<TFeatures>) => DataGridSlot;
175
+ export interface DataGridSlots<TFeatures extends TableFeatures = DataGridFeatures> {
176
+ toolbar: DataGridSlotFactory<TFeatures>;
177
+ pagination: DataGridSlotFactory<TFeatures>;
178
+ empty: DataGridSlotFactory<TFeatures>;
170
179
  }
171
180
  export interface DataGridToolbarOptions {
172
181
  columns?: boolean;
173
- export?: boolean | CsvDownloadOptions;
182
+ export?: boolean | DataGridExportOptions;
174
183
  history?: boolean;
184
+ print?: boolean;
175
185
  search?: boolean;
176
186
  }
177
187
  export interface DataGridSortingOptions {
@@ -188,6 +198,10 @@ export interface DataGridPaginationInfoState {
188
198
  pageSize: number;
189
199
  totalRows: number;
190
200
  }
201
+ export interface DataGridInfiniteScrollOptions {
202
+ pageSize?: number;
203
+ threshold?: number;
204
+ }
191
205
  export interface DataGridPaginationOptions {
192
206
  info?: boolean | ((state: DataGridPaginationInfoState) => string);
193
207
  pageSize?: number;
@@ -199,7 +213,7 @@ export interface DataGridState {
199
213
  columnOrder: ColumnOrderState;
200
214
  columnPinning: ColumnPinningState;
201
215
  columnSizing: ColumnSizingState;
202
- columnVisibility: VisibilityState;
216
+ columnVisibility: ColumnVisibilityState;
203
217
  globalFilter: string;
204
218
  pagination: PaginationState;
205
219
  rowSelection: RowSelectionState;
@@ -215,37 +229,44 @@ export interface DataGridDataResponse {
215
229
  items: DataGridItem[];
216
230
  totalRows: number;
217
231
  }
218
- export interface DataGridOptions {
232
+ export interface DataGridOptions<TFeatures extends TableFeatures = DataGridFeatures> {
233
+ autoRowHeight: boolean;
219
234
  cellNavigation: boolean;
235
+ cellSelection: boolean;
220
236
  columnFilters: boolean;
221
237
  columnMenu: boolean | DataGridColumnMenuBuilder;
222
238
  columnMenuIcon: string;
223
239
  columnOrder: boolean | ColumnOrderState;
224
- columnPinning: boolean | ColumnPinningState;
240
+ columnPinning: boolean | DataGridColumnPinning;
225
241
  columnSizing: boolean | DataGridColumnSizingOptions;
226
- columnVisibility: boolean | VisibilityState;
227
- columns: DataGridColumn[];
242
+ columnVisibility: boolean | ColumnVisibilityState;
243
+ columns: Array<DataGridColumn<TFeatures>>;
228
244
  dataProvider: ((request: DataGridDataRequest) => Promise<DataGridDataResponse>) | null;
229
245
  editing: boolean;
230
246
  empty: string | (() => Node | string);
247
+ features: TFeatures | null;
231
248
  filterIcon: string;
232
249
  globalFilter: boolean;
233
250
  hideColumnIcon: string;
234
251
  history: boolean;
252
+ infiniteScroll: boolean | DataGridInfiniteScrollOptions;
235
253
  itemKey: ((item: DataGridItem, index: number) => string) | null;
236
254
  items: DataGridItem[];
237
255
  labels: Partial<DataGridLabels>;
238
- moveLeftIcon: string;
239
- moveRightIcon: string;
256
+ moveEndIcon: string;
257
+ moveStartIcon: string;
240
258
  overscan: number;
241
259
  pagination: boolean | DataGridPaginationOptions;
242
- pinLeftIcon: string;
243
- pinRightIcon: string;
260
+ pinEndIcon: string;
261
+ pinStartIcon: string;
262
+ printTitle: string | null;
263
+ rowHandleIcon: string;
244
264
  rowHeight: number;
265
+ rowOrder: boolean;
245
266
  rowSelection: boolean | DataGridRowSelectionOptions;
246
267
  sanitize: boolean;
247
268
  sanitizeFn: ((html: string) => string) | null;
248
- slots: Partial<DataGridSlots>;
269
+ slots: Partial<DataGridSlots<TFeatures>>;
249
270
  sortAscendingIcon: string;
250
271
  sortDescendingIcon: string;
251
272
  sortNeutralIcon: string;
@@ -255,6 +276,7 @@ export interface DataGridOptions {
255
276
  toolbar: boolean | DataGridToolbarOptions;
256
277
  toolbarColumnsIcon: string;
257
278
  toolbarExportIcon: string;
279
+ toolbarPrintIcon: string;
258
280
  toolbarRedoIcon: string;
259
281
  toolbarUndoIcon: string;
260
282
  unpinIcon: string;
@@ -4,11 +4,11 @@
4
4
  * License (https://coreui.io/pro/license/)
5
5
  * --------------------------------------------------------------------------
6
6
  */
7
- import type { Row } from '@tanstack/table-core';
8
7
  import type { GridVirtualizerInstance } from '../engine/virtualizer';
9
- import type { DataGridColumn, DataGridItem, DataGridLabels } from '../types';
8
+ import type { DataGridColumn, DataGridLabels, DataGridRow } from '../types';
10
9
  import { type GridPinning } from './pinning';
11
10
  export interface GridBodyContext {
11
+ autoRowHeight: boolean;
12
12
  cellNavigation: boolean;
13
13
  headerRowCount: number;
14
14
  labels: DataGridLabels;
@@ -20,11 +20,14 @@ export interface GridBodyContext {
20
20
  getEditorElement: () => HTMLElement | null;
21
21
  getPinning: () => GridPinning | null;
22
22
  getRowIndexOffset: () => number;
23
- getRows: () => Array<Row<DataGridItem>>;
23
+ getRows: () => DataGridRow[];
24
24
  getVisibleColumns: () => DataGridColumn[];
25
25
  getVirtualizer: () => GridVirtualizerInstance | null;
26
26
  renderEmpty: () => Node | string;
27
27
  sanitizeContent: (html: string) => string;
28
+ cellSelection: boolean;
29
+ rowOrder: boolean;
30
+ rowHandleIcon: string;
28
31
  selection: boolean;
29
32
  }
30
33
  export interface GridBody {