@adaptabletools/adaptable-cjs 18.0.0-canary.30 → 18.0.0-canary.31
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/ActionColumnOptions.d.ts +3 -2
- package/src/AdaptableOptions/CustomSortOptions.d.ts +2 -2
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +2 -2
- package/src/AdaptableOptions/PredicateOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/Api/FlashingCellApi.d.ts +2 -2
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ScopeApiImpl.d.ts +26 -26
- package/src/Api/Internal/AlertInternalApi.d.ts +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +18 -7
- package/src/Api/Internal/PredicateInternalApi.d.ts +6 -6
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +2 -2
- package/src/Api/Internal/StyledColumnInternalApi.js +3 -4
- package/src/Api/ScopeApi.d.ts +26 -26
- package/src/PredefinedConfig/AlertState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableObject.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +2 -2
- package/src/PredefinedConfig/Common/{AdaptableScope.d.ts → ColumnScope.d.ts} +1 -1
- package/src/PredefinedConfig/Common/RowScope.d.ts +17 -0
- package/src/PredefinedConfig/Common/RowScope.js +2 -0
- package/src/PredefinedConfig/ExportState.d.ts +2 -2
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +7 -8
- package/src/PredefinedConfig/PlusMinusState.d.ts +2 -2
- package/src/PredefinedConfig/ShortcutState.d.ts +2 -2
- package/src/PredefinedConfig/StyledColumnState.d.ts +5 -10
- package/src/Strategy/StyledColumnModule.js +4 -2
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +4 -3
- package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/View/Alert/Utilities/getAvailablePredicates.d.ts +2 -2
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.d.ts +3 -3
- package/src/View/Components/EntityRulesEditor/index.d.ts +3 -3
- package/src/View/Components/NewScopeComponent.d.ts +5 -5
- package/src/View/Components/RangesComponent.d.ts +2 -2
- package/src/View/Components/SharedProps/WizardScopeState.d.ts +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +4 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +24 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +32 -12
- package/src/agGrid/ActionColumnRenderer.js +41 -4
- package/src/agGrid/AgGridColumnAdapter.js +5 -4
- package/src/agGrid/BadgeRenderer.d.ts +2 -2
- package/src/agGrid/BadgeRenderer.js +21 -13
- package/src/agGrid/PercentBarRenderer.js +0 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +19 -26
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +2 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- /package/src/PredefinedConfig/Common/{AdaptableScope.js → ColumnScope.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigState } from './ConfigState';
|
|
2
2
|
import { AdaptableStyle } from './Common/AdaptableStyle';
|
|
3
|
-
import { AdaptableColumnPredicate,
|
|
3
|
+
import { AdaptableColumnPredicate, ColumnScope } from '../types';
|
|
4
4
|
import { XOR } from '../Utilities/Extensions/TypeExtensions';
|
|
5
5
|
import { AdaptableBooleanQuery } from './Common/AdaptableQuery';
|
|
6
6
|
import { TypeHint } from './Common/Types';
|
|
@@ -34,7 +34,7 @@ export interface FlashingCellDefinition extends SuspendableObject {
|
|
|
34
34
|
/**
|
|
35
35
|
* Where Flashing Cell can display: Column[s] or DataType[s]
|
|
36
36
|
*/
|
|
37
|
-
Scope:
|
|
37
|
+
Scope: ColumnScope;
|
|
38
38
|
/**
|
|
39
39
|
* When Flashing Cell should be triggered
|
|
40
40
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ConfigState } from './ConfigState';
|
|
2
2
|
import { AdaptableStyle } from './Common/AdaptableStyle';
|
|
3
3
|
import { AdaptableFormat } from './Common/AdaptableFormat';
|
|
4
|
-
import {
|
|
4
|
+
import { ColumnScope } from './Common/ColumnScope';
|
|
5
|
+
import { RowScope } from './Common/RowScope';
|
|
5
6
|
import { SuspendableObject } from './Common/SuspendableObject';
|
|
6
7
|
import { XOR } from '../Utilities/Extensions/TypeExtensions';
|
|
7
8
|
import { TypeHint } from './Common/Types';
|
|
@@ -23,7 +24,7 @@ export interface FormatColumn extends SuspendableObject {
|
|
|
23
24
|
/**
|
|
24
25
|
* Where Format will be applied - whole Row, some Columns or all Columns of given DataType
|
|
25
26
|
*/
|
|
26
|
-
Scope:
|
|
27
|
+
Scope: ColumnScope;
|
|
27
28
|
/**
|
|
28
29
|
* Rule used to decide whether to apply the Format; if undefined Format is always applied
|
|
29
30
|
*/
|
|
@@ -41,15 +42,13 @@ export interface FormatColumn extends SuspendableObject {
|
|
|
41
42
|
*/
|
|
42
43
|
CellAlignment?: 'Left' | 'Right' | 'Center';
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @defaultValue false
|
|
45
|
+
* Which types of Rows should be formatted (data, grouped, summary)
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
RowScope?: RowScope;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @defaultValue false
|
|
49
|
+
* @deprecated FormatColumns now apply to grouped rows by default; use RowScope for more control
|
|
51
50
|
*/
|
|
52
|
-
|
|
51
|
+
IncludeGroupedRows?: never;
|
|
53
52
|
}
|
|
54
53
|
/**
|
|
55
54
|
* The Format Column Rule - can be either a Predicate or a BooleanExpression
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigState } from './ConfigState';
|
|
2
|
-
import {
|
|
2
|
+
import { ColumnScope } from './Common/ColumnScope';
|
|
3
3
|
import { AdaptableBooleanQuery } from './Common/AdaptableQuery';
|
|
4
4
|
import { SuspendableObject } from './Common/SuspendableObject';
|
|
5
5
|
/**
|
|
@@ -18,7 +18,7 @@ export interface PlusMinusNudge extends SuspendableObject {
|
|
|
18
18
|
/**
|
|
19
19
|
* Where Rule is applied
|
|
20
20
|
*/
|
|
21
|
-
Scope:
|
|
21
|
+
Scope: ColumnScope;
|
|
22
22
|
/**
|
|
23
23
|
* Amount by which to update cell when Rule is applied
|
|
24
24
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigState } from './ConfigState';
|
|
2
|
-
import {
|
|
2
|
+
import { ColumnScope } from './Common/ColumnScope';
|
|
3
3
|
import { SuspendableObject } from './Common/SuspendableObject';
|
|
4
4
|
/**
|
|
5
5
|
* Predefined Configuration for Shortcut Module
|
|
@@ -21,7 +21,7 @@ export interface Shortcut extends SuspendableObject {
|
|
|
21
21
|
/**
|
|
22
22
|
* Numeric Columns where Shortcut is applied
|
|
23
23
|
*/
|
|
24
|
-
Scope:
|
|
24
|
+
Scope: ColumnScope<ShortcutScopeDataType>;
|
|
25
25
|
/**
|
|
26
26
|
* Key which triggers the Shortcut when pressed
|
|
27
27
|
*/
|
|
@@ -3,6 +3,7 @@ import { SuspendableObject } from './Common/SuspendableObject';
|
|
|
3
3
|
import { SparklineOptions } from '@ag-grid-community/core';
|
|
4
4
|
import { AdaptableCustomIcon, AdaptableSystemIcon, AdaptablePredicate, AdaptableStyle } from '../types';
|
|
5
5
|
import { TypeHint } from './Common/Types';
|
|
6
|
+
import { RowScope } from "./Common/RowScope";
|
|
6
7
|
/**
|
|
7
8
|
* Predefined Configuration for Styled Column Module
|
|
8
9
|
*/
|
|
@@ -36,16 +37,6 @@ export interface StyledColumn extends SuspendableObject {
|
|
|
36
37
|
* Displays cell values in Column as a Badge
|
|
37
38
|
*/
|
|
38
39
|
BadgeStyle?: BadgeStyle;
|
|
39
|
-
/**
|
|
40
|
-
* Includes Styled Column in Grouped Rows
|
|
41
|
-
* @defaultValue false
|
|
42
|
-
*/
|
|
43
|
-
IncludeGroupedRows?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Includes Row Summaries in Styled Column
|
|
46
|
-
* @defaultValue false
|
|
47
|
-
*/
|
|
48
|
-
IncludeRowSummaries?: boolean;
|
|
49
40
|
}
|
|
50
41
|
/**
|
|
51
42
|
* Style used to display Percent Bars in Special Column Style
|
|
@@ -195,4 +186,8 @@ export interface BadgeStyle {
|
|
|
195
186
|
* Collection of Badge Style Definitions
|
|
196
187
|
*/
|
|
197
188
|
Badges?: BadgeStyleDefinition[];
|
|
189
|
+
/**
|
|
190
|
+
* Which types of Rows should contain a Badge (data, grouped, summary)
|
|
191
|
+
*/
|
|
192
|
+
RowScope?: RowScope;
|
|
198
193
|
}
|
|
@@ -166,6 +166,7 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
168
|
toView(styledColumn) {
|
|
169
|
+
var _a, _b, _c, _d, _e, _f;
|
|
169
170
|
const specificTypeItems = [];
|
|
170
171
|
if (styledColumn.GradientStyle || styledColumn.PercentBarStyle) {
|
|
171
172
|
specificTypeItems.push({
|
|
@@ -179,8 +180,9 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
179
180
|
specificTypeItems.push({
|
|
180
181
|
name: 'Settings',
|
|
181
182
|
values: [
|
|
182
|
-
`
|
|
183
|
-
`
|
|
183
|
+
`Data Rows: ${((_b = (_a = styledColumn.BadgeStyle) === null || _a === void 0 ? void 0 : _a.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'No' : 'Yes'}`,
|
|
184
|
+
`Grouped Rows: ${((_d = (_c = styledColumn.BadgeStyle) === null || _c === void 0 ? void 0 : _c.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeGroupedRows) ? 'No' : 'Yes'}`,
|
|
185
|
+
`Summary Rows: ${((_f = (_e = styledColumn.BadgeStyle) === null || _e === void 0 ? void 0 : _e.RowScope) === null || _f === void 0 ? void 0 : _f.ExcludeSummaryRows) ? 'No' : 'Yes'}`,
|
|
184
186
|
],
|
|
185
187
|
});
|
|
186
188
|
}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFormatColumnSettingsViewItems = void 0;
|
|
4
4
|
const getFormatColumnSettingsViewItems = (formatColumn) => {
|
|
5
|
-
var _a;
|
|
5
|
+
var _a, _b, _c, _d;
|
|
6
6
|
const values = [
|
|
7
7
|
`Cell alignment: ${(_a = formatColumn.CellAlignment) !== null && _a !== void 0 ? _a : 'default'}`,
|
|
8
|
-
`
|
|
9
|
-
`
|
|
8
|
+
`Data Rows: ${((_b = formatColumn.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'Yes' : 'No'}`,
|
|
9
|
+
`Grouped Rows: ${((_c = formatColumn.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeGroupedRows) ? 'Yes' : 'No'}`,
|
|
10
|
+
`Row Summaries: ${((_d = formatColumn.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeSummaryRows) ? 'Yes' : 'No'}`,
|
|
10
11
|
].filter(Boolean);
|
|
11
12
|
return {
|
|
12
13
|
name: 'Settings',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AdaptableApi,
|
|
1
|
+
import { AdaptableApi, ColumnScope } from '../../../types';
|
|
2
2
|
import { AdaptableObjectItemView } from '../Interface/IModule';
|
|
3
|
-
export declare const getScopeViewItems: (scope:
|
|
3
|
+
export declare const getScopeViewItems: (scope: ColumnScope, api: AdaptableApi) => AdaptableObjectItemView;
|
|
@@ -260,6 +260,7 @@ function CreateEmptyFormatColumn() {
|
|
|
260
260
|
Style: CreateEmptyStyle(),
|
|
261
261
|
DisplayFormat: undefined,
|
|
262
262
|
CellAlignment: undefined,
|
|
263
|
+
RowScope: undefined,
|
|
263
264
|
};
|
|
264
265
|
}
|
|
265
266
|
exports.CreateEmptyFormatColumn = CreateEmptyFormatColumn;
|
|
@@ -334,7 +335,6 @@ function CreateEmptyStyledColumn() {
|
|
|
334
335
|
return {
|
|
335
336
|
Uuid: (0, Uuid_1.createUuid)(),
|
|
336
337
|
ColumnId: GeneralConstants_1.EMPTY_STRING,
|
|
337
|
-
IncludeGroupedRows: false,
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
340
|
exports.CreateEmptyStyledColumn = CreateEmptyStyledColumn;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AdaptableApi, AdaptablePredicateDef,
|
|
1
|
+
import { AdaptableApi, AdaptablePredicateDef, ColumnScope } from '../../../types';
|
|
2
2
|
import { AlertType } from './getAlertType';
|
|
3
|
-
export declare const getAvailablePredicateDefinitions: (api: AdaptableApi, scope:
|
|
3
|
+
export declare const getAvailablePredicateDefinitions: (api: AdaptableApi, scope: ColumnScope, alertType: AlertType) => AdaptablePredicateDef<string>[];
|
|
@@ -6,7 +6,7 @@ import { AlertType } from './getAlertType';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const getDefaultAlertDefinition: (alertDefinition: AlertDefinition, type: AlertType) => {
|
|
8
8
|
Uuid: string;
|
|
9
|
-
Scope: import("../../../types").
|
|
9
|
+
Scope: import("../../../types").ColumnScope<import("../../../PredefinedConfig/Common/ColumnScope").ScopeDataType>;
|
|
10
10
|
Rule: ({
|
|
11
11
|
Predicates?: never;
|
|
12
12
|
} & (({
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AdaptablePredicateDef,
|
|
2
|
+
import { AdaptablePredicateDef, ColumnScope } from '../../../../types';
|
|
3
3
|
import { EntityRulesEditorProps, RuleType } from '../index';
|
|
4
4
|
export interface EntityRulePredicatesEditorProps {
|
|
5
5
|
descriptions: EntityRulesEditorProps<any>['descriptions'];
|
|
6
6
|
data: {
|
|
7
7
|
Rule: RuleType;
|
|
8
|
-
Scope:
|
|
8
|
+
Scope: ColumnScope;
|
|
9
9
|
};
|
|
10
10
|
onChange: (data: {
|
|
11
11
|
Rule: RuleType;
|
|
12
|
-
Scope:
|
|
12
|
+
Scope: ColumnScope;
|
|
13
13
|
}) => void;
|
|
14
14
|
predicateDefs: AdaptablePredicateDef[];
|
|
15
15
|
getPredicateDefsForColId?: (colId: string) => AdaptablePredicateDef[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FlexProps } from 'rebass';
|
|
3
|
-
import type { AdaptableColumnPredicate, AdaptableModule, AdaptablePredicateDef,
|
|
3
|
+
import type { AdaptableColumnPredicate, AdaptableModule, AdaptablePredicateDef, ColumnScope } from '../../../types';
|
|
4
4
|
import type { XOR } from '../../../Utilities/Extensions/TypeExtensions';
|
|
5
5
|
import { AdaptableQuery } from '../../../PredefinedConfig/Common/AdaptableQuery';
|
|
6
6
|
export type RuleType = XOR<{
|
|
@@ -30,7 +30,7 @@ export type EntityRulesEditorProps<T> = {
|
|
|
30
30
|
};
|
|
31
31
|
export declare const EntityRulesSummary: <T extends {
|
|
32
32
|
Rule?: RuleType;
|
|
33
|
-
Scope:
|
|
33
|
+
Scope: ColumnScope;
|
|
34
34
|
}>(props: {
|
|
35
35
|
data: T;
|
|
36
36
|
renderPredicate: (content: string) => React.ReactNode;
|
|
@@ -38,5 +38,5 @@ export declare const EntityRulesSummary: <T extends {
|
|
|
38
38
|
}) => JSX.Element;
|
|
39
39
|
export declare const EntityRulesEditor: <T extends {
|
|
40
40
|
Rule: RuleType;
|
|
41
|
-
Scope:
|
|
41
|
+
Scope: ColumnScope;
|
|
42
42
|
}>(props: EntityRulesEditorProps<T>) => JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScopeDataType,
|
|
2
|
+
import { ScopeDataType, ColumnScope } from '../../PredefinedConfig/Common/ColumnScope';
|
|
3
3
|
import { AdaptableColumn } from '../../types';
|
|
4
4
|
export declare const isScopeValid: ({ Scope }: {
|
|
5
|
-
Scope:
|
|
5
|
+
Scope: ColumnScope;
|
|
6
6
|
}) => string | true;
|
|
7
|
-
export declare const renderScopeSummary: (scope:
|
|
7
|
+
export declare const renderScopeSummary: (scope: ColumnScope, labels: {
|
|
8
8
|
scopeWholeRow: string;
|
|
9
9
|
scopeColumns: string;
|
|
10
10
|
scopeDataTypes: string;
|
|
11
11
|
}) => JSX.Element;
|
|
12
12
|
export interface NewScopeComponentProps extends React.ClassAttributes<any> {
|
|
13
|
-
scope:
|
|
13
|
+
scope: ColumnScope;
|
|
14
14
|
scopeColumns?: AdaptableColumn[];
|
|
15
|
-
updateScope: (scope:
|
|
15
|
+
updateScope: (scope: ColumnScope) => void;
|
|
16
16
|
availableDataTypes?: ScopeDataType[];
|
|
17
17
|
hideWholeRow?: boolean;
|
|
18
18
|
style?: React.CSSProperties;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { CellColorRange, ColumnComparison, NumericStyledColumn } from '../../PredefinedConfig/StyledColumnState';
|
|
4
|
-
import {
|
|
4
|
+
import { ColumnScope } from '../../PredefinedConfig/Common/ColumnScope';
|
|
5
5
|
export interface RangesComponentProps extends React.ClassAttributes<RangesComponent> {
|
|
6
6
|
ranges: CellColorRange[];
|
|
7
7
|
columnComparison?: ColumnComparison;
|
|
8
8
|
rangeValueType: NumericStyledColumn['RangeValueType'];
|
|
9
9
|
onRangeValueTypeChange: (rangeValueType: NumericStyledColumn['RangeValueType']) => void;
|
|
10
|
-
scope:
|
|
10
|
+
scope: ColumnScope;
|
|
11
11
|
api: AdaptableApi;
|
|
12
12
|
showRangeDirection: boolean;
|
|
13
13
|
updateRanges: (ranges: CellColorRange[]) => void;
|
|
@@ -99,7 +99,10 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
99
99
|
{
|
|
100
100
|
columnId: 'undoActionColumn',
|
|
101
101
|
friendlyName: ' ',
|
|
102
|
-
|
|
102
|
+
rowScope: {
|
|
103
|
+
ExcludeGroupedRows: true,
|
|
104
|
+
ExcludeSummaryRows: true,
|
|
105
|
+
},
|
|
103
106
|
actionColumnSettings: { suppressMenu: true, suppressMovable: true },
|
|
104
107
|
actionColumnButton,
|
|
105
108
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormatColumn } from '../../../PredefinedConfig/FormatColumnState';
|
|
3
3
|
import { AdaptableFormat } from '../../../PredefinedConfig/Common/AdaptableFormat';
|
|
4
|
-
import {
|
|
4
|
+
import { ColumnScope } from '../../../PredefinedConfig/Common/ColumnScope';
|
|
5
5
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
6
6
|
export type FormatColumnFormatWizardSectionProps = {
|
|
7
7
|
onChange: (data: FormatColumn) => void;
|
|
@@ -12,5 +12,5 @@ export interface FormatColumnFormatWizardState {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const getFormatColumnFormatSummaryValue: (data: FormatColumn) => string;
|
|
14
14
|
export declare const renderFormatColumnFormatSummary: (data: FormatColumn) => JSX.Element;
|
|
15
|
-
export declare const getFormatDisplayTypeForScope: (scope:
|
|
15
|
+
export declare const getFormatDisplayTypeForScope: (scope: ColumnScope, api: AdaptableApi) => 'Number' | 'Date' | 'String' | undefined;
|
|
16
16
|
export declare const FormatColumnFormatWizardSection: (props: FormatColumnFormatWizardSectionProps) => JSX.Element;
|
|
@@ -12,20 +12,25 @@ const Tag_1 = require("../../../components/Tag");
|
|
|
12
12
|
const ToggleGroup_1 = require("../../../components/Toggle/ToggleGroup");
|
|
13
13
|
const Toggle_1 = require("../../../components/Toggle/Toggle");
|
|
14
14
|
const renderFormatColumnSettingsSummary = (data) => {
|
|
15
|
-
var _a;
|
|
15
|
+
var _a, _b, _c, _d;
|
|
16
16
|
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
17
17
|
React.createElement(rebass_1.Text, null,
|
|
18
18
|
"Cell alignment ",
|
|
19
19
|
React.createElement(Tag_1.Tag, null, (_a = data.CellAlignment) !== null && _a !== void 0 ? _a : 'default')),
|
|
20
20
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
21
|
-
"
|
|
22
|
-
React.createElement(Tag_1.Tag, null, data.
|
|
21
|
+
"Data Rows ",
|
|
22
|
+
React.createElement(Tag_1.Tag, null, ((_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'no' : 'yes')),
|
|
23
|
+
' ',
|
|
23
24
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
24
|
-
"
|
|
25
|
-
React.createElement(Tag_1.Tag, null, data.
|
|
25
|
+
"Grouped Rows ",
|
|
26
|
+
React.createElement(Tag_1.Tag, null, ((_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeGroupedRows) ? 'no' : 'yes')),
|
|
27
|
+
React.createElement(rebass_1.Text, { mt: 3 },
|
|
28
|
+
"Summary Rows ",
|
|
29
|
+
React.createElement(Tag_1.Tag, null, ((_d = data.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeSummaryRows) ? 'no' : 'yes'))));
|
|
26
30
|
};
|
|
27
31
|
exports.renderFormatColumnSettingsSummary = renderFormatColumnSettingsSummary;
|
|
28
32
|
const FormatColumnSettingsWizardSection = (props) => {
|
|
33
|
+
var _a, _b, _c;
|
|
29
34
|
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
30
35
|
const onCellAlignmentSelectChanged = (CellAlignment) => {
|
|
31
36
|
const newData = Object.assign(Object.assign({}, data), { CellAlignment });
|
|
@@ -34,11 +39,14 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
34
39
|
}
|
|
35
40
|
props.onChange(newData);
|
|
36
41
|
};
|
|
37
|
-
const
|
|
38
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
42
|
+
const onExcludeDataRowsChanged = (ExcludeDataRows) => {
|
|
43
|
+
props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeDataRows }) }));
|
|
44
|
+
};
|
|
45
|
+
const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
|
|
46
|
+
props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeGroupedRows }) }));
|
|
39
47
|
};
|
|
40
|
-
const
|
|
41
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
48
|
+
const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
|
|
49
|
+
props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeSummaryRows }) }));
|
|
42
50
|
};
|
|
43
51
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
44
52
|
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
@@ -56,11 +64,14 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
56
64
|
React.createElement(Toggle_1.Toggle, { icon: "align-right", pressed: data.CellAlignment === 'Right', onPressedChange: (pressed) => pressed
|
|
57
65
|
? onCellAlignmentSelectChanged('Right')
|
|
58
66
|
: onCellAlignmentSelectChanged(null) }))),
|
|
59
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
67
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Data Rows:" },
|
|
68
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
69
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-data-rows-checkbox", checked: (_a = data.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
|
|
70
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Grouped Rows:" },
|
|
60
71
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
61
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "
|
|
62
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
72
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked: (_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
|
|
73
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Row Summaries:" },
|
|
63
74
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
64
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "
|
|
75
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked: (_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))))))));
|
|
65
76
|
};
|
|
66
77
|
exports.FormatColumnSettingsWizardSection = FormatColumnSettingsWizardSection;
|
|
@@ -10,33 +10,53 @@ const Tabs_1 = require("../../../components/Tabs");
|
|
|
10
10
|
const Tag_1 = require("../../../components/Tag");
|
|
11
11
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
12
12
|
const renderStyledColumnWizardSettingsSummary = (data) => {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const badgeStyle = data;
|
|
13
15
|
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
14
16
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
15
|
-
"
|
|
16
|
-
React.createElement(Tag_1.Tag, null,
|
|
17
|
+
"Data Rows ",
|
|
18
|
+
React.createElement(Tag_1.Tag, null, ((_a = badgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows) ? 'no' : 'yes')),
|
|
19
|
+
' ',
|
|
17
20
|
React.createElement(rebass_1.Text, { mt: 3 },
|
|
18
|
-
"
|
|
19
|
-
React.createElement(Tag_1.Tag, null,
|
|
21
|
+
"Grouped Rows ",
|
|
22
|
+
React.createElement(Tag_1.Tag, null, ((_b = badgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) ? 'no' : 'yes')),
|
|
23
|
+
React.createElement(rebass_1.Text, { mt: 3 },
|
|
24
|
+
"Summary Rows ",
|
|
25
|
+
React.createElement(Tag_1.Tag, null, ((_c = badgeStyle.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) ? 'no' : 'yes'))));
|
|
20
26
|
};
|
|
21
27
|
exports.renderStyledColumnWizardSettingsSummary = renderStyledColumnWizardSettingsSummary;
|
|
22
28
|
const StyledColumnWizardSettingsSection = (props) => {
|
|
29
|
+
var _a, _b, _c;
|
|
23
30
|
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
24
|
-
const
|
|
25
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
31
|
+
const onExcludeDataRowsChanged = (ExcludeDataRows) => {
|
|
32
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeDataRows }) }) }));
|
|
33
|
+
};
|
|
34
|
+
const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
|
|
35
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeGroupedRows }) }) }));
|
|
26
36
|
};
|
|
27
|
-
const
|
|
28
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
37
|
+
const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
|
|
38
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeSummaryRows }) }) }));
|
|
29
39
|
};
|
|
30
40
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
31
41
|
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
32
42
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
33
43
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
34
44
|
React.createElement(FormLayout_1.default, null,
|
|
35
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
45
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Data Rows:" },
|
|
46
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
47
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-data-rows-checkbox", checked:
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
(_a = data.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
|
|
50
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Grouped Rows:" },
|
|
36
51
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
37
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "
|
|
38
|
-
|
|
52
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked:
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
(_b = data.BadgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
|
|
55
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Row Summaries:" },
|
|
39
56
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
40
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "
|
|
57
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked:
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
(_c = data.BadgeStyle.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))),
|
|
60
|
+
' ')))));
|
|
41
61
|
};
|
|
42
62
|
exports.StyledColumnWizardSettingsSection = StyledColumnWizardSettingsSection;
|
|
@@ -6,6 +6,7 @@ const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButt
|
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const useRerender_1 = require("../components/utils/useRerender");
|
|
8
8
|
const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext");
|
|
9
|
+
const RowSummary_1 = require("../PredefinedConfig/Common/RowSummary");
|
|
9
10
|
const ActionButtons = (props) => {
|
|
10
11
|
const { buttons, adaptableApi, context, rerender } = props;
|
|
11
12
|
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
@@ -36,14 +37,32 @@ const ActionButtons = (props) => {
|
|
|
36
37
|
})));
|
|
37
38
|
};
|
|
38
39
|
const ReactActionColumnRenderer = (props) => {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
39
41
|
const rerender = (0, useRerender_1.useRerender)();
|
|
40
42
|
const adaptable = props.context.__adaptable;
|
|
41
43
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(props.colDef);
|
|
42
44
|
if (!actionColumn || !actionButtons.length) {
|
|
43
45
|
return null;
|
|
44
46
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
const isGroupedRow = adaptable.api.gridApi.isGroupRowNode(props.node);
|
|
48
|
+
const isSummaryRow = (_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
49
|
+
let shouldRender = true;
|
|
50
|
+
if (isGroupedRow) {
|
|
51
|
+
if ((_b = actionColumn.rowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) {
|
|
52
|
+
shouldRender = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if (isSummaryRow) {
|
|
56
|
+
if ((_c = actionColumn.rowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) {
|
|
57
|
+
shouldRender = false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if ((_d = actionColumn.rowScope) === null || _d === void 0 ? void 0 : _d.ExcludeDataRows) {
|
|
62
|
+
shouldRender = false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (!shouldRender) {
|
|
47
66
|
return null;
|
|
48
67
|
}
|
|
49
68
|
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node, props.api);
|
|
@@ -63,6 +82,7 @@ exports.ReactActionColumnRenderer = ReactActionColumnRenderer;
|
|
|
63
82
|
class ActionColumnRenderer {
|
|
64
83
|
// gets called once before the renderer is used
|
|
65
84
|
init(params) {
|
|
85
|
+
var _a, _b, _c, _d;
|
|
66
86
|
const adaptable = params.context.__adaptable;
|
|
67
87
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(params.colDef);
|
|
68
88
|
if (!actionColumn || !actionButtons.length) {
|
|
@@ -71,8 +91,25 @@ class ActionColumnRenderer {
|
|
|
71
91
|
// create the cell
|
|
72
92
|
this.eGui = document.createElement('div');
|
|
73
93
|
this.eGui.className = 'ab-ActionColumn';
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
const isGroupedRow = adaptable.api.gridApi.isGroupRowNode(params.node);
|
|
95
|
+
const isSummaryRow = (_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
96
|
+
let shouldRender = true;
|
|
97
|
+
if (isGroupedRow) {
|
|
98
|
+
if ((_b = actionColumn.rowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) {
|
|
99
|
+
shouldRender = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else if (isSummaryRow) {
|
|
103
|
+
if ((_c = actionColumn.rowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) {
|
|
104
|
+
shouldRender = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
if ((_d = actionColumn.rowScope) === null || _d === void 0 ? void 0 : _d.ExcludeDataRows) {
|
|
109
|
+
shouldRender = false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (!shouldRender) {
|
|
76
113
|
this.eGui.innerHTML = '';
|
|
77
114
|
return;
|
|
78
115
|
}
|
|
@@ -211,7 +211,7 @@ class AgGridColumnAdapter {
|
|
|
211
211
|
return (0, PercentBarRenderer_1.getPercentBarRendererForColumn)(styledColumn, abColumn, this.adaptableApi);
|
|
212
212
|
}
|
|
213
213
|
if (styledColumn.BadgeStyle) {
|
|
214
|
-
return (0, BadgeRenderer_1.getBadgeRendererForColumn)(styledColumn, abColumn, this.adaptableApi);
|
|
214
|
+
return (0, BadgeRenderer_1.getBadgeRendererForColumn)(styledColumn.BadgeStyle, abColumn, this.adaptableApi);
|
|
215
215
|
}
|
|
216
216
|
if (styledColumn.SparkLineStyle) {
|
|
217
217
|
return 'agSparklineCellRenderer';
|
|
@@ -668,7 +668,7 @@ class AgGridColumnAdapter {
|
|
|
668
668
|
return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
|
|
669
669
|
}
|
|
670
670
|
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
671
|
-
var _a, _b;
|
|
671
|
+
var _a, _b, _c;
|
|
672
672
|
let style = {};
|
|
673
673
|
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
674
674
|
if (params.value === undefined) {
|
|
@@ -676,7 +676,6 @@ class AgGridColumnAdapter {
|
|
|
676
676
|
}
|
|
677
677
|
let colValue = params.value;
|
|
678
678
|
if (this.adaptableApi.gridApi.isGroupRowNode(params.node)) {
|
|
679
|
-
// We no longer support Grouped Rows
|
|
680
679
|
return style;
|
|
681
680
|
// if (styledColumn.IncludeGroupedRows) {
|
|
682
681
|
// const minColumnValue =
|
|
@@ -692,7 +691,9 @@ class AgGridColumnAdapter {
|
|
|
692
691
|
// return style;
|
|
693
692
|
// }
|
|
694
693
|
}
|
|
695
|
-
if (
|
|
694
|
+
if (styledColumn.BadgeStyle &&
|
|
695
|
+
!((_a = styledColumn.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeSummaryRows) &&
|
|
696
|
+
((_c = (_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c[RowSummary_1.ROW_SUMMARY_ROW_ID])) {
|
|
696
697
|
return style;
|
|
697
698
|
}
|
|
698
699
|
if (gradientStyle) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BadgeStyle } from '../PredefinedConfig/StyledColumnState';
|
|
2
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
-
export declare const getBadgeRendererForColumn: (
|
|
4
|
+
export declare const getBadgeRendererForColumn: (badgeStyle: BadgeStyle, abColumn: AdaptableColumn, api: AdaptableApi) => any;
|