@dhtmlx/chart 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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/codebase/chart.min.css +1 -1
  3. package/codebase/chart.min.js +3 -3
  4. package/codebase/chart.min.js.map +1 -1
  5. package/codebase/types/ts-calendar/sources/Calendar.d.ts +6 -0
  6. package/codebase/types/ts-calendar/sources/helper.d.ts +1 -0
  7. package/codebase/types/ts-calendar/sources/types.d.ts +3 -0
  8. package/codebase/types/ts-chart/sources/AxisCreator.d.ts +10 -0
  9. package/codebase/types/ts-chart/sources/Chart.d.ts +26 -1
  10. package/codebase/types/ts-chart/sources/helpers/common.d.ts +12 -1
  11. package/codebase/types/ts-chart/sources/helpers/constants.d.ts +2 -0
  12. package/codebase/types/ts-chart/sources/scales/Scale.d.ts +3 -0
  13. package/codebase/types/ts-chart/sources/scales/SvgScales.d.ts +1 -1
  14. package/codebase/types/ts-chart/sources/series/Bar.d.ts +11 -1
  15. package/codebase/types/ts-chart/sources/series/BarX.d.ts +4 -1
  16. package/codebase/types/ts-chart/sources/series/BaseSeria.d.ts +1 -0
  17. package/codebase/types/ts-chart/sources/series/NoScaleSeria.d.ts +1 -1
  18. package/codebase/types/ts-chart/sources/series/ScaleSeria.d.ts +0 -1
  19. package/codebase/types/ts-chart/sources/series/Stacker.d.ts +9 -0
  20. package/codebase/types/ts-chart/sources/types.d.ts +16 -3
  21. package/codebase/types/ts-common/date.d.ts +2 -0
  22. package/codebase/types/ts-data/sources/datacollection/group.d.ts +11 -0
  23. package/codebase/types/ts-data/sources/datacollection.d.ts +84 -3
  24. package/codebase/types/ts-data/sources/methods.d.ts +8 -3
  25. package/codebase/types/ts-data/sources/treecollection.d.ts +99 -0
  26. package/codebase/types/ts-data/sources/types.d.ts +12 -2
  27. package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +3 -1
  28. package/codebase/types/ts-grid/sources/Grid.d.ts +12 -2
  29. package/codebase/types/ts-grid/sources/helpers/cells.d.ts +7 -1
  30. package/codebase/types/ts-grid/sources/helpers/data.d.ts +16 -1
  31. package/codebase/types/ts-grid/sources/helpers/default.d.ts +1 -0
  32. package/codebase/types/ts-grid/sources/helpers/dom.d.ts +3 -0
  33. package/codebase/types/ts-grid/sources/helpers/zoneFocus.d.ts +25 -4
  34. package/codebase/types/ts-grid/sources/locales/en.d.ts +0 -2
  35. package/codebase/types/ts-grid/sources/modules/ActiveCell.d.ts +26 -0
  36. package/codebase/types/ts-grid/sources/modules/History.d.ts +4 -0
  37. package/codebase/types/ts-grid/sources/modules/Selection.d.ts +5 -6
  38. package/codebase/types/ts-grid/sources/types.d.ts +82 -5
  39. package/codebase/types/ts-grid/sources/ui/cells.d.ts +28 -1
  40. package/codebase/types/ts-grid/sources/ui/content/ComboFilter.d.ts +1 -0
  41. package/codebase/types/ts-grid/sources/ui/content/SelectFilter.d.ts +1 -0
  42. package/codebase/types/ts-grid/sources/ui/content.d.ts +6 -2
  43. package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +1 -0
  44. package/codebase/types/ts-grid/sources/ui/proContent.d.ts +3 -16
  45. package/codebase/types/ts-layout/sources/Cell.d.ts +10 -0
  46. package/codebase/types/ts-layout/sources/helpers/constants.d.ts +2 -0
  47. package/codebase/types/ts-layout/sources/{helpers.d.ts → helpers/helpers.d.ts} +1 -1
  48. package/codebase/types/ts-layout/sources/types.d.ts +2 -1
  49. package/codebase/types/ts-message/sources/locales/en.d.ts +4 -0
  50. package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +0 -2
  51. package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +2 -1
  52. package/package.json +1 -1
  53. package/whatsnew.txt +74 -33
