@adaptabletools/adaptable 20.2.6 → 20.2.7
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/GridApi.d.ts +2 -2
- package/src/Api/GridFilterApi.d.ts +10 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridFilterApiImpl.d.ts +3 -1
- package/src/Api/Implementation/GridFilterApiImpl.js +10 -0
- package/src/Api/Implementation/LayoutHelpers.js +4 -4
- package/src/Api/Implementation/StateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/StateApiImpl.js +7 -4
- package/src/Api/StateApi.d.ts +7 -0
- package/src/View/Components/ReorderDraggable/index.js +2 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +3 -1
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +1 -1
- package/src/View/StateManagement/components/ExportDropdown.js +1 -1
- package/src/agGrid/AgGridAdapter.js +2 -2
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +4 -4
- package/src/layout-manager/src/index.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +0 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "20.2.
|
|
3
|
+
"version": "20.2.7",
|
|
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",
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -503,10 +503,10 @@ export interface GridApi {
|
|
|
503
503
|
*/
|
|
504
504
|
refreshRowNode(rowNode: IRowNode): void;
|
|
505
505
|
/**
|
|
506
|
-
* Forces
|
|
506
|
+
* Forces re-render of given rows (if none provided, all rows are refreshed)
|
|
507
507
|
* @param rowNodes AG Grid rows
|
|
508
508
|
*/
|
|
509
|
-
refreshRowNodes(rowNodes
|
|
509
|
+
refreshRowNodes(rowNodes?: IRowNode[]): void;
|
|
510
510
|
/**
|
|
511
511
|
* Forces a re-render of all Group Rows (including aggregations)
|
|
512
512
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridFilter } from '../types';
|
|
1
|
+
import { GridFilter, NamedQuery } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Provides run-time access to Grid Filter section of Adaptable State.
|
|
4
4
|
*/
|
|
@@ -8,6 +8,10 @@ export interface GridFilterApi {
|
|
|
8
8
|
* @returns Grid Filter
|
|
9
9
|
*/
|
|
10
10
|
getCurrentGridFilter(): GridFilter | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Re-applies the Grid Filter
|
|
13
|
+
*/
|
|
14
|
+
reApplyGridFilter(): void;
|
|
11
15
|
/**
|
|
12
16
|
* Retrieves the Grid Filter's Expression from the current layout
|
|
13
17
|
* @returns Grid Filter Expression
|
|
@@ -18,6 +22,11 @@ export interface GridFilterApi {
|
|
|
18
22
|
* @param expression filter string
|
|
19
23
|
*/
|
|
20
24
|
setGridFilterExpression(expression: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the Grid Filter (for the current layout)
|
|
27
|
+
* @param namedQuery: NamedQuery to use
|
|
28
|
+
*/
|
|
29
|
+
setGridFilterExpressionUsingNamedQuery(namedQuery: NamedQuery): void;
|
|
21
30
|
/**
|
|
22
31
|
* Clears the Grid Filter (for the current Layout)
|
|
23
32
|
*/
|
|
@@ -126,7 +126,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
|
|
|
126
126
|
refreshColumns(columnIds: string[]): void;
|
|
127
127
|
refreshRowByPrimaryKey(primaryKey: any): void;
|
|
128
128
|
refreshRowNode(rowNode: IRowNode): void;
|
|
129
|
-
refreshRowNodes(rowNodes
|
|
129
|
+
refreshRowNodes(rowNodes?: IRowNode[]): void;
|
|
130
130
|
refreshGroupRowNodes(): void;
|
|
131
131
|
isCellEditable(gridCell: GridCell): boolean;
|
|
132
132
|
isCellEdited(gridCell: GridCell): boolean;
|
|
@@ -2,13 +2,15 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
|
2
2
|
import { GridFilterApi } from '../GridFilterApi';
|
|
3
3
|
import { GridFilterInternalApi } from '../Internal/GridFilterInternalApi';
|
|
4
4
|
import { ApiBase } from './ApiBase';
|
|
5
|
-
import { GridFilter } from '../../types';
|
|
5
|
+
import { GridFilter, NamedQuery } from '../../types';
|
|
6
6
|
export declare class GridFilterApiImpl extends ApiBase implements GridFilterApi {
|
|
7
7
|
internalApi: GridFilterInternalApi;
|
|
8
8
|
constructor(_adaptable: IAdaptable);
|
|
9
|
+
reApplyGridFilter(): void;
|
|
9
10
|
getCurrentGridFilter(): GridFilter | undefined;
|
|
10
11
|
getCurrentGridFilterExpression(): string | undefined;
|
|
11
12
|
setGridFilterExpression(filter: string): void;
|
|
13
|
+
setGridFilterExpressionUsingNamedQuery(namedQuery: NamedQuery): void;
|
|
12
14
|
clearGridFilter(): void;
|
|
13
15
|
openUIEditorForGridFilter(expression?: string): void;
|
|
14
16
|
suspendGridFilter(): void;
|
|
@@ -8,6 +8,12 @@ export class GridFilterApiImpl extends ApiBase {
|
|
|
8
8
|
super(_adaptable);
|
|
9
9
|
this.internalApi = new GridFilterInternalApi(_adaptable);
|
|
10
10
|
}
|
|
11
|
+
reApplyGridFilter() {
|
|
12
|
+
const currentGridFilter = this.getCurrentGridFilter();
|
|
13
|
+
if (currentGridFilter?.Expression) {
|
|
14
|
+
this.setGridFilterExpression(currentGridFilter.Expression);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
11
17
|
getCurrentGridFilter() {
|
|
12
18
|
return this.getLayoutApi().getCurrentLayout()?.GridFilter;
|
|
13
19
|
}
|
|
@@ -21,6 +27,10 @@ export class GridFilterApiImpl extends ApiBase {
|
|
|
21
27
|
setGridFilterExpression(filter) {
|
|
22
28
|
this.dispatchAction(LayoutRedux.LayoutGridFilterSet(filter));
|
|
23
29
|
}
|
|
30
|
+
setGridFilterExpressionUsingNamedQuery(namedQuery) {
|
|
31
|
+
const expressionString = 'QUERY("' + namedQuery.Name + '")';
|
|
32
|
+
this.setGridFilterExpression(expressionString);
|
|
33
|
+
}
|
|
24
34
|
clearGridFilter() {
|
|
25
35
|
this.dispatchAction(LayoutRedux.LayoutGridFilterClear());
|
|
26
36
|
}
|
|
@@ -161,7 +161,7 @@ export const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
161
161
|
};
|
|
162
162
|
});
|
|
163
163
|
const result = simplifyTableLayoutModel({
|
|
164
|
-
|
|
164
|
+
Name: tableLayout.Name,
|
|
165
165
|
SuppressAggFuncInHeader: tableLayout.SuppressAggFuncInHeader,
|
|
166
166
|
TableColumns: tableLayout.TableColumns,
|
|
167
167
|
ColumnWidths: tableLayout.ColumnWidths,
|
|
@@ -223,7 +223,7 @@ export const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
223
223
|
pivotLayout = structuredClone(pivotLayout);
|
|
224
224
|
cleanupAdaptableObjectPrimitives(pivotLayout);
|
|
225
225
|
const result = simplifyPivotLayoutModel({
|
|
226
|
-
|
|
226
|
+
Name: pivotLayout.Name,
|
|
227
227
|
SuppressAggFuncInHeader: pivotLayout.SuppressAggFuncInHeader,
|
|
228
228
|
ColumnWidths: pivotLayout.ColumnWidths,
|
|
229
229
|
ColumnVisibility: pivotLayout.ColumnVisibility,
|
|
@@ -292,7 +292,7 @@ function toAggFunc(aggFunc) {
|
|
|
292
292
|
}
|
|
293
293
|
export const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
294
294
|
const tableLayout = {
|
|
295
|
-
Name: layoutModel.
|
|
295
|
+
Name: layoutModel.Name,
|
|
296
296
|
TableColumns: layoutModel.TableColumns,
|
|
297
297
|
ColumnWidths: layoutModel.ColumnWidths,
|
|
298
298
|
ColumnVisibility: layoutModel.ColumnVisibility,
|
|
@@ -395,7 +395,7 @@ function toAggregationColumnValue(columnAggregationModel) {
|
|
|
395
395
|
}
|
|
396
396
|
export const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
397
397
|
const pivotLayout = {
|
|
398
|
-
Name: layoutModel.
|
|
398
|
+
Name: layoutModel.Name,
|
|
399
399
|
PivotColumns: layoutModel.PivotColumns,
|
|
400
400
|
TableColumns: layoutModel.TableColumns,
|
|
401
401
|
ColumnWidths: layoutModel.ColumnWidths,
|
|
@@ -31,6 +31,7 @@ export declare class StateApiImpl extends ApiBase implements StateApi {
|
|
|
31
31
|
reloadInitialState(newInitialState?: InitialState): void;
|
|
32
32
|
getAllState(): AdaptableState;
|
|
33
33
|
getPersistedState(): AdaptablePersistentState;
|
|
34
|
+
getPersistentState(): AdaptablePersistentState;
|
|
34
35
|
getAllUserState(): BaseState[];
|
|
35
36
|
loadUserState(state: InitialState): void;
|
|
36
37
|
getAdaptableFilterState(): AdaptableFilterState;
|
|
@@ -53,7 +53,7 @@ export class StateApiImpl extends ApiBase {
|
|
|
53
53
|
}
|
|
54
54
|
reloadInitialState(newInitialState) {
|
|
55
55
|
const adaptableOptions = this.getOptions();
|
|
56
|
-
const oldState = this.
|
|
56
|
+
const oldState = this.getPersistentState();
|
|
57
57
|
// clearing filters so that AG Grid doesnt display the filter icon in a column header after grid reloads
|
|
58
58
|
// but this is a hack so would be nicer if there was a better way to do this
|
|
59
59
|
this.getGridApi().clearFiltering();
|
|
@@ -71,7 +71,7 @@ export class StateApiImpl extends ApiBase {
|
|
|
71
71
|
initialState: newInitialState || adaptableOptions.initialState,
|
|
72
72
|
flushCurrentState: false,
|
|
73
73
|
}).then(() => {
|
|
74
|
-
const newState = this.
|
|
74
|
+
const newState = this.getPersistentState();
|
|
75
75
|
this.getEventApi().internalApi.fireAdaptableStateReloadedEvent(oldState, newState);
|
|
76
76
|
});
|
|
77
77
|
});
|
|
@@ -81,11 +81,14 @@ export class StateApiImpl extends ApiBase {
|
|
|
81
81
|
return this.getAdaptableState();
|
|
82
82
|
}
|
|
83
83
|
getPersistedState() {
|
|
84
|
-
|
|
84
|
+
logDeprecation(this.getAdatableLogger(), 'StateApi', 'getPersistedState', 'getPersistentState');
|
|
85
|
+
return this.getPersistentState();
|
|
86
|
+
}
|
|
87
|
+
getPersistentState() {
|
|
85
88
|
return this.getAdaptableStore().getCurrentStorageState();
|
|
86
89
|
}
|
|
87
90
|
getAllUserState() {
|
|
88
|
-
return Object.values(this.
|
|
91
|
+
return Object.values(this.getPersistentState());
|
|
89
92
|
}
|
|
90
93
|
loadUserState(state) {
|
|
91
94
|
this.setAdaptableStateKey(this.getOptions().adaptableStateKey, {
|
package/src/Api/StateApi.d.ts
CHANGED
|
@@ -69,8 +69,15 @@ export interface StateApi {
|
|
|
69
69
|
getAllState(): AdaptableState;
|
|
70
70
|
/**
|
|
71
71
|
* Retrieves persisted state in AdapTable, i.e. state last stored with `StateOptions.persistState()` function
|
|
72
|
+
*
|
|
73
|
+
* @deprecated use `getPersistentState()` instead
|
|
72
74
|
*/
|
|
73
75
|
getPersistedState(): AdaptablePersistentState;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the persistent state in Adaptable, i.e. state that is passed to the `StateOptions.persistState()` function.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
getPersistentState(): AdaptablePersistentState;
|
|
74
81
|
/**
|
|
75
82
|
* Gets filter-related sections of Adaptable State
|
|
76
83
|
*/
|
|
@@ -13,7 +13,8 @@ export function ReorderDraggable(props) {
|
|
|
13
13
|
return (React.createElement(Flex, { className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier ?? index, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option", ...flexProps },
|
|
14
14
|
React.createElement(Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
|
|
15
15
|
reorderable ? (React.createElement(Box, { mr: 3, ...dragHandleProps },
|
|
16
|
-
React.createElement(Icon, { name: "drag", style: { cursor: 'grab' } }))) :
|
|
16
|
+
React.createElement(Icon, { name: "drag", style: { cursor: 'grab' } }))) : (React.createElement(Box, { mr: 3 },
|
|
17
|
+
React.createElement(Icon, { name: "drag", style: { cursor: 'not-allowed', opacity: 0.3 } }))),
|
|
17
18
|
props.renderOption(option, index))));
|
|
18
19
|
};
|
|
19
20
|
const reorderable = isOptionDraggable ? isOptionDraggable(option) : true;
|
|
@@ -376,7 +376,9 @@ export const ColumnsSection = (props) => {
|
|
|
376
376
|
React.createElement(Box, null,
|
|
377
377
|
React.createElement(NaturallySizedIcon, { name: "info" })),
|
|
378
378
|
React.createElement(Text, { ml: 1 }, "Expand each Column to set Width, Pinnning and a custom Header")),
|
|
379
|
-
React.createElement(ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`,
|
|
379
|
+
React.createElement(ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`, isOptionDraggable: (option) => {
|
|
380
|
+
return option.moveable;
|
|
381
|
+
}, order: currentOrder, renderOption: (option) => {
|
|
380
382
|
return (React.createElement(ColumnRow, { onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange, onPinChange: handlePinChange, layout: layout, column: option }));
|
|
381
383
|
}, onChange: handleColumnsChange }),
|
|
382
384
|
renderSelectionSection({
|
|
@@ -22,7 +22,7 @@ export const PivotRowGroupingSection = (props) => {
|
|
|
22
22
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
23
23
|
const allGroupableColumns = adaptable.api.columnApi.getGroupableColumns();
|
|
24
24
|
const sortedGroupableColumns = React.useMemo(() => {
|
|
25
|
-
return ArrayExtensions.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.
|
|
25
|
+
return ArrayExtensions.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.PivotGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
|
|
26
26
|
}, [layout, allGroupableColumns]);
|
|
27
27
|
const onChange = (layout) => {
|
|
28
28
|
props.onChange(normalizeLayout(layout));
|
|
@@ -5,7 +5,7 @@ export const ExportDropdown = (props) => {
|
|
|
5
5
|
const handleChange = (destination) => {
|
|
6
6
|
switch (props.type) {
|
|
7
7
|
case 'adaptableState':
|
|
8
|
-
const adaptableState = props.api.stateApi.
|
|
8
|
+
const adaptableState = props.api.stateApi.getPersistentState();
|
|
9
9
|
handleExportState(destination, 'adaptableState', adaptableState);
|
|
10
10
|
break;
|
|
11
11
|
case 'initialState':
|
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: "20.2.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1751978297635 || Date.now(),
|
|
4
|
+
VERSION: "20.2.7" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -40,10 +40,6 @@ export interface BaseLayoutModel {
|
|
|
40
40
|
* Same as RowSummaries, but for Pivot Layout
|
|
41
41
|
*/
|
|
42
42
|
Ignore_RowSummaries?: any;
|
|
43
|
-
/**
|
|
44
|
-
* Same as above, but
|
|
45
|
-
*/
|
|
46
|
-
Ignore_Name?: string;
|
|
47
43
|
/**
|
|
48
44
|
* Same as above, but for Column Headers
|
|
49
45
|
*/
|
|
@@ -51,6 +47,10 @@ export interface BaseLayoutModel {
|
|
|
51
47
|
Ignore_Source?: string;
|
|
52
48
|
Ignore_AdaptableVersion?: string;
|
|
53
49
|
Ignore_Uuid?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The Layout Name
|
|
52
|
+
*/
|
|
53
|
+
Name?: string;
|
|
54
54
|
ColumnVisibility?: {
|
|
55
55
|
[columnId: string]: false;
|
|
56
56
|
};
|
|
@@ -276,7 +276,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
276
276
|
}
|
|
277
277
|
delete layout.TableColumns;
|
|
278
278
|
const pivotLayout = {
|
|
279
|
-
|
|
279
|
+
Name: layout.Name,
|
|
280
280
|
Ignore_GridFilter: layout.Ignore_GridFilter,
|
|
281
281
|
Ignore_ColumnFilters: layout.Ignore_ColumnFilters,
|
|
282
282
|
Ignore_ColumnHeaders: layout.Ignore_ColumnHeaders,
|
|
@@ -595,7 +595,7 @@ export class LayoutManager extends LMEmitter {
|
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
const layout = simplifyTableLayoutModel({
|
|
598
|
-
|
|
598
|
+
Name: this.currentLayout?.Name || 'Default',
|
|
599
599
|
Ignore_GridFilter: this.currentLayout?.Ignore_GridFilter,
|
|
600
600
|
Ignore_ColumnFilters: this.currentLayout?.Ignore_ColumnFilters,
|
|
601
601
|
Ignore_ColumnHeaders: this.currentLayout?.Ignore_ColumnHeaders,
|
|
@@ -49,7 +49,6 @@ export function isTableLayoutEqual(l1, l2) {
|
|
|
49
49
|
function clearIgnoredProperties(layout) {
|
|
50
50
|
delete layout.Ignore_GridFilter;
|
|
51
51
|
delete layout.Ignore_ColumnFilters;
|
|
52
|
-
delete layout.Ignore_Name;
|
|
53
52
|
delete layout.Ignore_ColumnHeaders;
|
|
54
53
|
delete layout.Ignore_AutoSizeColumns;
|
|
55
54
|
delete layout.Ignore_RowSummaries;
|