@adaptabletools/adaptable 11.1.1-canary.1 → 11.1.2
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/README.md +6 -4
- package/agGrid.d.ts +2 -2
- package/base.css +6 -6
- package/bundle.cjs.js +97 -97
- package/index.css +7 -6
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
- package/src/AdaptableOptions/LayoutOptions.d.ts +11 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +9 -13
- package/src/Api/Implementation/EventApiImpl.js +2 -1
- package/src/Api/Implementation/GridApiImpl.js +9 -10
- package/src/Api/Implementation/InternalApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +7 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -1
- package/src/Api/QueryLanguageApi.d.ts +6 -6
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +5 -0
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/Interface/IModule.d.ts +2 -1
- package/src/Strategy/LayoutModule.d.ts +23 -0
- package/src/Strategy/LayoutModule.js +70 -0
- package/src/Strategy/Utilities/getFlashingCellStyleViewItems.d.ts +1 -0
- package/src/Strategy/Utilities/getFlashingCellStyleViewItems.js +2 -1
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +3 -6
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
- package/src/Utilities/Helpers/StyleHelper.d.ts +1 -0
- package/src/Utilities/Helpers/StyleHelper.js +13 -1
- package/src/View/AdaptableViewFactory.js +2 -4
- package/src/View/ColorPicker.d.ts +4 -2
- package/src/View/ColorPicker.js +16 -4
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +24 -19
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +3 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +23 -15
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +2 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +9 -5
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
- package/src/View/Components/RangesComponent.js +4 -6
- package/src/View/Components/StyleComponent.js +6 -9
- package/src/View/Components/ValueSelector/index.d.ts +1 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/Dashboard/CustomToolbarWrapper.js +9 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -3
- package/src/View/GridInfo/AdaptableObjectsSummary.d.ts +2 -0
- package/src/View/GridInfo/AdaptableObjectsSummary.js +26 -0
- package/src/View/GridInfo/GridInfoPopup.js +11 -3
- package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -4
- package/src/View/Layout/LayoutRadioSelector.d.ts +5 -0
- package/src/View/Layout/LayoutRadioSelector.js +18 -0
- package/src/View/Query/ExpandedQueryPopup.d.ts +2 -18
- package/src/View/Query/ExpandedQueryPopup.js +42 -57
- package/src/View/Query/QueryViewPanel.js +8 -5
- package/src/agGrid/ActionColumnRenderer.d.ts +1 -6
- package/src/agGrid/ActionColumnRenderer.js +50 -59
- package/src/agGrid/Adaptable.d.ts +3 -1
- package/src/agGrid/Adaptable.js +63 -27
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +16 -2
- package/src/components/ExpressionEditor/index.js +0 -1
- package/src/components/OverlayTrigger/index.js +1 -0
- package/src/components/Radio/index.d.ts +1 -1
- package/src/components/Radio/index.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +17 -10
- package/src/types.d.ts +5 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/LICENSE.md +0 -264
package/index.css
CHANGED
|
@@ -3645,6 +3645,9 @@ html.ab--theme-dark .ab-ListBoxFilterForm--aggrid-style {
|
|
|
3645
3645
|
max-height: 100%;
|
|
3646
3646
|
box-shadow: var(--ab-cmp-adaptable-window-popup__box-shadow); }
|
|
3647
3647
|
|
|
3648
|
+
.ab-Window-Modal .ab-Dialog__close-button {
|
|
3649
|
+
top: 3px; }
|
|
3650
|
+
|
|
3648
3651
|
.ab-Window-Modal .ab-Panel {
|
|
3649
3652
|
max-height: initial; }
|
|
3650
3653
|
|
|
@@ -3728,14 +3731,12 @@ html.ab--theme-dark .ab-ListBoxFilterForm--aggrid-style {
|
|
|
3728
3731
|
width: 100%; }
|
|
3729
3732
|
|
|
3730
3733
|
.ab-ActionColumn {
|
|
3731
|
-
|
|
3732
|
-
|
|
3734
|
+
height: 100%;
|
|
3735
|
+
display: flex;
|
|
3736
|
+
column-gap: var(--ab-space-1); }
|
|
3733
3737
|
|
|
3734
3738
|
.ab-ActionColumn > button.ab-SimpleButton {
|
|
3735
|
-
height: 100%;
|
|
3736
|
-
position: absolute;
|
|
3737
|
-
top: 0;
|
|
3738
|
-
left: 0; }
|
|
3739
|
+
height: 100%; }
|
|
3739
3740
|
|
|
3740
3741
|
.Toastify__toast-container {
|
|
3741
3742
|
border-style: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.2",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"blotter"
|
|
18
18
|
],
|
|
19
19
|
"homepage": "http://www.adaptabletools.com/",
|
|
20
|
-
"license": "
|
|
20
|
+
"license": "contact sales@adaptabletools.com for details",
|
|
21
21
|
"author": {
|
|
22
22
|
"name": "Jonny Wolfson",
|
|
23
23
|
"email": "jonny.wolfson@adaptabletools.com"
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1648639602191;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -164,7 +164,8 @@ export interface IAdaptable {
|
|
|
164
164
|
lookupPlugins(propertyName: string, ...args: any): any;
|
|
165
165
|
getPluginProperty(pluginId: string, propertyName: string, ...args: any): any;
|
|
166
166
|
getPlugin(pluginId: string): AdaptablePlugin;
|
|
167
|
-
|
|
167
|
+
setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: RowNode): void;
|
|
168
|
+
setCellValue(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
168
169
|
cancelEdit(): any;
|
|
169
170
|
isCellEditable(rowNode: RowNode, column: Column): boolean;
|
|
170
171
|
getFirstRowNode(): RowNode;
|
|
@@ -42,4 +42,15 @@ export interface LayoutOptions {
|
|
|
42
42
|
* @gridInfoItem
|
|
43
43
|
*/
|
|
44
44
|
createDefaultLayout?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Options to customize how layout items are shown in Settings Panel
|
|
47
|
+
*/
|
|
48
|
+
view?: {
|
|
49
|
+
/**
|
|
50
|
+
* How many columns to display in the inline layout preview
|
|
51
|
+
*
|
|
52
|
+
* @defaultValue 10
|
|
53
|
+
*/
|
|
54
|
+
maxColumnsToDisplay?: number;
|
|
55
|
+
};
|
|
45
56
|
}
|
|
@@ -33,29 +33,25 @@ export interface UserInterfaceOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
permittedValues?: PermittedValues[];
|
|
35
35
|
/**
|
|
36
|
-
* Dropdown values displayed when column is being edited
|
|
37
|
-
* When not defined it defaults to permittedValues.
|
|
36
|
+
* Dropdown values displayed when column is being edited; when not defined defaults to permittedValues
|
|
38
37
|
*/
|
|
39
38
|
editLookUpItems?: EditLookUpPermittedValues[];
|
|
40
39
|
/**
|
|
41
|
-
*
|
|
42
|
-
* When not defined it defaults to permittedValues.
|
|
40
|
+
* Custom column values for 'IN' filter; when not defined defaults to permittedValues
|
|
43
41
|
*/
|
|
44
42
|
filterPermittedValues?: FilterPermittedValues[];
|
|
45
43
|
/**
|
|
46
|
-
* Custom column values for defining
|
|
47
|
-
* When not defined it defaults to permittedValues.
|
|
44
|
+
* Custom column values for defining Custom Sort; when not defined defaults to permittedValues
|
|
48
45
|
*/
|
|
49
46
|
customSortPermittedValues?: CustomSortPermittedValues[];
|
|
50
47
|
/**
|
|
51
|
-
* Custom column values for editing via bulk-update
|
|
52
|
-
* When not defined it defaults to permittedValues.
|
|
48
|
+
* Custom column values for editing via bulk-update; when not defined defaults to permittedValues
|
|
53
49
|
*/
|
|
54
50
|
bulkUpdatePermittedValues?: BulkUpdatePermittedValues[];
|
|
55
51
|
/**
|
|
56
|
-
* Colours to display in Colour Picker (in place of AdapTable's default set)
|
|
52
|
+
* Colours to display in Colour Picker (in place of AdapTable's default set); can be hardcoded list or function
|
|
57
53
|
*/
|
|
58
|
-
colorPalette?: string[] | (() => string[]);
|
|
54
|
+
colorPalette?: string[] | ((currentTheme: string) => string[]);
|
|
59
55
|
/**
|
|
60
56
|
* Columns which contain an AdapTable Button - used for performing Actions
|
|
61
57
|
*/
|
|
@@ -155,9 +151,9 @@ export interface ActionColumn extends AdaptableObject {
|
|
|
155
151
|
*/
|
|
156
152
|
friendlyName?: string;
|
|
157
153
|
/**
|
|
158
|
-
* Button to display in the Column
|
|
154
|
+
* Button (or list of buttons) to display in the Column
|
|
159
155
|
*/
|
|
160
|
-
actionColumnButton: AdaptableButton<ActionColumnButtonContext
|
|
156
|
+
actionColumnButton: AdaptableButton<ActionColumnButtonContext> | AdaptableButton<ActionColumnButtonContext>[];
|
|
161
157
|
/**
|
|
162
158
|
* Shows Action Column also in grouped rows
|
|
163
159
|
*/
|
|
@@ -248,4 +244,4 @@ export interface BulkUpdatePermittedValuesParams extends BaseParams {
|
|
|
248
244
|
gridCells: GridCell[];
|
|
249
245
|
}
|
|
250
246
|
export declare type GridInfoSections = GridInfoSection[];
|
|
251
|
-
export declare type GridInfoSection = 'GridSummary' | 'AdaptableOptions' | 'ColumnInfo';
|
|
247
|
+
export declare type GridInfoSection = 'GridSummary' | 'AdaptableOptions' | 'ColumnInfo' | 'AdaptableObjectsSummary';
|
|
@@ -10,7 +10,8 @@ class EventApiImpl extends ApiBase_1.ApiBase {
|
|
|
10
10
|
this.on = (eventName, callback) => {
|
|
11
11
|
let result;
|
|
12
12
|
if (eventName === 'AdaptableReady') {
|
|
13
|
-
|
|
13
|
+
this.emitter.onIncludeFiredOnce(eventName).then(callback);
|
|
14
|
+
return () => { };
|
|
14
15
|
}
|
|
15
16
|
else {
|
|
16
17
|
result = this.emitter.on(eventName, callback);
|
|
@@ -6,6 +6,7 @@ const ApiBase_1 = require("./ApiBase");
|
|
|
6
6
|
const GridRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/GridRedux"));
|
|
7
7
|
const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
|
|
8
8
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
9
|
+
const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
9
10
|
class GridApiImpl extends ApiBase_1.ApiBase {
|
|
10
11
|
getGridState() {
|
|
11
12
|
return this.getAdaptableState().Grid;
|
|
@@ -48,22 +49,20 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
48
49
|
}
|
|
49
50
|
setCellValue(columnId, newValue, primaryKeyValue) {
|
|
50
51
|
const abColumn = this.adaptable.api.columnApi.getColumnFromId(columnId);
|
|
51
|
-
if (!abColumn
|
|
52
|
+
if (!abColumn) {
|
|
53
|
+
LoggingHelper_1.LogAdaptableWarning(`setCellValue() - column not found for columnId: ${columnId}`);
|
|
52
54
|
return;
|
|
53
55
|
}
|
|
54
56
|
const rowNode = this.getRowNodeForPrimaryKey(primaryKeyValue);
|
|
57
|
+
if (!rowNode) {
|
|
58
|
+
LoggingHelper_1.LogAdaptableWarning(`setCellValue() - rowNode not found for primaryKeyValue: ${primaryKeyValue}`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
55
61
|
if (!this.adaptable.isCellEditable(rowNode, this.adaptable.getAgGridColumnForColumnId(columnId))) {
|
|
62
|
+
LoggingHelper_1.LogAdaptableInfo(`setCellValue() - cell is not editable (primaryKeyValue: ${primaryKeyValue},columnId: ${columnId},value: ${newValue})`);
|
|
56
63
|
return;
|
|
57
64
|
}
|
|
58
|
-
|
|
59
|
-
primaryKeyValue: primaryKeyValue,
|
|
60
|
-
rawValue: newValue,
|
|
61
|
-
displayValue: newValue,
|
|
62
|
-
normalisedValue: newValue,
|
|
63
|
-
rowNode: rowNode,
|
|
64
|
-
column: abColumn,
|
|
65
|
-
};
|
|
66
|
-
this.adaptable.api.internalApi.setGridCell(gridCell);
|
|
65
|
+
this.adaptable.setDataValue(newValue, abColumn, primaryKeyValue, rowNode);
|
|
67
66
|
}
|
|
68
67
|
setCellsValue(gridCells) {
|
|
69
68
|
gridCells === null || gridCells === void 0 ? void 0 : gridCells.forEach((gridCell) => this.setCellValue(gridCell.columnId, gridCell.newValue, gridCell.primaryKeyValue));
|
|
@@ -198,7 +198,7 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
198
198
|
}
|
|
199
199
|
setGridCell(gridCell) {
|
|
200
200
|
const cellDataChangedInfo = this.createDataChangedInfoFromGridCell(gridCell);
|
|
201
|
-
this.adaptable.
|
|
201
|
+
this.adaptable.setCellValue(cellDataChangedInfo);
|
|
202
202
|
}
|
|
203
203
|
buildDataChangedInfo(config) {
|
|
204
204
|
var _a;
|
|
@@ -252,14 +252,20 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
252
252
|
}
|
|
253
253
|
showLayoutEditor(layoutName, action = 'Edit') {
|
|
254
254
|
const layout = layoutName ? this.getLayoutByName(layoutName) : this.getCurrentLayout();
|
|
255
|
+
const moduleInfo = this.adaptable.ModuleService.getModuleInfoByModule(ModuleConstants.LayoutModuleId);
|
|
255
256
|
let preparedAction = action;
|
|
256
257
|
if (!['Edit', 'New', 'Clone'].includes(action)) {
|
|
257
258
|
preparedAction = 'Edit';
|
|
258
259
|
LoggingHelper_1.LogAdaptableError(`When opening the layout editor the action must be one of: New, Clone, Edit; given: ${action}`);
|
|
259
260
|
}
|
|
261
|
+
let title = 'Layout Editor';
|
|
262
|
+
if (action === 'Edit') {
|
|
263
|
+
title = `Edit Layout${(layout === null || layout === void 0 ? void 0 : layout.Name) ? `: ${layout.Name}` : ''}`;
|
|
264
|
+
}
|
|
260
265
|
this.dispatchAction(PopupRedux.PopupShowWindow({
|
|
261
266
|
Id: windowFactory_1.WINDOW_LAYOUT_EDITOR,
|
|
262
|
-
Title:
|
|
267
|
+
Title: title,
|
|
268
|
+
Icon: moduleInfo.Glyph,
|
|
263
269
|
PopupProps: {
|
|
264
270
|
action: preparedAction,
|
|
265
271
|
layout,
|
|
@@ -8,7 +8,9 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
8
8
|
let colorPalette = this.getUserInterfaceOptions().colorPalette;
|
|
9
9
|
// first do the function then get hardcoded items
|
|
10
10
|
if (colorPalette != null && typeof colorPalette === 'function') {
|
|
11
|
-
|
|
11
|
+
const currentTheme = this.adaptable.api.themeApi.getCurrentTheme();
|
|
12
|
+
const colours = colorPalette(currentTheme);
|
|
13
|
+
return colours;
|
|
12
14
|
}
|
|
13
15
|
else {
|
|
14
16
|
let arr = colorPalette;
|
|
@@ -2,16 +2,16 @@ import { AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
|
2
2
|
import { ExpressionFunctionMap } from '../types';
|
|
3
3
|
import { AdaptableQuery } from '../PredefinedConfig/Common/AdaptableQuery';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Functions related to AdapTableQL (the Adaptable Query Language)
|
|
6
6
|
*/
|
|
7
7
|
export interface QueryLanguageApi {
|
|
8
8
|
/**
|
|
9
9
|
* Whether the given BooleanExpression is valid
|
|
10
|
-
* @param
|
|
10
|
+
* @param expression query to Check
|
|
11
11
|
* @param module module specific query
|
|
12
12
|
* @param validationErrorMessage optional validation error message; if provided, the error will be logged
|
|
13
13
|
*/
|
|
14
|
-
isValidBooleanExpression(
|
|
14
|
+
isValidBooleanExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Whether the given ObservableExpression is valid
|
|
17
17
|
* @param expression - ObservableExpression to check
|
|
@@ -34,7 +34,7 @@ export interface QueryLanguageApi {
|
|
|
34
34
|
*/
|
|
35
35
|
isValidAggregatedScalarExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Returns all Columns referenced in
|
|
37
|
+
* Returns all Columns referenced in an Expression
|
|
38
38
|
* @param expression - expression to check
|
|
39
39
|
*/
|
|
40
40
|
getColumnsFromExpression(expression: string): string[];
|
|
@@ -47,12 +47,12 @@ export interface QueryLanguageApi {
|
|
|
47
47
|
*/
|
|
48
48
|
getModuleExpressionFunctionMap(): ExpressionFunctionMap;
|
|
49
49
|
/**
|
|
50
|
-
* Runs the AST that AdapTableQL creates for
|
|
50
|
+
* Runs the AST that AdapTableQL creates for an Expression - useful when evaluating remotely
|
|
51
51
|
* @param expression expression to be run
|
|
52
52
|
*/
|
|
53
53
|
getASTForExpression(expression: string): any;
|
|
54
54
|
/**
|
|
55
|
-
* Returns the Expression string of the given AdaptableQuery
|
|
55
|
+
* Returns the Expression string of the given AdaptableQuery: can be Boolean, AggregatedBoolean, Scalar, AggregatedScalar or Observable Expression
|
|
56
56
|
* @param query - the AdaptableQuery
|
|
57
57
|
*/
|
|
58
58
|
getAdaptableQueryExpression(query: Partial<AdaptableQuery>): string | undefined;
|
|
@@ -645,7 +645,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
645
645
|
case QuickSearchRedux.QUICK_SEARCH_RUN: {
|
|
646
646
|
let returnAction = next(action);
|
|
647
647
|
adaptable.redrawBody();
|
|
648
|
-
// if set then
|
|
648
|
+
// if set then return a query on the text
|
|
649
649
|
if (adaptable.adaptableOptions.searchOptions.filterResultsAfterQuickSearch) {
|
|
650
650
|
const actionTyped = action;
|
|
651
651
|
const searchText = actionTyped.quickSearchText;
|
|
@@ -71,6 +71,11 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
71
71
|
label: 'Column Id',
|
|
72
72
|
values: [calculateColumn.ColumnId],
|
|
73
73
|
},
|
|
74
|
+
calculateColumn.FriendlyName && {
|
|
75
|
+
name: 'Settings',
|
|
76
|
+
label: 'Column Name',
|
|
77
|
+
values: [calculateColumn.FriendlyName],
|
|
78
|
+
},
|
|
74
79
|
getExpressionViewItems_1.getExpressionViewItems(calculateColumn.Query),
|
|
75
80
|
];
|
|
76
81
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(settingsTags)) {
|
|
@@ -75,7 +75,7 @@ class FreeTextColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
75
75
|
label: 'Data Type',
|
|
76
76
|
values: [(_a = freeTextColumn.DataType) !== null && _a !== void 0 ? _a : 'Not specified'],
|
|
77
77
|
},
|
|
78
|
-
freeTextColumn.DefaultValue
|
|
78
|
+
Boolean(freeTextColumn.DefaultValue) && {
|
|
79
79
|
name: 'Settings',
|
|
80
80
|
label: 'Default Value',
|
|
81
81
|
values: [freeTextColumn.DefaultValue],
|
|
@@ -74,11 +74,12 @@ export interface AdaptableObjectView {
|
|
|
74
74
|
export interface AdaptableModuleView {
|
|
75
75
|
/**
|
|
76
76
|
* List of actions.
|
|
77
|
-
* Allows to add
|
|
77
|
+
* Allows to add custom actions.
|
|
78
78
|
*/
|
|
79
79
|
actions?: React.FunctionComponent<{
|
|
80
80
|
data: AdaptableObject;
|
|
81
81
|
}>[];
|
|
82
|
+
onOpenEditPopup?: (abObject?: AdaptableObject) => void;
|
|
82
83
|
getDeleteAction?: (abObject: AdaptableObject) => Redux.Action;
|
|
83
84
|
getSuspendAction?: (abObject: AdaptableObject) => Redux.Action;
|
|
84
85
|
getUnSuspendAction?: (abObject: AdaptableObject) => Redux.Action;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
2
3
|
import { LayoutState, Layout } from '../PredefinedConfig/LayoutState';
|
|
3
4
|
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
5
|
+
import * as LayoutRedux from '../Redux/ActionsReducers/LayoutRedux';
|
|
4
6
|
import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
|
|
5
7
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
6
8
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
@@ -16,4 +18,25 @@ export declare class LayoutModule extends AdaptableModuleBase implements IModule
|
|
|
16
18
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
17
19
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
18
20
|
getTeamSharingAction(): TeamSharingImportInfo<Layout>;
|
|
21
|
+
toViewAll(): {
|
|
22
|
+
items: {
|
|
23
|
+
name: string;
|
|
24
|
+
values: string[];
|
|
25
|
+
}[];
|
|
26
|
+
abObject: Layout;
|
|
27
|
+
}[];
|
|
28
|
+
toView(layout: Layout): {
|
|
29
|
+
items: {
|
|
30
|
+
name: string;
|
|
31
|
+
values: string[];
|
|
32
|
+
}[];
|
|
33
|
+
abObject: Layout;
|
|
34
|
+
};
|
|
35
|
+
getViewProperties(): {
|
|
36
|
+
actions: import("react").FunctionComponent<{
|
|
37
|
+
data: Layout;
|
|
38
|
+
}>[];
|
|
39
|
+
getDeleteAction: (layout: Layout) => LayoutRedux.LayoutDeleteAction;
|
|
40
|
+
onOpenEditPopup: (layout?: Layout) => void;
|
|
41
|
+
};
|
|
19
42
|
}
|
|
@@ -6,6 +6,7 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
7
|
const LayoutRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/LayoutRedux"));
|
|
8
8
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
9
|
+
const LayoutRadioSelector_1 = require("../View/Layout/LayoutRadioSelector");
|
|
9
10
|
class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
10
11
|
constructor(api) {
|
|
11
12
|
super(ModuleConstants.LayoutModuleId, 'Layout', 'layout', 'LayoutPopup', 'Named sets of column visibility, order, groupings, aggregation, pivots etc.', api);
|
|
@@ -128,5 +129,74 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
128
129
|
EditAction: LayoutRedux.LayoutSave,
|
|
129
130
|
};
|
|
130
131
|
}
|
|
132
|
+
toViewAll() {
|
|
133
|
+
return this.getModuleAdaptableObjects().map((layout) => this.toView(layout));
|
|
134
|
+
}
|
|
135
|
+
toView(layout) {
|
|
136
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
137
|
+
const maxColumnsToDisplay = (_d = (_c = (_b = (_a = this.api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.layoutOptions) === null || _b === void 0 ? void 0 : _b.view) === null || _c === void 0 ? void 0 : _c.maxColumnsToDisplay) !== null && _d !== void 0 ? _d : 10;
|
|
138
|
+
const columnIdToFriendlyName = (columnId) => {
|
|
139
|
+
return this.api.columnApi.getFriendlyNameFromColumnId(columnId);
|
|
140
|
+
};
|
|
141
|
+
let columns = layout.Columns;
|
|
142
|
+
if (columns.length >
|
|
143
|
+
maxColumnsToDisplay + 1 /* +1 is to show tag only beginning with 2, 'other 2' */) {
|
|
144
|
+
const extraColumns = columns.length - maxColumnsToDisplay;
|
|
145
|
+
const firstNColumns = columns
|
|
146
|
+
.slice(0, maxColumnsToDisplay)
|
|
147
|
+
.map((colId) => columnIdToFriendlyName(colId));
|
|
148
|
+
columns = [...firstNColumns, `and other ${extraColumns}`];
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
items: [
|
|
152
|
+
{
|
|
153
|
+
name: 'Name',
|
|
154
|
+
values: [layout.Name],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'Columns',
|
|
158
|
+
values: columns,
|
|
159
|
+
},
|
|
160
|
+
((_e = layout.ColumnSorts) === null || _e === void 0 ? void 0 : _e.length) && {
|
|
161
|
+
name: 'Sort',
|
|
162
|
+
values: layout.ColumnSorts.map((customSort) => `[${columnIdToFriendlyName(customSort.ColumnId)}: ${customSort.SortOrder}]`),
|
|
163
|
+
},
|
|
164
|
+
((_f = layout === null || layout === void 0 ? void 0 : layout.RowGroupedColumns) === null || _f === void 0 ? void 0 : _f.length) && {
|
|
165
|
+
name: 'Grouped Columns',
|
|
166
|
+
values: layout.RowGroupedColumns.map((colId) => columnIdToFriendlyName(colId)),
|
|
167
|
+
},
|
|
168
|
+
((_g = layout === null || layout === void 0 ? void 0 : layout.PivotColumns) === null || _g === void 0 ? void 0 : _g.length) && {
|
|
169
|
+
name: 'Pivot Columns',
|
|
170
|
+
values: layout.PivotColumns.map((colId) => columnIdToFriendlyName(colId)),
|
|
171
|
+
},
|
|
172
|
+
(layout === null || layout === void 0 ? void 0 : layout.EnablePivot) && {
|
|
173
|
+
name: 'Pivot Enabled',
|
|
174
|
+
values: ['Yes'],
|
|
175
|
+
},
|
|
176
|
+
].filter(Boolean),
|
|
177
|
+
abObject: layout,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
getViewProperties() {
|
|
181
|
+
return {
|
|
182
|
+
actions: [LayoutRadioSelector_1.LayoutRadioSelector],
|
|
183
|
+
getDeleteAction: (layout) => {
|
|
184
|
+
// make sure we do not delete the last layout
|
|
185
|
+
if (this.getModuleAdaptableObjects().length === 1) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
return LayoutRedux.LayoutDelete(layout);
|
|
189
|
+
},
|
|
190
|
+
onOpenEditPopup: (layout) => {
|
|
191
|
+
if (!layout) {
|
|
192
|
+
// consider it is new
|
|
193
|
+
this.api.layoutApi.showLayoutEditor(null, 'New');
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.api.layoutApi.showLayoutEditor(layout.Name);
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
}
|
|
131
201
|
}
|
|
132
202
|
exports.LayoutModule = LayoutModule;
|
|
@@ -4,7 +4,8 @@ exports.getFlashingCellStyleViewItems = void 0;
|
|
|
4
4
|
const FlashingCellStyle_1 = require("../../View/FlashingCell/FlashingCellStyle");
|
|
5
5
|
exports.getFlashingCellStyleViewItems = () => {
|
|
6
6
|
return {
|
|
7
|
-
name: '
|
|
7
|
+
name: 'Flash Styles',
|
|
8
|
+
label: 'Change Style',
|
|
8
9
|
view: FlashingCellStyle_1.FlashingCellStyle,
|
|
9
10
|
};
|
|
10
11
|
};
|
|
@@ -11,4 +11,4 @@ exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptab
|
|
|
11
11
|
exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-aggregation#aggregated-scalar-expressions`;
|
|
12
12
|
exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-predicate`;
|
|
13
13
|
exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/guide/dev-guide-tutorial-primary-key`;
|
|
14
|
-
exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/licensing`;
|
|
14
|
+
exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/guide/licensing`;
|
|
@@ -131,6 +131,9 @@ exports.DefaultAdaptableOptions = {
|
|
|
131
131
|
autoSizeColumnsInLayout: false,
|
|
132
132
|
autoSizeColumnsInPivotLayout: false,
|
|
133
133
|
createDefaultLayout: false,
|
|
134
|
+
view: {
|
|
135
|
+
maxColumnsToDisplay: 10,
|
|
136
|
+
},
|
|
134
137
|
},
|
|
135
138
|
menuOptions: {
|
|
136
139
|
showAdaptableContextMenu: true,
|
|
@@ -10,6 +10,7 @@ exports.STANDALONE_MODULE_POPUPS = [
|
|
|
10
10
|
* This constants determines the order and the items that appear in the navigation.
|
|
11
11
|
*/
|
|
12
12
|
exports.DEFAULT_NAVIGATION_ITEMS = [
|
|
13
|
+
'GridInfo',
|
|
13
14
|
'Dashboard',
|
|
14
15
|
'ToolPanel',
|
|
15
16
|
'StateManagement',
|
|
@@ -31,7 +32,6 @@ exports.DEFAULT_NAVIGATION_ITEMS = [
|
|
|
31
32
|
'Schedule',
|
|
32
33
|
'Shortcut',
|
|
33
34
|
'-',
|
|
34
|
-
'GridInfo',
|
|
35
35
|
'SystemStatus',
|
|
36
36
|
'DataChangeHistory',
|
|
37
37
|
'TeamSharing',
|
|
@@ -7,7 +7,7 @@ declare class Emittery {
|
|
|
7
7
|
on(eventName: string, listener: EmitterCallback): any;
|
|
8
8
|
off(eventName: string, listener: EmitterCallback): void;
|
|
9
9
|
once(eventName: string): Promise<unknown>;
|
|
10
|
-
onIncludeFiredOnce(eventName: string
|
|
10
|
+
onIncludeFiredOnce(eventName: string): Promise<any>;
|
|
11
11
|
onIncludeFired(eventName: string, listener: EmitterCallback): any;
|
|
12
12
|
emit(eventName: string, eventData?: any): Promise<any[]>;
|
|
13
13
|
emitSync(eventName: string, eventData?: any): any[];
|
package/src/Utilities/Emitter.js
CHANGED
|
@@ -100,16 +100,13 @@ class Emittery {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
onIncludeFiredOnce(eventName
|
|
103
|
+
onIncludeFiredOnce(eventName) {
|
|
104
104
|
const triggeredEventsMap = triggeredMap.get(this);
|
|
105
105
|
const eventInfo = triggeredEventsMap.get(eventName);
|
|
106
106
|
if (eventInfo) {
|
|
107
|
-
|
|
108
|
-
return () => { };
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return this.on(eventName, listener);
|
|
107
|
+
return Promise.resolve(eventInfo.data);
|
|
112
108
|
}
|
|
109
|
+
return this.once(eventName);
|
|
113
110
|
}
|
|
114
111
|
onIncludeFired(eventName, listener) {
|
|
115
112
|
const triggeredEventsMap = triggeredMap.get(this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
-
declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
2
|
+
export declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
3
3
|
declare type AggregationFunction = 'SUM';
|
|
4
4
|
declare type ComparisonFunction = 'EQ' | 'NEQ' | 'LT' | 'GT' | 'LTE' | 'GTE';
|
|
5
5
|
export declare const aggregatedBooleanExpressionFunctions: Record<AggregationFunctionName, ExpressionFunction>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
-
declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | ObservableFunction | ChangeFunction;
|
|
2
|
+
export declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | ObservableFunction | ChangeFunction;
|
|
3
3
|
declare type ObservableFunction = 'ROW_CHANGE' | 'GRID_CHANGE';
|
|
4
4
|
declare type ChangeFunction = 'MAX' | 'MIN' | 'NONE' | 'COUNT';
|
|
5
5
|
export declare const observableExpressionFunctions: Record<ObservableFunctionName, ExpressionFunction>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toStyle = exports.convertCSSAbsoluteFontSizeToPt = exports.convertAdaptableStyleToCSS = void 0;
|
|
3
|
+
exports.getVariableColor = exports.toStyle = exports.convertCSSAbsoluteFontSizeToPt = exports.convertAdaptableStyleToCSS = void 0;
|
|
4
4
|
const EnumExtensions_1 = require("../Extensions/EnumExtensions");
|
|
5
5
|
exports.convertAdaptableStyleToCSS = (style) => {
|
|
6
6
|
let result = {};
|
|
@@ -45,3 +45,15 @@ exports.convertCSSAbsoluteFontSizeToPt = (fontSize) => {
|
|
|
45
45
|
exports.toStyle = (style) => {
|
|
46
46
|
return Object.assign(Object.assign({}, exports.convertAdaptableStyleToCSS(style !== null && style !== void 0 ? style : {})), { borderWidth: (style === null || style === void 0 ? void 0 : style.BorderColor) ? 2 : 0, borderStyle: 'solid' });
|
|
47
47
|
};
|
|
48
|
+
exports.getVariableColor = (variable) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const isVariable = (_a = variable === null || variable === void 0 ? void 0 : variable.startsWith) === null || _a === void 0 ? void 0 : _a.call(variable, 'var(');
|
|
51
|
+
if (!isVariable) {
|
|
52
|
+
return variable;
|
|
53
|
+
}
|
|
54
|
+
const match = /\((.+)\)/.exec(variable);
|
|
55
|
+
if (!match) {
|
|
56
|
+
return variable;
|
|
57
|
+
}
|
|
58
|
+
return getComputedStyle(document.documentElement).getPropertyValue(match[1]).trim();
|
|
59
|
+
};
|
|
@@ -4,10 +4,8 @@ exports.AdaptableViewPanelFactory = exports.AdaptableViewFactory = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const SmartEditPopup_1 = require("./SmartEdit/SmartEditPopup");
|
|
6
6
|
const QuickSearchPopup_1 = require("./QuickSearch/QuickSearchPopup");
|
|
7
|
-
const ExpandedQueryPopup_1 = require("./Query/ExpandedQueryPopup");
|
|
8
7
|
const ThemePopup_1 = require("./Theme/ThemePopup");
|
|
9
8
|
const ToolPanelPopup_1 = require("./Components/ToolPanel/ToolPanelPopup");
|
|
10
|
-
const LayoutPopup_1 = require("./Layout/LayoutPopup");
|
|
11
9
|
const GridInfoPopup_1 = require("./GridInfo/GridInfoPopup");
|
|
12
10
|
const TeamSharingPopup_1 = require("./TeamSharing/TeamSharingPopup");
|
|
13
11
|
const DashboardPopup_1 = require("./Dashboard/DashboardPopup");
|
|
@@ -33,12 +31,12 @@ const DataChangeHistoryPopup_1 = require("./DataChangeHistory/DataChangeHistoryP
|
|
|
33
31
|
const DataChangeHistoryViewPanel_1 = require("./DataChangeHistory/DataChangeHistoryViewPanel");
|
|
34
32
|
const StateManagementViewPanel_1 = require("./StateManagement/StateManagementViewPanel");
|
|
35
33
|
exports.AdaptableViewFactory = {
|
|
36
|
-
|
|
34
|
+
// ExpandedQueryPopup,
|
|
37
35
|
BulkUpdatePopup: BulkUpdatePopup_1.BulkUpdatePopup,
|
|
38
36
|
DashboardPopup: DashboardPopup_1.DashboardPopup,
|
|
39
37
|
StateManagementPopup: StateManagementPopup_1.StateManagementPopup,
|
|
40
38
|
GridInfoPopup: GridInfoPopup_1.GridInfoPopup,
|
|
41
|
-
|
|
39
|
+
// LayoutPopup,
|
|
42
40
|
QuickSearchPopup: QuickSearchPopup_1.QuickSearchPopup,
|
|
43
41
|
CellSummaryPopup: CellSummaryPopup_1.CellSummaryPopup,
|
|
44
42
|
SmartEditPopup: SmartEditPopup_1.SmartEditPopup,
|