@adaptabletools/adaptable 15.4.3 → 16.0.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 (290) hide show
  1. package/base.css +1 -1
  2. package/base.css.map +1 -1
  3. package/bundle.cjs.js +234 -228
  4. package/index.css +1 -1
  5. package/index.css.map +1 -1
  6. package/package.json +2 -2
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableInterfaces/IAdaptable.d.ts +8 -2
  10. package/src/AdaptableOptions/ActionColumnOptions.d.ts +82 -0
  11. package/src/AdaptableOptions/{ActionOptions.d.ts → ActionRowOptions.d.ts} +15 -90
  12. package/src/AdaptableOptions/AdaptableOptions.d.ts +32 -12
  13. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -12
  14. package/src/AdaptableOptions/AlertOptions.d.ts +9 -0
  15. package/src/AdaptableOptions/CalendarOptions.d.ts +11 -0
  16. package/src/AdaptableOptions/CellSummaryOptions.d.ts +10 -0
  17. package/src/AdaptableOptions/ColumnOptions.d.ts +0 -4
  18. package/src/AdaptableOptions/CustomSortOptions.d.ts +24 -0
  19. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +5 -1
  20. package/src/AdaptableOptions/DataSetOptions.d.ts +41 -0
  21. package/src/AdaptableOptions/DataSetOptions.js +2 -0
  22. package/src/AdaptableOptions/EditOptions.d.ts +4 -4
  23. package/src/AdaptableOptions/EntitlementOptions.d.ts +0 -16
  24. package/src/AdaptableOptions/ExportOptions.d.ts +2 -4
  25. package/src/AdaptableOptions/ExpressionOptions.d.ts +7 -0
  26. package/src/AdaptableOptions/FinancePluginOptions.d.ts +1 -1
  27. package/src/AdaptableOptions/GroupingOptions.d.ts +50 -0
  28. package/src/AdaptableOptions/GroupingOptions.js +2 -0
  29. package/src/AdaptableOptions/MasterDetailPluginOptions.d.ts +9 -0
  30. package/src/AdaptableOptions/PredicateOptions.d.ts +4 -0
  31. package/src/AdaptableOptions/TeamSharingOptions.d.ts +0 -8
  32. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +30 -1
  33. package/src/Api/ActionColumnApi.d.ts +10 -0
  34. package/src/Api/ActionColumnApi.js +2 -0
  35. package/src/Api/{ActionApi.d.ts → ActionRowApi.d.ts} +4 -15
  36. package/src/Api/ActionRowApi.js +2 -0
  37. package/src/Api/AdaptableApi.d.ts +11 -6
  38. package/src/Api/AlertApi.d.ts +2 -111
  39. package/src/Api/BulkUpdateApi.d.ts +0 -7
  40. package/src/Api/CalculatedColumnApi.d.ts +0 -31
  41. package/src/Api/CalendarApi.d.ts +1 -1
  42. package/src/Api/CellSummaryApi.d.ts +0 -7
  43. package/src/Api/ChartingApi.d.ts +0 -7
  44. package/src/Api/ColumnApi.d.ts +1 -131
  45. package/src/Api/ConfigApi.d.ts +1 -7
  46. package/src/Api/CustomSortApi.d.ts +0 -25
  47. package/src/Api/DashboardApi.d.ts +0 -16
  48. package/src/Api/DataChangeHistoryApi.d.ts +0 -7
  49. package/src/Api/DataSetApi.d.ts +1 -16
  50. package/src/Api/EventApi.d.ts +1 -9
  51. package/src/Api/Events/AdaptableStateChanged.d.ts +0 -8
  52. package/src/Api/Events/AdaptableStateReloaded.d.ts +0 -4
  53. package/src/Api/Events/BaseEventInfo.d.ts +9 -1
  54. package/src/Api/Events/LiveDataChanged.d.ts +3 -7
  55. package/src/Api/ExportApi.d.ts +7 -31
  56. package/src/Api/{QueryLanguageApi.d.ts → ExpressionApi.d.ts} +2 -2
  57. package/src/Api/ExpressionApi.js +2 -0
  58. package/src/Api/FilterApi.d.ts +1 -59
  59. package/src/Api/FlashingCellApi.d.ts +0 -15
  60. package/src/Api/FormatColumnApi.d.ts +1 -91
  61. package/src/Api/FreeTextColumnApi.d.ts +0 -39
  62. package/src/Api/GridApi.d.ts +0 -31
  63. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +7 -0
  64. package/src/Api/Implementation/ActionColumnApiImpl.js +14 -0
  65. package/src/Api/Implementation/ActionRowApiImpl.d.ts +12 -0
  66. package/src/Api/Implementation/{ActionApiImpl.js → ActionRowApiImpl.js} +8 -15
  67. package/src/Api/Implementation/AdaptableApiImpl.d.ts +6 -4
  68. package/src/Api/Implementation/AdaptableApiImpl.js +7 -5
  69. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -43
  70. package/src/Api/Implementation/AlertApiImpl.js +4 -94
  71. package/src/Api/Implementation/ApiBase.d.ts +15 -5
  72. package/src/Api/Implementation/ApiBase.js +26 -8
  73. package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +0 -7
  74. package/src/Api/Implementation/CalculatedColumnApiImpl.js +0 -32
  75. package/src/Api/Implementation/CalendarApiImpl.d.ts +1 -0
  76. package/src/Api/Implementation/CalendarApiImpl.js +20 -17
  77. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -1
  78. package/src/Api/Implementation/CellSummaryApiImpl.js +3 -6
  79. package/src/Api/Implementation/ChartingApiImpl.d.ts +0 -1
  80. package/src/Api/Implementation/ChartingApiImpl.js +0 -5
  81. package/src/Api/Implementation/ColumnApiImpl.d.ts +0 -35
  82. package/src/Api/Implementation/ColumnApiImpl.js +1 -138
  83. package/src/Api/Implementation/ConfigApiImpl.js +2 -1
  84. package/src/Api/Implementation/CustomSortApiImpl.d.ts +1 -5
  85. package/src/Api/Implementation/CustomSortApiImpl.js +0 -16
  86. package/src/Api/Implementation/DashboardApiImpl.d.ts +0 -4
  87. package/src/Api/Implementation/DashboardApiImpl.js +2 -24
  88. package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +0 -1
  89. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +0 -5
  90. package/src/Api/Implementation/DataSetApiImpl.d.ts +1 -4
  91. package/src/Api/Implementation/DataSetApiImpl.js +1 -14
  92. package/src/Api/Implementation/ExportApiImpl.d.ts +4 -10
  93. package/src/Api/Implementation/ExportApiImpl.js +15 -34
  94. package/src/Api/Implementation/{QueryLanguageApiImpl.d.ts → ExpressionApiImpl.d.ts} +4 -4
  95. package/src/Api/Implementation/{QueryLanguageApiImpl.js → ExpressionApiImpl.js} +7 -5
  96. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -17
  97. package/src/Api/Implementation/FilterApiImpl.js +0 -53
  98. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +0 -3
  99. package/src/Api/Implementation/FlashingCellApiImpl.js +2 -13
  100. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +2 -34
  101. package/src/Api/Implementation/FormatColumnApiImpl.js +0 -73
  102. package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +0 -8
  103. package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -29
  104. package/src/Api/Implementation/GridApiImpl.d.ts +0 -7
  105. package/src/Api/Implementation/GridApiImpl.js +3 -32
  106. package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -6
  107. package/src/Api/Implementation/LayoutApiImpl.js +2 -27
  108. package/src/Api/Implementation/OptionsApiImpl.d.ts +10 -5
  109. package/src/Api/Implementation/OptionsApiImpl.js +19 -7
  110. package/src/Api/Implementation/PlusMinusApiImpl.d.ts +0 -1
  111. package/src/Api/Implementation/PlusMinusApiImpl.js +0 -5
  112. package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -8
  113. package/src/Api/Implementation/PredicateApiImpl.js +2 -30
  114. package/src/Api/Implementation/QueryApiImpl.d.ts +0 -5
  115. package/src/Api/Implementation/QueryApiImpl.js +0 -21
  116. package/src/Api/Implementation/QuickSearchApiImpl.d.ts +0 -1
  117. package/src/Api/Implementation/QuickSearchApiImpl.js +0 -5
  118. package/src/Api/Implementation/ScheduleApiImpl.d.ts +1 -18
  119. package/src/Api/Implementation/ScheduleApiImpl.js +0 -69
  120. package/src/Api/Implementation/ScopeApiImpl.js +1 -1
  121. package/src/Api/Implementation/SettingsPanelApiImpl.d.ts +0 -2
  122. package/src/Api/Implementation/SettingsPanelApiImpl.js +0 -9
  123. package/src/Api/Implementation/ShortcutApiImpl.d.ts +1 -6
  124. package/src/Api/Implementation/ShortcutApiImpl.js +0 -21
  125. package/src/Api/Implementation/SmartEditApiImpl.d.ts +0 -1
  126. package/src/Api/Implementation/SmartEditApiImpl.js +0 -5
  127. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +1 -5
  128. package/src/Api/Implementation/StyledColumnApiImpl.js +2 -17
  129. package/src/Api/Implementation/SystemStatusApiImpl.d.ts +0 -2
  130. package/src/Api/Implementation/SystemStatusApiImpl.js +0 -9
  131. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +0 -5
  132. package/src/Api/Implementation/TeamSharingApiImpl.js +0 -21
  133. package/src/Api/Implementation/ThemeApiImpl.d.ts +0 -4
  134. package/src/Api/Implementation/ThemeApiImpl.js +2 -17
  135. package/src/Api/Implementation/ToolPanelApiImpl.js +2 -2
  136. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +4 -2
  137. package/src/Api/Implementation/UserInterfaceApiImpl.js +17 -10
  138. package/src/Api/Internal/{ActionInternalApi.d.ts → ActionRowInternalApi.d.ts} +2 -2
  139. package/src/Api/Internal/{ActionInternalApi.js → ActionRowInternalApi.js} +12 -5
  140. package/src/Api/Internal/AdaptableInternalApi.d.ts +1 -10
  141. package/src/Api/Internal/AdaptableInternalApi.js +9 -20
  142. package/src/Api/Internal/AlertInternalApi.js +9 -6
  143. package/src/Api/Internal/CalculatedColumnInternalApi.js +2 -2
  144. package/src/Api/Internal/CustomSortInternalApi.d.ts +1 -1
  145. package/src/Api/Internal/CustomSortInternalApi.js +1 -1
  146. package/src/Api/Internal/DashboardInternalApi.js +2 -0
  147. package/src/Api/Internal/DataSetInternalApi.d.ts +1 -1
  148. package/src/Api/Internal/DataSetInternalApi.js +2 -1
  149. package/src/Api/Internal/ExportInternalApi.js +1 -1
  150. package/src/Api/Internal/{QueryLanguageInternalApi.d.ts → ExpressionnternalApi.d.ts} +1 -1
  151. package/src/Api/Internal/{QueryLanguageInternalApi.js → ExpressionnternalApi.js} +9 -5
  152. package/src/Api/Internal/FilterInternalApi.js +4 -1
  153. package/src/Api/Internal/FormatColumnInternalApi.js +1 -1
  154. package/src/Api/Internal/GridInternalApi.js +8 -0
  155. package/src/Api/Internal/LayoutInternalApi.js +6 -1
  156. package/src/Api/Internal/PredicateInternalApi.js +10 -0
  157. package/src/Api/Internal/QueryInternalApi.js +3 -1
  158. package/src/Api/Internal/SystemStatusInternalApi.js +4 -1
  159. package/src/Api/Internal/TeamSharingInternalApi.js +2 -0
  160. package/src/Api/LayoutApi.d.ts +3 -27
  161. package/src/Api/OptionsApi.d.ts +28 -10
  162. package/src/Api/PlusMinusApi.d.ts +0 -7
  163. package/src/Api/PredicateApi.d.ts +1 -32
  164. package/src/Api/QueryApi.d.ts +0 -23
  165. package/src/Api/QuickSearchApi.d.ts +0 -4
  166. package/src/Api/ScheduleApi.d.ts +0 -81
  167. package/src/Api/SettingsPanelApi.d.ts +0 -11
  168. package/src/Api/ShortcutApi.d.ts +0 -25
  169. package/src/Api/SmartEditApi.d.ts +0 -7
  170. package/src/Api/StyledColumnApi.d.ts +0 -21
  171. package/src/Api/SystemStatusApi.d.ts +0 -11
  172. package/src/Api/TeamSharingApi.d.ts +0 -23
  173. package/src/Api/ThemeApi.d.ts +0 -19
  174. package/src/Api/UserInterfaceApi.d.ts +4 -9
  175. package/src/PredefinedConfig/AlertState.d.ts +4 -1
  176. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +3 -3
  177. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +4 -1
  178. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +3 -0
  179. package/src/PredefinedConfig/Common/BaseContext.d.ts +8 -0
  180. package/src/PredefinedConfig/Common/CellSummary.d.ts +1 -0
  181. package/src/PredefinedConfig/Common/DataChangedScope.d.ts +9 -0
  182. package/src/PredefinedConfig/Common/Entitlement.d.ts +1 -1
  183. package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
  184. package/src/PredefinedConfig/Common/Enums.js +1 -0
  185. package/src/PredefinedConfig/LayoutState.d.ts +0 -6
  186. package/src/PredefinedConfig/SystemState.d.ts +1 -1
  187. package/src/PredefinedConfig/TeamSharingState.d.ts +1 -1
  188. package/src/PredefinedConfig/ThemeState.d.ts +3 -0
  189. package/src/Strategy/AdaptableModuleBase.js +3 -3
  190. package/src/Strategy/AlertModule.js +3 -3
  191. package/src/Strategy/CalculatedColumnModule.js +2 -2
  192. package/src/Strategy/CellSummaryModule.js +3 -0
  193. package/src/Strategy/DataSetModule.d.ts +1 -1
  194. package/src/Strategy/DataSetModule.js +1 -1
  195. package/src/Strategy/ExportModule.js +4 -0
  196. package/src/Strategy/FlashingCellModule.js +4 -4
  197. package/src/Strategy/FormatColumnModule.js +3 -3
  198. package/src/Strategy/QueryModule.js +1 -1
  199. package/src/Strategy/SmartEditModule.js +2 -0
  200. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +25 -23
  201. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +4 -0
  202. package/src/Utilities/Helpers/AdaptableHelper.js +12 -6
  203. package/src/Utilities/Helpers/FormatHelper.js +7 -0
  204. package/src/Utilities/ObjectFactory.d.ts +2 -2
  205. package/src/Utilities/ObjectFactory.js +7 -4
  206. package/src/Utilities/Services/AlertService.js +1 -1
  207. package/src/Utilities/Services/CalculatedColumnExpressionService.js +2 -2
  208. package/src/Utilities/Services/ChartingService.js +2 -0
  209. package/src/Utilities/Services/EntitlementService.js +2 -2
  210. package/src/Utilities/Services/MetamodelService.js +4 -0
  211. package/src/Utilities/Services/ModuleService.js +10 -10
  212. package/src/Utilities/Services/QueryLanguageService.js +16 -0
  213. package/src/Utilities/Services/ReportService.js +8 -6
  214. package/src/Utilities/Services/RowEditService.js +4 -2
  215. package/src/Utilities/Services/ValidationService.js +2 -0
  216. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +5 -5
  217. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +1 -1
  218. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +1 -1
  219. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +9 -9
  220. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.js +3 -3
  221. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +4 -4
  222. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +3 -3
  223. package/src/View/AdaptableWizardView/Wizard.js +2 -2
  224. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  225. package/src/View/CellSummary/CellSummaryStatusPanel.js +1 -1
  226. package/src/View/Components/AdaptableIconSelector/index.d.ts +6 -0
  227. package/src/View/Components/AdaptableIconSelector/index.js +18 -0
  228. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -2
  229. package/src/View/Components/AdaptableViewIcon/index.d.ts +10 -0
  230. package/src/View/Components/AdaptableViewIcon/index.js +18 -0
  231. package/src/View/Components/EntityRulesEditor/Utilities.js +3 -3
  232. package/src/View/Components/ExternalRenderer.js +14 -2
  233. package/src/View/Components/FilterForm/QuickFilterForm.js +4 -0
  234. package/src/View/Components/Popups/AdaptablePopupAlert.js +2 -0
  235. package/src/View/Components/RangesComponent.d.ts +4 -4
  236. package/src/View/Components/RangesComponent.js +13 -22
  237. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +2 -0
  238. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -1
  239. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
  240. package/src/View/Dashboard/CustomDashboardButton.js +2 -0
  241. package/src/View/Dashboard/CustomToolbarWrapper.js +13 -1
  242. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +11 -7
  243. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +2 -2
  244. package/src/View/DataChangeHistory/buildActionColumnButton.js +3 -2
  245. package/src/View/Export/ExportViewPanel.d.ts +1 -1
  246. package/src/View/Export/ExportViewPanel.js +4 -4
  247. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +3 -1
  248. package/src/View/GridInfo/GridInfoPopup.d.ts +0 -1
  249. package/src/View/GridInfo/GridInfoPopup.js +1 -2
  250. package/src/View/GridInfo/GridOptionsComponent.js +1 -1
  251. package/src/View/Layout/LayoutViewPanel.js +1 -1
  252. package/src/View/Layout/PivotDetailsPopoup.js +2 -0
  253. package/src/View/Layout/SaveLayoutButton.js +1 -1
  254. package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
  255. package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  256. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +1 -1
  257. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +2 -2
  258. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +8 -1
  259. package/src/agGrid/ActionColumnRenderer.d.ts +1 -1
  260. package/src/agGrid/ActionColumnRenderer.js +5 -1
  261. package/src/agGrid/Adaptable.d.ts +21 -10
  262. package/src/agGrid/Adaptable.js +164 -63
  263. package/src/agGrid/BadgeRenderer.js +10 -2
  264. package/src/agGrid/CheckboxRenderer.d.ts +1 -2
  265. package/src/agGrid/agGridHelper.js +4 -5
  266. package/src/agGrid/agGridMenuHelper.js +4 -0
  267. package/src/agGrid/attachAddaptableColumnTypes.d.ts +11 -11
  268. package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -0
  269. package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
  270. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +6 -3
  271. package/src/components/AdaptableIconComponent/index.js +6 -3
  272. package/src/components/ExpressionEditor/BaseEditorInput.js +2 -0
  273. package/src/components/ExpressionEditor/index.js +1 -1
  274. package/src/components/IconSelector/IconSelector.d.ts +2 -0
  275. package/src/components/IconSelector/IconSelector.js +21 -5
  276. package/src/components/Input/NumberInput.d.ts +10 -0
  277. package/src/components/Input/NumberInput.js +46 -0
  278. package/src/metamodel/adaptable.metamodel.d.ts +230 -145
  279. package/src/metamodel/adaptable.metamodel.js +1 -1
  280. package/src/types.d.ts +14 -8
  281. package/version.d.ts +1 -1
  282. package/version.js +1 -1
  283. package/src/AdaptableOptions/GeneralOptions.d.ts +0 -159
  284. package/src/Api/Events/SearchChanged.d.ts +0 -12
  285. package/src/Api/Implementation/ActionApiImpl.d.ts +0 -14
  286. /package/src/AdaptableOptions/{ActionOptions.js → ActionColumnOptions.js} +0 -0
  287. /package/src/AdaptableOptions/{GeneralOptions.js → ActionRowOptions.js} +0 -0
  288. /package/src/{Api/ActionApi.js → AdaptableOptions/CalendarOptions.js} +0 -0
  289. /package/src/{Api/Events/SearchChanged.js → AdaptableOptions/CellSummaryOptions.js} +0 -0
  290. /package/src/{Api/QueryLanguageApi.js → AdaptableOptions/CustomSortOptions.js} +0 -0
