@adaptabletools/adaptable 15.0.3-canary.0 → 15.1.0
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/bundle.cjs.js +181 -177
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +7 -0
- package/src/AdaptableOptions/SearchOptions.d.ts +8 -0
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +7 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +5 -5
- package/src/Api/GridApi.d.ts +14 -6
- package/src/Api/Implementation/GridApiImpl.d.ts +7 -2
- package/src/Api/Implementation/GridApiImpl.js +43 -3
- package/src/Api/Internal/GridInternalApi.js +11 -1
- package/src/Redux/Store/AdaptableStore.js +5 -2
- package/src/Strategy/AlertModule.js +1 -0
- package/src/Strategy/CustomSortModule.d.ts +1 -0
- package/src/Strategy/CustomSortModule.js +1 -0
- package/src/Strategy/FlashingCellModule.js +1 -0
- package/src/Strategy/FormatColumnModule.js +1 -0
- package/src/Strategy/Interface/IModule.d.ts +6 -0
- package/src/Strategy/PlusMinusModule.js +1 -0
- package/src/Strategy/ScheduleModule.js +21 -0
- package/src/Strategy/ShortcutModule.js +1 -0
- package/src/Strategy/StyledColumnModule.js +1 -0
- package/src/Strategy/Utilities/Alert/getAlertBehaviourViewItems.d.ts +3 -8
- package/src/Strategy/Utilities/getObjectTagsViewItems.js +27 -2
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +104 -42
- package/src/Utilities/Extensions/NumberExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/NumberExtensions.js +6 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +1 -0
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +9 -2
- package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
- package/src/View/TeamSharing/SharedEntityObjectView.d.ts +3 -0
- package/src/View/Theme/ThemePopup.d.ts +1 -1
- package/src/View/Theme/ThemePopup.js +17 -3
- package/src/agGrid/Adaptable.d.ts +1 -1
- package/src/agGrid/Adaptable.js +19 -8
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/evaluator.js +3 -1
- package/src/parser/src/parser.js +496 -453
- package/src/parser/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -21,6 +21,14 @@ const dateUtils_1 = require("./dateUtils");
|
|
|
21
21
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
|
|
22
22
|
const TypeExtensions_1 = require("../Extensions/TypeExtensions");
|
|
23
23
|
const src_1 = require("../../parser/src");
|
|
24
|
+
// useful for unary operators which expect a list of arguments
|
|
25
|
+
// we extract the provided array elements into a list
|
|
26
|
+
const flattenArguments = (values) => {
|
|
27
|
+
if (!Array.isArray(values)) {
|
|
28
|
+
return values;
|
|
29
|
+
}
|
|
30
|
+
return values.flat(Infinity);
|
|
31
|
+
};
|
|
24
32
|
const sanitizeArguments = (values, allowNaN) => {
|
|
25
33
|
return values.filter((value) => value != undefined && value != null && value !== '' && (allowNaN || !isNaN(value)));
|
|
26
34
|
};
|
|
@@ -113,7 +121,7 @@ exports.scalarExpressionFunctions = {
|
|
|
113
121
|
},
|
|
114
122
|
COALESCE: {
|
|
115
123
|
handler(args) {
|
|
116
|
-
return args.find((arg) => !(arg === null || arg === undefined));
|
|
124
|
+
return flattenArguments(args).find((arg) => !(arg === null || arg === undefined));
|
|
117
125
|
},
|
|
118
126
|
description: 'Returns the first argument which is not null',
|
|
119
127
|
signatures: ['COALESCE(value, value, ...value)'],
|
|
@@ -121,6 +129,16 @@ exports.scalarExpressionFunctions = {
|
|
|
121
129
|
category: 'special',
|
|
122
130
|
returnType: 'string',
|
|
123
131
|
},
|
|
132
|
+
NULL: {
|
|
133
|
+
handler: () => {
|
|
134
|
+
return null;
|
|
135
|
+
},
|
|
136
|
+
description: 'Returns the NULL literal which represents the intentional absence of any object value',
|
|
137
|
+
category: 'special',
|
|
138
|
+
returnType: 'null',
|
|
139
|
+
signatures: ['NULL'],
|
|
140
|
+
examples: ['[status] = "accepted" ? 100 : NULL'],
|
|
141
|
+
},
|
|
124
142
|
IS_BLANK: {
|
|
125
143
|
handler(args) {
|
|
126
144
|
return args[0] === undefined || args[0] === null || args[0] === '';
|
|
@@ -131,6 +149,85 @@ exports.scalarExpressionFunctions = {
|
|
|
131
149
|
examples: ['IS_BLANK([col1])'],
|
|
132
150
|
returnType: 'boolean',
|
|
133
151
|
},
|
|
152
|
+
ABS: {
|
|
153
|
+
handler(args) {
|
|
154
|
+
return sanitizeNumericResult(Math.abs(args[0]));
|
|
155
|
+
},
|
|
156
|
+
isHiddenFromMenu: true,
|
|
157
|
+
description: 'Returns the absolute value of the given number',
|
|
158
|
+
signatures: ['ABS(a: number)'],
|
|
159
|
+
examples: ['ABS([columnName])'],
|
|
160
|
+
category: 'maths',
|
|
161
|
+
returnType: 'number',
|
|
162
|
+
},
|
|
163
|
+
CEILING: {
|
|
164
|
+
handler(args) {
|
|
165
|
+
return sanitizeNumericResult(Math.ceil(args[0]));
|
|
166
|
+
},
|
|
167
|
+
isHiddenFromMenu: true,
|
|
168
|
+
description: 'Returns the smaller integer greater than or equal to the given number',
|
|
169
|
+
signatures: ['CEILING(a: number)'],
|
|
170
|
+
examples: ['CEILING([columnName])'],
|
|
171
|
+
category: 'maths',
|
|
172
|
+
returnType: 'number',
|
|
173
|
+
},
|
|
174
|
+
FLOOR: {
|
|
175
|
+
handler(args) {
|
|
176
|
+
return sanitizeNumericResult(Math.floor(args[0]));
|
|
177
|
+
},
|
|
178
|
+
isHiddenFromMenu: true,
|
|
179
|
+
description: 'Returns the largest integer less than or equal to the given number',
|
|
180
|
+
signatures: ['FLOOR(a: number)'],
|
|
181
|
+
examples: ['FLOOR([columnName])'],
|
|
182
|
+
category: 'maths',
|
|
183
|
+
returnType: 'number',
|
|
184
|
+
},
|
|
185
|
+
ROUND: {
|
|
186
|
+
handler(args) {
|
|
187
|
+
return sanitizeNumericResult(Math.round(args[0]));
|
|
188
|
+
},
|
|
189
|
+
isHiddenFromMenu: true,
|
|
190
|
+
description: 'Returns the value of the given number rounded to the nearest integer',
|
|
191
|
+
signatures: ['ROUND(a: number)'],
|
|
192
|
+
examples: ['ROUND([columnName])'],
|
|
193
|
+
category: 'maths',
|
|
194
|
+
returnType: 'number',
|
|
195
|
+
},
|
|
196
|
+
MIN: {
|
|
197
|
+
handler(args) {
|
|
198
|
+
return Math.min(...sanitizeArguments(flattenArguments(args)));
|
|
199
|
+
},
|
|
200
|
+
description: 'Returns the smallest of given numbers',
|
|
201
|
+
signatures: ['MIN(number, number, ...number)'],
|
|
202
|
+
examples: ['MIN([col1], 5)'],
|
|
203
|
+
category: 'maths',
|
|
204
|
+
returnType: 'number',
|
|
205
|
+
},
|
|
206
|
+
MAX: {
|
|
207
|
+
handler(args) {
|
|
208
|
+
return Math.max(...sanitizeArguments(flattenArguments(args)));
|
|
209
|
+
},
|
|
210
|
+
description: 'Returns the highest of given numbers',
|
|
211
|
+
signatures: ['MAX(number, number, ...number)'],
|
|
212
|
+
examples: ['MAX([col1], 5)'],
|
|
213
|
+
category: 'maths',
|
|
214
|
+
returnType: 'number',
|
|
215
|
+
},
|
|
216
|
+
AVG: {
|
|
217
|
+
handler(args) {
|
|
218
|
+
const sanitizedArguments = sanitizeArguments(flattenArguments(args));
|
|
219
|
+
if (args.length && !sanitizedArguments.length) {
|
|
220
|
+
// expression is syntactically valid, but operates with incompatible values
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
return sanitizedArguments.reduce((a, b) => a + b) / args.length;
|
|
224
|
+
},
|
|
225
|
+
description: 'Returns the average of inputted numbers',
|
|
226
|
+
signatures: ['AVG(number, number, ...number)'],
|
|
227
|
+
examples: ['AVG([col1], 5)'],
|
|
228
|
+
category: 'maths',
|
|
229
|
+
returnType: 'number',
|
|
230
|
+
},
|
|
134
231
|
ADD: {
|
|
135
232
|
handler(args) {
|
|
136
233
|
const sanitizedArguments = sanitizeArguments(args, true);
|
|
@@ -196,17 +293,6 @@ exports.scalarExpressionFunctions = {
|
|
|
196
293
|
category: 'maths',
|
|
197
294
|
returnType: 'number',
|
|
198
295
|
},
|
|
199
|
-
POW: {
|
|
200
|
-
handler(args) {
|
|
201
|
-
return sanitizeNumericResult(Math.pow(args[0], args[1]));
|
|
202
|
-
},
|
|
203
|
-
isHiddenFromMenu: true,
|
|
204
|
-
description: 'Returns the pow of 2 numbers',
|
|
205
|
-
signatures: ['number ^ number', 'POW(a: number, b: number)'],
|
|
206
|
-
examples: ['[col1] ^ 5', 'POW([col1], 5)'],
|
|
207
|
-
category: 'maths',
|
|
208
|
-
returnType: 'number',
|
|
209
|
-
},
|
|
210
296
|
IF: {
|
|
211
297
|
handler(args) {
|
|
212
298
|
return args[0] ? args[1] : args[2];
|
|
@@ -255,38 +341,14 @@ exports.scalarExpressionFunctions = {
|
|
|
255
341
|
category: 'conditional',
|
|
256
342
|
returnType: 'any',
|
|
257
343
|
},
|
|
258
|
-
|
|
259
|
-
handler(args) {
|
|
260
|
-
return Math.min(...sanitizeArguments(args));
|
|
261
|
-
},
|
|
262
|
-
description: 'Returns the smallest of inputted numbers',
|
|
263
|
-
signatures: ['MIN(number, number, ...number)'],
|
|
264
|
-
examples: ['MIN([col1], 5)'],
|
|
265
|
-
category: 'maths',
|
|
266
|
-
returnType: 'number',
|
|
267
|
-
},
|
|
268
|
-
MAX: {
|
|
269
|
-
handler(args) {
|
|
270
|
-
return Math.max(...sanitizeArguments(args));
|
|
271
|
-
},
|
|
272
|
-
description: 'Returns the highest of inputted numbers',
|
|
273
|
-
signatures: ['MAX(number, number, ...number)'],
|
|
274
|
-
examples: ['MAX([col1], 5)'],
|
|
275
|
-
category: 'maths',
|
|
276
|
-
returnType: 'number',
|
|
277
|
-
},
|
|
278
|
-
AVG: {
|
|
344
|
+
POW: {
|
|
279
345
|
handler(args) {
|
|
280
|
-
|
|
281
|
-
if (args.length && !sanitizedArguments.length) {
|
|
282
|
-
// expression is syntactically valid, but operates with incompatible values
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
return sanitizedArguments.reduce((a, b) => a + b) / args.length;
|
|
346
|
+
return sanitizeNumericResult(Math.pow(args[0], args[1]));
|
|
286
347
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
348
|
+
isHiddenFromMenu: true,
|
|
349
|
+
description: 'Returns the pow of 2 numbers',
|
|
350
|
+
signatures: ['number ^ number', 'POW(a: number, b: number)'],
|
|
351
|
+
examples: ['[col1] ^ 5', 'POW([col1], 5)'],
|
|
290
352
|
category: 'maths',
|
|
291
353
|
returnType: 'number',
|
|
292
354
|
},
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare function abbreviateNumber(numberToAbbreviate: number): string;
|
|
2
|
+
export declare function WrapInParentheses(numberToWrap: number): string;
|
|
2
3
|
export declare const NumberExtensions: {
|
|
3
4
|
abbreviateNumber: typeof abbreviateNumber;
|
|
5
|
+
WrapInParentheses: typeof WrapInParentheses;
|
|
4
6
|
};
|
|
5
7
|
export default NumberExtensions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberExtensions = exports.abbreviateNumber = void 0;
|
|
3
|
+
exports.NumberExtensions = exports.WrapInParentheses = exports.abbreviateNumber = void 0;
|
|
4
4
|
function abbreviateNumber(numberToAbbreviate) {
|
|
5
5
|
let str = '';
|
|
6
6
|
if (numberToAbbreviate >= 1000000000) {
|
|
@@ -18,7 +18,12 @@ function abbreviateNumber(numberToAbbreviate) {
|
|
|
18
18
|
return str;
|
|
19
19
|
}
|
|
20
20
|
exports.abbreviateNumber = abbreviateNumber;
|
|
21
|
+
function WrapInParentheses(numberToWrap) {
|
|
22
|
+
return ' (' + numberToWrap + ')';
|
|
23
|
+
}
|
|
24
|
+
exports.WrapInParentheses = WrapInParentheses;
|
|
21
25
|
exports.NumberExtensions = {
|
|
22
26
|
abbreviateNumber,
|
|
27
|
+
WrapInParentheses,
|
|
23
28
|
};
|
|
24
29
|
exports.default = exports.NumberExtensions;
|
|
@@ -25,6 +25,7 @@ export declare const AdaptableObjectListItemView: React.FunctionComponent<{
|
|
|
25
25
|
suspendedEnabled?: boolean;
|
|
26
26
|
teamSharingActivated?: boolean;
|
|
27
27
|
disableDeleteConfirmation?: boolean;
|
|
28
|
+
module: IModule;
|
|
28
29
|
}>;
|
|
29
30
|
interface AdaptableObjectListItemProps {
|
|
30
31
|
data: AdaptableObjectView;
|
|
@@ -56,9 +56,16 @@ const AdaptableObjectListItemView = (props) => {
|
|
|
56
56
|
typeof tag.view === 'function'
|
|
57
57
|
? React.createElement(tag.view, {
|
|
58
58
|
data: props.abObject,
|
|
59
|
+
module: props.module,
|
|
59
60
|
})
|
|
60
61
|
: tag.view,
|
|
61
|
-
Boolean((tag === null || tag === void 0 ? void 0 : tag.values) && ((_a = tag === null || tag === void 0 ? void 0 : tag.values) === null || _a === void 0 ? void 0 : _a.length)) && (React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: tag.values, value: tag.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) }))
|
|
62
|
+
Boolean((tag === null || tag === void 0 ? void 0 : tag.values) && ((_a = tag === null || tag === void 0 ? void 0 : tag.values) === null || _a === void 0 ? void 0 : _a.length)) && (React.createElement(ValueSelector_1.ValueOptionsTags, { style: { marginRight: 0 }, readOnly: true, options: tag.values, value: tag.values, allowWrap: true, toIdentifier: (c) => c, toLabel: (c) => React.createElement(React.Fragment, null, c) })),
|
|
63
|
+
typeof tag.viewAfter === 'function'
|
|
64
|
+
? React.createElement(tag.viewAfter, {
|
|
65
|
+
data: props.abObject,
|
|
66
|
+
module: props.module,
|
|
67
|
+
})
|
|
68
|
+
: tag.viewAfter)));
|
|
62
69
|
})),
|
|
63
70
|
props.showActions && (React.createElement(rebass_1.Flex, { flexDirection: "column", className: `${baseClassName}__buttons` },
|
|
64
71
|
React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
@@ -121,7 +128,7 @@ const AdaptableObjectListItem = (props) => {
|
|
|
121
128
|
const disableDeleteConfirmationState = (0, react_redux_1.useSelector)((adaptableState) => SystemRedux.SystemDisableDeleteConfirmationSelector(adaptableState.System));
|
|
122
129
|
const disableDeleteConfirmation = disableDeleteConfirmationState || ((_h = adaptableOpttions === null || adaptableOpttions === void 0 ? void 0 : adaptableOpttions.generalOptions) === null || _h === void 0 ? void 0 : _h.disableDeleteConfirmation);
|
|
123
130
|
return (React.createElement(React.Fragment, null,
|
|
124
|
-
React.createElement(exports.AdaptableObjectListItemView, { disableDeleteConfirmation: disableDeleteConfirmation, abObject: props.data.abObject, accessLevel: accessLevel, actions: actions, className: itemClassName, handleOnEdit: handleOnEdit, items: props.data.items, showActions: showActions, showEditButton: showEditButton, style: props.data.style, teamSharingActivated: teamSharingActivated, onShare: (config) => adaptable.api.teamSharingApi.shareEntity(props.data.abObject, props.module.moduleInfo.ModuleName, config), entityType: entityType, deleteAction: deleteAction, deleteDisabled: props.deleteDisabled, deleteTooltip: props.deleteTooltip, editDisabled: isEditDisabled, suspendedEnabled: hasSuspend, onSuspend: () => dispatch(viewOptions.getSuspendAction(props.data.abObject)), onUnSuspend: () => dispatch(viewOptions.getUnSuspendAction(props.data.abObject)) }),
|
|
131
|
+
React.createElement(exports.AdaptableObjectListItemView, { module: props.module, disableDeleteConfirmation: disableDeleteConfirmation, abObject: props.data.abObject, accessLevel: accessLevel, actions: actions, className: itemClassName, handleOnEdit: handleOnEdit, items: props.data.items, showActions: showActions, showEditButton: showEditButton, style: props.data.style, teamSharingActivated: teamSharingActivated, onShare: (config) => adaptable.api.teamSharingApi.shareEntity(props.data.abObject, props.module.moduleInfo.ModuleName, config), entityType: entityType, deleteAction: deleteAction, deleteDisabled: props.deleteDisabled, deleteTooltip: props.deleteTooltip, editDisabled: isEditDisabled, suspendedEnabled: hasSuspend, onSuspend: () => dispatch(viewOptions.getSuspendAction(props.data.abObject)), onUnSuspend: () => dispatch(viewOptions.getUnSuspendAction(props.data.abObject)) }),
|
|
125
132
|
isEditWizardVisible && EditWizard && (React.createElement(EditWizard, { defaultCurrentSectionName: wizardStepName, moduleInfo: props.module.moduleInfo, data: props.data.abObject, configEntities: null, onCloseWizard: handleCloseWizard, onFinishWizard: handleCloseWizard }))));
|
|
126
133
|
};
|
|
127
134
|
exports.AdaptableObjectListItem = AdaptableObjectListItem;
|
|
@@ -78,7 +78,7 @@ const FilterSection = (props) => {
|
|
|
78
78
|
view: (React.createElement(PredicateEditor_1.PredicateEditor, { columnId: columnFilter.ColumnId, predicate: columnFilter.Predicate, predicateDefs: predicateDefs, onChange: (predicate) => handlePredicateEdit(predicate, columnFilter), onClear: () => handlePredicateEdit(null, columnFilter) })),
|
|
79
79
|
},
|
|
80
80
|
];
|
|
81
|
-
return (React.createElement(AdaptableObjectList_1.AdaptableObjectListItemView, { abObject: columnFilter, entityType: "Filter", showActions: true, showEditButton: false, items: items, onDelete: () => handleDelete(columnFilter), key: columnFilter.ColumnId }));
|
|
81
|
+
return (React.createElement(AdaptableObjectList_1.AdaptableObjectListItemView, { module: filterModule, abObject: columnFilter, entityType: "Filter", showActions: true, showEditButton: false, items: items, onDelete: () => handleDelete(columnFilter), key: columnFilter.ColumnId }));
|
|
82
82
|
}))))));
|
|
83
83
|
};
|
|
84
84
|
exports.FilterSection = FilterSection;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { AdaptableSharedEntity } from '../../../types';
|
|
4
|
+
import { IModule } from '../../Strategy/Interface/IModule';
|
|
3
5
|
export declare const SharedEntityTypeItemView: React.FunctionComponent<{
|
|
4
6
|
data: AdaptableSharedEntity;
|
|
5
7
|
}>;
|
|
6
8
|
export declare const getSharedEntityActiveStatusObjectView: (isDependency: boolean) => (props: {
|
|
7
9
|
data: AdaptableSharedEntity;
|
|
10
|
+
module?: IModule;
|
|
8
11
|
}) => JSX.Element;
|
|
9
12
|
export declare const getSharedEntityStaleDepsItemView: (staleDependencies: AdaptableSharedEntity[]) => () => JSX.Element;
|
|
@@ -11,7 +11,7 @@ interface ThemePopupProps extends ModuleViewPopupProps<ThemePopupComponent> {
|
|
|
11
11
|
declare class ThemePopupComponent extends React.Component<ThemePopupProps, {}> {
|
|
12
12
|
render(): JSX.Element;
|
|
13
13
|
onChangeTheme(value: string): void;
|
|
14
|
-
handleCreateNewTheme: () => void;
|
|
14
|
+
handleCreateNewTheme: (variant: 'dark' | 'light') => void;
|
|
15
15
|
}
|
|
16
16
|
export declare let ThemePopup: import("react-redux").ConnectedComponent<typeof ThemePopupComponent, any>;
|
|
17
17
|
export {};
|
|
@@ -10,13 +10,13 @@ const FormLayout_1 = tslib_1.__importStar(require("../../components/FormLayout")
|
|
|
10
10
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
|
|
11
11
|
const ThemeEditor_1 = require("./ThemeEditor");
|
|
12
12
|
const rebass_1 = require("rebass");
|
|
13
|
-
const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
|
|
14
13
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
|
|
15
14
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
15
|
+
const icons_1 = require("../../components/icons");
|
|
16
16
|
class ThemePopupComponent extends React.Component {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
|
-
this.handleCreateNewTheme = () => {
|
|
19
|
+
this.handleCreateNewTheme = (variant) => {
|
|
20
20
|
let nthItem = this.props.UserThemes.length + 1;
|
|
21
21
|
let name = 'Custom-Theme-' + nthItem;
|
|
22
22
|
// make sure it is unique
|
|
@@ -25,6 +25,7 @@ class ThemePopupComponent extends React.Component {
|
|
|
25
25
|
name = 'Custom-Theme-' + nthItem;
|
|
26
26
|
}
|
|
27
27
|
const newTheme = ObjectFactory_1.default.CreateEmptyTheme(name);
|
|
28
|
+
newTheme.Variant = variant;
|
|
28
29
|
this.props.api.themeApi.addUserTheme(newTheme);
|
|
29
30
|
this.props.api.themeApi.loadTheme(newTheme.Name);
|
|
30
31
|
};
|
|
@@ -50,11 +51,24 @@ class ThemePopupComponent extends React.Component {
|
|
|
50
51
|
const isCustomTheme = this.props.api.themeApi
|
|
51
52
|
.getUserThemes()
|
|
52
53
|
.some((theme) => theme.Name === this.props.CurrentTheme);
|
|
54
|
+
const disabled = this.props.accessLevel === 'ReadOnly';
|
|
55
|
+
const newButton = (React.createElement(DropdownButton_1.default, { ml: 2, disabled: disabled, tone: "accent", variant: "raised", columns: ['label'], items: [
|
|
56
|
+
{
|
|
57
|
+
label: 'Dark',
|
|
58
|
+
onClick: () => this.handleCreateNewTheme('dark'),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Light',
|
|
62
|
+
onClick: () => this.handleCreateNewTheme('light'),
|
|
63
|
+
},
|
|
64
|
+
] },
|
|
65
|
+
React.createElement(icons_1.Icon, { name: "plus" }),
|
|
66
|
+
" New"));
|
|
53
67
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), button: React.createElement(React.Fragment, null,
|
|
54
68
|
!this.props.hideShowInWindow && (React.createElement(SimpleButton_1.default, { icon: "open-in-new", onClick: () => {
|
|
55
69
|
this.props.api.themeApi.internalApi.openInWindow();
|
|
56
70
|
} })),
|
|
57
|
-
|
|
71
|
+
newButton) },
|
|
58
72
|
React.createElement(FormLayout_1.default, null,
|
|
59
73
|
React.createElement(FormLayout_1.FormRow, { label: "Current Theme:" },
|
|
60
74
|
React.createElement(DropdownButton_1.default, { "data-name": "select-theme-dropdown", columns: ['label'], style: { width: '50%', minWidth: 200 }, placeholder: "Select theme", value: this.props.CurrentTheme, items: optionThemes, accessLevel: this.props.accessLevel }, currentThemeDescription))),
|
|
@@ -196,6 +196,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
196
196
|
setCellValue(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
197
197
|
cancelEdit(): void;
|
|
198
198
|
isCellEditable(rowNode: IRowNode, column: Column): boolean;
|
|
199
|
+
getGridCellsForColumn(columnId: string): GridCell[] | undefined;
|
|
199
200
|
getDistinctValuesForColumn(column: AdaptableColumn, visibleRowsOnly: boolean, skipRowNode?: IRowNode, permittedValues?: any[]): GridCell[];
|
|
200
201
|
getDistinctFilterValuesForColumn(column: AdaptableColumn, visibleRowsOnly: boolean, filter: string, skipRowNode?: IRowNode): Promise<{
|
|
201
202
|
suppressClientSideFilter?: boolean;
|
|
@@ -347,7 +348,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
347
348
|
setDataSource(dataSource: any[]): void;
|
|
348
349
|
getGridData(): any[];
|
|
349
350
|
getFilteredData(): any[];
|
|
350
|
-
loadDataSource(dataSource: any[]): void;
|
|
351
351
|
updateRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
352
352
|
addRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
353
353
|
deleteRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1215,7 +1215,10 @@ class Adaptable {
|
|
|
1215
1215
|
if (abColumn.isExcludedFromQuickSearch) {
|
|
1216
1216
|
return false;
|
|
1217
1217
|
}
|
|
1218
|
-
if (!params.node
|
|
1218
|
+
if (!params.node) {
|
|
1219
|
+
return false;
|
|
1220
|
+
}
|
|
1221
|
+
if (!this.api.optionsApi.getSearchOptions().runQuickSearchOnRowGroups && params.node.group) {
|
|
1219
1222
|
return false;
|
|
1220
1223
|
}
|
|
1221
1224
|
let quickSearchValue = this.api.quickSearchApi.getQuickSearchValue();
|
|
@@ -1550,6 +1553,11 @@ class Adaptable {
|
|
|
1550
1553
|
updateLayoutFromGrid() {
|
|
1551
1554
|
var _a, _b;
|
|
1552
1555
|
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
1556
|
+
if (currentLayout.IsReadOnly) {
|
|
1557
|
+
// reaply the layout so the grid is reverted
|
|
1558
|
+
this.setLayout();
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1553
1561
|
const layout = Object.assign({}, currentLayout);
|
|
1554
1562
|
let columnOrder = [];
|
|
1555
1563
|
const columnFlexes = {};
|
|
@@ -1766,6 +1774,16 @@ class Adaptable {
|
|
|
1766
1774
|
// it's safe to rely on the AG Grid implementation because we override the colDef.editable property, which is in this case the single source of truth
|
|
1767
1775
|
return column === null || column === void 0 ? void 0 : column.isCellEditable(rowNode);
|
|
1768
1776
|
}
|
|
1777
|
+
getGridCellsForColumn(columnId) {
|
|
1778
|
+
let returnValues = [];
|
|
1779
|
+
this.gridOptions.api.forEachNode((rowNode) => {
|
|
1780
|
+
const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
|
|
1781
|
+
if (gridCell && gridCell.rawValue != undefined) {
|
|
1782
|
+
returnValues.push(gridCell);
|
|
1783
|
+
}
|
|
1784
|
+
});
|
|
1785
|
+
return returnValues;
|
|
1786
|
+
}
|
|
1769
1787
|
getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, permittedValues) {
|
|
1770
1788
|
let returnValues = [];
|
|
1771
1789
|
// this function does NOT look up for server values but actually it should...
|
|
@@ -2173,7 +2191,6 @@ class Adaptable {
|
|
|
2173
2191
|
this.redrawRows([rowNode]);
|
|
2174
2192
|
}
|
|
2175
2193
|
redrawRows(rowNodes) {
|
|
2176
|
-
// RedrawRowsParams
|
|
2177
2194
|
const redrawRowsParams = {
|
|
2178
2195
|
rowNodes,
|
|
2179
2196
|
};
|
|
@@ -4100,12 +4117,6 @@ class Adaptable {
|
|
|
4100
4117
|
});
|
|
4101
4118
|
return data;
|
|
4102
4119
|
}
|
|
4103
|
-
loadDataSource(dataSource) {
|
|
4104
|
-
if (this.hasAutogeneratedPrimaryKey()) {
|
|
4105
|
-
this.addSyntheticPrimaryKey(dataSource);
|
|
4106
|
-
}
|
|
4107
|
-
this.setDataSource(dataSource);
|
|
4108
|
-
}
|
|
4109
4120
|
updateRows(dataRows, dataUpdateConfig) {
|
|
4110
4121
|
if (this.hasAutogeneratedPrimaryKey()) {
|
|
4111
4122
|
this.addSyntheticPrimaryKeyIfMissing(dataRows);
|