@adaptabletools/adaptable 16.0.10-canary.0 → 16.1.0-canary.1

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 (103) hide show
  1. package/agGrid.d.ts +4 -0
  2. package/agGrid.js +4 -0
  3. package/base.css +2 -0
  4. package/base.css.map +1 -1
  5. package/bundle.cjs.js +162 -161
  6. package/index.css +4 -0
  7. package/index.css.map +1 -1
  8. package/package.json +1 -1
  9. package/publishTimestamp.d.ts +1 -1
  10. package/publishTimestamp.js +1 -1
  11. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +12 -1
  12. package/src/AdaptableOptions/AdaptableOptions.d.ts +5 -0
  13. package/src/AdaptableOptions/ChartingOptions.d.ts +44 -39
  14. package/src/AdaptableOptions/DataImportOptions.d.ts +67 -0
  15. package/src/AdaptableOptions/DataImportOptions.js +2 -0
  16. package/src/AdaptableOptions/MenuOptions.d.ts +147 -8
  17. package/src/AdaptableOptions/MenuOptions.js +75 -0
  18. package/src/Api/AdaptableApi.d.ts +5 -0
  19. package/src/Api/DataImportApi.d.ts +9 -0
  20. package/src/Api/DataImportApi.js +2 -0
  21. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
  22. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  23. package/src/Api/Implementation/DataImportApiImpl.d.ts +10 -0
  24. package/src/Api/Implementation/DataImportApiImpl.js +14 -0
  25. package/src/Api/Implementation/ExpressionApiImpl.js +1 -1
  26. package/src/Api/Implementation/OptionsApiImpl.d.ts +1 -0
  27. package/src/Api/Implementation/OptionsApiImpl.js +3 -0
  28. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +5 -1
  29. package/src/Api/Implementation/UserInterfaceApiImpl.js +22 -0
  30. package/src/Api/Internal/ChartingInternalApi.js +15 -15
  31. package/src/Api/Internal/DataImportInternalApi.d.ts +4 -0
  32. package/src/Api/Internal/DataImportInternalApi.js +53 -0
  33. package/src/Api/OptionsApi.d.ts +5 -0
  34. package/src/Api/UserInterfaceApi.d.ts +14 -0
  35. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  36. package/src/PredefinedConfig/Common/Menu.d.ts +1 -6
  37. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  38. package/src/PredefinedConfig/Common/Types.js +2 -0
  39. package/src/Strategy/ChartingModule.js +1 -1
  40. package/src/Strategy/DataImportModule.d.ts +11 -0
  41. package/src/Strategy/DataImportModule.js +36 -0
  42. package/src/Strategy/Fdc3Module.js +3 -2
  43. package/src/Strategy/LayoutModule.js +1 -0
  44. package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
  45. package/src/Utilities/Constants/ModuleConstants.js +4 -1
  46. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
  47. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
  48. package/src/Utilities/Helpers/AdaptableHelper.js +2 -0
  49. package/src/Utilities/Interface/MessagePopups.d.ts +2 -2
  50. package/src/Utilities/Services/ModuleService.js +2 -0
  51. package/src/View/AdaptableViewFactory.js +2 -0
  52. package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +1 -1
  53. package/src/View/Components/ExternalRenderer.d.ts +1 -0
  54. package/src/View/Components/ExternalRenderer.js +2 -1
  55. package/src/View/Components/Panels/PanelWithImage.js +3 -3
  56. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
  57. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +4 -1
  58. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -0
  59. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +1 -0
  60. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +14 -4
  61. package/src/View/DataImport/DataImportPopup.d.ts +6 -0
  62. package/src/View/DataImport/DataImportPopup.js +32 -0
  63. package/src/View/DataImport/DataImportWizard/DataImportWizard.d.ts +8 -0
  64. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +176 -0
  65. package/src/View/DataImport/DataImportWizard/index.d.ts +1 -0
  66. package/src/View/DataImport/DataImportWizard/index.js +4 -0
  67. package/src/View/DataImport/DataImportWizard/sections/DataPreview.d.ts +10 -0
  68. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +154 -0
  69. package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +9 -0
  70. package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +24 -0
  71. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadFileSection.d.ts +8 -0
  72. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadFileSection.js +11 -0
  73. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.d.ts +13 -0
  74. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +23 -0
  75. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.d.ts +8 -0
  76. package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +13 -0
  77. package/src/View/DataImport/DataImportWizard/sections/UploadSection/index.d.ts +1 -0
  78. package/src/View/DataImport/DataImportWizard/sections/UploadSection/index.js +4 -0
  79. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.d.ts +11 -0
  80. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +35 -0
  81. package/src/View/DataImport/systemFileHandlers.d.ts +3 -0
  82. package/src/View/DataImport/systemFileHandlers.js +44 -0
  83. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
  84. package/src/View/Wizard/OnePageWizards.d.ts +1 -0
  85. package/src/View/Wizard/OnePageWizards.js +2 -2
  86. package/src/agGrid/agGridHelper.js +2 -0
  87. package/src/agGrid/agGridMenuHelper.d.ts +20 -9
  88. package/src/agGrid/agGridMenuHelper.js +288 -133
  89. package/src/components/FileDroppable/index.d.ts +2 -1
  90. package/src/components/FileDroppable/index.js +8 -7
  91. package/src/components/icons/import.d.ts +3 -0
  92. package/src/components/icons/import.js +7 -0
  93. package/src/components/icons/index.js +2 -0
  94. package/src/metamodel/adaptable.metamodel.d.ts +171 -2
  95. package/src/metamodel/adaptable.metamodel.js +1 -1
  96. package/src/parser/src/index.d.ts +2 -2
  97. package/src/parser/src/index.js +4 -4
  98. package/src/parser/src/tokenizer.d.ts +1 -1
  99. package/src/parser/src/tokenizer.js +14 -6
  100. package/src/parser/src/types.d.ts +2 -2
  101. package/src/types.d.ts +5 -4
  102. package/version.d.ts +1 -1
  103. package/version.js +1 -1
