@adaptabletools/adaptable 16.0.0-canary.3 → 16.0.0-canary.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.
Files changed (95) hide show
  1. package/README.md +2 -0
  2. package/base.css +31 -23
  3. package/base.css.map +1 -1
  4. package/bundle.cjs.js +184 -184
  5. package/index.css +43 -31
  6. package/index.css.map +1 -1
  7. package/package.json +10 -2
  8. package/publishTimestamp.d.ts +1 -1
  9. package/publishTimestamp.js +1 -1
  10. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +9 -4
  12. package/src/AdaptableOptions/ColumnOptions.d.ts +1 -10
  13. package/src/AdaptableOptions/Fdc3Options.d.ts +279 -0
  14. package/src/AdaptableOptions/Fdc3Options.js +5 -0
  15. package/src/AdaptableOptions/FinancePluginOptions.d.ts +25 -25
  16. package/src/AdaptableOptions/GroupingOptions.d.ts +8 -0
  17. package/src/AdaptableOptions/OpenFinPluginOptions.d.ts +1 -1
  18. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -6
  19. package/src/Api/AdaptableApi.d.ts +7 -2
  20. package/src/Api/ColumnApi.d.ts +0 -5
  21. package/src/Api/EventApi.d.ts +3 -3
  22. package/src/Api/Events/ThemeChanged.d.ts +0 -6
  23. package/src/Api/Events/ThemeEdited.d.ts +11 -0
  24. package/src/Api/Fdc3Api.d.ts +91 -0
  25. package/src/Api/Fdc3Api.js +2 -0
  26. package/src/Api/FinanceApi.d.ts +13 -13
  27. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  28. package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
  29. package/src/Api/Implementation/ApiBase.d.ts +4 -0
  30. package/src/Api/Implementation/ApiBase.js +6 -0
  31. package/src/Api/Implementation/ColumnApiImpl.d.ts +0 -1
  32. package/src/Api/Implementation/ColumnApiImpl.js +0 -3
  33. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +28 -0
  34. package/src/Api/Implementation/Fdc3ApiImpl.js +87 -0
  35. package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -0
  36. package/src/Api/Implementation/OptionsApiImpl.js +3 -0
  37. package/src/Api/Implementation/QuickSearchApiImpl.d.ts +2 -0
  38. package/src/Api/Implementation/QuickSearchApiImpl.js +7 -0
  39. package/src/Api/Internal/ActionRowInternalApi.js +1 -1
  40. package/src/Api/Internal/AdaptableInternalApi.d.ts +11 -4
  41. package/src/Api/Internal/AdaptableInternalApi.js +59 -10
  42. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -0
  43. package/src/Api/Internal/ColumnInternalApi.js +4 -0
  44. package/src/Api/Internal/Fdc3InternalApi.d.ts +27 -0
  45. package/src/Api/Internal/Fdc3InternalApi.js +442 -0
  46. package/src/Api/OptionsApi.d.ts +5 -0
  47. package/src/Api/QuickSearchApi.d.ts +8 -0
  48. package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
  49. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  50. package/src/PredefinedConfig/Common/{FDC3Context.d.ts → FDC3Context_DEPR.d.ts} +22 -22
  51. package/src/PredefinedConfig/Common/FDC3Context_DEPR.js +2 -0
  52. package/src/PredefinedConfig/Common/Fdc3Context.d.ts +55 -0
  53. package/src/PredefinedConfig/Common/Fdc3Context.js +36 -0
  54. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +71 -0
  55. package/src/PredefinedConfig/Common/Fdc3Intent.js +107 -0
  56. package/src/PredefinedConfig/Common/Types.d.ts +2 -2
  57. package/src/PredefinedConfig/SystemState.d.ts +3 -0
  58. package/src/Redux/ActionsReducers/SystemRedux.d.ts +12 -6
  59. package/src/Redux/ActionsReducers/SystemRedux.js +18 -2
  60. package/src/Redux/Store/AdaptableStore.js +2 -2
  61. package/src/Strategy/Fdc3Module.d.ts +13 -0
  62. package/src/Strategy/Fdc3Module.js +105 -0
  63. package/src/Utilities/Constants/GeneralConstants.d.ts +4 -0
  64. package/src/Utilities/Constants/GeneralConstants.js +6 -2
  65. package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
  66. package/src/Utilities/Constants/ModuleConstants.js +5 -2
  67. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +11 -1
  68. package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
  69. package/src/Utilities/Services/Fdc3Service.d.ts +20 -0
  70. package/src/Utilities/Services/Fdc3Service.js +92 -0
  71. package/src/View/AdaptableView.js +9 -7
  72. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.d.ts +9 -0
  73. package/src/View/Layout/Wizard/sections/Utilities.js +1 -1
  74. package/src/View/QuickSearch/FloatingQuickSearch/FloatingQuickSearch.d.ts +2 -0
  75. package/src/View/QuickSearch/FloatingQuickSearch/FloatingQuickSearch.js +26 -0
  76. package/src/View/QuickSearch/QuickSearchInput.d.ts +6 -0
  77. package/src/View/QuickSearch/QuickSearchInput.js +22 -0
  78. package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +2 -5
  79. package/src/View/QuickSearch/QuickSearchViewPanel.js +5 -19
  80. package/src/agGrid/ActionColumnRenderer.js +2 -31
  81. package/src/agGrid/Adaptable.d.ts +2 -0
  82. package/src/agGrid/Adaptable.js +22 -16
  83. package/src/agGrid/agGridHelper.js +7 -2
  84. package/src/components/Drawer/index.d.ts +6 -0
  85. package/src/components/Drawer/index.js +60 -0
  86. package/src/components/ExpressionEditor/index.js +4 -2
  87. package/src/components/icons/fdc3.d.ts +3 -0
  88. package/src/components/icons/fdc3.js +9 -0
  89. package/src/components/icons/index.js +3 -1
  90. package/src/metamodel/adaptable.metamodel.d.ts +161 -19
  91. package/src/metamodel/adaptable.metamodel.js +1 -1
  92. package/src/types.d.ts +8 -4
  93. package/version.d.ts +1 -1
  94. package/version.js +1 -1
  95. /package/src/{PredefinedConfig/Common/FDC3Context.js → Api/Events/ThemeEdited.js} +0 -0
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ColumnInternalApi = void 0;
4
4
  const ApiBase_1 = require("../Implementation/ApiBase");