@@ -60,6 +60,7 @@ exports.ReactAdaptableDateEditor = (0, react_1.forwardRef)((props, ref) => {
60
60
  Pattern,
61
61
  });
62
62
  } });
63
+ // @ts-ignore it will be fixed with https://github.com/AdaptableTools/adaptable/issues/2230
63
64
  valueRef.current = valueParser(params);
64
65
  }
65
66
  else {
@@ -159,6 +160,7 @@ class AdaptableDateEditor {
159
160
  Pattern,
160
161
  });
161
162
  } });
163
+ // @ts-ignore it will be fixed with https://github.com/AdaptableTools/adaptable/issues/2230
162
164
  this.value = this.valueParser(params);
163
165
  }
164
166
  else {
@@ -19,8 +19,8 @@ function getStartValue(params) {
19
19
  if (shouldClearExistingValue(params)) {
20
20
  return '';
21
21
  }
22
- if (params.charPress && isValidChar(params.charPress)) {
23
- return params.charPress;
22
+ if (params.eventKey && isValidChar(params.eventKey)) {
23
+ return params.eventKey;
24
24
  }
25
25
  return params.value;
26
26
  }
@@ -18,9 +18,12 @@ function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabled
18
18
  height: 15,
19
19
  width: 15,
20
20
  });
