@adaptabletools/adaptable 20.2.1 → 20.2.2
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/AdaptableState/Common/AdaptableColumn.d.ts +4 -0
- package/src/AdaptableState/LayoutState.d.ts +16 -2
- package/src/AdaptableState/QuickSearchState.d.ts +5 -5
- package/src/Api/Implementation/ColumnApiImpl.js +1 -0
- package/src/Api/Implementation/LayoutHelpers.d.ts +3 -0
- package/src/Api/Implementation/LayoutHelpers.js +76 -40
- package/src/Api/Implementation/QuickSearchApiImpl.d.ts +2 -2
- package/src/Api/Implementation/QuickSearchApiImpl.js +4 -4
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +4 -4
- package/src/Api/QuickSearchApi.d.ts +2 -2
- package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +4 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +7 -7
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +2 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +27 -8
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
- package/src/View/QuickSearch/QuickSearchPopup.d.ts +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +7 -4
- package/src/agGrid/AdaptableAgGrid.js +20 -9
- package/src/agGrid/AgGridAdapter.js +6 -1
- package/src/agGrid/AgGridColumnAdapter.js +10 -8
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +17 -4
- package/src/layout-manager/src/index.d.ts +1 -1
- package/src/layout-manager/src/index.js +61 -18
- package/src/metamodel/adaptable.metamodel.d.ts +10 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -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.2",
|
|
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",
|
|
@@ -155,6 +155,10 @@ export interface AdaptableColumn<TData = any> extends AdaptableColumnBase {
|
|
|
155
155
|
* Is Column a generated Row Group Column
|
|
156
156
|
*/
|
|
157
157
|
isGeneratedRowGroupColumn: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Is Column a generated Selection Column
|
|
160
|
+
*/
|
|
161
|
+
isGeneratedSelectionColumn: boolean;
|
|
158
162
|
/**
|
|
159
163
|
* Is Column a generated Pivot Result Column
|
|
160
164
|
*/
|
|
@@ -5,6 +5,7 @@ import { ColumnFilter, GridFilter } from '../types';
|
|
|
5
5
|
import { TableAggregationColumns, PivotAggregationColumns } from './Common/AggregationColumns';
|
|
6
6
|
import { RowSummary } from './Common/RowSummary';
|
|
7
7
|
import { NonEmptyArray } from '../Utilities/Extensions/ArrayExtensions';
|
|
8
|
+
import { XOR } from '../Utilities/Extensions/TypeExtensions';
|
|
8
9
|
/**
|
|
9
10
|
* Base Layout Type - Pivot or Table
|
|
10
11
|
*/
|
|
@@ -188,11 +189,24 @@ export type RowGroupValuesWithExceptionKeys = {
|
|
|
188
189
|
* Default behaviour for Row Groups: 'expanded' or 'collapsed';
|
|
189
190
|
*/
|
|
190
191
|
RowGroupDefaultBehavior: 'expanded' | 'collapsed';
|
|
192
|
+
} & XOR<{
|
|
191
193
|
/**
|
|
192
|
-
*
|
|
194
|
+
* @deprecated - use GroupKeys instead. Layout.RowGroupValues.GroupKeys[] array allows you
|
|
195
|
+
* to configure the row group expand / collapse behaviour for each combination of row grouped columns.
|
|
193
196
|
*/
|
|
194
197
|
ExceptionGroupKeys?: any[][];
|
|
195
|
-
}
|
|
198
|
+
}, {
|
|
199
|
+
/**
|
|
200
|
+
* Allows you to configure the row group expand / collapse behaviour for each combination of row grouped columns.
|
|
201
|
+
* The default value is configured via RowGroupDefaultBehavior, but exceptions are configured by the GroupKeys array.
|
|
202
|
+
* Each item in the GroupKeys array is a an object with `RowGroupedColumns` and `ExceptionGroupKeys`. Those properties
|
|
203
|
+
* configure the collapse/expand exceptions for the specific row group columns.
|
|
204
|
+
*/
|
|
205
|
+
GroupKeys?: {
|
|
206
|
+
RowGroupedColumns: string[];
|
|
207
|
+
ExceptionGroupKeys?: any[][];
|
|
208
|
+
}[];
|
|
209
|
+
}>;
|
|
196
210
|
/**
|
|
197
211
|
* Manages Column Group expand / collapse behaviour, including exceptions
|
|
198
212
|
*/
|
|
@@ -5,19 +5,19 @@ import { BaseState } from './BaseState';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface QuickSearchState extends BaseState {
|
|
7
7
|
/**
|
|
8
|
-
* Last Quick Search that was run (and will
|
|
8
|
+
* Last Quick Search that was run (and will be applied at start-up)
|
|
9
9
|
*/
|
|
10
10
|
QuickSearchText?: string;
|
|
11
11
|
/**
|
|
12
|
-
* Style
|
|
12
|
+
* Style used to highlight matching cells
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
CellMatchStyle?: Omit<AdaptableStyle, 'ClassName'>;
|
|
15
15
|
/**
|
|
16
|
-
* Style
|
|
16
|
+
* Style used to highlight matching text within a cell (not availale in SSRM)
|
|
17
17
|
*/
|
|
18
18
|
TextMatchStyle?: Omit<AdaptableStyle, 'ClassName'>;
|
|
19
19
|
/**
|
|
20
|
-
* Style
|
|
20
|
+
* Style used to highlight matching text within current match (not availale in SSRM)
|
|
21
21
|
*/
|
|
22
22
|
CurrentTextMatchStyle?: Omit<AdaptableStyle, 'ClassName'>;
|
|
23
23
|
}
|
|
@@ -15,6 +15,9 @@ export declare const normalizeTableLayout: (tableLayout: TableLayout, options?:
|
|
|
15
15
|
isTree: boolean;
|
|
16
16
|
}) => TableLayout;
|
|
17
17
|
export declare const normalizePivotLayout: (pivotLayout: PivotLayout) => PivotLayout;
|
|
18
|
+
export declare const getLayoutRowGroupValuesExceptionGroupKeys: (layout: TableLayout | PivotLayout) => any[][];
|
|
19
|
+
export declare const toRowGroupValuesForLayoutState: (rowGroupValuesModel: TableLayoutModel['RowGroupValues']) => TableLayout['RowGroupValues'];
|
|
20
|
+
export declare const toRowGroupValuesForLayoutModel: (rowGroupValuesState: TableLayout['RowGroupValues']) => TableLayoutModel['RowGroupValues'];
|
|
18
21
|
export declare const checkForDuplicateColumns: (layout: TableLayout) => void;
|
|
19
22
|
export declare const tableLayoutToTableLayoutModel: (tableLayout: TableLayout) => TableLayoutModel;
|
|
20
23
|
export declare const pivotLayoutToPivotLayoutModel: (pivotLayout: PivotLayout) => PivotLayoutModel;
|
|
@@ -64,6 +64,78 @@ const errorOnce = (message) => {
|
|
|
64
64
|
console.error(message);
|
|
65
65
|
errorOnceMessages.set(message, true);
|
|
66
66
|
};
|
|
67
|
+
export const getLayoutRowGroupValuesExceptionGroupKeys = (layout) => {
|
|
68
|
+
if (!layout.RowGroupValues) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
if (layout.RowGroupValues?.RowGroupDefaultBehavior === 'always-collapsed') {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
if (layout.RowGroupValues?.RowGroupDefaultBehavior === 'always-expanded') {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
if (Array.isArray(layout.RowGroupValues?.GroupKeys)) {
|
|
78
|
+
const currentGroupedColumns = (layout.RowGroupedColumns || []).join(',');
|
|
79
|
+
const matchingGroupKeys = layout.RowGroupValues.GroupKeys.find(({ RowGroupedColumns }) => {
|
|
80
|
+
return RowGroupedColumns.join(',') === currentGroupedColumns;
|
|
81
|
+
});
|
|
82
|
+
if (matchingGroupKeys) {
|
|
83
|
+
return matchingGroupKeys.ExceptionGroupKeys;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return layout.RowGroupValues.ExceptionGroupKeys || [];
|
|
87
|
+
};
|
|
88
|
+
export const toRowGroupValuesForLayoutState = (rowGroupValuesModel) => {
|
|
89
|
+
if (!rowGroupValuesModel) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
const rowGroupValuesState = {
|
|
93
|
+
RowGroupDefaultBehavior: rowGroupValuesModel.RowGroupDisplay,
|
|
94
|
+
};
|
|
95
|
+
if (rowGroupValuesModel.RowGroupDisplay === 'collapsed' ||
|
|
96
|
+
rowGroupValuesModel.RowGroupDisplay === 'expanded') {
|
|
97
|
+
if (rowGroupValuesModel.GroupKeys) {
|
|
98
|
+
rowGroupValuesState.GroupKeys =
|
|
99
|
+
rowGroupValuesModel.GroupKeys.map(({ RowGroupedColumns, Values }) => {
|
|
100
|
+
return {
|
|
101
|
+
RowGroupedColumns,
|
|
102
|
+
ExceptionGroupKeys: Values,
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
rowGroupValuesState.ExceptionGroupKeys =
|
|
108
|
+
rowGroupValuesModel.Values;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return rowGroupValuesState;
|
|
112
|
+
};
|
|
113
|
+
export const toRowGroupValuesForLayoutModel = (rowGroupValuesState) => {
|
|
114
|
+
if (!rowGroupValuesState) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
if (rowGroupValuesState.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
118
|
+
rowGroupValuesState.RowGroupDefaultBehavior === 'always-expanded') {
|
|
119
|
+
return {
|
|
120
|
+
RowGroupDisplay: rowGroupValuesState.RowGroupDefaultBehavior,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (rowGroupValuesState.GroupKeys) {
|
|
124
|
+
return {
|
|
125
|
+
RowGroupDisplay: rowGroupValuesState.RowGroupDefaultBehavior,
|
|
126
|
+
GroupKeys: rowGroupValuesState.GroupKeys.map(({ RowGroupedColumns, ExceptionGroupKeys }) => {
|
|
127
|
+
return {
|
|
128
|
+
RowGroupedColumns,
|
|
129
|
+
Values: ExceptionGroupKeys,
|
|
130
|
+
};
|
|
131
|
+
}),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
RowGroupDisplay: rowGroupValuesState.RowGroupDefaultBehavior,
|
|
136
|
+
Values: rowGroupValuesState.ExceptionGroupKeys || [],
|
|
137
|
+
};
|
|
138
|
+
};
|
|
67
139
|
export const checkForDuplicateColumns = (layout) => {
|
|
68
140
|
if (layout.TableColumns) {
|
|
69
141
|
const set = new Set(layout.TableColumns);
|
|
@@ -97,17 +169,7 @@ export const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
97
169
|
ColumnSorts: tableLayout.ColumnSorts,
|
|
98
170
|
RowGroupedColumns: tableLayout.RowGroupedColumns,
|
|
99
171
|
ColumnPinning: tableLayout.ColumnPinning,
|
|
100
|
-
RowGroupValues: tableLayout.RowGroupValues
|
|
101
|
-
? tableLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
102
|
-
tableLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-expanded'
|
|
103
|
-
? {
|
|
104
|
-
RowGroupDisplay: tableLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
105
|
-
}
|
|
106
|
-
: {
|
|
107
|
-
RowGroupDisplay: tableLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
108
|
-
Values: tableLayout.RowGroupValues.ExceptionGroupKeys || [],
|
|
109
|
-
}
|
|
110
|
-
: undefined,
|
|
172
|
+
RowGroupValues: toRowGroupValuesForLayoutModel(tableLayout.RowGroupValues),
|
|
111
173
|
ColumnGroupValues: tableLayout.ColumnGroupValues
|
|
112
174
|
? tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
|
|
113
175
|
tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
|
|
@@ -180,17 +242,7 @@ export const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
180
242
|
GrandTotalRow: pivotLayout.GrandTotalRow,
|
|
181
243
|
PivotGrandTotal: pivotLayout.PivotGrandTotal,
|
|
182
244
|
PivotColumnTotal: pivotLayout.PivotColumnTotal,
|
|
183
|
-
RowGroupValues: pivotLayout.RowGroupValues
|
|
184
|
-
? pivotLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
185
|
-
pivotLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-expanded'
|
|
186
|
-
? {
|
|
187
|
-
RowGroupDisplay: pivotLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
188
|
-
}
|
|
189
|
-
: {
|
|
190
|
-
RowGroupDisplay: pivotLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
191
|
-
Values: pivotLayout.RowGroupValues.ExceptionGroupKeys || [],
|
|
192
|
-
}
|
|
193
|
-
: undefined,
|
|
245
|
+
RowGroupValues: toRowGroupValuesForLayoutModel(pivotLayout.RowGroupValues),
|
|
194
246
|
ColumnGroupValues: pivotLayout.ColumnGroupValues
|
|
195
247
|
? pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
|
|
196
248
|
pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
|
|
@@ -295,15 +347,7 @@ export const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
|
295
347
|
delete tableLayout.ColumnPinning;
|
|
296
348
|
}
|
|
297
349
|
if (layoutModel.RowGroupValues) {
|
|
298
|
-
tableLayout.RowGroupValues =
|
|
299
|
-
RowGroupDefaultBehavior: layoutModel.RowGroupValues.RowGroupDisplay,
|
|
300
|
-
};
|
|
301
|
-
if ((layoutModel.RowGroupValues.RowGroupDisplay === 'collapsed' ||
|
|
302
|
-
layoutModel.RowGroupValues.RowGroupDisplay === 'expanded') &&
|
|
303
|
-
layoutModel.RowGroupValues.Values) {
|
|
304
|
-
// @ts-ignore
|
|
305
|
-
tableLayout.RowGroupValues.ExceptionGroupKeys = layoutModel.RowGroupValues.Values;
|
|
306
|
-
}
|
|
350
|
+
tableLayout.RowGroupValues = toRowGroupValuesForLayoutState(layoutModel.RowGroupValues);
|
|
307
351
|
}
|
|
308
352
|
else {
|
|
309
353
|
delete tableLayout.RowGroupValues;
|
|
@@ -397,15 +441,7 @@ export const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
|
397
441
|
delete pivotLayout.PivotGroupedColumns;
|
|
398
442
|
}
|
|
399
443
|
if (layoutModel.RowGroupValues) {
|
|
400
|
-
pivotLayout.RowGroupValues =
|
|
401
|
-
RowGroupDefaultBehavior: layoutModel.RowGroupValues.RowGroupDisplay,
|
|
402
|
-
};
|
|
403
|
-
if ((layoutModel.RowGroupValues.RowGroupDisplay === 'collapsed' ||
|
|
404
|
-
layoutModel.RowGroupValues.RowGroupDisplay === 'expanded') &&
|
|
405
|
-
layoutModel.RowGroupValues.Values) {
|
|
406
|
-
// @ts-ignore
|
|
407
|
-
pivotLayout.RowGroupValues.ExceptionGroupKeys = layoutModel.RowGroupValues.Values;
|
|
408
|
-
}
|
|
444
|
+
pivotLayout.RowGroupValues = toRowGroupValuesForLayoutState(layoutModel.RowGroupValues);
|
|
409
445
|
}
|
|
410
446
|
else {
|
|
411
447
|
delete pivotLayout.RowGroupValues;
|
|
@@ -9,10 +9,10 @@ export declare class QuickSearchApiImpl extends ApiBase implements QuickSearchAp
|
|
|
9
9
|
gotoNextMatch(): void;
|
|
10
10
|
gotoPreviousMatch(): void;
|
|
11
11
|
getQuickSearchValue(): string;
|
|
12
|
-
|
|
12
|
+
getQuickSearchCellMatchStyle(): AdaptableStyle;
|
|
13
13
|
getQuickSearchTextMatchStyle(): AdaptableStyle | undefined;
|
|
14
14
|
getQuickSearchCurrentTextMatchStyle(): AdaptableStyle | undefined;
|
|
15
|
-
|
|
15
|
+
setQuickSearchCellMatchStyle(style: AdaptableStyle): void;
|
|
16
16
|
openQuickSearchSettingsPanel(): void;
|
|
17
17
|
showFloatingQuickSearch(): void;
|
|
18
18
|
hideFloatingQuickSearch(): void;
|
|
@@ -21,8 +21,8 @@ export class QuickSearchApiImpl extends ApiBase {
|
|
|
21
21
|
getQuickSearchValue() {
|
|
22
22
|
return this.getQuickSearchState().QuickSearchText;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
return this.getQuickSearchState().
|
|
24
|
+
getQuickSearchCellMatchStyle() {
|
|
25
|
+
return this.getQuickSearchState().CellMatchStyle;
|
|
26
26
|
}
|
|
27
27
|
getQuickSearchTextMatchStyle() {
|
|
28
28
|
return this.getQuickSearchState().TextMatchStyle;
|
|
@@ -30,8 +30,8 @@ export class QuickSearchApiImpl extends ApiBase {
|
|
|
30
30
|
getQuickSearchCurrentTextMatchStyle() {
|
|
31
31
|
return this.getQuickSearchState().CurrentTextMatchStyle;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
this.dispatchAction(QuickSearchRedux.
|
|
33
|
+
setQuickSearchCellMatchStyle(style) {
|
|
34
|
+
this.dispatchAction(QuickSearchRedux.QuickSearchSetCellMatchingStyle(style));
|
|
35
35
|
}
|
|
36
36
|
openQuickSearchSettingsPanel() {
|
|
37
37
|
this.showModulePopup(ModuleConstants.QuickSearchModuleId);
|
|
@@ -77,7 +77,7 @@ export declare class FormatColumnInternalApi extends ApiBase {
|
|
|
77
77
|
* @param scope Scope to check
|
|
78
78
|
*/
|
|
79
79
|
getFormatColumnDefsForScope(scope: ColumnScope): AdaptablePredicateDef[];
|
|
80
|
-
|
|
80
|
+
formatColumnWithColumnGroupScopeShouldRender(formatColumn: FormatColumn, column: AdaptableColumn): boolean;
|
|
81
81
|
/**
|
|
82
82
|
* Checks if format column is relevant for a given cell (intersection of given AdaptableColumn and RowNode)
|
|
83
83
|
*
|
|
@@ -172,7 +172,7 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
172
172
|
.predicateApi.internalApi.getFormatColumnPredicateDefs(scope)
|
|
173
173
|
.filter((predicateDef) => this.getColumnScopeApi().isScopeInScope(scope, predicateDef.columnScope));
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
formatColumnWithColumnGroupScopeShouldRender(formatColumn, column) {
|
|
176
176
|
if (!formatColumn.ColumnGroupScope) {
|
|
177
177
|
return true;
|
|
178
178
|
}
|
|
@@ -187,7 +187,7 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
187
187
|
if (!columnGroupParentForCurrentColumn) {
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
|
-
const
|
|
190
|
+
const columnGroupScope = columnGroupParentForCurrentColumn.isExpanded()
|
|
191
191
|
? 'Expanded'
|
|
192
192
|
: 'Collapsed';
|
|
193
193
|
const columnGroupLeafColumns = columnGroupParentForCurrentColumn.getLeafColumns();
|
|
@@ -201,7 +201,7 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
201
201
|
if (formatColumn.ColumnGroupScope === 'Both') {
|
|
202
202
|
return true;
|
|
203
203
|
}
|
|
204
|
-
return formatColumn.ColumnGroupScope ===
|
|
204
|
+
return formatColumn.ColumnGroupScope === columnGroupScope;
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* Checks if format column is relevant for a given cell (intersection of given AdaptableColumn and RowNode)
|
|
@@ -234,7 +234,7 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
if (formatColumn.ColumnGroupScope &&
|
|
237
|
-
!this.
|
|
237
|
+
!this.formatColumnWithColumnGroupScopeShouldRender(formatColumn, column)) {
|
|
238
238
|
return false;
|
|
239
239
|
}
|
|
240
240
|
if (!formatColumn.Rule) {
|
|
@@ -32,7 +32,7 @@ export interface QuickSearchApi {
|
|
|
32
32
|
/**
|
|
33
33
|
* Retrieves current Quick Search style
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
getQuickSearchCellMatchStyle(): AdaptableStyle;
|
|
36
36
|
/**
|
|
37
37
|
* Retrieves the style for the text match in the Quick Search
|
|
38
38
|
*/
|
|
@@ -45,7 +45,7 @@ export interface QuickSearchApi {
|
|
|
45
45
|
* Sets style for Quick Search; can be name of (a provided) css style
|
|
46
46
|
* @param style the style to use
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
setQuickSearchCellMatchStyle(style: AdaptableStyle): void;
|
|
49
49
|
/**
|
|
50
50
|
* Opens Settings Panel with Quick Search section selected and visible
|
|
51
51
|
*/
|
|
@@ -8,7 +8,7 @@ export declare const QUICK_SEARCH_RUN = "QUICK_SEARCH_RUN";
|
|
|
8
8
|
/**
|
|
9
9
|
* @ReduxAction Sets Quick Search style
|
|
10
10
|
*/
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const QUICK_SEARCH_SET_CELL_MATCHING_STYLE = "QUICK_SEARCH_SET_CELL_MATCHING_STYLE";
|
|
12
12
|
/**
|
|
13
13
|
* @ReduxAction Quick Search Module is ready
|
|
14
14
|
*/
|
|
@@ -16,13 +16,13 @@ export declare const QUICK_SEARCH_READY = "QUICK_SEARCH_READY";
|
|
|
16
16
|
export interface QuickSearchRunAction extends Redux.Action {
|
|
17
17
|
quickSearchText: string;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
20
|
-
|
|
19
|
+
export interface QuickSearchSetMatchingCellStyleAction extends Redux.Action {
|
|
20
|
+
matchingCellStyle: AdaptableStyle;
|
|
21
21
|
}
|
|
22
22
|
export interface QuickSearchReadyAction extends Redux.Action {
|
|
23
23
|
quickSearchState: QuickSearchState;
|
|
24
24
|
}
|
|
25
25
|
export declare const QuickSearchRun: (quickSearchText: string) => QuickSearchRunAction;
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const QuickSearchSetCellMatchingStyle: (matchingCellStyle: AdaptableStyle) => QuickSearchSetMatchingCellStyleAction;
|
|
27
27
|
export declare const QuickSearchReady: (quickSearchState: QuickSearchState) => QuickSearchReadyAction;
|
|
28
28
|
export declare const QuickSearchReducer: Redux.Reducer<QuickSearchState>;
|
|
@@ -7,7 +7,7 @@ export const QUICK_SEARCH_RUN = 'QUICK_SEARCH_RUN';
|
|
|
7
7
|
/**
|
|
8
8
|
* @ReduxAction Sets Quick Search style
|
|
9
9
|
*/
|
|
10
|
-
export const
|
|
10
|
+
export const QUICK_SEARCH_SET_CELL_MATCHING_STYLE = 'QUICK_SEARCH_SET_CELL_MATCHING_STYLE';
|
|
11
11
|
/**
|
|
12
12
|
* @ReduxAction Quick Search Module is ready
|
|
13
13
|
*/
|
|
@@ -16,9 +16,9 @@ export const QuickSearchRun = (quickSearchText) => ({
|
|
|
16
16
|
type: QUICK_SEARCH_RUN,
|
|
17
17
|
quickSearchText,
|
|
18
18
|
});
|
|
19
|
-
export const
|
|
20
|
-
type:
|
|
21
|
-
|
|
19
|
+
export const QuickSearchSetCellMatchingStyle = (matchingCellStyle) => ({
|
|
20
|
+
type: QUICK_SEARCH_SET_CELL_MATCHING_STYLE,
|
|
21
|
+
matchingCellStyle: matchingCellStyle,
|
|
22
22
|
});
|
|
23
23
|
export const QuickSearchReady = (quickSearchState) => ({
|
|
24
24
|
type: QUICK_SEARCH_READY,
|
|
@@ -26,7 +26,7 @@ export const QuickSearchReady = (quickSearchState) => ({
|
|
|
26
26
|
});
|
|
27
27
|
const initialState = {
|
|
28
28
|
QuickSearchText: EMPTY_STRING,
|
|
29
|
-
|
|
29
|
+
CellMatchStyle: {
|
|
30
30
|
BackColor: QUICK_SEARCH_DEFAULT_BACK_COLOR,
|
|
31
31
|
ForeColor: QUICK_SEARCH_DEFAULT_FORE_COLOR,
|
|
32
32
|
},
|
|
@@ -37,9 +37,9 @@ export const QuickSearchReducer = (state = initialState, action) => {
|
|
|
37
37
|
return Object.assign({}, state, {
|
|
38
38
|
QuickSearchText: action.quickSearchText,
|
|
39
39
|
});
|
|
40
|
-
case
|
|
40
|
+
case QUICK_SEARCH_SET_CELL_MATCHING_STYLE:
|
|
41
41
|
return Object.assign({}, state, {
|
|
42
|
-
|
|
42
|
+
CellMatchStyle: action.matchingCellStyle,
|
|
43
43
|
});
|
|
44
44
|
default:
|
|
45
45
|
return state;
|
|
@@ -466,7 +466,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
466
466
|
* Use Case: We have updated an AdapTable Module that affects rendering
|
|
467
467
|
* Action: We set up all columns again
|
|
468
468
|
*/
|
|
469
|
-
case QuickSearchRedux.
|
|
469
|
+
case QuickSearchRedux.QUICK_SEARCH_SET_CELL_MATCHING_STYLE:
|
|
470
470
|
case FormatColumnRedux.FORMAT_COLUMN_ADD:
|
|
471
471
|
case FormatColumnRedux.FORMAT_COLUMN_EDIT:
|
|
472
472
|
case FormatColumnRedux.FORMAT_COLUMN_DELETE:
|
|
@@ -8,6 +8,7 @@ export interface StyleComponentProps extends React.ClassAttributes<StyleComponen
|
|
|
8
8
|
api: AdaptableApi;
|
|
9
9
|
headless?: boolean;
|
|
10
10
|
hidePreview?: boolean;
|
|
11
|
+
headerText?: string;
|
|
11
12
|
Style: AdaptableStyle;
|
|
12
13
|
showFontSizeAs?: 'radio' | 'dropdown';
|
|
13
14
|
UpdateStyle: (style: AdaptableStyle) => void;
|
|
@@ -44,10 +44,11 @@ export class StyleComponent extends React.Component {
|
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
46
|
const Cmp = this.props.headless ? Box : Panel;
|
|
47
|
+
const headerText = this.props.headerText ?? 'Style';
|
|
47
48
|
const cmpProps = this.props.headless
|
|
48
49
|
? {}
|
|
49
50
|
: {
|
|
50
|
-
header:
|
|
51
|
+
header: headerText,
|
|
51
52
|
margin: 2,
|
|
52
53
|
'data-name': 'style-component',
|
|
53
54
|
};
|
|
@@ -22,6 +22,7 @@ import { ReorderDraggable } from '../../../Components/ReorderDraggable';
|
|
|
22
22
|
import { AdaptableFormControlTextClear } from '../../../Components/Forms/AdaptableFormControlTextClear';
|
|
23
23
|
import { sortColumnIdsByOrder } from '../../../../layout-manager/src/sortColumnIdsByOrder';
|
|
24
24
|
import HelpBlock from '../../../../components/HelpBlock';
|
|
25
|
+
import { AG_GRID_SELECTION_COLUMN } from '../../../../Utilities/Constants/GeneralConstants';
|
|
25
26
|
const PropertyOrderText = (props) => (React.createElement(Text, { fontWeight: 600, fontSize: 2 }, props.children));
|
|
26
27
|
const columnTypes = {
|
|
27
28
|
default: {
|
|
@@ -195,6 +196,7 @@ export const ColumnsSection = (props) => {
|
|
|
195
196
|
const adaptable = useAdaptable();
|
|
196
197
|
const { data: layout } = useOnePageAdaptableWizardContext();
|
|
197
198
|
const [searchInputValue, setSearchInputValue] = React.useState('');
|
|
199
|
+
let hasSelectionColumn = false;
|
|
198
200
|
const allColumns = adaptable.api.columnApi
|
|
199
201
|
.getUIAvailableColumns()
|
|
200
202
|
.filter((col) => {
|
|
@@ -204,7 +206,23 @@ export const ColumnsSection = (props) => {
|
|
|
204
206
|
return !col.isGeneratedRowGroupColumn;
|
|
205
207
|
})
|
|
206
208
|
// if the current Layout is a PivotLayout, then we also filter out current Pivot Result Columns
|
|
207
|
-
.filter((col) => !col.isGeneratedPivotResultColumn)
|
|
209
|
+
.filter((col) => !col.isGeneratedPivotResultColumn)
|
|
210
|
+
// also we need to filter out selection column
|
|
211
|
+
.filter((col) => {
|
|
212
|
+
const result = !col.isGeneratedSelectionColumn;
|
|
213
|
+
if (!result) {
|
|
214
|
+
hasSelectionColumn = true;
|
|
215
|
+
}
|
|
216
|
+
return result;
|
|
217
|
+
});
|
|
218
|
+
const onChange = (data) => {
|
|
219
|
+
if (hasSelectionColumn &&
|
|
220
|
+
Array.isArray(data.TableColumns) &&
|
|
221
|
+
!data.TableColumns.includes(AG_GRID_SELECTION_COLUMN)) {
|
|
222
|
+
data.TableColumns.unshift(AG_GRID_SELECTION_COLUMN);
|
|
223
|
+
}
|
|
224
|
+
props.onChange(data);
|
|
225
|
+
};
|
|
208
226
|
// however, changes in RowGroupedColumns done in the previous step
|
|
209
227
|
// are reflected into the layout, so we use the latest layout.RowGroupedColumns
|
|
210
228
|
// to create new columns
|
|
@@ -261,7 +279,7 @@ export const ColumnsSection = (props) => {
|
|
|
261
279
|
ColumnVisibility[colId] = false;
|
|
262
280
|
}
|
|
263
281
|
});
|
|
264
|
-
|
|
282
|
+
onChange({
|
|
265
283
|
...layout,
|
|
266
284
|
TableColumns: columnIds,
|
|
267
285
|
ColumnVisibility,
|
|
@@ -300,14 +318,14 @@ export const ColumnsSection = (props) => {
|
|
|
300
318
|
return shouldInclude;
|
|
301
319
|
});
|
|
302
320
|
}
|
|
303
|
-
|
|
321
|
+
onChange({
|
|
304
322
|
...layout,
|
|
305
323
|
TableColumns: TableColumns,
|
|
306
324
|
ColumnVisibility,
|
|
307
325
|
});
|
|
308
326
|
};
|
|
309
327
|
const handlePinChange = (columnId, pinning) => {
|
|
310
|
-
|
|
328
|
+
onChange({
|
|
311
329
|
...layout,
|
|
312
330
|
ColumnPinning: {
|
|
313
331
|
...layout.ColumnPinning,
|
|
@@ -316,7 +334,7 @@ export const ColumnsSection = (props) => {
|
|
|
316
334
|
});
|
|
317
335
|
};
|
|
318
336
|
const handleColumnNameChange = (columnId, headerName) => {
|
|
319
|
-
|
|
337
|
+
onChange({
|
|
320
338
|
...layout,
|
|
321
339
|
ColumnHeaders: {
|
|
322
340
|
...layout.ColumnHeaders,
|
|
@@ -325,7 +343,7 @@ export const ColumnsSection = (props) => {
|
|
|
325
343
|
});
|
|
326
344
|
};
|
|
327
345
|
const handleColumnWidthChange = (columnId, width) => {
|
|
328
|
-
|
|
346
|
+
onChange({
|
|
329
347
|
...layout,
|
|
330
348
|
ColumnWidths: {
|
|
331
349
|
...layout.ColumnWidths,
|
|
@@ -334,7 +352,8 @@ export const ColumnsSection = (props) => {
|
|
|
334
352
|
});
|
|
335
353
|
};
|
|
336
354
|
const visibleIds = layout.TableColumns.filter((colId) => {
|
|
337
|
-
return layout.ColumnVisibility?.[colId] !== false
|
|
355
|
+
return (layout.ColumnVisibility?.[colId] !== false &&
|
|
356
|
+
adaptable.api.columnApi.isSelectionColumn(colId) === false);
|
|
338
357
|
});
|
|
339
358
|
const toLabel = (colId) => adaptable.api.columnApi.getFriendlyNameForColumnId(colId, layout);
|
|
340
359
|
const toIdentifier = (colId) => colId;
|
|
@@ -373,7 +392,7 @@ export const ColumnsSection = (props) => {
|
|
|
373
392
|
noSelectionLabel: `No Columns Selected`,
|
|
374
393
|
onChange: handleColumnsChange,
|
|
375
394
|
onSelectAll: () => {
|
|
376
|
-
|
|
395
|
+
onChange({
|
|
377
396
|
...layout,
|
|
378
397
|
ColumnVisibility: {},
|
|
379
398
|
TableColumns: ColumnOrderAllColumns.map((col) => col.columnId),
|
|
@@ -39,8 +39,8 @@ export const RowGroupBehaviorSection = (props) => {
|
|
|
39
39
|
}
|
|
40
40
|
onChange(newLayout);
|
|
41
41
|
} },
|
|
42
|
-
React.createElement(TypeRadio, { value: "always-collapsed", text: "All Collapsed", description: "
|
|
43
|
-
React.createElement(TypeRadio, { value: "always-expanded", text: "All Expanded", description: "
|
|
42
|
+
React.createElement(TypeRadio, { value: "always-collapsed", text: "All Collapsed", description: "Layout opens with all Grouped Rows always collapsed" }),
|
|
43
|
+
React.createElement(TypeRadio, { value: "always-expanded", text: "All Expanded", description: "Layout opens with all Grouped Rows always expanded" }),
|
|
44
44
|
React.createElement(TypeRadio, { value: "expanded", text: "Mostly Expanded", description: "Layout opens with all Grouped rows expanded, other than those collapsed when Layout last displayed" }),
|
|
45
45
|
React.createElement(TypeRadio, { value: "collapsed", text: "Mostly Collapsed", description: "Layout opens with all Grouped rows collapsed, other than those expanded when Layout last displayed" }))));
|
|
46
46
|
};
|
|
@@ -6,7 +6,7 @@ interface QuickSearchPopupProps extends ModuleViewPopupProps<any> {
|
|
|
6
6
|
QuickSearchText: string;
|
|
7
7
|
QuickSearchStyle: AdaptableStyle;
|
|
8
8
|
onRunQuickSearch: (quickSearchText: string) => QuickSearchRedux.QuickSearchRunAction;
|
|
9
|
-
|
|
9
|
+
onSetMatchingCellStyle: (style: AdaptableStyle) => QuickSearchRedux.QuickSearchSetMatchingCellStyleAction;
|
|
10
10
|
}
|
|
11
11
|
export declare const QuickSearchPopup: import("react-redux").ConnectedComponent<(props: QuickSearchPopupProps) => React.JSX.Element, {
|
|
12
12
|
[x: string]: any;
|
|
@@ -11,6 +11,7 @@ import { CheckBox } from '../../components/CheckBox';
|
|
|
11
11
|
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
12
12
|
import { useQuickSearchDebounced } from './useQuickSearchDebounced';
|
|
13
13
|
import { QuickSearchInput } from './QuickSearchInput';
|
|
14
|
+
import HelpBlock from '../../components/HelpBlock';
|
|
14
15
|
const QuickSearchPopupComponent = (props) => {
|
|
15
16
|
const [searchText, search] = useQuickSearchDebounced(props);
|
|
16
17
|
const [state, setState] = useState({
|
|
@@ -19,7 +20,7 @@ const QuickSearchPopupComponent = (props) => {
|
|
|
19
20
|
});
|
|
20
21
|
const onUpdateStyle = (style) => {
|
|
21
22
|
setState({ ...state, EditedStyle: style });
|
|
22
|
-
props.
|
|
23
|
+
props.onSetMatchingCellStyle(style);
|
|
23
24
|
};
|
|
24
25
|
const onQuickSearchBehaviourChange = (checked) => {
|
|
25
26
|
setState({ ...state, RunQueryAfterQuickSearch: checked });
|
|
@@ -33,21 +34,23 @@ const QuickSearchPopupComponent = (props) => {
|
|
|
33
34
|
React.createElement(Panel, { header: props.api.internalApi.getCorrectEnglishVariant('Behaviour'), style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginLeft: 2, marginRight: 2 },
|
|
34
35
|
' ',
|
|
35
36
|
React.createElement(Flex, { flexDirection: "column" },
|
|
37
|
+
React.createElement(HelpBlock, { fontSize: 2, marginTop: 2, marginBottom: 2 }, "Filters the Grid to only show rows with matching cells; use with care as can cause performance issues"),
|
|
38
|
+
' ',
|
|
36
39
|
React.createElement(FormLayout, { columns: [1, 2] },
|
|
37
40
|
React.createElement(FormRow, null,
|
|
38
41
|
React.createElement(CheckBox, { "data-name": "filter-quick-search-results", value: "existing", marginLeft: 1, marginRight: 3, checked: state.RunQueryAfterQuickSearch, disabled: StringExtensions.IsNotNullOrEmpty(searchText), onChange: onQuickSearchBehaviourChange }, "Filter using Quick Search Results"))))),
|
|
39
|
-
React.createElement(StyleComponent, { style: { height: '100%' }, api: props.api, Style: props.QuickSearchStyle, UpdateStyle: onUpdateStyle })));
|
|
42
|
+
React.createElement(StyleComponent, { style: { height: '100%' }, headerText: 'Cell Matching Style', api: props.api, Style: props.QuickSearchStyle, UpdateStyle: onUpdateStyle })));
|
|
40
43
|
};
|
|
41
44
|
function mapStateToProps(state, ownProps) {
|
|
42
45
|
return {
|
|
43
46
|
QuickSearchText: state.QuickSearch.QuickSearchText,
|
|
44
|
-
QuickSearchStyle: state.QuickSearch.
|
|
47
|
+
QuickSearchStyle: state.QuickSearch.CellMatchStyle,
|
|
45
48
|
};
|
|
46
49
|
}
|
|
47
50
|
function mapDispatchToProps(dispatch) {
|
|
48
51
|
return {
|
|
49
52
|
onRunQuickSearch: (quickSearchText) => dispatch(QuickSearchRedux.QuickSearchRun(quickSearchText)),
|
|
50
|
-
|
|
53
|
+
onSetMatchingCellStyle: (style) => dispatch(QuickSearchRedux.QuickSearchSetCellMatchingStyle(style)),
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
export const QuickSearchPopup = connect(mapStateToProps, mapDispatchToProps)(QuickSearchPopupComponent);
|