@adaptabletools/adaptable-cjs 21.2.1 → 21.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/package.json +1 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +1 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +3 -0
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +6 -0
- package/src/AdaptableState/Common/DataUpdateConfig.d.ts +4 -4
- package/src/AdaptableState/Common/RowDataChangedInfo.d.ts +3 -0
- package/src/AdaptableState/InitialState.d.ts +1 -1
- package/src/AdaptableState/Selection/GridCell.d.ts +9 -0
- package/src/Api/CustomSortApi.d.ts +6 -1
- package/src/Api/Implementation/CustomSortApiImpl.d.ts +2 -1
- package/src/Api/Implementation/CustomSortApiImpl.js +5 -1
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -0
- package/src/Api/Implementation/LayoutApiImpl.js +82 -1
- package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/PredicateApiImpl.js +17 -2
- package/src/Api/Implementation/ScheduleApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ScheduleApiImpl.js +12 -0
- package/src/Api/Implementation/ShortcutApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ShortcutApiImpl.js +4 -0
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +4 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +1 -0
- package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
- package/src/Api/Internal/LayoutInternalApi.js +9 -0
- package/src/Api/LayoutApi.d.ts +7 -1
- package/src/Api/ScheduleApi.d.ts +5 -0
- package/src/Api/ShortcutApi.d.ts +5 -0
- package/src/Api/StyledColumnApi.d.ts +5 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +6 -6
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +16 -16
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +18 -17
- package/src/Utilities/Constants/DocumentationLinkConstants.js +19 -18
- package/src/Utilities/Services/ModuleService.js +37 -38
- package/src/agGrid/AdaptableAgGrid.d.ts +11 -1
- package/src/agGrid/AdaptableAgGrid.js +63 -9
- package/src/agGrid/AdaptableFilterHandler.d.ts +1 -0
- package/src/agGrid/AdaptableFilterHandler.js +15 -5
- package/src/agGrid/AdaptableLogger.d.ts +3 -0
- package/src/agGrid/AdaptableLogger.js +3 -0
- package/src/agGrid/AgGridAdapter.d.ts +2 -0
- package/src/agGrid/AgGridAdapter.js +29 -15
- package/src/agGrid/index.d.ts +6 -0
- package/src/agGrid/index.js +6 -0
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.d.ts +6 -0
- package/src/layout-manager/src/index.js +20 -0
- package/src/metamodel/adaptable.metamodel.d.ts +57 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
1
|
+
export declare const HOST_URL_ROOT = "https://www.adaptabletools.com";
|
|
2
|
+
export declare const HOST_URL_DOCS = "https://www.adaptabletools.com/docs";
|
|
3
|
+
export declare const ExpressionEditorDocsLink = "https://www.adaptabletools.com/docs/ui-expression-editor";
|
|
4
|
+
export declare const BooleanQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-standard";
|
|
5
|
+
export declare const ScalarQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-standard";
|
|
6
|
+
export declare const ObservableQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-observable";
|
|
7
|
+
export declare const AggregatedBooleanQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-aggregation";
|
|
8
|
+
export declare const AggregatedScalarQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-aggregation";
|
|
9
|
+
export declare const CumulativeAggregatedScalarQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-cumulative";
|
|
10
|
+
export declare const QuantileAggregatedScalarQueryDocsLink = "https://www.adaptabletools.com/docs/adaptable-ql-expression-quantile";
|
|
11
|
+
export declare const PredicateDocsLink = "https://www.adaptabletools.com/docs/adaptable-predicate";
|
|
12
|
+
export declare const PrimaryKeyDocsLink = "https://www.adaptabletools.com/docs/getting-started-primary-key";
|
|
13
|
+
export declare const LicenseDocsLink = "https://www.adaptabletools.com/buy/buying-adaptable-licensing";
|
|
14
|
+
export declare const AdaptableOptionsDocsLink = "https://www.adaptabletools.com/docs/technical-reference-adaptable-options";
|
|
15
|
+
export declare const AgGridModulesDocsLink = "https://www.adaptabletools.com/docs/dev-guide-aggrid-modules-overview";
|
|
16
|
+
export declare const AlertMessageDocsLink = "https://www.adaptabletools.com/docs/handbook-alerting-message";
|
|
17
|
+
export declare const FormatColumnPlaceholderDocsLink = "https://www.adaptabletools.com/docs/handbook-column-formatting-display-format-placeholder";
|
|
18
|
+
export declare const AgGridRequiredModulesDocsLink = "https://www.adaptabletools.com/docs/dev-guide-aggrid-modules-overview#mandatory-modules";
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgGridRequiredModulesDocsLink = exports.FormatColumnPlaceholderDocsLink = exports.AlertMessageDocsLink = exports.AgGridModulesDocsLink = exports.AdaptableOptionsDocsLink = exports.LicenseDocsLink = exports.PrimaryKeyDocsLink = exports.PredicateDocsLink = exports.QuantileAggregatedScalarQueryDocsLink = exports.CumulativeAggregatedScalarQueryDocsLink = exports.AggregatedScalarQueryDocsLink = exports.AggregatedBooleanQueryDocsLink = exports.ObservableQueryDocsLink = exports.ScalarQueryDocsLink = exports.BooleanQueryDocsLink = exports.ExpressionEditorDocsLink = exports.HOST_URL_DOCS = void 0;
|
|
4
|
-
exports.
|
|
3
|
+
exports.AgGridRequiredModulesDocsLink = exports.FormatColumnPlaceholderDocsLink = exports.AlertMessageDocsLink = exports.AgGridModulesDocsLink = exports.AdaptableOptionsDocsLink = exports.LicenseDocsLink = exports.PrimaryKeyDocsLink = exports.PredicateDocsLink = exports.QuantileAggregatedScalarQueryDocsLink = exports.CumulativeAggregatedScalarQueryDocsLink = exports.AggregatedScalarQueryDocsLink = exports.AggregatedBooleanQueryDocsLink = exports.ObservableQueryDocsLink = exports.ScalarQueryDocsLink = exports.BooleanQueryDocsLink = exports.ExpressionEditorDocsLink = exports.HOST_URL_DOCS = exports.HOST_URL_ROOT = void 0;
|
|
4
|
+
exports.HOST_URL_ROOT = 'https://www.adaptabletools.com';
|
|
5
|
+
exports.HOST_URL_DOCS = `${exports.HOST_URL_ROOT}/docs`;
|
|
5
6
|
//export const HOST_URL_DOCS = 'http://localhost:3000';
|
|
6
|
-
exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/
|
|
7
|
-
exports.BooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
8
|
-
exports.ScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
9
|
-
exports.ObservableQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
10
|
-
exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
11
|
-
exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
12
|
-
exports.CumulativeAggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
13
|
-
exports.QuantileAggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/
|
|
14
|
-
exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/
|
|
15
|
-
exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/
|
|
16
|
-
exports.LicenseDocsLink = `${exports.
|
|
17
|
-
exports.AdaptableOptionsDocsLink = `${exports.HOST_URL_DOCS}/
|
|
18
|
-
exports.AgGridModulesDocsLink = `${exports.HOST_URL_DOCS}/
|
|
19
|
-
exports.AlertMessageDocsLink = `${exports.HOST_URL_DOCS}/
|
|
20
|
-
exports.FormatColumnPlaceholderDocsLink = `${exports.HOST_URL_DOCS}/
|
|
21
|
-
exports.AgGridRequiredModulesDocsLink = `${exports.HOST_URL_DOCS}/
|
|
7
|
+
exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/ui-expression-editor`;
|
|
8
|
+
exports.BooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-standard`;
|
|
9
|
+
exports.ScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-standard`;
|
|
10
|
+
exports.ObservableQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-observable`;
|
|
11
|
+
exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-aggregation`;
|
|
12
|
+
exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-aggregation`;
|
|
13
|
+
exports.CumulativeAggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-cumulative`;
|
|
14
|
+
exports.QuantileAggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/adaptable-ql-expression-quantile`;
|
|
15
|
+
exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/adaptable-predicate`;
|
|
16
|
+
exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/getting-started-primary-key`;
|
|
17
|
+
exports.LicenseDocsLink = `${exports.HOST_URL_ROOT}/buy/buying-adaptable-licensing`;
|
|
18
|
+
exports.AdaptableOptionsDocsLink = `${exports.HOST_URL_DOCS}/technical-reference-adaptable-options`;
|
|
19
|
+
exports.AgGridModulesDocsLink = `${exports.HOST_URL_DOCS}/dev-guide-aggrid-modules-overview`;
|
|
20
|
+
exports.AlertMessageDocsLink = `${exports.HOST_URL_DOCS}/handbook-alerting-message`;
|
|
21
|
+
exports.FormatColumnPlaceholderDocsLink = `${exports.HOST_URL_DOCS}/handbook-column-formatting-display-format-placeholder`;
|
|
22
|
+
exports.AgGridRequiredModulesDocsLink = `${exports.HOST_URL_DOCS}/dev-guide-aggrid-modules-overview#mandatory-modules`;
|
|
@@ -109,84 +109,83 @@ class ModuleService {
|
|
|
109
109
|
}
|
|
110
110
|
getModuleDocumentationPageByModule(adaptableModule) {
|
|
111
111
|
let url = `${DocumentationLinkConstants_1.HOST_URL_DOCS}/`;
|
|
112
|
-
let learnUrl = url + 'guide/';
|
|
113
112
|
switch (adaptableModule) {
|
|
114
113
|
case 'Alert':
|
|
115
|
-
return
|
|
114
|
+
return url + 'handbook-alerting';
|
|
116
115
|
case 'BulkUpdate':
|
|
117
116
|
return url + 'handbook-editing-bulk-update';
|
|
118
117
|
case 'CalculatedColumn':
|
|
119
|
-
return
|
|
118
|
+
return url + 'handbook-calculated-column';
|
|
120
119
|
case 'CellSummary':
|
|
121
|
-
return
|
|
120
|
+
return url + 'handbook-summarising';
|
|
122
121
|
case 'Charting':
|
|
123
|
-
return
|
|
122
|
+
return url + 'handbook-charts';
|
|
124
123
|
case 'ColumnFilter':
|
|
125
|
-
return
|
|
124
|
+
return url + 'handbook-column-filter';
|
|
126
125
|
case 'ColumnInfo':
|
|
127
|
-
return
|
|
126
|
+
return url + 'dev-guide-column-grid-column-info';
|
|
128
127
|
case 'Comment':
|
|
129
|
-
return
|
|
128
|
+
return url + 'handbook-comments';
|
|
130
129
|
case 'CustomSort':
|
|
131
|
-
return
|
|
130
|
+
return url + 'handbook-custom-sorting';
|
|
132
131
|
case 'Dashboard':
|
|
133
|
-
return
|
|
132
|
+
return url + 'ui-dashboard';
|
|
134
133
|
case 'DataChangeHistory':
|
|
135
|
-
return
|
|
134
|
+
return url + 'handbook-monitoring-data-change-history';
|
|
136
135
|
case 'DataImport':
|
|
137
|
-
return
|
|
136
|
+
return url + 'handbook-importing';
|
|
138
137
|
case 'DataSet':
|
|
139
|
-
return
|
|
138
|
+
return url + 'handbook-data-sets';
|
|
140
139
|
case 'Export':
|
|
141
|
-
return
|
|
140
|
+
return url + 'handbook-exporting';
|
|
142
141
|
case 'Fdc3':
|
|
143
|
-
return
|
|
142
|
+
return url + 'handbook-fdc3';
|
|
144
143
|
case 'FlashingCell':
|
|
145
|
-
return
|
|
144
|
+
return url + 'handbook-flashing-cell';
|
|
146
145
|
case 'FormatColumn':
|
|
147
|
-
return
|
|
146
|
+
return url + 'handbook-column-formatting';
|
|
148
147
|
case 'FreeTextColumn':
|
|
149
|
-
return
|
|
148
|
+
return url + 'handbook-freetext-column';
|
|
150
149
|
case 'GridFilter':
|
|
151
|
-
return
|
|
150
|
+
return url + 'handbook-grid-filter';
|
|
152
151
|
case 'GridInfo':
|
|
153
|
-
return
|
|
152
|
+
return url + 'dev-guide-column-grid-column-info';
|
|
154
153
|
case 'Layout':
|
|
155
|
-
return
|
|
154
|
+
return url + 'handbook-layouts';
|
|
156
155
|
case 'NamedQuery':
|
|
157
|
-
return
|
|
156
|
+
return url + 'handbook-named-queries';
|
|
158
157
|
case 'Note':
|
|
159
|
-
return
|
|
158
|
+
return url + 'handbook-notes';
|
|
160
159
|
case 'PlusMinus':
|
|
161
|
-
return
|
|
160
|
+
return url + 'handbook-editing-plus-minus';
|
|
162
161
|
case 'QuickSearch':
|
|
163
|
-
return
|
|
162
|
+
return url + 'handbook-quick-search';
|
|
164
163
|
case 'Schedule':
|
|
165
|
-
return
|
|
164
|
+
return url + 'handbook-scheduling';
|
|
166
165
|
case 'SettingsPanel':
|
|
167
|
-
return
|
|
166
|
+
return url + 'ui-settings-panel';
|
|
168
167
|
case 'Shortcut':
|
|
169
|
-
return
|
|
168
|
+
return url + 'handbook-editing-shortcut';
|
|
170
169
|
case 'SmartEdit':
|
|
171
|
-
return
|
|
170
|
+
return url + 'handbook-editing-smart-edit';
|
|
172
171
|
case 'StateManagement':
|
|
173
|
-
return
|
|
172
|
+
return url + 'dev-guide-adaptable-state-management';
|
|
174
173
|
case 'StatusBar':
|
|
175
|
-
return
|
|
174
|
+
return url + 'ui-status-bar';
|
|
176
175
|
case 'StyledColumn':
|
|
177
|
-
return
|
|
176
|
+
return url + 'handbook-styled-column-overview';
|
|
178
177
|
case 'SystemStatus':
|
|
179
|
-
return
|
|
178
|
+
return url + 'handbook-system-status-message';
|
|
180
179
|
case 'TeamSharing':
|
|
181
|
-
return
|
|
180
|
+
return url + 'handbook-team-sharing';
|
|
182
181
|
case 'Theme':
|
|
183
|
-
return
|
|
182
|
+
return url + 'handbook-theming';
|
|
184
183
|
case 'ToolPanel':
|
|
185
|
-
return
|
|
184
|
+
return url + 'ui-tool-panel';
|
|
186
185
|
case 'IPushPull':
|
|
187
|
-
return
|
|
186
|
+
return url + 'integrations-ipushpull';
|
|
188
187
|
case 'OpenFin':
|
|
189
|
-
return
|
|
188
|
+
return url + 'integrations-openfin';
|
|
190
189
|
default:
|
|
191
190
|
return 'good';
|
|
192
191
|
}
|
|
@@ -149,9 +149,19 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
149
149
|
private normaliseToolPanelState;
|
|
150
150
|
private getCurrentLayoutModel;
|
|
151
151
|
silentUpdateCurrentLayoutModel(layoutModel?: TableLayoutModel | PivotLayoutModel): void;
|
|
152
|
+
/**
|
|
153
|
+
* Returns TRUE if filtering was applied, FALSE otherwise
|
|
154
|
+
* This is important in the INIT phase because applying filtering will automatically refresh AG Grids columnState,
|
|
155
|
+
* implicitly refreshing the sorting state too (hence we don't need to apply sorting separately)
|
|
156
|
+
*/
|
|
152
157
|
applyFiltering(config?: {
|
|
153
158
|
updateColumnFilterModel?: boolean;
|
|
154
|
-
}):
|
|
159
|
+
}): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Checks if the current layout has ColumnSorts for columns that have CustomSort defined
|
|
162
|
+
* (either via initialState CustomSorts or via customSortComparers option) and refreshes the sort if needed.
|
|
163
|
+
*/
|
|
164
|
+
private refreshInitialSortIfNeeded;
|
|
155
165
|
showQuickFilter(): void;
|
|
156
166
|
hideQuickFilter(): void;
|
|
157
167
|
private normalizeAdaptableOptions;
|
|
@@ -106,6 +106,7 @@ const AgGridModulesAdapter_1 = require("./AgGridModulesAdapter");
|
|
|
106
106
|
const devTools_1 = require("../devTools");
|
|
107
107
|
const infinite_react_1 = require("@infinite-table/infinite-react");
|
|
108
108
|
const FormatHelper_1 = require("../Utilities/Helpers/FormatHelper");
|
|
109
|
+
const PredicateApiImpl_1 = require("../Api/Implementation/PredicateApiImpl");
|
|
109
110
|
const LocalEventService_Prototype = ag_grid_enterprise_1.LocalEventService.prototype;
|
|
110
111
|
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
111
112
|
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
@@ -450,10 +451,14 @@ class AdaptableAgGrid {
|
|
|
450
451
|
this.api.themeApi.applyCurrentTheme();
|
|
451
452
|
this.validatePrimaryKey();
|
|
452
453
|
this.checkShouldClearExistingFiltersOrSearches();
|
|
453
|
-
// FIXME AFL FILTER: talk with Radu: should ColumnFilters still be ignored?!
|
|
454
|
-
// see layoutModel.Ignore_ColumnFilters
|
|
455
454
|
// initial filter model
|
|
456
|
-
this.applyFiltering();
|
|
455
|
+
const filteringApplied = this.applyFiltering();
|
|
456
|
+
// We may need to re-apply sort if there are ColumnSorts for columns with CustomSort defined
|
|
457
|
+
// This is required because AG Grid wasn't aware of the CustomSort when applying sorting initially
|
|
458
|
+
// this is not required when filtering was applied because filtering also triggers a sort refresh internally
|
|
459
|
+
if (!filteringApplied) {
|
|
460
|
+
this.refreshInitialSortIfNeeded();
|
|
461
|
+
}
|
|
457
462
|
// apply quick search if there is one
|
|
458
463
|
// yes, we could have put this on the gridOptions.findSearchValue
|
|
459
464
|
// but we need to wait for setupColumns to run first so as to correctly
|
|
@@ -625,26 +630,67 @@ You need to define at least one Layout!`);
|
|
|
625
630
|
normalize: true,
|
|
626
631
|
});
|
|
627
632
|
}
|
|
633
|
+
/**
|
|
634
|
+
* Returns TRUE if filtering was applied, FALSE otherwise
|
|
635
|
+
* This is important in the INIT phase because applying filtering will automatically refresh AG Grids columnState,
|
|
636
|
+
* implicitly refreshing the sorting state too (hence we don't need to apply sorting separately)
|
|
637
|
+
*/
|
|
628
638
|
applyFiltering(config) {
|
|
639
|
+
let filteringApplied = false;
|
|
629
640
|
// default updateColumnFilterModel to TRUE, if not provided
|
|
630
641
|
const updateColumnFilterModel = config?.updateColumnFilterModel ?? true;
|
|
631
642
|
const agGridApi = this.agGridAdapter.getAgGridApi();
|
|
632
643
|
if (updateColumnFilterModel) {
|
|
633
644
|
const columnFilters = this.api.filterApi.columnFilterApi
|
|
634
645
|
.getActiveColumnFilters()
|
|
635
|
-
//
|
|
646
|
+
// we need this additional filter because 'getActiveColumnFilters' checks only for suspended while 'isColumnFilterActive' also checkss for COMPLETE filters
|
|
636
647
|
.filter((columnFilter) => this.api.filterApi.columnFilterApi.isColumnFilterActive(columnFilter));
|
|
637
648
|
const filterModel = {};
|
|
638
649
|
columnFilters.forEach((columnFilter) => {
|
|
639
650
|
filterModel[columnFilter.ColumnId] = columnFilter;
|
|
640
651
|
});
|
|
641
652
|
agGridApi.setFilterModel(filterModel);
|
|
653
|
+
filteringApplied = Object.keys(filterModel).length > 0;
|
|
642
654
|
}
|
|
643
655
|
// FIXME AFL FILTER why is this needed???
|
|
644
656
|
this.refreshSelectedCellsState();
|
|
645
657
|
this.refreshSelectedRowsState();
|
|
646
|
-
|
|
658
|
+
// FIXME AFL: this is temporary, will be replaced with v22's new autoCol filtering
|
|
659
|
+
const currentPivotLayoutHasAutoCols = this.api.layoutApi.isCurrentLayoutPivot() &&
|
|
660
|
+
!!this.api.layoutApi.getCurrentRowGroupsColumnIds()?.length;
|
|
661
|
+
// agGridApi.setFilterModel() already triggered onFilterChanged(), so we skip it if updateColumnFilterModel is TRUE
|
|
662
|
+
if (!filteringApplied || currentPivotLayoutHasAutoCols) {
|
|
663
|
+
agGridApi.onFilterChanged();
|
|
664
|
+
filteringApplied = true;
|
|
665
|
+
}
|
|
647
666
|
this._emit('AdapTableFiltersApplied');
|
|
667
|
+
return filteringApplied;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Checks if the current layout has ColumnSorts for columns that have CustomSort defined
|
|
671
|
+
* (either via initialState CustomSorts or via customSortComparers option) and refreshes the sort if needed.
|
|
672
|
+
*/
|
|
673
|
+
refreshInitialSortIfNeeded() {
|
|
674
|
+
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
675
|
+
const columnSorts = currentLayout?.ColumnSorts;
|
|
676
|
+
if (!columnSorts || columnSorts.length === 0) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
const hasCustomSortForSortedColumn = columnSorts.some((columnSort) => {
|
|
680
|
+
// Check if there's a CustomSort defined in state for this column
|
|
681
|
+
const customSort = this.api.customSortApi.getCustomSortForColumn(columnSort.ColumnId);
|
|
682
|
+
if (customSort && !customSort.IsSuspended) {
|
|
683
|
+
return true;
|
|
684
|
+
}
|
|
685
|
+
// Check if there's a customSortComparer defined in options for this column
|
|
686
|
+
if (this.api.customSortApi.internalApi.columnHasCustomSortComparer(columnSort.ColumnId)) {
|
|
687
|
+
return true;
|
|
688
|
+
}
|
|
689
|
+
return false;
|
|
690
|
+
});
|
|
691
|
+
if (hasCustomSortForSortedColumn) {
|
|
692
|
+
this.layoutManager.refreshSort();
|
|
693
|
+
}
|
|
648
694
|
}
|
|
649
695
|
showQuickFilter() {
|
|
650
696
|
const height = this.api.optionsApi.getFilterOptions().columnFilterOptions.quickFilterHeight;
|
|
@@ -1768,14 +1814,21 @@ You need to define at least one Layout!`);
|
|
|
1768
1814
|
let _displayValue = defaults ? defaults.displayValue : undefined;
|
|
1769
1815
|
let _normalisedValue = defaults ? defaults.normalisedValue : undefined;
|
|
1770
1816
|
let _isRowGroupCell;
|
|
1771
|
-
|
|
1772
|
-
this.api.columnApi.isPivotAggColumnWithNoPivotColumns(columnId);
|
|
1817
|
+
let _isPivotCell;
|
|
1773
1818
|
const self = this;
|
|
1774
1819
|
const api = this.api;
|
|
1820
|
+
const getIsPivotCell = () => {
|
|
1821
|
+
if (_isPivotCell === undefined) {
|
|
1822
|
+
_isPivotCell =
|
|
1823
|
+
api.columnApi.isPivotResultColumn(columnId) ||
|
|
1824
|
+
api.columnApi.isPivotAggColumnWithNoPivotColumns(columnId);
|
|
1825
|
+
}
|
|
1826
|
+
return _isPivotCell;
|
|
1827
|
+
};
|
|
1775
1828
|
const getRawValue = () => {
|
|
1776
1829
|
if (_rawValue === undefined) {
|
|
1777
1830
|
_rawValue = self.getRawValueFromRowNode(rowNode, columnId);
|
|
1778
|
-
if (
|
|
1831
|
+
if (_rawValue?.value != undefined && getIsPivotCell()) {
|
|
1779
1832
|
// for pivot result columns, the raw value is an object with a value property
|
|
1780
1833
|
// we want to return the value property as the raw value
|
|
1781
1834
|
_rawValue = _rawValue.value;
|
|
@@ -1818,7 +1871,7 @@ You need to define at least one Layout!`);
|
|
|
1818
1871
|
return _primaryKeyValue;
|
|
1819
1872
|
},
|
|
1820
1873
|
get isPivotCell() {
|
|
1821
|
-
return
|
|
1874
|
+
return getIsPivotCell();
|
|
1822
1875
|
},
|
|
1823
1876
|
get isRowGroupCell() {
|
|
1824
1877
|
if (_isRowGroupCell === undefined) {
|
|
@@ -3390,6 +3443,7 @@ You need to define at least one Layout!`);
|
|
|
3390
3443
|
this.__prevLayoutForRefresh = undefined;
|
|
3391
3444
|
this.layoutManager?.destroy();
|
|
3392
3445
|
this.layoutManager = null;
|
|
3446
|
+
(0, PredicateApiImpl_1.clearPredicateDefMapMemo)();
|
|
3393
3447
|
const agGridApi = this.agGridAdapter?.getAgGridApi();
|
|
3394
3448
|
if (agGridApi && !agGridApi.isDestroyed()) {
|
|
3395
3449
|
agGridApi.removeEventListener('firstDataRendered', this.listenerFirstDataRendered);
|
|
@@ -8,6 +8,7 @@ export declare class AdaptableFilterHandler implements FilterHandler {
|
|
|
8
8
|
readonly colId: string;
|
|
9
9
|
private filterDisplayValuesResult;
|
|
10
10
|
private previousFilterDisplayValuesResult;
|
|
11
|
+
private currentColumnFilters_MEMO;
|
|
11
12
|
constructor(adaptableApi: AdaptableApi, columnSetup: ColumnSetupInfo);
|
|
12
13
|
getCurrentColumnFilters(): ColumnFilter[];
|
|
13
14
|
doesFilterPass(params: DoesFilterPassParams): boolean;
|
|
@@ -4,9 +4,17 @@ exports.AdaptableFilterHandler = void 0;
|
|
|
4
4
|
class AdaptableFilterHandler {
|
|
5
5
|
constructor(adaptableApi, columnSetup) {
|
|
6
6
|
this.adaptableApi = adaptableApi;
|
|
7
|
+
this.currentColumnFilters_MEMO = new WeakMap();
|
|
7
8
|
this.colId = columnSetup.colId;
|
|
8
9
|
}
|
|
9
10
|
getCurrentColumnFilters() {
|
|
11
|
+
// we memoize based on layout column filters object reference
|
|
12
|
+
// this method is called for each row during filtering so we need to optimize it
|
|
13
|
+
const layoutColumnFilters = this.adaptableApi.layoutApi.internalApi.getCurrentLayout_perfOptimized()?.ColumnFilters;
|
|
14
|
+
const memoizedColumnFilters = this.currentColumnFilters_MEMO.get(layoutColumnFilters);
|
|
15
|
+
if (memoizedColumnFilters) {
|
|
16
|
+
return memoizedColumnFilters;
|
|
17
|
+
}
|
|
10
18
|
const columnFilters = this.adaptableApi.filterApi.columnFilterApi
|
|
11
19
|
.getActiveColumnFilters()
|
|
12
20
|
.filter((columnFilter) => this.adaptableApi.filterApi.columnFilterApi.isColumnFilterActive(columnFilter))
|
|
@@ -15,6 +23,7 @@ class AdaptableFilterHandler {
|
|
|
15
23
|
const shouldEvaluateFilterOnClient = this.adaptableApi.expressionApi.internalApi.shouldEvaluatePredicatesInAdaptableQL('ColumnFilter', columnFilter, columnFilter.Predicates);
|
|
16
24
|
return shouldEvaluateFilterOnClient;
|
|
17
25
|
});
|
|
26
|
+
this.currentColumnFilters_MEMO.set(layoutColumnFilters, columnFilters);
|
|
18
27
|
return columnFilters;
|
|
19
28
|
}
|
|
20
29
|
doesFilterPass(params) {
|
|
@@ -26,11 +35,11 @@ class AdaptableFilterHandler {
|
|
|
26
35
|
return true;
|
|
27
36
|
}
|
|
28
37
|
const columnFilters = this.getCurrentColumnFilters();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
38
|
+
// #column_filter_predicates_evaluation
|
|
39
|
+
const allFiltersMatched = columnFilters.every((columnFilter) => {
|
|
40
|
+
return this.adaptableApi.filterApi.columnFilterApi.internalApi.evaluateColumnFilter(columnFilter, rowNode);
|
|
32
41
|
});
|
|
33
|
-
return
|
|
42
|
+
return allFiltersMatched;
|
|
34
43
|
}
|
|
35
44
|
catch (ex) {
|
|
36
45
|
this.adaptableApi.consoleError(ex);
|
|
@@ -49,7 +58,7 @@ class AdaptableFilterHandler {
|
|
|
49
58
|
}
|
|
50
59
|
return this.fetchFilterDisplayValues(options);
|
|
51
60
|
}
|
|
52
|
-
fetchFilterDisplayValues(options) {
|
|
61
|
+
async fetchFilterDisplayValues(options) {
|
|
53
62
|
return this.adaptableApi.gridApi.internalApi
|
|
54
63
|
.getDistinctFilterDisplayValuesForColumn({
|
|
55
64
|
columnId: this.colId,
|
|
@@ -91,6 +100,7 @@ class AdaptableFilterHandler {
|
|
|
91
100
|
destroy() {
|
|
92
101
|
this.filterDisplayValuesResult = undefined;
|
|
93
102
|
this.previousFilterDisplayValuesResult = undefined;
|
|
103
|
+
this.currentColumnFilters_MEMO = undefined;
|
|
94
104
|
}
|
|
95
105
|
}
|
|
96
106
|
exports.AdaptableFilterHandler = AdaptableFilterHandler;
|
|
@@ -15,6 +15,9 @@ const errorOnce = (message) => {
|
|
|
15
15
|
errorOnceFlags[message] = true;
|
|
16
16
|
};
|
|
17
17
|
exports.errorOnce = errorOnce;
|
|
18
|
+
/**
|
|
19
|
+
* AdapTable's Logger
|
|
20
|
+
*/
|
|
18
21
|
class AdaptableLogger {
|
|
19
22
|
// use static loggers whenever access to AdaptableLogger instance is not feasible
|
|
20
23
|
static consoleErrorBase(message, ...optionalParams) {
|
|
@@ -11,6 +11,7 @@ export declare class AgGridAdapter {
|
|
|
11
11
|
private DANGER_updateGridOptionsMonkeyPatcher;
|
|
12
12
|
private DANGER_doFiltersPassMonkeyPatcher;
|
|
13
13
|
private DANGER_isAggFilterPresentMonkeyPatcher;
|
|
14
|
+
private activePivotColumnFilters_MEMO;
|
|
14
15
|
initialGridOptions: GridOptions;
|
|
15
16
|
private _agGridId;
|
|
16
17
|
constructor(_adaptableInstance: AdaptableAgGrid, config?: {
|
|
@@ -20,6 +21,7 @@ export declare class AgGridAdapter {
|
|
|
20
21
|
private get adaptableOptions();
|
|
21
22
|
private get adaptableApi();
|
|
22
23
|
private get logger();
|
|
24
|
+
private getActivePivotColumnFilters;
|
|
23
25
|
private get agGridOptionsService();
|
|
24
26
|
setAgGridId(agGridId: string): void;
|
|
25
27
|
setAgGridApi(gridApi: GridApi): void;
|
|
@@ -19,6 +19,7 @@ const getColumnApiModule = () => ag_grid_enterprise_1.ColumnApiModule;
|
|
|
19
19
|
class AgGridAdapter {
|
|
20
20
|
constructor(_adaptableInstance, config) {
|
|
21
21
|
this._adaptableInstance = _adaptableInstance;
|
|
22
|
+
this.activePivotColumnFilters_MEMO = new WeakMap();
|
|
22
23
|
const columnApiModuleReference = config?.getAgGridColumnApiModuleReference?.() ?? getColumnApiModule();
|
|
23
24
|
const ColumnDefFactory_Prototype = columnApiModuleReference?.beans?.[0]?.prototype;
|
|
24
25
|
if (!ColumnDefFactory_Prototype) {
|
|
@@ -44,6 +45,7 @@ class AgGridAdapter {
|
|
|
44
45
|
this.DANGER_updateGridOptionsMonkeyPatcher = null;
|
|
45
46
|
this.DANGER_doFiltersPassMonkeyPatcher = null;
|
|
46
47
|
this.DANGER_isAggFilterPresentMonkeyPatcher = null;
|
|
48
|
+
this.activePivotColumnFilters_MEMO = null;
|
|
47
49
|
this._adaptableInstance = null;
|
|
48
50
|
}
|
|
49
51
|
get adaptableOptions() {
|
|
@@ -55,6 +57,27 @@ class AgGridAdapter {
|
|
|
55
57
|
get logger() {
|
|
56
58
|
return this._adaptableInstance.logger;
|
|
57
59
|
}
|
|
60
|
+
getActivePivotColumnFilters() {
|
|
61
|
+
// we memoize based on layout column filters object reference
|
|
62
|
+
// this method is called for each row during filtering so we need to optimize it
|
|
63
|
+
const layoutColumnFilters = this.adaptableApi.layoutApi.internalApi.getCurrentLayout_perfOptimized()?.ColumnFilters;
|
|
64
|
+
if (!layoutColumnFilters) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
const memoizedColumnFilters = this.activePivotColumnFilters_MEMO.get(layoutColumnFilters);
|
|
68
|
+
if (memoizedColumnFilters) {
|
|
69
|
+
return memoizedColumnFilters;
|
|
70
|
+
}
|
|
71
|
+
const pivotColumnFilters = this.adaptableApi.filterApi.columnFilterApi
|
|
72
|
+
.getActiveColumnFilters()
|
|
73
|
+
.filter((columnFilter) => this.adaptableApi.columnApi.isPivotResultColumn(columnFilter.ColumnId) ||
|
|
74
|
+
this.adaptableApi.columnApi.isAutoRowGroupColumnForSingle(columnFilter.ColumnId) ||
|
|
75
|
+
this.adaptableApi.columnApi.isPivotAggColumnWithNoPivotColumns(columnFilter.ColumnId))
|
|
76
|
+
.filter((columnFilter) => this.adaptableApi.filterApi.columnFilterApi.isColumnFilterActive(columnFilter))
|
|
77
|
+
.filter((columnFilter) => this.adaptableApi.expressionApi.internalApi.shouldEvaluatePredicatesInAdaptableQL('ColumnFilter', columnFilter, columnFilter.Predicates));
|
|
78
|
+
this.activePivotColumnFilters_MEMO.set(layoutColumnFilters, pivotColumnFilters);
|
|
79
|
+
return pivotColumnFilters;
|
|
80
|
+
}
|
|
58
81
|
get agGridOptionsService() {
|
|
59
82
|
return this._adaptableInstance.agGridOptionsService;
|
|
60
83
|
}
|
|
@@ -155,21 +178,15 @@ class AgGridAdapter {
|
|
|
155
178
|
// should NEVER happen
|
|
156
179
|
return true;
|
|
157
180
|
}
|
|
158
|
-
const pivotColumnFilters = self.
|
|
159
|
-
.getActiveColumnFilters()
|
|
160
|
-
.filter((columnFilter) => self.adaptableApi.columnApi.isPivotResultColumn(columnFilter.ColumnId) ||
|
|
161
|
-
self.adaptableApi.columnApi.isAutoRowGroupColumnForSingle(columnFilter.ColumnId) ||
|
|
162
|
-
self.adaptableApi.columnApi.isPivotAggColumnWithNoPivotColumns(columnFilter.ColumnId));
|
|
181
|
+
const pivotColumnFilters = self.getActivePivotColumnFilters();
|
|
163
182
|
try {
|
|
164
183
|
if (pivotColumnFilters.length > 0) {
|
|
165
184
|
for (const columnFilter of pivotColumnFilters) {
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
if (!columnFilterEvaluationResult) {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
185
|
+
const columnFilterEvaluationResult = self.adaptableApi.filterApi.columnFilterApi.internalApi.evaluateColumnFilter(columnFilter, rowNode);
|
|
186
|
+
if (!columnFilterEvaluationResult) {
|
|
187
|
+
return false;
|
|
172
188
|
}
|
|
189
|
+
// else continue to next filter
|
|
173
190
|
}
|
|
174
191
|
}
|
|
175
192
|
}
|
|
@@ -181,10 +198,7 @@ class AgGridAdapter {
|
|
|
181
198
|
};
|
|
182
199
|
agGridColumnFilterService.doFiltersPass = this.DANGER_doFiltersPassMonkeyPatcher;
|
|
183
200
|
this.DANGER_isAggFilterPresentMonkeyPatcher = function () {
|
|
184
|
-
|
|
185
|
-
return columnFilters.some((colFilter) => self.adaptableApi.columnApi.isPivotResultColumn(colFilter.ColumnId) ||
|
|
186
|
-
self.adaptableApi.columnApi.isAutoRowGroupColumnForSingle(colFilter.ColumnId) ||
|
|
187
|
-
self.adaptableApi.columnApi.isPivotAggColumnWithNoPivotColumns(colFilter.ColumnId));
|
|
201
|
+
return self.getActivePivotColumnFilters().length > 0;
|
|
188
202
|
};
|
|
189
203
|
agGridColumnFilterService.isAggFilterPresent = this.DANGER_isAggFilterPresentMonkeyPatcher;
|
|
190
204
|
}
|
package/src/agGrid/index.d.ts
CHANGED
|
@@ -2,5 +2,11 @@ import { Adaptable, AdaptableNoCodeWizard as ABWizard } from './Adaptable';
|
|
|
2
2
|
import { AdaptableLogger as ABLogger } from './AdaptableLogger';
|
|
3
3
|
export { default as AdaptableWizardView } from '../View/AdaptableWizardView';
|
|
4
4
|
export default Adaptable;
|
|
5
|
+
/**
|
|
6
|
+
* AdapTable's No Code Wizard
|
|
7
|
+
*/
|
|
5
8
|
export declare const AdaptableNoCodeWizard: typeof ABWizard;
|
|
9
|
+
/**
|
|
10
|
+
* AdapTable's Logger
|
|
11
|
+
*/
|
|
6
12
|
export declare const AdaptableLogger: typeof ABLogger;
|
package/src/agGrid/index.js
CHANGED
|
@@ -9,5 +9,11 @@ const AdaptableLogger_1 = require("./AdaptableLogger");
|
|
|
9
9
|
var AdaptableWizardView_1 = require("../View/AdaptableWizardView");
|
|
10
10
|
Object.defineProperty(exports, "AdaptableWizardView", { enumerable: true, get: function () { return __importDefault(AdaptableWizardView_1).default; } });
|
|
11
11
|
exports.default = Adaptable_1.Adaptable;
|
|
12
|
+
/**
|
|
13
|
+
* AdapTable's No Code Wizard
|
|
14
|
+
*/
|
|
12
15
|
exports.AdaptableNoCodeWizard = Adaptable_1.AdaptableNoCodeWizard;
|
|
16
|
+
/**
|
|
17
|
+
* AdapTable's Logger
|
|
18
|
+
*/
|
|
13
19
|
exports.AdaptableLogger = AdaptableLogger_1.AdaptableLogger;
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_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: "21.2.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1769503291364 || Date.now(),
|
|
6
|
+
VERSION: "21.2.2" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -87,6 +87,12 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
87
87
|
applyPivotTotals(layout: PivotLayoutModel): void;
|
|
88
88
|
applyColumnGroupCollapseExpandState(layout: PivotLayoutModel | TableLayoutModel): void;
|
|
89
89
|
private withSuppressColumnAnimation;
|
|
90
|
+
private withSuppressRowAnimation;
|
|
91
|
+
/**
|
|
92
|
+
* Refreshes the sort order by refreshing the client side row model.
|
|
93
|
+
* This is useful when custom sort comparers are defined and the sort needs to be re-applied after filtering.
|
|
94
|
+
*/
|
|
95
|
+
refreshSort(): void;
|
|
90
96
|
private patchColDefType;
|
|
91
97
|
private setupPivotTotals;
|
|
92
98
|
private patchPivotAggregationTotal;
|
|
@@ -1633,6 +1633,26 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
return res;
|
|
1635
1635
|
}
|
|
1636
|
+
withSuppressRowAnimation(fn) {
|
|
1637
|
+
const animateRows = this.gridApi.getGridOption('animateRows');
|
|
1638
|
+
if (animateRows) {
|
|
1639
|
+
this.gridApi.setGridOption('animateRows', false);
|
|
1640
|
+
}
|
|
1641
|
+
const res = fn();
|
|
1642
|
+
if (animateRows) {
|
|
1643
|
+
this.gridApi.setGridOption('animateRows', true);
|
|
1644
|
+
}
|
|
1645
|
+
return res;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Refreshes the sort order by refreshing the client side row model.
|
|
1649
|
+
* This is useful when custom sort comparers are defined and the sort needs to be re-applied after filtering.
|
|
1650
|
+
*/
|
|
1651
|
+
refreshSort() {
|
|
1652
|
+
this.withSuppressRowAnimation(() => {
|
|
1653
|
+
this.gridApi.refreshClientSideRowModel('sort');
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1636
1656
|
patchColDefType(colDef, colTypes) {
|
|
1637
1657
|
const originalTypes = colDef.type == undefined ? [] : Array.isArray(colDef.type) ? colDef.type : [colDef.type];
|
|
1638
1658
|
const columnTypes = new Set(originalTypes);
|