@adaptabletools/adaptable-cjs 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.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
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;
|
|
@@ -12,6 +12,12 @@ class GridFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
12
12
|
super(_adaptable);
|
|
13
13
|
this.internalApi = new GridFilterInternalApi_1.GridFilterInternalApi(_adaptable);
|
|
14
14
|
}
|
|
15
|
+
reApplyGridFilter() {
|
|
16
|
+
const currentGridFilter = this.getCurrentGridFilter();
|
|
17
|
+
if (currentGridFilter?.Expression) {
|
|
18
|
+
this.setGridFilterExpression(currentGridFilter.Expression);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
15
21
|
getCurrentGridFilter() {
|
|
16
22
|
return this.getLayoutApi().getCurrentLayout()?.GridFilter;
|
|
17
23
|
}
|
|
@@ -25,6 +31,10 @@ class GridFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
25
31
|
setGridFilterExpression(filter) {
|
|
26
32
|
this.dispatchAction(LayoutRedux.LayoutGridFilterSet(filter));
|
|
27
33
|
}
|
|
34
|
+
setGridFilterExpressionUsingNamedQuery(namedQuery) {
|
|
35
|
+
const expressionString = 'QUERY("' + namedQuery.Name + '")';
|
|
36
|
+
this.setGridFilterExpression(expressionString);
|
|
37
|
+
}
|
|
28
38
|
clearGridFilter() {
|
|
29
39
|
this.dispatchAction(LayoutRedux.LayoutGridFilterClear());
|
|
30
40
|
}
|
|
@@ -175,7 +175,7 @@ const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
175
175
|
};
|
|
176
176
|
});
|
|
177
177
|
const result = (0, simplifyLayoutModel_1.simplifyTableLayoutModel)({
|
|
178
|
-
|
|
178
|
+
Name: tableLayout.Name,
|
|
179
179
|
SuppressAggFuncInHeader: tableLayout.SuppressAggFuncInHeader,
|
|
180
180
|
TableColumns: tableLayout.TableColumns,
|
|
181
181
|
ColumnWidths: tableLayout.ColumnWidths,
|
|
@@ -238,7 +238,7 @@ const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
238
238
|
pivotLayout = structuredClone(pivotLayout);
|
|
239
239
|
cleanupAdaptableObjectPrimitives(pivotLayout);
|
|
240
240
|
const result = (0, simplifyLayoutModel_1.simplifyPivotLayoutModel)({
|
|
241
|
-
|
|
241
|
+
Name: pivotLayout.Name,
|
|
242
242
|
SuppressAggFuncInHeader: pivotLayout.SuppressAggFuncInHeader,
|
|
243
243
|
ColumnWidths: pivotLayout.ColumnWidths,
|
|
244
244
|
ColumnVisibility: pivotLayout.ColumnVisibility,
|
|
@@ -308,7 +308,7 @@ function toAggFunc(aggFunc) {
|
|
|
308
308
|
}
|
|
309
309
|
const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
310
310
|
const tableLayout = {
|
|
311
|
-
Name: layoutModel.
|
|
311
|
+
Name: layoutModel.Name,
|
|
312
312
|
TableColumns: layoutModel.TableColumns,
|
|
313
313
|
ColumnWidths: layoutModel.ColumnWidths,
|
|
314
314
|
ColumnVisibility: layoutModel.ColumnVisibility,
|
|
@@ -412,7 +412,7 @@ function toAggregationColumnValue(columnAggregationModel) {
|
|
|
412
412
|
}
|
|
413
413
|
const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
414
414
|
const pivotLayout = {
|
|
415
|
-
Name: layoutModel.
|
|
415
|
+
Name: layoutModel.Name,
|
|
416
416
|
PivotColumns: layoutModel.PivotColumns,
|
|
417
417
|
TableColumns: layoutModel.TableColumns,
|
|
418
418
|
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;
|
|
@@ -57,7 +57,7 @@ class StateApiImpl extends ApiBase_1.ApiBase {
|
|
|
57
57
|
}
|
|
58
58
|
reloadInitialState(newInitialState) {
|
|
59
59
|
const adaptableOptions = this.getOptions();
|
|
60
|
-
const oldState = this.
|
|
60
|
+
const oldState = this.getPersistentState();
|
|
61
61
|
// clearing filters so that AG Grid doesnt display the filter icon in a column header after grid reloads
|
|
62
62
|
// but this is a hack so would be nicer if there was a better way to do this
|
|
63
63
|
this.getGridApi().clearFiltering();
|
|
@@ -75,7 +75,7 @@ class StateApiImpl extends ApiBase_1.ApiBase {
|
|
|
75
75
|
initialState: newInitialState || adaptableOptions.initialState,
|
|
76
76
|
flushCurrentState: false,
|
|
77
77
|
}).then(() => {
|
|
78
|
-
const newState = this.
|
|
78
|
+
const newState = this.getPersistentState();
|
|
79
79
|
this.getEventApi().internalApi.fireAdaptableStateReloadedEvent(oldState, newState);
|
|
80
80
|
});
|
|
81
81
|
});
|
|
@@ -85,11 +85,14 @@ class StateApiImpl extends ApiBase_1.ApiBase {
|
|
|
85
85
|
return this.getAdaptableState();
|
|
86
86
|
}
|
|
87
87
|
getPersistedState() {
|
|
88
|
-
|
|
88
|
+
(0, logDeprecation_1.logDeprecation)(this.getAdatableLogger(), 'StateApi', 'getPersistedState', 'getPersistentState');
|
|
89
|
+
return this.getPersistentState();
|
|
90
|
+
}
|
|
91
|
+
getPersistentState() {
|
|
89
92
|
return this.getAdaptableStore().getCurrentStorageState();
|
|
90
93
|
}
|
|
91
94
|
getAllUserState() {
|
|
92
|
-
return Object.values(this.
|
|
95
|
+
return Object.values(this.getPersistentState());
|
|
93
96
|
}
|
|
94
97
|
loadUserState(state) {
|
|
95
98
|
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
|
*/
|
|
@@ -17,7 +17,8 @@ function ReorderDraggable(props) {
|
|
|
17
17
|
return (React.createElement(rebass_1.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 },
|
|
18
18
|
React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
|
|
19
19
|
reorderable ? (React.createElement(rebass_1.Box, { mr: 3, ...dragHandleProps },
|
|
20
|
-
React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) :
|
|
20
|
+
React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) : (React.createElement(rebass_1.Box, { mr: 3 },
|
|
21
|
+
React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'not-allowed', opacity: 0.3 } }))),
|
|
21
22
|
props.renderOption(option, index))));
|
|
22
23
|
};
|
|
23
24
|
const reorderable = isOptionDraggable ? isOptionDraggable(option) : true;
|
|
@@ -381,7 +381,9 @@ const ColumnsSection = (props) => {
|
|
|
381
381
|
React.createElement(rebass_1.Box, null,
|
|
382
382
|
React.createElement(icons_1.NaturallySizedIcon, { name: "info" })),
|
|
383
383
|
React.createElement(rebass_1.Text, { ml: 1 }, "Expand each Column to set Width, Pinnning and a custom Header")),
|
|
384
|
-
React.createElement(ReorderDraggable_1.ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`,
|
|
384
|
+
React.createElement(ReorderDraggable_1.ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`, isOptionDraggable: (option) => {
|
|
385
|
+
return option.moveable;
|
|
386
|
+
}, order: currentOrder, renderOption: (option) => {
|
|
385
387
|
return (React.createElement(ColumnRow, { onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange, onPinChange: handlePinChange, layout: layout, column: option }));
|
|
386
388
|
}, onChange: handleColumnsChange }),
|
|
387
389
|
(0, ValueSelector_1.renderSelectionSection)({
|
|
@@ -27,7 +27,7 @@ const PivotRowGroupingSection = (props) => {
|
|
|
27
27
|
const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
28
28
|
const allGroupableColumns = adaptable.api.columnApi.getGroupableColumns();
|
|
29
29
|
const sortedGroupableColumns = React.useMemo(() => {
|
|
30
|
-
return ArrayExtensions_1.default.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.
|
|
30
|
+
return ArrayExtensions_1.default.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.PivotGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
|
|
31
31
|
}, [layout, allGroupableColumns]);
|
|
32
32
|
const onChange = (layout) => {
|
|
33
33
|
props.onChange((0, LayoutHelpers_1.normalizeLayout)(layout));
|
|
@@ -9,7 +9,7 @@ const ExportDropdown = (props) => {
|
|
|
9
9
|
const handleChange = (destination) => {
|
|
10
10
|
switch (props.type) {
|
|
11
11
|
case 'adaptableState':
|
|
12
|
-
const adaptableState = props.api.stateApi.
|
|
12
|
+
const adaptableState = props.api.stateApi.getPersistentState();
|
|
13
13
|
(0, handleExportState_1.handleExportState)(destination, 'adaptableState', adaptableState);
|
|
14
14
|
break;
|
|
15
15
|
case 'initialState':
|
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: "20.2.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1751978327606 || Date.now(),
|
|
6
|
+
VERSION: "20.2.7" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -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
|
};
|
|
@@ -279,7 +279,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
279
279
|
}
|
|
280
280
|
delete layout.TableColumns;
|
|
281
281
|
const pivotLayout = {
|
|
282
|
-
|
|
282
|
+
Name: layout.Name,
|
|
283
283
|
Ignore_GridFilter: layout.Ignore_GridFilter,
|
|
284
284
|
Ignore_ColumnFilters: layout.Ignore_ColumnFilters,
|
|
285
285
|
Ignore_ColumnHeaders: layout.Ignore_ColumnHeaders,
|
|
@@ -598,7 +598,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
600
|
const layout = (0, simplifyLayoutModel_1.simplifyTableLayoutModel)({
|
|
601
|
-
|
|
601
|
+
Name: this.currentLayout?.Name || 'Default',
|
|
602
602
|
Ignore_GridFilter: this.currentLayout?.Ignore_GridFilter,
|
|
603
603
|
Ignore_ColumnFilters: this.currentLayout?.Ignore_ColumnFilters,
|
|
604
604
|
Ignore_ColumnHeaders: this.currentLayout?.Ignore_ColumnHeaders,
|
|
@@ -56,7 +56,6 @@ exports.isTableLayoutEqual = isTableLayoutEqual;
|
|
|
56
56
|
function clearIgnoredProperties(layout) {
|
|
57
57
|
delete layout.Ignore_GridFilter;
|
|
58
58
|
delete layout.Ignore_ColumnFilters;
|
|
59
|
-
delete layout.Ignore_Name;
|
|
60
59
|
delete layout.Ignore_ColumnHeaders;
|
|
61
60
|
delete layout.Ignore_AutoSizeColumns;
|
|
62
61
|
delete layout.Ignore_RowSummaries;
|