@adaptabletools/adaptable 12.0.2 → 12.0.5
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 +100 -100
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/EditOptions.d.ts +6 -9
- package/src/AdaptableOptions/ExportOptions.d.ts +18 -3
- package/src/AdaptableOptions/Glue42PluginOptions.d.ts +1 -1
- package/src/AdaptableOptions/IPushPullPluginOptions.d.ts +1 -3
- package/src/Api/Events/SearchChanged.d.ts +1 -1
- package/src/Api/FinanceApi.d.ts +8 -8
- package/src/Api/FormatColumnApi.d.ts +5 -0
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FormatColumnApiImpl.js +23 -1
- package/src/Api/Implementation/InternalApiImpl.js +1 -2
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -0
- package/src/Api/Implementation/LayoutApiImpl.js +7 -1
- package/src/Api/LayoutApi.d.ts +5 -0
- package/src/Api/StatusBarApi.d.ts +3 -0
- package/src/PredefinedConfig/ChartingState.d.ts +1 -1
- package/src/PredefinedConfig/Common/CellSummary.d.ts +3 -0
- package/src/PredefinedConfig/Common/ColumnFilter.d.ts +9 -0
- package/src/PredefinedConfig/Common/FDC3Context.d.ts +12 -3
- package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +1 -2
- package/src/PredefinedConfig/Common/FilterActionOnDataChange.js +1 -2
- package/src/PredefinedConfig/ExportState.d.ts +6 -0
- package/src/PredefinedConfig/FormatColumnState.d.ts +4 -1
- package/src/PredefinedConfig/IPushPullState.d.ts +16 -5
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
- package/src/PredefinedConfig/ShortcutState.d.ts +1 -1
- package/src/PredefinedConfig/TeamSharingState.d.ts +6 -0
- package/src/Redux/ActionsReducers/GridRedux.d.ts +30 -1
- package/src/Redux/ActionsReducers/GridRedux.js +105 -2
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +10 -11
- package/src/Redux/ActionsReducers/LayoutRedux.js +10 -10
- package/src/Redux/Store/AdaptableStore.js +43 -8
- package/src/Strategy/FormatColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +2 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -0
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +4 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +7 -7
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +3 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +26 -4
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +5 -5
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +3 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +11 -11
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +3 -0
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +2 -2
- package/src/Utilities/Helpers/FormatHelper.js +3 -2
- package/src/Utilities/Helpers/Helper.js +1 -1
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +4 -4
- package/src/View/Filter/FilterSummary.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +1 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +30 -27
- package/src/View/Layout/LayoutViewPanel.d.ts +2 -2
- package/src/View/Layout/LayoutViewPanel.js +5 -5
- package/src/View/Layout/SaveLayoutButton.d.ts +2 -0
- package/src/View/Layout/SaveLayoutButton.js +30 -0
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +149 -6
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +2 -6
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GridReducer = exports.SetModuleButtonMenuItems = exports.SetSettingPanelModuleMenuItems = exports.SetTreeModeOff = exports.SetTreeModeOn = exports.SetPivotModeOff = exports.SetPivotModeOn = exports.GridRefreshCells = exports.GridSetCellSummary = exports.GridCreateCellSummary = exports.GridSetSelectedRows = exports.GridSetSelectedCells = exports.GridClearSort = exports.GridSetSort = exports.GridEditColumn = exports.GridRemoveColumn = exports.GridAddColumns = exports.GridAddColumn = exports.GridSetColumns = exports.GRID_SET_TREE_MODE_OFF = exports.GRID_SET_TREE_MODE_ON = exports.GRID_SET_PIVOT_MODE_OFF = exports.GRID_SET_PIVOT_MODE_ON = exports.GRID_SET_MODULE_BUTTON_MENUITEMS = exports.GRID_SET_MODULE_DROPDOWN_MENUITEMS = exports.GRID_REFRESH_CELLS = exports.GRID_SET_CELLS_SUMMARY = exports.GRID_CREATE_CELLS_SUMMARY = exports.GRID_SET_SELECTED_ROWS = exports.GRID_SET_SELECTED_CELLS = exports.GRID_CLEAR_SORT = exports.GRID_SET_SORT = exports.GRID_EDIT_COLUMN = exports.GRID_REMOVE_COLUMN = exports.GRID_ADD_COLUMNS = exports.GRID_ADD_COLUMN = exports.GRID_SET_COLUMNS = void 0;
|
|
3
|
+
exports.GridReducer = exports.LayoutDraftColumnFilterClearAll = exports.LayoutDraftColumnFilterClear = exports.LayoutDraftColumnFilterSet = exports.LayoutDraftColumnFilterEdit = exports.LayoutDraftColumnFilterAdd = exports.LayoutUpdateCurrentDraft = exports.SetModuleButtonMenuItems = exports.SetSettingPanelModuleMenuItems = exports.SetTreeModeOff = exports.SetTreeModeOn = exports.SetPivotModeOff = exports.SetPivotModeOn = exports.GridRefreshCells = exports.GridSetCellSummary = exports.GridCreateCellSummary = exports.GridSetSelectedRows = exports.GridSetSelectedCells = exports.GridClearSort = exports.GridSetSort = exports.GridEditColumn = exports.GridRemoveColumn = exports.GridAddColumns = exports.GridAddColumn = exports.GridSetColumns = exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR = exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR_ALL = exports.LAYOUT_DRAFT_COLUMN_FILTER_SET = exports.LAYOUT_DRAFT_COLUMN_FILTER_EDIT = exports.LAYOUT_DRAFT_COLUMN_FILTER_ADD = exports.LAYOUT_UPDATE_CURRENT_DRAFT = exports.GRID_SET_TREE_MODE_OFF = exports.GRID_SET_TREE_MODE_ON = exports.GRID_SET_PIVOT_MODE_OFF = exports.GRID_SET_PIVOT_MODE_ON = exports.GRID_SET_MODULE_BUTTON_MENUITEMS = exports.GRID_SET_MODULE_DROPDOWN_MENUITEMS = exports.GRID_REFRESH_CELLS = exports.GRID_SET_CELLS_SUMMARY = exports.GRID_CREATE_CELLS_SUMMARY = exports.GRID_SET_SELECTED_ROWS = exports.GRID_SET_SELECTED_CELLS = exports.GRID_CLEAR_SORT = exports.GRID_SET_SORT = exports.GRID_EDIT_COLUMN = exports.GRID_REMOVE_COLUMN = exports.GRID_ADD_COLUMNS = exports.GRID_ADD_COLUMN = exports.GRID_SET_COLUMNS = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
5
6
|
const LayoutRedux_1 = require("./LayoutRedux");
|
|
7
|
+
const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
|
|
6
8
|
/**
|
|
7
9
|
* @ReduxAction Columns have been set in the Grid
|
|
8
10
|
*/
|
|
@@ -75,6 +77,12 @@ exports.GRID_SET_TREE_MODE_ON = 'GRID_SET_TREE_MODE_ON';
|
|
|
75
77
|
* @ReduxAction Grid is taken out of tree mode
|
|
76
78
|
*/
|
|
77
79
|
exports.GRID_SET_TREE_MODE_OFF = 'GRID_SET_TREE_MODE_OFF';
|
|
80
|
+
exports.LAYOUT_UPDATE_CURRENT_DRAFT = 'LAYOUT_UPDATE_CURRENT_DRAFT';
|
|
81
|
+
exports.LAYOUT_DRAFT_COLUMN_FILTER_ADD = 'LAYOUT_DRAFT_COLUMN_FILTER_ADD';
|
|
82
|
+
exports.LAYOUT_DRAFT_COLUMN_FILTER_EDIT = 'LAYOUT_DRAFT_COLUMN_FILTER_EDIT';
|
|
83
|
+
exports.LAYOUT_DRAFT_COLUMN_FILTER_SET = 'LAYOUT_DRAFT_COLUMN_FILTER_SET';
|
|
84
|
+
exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR_ALL = 'LAYOUT_DRAFT_COLUMN_FILTER_CLEAR_ALL';
|
|
85
|
+
exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR = 'LAYOUT_DRAFT_COLUMN_FILTER_CLEAR';
|
|
78
86
|
const GridSetColumns = (Columns) => ({
|
|
79
87
|
type: exports.GRID_SET_COLUMNS,
|
|
80
88
|
columns: Columns,
|
|
@@ -160,6 +168,35 @@ const SetModuleButtonMenuItems = (MenuItems) => ({
|
|
|
160
168
|
menuItems: MenuItems,
|
|
161
169
|
});
|
|
162
170
|
exports.SetModuleButtonMenuItems = SetModuleButtonMenuItems;
|
|
171
|
+
const LayoutUpdateCurrentDraft = (layout) => ({
|
|
172
|
+
type: exports.LAYOUT_UPDATE_CURRENT_DRAFT,
|
|
173
|
+
layout,
|
|
174
|
+
});
|
|
175
|
+
exports.LayoutUpdateCurrentDraft = LayoutUpdateCurrentDraft;
|
|
176
|
+
const LayoutDraftColumnFilterAdd = (columnFilter) => ({
|
|
177
|
+
type: exports.LAYOUT_DRAFT_COLUMN_FILTER_ADD,
|
|
178
|
+
columnFilter,
|
|
179
|
+
});
|
|
180
|
+
exports.LayoutDraftColumnFilterAdd = LayoutDraftColumnFilterAdd;
|
|
181
|
+
const LayoutDraftColumnFilterEdit = (columnFilter) => ({
|
|
182
|
+
type: exports.LAYOUT_DRAFT_COLUMN_FILTER_EDIT,
|
|
183
|
+
columnFilter,
|
|
184
|
+
});
|
|
185
|
+
exports.LayoutDraftColumnFilterEdit = LayoutDraftColumnFilterEdit;
|
|
186
|
+
const LayoutDraftColumnFilterSet = (columnFilter) => ({
|
|
187
|
+
type: exports.LAYOUT_DRAFT_COLUMN_FILTER_SET,
|
|
188
|
+
columnFilter,
|
|
189
|
+
});
|
|
190
|
+
exports.LayoutDraftColumnFilterSet = LayoutDraftColumnFilterSet;
|
|
191
|
+
const LayoutDraftColumnFilterClear = (columnFilter) => ({
|
|
192
|
+
type: exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR,
|
|
193
|
+
columnFilter,
|
|
194
|
+
});
|
|
195
|
+
exports.LayoutDraftColumnFilterClear = LayoutDraftColumnFilterClear;
|
|
196
|
+
const LayoutDraftColumnFilterClearAll = () => ({
|
|
197
|
+
type: exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR_ALL,
|
|
198
|
+
});
|
|
199
|
+
exports.LayoutDraftColumnFilterClearAll = LayoutDraftColumnFilterClearAll;
|
|
163
200
|
const initialState = {
|
|
164
201
|
Columns: GeneralConstants_1.EMPTY_ARRAY,
|
|
165
202
|
CurrentLayout: null,
|
|
@@ -173,6 +210,7 @@ const initialState = {
|
|
|
173
210
|
IsGridInTreeMode: false,
|
|
174
211
|
};
|
|
175
212
|
const GridReducer = (state = initialState, action) => {
|
|
213
|
+
var _a, _b, _c, _d;
|
|
176
214
|
switch (action.type) {
|
|
177
215
|
case exports.GRID_SET_COLUMNS:
|
|
178
216
|
return Object.assign({}, state, {
|
|
@@ -222,12 +260,77 @@ const GridReducer = (state = initialState, action) => {
|
|
|
222
260
|
const menuItems = actionTyped.menuItems.sort((a, b) => a.label < b.label ? -1 : a.label > b.label ? 1 : 0);
|
|
223
261
|
return Object.assign({}, state, { ModuleButtonMenuItems: menuItems });
|
|
224
262
|
}
|
|
225
|
-
case
|
|
263
|
+
case exports.LAYOUT_UPDATE_CURRENT_DRAFT: {
|
|
226
264
|
const currentDraftLayout = action.layout;
|
|
227
265
|
return Object.assign({}, state, {
|
|
228
266
|
CurrentLayout: currentDraftLayout,
|
|
229
267
|
});
|
|
230
268
|
}
|
|
269
|
+
case exports.LAYOUT_DRAFT_COLUMN_FILTER_SET: {
|
|
270
|
+
const currentDraftLayout = state.CurrentLayout;
|
|
271
|
+
if (currentDraftLayout) {
|
|
272
|
+
let columnFilters = (_a = currentDraftLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
|
|
273
|
+
const columnFilterAction = action
|
|
274
|
+
.columnFilter;
|
|
275
|
+
AdaptableHelper_1.default.addUuidAndSource(columnFilterAction);
|
|
276
|
+
columnFilters = columnFilters
|
|
277
|
+
.filter((colFilter) => {
|
|
278
|
+
return colFilter.ColumnId !== columnFilterAction.ColumnId;
|
|
279
|
+
})
|
|
280
|
+
.concat(columnFilterAction);
|
|
281
|
+
return Object.assign({}, state, {
|
|
282
|
+
CurrentLayout: Object.assign(Object.assign({}, currentDraftLayout), { ColumnFilters: columnFilters }),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
case exports.LAYOUT_DRAFT_COLUMN_FILTER_ADD: {
|
|
287
|
+
const currentDraftLayout = state.CurrentLayout;
|
|
288
|
+
if (currentDraftLayout) {
|
|
289
|
+
let columnFilters = [...((_b = currentDraftLayout.ColumnFilters) !== null && _b !== void 0 ? _b : [])];
|
|
290
|
+
const columnFilterAction = action
|
|
291
|
+
.columnFilter;
|
|
292
|
+
AdaptableHelper_1.default.addUuidAndSource(columnFilterAction);
|
|
293
|
+
columnFilters.push(columnFilterAction);
|
|
294
|
+
return Object.assign({}, state, {
|
|
295
|
+
CurrentLayout: Object.assign(Object.assign({}, currentDraftLayout), { ColumnFilters: columnFilters }),
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
case exports.LAYOUT_DRAFT_COLUMN_FILTER_EDIT: {
|
|
300
|
+
const currentDraftLayout = state.CurrentLayout;
|
|
301
|
+
if (currentDraftLayout) {
|
|
302
|
+
const columnFilterAction = action
|
|
303
|
+
.columnFilter;
|
|
304
|
+
let columnFilters = ((_c = currentDraftLayout.ColumnFilters) !== null && _c !== void 0 ? _c : []).map((abObject) => abObject.Uuid === columnFilterAction.Uuid ? columnFilterAction : abObject);
|
|
305
|
+
return Object.assign({}, state, {
|
|
306
|
+
CurrentLayout: Object.assign(Object.assign({}, currentDraftLayout), { ColumnFilters: columnFilters }),
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
case exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR: {
|
|
311
|
+
const currentDraftLayout = state.CurrentLayout;
|
|
312
|
+
if (currentDraftLayout) {
|
|
313
|
+
let columnFilters = [...((_d = currentDraftLayout.ColumnFilters) !== null && _d !== void 0 ? _d : [])];
|
|
314
|
+
const actionTypedDelete = action;
|
|
315
|
+
const index = actionTypedDelete.columnFilter
|
|
316
|
+
? columnFilters.findIndex((i) => i.Uuid == actionTypedDelete.columnFilter.Uuid)
|
|
317
|
+
: -1;
|
|
318
|
+
if (index != -1) {
|
|
319
|
+
columnFilters.splice(index, 1);
|
|
320
|
+
}
|
|
321
|
+
return Object.assign({}, state, {
|
|
322
|
+
CurrentLayout: Object.assign(Object.assign({}, currentDraftLayout), { ColumnFilters: columnFilters }),
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
case exports.LAYOUT_DRAFT_COLUMN_FILTER_CLEAR_ALL: {
|
|
327
|
+
const currentDraftLayout = state.CurrentLayout;
|
|
328
|
+
if (currentDraftLayout) {
|
|
329
|
+
return Object.assign({}, state, {
|
|
330
|
+
CurrentLayout: Object.assign(Object.assign({}, currentDraftLayout), { ColumnFilters: [] }),
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
231
334
|
case LayoutRedux_1.LAYOUT_SELECT: {
|
|
232
335
|
return Object.assign({}, state, {
|
|
233
336
|
CurrentLayout: null,
|
|
@@ -22,6 +22,9 @@ export declare const LAYOUT_SELECT = "LAYOUT_SELECT";
|
|
|
22
22
|
* @ReduxAction A Layout has been (auto)saved
|
|
23
23
|
*/
|
|
24
24
|
export declare const LAYOUT_SAVE = "LAYOUT_SAVE";
|
|
25
|
+
/**
|
|
26
|
+
* @ReduxAction A Column has been removed
|
|
27
|
+
*/
|
|
25
28
|
export declare const LAYOUT_REMOVE_COLUMN = "LAYOUT_REMOVE_COLUMN";
|
|
26
29
|
/**
|
|
27
30
|
* @ReduxAction A Column Filter has been added
|
|
@@ -50,22 +53,21 @@ export interface LayoutColumnFilterAddAction extends LayoutColumnFilterAction {
|
|
|
50
53
|
}
|
|
51
54
|
export interface LayoutColumnFilterEditAction extends LayoutColumnFilterAction {
|
|
52
55
|
}
|
|
53
|
-
export interface
|
|
56
|
+
export interface LayoutColumnFilterSetAction extends LayoutColumnFilterAction {
|
|
54
57
|
}
|
|
55
|
-
export interface
|
|
58
|
+
export interface LayoutColumnFilterClearAction extends LayoutColumnFilterAction {
|
|
56
59
|
}
|
|
57
|
-
export interface
|
|
60
|
+
export interface LayoutColumnFilterClearAllAction extends Redux.Action {
|
|
58
61
|
}
|
|
59
62
|
export declare const LayoutColumnFilterAdd: (columnFilter: ColumnFilter) => LayoutColumnFilterAddAction;
|
|
60
63
|
export declare const LayoutColumnFilterEdit: (columnFilter: ColumnFilter) => LayoutColumnFilterEditAction;
|
|
61
|
-
export declare const LayoutColumnFilterSet: (columnFilter: ColumnFilter) =>
|
|
62
|
-
export declare const LayoutColumnFilterClearAll: () =>
|
|
63
|
-
export declare const LayoutColumnFilterClear: (columnFilter: ColumnFilter) =>
|
|
64
|
+
export declare const LayoutColumnFilterSet: (columnFilter: ColumnFilter) => LayoutColumnFilterSetAction;
|
|
65
|
+
export declare const LayoutColumnFilterClearAll: () => LayoutColumnFilterClearAllAction;
|
|
66
|
+
export declare const LayoutColumnFilterClear: (columnFilter: ColumnFilter) => LayoutColumnFilterClearAction;
|
|
64
67
|
/**
|
|
65
68
|
* @ReduxAction A new caption / header has been set for a Column in the Layout
|
|
66
69
|
*/
|
|
67
70
|
export declare const LAYOUT_SET_COLUMN_CAPTION = "LAYOUT_SET_COLUMN_CAPTION";
|
|
68
|
-
export declare const LAYOUT_UPDATE_CURRENT_DRAFT = "LAYOUT_UPDATE_CURRENT_DRAFT";
|
|
69
71
|
/**
|
|
70
72
|
* @ReduxAction Layout Module is ready
|
|
71
73
|
*/
|
|
@@ -90,8 +92,6 @@ export interface LayoutRemoveColumnAction extends Redux.Action {
|
|
|
90
92
|
layoutName: string;
|
|
91
93
|
columnId: string;
|
|
92
94
|
}
|
|
93
|
-
export interface LayoutUpdateCurrentDraftAction extends LayoutAction {
|
|
94
|
-
}
|
|
95
95
|
export interface LayoutSelectAction extends Redux.Action {
|
|
96
96
|
layoutName: string;
|
|
97
97
|
}
|
|
@@ -106,9 +106,8 @@ export declare const LayoutAdd: (layout: Layout) => LayoutAddAction;
|
|
|
106
106
|
export declare const LayoutDelete: (layout: Layout) => LayoutDeleteAction;
|
|
107
107
|
export declare const LayoutSave: (layout: Layout) => LayoutSaveAction;
|
|
108
108
|
export declare const LayoutSetColumnCaption: (layoutName: string, columnId: string, caption: string) => LayoutSetColumnCaptionAction;
|
|
109
|
-
export declare const
|
|
109
|
+
export declare const LayoutRemoveColumn: (layoutName: string, columnId: string) => LayoutRemoveColumnAction;
|
|
110
110
|
export declare const LayoutSelect: (layoutName: string) => LayoutSelectAction;
|
|
111
|
-
export declare const LayoutUpdateCurrentDraft: (layout: Layout) => LayoutUpdateCurrentDraftAction;
|
|
112
111
|
export declare const LayoutReady: (layoutState: LayoutState) => LayoutReadyAction;
|
|
113
112
|
export declare const getColumnFilterSelector: (state: AdaptableState) => ColumnFilter[];
|
|
114
113
|
export declare const LayoutReducer: Redux.Reducer<LayoutState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LayoutReducer = exports.getColumnFilterSelector = exports.LayoutReady = exports.
|
|
3
|
+
exports.LayoutReducer = exports.getColumnFilterSelector = exports.LayoutReady = exports.LayoutSelect = exports.LayoutRemoveColumn = exports.LayoutSetColumnCaption = exports.LayoutSave = exports.LayoutDelete = exports.LayoutAdd = exports.LAYOUT_READY = exports.LAYOUT_SET_COLUMN_CAPTION = exports.LayoutColumnFilterClear = exports.LayoutColumnFilterClearAll = exports.LayoutColumnFilterSet = exports.LayoutColumnFilterEdit = exports.LayoutColumnFilterAdd = exports.LAYOUT_COLUMN_FILTER_CLEAR = exports.LAYOUT_COLUMN_FILTER_CLEAR_ALL = exports.LAYOUT_COLUMN_FILTER_SET = exports.LAYOUT_COLUMN_FILTER_EDIT = exports.LAYOUT_COLUMN_FILTER_ADD = exports.LAYOUT_REMOVE_COLUMN = exports.LAYOUT_SAVE = exports.LAYOUT_SELECT = exports.LAYOUT_DELETE = exports.LAYOUT_EDIT = exports.LAYOUT_ADD = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
6
6
|
const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
|
|
@@ -24,6 +24,9 @@ exports.LAYOUT_SELECT = 'LAYOUT_SELECT';
|
|
|
24
24
|
* @ReduxAction A Layout has been (auto)saved
|
|
25
25
|
*/
|
|
26
26
|
exports.LAYOUT_SAVE = 'LAYOUT_SAVE';
|
|
27
|
+
/**
|
|
28
|
+
* @ReduxAction A Column has been removed
|
|
29
|
+
*/
|
|
27
30
|
exports.LAYOUT_REMOVE_COLUMN = 'LAYOUT_REMOVE_COLUMN';
|
|
28
31
|
/**
|
|
29
32
|
* @ReduxAction A Column Filter has been added
|
|
@@ -74,7 +77,6 @@ exports.LayoutColumnFilterClear = LayoutColumnFilterClear;
|
|
|
74
77
|
* @ReduxAction A new caption / header has been set for a Column in the Layout
|
|
75
78
|
*/
|
|
76
79
|
exports.LAYOUT_SET_COLUMN_CAPTION = 'LAYOUT_SET_COLUMN_CAPTION';
|
|
77
|
-
exports.LAYOUT_UPDATE_CURRENT_DRAFT = 'LAYOUT_UPDATE_CURRENT_DRAFT';
|
|
78
80
|
/**
|
|
79
81
|
* @ReduxAction Layout Module is ready
|
|
80
82
|
*/
|
|
@@ -101,22 +103,17 @@ const LayoutSetColumnCaption = (layoutName, columnId, caption) => ({
|
|
|
101
103
|
caption,
|
|
102
104
|
});
|
|
103
105
|
exports.LayoutSetColumnCaption = LayoutSetColumnCaption;
|
|
104
|
-
const
|
|
106
|
+
const LayoutRemoveColumn = (layoutName, columnId) => ({
|
|
105
107
|
type: exports.LAYOUT_REMOVE_COLUMN,
|
|
106
108
|
layoutName,
|
|
107
109
|
columnId,
|
|
108
110
|
});
|
|
109
|
-
exports.
|
|
111
|
+
exports.LayoutRemoveColumn = LayoutRemoveColumn;
|
|
110
112
|
const LayoutSelect = (layoutName) => ({
|
|
111
113
|
type: exports.LAYOUT_SELECT,
|
|
112
114
|
layoutName,
|
|
113
115
|
});
|
|
114
116
|
exports.LayoutSelect = LayoutSelect;
|
|
115
|
-
const LayoutUpdateCurrentDraft = (layout) => ({
|
|
116
|
-
type: exports.LAYOUT_UPDATE_CURRENT_DRAFT,
|
|
117
|
-
layout,
|
|
118
|
-
});
|
|
119
|
-
exports.LayoutUpdateCurrentDraft = LayoutUpdateCurrentDraft;
|
|
120
117
|
const LayoutReady = (layoutState) => ({
|
|
121
118
|
type: exports.LAYOUT_READY,
|
|
122
119
|
layoutState,
|
|
@@ -124,7 +121,10 @@ const LayoutReady = (layoutState) => ({
|
|
|
124
121
|
exports.LayoutReady = LayoutReady;
|
|
125
122
|
const getColumnFilterSelector = (state) => {
|
|
126
123
|
var _a, _b, _c, _d;
|
|
127
|
-
|
|
124
|
+
// in case of non-saving Layouts, we load the current Layout(possibly draft) from GridState
|
|
125
|
+
const currentLayout = state.Grid.CurrentLayout
|
|
126
|
+
? state.Grid.CurrentLayout
|
|
127
|
+
: (_c = (_b = (_a = state.Layout) === null || _a === void 0 ? void 0 : _a.Layouts) === null || _b === void 0 ? void 0 : _b.find) === null || _c === void 0 ? void 0 : _c.call(_b, (layout) => layout.Name === state.Layout.CurrentLayout);
|
|
128
128
|
return (_d = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.ColumnFilters) !== null && _d !== void 0 ? _d : [];
|
|
129
129
|
};
|
|
130
130
|
exports.getColumnFilterSelector = getColumnFilterSelector;
|
|
@@ -281,7 +281,7 @@ exports.AdaptableStore = AdaptableStore;
|
|
|
281
281
|
const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
282
282
|
return function (next) {
|
|
283
283
|
return function (action) {
|
|
284
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
284
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
285
285
|
switch (action.type) {
|
|
286
286
|
/*******************
|
|
287
287
|
* NAMED QUERY ACTIONS
|
|
@@ -682,12 +682,18 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
682
682
|
if (adaptable.adaptableOptions.searchOptions.filterResultsAfterQuickSearch) {
|
|
683
683
|
const actionTyped = action;
|
|
684
684
|
const searchText = actionTyped.quickSearchText;
|
|
685
|
+
// const gridOptions = adaptable.api.gridApi.getAgGridInstance();
|
|
685
686
|
if (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(searchText)) {
|
|
687
|
+
// Currently using this but any searchable would allow us to limit the cols checked
|
|
686
688
|
const queryText = 'ANY_CONTAINS("' + searchText + '") ';
|
|
689
|
+
// const queryText = 'ANY_SEARCHABLE_CONTAINS("' + searchText + '") ';
|
|
687
690
|
adaptable.api.queryApi.setCurrentQuery(queryText);
|
|
691
|
+
// Better still would be to use ag grid if that is possible?
|
|
692
|
+
// gridOptions.api.setQuickFilter(searchText);
|
|
688
693
|
}
|
|
689
694
|
else {
|
|
690
695
|
adaptable.api.queryApi.clearCurrentQuery();
|
|
696
|
+
// gridOptions.api.setQuickFilter('');
|
|
691
697
|
}
|
|
692
698
|
}
|
|
693
699
|
return returnAction;
|
|
@@ -714,9 +720,38 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
714
720
|
case LayoutRedux.LAYOUT_COLUMN_FILTER_ADD:
|
|
715
721
|
case LayoutRedux.LAYOUT_COLUMN_FILTER_EDIT:
|
|
716
722
|
case LayoutRedux.LAYOUT_COLUMN_FILTER_SET:
|
|
717
|
-
case LayoutRedux.
|
|
718
|
-
case LayoutRedux.
|
|
719
|
-
let returnAction
|
|
723
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_CLEAR:
|
|
724
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_CLEAR_ALL: {
|
|
725
|
+
let returnAction;
|
|
726
|
+
if ((_g = adaptable.adaptableOptions.layoutOptions) === null || _g === void 0 ? void 0 : _g.autoSaveLayouts) {
|
|
727
|
+
returnAction = next(action);
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
if (!middlewareAPI.getState().Grid.CurrentLayout) {
|
|
731
|
+
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
732
|
+
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(currentLayout));
|
|
733
|
+
}
|
|
734
|
+
// we have a layout draft, we have to update that state
|
|
735
|
+
let draftLayoutAction;
|
|
736
|
+
switch (action.type) {
|
|
737
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_ADD:
|
|
738
|
+
draftLayoutAction = GridRedux.LayoutDraftColumnFilterAdd(action.columnFilter);
|
|
739
|
+
break;
|
|
740
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_EDIT:
|
|
741
|
+
draftLayoutAction = GridRedux.LayoutDraftColumnFilterEdit(action.columnFilter);
|
|
742
|
+
break;
|
|
743
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_SET:
|
|
744
|
+
draftLayoutAction = GridRedux.LayoutDraftColumnFilterSet(action.columnFilter);
|
|
745
|
+
break;
|
|
746
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_CLEAR:
|
|
747
|
+
draftLayoutAction = GridRedux.LayoutDraftColumnFilterClear(action.columnFilter);
|
|
748
|
+
break;
|
|
749
|
+
case LayoutRedux.LAYOUT_COLUMN_FILTER_CLEAR_ALL:
|
|
750
|
+
draftLayoutAction = GridRedux.LayoutDraftColumnFilterClearAll();
|
|
751
|
+
break;
|
|
752
|
+
}
|
|
753
|
+
returnAction = next(draftLayoutAction);
|
|
754
|
+
}
|
|
720
755
|
setTimeout(() => adaptable.applyGridFiltering(), 5);
|
|
721
756
|
adaptable.api.gridApi.fireSearchChangedEvent('Filter');
|
|
722
757
|
return returnAction;
|
|
@@ -840,18 +875,18 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
840
875
|
// tell grid the layout has been selected
|
|
841
876
|
adaptable.setLayout(currentLayout);
|
|
842
877
|
}
|
|
843
|
-
if (!((
|
|
844
|
-
middlewareAPI.dispatch(
|
|
878
|
+
if (!((_h = adaptable.adaptableOptions.layoutOptions) === null || _h === void 0 ? void 0 : _h.autoSaveLayouts)) {
|
|
879
|
+
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(currentLayout));
|
|
845
880
|
}
|
|
846
881
|
}
|
|
847
882
|
if (returnAction.type == LayoutRedux.LAYOUT_ADD ||
|
|
848
883
|
returnAction.type == LayoutRedux.LAYOUT_SAVE) {
|
|
849
884
|
const actionTyped = action;
|
|
850
885
|
// if autosave is false
|
|
851
|
-
if (!((
|
|
886
|
+
if (!((_j = adaptable.adaptableOptions.layoutOptions) === null || _j === void 0 ? void 0 : _j.autoSaveLayouts)) {
|
|
852
887
|
// and the current layout is saved, make sure we also update the draft
|
|
853
888
|
if (actionTyped.layout.Name === newLayoutState.CurrentLayout) {
|
|
854
|
-
middlewareAPI.dispatch(
|
|
889
|
+
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(actionTyped.layout));
|
|
855
890
|
}
|
|
856
891
|
}
|
|
857
892
|
}
|
|
@@ -247,7 +247,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
247
247
|
},
|
|
248
248
|
{
|
|
249
249
|
name: 'Display Format',
|
|
250
|
-
values: [FormatColumnFormatWizardSection_1.getFormatColumnFormatSummaryValue(formatColumn, this.api
|
|
250
|
+
values: [FormatColumnFormatWizardSection_1.getFormatColumnFormatSummaryValue(formatColumn, this.api)],
|
|
251
251
|
},
|
|
252
252
|
getFormatColumnSettingsViewItems_1.getFormatColumnSettingsViewItems(formatColumn),
|
|
253
253
|
getObjectTagsViewItems_1.getObjectTagsViewItems(formatColumn, this.api),
|
|
@@ -10,6 +10,7 @@ const LayoutRadioSelector_1 = require("../View/Layout/LayoutRadioSelector");
|
|
|
10
10
|
const LayoutStatusBarSubPanelPopover_1 = require("../View/Layout/LayoutStatusBarSubPanelPopover");
|
|
11
11
|
const EditCurrentLayoutButton_1 = require("../View/Layout/EditCurrentLayoutButton");
|
|
12
12
|
const LayoutCloneButton_1 = require("../View/Layout/LayoutCloneButton");
|
|
13
|
+
const SaveLayoutButton_1 = require("../View/Layout/SaveLayoutButton");
|
|
13
14
|
class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
14
15
|
constructor(api) {
|
|
15
16
|
super(ModuleConstants.LayoutModuleId, 'Layout', 'layout', 'LayoutPopup', 'Named sets of column visibility, order, groupings, aggregation, pivots etc.', api);
|
|
@@ -293,7 +294,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
293
294
|
content: text,
|
|
294
295
|
popover: popover,
|
|
295
296
|
popoverMinWidth: 150,
|
|
296
|
-
extraActions: [EditCurrentLayoutButton_1.EditCurrentLayoutButton],
|
|
297
|
+
extraActions: [EditCurrentLayoutButton_1.EditCurrentLayoutButton, SaveLayoutButton_1.SaveLayoutButton],
|
|
297
298
|
};
|
|
298
299
|
},
|
|
299
300
|
};
|
|
@@ -28,6 +28,7 @@ export declare const AG_GRID_GROUPED_COLUMN: string;
|
|
|
28
28
|
export declare const AG_GRID_PIVOT_COLUMN: string;
|
|
29
29
|
export declare const ADAPTABLE_ROW_ACTION_BUTTONS = "adaptableRowActionButtons";
|
|
30
30
|
export declare const ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = "(ActionRowButtons)";
|
|
31
|
+
export declare const DEFAULT_DATE_FORMAT_PATTERN = "dd-MM-yyyy";
|
|
31
32
|
export declare const SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE: number;
|
|
32
33
|
export declare const QUICK_SEARCH_DEFAULT_BACK_COLOR: string;
|
|
33
34
|
export declare const QUICK_SEARCH_DEFAULT_FORE_COLOR: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = void 0;
|
|
3
|
+
exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.HALF_SECOND = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
|
|
4
|
+
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = void 0;
|
|
5
5
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
6
6
|
const UIHelper_1 = require("../../View/UIHelper");
|
|
7
7
|
exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
|
|
@@ -31,6 +31,7 @@ exports.AG_GRID_GROUPED_COLUMN = 'ag-Grid-AutoColumn';
|
|
|
31
31
|
exports.AG_GRID_PIVOT_COLUMN = 'pivot_';
|
|
32
32
|
exports.ADAPTABLE_ROW_ACTION_BUTTONS = 'adaptableRowActionButtons';
|
|
33
33
|
exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = '(ActionRowButtons)';
|
|
34
|
+
exports.DEFAULT_DATE_FORMAT_PATTERN = 'dd-MM-yyyy';
|
|
34
35
|
/*
|
|
35
36
|
Redux / State Defaults
|
|
36
37
|
Try to put all our Redux / State defaults here and ONLY reference from here - avoid magic numbers / strings.
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
+
/**
|
|
3
|
+
* List of all the Aggregation Functions available in AdaptableQL
|
|
4
|
+
*/
|
|
2
5
|
export declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
3
6
|
declare type AggregationFunction = 'SUM';
|
|
4
7
|
declare type ComparisonFunction = 'EQ' | 'NEQ' | 'LT' | 'GT' | 'LTE' | 'GTE';
|
|
@@ -28,7 +28,7 @@ exports.aggregatedBooleanExpressionFunctions = {
|
|
|
28
28
|
SUM: {
|
|
29
29
|
handler(args, context) {
|
|
30
30
|
const columnParameter = expressionFunctionUtils_1.extractColumnParameter('SUM', args);
|
|
31
|
-
expressionFunctionUtils_1.validateColumnType(columnParameter.value, ['Number'], 'SUM', context.
|
|
31
|
+
expressionFunctionUtils_1.validateColumnType(columnParameter.value, ['Number'], 'SUM', context.adaptableApi);
|
|
32
32
|
const sumAggregationFn = (dataSource$) => getSumAggregation$(dataSource$, getColumnValueSum(columnParameter.value, context));
|
|
33
33
|
const result = {
|
|
34
34
|
type: 'aggregation',
|
|
@@ -195,15 +195,15 @@ const getSumAggregation$ = (source$, initialSum) => {
|
|
|
195
195
|
};
|
|
196
196
|
const getColumnValueSum = (column, context) => {
|
|
197
197
|
let sum = 0;
|
|
198
|
-
context.
|
|
198
|
+
context.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
|
|
199
199
|
// if there is a WHERE clause defined, check if the current rowNode satisfies the condition
|
|
200
200
|
if (context.filterFn && !context.filterFn(rowNode)) {
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
|
-
if (context.
|
|
203
|
+
if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
const cellValue = context.
|
|
206
|
+
const cellValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, column);
|
|
207
207
|
if (cellValue != undefined) {
|
|
208
208
|
sum = sum + expressionFunctionUtils_1.getNumericValue(rowNode.data[column]);
|
|
209
209
|
}
|
|
@@ -2,6 +2,9 @@ import { ExpressionFunction } from '../../parser/src/types';
|
|
|
2
2
|
import { BaseParameter } from './expressionFunctionUtils';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
4
|
import { AggregateParams } from './scalarAggregationHelper';
|
|
5
|
+
/**
|
|
6
|
+
* List of all the AggregatedScalar Functions available in AdaptableQL
|
|
7
|
+
*/
|
|
5
8
|
export declare type AggregatedScalarFunctionName = AggregationFunction | OperandFunction;
|
|
6
9
|
declare type AggregationFunction = 'SUM' | 'PERCENTAGE' | 'AVG' | 'MIN' | 'MAX' | 'CUMUL';
|
|
7
10
|
declare type OperandFunction = 'COL' | 'OVER' | 'GROUP_BY';
|
|
@@ -8,7 +8,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
8
8
|
handler(args, context) {
|
|
9
9
|
const sumColumnParameter = expressionFunctionUtils_1.extractColumnParameter('SUM', args);
|
|
10
10
|
const sumColumnName = sumColumnParameter.value;
|
|
11
|
-
expressionFunctionUtils_1.validateColumnType(sumColumnName, ['Number'], 'SUM', context.
|
|
11
|
+
expressionFunctionUtils_1.validateColumnType(sumColumnName, ['Number'], 'SUM', context.adaptableApi);
|
|
12
12
|
const groupByParameter = expressionFunctionUtils_1.extractParameter('SUM', 'operand', ['GROUP_BY'], args, true);
|
|
13
13
|
const aggregationExpressionEvaluation = {
|
|
14
14
|
aggregationParams: {
|
|
@@ -50,7 +50,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
50
50
|
var _a;
|
|
51
51
|
const percentageColumnParameter = expressionFunctionUtils_1.extractColumnParameter('PERCENTAGE', args);
|
|
52
52
|
const percentageColumnName = percentageColumnParameter.value;
|
|
53
|
-
expressionFunctionUtils_1.validateColumnType(percentageColumnName, ['Number'], 'PERCENTAGE', context.
|
|
53
|
+
expressionFunctionUtils_1.validateColumnType(percentageColumnName, ['Number'], 'PERCENTAGE', context.adaptableApi);
|
|
54
54
|
const sumOperand = expressionFunctionUtils_1.extractParameter('PERCENTAGE', 'aggregation', ['SUM'], args, true);
|
|
55
55
|
const groupByOperand = expressionFunctionUtils_1.extractParameter('PERCENTAGE', 'operand', ['GROUP_BY'], args, true);
|
|
56
56
|
if (sumOperand && groupByOperand) {
|
|
@@ -79,7 +79,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
rowValueGetter: (rowNode, aggregationValue) => {
|
|
82
|
-
return ((context.
|
|
82
|
+
return ((context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, percentageColumnName) /
|
|
83
83
|
aggregationValue) *
|
|
84
84
|
100);
|
|
85
85
|
},
|
|
@@ -118,7 +118,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
118
118
|
handler(args, context) {
|
|
119
119
|
const avgColumnParameter = expressionFunctionUtils_1.extractColumnParameter('AVG', args);
|
|
120
120
|
const avgColumnName = avgColumnParameter.value;
|
|
121
|
-
expressionFunctionUtils_1.validateColumnType(avgColumnName, ['Number'], 'AVG', context.
|
|
121
|
+
expressionFunctionUtils_1.validateColumnType(avgColumnName, ['Number'], 'AVG', context.adaptableApi);
|
|
122
122
|
const groupByParameter = expressionFunctionUtils_1.extractParameter('AVG', 'operand', ['GROUP_BY'], args, true);
|
|
123
123
|
const aggregationExpressionEvaluation = {
|
|
124
124
|
aggregationParams: {
|
|
@@ -162,7 +162,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
162
162
|
handler(args, context) {
|
|
163
163
|
const minColumnParameter = expressionFunctionUtils_1.extractColumnParameter('MIN', args);
|
|
164
164
|
const minColumnName = minColumnParameter.value;
|
|
165
|
-
expressionFunctionUtils_1.validateColumnType(minColumnName, ['Number'], 'MIN', context.
|
|
165
|
+
expressionFunctionUtils_1.validateColumnType(minColumnName, ['Number'], 'MIN', context.adaptableApi);
|
|
166
166
|
const groupByParameter = expressionFunctionUtils_1.extractParameter('MIN', 'operand', ['GROUP_BY'], args, true);
|
|
167
167
|
const aggregationExpressionEvaluation = {
|
|
168
168
|
aggregationParams: {
|
|
@@ -203,7 +203,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
203
203
|
handler(args, context) {
|
|
204
204
|
const maxColumnParameter = expressionFunctionUtils_1.extractColumnParameter('MAX', args);
|
|
205
205
|
const maxColumnName = maxColumnParameter.value;
|
|
206
|
-
expressionFunctionUtils_1.validateColumnType(maxColumnName, ['Number'], 'MAX', context.
|
|
206
|
+
expressionFunctionUtils_1.validateColumnType(maxColumnName, ['Number'], 'MAX', context.adaptableApi);
|
|
207
207
|
const groupByParameter = expressionFunctionUtils_1.extractParameter('MAX', 'operand', ['GROUP_BY'], args, true);
|
|
208
208
|
const aggregationExpressionEvaluation = {
|
|
209
209
|
aggregationParams: {
|
|
@@ -284,7 +284,7 @@ exports.aggregatedScalarExpressionFunctions = {
|
|
|
284
284
|
OVER: {
|
|
285
285
|
handler(args, context) {
|
|
286
286
|
const columnParameter = expressionFunctionUtils_1.extractColumnParameter('OVER', args);
|
|
287
|
-
expressionFunctionUtils_1.validateColumnType(columnParameter.value, ['Number', 'Date'], 'OVER', context.
|
|
287
|
+
expressionFunctionUtils_1.validateColumnType(columnParameter.value, ['Number', 'Date'], 'OVER', context.adaptableApi);
|
|
288
288
|
const result = {
|
|
289
289
|
type: 'operand',
|
|
290
290
|
name: 'OVER',
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
+
/**
|
|
3
|
+
* List of all the Boolean Functions available in AdaptableQL
|
|
4
|
+
*/
|
|
2
5
|
export declare type BooleanFunctionName = 'EQ' | 'NEQ' | 'GT' | 'LT' | 'GTE' | 'LTE' | 'AND' | 'OR' | 'NOT' | 'BETWEEN' | 'IN' | 'IS_BLANK' | 'CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'ANY_CONTAINS' | 'QUERY';
|
|
3
6
|
export declare const booleanExpressionFunctions: Record<BooleanFunctionName, ExpressionFunction>;
|
|
@@ -225,18 +225,40 @@ exports.booleanExpressionFunctions = {
|
|
|
225
225
|
handler(args, context) {
|
|
226
226
|
var _a;
|
|
227
227
|
const searchTerm = expressionFunctionUtils_1.getStringValue(context, String(args[0]));
|
|
228
|
-
return (_a = context.
|
|
228
|
+
return (_a = context.adaptableApi) === null || _a === void 0 ? void 0 : _a.columnApi.getColumns().some((column) => {
|
|
229
229
|
var _a;
|
|
230
|
-
const value = (_a = context.
|
|
230
|
+
const value = (_a = context.adaptableApi) === null || _a === void 0 ? void 0 : _a.gridApi.getDisplayValueFromRowNode(context.node, column.columnId);
|
|
231
231
|
const columnValue = expressionFunctionUtils_1.getStringValue(context, String(value));
|
|
232
232
|
return columnValue.indexOf(searchTerm) !== -1;
|
|
233
233
|
});
|
|
234
234
|
},
|
|
235
235
|
isPredicate: true,
|
|
236
|
-
description: 'Returns true if any
|
|
236
|
+
description: 'Returns true if any Column contains input',
|
|
237
237
|
signatures: ['ANY_CONTAINS(value)'],
|
|
238
238
|
examples: ['ANY_CONTAINS("abc")'],
|
|
239
239
|
},
|
|
240
|
+
/*
|
|
241
|
+
ANY_SEARCHABLE_CONTAINS: {
|
|
242
|
+
handler(args, context) {
|
|
243
|
+
const searchTerm = getStringValue(context, String(args[0]));
|
|
244
|
+
return context.api?.columnApi
|
|
245
|
+
.getVisibleColumns()
|
|
246
|
+
.filter((c) => !c.isExcludedFromQuickSearch)
|
|
247
|
+
.some((column) => {
|
|
248
|
+
const value = context.api?.gridApi.getDisplayValueFromRowNode(
|
|
249
|
+
context.node,
|
|
250
|
+
column.columnId
|
|
251
|
+
);
|
|
252
|
+
const columnValue = getStringValue(context, String(value));
|
|
253
|
+
return columnValue.indexOf(searchTerm) !== -1;
|
|
254
|
+
});
|
|
255
|
+
},
|
|
256
|
+
isPredicate: true,
|
|
257
|
+
description: 'Returns true if any Searchable Column contains input',
|
|
258
|
+
signatures: ['ANY_SEARCHABLE_CONTAINS(value)'],
|
|
259
|
+
examples: ['ANY_SEARCHABLE_CONTAINS("abc")'],
|
|
260
|
+
},
|
|
261
|
+
*/
|
|
240
262
|
QUERY: {
|
|
241
263
|
handler(args, context) {
|
|
242
264
|
var _a, _b;
|
|
@@ -244,7 +266,7 @@ exports.booleanExpressionFunctions = {
|
|
|
244
266
|
if (StringExtensions_1.default.IsNullOrEmpty(namedQueryName)) {
|
|
245
267
|
return false;
|
|
246
268
|
}
|
|
247
|
-
const namedQuery = (_a = context.
|
|
269
|
+
const namedQuery = (_a = context.adaptableApi) === null || _a === void 0 ? void 0 : _a.queryApi.getNamedQueryByName(namedQueryName);
|
|
248
270
|
if (!namedQuery) {
|
|
249
271
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('QUERY', `Named Query with name ${namedQueryName} not found!`);
|
|
250
272
|
}
|