@adaptabletools/adaptable 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 +1 -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.esm.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
|
}
|
|
@@ -162,6 +162,7 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
toView(styledColumn) {
|
|
165
|
+
var _a, _b, _c, _d, _e, _f;
|
|
165
166
|
const specificTypeItems = [];
|
|
166
167
|
if (styledColumn.GradientStyle || styledColumn.PercentBarStyle) {
|
|
167
168
|
specificTypeItems.push({
|
|
@@ -175,8 +176,9 @@ export class StyledColumnModule extends AdaptableModuleBase {
|
|
|
175
176
|
specificTypeItems.push({
|
|
176
177
|
name: 'Settings',
|
|
177
178
|
values: [
|
|
178
|
-
`
|
|
179
|
-
`
|
|
179
|
+
`Data Rows: ${((_b = (_a = styledColumn.BadgeStyle) === null || _a === void 0 ? void 0 : _a.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'No' : 'Yes'}`,
|
|
180
|
+
`Grouped Rows: ${((_d = (_c = styledColumn.BadgeStyle) === null || _c === void 0 ? void 0 : _c.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeGroupedRows) ? 'No' : 'Yes'}`,
|
|
181
|
+
`Summary Rows: ${((_f = (_e = styledColumn.BadgeStyle) === null || _e === void 0 ? void 0 : _e.RowScope) === null || _f === void 0 ? void 0 : _f.ExcludeSummaryRows) ? 'No' : 'Yes'}`,
|
|
180
182
|
],
|
|
181
183
|
});
|
|
182
184
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export const getFormatColumnSettingsViewItems = (formatColumn) => {
|
|
2
|
-
var _a;
|
|
2
|
+
var _a, _b, _c, _d;
|
|
3
3
|
const values = [
|
|
4
4
|
`Cell alignment: ${(_a = formatColumn.CellAlignment) !== null && _a !== void 0 ? _a : 'default'}`,
|
|
5
|
-
`
|
|
6
|
-
`
|
|
5
|
+
`Data Rows: ${((_b = formatColumn.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'Yes' : 'No'}`,
|
|
6
|
+
`Grouped Rows: ${((_c = formatColumn.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeGroupedRows) ? 'Yes' : 'No'}`,
|
|
7
|
+
`Row Summaries: ${((_d = formatColumn.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeSummaryRows) ? 'Yes' : 'No'}`,
|
|
7
8
|
].filter(Boolean);
|
|
8
9
|
return {
|
|
9
10
|
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;
|
|
@@ -233,6 +233,7 @@ export function CreateEmptyFormatColumn() {
|
|
|
233
233
|
Style: CreateEmptyStyle(),
|
|
234
234
|
DisplayFormat: undefined,
|
|
235
235
|
CellAlignment: undefined,
|
|
236
|
+
RowScope: undefined,
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
239
|
export function CreateEmptyFreeTextColumn(defaultSpecialColumnSettings) {
|
|
@@ -300,7 +301,6 @@ export function CreateEmptyStyledColumn() {
|
|
|
300
301
|
return {
|
|
301
302
|
Uuid: createUuid(),
|
|
302
303
|
ColumnId: EMPTY_STRING,
|
|
303
|
-
IncludeGroupedRows: false,
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
export function CreateDefaultStyledColumnBadge() {
|
|
@@ -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;
|
|
@@ -94,7 +94,10 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
94
94
|
{
|
|
95
95
|
columnId: 'undoActionColumn',
|
|
96
96
|
friendlyName: ' ',
|
|
97
|
-
|
|
97
|
+
rowScope: {
|
|
98
|
+
ExcludeGroupedRows: true,
|
|
99
|
+
ExcludeSummaryRows: true,
|
|
100
|
+
},
|
|
98
101
|
actionColumnSettings: { suppressMenu: true, suppressMovable: true },
|
|
99
102
|
actionColumnButton,
|
|
100
103
|
},
|
|
@@ -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;
|
|
@@ -8,19 +8,24 @@ import { Tag } from '../../../components/Tag';
|
|
|
8
8
|
import { ToggleGroup } from '../../../components/Toggle/ToggleGroup';
|
|
9
9
|
import { Toggle } from '../../../components/Toggle/Toggle';
|
|
10
10
|
export const renderFormatColumnSettingsSummary = (data) => {
|
|
11
|
-
var _a;
|
|
11
|
+
var _a, _b, _c, _d;
|
|
12
12
|
return (React.createElement(Box, { padding: 2 },
|
|
13
13
|
React.createElement(Text, null,
|
|
14
14
|
"Cell alignment ",
|
|
15
15
|
React.createElement(Tag, null, (_a = data.CellAlignment) !== null && _a !== void 0 ? _a : 'default')),
|
|
16
16
|
React.createElement(Text, { mt: 3 },
|
|
17
|
-
"
|
|
18
|
-
React.createElement(Tag, null, data.
|
|
17
|
+
"Data Rows ",
|
|
18
|
+
React.createElement(Tag, null, ((_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeDataRows) ? 'no' : 'yes')),
|
|
19
|
+
' ',
|
|
19
20
|
React.createElement(Text, { mt: 3 },
|
|
20
|
-
"
|
|
21
|
-
React.createElement(Tag, null, data.
|
|
21
|
+
"Grouped Rows ",
|
|
22
|
+
React.createElement(Tag, null, ((_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeGroupedRows) ? 'no' : 'yes')),
|
|
23
|
+
React.createElement(Text, { mt: 3 },
|
|
24
|
+
"Summary Rows ",
|
|
25
|
+
React.createElement(Tag, null, ((_d = data.RowScope) === null || _d === void 0 ? void 0 : _d.ExcludeSummaryRows) ? 'no' : 'yes'))));
|
|
22
26
|
};
|
|
23
27
|
export const FormatColumnSettingsWizardSection = (props) => {
|
|
28
|
+
var _a, _b, _c;
|
|
24
29
|
const { data } = useOnePageAdaptableWizardContext();
|
|
25
30
|
const onCellAlignmentSelectChanged = (CellAlignment) => {
|
|
26
31
|
const newData = Object.assign(Object.assign({}, data), { CellAlignment });
|
|
@@ -29,11 +34,14 @@ export const FormatColumnSettingsWizardSection = (props) => {
|
|
|
29
34
|
}
|
|
30
35
|
props.onChange(newData);
|
|
31
36
|
};
|
|
32
|
-
const
|
|
33
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
37
|
+
const onExcludeDataRowsChanged = (ExcludeDataRows) => {
|
|
38
|
+
props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeDataRows }) }));
|
|
39
|
+
};
|
|
40
|
+
const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
|
|
41
|
+
props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeGroupedRows }) }));
|
|
34
42
|
};
|
|
35
|
-
const
|
|
36
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
43
|
+
const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
|
|
44
|
+
props.onChange(Object.assign(Object.assign({}, data), { RowScope: Object.assign(Object.assign({}, data.RowScope), { ExcludeSummaryRows }) }));
|
|
37
45
|
};
|
|
38
46
|
return (React.createElement(Tabs, null,
|
|
39
47
|
React.createElement(Tabs.Tab, null, "Settings"),
|
|
@@ -51,10 +59,13 @@ export const FormatColumnSettingsWizardSection = (props) => {
|
|
|
51
59
|
React.createElement(Toggle, { icon: "align-right", pressed: data.CellAlignment === 'Right', onPressedChange: (pressed) => pressed
|
|
52
60
|
? onCellAlignmentSelectChanged('Right')
|
|
53
61
|
: onCellAlignmentSelectChanged(null) }))),
|
|
54
|
-
React.createElement(FormRow, { label: "
|
|
62
|
+
React.createElement(FormRow, { label: "Exclude Data Rows:" },
|
|
63
|
+
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
|
|
64
|
+
React.createElement(CheckBox, { "data-name": "exclude-data-rows-checkbox", checked: (_a = data.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
|
|
65
|
+
React.createElement(FormRow, { label: "Exclude Grouped Rows:" },
|
|
55
66
|
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
|
|
56
|
-
React.createElement(CheckBox, { "data-name": "
|
|
57
|
-
React.createElement(FormRow, { label: "
|
|
67
|
+
React.createElement(CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked: (_b = data.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
|
|
68
|
+
React.createElement(FormRow, { label: "Exclude Row Summaries:" },
|
|
58
69
|
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
|
|
59
|
-
React.createElement(CheckBox, { "data-name": "
|
|
70
|
+
React.createElement(CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked: (_c = data.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))))))));
|
|
60
71
|
};
|
|
@@ -6,31 +6,51 @@ import { Tabs } from '../../../components/Tabs';
|
|
|
6
6
|
import { Tag } from '../../../components/Tag';
|
|
7
7
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
8
8
|
export const renderStyledColumnWizardSettingsSummary = (data) => {
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
const badgeStyle = data;
|
|
9
11
|
return (React.createElement(Box, { padding: 2 },
|
|
10
12
|
React.createElement(Text, { mt: 3 },
|
|
11
|
-
"
|
|
12
|
-
React.createElement(Tag, null,
|
|
13
|
+
"Data Rows ",
|
|
14
|
+
React.createElement(Tag, null, ((_a = badgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows) ? 'no' : 'yes')),
|
|
15
|
+
' ',
|
|
13
16
|
React.createElement(Text, { mt: 3 },
|
|
14
|
-
"
|
|
15
|
-
React.createElement(Tag, null,
|
|
17
|
+
"Grouped Rows ",
|
|
18
|
+
React.createElement(Tag, null, ((_b = badgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) ? 'no' : 'yes')),
|
|
19
|
+
React.createElement(Text, { mt: 3 },
|
|
20
|
+
"Summary Rows ",
|
|
21
|
+
React.createElement(Tag, null, ((_c = badgeStyle.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) ? 'no' : 'yes'))));
|
|
16
22
|
};
|
|
17
23
|
export const StyledColumnWizardSettingsSection = (props) => {
|
|
24
|
+
var _a, _b, _c;
|
|
18
25
|
const { data } = useOnePageAdaptableWizardContext();
|
|
19
|
-
const
|
|
20
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
26
|
+
const onExcludeDataRowsChanged = (ExcludeDataRows) => {
|
|
27
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeDataRows }) }) }));
|
|
28
|
+
};
|
|
29
|
+
const onExcludeGroupedRowsChanged = (ExcludeGroupedRows) => {
|
|
30
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeGroupedRows }) }) }));
|
|
21
31
|
};
|
|
22
|
-
const
|
|
23
|
-
props.onChange(Object.assign(Object.assign({}, data), {
|
|
32
|
+
const onExcludeSummaryRowsChanged = (ExcludeSummaryRows) => {
|
|
33
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { RowScope: Object.assign(Object.assign({}, data.BadgeStyle.RowScope), { ExcludeSummaryRows }) }) }));
|
|
24
34
|
};
|
|
25
35
|
return (React.createElement(Tabs, null,
|
|
26
36
|
React.createElement(Tabs.Tab, null, "Settings"),
|
|
27
37
|
React.createElement(Tabs.Content, null,
|
|
28
38
|
React.createElement(Flex, { flexDirection: "row" },
|
|
29
39
|
React.createElement(FormLayout, null,
|
|
30
|
-
React.createElement(FormRow, { label: "
|
|
40
|
+
React.createElement(FormRow, { label: "Exclude Data Rows:" },
|
|
41
|
+
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
|
|
42
|
+
React.createElement(CheckBox, { "data-name": "exclude-data-rows-checkbox", checked:
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
(_a = data.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeDataRows, onChange: onExcludeDataRowsChanged, mr: 2 }))),
|
|
45
|
+
React.createElement(FormRow, { label: "Exclude Grouped Rows:" },
|
|
31
46
|
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
|
|
32
|
-
React.createElement(CheckBox, { "data-name": "
|
|
33
|
-
|
|
47
|
+
React.createElement(CheckBox, { "data-name": "exclude-grouped-rows-checkbox", checked:
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
(_b = data.BadgeStyle.RowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows, onChange: onExcludeGroupedRowsChanged, mr: 2 }))),
|
|
50
|
+
React.createElement(FormRow, { label: "Exclude Row Summaries:" },
|
|
34
51
|
React.createElement(Flex, { alignItems: "center", marginLeft: 2 },
|
|
35
|
-
React.createElement(CheckBox, { "data-name": "
|
|
52
|
+
React.createElement(CheckBox, { "data-name": "exclude-summary-rows-checkbox", checked:
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
(_c = data.BadgeStyle.RowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows, onChange: onExcludeSummaryRowsChanged, mr: 2 }))),
|
|
55
|
+
' ')))));
|
|
36
56
|
};
|
|
@@ -2,6 +2,7 @@ import SimpleButton from '../components/SimpleButton';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useRerender } from '../components/utils/useRerender';
|
|
4
4
|
import { renderWithAdaptableContext } from '../View/renderWithAdaptableContext';
|
|
5
|
+
import { ROW_SUMMARY_ROW_ID } from '../PredefinedConfig/Common/RowSummary';
|
|
5
6
|
const ActionButtons = (props) => {
|
|
6
7
|
const { buttons, adaptableApi, context, rerender } = props;
|
|
7
8
|
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
@@ -32,14 +33,32 @@ const ActionButtons = (props) => {
|
|
|
32
33
|
})));
|
|
33
34
|
};
|
|
34
35
|
export const ReactActionColumnRenderer = (props) => {
|
|
36
|
+
var _a, _b, _c, _d;
|
|
35
37
|
const rerender = useRerender();
|
|
36
38
|
const adaptable = props.context.__adaptable;
|
|
37
39
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(props.colDef);
|
|
38
40
|
if (!actionColumn || !actionButtons.length) {
|
|
39
41
|
return null;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
const isGroupedRow = adaptable.api.gridApi.isGroupRowNode(props.node);
|
|
44
|
+
const isSummaryRow = (_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a[ROW_SUMMARY_ROW_ID];
|
|
45
|
+
let shouldRender = true;
|
|
46
|
+
if (isGroupedRow) {
|
|
47
|
+
if ((_b = actionColumn.rowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) {
|
|
48
|
+
shouldRender = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (isSummaryRow) {
|
|
52
|
+
if ((_c = actionColumn.rowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) {
|
|
53
|
+
shouldRender = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if ((_d = actionColumn.rowScope) === null || _d === void 0 ? void 0 : _d.ExcludeDataRows) {
|
|
58
|
+
shouldRender = false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!shouldRender) {
|
|
43
62
|
return null;
|
|
44
63
|
}
|
|
45
64
|
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node, props.api);
|
|
@@ -58,6 +77,7 @@ export const ReactActionColumnRenderer = (props) => {
|
|
|
58
77
|
export class ActionColumnRenderer {
|
|
59
78
|
// gets called once before the renderer is used
|
|
60
79
|
init(params) {
|
|
80
|
+
var _a, _b, _c, _d;
|
|
61
81
|
const adaptable = params.context.__adaptable;
|
|
62
82
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(params.colDef);
|
|
63
83
|
if (!actionColumn || !actionButtons.length) {
|
|
@@ -66,8 +86,25 @@ export class ActionColumnRenderer {
|
|
|
66
86
|
// create the cell
|
|
67
87
|
this.eGui = document.createElement('div');
|
|
68
88
|
this.eGui.className = 'ab-ActionColumn';
|
|
69
|
-
|
|
70
|
-
|
|
89
|
+
const isGroupedRow = adaptable.api.gridApi.isGroupRowNode(params.node);
|
|
90
|
+
const isSummaryRow = (_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a[ROW_SUMMARY_ROW_ID];
|
|
91
|
+
let shouldRender = true;
|
|
92
|
+
if (isGroupedRow) {
|
|
93
|
+
if ((_b = actionColumn.rowScope) === null || _b === void 0 ? void 0 : _b.ExcludeGroupedRows) {
|
|
94
|
+
shouldRender = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if (isSummaryRow) {
|
|
98
|
+
if ((_c = actionColumn.rowScope) === null || _c === void 0 ? void 0 : _c.ExcludeSummaryRows) {
|
|
99
|
+
shouldRender = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
if ((_d = actionColumn.rowScope) === null || _d === void 0 ? void 0 : _d.ExcludeDataRows) {
|
|
104
|
+
shouldRender = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!shouldRender) {
|
|
71
108
|
this.eGui.innerHTML = '';
|
|
72
109
|
return;
|
|
73
110
|
}
|
|
@@ -207,7 +207,7 @@ export class AgGridColumnAdapter {
|
|
|
207
207
|
return getPercentBarRendererForColumn(styledColumn, abColumn, this.adaptableApi);
|
|
208
208
|
}
|
|
209
209
|
if (styledColumn.BadgeStyle) {
|
|
210
|
-
return getBadgeRendererForColumn(styledColumn, abColumn, this.adaptableApi);
|
|
210
|
+
return getBadgeRendererForColumn(styledColumn.BadgeStyle, abColumn, this.adaptableApi);
|
|
211
211
|
}
|
|
212
212
|
if (styledColumn.SparkLineStyle) {
|
|
213
213
|
return 'agSparklineCellRenderer';
|
|
@@ -664,7 +664,7 @@ export class AgGridColumnAdapter {
|
|
|
664
664
|
return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
|
|
665
665
|
}
|
|
666
666
|
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
667
|
-
var _a, _b;
|
|
667
|
+
var _a, _b, _c;
|
|
668
668
|
let style = {};
|
|
669
669
|
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
670
670
|
if (params.value === undefined) {
|
|
@@ -672,7 +672,6 @@ export class AgGridColumnAdapter {
|
|
|
672
672
|
}
|
|
673
673
|
let colValue = params.value;
|
|
674
674
|
if (this.adaptableApi.gridApi.isGroupRowNode(params.node)) {
|
|
675
|
-
// We no longer support Grouped Rows
|
|
676
675
|
return style;
|
|
677
676
|
// if (styledColumn.IncludeGroupedRows) {
|
|
678
677
|
// const minColumnValue =
|
|
@@ -688,7 +687,9 @@ export class AgGridColumnAdapter {
|
|
|
688
687
|
// return style;
|
|
689
688
|
// }
|
|
690
689
|
}
|
|
691
|
-
if (
|
|
690
|
+
if (styledColumn.BadgeStyle &&
|
|
691
|
+
!((_a = styledColumn.BadgeStyle.RowScope) === null || _a === void 0 ? void 0 : _a.ExcludeSummaryRows) &&
|
|
692
|
+
((_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[ROW_SUMMARY_ROW_ID])) {
|
|
692
693
|
return style;
|
|
693
694
|
}
|
|
694
695
|
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;
|