5
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
5
6
  class ColumnInternalApi extends ApiBase_1.ApiBase {
6
7
  /**
7
8
  * Retrieves 'ColumnType' property for a given Column
@@ -63,5 +64,8 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
63
64
  }
64
65
  return true;
65
66
  }
67
+ isActionRowButtonColumn(columnId) {
68
+ return columnId === GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS;
69
+ }
66
70
  }
67
71
  exports.ColumnInternalApi = ColumnInternalApi;
@@ -0,0 +1,27 @@
1
+ import { ApiBase } from '../Implementation/ApiBase';
2
+ import { Fdc3Context, Fdc3ContextType, Fdc3CustomContextType } from '../../PredefinedConfig/Common/Fdc3Context';
3
+ import { ColDef, IRowNode } from '@ag-grid-community/core';
4
+ import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
5
+ import { ActionColumnContext } from '../../AdaptableOptions/ActionColumnOptions';
6
+ export declare class Fdc3InternalApi extends ApiBase {
7
+ mapRowToContextData(contextType: Fdc3ContextType | Fdc3CustomContextType, rowNode: IRowNode): Fdc3Context;
8
+ /**
9
+ * Computes the context based on the given `Fdc3Options.gridDataContextMapping` and the given `IRowNode`.
10
+ */
11
+ getMappedContextData(contextType: Fdc3ContextType, rowNode: IRowNode): Fdc3Context;
12
+ getFdc3ActionColDefs(): ColDef[];
13
+ getButtonsForFdc3MainActionColumn(): AdaptableButton<ActionColumnContext<any>>[];
14
+ getButtonsForFdc3StandaloneActionColumn(columnId: string): AdaptableButton<ActionColumnContext<any>>[];
15
+ isFdc3MainActionColumn(columnId: string): boolean;
16
+ isFdc3StandaloneActionColumn(columnId: string, columnType: string | string[]): boolean;
17
+ private isAtLeastOneActionButtonConfigured;
18
+ private getIntentConfigsWithActionButtons;
19
+ private getCustomIntentConfigsWithActionButtons;
20
+ private getContextConfigsWithActionButtons;
21
+ private getCustomContextConfigsWithActionButtons;
22
+ private mapRowValueToContextData;
23
+ private mapFdc3ButtonConfigToAdaptableButton;
24
+ private getDefaultFdc3ButtonLabel;
25
+ private getDefaultFdc3ButtonIcon;
26
+ private getDefaultFdc3ButtonStyle;
27
+ }
@@ -0,0 +1,442 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Fdc3InternalApi = void 0;
4
+ const ApiBase_1 = require("../Implementation/ApiBase");
5
+ const fdc3_1 = require("@finos/fdc3");
6
+ const Fdc3Options_1 = require("../../AdaptableOptions/Fdc3Options");
7
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
8
+ const ActionColumnRenderer_1 = require("../../agGrid/ActionColumnRenderer");
9
+ class Fdc3InternalApi extends ApiBase_1.ApiBase {
10
+ mapRowToContextData(contextType, rowNode) {
11
+ const contextMappedFromGridData = this.getFdc3Api().isStandardContextType(contextType)
12
+ ? // @ts-ignore
13
+ this.getMappedContextData(contextType, rowNode)
14
+ : { type: contextType };
15
+ const resolveContextDataFn = this.getFdc3Options().resolveContextData;
16
+ if (typeof resolveContextDataFn === 'function') {
17
+ return resolveContextDataFn(Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { contextType,
18
+ contextMappedFromGridData,
19
+ rowNode, rowData: rowNode.data, primaryKeyValue: this.getGridApi().getPrimaryKeyValueForRowNode(rowNode) }));
20
+ }
21
+ else {
22
+ return contextMappedFromGridData;
23
+ }
24
+ }
25
+ /**
26
+ * Computes the context based on the given `Fdc3Options.gridDataContextMapping` and the given `IRowNode`.
27
+ */
28
+ getMappedContextData(contextType, rowNode) {
29
+ var _a;
30
+ if (contextType === fdc3_1.ContextTypes.Nothing) {
31
+ return { type: fdc3_1.ContextTypes.Nothing };
32
+ }
33
+ const contextMapping = (_a = this.getFdc3Options().gridDataContextMapping) === null || _a === void 0 ? void 0 : _a[contextType];
34
+ if (!contextMapping) {
35
+ return { type: contextType };
36
+ }
37
+ const mappedData = this.mapRowValueToContextData(rowNode, contextMapping);
38
+ return Object.assign({ type: contextType }, mappedData);
39
+ }
40
+ getFdc3ActionColDefs() {
41
+ var _a, _b, _c, _d;
42
+ const actionColDefs = [];
43
+ if (this.isAtLeastOneActionButtonConfigured()) {
44
+ const actionColumnConfig = this.getFdc3Options().actionColumnDefaultConfiguration;
45
+ actionColDefs.push({
46
+ colId: GeneralConstants_1.ADAPTABLE_FDC3_ACTION_COLUMN,
47
+ headerName: actionColumnConfig.headerName,
48
+ hide: false,
49
+ lockVisible: true,
50
+ suppressColumnsToolPanel: true,
51
+ suppressFiltersToolPanel: true,
52
+ editable: false,
53
+ width: actionColumnConfig.width,
54
+ resizable: actionColumnConfig.resizable,
55
+ suppressMenu: true,
56
+ suppressMovable: !actionColumnConfig.movable,
57
+ filter: false,
58
+ sortable: false,
59
+ enableRowGroup: false,
60
+ cellRenderer: this.adaptable.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
61
+ type: [GeneralConstants_1.AB_SPECIAL_COLUMN, GeneralConstants_1.AB_FDC3_COLUMN, 'abColDefObject'],
62
+ });
63
+ }
64
+ const buildColDef = (actionColumnConfig) => {
65
+ return {
66
+ colId: actionColumnConfig.columnId,
67
+ headerName: actionColumnConfig.friendlyName,
68
+ hide: false,
69
+ lockVisible: true,
70
+ suppressColumnsToolPanel: true,
71
+ suppressFiltersToolPanel: true,
72
+ editable: false,
73
+ width: actionColumnConfig.defaultWidth,
74
+ resizable: true,
75
+ suppressMenu: true,
76
+ suppressMovable: false,
77
+ filter: false,
78
+ sortable: false,
79
+ enableRowGroup: false,
80
+ cellRenderer: this.adaptable.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
81
+ type: [GeneralConstants_1.AB_SPECIAL_COLUMN, GeneralConstants_1.AB_FDC3_COLUMN, 'abColDefObject'],
82
+ };
83
+ };
84
+ const raiseIntents = ((_a = this.getFdc3Options().intents) === null || _a === void 0 ? void 0 : _a.raises) || {};
85
+ Object.keys(raiseIntents).forEach((intent) => {
86
+ const intentConfigs = raiseIntents[intent];
87
+ intentConfigs.forEach((intentConfig) => {
88
+ if (!intentConfig.actionColumn) {
89
+ return;
90
+ }
91
+ const intendActionColumnConfig = intentConfig.actionColumn;
92
+ actionColDefs.push(buildColDef(intendActionColumnConfig));
93
+ });
94
+ });
95
+ const raiseCustomIntents = ((_b = this.getFdc3Options().customIntents) === null || _b === void 0 ? void 0 : _b.raises) || {};
96
+ Object.keys(raiseCustomIntents).forEach((intent) => {
97
+ const intentConfigs = raiseCustomIntents[intent];
98
+ intentConfigs.forEach((intentConfig) => {
99
+ if (!intentConfig.actionColumn) {
100
+ return;
101
+ }
102
+ const intendActionColumnConfig = intentConfig.actionColumn;
103
+ actionColDefs.push(buildColDef(intendActionColumnConfig));
104
+ });
105
+ });
106
+ const broadcastContexts = ((_c = this.getFdc3Options().contexts) === null || _c === void 0 ? void 0 : _c.broadcasts) || {};
107
+ Object.keys(broadcastContexts).forEach((contextType) => {
108
+ const contextConfig = broadcastContexts[contextType];
109
+ if (!contextConfig.actionColumn) {
110
+ return;
111
+ }
112
+ const contextActionColumnConfig = contextConfig.actionColumn;
113
+ actionColDefs.push(buildColDef(contextActionColumnConfig));
114
+ });
115
+ const broadcastCustomContexts = ((_d = this.getFdc3Options().customContexts) === null || _d === void 0 ? void 0 : _d.broadcasts) || {};
116
+ Object.keys(broadcastCustomContexts).forEach((contextType) => {
117
+ const contextConfig = broadcastCustomContexts[contextType];
118
+ if (!contextConfig.actionColumn) {
119
+ return;
120
+ }
121
+ const contextActionColumnConfig = contextConfig.actionColumn;
122
+ actionColDefs.push(buildColDef(contextActionColumnConfig));
123
+ });
124
+ return actionColDefs;
125
+ }
126
+ getButtonsForFdc3MainActionColumn() {
127
+ const buttons = [];
128
+ const intentButtonConfigs = this.getIntentConfigsWithActionButtons();
129
+ Object.keys(intentButtonConfigs).forEach((intent) => {
130
+ const intentConfigs = intentButtonConfigs[intent];
131
+ intentConfigs.forEach((intentConfig) => {
132
+ if (!intentConfig.actionButton) {
133
+ return;
134
+ }
135
+ const intendActionButtonConfig = intentConfig.actionButton;
136
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(intendActionButtonConfig, {
137
+ action: 'raiseIntent',
138
+ intent,
139
+ contextType: intentConfig.contextType,
140
+ }));
141
+ });
142
+ });
143
+ const intentCustomButtonConfigs = this.getCustomIntentConfigsWithActionButtons();
144
+ Object.keys(intentCustomButtonConfigs).forEach((intent) => {
145
+ const intentConfigs = intentCustomButtonConfigs[intent];
146
+ intentConfigs.forEach((intentConfig) => {
147
+ if (!intentConfig.actionButton) {
148
+ return;
149
+ }
150
+ const intendActionButtonConfig = intentConfig.actionButton;
151
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(intendActionButtonConfig, {
152
+ action: 'raiseIntent',
153
+ intent,
154
+ contextType: intentConfig.contextType,
155
+ }));
156
+ });
157
+ });
158
+ const broadcastButtonConfigs = this.getContextConfigsWithActionButtons();
159
+ Object.keys(broadcastButtonConfigs).forEach((contextType) => {
160
+ const contextConfig = broadcastButtonConfigs[contextType];
161
+ if (!contextConfig.actionButton) {
162
+ return;
163
+ }
164
+ const contextActionButtonConfig = contextConfig.actionButton;
165
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(contextActionButtonConfig, {
166
+ action: 'broadcastContext',
167
+ contextType,
168
+ }));
169
+ });
170
+ const broadcastCustomButtonConfigs = this.getCustomContextConfigsWithActionButtons();
171
+ Object.keys(broadcastCustomButtonConfigs).forEach((contextType) => {
172
+ const contextConfig = broadcastCustomButtonConfigs[contextType];
173
+ if (!contextConfig.actionButton) {
174
+ return;
175
+ }
176
+ const contextActionButtonConfig = contextConfig.actionButton;
177
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(contextActionButtonConfig, {
178
+ action: 'broadcastContext',
179
+ contextType,
180
+ }));
181
+ });
182
+ return buttons;
183
+ }
184
+ getButtonsForFdc3StandaloneActionColumn(columnId) {
185
+ var _a, _b, _c, _d;
186
+ const buttons = [];
187
+ // standard intents
188
+ const intentButtonConfigs = ((_a = this.getFdc3Options().intents) === null || _a === void 0 ? void 0 : _a.raises) || {};
189
+ Object.keys(intentButtonConfigs).forEach((intent) => {
190
+ const intentConfigs = intentButtonConfigs[intent];
191
+ intentConfigs.forEach((intentConfig) => {
192
+ var _a;
193
+ if (((_a = intentConfig.actionColumn) === null || _a === void 0 ? void 0 : _a.columnId) === columnId) {
194
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(intentConfig.actionColumn.button, {
195
+ action: 'raiseIntent',
196
+ intent,
197
+ contextType: intentConfig.contextType,
198
+ }));
199
+ }
200
+ });
201
+ });
202
+ // standard contexts
203
+ const broadcastButtonConfigs = ((_b = this.getFdc3Options().contexts) === null || _b === void 0 ? void 0 : _b.broadcasts) || {};
204
+ Object.keys(broadcastButtonConfigs).forEach((contextType) => {
205
+ var _a;
206
+ const contextConfig = broadcastButtonConfigs[contextType];
207
+ if (((_a = contextConfig.actionColumn) === null || _a === void 0 ? void 0 : _a.columnId) === columnId) {
208
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(contextConfig.actionColumn.button, {
209
+ action: 'broadcastContext',
210
+ contextType,
211
+ }));
212
+ }
213
+ });
214
+ // custom intents
215
+ const intentCustomButtonConfigs = ((_c = this.getFdc3Options().customIntents) === null || _c === void 0 ? void 0 : _c.raises) || {};
216
+ Object.keys(intentCustomButtonConfigs).forEach((intent) => {
217
+ const intentConfigs = intentCustomButtonConfigs[intent];
218
+ intentConfigs.forEach((intentConfig) => {
219
+ var _a;
220
+ if (((_a = intentConfig.actionColumn) === null || _a === void 0 ? void 0 : _a.columnId) === columnId) {
221
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(intentConfig.actionColumn.button, {
222
+ action: 'raiseIntent',
223
+ intent,
224
+ contextType: intentConfig.contextType,
225
+ }));
226
+ }
227
+ });
228
+ });
229
+ // custom contexts
230
+ const broadcastCustomButtonConfigs = ((_d = this.getFdc3Options().customContexts) === null || _d === void 0 ? void 0 : _d.broadcasts) || {};
231
+ Object.keys(broadcastCustomButtonConfigs).forEach((contextType) => {
232
+ var _a;
233
+ const contextConfig = broadcastCustomButtonConfigs[contextType];
234
+ if (((_a = contextConfig.actionColumn) === null || _a === void 0 ? void 0 : _a.columnId) === columnId) {
235
+ buttons.push(this.mapFdc3ButtonConfigToAdaptableButton(contextConfig.actionColumn.button, {
236
+ action: 'broadcastContext',
237
+ contextType,
238
+ }));
239
+ }
240
+ });
241
+ return buttons;
242
+ }
243
+ isFdc3MainActionColumn(columnId) {
244
+ return columnId === GeneralConstants_1.ADAPTABLE_FDC3_ACTION_COLUMN;
245
+ }
246
+ isFdc3StandaloneActionColumn(columnId, columnType) {
247
+ const types = typeof columnType === 'string' ? [columnType] : columnType;
248
+ return types.includes(GeneralConstants_1.AB_FDC3_COLUMN) && !this.isFdc3MainActionColumn(columnId);
249
+ }
250
+ isAtLeastOneActionButtonConfigured() {
251
+ return (!!Object.keys(this.getIntentConfigsWithActionButtons()).length ||
252
+ !!Object.keys(this.getContextConfigsWithActionButtons()).length ||
253
+ !!Object.keys(this.getCustomIntentConfigsWithActionButtons()).length ||
254
+ !!Object.keys(this.getCustomContextConfigsWithActionButtons()).length);
255
+ }
256
+ getIntentConfigsWithActionButtons() {
257
+ var _a;
258
+ let result = {};
259
+ const raiseIntents = ((_a = this.getFdc3Options().intents) === null || _a === void 0 ? void 0 : _a.raises) || {};
260
+ Object.keys(raiseIntents).forEach((intent) => {
261
+ const intentConfigs = raiseIntents[intent];
262
+ if (intentConfigs.some((intentConfig) => intentConfig.actionButton)) {
263
+ // @ts-ignore
264
+ result[intent] = raiseIntents[intent];
265
+ }
266
+ });
267
+ return result;
268
+ }
269
+ getCustomIntentConfigsWithActionButtons() {
270
+ var _a;
271
+ let result = {};
272
+ const raiseIntents = ((_a = this.getFdc3Options().customIntents) === null || _a === void 0 ? void 0 : _a.raises) || {};
273
+ Object.keys(raiseIntents).forEach((intent) => {
274
+ const intentConfigs = raiseIntents[intent];
275
+ if (intentConfigs.some((intentConfig) => intentConfig.actionButton)) {
276
+ // @ts-ignore
277
+ result[intent] = raiseIntents[intent];
278
+ }
279
+ });
280
+ return result;
281
+ }
282
+ getContextConfigsWithActionButtons() {
283
+ var _a;
284
+ let result = {};
285
+ const broadcastContexts = ((_a = this.getFdc3Options().contexts) === null || _a === void 0 ? void 0 : _a.broadcasts) || {};
286
+ Object.keys(broadcastContexts).forEach((contextType) => {
287
+ const contextConfig = broadcastContexts[contextType];
288
+ if (contextConfig.actionButton) {
289
+ result[contextType] = contextConfig;
290
+ }
291
+ });
292
+ return result;
293
+ }
294
+ getCustomContextConfigsWithActionButtons() {
295
+ var _a;
296
+ let result = {};
297
+ const broadcastContexts = ((_a = this.getFdc3Options().customContexts) === null || _a === void 0 ? void 0 : _a.broadcasts) || {};
298
+ Object.keys(broadcastContexts).forEach((contextType) => {
299
+ const contextConfig = broadcastContexts[contextType];
300
+ if (contextConfig.actionButton) {
301
+ result[contextType] = contextConfig;
302
+ }
303
+ });
304
+ return result;
305
+ }
306
+ mapRowValueToContextData(rowNode, contextMapping = {}) {
307
+ // recursively map the row node values to the context data
308
+ const mapContext = (obj) => {
309
+ return Object.keys(obj).reduce((mappedData, contextKey) => {
310
+ const valueReference = obj[contextKey];
311
+ if (Array.isArray(valueReference)) {
312
+ mappedData[contextKey] = valueReference.map((item) => mapContext(item));
313
+ }
314
+ else if (typeof valueReference === 'object') {
315
+ mappedData[contextKey] = mapContext(valueReference);
316
+ }
317
+ else {
318
+ // map value from row node
319
+ // first validate refs
320
+ if (typeof valueReference !== 'string' ||
321
+ (!valueReference.startsWith(Fdc3Options_1.ColumnRefTypePrefix) &&
322
+ !valueReference.startsWith(Fdc3Options_1.FieldRefTypePrefix))) {
323
+ this.logError(`Invalid FDC3 value reference for '${contextKey}': ${valueReference}`);
324
+ return mappedData;
325
+ }
326
+ // '_coldId.columnId'
327
+ if (valueReference.startsWith(Fdc3Options_1.ColumnRefTypePrefix)) {
328
+ const columnId = valueReference.replace(Fdc3Options_1.ColumnRefTypePrefix, '');
329
+ mappedData[contextKey] = this.getGridApi().getRawValueFromRowNode(rowNode, columnId);
330
+ }
331
+ // '_field.fieldName'
332
+ if (valueReference.startsWith(Fdc3Options_1.FieldRefTypePrefix)) {
333
+ const fieldId = valueReference.replace(Fdc3Options_1.FieldRefTypePrefix, '');
334
+ mappedData[contextKey] = this.getAdaptableApi().internalApi.getValueUsingField(rowNode.data, fieldId);
335
+ }
336
+ }
337
+ return mappedData;
338
+ }, {});
339
+ };
340
+ return mapContext(contextMapping);
341
+ }
342
+ mapFdc3ButtonConfigToAdaptableButton(fdc3AdaptableButton, fdcInfo) {
343
+ const buildFdc3Context = (context) => {
344
+ return {
345
+ context: this.mapRowToContextData(fdcInfo.contextType, context.rowNode),
346
+ intent: fdcInfo.action === 'raiseIntent' ? fdcInfo.intent : null,
347
+ rowNode: context.rowNode,
348
+ rowData: context.data,
349
+ adaptableId: context.adaptableId,
350
+ primaryKeyValue: context.primaryKeyValue,
351
+ userName: context.userName,
352
+ adaptableApi: context.adaptableApi,
353
+ };
354
+ };
355
+ return {
356
+ onClick: (_button, context) => {
357
+ if (fdcInfo.action === 'raiseIntent') {
358
+ this.getFdc3Api().raiseIntentFromRow(context.rowNode, fdcInfo.intent, fdcInfo.contextType);
359
+ }
360
+ if (fdcInfo.action === 'broadcastContext') {
361
+ this.getFdc3Api().broadcastFromRow(context.rowNode, fdcInfo.contextType);
362
+ }
363
+ },
364
+ label: (_button, context) => {
365
+ const fdc3Label = fdc3AdaptableButton.label;
366
+ if (typeof fdc3Label === 'function') {
367
+ return fdc3Label(fdc3AdaptableButton, buildFdc3Context(context));
368
+ }
369
+ if (fdc3Label === '_defaultFdc3') {
370
+ return this.getDefaultFdc3ButtonLabel(fdcInfo);
371
+ }
372
+ return fdc3Label;
373
+ },
374
+ icon: (_button, context) => {
375
+ const fdc3Icon = fdc3AdaptableButton.icon;
376
+ if (typeof fdc3Icon === 'function') {
377
+ return fdc3Icon(fdc3AdaptableButton, buildFdc3Context(context));
378
+ }
379
+ if (fdc3Icon === '_defaultFdc3') {
380
+ return this.getDefaultFdc3ButtonIcon(fdcInfo);
381
+ }
382
+ return fdc3Icon;
383
+ },
384
+ buttonStyle: (_button, context) => {
385
+ const fdc3ButtonStyle = fdc3AdaptableButton.buttonStyle;
386
+ if (fdc3ButtonStyle == undefined) {
387
+ return this.getDefaultFdc3ButtonStyle(fdcInfo);
388
+ }
389
+ if (typeof fdc3ButtonStyle === 'function') {
390
+ return fdc3ButtonStyle(fdc3AdaptableButton, buildFdc3Context(context));
391
+ }
392
+ return fdc3ButtonStyle;
393
+ },
394
+ tooltip: (_button, context) => {
395
+ const fdc3Tooltip = fdc3AdaptableButton.tooltip;
396
+ if (typeof fdc3Tooltip === 'function') {
397
+ return fdc3Tooltip(fdc3AdaptableButton, buildFdc3Context(context));
398
+ }
399
+ if (fdc3Tooltip === '_defaultFdc3') {
400
+ return this.getDefaultFdc3ButtonLabel(fdcInfo);
401
+ }
402
+ return fdc3Tooltip;
403
+ },
404
+ disabled: (_button, context) => {
405
+ const fdc3Disabled = fdc3AdaptableButton.disabled;
406
+ if (typeof fdc3Disabled === 'function') {
407
+ return fdc3Disabled(fdc3AdaptableButton, buildFdc3Context(context));
408
+ }
409
+ return fdc3Disabled;
410
+ },
411
+ hidden: (_button, context) => {
412
+ const fdc3Hidden = fdc3AdaptableButton.hidden;
413
+ if (typeof fdc3Hidden === 'function') {
414
+ return fdc3Hidden(fdc3AdaptableButton, buildFdc3Context(context));
415
+ }
416
+ return fdc3Hidden;
417
+ },
418
+ };
419
+ }
420
+ getDefaultFdc3ButtonLabel(fdc3Info) {
421
+ if (fdc3Info.action === 'raiseIntent') {
422
+ return `Raise ${fdc3Info.intent}`;
423
+ }
424
+ if (fdc3Info.action === 'broadcastContext') {
425
+ return `Broadcast ${this.getFdc3Api().getContextLabel(fdc3Info.contextType)}`;
426
+ }
427
+ return '';
428
+ }
429
+ getDefaultFdc3ButtonIcon(fdc3Info) {
430
+ // TODO AFL: extends with intend&context specific icons
431
+ return {
432
+ name: 'fdc3',
433
+ };
434
+ }
435
+ getDefaultFdc3ButtonStyle(fdcInfo) {
436
+ return {
437
+ variant: 'outlined',
438
+ tone: 'neutral',
439
+ };
440
+ }
441
+ }
442
+ exports.Fdc3InternalApi = Fdc3InternalApi;
@@ -2,6 +2,7 @@ import { CustomSortOptions } from '../AdaptableOptions/CustomSortOptions';
2
2
  import { DataSetOptions } from '../AdaptableOptions/DataSetOptions';
