@coreui/data-grid 0.3.0-rc.0 → 0.4.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/dist/css/data-grid.css +1 -1
- package/dist/css/data-grid.css.map +1 -1
- package/dist/css/data-grid.min.css +1 -1
- package/dist/css/data-grid.min.css.map +1 -1
- package/dist/css/data-grid.standalone.css +6 -6
- package/dist/css/data-grid.standalone.css.map +1 -1
- package/dist/css/data-grid.standalone.min.css +1 -1
- package/dist/css/data-grid.standalone.min.css.map +1 -1
- package/dist/js/clipboard.cjs +2 -3
- package/dist/js/clipboard.mjs +2 -3
- package/dist/js/csv.cjs +5 -6
- package/dist/js/csv.cjs.map +1 -1
- package/dist/js/csv.mjs +5 -6
- package/dist/js/csv.mjs.map +1 -1
- package/dist/js/data-grid.esm.js +5899 -5667
- package/dist/js/data-grid.esm.js.map +1 -1
- package/dist/js/data-grid.esm.min.js +2 -2
- package/dist/js/data-grid.esm.min.js.map +1 -1
- package/dist/js/data-grid.js +5899 -5668
- package/dist/js/data-grid.js.map +1 -1
- package/dist/js/data-grid.lite.esm.js +2669 -2622
- package/dist/js/data-grid.lite.esm.js.map +1 -1
- package/dist/js/data-grid.lite.esm.min.js +2 -2
- package/dist/js/data-grid.lite.esm.min.js.map +1 -1
- package/dist/js/data-grid.lite.js +2669 -2623
- package/dist/js/data-grid.lite.js.map +1 -1
- package/dist/js/data-grid.lite.min.js +2 -2
- package/dist/js/data-grid.lite.min.js.map +1 -1
- package/dist/js/data-grid.lite.mjs +2669 -2622
- package/dist/js/data-grid.lite.mjs.map +1 -1
- package/dist/js/data-grid.min.js +2 -2
- package/dist/js/data-grid.min.js.map +1 -1
- package/dist/js/data-grid.mjs +5899 -5667
- package/dist/js/data-grid.mjs.map +1 -1
- package/dist/js/direction.cjs +3 -4
- package/dist/js/direction.cjs.map +1 -1
- package/dist/js/direction.mjs +3 -4
- package/dist/js/direction.mjs.map +1 -1
- package/dist/js/drag.cjs +6 -6
- package/dist/js/drag.cjs.map +1 -1
- package/dist/js/drag.mjs +6 -6
- package/dist/js/drag.mjs.map +1 -1
- package/dist/js/{export-table-BdabEbJG.mjs → export-table-BggGRmzQ.mjs} +3 -4
- package/dist/js/{export-table-BdabEbJG.mjs.map → export-table-BggGRmzQ.mjs.map} +1 -1
- package/dist/js/{export-table-D762wrZ1.cjs → export-table-BiB3_lVo.cjs} +3 -4
- package/dist/js/{export-table-D762wrZ1.cjs.map → export-table-BiB3_lVo.cjs.map} +1 -1
- package/dist/js/filters.cjs +2 -3
- package/dist/js/filters.mjs +2 -3
- package/dist/js/labels.cjs +2 -3
- package/dist/js/labels.mjs +2 -3
- package/dist/js/print.cjs +2 -3
- package/dist/js/print.mjs +2 -3
- package/dist/js/selector.cjs +22 -0
- package/dist/js/selector.cjs.map +1 -0
- package/dist/js/selector.mjs +21 -0
- package/dist/js/selector.mjs.map +1 -0
- package/dist/js/validate.cjs +2 -3
- package/dist/js/validate.mjs +2 -3
- package/dist/js/xlsx.cjs +5 -7
- package/dist/js/xlsx.cjs.map +1 -1
- package/dist/js/xlsx.mjs +5 -7
- package/dist/js/xlsx.mjs.map +1 -1
- package/dist/types/base-component.d.mts +29 -0
- package/dist/types/data-grid.d.mts +141 -0
- package/dist/types/dom/data.d.mts +15 -0
- package/dist/types/dom/event-handler.d.mts +22 -0
- package/dist/types/dom/manipulator.d.mts +16 -0
- package/dist/types/engine/active-cell.d.mts +33 -0
- package/dist/types/engine/data-source.d.mts +19 -0
- package/dist/types/engine/features-lite.d.mts +25 -0
- package/dist/types/engine/features.d.mts +35 -0
- package/dist/types/engine/scheduler.d.mts +11 -0
- package/dist/types/engine/table.d.mts +9 -0
- package/dist/types/engine/validate.d.mts +20 -1
- package/dist/types/engine/virtualizer.d.mts +23 -0
- package/dist/types/filters.d.mts +13 -1
- package/dist/types/icons.d.mts +23 -0
- package/dist/types/index-lite.d.mts +19 -1
- package/dist/types/index.d.mts +21 -1
- package/dist/types/labels.d.mts +9 -1
- package/dist/types/types.d.mts +284 -0
- package/dist/types/ui/body.d.mts +37 -0
- package/dist/types/ui/column-chooser.d.mts +27 -0
- package/dist/types/ui/editor.d.mts +8 -0
- package/dist/types/ui/filter-menu.d.mts +21 -0
- package/dist/types/ui/header.d.mts +51 -0
- package/dist/types/ui/loading.d.mts +12 -0
- package/dist/types/ui/menu.d.mts +17 -0
- package/dist/types/ui/pagination.d.mts +17 -0
- package/dist/types/ui/pinning.d.mts +17 -0
- package/dist/types/ui/toolbar.d.mts +42 -0
- package/dist/types/ui/tooltip.d.mts +10 -0
- package/dist/types/util/clipboard.d.mts +29 -1
- package/dist/types/util/config.d.mts +28 -0
- package/dist/types/util/csv.d.mts +19 -1
- package/dist/types/util/debounce.d.mts +7 -0
- package/dist/types/util/direction.d.mts +17 -1
- package/dist/types/util/drag.d.mts +48 -1
- package/dist/types/util/export-table.d.mts +47 -0
- package/dist/types/util/index.d.mts +66 -0
- package/dist/types/util/print.d.mts +32 -1
- package/dist/types/util/sanitizer.d.mts +15 -0
- package/dist/types/util/selector.d.mts +12 -0
- package/dist/types/util/selector.d.ts +12 -0
- package/dist/types/util/xlsx.d.mts +17 -1
- package/dist/types/util/zip.d.mts +11 -0
- package/package.json +29 -16
- package/scss/data-grid.scss +1 -1
- package/src/data-grid.ts +4 -3
- package/src/engine/active-cell.ts +2 -6
- package/src/index-lite.ts +1 -1
- package/src/index.ts +1 -1
- package/src/ui/column-chooser.ts +4 -4
- package/src/ui/filter-menu.ts +5 -5
- package/src/ui/menu.ts +4 -4
- package/src/ui/pagination.ts +1 -1
- package/src/ui/tooltip.ts +2 -2
- package/src/util/csv.ts +2 -2
- package/src/util/direction.ts +4 -3
- package/src/util/drag.ts +5 -3
- package/src/util/selector.ts +16 -0
- package/src/util/xlsx.ts +1 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid types.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
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.mjs';
|
|
9
|
+
import type { DataGridExportOptions } from './ui/toolbar.mjs';
|
|
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.mjs';
|
|
12
|
+
export type { DataGridLiteFeatures } from './engine/features-lite.mjs';
|
|
13
|
+
export type DataGridItem = Record<string, unknown>;
|
|
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>;
|
|
21
|
+
labels: DataGridLabels;
|
|
22
|
+
}
|
|
23
|
+
export type DataGridColumnFilterFactory<TFeatures extends TableFeatures = DataGridFeatures> = (context: DataGridColumnFilterContext<TFeatures>) => DataGridSlot;
|
|
24
|
+
export type DataGridFilterType = 'text' | 'number' | 'date' | 'select';
|
|
25
|
+
export type DataGridFilterOperator = 'contains' | 'notContains' | 'equals' | 'notEquals' | 'startsWith' | 'endsWith' | 'blank' | 'notBlank' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'between';
|
|
26
|
+
export interface DataGridFilterCondition {
|
|
27
|
+
operator: DataGridFilterOperator;
|
|
28
|
+
value?: unknown;
|
|
29
|
+
value2?: unknown;
|
|
30
|
+
}
|
|
31
|
+
export type DataGridColumnFilterValue = string | {
|
|
32
|
+
conditions: DataGridFilterCondition[];
|
|
33
|
+
join: 'and' | 'or';
|
|
34
|
+
} | {
|
|
35
|
+
operator: 'in';
|
|
36
|
+
value: unknown[];
|
|
37
|
+
};
|
|
38
|
+
export type DataGridEditorType = 'text' | 'number' | 'select';
|
|
39
|
+
export interface DataGridEditableOptions {
|
|
40
|
+
type?: DataGridEditorType;
|
|
41
|
+
min?: number;
|
|
42
|
+
max?: number;
|
|
43
|
+
step?: number;
|
|
44
|
+
options?: Array<string | number | {
|
|
45
|
+
label: string;
|
|
46
|
+
value: unknown;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
export interface DataGridEditorContext {
|
|
50
|
+
item: DataGridItem;
|
|
51
|
+
column: DataGridColumn;
|
|
52
|
+
value: unknown;
|
|
53
|
+
commit: (value: unknown) => void;
|
|
54
|
+
cancel: () => void;
|
|
55
|
+
labels: DataGridLabels;
|
|
56
|
+
}
|
|
57
|
+
export interface DataGridEditor {
|
|
58
|
+
element: HTMLElement;
|
|
59
|
+
contains?: (target: Node) => boolean;
|
|
60
|
+
dispose?: () => void;
|
|
61
|
+
focus?: () => void;
|
|
62
|
+
getValue?: () => unknown;
|
|
63
|
+
popup?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export type DataGridEditorFactory = (context: DataGridEditorContext) => DataGridEditor;
|
|
66
|
+
export interface DataGridEditCommitEvent {
|
|
67
|
+
item: DataGridItem;
|
|
68
|
+
columnId: string;
|
|
69
|
+
value: unknown;
|
|
70
|
+
previousValue: unknown;
|
|
71
|
+
}
|
|
72
|
+
export interface DataGridColumn<TFeatures extends TableFeatures = DataGridFeatures> {
|
|
73
|
+
key: string;
|
|
74
|
+
editable?: boolean | DataGridEditableOptions;
|
|
75
|
+
editor?: DataGridEditorFactory;
|
|
76
|
+
editValidate?: (value: unknown, item: DataGridItem) => true | string;
|
|
77
|
+
filter?: DataGridColumnFilterFactory<TFeatures>;
|
|
78
|
+
filterable?: boolean;
|
|
79
|
+
filterFn?: (value: unknown, filterValue: unknown, item: DataGridItem) => boolean;
|
|
80
|
+
filterType?: DataGridFilterType;
|
|
81
|
+
formatter?: (value: unknown, item: DataGridItem) => string;
|
|
82
|
+
hideable?: boolean;
|
|
83
|
+
label?: string;
|
|
84
|
+
movable?: boolean;
|
|
85
|
+
render?: (item: DataGridItem, index: number) => Node | string;
|
|
86
|
+
resizable?: boolean;
|
|
87
|
+
sortable?: boolean;
|
|
88
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
89
|
+
width?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface DataGridMenuAction {
|
|
92
|
+
key: string;
|
|
93
|
+
label: string;
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
group?: string;
|
|
96
|
+
icon?: string;
|
|
97
|
+
run: () => void;
|
|
98
|
+
}
|
|
99
|
+
export interface DataGridColumnMenuContext {
|
|
100
|
+
column: DataGridColumn;
|
|
101
|
+
defaultActions: DataGridMenuAction[];
|
|
102
|
+
}
|
|
103
|
+
export type DataGridColumnMenuBuilder = (context: DataGridColumnMenuContext) => DataGridMenuAction[];
|
|
104
|
+
export interface DataGridLabels {
|
|
105
|
+
addCondition: string;
|
|
106
|
+
applyFilter: string;
|
|
107
|
+
clearFilter: string;
|
|
108
|
+
clearSort: string;
|
|
109
|
+
columnMenu: string;
|
|
110
|
+
filterAction: string;
|
|
111
|
+
filterColumn: string;
|
|
112
|
+
firstPage: string;
|
|
113
|
+
globalFilterLabel: string;
|
|
114
|
+
globalFilterPlaceholder: string;
|
|
115
|
+
hideColumn: string;
|
|
116
|
+
itemsInfo: string;
|
|
117
|
+
joinAnd: string;
|
|
118
|
+
joinOr: string;
|
|
119
|
+
lastPage: string;
|
|
120
|
+
loadError: string;
|
|
121
|
+
loading: string;
|
|
122
|
+
moveEnd: string;
|
|
123
|
+
moveStart: string;
|
|
124
|
+
nextPage: string;
|
|
125
|
+
operatorBetween: string;
|
|
126
|
+
operatorBlank: string;
|
|
127
|
+
operatorContains: string;
|
|
128
|
+
operatorEndsWith: string;
|
|
129
|
+
operatorEquals: string;
|
|
130
|
+
operatorGreaterThan: string;
|
|
131
|
+
operatorGreaterThanOrEqual: string;
|
|
132
|
+
operatorLessThan: string;
|
|
133
|
+
operatorLessThanOrEqual: string;
|
|
134
|
+
operatorNotBlank: string;
|
|
135
|
+
operatorNotContains: string;
|
|
136
|
+
operatorNotEquals: string;
|
|
137
|
+
operatorStartsWith: string;
|
|
138
|
+
pageSizeLabel: string;
|
|
139
|
+
paginationLabel: string;
|
|
140
|
+
pinEnd: string;
|
|
141
|
+
pinStart: string;
|
|
142
|
+
previousPage: string;
|
|
143
|
+
redoneAnnouncement: string;
|
|
144
|
+
reorderRow: string;
|
|
145
|
+
resetColumns: string;
|
|
146
|
+
resultsAnnouncement: string;
|
|
147
|
+
searchValues: string;
|
|
148
|
+
selectAllRows: string;
|
|
149
|
+
selectAllValues: string;
|
|
150
|
+
selectRow: string;
|
|
151
|
+
showAllColumns: string;
|
|
152
|
+
sortAscending: string;
|
|
153
|
+
sortDescending: string;
|
|
154
|
+
toolbarColumns: string;
|
|
155
|
+
toolbarExport: string;
|
|
156
|
+
toolbarPrint: string;
|
|
157
|
+
toolbarRedo: string;
|
|
158
|
+
toolbarUndo: string;
|
|
159
|
+
undoneAnnouncement: string;
|
|
160
|
+
unpin: string;
|
|
161
|
+
}
|
|
162
|
+
export interface DataGridColumnSizingOptions {
|
|
163
|
+
mode?: 'onChange' | 'onEnd';
|
|
164
|
+
}
|
|
165
|
+
export interface DataGridSlotContext<TFeatures extends TableFeatures = DataGridFeatures> {
|
|
166
|
+
table: DataGridTable<TFeatures>;
|
|
167
|
+
labels: DataGridLabels;
|
|
168
|
+
}
|
|
169
|
+
export interface DataGridSlot {
|
|
170
|
+
element: HTMLElement;
|
|
171
|
+
update?: () => void;
|
|
172
|
+
dispose?: () => void;
|
|
173
|
+
}
|
|
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>;
|
|
179
|
+
}
|
|
180
|
+
export interface DataGridToolbarOptions {
|
|
181
|
+
columns?: boolean;
|
|
182
|
+
export?: boolean | DataGridExportOptions;
|
|
183
|
+
history?: boolean;
|
|
184
|
+
print?: boolean;
|
|
185
|
+
search?: boolean;
|
|
186
|
+
}
|
|
187
|
+
export interface DataGridSortingOptions {
|
|
188
|
+
multiple?: boolean;
|
|
189
|
+
resetable?: boolean;
|
|
190
|
+
}
|
|
191
|
+
export type DataGridSorterVisibility = 'always' | 'hover' | false;
|
|
192
|
+
export interface DataGridRowSelectionOptions {
|
|
193
|
+
selectAll?: boolean;
|
|
194
|
+
}
|
|
195
|
+
export interface DataGridPaginationInfoState {
|
|
196
|
+
pageCount: number;
|
|
197
|
+
pageIndex: number;
|
|
198
|
+
pageSize: number;
|
|
199
|
+
totalRows: number;
|
|
200
|
+
}
|
|
201
|
+
export interface DataGridInfiniteScrollOptions {
|
|
202
|
+
pageSize?: number;
|
|
203
|
+
threshold?: number;
|
|
204
|
+
}
|
|
205
|
+
export interface DataGridPaginationOptions {
|
|
206
|
+
info?: boolean | ((state: DataGridPaginationInfoState) => string);
|
|
207
|
+
pageSize?: number;
|
|
208
|
+
pageSizeOptions?: number[];
|
|
209
|
+
position?: 'top' | 'bottom' | 'both';
|
|
210
|
+
}
|
|
211
|
+
export interface DataGridState {
|
|
212
|
+
columnFilters: ColumnFiltersState;
|
|
213
|
+
columnOrder: ColumnOrderState;
|
|
214
|
+
columnPinning: ColumnPinningState;
|
|
215
|
+
columnSizing: ColumnSizingState;
|
|
216
|
+
columnVisibility: ColumnVisibilityState;
|
|
217
|
+
globalFilter: string;
|
|
218
|
+
pagination: PaginationState;
|
|
219
|
+
rowSelection: RowSelectionState;
|
|
220
|
+
sorting: SortingState;
|
|
221
|
+
}
|
|
222
|
+
export interface DataGridDataRequest {
|
|
223
|
+
columnFilters: ColumnFiltersState;
|
|
224
|
+
globalFilter: string;
|
|
225
|
+
pagination: PaginationState;
|
|
226
|
+
sorting: SortingState;
|
|
227
|
+
}
|
|
228
|
+
export interface DataGridDataResponse {
|
|
229
|
+
items: DataGridItem[];
|
|
230
|
+
totalRows: number;
|
|
231
|
+
}
|
|
232
|
+
export interface DataGridOptions<TFeatures extends TableFeatures = DataGridFeatures> {
|
|
233
|
+
autoRowHeight: boolean;
|
|
234
|
+
cellNavigation: boolean;
|
|
235
|
+
cellSelection: boolean;
|
|
236
|
+
columnFilters: boolean;
|
|
237
|
+
columnMenu: boolean | DataGridColumnMenuBuilder;
|
|
238
|
+
columnMenuIcon: string;
|
|
239
|
+
columnOrder: boolean | ColumnOrderState;
|
|
240
|
+
columnPinning: boolean | DataGridColumnPinning;
|
|
241
|
+
columnSizing: boolean | DataGridColumnSizingOptions;
|
|
242
|
+
columnVisibility: boolean | ColumnVisibilityState;
|
|
243
|
+
columns: Array<DataGridColumn<TFeatures>>;
|
|
244
|
+
dataProvider: ((request: DataGridDataRequest) => Promise<DataGridDataResponse>) | null;
|
|
245
|
+
editing: boolean;
|
|
246
|
+
empty: string | (() => Node | string);
|
|
247
|
+
features: TFeatures | null;
|
|
248
|
+
filterIcon: string;
|
|
249
|
+
globalFilter: boolean;
|
|
250
|
+
hideColumnIcon: string;
|
|
251
|
+
history: boolean;
|
|
252
|
+
infiniteScroll: boolean | DataGridInfiniteScrollOptions;
|
|
253
|
+
itemKey: ((item: DataGridItem, index: number) => string) | null;
|
|
254
|
+
items: DataGridItem[];
|
|
255
|
+
labels: Partial<DataGridLabels>;
|
|
256
|
+
moveEndIcon: string;
|
|
257
|
+
moveStartIcon: string;
|
|
258
|
+
overscan: number;
|
|
259
|
+
pagination: boolean | DataGridPaginationOptions;
|
|
260
|
+
pinEndIcon: string;
|
|
261
|
+
pinStartIcon: string;
|
|
262
|
+
printTitle: string | null;
|
|
263
|
+
rowHandleIcon: string;
|
|
264
|
+
rowHeight: number;
|
|
265
|
+
rowOrder: boolean;
|
|
266
|
+
rowSelection: boolean | DataGridRowSelectionOptions;
|
|
267
|
+
sanitize: boolean;
|
|
268
|
+
sanitizeFn: ((html: string) => string) | null;
|
|
269
|
+
slots: Partial<DataGridSlots<TFeatures>>;
|
|
270
|
+
sortAscendingIcon: string;
|
|
271
|
+
sortDescendingIcon: string;
|
|
272
|
+
sortNeutralIcon: string;
|
|
273
|
+
sorterVisibility: DataGridSorterVisibility;
|
|
274
|
+
sorting: boolean | DataGridSortingOptions;
|
|
275
|
+
stateKey: string | null;
|
|
276
|
+
toolbar: boolean | DataGridToolbarOptions;
|
|
277
|
+
toolbarColumnsIcon: string;
|
|
278
|
+
toolbarExportIcon: string;
|
|
279
|
+
toolbarPrintIcon: string;
|
|
280
|
+
toolbarRedoIcon: string;
|
|
281
|
+
toolbarUndoIcon: string;
|
|
282
|
+
unpinIcon: string;
|
|
283
|
+
virtualization: boolean;
|
|
284
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/body.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { GridVirtualizerInstance } from '../engine/virtualizer.mjs';
|
|
8
|
+
import type { DataGridColumn, DataGridLabels, DataGridRow } from '../types.mjs';
|
|
9
|
+
import { type GridPinning } from './pinning.mjs';
|
|
10
|
+
export interface GridBodyContext {
|
|
11
|
+
autoRowHeight: boolean;
|
|
12
|
+
cellNavigation: boolean;
|
|
13
|
+
headerRowCount: number;
|
|
14
|
+
labels: DataGridLabels;
|
|
15
|
+
getDataVersion: () => number;
|
|
16
|
+
getEditingCell: () => {
|
|
17
|
+
rowId: string;
|
|
18
|
+
columnId: string;
|
|
19
|
+
} | null;
|
|
20
|
+
getEditorElement: () => HTMLElement | null;
|
|
21
|
+
getPinning: () => GridPinning | null;
|
|
22
|
+
getRowIndexOffset: () => number;
|
|
23
|
+
getRows: () => DataGridRow[];
|
|
24
|
+
getVisibleColumns: () => DataGridColumn[];
|
|
25
|
+
getVirtualizer: () => GridVirtualizerInstance | null;
|
|
26
|
+
renderEmpty: () => Node | string;
|
|
27
|
+
sanitizeContent: (html: string) => string;
|
|
28
|
+
cellSelection: boolean;
|
|
29
|
+
rowOrder: boolean;
|
|
30
|
+
rowHandleIcon: string;
|
|
31
|
+
selection: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface GridBody {
|
|
34
|
+
element: HTMLTableSectionElement;
|
|
35
|
+
update: () => void;
|
|
36
|
+
}
|
|
37
|
+
export declare const createBody: (context: GridBodyContext) => GridBody;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/column-chooser.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels } from '../types.mjs';
|
|
8
|
+
export interface ColumnChooserColumn {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
canHide: boolean;
|
|
12
|
+
visible: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface GridColumnChooserContext {
|
|
15
|
+
root: HTMLElement;
|
|
16
|
+
labels: DataGridLabels;
|
|
17
|
+
getColumns: () => ColumnChooserColumn[];
|
|
18
|
+
toggleVisibility: (columnId: string, visible: boolean) => void;
|
|
19
|
+
showAll: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
}
|
|
22
|
+
export interface GridColumnChooser {
|
|
23
|
+
toggle: (button: HTMLElement) => void;
|
|
24
|
+
close: () => void;
|
|
25
|
+
dispose: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const createColumnChooser: (context: GridColumnChooserContext) => GridColumnChooser;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/editor.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridEditableOptions, DataGridEditor, DataGridEditorContext } from '../types.mjs';
|
|
8
|
+
export declare const createBuiltInEditor: (options: DataGridEditableOptions, context: DataGridEditorContext) => DataGridEditor;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/filter-menu.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridColumn, DataGridColumnFilterValue, DataGridLabels } from '../types.mjs';
|
|
8
|
+
export interface GridFilterMenuContext {
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
labels: DataGridLabels;
|
|
11
|
+
getColumn: (columnKey: string) => DataGridColumn | null;
|
|
12
|
+
getFacetedValues: (columnKey: string) => unknown[];
|
|
13
|
+
getFilterValue: (columnKey: string) => DataGridColumnFilterValue | undefined;
|
|
14
|
+
applyFilter: (columnKey: string, value?: DataGridColumnFilterValue) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface GridFilterMenu {
|
|
17
|
+
toggle: (button: HTMLElement, columnKey: string) => void;
|
|
18
|
+
close: () => void;
|
|
19
|
+
dispose: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const createFilterMenu: (context: GridFilterMenuContext) => GridFilterMenu;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/header.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridColumn, DataGridLabels, DataGridTable, SortingState } from '../types.mjs';
|
|
8
|
+
import { type GridPinning } from './pinning.mjs';
|
|
9
|
+
export interface GridHeaderContext {
|
|
10
|
+
cellNavigation: boolean;
|
|
11
|
+
columns: DataGridColumn[];
|
|
12
|
+
draggable: boolean;
|
|
13
|
+
filterRow: boolean;
|
|
14
|
+
hasMenu: (column: DataGridColumn) => boolean;
|
|
15
|
+
icons: {
|
|
16
|
+
columnMenu: string;
|
|
17
|
+
filter: string;
|
|
18
|
+
sortAscending: string;
|
|
19
|
+
sortDescending: string;
|
|
20
|
+
sortNeutral: string;
|
|
21
|
+
};
|
|
22
|
+
hasFilterMenu: (column: DataGridColumn) => boolean;
|
|
23
|
+
isFilterable: (column: DataGridColumn) => boolean;
|
|
24
|
+
isResizable: (column: DataGridColumn) => boolean;
|
|
25
|
+
isSortable: (column: DataGridColumn) => boolean;
|
|
26
|
+
labels: DataGridLabels;
|
|
27
|
+
resizable: boolean;
|
|
28
|
+
rowOrder: boolean;
|
|
29
|
+
selection: boolean;
|
|
30
|
+
selectAll: boolean;
|
|
31
|
+
table: DataGridTable;
|
|
32
|
+
}
|
|
33
|
+
export interface GridHeaderState {
|
|
34
|
+
filteredColumns: string[] | null;
|
|
35
|
+
order: string[];
|
|
36
|
+
pinning: GridPinning | null;
|
|
37
|
+
resizingColumn: string | false;
|
|
38
|
+
sizes: Record<string, number> | null;
|
|
39
|
+
sorting: SortingState;
|
|
40
|
+
selectAll: {
|
|
41
|
+
checked: boolean;
|
|
42
|
+
indeterminate: boolean;
|
|
43
|
+
} | null;
|
|
44
|
+
}
|
|
45
|
+
export interface GridHeader {
|
|
46
|
+
element: HTMLTableSectionElement;
|
|
47
|
+
rowCount: number;
|
|
48
|
+
update: (state: GridHeaderState) => void;
|
|
49
|
+
dispose: () => void;
|
|
50
|
+
}
|
|
51
|
+
export declare const createHeader: (context: GridHeaderContext) => GridHeader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/loading.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels } from '../types.mjs';
|
|
8
|
+
export interface GridLoading {
|
|
9
|
+
element: HTMLDivElement;
|
|
10
|
+
setVisible: (visible: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const createLoading: (labels: DataGridLabels, className?: string) => GridLoading;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/menu.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridMenuAction } from '../types.mjs';
|
|
8
|
+
export interface GridMenuContext {
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
getActions: (columnKey: string) => DataGridMenuAction[];
|
|
11
|
+
}
|
|
12
|
+
export interface GridMenu {
|
|
13
|
+
toggle: (button: HTMLElement, columnKey: string) => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
dispose: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const createMenu: (context: GridMenuContext) => GridMenu;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/pagination.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels, DataGridPaginationInfoState } from '../types.mjs';
|
|
8
|
+
export interface GridPaginationContext {
|
|
9
|
+
info: boolean | ((state: DataGridPaginationInfoState) => string);
|
|
10
|
+
labels: DataGridLabels;
|
|
11
|
+
pageSizeOptions: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface GridPagination {
|
|
14
|
+
element: HTMLDivElement;
|
|
15
|
+
update: (state: DataGridPaginationInfoState) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const createPagination: (context: GridPaginationContext) => GridPagination;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/pinning.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export interface PinnedCellInfo {
|
|
8
|
+
side: 'start' | 'end';
|
|
9
|
+
offset: number;
|
|
10
|
+
edge: boolean;
|
|
11
|
+
afterSelect: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface GridPinning {
|
|
14
|
+
columns: Record<string, PinnedCellInfo>;
|
|
15
|
+
select: PinnedCellInfo | null;
|
|
16
|
+
}
|
|
17
|
+
export declare const applyPinnedCell: (cell: HTMLTableCellElement, info: PinnedCellInfo | null) => void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/toolbar.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { CsvDownloadOptions, CsvTable } from '../util/csv.mjs';
|
|
8
|
+
import type { DataGridLabels, DataGridOptions } from '../types.mjs';
|
|
9
|
+
export interface GridToolbarContext {
|
|
10
|
+
labels: DataGridLabels;
|
|
11
|
+
columns: boolean;
|
|
12
|
+
export: boolean;
|
|
13
|
+
history: boolean;
|
|
14
|
+
print: boolean;
|
|
15
|
+
search: boolean;
|
|
16
|
+
icons: {
|
|
17
|
+
columns: string;
|
|
18
|
+
export: string;
|
|
19
|
+
print: string;
|
|
20
|
+
redo: string;
|
|
21
|
+
undo: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface GridToolbar {
|
|
25
|
+
element: HTMLDivElement;
|
|
26
|
+
}
|
|
27
|
+
export type DataGridExporter = (table: CsvTable, options: DataGridExportOptions) => void;
|
|
28
|
+
export interface DataGridExportOptions extends CsvDownloadOptions {
|
|
29
|
+
sheetName?: string;
|
|
30
|
+
exporter?: DataGridExporter;
|
|
31
|
+
}
|
|
32
|
+
export interface ResolvedToolbar {
|
|
33
|
+
columns: boolean;
|
|
34
|
+
export: boolean;
|
|
35
|
+
exportOptions: DataGridExportOptions;
|
|
36
|
+
history: boolean;
|
|
37
|
+
print: boolean;
|
|
38
|
+
search: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare const resolveToolbar: (options: DataGridOptions) => ResolvedToolbar;
|
|
41
|
+
export declare const isGlobalFilterEnabled: (options: DataGridOptions) => boolean;
|
|
42
|
+
export declare const createToolbar: (context: GridToolbarContext) => GridToolbar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/tooltip.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export interface GridTooltip {
|
|
8
|
+
dispose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const createTooltip: (root: HTMLElement) => GridTooltip;
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/clipboard.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridItem } from '../types.mjs';
|
|
8
|
+
export interface ClipboardBounds {
|
|
9
|
+
maxColumnIndex: number;
|
|
10
|
+
maxRowIndex: number;
|
|
11
|
+
minColumnIndex: number;
|
|
12
|
+
minRowIndex: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ClipboardRow {
|
|
15
|
+
getValue: (columnId: string) => unknown;
|
|
16
|
+
original: DataGridItem;
|
|
17
|
+
}
|
|
18
|
+
export interface ClipboardTable {
|
|
19
|
+
getCellSelectionBounds: () => ClipboardBounds[];
|
|
20
|
+
getRowModel: () => {
|
|
21
|
+
rows: ClipboardRow[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ClipboardColumn {
|
|
25
|
+
id: string;
|
|
26
|
+
formatter?: (value: unknown, item: DataGridItem) => string;
|
|
27
|
+
}
|
|
28
|
+
export declare const serializeCellSelection: (table: ClipboardTable, columns: ClipboardColumn[]) => string;
|
|
29
|
+
export declare const copyCellSelection: (table: ClipboardTable, columns: ClipboardColumn[]) => Promise<string>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI util/config.ts
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
|
+
*
|
|
6
|
+
* This is a modified version of the Bootstrap's util/config.ts
|
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
|
+
* --------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Types
|
|
12
|
+
*/
|
|
13
|
+
type ComponentConfig = Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Class definition
|
|
16
|
+
*/
|
|
17
|
+
declare class Config {
|
|
18
|
+
['constructor']: typeof Config;
|
|
19
|
+
static get Default(): ComponentConfig;
|
|
20
|
+
static get DefaultType(): ComponentConfig;
|
|
21
|
+
static get NAME(): string;
|
|
22
|
+
_getConfig(config?: ComponentConfig | null): ComponentConfig;
|
|
23
|
+
_configAfterMerge(config: ComponentConfig): ComponentConfig;
|
|
24
|
+
_mergeConfigObj(config?: ComponentConfig | null, element?: Element): ComponentConfig;
|
|
25
|
+
_typeCheckConfig(config: ComponentConfig, configTypes?: ComponentConfig): void;
|
|
26
|
+
}
|
|
27
|
+
export default Config;
|
|
28
|
+
export type { ComponentConfig };
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/csv.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import { type ExportScope, type ExportTable } from './export-table.mjs';
|
|
8
|
+
export interface CsvOptions {
|
|
9
|
+
scope?: ExportScope;
|
|
10
|
+
delimiter?: string;
|
|
11
|
+
bom?: boolean;
|
|
12
|
+
sanitize?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CsvDownloadOptions extends CsvOptions {
|
|
15
|
+
filename?: string;
|
|
16
|
+
}
|
|
17
|
+
export type CsvTable = ExportTable;
|
|
18
|
+
export declare const exportCsv: (table: CsvTable, options?: CsvOptions) => string;
|
|
19
|
+
export declare const downloadCsv: (table: CsvTable, options?: CsvDownloadOptions) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/debounce.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export declare const debounce: <Args extends unknown[]>(callback: (...args: Args) => void, delay: number) => ((...args: Args) => void);
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/direction.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export declare const isElementRTL: (element: Element | null | undefined) => boolean;
|
|
8
|
+
interface ResizeDirectionTable {
|
|
9
|
+
options: {
|
|
10
|
+
columnResizeDirection?: 'ltr' | 'rtl';
|
|
11
|
+
};
|
|
12
|
+
setOptions: (updater: (previous: {
|
|
13
|
+
columnResizeDirection?: 'ltr' | 'rtl';
|
|
14
|
+
}) => never) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const syncResizeDirection: (table: ResizeDirectionTable, element: Element | null | undefined) => void;
|
|
17
|
+
export {};
|