@dhtmlx/chart 9.3.12 → 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 (51) 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 +10 -2
  29. package/codebase/types/ts-grid/sources/helpers/data.d.ts +16 -1
  30. package/codebase/types/ts-grid/sources/helpers/default.d.ts +1 -0
  31. package/codebase/types/ts-grid/sources/helpers/dom.d.ts +3 -0
  32. package/codebase/types/ts-grid/sources/helpers/zoneFocus.d.ts +15 -4
  33. package/codebase/types/ts-grid/sources/locales/en.d.ts +0 -2
  34. package/codebase/types/ts-grid/sources/modules/History.d.ts +4 -0
  35. package/codebase/types/ts-grid/sources/modules/Selection.d.ts +3 -0
  36. package/codebase/types/ts-grid/sources/types.d.ts +36 -5
  37. package/codebase/types/ts-grid/sources/ui/cells.d.ts +3 -1
  38. package/codebase/types/ts-grid/sources/ui/content/ComboFilter.d.ts +1 -0
  39. package/codebase/types/ts-grid/sources/ui/content/SelectFilter.d.ts +1 -0
  40. package/codebase/types/ts-grid/sources/ui/content.d.ts +6 -2
  41. package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +1 -0
  42. package/codebase/types/ts-grid/sources/ui/proContent.d.ts +3 -16
  43. package/codebase/types/ts-layout/sources/Cell.d.ts +10 -0
  44. package/codebase/types/ts-layout/sources/helpers/constants.d.ts +2 -0
  45. package/codebase/types/ts-layout/sources/{helpers.d.ts → helpers/helpers.d.ts} +1 -1
  46. package/codebase/types/ts-layout/sources/types.d.ts +2 -1
  47. package/codebase/types/ts-message/sources/locales/en.d.ts +1 -0
  48. package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +0 -2
  49. package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +2 -1
  50. package/package.json +1 -1
  51. package/whatsnew.txt +74 -36
@@ -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,7 +6,7 @@ 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
11
  import { IActiveCell } from "./modules/ActiveCell";
12
12
  import { IProContentList } from "./ui/proContent";