@@ -1,33 +1,44 @@
1
1
  import { AdaptableMenuItem, ColumnMenuContext, ContextMenuContext, UserMenuItem } from '../PredefinedConfig/Common/Menu';
2
- import { AdaptableColumn, BaseContext } from '../types';
2
+ import { AdaptableColumn, AdaptableIcon, AdaptableModule, BaseContext } from '../types';
3
3
  /**
4
4
  * Options for managing menus in AdapTable
5
5
  */
6
6
  export interface MenuOptions<TData = any> {
7
7
  /**
8
- * Show Adaptable Context Menu (or specific items); can be boolean value or function invoked for each menu item
8
+ * Adds 'Ungroup' Column Menu item to a row grouped column menu
9
9
  *
10
10
  * @defaultValue true
11
11
  * @gridInfoItem
12
12
  */
13
- showAdaptableContextMenu?: boolean | ((menuItem: AdaptableMenuItem, menuContext: ContextMenuContext<TData>) => boolean);
13
+ showUngroupColumnMenuItem?: boolean;
14
14
  /**
15
- * Show Adaptable Column Menu (or specific items); can be boolean value or function invoked for each menu item
15
+ * Customised Context Menu. Default context menu items are available in the provided context.
16
+ */
17
+ customContextMenu?: (menuContext: CustomContextMenuContext<TData>) => CustomContextMenuItem[];
18
+ /**
19
+ * Customised Column Menu. Default column menu items are available in the provided context.
20
+ */
21
+ customColumnMenu?: (menuContext: CustomColumnMenuContext<TData>) => CustomColumnMenuItem[];
22
+ /**
23
+ * Show Adaptable Context Menu (or specific items); can be boolean value or function invoked for each menu item
16
24
  *
25
+ * @deprecated Use `customContextMenu` instead
17
26
  * @defaultValue true
18
27
  * @gridInfoItem
19
28
  */
20
- showAdaptableColumnMenu?: boolean | ((menuItem: AdaptableMenuItem, menuContext: ColumnMenuContext<TData>) => boolean);
29
+ showAdaptableContextMenu?: boolean | ((menuItem: AdaptableMenuItem, menuContext: ContextMenuContext<TData>) => boolean);
21
30
  /**
22
- * Adds 'Ungroup' Column Menu item to a row grouped column
31
+ * Show Adaptable Column Menu (or specific items); can be boolean value or function invoked for each menu item
23
32
  *
33
+ * @deprecated Use `customContextMenu` instead
24
34
  * @defaultValue true
25
35
  * @gridInfoItem
26
36
  */
27
- showUngroupColumnMenuItem?: boolean;
37
+ showAdaptableColumnMenu?: boolean | ((menuItem: AdaptableMenuItem, menuContext: ColumnMenuContext<TData>) => boolean);
28
38
  /**
29
39
  * Order in which AG Grid, AdapTable and User Menu sections will appear in Column Menu (list or function)
30
40
  *
41
+ * @deprecated Use `customColumnMenu` instead
31
42
  * @defaultValue 'aggrid', 'adaptable', 'user'
32
43
  * @gridInfoItem
33
44
  */
@@ -35,19 +46,143 @@ export interface MenuOptions<TData = any> {
35
46
  /**
36
47
  * Order in which AG Grid, AdapTable and User Menu sections will appear in Context Menu (list or function)
37
48
  *
49
+ * @deprecated Use `customContextMenu` instead
38
50
  * @defaultValue 'aggrid', 'adaptable', 'user'
39
51
  * @gridInfoItem
40
52
  */
41
53
  contextMenuOrder?: ((context: MenuOrderContext) => ('aggrid' | 'adaptable' | 'user')[]) | ('aggrid' | 'adaptable' | 'user')[];
42
54
  /**
43
55
  * User-defined Menu Items to add to the Column Menu
56
+ *
57
+ * @deprecated Use `customColumnMenu` instead
44
58
  */
45
59
  columnMenuItems?: UserMenuItem<ColumnMenuContext>[];
46
60
  /**
47
- * User-defined Menu Items to add to the Context Menu
61
+ * Customised Context Menu. Default context menu items are available in the provided context.
62
+ *
63
+ * @deprecated Use `customContextMenu` instead
48
64
  */
49
65
  contextMenuItems?: UserMenuItem<ContextMenuContext>[];
50
66
  }
67
+ /**
68
+ * Context info provided when building Custom Context Menus
69
+ */
70
+ export interface CustomContextMenuContext<TData = any> extends ContextMenuContext<TData> {
71
+ /**
72
+ * Default AG Grid Menu Items
73
+ */
74
+ defaultAgGridMenuItems: AgGridMenuItem<AgGridContextMenuItemType>[];
75
+ /**
76
+ * Default Adaptable Menu Items
77
+ */
78
+ defaultAdaptableMenuItems: AdaptableSystemMenuItem[];
79
+ }
80
+ /**
81
+ * Context info provided when building Custom Context Menus
82
+ */
83
+ export interface CustomColumnMenuContext<TData = any> extends ColumnMenuContext<TData> {
84
+ /**
85
+ * Default AG Grid Menu Items
86
+ */
87
+ defaultAgGridMenuItems: AgGridMenuItem<AgGridColumnMenuItemType>[];
88
+ /**
89
+ * Default Adaptable Menu Items
90
+ */
91
+ defaultAdaptableMenuItems: AdaptableSystemMenuItem[];
92
+ }
93
+ /**
94
+ * Custom Context Menu Item
95
+ */
96
+ export declare type CustomContextMenuItem = AgGridMenuItem<AgGridContextMenuItemType> | AdaptableSystemMenuItem | UserContextMenuItem | '-' | {
97
+ menuType: 'Group';
98
+ label: string;
99
+ subMenuItems: CustomContextMenuItem[];
100
+ disabled?: boolean;
101
+ icon?: AdaptableIcon;
102
+ };
103
+ /**
104
+ * Custom Column Menu Item
105
+ */
106
+ export declare type CustomColumnMenuItem = AgGridMenuItem<AgGridColumnMenuItemType> | AdaptableSystemMenuItem | UserColumnMenuItem | '-' | {
107
+ menuType: 'Group';
108
+ label: string;
109
+ subMenuItems: CustomColumnMenuItem[];
110
+ disabled?: boolean;
111
+ icon?: AdaptableIcon;
112
+ };
113
+ /**
114
+ * Menu Item that is provided by AG Grid
115
+ */
116
+ export interface AgGridMenuItem<MENU_TYPE> {
117
+ menuType: 'AgGrid';
118
+ name: MENU_TYPE;
119
+ }
120
+ /**
121
+ * Context Menu Item that is provided by AdapTable
122
+ */
123
+ export interface AdaptableSystemMenuItem extends AdaptableMenuItem {
124
+ menuType: 'Adaptable';
125
+ }
126
+ /**
127
+ * Context Menu Item that is provided by User
128
+ */
129
+ export interface UserContextMenuItem {
130
+ menuType: 'User';
131
+ /**
132
+ * Text to appear in the Menu Item
133
+ */
134
+ label: string;
135
+ /**
136
+ * Function invoked when the Menu Item is clicked
137
+ */
138
+ onClick?: (menuContext: ContextMenuContext) => void;
139
+ /**
140
+ * Whether menu item is disabled
141
+ */
142
+ disabled?: boolean;
143
+ /**
144
+ * Whether menu item is hidden
145
+ */
146
+ hidden?: boolean;
147
+ /**
148
+ * Optional icon to display
149
+ */
150
+ icon?: AdaptableIcon;
151
+ /**
152
+ * Array of Menu Items, enabling limitless levels of menus
153
+ */
154
+ subMenuItems?: CustomContextMenuItem[];
155
+ }
156
+ /**
157
+ * Context Menu Item that is provided by User
158
+ */
159
+ export interface UserColumnMenuItem {
160
+ menuType: 'User';
161
+ /**
162
+ * Text to appear in the Menu Item
163
+ */
164
+ label: string;
165
+ /**
166
+ * Function invoked when the Menu Item is clicked
167
+ */
168
+ onClick?: (menuContext: ColumnMenuContext) => void;
169
+ /**
170
+ * Whether menu item is disabled
171
+ */
172
+ disabled?: boolean;
173
+ /**
174
+ * Whether menu item is hidden
175
+ */
176
+ hidden?: boolean;
177
+ /**
178
+ * Optional icon to display
179
+ */
180
+ icon?: AdaptableIcon;
181
+ /**
182
+ * Array of Menu Items, enabling limitless levels of menus
183
+ */
184
+ subMenuItems?: CustomColumnMenuItem[];
185
+ }
51
186
  /**
52
187
  * Context used when ordering Menu Sections
53
188
  */
@@ -57,3 +192,7 @@ export interface MenuOrderContext extends BaseContext {
57
192
  */
58
193
  column: AdaptableColumn;
59
194
  }
195
+ export declare type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractAll' | 'copy' | 'copyWithHeaders' | 'cut' | 'paste' | 'resetColumns' | 'export' | 'csvExport' | 'excelExport' | 'chartRange' | 'pivotChart';
196
+ export declare type AgGridColumnMenuItemType = 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll';
197
+ export declare const DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER: AdaptableModule[];
198
+ export declare const DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER: AdaptableModule[];
@@ -1,2 +1,77 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER = exports.DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
6
+ exports.DEFAULT_ADAPTABLE_CONTEXT_MENU_ORDER = [
7
+ ModuleConstants.SettingsPanelModuleId,
8
+ ModuleConstants.LayoutModuleId,
9
+ ModuleConstants.FlashingCellModuleId,
10
+ ModuleConstants.FormatColumnModuleId,
11
+ ModuleConstants.StyledColumnModuleId,
12
+ ModuleConstants.CustomSortModuleId,
13
+ ModuleConstants.CellSummaryModuleId,
14
+ ModuleConstants.Fdc3ModuleId,
15
+ ModuleConstants.PlusMinusModuleId,
16
+ ModuleConstants.DashboardModuleId,
17
+ ModuleConstants.SystemStatusModuleId,
18
+ ModuleConstants.GridInfoModuleId,
19
+ ModuleConstants.ColumnInfoModuleId,
20
+ ModuleConstants.DataImportModuleId,
21
+ ModuleConstants.AlertModuleId,
22
+ ModuleConstants.CalculatedColumnModuleId,
23
+ ModuleConstants.ExportModuleId,
24
+ ModuleConstants.FilterModuleId,
25
+ ModuleConstants.SmartEditModuleId,
26
+ ModuleConstants.BulkUpdateModuleId,
27
+ ModuleConstants.TeamSharingModuleId,
28
+ ModuleConstants.DataChangeHistoryModuleId,
29
+ ModuleConstants.DataSetModuleId,
30
+ ModuleConstants.FreeTextColumnModuleId,
31
+ ModuleConstants.QueryModuleId,
32
+ ModuleConstants.QuickSearchModuleId,
33
+ ModuleConstants.ScheduleModuleId,
34
+ ModuleConstants.ShortcutModuleId,
35
+ ModuleConstants.StateManagementModuleId,
36
+ ModuleConstants.ToolPanelModuleId,
37
+ ModuleConstants.ThemeModuleId,
38
+ ModuleConstants.StatusBarModuleId,
39
+ ModuleConstants.ChartingModuleId,
40
+ ModuleConstants.NotesModuleId,
41
+ ];
42
+ exports.DEFAULT_ADAPTABLE_COLUMN_MENU_ORDER = [
43
+ ModuleConstants.SettingsPanelModuleId,
44
+ ModuleConstants.LayoutModuleId,
45
+ ModuleConstants.FlashingCellModuleId,
46
+ ModuleConstants.FormatColumnModuleId,
47
+ ModuleConstants.StyledColumnModuleId,
48
+ ModuleConstants.CustomSortModuleId,
49
+ ModuleConstants.CellSummaryModuleId,
50
+ ModuleConstants.Fdc3ModuleId,
51
+ ModuleConstants.PlusMinusModuleId,
52
+ ModuleConstants.DashboardModuleId,
53
+ ModuleConstants.SystemStatusModuleId,
54
+ ModuleConstants.GridInfoModuleId,
55
+ ModuleConstants.ColumnInfoModuleId,
56
+ ModuleConstants.DataImportModuleId,
57
+ ModuleConstants.AlertModuleId,
58
+ ModuleConstants.CalculatedColumnModuleId,
59
+ ModuleConstants.ExportModuleId,
60
+ ModuleConstants.FilterModuleId,
61
+ ModuleConstants.SmartEditModuleId,
62
+ ModuleConstants.BulkUpdateModuleId,
63
+ ModuleConstants.TeamSharingModuleId,
64
+ ModuleConstants.DataChangeHistoryModuleId,
65
+ ModuleConstants.DataSetModuleId,
66
+ ModuleConstants.FreeTextColumnModuleId,
67
+ ModuleConstants.QueryModuleId,
68
+ ModuleConstants.QuickSearchModuleId,
69
+ ModuleConstants.ScheduleModuleId,
70
+ ModuleConstants.ShortcutModuleId,
71
+ ModuleConstants.StateManagementModuleId,
72
+ ModuleConstants.ToolPanelModuleId,
73
+ ModuleConstants.ThemeModuleId,
74
+ ModuleConstants.StatusBarModuleId,
75
+ ModuleConstants.ChartingModuleId,
76
+ ModuleConstants.NotesModuleId,
77
+ ];
@@ -43,6 +43,7 @@ import { ActionColumnApi } from './ActionColumnApi';
43
43
  import { ActionRowApi } from './ActionRowApi';
44
44
  import { NotesApi } from './NotesAPi';
45
45
  import { Fdc3Api } from './Fdc3Api';
46
+ import { DataImportApi } from './DataImportApi';
46
47
  /**
47
48
  *
48
49
  * The `AdaptableApi` provides developers with run-time access to AdapTable.
@@ -226,6 +227,10 @@ export interface AdaptableApi {
226
227
  * Provides access to the Notes Module
227
228
  */
228
229
  notesApi: NotesApi;
230
+ /**
231
+ * Provides access to the Data Import Module
232
+ */
233
+ dataImportApi: DataImportApi;
229
234
  /**
230
235
  * Manages the FDC3 capabilities of AdapTable
231
236
  */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Provides run-time access to the Settings Panel
3
+ **/
4
+ export interface DataImportApi {
5
+ /**
6
+ * Opens the Data Import Wizard
7
+ */
8
+ openImportWizard(): void;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -44,6 +44,7 @@ import { ActionColumnApi } from '../ActionColumnApi';
44
44
  import { ActionRowApi } from '../ActionRowApi';
45
45
  import { NotesApi } from '../NotesAPi';
46
46
  import { Fdc3Api } from '../Fdc3Api';
47
+ import { DataImportApiImpl } from './DataImportApiImpl';
47
48
  export declare class AdaptableApiImpl implements AdaptableApi {
48
49
  protected adaptable: IAdaptable;
49
50
  internalApi: AdaptableInternalApi;
@@ -92,6 +93,7 @@ export declare class AdaptableApiImpl implements AdaptableApi {
92
93
  statusBarApi: StatusBarApi;
93
94
  notesApi: NotesApi;
94
95
  fdc3Api: Fdc3Api;
96
+ dataImportApi: DataImportApiImpl;
95
97
  private destroyed;
96
98
  constructor(adaptable: IAdaptable);
97
99
  /**
@@ -47,6 +47,7 @@ const EntitlementApiImpl_1 = require("./EntitlementApiImpl");
47
47
  const OptionsApiImpl_1 = require("./OptionsApiImpl");
48
48
  const NotesApiImpl_1 = require("./NotesApiImpl");
49
49
  const Fdc3ApiImpl_1 = require("./Fdc3ApiImpl");
50
+ const DataImportApiImpl_1 = require("./DataImportApiImpl");
50
51
  class AdaptableApiImpl {
51
52
  constructor(adaptable) {
52
53
  this.adaptable = adaptable;
@@ -97,6 +98,7 @@ class AdaptableApiImpl {
97
98
  this.statusBarApi = new StatusBarApiImpl_1.StatusBarApiImpl(adaptable);
98
99
  this.notesApi = new NotesApiImpl_1.NotesApiImpl(adaptable);
99
100
  this.fdc3Api = new Fdc3ApiImpl_1.Fdc3ApiImpl(adaptable);
101
+ this.dataImportApi = new DataImportApiImpl_1.DataImportApiImpl(adaptable);
100
102
  // adaptable internal api
101
103
  this.internalApi = new AdaptableInternalApi_1.AdaptableInternalApi(adaptable);
102
104
  }
@@ -0,0 +1,10 @@
1
+ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
+ import { DataImportApi } from '../DataImportApi';
3
+ import { DataImportInternalApi } from '../Internal/DataImportInternalApi';
4
+ import { ApiBase } from './ApiBase';
5
+ export declare class DataImportApiImpl extends ApiBase implements DataImportApi {
6
+ internalApi: DataImportInternalApi;
7
+ constructor(adaptable: IAdaptable);
8
+ openImportWizard(): void;
9
+ importData(partialRows: any[]): void;
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataImportApiImpl = void 0;
4
+ const DataImportInternalApi_1 = require("../Internal/DataImportInternalApi");
5
+ const ApiBase_1 = require("./ApiBase");
6
+ class DataImportApiImpl extends ApiBase_1.ApiBase {
7
+ constructor(adaptable) {
8
+ super(adaptable);
9
+ this.internalApi = new DataImportInternalApi_1.DataImportInternalApi(adaptable);
10
+ }
11
+ openImportWizard() { }
12
+ importData(partialRows) { }
13
+ }
14
+ exports.DataImportApiImpl = DataImportApiImpl;
@@ -47,7 +47,7 @@ class ExpressionApiImpl extends ApiBase_1.ApiBase {
47
47
  return isValid;
48
48
  }
49
49
  getASTForExpression(query) {
50
- return parser.getAST(query);
50
+ return parser.getAbstractSyntaxTree(query);
51
51
  }
52
52
  getColumnsFromExpression(expression) {
53
53
  try {
@@ -43,4 +43,5 @@ export declare class OptionsApiImpl extends ApiBase implements OptionsApi {
43
43
  getFlashingCellOptions(): FlashingCellOptions;
44
44
  getSettingsPanelOptions(): SettingsPanelOptions;
45
45
  getFdc3Options(): Fdc3Options;
46
+ getDataImportOptions(): import("../../types").DataImportOptions<any>;
46
47
  }
@@ -117,5 +117,8 @@ class OptionsApiImpl extends ApiBase_1.ApiBase {
117
117
  getFdc3Options() {
118
118
  return this.adaptable.adaptableOptions.fdc3Options;
119
119
  }
120
+ getDataImportOptions() {
121
+ return this.getOptions().dataImportOptions;
122
+ }
120
123
  }
121
124
  exports.OptionsApiImpl = OptionsApiImpl;
@@ -4,7 +4,7 @@ import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { AdaptableStyle } from '../../PredefinedConfig/Common/AdaptableStyle';
5
5
  import { ColumnMenuContext, ContextMenuContext, UserMenuItem } from '../../PredefinedConfig/Common/Menu';
6
6
  import { BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../../AdaptableOptions/UserInterfaceOptions';
7
- import { AdaptableObjectTag, GridCell } from '../../types';
7
+ import { AdaptableObjectTag, CustomWindowConfig, GridCell } from '../../types';
8
8
  import { UserInterfaceInternalApi } from '../Internal/UserInterfaceInternalApi';
9
9
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
10
10
  export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfaceApi {
@@ -32,4 +32,8 @@ export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfa
32
32
  getCustomIconDefinition(iconName: string): import("../../types").AdaptableIcon | import("../../types").CustomIcon;
33
33
  showLoadingScreen(): void;
34
34
  hideLoadingScreen(): void;
35
+ openCustomWindowPopup(config: CustomWindowConfig): {
36
+ close: () => void;
37
+ };
38
+ closeCustomWindowPopup(windowId: string): void;
35
39
  }
@@ -6,6 +6,7 @@ const ApiBase_1 = require("./ApiBase");
6
6
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
7
7
  const ArrayExtensions_1 = require("../../Utilities/Extensions/ArrayExtensions");
8
8
  const UserInterfaceInternalApi_1 = require("../Internal/UserInterfaceInternalApi");
9
+ const WindowPopups_1 = require("../../View/Components/Popups/WindowPopups/WindowPopups");
9
10
  class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
10
11
  constructor(adaptable) {
11
12
  super(adaptable);
@@ -191,5 +192,26 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
191
192
  hideLoadingScreen() {
192
193
  this.dispatchAction(PopupRedux.PopupHideLoading());
193
194
  }
195
+ openCustomWindowPopup(config) {
196
+ const close = () => {
197
+ this.dispatchAction(PopupRedux.PopupHideWindow(config.id));
198
+ };
199
+ const action = PopupRedux.PopupShowWindow({
200
+ Id: config.id,
201
+ Title: config.title,
202
+ FactoryId: WindowPopups_1.CUSTOM_WINDOW_FACTORY_ID,
203
+ PopupProps: {
204
+ render: config.render,
205
+ frameworkComponent: config.frameworkComponent,
206
+ onFrameworkComponentDestroyed: config.onFrameworkComponentDestroyed,
207
+ },
208
+ Icon: config.icon,
209
+ });
210
+ this.dispatchAction(action);
211
+ return { close };
212
+ }
213
+ closeCustomWindowPopup(windowId) {
214
+ this.dispatchAction(PopupRedux.PopupHideWindow(windowId));
215
+ }
194
216
  }
195
217
  exports.UserInterfaceApiImpl = UserInterfaceApiImpl;
@@ -27,42 +27,42 @@ class ChartingInternalApi extends ApiBase_1.ApiBase {
27
27
  }
28
28
  // External lib charting service
29
29
  isExternalChartOpened(chartDefinition) {
30
- const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions();
31
- if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.externalCharting.isChartOpened)) {
30
+ const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions().externalChartingOptions;
31
+ if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.isChartOpened)) {
32
32
  return false;
33
33
  }
34
34
  if (!chartDefinition) {
35
35
  return false;
36
36
  }
37
- return externalChartingOptions.externalCharting.isChartOpened(Object.assign({ chartDefinition: chartDefinition }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
37
+ return externalChartingOptions.isChartOpened(Object.assign({ chartDefinition: chartDefinition }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
38
38
  }
39
39
  onHideExternalChart(chartDefinition) {
40
- const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions();
41
- if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.externalCharting.onHideChart)) {
40
+ const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions().externalChartingOptions;
41
+ if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.onHideChart)) {
42
42
  return;
43
43
  }
44
- externalChartingOptions.externalCharting.onHideChart(Object.assign({ chartDefinition: chartDefinition }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
44
+ externalChartingOptions.onHideChart(Object.assign({ chartDefinition: chartDefinition }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
45
45
  }
46
46
  onShowExternalChart(chartDefinition, container) {
47
- const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions();
48
- if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.externalCharting.onShowChart)) {
47
+ const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions().externalChartingOptions;
48
+ if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.onShowChart)) {
49
49
  return;
50
50
  }
51
- externalChartingOptions.externalCharting.onShowChart(Object.assign({ chartDefinition: chartDefinition, container: container }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
51
+ externalChartingOptions.onShowChart(Object.assign({ chartDefinition: chartDefinition, container: container }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
52
52
  }
53
53
  onPreviewExternalChart(chartDefinition, container) {
54
- const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions();
55
- if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.externalCharting.onPreviewChart)) {
54
+ const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions().externalChartingOptions;
55
+ if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.onPreviewChart)) {
56
56
  return;
57
57
  }
58
- return externalChartingOptions.externalCharting.onPreviewChart(Object.assign({ chartDefinition: chartDefinition, container: container }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
58
+ return externalChartingOptions.onPreviewChart(Object.assign({ chartDefinition: chartDefinition, container: container }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
59
59
  }
60
60
  onDeleteExternalChart(chartDefinition) {
61
- const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions();
62
- if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.externalCharting.onDeleteChart)) {
61
+ const externalChartingOptions = this.adaptable.api.optionsApi.getChartingOptions().externalChartingOptions;
62
+ if (!(externalChartingOptions === null || externalChartingOptions === void 0 ? void 0 : externalChartingOptions.onDeleteChart)) {
63
63
  return;
64
64
  }
65
- externalChartingOptions.externalCharting.onDeleteChart(Object.assign({ chartDefinition: chartDefinition }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
65
+ externalChartingOptions.onDeleteChart(Object.assign({ chartDefinition: chartDefinition }, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
66
66
  }
67
67
  }
68
68
  exports.ChartingInternalApi = ChartingInternalApi;
@@ -0,0 +1,4 @@
1
+ import { ApiBase } from '../Implementation/ApiBase';
2
+ export declare class DataImportInternalApi extends ApiBase {
3
+ importData(partialRows: any[]): Promise<void>;
4
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataImportInternalApi = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ObjectFactory_1 = tslib_1.__importStar(require("../../Utilities/ObjectFactory"));
6
+ const ApiBase_1 = require("../Implementation/ApiBase");
7
+ class DataImportInternalApi extends ApiBase_1.ApiBase {
8
+ async importData(partialRows) {
9
+ const dataImportOptions = this.getOptions().dataImportOptions;
10
+ let importData = partialRows;
11
+ if (typeof dataImportOptions.preprocessData === 'function') {
12
+ importData = dataImportOptions.preprocessData(Object.assign({ data: partialRows }, (0, ObjectFactory_1.createBaseContext)(this.getAdaptableApi())));
13
+ }
14
+ if (dataImportOptions.applyImport) {
15
+ dataImportOptions.applyImport(Object.assign({ data: importData }, (0, ObjectFactory_1.createBaseContext)(this.getAdaptableApi())));
16
+ return;
17
+ }
18
+ const gridApi = this.getGridApi();
19
+ const primaryKey = this.getOptions().primaryKey;
20
+ let newRows = 0;
21
+ let updatedRows = 0;
22
+ const preparedDataRows = importData.map((dataRow) => {
23
+ const node = gridApi.getRowNodeForPrimaryKey(dataRow[primaryKey]);
24
+ if (!node) {
25
+ newRows += 1;
26
+ return dataRow;
27
+ }
28
+ updatedRows += 1;
29
+ return Object.assign(Object.assign({}, node === null || node === void 0 ? void 0 : node.data), dataRow);
30
+ });
31
+ await gridApi.addOrUpdateGridData(preparedDataRows);
32
+ let message = '';
33
+ if (newRows && updatedRows) {
34
+ message = `Added: ${newRows} new Row${newRows > 1 ? 's' : ''}; Updated: ${updatedRows} existing Row${updatedRows > 1 ? 's' : ''}`;
35
+ }
36
+ else if (newRows && !updatedRows) {
37
+ message = `Added: ${newRows} new Row${newRows > 1 ? 's' : ''}`;
38
+ }
39
+ else if (!newRows && updatedRows) {
40
+ message = `Updated: ${updatedRows} existing Row${updatedRows > 1 ? 's' : ''}`;
41
+ }
42
+ const alert = {
43
+ alertType: 'generic',
44
+ header: 'Data Imported',
45
+ message,
46
+ alertDefinition: Object.assign(Object.assign({}, ObjectFactory_1.default.CreateEmptyAlertDefinition()), { MessageType: 'Info', AlertProperties: {
47
+ DisplayNotification: true,
48
+ } }),
49
+ };
50
+ this.getAlertApi().showAdaptableAlert(alert);
51
+ }
52
+ }
53
+ exports.DataImportInternalApi = DataImportInternalApi;
@@ -4,6 +4,7 @@ import { GroupingOptions } from '../AdaptableOptions/GroupingOptions';
4
4
  import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnOptions, ContainerOptions, DashboardOptions, DataChangeHistoryOptions, EditOptions, EntitlementOptions, ExportOptions, FilterOptions, FlashingCellOptions, FormatColumnOptions, LayoutOptions, MenuOptions, NotesOptions, NotificationsOptions, QuickSearchOptions, SettingsPanelOptions, StateOptions, TeamSharingOptions, ToolPanelOptions, UserInterfaceOptions } from '../types';
5
5
  import { Fdc3Options } from '../AdaptableOptions/Fdc3Options';
6
6
  import { ExpressionOptions } from '../AdaptableOptions/ExpressionOptions';
7
+ import { DataImportOptions } from '../AdaptableOptions/DataImportOptions';
7
8
  /**
8
9
  * Range of functions to access Adaptable Options
9
10
  */
@@ -160,4 +161,8 @@ export interface OptionsApi {
160
161
  * Returns `AdaptableOptions.fdc3Options`
161
162
  */
162
163
  getFdc3Options(): Readonly<Fdc3Options>;
164
+ /**
165
+ * Returns `AdaptableOptions.dataImportOptions`
166
+ */
167
+ getDataImportOptions(): Readonly<DataImportOptions>;
163
168
  }
@@ -5,6 +5,7 @@ import { BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermitt
5
5
  import { GridCell } from '../PredefinedConfig/Selection/GridCell';
6
6
  import { AdaptableObjectTag } from '../PredefinedConfig/Common/AdaptableObject';
7
7
  import { AdaptableIcon } from '../types';
8
+ import { CustomWindowConfig } from '../AdaptableOptions/AdaptableFrameworkComponent';
8
9
  /**
9
10
  * Functions relating to User Interface section of Adaptable State
10
11
  */
@@ -88,4 +89,17 @@ export interface UserInterfaceApi {
88
89
  * Hides the popup that says getting data and initialising grid
89
90
  */
90
91
  hideLoadingScreen(): void;
92
+ /**
93
+ * Opens window with custom content
94
+ * @param config
95
+ */
96
+ openCustomWindowPopup(config: CustomWindowConfig): {
97
+ close: () => void;
98
+ };
99
+ /**
100
+ * Closes a custom window
101
+ *
102
+ * @param windowId window popup id
103
+ */
104
+ closeCustomWindowPopup(windowId: string): void;
91
105
  }
@@ -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' | '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' | 'dollar' | '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' | 'interactions' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'mail' | 'menu' | 'minus' | 'multiplication' | 'money' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'order' | 'organisation' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'contact' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'science' | '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' | 'note';
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' | 'dollar' | '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' | 'interactions' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'mail' | 'menu' | 'minus' | 'multiplication' | 'money' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'order' | 'organisation' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'contact' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'science' | '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' | 'note' | 'import';