@adaptabletools/adaptable 21.0.9-canary.0 → 21.0.10
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/View/Layout/Wizard/sections/AggregationsSection.js +18 -5
- package/src/agGrid/AgGridAdapter.js +4 -1
- package/src/agGrid/AgGridColumnAdapter.js +1 -1
- package/src/components/OverlayTrigger/index.js +6 -2
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +3 -1
- package/src/layout-manager/src/isLayoutEqual.js +1 -0
- package/src/layout-manager/src/normalizeLayoutModel.js +3 -0
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.10",
|
|
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",
|
|
@@ -41,10 +41,15 @@ const ColumnRow = (props) => {
|
|
|
41
41
|
const adaptable = useAdaptable();
|
|
42
42
|
const aggValue = props.layout?.TableAggregationColumns?.find((agg) => agg.ColumnId === props.column.columnId)?.AggFunc;
|
|
43
43
|
const adaptableAggFunctions = [];
|
|
44
|
-
if (props.column.dataType === 'number') {
|
|
44
|
+
if (props.column.dataType === 'number' && props.column.aggregatable) {
|
|
45
45
|
adaptableAggFunctions.push(WEIGHTED_AVERAGE_AGG_FN_NAME);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
// props.column.availableAggregationFunctions is null for non-aggregatable columns
|
|
48
|
+
// but we want to support non-aggregatable columns that are specified to be aggregated by default
|
|
49
|
+
// so we need to allow this. as soon as they will be unchecked from aggregation, they will no longer be displayed in the aggregation wizard.
|
|
50
|
+
// but until the user checks them off, we want to allow them.
|
|
51
|
+
const availableAggregationFunctions = props.column.availableAggregationFunctions || [];
|
|
52
|
+
const aggOptions = [...new Set([...availableAggregationFunctions, ...adaptableAggFunctions])].map((fnName) => {
|
|
48
53
|
return {
|
|
49
54
|
label: fnName,
|
|
50
55
|
onClick: () => {
|
|
@@ -135,9 +140,17 @@ export const AggregationsSection = (props) => {
|
|
|
135
140
|
const allAggregableColumns = adaptable.api.columnApi.getAggregatableColumns();
|
|
136
141
|
const allColumns = adaptable.api.columnApi.getUIAvailableColumns();
|
|
137
142
|
const numberColumns = adaptable.api.columnApi.getNumericColumns();
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
const allAggregatableColumnIds = allAggregableColumns.map((col) => col.columnId);
|
|
144
|
+
(layout.TableAggregationColumns || []).forEach((agg) => {
|
|
145
|
+
// we need to also display the columns currently aggregated,
|
|
146
|
+
// even if they are not aggregatable
|
|
147
|
+
if (!allAggregatableColumnIds.includes(agg.ColumnId)) {
|
|
148
|
+
allAggregatableColumnIds.push(agg.ColumnId);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
const sortedAggregableColumns = ArrayExtensions.sortArrayWithOrder(allAggregatableColumnIds, (layout.TableAggregationColumns ?? []).map((agg) => agg.ColumnId), { sortUnorderedItems: false })
|
|
152
|
+
.map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId))
|
|
153
|
+
.filter(Boolean);
|
|
141
154
|
const handleColumnsSelectionChange = React.useCallback((columnIds) => {
|
|
142
155
|
const currentAggsMap = (layout.TableAggregationColumns || []).reduce((acc, { ColumnId, AggFunc }) => {
|
|
143
156
|
acc[ColumnId] = AggFunc;
|
|
@@ -608,7 +608,10 @@ export class AgGridAdapter {
|
|
|
608
608
|
return false;
|
|
609
609
|
}
|
|
610
610
|
getColumnAggregationFunctions(colDef) {
|
|
611
|
-
|
|
611
|
+
const result = colDef.allowedAggFuncs || ['sum', 'min', 'max', 'count', 'avg', 'first', 'last']; // those are the default fns aggrid supports out-of-the-box
|
|
612
|
+
const gridOptionsAggFuncs = this.adaptableApi.agGridApi.getGridOption('aggFuncs') || {};
|
|
613
|
+
result.push(...Object.keys(gridOptionsAggFuncs));
|
|
614
|
+
return [...new Set(result)];
|
|
612
615
|
}
|
|
613
616
|
isTreeColumn(isGeneratedRowGroupColumn) {
|
|
614
617
|
return this.adaptableApi.gridApi.isTreeDataGrid() ? isGeneratedRowGroupColumn : false;
|
|
@@ -576,7 +576,7 @@ export class AgGridColumnAdapter {
|
|
|
576
576
|
if (this.adaptableApi.gridApi.isTreeDataGrid()) {
|
|
577
577
|
this.setColDefProperty(col, 'filter', (original_filter) => {
|
|
578
578
|
const autoGroupColumnDef = this.agGridApi.getGridOption('autoGroupColumnDef');
|
|
579
|
-
if (autoGroupColumnDef
|
|
579
|
+
if (autoGroupColumnDef?.filter != undefined) {
|
|
580
580
|
// we plan to provide a TreeListColumnFilter
|
|
581
581
|
// until then, it's the user's responsibility to explicitly set the filter in the provided `autoGroupColumnDef`
|
|
582
582
|
return original_filter;
|
|
@@ -14,6 +14,7 @@ import { isBrowserDocumentAvailable } from '../../View/UIHelper';
|
|
|
14
14
|
import { useOverlay } from '../InfiniteTable';
|
|
15
15
|
import { useAdaptable } from '../../View/AdaptableContext';
|
|
16
16
|
import { OVERLAY_BASE_Z_INDEX } from '../overlayBaseZIndex';
|
|
17
|
+
const DATA_NAME_OVERLAY_TRIGGER = 'OverlayTrigger';
|
|
17
18
|
export const getConstrainElement = (target, constrainTo) => {
|
|
18
19
|
let el = null;
|
|
19
20
|
if (typeof constrainTo === 'string') {
|
|
@@ -58,6 +59,7 @@ const defaultProps = {
|
|
|
58
59
|
};
|
|
59
60
|
const OverlayTrigger = React.forwardRef((givenProps, ref) => {
|
|
60
61
|
const props = { ...defaultProps, ...givenProps };
|
|
62
|
+
ensurePortalElement();
|
|
61
63
|
const adaptable = useAdaptable();
|
|
62
64
|
let { visible: _, showTriangle, showEvent, hideEvent, render, targetOffset, preventPortalEventPropagation = false, anchor, hideDelay = 0, opacityTransitionDuration, onVisibleChange, alignPosition = [
|
|
63
65
|
// overlay - target
|
|
@@ -106,7 +108,6 @@ const OverlayTrigger = React.forwardRef((givenProps, ref) => {
|
|
|
106
108
|
doSetVisible(true);
|
|
107
109
|
}, 50), []);
|
|
108
110
|
const prevVisible = usePrevious(visible, false);
|
|
109
|
-
ensurePortalElement();
|
|
110
111
|
const onShow = React.useCallback((event) => {
|
|
111
112
|
const target = targetRef.current;
|
|
112
113
|
if (event && preventPortalEventPropagation && !contains(target, event.target)) {
|
|
@@ -141,6 +142,9 @@ const OverlayTrigger = React.forwardRef((givenProps, ref) => {
|
|
|
141
142
|
}, [ref]);
|
|
142
143
|
useEffect(() => {
|
|
143
144
|
let target = domRef.current.previousSibling;
|
|
145
|
+
while (target && target.dataset.name === DATA_NAME_OVERLAY_TRIGGER) {
|
|
146
|
+
target = target.previousSibling;
|
|
147
|
+
}
|
|
144
148
|
if (targetProp) {
|
|
145
149
|
target = targetProp(target);
|
|
146
150
|
}
|
|
@@ -211,7 +215,7 @@ const OverlayTrigger = React.forwardRef((givenProps, ref) => {
|
|
|
211
215
|
const agGridClassName = useAgGridClassName([visible]);
|
|
212
216
|
return (React.createElement(React.Fragment, null,
|
|
213
217
|
React.Children.only(props.children),
|
|
214
|
-
React.createElement("div", { "data-name":
|
|
218
|
+
React.createElement("div", { "data-name": DATA_NAME_OVERLAY_TRIGGER, "data-visible": visible, ref: domRef, style: {
|
|
215
219
|
visibility: 'hidden',
|
|
216
220
|
flex: 'none',
|
|
217
221
|
width: 0,
|
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.0.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1761827363149 || Date.now(),
|
|
4
|
+
VERSION: "21.0.10" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -312,7 +312,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
312
312
|
// emit an event that the layout has changed from the grid
|
|
313
313
|
this.emitSync('gridLayoutChanged', layout);
|
|
314
314
|
const log = this.debugger.extend('gridLayoutChanged');
|
|
315
|
-
const changes = getChanges(prevLayout, layout);
|
|
315
|
+
const changes = getChanges(normalizeLayoutModel(prevLayout), normalizeLayoutModel(layout));
|
|
316
316
|
log('current grid layout:', JSON.stringify(layout, null, 2), '\nprev layout:\n', prevLayout ? JSON.stringify(prevLayout, null, 2) : 'no prev layout', '\nchanges from prev to current:\n', changes);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -378,6 +378,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
378
378
|
Ignore_RowSummaries: layout.Ignore_RowSummaries,
|
|
379
379
|
Ignore_IsReadOnly: layout.Ignore_IsReadOnly,
|
|
380
380
|
Ignore_Tags: layout.Ignore_Tags,
|
|
381
|
+
Ignore_Metadata: layout.Ignore_Metadata,
|
|
381
382
|
Ignore_Source: layout.Ignore_Source,
|
|
382
383
|
Ignore_AdaptableVersion: layout.Ignore_AdaptableVersion,
|
|
383
384
|
Ignore_Uuid: layout.Ignore_Uuid,
|
|
@@ -706,6 +707,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
706
707
|
Ignore_RowSummaries: this.currentLayout?.Ignore_RowSummaries,
|
|
707
708
|
Ignore_IsReadOnly: this.currentLayout?.Ignore_IsReadOnly,
|
|
708
709
|
Ignore_Tags: this.currentLayout?.Ignore_Tags,
|
|
710
|
+
Ignore_Metadata: this.currentLayout?.Ignore_Metadata,
|
|
709
711
|
Ignore_Source: this.currentLayout?.Ignore_Source,
|
|
710
712
|
Ignore_AdaptableVersion: this.currentLayout?.Ignore_AdaptableVersion,
|
|
711
713
|
Ignore_Uuid: this.currentLayout?.Ignore_Uuid,
|
|
@@ -2,6 +2,9 @@ import { isPivotLayoutModel } from './isPivotLayoutModel';
|
|
|
2
2
|
export const AUTO_GROUP_COLUMN_ID__SINGLE = 'ag-Grid-AutoColumn';
|
|
3
3
|
export const AUTO_GROUP_COLUMN_ID__MULTI_PREFIX = 'ag-Grid-AutoColumn-';
|
|
4
4
|
export function normalizeTableLayoutModel(layout, options) {
|
|
5
|
+
if (!layout) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
5
8
|
layout = structuredClone(layout);
|
|
6
9
|
if (!layout.ColumnVisibility) {
|
|
7
10
|
layout.ColumnVisibility = {};
|