3
3
  import { GroupingOptions } from '../AdaptableOptions/GroupingOptions';
4
4
  import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AdaptableQLOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnOptions, ContainerOptions, DashboardOptions, DataChangeHistoryOptions, EditOptions, EntitlementOptions, ExportOptions, FilterOptions, FlashingCellOptions, FormatColumnOptions, LayoutOptions, MenuOptions, NotificationsOptions, QuickSearchOptions, SettingsPanelOptions, StateOptions, TeamSharingOptions, ToolPanelOptions, UserInterfaceOptions } from '../types';
5
+ import { Fdc3Options } from '../AdaptableOptions/Fdc3Options';
5
6
  /**
6
7
  * Range of functions to access Adaptable Options
7
8
  */
@@ -150,4 +151,8 @@ export interface OptionsApi {
150
151
  * Returns `AdaptableOptions.userInterfaceOptions`
151
152
  */
152
153
  getUserInterfaceOptions(): Readonly<UserInterfaceOptions>;
154
+ /**
155
+ * Returns `AdaptableOptions.fdc3Options`
156
+ */
157
+ getFdc3Options(): Readonly<Fdc3Options>;
153
158
  }
@@ -34,4 +34,12 @@ export interface QuickSearchApi {
34
34
  * Opens Settings Panel with Quick Search section selected and visible
35
35
  */
36
36
  openQuickSearchSettingsPanel(): void;
37
+ /**
38
+ * Opens the floating Quick Search
39
+ */
40
+ showFloatingQuickSearch(): void;
41
+ /**
42
+ * Hides the floating Quick Search
43
+ */
44
+ hideFloatingQuickSearch(): void;
37
45
  }
