@adaptabletools/adaptable 18.0.0-canary.29 → 18.0.0-canary.30
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/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
- package/src/Api/GridApi.d.ts +11 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -0
- package/src/Api/Implementation/GridApiImpl.js +8 -1
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +1 -4
- package/src/Api/Internal/FormatColumnInternalApi.js +10 -10
- package/src/PredefinedConfig/FormatColumnState.d.ts +3 -2
- package/src/Utilities/Services/ReportService.js +5 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -1
- package/src/agGrid/AdaptableAgGrid.js +8 -7
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "18.0.0-canary.
|
|
3
|
+
"version": "18.0.0-canary.30",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -238,7 +238,8 @@ export interface IAdaptable {
|
|
|
238
238
|
getRowCount(): number;
|
|
239
239
|
getColumnCount(): number;
|
|
240
240
|
getVisibleColumnCount(): number;
|
|
241
|
-
|
|
241
|
+
isGridRangeSelectable(): boolean;
|
|
242
|
+
isGridRowSelectable(): boolean;
|
|
242
243
|
isGridGroupingActive(): boolean;
|
|
243
244
|
getAgGridCurrentThemeName(): string;
|
|
244
245
|
applyAdaptableTheme(theme: AdaptableTheme | string): void;
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -359,9 +359,19 @@ export interface GridApi {
|
|
|
359
359
|
*/
|
|
360
360
|
isGridGroupable(): boolean;
|
|
361
361
|
/**
|
|
362
|
-
* Whether AdapTable instance offers
|
|
362
|
+
* Whether AdapTable instance offers row selection
|
|
363
|
+
*
|
|
364
|
+
* @deprecated use `isGridRowSelectable()` instead
|
|
363
365
|
*/
|
|
364
366
|
isGridSelectable(): boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Whether AdapTable instance offers row selection
|
|
369
|
+
*/
|
|
370
|
+
isGridRowSelectable(): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Whether AdapTable instance offers cell range selection
|
|
373
|
+
*/
|
|
374
|
+
isGridRangeSelectable(): boolean;
|
|
365
375
|
/**
|
|
366
376
|
* Whether Grid is currently showing Row Groups
|
|
367
377
|
*/
|
|
@@ -94,6 +94,8 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
94
94
|
isGridPivotable(): boolean;
|
|
95
95
|
isGridGroupable(): boolean;
|
|
96
96
|
isGridSelectable(): boolean;
|
|
97
|
+
isGridRowSelectable(): boolean;
|
|
98
|
+
isGridRangeSelectable(): boolean;
|
|
97
99
|
isGridRowGrouped(): boolean;
|
|
98
100
|
isGridInPivotMode(): boolean;
|
|
99
101
|
isGroupRowNode(rowNode: IRowNode): boolean;
|
|
@@ -356,7 +356,14 @@ export class GridApiImpl extends ApiBase {
|
|
|
356
356
|
return !this.getAdaptableApi().internalApi.isGridInTreeMode();
|
|
357
357
|
}
|
|
358
358
|
isGridSelectable() {
|
|
359
|
-
|
|
359
|
+
logDeprecation(this.adaptable.logger, 'GridApi', 'isGridSelectable', 'isGridRowSelectable');
|
|
360
|
+
return this.isGridRowSelectable();
|
|
361
|
+
}
|
|
362
|
+
isGridRowSelectable() {
|
|
363
|
+
return this.adaptable.isGridRowSelectable();
|
|
364
|
+
}
|
|
365
|
+
isGridRangeSelectable() {
|
|
366
|
+
return this.adaptable.isGridRangeSelectable();
|
|
360
367
|
}
|
|
361
368
|
isGridRowGrouped() {
|
|
362
369
|
return this.adaptable.isGridGroupingActive();
|
|
@@ -84,10 +84,7 @@ export declare class FormatColumnInternalApi extends ApiBase {
|
|
|
84
84
|
* @param column
|
|
85
85
|
* @param params
|
|
86
86
|
*/
|
|
87
|
-
|
|
88
|
-
node: IRowNode;
|
|
89
|
-
value: any;
|
|
90
|
-
}): boolean;
|
|
87
|
+
formatColumnShouldRender(formatColumn: FormatColumn, column: AdaptableColumn, rowNode: IRowNode, cellValue: any): boolean;
|
|
91
88
|
private evaluatePredicate;
|
|
92
89
|
private evaluateExpression;
|
|
93
90
|
/**
|
|
@@ -154,29 +154,29 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
154
154
|
* @param column
|
|
155
155
|
* @param params
|
|
156
156
|
*/
|
|
157
|
-
|
|
158
|
-
var _a, _b, _c
|
|
157
|
+
formatColumnShouldRender(formatColumn, column, rowNode, cellValue) {
|
|
158
|
+
var _a, _b, _c;
|
|
159
159
|
// suspended is important to be first
|
|
160
160
|
if (formatColumn.IsSuspended) {
|
|
161
161
|
return false;
|
|
162
162
|
}
|
|
163
163
|
if (!formatColumn.IncludeGroupedRows &&
|
|
164
|
-
this.getAdaptableApi().gridApi.isGroupRowNode(
|
|
164
|
+
this.getAdaptableApi().gridApi.isGroupRowNode(rowNode)) {
|
|
165
165
|
return false;
|
|
166
166
|
}
|
|
167
|
-
if (!formatColumn.IncludeRowSummaries && ((
|
|
167
|
+
if (!formatColumn.IncludeRowSummaries && ((_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data) === null || _a === void 0 ? void 0 : _a[ROW_SUMMARY_ROW_ID])) {
|
|
168
168
|
return false;
|
|
169
169
|
}
|
|
170
170
|
if (!formatColumn.Rule) {
|
|
171
171
|
return true;
|
|
172
172
|
}
|
|
173
173
|
// first run the predicate
|
|
174
|
-
if (formatColumn.Rule.Predicates && ((
|
|
175
|
-
const predicateDefHandlerContext = Object.assign({ value:
|
|
174
|
+
if (formatColumn.Rule.Predicates && ((_c = (_b = formatColumn.Rule) === null || _b === void 0 ? void 0 : _b.Predicates) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
175
|
+
const predicateDefHandlerContext = Object.assign({ value: cellValue, oldValue: null, displayValue: cellValue, node: rowNode, column: column }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
176
176
|
return this.evaluatePredicate(formatColumn, predicateDefHandlerContext);
|
|
177
|
-
}
|
|
177
|
+
} // then run the Expression
|
|
178
178
|
else if (formatColumn.Rule.BooleanExpression) {
|
|
179
|
-
return this.evaluateExpression(formatColumn,
|
|
179
|
+
return this.evaluateExpression(formatColumn, rowNode);
|
|
180
180
|
}
|
|
181
181
|
// nothing has passed then return false
|
|
182
182
|
return false;
|
|
@@ -200,7 +200,7 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
200
200
|
* @param params
|
|
201
201
|
*/
|
|
202
202
|
getFormatColumnsRelevantForColumn(formatColumns, column, params) {
|
|
203
|
-
return formatColumns.filter((formatColumn) => this.
|
|
203
|
+
return formatColumns.filter((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
206
|
* Extract from the given FormatColumns the one which is the most relevant for a given cell (intersection of given AdaptableColumn and RowNode)
|
|
@@ -210,7 +210,7 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
210
210
|
* @param params
|
|
211
211
|
*/
|
|
212
212
|
getMostRelevantFormatColumnForColumn(formatColumns, column, params) {
|
|
213
|
-
return formatColumns.find((formatColumn) => this.
|
|
213
|
+
return formatColumns.find((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
216
|
* Retrieves all Format Columns which have an Expression
|
|
@@ -41,12 +41,13 @@ export interface FormatColumn extends SuspendableObject {
|
|
|
41
41
|
*/
|
|
42
42
|
CellAlignment?: 'Left' | 'Right' | 'Center';
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Interop.io to Format the Column in Grouped Rows
|
|
45
45
|
* @defaultValue false
|
|
46
46
|
*/
|
|
47
47
|
IncludeGroupedRows?: boolean;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Interop.io to include Row Summary Rows
|
|
50
|
+
* @defaultValue false
|
|
50
51
|
*/
|
|
51
52
|
IncludeRowSummaries?: boolean;
|
|
52
53
|
}
|
|
@@ -84,8 +84,11 @@ export class ReportService {
|
|
|
84
84
|
reportName == VISUAL_DATA_REPORT);
|
|
85
85
|
}
|
|
86
86
|
IsSystemReportActive(reportName) {
|
|
87
|
-
if (reportName == SELECTED_CELLS_REPORT
|
|
88
|
-
return this.adaptableApi.gridApi.
|
|
87
|
+
if (reportName == SELECTED_CELLS_REPORT) {
|
|
88
|
+
return this.adaptableApi.gridApi.isGridRangeSelectable();
|
|
89
|
+
}
|
|
90
|
+
if (reportName == SELECTED_ROWS_REPORT) {
|
|
91
|
+
return this.adaptableApi.gridApi.isGridRowSelectable();
|
|
89
92
|
}
|
|
90
93
|
if (reportName === VISUAL_DATA_REPORT) {
|
|
91
94
|
return this.adaptableApi.exportApi
|
|
@@ -159,7 +159,8 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
159
159
|
getAdaptableContainerElement(): HTMLElement | null;
|
|
160
160
|
refreshSelectedCellsState(): SelectedCellInfo | undefined;
|
|
161
161
|
refreshSelectedRowsState(): SelectedRowInfo | undefined;
|
|
162
|
-
|
|
162
|
+
isGridRowSelectable(): boolean;
|
|
163
|
+
isGridRangeSelectable(): boolean;
|
|
163
164
|
private initAdaptableStore;
|
|
164
165
|
private mapAdaptableStateToAgGridState;
|
|
165
166
|
private addGridEventListeners;
|
|
@@ -1127,10 +1127,7 @@ export class AdaptableAgGrid {
|
|
|
1127
1127
|
// This method returns selected cells ONLY (if selection mode is cells or multiple cells).
|
|
1128
1128
|
// If the selection mode is row it will returns nothing - use the setSelectedRows() method
|
|
1129
1129
|
refreshSelectedCellsState() {
|
|
1130
|
-
|
|
1131
|
-
const isRangeSelectionModuleRegistered = this.agGridAdapter.isModulePresent(ModuleNames.RangeSelectionModule);
|
|
1132
|
-
if (!isRangeSelectionModuleRegistered ||
|
|
1133
|
-
!((_a = this.agGridAdapter.getLiveGridOptions()) === null || _a === void 0 ? void 0 : _a.enableRangeSelection) === true) {
|
|
1130
|
+
if (!this.isGridRangeSelectable()) {
|
|
1134
1131
|
return;
|
|
1135
1132
|
}
|
|
1136
1133
|
const selectedCellInfo = this.agGridAdapter.deriveSelectedCellInfoFromAgGrid();
|
|
@@ -1141,8 +1138,8 @@ export class AdaptableAgGrid {
|
|
|
1141
1138
|
return selectedCellInfo;
|
|
1142
1139
|
}
|
|
1143
1140
|
refreshSelectedRowsState() {
|
|
1144
|
-
if (!this.
|
|
1145
|
-
return
|
|
1141
|
+
if (!this.isGridRowSelectable()) {
|
|
1142
|
+
return;
|
|
1146
1143
|
}
|
|
1147
1144
|
const selectedRowInfo = this.agGridAdapter.deriveSelectedRowInfoFromAgGrid();
|
|
1148
1145
|
this.api.gridApi.internalApi.setSelectedRows(selectedRowInfo);
|
|
@@ -1150,10 +1147,14 @@ export class AdaptableAgGrid {
|
|
|
1150
1147
|
this.api.eventApi.emit('RowSelectionChanged', rowSelectionChangedInfo);
|
|
1151
1148
|
return selectedRowInfo;
|
|
1152
1149
|
}
|
|
1153
|
-
|
|
1150
|
+
isGridRowSelectable() {
|
|
1154
1151
|
const rowSelection = this.agGridAdapter.getAgGridApi().getGridOption('rowSelection');
|
|
1155
1152
|
return rowSelection === 'single' || rowSelection === 'multiple';
|
|
1156
1153
|
}
|
|
1154
|
+
isGridRangeSelectable() {
|
|
1155
|
+
return (this.agGridAdapter.isModulePresent(ModuleNames.RangeSelectionModule) &&
|
|
1156
|
+
this.agGridAdapter.getGridOption('enableRangeSelection'));
|
|
1157
|
+
}
|
|
1157
1158
|
initAdaptableStore() {
|
|
1158
1159
|
const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
|
|
1159
1160
|
const adaptableStore = new AdaptableStore(this);
|
|
@@ -604,7 +604,7 @@ export class AgGridColumnAdapter {
|
|
|
604
604
|
.map((formatColumn) => {
|
|
605
605
|
var _a, _b;
|
|
606
606
|
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
607
|
-
this.adaptableApi.formatColumnApi.internalApi.
|
|
607
|
+
this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value)) {
|
|
608
608
|
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
609
609
|
}
|
|
610
610
|
})
|
|
@@ -729,7 +729,7 @@ export class AgGridColumnAdapter {
|
|
|
729
729
|
return {};
|
|
730
730
|
}
|
|
731
731
|
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
732
|
-
return this.adaptableApi.formatColumnApi.internalApi.
|
|
732
|
+
return this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value);
|
|
733
733
|
});
|
|
734
734
|
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
735
735
|
}
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "18.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1712760567298 || Date.now(),
|
|
4
|
+
VERSION: "18.0.0-canary.30" || '--current-version--',
|
|
5
5
|
};
|