@adaptabletools/adaptable 10.0.1 → 10.0.4-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 (191) hide show
  1. package/base.css +68 -26
  2. package/index.css +80 -28
  3. package/package.json +1 -1
  4. package/publishTimestamp.d.ts +1 -1
  5. package/publishTimestamp.js +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
  7. package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/NotificationsOptions.d.ts +3 -1
  10. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +107 -5
  11. package/src/Api/AlertApi.d.ts +1 -1
  12. package/src/Api/CalculatedColumnApi.d.ts +15 -0
  13. package/src/Api/ColumnApi.d.ts +39 -0
  14. package/src/Api/ConfigApi.d.ts +8 -0
  15. package/src/Api/Events/AdaptableReady.d.ts +2 -6
  16. package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
  17. package/src/Api/Events/AlertFired.d.ts +2 -1
  18. package/src/Api/Events/BaseEventInfo.d.ts +10 -0
  19. package/src/{Utilities/Interface/ProgressIndicator.js → Api/Events/BaseEventInfo.js} +0 -0
  20. package/src/Api/Events/CellChanged.d.ts +2 -1
  21. package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
  22. package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
  23. package/src/Api/Events/DashboardChanged.d.ts +2 -1
  24. package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
  25. package/src/Api/Events/GridDataChanged.d.ts +2 -1
  26. package/src/Api/Events/LayoutChanged.d.ts +2 -1
  27. package/src/Api/Events/LiveDataChanged.d.ts +2 -1
  28. package/src/Api/Events/SearchChanged.d.ts +2 -1
  29. package/src/Api/Events/SelectionChanged.d.ts +2 -1
  30. package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
  31. package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
  32. package/src/Api/Events/ThemeChanged.d.ts +2 -1
  33. package/src/Api/GridApi.d.ts +34 -8
  34. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
  35. package/src/Api/Implementation/AlertApiImpl.js +22 -15
  36. package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
  37. package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
  38. package/src/Api/Implementation/ColumnApiImpl.d.ts +8 -0
  39. package/src/Api/Implementation/ColumnApiImpl.js +69 -36
  40. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
  41. package/src/Api/Implementation/ConfigApiImpl.js +28 -17
  42. package/src/Api/Implementation/DashboardApiImpl.js +2 -1
  43. package/src/Api/Implementation/ExportApiImpl.js +4 -4
  44. package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
  45. package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
  46. package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
  47. package/src/Api/Implementation/GridApiImpl.js +28 -10
  48. package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
  49. package/src/Api/Implementation/InternalApiImpl.js +20 -4
  50. package/src/Api/Implementation/LayoutApiImpl.js +4 -3
  51. package/src/Api/Implementation/ScopeApiImpl.js +11 -11
  52. package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
  53. package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
  54. package/src/Api/Implementation/ThemeApiImpl.js +1 -0
  55. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
  56. package/src/Api/Implementation/UserInterfaceApiImpl.js +69 -87
  57. package/src/Api/InternalApi.d.ts +3 -1
  58. package/src/Api/UserInterfaceApi.d.ts +16 -6
  59. package/src/PredefinedConfig/AlertState.d.ts +4 -0
  60. package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
  61. package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
  62. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
  63. package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
  64. package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
  65. package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
  66. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
  67. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
  68. package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
  69. package/src/PredefinedConfig/FilterState.d.ts +1 -1
  70. package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
  71. package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
  72. package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
  73. package/src/PredefinedConfig/SystemState.d.ts +4 -1
  74. package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
  75. package/src/Redux/Store/AdaptableStore.js +7 -3
  76. package/src/Strategy/AdaptableModuleBase.js +8 -8
  77. package/src/Strategy/AlertModule.js +12 -11
  78. package/src/Strategy/BulkUpdateModule.js +5 -5
  79. package/src/Strategy/CalculatedColumnModule.js +1 -1
  80. package/src/Strategy/CellSummaryModule.js +3 -3
  81. package/src/Strategy/ConditionalStyleModule.js +3 -3
  82. package/src/Strategy/CustomSortModule.js +2 -2
  83. package/src/Strategy/ExportModule.d.ts +0 -2
  84. package/src/Strategy/ExportModule.js +59 -62
  85. package/src/Strategy/FilterModule.js +4 -4
  86. package/src/Strategy/FormatColumnModule.js +5 -5
  87. package/src/Strategy/FreeTextColumnModule.js +1 -1
  88. package/src/Strategy/LayoutModule.js +3 -3
  89. package/src/Strategy/PlusMinusModule.js +8 -9
  90. package/src/Strategy/SmartEditModule.js +6 -6
  91. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
  92. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
  93. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
  94. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
  95. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
  96. package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
  97. package/src/Utilities/Helpers/DateHelper.js +30 -20
  98. package/src/Utilities/Helpers/PreviewHelper.js +2 -2
  99. package/src/Utilities/ObjectFactory.d.ts +1 -1
  100. package/src/Utilities/ObjectFactory.js +14 -2
  101. package/src/Utilities/Services/DataService.js +5 -5
  102. package/src/Utilities/Services/ReportService.js +13 -12
  103. package/src/Utilities/Services/ValidationService.js +4 -5
  104. package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
  105. package/src/Utilities/runIfNotResolvedIn.js +23 -0
  106. package/src/View/AdaptableView.js +1 -1
  107. package/src/View/Alert/AlertPopup.js +1 -1
  108. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
  109. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
  110. package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
  111. package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
  112. package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
  113. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
  114. package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
  115. package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
  116. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  117. package/src/View/Components/ColumnSelector/index.js +2 -2
  118. package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
  119. package/src/View/Components/FilterForm/FilterForm.js +53 -32
  120. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
  121. package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
  122. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
  123. package/src/View/Components/FilterForm/QuickFilterForm.js +72 -31
  124. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
  125. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
  126. package/src/View/Components/NewScopeComponent.js +1 -1
  127. package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
  128. package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
  129. package/src/View/Components/PreviewResultsPanel.js +1 -1
  130. package/src/View/Components/RangesComponent.js +2 -2
  131. package/src/View/Components/Selectors/ColumnSelector.js +5 -5
  132. package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
  133. package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
  134. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +7 -7
  135. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
  136. package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
  137. package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
  138. package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
  139. package/src/View/CustomSort/CustomSortPopup.js +1 -1
  140. package/src/View/CustomSort/CustomSortSummary.js +3 -3
  141. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
  142. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
  143. package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
  144. package/src/View/Dashboard/Dashboard.js +2 -3
  145. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -5
  146. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
  147. package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
  148. package/src/View/Filter/FilterSummary.js +2 -2
  149. package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
  150. package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
  151. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  152. package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
  153. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
  154. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
  155. package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
  156. package/src/View/GridInfo/GridInfoPopup.js +4 -1
  157. package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
  158. package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
  159. package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
  160. package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
  161. package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
  162. package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
  163. package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
  164. package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
  165. package/src/View/Query/QueryViewPanel.js +2 -2
  166. package/src/View/UIHelper.d.ts +2 -0
  167. package/src/View/UIHelper.js +10 -1
  168. package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
  169. package/src/agGrid/ActionColumnRenderer.js +21 -4
  170. package/src/agGrid/Adaptable.d.ts +20 -4
  171. package/src/agGrid/Adaptable.js +249 -102
  172. package/src/agGrid/agGridHelper.js +33 -32
  173. package/src/agGrid/agGridMenuHelper.js +2 -2
  174. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
  175. package/src/components/Dashboard/Dashboard.js +1 -1
  176. package/src/components/DropdownButton/index.js +1 -1
  177. package/src/components/ExpressionEditor/index.js +7 -7
  178. package/src/components/Loader/Loader.d.ts +7 -0
  179. package/src/components/Loader/Loader.js +13 -0
  180. package/src/components/Loader/index.d.ts +2 -0
  181. package/src/components/Loader/index.js +7 -0
  182. package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
  183. package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
  184. package/src/metamodel/adaptable.metamodel.d.ts +125 -16
  185. package/src/metamodel/adaptable.metamodel.js +403 -106
  186. package/src/types.d.ts +4 -3
  187. package/version.d.ts +1 -1
  188. package/version.js +1 -1
  189. package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
  190. package/src/View/Export/ProgressIndicator.d.ts +0 -6
  191. package/src/View/Export/ProgressIndicator.js +0 -25