21
- let buttonStyle = api.internalApi.getStyleForButton(button, context ? context : { adaptableApi: api });
22
- let buttonLabel = api.internalApi.getLabelForButton(button, context ? context : { adaptableApi: api });
23
- let buttonTooltip = api.internalApi.getTooltipForButton(button, context ? context : { adaptableApi: api });
21
+ let buttonStyle = api.internalApi.getStyleForButton(button, context ? context : { adaptableApi: api, userName: this.getOptions().userName,
22
+ adaptableId: this.getOptions().adaptableId, });
23
+ let buttonLabel = api.internalApi.getLabelForButton(button, context ? context : { adaptableApi: api, userName: this.getOptions().userName,
24
+ adaptableId: this.getOptions().adaptableId, });
25
+ let buttonTooltip = api.internalApi.getTooltipForButton(button, context ? context : { adaptableApi: api, userName: this.getOptions().userName,
26
+ adaptableId: this.getOptions().adaptableId, });
24
27
  return (React.createElement(SimpleButton_1.default, { autoFocus: focusFirstButton && index === 0, disabled: disabledButtons[index], key: index, tooltip: buttonTooltip, icon: buttonIcon, tone: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _a !== void 0 ? _a : defaultTone, variant: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant, "data-text": buttonLabel, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, marginLeft: index ? 2 : 0, onClick: () => {
25
28
  onClick(button);
26
29
  } }, buttonLabel));
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isAdaptableIcon = exports.isAdaptableElementIcon = exports.isAdaptableExternalIcon = exports.isAdaptableInternalIcon = exports.AdaptableIconComponent = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const icons_1 = require("../icons");
6
+ const icons_1 = tslib_1.__importStar(require("../icons"));
7
7
  const join_1 = tslib_1.__importDefault(require("../utils/join"));
