@adaptabletools/adaptable-cjs 21.0.5 → 21.0.6
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/Api/Implementation/LayoutHelpers.js +23 -6
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
- package/src/agGrid/AdaptableAgGrid.js +35 -8
- package/src/agGrid/AgGridModulesAdapter.js +14 -1
- package/src/components/Select/Select.js +2 -2
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +14 -4
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.6",
|
|
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",
|
|
@@ -35,6 +35,23 @@ exports.layoutModelToLayoutState = layoutModelToLayoutState;
|
|
|
35
35
|
function cleanupAdaptableObjectPrimitives(layout) {
|
|
36
36
|
const l = layout;
|
|
37
37
|
for (const key in l) {
|
|
38
|
+
if (key === 'ColumnFilters') {
|
|
39
|
+
// we don't want to cleanup ColumnFilters
|
|
40
|
+
// as we rely on the Uuids for identifying the filters
|
|
41
|
+
if (Array.isArray(l[key])) {
|
|
42
|
+
l[key].forEach((item) => {
|
|
43
|
+
if (typeof item === 'object') {
|
|
44
|
+
// but we do want to cleanup further down - eg: predicates in the filter
|
|
45
|
+
for (const k in item) {
|
|
46
|
+
if (typeof item[k] === 'object') {
|
|
47
|
+
(0, AdaptableHelper_1.removeAdaptableObjectPrimitivesInlineDeep)(item[k]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
38
55
|
if (typeof l[key] === 'object') {
|
|
39
56
|
(0, AdaptableHelper_1.removeAdaptableObjectPrimitivesInlineDeep)(l[key]);
|
|
40
57
|
}
|
|
@@ -372,9 +389,9 @@ const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
|
372
389
|
if (layoutModel.Ignore_Metadata) {
|
|
373
390
|
tableLayout.Metadata = layoutModel.Ignore_Metadata;
|
|
374
391
|
}
|
|
375
|
-
if (layoutModel.RowGroupDisplayType) {
|
|
376
|
-
|
|
377
|
-
}
|
|
392
|
+
// if (layoutModel.RowGroupDisplayType) {
|
|
393
|
+
tableLayout.RowGroupDisplayType = layoutModel.RowGroupDisplayType ?? 'single';
|
|
394
|
+
// }
|
|
378
395
|
if (layoutModel.RowGroupedColumns) {
|
|
379
396
|
tableLayout.RowGroupedColumns = layoutModel.RowGroupedColumns;
|
|
380
397
|
}
|
|
@@ -529,9 +546,9 @@ const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
|
529
546
|
pivotLayout.ColumnGroupValues.ExceptionGroupKeys = layoutModel.ColumnGroupValues.Values;
|
|
530
547
|
}
|
|
531
548
|
}
|
|
532
|
-
if (layoutModel.RowGroupDisplayType) {
|
|
533
|
-
|
|
534
|
-
}
|
|
549
|
+
// if (layoutModel.RowGroupDisplayType) {
|
|
550
|
+
pivotLayout.RowGroupDisplayType = layoutModel.RowGroupDisplayType ?? 'single';
|
|
551
|
+
// }
|
|
535
552
|
return pivotLayout;
|
|
536
553
|
};
|
|
537
554
|
exports.pivotLayoutModelToPivotLayout = pivotLayoutModelToPivotLayout;
|
|
@@ -266,7 +266,8 @@ const ColumnsSection = (props) => {
|
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
if (adaptable.api.gridApi.isTreeDataGrid()
|
|
269
|
+
if (adaptable.api.gridApi.isTreeDataGrid() &&
|
|
270
|
+
!allColumns.find((col) => col.columnId === GeneralConstants_1.AG_GRID_GROUPED_COLUMN)) {
|
|
270
271
|
allColumns.unshift((0, ColumnApiImpl_1.generateAutoTreeSingleColumn)());
|
|
271
272
|
}
|
|
272
273
|
const colIdToCol = allColumns.reduce((acc, col) => {
|
|
@@ -200,7 +200,9 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
200
200
|
getDisplayValueFromRawValue(rowNode: IRowNode, columnId: string, rawValue: any): string | undefined;
|
|
201
201
|
private getCleanValue;
|
|
202
202
|
getNormalisedValueFromRawValue(rawValue: any, column: AdaptableColumn): string | number | boolean | Date | unknown;
|
|
203
|
+
private __updateColumnModelAndRefreshGrid_already_called;
|
|
203
204
|
updateColumnModelAndRefreshGrid(): void;
|
|
205
|
+
_updateColumnModelAndRefreshGridNow(): void;
|
|
204
206
|
redrawBody(): void;
|
|
205
207
|
refreshHeader(): void;
|
|
206
208
|
redrawRows(rowNodes?: IRowNode[]): void;
|
|
@@ -183,6 +183,7 @@ class AdaptableAgGrid {
|
|
|
183
183
|
}
|
|
184
184
|
return this.emitter.onIncludeFired(eventName, callback);
|
|
185
185
|
};
|
|
186
|
+
this.__updateColumnModelAndRefreshGrid_already_called = false;
|
|
186
187
|
this.lifecycleState = 'initial';
|
|
187
188
|
this.emitter = new Emitter_1.default();
|
|
188
189
|
this.agGridOptionsService = new AgGridOptionsService_1.AgGridOptionsService(this);
|
|
@@ -716,18 +717,30 @@ You need to define at least one Layout!`);
|
|
|
716
717
|
};
|
|
717
718
|
}
|
|
718
719
|
return (params) => {
|
|
720
|
+
// might be a summary row
|
|
721
|
+
if (params.data?.[RowSummary_1.ROW_SUMMARY_ROW_ID]) {
|
|
722
|
+
return params.data[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
723
|
+
}
|
|
724
|
+
if (params.level > 0) {
|
|
725
|
+
const parentKeys = params.parentKeys ?? [];
|
|
726
|
+
const values = Object.values(params.data);
|
|
727
|
+
let hash = 0;
|
|
728
|
+
for (let i = 0; i < values.length; i++) {
|
|
729
|
+
const str = String(values[i] ?? '');
|
|
730
|
+
for (let j = 0; j < str.length; j++) {
|
|
731
|
+
hash = ((hash << 5) - hash + str.charCodeAt(j)) | 0;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
const id = [...parentKeys, Math.abs(hash)].join('/');
|
|
735
|
+
return id;
|
|
736
|
+
}
|
|
719
737
|
if (params.data?.[primaryKey]) {
|
|
720
738
|
const primaryKeyValue = params.data[primaryKey];
|
|
721
739
|
return typeof primaryKeyValue === 'number'
|
|
722
740
|
? `${primaryKeyValue}`
|
|
723
741
|
: params.data[primaryKey];
|
|
724
742
|
}
|
|
725
|
-
//
|
|
726
|
-
if (params.data?.[RowSummary_1.ROW_SUMMARY_ROW_ID]) {
|
|
727
|
-
return params.data[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
728
|
-
}
|
|
729
|
-
// AFL 2024.08.17 - no idea why is this here and when it's used
|
|
730
|
-
// might be a group row
|
|
743
|
+
// fallback
|
|
731
744
|
const parentKeys = params.parentKeys ?? [];
|
|
732
745
|
const values = Object.values(params.data);
|
|
733
746
|
if (values.length) {
|
|
@@ -1869,6 +1882,20 @@ You need to define at least one Layout!`);
|
|
|
1869
1882
|
return rawValue;
|
|
1870
1883
|
}
|
|
1871
1884
|
updateColumnModelAndRefreshGrid() {
|
|
1885
|
+
if (this.__updateColumnModelAndRefreshGrid_already_called) {
|
|
1886
|
+
return;
|
|
1887
|
+
}
|
|
1888
|
+
try {
|
|
1889
|
+
this._updateColumnModelAndRefreshGridNow();
|
|
1890
|
+
this.__updateColumnModelAndRefreshGrid_already_called = true;
|
|
1891
|
+
}
|
|
1892
|
+
finally {
|
|
1893
|
+
queueMicrotask(() => {
|
|
1894
|
+
this.__updateColumnModelAndRefreshGrid_already_called = false;
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
_updateColumnModelAndRefreshGridNow() {
|
|
1872
1899
|
this.logger.info(`Updating Column Model and Refreshing Grid.`);
|
|
1873
1900
|
this.deriveAdaptableColumnStateFromAgGrid();
|
|
1874
1901
|
this.agGridColumnAdapter.setupColumns();
|
|
@@ -3555,8 +3582,8 @@ You need to define at least one Layout!`);
|
|
|
3555
3582
|
isRowGroupDifferentInLayout(one, other) {
|
|
3556
3583
|
const prevRowGroupedColumns = one.RowGroupedColumns || one.PivotGroupedColumns || [];
|
|
3557
3584
|
const currentRowGroupedColumns = other.RowGroupedColumns || other.PivotGroupedColumns || [];
|
|
3558
|
-
const prevRowGroupDisplayType = one.RowGroupDisplayType;
|
|
3559
|
-
const currentRowGroupDisplayType = other.RowGroupDisplayType;
|
|
3585
|
+
const prevRowGroupDisplayType = one.RowGroupDisplayType ?? 'single';
|
|
3586
|
+
const currentRowGroupDisplayType = other.RowGroupDisplayType ?? 'single';
|
|
3560
3587
|
if (prevRowGroupDisplayType !== currentRowGroupDisplayType) {
|
|
3561
3588
|
return true;
|
|
3562
3589
|
}
|
|
@@ -19,7 +19,20 @@ class AgGridModulesAdapter {
|
|
|
19
19
|
return this.adaptableInstance.agGridAdapter.getAgGridApi();
|
|
20
20
|
}
|
|
21
21
|
isAgGridModuleRegistered(moduleName) {
|
|
22
|
-
|
|
22
|
+
let isModuleRegistered = this.agGridApi.isModuleRegistered(moduleName);
|
|
23
|
+
if (!isModuleRegistered) {
|
|
24
|
+
// SSRM module comes with its own implementations of Pivot, MasterDetail and TreeData
|
|
25
|
+
// #ssrm_pivot_module
|
|
26
|
+
const serverSideDependencies = [
|
|
27
|
+
'PivotModule',
|
|
28
|
+
'MasterDetailModule',
|
|
29
|
+
'TreeDataModule',
|
|
30
|
+
];
|
|
31
|
+
if (serverSideDependencies.includes(moduleName)) {
|
|
32
|
+
isModuleRegistered = this.agGridApi.isModuleRegistered('ServerSideRowModelModule');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return isModuleRegistered;
|
|
23
36
|
}
|
|
24
37
|
getAgGridRegisteredModules() {
|
|
25
38
|
const registeredModules = [];
|
|
@@ -283,10 +283,10 @@ const Select = function (props) {
|
|
|
283
283
|
// ignore the event if the focus is still inside the menu
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
requestAnimationFrame(() => {
|
|
287
287
|
// wee need to wait for the single value selection to complete before closing
|
|
288
288
|
closeSelectMenu();
|
|
289
|
-
}
|
|
289
|
+
});
|
|
290
290
|
},
|
|
291
291
|
onMouseDown: (event) => {
|
|
292
292
|
if (!props.isMulti) {
|
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.0.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1759506326299 || Date.now(),
|
|
6
|
+
VERSION: "21.0.6" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -345,9 +345,15 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
345
345
|
let ColumnSizing = layout.ColumnSizing || {};
|
|
346
346
|
//let's also include the column widths of the pivotResult columns
|
|
347
347
|
pivotResultColumns.forEach((col) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
const colId = col.getColId();
|
|
349
|
+
const Width = col.getActualWidth();
|
|
350
|
+
const initialWidth = this.initialColumnWidths[colId] ?? DEFAULT_COLUMN_WIDTH;
|
|
351
|
+
// but if the width is the initial/default width, don't include it in the ColumnSizing
|
|
352
|
+
if (Width !== initialWidth) {
|
|
353
|
+
ColumnSizing[colId] = {
|
|
354
|
+
Width,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
351
357
|
});
|
|
352
358
|
if (!Object.keys(ColumnSizing).length) {
|
|
353
359
|
ColumnSizing = undefined;
|
|
@@ -1710,7 +1716,11 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
1710
1716
|
}
|
|
1711
1717
|
}
|
|
1712
1718
|
isInPivotMode() {
|
|
1713
|
-
|
|
1719
|
+
// SSRM comes with its own pivot module implementation
|
|
1720
|
+
// see #ssrm_pivot_module
|
|
1721
|
+
const isModuleRegistered = this.gridApi.isModuleRegistered('PivotModule') ||
|
|
1722
|
+
this.gridApi.isModuleRegistered('ServerSideRowModelModule');
|
|
1723
|
+
return isModuleRegistered && this.gridApi.isPivotMode();
|
|
1714
1724
|
}
|
|
1715
1725
|
}
|
|
1716
1726
|
exports.LayoutManager = LayoutManager;
|