@@ -14,10 +14,10 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
14
14
  // do we need a true check here?
15
15
  return true;
16
16
  }
17
- if ('DataTypes' in scope && scope.DataTypes.includes(column.DataType)) {
17
+ if ('DataTypes' in scope && scope.DataTypes.includes(column.dataType)) {
18
18
  return true;
19
19
  }
20
- if ('ColumnIds' in scope && scope.ColumnIds.includes(column.ColumnId)) {
20
+ if ('ColumnIds' in scope && scope.ColumnIds.includes(column.columnId)) {
21
21
  return true;
22
22
  }
23
23
  return false;
@@ -31,10 +31,10 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
31
31
  return columns;
32
32
  }
33
33
  return columns.filter((c) => {
34
- if ('DataTypes' in scope && scope.DataTypes.includes(c.DataType)) {
34
+ if ('DataTypes' in scope && scope.DataTypes.includes(c.dataType)) {
35
35
  return true;
36
36
  }
37
- if ('ColumnIds' in scope && scope.ColumnIds.includes(c.ColumnId)) {
37
+ if ('ColumnIds' in scope && scope.ColumnIds.includes(c.columnId)) {
38
38
  return true;
39
39
  }
40
40
  return false;
@@ -140,7 +140,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
140
140
  }
141
141
  isColumnInNumericScope(column, scope) {
142
142
  // if column is not even numeric then return false
143
- if (column == null || column == undefined || column.DataType !== 'Number') {
143
+ if (column == null || column == undefined || column.dataType !== 'Number') {
144
144
  return false;
145
145
  }
146
146
  // if no scope then return false
@@ -148,7 +148,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
148
148
  return false;
149
149
  }
150
150
  // check if the scope has ColumnIds and whether this column is contained
151
- if ('ColumnIds' in scope && scope.ColumnIds.includes(column.ColumnId)) {
151
+ if ('ColumnIds' in scope && scope.ColumnIds.includes(column.columnId)) {
152
152
  return true;
153
153
  }
154
154
  // check if the scope has ColumnIds and whether this column is contained
@@ -159,7 +159,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
159
159
  }
160
160
  isColumnInStringsScope(column, scope) {
161
161
  // if column is not even string then return false
162
- if (column == null || column == undefined || column.DataType !== 'String') {
162
+ if (column == null || column == undefined || column.dataType !== 'String') {
163
163
  return false;
164
164
  }
165
165
  // if no scope then return false
@@ -167,7 +167,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
167
167
  return false;
168
168
  }
169
169
  // check if the scope has ColumnIds and whether this column is contained
170
- if ('ColumnIds' in scope && scope.ColumnIds.includes(column.ColumnId)) {
170
+ if ('ColumnIds' in scope && scope.ColumnIds.includes(column.columnId)) {
171
171
  return true;
172
172
  }
173
173
  // check if the scope has ColumnIds and whether this column is contained
@@ -178,7 +178,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
178
178
  }
179
179
  isColumnInDateScope(column, scope) {
180
180
  // if column is not even numeric then return false
181
- if (column == null || column == undefined || column.DataType !== 'Date') {
181
+ if (column == null || column == undefined || column.dataType !== 'Date') {
182
182
  return false;
183
183
  }
184
184
  // if no scope then return false
@@ -186,7 +186,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
186
186
  return false;
187
187
  }
188
188
  // check if the scope has ColumnIds and whether this column is contained
189
- if ('ColumnIds' in scope && scope.ColumnIds.includes(column.ColumnId)) {
189
+ if ('ColumnIds' in scope && scope.ColumnIds.includes(column.columnId)) {
190
190
  return true;
191
191
  }
192
192
  // check if the scope has ColumnIds and whether this column is contained
@@ -213,7 +213,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
213
213
  'DataTypes' in b &&
214
214
  a.ColumnIds.every((columnId) => {
215
215
  var _a;
216
- return b.DataTypes.includes((_a = this.adaptable.api.columnApi.getColumnFromId(columnId)) === null || _a === void 0 ? void 0 : _a.DataType);
216
+ return b.DataTypes.includes((_a = this.adaptable.api.columnApi.getColumnFromId(columnId)) === null || _a === void 0 ? void 0 : _a.dataType);
217
217
  })) {
218
218
  return true;
219
219
  }
@@ -80,6 +80,7 @@ class SystemStatusApiImpl extends ApiBase_1.ApiBase {
80
80
  }
81
81
  fireSystemStatusMessageDisplayedEvent(systemStatusMessageInfo) {
82
82
  const systemStatusMessageDisplayedInfo = {
83
+ adaptableApi: this.adaptable.api,
83
84
  systemStatusMessageInfo: systemStatusMessageInfo,
84
85
  };
85
86
  this.adaptable.api.eventApi.emit('SystemStatusMessageDisplayed', systemStatusMessageDisplayedInfo);
@@ -35,6 +35,7 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
35
35
  fireTeamSharingEntityChangedEvent(sharedEntity) {
36
36
  if (this.adaptable.isInitialised) {
37
37
  const teamSharingEntityChangedInfo = {
38
+ adaptableApi: this.adaptable.api,
38
39
  sharedEntity: sharedEntity,
39
40
  };
40
41
  this.adaptable.api.eventApi.emit('TeamSharingEntityChanged', teamSharingEntityChangedInfo);
@@ -48,6 +48,7 @@ class ThemeApiImpl extends ApiBase_1.ApiBase {
48
48
  }
49
49
  this.adaptable.applyAdaptableTheme(currentTheme);
50
50
  let themeChangedInfo = {
51
+ adaptableApi: this.adaptable.api,
51
52
  theme: currentTheme,
52
53
  };
53
54
  this.adaptable.api.eventApi.emit('ThemeChanged', themeChangedInfo);
@@ -3,19 +3,23 @@ import { UserInterfaceApi } from '../UserInterfaceApi';
3
3
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { AdaptableStyle } from '../../PredefinedConfig/Common/AdaptableStyle';
5
5
  import { UserMenuItem } from '../../PredefinedConfig/Common/Menu';
6
- import { ActionColumn, CellValuesList } from '../../AdaptableOptions/UserInterfaceOptions';
6
+ import { ActionColumn, BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../../AdaptableOptions/UserInterfaceOptions';
7
+ import { GridCell } from '../../types';
7
8
  export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfaceApi {
8
9
  getColorPalette(): string[];
9
10
  getStyleClassNames(): string[] | undefined;
10
- getAllPermittedValuesItems(): CellValuesList[];
11
- private getPermittedValuesItemsWithColumnScope;
12
- private getPermittedValuesItemsWithDataTypeScope;
13
- private getPermittedValuesItemsWithAllScope;
11
+ getAllPermittedValuesItems(): PermittedValues[];
14
12
  private getPermittedValuesForScope;
15
13
  getPermittedValuesForColumn(column: AdaptableColumn): any[] | undefined;
16
- getAllEditLookUpItems(): CellValuesList[];
17
- getEditLookUpItemForColumn(columnId: string): CellValuesList | undefined;
18
- getEditLookUpValuesForEditLookUpItem(editLookUpItem: CellValuesList, columnId: string): any[] | undefined;
14
+ getAllFilterPermittedValuesItems(): FilterPermittedValues[];
15
+ getFilterPermittedValuesForColumn(column: AdaptableColumn): FilterPermittedValues | undefined;
16
+ getAllCustomSortPermittedValuesItems(): CustomSortPermittedValues[];
17
+ getCustomSortPermittedValuesForColumn(column: AdaptableColumn): CustomSortPermittedValues | undefined;
18
+ getAllBulkUpdatePermittedValuesItems(): BulkUpdatePermittedValues[];
19
+ getBulkUpdatePermittedValuesForColumn(column: AdaptableColumn): BulkUpdatePermittedValues | undefined;
20
+ getAllEditLookUpItems(): EditLookUpPermittedValues[];
21
+ getEditLookUpItemForColumn(column: AdaptableColumn): EditLookUpPermittedValues | undefined;
22
+ getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues, gridCell: GridCell): any[] | undefined;
19
23
  addColumnMenuItem(columnMenuItem: UserMenuItem): void;
20
24
  addContextMenuItem(contextMenuItem: UserMenuItem): void;
21
25
  getEditableCellStyle(): AdaptableStyle | undefined;
@@ -22,51 +22,32 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
22
22
  return this.getUserInterfaceOptions().styleClassNames;
23
23
  }
24
24
  getAllPermittedValuesItems() {
25
- return this.getUserInterfaceOptions().permittedValues;
25
+ var _a, _b;
26
+ return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.permittedValues) !== null && _b !== void 0 ? _b : [];
26
27
  }
27
- getPermittedValuesItemsWithColumnScope() {
28
- return this.getAllPermittedValuesItems().filter((pv) => {
29
- return 'ColumnIds' in pv.scope == true;
30
- });
31
- }
32
- getPermittedValuesItemsWithDataTypeScope() {
33
- return this.getAllPermittedValuesItems().filter((pv) => {
34
- return 'DataTypes' in pv.scope == true;
35
- });
36
- }
37
- getPermittedValuesItemsWithAllScope() {
38
- return this.getAllPermittedValuesItems().filter((pv) => {
39
- return 'All' in pv.scope == true;
40
- });
41
- }
42
- getPermittedValuesForScope(column) {
28
+ getPermittedValuesForScope(column, permittedValues) {
43
29
  let permittedValuesItem;
44
- this.getPermittedValuesItemsWithColumnScope().forEach((pv) => {
45
- if (!permittedValuesItem) {
46
- if (this.adaptable.api.scopeApi.isColumnInScope(column, pv.scope)) {
47
- permittedValuesItem = pv;
48
- }
49
- }
30
+ /**
31
+ * The previous implementation prioritized column-id, data-types and all
32
+ */
33
+ // columns id
34
+ permittedValuesItem = permittedValues.find((permittedValue) => {
35
+ return ('ColumnIds' in permittedValue.scope &&
36
+ this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
50
37
  });
51
38
  if (permittedValuesItem) {
52
39
  return permittedValuesItem;
53
40
  }
54
- this.getPermittedValuesItemsWithDataTypeScope().forEach((pv) => {
55
- if (!permittedValuesItem) {
56
- if (this.adaptable.api.scopeApi.isColumnInScope(column, pv.scope)) {
57
- permittedValuesItem = pv;
58
- }
59
- }
41
+ permittedValuesItem = permittedValues.find((permittedValue) => {
42
+ return ('DataTypes' in permittedValue.scope &&
43
+ this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
60
44
  });
61
45
  if (permittedValuesItem) {
62
46
  return permittedValuesItem;
63
47
  }
64
- this.getPermittedValuesItemsWithAllScope().forEach((pv) => {
65
- if (!permittedValuesItem) {
66
- if (this.adaptable.api.scopeApi.isColumnInScope(column, pv.scope)) {
67
- permittedValuesItem = pv;
68
- }
69
- }
48
+ permittedValuesItem = permittedValues.find((permittedValue) => {
49
+ return ('All' in permittedValue.scope &&
50
+ this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
70
51
  });
71
52
  if (permittedValuesItem) {
72
53
  return permittedValuesItem;
@@ -77,7 +58,8 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
77
58
  if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(this.getAllPermittedValuesItems())) {
78
59
  return undefined;
79
60
  }
80
- let permittedValuesColumn = this.getPermittedValuesForScope(column);
61
+ const allPermittedValues = this.getAllPermittedValuesItems();
62
+ let permittedValuesColumn = this.getPermittedValuesForScope(column, allPermittedValues);
81
63
  if (!permittedValuesColumn) {
82
64
  return undefined;
83
65
  }
@@ -85,7 +67,11 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
85
67
  // first do the function then get hardcoded items
86
68
  if (permittedValues != null && typeof permittedValues === 'function') {
87
69
  if (column) {
88
- return permittedValues(column);
70
+ const permittedValuesParams = {
71
+ adaptableApi: this.adaptable.api,
72
+ column: column,
73
+ };
74
+ return permittedValues(permittedValuesParams);
89
75
  }
90
76
  }
91
77
  else {
@@ -96,69 +82,65 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
96
82
  }
97
83
  return undefined;
98
84
  }
99
- getAllEditLookUpItems() {
100
- return this.getUserInterfaceOptions().editLookUpItems;
85
+ getAllFilterPermittedValuesItems() {
86
+ var _a, _b;
87
+ return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.filterPermittedValues) !== null && _b !== void 0 ? _b : [];
101
88
  }
102
- getEditLookUpItemForColumn(columnId) {
103
- const abColumn = this.adaptable.api.columnApi.getColumnFromId(columnId);
104
- if (!abColumn) {
89
+ getFilterPermittedValuesForColumn(column) {
90
+ const allFilterPermittedValuesItems = this.getAllFilterPermittedValuesItems();
91
+ if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(allFilterPermittedValuesItems)) {
105
92
  return undefined;
106
93
  }
107
- let editLookUpItem;
108
- let editLookUpItems = this.getAllEditLookUpItems();
109
- if (!editLookUpItems) {
94
+ return this.getPermittedValuesForScope(column, allFilterPermittedValuesItems);
95
+ }
96
+ getAllCustomSortPermittedValuesItems() {
97
+ var _a, _b;
98
+ return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.customSortPermittedValues) !== null && _b !== void 0 ? _b : [];
99
+ }
100
+ getCustomSortPermittedValuesForColumn(column) {
101
+ const allFilterPermittedValuesItems = this.getAllCustomSortPermittedValuesItems();
102
+ if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(allFilterPermittedValuesItems)) {
110
103
  return undefined;
111
104
  }
112
- // first we get any for the column as that is lower level
113
- const columnEditLookItems = editLookUpItems.filter((pv) => {
114
- return 'ColumnIds' in pv.scope == true;
115
- });
116
- columnEditLookItems.forEach((eli) => {
117
- if (this.adaptable.api.scopeApi.isColumnInScopeColumns(abColumn, eli.scope)) {
118
- editLookUpItem = eli;
119
- }
120
- });
121
- if (editLookUpItem) {
122
- return editLookUpItem;
123
- }
124
- // then we get any for the DataType
125
- const dateEditLookItems = editLookUpItems.filter((pv) => {
126
- return 'DataTypes' in pv.scope == true;
127
- });
128
- dateEditLookItems.forEach((eli) => {
129
- if (this.adaptable.api.scopeApi.isColumnInDateScope(abColumn, eli.scope)) {
130
- editLookUpItem = eli;
131
- }
132
- });
133
- if (editLookUpItem) {
134
- return editLookUpItem;
135
- }
136
- // then we get any for All
137
- const allTypeEditLookItems = editLookUpItems.filter((pv) => {
138
- return 'All' in pv.scope == true;
139
- });
140
- allTypeEditLookItems.forEach((eli) => {
141
- if (this.adaptable.api.scopeApi.isColumnInScope(abColumn, eli.scope)) {
142
- editLookUpItem = eli;
143
- }
144
- });
145
- if (editLookUpItem) {
146
- return editLookUpItem;
147
- }
148
- return undefined;
105
+ return this.getPermittedValuesForScope(column, allFilterPermittedValuesItems);
149
106
  }
150
- getEditLookUpValuesForEditLookUpItem(editLookUpItem, columnId) {
151
- if (!editLookUpItem) {
107
+ getAllBulkUpdatePermittedValuesItems() {
108
+ var _a, _b;
109
+ return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.bulkUpdatePermittedValues) !== null && _b !== void 0 ? _b : [];
110
+ }
111
+ getBulkUpdatePermittedValuesForColumn(column) {
112
+ const allFilterPermittedValuesItems = this.getAllBulkUpdatePermittedValuesItems();
113
+ if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(allFilterPermittedValuesItems)) {
152
114
  return undefined;
153
115
  }
154
- const column = this.adaptable.api.columnApi.getColumnFromId(columnId);
116
+ return this.getPermittedValuesForScope(column, allFilterPermittedValuesItems);
117
+ }
118
+ getAllEditLookUpItems() {
119
+ return this.getUserInterfaceOptions().editLookUpItems || [];
120
+ }
121
+ getEditLookUpItemForColumn(column) {
155
122
  if (!column) {
156
123
  return undefined;
157
124
  }
125
+ let editLookUpItems = this.getAllEditLookUpItems();
126
+ if (!editLookUpItems) {
127
+ return undefined;
128
+ }
129
+ return this.getPermittedValuesForScope(column, editLookUpItems);
130
+ }
131
+ getEditLookUpValuesForEditLookUpItem(editLookUpItem, gridCell) {
132
+ if (!editLookUpItem || !gridCell || !gridCell.column) {
133
+ return undefined;
134
+ }
158
135
  let editLookUpValues = editLookUpItem.values;
159
136
  // first do the function then get hardcoded items
160
137
  if (editLookUpValues != null && typeof editLookUpValues === 'function') {
161
- return editLookUpValues(column);
138
+ const editLookUpParams = {
139
+ adaptableApi: this.adaptable.api,
140
+ column: gridCell.column,
141
+ gridCell: gridCell,
142
+ };
143
+ return editLookUpValues(editLookUpParams);
162
144
  }
163
145
  else {
164
146
  let arr = editLookUpValues;
@@ -168,7 +150,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
168
150
  }
169
151
  // if no hard-coded values or function provided then just get the distinct values for the column
170
152
  // this will use the columnapi method that first looks for permitted values and then distinct values
171
- return this.adaptable.api.columnApi.getDistinctDisplayValuesForColumn(columnId);
153
+ return this.adaptable.api.columnApi.getDistinctDisplayValuesForColumn(gridCell.column.columnId);
172
154
  }
173
155
  addColumnMenuItem(columnMenuItem) {
174
156
  var _a;
@@ -78,7 +78,7 @@ export interface InternalApi {
78
78
  setGridCell(gridCell: GridCell): void;
79
79
  setToolbarTitle(): string;
80
80
  getQueryPreviewData(): any;
81
- buildDataChangedInfo(config: Pick<DataChangedInfo, 'newValue' | 'oldValue' | 'columnId' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): DataChangedInfo;
81
+ buildDataChangedInfo(config: Pick<DataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): DataChangedInfo;
82
82
  setLastAppliedShortCut(gridCell: GridCell | undefined): void;
83
83
  setDefaultDashboardTab(): void;
84
84
  updateCurrentDraftLayout(layout: Layout): void;
@@ -116,4 +116,6 @@ export interface InternalApi {
116
116
  destroyFrameworkComponent(containerDomNode: HTMLElement, frameworkComponent: AdaptableFrameworkComponent, componentType: 'toolPanel' | 'toolbar'): void;
117
117
  initializeDataChangeHistory(): void;
118
118
  isTextComparisonCaseSensitive(): boolean;
119
+ executeWithProgressIndicator(label: string, executeFn: () => unknown): void;
120
+ hideProgressIndicator(): void;
119
121
  }
@@ -1,7 +1,8 @@
1
1
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
2
2
  import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
3
3
  import { UserMenuItem } from '../PredefinedConfig/Common/Menu';
4
- import { ActionColumn, CellValuesList } from '../AdaptableOptions/UserInterfaceOptions';
4
+ import { ActionColumn, BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../AdaptableOptions/UserInterfaceOptions';
5
+ import { GridCell } from '../PredefinedConfig/Selection/GridCell';
5
6
  /**
6
7
  * Functions relating to User Interface section of Adaptable State
7
8
  */
@@ -17,27 +18,36 @@ export interface UserInterfaceApi {
17
18
  /**
18
19
  * Retrieves `permittedValues` property from User Interface Options
19
20
  */
20
- getAllPermittedValuesItems(): CellValuesList[];
21
+ getAllPermittedValuesItems(): PermittedValues[];
21
22
  /**
22
23
  * Retrieves Permitted Values for a given Column
23
24
  * @param column column for which to retrieve Permitted Values
24
25
  */
25
26
  getPermittedValuesForColumn(column: AdaptableColumn): any[];
27
+ /**
28
+ * Retrieves Permitted values for filtering by column values in Floating Filter and dropdown Filter.
29
+ */
30
+ getFilterPermittedValuesForColumn(column: AdaptableColumn): FilterPermittedValues | undefined;
31
+ /**
32
+ * Retrieves Permitted values for Custom sort.
33
+ */
34
+ getCustomSortPermittedValuesForColumn(column: AdaptableColumn): CustomSortPermittedValues | undefined;
35
+ getBulkUpdatePermittedValuesForColumn(column: AdaptableColumn): BulkUpdatePermittedValues | undefined;
26
36
  /**
27
37
  * Retrieves `editLookUpItems` property from User Interface Options
28
38
  */
29
- getAllEditLookUpItems(): CellValuesList[];
39
+ getAllEditLookUpItems(): EditLookUpPermittedValues[];
30
40
  /**
31
41
  * Retrieves EditLookUpItems for a given Column
32
42
  * @param columnId Column for which to retrieve EditLookUpItems
33
43
  */
34
- getEditLookUpItemForColumn(columnId: string): CellValuesList | undefined;
44
+ getEditLookUpItemForColumn(column: AdaptableColumn): EditLookUpPermittedValues | undefined;
35
45
  /**
36
46
  * Retrieves actual Look Up Values from an EditLookUpItem
37
47
  * @param editLookUpItem editLookUpItem to check
38
- * @param columnId Column to check
48
+ * @param gridCell: the currently edited Grid Cell
39
49
  */
40
- getEditLookUpValuesForEditLookUpItem(editLookUpItem: CellValuesList, columnId: string): any[] | undefined;
50
+ getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues, gridCell: GridCell): any[] | undefined;
41
51
  /**
42
52
  * Adds menu item to Column Menu
43
53
  * @param userMenuItem Menu Item to add
@@ -82,6 +82,10 @@ export interface AlertDefinition extends BaseAlertDefinition {
82
82
  * Type of Alert: 'Info', 'Success', 'Warning', 'Error'; influences Alert colour, icon and logging
83
83
  */
84
84
  MessageType: AdaptableMessageType;
85
+ /**
86
+ * Alert Message - can be string or function; if not provided AdapTable creates dynamically using Rule & Scope
87
+ */
88
+ MessageText?: string;
85
89
  /**
86
90
  * Series of properties which set what happens when Alert is triggered
87
91
  */
@@ -1,6 +1,7 @@
1
1
  import { ConfigState } from './ConfigState';
2
2
  import { AdaptableObject } from './Common/AdaptableObject';
3
3
  import { AdaptableScalarQuery } from './Common/AdaptableQuery';
4
+ import { SpecialColumnSettings } from './Common/SpecialColumnSettings';
4
5
  /**
5
6
  * Predefined Configuration for Calculated Column function
6
7
  **/
@@ -24,7 +25,7 @@ export interface CalculatedColumn extends AdaptableObject {
24
25
  */
25
26
  FriendlyName?: string;
26
27
  /**
27
- * Addtional optional properties for Column (e.g. filterable, resizable)
28
+ * Additional optional properties for Column (e.g. filterable, resizable)
28
29
  */
29
30
  CalculatedColumnSettings?: CalculatedColumnSettings;
30
31
  /**
@@ -35,9 +36,9 @@ export interface CalculatedColumn extends AdaptableObject {
35
36
  /**
36
37
  * Set of optional properties that define a Calculated Column's behaviour
37
38
  */
38
- export interface CalculatedColumnSettings {
39
+ export interface CalculatedColumnSettings extends SpecialColumnSettings {
39
40
  /**
40
- * Expression's return value DataType; inferred by AdapTable but setable by User
41
+ * Expression's return value DataType; inferred by AdapTable but settable by User
41
42
  */
42
43
  DataType?: 'String' | 'Number' | 'Boolean' | 'Date';
43
44
  /**
@@ -45,38 +46,4 @@ export interface CalculatedColumnSettings {
45
46
  * @defaultValue false
46
47
  */
47
48
  ShowToolTip?: boolean;
48
- /**
49
- * Preferred width (in pixels) for Column; if unset, calculated dynamically by underlying Grid
50
- */
51
- Width?: number;
52
- /**
53
- * Whether Column is filterable
54
- * @defaultValue true
55
- */
56
- Filterable?: boolean;
57
- /**
58
- * Whether Column can be resized (by dragging column header edges)
59
- * @defaultValue true
60
- */
61
- Resizable?: boolean;
62
- /**
63
- * Whether Column can be grouped
64
- * @defaultValue true
65
- */
66
- Groupable?: boolean;
67
- /**
68
- * Whether Column is sortable
69
- * @defaultValue true
70
- */
71
- Sortable?: boolean;
72
- /**
73
- * Whether Column can be used when grid is in pivot mode
74
- * @defaultValue true
75
- */
76
- Pivotable?: boolean;
77
- /**
78
- * Whether Column can be used in an aggregation when grouping
79
- * @defaultValue true
80
- */
81
- Aggregatable?: boolean;
82
49
  }
@@ -36,5 +36,5 @@ export interface AdaptableButton<CONTEXT_TYPE extends ButtonContext> extends Ada
36
36
  hidden?: (button: AdaptableButton<CONTEXT_TYPE>, context: CONTEXT_TYPE) => boolean;
37
37
  }
38
38
  export interface ButtonContext {
39
- api: AdaptableApi;
39
+ adaptableApi: AdaptableApi;
40
40
  }