8
8
  const react_1 = require("react");
9
9
  const AdaptableIconComponent = (props) => {
@@ -26,6 +26,9 @@ const AdaptableIconComponent = (props) => {
26
26
  }
27
27
  else {
28
28
  htmlElement = icon.element;
29
+ // THe element neets to be cloned.
30
+ // when it is used in more than one plce the element is removed from the DOM
31
+ htmlElement = htmlElement.cloneNode(true);
29
32
  }
30
33
  divRef.current.insertAdjacentElement('afterend', htmlElement);
31
34
  }
@@ -35,8 +38,8 @@ const AdaptableIconComponent = (props) => {
35
38
  }
36
39
  };
37
40
  }, [icon]);
38
- if ((0, exports.isAdaptableInternalIcon)(icon)) {
39
- return React.createElement(icons_1.Icon, { name: icon.name, size: icon.size, style: icon.style, className: className });
41
+ if ((0, exports.isAdaptableInternalIcon)(icon) && icon.name in icons_1.default) {
42
+ return (React.createElement(icons_1.Icon, { name: icon.name, size: icon.size, style: icon.style, className: className }));
40
43
  }
41
44
  if ((0, exports.isAdaptableExternalIcon)(icon)) {
42
45
  let width = (_b = (_a = icon.style) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 'var(--ab-cmp-icon__width)';
@@ -195,6 +195,8 @@ function BaseEditorInput(props) {
195
195
  // we need a fully-fledged rowNode as Adaptable accesses internal methods of it
196
196
  node: testRowNode,
197
197
  adaptableApi: props.api,
198
+ userName: props.api.optionsApi.getUserName(),
199
+ adaptableId: props.api.optionsApi.getAdaptableId(),
198
200
  functions: expressionFunctions,
199
201
  evaluateCustomQueryVariable: props.api.internalApi.getQueryLanguageService().evaluateCustomQueryVariable,
200
202
  });
@@ -112,7 +112,7 @@ function ExpressionEditor(props) {
112
112
  padding: 5,
113
113
  } }, showColumnIds
114
114
  ? namedQuery.BooleanExpression
115
- : props.api.queryLanguageApi.getAdaptableQueryExpressionWithColumnFriendlyNames(namedQuery)))))));
115
+ : props.api.expressionApi.getAdaptableQueryExpressionWithColumnFriendlyNames(namedQuery)))))));
116
116
  const showDocumentationLinks = props.api.internalApi.isDocumentationLinksDisplayed();
