@adaptabletools/adaptable 11.2.4-canary.0 → 12.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/base.css +22 -4
  2. package/bundle.cjs.js +111 -111
  3. package/index.css +26 -4
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +6 -1
  8. package/src/AdaptableOptions/ActionOptions.d.ts +1 -0
  9. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.js → ActionOptions.js} +0 -0
  10. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +5 -0
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
  12. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +5 -0
  13. package/src/AdaptableOptions/AlertOptions.d.ts +14 -1
  14. package/src/AdaptableOptions/ColumnOptions.d.ts +49 -0
  15. package/src/AdaptableOptions/{SmartEdit.js → ColumnOptions.js} +0 -0
  16. package/src/AdaptableOptions/DashboardOptions.d.ts +2 -7
  17. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +19 -0
  18. package/src/AdaptableOptions/EditOptions.d.ts +92 -4
  19. package/src/AdaptableOptions/EntitlementOptions.d.ts +7 -1
  20. package/src/AdaptableOptions/ExportOptions.d.ts +5 -1
  21. package/src/AdaptableOptions/FilterOptions.d.ts +6 -1
  22. package/src/AdaptableOptions/FinancePluginOptions.d.ts +33 -3
  23. package/src/AdaptableOptions/GeneralOptions.d.ts +22 -23
  24. package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.d.ts → MasterDetailPluginOptions.d.ts} +2 -4
  25. package/src/{Api/DataSourceApi.js → AdaptableOptions/MasterDetailPluginOptions.js} +0 -0
  26. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -6
  27. package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -49
  28. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +81 -54
  29. package/src/Api/AdaptableApi.d.ts +6 -3
  30. package/src/Api/ColumnApi.d.ts +6 -3
  31. package/src/Api/ConditionalStyleApi.d.ts +10 -0
  32. package/src/Api/ConfigApi.d.ts +0 -12
  33. package/src/Api/DashboardApi.d.ts +6 -19
  34. package/src/Api/DataSetApi.d.ts +40 -0
  35. package/src/{PredefinedConfig/DataSourceState.js → Api/DataSetApi.js} +0 -0
  36. package/src/Api/EventApi.d.ts +18 -1
  37. package/src/Api/Events/DataSetChanged.d.ts +5 -0
  38. package/src/{PredefinedConfig/FilterState.js → Api/Events/DataSetChanged.js} +0 -0
  39. package/src/Api/Events/RowFormSubmitted.d.ts +19 -0
  40. package/src/Api/Events/RowFormSubmitted.js +2 -0
  41. package/src/Api/Events/SearchChanged.d.ts +3 -4
  42. package/src/Api/FilterApi.d.ts +1 -77
  43. package/src/Api/FinanceApi.d.ts +3 -2
  44. package/src/Api/FormatColumnApi.d.ts +28 -1
  45. package/src/Api/GridApi.d.ts +15 -1
  46. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
  47. package/src/Api/Implementation/AdaptableApiImpl.js +3 -3
  48. package/src/Api/Implementation/AlertApiImpl.js +5 -1
  49. package/src/Api/Implementation/ApiBase.d.ts +3 -0
  50. package/src/Api/Implementation/ApiBase.js +6 -0
  51. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  52. package/src/Api/Implementation/ColumnApiImpl.js +6 -3
  53. package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +2 -0
  54. package/src/Api/Implementation/ConditionalStyleApiImpl.js +8 -0
  55. package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -4
  56. package/src/Api/Implementation/ConfigApiImpl.js +2 -24
  57. package/src/Api/Implementation/DashboardApiImpl.d.ts +3 -6
  58. package/src/Api/Implementation/DashboardApiImpl.js +5 -29
  59. package/src/Api/Implementation/DataSetApiImpl.d.ts +12 -0
  60. package/src/Api/Implementation/DataSetApiImpl.js +42 -0
  61. package/src/Api/Implementation/EventApiImpl.js +1 -0
  62. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -16
  63. package/src/Api/Implementation/FilterApiImpl.js +5 -164
  64. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +6 -0
  65. package/src/Api/Implementation/FormatColumnApiImpl.js +34 -0
  66. package/src/Api/Implementation/GridApiImpl.d.ts +4 -1
  67. package/src/Api/Implementation/GridApiImpl.js +41 -1
  68. package/src/Api/Implementation/InternalApiImpl.d.ts +7 -2
  69. package/src/Api/Implementation/InternalApiImpl.js +51 -10
  70. package/src/Api/Implementation/LayoutApiImpl.d.ts +18 -1
  71. package/src/Api/Implementation/LayoutApiImpl.js +172 -0
  72. package/src/Api/Implementation/PredicateApiImpl.js +1 -1
  73. package/src/Api/Implementation/SmartEditApiImpl.d.ts +5 -2
  74. package/src/Api/Implementation/SmartEditApiImpl.js +9 -0
  75. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +5 -3
  76. package/src/Api/Implementation/TeamSharingApiImpl.js +28 -10
  77. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
  78. package/src/Api/Implementation/UserInterfaceApiImpl.js +7 -25
  79. package/src/Api/InternalApi.d.ts +6 -2
  80. package/src/Api/LayoutApi.d.ts +88 -1
  81. package/src/Api/SmartEditApi.d.ts +14 -3
  82. package/src/Api/TeamSharingApi.d.ts +18 -5
  83. package/src/Api/UserInterfaceApi.d.ts +4 -4
  84. package/src/PredefinedConfig/AdaptableState.d.ts +0 -4
  85. package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -0
  86. package/src/PredefinedConfig/Common/AdaptableButton.d.ts +3 -3
  87. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -1
  88. package/src/PredefinedConfig/Common/AdaptableForm.d.ts +3 -2
  89. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +6 -3
  90. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -11
  91. package/src/PredefinedConfig/Common/AdaptablePredicate.js +35 -2
  92. package/src/PredefinedConfig/Common/BaseContext.d.ts +1 -1
  93. package/src/PredefinedConfig/{FilterState.d.ts → Common/ColumnFilter.d.ts} +2 -33
  94. package/src/PredefinedConfig/Common/ColumnFilter.js +2 -0
  95. package/src/PredefinedConfig/Common/Enums.d.ts +2 -2
  96. package/src/PredefinedConfig/Common/Enums.js +1 -1
  97. package/src/PredefinedConfig/Common/FDC3Context.d.ts +5 -1
  98. package/src/PredefinedConfig/Common/Types.d.ts +6 -5
  99. package/src/PredefinedConfig/Common/Types.js +2 -3
  100. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  101. package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -10
  102. package/src/PredefinedConfig/StatusBarState.d.ts +1 -2
  103. package/src/PredefinedConfig/SystemState.d.ts +4 -2
  104. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +47 -0
  105. package/src/Redux/ActionsReducers/LayoutRedux.js +135 -1
  106. package/src/Redux/ActionsReducers/SystemRedux.d.ts +23 -1
  107. package/src/Redux/ActionsReducers/SystemRedux.js +39 -1
  108. package/src/Redux/Store/AdaptableStore.js +37 -39
  109. package/src/Strategy/AlertModule.d.ts +11 -0
  110. package/src/Strategy/AlertModule.js +14 -0
  111. package/src/Strategy/CellSummaryModule.d.ts +3 -0
  112. package/src/Strategy/CellSummaryModule.js +28 -14
  113. package/src/Strategy/DataSetModule.d.ts +25 -0
  114. package/src/Strategy/DataSetModule.js +65 -0
  115. package/src/Strategy/ExportModule.js +6 -1
  116. package/src/Strategy/FilterModule.d.ts +7 -11
  117. package/src/Strategy/FilterModule.js +24 -15
  118. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  119. package/src/Strategy/FlashingCellModule.js +2 -2
  120. package/src/Strategy/FormatColumnModule.js +1 -1
  121. package/src/Strategy/Interface/IModule.d.ts +3 -1
  122. package/src/Strategy/LayoutModule.js +24 -2
  123. package/src/Strategy/SmartEditModule.d.ts +1 -1
  124. package/src/Strategy/SmartEditModule.js +5 -6
  125. package/src/Strategy/StatusBarModule.js +1 -3
  126. package/src/Strategy/TeamSharingModule.js +1 -1
  127. package/src/Strategy/ToolPanelModule.js +1 -4
  128. package/src/Utilities/Constants/GeneralConstants.d.ts +6 -2
  129. package/src/Utilities/Constants/GeneralConstants.js +6 -2
  130. package/src/Utilities/Constants/ModuleConstants.d.ts +1 -1
  131. package/src/Utilities/Constants/ModuleConstants.js +2 -2
  132. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +22 -13
  133. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
  134. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -4
  135. package/src/Utilities/Helpers/AdaptableHelper.js +4 -1
  136. package/src/Utilities/ObjectFactory.d.ts +3 -6
  137. package/src/Utilities/ObjectFactory.js +3 -7
  138. package/src/Utilities/Services/EntitlementService.js +7 -1
  139. package/src/Utilities/Services/Interface/IRowEditService.d.ts +8 -0
  140. package/src/Utilities/Services/Interface/IRowEditService.js +2 -0
  141. package/src/Utilities/Services/ModuleService.js +1 -1
  142. package/src/Utilities/Services/ReportService.js +2 -3
  143. package/src/Utilities/Services/RowEditService.d.ts +25 -0
  144. package/src/Utilities/Services/RowEditService.js +165 -0
  145. package/src/Utilities/Services/TeamSharingService.js +4 -4
  146. package/src/View/AdaptablePopover/index.d.ts +1 -0
  147. package/src/View/AdaptablePopover/index.js +5 -6
  148. package/src/View/AdaptableView.js +1 -1
  149. package/src/View/AdaptableViewFactory.js +2 -2
  150. package/src/View/Alert/ActiveAlertsPanel.d.ts +2 -0
  151. package/src/View/Alert/ActiveAlertsPanel.js +15 -0
  152. package/src/View/Alert/AlertStatusSubPanel.js +3 -8
  153. package/src/View/Alert/AlertViewPanel.js +2 -2
  154. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +1 -1
  155. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
  156. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  157. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +9 -2
  158. package/src/View/CellSummary/CellSummaryDetails.js +2 -2
  159. package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -4
  160. package/src/View/CellSummary/CellSummaryPopover.js +3 -6
  161. package/src/View/CellSummary/CellSummaryPopup.js +8 -0
  162. package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
  163. package/src/View/CellSummary/CellSummaryStatusPanel.js +2 -2
  164. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  165. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +18 -8
  166. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -2
  167. package/src/View/Components/ExternalRenderer.d.ts +3 -6
  168. package/src/View/Components/ExternalRenderer.js +5 -5
  169. package/src/View/Components/FilterForm/FilterForm.d.ts +5 -2
  170. package/src/View/Components/FilterForm/FilterForm.js +9 -7
  171. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
  172. package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
  173. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +1 -1
  174. package/src/View/Components/FilterForm/QuickFilterForm.js +21 -7
  175. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
  176. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +2 -0
  177. package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +0 -2
  178. package/src/View/Components/Popups/AdaptablePopupAlert.js +13 -11
  179. package/src/View/Components/Popups/AdaptableToaster.js +29 -9
  180. package/src/View/Components/Popups/FormPopups/FormPopups.js +2 -2
  181. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
  182. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -9
  183. package/src/View/Dashboard/CustomDashboardButton.d.ts +11 -0
  184. package/src/View/Dashboard/CustomDashboardButton.js +47 -0
  185. package/src/View/Dashboard/CustomToolbarWrapper.d.ts +1 -0
  186. package/src/View/Dashboard/CustomToolbarWrapper.js +30 -11
  187. package/src/View/Dashboard/Dashboard.d.ts +1 -0
  188. package/src/View/Dashboard/Dashboard.js +8 -34
  189. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +19 -36
  190. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +3 -0
  191. package/src/View/DataChangeHistory/buildActionColumnButton.js +70 -0
  192. package/src/View/DataSet/DataSetSelector.d.ts +7 -0
  193. package/src/View/DataSet/DataSetSelector.js +18 -0
  194. package/src/View/DataSet/DataSetStatusPanelPopover.d.ts +2 -0
  195. package/src/View/DataSet/DataSetStatusPanelPopover.js +19 -0
  196. package/src/View/DataSet/DataSetViewPanel.d.ts +19 -0
  197. package/src/View/DataSet/DataSetViewPanel.js +58 -0
  198. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  199. package/src/View/Filter/FilterSummary.d.ts +5 -5
  200. package/src/View/Filter/FilterSummary.js +6 -5
  201. package/src/View/Filter/FilterViewPanel.d.ts +4 -4
  202. package/src/View/Filter/FilterViewPanel.js +11 -14
  203. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +3 -2
  204. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +51 -22
  205. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
  206. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  207. package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +6 -24
  208. package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
  209. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +2 -1
  210. package/src/View/SmartEdit/SmartEditPopup.d.ts +1 -1
  211. package/src/View/SmartEdit/SmartEditPopup.js +3 -4
  212. package/src/View/SmartEdit/SmartEditViewPanel.d.ts +1 -1
  213. package/src/View/SmartEdit/SmartEditViewPanel.js +3 -4
  214. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  215. package/src/View/StatusBar/AdaptableStatusBar.js +1 -1
  216. package/src/View/StatusBar/StatusBarPanel.d.ts +1 -0
  217. package/src/View/StatusBar/StatusBarPanel.js +5 -4
  218. package/src/View/Theme/ThemeStatusPanelPopover.js +5 -25
  219. package/src/View/UIHelper.d.ts +4 -4
  220. package/src/View/UIHelper.js +4 -4
  221. package/src/agGrid/ActionColumnRenderer.d.ts +6 -1
  222. package/src/agGrid/ActionColumnRenderer.js +9 -6
  223. package/src/agGrid/Adaptable.d.ts +7 -2
  224. package/src/agGrid/Adaptable.js +217 -87
  225. package/src/agGrid/FilterWrapper.js +1 -1
  226. package/src/agGrid/agGridHelper.d.ts +6 -6
  227. package/src/agGrid/agGridHelper.js +34 -56
  228. package/src/agGrid/agGridMenuHelper.js +4 -1
  229. package/src/agGrid/rowEditIcons.d.ts +4 -0
  230. package/src/agGrid/rowEditIcons.js +9 -0
  231. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +9 -18
  232. package/src/components/Dashboard/DashboardToolbar.js +2 -2
  233. package/src/components/Datepicker/index.js +19 -18
  234. package/src/components/SelectList.d.ts +10 -0
  235. package/src/components/SelectList.js +9 -0
  236. package/src/components/WindowModal/WindowModal.d.ts +2 -0
  237. package/src/components/WindowModal/WindowModal.js +1 -1
  238. package/src/components/icons/{data-source.d.ts → data-set.d.ts} +0 -0
  239. package/src/components/icons/{data-source.js → data-set.js} +0 -0
  240. package/src/components/icons/index.js +2 -2
  241. package/src/metamodel/adaptable.metamodel.d.ts +242 -70
  242. package/src/metamodel/adaptable.metamodel.js +620 -376
  243. package/src/types.d.ts +19 -15
  244. package/version.d.ts +1 -1
  245. package/version.js +1 -1
  246. package/src/AdaptableOptions/SmartEdit.d.ts +0 -34
  247. package/src/Api/DataSourceApi.d.ts +0 -58
  248. package/src/Api/Implementation/DataSourceApiImpl.d.ts +0 -15
  249. package/src/Api/Implementation/DataSourceApiImpl.js +0 -51
  250. package/src/PredefinedConfig/DataSourceState.d.ts +0 -34
  251. package/src/Redux/ActionsReducers/DataSourceRedux.d.ts +0 -42
  252. package/src/Redux/ActionsReducers/DataSourceRedux.js +0 -76
  253. package/src/Redux/ActionsReducers/FilterRedux.d.ts +0 -70
  254. package/src/Redux/ActionsReducers/FilterRedux.js +0 -126
  255. package/src/Strategy/DataSourceModule.d.ts +0 -20
  256. package/src/Strategy/DataSourceModule.js +0 -56
  257. package/src/View/Components/Forms/AdaptableForm.d.ts +0 -6
  258. package/src/View/Components/Forms/AdaptableForm.js +0 -21
  259. package/src/View/DataSource/DataSourceViewPanel.d.ts +0 -19
  260. package/src/View/DataSource/DataSourceViewPanel.js +0 -69
  261. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.d.ts +0 -2
  262. package/src/View/DataSource/Wizard/DataSourceSettingsSummary.js +0 -17
  263. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.d.ts +0 -8
  264. package/src/View/DataSource/Wizard/DataSourceSettingsWizard.js +0 -42
  265. package/src/View/DataSource/Wizard/DataSourceWizard.d.ts +0 -8
  266. package/src/View/DataSource/Wizard/DataSourceWizard.js +0 -53