@@ -21,6 +21,31 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
21
21
  removeAll(id?: Id): void;
22
22
  update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
23
23
  getIndex(id: Id): number;
24
+ /**
25
+ * Returns the index of an item among the visible ones, i.e. in the order the items are
26
+ * rendered in. Unlike {@link TreeCollection.getIndex} the hidden items are not counted, and an
27
+ * item that is not rendered at all gets `-1`. A range set by {@link DataCollection.setRange}
28
+ * leaves the top level items of the current page only.
29
+ * @param id - The id of the item.
30
+ * @param flat - Whether the index is counted in the flat list of all the visible items, i.e.
31
+ * the items of the expanded branches above the item are counted as well. By default the index
32
+ * is counted within the parent branch of the item only. Defaults to `false`.
33
+ * @returns The zero-based index of the item, or `-1` if the item doesn't exist, is hidden, is
34
+ * placed under a hidden or a collapsed parent, or is out of the currently set range.
35
+ * @example
36
+ * ```ts
37
+ * // "1", "2", "3" are top level items, "3" is expanded and holds "3.1" and "3.2"
38
+ * collection.update("3.1", { hidden: true });
39
+ * collection.getIndex("3.2"); // 1 - the second child of "3"
40
+ * collection.getVisibleIndex("3.2"); // 0 - the first rendered child of "3"
41
+ * collection.getVisibleIndex("3.2", true); // 3 - the fourth rendered item
42
+ *
43
+ * collection.update("3", { $opened: false });
44
+ * collection.getVisibleIndex("3.2"); // -1
45
+ * collection.getVisibleIndex("3.2", true); // -1
46
+ * ```
47
+ */
48
+ getVisibleIndex(id: Id, flat?: boolean): number;
24
49
  /**
25
50
  * Sorts the tree, reordering the items within each parent independently.
26
51
  * The rules are combined the same way as in {@link DataCollection.sort}, but unlike it this
@@ -74,6 +99,47 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
74
99
  getId(index: number, parent?: Id): Id;
75
100
  map(callback: DataCallback<T>, parent?: Id, direct?: boolean): any[];
76
101
  getRawData(from: number, to: number, order?: T[], mode?: number, parent?: Id): T[];
102
+ /**
103
+ * Tells whether the children of an item are rendered. Both flags in use are checked:
104
+ * `$opened`, set by TreeGrid, and `opened`, set by Tree.
105
+ * @param item - The item to check.
106
+ * @returns `true` if the item is expanded.
107
+ * @internal
108
+ */
109
+ protected _isOpened(item: T): boolean;
110
+ /**
111
+ * Gives the range of the top level items to count, narrowed by {@link DataCollection.setRange}.
112
+ * @returns The index to count from and the one to stop before.
113
+ * @internal
114
+ */
115
+ private _getRootBounds;
116
+ /**
117
+ * Counts the visible items placed before an item within its parent branch.
118
+ * @param item - The item to locate.
119
+ * @param start - The index the top level items are counted from, set by a range.
120
+ * @param end - The index the top level items are counted up to, set by a range.
121
+ * @returns The index of the item within its branch, or `-1` if the branch doesn't hold it.
122
+ * @internal
123
+ */
124
+ private _getBranchVisibleIndex;
125
+ /**
126
+ * Counts the visible items placed before an item in the flat list of the visible items: at
127
+ * every level the branches of the preceding siblings are counted together with the parent
128
+ * item itself.
129
+ * @param item - The item to locate.
130
+ * @param start - The index the top level items are counted from, set by a range.
131
+ * @returns The index of the item in the flat list, or `-1` if the tree doesn't hold it.
132
+ * @internal
133
+ */
134
+ private _getFlatVisibleIndex;
135
+ /**
136
+ * Counts the rows an item takes in the flat list of the visible items: the item itself plus
137
+ * the visible items of its branch while it is expanded.
138
+ * @param item - The item to measure.
139
+ * @returns The number of the visible rows, `0` for a hidden item.
140
+ * @internal
141
+ */
142
+ private _getVisibleCount;
77
143
  protected flatten(input: T[]): T[];