@@ -92,10 +92,11 @@ export declare class Grid extends View implements IGrid {
92
92
  protected _dragInit(): void;
93
93
  protected _parseColumns(configChanged?: boolean): void;
94
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;
95
97
  protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
96
98
  protected _parseData(): void;
97
99
  protected _createCollection(): void;
98
- protected _getRowIndex(rowId: Id): number;
99
100
  protected _setHTMLEventHandlers(): void;
100
101
  protected _setEventHandlers(): void;
101
102
  protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
@@ -121,6 +122,13 @@ export declare class Grid extends View implements IGrid {
121
122
  protected _normalizeDataType(): void;
122
123
  protected _applyLocalFilter(beforePrepareData?: boolean): void;
123
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;
124
132
  protected _hideColumn(column: ICol): void;
125
133
  protected _showColumn(column: ICol): void;
126
134
  protected _setSummary(): void;
@@ -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
@@ -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;
@@ -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;
@@ -15,6 +15,8 @@ export interface ISelection extends ICellSource {
15
15
  enable(): void;
16
16
  isSelectedCell(row: IRow | Id, column?: ICol | Id): boolean;
17
17
  toHTML(): VNode | VNode[];
18
+ /** @internal Rebuild the id-based cache after a row id has been changed */
19
+ remapRows(): void;
18
20
  }
19
21
  export declare enum GridSelectionEvents {
20
22
  beforeUnSelect = "beforeUnSelect",
@@ -46,6 +48,7 @@ export declare class Selection implements ISelection {
46
48
  enable(): void;
47
49
  isSelectedCell(row: IRow | Id, column?: ICol | Id): boolean;
48
50
  restoreFocus(): void;
51
+ remapRows(): void;
49
52
  toHTML(): VNode | VNode[];
50
53
  private _setCell;
51
54
  private _removeCell;
@@ -18,7 +18,7 @@ import { PrefixSums } from "./helpers/PrefixSums";
18
18
  import { IBlockSelection, IBlockSelectionConfig } from "./modules/BlockSelection";
19
19
  import { IClipboard, IClipboardConfig } from "./modules/Clipboard";
20
20
  import { IHistory, IHistoryConfig } from "./modules/History";
21
- import { IComboFilterConfig, IContentList, IHeaderFilter, IInputFilterConfig } from "./ui/content";
21
+ import { IComboFilterConfig, IContentList, IHeaderFilter, IInputFilterConfig, ISelectFilterConfig } from "./ui/content";
22
22
  import { ExportType, ICsvExportConfig, IXlsxExportConfig } from "./modules/Exporter";
23
23
  import { IDateFilterConfig, IProContentList, IProHeaderFilter } from "./ui/proContent";
24
24
  /**
@@ -110,8 +110,8 @@ export interface IGridConfig extends IDragConfig {
110
110
  height?: number | "auto";
111
111
  autoWidth?: boolean;
112
112
  rowHeight?: number;
113
- headerRowHeight?: number;
114
- footerRowHeight?: number;
113
+ headerRowHeight?: TFixedRowHeight;
114
+ footerRowHeight?: TFixedRowHeight;
115
115
  footerPosition?: IFooterPosition;
116
116
  leftSplit?: number;
117
117
  topSplit?: number;
@@ -126,6 +126,7 @@ export interface IGridConfig extends IDragConfig {
126
126
  css?: string;
127
127
  rowCss?: (row: IRow) => string;
128
128
  exportStyles?: boolean | string[];
129
+ ariaLabel?: string;
129
130
  selection?: ISelectionType;
130
131
  multiselection?: boolean;
131
132
  rangeSelection?: boolean | IRangeConfig;
@@ -167,6 +168,8 @@ export interface IGridConfig extends IDragConfig {
167
168
  $footerHeight?: number;
168
169
  $headerHeightMap?: number[];
169
170
  $footerHeightMap?: number[];
171
+ $headerAutoHeightMap?: boolean[];
172
+ $footerAutoHeightMap?: boolean[];
170
173
  $totalWidth?: number;
171
174
  $totalHeight?: number;
172
175
  $rowHeights?: PrefixSums;
@@ -243,6 +246,8 @@ export interface IRendererConfig extends Required<IProGridConfig> {
243
246
  $renderFrom?: RenderFrom;
244
247
  $isDragging?: boolean;
245
248
  $rowIndexShift?: number;
249
+ /** @internal only for {@link ICellState.hideSpans} in a grid with rendered spans */
250
+ $spanAreas?: ISpanArea[];
246
251
  _events?: IEventSystem<GridSystemEvents>;
247
252
  }
248
253
  export declare enum GridEvents {
@@ -447,6 +452,7 @@ export interface ICol {
447
452
  };
448
453
  $uniqueData?: any[];
449
454
  $activeFilterData?: any[];
455
+ $filterOptions?: IOption[];
450
456
  $index?: number;
451
457
  $width?: number;
452
458
  $fixedWidth?: boolean;
@@ -463,6 +469,8 @@ export interface IRow {
463
469
  $opened?: boolean;
464
470
  $subRowHeight?: number;
465
471
  $draggable?: boolean;
472
+ $count?: number;
473
+ $totalCount?: number;
466
474
  }
467
475
  export interface ISpan {
468
476
  row: Id;
@@ -500,7 +508,7 @@ export interface IContent {
500
508
  export type TContentFilter = "inputFilter" | "selectFilter" | "comboFilter" | "dateFilter";
501
509
  export interface IHeader extends IContent {
502
510
  content?: TContentFilter;
503
- filterConfig?: IComboFilterConfig | IInputFilterConfig | IDateFilterConfig;
511
+ filterConfig?: IComboFilterConfig | IInputFilterConfig | IDateFilterConfig | ISelectFilterConfig;
504
512
  customFilter?: (item: string | number | Date | Date[], match: string | string[] | Date | Date[]) => boolean;
505
513
  headerSort?: boolean;
506
514
  sortAs?: SortFunction;
@@ -545,6 +553,8 @@ export interface IGroup {
545
553
  panelHeight: number;
546
554
  hideableColumns?: boolean;
547
555
  showMissed?: boolean | string;
556
+ showEmptyGroups?: boolean;
557
+ counter?: boolean | ((row: IRow) => string);
548
558
  fields?: {
549
559
  [colId: string]: Omit<IGroupOrder, "by">;
550
560
  };
@@ -625,6 +635,7 @@ export interface IOption {
625
635
  value: string;
626
636
  }
627
637
  export type TOption = IOption | string;
638
+ export type TFilterOptions = TOption[] | ((uniqueData: IOption[], col: ICol) => TOption[]);
628
639
  export type SortFunction = (cellValue: any) => string | number;
629
640
  type MarkFunction = (cell: any, columnCells: any[], row: IRow, column: ICol) => string;
630
641
  export interface IMark {
@@ -651,7 +662,7 @@ export interface ILayoutState {
651
662
  footerAtBottom: boolean;
652
663
  }
653
664
  export interface IFixedRowsConfig extends ILayoutState {
654
- name: "header" | "footer";
665
+ name: TFixedRowsName;
655
666
  position: "top" | "bottom";
656
667
  }
657
668
  export interface ICoords {
@@ -676,6 +687,12 @@ export type IDragType = "row" | "column" | "both";
676
687
  export type AdjustTargetType = "data" | "header" | "footer";
677
688
  export type IAdjustBy = AdjustTargetType | boolean;
678
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
+ }
679
696
  export interface IAdjustColumns {
680
697
  rows: IRow[];
681
698
  cols: ICol[];
@@ -721,5 +738,19 @@ export interface ICellState {
721
738
  }>;
722
739
  editable?: boolean;
723
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>;
724
755
  }
725
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;
@@ -25,6 +25,8 @@ export interface IResolvedCellState {
25
25
  tabRow: Id;
26
26
  tabCol: Id;
27
27
  readonly: "true" | "false";
28
+ /** the cells a host reports as read-only in an editable grid */
29
+ readonlyCells: ICellState["readonlyCells"];
28
30
  /** whether `aria-selected` belongs on a cell at all — it does not in row selection mode */
29
31
  exposeSelected: boolean;
30
32
  isSelected: (rowId: Id, colId: Id) => boolean;
@@ -31,5 +31,6 @@ export declare class ComboFilter implements IHeaderFilter {
31
31
  blur(): void;
32
32
  destructor(): void;
33
33
  private _setData;
34
+ private _getFilterValue;
34
35
  private _checkValue;
35
36
  }
@@ -24,5 +24,6 @@ export declare class SelectFilter implements IHeaderFilter {
24
24
  clear(silent?: boolean): void;
25
25
  focus(): void;
26
26
  blur(): void;
27
+ private _getOptions;
27
28
  private initHandlers;
28
29
  }
@@ -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 interface IComboFilterConfig {
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-right" | "dxi dxi-chevron-left" | "dxi dxi-chevron-up" | "dxi dxi-chevron-down";
48
58
  protected _isLastCell(): boolean;
49
59
  protected _getNextCell(): any;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_CELL_HEADER_HEIGHT = 37;
2
+ export declare const DEFAULT_CELL_HEADER_WIDTH = 45;
@@ -1,4 +1,4 @@
1
- import { ICellConfig } from "./types";
1
+ import { ICellConfig } from "../types";
2
2
  export declare function getBlockRange(block1: ClientRect, block2: ClientRect, isXLayout?: boolean): {
3
3
  min: number;
4
4
  max: number;