@adaptabletools/adaptable-cjs 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.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
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;
|
|
@@ -360,7 +360,14 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
360
360
|
return !this.getAdaptableApi().internalApi.isGridInTreeMode();
|
|
361
361
|
}
|
|
362
362
|
isGridSelectable() {
|
|
363
|
-
|
|
363
|
+
(0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'GridApi', 'isGridSelectable', 'isGridRowSelectable');
|
|
364
|
+
return this.isGridRowSelectable();
|
|
365
|
+
}
|
|
366
|
+
isGridRowSelectable() {
|
|
367
|
+
return this.adaptable.isGridRowSelectable();
|
|
368
|
+
}
|
|
369
|
+
isGridRangeSelectable() {
|
|
370
|
+
return this.adaptable.isGridRangeSelectable();
|
|
364
371
|
}
|
|
365
372
|
isGridRowGrouped() {
|
|
366
373
|
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
|
/**
|
|
@@ -158,29 +158,29 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
158
158
|
* @param column
|
|
159
159
|
* @param params
|
|
160
160
|
*/
|
|
161
|
-
|
|
162
|
-
var _a, _b, _c
|
|
161
|
+
formatColumnShouldRender(formatColumn, column, rowNode, cellValue) {
|
|
162
|
+
var _a, _b, _c;
|
|
163
163
|
// suspended is important to be first
|
|
164
164
|
if (formatColumn.IsSuspended) {
|
|
165
165
|
return false;
|
|
166
166
|
}
|
|
167
167
|
if (!formatColumn.IncludeGroupedRows &&
|
|
168
|
-
this.getAdaptableApi().gridApi.isGroupRowNode(
|
|
168
|
+
this.getAdaptableApi().gridApi.isGroupRowNode(rowNode)) {
|
|
169
169
|
return false;
|
|
170
170
|
}
|
|
171
|
-
if (!formatColumn.IncludeRowSummaries && ((
|
|
171
|
+
if (!formatColumn.IncludeRowSummaries && ((_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data) === null || _a === void 0 ? void 0 : _a[RowSummary_1.ROW_SUMMARY_ROW_ID])) {
|
|
172
172
|
return false;
|
|
173
173
|
}
|
|
174
174
|
if (!formatColumn.Rule) {
|
|
175
175
|
return true;
|
|
176
176
|
}
|
|
177
177
|
// first run the predicate
|
|
178
|
-
if (formatColumn.Rule.Predicates && ((
|
|
179
|
-
const predicateDefHandlerContext = Object.assign({ value:
|
|
178
|
+
if (formatColumn.Rule.Predicates && ((_c = (_b = formatColumn.Rule) === null || _b === void 0 ? void 0 : _b.Predicates) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
179
|
+
const predicateDefHandlerContext = Object.assign({ value: cellValue, oldValue: null, displayValue: cellValue, node: rowNode, column: column }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
180
180
|
return this.evaluatePredicate(formatColumn, predicateDefHandlerContext);
|
|
181
|
-
}
|
|
181
|
+
} // then run the Expression
|
|
182
182
|
else if (formatColumn.Rule.BooleanExpression) {
|
|
183
|
-
return this.evaluateExpression(formatColumn,
|
|
183
|
+
return this.evaluateExpression(formatColumn, rowNode);
|
|
184
184
|
}
|
|
185
185
|
// nothing has passed then return false
|
|
186
186
|
return false;
|
|
@@ -204,7 +204,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
204
204
|
* @param params
|
|
205
205
|
*/
|
|
206
206
|
getFormatColumnsRelevantForColumn(formatColumns, column, params) {
|
|
207
|
-
return formatColumns.filter((formatColumn) => this.
|
|
207
|
+
return formatColumns.filter((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
210
|
* Extract from the given FormatColumns the one which is the most relevant for a given cell (intersection of given AdaptableColumn and RowNode)
|
|
@@ -214,7 +214,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
214
214
|
* @param params
|
|
215
215
|
*/
|
|
216
216
|
getMostRelevantFormatColumnForColumn(formatColumns, column, params) {
|
|
217
|
-
return formatColumns.find((formatColumn) => this.
|
|
217
|
+
return formatColumns.find((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
220
220
|
* 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
|
}
|
|
@@ -88,8 +88,11 @@ class ReportService {
|
|
|
88
88
|
reportName == GeneralConstants_1.VISUAL_DATA_REPORT);
|
|
89
89
|
}
|
|
90
90
|
IsSystemReportActive(reportName) {
|
|
91
|
-
if (reportName == GeneralConstants_1.SELECTED_CELLS_REPORT
|
|
92
|
-
return this.adaptableApi.gridApi.
|
|
91
|
+
if (reportName == GeneralConstants_1.SELECTED_CELLS_REPORT) {
|
|
92
|
+
return this.adaptableApi.gridApi.isGridRangeSelectable();
|
|
93
|
+
}
|
|
94
|
+
if (reportName == GeneralConstants_1.SELECTED_ROWS_REPORT) {
|
|
95
|
+
return this.adaptableApi.gridApi.isGridRowSelectable();
|
|
93
96
|
}
|
|
94
97
|
if (reportName === GeneralConstants_1.VISUAL_DATA_REPORT) {
|
|
95
98
|
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;
|
|
@@ -1131,10 +1131,7 @@ class AdaptableAgGrid {
|
|
|
1131
1131
|
// This method returns selected cells ONLY (if selection mode is cells or multiple cells).
|
|
1132
1132
|
// If the selection mode is row it will returns nothing - use the setSelectedRows() method
|
|
1133
1133
|
refreshSelectedCellsState() {
|
|
1134
|
-
|
|
1135
|
-
const isRangeSelectionModuleRegistered = this.agGridAdapter.isModulePresent(core_1.ModuleNames.RangeSelectionModule);
|
|
1136
|
-
if (!isRangeSelectionModuleRegistered ||
|
|
1137
|
-
!((_a = this.agGridAdapter.getLiveGridOptions()) === null || _a === void 0 ? void 0 : _a.enableRangeSelection) === true) {
|
|
1134
|
+
if (!this.isGridRangeSelectable()) {
|
|
1138
1135
|
return;
|
|
1139
1136
|
}
|
|
1140
1137
|
const selectedCellInfo = this.agGridAdapter.deriveSelectedCellInfoFromAgGrid();
|
|
@@ -1145,8 +1142,8 @@ class AdaptableAgGrid {
|
|
|
1145
1142
|
return selectedCellInfo;
|
|
1146
1143
|
}
|
|
1147
1144
|
refreshSelectedRowsState() {
|
|
1148
|
-
if (!this.
|
|
1149
|
-
return
|
|
1145
|
+
if (!this.isGridRowSelectable()) {
|
|
1146
|
+
return;
|
|
1150
1147
|
}
|
|
1151
1148
|
const selectedRowInfo = this.agGridAdapter.deriveSelectedRowInfoFromAgGrid();
|
|
1152
1149
|
this.api.gridApi.internalApi.setSelectedRows(selectedRowInfo);
|
|
@@ -1154,10 +1151,14 @@ class AdaptableAgGrid {
|
|
|
1154
1151
|
this.api.eventApi.emit('RowSelectionChanged', rowSelectionChangedInfo);
|
|
1155
1152
|
return selectedRowInfo;
|
|
1156
1153
|
}
|
|
1157
|
-
|
|
1154
|
+
isGridRowSelectable() {
|
|
1158
1155
|
const rowSelection = this.agGridAdapter.getAgGridApi().getGridOption('rowSelection');
|
|
1159
1156
|
return rowSelection === 'single' || rowSelection === 'multiple';
|
|
1160
1157
|
}
|
|
1158
|
+
isGridRangeSelectable() {
|
|
1159
|
+
return (this.agGridAdapter.isModulePresent(core_1.ModuleNames.RangeSelectionModule) &&
|
|
1160
|
+
this.agGridAdapter.getGridOption('enableRangeSelection'));
|
|
1161
|
+
}
|
|
1161
1162
|
initAdaptableStore() {
|
|
1162
1163
|
const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
|
|
1163
1164
|
const adaptableStore = new AdaptableStore_1.AdaptableStore(this);
|
|
@@ -608,7 +608,7 @@ class AgGridColumnAdapter {
|
|
|
608
608
|
.map((formatColumn) => {
|
|
609
609
|
var _a, _b;
|
|
610
610
|
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
611
|
-
this.adaptableApi.formatColumnApi.internalApi.
|
|
611
|
+
this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value)) {
|
|
612
612
|
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
613
613
|
}
|
|
614
614
|
})
|
|
@@ -733,7 +733,7 @@ class AgGridColumnAdapter {
|
|
|
733
733
|
return {};
|
|
734
734
|
}
|
|
735
735
|
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
736
|
-
return this.adaptableApi.formatColumnApi.internalApi.
|
|
736
|
+
return this.adaptableApi.formatColumnApi.internalApi.formatColumnShouldRender(formatColumn, abColumn, params.node, params.value);
|
|
737
737
|
});
|
|
738
738
|
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
739
739
|
}
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
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" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "18.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1712760596288 || Date.now(),
|
|
6
|
+
VERSION: "18.0.0-canary.30" || '--current-version--',
|
|
7
7
|
};
|