78
144
  protected _add({ newItem, index, parent, order, batch, }: {
79
145
  newItem: IDataItem;
@@ -85,6 +151,15 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
85
151
  protected _setParent(item: IDataItem, parent: Id): void;
86
152
  protected _copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number): Id;
87
153
  protected _move(id: Id, index: number, target?: ITreeCollection | IDataCollection, targetId?: Id, key?: number): Id;
154
+ /**
155
+ * Changes the id of a data item. The root id can't be changed.
156
+ * @param id - The current id of the item.
157
+ * @param newId - The new id for the item. If omitted, a unique id is generated automatically.
158
+ * @param silent - If true, the change event is not fired.
159
+ * @returns The new id of the item, or the original id if the change was rejected.
160
+ */
161
+ changeId(id: Id, newId?: Id, silent?: boolean): Id;
162
+ protected _changeIdCore(id: Id, newId: Id): void;
88
163
  protected _moveItem(id: any, targetId: any, index: any): void;
89
164
  protected _reset(config: {
90
165
  id?: Id;
@@ -108,6 +183,30 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
108
183
  * @internal
109
184
  */
110
185
  private _applyFilter;
186
+ /**
187
+ * Recomputes every group header from the items the tree holds now, and drops the groups that
188
+ * ended up with nothing in them unless `showEmptyGroups` is set. See
189
+ * {@link TreeCollection._dropGroups} for what dropping a header costs it.
190
+ * @internal
191
+ */
192
+ protected _recalculateGroups(): void;
193
+ /**
194
+ * Counts the items every group header holds in a given tree, its whole subtree and not just
195
+ * the direct children. Summary rows are not items.
196
+ * @param store - The parent to children map to count over.
197
+ * @returns The counts, keyed by header id.
198
+ * @internal
199
+ */
200
+ private _countTreeGroups;
201
+ /**
202
+ * Takes group headers out of the tree together with everything below them, their summary rows
203
+ * included. While a filter is applied the headers only leave `_children`, because `_initChildren`
204
+ * keeps the whole grouped tree and resetting the filter has to bring them back. Without a filter
205
+ * there is nothing to restore them from, so they leave the tree for good.
206
+ * @param ids - Ids of the headers to drop.
207
+ * @internal
208
+ */
209
+ protected _dropGroups(ids: Set<string>): void;
111
210
  /**
112
211
  * Unwraps the stored filters into their bare rules, keeping them keyed by filter id.
113
212
  * Unlike {@link DataCollection._normalizeFilters} it does not turn the rules into predicates:
@@ -184,6 +184,7 @@ export interface IDataCollection<T extends IDataItem = IDataItem> {
184
184
  getInitialData(): T[];
185
185
  getItem(id: Id): T;
186
186
  getIndex(id: Id): number;
187
+ getVisibleIndex(id: Id): number;
187
188
  getLength(): number;
188
189
  isDataLoaded(from?: number, to?: number): boolean;
189
190
  getId(index: number): Id;
@@ -205,7 +206,7 @@ export interface IDataCollection<T extends IDataItem = IDataItem> {
205
206
  serialize(driver?: DataDriver): T[];
206
207
  copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
207
208
  move(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
208
- changeId(id: Id, newId?: Id, silent?: boolean): void;
209
+ changeId(id: Id, newId?: Id, silent?: boolean): Id;
209
210
  forEach(callback: DataCallback<T>): void;
210
211
  save(url: IDataProxy | string): void;
211
212
  isSaved(): boolean;
@@ -215,6 +216,14 @@ export interface IDataChangeStack {
215
216
  order: IDataChange[];
216
217
  }
217
218
  export type Statuses = "add" | "update" | "remove" | string;
219
+ /**
220
+ * Service payload of the {@link DataEvents.change} event.
221
+ * @internal Not a part of the public API, may be extended or changed without notice.
222
+ */
223
+ export interface IDataChangeService {
224
+ /** the previous id of the item, set by changeId */
225
+ oldId?: Id;
226
+ }
218
227
  export interface IDataChange {
219
228
  id: Id;
220
229
  status: Statuses;
@@ -265,6 +274,7 @@ export interface ITreeCollection<T extends IDataItem = IDataItem> extends IDataC
265
274
  removeAll(id?: Id): void;
266
275
  getLength(id?: Id): number;
267
276
  getIndex(id: Id): number;
277
+ getVisibleIndex(id: Id, flat?: boolean): number;
268
278
  getItems(id: Id): T[];
269
279
  sort(rule?: ISortMode, config?: ISortConfig, ignore?: boolean): void;
270
280
  map(callback: DataCallback<T>, parent?: Id, direct?: boolean): any;
@@ -348,7 +358,7 @@ export declare enum DataEvents {
348
358
  }
349
359
  export interface IDataEventsHandlersMap {
350
360
  [key: string]: (...args: any[]) => any;
351
- [DataEvents.change]: (id?: Id, status?: Statuses, updatedItem?: IDataItem) => void;
361
+ [DataEvents.change]: (id?: Id, status?: Statuses, updatedItem?: IDataItem, service?: IDataChangeService) => void;
352
362
  [DataEvents.filter]: (filter?: IFilter) => void;
353
363
  [DataEvents.beforeAdd]: (newItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;
354
364
  [DataEvents.afterAdd]: (newItem: IDataItem, batch: IDataItem[], index: number) => void;
@@ -1,4 +1,4 @@
1
- import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig, ISubViewCell } from "./types";
1
+ import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig, ISubViewCell, IFixedRowLevel, TFixedRowsName } from "./types";
2
2
  import { IDataCollection, IDataItem } from "../../ts-data";
3
3
  import { ScrollView } from "../../ts-common/ScrollView";
4
4
  import { Id } from "../../ts-common/types";
@@ -30,11 +30,13 @@ export declare class ExtendedGrid extends Grid implements IExtendedGrid {
30
30
  protected _setEventHandlers(): void;
31
31
  protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
32
32
  protected _setSort(): void;
33
+ protected _resolveFixedRowLevel(name: TFixedRowsName, index: number, config: IExtendedGridConfig): IFixedRowLevel;
33
34
  protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
34
35
  protected _prepareData(data: IDataItem[] | IDataCollection): IRow[];
35
36
  protected _prepareDataFromTo(data: IDataCollection, from: number, to: number): IRow[];
36
37
  protected _dragStart(event: any): void;
37
38
  protected _group(order: IGroupOrderItem[]): void;
39
+ protected _getGroupCounter(row: IRow): string;
38
40
  protected _expand(row: IRow): boolean;
39
41
  protected _collapse(row: IRow): boolean;
40
42
  private _lazyLoad;
@@ -6,8 +6,9 @@ import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataI
6
6
  import { Exporter } from "./modules/Exporter";
7
7
  import { PrefixSums } from "./helpers/PrefixSums";
8
8
  import { ISelection } from "./modules/Selection";
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";
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, IFixedRowLevel, TFixedRowsName } 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;
@@ -90,10 +92,11 @@ export declare class Grid extends View implements IGrid {
90
92
  protected _dragInit(): void;
91
93
  protected _parseColumns(configChanged?: boolean): void;
92
94
  protected normalizeColumns({ config, columns, configChanged }: INormalizeColumnsParams): void;
95
+ protected _buildFixedRowsHeightMap(config: IGridConfig, columns: ICol[], name: TFixedRowsName): void;
96
+ protected _resolveFixedRowLevel(name: TFixedRowsName, index: number, config: IGridConfig): IFixedRowLevel;
93
97
  protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
94
98
  protected _parseData(): void;
95
99
  protected _createCollection(): void;
96
- protected _getRowIndex(rowId: Id): number;
97
100
  protected _setHTMLEventHandlers(): void;
98
101
  protected _setEventHandlers(): void;
99
102
  protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
@@ -119,6 +122,13 @@ export declare class Grid extends View implements IGrid {
119
122
  protected _normalizeDataType(): void;
120
123
  protected _applyLocalFilter(beforePrepareData?: boolean): void;
121
124
  protected _normalizeSpans(): void;
125
+ /**
126
+ * Retargets the caches that store a row id by value to the new id.
127
+ * The row objects themselves are shared with the data collection, so everything that
128
+ * keeps a reference to them (the selected cells, the rendered rows) is already up to date.
129
+ * @internal
130
+ */
131
+ protected _remapRowId(oldId: Id, newId: Id): void;
122
132
  protected _hideColumn(column: ICol): void;
123
133
  protected _showColumn(column: ICol): void;
124
134
  protected _setSummary(): void;
@@ -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;
@@ -1,10 +1,22 @@
1
1
  import { IContainerConfig } from "../../../ts-common/core";
2
- import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IScrollState, IVisibleRange, ISizes } from "./../types";
2
+ import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IOption, IScrollState, IVisibleRange, ISizes, TContentFilter, TFilterOptions, TFixedRowHeight } from "./../types";
3
3
  import { Id } from "../../../ts-common/types";
4
4
  export declare function getTotalRowHeight(row: IRow): number;
5
5
  export declare function rowsHeight(config: IGridConfig, rows: IRow[], from: number, to: number): number;
6
6
  export declare function colsWidth(config: IGridConfig, cols: ICol[], from: number, to: number): number;
7
7
  export declare function normalizeArray(obj: any, name: string): void;
8
+ /**
9
+ * Resolves the height of a single header/footer level from the headerRowHeight/footerRowHeight value.
10
+ * An array form describes the levels individually, a plain number applies to every level.
11
+ * @param value - the headerRowHeight/footerRowHeight config value
12
+ * @param index - the zero-based header/footer level index
13
+ * @returns the level height and its auto-height state, where `auto: null` means
14
+ * "the legacy mode, the headerAutoHeight/footerAutoHeight flag decides"
15
+ */
16
+ export declare function resolveFixedRowHeight(value: TFixedRowHeight | undefined, index: number): {
17
+ height: number;
18
+ auto: boolean | null;
19
+ };
8
20
  export declare function measureTextHeight({ text, width, lineHeight, font, htmlEnable, }: {
9
21
  text?: string;
10
22
  width?: number;
@@ -28,6 +40,9 @@ export declare const getTreeCellWidthOffset: (row: IRow, toArrow?: boolean) => n
28
40
  export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config: IContainerConfig, target: AdjustTargetType) => IColumnsWidth;
29
41
  export declare function applyPattern(value: string | number | boolean, col: ICol): string | number | boolean;
30
42
  export declare function getEditorOptions(col: ICol, row?: IRow): TOption[];
43
+ export declare function normalizeOptions(options: any[]): IOption[];
44
+ export declare function getFilterOptions(col: ICol, content: TContentFilter): TFilterOptions;
45
+ export declare function resolveFilterOptions(col: ICol, content: TContentFilter, uniqueData?: any[]): IOption[];
31
46
  export declare function getOptionValue(value: string, column: ICol): string;
32
47
  export declare function getValueForNumberColumn(col: ICol, value: any): any;
33
48
  export declare function getComboEditorValue(value: any, col: ICol, row: IRow): any;
@@ -1,5 +1,6 @@
1
1
  import { IHistoryConfig } from "../modules/History";
2
2
  import { IDragPanelConfig, IGroup, ISubRowConfig } from "../types";
3
+ export declare const DEFAULT_ROW_HEIGHT = 40;
3
4
  export declare const getGroupDefaultConfig: (config?: IGroup | boolean) => IGroup;
4
5
  export declare const defaultSubRowConfig: Omit<ISubRowConfig, "view">;
5
6
  export declare const defaultDragPanelConfig: IDragPanelConfig;
@@ -1,3 +1,6 @@
1
1
  import { Id } from "../../../ts-common/types";
2
+ import { ISpan } from "../types";
2
3
  export declare function getRowNode(id: Id, root: HTMLElement, split?: "left" | "right"): HTMLElement;
4
+ /** Returns a data cell, or the span that covers it, from any part of the grid, frozen columns included. */
5
+ export declare function getCellNode(root: HTMLElement, rowId: Id, colId: Id, span?: ISpan): HTMLElement;
3
6
  export declare function getVisibleRowNode(row: HTMLElement, width: number, offset: number): HTMLElement;
@@ -49,8 +49,9 @@ export declare function findZoneCell(grid: any, zone: FocusZone, colId: string,
49
49
  * the scroll offset if the column is outside the visible range.
50
50
  * @param grid - the grid instance
51
51
  * @param colId - the column ID to make visible
52
+ * @returns true if the grid was scrolled
52
53
  */
53
- export declare function ensureZoneCellVisible(grid: any, colId: string): void;
54
+ export declare function ensureZoneCellVisible(grid: any, colId: string): boolean;
54
55
  /**
55
56
  * Resolves the actual owning cell for a position that may be covered by a colspan or rowspan.
56
57
  * Scans all rows (0..rowIndex) and columns (0..colIndex) to find any cell whose
@@ -93,8 +94,9 @@ export declare function moveZoneFocusVertical(grid: any, event: KeyboardEvent, z
93
94
  * Moves focus via Tab/Shift+Tab within a header/footer zone.
94
95
  * Advances column-by-column with row wrapping: when reaching the last column,
95
96
  * moves to the first column of the next row (and vice versa for backward).
96
- * Skips cells that resolve back to the current cell (due to spans) and retries
97
- * if a cell is not found in the DOM (virtualized columns).
97
+ * Skips cells that resolve back to the current cell (due to spans) and cells that are
98
+ * not in the DOM although their column is in view. A cell scrolled into view is focused
99
+ * after the redraw, not skipped (see setZoneCellFocus).
98
100
  * Does NOT call preventDefault for exit cases — the caller decides.
99
101
  * @param grid - the grid instance
100
102
  * @param event - the keyboard event (preventDefault'd only on successful move)
@@ -153,9 +155,18 @@ export declare function triggerHeaderSort(grid: any, event: KeyboardEvent, isMod
153
155
  * @param rowIndex - the row index of the cell to focus
154
156
  * @param prevCell - the previously focused cell (will get tabindex="-1")
155
157
  * @param navRowIndex - the logical navigation row to store (defaults to rowIndex)
156
- * @returns true if focus was set successfully, false if the cell was not found
158
+ * @returns true if focus was set, or will be set after the redraw; false if the cell was not found
157
159
  */
158
160
  export declare function setZoneCellFocus(grid: any, zone: FocusZone, colId: string, rowIndex: number, prevCell?: HTMLElement, navRowIndex?: number): boolean;
161
+ /**
162
+ * Checks if focus is still in the body data area, or was dropped to the page.
163
+ * Focus is dropped to the page when the focused editor is removed. Focus that has moved on,
164
+ * out of the widget or into the header or the footer, is not in the body.
165
+ * Used after an edit ends, so that focus is returned to the active cell only when nothing moved it away.
166
+ * @param grid - the grid instance
167
+ * @returns true if focus is in the body or on the page body element
168
+ */
169
+ export declare function isFocusInBody(grid: any): boolean;
159
170
  /**
160
171
  * Transitions focus from a header/footer zone to the body data area.
161
172
  * Selects the first or last row in the specified column, using either
@@ -219,6 +230,16 @@ export declare function getColIdFromTarget(target: HTMLElement): string | null;
219
230
  * @param zone - the zone whose cells should be reset
220
231
  */
221
232
  export declare function restoreZoneTabindex(grid: any, zone: FocusZone): void;
233
+ /**
234
+ * Hands focus to the sentinel on one side of the widget so that the browser's own Tab handling
235
+ * continues from the edge of the widget instead of from the boundary cell.
236
+ * The sentinels are the first and the last child of the widget root and are already the widget's
237
+ * entry points, so their own focus listeners are suppressed for this one focus.
238
+ * @param grid - the grid instance
239
+ * @param direction - "forward" for Tab, "backward" for Shift+Tab
240
+ * @returns true if the sentinel was found and focused
241
+ */
242
+ export declare function exitThroughSentinel(grid: any, direction: "forward" | "backward"): boolean;
222
243
  /**
223
244
  * Initializes the start focus sentinel for the grid.
224
245
  * Attaches a focus listener on the .dhx_grid-focus-sentinel element that redirects
@@ -21,8 +21,6 @@ declare const locale: {
21
21
  aria_collapseRow: string;
22
22
  aria_editContent: string;
23
23
  aria_subRow: string;
24
- aria_enterGrid: string;
25
- aria_exitGrid: string;
26
24
  aria_dragPanel: string;
27
25
  aria_panelHeader: string;
28
26
  aria_panelFooter: string;
@@ -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,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 Restore browser focus */
21
- restoreFocus(): void;
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;