@adaptabletools/adaptable 20.2.1 → 20.2.3
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/AdaptableOptions/ExportOptions.d.ts +16 -5
- 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/ExportApi.d.ts +4 -9
- package/src/Api/Implementation/ColumnApiImpl.js +1 -0
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -5
- package/src/Api/Implementation/ExportApiImpl.js +3 -3
- 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 +8 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +10 -10
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/Strategy/QuickSearchModule.d.ts +1 -0
- package/src/Strategy/QuickSearchModule.js +14 -0
- 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 +23 -9
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +2 -2
- 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.3",
|
|
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",
|
|
@@ -346,10 +346,21 @@ export interface DataFormatDataType {
|
|
|
346
346
|
date?: DataFormatType;
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
|
-
* Custom Export Parameters which extend AG Grid's base export parameters.
|
|
350
|
-
* Use
|
|
351
|
-
* - `ExcelExportParams` for Excel format exports
|
|
352
|
-
* - `CsvExportParams` for CSV, JSON and any custom format exports
|
|
353
|
-
* These parameters allow overriding AdapTable's default export behavior.
|
|
349
|
+
* Custom Export Parameters which extend AG Grid's base export parameters, allowing overriding of AdapTable's default export behaviour.
|
|
350
|
+
* Use `ExcelExportParams` for Excel format exports and `CsvExportParams` for CSV, JSON and any custom format exports
|
|
354
351
|
*/
|
|
355
352
|
export type CustomExportParams = ExcelExportParams | CsvExportParams;
|
|
353
|
+
/**
|
|
354
|
+
* Config used when Exporting via API, allows fine grained exporting
|
|
355
|
+
*/
|
|
356
|
+
export interface ExportConfig {
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
* Function to modify export params; receives default params & returns modified params
|
|
360
|
+
*/
|
|
361
|
+
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
362
|
+
/**
|
|
363
|
+
* Whether to show progress indicator
|
|
364
|
+
*/
|
|
365
|
+
showProgressIndicator?: boolean;
|
|
366
|
+
}
|
|
@@ -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
|
}
|
package/src/Api/ExportApi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdaptableForm } from '../AdaptableState/Common/AdaptableForm';
|
|
2
2
|
import { ExportState, Report, ReportFormatType, ReportNameType, SystemReportFormat, SystemReportName } from '../AdaptableState/ExportState';
|
|
3
|
-
import { CustomDestination, CustomExportParams, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../AdaptableOptions/ExportOptions';
|
|
3
|
+
import { CustomDestination, CustomExportParams, ExportConfig, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../AdaptableOptions/ExportOptions';
|
|
4
4
|
import { AdaptableColumn } from '../types';
|
|
5
5
|
/**
|
|
6
6
|
* Provides run-time access to the Export Module and Report state
|
|
@@ -143,14 +143,9 @@ export interface ExportApi {
|
|
|
143
143
|
* @param reportName - name of the report
|
|
144
144
|
* @param format - format of the report
|
|
145
145
|
* @param destination - destination to export to
|
|
146
|
-
* @param
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*/
|
|
150
|
-
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, config?: {
|
|
151
|
-
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
152
|
-
showProgressIndicator?: boolean;
|
|
153
|
-
}): Promise<void>;
|
|
146
|
+
* @param exportConfig - optional export configuration
|
|
147
|
+
*/
|
|
148
|
+
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, exportConfig?: ExportConfig): Promise<void>;
|
|
154
149
|
/**
|
|
155
150
|
* Gets the data for the Report with the given Name in the given Format
|
|
156
151
|
* @param reportName - name of the report
|
|
@@ -2,7 +2,7 @@ import { ExportApi } from '../ExportApi';
|
|
|
2
2
|
import { ExportState, Report, ReportFormatType, ReportNameType, SystemReportFormat, SystemReportName } from '../../AdaptableState/ExportState';
|
|
3
3
|
import { ApiBase } from './ApiBase';
|
|
4
4
|
import { AdaptableForm } from '../../AdaptableState/Common/AdaptableForm';
|
|
5
|
-
import { CustomDestination, CustomExportParams, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
|
|
5
|
+
import { CustomDestination, CustomExportParams, ExportConfig, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
|
|
6
6
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
7
7
|
import { ExportInternalApi } from '../Internal/ExportInternalApi';
|
|
8
8
|
import { AdaptableColumn } from '../../types';
|
|
@@ -37,10 +37,7 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
|
|
|
37
37
|
getCustomReports(): Report[];
|
|
38
38
|
isColumnExportable(adaptableColumn: AdaptableColumn): boolean;
|
|
39
39
|
getSupportedExportDestinations(reportFormat: ReportFormatType): ExportDestinationType[];
|
|
40
|
-
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType,
|
|
41
|
-
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
42
|
-
showProgressIndicator?: boolean;
|
|
43
|
-
}): Promise<void>;
|
|
40
|
+
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, exportConfig?: ExportConfig): Promise<void>;
|
|
44
41
|
getReportData(reportName: ReportNameType, format: ReportFormatType, config?: {
|
|
45
42
|
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
46
43
|
showProgressIndicator?: boolean;
|
|
@@ -179,7 +179,7 @@ export class ExportApiImpl extends ApiBase {
|
|
|
179
179
|
return true;
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
async exportReport(reportName, format, destination = 'Download',
|
|
182
|
+
async exportReport(reportName, format, destination = 'Download', exportConfig) {
|
|
183
183
|
let report = this.getReportByName(reportName);
|
|
184
184
|
if (!this.checkItemExists(report, reportName, 'Report')) {
|
|
185
185
|
return;
|
|
@@ -197,8 +197,8 @@ export class ExportApiImpl extends ApiBase {
|
|
|
197
197
|
report,
|
|
198
198
|
format,
|
|
199
199
|
destination,
|
|
200
|
-
showProgressIndicator:
|
|
201
|
-
customExportParams:
|
|
200
|
+
showProgressIndicator: exportConfig?.showProgressIndicator === false ? false : true,
|
|
201
|
+
customExportParams: exportConfig?.exportParams,
|
|
202
202
|
});
|
|
203
203
|
if (!exportedReport) {
|
|
204
204
|
// for destination 'Download' and format 'Excel', 'VisualExcel' or 'Csv', AG Grid handles the download as well
|
|
@@ -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
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as Redux from 'redux';
|
|
2
2
|
import { QuickSearchState } from '../../AdaptableState/QuickSearchState';
|
|
3
3
|
import { AdaptableStyle } from '../../AdaptableState/Common/AdaptableStyle';
|
|
4
|
+
export declare const QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT: {
|
|
5
|
+
BackColor: string;
|
|
6
|
+
ForeColor: string;
|
|
7
|
+
};
|
|
4
8
|
/**
|
|
5
9
|
* @ReduxAction Runs Quick Search
|
|
6
10
|
*/
|
|
@@ -8,7 +12,7 @@ export declare const QUICK_SEARCH_RUN = "QUICK_SEARCH_RUN";
|
|
|
8
12
|
/**
|
|
9
13
|
* @ReduxAction Sets Quick Search style
|
|
10
14
|
*/
|
|
11
|
-
export declare const
|
|
15
|
+
export declare const QUICK_SEARCH_SET_CELL_MATCHING_STYLE = "QUICK_SEARCH_SET_CELL_MATCHING_STYLE";
|
|
12
16
|
/**
|
|
13
17
|
* @ReduxAction Quick Search Module is ready
|
|
14
18
|
*/
|
|
@@ -16,13 +20,13 @@ export declare const QUICK_SEARCH_READY = "QUICK_SEARCH_READY";
|
|
|
16
20
|
export interface QuickSearchRunAction extends Redux.Action {
|
|
17
21
|
quickSearchText: string;
|
|
18
22
|
}
|
|
19
|
-
export interface
|
|
20
|
-
|
|
23
|
+
export interface QuickSearchSetMatchingCellStyleAction extends Redux.Action {
|
|
24
|
+
matchingCellStyle: AdaptableStyle;
|
|
21
25
|
}
|
|
22
26
|
export interface QuickSearchReadyAction extends Redux.Action {
|
|
23
27
|
quickSearchState: QuickSearchState;
|
|
24
28
|
}
|
|
25
29
|
export declare const QuickSearchRun: (quickSearchText: string) => QuickSearchRunAction;
|
|
26
|
-
export declare const
|
|
30
|
+
export declare const QuickSearchSetCellMatchingStyle: (matchingCellStyle: AdaptableStyle) => QuickSearchSetMatchingCellStyleAction;
|
|
27
31
|
export declare const QuickSearchReady: (quickSearchState: QuickSearchState) => QuickSearchReadyAction;
|
|
28
32
|
export declare const QuickSearchReducer: Redux.Reducer<QuickSearchState>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { QUICK_SEARCH_DEFAULT_BACK_COLOR, QUICK_SEARCH_DEFAULT_FORE_COLOR, } from '../../Utilities/Constants/ReduxConstants';
|
|
2
2
|
import { EMPTY_STRING } from '../../Utilities/Constants/GeneralConstants';
|
|
3
|
+
export const QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = {
|
|
4
|
+
BackColor: QUICK_SEARCH_DEFAULT_BACK_COLOR,
|
|
5
|
+
ForeColor: QUICK_SEARCH_DEFAULT_FORE_COLOR,
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* @ReduxAction Runs Quick Search
|
|
5
9
|
*/
|
|
@@ -7,7 +11,7 @@ export const QUICK_SEARCH_RUN = 'QUICK_SEARCH_RUN';
|
|
|
7
11
|
/**
|
|
8
12
|
* @ReduxAction Sets Quick Search style
|
|
9
13
|
*/
|
|
10
|
-
export const
|
|
14
|
+
export const QUICK_SEARCH_SET_CELL_MATCHING_STYLE = 'QUICK_SEARCH_SET_CELL_MATCHING_STYLE';
|
|
11
15
|
/**
|
|
12
16
|
* @ReduxAction Quick Search Module is ready
|
|
13
17
|
*/
|
|
@@ -16,9 +20,9 @@ export const QuickSearchRun = (quickSearchText) => ({
|
|
|
16
20
|
type: QUICK_SEARCH_RUN,
|
|
17
21
|
quickSearchText,
|
|
18
22
|
});
|
|
19
|
-
export const
|
|
20
|
-
type:
|
|
21
|
-
|
|
23
|
+
export const QuickSearchSetCellMatchingStyle = (matchingCellStyle) => ({
|
|
24
|
+
type: QUICK_SEARCH_SET_CELL_MATCHING_STYLE,
|
|
25
|
+
matchingCellStyle: matchingCellStyle,
|
|
22
26
|
});
|
|
23
27
|
export const QuickSearchReady = (quickSearchState) => ({
|
|
24
28
|
type: QUICK_SEARCH_READY,
|
|
@@ -26,10 +30,6 @@ export const QuickSearchReady = (quickSearchState) => ({
|
|
|
26
30
|
});
|
|
27
31
|
const initialState = {
|
|
28
32
|
QuickSearchText: EMPTY_STRING,
|
|
29
|
-
Style: {
|
|
30
|
-
BackColor: QUICK_SEARCH_DEFAULT_BACK_COLOR,
|
|
31
|
-
ForeColor: QUICK_SEARCH_DEFAULT_FORE_COLOR,
|
|
32
|
-
},
|
|
33
33
|
};
|
|
34
34
|
export const QuickSearchReducer = (state = initialState, action) => {
|
|
35
35
|
switch (action.type) {
|
|
@@ -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:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
2
2
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
3
3
|
import { QuickSearchStatusBarContent } from '../View/QuickSearch/QuickSearchStatusBarContent';
|
|
4
|
+
import { QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT, QuickSearchSetCellMatchingStyle, } from '../Redux/ActionsReducers/QuickSearchRedux';
|
|
4
5
|
export class QuickSearchModule extends AdaptableModuleBase {
|
|
5
6
|
constructor(api) {
|
|
6
7
|
super(ModuleConstants.QuickSearchModuleId, ModuleConstants.QuickSearchFriendlyName, 'search-table', 'QuickSearchPopup', 'Quickly highlight all cells in the grid that contain matching query text', api);
|
|
@@ -14,4 +15,17 @@ export class QuickSearchModule extends AdaptableModuleBase {
|
|
|
14
15
|
},
|
|
15
16
|
};
|
|
16
17
|
}
|
|
18
|
+
onAdaptableReady() {
|
|
19
|
+
const { api } = this;
|
|
20
|
+
const { internalApi, agGridApi } = api;
|
|
21
|
+
const isServerSideRowModel = agGridApi.getGridOption('rowModelType') === 'serverSide';
|
|
22
|
+
if (isServerSideRowModel &&
|
|
23
|
+
internalApi.getAdaptableState().QuickSearch.CellMatchStyle === undefined) {
|
|
24
|
+
// for server side row model,
|
|
25
|
+
// let's setup some defaults if there are no styles set
|
|
26
|
+
// as there are no defaults in the AG Grid find functionality (as it only works for non ssrm)
|
|
27
|
+
// so we need to set the defaults here
|
|
28
|
+
this.api.internalApi.dispatchReduxAction(QuickSearchSetCellMatchingStyle(QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
17
31
|
}
|
|
@@ -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
|
};
|