@adaptabletools/adaptable 15.2.2 → 15.3.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 +158 -158
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +10 -1
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -3
- package/src/AdaptableOptions/MasterDetailPluginOptions.d.ts +4 -0
- package/src/AdaptableOptions/PredicateOptions.d.ts +4 -4
- package/src/Api/Glue42Api.d.ts +0 -38
- package/src/Api/IPushPullApi.d.ts +0 -30
- package/src/Api/Implementation/LayoutApiImpl.js +2 -2
- package/src/Api/Internal/AlertInternalApi.d.ts +3 -1
- package/src/Api/Internal/AlertInternalApi.js +30 -5
- package/src/Api/Internal/QueryLanguageInternalApi.d.ts +3 -1
- package/src/Api/Internal/QueryLanguageInternalApi.js +25 -1
- package/src/Api/OpenFinApi.d.ts +1 -15
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +17 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +4 -0
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/DashboardState.d.ts +8 -8
- package/src/Strategy/AlertModule.js +15 -12
- package/src/Strategy/ExportModule.d.ts +2 -0
- package/src/Strategy/ExportModule.js +64 -25
- package/src/Utilities/Helpers/FormatHelper.js +13 -1
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +15 -4
- package/src/agGrid/Adaptable.js +10 -21
- package/src/agGrid/agGridMenuHelper.js +6 -0
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +15 -0
- package/src/agGrid/attachAddaptableColumnTypes.js +21 -0
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +30 -1
- package/src/components/Dashboard/DashboardManager.js +11 -5
- package/src/metamodel/adaptable.metamodel.d.ts +6 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -45,31 +45,66 @@ class ExportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
45
45
|
return this.api.queryApi.internalApi.getReferencedNamedQueryNames(report.Query.BooleanExpression);
|
|
46
46
|
}
|
|
47
47
|
addContextMenuItems(menuContext) {
|
|
48
|
-
const canExport = !menuContext.isRowGroupColumn &&
|
|
49
|
-
this.isModuleAvailable() &&
|
|
50
|
-
menuContext.selectedCellInfo &&
|
|
51
|
-
ArrayExtensions_1.default.IsNotNullOrEmpty(menuContext.selectedCellInfo.columns) &&
|
|
52
|
-
ArrayExtensions_1.default.IsNotNullOrEmpty(menuContext.selectedCellInfo.gridCells);
|
|
48
|
+
const canExport = !menuContext.isRowGroupColumn && this.isModuleAvailable();
|
|
53
49
|
if (!canExport) {
|
|
54
50
|
return;
|
|
55
51
|
}
|
|
56
|
-
|
|
52
|
+
let returnMenuItems = [];
|
|
53
|
+
let selectedCellmenuItems = [];
|
|
54
|
+
let selectedRowmenuItems = [];
|
|
55
|
+
const canExportCells = menuContext.selectedCellInfo &&
|
|
56
|
+
ArrayExtensions_1.default.IsNotNullOrEmpty(menuContext.selectedCellInfo.columns) &&
|
|
57
|
+
ArrayExtensions_1.default.IsNotNullOrEmpty(menuContext.selectedCellInfo.gridCells);
|
|
58
|
+
const canExportRows = menuContext.selectedRowInfo &&
|
|
59
|
+
ArrayExtensions_1.default.IsNotNullOrEmpty(menuContext.selectedRowInfo.gridRows) &&
|
|
60
|
+
menuContext.gridCell &&
|
|
61
|
+
menuContext.gridCell.primaryKeyValue &&
|
|
62
|
+
menuContext.isSelectedRow;
|
|
63
|
+
if (canExportCells) {
|
|
64
|
+
const selectedCellReport = this.api.exportApi.getReportByName(GeneralConstants_1.SELECTED_CELLS_REPORT);
|
|
65
|
+
selectedCellmenuItems = this.buildReportMenuItems(selectedCellReport);
|
|
66
|
+
}
|
|
67
|
+
if (canExportRows) {
|
|
68
|
+
const selectedRowReport = this.api.exportApi.getReportByName(GeneralConstants_1.SELECTED_ROWS_REPORT);
|
|
69
|
+
selectedRowmenuItems = this.buildReportMenuItems(selectedRowReport);
|
|
70
|
+
}
|
|
71
|
+
// if only selected cells then just do one level
|
|
72
|
+
if (canExportCells && !canExportRows) {
|
|
73
|
+
returnMenuItems.push(this.buildExportMenuItem('Export Selected Cells', selectedCellmenuItems));
|
|
74
|
+
// if only selected Rows then just do one level
|
|
75
|
+
}
|
|
76
|
+
else if (canExportRows && !canExportCells) {
|
|
77
|
+
returnMenuItems.push(this.buildExportMenuItem('Export Selected Rows', selectedRowmenuItems));
|
|
78
|
+
}
|
|
79
|
+
// if both selected Cells and Rows then add a new level
|
|
80
|
+
else if (canExportRows && canExportCells) {
|
|
81
|
+
const exportSelectedCellsMenuItem = this.buildExportMenuItem('Cells', selectedCellmenuItems);
|
|
82
|
+
const exportSelectedRowsMenuItem = this.buildExportMenuItem('Rows', selectedRowmenuItems);
|
|
83
|
+
returnMenuItems.push(this.buildExportMenuItem('Export Selected', [
|
|
84
|
+
exportSelectedCellsMenuItem,
|
|
85
|
+
exportSelectedRowsMenuItem,
|
|
86
|
+
]));
|
|
87
|
+
}
|
|
88
|
+
return returnMenuItems;
|
|
89
|
+
}
|
|
90
|
+
buildReportMenuItems(report) {
|
|
57
91
|
const menuItems = [];
|
|
58
92
|
for (const destination of this.api.exportApi.getAvailableExportDestinations()) {
|
|
59
|
-
menuItems.push(this.createColumnMenuItemClickFunction(destination, this.moduleInfo.Glyph, () => this.export(
|
|
93
|
+
menuItems.push(this.createColumnMenuItemClickFunction(destination, this.moduleInfo.Glyph, () => this.export(report, destination)));
|
|
60
94
|
}
|
|
61
95
|
for (const customDestination of this.api.exportApi.getCustomDestinations()) {
|
|
62
|
-
menuItems.push(this.createColumnMenuItemClickFunction(customDestination.name, this.moduleInfo.Glyph, () => this.export(
|
|
96
|
+
menuItems.push(this.createColumnMenuItemClickFunction(customDestination.name, this.moduleInfo.Glyph, () => this.export(report, customDestination.name)));
|
|
63
97
|
}
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
98
|
+
return menuItems;
|
|
99
|
+
}
|
|
100
|
+
buildExportMenuItem(label, subItems) {
|
|
101
|
+
return {
|
|
102
|
+
label: label,
|
|
103
|
+
module: this.moduleInfo.ModuleName,
|
|
104
|
+
isVisible: true,
|
|
105
|
+
icon: { name: this.moduleInfo.Glyph },
|
|
106
|
+
subItems: subItems,
|
|
107
|
+
};
|
|
73
108
|
}
|
|
74
109
|
async export(report, exportDestination) {
|
|
75
110
|
var _a;
|
|
@@ -153,7 +188,7 @@ class ExportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
153
188
|
this.convertReportToExcel(report, reportData);
|
|
154
189
|
break;
|
|
155
190
|
case Enums_1.ExportDestination.Clipboard:
|
|
156
|
-
this.copyToClipboard(
|
|
191
|
+
this.copyToClipboard(reportData);
|
|
157
192
|
break;
|
|
158
193
|
case Enums_1.ExportDestination.CSV:
|
|
159
194
|
this.convertReportToCsv(report, reportData);
|
|
@@ -247,7 +282,7 @@ class ExportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
247
282
|
});
|
|
248
283
|
}
|
|
249
284
|
convertReportToCsv(report, reportData) {
|
|
250
|
-
const csvContent = this.createCSVContent(
|
|
285
|
+
const csvContent = this.createCSVContent(reportData);
|
|
251
286
|
if (StringExtensions_1.default.IsNullOrEmpty(csvContent)) {
|
|
252
287
|
this.showEmptyExportWarning();
|
|
253
288
|
return;
|
|
@@ -262,20 +297,24 @@ class ExportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
262
297
|
}
|
|
263
298
|
this.api.exportApi.exportDataToExcel(reportData, this.api.internalApi.getReportService().getReportFileName(report.Name));
|
|
264
299
|
}
|
|
265
|
-
copyToClipboard(
|
|
266
|
-
const csvContent = this.createTabularContent(
|
|
300
|
+
copyToClipboard(reportData) {
|
|
301
|
+
const csvContent = this.createTabularContent(reportData);
|
|
267
302
|
if (StringExtensions_1.default.IsNullOrEmpty(csvContent)) {
|
|
268
303
|
this.showEmptyExportWarning();
|
|
269
304
|
return;
|
|
270
305
|
}
|
|
271
306
|
Helper_1.Helper.copyToClipboard(csvContent);
|
|
272
307
|
}
|
|
273
|
-
createCSVContent(
|
|
274
|
-
const reportDataAsArray = this.api.internalApi
|
|
308
|
+
createCSVContent(reportData) {
|
|
309
|
+
const reportDataAsArray = this.api.internalApi
|
|
310
|
+
.getReportService()
|
|
311
|
+
.convertReportDataToArray(reportData);
|
|
275
312
|
return Helper_1.Helper.convertArrayToCsv(reportDataAsArray, ',');
|
|
276
313
|
}
|
|
277
|
-
createTabularContent(
|
|
278
|
-
const reportDataAsArray = this.api.internalApi
|
|
314
|
+
createTabularContent(reportData) {
|
|
315
|
+
const reportDataAsArray = this.api.internalApi
|
|
316
|
+
.getReportService()
|
|
317
|
+
.convertReportDataToArray(reportData);
|
|
279
318
|
return Helper_1.Helper.convertArrayToCsv(reportDataAsArray, '\t');
|
|
280
319
|
}
|
|
281
320
|
getTeamSharingAction() {
|
|
@@ -40,12 +40,24 @@ function NumberFormatter(input, options = {}) {
|
|
|
40
40
|
n *= -1;
|
|
41
41
|
n = parseFloat(n.toFixed(12));
|
|
42
42
|
}
|
|
43
|
+
if (options.Abs) {
|
|
44
|
+
n = Math.abs(n);
|
|
45
|
+
}
|
|
43
46
|
if (options.Truncate) {
|
|
44
47
|
n = Math.trunc(n);
|
|
45
48
|
}
|
|
49
|
+
if (options.Ceiling) {
|
|
50
|
+
n = Math.ceil(n);
|
|
51
|
+
}
|
|
52
|
+
if (options.Round) {
|
|
53
|
+
n = Math.round(n);
|
|
54
|
+
}
|
|
55
|
+
if (options.Floor) {
|
|
56
|
+
n = Math.floor(n);
|
|
57
|
+
}
|
|
46
58
|
let s;
|
|
47
59
|
let digitsToUse;
|
|
48
|
-
if (options.Truncate) {
|
|
60
|
+
if (options.Truncate || options.Ceiling || options.Round || options.Floor) {
|
|
49
61
|
digitsToUse = 0;
|
|
50
62
|
}
|
|
51
63
|
else if (options.FractionDigits != null) {
|
|
@@ -61,11 +61,11 @@ const EntityRulePredicatesEditor = (props) => {
|
|
|
61
61
|
enablePredicateColumnId && (React.createElement(rebass_1.Flex, { className: "ab-EntityRulePredicateEditor-ScopeTypeSelector", p: 2, mb: 2, flexDirection: "column" },
|
|
62
62
|
React.createElement(rebass_1.Text, { mb: 2 }, "Create Predicate Rule(s) using"),
|
|
63
63
|
React.createElement(Radio_1.default, { "data-name": "entity-scope", onClick: () => handlePredicateScopeTypeChange(false), mr: 3, checked: !columnPredicateEnabled },
|
|
64
|
-
"
|
|
64
|
+
"Active Column:",
|
|
65
65
|
' ',
|
|
66
66
|
React.createElement(Tag_1.Tag, { ml: 1, mr: 1 }, scopeString || 'Not Defined'),
|
|
67
67
|
' '),
|
|
68
|
-
React.createElement(Radio_1.default, { "data-name": "column-scope", onClick: () => handlePredicateScopeTypeChange(true), checked: columnPredicateEnabled }, "Selected Columns (overriding
|
|
68
|
+
React.createElement(Radio_1.default, { "data-name": "column-scope", onClick: () => handlePredicateScopeTypeChange(true), checked: columnPredicateEnabled }, "Selected Columns (overriding Active Column)"))),
|
|
69
69
|
(((_e = (_d = props.data.Rule) === null || _d === void 0 ? void 0 : _d.Predicates) === null || _e === void 0 ? void 0 : _e.length) ? props.data.Rule.Predicates : [null]).map((predicate, index) => {
|
|
70
70
|
const currentPredicatDef = props.predicateDefs.find((pd) => pd.id === (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId));
|
|
71
71
|
let editorPredicateDefs = defaultPredicateDefs;
|
|
@@ -260,8 +260,13 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
260
260
|
React.createElement(Input_1.default, { "data-name": "prefix", value: (_a = data.DisplayFormat.Options.Prefix) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
|
|
261
261
|
React.createElement(FormLayout_1.FormRow, { label: "Suffix" },
|
|
262
262
|
React.createElement(Input_1.default, { "data-name": "suffix", value: (_b = data.DisplayFormat.Options.Suffix) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
|
|
263
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
264
|
-
React.createElement(
|
|
263
|
+
React.createElement(FormLayout_1.FormRow, { label: "Truncate" },
|
|
264
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "truncate-checkbox", checked: data.DisplayFormat.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) })),
|
|
265
|
+
React.createElement(FormLayout_1.FormRow, { label: "Ceiling" },
|
|
266
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "ceiling-checkbox", checked: data.DisplayFormat.Options.Ceiling, onChange: (checked) => setFormatOption('Ceiling', checked) })),
|
|
267
|
+
' ',
|
|
268
|
+
React.createElement(FormLayout_1.FormRow, { label: "Absolute" },
|
|
269
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "abs-checkbox", checked: data.DisplayFormat.Options.Abs, onChange: (checked) => setFormatOption('Abs', checked) }))),
|
|
265
270
|
React.createElement(FormLayout_1.default, null,
|
|
266
271
|
React.createElement(FormLayout_1.FormRow, { label: "Fraction Digits" },
|
|
267
272
|
React.createElement(Input_1.default, { "data-name": "fraction-digits", type: "number", min: "0",
|
|
@@ -275,10 +280,16 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
275
280
|
React.createElement(Input_1.default, { "data-name": "integer-digits", type: "number", min: "0", value: data.DisplayFormat.Options.IntegerDigits, onChange: (e) => setFormatOption('IntegerDigits', Number(e.currentTarget.value)) })),
|
|
276
281
|
React.createElement(FormLayout_1.FormRow, { label: "Multiplier" },
|
|
277
282
|
React.createElement(Input_1.default, { "data-name": "multiplier", type: "number", value: data.DisplayFormat.Options.Multiplier, onChange: (e) => setFormatOption('Multiplier', Number(e.currentTarget.value)) })),
|
|
283
|
+
' ',
|
|
284
|
+
React.createElement(FormLayout_1.FormRow, { label: "Content" },
|
|
285
|
+
React.createElement(Input_1.default, { "data-name": "content", value: (_c = data.DisplayFormat.Options.Content) !== null && _c !== void 0 ? _c : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
|
|
286
|
+
' ',
|
|
278
287
|
React.createElement(FormLayout_1.FormRow, { label: "Parentheses" },
|
|
279
288
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "parentheses-checkbox", checked: data.DisplayFormat.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) })),
|
|
280
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
281
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "
|
|
289
|
+
React.createElement(FormLayout_1.FormRow, { label: "Floor" },
|
|
290
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "floor-checkbox", checked: data.DisplayFormat.Options.Floor, onChange: (checked) => setFormatOption('Floor', checked) })),
|
|
291
|
+
React.createElement(FormLayout_1.FormRow, { label: "Round" },
|
|
292
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) })))))),
|
|
282
293
|
scopedCustomFormatters.length > 0 && (React.createElement(Tabs_1.Tabs, { marginTop: 2, keyboardNavigation: false },
|
|
283
294
|
React.createElement(Tabs_1.Tabs.Tab, null, "Custom Formats"),
|
|
284
295
|
React.createElement(Tabs_1.Tabs.Content, null,
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -66,6 +66,7 @@ const renderReactRoot_1 = require("../renderReactRoot");
|
|
|
66
66
|
const ChartingService_1 = require("../Utilities/Services/ChartingService");
|
|
67
67
|
const ThemeService_1 = require("../Utilities/Services/ThemeService");
|
|
68
68
|
const AdaptableLogger_1 = require("./AdaptableLogger");
|
|
69
|
+
const attachAddaptableColumnTypes_1 = require("./attachAddaptableColumnTypes");
|
|
69
70
|
const tinycolor = require('tinycolor2');
|
|
70
71
|
const GROUP_PATH_SEPARATOR = '/';
|
|
71
72
|
// IMPORTANT - we need colId to be set in order for safeSetColDefs to work correctly
|
|
@@ -352,7 +353,6 @@ class Adaptable {
|
|
|
352
353
|
// the 'old' constructor which takes an Adaptable adaptable object
|
|
353
354
|
// this is still used internally but should not be used externally as a preference
|
|
354
355
|
async init(adaptableOptions, runtimeConfig, _staticInit) {
|
|
355
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
356
356
|
this.logger = new AdaptableLogger_1.AdaptableLogger(adaptableOptions.adaptableId || String(Date.now()));
|
|
357
357
|
const perfAdaptableInit = this.logger.beginPerf(`Adaptable init()`);
|
|
358
358
|
if (runtimeConfig) {
|
|
@@ -455,18 +455,7 @@ class Adaptable {
|
|
|
455
455
|
this.gridOptions.api.__adaptable = this;
|
|
456
456
|
}
|
|
457
457
|
this.gridOptions.columnTypes = this.gridOptions.columnTypes || {};
|
|
458
|
-
|
|
459
|
-
[GeneralConstants_1.AB_SPECIAL_COLUMN]: {},
|
|
460
|
-
abColDefNumber: (_a = this.gridOptions.columnTypes.abColDefNumber) !== null && _a !== void 0 ? _a : {},
|
|
461
|
-
abColDefString: (_b = this.gridOptions.columnTypes.abColDefString) !== null && _b !== void 0 ? _b : {},
|
|
462
|
-
abColDefBoolean: (_c = this.gridOptions.columnTypes.abColDefBoolean) !== null && _c !== void 0 ? _c : {},
|
|
463
|
-
abColDefDate: (_d = this.gridOptions.columnTypes.abColDefDate) !== null && _d !== void 0 ? _d : {},
|
|
464
|
-
abColDefObject: (_e = this.gridOptions.columnTypes.abColDefObject) !== null && _e !== void 0 ? _e : {},
|
|
465
|
-
abColDefCustom: (_f = this.gridOptions.columnTypes.abColDefCustom) !== null && _f !== void 0 ? _f : {},
|
|
466
|
-
abColDefNumberArray: (_g = this.gridOptions.columnTypes.abColDefNumberArray) !== null && _g !== void 0 ? _g : {},
|
|
467
|
-
abColDefTupleNumberArray: (_h = this.gridOptions.columnTypes.abColDefTupleNumberArray) !== null && _h !== void 0 ? _h : {},
|
|
468
|
-
abColDefObjectNumberArray: (_j = this.gridOptions.columnTypes.abColDefObjectNumberArray) !== null && _j !== void 0 ? _j : {},
|
|
469
|
-
});
|
|
458
|
+
(0, attachAddaptableColumnTypes_1.attachColumnTypes)(this.gridOptions);
|
|
470
459
|
if (this.gridOptions.columnTypes.abColDefNumber.cellEditor === undefined) {
|
|
471
460
|
this.gridOptions.columnTypes.abColDefNumber.cellEditor =
|
|
472
461
|
this.variant === 'react' ? AdaptableNumberEditor_1.ReactAdaptableNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
|
|
@@ -2511,7 +2500,7 @@ class Adaptable {
|
|
|
2511
2500
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(calculatedColumnSettings.ColumnTypes)) {
|
|
2512
2501
|
columnTypes.push(...calculatedColumnSettings.ColumnTypes);
|
|
2513
2502
|
}
|
|
2514
|
-
const isExternalEvaluation = !this.api.queryLanguageApi.internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query));
|
|
2503
|
+
const isExternalEvaluation = !this.api.queryLanguageApi.internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', calculatedColumn, this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query));
|
|
2515
2504
|
const newColDef = {
|
|
2516
2505
|
headerName: calculatedColumn.FriendlyName
|
|
2517
2506
|
? calculatedColumn.FriendlyName
|
|
@@ -3023,7 +3012,7 @@ class Adaptable {
|
|
|
3023
3012
|
if (!this.isGroupRowNode(node)) {
|
|
3024
3013
|
const currentQuery = this.api.queryApi.getCurrentQuery();
|
|
3025
3014
|
if (currentQuery) {
|
|
3026
|
-
const evaluateQueryOnClient = this.api.queryLanguageApi.internalApi.evaluateExpressionInAdaptableQL('Query', currentQuery);
|
|
3015
|
+
const evaluateQueryOnClient = this.api.queryLanguageApi.internalApi.evaluateExpressionInAdaptableQL('Query', undefined, currentQuery);
|
|
3027
3016
|
if (evaluateQueryOnClient) {
|
|
3028
3017
|
const isCurrentQueryValid = this.api.queryLanguageApi.isValidBooleanExpression(currentQuery, ModuleConstants_1.QueryModuleId, `Invalid CurrentQuery '${currentQuery}'`);
|
|
3029
3018
|
if (!isCurrentQueryValid ||
|
|
@@ -3035,13 +3024,13 @@ class Adaptable {
|
|
|
3035
3024
|
}
|
|
3036
3025
|
}
|
|
3037
3026
|
}
|
|
3038
|
-
const
|
|
3027
|
+
const columnFilters = this.api.filterApi.getActiveColumnFilters();
|
|
3039
3028
|
try {
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3029
|
+
if (columnFilters.length > 0) {
|
|
3030
|
+
for (const columnFilter of columnFilters) {
|
|
3031
|
+
const evaluateFilterOnClient = this.api.queryLanguageApi.internalApi.evaluatePredicatesInAdaptableQL('Filter', columnFilter, [columnFilter.Predicate]);
|
|
3032
|
+
if (evaluateFilterOnClient) {
|
|
3033
|
+
// we then assess filters (if running locally)
|
|
3045
3034
|
if (!this.api.filterApi.internalApi.evaluateColumnFilter(columnFilter, node)) {
|
|
3046
3035
|
return false;
|
|
3047
3036
|
}
|
|
@@ -244,6 +244,7 @@ class agGridMenuHelper {
|
|
|
244
244
|
// lets build a picture of what has been right clicked. Will take time to get right but lets start
|
|
245
245
|
let isSingleSelectedColumn = false;
|
|
246
246
|
let isSelectedCell = false;
|
|
247
|
+
let isSelectedRow = false;
|
|
247
248
|
let clickedCell = undefined;
|
|
248
249
|
if (adaptableColumn) {
|
|
249
250
|
clickedCell = this.adaptable.getGridCellFromRowNode(params.node, adaptableColumn.columnId);
|
|
@@ -259,8 +260,13 @@ class agGridMenuHelper {
|
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
let selectedRowInfo = this.adaptable.api.gridApi.getSelectedRowInfo();
|
|
263
|
+
if (selectedRowInfo) {
|
|
264
|
+
let matchedPKValue = selectedRowInfo.gridRows.find((gr) => gr != null && gr.primaryKeyValue == clickedCell.primaryKeyValue);
|
|
265
|
+
isSelectedRow = matchedPKValue != null;
|
|
266
|
+
}
|
|
262
267
|
return {
|
|
263
268
|
isSelectedCell: isSelectedCell,
|
|
269
|
+
isSelectedRow: isSelectedRow,
|
|
264
270
|
gridCell: clickedCell,
|
|
265
271
|
adaptableColumn: adaptableColumn,
|
|
266
272
|
agGridColumn: params.column,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GridOptions } from '@ag-grid-community/core';
|
|
2
|
+
export declare const attachColumnTypes: (gridOptions: GridOptions) => {
|
|
3
|
+
[key: string]: import("@ag-grid-community/core").ColDef<any>;
|
|
4
|
+
} & {
|
|
5
|
+
[x: string]: import("@ag-grid-community/core").ColDef<any>;
|
|
6
|
+
abColDefNumber: import("@ag-grid-community/core").ColDef<any>;
|
|
7
|
+
abColDefString: import("@ag-grid-community/core").ColDef<any>;
|
|
8
|
+
abColDefBoolean: import("@ag-grid-community/core").ColDef<any>;
|
|
9
|
+
abColDefDate: import("@ag-grid-community/core").ColDef<any>;
|
|
10
|
+
abColDefObject: import("@ag-grid-community/core").ColDef<any>;
|
|
11
|
+
abColDefCustom: import("@ag-grid-community/core").ColDef<any>;
|
|
12
|
+
abColDefNumberArray: import("@ag-grid-community/core").ColDef<any>;
|
|
13
|
+
abColDefTupleNumberArray: import("@ag-grid-community/core").ColDef<any>;
|
|
14
|
+
abColDefObjectNumberArray: import("@ag-grid-community/core").ColDef<any>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attachColumnTypes = void 0;
|
|
4
|
+
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
5
|
+
const attachColumnTypes = (gridOptions) => {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
7
|
+
gridOptions.columnTypes = (_a = gridOptions.columnTypes) !== null && _a !== void 0 ? _a : {};
|
|
8
|
+
return Object.assign(gridOptions.columnTypes, {
|
|
9
|
+
[GeneralConstants_1.AB_SPECIAL_COLUMN]: {},
|
|
10
|
+
abColDefNumber: (_b = gridOptions.columnTypes.abColDefNumber) !== null && _b !== void 0 ? _b : {},
|
|
11
|
+
abColDefString: (_c = gridOptions.columnTypes.abColDefString) !== null && _c !== void 0 ? _c : {},
|
|
12
|
+
abColDefBoolean: (_d = gridOptions.columnTypes.abColDefBoolean) !== null && _d !== void 0 ? _d : {},
|
|
13
|
+
abColDefDate: (_e = gridOptions.columnTypes.abColDefDate) !== null && _e !== void 0 ? _e : {},
|
|
14
|
+
abColDefObject: (_f = gridOptions.columnTypes.abColDefObject) !== null && _f !== void 0 ? _f : {},
|
|
15
|
+
abColDefCustom: (_g = gridOptions.columnTypes.abColDefCustom) !== null && _g !== void 0 ? _g : {},
|
|
16
|
+
abColDefNumberArray: (_h = gridOptions.columnTypes.abColDefNumberArray) !== null && _h !== void 0 ? _h : {},
|
|
17
|
+
abColDefTupleNumberArray: (_j = gridOptions.columnTypes.abColDefTupleNumberArray) !== null && _j !== void 0 ? _j : {},
|
|
18
|
+
abColDefObjectNumberArray: (_k = gridOptions.columnTypes.abColDefObjectNumberArray) !== null && _k !== void 0 ? _k : {},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.attachColumnTypes = attachColumnTypes;
|
|
@@ -10,6 +10,7 @@ const SimpleButton_1 = tslib_1.__importDefault(require("../SimpleButton"));
|
|
|
10
10
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../View/Components/AdaptableInput"));
|
|
11
11
|
const DropdownButton_1 = tslib_1.__importDefault(require("../DropdownButton"));
|
|
12
12
|
const react_1 = require("react");
|
|
13
|
+
const AdaptableContext_1 = require("../../View/AdaptableContext");
|
|
13
14
|
function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabledButtons, api, context, focusFirstButton = true, }) {
|
|
14
15
|
return (React.createElement(React.Fragment, null, formDef.buttons.map((button, index) => {
|
|
15
16
|
var _a;
|
|
@@ -33,6 +34,7 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
|
|
|
33
34
|
const newData = Object.assign(Object.assign({}, data), { [key]: value });
|
|
34
35
|
onChange(newData);
|
|
35
36
|
};
|
|
37
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
36
38
|
const disabledButtons = (0, react_1.useMemo)(() => {
|
|
37
39
|
var _a, _b;
|
|
38
40
|
return (_b = (_a = formDef.buttons) === null || _a === void 0 ? void 0 : _a.map((button) => {
|
|
@@ -85,7 +87,34 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
|
|
|
85
87
|
return (React.createElement(React.Fragment, null,
|
|
86
88
|
displayTitle && formDef.title && (React.createElement(rebass_1.Box, { "data-name": "form-title", fontSize: 5, mb: 2, style: { fontWeight: 'bold' } }, formDef.title)),
|
|
87
89
|
formDef.description && (React.createElement(rebass_1.Box, { "data-name": "form-description", mb: 3 }, formDef.description)),
|
|
88
|
-
React.createElement(FormLayout_1.default, {
|
|
90
|
+
React.createElement(FormLayout_1.default, { onKeyDown: (event) => {
|
|
91
|
+
const target = event.target;
|
|
92
|
+
const targetName = target.name;
|
|
93
|
+
const field = formDef.fields
|
|
94
|
+
.map((field) => {
|
|
95
|
+
if (Array.isArray(field)) {
|
|
96
|
+
return field.filter((f) => f.name === targetName)[0];
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return field.name === targetName ? field : null;
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
.filter(Boolean)[0];
|
|
103
|
+
if (field && field.fieldType === 'number') {
|
|
104
|
+
// for number fields
|
|
105
|
+
// hook them up to the CellEditorKeyDown event
|
|
106
|
+
// so Shortcuts work as expected
|
|
107
|
+
const value = event.target.value;
|
|
108
|
+
adaptable._emit('CellEditorKeyDown', {
|
|
109
|
+
keyDownEvent: event,
|
|
110
|
+
cellValue: value,
|
|
111
|
+
columnId: field.name,
|
|
112
|
+
updateValueCallback: (updatedValue) => {
|
|
113
|
+
setFieldValue(field.name, updatedValue);
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}, "data-name": "form-content", columns: columns, style: { overflow: 'auto' }, paddingRight: 1 }, (_c = formDef.fields) === null || _c === void 0 ? void 0 : _c.map((field, index) => {
|
|
89
118
|
if (Array.isArray(field)) {
|
|
90
119
|
const rowFields = {};
|
|
91
120
|
field.map((fieldItem, index) => {
|
|
@@ -6,13 +6,19 @@ const ModuleManager_1 = require("../DragAndDropContext/ModuleManager");
|
|
|
6
6
|
const DashboardManager = ({ tabs, onTabsChange, availableToolbars, api, disabled, }) => {
|
|
7
7
|
const moduleService = api.internalApi.getModuleService();
|
|
8
8
|
const moduleInfo = moduleService.getModuleInfoByModule('Dashboard');
|
|
9
|
-
const
|
|
10
|
-
return
|
|
9
|
+
const moduleTabs = tabs.map((tab) => {
|
|
10
|
+
return {
|
|
11
|
+
Name: tab.Name,
|
|
12
|
+
Items: tab.Toolbars,
|
|
13
|
+
};
|
|
11
14
|
});
|
|
12
15
|
const handleTabsChange = React.useCallback((tabs) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
16
|
+
const dashboardTabs = tabs.map((tab) => ({
|
|
17
|
+
Name: tab.Name,
|
|
18
|
+
Toolbars: tab.Items,
|
|
19
|
+
}));
|
|
20
|
+
onTabsChange(dashboardTabs);
|
|
15
21
|
}, []);
|
|
16
|
-
return (React.createElement(ModuleManager_1.ModuleManager, { availableItems: availableToolbars, disabled: disabled, onTabsChange: handleTabsChange, tabs:
|
|
22
|
+
return (React.createElement(ModuleManager_1.ModuleManager, { availableItems: availableToolbars, disabled: disabled, onTabsChange: handleTabsChange, tabs: moduleTabs, tabsTitle: moduleInfo.FriendlyName + ' Tabs', unusedPanelTitle: 'Available Toolbars', dragItemText: "Drag into a Tab below" }));
|
|
17
23
|
};
|
|
18
24
|
exports.default = DashboardManager;
|
|
@@ -2263,6 +2263,12 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2263
2263
|
desc: string;
|
|
2264
2264
|
ref: string;
|
|
2265
2265
|
isOpt?: undefined;
|
|
2266
|
+
} | {
|
|
2267
|
+
name: string;
|
|
2268
|
+
kind: string;
|
|
2269
|
+
desc: string;
|
|
2270
|
+
isOpt: boolean;
|
|
2271
|
+
ref: string;
|
|
2266
2272
|
})[];
|
|
2267
2273
|
};
|
|
2268
2274
|
ExportableColumnContext: {
|