117
117
  const queryDocumentationLink = queryDocumentationLinks[type];
118
118
  return (React.createElement(EditorContext_1.ExpressionEditorContext.Provider, { value: {
@@ -1,5 +1,7 @@
1
1
  import { FunctionComponent } from 'react';
2
+ import { UserInterfaceOptions } from '../../types';
2
3
  export interface IconSelectorProps {
4
+ customIcons?: UserInterfaceOptions['customIcons'];
3
5
  value?: string;
4
6
  onChange: (iconName: string) => void;
5
7
  clearable?: boolean;
@@ -5,11 +5,15 @@ const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const rebass_1 = require("rebass");
7
7
  const AdaptableInput_1 = tslib_1.__importDefault(require("../../View/Components/AdaptableInput"));
8
+ const AdaptableIconComponent_1 = require("../AdaptableIconComponent");
8
9
  const icons_1 = tslib_1.__importStar(require("../icons"));
9
10
  const OverlayTrigger_1 = tslib_1.__importDefault(require("../OverlayTrigger"));
10
11
  const SimpleButton_1 = tslib_1.__importDefault(require("../SimpleButton"));
12
+ const IconButton = (props) => {
13
+ return (react_1.default.createElement(SimpleButton_1.default, { onClick: () => props.onClick(), p: 2, variant: props.active ? 'raised' : 'text', tone: props.active ? 'accent' : 'none', icon: props.icon }, props.children));
14
+ };
11
15
  const IconSelector = (props) => {
12
- var _a;
16
+ var _a, _b, _c;
13
17
  const [query, setQuery] = react_1.default.useState('');
14
18
  const allIcons = Object.keys(icons_1.default);
15
19
  const filteredIcons = query
@@ -17,23 +21,35 @@ const IconSelector = (props) => {
17
21
  return iconName.toLowerCase().includes(query.toLowerCase());
18
22
  })
19
23
  : allIcons;
20
- let iconsElements = filteredIcons.map((iconName) => {
24
+ const iconsElements = filteredIcons.map((iconName) => {
21
25
  return (react_1.default.createElement(rebass_1.Flex, { key: iconName },
22
- react_1.default.createElement(SimpleButton_1.default, { onClick: () => props.onChange(iconName), p: 2, variant: iconName === props.value ? 'raised' : 'text', tone: iconName === props.value ? 'accent' : 'none', icon: iconName })));
26
+ react_1.default.createElement(IconButton, { onClick: () => props.onChange(iconName), active: iconName === props.value, icon: iconName })));
27
+ });
28
+ const customIconsElements = (_a = props.customIcons) === null || _a === void 0 ? void 0 : _a.map((def) => {
29
+ return (react_1.default.createElement(IconButton, { key: def.name, active: false, onClick: () => props.onChange(def.name) },
30
+ react_1.default.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { key: def.name, icon: def.icon })));
23
31
  });
24
32
  const popup = (react_1.default.createElement(rebass_1.Box, { className: "ab-IconSelector__Popup" },
25
33
  react_1.default.createElement(rebass_1.Box, { mb: 2 },
26
34
  react_1.default.createElement(rebass_1.Box, { mb: 2, fontSize: 4 }, "Select an Icon"),
27
35
  react_1.default.createElement(AdaptableInput_1.default, { value: query, onChange: (event) => { var _a; return setQuery((_a = event.target.value) !== null && _a !== void 0 ? _a : ''); }, width: "100%" })),
28
- react_1.default.createElement(rebass_1.Flex, { p: 2, style: { width: 300, maxHeight: 300, overflow: 'auto' }, flexWrap: "wrap" }, iconsElements)));
36
+ react_1.default.createElement(rebass_1.Flex, { p: 2, style: { width: 300, maxHeight: 300, overflow: 'auto' }, flexWrap: "wrap" },
37
+ iconsElements,
38
+ " ",
39
+ customIconsElements)));
29
40
  let value = 'No Icon Selected';
30
41
  if (props.value in icons_1.default) {
31
42
  value = (react_1.default.createElement(icons_1.Icon, { style: { display: 'inline-block' }, name: props.value }));
32
43
  }
44
+ else {
45
+ const icon = (_b = props.customIcons) === null || _b === void 0 ? void 0 : _b.find((def) => def.name === props.value);
46
+ if (icon)
47
+ value = react_1.default.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: icon.icon });
48
+ }
33
49
  return (react_1.default.createElement(rebass_1.Flex, { className: "ab-IconSelector" },
34
50
  react_1.default.createElement(OverlayTrigger_1.default, { preventPortalEventPropagation: false, render: () => popup, showEvent: "mouseenter", hideEvent: "mouseleave", hideDelay: 300 },
35
51
  react_1.default.createElement(SimpleButton_1.default, { className: "ab-IconSelector__trigger", textAlign: "center", onClick: () => null, variant: "raised", width: 150, justifyContent: "center" }, value)),
36
- ((_a = props.clearable) !== null && _a !== void 0 ? _a : true) && (react_1.default.createElement(SimpleButton_1.default, { disabled: !props.value, className: "ab-IconSelector__clear-button", ml: 2, onClick: (event) => {
52
+ ((_c = props.clearable) !== null && _c !== void 0 ? _c : true) && (react_1.default.createElement(SimpleButton_1.default, { disabled: !props.value, className: "ab-IconSelector__clear-button", ml: 2, onClick: (event) => {
37
53
  event.stopPropagation();
38
54
  event.preventDefault();
39
55
  props.onChange('');
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { InputProps } from './index';
3
+ export declare type NumberInputProps = {
4
+ onChange: (value: number) => void;
5
+ } & Omit<InputProps, 'onChange'>;
6
+ /**
7
+ * This component allows - and empty values as intermediery values
8
+ * it calls change only with valid numeric values
9
+ */
10
+ export declare const NumberInput: React.FunctionComponent<NumberInputProps>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NumberInput = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const index_1 = tslib_1.__importDefault(require("./index"));
7
+ /**
8
+ * This component allows - and empty values as intermediery values
9
+ * it calls change only with valid numeric values
10
+ */
11
+ const NumberInput = (props) => {
12
+ const [value, setValue] = React.useState(() => {
13
+ var _a;
14
+ // awlays controlled
15
+ return (_a = props.value) !== null && _a !== void 0 ? _a : '';
16
+ });
17
+ const handleChange = React.useCallback((event) => {
18
+ const { value } = event.target;
19
+ let newVal = Number(value);
20
+ if (value === '-' || value === '') {
21
+ // we are saving invalid values so we allow values as empty string and '-'
22
+ // there is a validation that prevents the
23
+ newVal = value;
24
+ // the value may be empty or negative
25
+ setValue(value);
26
+ }
27
+ else if (!isNaN(newVal)) {
28
+ setValue(value);
29
+ // only set when a valid numer
30
+ props.onChange(newVal);
31
+ }
32
+ }, []);
33
+ React.useEffect(() => {
34
+ setValue(props.value);
35
+ }, [props.value]);
36
+ const handleBlur = React.useCallback((event) => {
37
+ var _a;
38
+ (_a = props === null || props === void 0 ? void 0 : props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
39
+ // show the prop value
40
+ if (value !== props.value) {
41
+ setValue(props.value);
42
+ }
43
+ }, [props.value, value]);
44
+ return React.createElement(index_1.default, Object.assign({}, props, { value: value, onBlur: handleBlur, onChange: handleChange }));
45
+ };
46
+ exports.NumberInput = NumberInput;