@keenmate/web-grid 1.0.0-rc08 → 1.0.0-rc10
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/grid.d.ts +70 -67
- package/dist/modules/contextmenu/index.d.ts +15 -1
- package/dist/modules/navigation/index.d.ts +1 -1
- package/dist/types.d.ts +70 -33
- package/dist/web-component.d.ts +54 -44
- package/dist/web-grid.js +5821 -5441
- package/dist/web-grid.umd.js +273 -235
- package/package.json +78 -78
- package/src/css/_cells.css +13 -2
- package/src/css/_dialogs.css +2 -2
- package/src/css/_dropdown.css +33 -3
- package/src/css/_freeze.css +7 -8
- package/src/css/_header.css +53 -9
- package/src/css/_reorder.css +9 -8
- package/src/css/_resize.css +14 -5
- package/src/css/_table.css +25 -2
- package/src/css/_toolbar.css +7 -7
- package/src/css/_variables.css +37 -7
package/dist/grid.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Column, CellValidationState, RowToolbarConfig, ContextMenuItem, RowShortcut, RowChangeDetail, ToolbarClickDetail, RowActionClickDetail, ContextMenuContext, EditTrigger, EditStartSelection, EditingCell, FocusedCell, SortMode, SortState, DataRequestDetail, DataRequestTrigger, BeforeCommitResult, GridMode, ToggleVisibility, PaginationLabelsCallback, SummaryContentCallback, ValidationTooltipContext, ToolbarPosition, GridLabels, RowLockInfo, RowLockingOptions, RowLockChangeDetail, ColumnWidthState, ColumnResizeDetail, ColumnOrderState, ColumnReorderDetail, FillDragDetail, FillDirection, RangeShortcut } from './types.js';
|
|
1
|
+
import type { Column, CellValidationState, RowToolbarConfig, ContextMenuItem, RowShortcut, RowChangeDetail, ToolbarClickDetail, RowActionClickDetail, ContextMenuContext, HeaderMenuConfig, HeaderMenuContext, EditTrigger, EditStartSelection, EditingCell, FocusedCell, SortMode, SortState, DataRequestDetail, DataRequestTrigger, BeforeCommitResult, GridMode, ToggleVisibility, PaginationLabelsCallback, SummaryContentCallback, ValidationTooltipContext, ToolbarPosition, GridLabels, RowLockInfo, RowLockingOptions, RowLockChangeDetail, ColumnWidthState, ColumnResizeDetail, ColumnOrderState, ColumnReorderDetail, FillDragDetail, FillDirection, RangeShortcut } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* WebGrid - Core logic class for the data grid
|
|
4
4
|
*
|
|
@@ -9,25 +9,25 @@ export declare class WebGrid<T = unknown> {
|
|
|
9
9
|
protected _items: T[];
|
|
10
10
|
protected _columns: Column<T>[];
|
|
11
11
|
protected _sortMode: SortMode;
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
12
|
+
protected _isFilterable: boolean;
|
|
13
|
+
protected _isPageable: boolean;
|
|
14
14
|
protected _pageSize: number;
|
|
15
15
|
protected _pageSizes: number[];
|
|
16
|
-
protected
|
|
17
|
-
protected
|
|
18
|
-
protected
|
|
16
|
+
protected _isStriped: boolean;
|
|
17
|
+
protected _isHoverable: boolean;
|
|
18
|
+
protected _isEditable: boolean;
|
|
19
19
|
protected _editTrigger: EditTrigger;
|
|
20
20
|
protected _editStartSelection: EditStartSelection;
|
|
21
21
|
protected _mode: GridMode;
|
|
22
22
|
protected _dropdownToggleVisibility: ToggleVisibility;
|
|
23
|
-
protected
|
|
24
|
-
protected
|
|
25
|
-
protected
|
|
26
|
-
protected
|
|
27
|
-
protected
|
|
23
|
+
protected _shouldShowDropdownOnFocus: boolean;
|
|
24
|
+
protected _shouldOpenDropdownOnEnter: boolean;
|
|
25
|
+
protected _isCheckboxAlwaysEditable: boolean;
|
|
26
|
+
protected _isRowNumbersVisible: boolean;
|
|
27
|
+
protected _isStickyRowNumbers: boolean;
|
|
28
28
|
protected _freezeColumns: number;
|
|
29
29
|
protected _invalidCells: CellValidationState[];
|
|
30
|
-
protected
|
|
30
|
+
protected _isRowToolbarVisible: boolean;
|
|
31
31
|
protected _rowToolbar: RowToolbarConfig<T>[];
|
|
32
32
|
protected _toolbarVerticalAlign: 'top' | 'center' | 'bottom';
|
|
33
33
|
protected _toolbarHorizontalAlign: 'start' | 'center' | 'end' | 'cursor';
|
|
@@ -37,8 +37,9 @@ export declare class WebGrid<T = unknown> {
|
|
|
37
37
|
protected _contextMenu: ContextMenuItem<T>[] | undefined;
|
|
38
38
|
protected _contextMenuXOffset: number;
|
|
39
39
|
protected _contextMenuYOffset: number;
|
|
40
|
+
protected _headerContextMenu: HeaderMenuConfig<T>[] | undefined;
|
|
40
41
|
protected _rowShortcuts: RowShortcut<T>[] | undefined;
|
|
41
|
-
protected
|
|
42
|
+
protected _isShortcutsHelpVisible: boolean;
|
|
42
43
|
protected _shortcutsHelpPosition: 'top-right' | 'top-left';
|
|
43
44
|
protected _shortcutsHelpContentCallback: (() => string) | undefined;
|
|
44
45
|
protected _idValueMember: keyof T | undefined;
|
|
@@ -47,15 +48,15 @@ export declare class WebGrid<T = unknown> {
|
|
|
47
48
|
protected _externalLocks: Map<unknown, RowLockInfo>;
|
|
48
49
|
protected _onrowlockchange: ((detail: RowLockChangeDetail<T>) => void) | undefined;
|
|
49
50
|
protected _gridName: string | null;
|
|
50
|
-
protected
|
|
51
|
+
protected _shouldPersistColumnWidths: boolean;
|
|
51
52
|
protected _columnWidths: Map<string, string>;
|
|
52
53
|
protected _oncolumnresize: ((detail: ColumnResizeDetail) => void) | undefined;
|
|
53
|
-
protected
|
|
54
|
-
protected
|
|
54
|
+
protected _isColumnReorderAllowed: boolean;
|
|
55
|
+
protected _shouldPersistColumnOrder: boolean;
|
|
55
56
|
protected _columnOrder: Map<string, number>;
|
|
56
57
|
protected _oncolumnreorder: ((detail: ColumnReorderDetail) => void) | undefined;
|
|
57
58
|
protected _fillDirection: FillDirection;
|
|
58
|
-
protected
|
|
59
|
+
protected _fillDragCallback: ((detail: FillDragDetail) => boolean | void) | undefined;
|
|
59
60
|
protected _onrowchange: ((detail: RowChangeDetail<T>) => void) | undefined;
|
|
60
61
|
protected _onroweditstart: ((detail: {
|
|
61
62
|
row: T;
|
|
@@ -77,6 +78,7 @@ export declare class WebGrid<T = unknown> {
|
|
|
77
78
|
protected _ontoolbarclick: ((detail: ToolbarClickDetail<T>) => void) | undefined;
|
|
78
79
|
protected _onrowaction: ((detail: RowActionClickDetail<T>) => void) | undefined;
|
|
79
80
|
protected _oncontextmenuopen: ((context: ContextMenuContext<T>) => void) | undefined;
|
|
81
|
+
protected _onheadercontextmenuopen: ((context: HeaderMenuContext<T>) => void) | undefined;
|
|
80
82
|
protected _ondatarequest: ((detail: DataRequestDetail) => void) | undefined;
|
|
81
83
|
protected _onrowdelete: ((detail: {
|
|
82
84
|
rowIndex: number;
|
|
@@ -93,15 +95,15 @@ export declare class WebGrid<T = unknown> {
|
|
|
93
95
|
protected _summaryPosition?: string;
|
|
94
96
|
protected _summaryContentCallback?: SummaryContentCallback<T>;
|
|
95
97
|
protected _summaryMetadata: unknown;
|
|
96
|
-
protected
|
|
98
|
+
protected _isSummaryInline: boolean;
|
|
97
99
|
protected _customStylesCallback?: () => string;
|
|
98
100
|
protected _rowClassCallback?: (row: T, rowIndex: number) => string | null;
|
|
99
101
|
protected _labels: GridLabels;
|
|
100
|
-
protected
|
|
102
|
+
protected _isVirtualScrollEnabled: boolean;
|
|
101
103
|
protected _virtualScrollThreshold: number;
|
|
102
104
|
protected _virtualScrollRowHeight: number;
|
|
103
105
|
protected _virtualScrollBuffer: number;
|
|
104
|
-
protected
|
|
106
|
+
protected _isInfiniteScrollEnabled: boolean;
|
|
105
107
|
protected _infiniteScrollThreshold: number;
|
|
106
108
|
protected _hasMoreItems: boolean;
|
|
107
109
|
protected _isLoadingMore: boolean;
|
|
@@ -126,20 +128,20 @@ export declare class WebGrid<T = unknown> {
|
|
|
126
128
|
set columns(value: Column<T>[]);
|
|
127
129
|
get sortMode(): SortMode;
|
|
128
130
|
set sortMode(value: SortMode);
|
|
129
|
-
get
|
|
130
|
-
set
|
|
131
|
-
get
|
|
132
|
-
set
|
|
131
|
+
get isFilterable(): boolean;
|
|
132
|
+
set isFilterable(value: boolean);
|
|
133
|
+
get isPageable(): boolean;
|
|
134
|
+
set isPageable(value: boolean);
|
|
133
135
|
get pageSize(): number;
|
|
134
136
|
set pageSize(value: number);
|
|
135
137
|
get pageSizes(): number[];
|
|
136
138
|
set pageSizes(value: number[]);
|
|
137
|
-
get
|
|
138
|
-
set
|
|
139
|
-
get
|
|
140
|
-
set
|
|
141
|
-
get
|
|
142
|
-
set
|
|
139
|
+
get isStriped(): boolean;
|
|
140
|
+
set isStriped(value: boolean);
|
|
141
|
+
get isHoverable(): boolean;
|
|
142
|
+
set isHoverable(value: boolean);
|
|
143
|
+
get isEditable(): boolean;
|
|
144
|
+
set isEditable(value: boolean);
|
|
143
145
|
get editTrigger(): EditTrigger;
|
|
144
146
|
set editTrigger(value: EditTrigger);
|
|
145
147
|
get editStartSelection(): EditStartSelection;
|
|
@@ -152,20 +154,20 @@ export declare class WebGrid<T = unknown> {
|
|
|
152
154
|
* Get effective toggle visibility for a column (column override or grid default)
|
|
153
155
|
*/
|
|
154
156
|
getEffectiveToggleVisibility(column: Column<T>): ToggleVisibility;
|
|
155
|
-
get
|
|
156
|
-
set
|
|
157
|
-
get
|
|
158
|
-
set
|
|
159
|
-
/**
|
|
160
|
-
* Get effective
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
get
|
|
164
|
-
set
|
|
165
|
-
get
|
|
166
|
-
set
|
|
167
|
-
get
|
|
168
|
-
set
|
|
157
|
+
get shouldShowDropdownOnFocus(): boolean;
|
|
158
|
+
set shouldShowDropdownOnFocus(value: boolean);
|
|
159
|
+
get shouldOpenDropdownOnEnter(): boolean;
|
|
160
|
+
set shouldOpenDropdownOnEnter(value: boolean);
|
|
161
|
+
/**
|
|
162
|
+
* Get effective shouldOpenDropdownOnEnter for a column (column override or grid default)
|
|
163
|
+
*/
|
|
164
|
+
getEffectiveShouldOpenDropdownOnEnter(column: Column<T>): boolean;
|
|
165
|
+
get isCheckboxAlwaysEditable(): boolean;
|
|
166
|
+
set isCheckboxAlwaysEditable(value: boolean);
|
|
167
|
+
get isRowNumbersVisible(): boolean;
|
|
168
|
+
set isRowNumbersVisible(value: boolean);
|
|
169
|
+
get isStickyRowNumbers(): boolean;
|
|
170
|
+
set isStickyRowNumbers(value: boolean);
|
|
169
171
|
get freezeColumns(): number;
|
|
170
172
|
set freezeColumns(value: number);
|
|
171
173
|
/**
|
|
@@ -191,8 +193,8 @@ export declare class WebGrid<T = unknown> {
|
|
|
191
193
|
get isValidating(): boolean;
|
|
192
194
|
get currentCellError(): string | null;
|
|
193
195
|
get hoveredRowIndex(): number | null;
|
|
194
|
-
get
|
|
195
|
-
set
|
|
196
|
+
get isRowToolbarVisible(): boolean;
|
|
197
|
+
set isRowToolbarVisible(value: boolean);
|
|
196
198
|
get rowToolbar(): RowToolbarConfig<T>[];
|
|
197
199
|
set rowToolbar(value: RowToolbarConfig<T>[]);
|
|
198
200
|
get toolbarVerticalAlign(): 'top' | 'center' | 'bottom';
|
|
@@ -215,10 +217,12 @@ export declare class WebGrid<T = unknown> {
|
|
|
215
217
|
set contextMenuXOffset(value: number);
|
|
216
218
|
get contextMenuYOffset(): number;
|
|
217
219
|
set contextMenuYOffset(value: number);
|
|
220
|
+
get headerContextMenu(): HeaderMenuConfig<T>[] | undefined;
|
|
221
|
+
set headerContextMenu(value: HeaderMenuConfig<T>[] | undefined);
|
|
218
222
|
get rowShortcuts(): RowShortcut<T>[] | undefined;
|
|
219
223
|
set rowShortcuts(value: RowShortcut<T>[] | undefined);
|
|
220
|
-
get
|
|
221
|
-
set
|
|
224
|
+
get isShortcutsHelpVisible(): boolean;
|
|
225
|
+
set isShortcutsHelpVisible(value: boolean);
|
|
222
226
|
get shortcutsHelpPosition(): 'top-right' | 'top-left';
|
|
223
227
|
set shortcutsHelpPosition(value: 'top-right' | 'top-left');
|
|
224
228
|
get shortcutsHelpContentCallback(): (() => string) | undefined;
|
|
@@ -243,24 +247,24 @@ export declare class WebGrid<T = unknown> {
|
|
|
243
247
|
set summaryContentCallback(value: SummaryContentCallback<T> | undefined);
|
|
244
248
|
get summaryMetadata(): unknown;
|
|
245
249
|
set summaryMetadata(value: unknown);
|
|
246
|
-
get
|
|
247
|
-
set
|
|
250
|
+
get isSummaryInline(): boolean;
|
|
251
|
+
set isSummaryInline(value: boolean);
|
|
248
252
|
get customStylesCallback(): (() => string) | undefined;
|
|
249
253
|
set customStylesCallback(value: (() => string) | undefined);
|
|
250
254
|
get rowClassCallback(): ((row: T, rowIndex: number) => string | null) | undefined;
|
|
251
255
|
set rowClassCallback(value: ((row: T, rowIndex: number) => string | null) | undefined);
|
|
252
256
|
get labels(): GridLabels;
|
|
253
257
|
set labels(value: Partial<GridLabels>);
|
|
254
|
-
get
|
|
255
|
-
set
|
|
258
|
+
get isVirtualScrollEnabled(): boolean;
|
|
259
|
+
set isVirtualScrollEnabled(value: boolean);
|
|
256
260
|
get virtualScrollThreshold(): number;
|
|
257
261
|
set virtualScrollThreshold(value: number);
|
|
258
262
|
get virtualScrollRowHeight(): number;
|
|
259
263
|
set virtualScrollRowHeight(value: number);
|
|
260
264
|
get virtualScrollBuffer(): number;
|
|
261
265
|
set virtualScrollBuffer(value: number);
|
|
262
|
-
get
|
|
263
|
-
set
|
|
266
|
+
get isInfiniteScrollEnabled(): boolean;
|
|
267
|
+
set isInfiniteScrollEnabled(value: boolean);
|
|
264
268
|
get infiniteScrollThreshold(): number;
|
|
265
269
|
set infiniteScrollThreshold(value: number);
|
|
266
270
|
get hasMoreItems(): boolean;
|
|
@@ -271,10 +275,6 @@ export declare class WebGrid<T = unknown> {
|
|
|
271
275
|
* Check if virtual scroll should be used
|
|
272
276
|
*/
|
|
273
277
|
shouldUseVirtualScroll(): boolean;
|
|
274
|
-
get showRowActions(): boolean;
|
|
275
|
-
set showRowActions(value: boolean);
|
|
276
|
-
get rowActions(): RowToolbarConfig<T>[];
|
|
277
|
-
set rowActions(value: RowToolbarConfig<T>[]);
|
|
278
278
|
set onrowchange(value: ((detail: RowChangeDetail<T>) => void) | undefined);
|
|
279
279
|
set onroweditstart(value: ((detail: {
|
|
280
280
|
row: T;
|
|
@@ -298,6 +298,8 @@ export declare class WebGrid<T = unknown> {
|
|
|
298
298
|
set ontoolbarclick(value: ((detail: ToolbarClickDetail<T>) => void) | undefined);
|
|
299
299
|
set onrowaction(value: ((detail: RowActionClickDetail<T>) => void) | undefined);
|
|
300
300
|
set oncontextmenuopen(value: ((context: ContextMenuContext<T>) => void) | undefined);
|
|
301
|
+
get onheadercontextmenuopen(): ((context: HeaderMenuContext<T>) => void) | undefined;
|
|
302
|
+
set onheadercontextmenuopen(value: ((context: HeaderMenuContext<T>) => void) | undefined);
|
|
301
303
|
get ondatarequest(): ((detail: DataRequestDetail) => void) | undefined;
|
|
302
304
|
set ondatarequest(value: ((detail: DataRequestDetail) => void) | undefined);
|
|
303
305
|
get onrowdelete(): ((detail: {
|
|
@@ -318,20 +320,20 @@ export declare class WebGrid<T = unknown> {
|
|
|
318
320
|
set onrowlockchange(value: ((detail: RowLockChangeDetail<T>) => void) | undefined);
|
|
319
321
|
get gridName(): string | null;
|
|
320
322
|
set gridName(value: string | null);
|
|
321
|
-
get
|
|
322
|
-
set
|
|
323
|
+
get shouldPersistColumnWidths(): boolean;
|
|
324
|
+
set shouldPersistColumnWidths(value: boolean);
|
|
323
325
|
get oncolumnresize(): ((detail: ColumnResizeDetail) => void) | undefined;
|
|
324
326
|
set oncolumnresize(value: ((detail: ColumnResizeDetail) => void) | undefined);
|
|
325
|
-
get
|
|
326
|
-
set
|
|
327
|
-
get
|
|
328
|
-
set
|
|
327
|
+
get isColumnReorderAllowed(): boolean;
|
|
328
|
+
set isColumnReorderAllowed(value: boolean);
|
|
329
|
+
get shouldPersistColumnOrder(): boolean;
|
|
330
|
+
set shouldPersistColumnOrder(value: boolean);
|
|
329
331
|
get oncolumnreorder(): ((detail: ColumnReorderDetail) => void) | undefined;
|
|
330
332
|
set oncolumnreorder(value: ((detail: ColumnReorderDetail) => void) | undefined);
|
|
331
333
|
get fillDirection(): FillDirection;
|
|
332
334
|
set fillDirection(value: FillDirection);
|
|
333
|
-
get
|
|
334
|
-
set
|
|
335
|
+
get fillDragCallback(): ((detail: FillDragDetail) => boolean | void) | undefined;
|
|
336
|
+
set fillDragCallback(value: ((detail: FillDragDetail) => boolean | void) | undefined);
|
|
335
337
|
get selectedRows(): number[];
|
|
336
338
|
get rangeShortcuts(): RangeShortcut<T>[];
|
|
337
339
|
set rangeShortcuts(value: RangeShortcut<T>[]);
|
|
@@ -489,8 +491,9 @@ export declare class WebGrid<T = unknown> {
|
|
|
489
491
|
getColumnWidth(field: string): string | undefined;
|
|
490
492
|
/**
|
|
491
493
|
* Set runtime column width override
|
|
494
|
+
* @param skipRender - If true, don't trigger a re-render (useful during resize when DOM is already updated)
|
|
492
495
|
*/
|
|
493
|
-
setColumnWidth(field: string, width: string): void;
|
|
496
|
+
setColumnWidth(field: string, width: string, skipRender?: boolean): void;
|
|
494
497
|
/**
|
|
495
498
|
* Set multiple column widths at once (for restoring saved state)
|
|
496
499
|
* Accepts the same format as oncolumnresize.allWidths
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextMenuItem, ContextMenuContext } from '../../types.js';
|
|
1
|
+
import type { ContextMenuItem, ContextMenuContext, HeaderMenuConfig, HeaderMenuItem, HeaderMenuContext } from '../../types.js';
|
|
2
2
|
import type { GridContext } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Open context menu at position
|
|
@@ -8,3 +8,17 @@ export declare function openContextMenu<T>(ctx: GridContext<T>, x: number, y: nu
|
|
|
8
8
|
* Close context menu and cleanup
|
|
9
9
|
*/
|
|
10
10
|
export declare function closeContextMenu(container: HTMLElement, handleOutsideClick?: (e: MouseEvent) => void, handleKeyDown?: (e: KeyboardEvent) => void): void;
|
|
11
|
+
/**
|
|
12
|
+
* Normalize header menu items (convert string shortcuts to full items)
|
|
13
|
+
* Handles standalone divider markers like { dividerBefore: true } by applying
|
|
14
|
+
* the divider to the next actual item.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeHeaderMenuItems<T>(config: HeaderMenuConfig<T>[], context: HeaderMenuContext<T>): HeaderMenuItem<T>[];
|
|
17
|
+
/**
|
|
18
|
+
* Execute predefined header menu action
|
|
19
|
+
*/
|
|
20
|
+
export declare function executeHeaderMenuAction<T>(ctx: GridContext<T>, actionId: string, menuContext: HeaderMenuContext<T>, ctrlKey?: boolean): void;
|
|
21
|
+
/**
|
|
22
|
+
* Open header context menu at position
|
|
23
|
+
*/
|
|
24
|
+
export declare function openHeaderContextMenu<T>(ctx: GridContext<T>, x: number, y: number, items: HeaderMenuItem<T>[], menuContext: HeaderMenuContext<T>, onItemClick: (itemId: string, keepOpen?: boolean, ctrlKey?: boolean) => void, onClose: () => void): HTMLElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { focusCellElement, updateFocusVisual, clearEditingVisual, handleCellFocus, moveFocus, tryStartEdit, getCursorPositionFromClick, handleTableFocusOut, scrollToRowPosition } from './focus.js';
|
|
1
|
+
export { focusCellElement, updateFocusVisual, clearEditingVisual, restoreEditingCellToDisplayMode, handleCellFocus, moveFocus, tryStartEdit, getCursorPositionFromClick, handleTableFocusOut, scrollToRowPosition } from './focus.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type EditorOptions<T = unknown> = {
|
|
|
41
41
|
emptyLabel?: string;
|
|
42
42
|
noOptionsText?: string;
|
|
43
43
|
searchingText?: string;
|
|
44
|
+
dropdownMinWidth?: string;
|
|
44
45
|
maxLength?: number;
|
|
45
46
|
placeholder?: string;
|
|
46
47
|
pattern?: string;
|
|
@@ -58,7 +59,7 @@ export type EditorOptions<T = unknown> = {
|
|
|
58
59
|
dateFormat?: string;
|
|
59
60
|
outputFormat?: DateOutputFormat;
|
|
60
61
|
initialOptions?: EditorOption[];
|
|
61
|
-
|
|
62
|
+
searchCallback?: (query: string, row: T, signal?: AbortSignal) => Promise<EditorOption[]>;
|
|
62
63
|
minSearchLength?: number;
|
|
63
64
|
debounceMs?: number;
|
|
64
65
|
multiple?: boolean;
|
|
@@ -95,36 +96,41 @@ export type Column<T> = {
|
|
|
95
96
|
field: keyof T | string;
|
|
96
97
|
title: string;
|
|
97
98
|
headerInfo?: string;
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
isSortable?: boolean;
|
|
100
|
+
isFilterable?: boolean;
|
|
100
101
|
width?: string;
|
|
101
102
|
minWidth?: string;
|
|
102
103
|
maxWidth?: string;
|
|
103
104
|
textOverflow?: 'wrap' | 'ellipsis';
|
|
104
|
-
|
|
105
|
+
maxLines?: number;
|
|
106
|
+
horizontalAlign?: "left" | "center" | "right" | "justify";
|
|
107
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
108
|
+
headerHorizontalAlign?: "left" | "center" | "right" | "justify";
|
|
109
|
+
headerVerticalAlign?: "top" | "middle" | "bottom";
|
|
105
110
|
cellClass?: string;
|
|
106
111
|
cellClassCallback?: (value: unknown, row: T) => string | null;
|
|
107
112
|
formatCallback?: (value: unknown, row: T) => string;
|
|
108
113
|
templateCallback?: (row: T) => string;
|
|
109
114
|
renderCallback?: CellRenderCallback<T>;
|
|
110
|
-
|
|
115
|
+
isEditable?: boolean;
|
|
111
116
|
editor?: EditorType;
|
|
112
117
|
editTrigger?: EditTrigger;
|
|
113
118
|
dropdownToggleVisibility?: ToggleVisibility;
|
|
114
|
-
|
|
119
|
+
shouldOpenDropdownOnEnter?: boolean;
|
|
115
120
|
editorOptions?: EditorOptions<T>;
|
|
116
121
|
validateCallback?: (value: unknown, row: T) => string | null | Promise<string | null>;
|
|
117
122
|
beforeCommitCallback?: (context: BeforeCommitContext<T>) => BeforeCommitResult | Promise<BeforeCommitResult>;
|
|
118
123
|
cellEditCallback?: (context: CustomEditorContext<T>) => void;
|
|
119
|
-
|
|
124
|
+
isEditButtonVisible?: boolean;
|
|
120
125
|
tooltipMember?: string;
|
|
121
126
|
tooltipCallback?: (value: unknown, row: T) => string | null;
|
|
122
127
|
beforeCopyCallback?: (value: unknown, row: T) => string;
|
|
123
128
|
beforePasteCallback?: (value: string, row: T) => unknown;
|
|
124
129
|
validationTooltipCallback?: (context: ValidationTooltipContext<T>) => string | null;
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
isFrozen?: boolean;
|
|
131
|
+
isResizable?: boolean;
|
|
127
132
|
fillDirection?: FillDirection;
|
|
133
|
+
isHidden?: boolean;
|
|
128
134
|
};
|
|
129
135
|
export type ValidationTooltipContext<T> = {
|
|
130
136
|
field: string;
|
|
@@ -201,6 +207,30 @@ export type ContextMenuItem<T> = {
|
|
|
201
207
|
dividerBefore?: boolean;
|
|
202
208
|
onclick?: (context: ContextMenuContext<T>) => void | Promise<void>;
|
|
203
209
|
};
|
|
210
|
+
export type HeaderMenuContext<T> = {
|
|
211
|
+
column: Column<T>;
|
|
212
|
+
field: string;
|
|
213
|
+
columnIndex: number;
|
|
214
|
+
sortDirection: 'asc' | 'desc' | null;
|
|
215
|
+
isFrozen: boolean;
|
|
216
|
+
allColumns: Column<T>[];
|
|
217
|
+
labels: GridLabels;
|
|
218
|
+
};
|
|
219
|
+
export type PredefinedHeaderMenuItemType = 'sortAsc' | 'sortDesc' | 'clearSort' | 'hideColumn' | 'freezeColumn' | 'unfreezeColumn' | 'columnVisibility';
|
|
220
|
+
export type HeaderMenuItem<T> = {
|
|
221
|
+
id: string;
|
|
222
|
+
label: string | ((context: HeaderMenuContext<T>) => string);
|
|
223
|
+
icon?: string | ((context: HeaderMenuContext<T>) => string);
|
|
224
|
+
shortcut?: string;
|
|
225
|
+
disabled?: boolean | ((context: HeaderMenuContext<T>) => boolean);
|
|
226
|
+
visible?: boolean | ((context: HeaderMenuContext<T>) => boolean);
|
|
227
|
+
danger?: boolean;
|
|
228
|
+
dividerBefore?: boolean;
|
|
229
|
+
onclick?: (context: HeaderMenuContext<T>) => void | Promise<void>;
|
|
230
|
+
children?: HeaderMenuItem<T>[];
|
|
231
|
+
submenu?: (context: HeaderMenuContext<T>) => HeaderMenuItem<T>[];
|
|
232
|
+
};
|
|
233
|
+
export type HeaderMenuConfig<T> = PredefinedHeaderMenuItemType | HeaderMenuItem<T>;
|
|
204
234
|
export type ShortcutContext<T> = {
|
|
205
235
|
row: T;
|
|
206
236
|
rowIndex: number;
|
|
@@ -236,13 +266,13 @@ export type ParsedKeyCombo = {
|
|
|
236
266
|
export type QuickGridProps<T> = {
|
|
237
267
|
items: T[];
|
|
238
268
|
columns: Column<T>[];
|
|
239
|
-
|
|
240
|
-
|
|
269
|
+
isFilterable?: boolean;
|
|
270
|
+
isPageable?: boolean;
|
|
241
271
|
pageSize?: number;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
272
|
+
isStriped?: boolean;
|
|
273
|
+
isHoverable?: boolean;
|
|
274
|
+
isRowNumbersVisible?: boolean;
|
|
275
|
+
isStickyRowNumbers?: boolean;
|
|
246
276
|
freezeColumns?: number;
|
|
247
277
|
class?: string;
|
|
248
278
|
style?: string;
|
|
@@ -259,40 +289,38 @@ export type QuickGridProps<T> = {
|
|
|
259
289
|
paginationLayout?: string;
|
|
260
290
|
summaryPosition?: string;
|
|
261
291
|
summaryContentCallback?: SummaryContentCallback<T>;
|
|
262
|
-
|
|
263
|
-
|
|
292
|
+
isSummaryInline?: boolean;
|
|
293
|
+
isEditable?: boolean;
|
|
264
294
|
editTrigger?: EditTrigger;
|
|
265
295
|
editStartSelection?: EditStartSelection;
|
|
266
296
|
mode?: GridMode;
|
|
267
297
|
dropdownToggleVisibility?: ToggleVisibility;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
298
|
+
shouldShowDropdownOnFocus?: boolean;
|
|
299
|
+
shouldOpenDropdownOnEnter?: boolean;
|
|
300
|
+
isCheckboxAlwaysEditable?: boolean;
|
|
271
301
|
invalidCells?: CellValidationState[];
|
|
272
|
-
|
|
302
|
+
isRowToolbarVisible?: boolean;
|
|
273
303
|
rowToolbar?: RowToolbarConfig<T>[];
|
|
274
304
|
toolbarVerticalAlign?: 'top' | 'center' | 'bottom';
|
|
275
305
|
toolbarHorizontalAlign?: 'start' | 'center' | 'end' | 'cursor';
|
|
276
306
|
toolbarTrigger?: 'hover' | 'click' | 'button';
|
|
277
307
|
toolbarPosition?: ToolbarPosition;
|
|
278
308
|
inlineActionsTitle?: string;
|
|
279
|
-
showRowActions?: boolean;
|
|
280
|
-
rowActions?: RowToolbarConfig<T>[];
|
|
281
|
-
toolbarAlign?: 'top' | 'center' | 'bottom';
|
|
282
|
-
toolbarTopPosition?: 'start' | 'center' | 'end' | 'cursor';
|
|
283
309
|
contextMenu?: ContextMenuItem<T>[];
|
|
284
310
|
contextMenuXOffset?: number;
|
|
285
311
|
contextMenuYOffset?: number;
|
|
286
312
|
oncontextmenuopen?: (context: ContextMenuContext<T>) => void;
|
|
313
|
+
headerContextMenu?: HeaderMenuConfig<T>[];
|
|
314
|
+
onheadercontextmenuopen?: (context: HeaderMenuContext<T>) => void;
|
|
287
315
|
rowShortcuts?: RowShortcut<T>[];
|
|
288
|
-
|
|
316
|
+
isShortcutsHelpVisible?: boolean;
|
|
289
317
|
shortcutsHelpPosition?: 'top-right' | 'top-left';
|
|
290
318
|
shortcutsHelpContentCallback?: () => string;
|
|
291
|
-
|
|
319
|
+
isVirtualScrollEnabled?: boolean;
|
|
292
320
|
virtualScrollThreshold?: number;
|
|
293
321
|
virtualScrollRowHeight?: number;
|
|
294
322
|
virtualScrollBuffer?: number;
|
|
295
|
-
|
|
323
|
+
isInfiniteScrollEnabled?: boolean;
|
|
296
324
|
infiniteScrollThreshold?: number;
|
|
297
325
|
hasMoreItems?: boolean;
|
|
298
326
|
onrowchange?: (detail: RowChangeDetail<T>) => void;
|
|
@@ -314,19 +342,18 @@ export type QuickGridProps<T> = {
|
|
|
314
342
|
}) => void;
|
|
315
343
|
validationTooltipCallback?: (context: ValidationTooltipContext<T>) => string | null;
|
|
316
344
|
ontoolbarclick?: (detail: ToolbarClickDetail<T>) => void;
|
|
317
|
-
onrowaction?: (detail: RowActionClickDetail<T>) => void;
|
|
318
345
|
ondatarequest?: (detail: DataRequestDetail) => void;
|
|
319
346
|
onrowdelete?: (detail: {
|
|
320
347
|
rowIndex: number;
|
|
321
348
|
row: T;
|
|
322
349
|
}) => void;
|
|
323
350
|
gridName?: string;
|
|
324
|
-
|
|
351
|
+
shouldPersistColumnWidths?: boolean;
|
|
325
352
|
oncolumnresize?: (detail: ColumnResizeDetail) => void;
|
|
326
|
-
|
|
327
|
-
|
|
353
|
+
isColumnReorderAllowed?: boolean;
|
|
354
|
+
shouldPersistColumnOrder?: boolean;
|
|
328
355
|
oncolumnreorder?: (detail: ColumnReorderDetail) => void;
|
|
329
|
-
|
|
356
|
+
fillDragCallback?: (detail: FillDragDetail) => boolean | void;
|
|
330
357
|
};
|
|
331
358
|
export type EditingCell = {
|
|
332
359
|
rowIndex: number;
|
|
@@ -393,6 +420,16 @@ export type GridLabels = {
|
|
|
393
420
|
paginationPerPage: string;
|
|
394
421
|
dropdownNoOptions: string;
|
|
395
422
|
dropdownSearching: string;
|
|
423
|
+
contextMenu: {
|
|
424
|
+
sortAsc: string;
|
|
425
|
+
sortDesc: string;
|
|
426
|
+
clearSort: string;
|
|
427
|
+
hideColumn: string;
|
|
428
|
+
freezeColumn: string;
|
|
429
|
+
unfreezeColumn: string;
|
|
430
|
+
columnVisibility: string;
|
|
431
|
+
showAll: string;
|
|
432
|
+
};
|
|
396
433
|
};
|
|
397
434
|
export type SummaryContext<T> = {
|
|
398
435
|
items: T[];
|