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