@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.
- package/README.md +9 -6
- package/dist/css/data-grid.css +156 -38
- package/dist/css/data-grid.css.map +1 -1
- package/dist/css/data-grid.min.css +2 -2
- package/dist/css/data-grid.min.css.map +1 -1
- package/dist/css/data-grid.standalone.css +1066 -0
- package/dist/css/data-grid.standalone.css.map +1 -0
- package/dist/css/data-grid.standalone.min.css +5 -0
- package/dist/css/data-grid.standalone.min.css.map +1 -0
- package/dist/js/clipboard.cjs +56 -0
- package/dist/js/clipboard.cjs.map +1 -0
- package/dist/js/clipboard.mjs +54 -0
- package/dist/js/clipboard.mjs.map +1 -0
- package/dist/js/csv.cjs +36 -59
- package/dist/js/csv.cjs.map +1 -1
- package/dist/js/csv.mjs +35 -55
- package/dist/js/csv.mjs.map +1 -1
- package/dist/js/data-grid.esm.js +14108 -9331
- package/dist/js/data-grid.esm.js.map +1 -1
- package/dist/js/data-grid.esm.min.js +6 -6
- package/dist/js/data-grid.esm.min.js.map +1 -1
- package/dist/js/data-grid.js +14408 -9634
- package/dist/js/data-grid.js.map +1 -1
- package/dist/js/data-grid.lite.esm.js +10507 -0
- package/dist/js/data-grid.lite.esm.js.map +1 -0
- package/dist/js/data-grid.lite.esm.min.js +8 -0
- package/dist/js/data-grid.lite.esm.min.js.map +1 -0
- package/dist/js/data-grid.lite.js +10520 -0
- package/dist/js/data-grid.lite.js.map +1 -0
- package/dist/js/data-grid.lite.min.js +8 -0
- package/dist/js/data-grid.lite.min.js.map +1 -0
- package/dist/js/data-grid.lite.mjs +10507 -0
- package/dist/js/data-grid.lite.mjs.map +1 -0
- package/dist/js/data-grid.min.js +6 -6
- package/dist/js/data-grid.min.js.map +1 -1
- package/dist/js/data-grid.mjs +14108 -9331
- package/dist/js/data-grid.mjs.map +1 -1
- package/dist/js/direction.cjs +26 -0
- package/dist/js/direction.cjs.map +1 -0
- package/dist/js/direction.mjs +24 -0
- package/dist/js/direction.mjs.map +1 -0
- package/dist/js/drag.cjs +467 -0
- package/dist/js/drag.cjs.map +1 -0
- package/dist/js/drag.mjs +464 -0
- package/dist/js/drag.mjs.map +1 -0
- package/dist/js/export-table-BdabEbJG.mjs +26 -0
- package/dist/js/export-table-BdabEbJG.mjs.map +1 -0
- package/dist/js/export-table-D762wrZ1.cjs +55 -0
- package/dist/js/export-table-D762wrZ1.cjs.map +1 -0
- package/dist/js/filters.cjs +89 -132
- package/dist/js/filters.cjs.map +1 -1
- package/dist/js/filters.mjs +88 -128
- package/dist/js/filters.mjs.map +1 -1
- package/dist/js/labels.cjs +65 -70
- package/dist/js/labels.cjs.map +1 -1
- package/dist/js/labels.mjs +64 -66
- package/dist/js/labels.mjs.map +1 -1
- package/dist/js/print.cjs +66 -0
- package/dist/js/print.cjs.map +1 -0
- package/dist/js/print.mjs +64 -0
- package/dist/js/print.mjs.map +1 -0
- package/dist/js/validate.cjs +43 -0
- package/dist/js/validate.cjs.map +1 -0
- package/dist/js/validate.mjs +42 -0
- package/dist/js/validate.mjs.map +1 -0
- package/dist/js/xlsx.cjs +240 -0
- package/dist/js/xlsx.cjs.map +1 -0
- package/dist/js/xlsx.mjs +238 -0
- package/dist/js/xlsx.mjs.map +1 -0
- package/dist/types/base-component.d.ts +28 -18
- package/dist/types/data-grid.d.ts +26 -13
- package/dist/types/dom/data.d.ts +15 -0
- package/dist/types/dom/event-handler.d.ts +21 -10
- package/dist/types/dom/manipulator.d.ts +15 -8
- package/dist/types/engine/active-cell.d.ts +1 -0
- package/dist/types/engine/data-source.d.ts +1 -1
- package/dist/types/engine/features-lite.d.ts +25 -0
- package/dist/types/engine/features.d.ts +35 -0
- package/dist/types/engine/table.d.ts +3 -3
- package/dist/types/engine/validate.d.mts +1 -0
- package/dist/types/engine/validate.d.ts +20 -0
- package/dist/types/engine/virtualizer.d.ts +2 -0
- package/dist/types/icons.d.ts +6 -4
- package/dist/types/index-lite.d.mts +1 -0
- package/dist/types/index-lite.d.ts +19 -0
- package/dist/types/index.d.ts +11 -2
- package/dist/types/types.d.ts +53 -31
- package/dist/types/ui/body.d.ts +6 -3
- package/dist/types/ui/header.d.ts +3 -2
- package/dist/types/ui/loading.d.ts +1 -1
- package/dist/types/ui/pinning.d.ts +1 -1
- package/dist/types/ui/toolbar.d.ts +10 -2
- package/dist/types/util/clipboard.d.mts +1 -0
- package/dist/types/util/clipboard.d.ts +29 -0
- package/dist/types/util/config.d.ts +27 -10
- package/dist/types/util/csv.d.ts +5 -5
- package/dist/types/util/direction.d.mts +1 -0
- package/dist/types/util/direction.d.ts +17 -0
- package/dist/types/util/drag.d.mts +1 -0
- package/dist/types/util/drag.d.ts +48 -0
- package/dist/types/util/export-table.d.ts +47 -0
- package/dist/types/util/index.d.ts +66 -10
- package/dist/types/util/print.d.mts +1 -0
- package/dist/types/util/print.d.ts +32 -0
- package/dist/types/util/sanitizer.d.ts +15 -11
- package/dist/types/util/xlsx.d.mts +1 -0
- package/dist/types/util/xlsx.d.ts +17 -0
- package/dist/types/util/zip.d.ts +11 -0
- package/package.json +101 -10
- package/scss/_base.scss +13 -0
- package/scss/_config.scss +14 -0
- package/scss/_functions.scss +1 -0
- package/scss/_mixins.scss +1 -0
- package/scss/base/_buttons.scss +113 -0
- package/scss/base/_forms.scss +157 -0
- package/scss/base/_helpers.scss +24 -0
- package/scss/base/_pagination.scss +100 -0
- package/scss/base/_reboot.scss +93 -0
- package/scss/base/_root.scss +85 -0
- package/scss/base/_spinner.scss +45 -0
- package/scss/base/_table.scss +78 -0
- package/scss/components/_data-grid.scss +807 -0
- package/scss/data-grid.scss +7 -555
- package/scss/data-grid.standalone.scss +16 -0
- package/scss/functions/_defaults.scss +25 -0
- package/scss/mixins/_tokens.scss +12 -0
- package/src/{base-component.js → base-component.ts} +21 -17
- package/src/data-grid.ts +523 -201
- package/src/dom/{data.js → data.ts} +13 -10
- package/src/dom/event-handler.ts +380 -0
- package/src/dom/{manipulator.js → manipulator.ts} +11 -11
- package/src/engine/active-cell.ts +10 -3
- package/src/engine/data-source.ts +7 -3
- package/src/engine/features-lite.ts +47 -0
- package/src/engine/features.ts +68 -0
- package/src/engine/table.ts +86 -45
- package/src/engine/validate.ts +64 -0
- package/src/engine/virtualizer.ts +17 -1
- package/src/icons.ts +11 -5
- package/src/index-lite.ts +85 -0
- package/src/index.ts +30 -2
- package/src/labels.ts +6 -4
- package/src/types.ts +87 -32
- package/src/ui/body.ts +73 -17
- package/src/ui/header.ts +51 -26
- package/src/ui/loading.ts +2 -2
- package/src/ui/pinning.ts +16 -16
- package/src/ui/toolbar.ts +27 -3
- package/src/util/clipboard.ts +112 -0
- package/src/util/{config.js → config.ts} +25 -11
- package/src/util/csv.ts +11 -30
- package/src/util/direction.ts +37 -0
- package/src/util/drag.ts +832 -0
- package/src/util/export-table.ts +86 -0
- package/src/util/{index.js → index.ts} +55 -35
- package/src/util/print.ts +125 -0
- package/src/util/{sanitizer.js → sanitizer.ts} +17 -13
- package/src/util/xlsx.ts +183 -0
- package/src/util/zip.ts +170 -0
- package/src/base-component.d.ts +0 -19
- package/src/dom/event-handler.d.ts +0 -11
- package/src/dom/event-handler.js +0 -331
- package/src/dom/manipulator.d.ts +0 -9
- package/src/util/config.d.ts +0 -11
- package/src/util/index.d.ts +0 -10
- 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 {
|
|
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
|
|
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():
|
|
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
|
|
72
|
+
update(config: Partial<DataGridOptions<TFeatures>>): void;
|
|
68
73
|
dispose(): void;
|
|
69
|
-
_configAfterMerge(config:
|
|
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
|
|
104
|
-
private
|
|
105
|
-
private
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export
|
|
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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
|
@@ -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 {
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
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;
|
package/dist/types/icons.d.ts
CHANGED
|
@@ -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
|
|
17
|
-
export declare const
|
|
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
|
|
20
|
-
export declare const
|
|
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';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,9 +4,18 @@
|
|
|
4
4
|
* License (https://coreui.io/pro/license/)
|
|
5
5
|
* --------------------------------------------------------------------------
|
|
6
6
|
*/
|
|
7
|
-
|
|
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 {
|
|
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';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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,
|
|
8
|
-
import type {
|
|
9
|
-
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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:
|
|
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 |
|
|
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:
|
|
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 |
|
|
240
|
+
columnPinning: boolean | DataGridColumnPinning;
|
|
225
241
|
columnSizing: boolean | DataGridColumnSizingOptions;
|
|
226
|
-
columnVisibility: boolean |
|
|
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
|
-
|
|
239
|
-
|
|
256
|
+
moveEndIcon: string;
|
|
257
|
+
moveStartIcon: string;
|
|
240
258
|
overscan: number;
|
|
241
259
|
pagination: boolean | DataGridPaginationOptions;
|
|
242
|
-
|
|
243
|
-
|
|
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;
|
package/dist/types/ui/body.d.ts
CHANGED
|
@@ -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,
|
|
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: () =>
|
|
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 {
|