@adaptabletools/adaptable 23.0.21 → 23.1.0-canary.0
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 +3 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/ColumnMenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/ContextMenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +34 -0
- package/src/Api/GridApi.d.ts +5 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +22 -1
- package/src/Redux/Store/AdaptableStore.js +6 -1
- package/src/Utilities/Helpers/DisplayFormatHelper.js +16 -4
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.d.ts +2 -0
- package/src/Utilities/Helpers/StyledColumns/SparklineStyleHelper.js +13 -10
- package/src/Utilities/Hooks/useAdaptableOptions.d.ts +1 -1
- package/src/Utilities/Services/AnnotationsService.js +8 -8
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.d.ts +3 -0
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +16 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
- package/src/View/Components/PredicateEditor/PredicateEditor.js +11 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +6 -2
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +18 -8
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +2 -2
- package/src/View/Wizard/OnePageWizards.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +30 -6
- package/src/agGrid/AdaptableAgGrid.js +60 -78
- package/src/agGrid/AgGridAdapter.d.ts +32 -1
- package/src/agGrid/AgGridAdapter.js +88 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +44 -0
- package/src/agGrid/AgGridColumnAdapter.js +153 -37
- package/src/agGrid/AgGridMenuAdapter.d.ts +8 -2
- package/src/agGrid/AgGridMenuAdapter.js +17 -4
- package/src/agGrid/AgGridModulesAdapter.js +6 -1
- package/src/agGrid/AgGridThemeAdapter.d.ts +17 -0
- package/src/agGrid/AgGridThemeAdapter.js +37 -6
- package/src/components/Combobox/index.d.ts +11 -0
- package/src/components/Combobox/index.js +5 -3
- package/src/components/Radio/index.d.ts +2 -2
- package/src/components/Tree/TreeDropdown/index.d.ts +11 -0
- package/src/components/Tree/TreeDropdown/index.js +6 -3
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.d.ts +9 -0
- package/src/layout-manager/src/index.js +38 -17
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
|
@@ -1340,20 +1340,6 @@ export class LayoutManager extends LMEmitter {
|
|
|
1340
1340
|
this.computeColumnSorts(layout, columnState);
|
|
1341
1341
|
this.computePinnedColumns(layout, columnState);
|
|
1342
1342
|
this.computePivotAggregations(layout, columnState);
|
|
1343
|
-
if (Array.isArray(layout.PivotResultColumnsOrder)) {
|
|
1344
|
-
const pivotResultColumnsOrderSet = new Set(layout.PivotResultColumnsOrder);
|
|
1345
|
-
const existingPivotResultState = {};
|
|
1346
|
-
columnState.state = columnState.state.filter((colState) => {
|
|
1347
|
-
if (pivotResultColumnsOrderSet.has(colState.colId)) {
|
|
1348
|
-
existingPivotResultState[colState.colId] = colState;
|
|
1349
|
-
return false;
|
|
1350
|
-
}
|
|
1351
|
-
return true;
|
|
1352
|
-
});
|
|
1353
|
-
layout.PivotResultColumnsOrder.forEach((colId) => {
|
|
1354
|
-
columnState.state.push(existingPivotResultState[colId] || { colId });
|
|
1355
|
-
});
|
|
1356
|
-
}
|
|
1357
1343
|
return columnState;
|
|
1358
1344
|
}
|
|
1359
1345
|
computePivotAggregations(layout, columnState) {
|
|
@@ -1583,10 +1569,8 @@ export class LayoutManager extends LMEmitter {
|
|
|
1583
1569
|
this.gridApi.applyColumnState(columnState);
|
|
1584
1570
|
});
|
|
1585
1571
|
this.computePivotAggregations(layout, columnState);
|
|
1586
|
-
if (Array.isArray(layout.PivotResultColumnsOrder)) {
|
|
1587
|
-
columnState.applyOrder = true;
|
|
1588
|
-
}
|
|
1589
1572
|
this.gridApi.applyColumnState(columnState);
|
|
1573
|
+
this.applyPivotResultColumnsState(layout);
|
|
1590
1574
|
if (layout.ColumnSizing) {
|
|
1591
1575
|
const colWidthForPivotResultColumns = [];
|
|
1592
1576
|
(this.gridApi.getPivotResultColumns() || []).forEach((col) => {
|
|
@@ -1608,6 +1592,43 @@ export class LayoutManager extends LMEmitter {
|
|
|
1608
1592
|
}
|
|
1609
1593
|
});
|
|
1610
1594
|
}
|
|
1595
|
+
applyPivotResultColumnsState(layout) {
|
|
1596
|
+
const existingPivotResultColIds = (this.gridApi.getPivotResultColumns() || []).map((col) => col.getColId());
|
|
1597
|
+
if (!existingPivotResultColIds.length) {
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
const existingSet = new Set(existingPivotResultColIds);
|
|
1601
|
+
const persistedOrder = Array.isArray(layout.PivotResultColumnsOrder) && layout.PivotResultColumnsOrder.length > 0
|
|
1602
|
+
? layout.PivotResultColumnsOrder
|
|
1603
|
+
: null;
|
|
1604
|
+
let orderedColIds = existingPivotResultColIds;
|
|
1605
|
+
if (persistedOrder) {
|
|
1606
|
+
const desiredSet = new Set(persistedOrder);
|
|
1607
|
+
const knownColIds = existingPivotResultColIds.filter((colId) => desiredSet.has(colId));
|
|
1608
|
+
const extraColIds = existingPivotResultColIds.filter((colId) => !desiredSet.has(colId));
|
|
1609
|
+
orderedColIds = [
|
|
1610
|
+
...sortColumnIdsByOrder(knownColIds, persistedOrder).filter((colId) => existingSet.has(colId)),
|
|
1611
|
+
...extraColIds,
|
|
1612
|
+
];
|
|
1613
|
+
}
|
|
1614
|
+
const sorts = layout.ColumnSorts || [];
|
|
1615
|
+
const sortIndexes = new Map(sorts.map((sort, index) => [sort.ColumnId, index]));
|
|
1616
|
+
const pinning = layout.ColumnPinning || {};
|
|
1617
|
+
const state = orderedColIds.map((colId) => {
|
|
1618
|
+
const sortIndex = sortIndexes.get(colId);
|
|
1619
|
+
const sort = sortIndex != null ? sorts[sortIndex] : undefined;
|
|
1620
|
+
return {
|
|
1621
|
+
colId,
|
|
1622
|
+
sort: sort ? (sort.SortOrder === 'Asc' ? 'asc' : 'desc') : null,
|
|
1623
|
+
sortIndex: sort ? sortIndex : null,
|
|
1624
|
+
pinned: pinning[colId] ?? null,
|
|
1625
|
+
};
|
|
1626
|
+
});
|
|
1627
|
+
this.gridApi.applyColumnState({
|
|
1628
|
+
state,
|
|
1629
|
+
applyOrder: !!persistedOrder,
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1611
1632
|
applyPivotTotals(layout) {
|
|
1612
1633
|
if (layout.PivotGrandTotal) {
|
|
1613
1634
|
const pivotGrandTotal = layout.PivotGrandTotal === true || layout.PivotGrandTotal === 'before'
|
package/src/types.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export type { OpenFinPluginOptions } from './AdaptableOptions/OpenFinPluginOptio
|
|
|
34
34
|
export type { InteropioPluginOptions } from './AdaptableOptions/InteropioPluginOptions';
|
|
35
35
|
export type { MasterDetailPluginOptions, DetailInitContext, } from './AdaptableOptions/MasterDetailPluginOptions';
|
|
36
36
|
export type { DateInputOptions } from './AdaptableOptions/DateInputOptions';
|
|
37
|
-
export type { FilterOptions, ColumnFilterOptions, GridFilterOptions, IsRowFilterableContext, InFilterValueInfo, InFilterValueResult, InFilterValue, CustomInFilterValuesContext, GridFilterEditors, DefaultPredicateFilterContext, AdaptableFilterComponentLocation, } from './AdaptableOptions/FilterOptions';
|
|
37
|
+
export type { FilterOptions, ColumnFilterOptions, GridFilterOptions, IsRowFilterableContext, InFilterValueInfo, InFilterValueResult, InFilterValue, CustomInFilterValuesContext, InFilterLabelContext, GridFilterEditors, DefaultPredicateFilterContext, AdaptableFilterComponentLocation, } from './AdaptableOptions/FilterOptions';
|
|
38
38
|
export type { QuickSearchOptions, QuickSearchContext } from './AdaptableOptions/QuickSearchOptions';
|
|
39
39
|
export type { FormatColumnOptions, CustomDisplayFormatter, CustomDisplayFormatterContext, } from './AdaptableOptions/FormatColumnOptions';
|
|
40
40
|
export type { PlusMinusOptions } from './AdaptableOptions/EditOptions';
|