@dhtmlx/grid 9.3.11 → 9.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/README.md +1 -1
- package/codebase/grid.min.css +1 -1
- package/codebase/grid.min.js +3 -3
- package/codebase/grid.min.js.map +1 -1
- package/codebase/types/ts-calendar/sources/Calendar.d.ts +6 -0
- package/codebase/types/ts-calendar/sources/helper.d.ts +1 -0
- package/codebase/types/ts-calendar/sources/types.d.ts +3 -0
- package/codebase/types/ts-common/date.d.ts +2 -0
- package/codebase/types/ts-data/sources/datacollection/group.d.ts +11 -0
- package/codebase/types/ts-data/sources/datacollection.d.ts +84 -3
- package/codebase/types/ts-data/sources/methods.d.ts +8 -3
- package/codebase/types/ts-data/sources/treecollection.d.ts +99 -0
- package/codebase/types/ts-data/sources/types.d.ts +12 -2
- package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +3 -1
- package/codebase/types/ts-grid/sources/Grid.d.ts +12 -2
- package/codebase/types/ts-grid/sources/helpers/cells.d.ts +7 -1
- package/codebase/types/ts-grid/sources/helpers/data.d.ts +16 -1
- package/codebase/types/ts-grid/sources/helpers/default.d.ts +1 -0
- package/codebase/types/ts-grid/sources/helpers/dom.d.ts +3 -0
- package/codebase/types/ts-grid/sources/helpers/zoneFocus.d.ts +25 -4
- package/codebase/types/ts-grid/sources/locales/en.d.ts +0 -2
- package/codebase/types/ts-grid/sources/modules/ActiveCell.d.ts +26 -0
- package/codebase/types/ts-grid/sources/modules/History.d.ts +4 -0
- package/codebase/types/ts-grid/sources/modules/Selection.d.ts +5 -6
- package/codebase/types/ts-grid/sources/types.d.ts +82 -5
- package/codebase/types/ts-grid/sources/ui/cells.d.ts +28 -1
- package/codebase/types/ts-grid/sources/ui/content/ComboFilter.d.ts +1 -0
- package/codebase/types/ts-grid/sources/ui/content/SelectFilter.d.ts +1 -0
- package/codebase/types/ts-grid/sources/ui/content.d.ts +6 -2
- package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +1 -0
- package/codebase/types/ts-grid/sources/ui/proContent.d.ts +3 -16
- package/codebase/types/ts-layout/sources/Cell.d.ts +10 -0
- package/codebase/types/ts-layout/sources/helpers/constants.d.ts +2 -0
- package/codebase/types/ts-layout/sources/{helpers.d.ts → helpers/helpers.d.ts} +1 -1
- package/codebase/types/ts-layout/sources/types.d.ts +2 -1
- package/codebase/types/ts-message/sources/locales/en.d.ts +4 -0
- package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +0 -2
- package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +2 -1
- package/package.json +1 -1
- package/whatsnew.txt +93 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IEventSystem } from "../../../ts-common/events";
|
|
2
2
|
import { IExtendedGrid, IProGrid, IRow } from "../types";
|
|
3
|
+
import { Id } from "../../../ts-common/types";
|
|
3
4
|
export type ActionType = "add" | "remove" | "removeAll" | "change";
|
|
4
5
|
export interface IAction {
|
|
5
6
|
type: ActionType;
|
|
@@ -45,6 +46,8 @@ export interface IHistory {
|
|
|
45
46
|
enable(): void;
|
|
46
47
|
isDisabled(): boolean;
|
|
47
48
|
destructor(): void;
|
|
49
|
+
/** @internal Retarget the stored actions after a row id has been changed */
|
|
50
|
+
remapId(oldId: Id, newId: Id): void;
|
|
48
51
|
}
|
|
49
52
|
export declare class History implements IHistory {
|
|
50
53
|
config: IHistoryConfig;
|
|
@@ -66,6 +69,7 @@ export declare class History implements IHistory {
|
|
|
66
69
|
enable(): void;
|
|
67
70
|
isDisabled(): boolean;
|
|
68
71
|
destructor(): void;
|
|
72
|
+
remapId(oldId: Id, newId: Id): void;
|
|
69
73
|
private _initConfig;
|
|
70
74
|
private _initHandlers;
|
|
71
75
|
private _fireError;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { VNode } from "../../../ts-common/dom";
|
|
2
2
|
import { IEventSystem } from "../../../ts-common/events";
|
|
3
|
-
import { ICell, IGrid, IRow, ICol, ISelectionType, IProGrid } from "../types";
|
|
3
|
+
import { ICell, IGrid, IRow, ICol, ISelectionType, IProGrid, ICellSource } from "../types";
|
|
4
4
|
import { Id } from "../../../ts-common/types";
|
|
5
5
|
export interface ISelectionConfig {
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
type?: ISelectionType;
|
|
8
8
|
multiSelection?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export interface ISelection {
|
|
10
|
+
export interface ISelection extends ICellSource {
|
|
11
11
|
config?: ISelectionConfig;
|
|
12
|
-
setCell(rowId?: IRow | Id, colId?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
13
|
-
getCell(): ICell | void;
|
|
14
12
|
getCells(): ICell[];
|
|
15
13
|
removeCell(rowId?: Id, colId?: Id): void;
|
|
16
14
|
disable(): void;
|
|
17
15
|
enable(): void;
|
|
18
16
|
isSelectedCell(row: IRow | Id, column?: ICol | Id): boolean;
|
|
19
17
|
toHTML(): VNode | VNode[];
|
|
20
|
-
/** @internal
|
|
21
|
-
|
|
18
|
+
/** @internal Rebuild the id-based cache after a row id has been changed */
|
|
19
|
+
remapRows(): void;
|
|
22
20
|
}
|
|
23
21
|
export declare enum GridSelectionEvents {
|
|
24
22
|
beforeUnSelect = "beforeUnSelect",
|
|
@@ -50,6 +48,7 @@ export declare class Selection implements ISelection {
|
|
|
50
48
|
enable(): void;
|
|
51
49
|
isSelectedCell(row: IRow | Id, column?: ICol | Id): boolean;
|
|
52
50
|
restoreFocus(): void;
|
|
51
|
+
remapRows(): void;
|
|
53
52
|
toHTML(): VNode | VNode[];
|
|
54
53
|
private _setCell;
|
|
55
54
|
private _removeCell;
|
|
@@ -11,15 +11,32 @@ import { IGroupOrder, TDisplayMode } from "../../ts-data/sources/datacollection/
|
|
|
11
11
|
import { IGroupItem } from "./ui/components/groupPanel";
|
|
12
12
|
import { ITreeGrid, ITreeGridConfig } from "../../ts-treegrid";
|
|
13
13
|
import { ISelection } from "./modules/Selection";
|
|
14
|
+
import { IActiveCell } from "./modules/ActiveCell";
|
|
14
15
|
import { IProCell, IViewConstructor } from "../../ts-layout";
|
|
15
16
|
import { IRange, IRangeConfig } from "./modules/Range";
|
|
16
17
|
import { PrefixSums } from "./helpers/PrefixSums";
|
|
17
18
|
import { IBlockSelection, IBlockSelectionConfig } from "./modules/BlockSelection";
|
|
18
19
|
import { IClipboard, IClipboardConfig } from "./modules/Clipboard";
|
|
19
20
|
import { IHistory, IHistoryConfig } from "./modules/History";
|
|
20
|
-
import { IComboFilterConfig, IContentList, IHeaderFilter, IInputFilterConfig } from "./ui/content";
|
|
21
|
+
import { IComboFilterConfig, IContentList, IHeaderFilter, IInputFilterConfig, ISelectFilterConfig } from "./ui/content";
|
|
21
22
|
import { ExportType, ICsvExportConfig, IXlsxExportConfig } from "./modules/Exporter";
|
|
22
23
|
import { IDateFilterConfig, IProContentList, IProHeaderFilter } from "./ui/proContent";
|
|
24
|
+
/**
|
|
25
|
+
* @internal The active-cell contract shared by the selection module and the service active-cell
|
|
26
|
+
* module, so that the key handlers read one position whichever module owns it.
|
|
27
|
+
*/
|
|
28
|
+
export interface ICellSource {
|
|
29
|
+
getCell(): ICell | void;
|
|
30
|
+
setCell(row?: IRow | Id, col?: ICol | Id, ctrlUp?: boolean, shiftUp?: boolean): void;
|
|
31
|
+
restoreFocus(): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @internal Anything that holds the active cell: the grid itself, or a renderer config.
|
|
35
|
+
*/
|
|
36
|
+
export interface ICellSourceHolder {
|
|
37
|
+
selection: ICellSource;
|
|
38
|
+
$activeCell?: IActiveCell;
|
|
39
|
+
}
|
|
23
40
|
export interface IGrid {
|
|
24
41
|
data: IDataCollection;
|
|
25
42
|
name: "grid" | string;
|
|
@@ -29,6 +46,8 @@ export interface IGrid {
|
|
|
29
46
|
content: IContentList | IProContentList;
|
|
30
47
|
keyManager: IKeyManager;
|
|
31
48
|
export: any;
|
|
49
|
+
/** @internal Service module: present only when no selection module is initialized. */
|
|
50
|
+
$activeCell?: IActiveCell;
|
|
32
51
|
paint(): void;
|
|
33
52
|
announce(message: string): void;
|
|
34
53
|
destructor(): void;
|
|
@@ -91,8 +110,8 @@ export interface IGridConfig extends IDragConfig {
|
|
|
91
110
|
height?: number | "auto";
|
|
92
111
|
autoWidth?: boolean;
|
|
93
112
|
rowHeight?: number;
|
|
94
|
-
headerRowHeight?:
|
|
95
|
-
footerRowHeight?:
|
|
113
|
+
headerRowHeight?: TFixedRowHeight;
|
|
114
|
+
footerRowHeight?: TFixedRowHeight;
|
|
96
115
|
footerPosition?: IFooterPosition;
|
|
97
116
|
leftSplit?: number;
|
|
98
117
|
topSplit?: number;
|
|
@@ -107,6 +126,7 @@ export interface IGridConfig extends IDragConfig {
|
|
|
107
126
|
css?: string;
|
|
108
127
|
rowCss?: (row: IRow) => string;
|
|
109
128
|
exportStyles?: boolean | string[];
|
|
129
|
+
ariaLabel?: string;
|
|
110
130
|
selection?: ISelectionType;
|
|
111
131
|
multiselection?: boolean;
|
|
112
132
|
rangeSelection?: boolean | IRangeConfig;
|
|
@@ -148,6 +168,8 @@ export interface IGridConfig extends IDragConfig {
|
|
|
148
168
|
$footerHeight?: number;
|
|
149
169
|
$headerHeightMap?: number[];
|
|
150
170
|
$footerHeightMap?: number[];
|
|
171
|
+
$headerAutoHeightMap?: boolean[];
|
|
172
|
+
$footerAutoHeightMap?: boolean[];
|
|
151
173
|
$totalWidth?: number;
|
|
152
174
|
$totalHeight?: number;
|
|
153
175
|
$rowHeights?: PrefixSums;
|
|
@@ -168,6 +190,7 @@ export interface IGridConfig extends IDragConfig {
|
|
|
168
190
|
$data?: any[];
|
|
169
191
|
$grouped?: IGroupItem[];
|
|
170
192
|
$subRowCells?: Map<Id, ISubRowCell>;
|
|
193
|
+
$cellState?: ICellState;
|
|
171
194
|
}
|
|
172
195
|
export type IProGridConfig = IExtendedGridConfig & ITreeGridConfig;
|
|
173
196
|
export interface IExtendedGridConfig extends IGridConfig {
|
|
@@ -208,6 +231,7 @@ export interface IRendererConfig extends Required<IProGridConfig> {
|
|
|
208
231
|
footerHeight?: number;
|
|
209
232
|
events?: IEventSystem<GridEvents, IEventHandlersMap>;
|
|
210
233
|
selection: any;
|
|
234
|
+
$activeCell?: IActiveCell;
|
|
211
235
|
dropManager: any;
|
|
212
236
|
blockSelection: any;
|
|
213
237
|
range?: IRange;
|
|
@@ -222,6 +246,8 @@ export interface IRendererConfig extends Required<IProGridConfig> {
|
|
|
222
246
|
$renderFrom?: RenderFrom;
|
|
223
247
|
$isDragging?: boolean;
|
|
224
248
|
$rowIndexShift?: number;
|
|
249
|
+
/** @internal only for {@link ICellState.hideSpans} in a grid with rendered spans */
|
|
250
|
+
$spanAreas?: ISpanArea[];
|
|
225
251
|
_events?: IEventSystem<GridSystemEvents>;
|
|
226
252
|
}
|
|
227
253
|
export declare enum GridEvents {
|
|
@@ -426,10 +452,12 @@ export interface ICol {
|
|
|
426
452
|
};
|
|
427
453
|
$uniqueData?: any[];
|
|
428
454
|
$activeFilterData?: any[];
|
|
455
|
+
$filterOptions?: IOption[];
|
|
429
456
|
$index?: number;
|
|
430
457
|
$width?: number;
|
|
431
458
|
$fixedWidth?: boolean;
|
|
432
459
|
$customOptions?: any;
|
|
460
|
+
$rowHeader?: boolean;
|
|
433
461
|
}
|
|
434
462
|
export interface IRow {
|
|
435
463
|
id?: Id;
|
|
@@ -441,6 +469,8 @@ export interface IRow {
|
|
|
441
469
|
$opened?: boolean;
|
|
442
470
|
$subRowHeight?: number;
|
|
443
471
|
$draggable?: boolean;
|
|
472
|
+
$count?: number;
|
|
473
|
+
$totalCount?: number;
|
|
444
474
|
}
|
|
445
475
|
export interface ISpan {
|
|
446
476
|
row: Id;
|
|
@@ -478,7 +508,7 @@ export interface IContent {
|
|
|
478
508
|
export type TContentFilter = "inputFilter" | "selectFilter" | "comboFilter" | "dateFilter";
|
|
479
509
|
export interface IHeader extends IContent {
|
|
480
510
|
content?: TContentFilter;
|
|
481
|
-
filterConfig?: IComboFilterConfig | IInputFilterConfig | IDateFilterConfig;
|
|
511
|
+
filterConfig?: IComboFilterConfig | IInputFilterConfig | IDateFilterConfig | ISelectFilterConfig;
|
|
482
512
|
customFilter?: (item: string | number | Date | Date[], match: string | string[] | Date | Date[]) => boolean;
|
|
483
513
|
headerSort?: boolean;
|
|
484
514
|
sortAs?: SortFunction;
|
|
@@ -523,6 +553,8 @@ export interface IGroup {
|
|
|
523
553
|
panelHeight: number;
|
|
524
554
|
hideableColumns?: boolean;
|
|
525
555
|
showMissed?: boolean | string;
|
|
556
|
+
showEmptyGroups?: boolean;
|
|
557
|
+
counter?: boolean | ((row: IRow) => string);
|
|
526
558
|
fields?: {
|
|
527
559
|
[colId: string]: Omit<IGroupOrder, "by">;
|
|
528
560
|
};
|
|
@@ -603,6 +635,7 @@ export interface IOption {
|
|
|
603
635
|
value: string;
|
|
604
636
|
}
|
|
605
637
|
export type TOption = IOption | string;
|
|
638
|
+
export type TFilterOptions = TOption[] | ((uniqueData: IOption[], col: ICol) => TOption[]);
|
|
606
639
|
export type SortFunction = (cellValue: any) => string | number;
|
|
607
640
|
type MarkFunction = (cell: any, columnCells: any[], row: IRow, column: ICol) => string;
|
|
608
641
|
export interface IMark {
|
|
@@ -629,7 +662,7 @@ export interface ILayoutState {
|
|
|
629
662
|
footerAtBottom: boolean;
|
|
630
663
|
}
|
|
631
664
|
export interface IFixedRowsConfig extends ILayoutState {
|
|
632
|
-
name:
|
|
665
|
+
name: TFixedRowsName;
|
|
633
666
|
position: "top" | "bottom";
|
|
634
667
|
}
|
|
635
668
|
export interface ICoords {
|
|
@@ -654,6 +687,12 @@ export type IDragType = "row" | "column" | "both";
|
|
|
654
687
|
export type AdjustTargetType = "data" | "header" | "footer";
|
|
655
688
|
export type IAdjustBy = AdjustTargetType | boolean;
|
|
656
689
|
export type IFooterPosition = "bottom" | "relative";
|
|
690
|
+
export type TFixedRowsName = "header" | "footer";
|
|
691
|
+
export type TFixedRowHeight = number | (number | "auto")[];
|
|
692
|
+
export interface IFixedRowLevel {
|
|
693
|
+
height: number;
|
|
694
|
+
auto: boolean;
|
|
695
|
+
}
|
|
657
696
|
export interface IAdjustColumns {
|
|
658
697
|
rows: IRow[];
|
|
659
698
|
cols: ICol[];
|
|
@@ -676,4 +715,42 @@ export interface IExportGridCell {
|
|
|
676
715
|
v: string | number;
|
|
677
716
|
s: number;
|
|
678
717
|
}
|
|
718
|
+
/**
|
|
719
|
+
* @internal
|
|
720
|
+
* Cell state supplied by a host product that manages selection and editing itself.
|
|
721
|
+
* When it is set, it is the source of truth for the roving tabindex, `aria-selected`,
|
|
722
|
+
* `aria-readonly` and `aria-multiselectable`, and the grid's own selection module is not
|
|
723
|
+
* consulted. When it is not set, the grid behaves exactly as before.
|
|
724
|
+
*
|
|
725
|
+
* A range is a set of row ids by a set of column ids, so that a cell can be tested with two
|
|
726
|
+
* hash lookups: `getCells` runs per visible cell and again per frozen zone, and the column
|
|
727
|
+
* index of a cell is not recoverable there because the fixed-column zones replace
|
|
728
|
+
* `filteredColumns` and reset `$positions.xStart`.
|
|
729
|
+
*/
|
|
730
|
+
export interface ICellState {
|
|
731
|
+
active?: {
|
|
732
|
+
row: Id;
|
|
733
|
+
col: Id;
|
|
734
|
+
};
|
|
735
|
+
ranges?: Array<{
|
|
736
|
+
rows: Set<Id>;
|
|
737
|
+
cols: Set<Id>;
|
|
738
|
+
}>;
|
|
739
|
+
editable?: boolean;
|
|
740
|
+
multiselectable?: boolean;
|
|
741
|
+
/** Read-only cells in an editable grid: a row id and a set of column ids. */
|
|
742
|
+
readonlyCells?: Map<Id, Set<Id>>;
|
|
743
|
+
/** The first cell of a span shows its content, so the span element and the cells under it are hidden. */
|
|
744
|
+
hideSpans?: boolean;
|
|
745
|
+
}
|
|
746
|
+
/** @internal the cells of a rendered span */
|
|
747
|
+
export interface ISpanArea {
|
|
748
|
+
/** the column id of the first cell */
|
|
749
|
+
column: Id;
|
|
750
|
+
/** the data index range of the rows */
|
|
751
|
+
rowStart: number;
|
|
752
|
+
rowEnd: number;
|
|
753
|
+
/** the column ids */
|
|
754
|
+
columns: Set<string>;
|
|
755
|
+
}
|
|
679
756
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridEvents, GridSystemEvents, ICoords, IGridConfig, IRendererConfig, ISpan, Split } from "../types";
|
|
1
|
+
import { GridEvents, GridSystemEvents, ICellState, ICoords, IGridConfig, IRendererConfig, ISpan, Split } from "../types";
|
|
2
2
|
import { IDataCollection } from "../../../ts-data";
|
|
3
3
|
import { Id } from "../../../ts-common/types";
|
|
4
4
|
type mouseEvents = GridEvents.cellClick | GridEvents.cellMouseOver | GridEvents.cellMouseDown | GridEvents.cellDblClick | GridEvents.cellRightClick;
|
|
@@ -14,6 +14,33 @@ export declare function getHandlers(row: number, column: number, conf: IRenderer
|
|
|
14
14
|
ontouchmove: (number | GridSystemEvents | IRendererConfig | typeof handleMouse)[];
|
|
15
15
|
ontouchend: (number | GridSystemEvents | IRendererConfig | typeof handleMouse)[];
|
|
16
16
|
};
|
|
17
|
+
export interface ISpanExtent {
|
|
18
|
+
column: Id;
|
|
19
|
+
colspan: number;
|
|
20
|
+
rowspan: number;
|
|
21
|
+
}
|
|
22
|
+
/** @internal the per-render-pass answer of {@link resolveCellState} */
|
|
23
|
+
export interface IResolvedCellState {
|
|
24
|
+
/** the row and the column of the only cell that carries `tabindex="0"` */
|
|
25
|
+
tabRow: Id;
|
|
26
|
+
tabCol: Id;
|
|
27
|
+
readonly: "true" | "false";
|
|
28
|
+
/** the cells a host reports as read-only in an editable grid */
|
|
29
|
+
readonlyCells: ICellState["readonlyCells"];
|
|
30
|
+
/** whether `aria-selected` belongs on a cell at all — it does not in row selection mode */
|
|
31
|
+
exposeSelected: boolean;
|
|
32
|
+
isSelected: (rowId: Id, colId: Id) => boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolves everything the cell renderers need to know about selection, focus and editability,
|
|
36
|
+
* once per render pass. This is the hottest path in the product — `getCells` runs per visible
|
|
37
|
+
* cell and again for every frozen zone — so the per-cell work left afterwards is two identity
|
|
38
|
+
* comparisons for the tabindex and one call for `aria-selected`.
|
|
39
|
+
*
|
|
40
|
+
* The state comes from `$cellState` when a host product supplies it, and from the grid's own
|
|
41
|
+
* selection module otherwise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveCellState(conf: IRendererConfig): IResolvedCellState;
|
|
17
44
|
export declare function getCells(conf: IRendererConfig): any[];
|
|
18
45
|
export declare function getSpans(config: IRendererConfig, mode?: Split): any[];
|
|
19
46
|
export declare function getShifts(conf: IRendererConfig): ICoords;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VNode } from "../../../ts-common/dom";
|
|
2
|
-
import { ICol, IExtendedGrid, IGrid, IProGrid, IRendererConfig } from "../types";
|
|
2
|
+
import { ICol, IExtendedGrid, IGrid, IProGrid, IRendererConfig, TFilterOptions } from "../types";
|
|
3
3
|
import { DataCollection, IDataItem } from "../../../ts-data";
|
|
4
4
|
import { Combobox } from "../../../ts-combobox";
|
|
5
5
|
import { IEventSystem } from "../../../ts-common/events";
|
|
@@ -12,11 +12,15 @@ export interface IComboFilterConfig {
|
|
|
12
12
|
readonly?: boolean;
|
|
13
13
|
virtual?: boolean;
|
|
14
14
|
multiselection?: boolean;
|
|
15
|
+
options?: TFilterOptions;
|
|
15
16
|
}
|
|
16
17
|
export interface IInputFilterConfig {
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
icon?: string;
|
|
19
20
|
}
|
|
21
|
+
export interface ISelectFilterConfig {
|
|
22
|
+
options?: TFilterOptions;
|
|
23
|
+
}
|
|
20
24
|
export declare enum HeaderFilterEvent {
|
|
21
25
|
change = "change"
|
|
22
26
|
}
|
|
@@ -27,7 +31,7 @@ export interface IHeaderFilter {
|
|
|
27
31
|
events: IEventSystem<HeaderFilterEvent>;
|
|
28
32
|
data?: string[] | IDataItem[];
|
|
29
33
|
id?: Id;
|
|
30
|
-
filterConfig?: IComboFilterConfig | IInputFilterConfig;
|
|
34
|
+
filterConfig?: IComboFilterConfig | IInputFilterConfig | ISelectFilterConfig;
|
|
31
35
|
getFilter(): VNode | Combobox;
|
|
32
36
|
setValue(value: string | string[], silent?: boolean): void;
|
|
33
37
|
clear(silent?: boolean): void;
|
|
@@ -29,6 +29,7 @@ export declare class DateEditor implements IEditor {
|
|
|
29
29
|
thisMonthOnly?: boolean;
|
|
30
30
|
width?: string | number;
|
|
31
31
|
$rangeMark?: (a: Date) => string;
|
|
32
|
+
controls?: boolean | import("../../../../ts-calendar").TCalendarControlsInput[];
|
|
32
33
|
block?: (a: Date) => boolean;
|
|
33
34
|
view?: import("../../../../ts-calendar").ViewMode;
|
|
34
35
|
};
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { IExtendedGrid, IProGrid } from "../types";
|
|
2
|
-
import { ICellContent, IHeaderFilter } from "./content";
|
|
2
|
+
import { ICellContent, IComboFilterConfig, IHeaderFilter, IInputFilterConfig, ISelectFilterConfig } from "./content";
|
|
3
3
|
import { VNode } from "../../../ts-common/dom";
|
|
4
|
-
import { DataCollection, IDataItem } from "../../../ts-data";
|
|
5
4
|
import { Calendar, ICalendarConfig } from "../../../ts-calendar";
|
|
6
5
|
import { Combobox } from "../../../ts-combobox";
|
|
7
|
-
export
|
|
8
|
-
template?: (item: IDataItem) => string;
|
|
9
|
-
filter?: (item: IDataItem, input: string) => boolean;
|
|
10
|
-
data?: DataCollection<IDataItem> | IDataItem[];
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
readonly?: boolean;
|
|
13
|
-
virtual?: boolean;
|
|
14
|
-
multiselection?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface IInputFilterConfig {
|
|
17
|
-
placeholder?: string;
|
|
18
|
-
icon?: string;
|
|
19
|
-
}
|
|
6
|
+
export { IComboFilterConfig, IInputFilterConfig, ISelectFilterConfig } from "./content";
|
|
20
7
|
export interface IDateFilterConfig extends Omit<ICalendarConfig, "value" | "css" | "$rangeMark"> {
|
|
21
8
|
icon?: string;
|
|
22
9
|
placeholder?: string;
|
|
@@ -24,7 +11,7 @@ export interface IDateFilterConfig extends Omit<ICalendarConfig, "value" | "css"
|
|
|
24
11
|
}
|
|
25
12
|
export interface IProHeaderFilter extends Omit<IHeaderFilter, "value" | "filterConfig"> {
|
|
26
13
|
value: string | string[] | Date | Date[];
|
|
27
|
-
filterConfig?: IComboFilterConfig | IDateFilterConfig | IInputFilterConfig;
|
|
14
|
+
filterConfig?: IComboFilterConfig | IDateFilterConfig | IInputFilterConfig | ISelectFilterConfig;
|
|
28
15
|
getFilter(): VNode | Combobox | Calendar;
|
|
29
16
|
setValue(value: string | string[] | Date | Date[], silent?: boolean): void;
|
|
30
17
|
}
|
|
@@ -19,6 +19,7 @@ export declare class Cell extends View implements ICell {
|
|
|
19
19
|
protected _theme: string;
|
|
20
20
|
private _isLastFlexCell;
|
|
21
21
|
private _afterWindowResized;
|
|
22
|
+
private _headerSize;
|
|
22
23
|
constructor(parent: string | HTMLElement | ILayout, config: ICellConfig);
|
|
23
24
|
paint(): void;
|
|
24
25
|
isVisible(): boolean;
|
|
@@ -39,11 +40,20 @@ export declare class Cell extends View implements ICell {
|
|
|
39
40
|
progressHide(): void;
|
|
40
41
|
isVisibleProgress(): boolean;
|
|
41
42
|
toVDOM(nodes?: any[]): any;
|
|
43
|
+
protected _renderHeader(): any;
|
|
44
|
+
protected _isRotatedHeader(): boolean;
|
|
45
|
+
protected _getHeaderStyle(): {
|
|
46
|
+
height?: number;
|
|
47
|
+
minWidth?: number;
|
|
48
|
+
};
|
|
49
|
+
protected _saveHeaderSize(): void;
|
|
50
|
+
protected _renderCellHeaderContent(): any;
|
|
42
51
|
protected _saveTheme(): void;
|
|
43
52
|
protected _getProgressBar(): any;
|
|
44
53
|
protected _getCss(_content?: boolean): string;
|
|
45
54
|
protected _initHandlers(): void;
|
|
46
55
|
protected _getCollapsedSize(cell: ICell, nextCell: ICell): number;
|
|
56
|
+
protected _getCellSize(cell: any): number;
|
|
47
57
|
protected _getCollapseIcon(): "dxi dxi-chevron-down" | "dxi dxi-chevron-right" | "dxi dxi-chevron-left" | "dxi dxi-chevron-up";
|
|
48
58
|
protected _isLastCell(): boolean;
|
|
49
59
|
protected _getNextCell(): any;
|
|
@@ -4,11 +4,12 @@ import { IEventSystem } from "../../ts-common/events";
|
|
|
4
4
|
import { FlexDirection } from "../../ts-common/html";
|
|
5
5
|
import { ScrollView } from "../../ts-common/ScrollView";
|
|
6
6
|
import { TLabelAlignment } from "../../ts-common/types";
|
|
7
|
+
export type TCellHeaderTemplate = (cell: ICellConfig) => string | IView;
|
|
7
8
|
export interface ICellConfig {
|
|
8
9
|
id?: string;
|
|
9
10
|
html?: string;
|
|
10
11
|
hidden?: boolean;
|
|
11
|
-
header?: string;
|
|
12
|
+
header?: string | TCellHeaderTemplate;
|
|
12
13
|
headerIcon?: string;
|
|
13
14
|
headerImage?: string;
|
|
14
15
|
headerHeight?: number;
|
|
@@ -19,8 +19,6 @@ export declare class TreeGrid extends ExtendedGrid implements ITreeGrid {
|
|
|
19
19
|
getSpan(rowId: Id, colId: Id): ISpan;
|
|
20
20
|
protected _adjustColumnsWidth({ rows, cols, totalCols, adjust, }: IAdjustColumns): IColumnsWidth;
|
|
21
21
|
protected _createCollection(): void;
|
|
22
|
-
protected _getRowIndex(rowId: Id): number;
|
|
23
22
|
protected _applyLocalFilter(beforePrepareData?: boolean): void;
|
|
24
23
|
protected _setEventHandlers(): void;
|
|
25
|
-
private _serialize;
|
|
26
24
|
}
|
|
@@ -16,6 +16,7 @@ export declare class TreeGridCollection extends TreeCollection {
|
|
|
16
16
|
protected _addToOrder(_order: any, obj: any, index: number): void;
|
|
17
17
|
protected _removeCore(id: Id): void;
|
|
18
18
|
protected _setParent(item: IDataItem, parent: Id): void;
|
|
19
|
-
|
|
19
|
+
protected _recalculateGroups(): void;
|
|
20
|
+
protected _checkItems(): void;
|
|
20
21
|
protected _moveItem(id: any, targetId: any, index: any): void;
|
|
21
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhtmlx/grid",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"description": "DHTMLX Grid - JavaScript data grid library. GPL v2 edition for GPL-compatible open-source projects; commercial licenses are available for proprietary and production use.",
|
|
5
5
|
"keywords": ["dhtmlx","grid","datagrid","table","treegrid","data-table","javascript","typescript"],
|
|
6
6
|
"homepage":"https://docs.dhtmlx.com/suite/grid/",
|
package/whatsnew.txt
CHANGED
|
@@ -1,3 +1,96 @@
|
|
|
1
|
+
## Version 9.4 (October 22, 2026)
|
|
2
|
+
|
|
3
|
+
### New functionality
|
|
4
|
+
|
|
5
|
+
#### DataCollection/TreeCollection
|
|
6
|
+
|
|
7
|
+
- The ability to get the position of an item among the visible ones
|
|
8
|
+
- new DataCollection method: `getVisibleIndex()`
|
|
9
|
+
- new TreeCollection method: `getVisibleIndex()`
|
|
10
|
+
|
|
11
|
+
#### Grid
|
|
12
|
+
|
|
13
|
+
- The ability to set an individual height for each row of the header/footer, including the *"auto"* value that adjusts a row to its content (PRO version)
|
|
14
|
+
- updated Grid configuration properties: `headerRowHeight` and `footerRowHeight`
|
|
15
|
+
- Group counters with the possibility to define the text rendered next to the group name and to keep the groups that are left with no rows after filtering (PRO version)
|
|
16
|
+
- new properties of the Grid `group` configuration object: `counter` and `showEmptyGroups`
|
|
17
|
+
- new property of the configuration object of the DataCollection `group()` method: `showEmptyGroups`
|
|
18
|
+
- service properties of a group header row: `$count`, `$totalCount`, `$by`
|
|
19
|
+
- The ability to define the options of a header/footer filter manually instead of building them from the column data
|
|
20
|
+
- new property of the `filterConfig` object of **selectFilter** and **comboFilter**: `options`
|
|
21
|
+
|
|
22
|
+
#### Accessibility
|
|
23
|
+
|
|
24
|
+
- The ability to set the accessible name of a widget, which a screen reader announces to the user, with the new `ariaLabel` configuration property of the following widgets:
|
|
25
|
+
- Grid - names a grid, so that several grids on one page can be told apart
|
|
26
|
+
|
|
27
|
+
### Updates
|
|
28
|
+
|
|
29
|
+
- DataCollection. The `changeId()` method returns the new id of the item
|
|
30
|
+
- DataCollection. The `changeId()` method doesn't change the id of an item while the data is grouped. It returns the original id and shows a warning in the browser console
|
|
31
|
+
- Grid. The `headerAutoHeight` and `footerAutoHeight` properties, and the header/footer part of `autoHeight`, are ignored for a zone whose `headerRowHeight`/`footerRowHeight` is set as an array
|
|
32
|
+
|
|
33
|
+
#### Accessibility updates
|
|
34
|
+
|
|
35
|
+
- Grid. Keyboard navigation:
|
|
36
|
+
- `Tab` and `Shift` + `Tab` move cell by cell through the header, the body and the footer and leave the grid at its ends, and the arrow keys move within and between these zones whether or not a selection module is enabled.
|
|
37
|
+
- In a grid without a footer, `Tab` from the last body cell leaves the grid.
|
|
38
|
+
- `Tab` in the header and the footer reaches the columns scrolled out of view instead of skipping them.
|
|
39
|
+
- `Enter`, `Space` and `Shift` + `Enter` on a footer cell don't sort the column.
|
|
40
|
+
- In the selection and block selection modes, the keyboard focus moves to the cells of the frozen columns.
|
|
41
|
+
|
|
42
|
+
- Grid. Screen-reader announcements:
|
|
43
|
+
- The new `announce()` method sends a message to the live region of the grid, so a screen reader announces a status change without moving focus.
|
|
44
|
+
- Sorting, filtering, data loading and the range corrections of a numeric editor are announced through the same live region, and the announced texts are translated through the locale.
|
|
45
|
+
|
|
46
|
+
### Fixes
|
|
47
|
+
|
|
48
|
+
- DataCollection. Fixed removing a group row leaving its items behind and the counters of the groups above it short
|
|
49
|
+
- DataCollection. Fixed changing the id of an item between adding the item and saving the changes, which produced a second save request for the item
|
|
50
|
+
- DataCollection/TreeCollection. Fixed the `avg`, `min` and `max` methods of the `dhx.methods` helper returning `NaN`, `Infinity` and `-Infinity` for an empty set of items instead of `null`
|
|
51
|
+
- DataCollection/TreeCollection. Fixed the counter and the aggregated values of a group staying at the values they had when the grouping was applied. They now follow filtering, adding, removing and updating of items, on every level of a nested grouping
|
|
52
|
+
- DataCollection/TreeCollection. Fixed the group summary rows (`summary: "top"` / `summary: "bottom"`) keeping the aggregates they had before filtering
|
|
53
|
+
- DataCollection/TreeCollection. Fixed filtering breaking the group structure: a rule that did not match a group row dropped that row and its summary row, leaving the items of the group without a header
|
|
54
|
+
- DataCollection/TreeCollection. Fixed a group staying in the collection with a non-zero counter after all its items were filtered out
|
|
55
|
+
- DataCollection/TreeCollection. Fixed the group counters not returning to their original values after `resetFilter()`
|
|
56
|
+
- DataCollection/TreeCollection. Fixed a group staying in the collection after all its items were removed
|
|
57
|
+
- Grid. Fixed the summaries counting the group rows and the group summary rows as data, which doubled the column and common totals in a grouped grid
|
|
58
|
+
- Grid. Fixed the group counters not being recalculated together with the tree structure of the grid
|
|
59
|
+
- Grid. Fixed the spans, the CSS classes added with `addCellCss()` and the selection of a row being lost after the id of the row was changed via `changeId()`
|
|
60
|
+
- Grid. Fixed the undo/redo actions of the History module referring to the old id of a row after the id was changed via `changeId()`
|
|
61
|
+
- Grid. Fixed the keyboard focus being moved back to the active cell after editing ended, when the focus had already gone to the header, the footer or outside the grid
|
|
62
|
+
- Grid. Fixed the `avg`, `min` and `max` summaries of a grid without rows being calculated as `NaN`, `Infinity` and `-Infinity` instead of `null`
|
|
63
|
+
- TreeCollection. Fixed filtering in an ungrouped tree: it skipped the items which carried a `$group` field
|
|
64
|
+
- TreeCollection. Fixed `changeId()` detaching the child items of an item from it, also when a filter was applied
|
|
65
|
+
|
|
66
|
+
### New samples
|
|
67
|
+
|
|
68
|
+
- [Grid. Flexible header and footer row height](https://snippet.dhtmlx.com/bq7koy9z)
|
|
69
|
+
- [Grid. Custom options for header filters](https://snippet.dhtmlx.com/pcrjqux0)
|
|
70
|
+
- [Grid. Group counter after filtering](https://snippet.dhtmlx.com/sbynrizv)
|
|
71
|
+
|
|
72
|
+
# Version 9.3.12 (September 23, 2026)
|
|
73
|
+
|
|
74
|
+
### Updates
|
|
75
|
+
|
|
76
|
+
- Keyboard access to the cell surface:
|
|
77
|
+
- The grid is entered with a single <kbd>Tab</kbd> press, the arrow keys move between cells, and <kbd>Tab</kbd> leaves the grid, as the WAI-ARIA Grid pattern specifies (**WCAG 2.1.1**, **WCAG 2.4.3**).
|
|
78
|
+
- Cells can now be reached with the keyboard in a grid configured without a selection module.
|
|
79
|
+
|
|
80
|
+
- Structure reported to assistive technology:
|
|
81
|
+
- The row number column is announced as a row header, and the sort state is reported only for columns that can be sorted (**WCAG 1.3.1**, **WCAG 4.1.2**).
|
|
82
|
+
- A merged cell reports how many rows and columns it spans.
|
|
83
|
+
|
|
84
|
+
### Fixes
|
|
85
|
+
|
|
86
|
+
- Fixed <kbd>Tab</kbd> not leaving a grid that has frozen (`leftSplit` / `rightSplit`) columns
|
|
87
|
+
- Fixed the focused cell being scrolled one column short of the viewport edge during horizontal keyboard navigation
|
|
88
|
+
- Fixed the focused cell being scrolled behind the footer instead of above it
|
|
89
|
+
- Fixed the doubled focus indicator on a cell that is both focused and selected
|
|
90
|
+
- Fixed cells rendered with `htmlEnable` being announced as buttons in columns without interactive content
|
|
91
|
+
- Corrected the ARIA structure of the grid so that rows and columns are reported reliably, and the focus helpers are no longer exposed as controls
|
|
92
|
+
- Fixed a script error that occurred after closing an inline editor in a grid with column summaries
|
|
93
|
+
|
|
1
94
|
# Version 9.3.11 (September 14, 2026)
|
|
2
95
|
|
|
3
96
|
### Updates
|