@dhtmlx/grid 9.3.11 → 9.3.12
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-grid/sources/Grid.d.ts +2 -0
- package/codebase/types/ts-grid/sources/helpers/cells.d.ts +7 -1
- package/codebase/types/ts-grid/sources/helpers/zoneFocus.d.ts +10 -0
- package/codebase/types/ts-grid/sources/modules/ActiveCell.d.ts +26 -0
- package/codebase/types/ts-grid/sources/modules/Selection.d.ts +2 -6
- package/codebase/types/ts-grid/sources/types.d.ts +46 -0
- package/codebase/types/ts-grid/sources/ui/cells.d.ts +25 -0
- package/codebase/types/ts-message/sources/locales/en.d.ts +3 -0
- package/package.json +1 -1
- package/whatsnew.txt +22 -0
|
@@ -8,6 +8,7 @@ import { PrefixSums } from "./helpers/PrefixSums";
|
|
|
8
8
|
import { ISelection } from "./modules/Selection";
|
|
9
9
|
import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, SortFunction, IAdjustColumns, IDirection, IFooter, IHeader, INormalizeColumnsParams, ISummaryList, ISortingStates } from "./types";
|
|
10
10
|
import { IContentList, IHeaderFilter } from "./ui/content";
|
|
11
|
+
import { IActiveCell } from "./modules/ActiveCell";
|
|
11
12
|
import { IProContentList } from "./ui/proContent";
|
|
12
13
|
export declare class Grid extends View implements IGrid {
|
|
13
14
|
version: string;
|
|
@@ -19,6 +20,7 @@ export declare class Grid extends View implements IGrid {
|
|
|
19
20
|
content: IContentList | IProContentList;
|
|
20
21
|
selection: ISelection;
|
|
21
22
|
keyManager: IKeyManager;
|
|
23
|
+
$activeCell: IActiveCell;
|
|
22
24
|
protected _touch: ITouchParam;
|
|
23
25
|
protected _destructed: boolean;
|
|
24
26
|
protected _scroll: IScrollState;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { ICell, ICol, IGrid, IRow, ISpan } from "./../types";
|
|
1
|
+
import { ICell, ICellSource, ICellSourceHolder, ICol, IGrid, IRow, ISpan } from "./../types";
|
|
2
2
|
import { Id } from "../../../ts-common/types";
|
|
3
3
|
export declare function getWidth(columns: ICol[], colspan: number, index: number): number;
|
|
4
4
|
export declare function getSourceCellIndex(currentIdx: number, minIdx: number, count: number): number;
|
|
5
5
|
export declare function getSpanHeight(rows: IRow[], span: ISpan): number;
|
|
6
6
|
export declare function getReducedColspan(columns: ICol[], colId: Id, colspan: number): number;
|
|
7
7
|
export declare function getReducedRowspan(initialRows: IRow[], currRows: IRow[], rowIndex: number, span: ISpan): number;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the module that owns the active cell position.
|
|
10
|
+
* @param holder - the grid, or the renderer config built from it
|
|
11
|
+
* @returns the module answering `getCell`, `setCell` and `restoreFocus`
|
|
12
|
+
*/
|
|
13
|
+
export declare function getCellSource(holder: ICellSourceHolder): ICellSource;
|
|
8
14
|
export declare function normalizeCell(cell: ICell, grid: IGrid): ICell;
|
|
9
15
|
export declare function clearCells(grid: any, cells: ICell[]): void;
|
|
10
16
|
export declare function formatValue(value: string, cell: ICell): any;
|
|
@@ -219,6 +219,16 @@ export declare function getColIdFromTarget(target: HTMLElement): string | null;
|
|
|
219
219
|
* @param zone - the zone whose cells should be reset
|
|
220
220
|
*/
|
|
221
221
|
export declare function restoreZoneTabindex(grid: any, zone: FocusZone): void;
|
|
222
|
+
/**
|
|
223
|
+
* Hands focus to the sentinel on one side of the widget so that the browser's own Tab handling
|
|
224
|
+
* continues from the edge of the widget instead of from the boundary cell.
|
|
225
|
+
* The sentinels are the first and the last child of the widget root and are already the widget's
|
|
226
|
+
* entry points, so their own focus listeners are suppressed for this one focus.
|
|
227
|
+
* @param grid - the grid instance
|
|
228
|
+
* @param direction - "forward" for Tab, "backward" for Shift+Tab
|
|
229
|
+
* @returns true if the sentinel was found and focused
|
|
230
|
+
*/
|
|
231
|
+
export declare function exitThroughSentinel(grid: any, direction: "forward" | "backward"): boolean;
|
|
222
232
|
/**
|
|
223
233
|
* Initializes the start focus sentinel for the grid.
|
|
224
234
|
* Attaches a focus listener on the .dhx_grid-focus-sentinel element that redirects
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Id } from "../../../ts-common/types";
|
|
2
|
+
import { ICell, ICellSource, ICol, IGrid, IProGrid, IRow } from "../types";
|
|
3
|
+
export interface IActiveCell extends ICellSource {
|
|
4
|
+
destructor(): void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Keeps the position the keyboard moves over the data when no selection module is initialized.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ActiveCell implements IActiveCell {
|
|
10
|
+
private _grid;
|
|
11
|
+
private _gridId;
|
|
12
|
+
private _cell;
|
|
13
|
+
constructor(grid: IGrid | IProGrid, gridId?: Id);
|
|
14
|
+
/**
|
|
15
|
+
* Moves the active cell. The `ctrlUp` and `shiftUp` modifiers of the selection module are
|
|
16
|
+
* accepted by the shared signature and ignored here: there is no selection to extend.
|
|
17
|
+
* @param row - the row, or the row id, to move to
|
|
18
|
+
* @param col - the column, or the column id, to move to; the first visible column by default
|
|
19
|
+
*/
|
|
20
|
+
setCell(row?: IRow | Id, col?: ICol | Id): void;
|
|
21
|
+
getCell(): ICell | void;
|
|
22
|
+
restoreFocus(): void;
|
|
23
|
+
destructor(): void;
|
|
24
|
+
private _init;
|
|
25
|
+
private _setBrowserFocus;
|
|
26
|
+
}
|
|
@@ -1,24 +1,20 @@
|
|
|
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 Restore browser focus */
|
|
21
|
-
restoreFocus(): void;
|
|
22
18
|
}
|
|
23
19
|
export declare enum GridSelectionEvents {
|
|
24
20
|
beforeUnSelect = "beforeUnSelect",
|
|
@@ -11,6 +11,7 @@ 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";
|
|
@@ -20,6 +21,22 @@ import { IHistory, IHistoryConfig } from "./modules/History";
|
|
|
20
21
|
import { IComboFilterConfig, IContentList, IHeaderFilter, IInputFilterConfig } 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;
|
|
@@ -168,6 +187,7 @@ export interface IGridConfig extends IDragConfig {
|
|
|
168
187
|
$data?: any[];
|
|
169
188
|
$grouped?: IGroupItem[];
|
|
170
189
|
$subRowCells?: Map<Id, ISubRowCell>;
|
|
190
|
+
$cellState?: ICellState;
|
|
171
191
|
}
|
|
172
192
|
export type IProGridConfig = IExtendedGridConfig & ITreeGridConfig;
|
|
173
193
|
export interface IExtendedGridConfig extends IGridConfig {
|
|
@@ -208,6 +228,7 @@ export interface IRendererConfig extends Required<IProGridConfig> {
|
|
|
208
228
|
footerHeight?: number;
|
|
209
229
|
events?: IEventSystem<GridEvents, IEventHandlersMap>;
|
|
210
230
|
selection: any;
|
|
231
|
+
$activeCell?: IActiveCell;
|
|
211
232
|
dropManager: any;
|
|
212
233
|
blockSelection: any;
|
|
213
234
|
range?: IRange;
|
|
@@ -430,6 +451,7 @@ export interface ICol {
|
|
|
430
451
|
$width?: number;
|
|
431
452
|
$fixedWidth?: boolean;
|
|
432
453
|
$customOptions?: any;
|
|
454
|
+
$rowHeader?: boolean;
|
|
433
455
|
}
|
|
434
456
|
export interface IRow {
|
|
435
457
|
id?: Id;
|
|
@@ -676,4 +698,28 @@ export interface IExportGridCell {
|
|
|
676
698
|
v: string | number;
|
|
677
699
|
s: number;
|
|
678
700
|
}
|
|
701
|
+
/**
|
|
702
|
+
* @internal
|
|
703
|
+
* Cell state supplied by a host product that manages selection and editing itself.
|
|
704
|
+
* When it is set, it is the source of truth for the roving tabindex, `aria-selected`,
|
|
705
|
+
* `aria-readonly` and `aria-multiselectable`, and the grid's own selection module is not
|
|
706
|
+
* consulted. When it is not set, the grid behaves exactly as before.
|
|
707
|
+
*
|
|
708
|
+
* A range is a set of row ids by a set of column ids, so that a cell can be tested with two
|
|
709
|
+
* hash lookups: `getCells` runs per visible cell and again per frozen zone, and the column
|
|
710
|
+
* index of a cell is not recoverable there because the fixed-column zones replace
|
|
711
|
+
* `filteredColumns` and reset `$positions.xStart`.
|
|
712
|
+
*/
|
|
713
|
+
export interface ICellState {
|
|
714
|
+
active?: {
|
|
715
|
+
row: Id;
|
|
716
|
+
col: Id;
|
|
717
|
+
};
|
|
718
|
+
ranges?: Array<{
|
|
719
|
+
rows: Set<Id>;
|
|
720
|
+
cols: Set<Id>;
|
|
721
|
+
}>;
|
|
722
|
+
editable?: boolean;
|
|
723
|
+
multiselectable?: boolean;
|
|
724
|
+
}
|
|
679
725
|
export {};
|
|
@@ -14,6 +14,31 @@ 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
|
+
/** whether `aria-selected` belongs on a cell at all — it does not in row selection mode */
|
|
29
|
+
exposeSelected: boolean;
|
|
30
|
+
isSelected: (rowId: Id, colId: Id) => boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolves everything the cell renderers need to know about selection, focus and editability,
|
|
34
|
+
* once per render pass. This is the hottest path in the product — `getCells` runs per visible
|
|
35
|
+
* cell and again for every frozen zone — so the per-cell work left afterwards is two identity
|
|
36
|
+
* comparisons for the tabindex and one call for `aria-selected`.
|
|
37
|
+
*
|
|
38
|
+
* The state comes from `$cellState` when a host product supplies it, and from the grid's own
|
|
39
|
+
* selection module otherwise.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveCellState(conf: IRendererConfig): IResolvedCellState;
|
|
17
42
|
export declare function getCells(conf: IRendererConfig): any[];
|
|
18
43
|
export declare function getSpans(config: IRendererConfig, mode?: Split): any[];
|
|
19
44
|
export declare function getShifts(conf: IRendererConfig): ICoords;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhtmlx/grid",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.12",
|
|
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,25 @@
|
|
|
1
|
+
# Version 9.3.12 (September 23, 2026)
|
|
2
|
+
|
|
3
|
+
### Updates
|
|
4
|
+
|
|
5
|
+
- Keyboard access to the cell surface:
|
|
6
|
+
- 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**).
|
|
7
|
+
- Cells can now be reached with the keyboard in a grid configured without a selection module.
|
|
8
|
+
|
|
9
|
+
- Structure reported to assistive technology:
|
|
10
|
+
- 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**).
|
|
11
|
+
- A merged cell reports how many rows and columns it spans.
|
|
12
|
+
|
|
13
|
+
### Fixes
|
|
14
|
+
|
|
15
|
+
- Fixed <kbd>Tab</kbd> not leaving a grid that has frozen (`leftSplit` / `rightSplit`) columns
|
|
16
|
+
- Fixed the focused cell being scrolled one column short of the viewport edge during horizontal keyboard navigation
|
|
17
|
+
- Fixed the focused cell being scrolled behind the footer instead of above it
|
|
18
|
+
- Fixed the doubled focus indicator on a cell that is both focused and selected
|
|
19
|
+
- Fixed cells rendered with `htmlEnable` being announced as buttons in columns without interactive content
|
|
20
|
+
- 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
|
|
21
|
+
- Fixed a script error that occurred after closing an inline editor in a grid with column summaries
|
|
22
|
+
|
|
1
23
|
# Version 9.3.11 (September 14, 2026)
|
|
2
24
|
|
|
3
25
|
### Updates
|