@@ -31,7 +31,7 @@ export interface AdaptableButton<CONTEXT_TYPE extends BaseContext> extends Adapt
31
31
  */
32
32
  onClick?: (button: AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => void;
33
33
  /**
34
- *Function which sets whether Button is hidden
34
+ * Function which sets whether Button is hidden
35
35
  */
36
36
  hidden?: (button: AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean;
37
37
  }
@@ -54,4 +54,4 @@ export interface AdaptableBaseIcon {
54
54
  /**
55
55
  * All AdapTable System Icon names
56
56
  */
57
- export declare type AdaptableSystemIconName = 'add' | 'alert' | 'building' | 'laptop' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-up-long' | 'arrow-down-long' | 'arrow-expand' | 'paperclip' | 'unfilled-circle' | 'boolean-list' | 'broadcast' | 'brush' | 'spanner' | 'edit-table' | 'chart-and-grid' | 'calendar' | 'call' | 'cells' | 'flag' | 'chart' | 'chat' | 'check' | 'check-circle' | 'checked' | 'clone' | 'close' | 'cloud-upload' | 'collapse' | 'column-add' | 'columns' | 'filter-list' | 'comment' | 'contains' | 'dashboard' | 'data-set' | 'date-range' | 'delete' | 'division' | 'dock' | 'drag' | 'edit' | 'ends-with' | 'equals' | 'equation' | 'error' | 'expand' | 'exponent' | 'export' | 'export-data' | 'fast-backward' | 'fast-forward' | 'filter' | 'lightning' | 'folder' | 'folder-open' | 'folder-shared' | 'color-palette' | 'horizontal-lines' | 'function' | 'greater-than' | 'greater-than-or-equal' | 'history' | 'home' | 'import-export' | 'info' | 'brain' | 'download' | 'grid' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'menu' | 'minus' | 'multiplication' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'settings' | 'link' | 'sort-asc' | 'sort-desc' | 'spark-line' | 'starts-with' | 'assignment' | 'statusbar' | 'stop' | 'traffic-lights' | 'tab-unselected' | 'theme' | 'clipboard' | 'target' | 'triangle-down' | 'triangle-up' | 'unchecked' | 'undo' | 'downloaded' | 'upload' | 'warning' | 'gradient' | 'badge' | 'italic' | 'bold' | 'align-left' | 'align-right' | 'align-center' | 'align-justify' | 'underline' | 'strikethrough' | 'overline' | 'case-upper' | 'case-lower' | 'case-sentence' | 'visibility-on' | 'visibility-off' | 'visibility-off-bold' | 'visibility-on-bold';
57
+ export declare type AdaptableSystemIconName = 'add' | 'alert' | 'building' | 'laptop' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-up-long' | 'arrow-down-long' | 'arrow-expand' | 'paperclip' | 'unfilled-circle' | 'boolean-list' | 'broadcast' | 'brush' | 'spanner' | 'edit-table' | 'chart-and-grid' | 'calendar' | 'call' | 'cells' | 'fdc3' | 'flag' | 'chart' | 'chat' | 'check' | 'check-circle' | 'checked' | 'clone' | 'close' | 'cloud-upload' | 'collapse' | 'column-add' | 'columns' | 'filter-list' | 'comment' | 'contains' | 'dashboard' | 'data-set' | 'date-range' | 'delete' | 'division' | 'dock' | 'drag' | 'edit' | 'ends-with' | 'equals' | 'equation' | 'error' | 'expand' | 'exponent' | 'export' | 'export-data' | 'fast-backward' | 'fast-forward' | 'filter' | 'lightning' | 'folder' | 'folder-open' | 'folder-shared' | 'color-palette' | 'horizontal-lines' | 'function' | 'greater-than' | 'greater-than-or-equal' | 'history' | 'home' | 'import-export' | 'info' | 'brain' | 'download' | 'grid' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'menu' | 'minus' | 'multiplication' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'settings' | 'link' | 'sort-asc' | 'sort-desc' | 'spark-line' | 'starts-with' | 'assignment' | 'statusbar' | 'stop' | 'traffic-lights' | 'tab-unselected' | 'theme' | 'clipboard' | 'target' | 'triangle-down' | 'triangle-up' | 'unchecked' | 'undo' | 'downloaded' | 'upload' | 'warning' | 'gradient' | 'badge' | 'italic' | 'bold' | 'align-left' | 'align-right' | 'align-center' | 'align-justify' | 'underline' | 'strikethrough' | 'overline' | 'case-upper' | 'case-lower' | 'case-sentence' | 'visibility-on' | 'visibility-off' | 'visibility-off-bold' | 'visibility-on-bold';