@adaptabletools/adaptable-cjs 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 +80 -41
- 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 +12 -12
- 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 +19 -8
- 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.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.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;
|
|
@@ -183,7 +183,7 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
183
183
|
return true;
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
async exportReport(reportName, format, destination = 'Download',
|
|
186
|
+
async exportReport(reportName, format, destination = 'Download', exportConfig) {
|
|
187
187
|
let report = this.getReportByName(reportName);
|
|
188
188
|
if (!this.checkItemExists(report, reportName, 'Report')) {
|
|
189
189
|
return;
|
|
@@ -201,8 +201,8 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
201
201
|
report,
|
|
202
202
|
format,
|
|
203
203
|
destination,
|
|
204
|
-
showProgressIndicator:
|
|
205
|
-
customExportParams:
|
|
204
|
+
showProgressIndicator: exportConfig?.showProgressIndicator === false ? false : true,
|
|
205
|
+
customExportParams: exportConfig?.exportParams,
|
|
206
206
|
});
|
|
207
207
|
if (!exportedReport) {
|
|
208
208
|
// 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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPivotLayout = exports.pivotLayoutModelToPivotLayout = exports.tableLayoutModelToTableLayout = exports.pivotLayoutToPivotLayoutModel = exports.tableLayoutToTableLayoutModel = exports.checkForDuplicateColumns = exports.normalizePivotLayout = exports.normalizeTableLayout = exports.normalizeLayout = exports.areLayoutsEqual = exports.layoutModelToLayoutState = exports.layoutStateToLayoutModel = void 0;
|
|
3
|
+
exports.isPivotLayout = exports.pivotLayoutModelToPivotLayout = exports.tableLayoutModelToTableLayout = exports.pivotLayoutToPivotLayoutModel = exports.tableLayoutToTableLayoutModel = exports.checkForDuplicateColumns = exports.toRowGroupValuesForLayoutModel = exports.toRowGroupValuesForLayoutState = exports.getLayoutRowGroupValuesExceptionGroupKeys = exports.normalizePivotLayout = exports.normalizeTableLayout = exports.normalizeLayout = exports.areLayoutsEqual = exports.layoutModelToLayoutState = exports.layoutStateToLayoutModel = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
6
6
|
const isPivotLayoutModel_1 = require("../../layout-manager/src/isPivotLayoutModel");
|
|
@@ -74,6 +74,81 @@ const errorOnce = (message) => {
|
|
|
74
74
|
console.error(message);
|
|
75
75
|
errorOnceMessages.set(message, true);
|
|
76
76
|
};
|
|
77
|
+
const getLayoutRowGroupValuesExceptionGroupKeys = (layout) => {
|
|
78
|
+
if (!layout.RowGroupValues) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
if (layout.RowGroupValues?.RowGroupDefaultBehavior === 'always-collapsed') {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
if (layout.RowGroupValues?.RowGroupDefaultBehavior === 'always-expanded') {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
if (Array.isArray(layout.RowGroupValues?.GroupKeys)) {
|
|
88
|
+
const currentGroupedColumns = (layout.RowGroupedColumns || []).join(',');
|
|
89
|
+
const matchingGroupKeys = layout.RowGroupValues.GroupKeys.find(({ RowGroupedColumns }) => {
|
|
90
|
+
return RowGroupedColumns.join(',') === currentGroupedColumns;
|
|
91
|
+
});
|
|
92
|
+
if (matchingGroupKeys) {
|
|
93
|
+
return matchingGroupKeys.ExceptionGroupKeys;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return layout.RowGroupValues.ExceptionGroupKeys || [];
|
|
97
|
+
};
|
|
98
|
+
exports.getLayoutRowGroupValuesExceptionGroupKeys = getLayoutRowGroupValuesExceptionGroupKeys;
|
|
99
|
+
const toRowGroupValuesForLayoutState = (rowGroupValuesModel) => {
|
|
100
|
+
if (!rowGroupValuesModel) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
const rowGroupValuesState = {
|
|
104
|
+
RowGroupDefaultBehavior: rowGroupValuesModel.RowGroupDisplay,
|
|
105
|
+
};
|
|
106
|
+
if (rowGroupValuesModel.RowGroupDisplay === 'collapsed' ||
|
|
107
|
+
rowGroupValuesModel.RowGroupDisplay === 'expanded') {
|
|
108
|
+
if (rowGroupValuesModel.GroupKeys) {
|
|
109
|
+
rowGroupValuesState.GroupKeys =
|
|
110
|
+
rowGroupValuesModel.GroupKeys.map(({ RowGroupedColumns, Values }) => {
|
|
111
|
+
return {
|
|
112
|
+
RowGroupedColumns,
|
|
113
|
+
ExceptionGroupKeys: Values,
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
rowGroupValuesState.ExceptionGroupKeys =
|
|
119
|
+
rowGroupValuesModel.Values;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return rowGroupValuesState;
|
|
123
|
+
};
|
|
124
|
+
exports.toRowGroupValuesForLayoutState = toRowGroupValuesForLayoutState;
|
|
125
|
+
const toRowGroupValuesForLayoutModel = (rowGroupValuesState) => {
|
|
126
|
+
if (!rowGroupValuesState) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
if (rowGroupValuesState.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
130
|
+
rowGroupValuesState.RowGroupDefaultBehavior === 'always-expanded') {
|
|
131
|
+
return {
|
|
132
|
+
RowGroupDisplay: rowGroupValuesState.RowGroupDefaultBehavior,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
if (rowGroupValuesState.GroupKeys) {
|
|
136
|
+
return {
|
|
137
|
+
RowGroupDisplay: rowGroupValuesState.RowGroupDefaultBehavior,
|
|
138
|
+
GroupKeys: rowGroupValuesState.GroupKeys.map(({ RowGroupedColumns, ExceptionGroupKeys }) => {
|
|
139
|
+
return {
|
|
140
|
+
RowGroupedColumns,
|
|
141
|
+
Values: ExceptionGroupKeys,
|
|
142
|
+
};
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
RowGroupDisplay: rowGroupValuesState.RowGroupDefaultBehavior,
|
|
148
|
+
Values: rowGroupValuesState.ExceptionGroupKeys || [],
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
exports.toRowGroupValuesForLayoutModel = toRowGroupValuesForLayoutModel;
|
|
77
152
|
const checkForDuplicateColumns = (layout) => {
|
|
78
153
|
if (layout.TableColumns) {
|
|
79
154
|
const set = new Set(layout.TableColumns);
|
|
@@ -108,17 +183,7 @@ const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
108
183
|
ColumnSorts: tableLayout.ColumnSorts,
|
|
109
184
|
RowGroupedColumns: tableLayout.RowGroupedColumns,
|
|
110
185
|
ColumnPinning: tableLayout.ColumnPinning,
|
|
111
|
-
RowGroupValues: tableLayout.RowGroupValues
|
|
112
|
-
? tableLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
113
|
-
tableLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-expanded'
|
|
114
|
-
? {
|
|
115
|
-
RowGroupDisplay: tableLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
116
|
-
}
|
|
117
|
-
: {
|
|
118
|
-
RowGroupDisplay: tableLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
119
|
-
Values: tableLayout.RowGroupValues.ExceptionGroupKeys || [],
|
|
120
|
-
}
|
|
121
|
-
: undefined,
|
|
186
|
+
RowGroupValues: (0, exports.toRowGroupValuesForLayoutModel)(tableLayout.RowGroupValues),
|
|
122
187
|
ColumnGroupValues: tableLayout.ColumnGroupValues
|
|
123
188
|
? tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
|
|
124
189
|
tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
|
|
@@ -192,17 +257,7 @@ const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
192
257
|
GrandTotalRow: pivotLayout.GrandTotalRow,
|
|
193
258
|
PivotGrandTotal: pivotLayout.PivotGrandTotal,
|
|
194
259
|
PivotColumnTotal: pivotLayout.PivotColumnTotal,
|
|
195
|
-
RowGroupValues: pivotLayout.RowGroupValues
|
|
196
|
-
? pivotLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
197
|
-
pivotLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-expanded'
|
|
198
|
-
? {
|
|
199
|
-
RowGroupDisplay: pivotLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
200
|
-
}
|
|
201
|
-
: {
|
|
202
|
-
RowGroupDisplay: pivotLayout.RowGroupValues.RowGroupDefaultBehavior,
|
|
203
|
-
Values: pivotLayout.RowGroupValues.ExceptionGroupKeys || [],
|
|
204
|
-
}
|
|
205
|
-
: undefined,
|
|
260
|
+
RowGroupValues: (0, exports.toRowGroupValuesForLayoutModel)(pivotLayout.RowGroupValues),
|
|
206
261
|
ColumnGroupValues: pivotLayout.ColumnGroupValues
|
|
207
262
|
? pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
|
|
208
263
|
pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
|
|
@@ -308,15 +363,7 @@ const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
|
308
363
|
delete tableLayout.ColumnPinning;
|
|
309
364
|
}
|
|
310
365
|
if (layoutModel.RowGroupValues) {
|
|
311
|
-
tableLayout.RowGroupValues =
|
|
312
|
-
RowGroupDefaultBehavior: layoutModel.RowGroupValues.RowGroupDisplay,
|
|
313
|
-
};
|
|
314
|
-
if ((layoutModel.RowGroupValues.RowGroupDisplay === 'collapsed' ||
|
|
315
|
-
layoutModel.RowGroupValues.RowGroupDisplay === 'expanded') &&
|
|
316
|
-
layoutModel.RowGroupValues.Values) {
|
|
317
|
-
// @ts-ignore
|
|
318
|
-
tableLayout.RowGroupValues.ExceptionGroupKeys = layoutModel.RowGroupValues.Values;
|
|
319
|
-
}
|
|
366
|
+
tableLayout.RowGroupValues = (0, exports.toRowGroupValuesForLayoutState)(layoutModel.RowGroupValues);
|
|
320
367
|
}
|
|
321
368
|
else {
|
|
322
369
|
delete tableLayout.RowGroupValues;
|
|
@@ -411,15 +458,7 @@ const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
|
411
458
|
delete pivotLayout.PivotGroupedColumns;
|
|
412
459
|
}
|
|
413
460
|
if (layoutModel.RowGroupValues) {
|
|
414
|
-
pivotLayout.RowGroupValues =
|
|
415
|
-
RowGroupDefaultBehavior: layoutModel.RowGroupValues.RowGroupDisplay,
|
|
416
|
-
};
|
|
417
|
-
if ((layoutModel.RowGroupValues.RowGroupDisplay === 'collapsed' ||
|
|
418
|
-
layoutModel.RowGroupValues.RowGroupDisplay === 'expanded') &&
|
|
419
|
-
layoutModel.RowGroupValues.Values) {
|
|
420
|
-
// @ts-ignore
|
|
421
|
-
pivotLayout.RowGroupValues.ExceptionGroupKeys = layoutModel.RowGroupValues.Values;
|
|
422
|
-
}
|
|
461
|
+
pivotLayout.RowGroupValues = (0, exports.toRowGroupValuesForLayoutState)(layoutModel.RowGroupValues);
|
|
423
462
|
}
|
|
424
463
|
else {
|
|
425
464
|
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;
|
|
@@ -25,8 +25,8 @@ class QuickSearchApiImpl extends ApiBase_1.ApiBase {
|
|
|
25
25
|
getQuickSearchValue() {
|
|
26
26
|
return this.getQuickSearchState().QuickSearchText;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
return this.getQuickSearchState().
|
|
28
|
+
getQuickSearchCellMatchStyle() {
|
|
29
|
+
return this.getQuickSearchState().CellMatchStyle;
|
|
30
30
|
}
|
|
31
31
|
getQuickSearchTextMatchStyle() {
|
|
32
32
|
return this.getQuickSearchState().TextMatchStyle;
|
|
@@ -34,8 +34,8 @@ class QuickSearchApiImpl extends ApiBase_1.ApiBase {
|
|
|
34
34
|
getQuickSearchCurrentTextMatchStyle() {
|
|
35
35
|
return this.getQuickSearchState().CurrentTextMatchStyle;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
this.dispatchAction(QuickSearchRedux.
|
|
37
|
+
setQuickSearchCellMatchStyle(style) {
|
|
38
|
+
this.dispatchAction(QuickSearchRedux.QuickSearchSetCellMatchingStyle(style));
|
|
39
39
|
}
|
|
40
40
|
openQuickSearchSettingsPanel() {
|
|
41
41
|
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
|
*
|
|
@@ -176,7 +176,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
176
176
|
.predicateApi.internalApi.getFormatColumnPredicateDefs(scope)
|
|
177
177
|
.filter((predicateDef) => this.getColumnScopeApi().isScopeInScope(scope, predicateDef.columnScope));
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
formatColumnWithColumnGroupScopeShouldRender(formatColumn, column) {
|
|
180
180
|
if (!formatColumn.ColumnGroupScope) {
|
|
181
181
|
return true;
|
|
182
182
|
}
|
|
@@ -191,7 +191,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
191
191
|
if (!columnGroupParentForCurrentColumn) {
|
|
192
192
|
return false;
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const columnGroupScope = columnGroupParentForCurrentColumn.isExpanded()
|
|
195
195
|
? 'Expanded'
|
|
196
196
|
: 'Collapsed';
|
|
197
197
|
const columnGroupLeafColumns = columnGroupParentForCurrentColumn.getLeafColumns();
|
|
@@ -205,7 +205,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
205
205
|
if (formatColumn.ColumnGroupScope === 'Both') {
|
|
206
206
|
return true;
|
|
207
207
|
}
|
|
208
|
-
return formatColumn.ColumnGroupScope ===
|
|
208
|
+
return formatColumn.ColumnGroupScope === columnGroupScope;
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Checks if format column is relevant for a given cell (intersection of given AdaptableColumn and RowNode)
|
|
@@ -238,7 +238,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
if (formatColumn.ColumnGroupScope &&
|
|
241
|
-
!this.
|
|
241
|
+
!this.formatColumnWithColumnGroupScopeShouldRender(formatColumn, column)) {
|
|
242
242
|
return false;
|
|
243
243
|
}
|
|
244
244
|
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,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuickSearchReducer = exports.QuickSearchReady = exports.
|
|
3
|
+
exports.QuickSearchReducer = exports.QuickSearchReady = exports.QuickSearchSetCellMatchingStyle = exports.QuickSearchRun = exports.QUICK_SEARCH_READY = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE = exports.QUICK_SEARCH_RUN = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = void 0;
|
|
4
4
|
const ReduxConstants_1 = require("../../Utilities/Constants/ReduxConstants");
|
|
5
5
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
6
|
+
exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = {
|
|
7
|
+
BackColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_BACK_COLOR,
|
|
8
|
+
ForeColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_FORE_COLOR,
|
|
9
|
+
};
|
|
6
10
|
/**
|
|
7
11
|
* @ReduxAction Runs Quick Search
|
|
8
12
|
*/
|
|
@@ -10,7 +14,7 @@ exports.QUICK_SEARCH_RUN = 'QUICK_SEARCH_RUN';
|
|
|
10
14
|
/**
|
|
11
15
|
* @ReduxAction Sets Quick Search style
|
|
12
16
|
*/
|
|
13
|
-
exports.
|
|
17
|
+
exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE = 'QUICK_SEARCH_SET_CELL_MATCHING_STYLE';
|
|
14
18
|
/**
|
|
15
19
|
* @ReduxAction Quick Search Module is ready
|
|
16
20
|
*/
|
|
@@ -20,11 +24,11 @@ const QuickSearchRun = (quickSearchText) => ({
|
|
|
20
24
|
quickSearchText,
|
|
21
25
|
});
|
|
22
26
|
exports.QuickSearchRun = QuickSearchRun;
|
|
23
|
-
const
|
|
24
|
-
type: exports.
|
|
25
|
-
|
|
27
|
+
const QuickSearchSetCellMatchingStyle = (matchingCellStyle) => ({
|
|
28
|
+
type: exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE,
|
|
29
|
+
matchingCellStyle: matchingCellStyle,
|
|
26
30
|
});
|
|
27
|
-
exports.
|
|
31
|
+
exports.QuickSearchSetCellMatchingStyle = QuickSearchSetCellMatchingStyle;
|
|
28
32
|
const QuickSearchReady = (quickSearchState) => ({
|
|
29
33
|
type: exports.QUICK_SEARCH_READY,
|
|
30
34
|
quickSearchState,
|
|
@@ -32,10 +36,6 @@ const QuickSearchReady = (quickSearchState) => ({
|
|
|
32
36
|
exports.QuickSearchReady = QuickSearchReady;
|
|
33
37
|
const initialState = {
|
|
34
38
|
QuickSearchText: GeneralConstants_1.EMPTY_STRING,
|
|
35
|
-
Style: {
|
|
36
|
-
BackColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_BACK_COLOR,
|
|
37
|
-
ForeColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_FORE_COLOR,
|
|
38
|
-
},
|
|
39
39
|
};
|
|
40
40
|
const QuickSearchReducer = (state = initialState, action) => {
|
|
41
41
|
switch (action.type) {
|
|
@@ -43,9 +43,9 @@ const QuickSearchReducer = (state = initialState, action) => {
|
|
|
43
43
|
return Object.assign({}, state, {
|
|
44
44
|
QuickSearchText: action.quickSearchText,
|
|
45
45
|
});
|
|
46
|
-
case exports.
|
|
46
|
+
case exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE:
|
|
47
47
|
return Object.assign({}, state, {
|
|
48
|
-
|
|
48
|
+
CellMatchStyle: action.matchingCellStyle,
|
|
49
49
|
});
|
|
50
50
|
default:
|
|
51
51
|
return state;
|
|
@@ -473,7 +473,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
473
473
|
* Use Case: We have updated an AdapTable Module that affects rendering
|
|
474
474
|
* Action: We set up all columns again
|
|
475
475
|
*/
|
|
476
|
-
case QuickSearchRedux.
|
|
476
|
+
case QuickSearchRedux.QUICK_SEARCH_SET_CELL_MATCHING_STYLE:
|
|
477
477
|
case FormatColumnRedux.FORMAT_COLUMN_ADD:
|
|
478
478
|
case FormatColumnRedux.FORMAT_COLUMN_EDIT:
|
|
479
479
|
case FormatColumnRedux.FORMAT_COLUMN_DELETE:
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
7
|
const QuickSearchStatusBarContent_1 = require("../View/QuickSearch/QuickSearchStatusBarContent");
|
|
8
|
+
const QuickSearchRedux_1 = require("../Redux/ActionsReducers/QuickSearchRedux");
|
|
8
9
|
class QuickSearchModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
9
10
|
constructor(api) {
|
|
10
11
|
super(ModuleConstants.QuickSearchModuleId, ModuleConstants.QuickSearchFriendlyName, 'search-table', 'QuickSearchPopup', 'Quickly highlight all cells in the grid that contain matching query text', api);
|
|
@@ -18,5 +19,18 @@ class QuickSearchModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
18
19
|
},
|
|
19
20
|
};
|
|
20
21
|
}
|
|
22
|
+
onAdaptableReady() {
|
|
23
|
+
const { api } = this;
|
|
24
|
+
const { internalApi, agGridApi } = api;
|
|
25
|
+
const isServerSideRowModel = agGridApi.getGridOption('rowModelType') === 'serverSide';
|
|
26
|
+
if (isServerSideRowModel &&
|
|
27
|
+
internalApi.getAdaptableState().QuickSearch.CellMatchStyle === undefined) {
|
|
28
|
+
// for server side row model,
|
|
29
|
+
// let's setup some defaults if there are no styles set
|
|
30
|
+
// as there are no defaults in the AG Grid find functionality (as it only works for non ssrm)
|
|
31
|
+
// so we need to set the defaults here
|
|
32
|
+
this.api.internalApi.dispatchReduxAction((0, QuickSearchRedux_1.QuickSearchSetCellMatchingStyle)(QuickSearchRedux_1.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
21
35
|
}
|
|
22
36
|
exports.QuickSearchModule = QuickSearchModule;
|
|
@@ -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;
|
|
@@ -48,10 +48,11 @@ class StyleComponent extends React.Component {
|
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
50
|
const Cmp = this.props.headless ? rebass_1.Box : Panel_1.default;
|
|
51
|
+
const headerText = this.props.headerText ?? 'Style';
|
|
51
52
|
const cmpProps = this.props.headless
|
|
52
53
|
? {}
|
|
53
54
|
: {
|
|
54
|
-
header:
|
|
55
|
+
header: headerText,
|
|
55
56
|
margin: 2,
|
|
56
57
|
'data-name': 'style-component',
|
|
57
58
|
};
|