@@ -1,4 +1,8 @@
1
1
  import { AdaptableObject } from './AdaptableObject';
2
+ /**
3
+ * The type of the column data
4
+ */
5
+ export declare type AdaptableColumnDataType = 'String' | 'Number' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
2
6
  /**
3
7
  * Base class for Adaptable Column containing most important properties
4
8
  */
@@ -14,7 +18,7 @@ export interface AdaptableColumnBase extends AdaptableObject {
14
18
  /**
15
19
  * DataType of the column
16
20
  */
17
- dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
21
+ dataType: AdaptableColumnDataType;
18
22
  }
19
23
  export declare const isValidOrderForColumnGroups: ({ oldColumns, newColumns, }: {
20
24
  oldColumns: AdaptableColumn[];
@@ -36,13 +36,13 @@ export interface AdaptableFormField {
36
36
  */
37
37
  name: string;
38
38
  /**
39
- * Label to display in in the Field
39
+ * Label to display in the Field
40
40
  */
41
41
  label: string;
42
42
  /**
43
43
  * Field Type: text, date, number, checkbox, select, textOutput
44
44
  */
45
- fieldType: 'text' | 'select' | 'date' | 'number' | 'checkbox' | 'textOutput';
45
+ fieldType: AdaptableFormFieldType;
46
46
  /**
47
47
  * Field Default Value - can be of type string, boolean, number
48
48
  */
@@ -55,4 +55,5 @@ export interface AdaptableFormField {
55
55
  label: string;
56
56
  }[];
57
57
  }
58
+ export declare type AdaptableFormFieldType = 'text' | 'select' | 'date' | 'number' | 'checkbox' | 'textOutput';
58
59
  export declare function getDefaultAdaptableFormData<T extends BaseContext = BaseContext>(formDef?: AdaptableForm<T>): Record<string, any>;
@@ -11,10 +11,13 @@ export declare type AdaptableFormat = {
11
11
  Formatter: 'StringFormatter';
12
12
  Options: StringFormatterOptions;
13
13
  };
14
+ export interface BaseFormatterOptions {
15
+ CustomDisplayFormats?: string[];
16
+ }
14
17
  /**
15
18
  * Formatter Options for Numeric Columns
16
19
  */
17
- export interface NumberFormatterOptions {
20
+ export interface NumberFormatterOptions extends BaseFormatterOptions {
18
21
  /**
19
22
  * Number of digits to show in fractions
20
23
  */
@@ -55,7 +58,7 @@ export interface NumberFormatterOptions {
55
58
  /**
56
59
  * Formatter Options for Date Columns - contains a single `Pattern` property
57
60
  */
58
- export interface DateFormatterOptions {
61
+ export interface DateFormatterOptions extends BaseFormatterOptions {
59
62
  /**
60
63
  * Pattern to use for Date Format
61
64
  */
@@ -64,7 +67,7 @@ export interface DateFormatterOptions {
64
67
  /**
65
68
  * Formatter Options for String Columns
66
69
  */
67
- export interface StringFormatterOptions {
70
+ export interface StringFormatterOptions extends BaseFormatterOptions {
68
71
  /**
69
72
  * Sets text to Upper or Lower case
70
73
  */
@@ -21,15 +21,6 @@ export interface AdaptableObject {
21
21
  Tags?: AdaptableObjectTag[];
22
22
  }
23
23
  /**
24
- * Object Tag - defined as a label and a value
24
+ * AdaptableObjectTag Object Tague - currently supporting only plain string values, but open for future extensions, if ever needed.
25
25
  */
26
- export declare type AdaptableObjectTag = string | {
27
- /**
28
- * Label for the Tag
29
- */
30
- label: string;
31
- /**
32
- * Value for the Tag - string or number
33
- */
34
- value: string | number;
35
- };
26
+ export declare type AdaptableObjectTag = string;
@@ -27,7 +27,23 @@ exports.SystemPredicateDefs = [
27
27
  icon: { text: 'IN' },
28
28
  columnScope: { DataTypes: ['String', 'Number', 'Date'] },
29
29
  moduleScope: ['filter'],
30
- handler: ({ displayValue, inputs }) => inputs.length === 0 || inputs.includes(displayValue),
30
+ handler: ({ inputs, column, value }) => {
31
+ if (inputs.length === 0) {
32
+ return true;
33
+ }
34
+ if (column.dataType === 'Date') {
35
+ return inputs.some((input) => {
36
+ return isSameDay_1.default(input, value);
37
+ });
38
+ }
39
+ if (column.dataType === 'Number') {
40
+ return inputs.includes(value);
41
+ }
42
+ if (column.dataType === 'String') {
43
+ return inputs.includes(value);
44
+ }
45
+ return true;
46
+ },
31
47
  toString: ({ inputs }) => `IN (${inputs.join(', ')})`,
32
48
  shortcuts: ['#', '['],
33
49
  },
@@ -37,7 +53,24 @@ exports.SystemPredicateDefs = [
37
53
  icon: { text: '!IN' },
38
54
  columnScope: { DataTypes: ['String', 'Number', 'Date'] },
39
55
  moduleScope: ['filter'],
40
- handler: ({ displayValue, inputs }) => inputs.length === 0 || !inputs.includes(displayValue),
56
+ handler: ({ inputs, column, value }) => {
57
+ // basically negation of IN
58
+ if (inputs.length === 0) {
59
+ return true;
60
+ }
61
+ if (column.dataType === 'Date') {
62
+ return inputs.some((input) => {
63
+ return !isSameDay_1.default(input, value);
64
+ });
65
+ }
66
+ if (column.dataType === 'Number') {
67
+ return !inputs.includes(value);
68
+ }
69
+ if (column.dataType === 'String') {
70
+ return !inputs.includes(value);
71
+ }
72
+ return true;
73
+ },
41
74
  toString: ({ inputs }) => `Exclude (${inputs.join(', ')})`,
42
75
  },
43
76
  {
@@ -1,6 +1,6 @@
1
1
  import { AdaptableApi } from '../../types';
2
2
  /**
3
- * Base Context object used in many functions provided by AdapTable
3
+ * Base Context used in many functions provided by developers and invoked as needed by AdapTable
4
4
  */
5
5
  export interface BaseContext {
6
6
  /**
@@ -1,36 +1,5 @@
1
- import { ConfigState } from './ConfigState';
2
- import { AdaptableApi, AdaptableColumn } from '../types';
3
- import { AdaptableObject } from './Common/AdaptableObject';
4
- import { AdaptablePredicate } from './Common/AdaptablePredicate';
5
- import { TypeHint } from './Common/Types';
6
- /**
7
- * Predefined Configuration for Filters
8
- */
9
- export interface FilterState extends ConfigState {
10
- /**
11
- * Collection of Column Filters
12
- */
13
- ColumnFilters?: ColumnFilter[];
14
- /**
15
- * Whether to display Quick Filter Bar between Column Header and the Grid
16
- * @defaultValue true
17
- */
18
- IsQuickFilterVisible?: boolean;
19
- }
20
- export interface FilterPredicateInput {
21
- type: 'number' | 'text' | 'date';
22
- defaultValue?: any;
23
- }
24
- export interface FilterPredicateHandler {
25
- (params: FilterPredicateParams): boolean;
26
- }
27
- export interface FilterPredicateParams {
28
- value: any;
29
- displayValue: string;
30
- inputs: any[];
31
- column: AdaptableColumn;
32
- api: AdaptableApi;
33
- }
1
+ import { AdaptableObject, AdaptablePredicate } from '../../types';
2
+ import { TypeHint } from './Types';
34
3
  /**
35
4
  * Defines a Filter applied on a Column using a Predicate
36
5
  */
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,8 +4,8 @@ export declare enum DataType {
4
4
  Boolean = "Boolean",
5
5
  Date = "Date",
6
6
  Object = "Object",
7
- All = "All",
8
- Unknown = "Unknown"
7
+ Unknown = "Unknown",
8
+ All = "All"
9
9
  }
10
10
  export declare enum MathOperation {
11
11
  Add = "Add",
@@ -9,8 +9,8 @@ var DataType;
9
9
  DataType["Boolean"] = "Boolean";
10
10
  DataType["Date"] = "Date";
11
11
  DataType["Object"] = "Object";
12
- DataType["All"] = "All";
13
12
  DataType["Unknown"] = "Unknown";
13
+ DataType["All"] = "All";
14
14
  })(DataType = exports.DataType || (exports.DataType = {}));
15
15
  var MathOperation;
16
16
  (function (MathOperation) {
@@ -1,3 +1,4 @@
1
+ import { CustomFDC3Intent } from '../../AdaptableOptions/FinancePluginOptions';
1
2
  import { BaseEventInfo } from '../../Api/Events/BaseEventInfo';
2
3
  import { FDC3Intent } from '../../types';
3
4
  /**
@@ -221,10 +222,13 @@ export interface AdaptableFDC3EventInfo extends BaseEventInfo {
221
222
  /**
222
223
  * The FDC3 Intent which caused Event to fire (if type is `RaiseIntent`)
223
224
  */
224
- intent?: FDC3Intent;
225
+ intent?: FDC3Intent | CustomFDC3Intent;
225
226
  /**
226
227
  * Full FDC3 Context for the object related to the event
227
228
  */
228
229
  context: FDC3Context;
229
230
  }
230
231
  export declare type ContextType = 'fdc3.instrument' | 'fdc3.instrumentList' | 'fdc3.position' | 'fdc3.portfolio' | 'fdc3.contact' | 'fdc3.contactList' | 'fdc3.organization' | 'fdc3.country';
232
+ export interface CustomFDC3Context extends FDC3Context {
233
+ type: any;
234
+ }
@@ -6,9 +6,9 @@ export declare type AdaptableDashboardToolbars = AdaptableDashboardToolbar[];
6
6
  /**
7
7
  * List of all the Toolbars that Adaptable provides
8
8
  */
9
- export declare type AdaptableDashboardToolbar = 'Alert' | 'BulkUpdate' | 'CellSummary' | 'DataChangeHistory' | 'DataSource' | 'Export' | 'Filter' | 'Glue42' | 'IPushPull' | 'Layout' | 'OpenFin' | 'Query' | 'QuickSearch' | 'SmartEdit' | 'StateManagement' | 'SystemStatus' | 'Theme';
9
+ export declare type AdaptableDashboardToolbar = 'Alert' | 'BulkUpdate' | 'CellSummary' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Filter' | 'Glue42' | 'IPushPull' | 'Layout' | 'OpenFin' | 'Query' | 'QuickSearch' | 'SmartEdit' | 'StateManagement' | 'SystemStatus' | 'Theme';
10
10
  export declare const ALL_TOOLBARS: AdaptableDashboardToolbar[];
11
- export declare type AdaptableStatusBarPanel = 'CellSummary' | 'Alert' | 'GridInfo' | 'Dashboard' | 'ToolPanel' | 'StatusBar' | 'StateManagement' | 'Alert' | 'CalculatedColumn' | 'ConditionalStyle' | 'CustomSort' | 'DataSource' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'Layout' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'Shortcut' | 'SystemStatus' | 'DataChangeHistory' | 'TeamSharing' | 'Theme' | 'BulkUpdate' | 'SettingsPanel' | 'SmartEdit';
11
+ export declare type AdaptableStatusBarPanel = 'CellSummary' | 'Alert' | 'GridInfo' | 'Dashboard' | 'ToolPanel' | 'StatusBar' | 'StateManagement' | 'Alert' | 'CalculatedColumn' | 'ConditionalStyle' | 'CustomSort' | 'DataSet' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'Layout' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'Shortcut' | 'SystemStatus' | 'DataChangeHistory' | 'TeamSharing' | 'Theme' | 'BulkUpdate' | 'SettingsPanel' | 'SmartEdit';
12
12
  export declare const ALL_STATUS_SUB_PANELS: AdaptableStatusBarPanel[];
13
13
  export declare type AdaptableToolPanels = AdaptableToolPanel[];
14
14
  export declare type AdaptableToolPanel = 'Alert' | 'BulkUpdate' | 'CellSummary' | 'Dashboard' | 'DataChangeHistory' | 'Export' | 'Filter' | 'IPushPull' | 'Layout' | 'OpenFin' | 'Query' | 'QuickSearch' | 'SmartEdit' | 'StateManagement' | 'SystemStatus' | 'Theme';
@@ -22,16 +22,17 @@ export declare type AdaptableModuleButtons = AdaptableModuleButton[];
22
22
  /**
23
23
  * List of all the Module buttons Adaptable provides - each Module has a popup for which this is a shortcut button
24
24
  */
25
- export declare type AdaptableModuleButton = 'Alert' | 'FlashingCell' | 'BulkUpdate' | 'CalculatedColumn' | 'CellSummary' | 'ConditionalStyle' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSource' | 'Export' | 'Filter' | 'FormatColumn' | 'FreeTextColumn' | 'Glue42' | 'GridInfo' | 'Layout' | 'OpenFin' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'SettingsPanel' | 'Shortcut' | 'SmartEdit' | 'StateManagement' | 'SystemStatus' | 'TeamSharing' | 'Theme';
25
+ export declare type AdaptableModuleButton = 'Alert' | 'FlashingCell' | 'BulkUpdate' | 'CalculatedColumn' | 'CellSummary' | 'ConditionalStyle' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Filter' | 'FormatColumn' | 'FreeTextColumn' | 'Glue42' | 'GridInfo' | 'Layout' | 'OpenFin' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'SettingsPanel' | 'Shortcut' | 'SmartEdit' | 'StateManagement' | 'SystemStatus' | 'TeamSharing' | 'Theme';
26
26
  export declare type AdaptableStateKeys = AdaptableStateKey[];
27
27
  export declare type AdaptableStateKey = keyof AdaptablePersistentState | 'OpenFin' | 'Glue42' | 'IPushPull';
28
28
  /**
29
29
  * Modules provided by AdapTable, subject to Entitlements and usually have Predefined Config
30
30
  */
31
- export declare type AdaptableModule = 'Alert' | 'BulkUpdate' | 'CalculatedColumn' | 'CellSummary' | 'Charting' | 'ConditionalStyle' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSource' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'Glue42' | 'GridInfo' | 'IPushPull' | 'Layout' | 'OpenFin' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'SettingsPanel' | 'Shortcut' | 'SmartEdit' | 'StateManagement' | 'StatusBar' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel';
32
- export declare type AdaptableSettingsPanel = 'Alert' | 'CalculatedColumn' | 'ConditionalStyle' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSource' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'GridInfo' | 'Layout' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'Shortcut' | 'StateManagement' | 'StatusBar' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel';
31
+ export declare type AdaptableModule = 'Alert' | 'BulkUpdate' | 'CalculatedColumn' | 'CellSummary' | 'Charting' | 'ConditionalStyle' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'Glue42' | 'GridInfo' | 'IPushPull' | 'Layout' | 'OpenFin' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'SettingsPanel' | 'Shortcut' | 'SmartEdit' | 'StateManagement' | 'StatusBar' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel';
32
+ export declare type AdaptableSettingsPanel = 'Alert' | 'CalculatedColumn' | 'ConditionalStyle' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'GridInfo' | 'Layout' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'Shortcut' | 'StateManagement' | 'StatusBar' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel';
33
33
  export declare type TypeHint<Base, Literals> = (Base & {
34
34
  __subType?: true;
35
35
  }) | Literals;
36
36
  export declare type AdaptableQLModules = AdaptableQLModule[];
37
37
  export declare type AdaptableQLModule = 'Filter' | 'Query';
38
+ export declare type AdaptableColumnType = 'abColDefBoolean' | 'abColDefDate' | 'abColDefNumber' | 'abColDefString' | 'abColDefObject' | 'abColDefCustom' | 'abSpecialColumn';
@@ -9,7 +9,7 @@ exports.ALL_TOOLBARS = [
9
9
  'BulkUpdate',
10
10
  'CellSummary',
11
11
  'DataChangeHistory',
12
- 'DataSource',
12
+ 'DataSet',
13
13
  'Export',
14
14
  'Filter',
15
15
  'Glue42',
@@ -32,7 +32,7 @@ exports.ALL_STATUS_SUB_PANELS = [
32
32
  'CustomSort',
33
33
  'Dashboard',
34
34
  'DataChangeHistory',
35
- 'DataSource',
35
+ 'DataSet',
36
36
  'Export',
37
37
  'Filter',
38
38
  'FlashingCell',
@@ -72,4 +72,3 @@ exports.ALL_TOOL_PANELS = [
72
72
  'SystemStatus',
73
73
  'Theme',
74
74
  ];
75
- // | 'QuickSearch'
@@ -1,6 +1,7 @@
1
1
  import { ConfigState } from './ConfigState';
2
2
  import { AdaptableObject } from './Common/AdaptableObject';
3
3
  import { ColumnSort } from './Common/ColumnSort';
4
+ import { ColumnFilter } from '../types';
4
5
  /**
5
6
  * Predefined Configuration for the Layout Module
6
7
  */
@@ -36,6 +37,10 @@ export interface Layout extends AdaptableObject {
36
37
  * Sorting to apply in the Layout
37
38
  */
38
39
  ColumnSorts?: ColumnSort[];
40
+ /**
41
+ * Collection of Column Filters.
42
+ */
43
+ ColumnFilters?: ColumnFilter[];
39
44
  /**
40
45
  * Columns which are row-grouped when the Layout is applied
41
46
  */
@@ -1,11 +1,9 @@
1
- import { FilterState } from './FilterState';
2
1
  import { ApplicationState } from './ApplicationState';
3
2
  import { AlertState } from './AlertState';
4
3
  import { CalculatedColumnState } from './CalculatedColumnState';
5
4
  import { ConditionalStyleState } from './ConditionalStyleState';
6
5
  import { CustomSortState } from './CustomSortState';
7
6
  import { DashboardState } from './DashboardState';
8
- import { DataSourceState } from './DataSourceState';
9
7
  import { ExportState } from './ExportState';
10
8
  import { FlashingCellState } from './FlashingCellState';
11
9
  import { FormatColumnState } from './FormatColumnState';
@@ -47,18 +45,10 @@ export interface PredefinedConfig {
47
45
  * Large series of properties to give users full control over the look and feel of the *Dashboard* - the section above the grid with toolbars and buttons
48
46
  */
49
47
  Dashboard?: DashboardState;
50
- /**
51
- * Supplies a collection of *DataSource* objects to facilitate replacing the DataSource in the Grid with an alternate set of data (e.g. a Book or Stored Proc name)
52
- */
53
- DataSource?: DataSourceState;
54
48
  /**
55
49
  * Supplies a collection of *Report* objects, together with name of the Current Report, as part of AdapTable export Module
56
50
  */
57
51
  Export?: ExportState;
58
- /**
59
- * Stores Filters in AdapTable - both System and Column (predicate) Filters
60
- */
61
- Filter?: FilterState;
62
52
  /***
63
53
  * Objects which define which cells flash in response to data changes
64
54
  */
@@ -16,8 +16,7 @@ export interface StatusBarState extends ConfigState {
16
16
  export declare const ADAPTABLE_STATUS_PANEL = "AdaptableStatusPanel";
17
17
  export interface AdaptableStatusBar {
18
18
  /**
19
- * Key of status panel defined in AG Grid gridConfig - make sure that keys are the same
20
- * Note: AG Grid statusPanel has a lowercase 'key'
19
+ * Key of status panel defined in AG Grid GridOptions - ensure keys are the same (Note: AG Grid statusPanel has a lowercase 'key')
21
20
  */
22
21
  Key: string;
23
22
  /**
@@ -1,7 +1,7 @@
1
1
  import { PreviewInfo } from '../Utilities/Interface/Preview';
2
2
  import { InternalState } from './InternalState';
3
3
  import { BulkUpdateValidationResult } from '../Strategy/Interface/IBulkUpdateModule';
4
- import { CellDataChangedInfo, GridCell } from '../types';
4
+ import { CellDataChangedInfo, GridCell, SmartEditOperation } from '../types';
5
5
  import type { IPushPullState, IPushPullReport, IPushPullDomain } from './IPushPullState';
6
6
  import { Glue42State, Glue42Report } from './Glue42State';
7
7
  import { OpenFinState, OpenFinReport } from './OpenFinState';
@@ -13,7 +13,6 @@ import { CachedQuery } from './QueryState';
13
13
  import { AdaptableFlashingCell } from './Common/AdaptableFlashingCell';
14
14
  import { TypeUuid } from './Uuid';
15
15
  import { SummaryOperation } from './Common/Enums';
16
- import { SmartEditOperation } from '../AdaptableOptions/SmartEdit';
17
16
  export type { IPushPullReport, IPushPullDomain };
18
17
  export type { Glue42Report };
19
18
  export type { OpenFinReport };
@@ -69,6 +68,9 @@ export interface SystemState extends InternalState, IPushPullState, Glue42State,
69
68
  };
70
69
  };
71
70
  ShowLayoutNotAssociatedObjects: boolean;
71
+ DashboardRevision: number;
72
+ IsQuickFilterVisible: boolean;
73
+ CurrentDataSet: string;
72
74
  }
73
75
  export interface ProgressIndicator {
74
76
  active: boolean;
@@ -1,5 +1,7 @@
1
1
  import * as Redux from 'redux';
2
+ import { AdaptableState } from '../../../types';
2
3
  import { LayoutState, Layout } from '../../PredefinedConfig/LayoutState';
4
+ import { ColumnFilter } from '../../types';
3
5
  /**
4
6
  * @ReduxAction A Layout has been added
5
7
  */
@@ -20,6 +22,45 @@ export declare const LAYOUT_SELECT = "LAYOUT_SELECT";
20
22
  * @ReduxAction A Layout has been (auto)saved
21
23
  */
22
24
  export declare const LAYOUT_SAVE = "LAYOUT_SAVE";
25
+ export declare const LAYOUT_REMOVE_COLUMN = "LAYOUT_REMOVE_COLUMN";
26
+ /**
27
+ * @ReduxAction A Column Filter has been added
28
+ */
29
+ export declare const LAYOUT_COLUMN_FILTER_ADD = "LAYOUT_COLUMN_FILTER_ADD";
30
+ /**
31
+ * @ReduxAction A Column Filter has been edited
32
+ */
33
+ export declare const LAYOUT_COLUMN_FILTER_EDIT = "LAYOUT_COLUMN_FILTER_EDIT";
34
+ /**
35
+ * @ReduxAction Column Filters have been set
36
+ */
37
+ export declare const LAYOUT_COLUMN_FILTER_SET = "LAYOUT_COLUMN_FILTER_SET";
38
+ /**
39
+ * @ReduxAction All Column Filters have been cleared
40
+ */
41
+ export declare const LAYOUT_COLUMN_FILTER_CLEAR_ALL = "LAYOUT_COLUMN_FILTER_CLEAR_ALL";
42
+ /**
43
+ * @ReduxAction A Column Filter has been cleared
44
+ */
45
+ export declare const LAYOUT_COLUMN_FILTER_CLEAR = "LAYOUT_COLUMN_FILTER_CLEAR";
46
+ export interface LayoutColumnFilterAction extends Redux.Action {
47
+ columnFilter: ColumnFilter;
48
+ }
49
+ export interface LayoutColumnFilterAddAction extends LayoutColumnFilterAction {
50
+ }
51
+ export interface LayoutColumnFilterEditAction extends LayoutColumnFilterAction {
52
+ }
53
+ export interface LayoutFilterSetAction extends LayoutColumnFilterAction {
54
+ }
55
+ export interface LayoutFilterClearAction extends LayoutColumnFilterAction {
56
+ }
57
+ export interface LayoutFilterClearAllAction extends Redux.Action {
58
+ }
59
+ export declare const LayoutColumnFilterAdd: (columnFilter: ColumnFilter) => LayoutColumnFilterAddAction;
60
+ export declare const LayoutColumnFilterEdit: (columnFilter: ColumnFilter) => LayoutColumnFilterEditAction;
61
+ export declare const LayoutColumnFilterSet: (columnFilter: ColumnFilter) => LayoutFilterSetAction;
62
+ export declare const LayoutColumnFilterClearAll: () => LayoutFilterClearAllAction;
63
+ export declare const LayoutColumnFilterClear: (columnFilter: ColumnFilter) => LayoutFilterClearAction;
23
64
  /**
24
65
  * @ReduxAction A new caption / header has been set for a Column in the Layout
25
66
  */
@@ -45,6 +86,10 @@ export interface LayoutSetColumnCaptionAction extends Redux.Action {
45
86
  columnId: string;
46
87
  caption: string;
47
88
  }
89
+ export interface LayoutRemoveColumnAction extends Redux.Action {
90
+ layoutName: string;
91
+ columnId: string;
92
+ }
48
93
  export interface LayoutUpdateCurrentDraftAction extends LayoutAction {
49
94
  }
50
95
  export interface LayoutSelectAction extends Redux.Action {
@@ -61,7 +106,9 @@ export declare const LayoutAdd: (layout: Layout) => LayoutAddAction;
61
106
  export declare const LayoutDelete: (layout: Layout) => LayoutDeleteAction;
62
107
  export declare const LayoutSave: (layout: Layout) => LayoutSaveAction;
63
108
  export declare const LayoutSetColumnCaption: (layoutName: string, columnId: string, caption: string) => LayoutSetColumnCaptionAction;
109
+ export declare const LayouRemoveColumn: (layoutName: string, columnId: string) => LayoutRemoveColumnAction;
64
110
  export declare const LayoutSelect: (layoutName: string) => LayoutSelectAction;
65
111
  export declare const LayoutUpdateCurrentDraft: (layout: Layout) => LayoutUpdateCurrentDraftAction;
66
112
  export declare const LayoutReady: (layoutState: LayoutState) => LayoutReadyAction;
113
+ export declare const getColumnFilterSelector: (state: AdaptableState) => ColumnFilter[];
67
114
  export declare const LayoutReducer: Redux.Reducer<LayoutState>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutReducer = exports.LayoutReady = exports.LayoutUpdateCurrentDraft = exports.LayoutSelect = exports.LayoutSetColumnCaption = exports.LayoutSave = exports.LayoutDelete = exports.LayoutAdd = exports.LAYOUT_READY = exports.LAYOUT_UPDATE_CURRENT_DRAFT = exports.LAYOUT_SET_COLUMN_CAPTION = exports.LAYOUT_SAVE = exports.LAYOUT_SELECT = exports.LAYOUT_DELETE = exports.LAYOUT_EDIT = exports.LAYOUT_ADD = void 0;
3
+ exports.LayoutReducer = exports.getColumnFilterSelector = exports.LayoutReady = exports.LayoutUpdateCurrentDraft = exports.LayoutSelect = exports.LayouRemoveColumn = exports.LayoutSetColumnCaption = exports.LayoutSave = exports.LayoutDelete = exports.LayoutAdd = exports.LAYOUT_READY = exports.LAYOUT_UPDATE_CURRENT_DRAFT = exports.LAYOUT_SET_COLUMN_CAPTION = exports.LayoutColumnFilterClear = exports.LayoutColumnFilterClearAll = exports.LayoutColumnFilterSet = exports.LayoutColumnFilterEdit = exports.LayoutColumnFilterAdd = exports.LAYOUT_COLUMN_FILTER_CLEAR = exports.LAYOUT_COLUMN_FILTER_CLEAR_ALL = exports.LAYOUT_COLUMN_FILTER_SET = exports.LAYOUT_COLUMN_FILTER_EDIT = exports.LAYOUT_COLUMN_FILTER_ADD = exports.LAYOUT_REMOVE_COLUMN = exports.LAYOUT_SAVE = exports.LAYOUT_SELECT = exports.LAYOUT_DELETE = exports.LAYOUT_EDIT = exports.LAYOUT_ADD = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
6
6
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
@@ -24,6 +24,47 @@ exports.LAYOUT_SELECT = 'LAYOUT_SELECT';
24
24
  * @ReduxAction A Layout has been (auto)saved
25
25
  */
26
26
  exports.LAYOUT_SAVE = 'LAYOUT_SAVE';
27
+ exports.LAYOUT_REMOVE_COLUMN = 'LAYOUT_REMOVE_COLUMN';
28
+ /**
29
+ * @ReduxAction A Column Filter has been added
30
+ */
31
+ exports.LAYOUT_COLUMN_FILTER_ADD = 'LAYOUT_COLUMN_FILTER_ADD';
32
+ /**
33
+ * @ReduxAction A Column Filter has been edited
34
+ */
35
+ exports.LAYOUT_COLUMN_FILTER_EDIT = 'LAYOUT_COLUMN_FILTER_EDIT';
36
+ /**
37
+ * @ReduxAction Column Filters have been set
38
+ */
39
+ exports.LAYOUT_COLUMN_FILTER_SET = 'LAYOUT_COLUMN_FILTER_SET';
40
+ /**
41
+ * @ReduxAction All Column Filters have been cleared
42
+ */
43
+ exports.LAYOUT_COLUMN_FILTER_CLEAR_ALL = 'LAYOUT_COLUMN_FILTER_CLEAR_ALL';
44
+ /**
45
+ * @ReduxAction A Column Filter has been cleared
46
+ */
47
+ exports.LAYOUT_COLUMN_FILTER_CLEAR = 'LAYOUT_COLUMN_FILTER_CLEAR';
48
+ // Column Filter Methods
49
+ exports.LayoutColumnFilterAdd = (columnFilter) => ({
50
+ type: exports.LAYOUT_COLUMN_FILTER_ADD,
51
+ columnFilter,
52
+ });
53
+ exports.LayoutColumnFilterEdit = (columnFilter) => ({
54
+ type: exports.LAYOUT_COLUMN_FILTER_EDIT,
55
+ columnFilter,
56
+ });
57
+ exports.LayoutColumnFilterSet = (columnFilter) => ({
58
+ type: exports.LAYOUT_COLUMN_FILTER_SET,
59
+ columnFilter,
60
+ });
61
+ exports.LayoutColumnFilterClearAll = () => ({
62
+ type: exports.LAYOUT_COLUMN_FILTER_CLEAR_ALL,
63
+ });
64
+ exports.LayoutColumnFilterClear = (columnFilter) => ({
65
+ type: exports.LAYOUT_COLUMN_FILTER_CLEAR,
66
+ columnFilter,
67
+ });
27
68
  /**
28
69
  * @ReduxAction A new caption / header has been set for a Column in the Layout
29
70
  */
@@ -51,6 +92,11 @@ exports.LayoutSetColumnCaption = (layoutName, columnId, caption) => ({
51
92
  columnId,
52
93
  caption,
53
94
  });
95
+ exports.LayouRemoveColumn = (layoutName, columnId) => ({
96
+ type: exports.LAYOUT_REMOVE_COLUMN,
97
+ layoutName,
98
+ columnId,
99
+ });
54
100
  exports.LayoutSelect = (layoutName) => ({
55
101
  type: exports.LAYOUT_SELECT,
56
102
  layoutName,
@@ -63,12 +109,19 @@ exports.LayoutReady = (layoutState) => ({
63
109
  type: exports.LAYOUT_READY,
64
110
  layoutState,
65
111
  });
112
+ exports.getColumnFilterSelector = (state) => {
113
+ var _a, _b, _c, _d;
114
+ const currentLayout = (_c = (_b = (_a = state.Layout) === null || _a === void 0 ? void 0 : _a.Layouts) === null || _b === void 0 ? void 0 : _b.find) === null || _c === void 0 ? void 0 : _c.call(_b, (layout) => layout.Name === state.Layout.CurrentLayout);
115
+ return (_d = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.ColumnFilters) !== null && _d !== void 0 ? _d : [];
116
+ };
66
117
  const initialState = {
67
118
  CurrentLayout: GeneralConstants_1.EMPTY_STRING,
68
119
  Layouts: GeneralConstants_1.EMPTY_ARRAY,
69
120
  };
70
121
  exports.LayoutReducer = (state = initialState, action) => {
122
+ var _a, _b, _c, _d;
71
123
  let layouts;
124
+ const currentLayout = state.Layouts.find((layout) => layout.Name === state.CurrentLayout);
72
125
  switch (action.type) {
73
126
  case exports.LAYOUT_SELECT: {
74
127
  const newCurrentLayout = action.layoutName;
@@ -106,6 +159,87 @@ exports.LayoutReducer = (state = initialState, action) => {
106
159
  }
107
160
  return state;
108
161
  }
162
+ case exports.LAYOUT_REMOVE_COLUMN: {
163
+ const removeColumnAction = action;
164
+ const layoutname = removeColumnAction.layoutName;
165
+ const colToRemove = removeColumnAction.columnId;
166
+ let layoutToUpdate = state.Layouts.find((l) => l.Name === layoutname);
167
+ if (layoutToUpdate) {
168
+ layoutToUpdate.Columns = layoutToUpdate.Columns.filter((col) => {
169
+ return col !== colToRemove;
170
+ });
171
+ console.log('updating', layoutToUpdate);
172
+ return Object.assign(Object.assign({}, state), { Layouts: state.Layouts.map((abObject) => abObject.Uuid === layoutToUpdate.Uuid ? layoutToUpdate : abObject) });
173
+ }
174
+ return state;
175
+ }
176
+ case exports.LAYOUT_COLUMN_FILTER_SET: {
177
+ let columnFilters = (_a = currentLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
178
+ const columnFilterAction = action.columnFilter;
179
+ AdaptableHelper_1.default.addUuidAndSource(columnFilterAction);
180
+ columnFilters = columnFilters
181
+ .filter((colFilter) => {
182
+ return colFilter.ColumnId !== columnFilterAction.ColumnId;
183
+ })
184
+ .concat(columnFilterAction);
185
+ const Layouts = state.Layouts.map((layout) => {
186
+ if (layout.Name === currentLayout.Name) {
187
+ return Object.assign(Object.assign({}, layout), { ColumnFilters: columnFilters });
188
+ }
189
+ return layout;
190
+ });
191
+ return Object.assign(Object.assign({}, state), { Layouts });
192
+ }
193
+ case exports.LAYOUT_COLUMN_FILTER_ADD: {
194
+ let columnFilters = [...((_b = currentLayout.ColumnFilters) !== null && _b !== void 0 ? _b : [])];
195
+ const columnFilterAction = action.columnFilter;
196
+ AdaptableHelper_1.default.addUuidAndSource(columnFilterAction);
197
+ columnFilters.push(columnFilterAction);
198
+ const Layouts = state.Layouts.map((layout) => {
199
+ if (layout.Name === currentLayout.Name) {
200
+ return Object.assign(Object.assign({}, layout), { ColumnFilters: columnFilters });
201
+ }
202
+ return layout;
203
+ });
204
+ return Object.assign(Object.assign({}, state), { Layouts });
205
+ }
206
+ case exports.LAYOUT_COLUMN_FILTER_EDIT: {
207
+ const columnFilterAction = action.columnFilter;
208
+ let columnFilters = ((_c = currentLayout.ColumnFilters) !== null && _c !== void 0 ? _c : []).map((abObject) => abObject.Uuid === columnFilterAction.Uuid ? columnFilterAction : abObject);
209
+ const Layouts = state.Layouts.map((layout) => {
210
+ if (layout.Name === currentLayout.Name) {
211
+ return Object.assign(Object.assign({}, layout), { ColumnFilters: columnFilters });
212
+ }
213
+ return layout;
214
+ });
215
+ return Object.assign(Object.assign({}, state), { Layouts });
216
+ }
217
+ case exports.LAYOUT_COLUMN_FILTER_CLEAR_ALL: {
218
+ const Layouts = state.Layouts.map((layout) => {
219
+ if (layout.Name === currentLayout.Name) {
220
+ return Object.assign(Object.assign({}, layout), { ColumnFilters: [] });
221
+ }
222
+ return layout;
223
+ });
224
+ return Object.assign(Object.assign({}, state), { Layouts });
225
+ }
226
+ case exports.LAYOUT_COLUMN_FILTER_CLEAR: {
227
+ let columnFilters = [...((_d = currentLayout.ColumnFilters) !== null && _d !== void 0 ? _d : [])];
228
+ const actionTypedDelete = action;
229
+ const index = actionTypedDelete.columnFilter
230
+ ? columnFilters.findIndex((i) => i.Uuid == actionTypedDelete.columnFilter.Uuid)
231
+ : -1;
232
+ if (index != -1) {
233
+ columnFilters.splice(index, 1);
234
+ }
235
+ const Layouts = state.Layouts.map((layout) => {
236
+ if (layout.Name === currentLayout.Name) {
237
+ return Object.assign(Object.assign({}, layout), { ColumnFilters: columnFilters });
238
+ }
239
+ return layout;
240
+ });
241
+ return Object.assign(Object.assign({}, state), { Layouts });
242
+ }
109
243
  default:
110
244
  return state;
111
245
  }