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

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 (149) hide show
  1. package/base.css +561 -283
  2. package/bundle.cjs.js +162 -148
  3. package/index.css +631 -280
  4. package/package.json +3 -3
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -0
  8. package/src/AdaptableOptions/AlertOptions.d.ts +5 -9
  9. package/src/AdaptableOptions/DashboardOptions.d.ts +1 -5
  10. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
  11. package/src/AdaptableOptions/EditOptions.d.ts +26 -8
  12. package/src/AdaptableOptions/ExportOptions.d.ts +4 -7
  13. package/src/AdaptableOptions/GeneralOptions.d.ts +12 -2
  14. package/src/AdaptableOptions/ToolPanelOptions.d.ts +1 -5
  15. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +21 -3
  16. package/src/Api/AlertApi.d.ts +3 -3
  17. package/src/Api/ColumnApi.d.ts +7 -2
  18. package/src/Api/EventApi.d.ts +11 -0
  19. package/src/Api/Events/RowFormSubmitted.d.ts +15 -0
  20. package/src/Api/Events/SearchChanged.d.ts +1 -1
  21. package/src/Api/ExportApi.d.ts +2 -2
  22. package/src/Api/FilterApi.d.ts +69 -1
  23. package/src/Api/Implementation/AlertApiImpl.d.ts +3 -3
  24. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  25. package/src/Api/Implementation/ColumnApiImpl.js +15 -14
  26. package/src/Api/Implementation/ConfigApiImpl.js +1 -1
  27. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
  28. package/src/Api/Implementation/FilterApiImpl.d.ts +16 -1
  29. package/src/Api/Implementation/FilterApiImpl.js +141 -0
  30. package/src/Api/Implementation/FormatColumnApiImpl.js +2 -2
  31. package/src/Api/Implementation/GridApiImpl.js +7 -3
  32. package/src/Api/Implementation/InternalApiImpl.d.ts +3 -3
  33. package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -15
  34. package/src/Api/Implementation/LayoutApiImpl.js +0 -152
  35. package/src/Api/Implementation/PredicateApiImpl.d.ts +2 -0
  36. package/src/Api/Implementation/PredicateApiImpl.js +18 -0
  37. package/src/Api/LayoutApi.d.ts +1 -72
  38. package/src/Api/PredicateApi.d.ts +7 -0
  39. package/src/PredefinedConfig/AlertState.d.ts +4 -4
  40. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
  41. package/src/PredefinedConfig/Common/FormContext.d.ts +11 -0
  42. package/src/PredefinedConfig/Common/FormContext.js +2 -0
  43. package/src/Redux/ActionsReducers/LayoutRedux.js +0 -1
  44. package/src/Redux/ActionsReducers/PopupRedux.d.ts +3 -2
  45. package/src/Redux/Store/AdaptableStore.js +6 -0
  46. package/src/Strategy/AdaptableModuleBase.js +1 -2
  47. package/src/Strategy/BulkUpdateModule.js +3 -4
  48. package/src/Strategy/CellSummaryModule.js +1 -2
  49. package/src/Strategy/FilterModule.js +15 -18
  50. package/src/Strategy/LayoutModule.js +1 -0
  51. package/src/Strategy/PlusMinusModule.js +1 -4
  52. package/src/Strategy/SmartEditModule.js +2 -2
  53. package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
  54. package/src/Utilities/Constants/GeneralConstants.js +3 -1
  55. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
  56. package/src/Utilities/Services/CalculatedColumnExpressionService.js +6 -7
  57. package/src/Utilities/Services/RowEditService.d.ts +1 -0
  58. package/src/Utilities/Services/RowEditService.js +34 -2
  59. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +8 -3
  60. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +3 -2
  61. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +9 -2
  62. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +30 -0
  63. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +87 -0
  64. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +18 -0
  65. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +16 -0
  66. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +2 -9
  67. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +2 -75
  68. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +3 -1
  69. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +9 -4
  70. package/src/View/AdaptableWizardView/Utils.d.ts +1 -0
  71. package/src/View/AdaptableWizardView/Utils.js +24 -0
  72. package/src/View/AdaptableWizardView/Wizard.d.ts +54 -0
  73. package/src/View/AdaptableWizardView/Wizard.js +98 -0
  74. package/src/View/AdaptableWizardView/index.d.ts +1 -22
  75. package/src/View/AdaptableWizardView/index.js +2 -103
  76. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
  77. package/src/View/Alert/Wizard/AlertButtonsEditor.d.ts +3 -3
  78. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -2
  79. package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -1
  80. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +2 -2
  81. package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -3
  82. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +3 -4
  83. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +5 -6
  84. package/src/View/CellSummary/CellSummaryDetails.js +2 -2
  85. package/src/View/Components/FilterForm/FilterForm.js +1 -1
  86. package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
  87. package/src/View/Components/PreviewResultsPanel.js +3 -3
  88. package/src/View/Components/WizardSummaryPage.js +2 -2
  89. package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +1 -1
  90. package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +1 -1
  91. package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
  92. package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +1 -1
  93. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +2 -2
  94. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +1 -1
  95. package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +2 -2
  96. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
  97. package/src/View/Export/Wizard/ReportNameWizardSection.js +1 -1
  98. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  99. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  100. package/src/View/Filter/FilterSummary.js +1 -1
  101. package/src/View/Filter/FilterViewPanel.js +2 -2
  102. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +2 -2
  103. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -1
  104. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +1 -1
  105. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -1
  106. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  107. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
  108. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  109. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
  110. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +5 -6
  111. package/src/View/GridInfo/ColumnInfoComponent.js +1 -1
  112. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  113. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +2 -2
  114. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +1 -1
  115. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +2 -2
  116. package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  117. package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
  118. package/src/View/Schedule/Wizard/ScheduleScheduleSummary.js +1 -1
  119. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
  120. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +1 -1
  121. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
  122. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +1 -1
  123. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +2 -2
  124. package/src/View/UIHelper.js +6 -6
  125. package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -2
  126. package/src/View/Wizard/ObjectTagsWizardSection.js +1 -1
  127. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +5 -6
  128. package/src/View/Wizard/OnePageAdaptableWizard.js +35 -169
  129. package/src/View/Wizard/OnePageWizards.d.ts +37 -0
  130. package/src/View/Wizard/OnePageWizards.js +187 -0
  131. package/src/View/Wizard/useKeyboardNavigation.d.ts +1 -1
  132. package/src/agGrid/Adaptable.js +25 -11
  133. package/src/agGrid/FilterWrapper.js +2 -2
  134. package/src/agGrid/agGridHelper.d.ts +2 -3
  135. package/src/agGrid/agGridHelper.js +37 -33
  136. package/src/agGrid/rowEditIcons.d.ts +1 -0
  137. package/src/agGrid/rowEditIcons.js +2 -1
  138. package/src/components/Datepicker/Caption.js +1 -1
  139. package/src/components/InfiniteTable/index.js +1 -0
  140. package/src/components/List/GridList/index.js +1 -1
  141. package/src/components/WindowModal/WindowModal.js +13 -7
  142. package/src/components/icons/add-row.d.ts +3 -0
  143. package/src/components/icons/add-row.js +7 -0
  144. package/src/components/icons/index.js +2 -0
  145. package/src/metamodel/adaptable.metamodel.d.ts +106 -22
  146. package/src/metamodel/adaptable.metamodel.js +238 -121
  147. package/src/types.d.ts +5 -4
  148. package/version.d.ts +1 -1
  149. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "12.0.0-canary.0",
3
+ "version": "12.0.0-canary.3",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -31,7 +31,7 @@
31
31
  "main": "agGrid.js",
32
32
  "typings": "types.d.ts",
33
33
  "dependencies": {
34
- "@infinite-table/infinite-react": "0.0.1-canary.11",
34
+ "@infinite-table/infinite-react": "0.3.10",
35
35
  "date-fns": "2.22.1",
36
36
  "debug": "^4.3.1",
37
37
  "isomorphic-fetch": "^2.2.1",
@@ -41,7 +41,7 @@
41
41
  "re-resizable": "^6.9.1",
42
42
  "react": "^16.8.0 || ^17.0.0",
43
43
  "react-beautiful-dnd": "13.1.0",
44
- "react-day-picker": "8.0.0-beta.38",
44
+ "react-day-picker": "8.0.6",
45
45
  "react-dom": "^16.8.0 || ^17.0.0",
46
46
  "react-redux": "7.2.4",
47
47
  "react-remove-scroll": "2.4.2",
@@ -1,2 +1,2 @@
1
- declare const _default: 1654532122066;
1
+ declare const _default: 1654758749447;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1654532122066;
3
+ exports.default = 1654758749447;
@@ -16,6 +16,7 @@ export interface AdaptableNoCodeWizardOptions {
16
16
  helpText?: React.ReactNode;
17
17
  fileContentsToJSON?: (str: string) => Promise<any> | any;
18
18
  readFile?: (file: File) => Promise<any>;
19
+ skipToWizard?: boolean;
19
20
  loadingMessage?: React.ReactNode;
20
21
  prepareData?: (data: any, file?: File) => {
21
22
  columns: string[];
@@ -1,7 +1,7 @@
1
- import { BaseContext } from '../../types';
1
+ import { FormContext } from '../../types';
2
2
  import { AlertButton, AlertDefinition } from '../PredefinedConfig/AlertState';
3
3
  import { AdaptableAlert } from '../PredefinedConfig/Common/AdaptableAlert';
4
- import { AdaptableForm, AdaptableFormData } from '../PredefinedConfig/Common/AdaptableForm';
4
+ import { AdaptableForm } from '../PredefinedConfig/Common/AdaptableForm';
5
5
  import { CellDataChangedInfo } from '../types';
6
6
  /**
7
7
  * Options related to Alerts in Adaptable.
@@ -65,7 +65,7 @@ export declare type ActionHandler = {
65
65
  /**
66
66
  * Handler function to call when the Button is clicked
67
67
  */
68
- handler: (button: AlertButton<AlertButtonContext>, context: AlertButtonContext) => void;
68
+ handler: (button: AlertButton<AlertFormContext>, context: AlertFormContext) => void;
69
69
  };
70
70
  /**
71
71
  * Form to show in an Alert
@@ -78,20 +78,16 @@ export declare type AlertForm = {
78
78
  /**
79
79
  * The Form to display in the Alert
80
80
  */
81
- form: AdaptableForm<AlertButtonContext>;
81
+ form: AdaptableForm<AlertFormContext>;
82
82
  };
83
83
  /**
84
84
  * Context required by functions when using an Alert Button
85
85
  */
86
- export interface AlertButtonContext extends BaseContext {
86
+ export interface AlertFormContext extends FormContext {
87
87
  /**
88
88
  * Alert that has been triggered
89
89
  */
90
90
  alert: AdaptableAlert;
91
- /**
92
- * Data in the Alert Form
93
- */
94
- formData?: AdaptableFormData;
95
91
  }
96
92
  /**
97
93
  * Context used for creating bespoke Alert messages
@@ -80,13 +80,9 @@ export interface DashboardButtonContext extends BaseContext {
80
80
  /**
81
81
  * Context required by functions when using a Custom Toolbar Button
82
82
  */
83
- export interface CustomToolbarButtonContext extends BaseContext {
83
+ export interface CustomToolbarButtonContext extends DashboardButtonContext {
84
84
  /**
85
85
  * Custom Toolbar which hosts the Button
86
86
  */
87
87
  customToolbar: CustomToolbar;
88
- /**
89
- * Current Dashboard State
90
- */
91
- dashboardState: DashboardState;
92
88
  }
@@ -1,7 +1,7 @@
1
1
  import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
2
- import { ActionColumnButtonContext, AdaptableButton } from '../types';
2
+ import { ActionColumnContext, AdaptableButton } from '../types';
3
3
  export declare type AdaptableDataChangeHistoryAction = 'undo';
4
- export interface DataChangeHistoryContext extends ActionColumnButtonContext {
4
+ export interface DataChangeHistoryContext extends ActionColumnContext {
5
5
  /**
6
6
  * Helper function to undo the change.
7
7
  */
@@ -1,12 +1,11 @@
1
1
  import { RowNode } from '@ag-grid-community/all-modules';
2
- import { AdaptableButton, AdaptableColumn, AdaptableFormData, BaseContext, RowFormSubmittedInfo, RowFormType } from '../../types';
2
+ import { AdaptableButton, AdaptableColumn, BaseContext, RowFormSubmittedInfo, RowFormType } from '../../types';
3
+ import { FormContext } from '../PredefinedConfig/Common/FormContext';
3
4
  import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
4
5
  import { MathOperation } from '../PredefinedConfig/Common/Enums';
5
6
  import { GridCell } from '../PredefinedConfig/Selection/GridCell';
6
7
  /**
7
- * Options related to Editing in Adaptable.
8
- *
9
- * Allows users to provide Adaptable with Server Validation that works in conjunction with Client (aka Cell) Validation
8
+ * Options related to Editing in Adaptable - includes Server Validation, Smart Edit Operations and Row Forms
10
9
  */
11
10
  export interface EditOptions {
12
11
  /**
@@ -107,15 +106,34 @@ export interface RowFormOptions {
107
106
  */
108
107
  onFormSubmit?: (rowFormSubmittedInfo: RowFormSubmittedInfo) => void;
109
108
  }
109
+ /**
110
+ * Context passed into a Row Form - can be `CreateRowFormContext` or `EditRowFormContext`
111
+ */
110
112
  export declare type RowFormContext = CreateRowFormContext | EditRowFormContext;
111
- export interface CreateRowFormContext extends BaseContext {
113
+ /**
114
+ * Context used in a Create Row Form
115
+ */
116
+ export interface CreateRowFormContext extends FormContext {
117
+ /**
118
+ * Type of the Context
119
+ */
112
120
  type: Extract<RowFormType, 'rowCreated'>;
113
- formData: AdaptableFormData;
121
+ /**
122
+ * The RowNode being cloned
123
+ */
114
124
  clonedRowNode?: RowNode;
115
125
  }
116
- export interface EditRowFormContext extends BaseContext {
126
+ /**
127
+ * Context used in an Edit Row Form
128
+ */
129
+ export interface EditRowFormContext extends FormContext {
130
+ /**
131
+ * Type of the Context
132
+ */
117
133
  type: Extract<RowFormType, 'rowEdited'>;
118
- formData: AdaptableFormData;
134
+ /**
135
+ * The RowNode being edited
136
+ */
119
137
  rowNode: RowNode;
120
138
  }
121
139
  export interface FormParamContext extends BaseContext {
@@ -1,4 +1,5 @@
1
- import { AdaptableForm, AdaptableFormData } from '../PredefinedConfig/Common/AdaptableForm';
1
+ import { AdaptableForm } from '../PredefinedConfig/Common/AdaptableForm';
2
+ import { FormContext } from '../PredefinedConfig/Common/FormContext';
2
3
  import { ReportData, Report, SystemReportNames } from '../PredefinedConfig/ExportState';
3
4
  import { BaseContext } from '../types';
4
5
  /**
@@ -77,7 +78,7 @@ export interface CustomDestination {
77
78
  /**
78
79
  * Optional Adaptable Form - if provided, it must include Buttons that will execute the export
79
80
  */
80
- form?: AdaptableForm<ExportButtonContext>;
81
+ form?: AdaptableForm<ExportFormContext>;
81
82
  /**
82
83
  * Function invoked when export is applied (used if no form is supplied)
83
84
  */
@@ -86,7 +87,7 @@ export interface CustomDestination {
86
87
  /**
87
88
  * Context required by functions when using an Export Button
88
89
  */
89
- export interface ExportButtonContext extends BaseContext {
90
+ export interface ExportFormContext extends FormContext {
90
91
  /**
91
92
  * The exported report
92
93
  */
@@ -99,10 +100,6 @@ export interface ExportButtonContext extends BaseContext {
99
100
  * Custom Export destination
100
101
  */
101
102
  customDestination: CustomDestination;
102
- /**
103
- * Adaptable Form Data
104
- */
105
- formData: AdaptableFormData;
106
103
  }
107
104
  export declare type SystemExportDestinations = SystemExportDestination[];
108
105
  export declare type SystemExportDestination = 'Excel' | 'CSV' | 'Clipboard' | 'JSON';
@@ -1,6 +1,7 @@
1
- import { AdaptableForm, AdaptableObject, AdaptableScope, BaseContext } from '../../types';
1
+ import { AdaptableForm, AdaptableObject, AdaptableScope } from '../../types';
2
2
  import { AdaptableComparerFunction } from '../PredefinedConfig/Common/AdaptableComparerFunction';
3
3
  import { AlternativeModuleName } from '../PredefinedConfig/Common/AlternativeModuleName';
4
+ import { FormContext } from '../PredefinedConfig/Common/FormContext';
4
5
  import { CellSummaryOperation } from '../PredefinedConfig/Common/CellSummary';
5
6
  /**
6
7
  * General options for configuring AdapTable including managing Primary Keys
@@ -88,5 +89,14 @@ export interface DataSet extends AdaptableObject {
88
89
  /**
89
90
  * Params for Data Set popup form
90
91
  */
91
- form?: AdaptableForm<BaseContext>;
92
+ form?: AdaptableForm<DataSetFormContext>;
93
+ }
94
+ /**
95
+ * Used when a DataSet displays a Form
96
+ */
97
+ export interface DataSetFormContext extends FormContext {
98
+ /**
99
+ * The DataSet which triggered the Form
100
+ */
101
+ dataSet: DataSet;
92
102
  }
@@ -57,13 +57,9 @@ export interface ToolPanelButtonContext extends BaseContext {
57
57
  */
58
58
  toolPanelState: ToolPanelState;
59
59
  }
60
- export interface CustomToolPanelButtonContext extends BaseContext {
60
+ export interface CustomToolPanelButtonContext extends ToolPanelButtonContext {
61
61
  /**
62
62
  *The Custom ToolPanel which contains the button
63
63
  */
64
64
  customToolPanel: CustomToolPanel;
65
- /**
66
- * Current ToolPanel State
67
- */
68
- toolPanelState: ToolPanelState;
69
65
  }
@@ -111,13 +111,31 @@ export interface ActionOptions {
111
111
  *
112
112
  * @defaultValue undefined
113
113
  */
114
- actionRowButtons?: ('clone' | 'edit' | 'delete')[];
114
+ actionRowButtons?: ('clone' | 'create' | 'edit' | 'delete')[];
115
115
  /**
116
116
  * Position of supplied Action Buttons
117
117
  *
118
118
  * @defaultValue 'pinnedLeft'
119
119
  */
120
120
  actionRowButtonsPosition?: 'pinnedLeft' | 'pinnedRight';
121
+ /**
122
+ * If set to true, the Action Row Buttons will be handled by AdapTable and the grid data model will be automatically updated with the created/edited/deleted rows
123
+ *
124
+ * @defaultValue false
125
+ */
126
+ autoHandleActionRowButtons?: boolean;
127
+ /**
128
+ * Function which is called when auto-handling the 'create' Action Row Button. The returned row value should have a valid(unique) primary key value.
129
+ *
130
+ * @defaultValue undefined
131
+ */
132
+ setPrimaryKeyValue?: (context: SetPrimaryKeyValueContext) => any;
133
+ }
134
+ /**
135
+ * The context for the SetPrimaryKeyValueContext function
136
+ */
137
+ export interface SetPrimaryKeyValueContext extends BaseContext {
138
+ rowData: any;
121
139
  }
122
140
  /**
123
141
  * A Special Column that wraps an AdapTable Button
@@ -134,7 +152,7 @@ export interface ActionColumn extends AdaptableObject {
134
152
  /**
135
153
  * Button (or list of buttons) to display in the Column
136
154
  */
137
- actionColumnButton: AdaptableButton<ActionColumnButtonContext> | AdaptableButton<ActionColumnButtonContext>[];
155
+ actionColumnButton: AdaptableButton<ActionColumnContext> | AdaptableButton<ActionColumnContext>[];
138
156
  /**
139
157
  * Shows Action Column also in grouped rows
140
158
  */
@@ -147,7 +165,7 @@ export interface ActionColumn extends AdaptableObject {
147
165
  /**
148
166
  * Context required by functions when using an Action Column Button
149
167
  */
150
- export interface ActionColumnButtonContext extends BaseContext {
168
+ export interface ActionColumnContext extends BaseContext {
151
169
  /**
152
170
  * Action Column in question
153
171
  */
@@ -4,7 +4,7 @@ import { AdaptableScope } from '../PredefinedConfig/Common/AdaptableScope';
4
4
  import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredicate';
5
5
  import { AdaptableAlert } from '../PredefinedConfig/Common/AdaptableAlert';
6
6
  import { AdaptableForm, AdaptableFormData } from '../PredefinedConfig/Common/AdaptableForm';
7
- import { AdaptableMessageType, AlertButtonContext, AlertProperties, GridDataChangedInfo } from '../types';
7
+ import { AdaptableMessageType, AlertFormContext, AlertProperties, GridDataChangedInfo } from '../types';
8
8
  /**
9
9
  * Provides run-time access to Alert function and associated State
10
10
  */
@@ -18,7 +18,7 @@ export interface AlertApi {
18
18
  * Retrieeves the Adaptable Form with the given name
19
19
  * @param name name of the Form
20
20
  */
21
- getAdaptableFormByName(name: string): AdaptableForm<AlertButtonContext> | undefined;
21
+ getAdaptableFormByName(name: string): AdaptableForm<AlertFormContext> | undefined;
22
22
  /**
23
23
  *
24
24
  * Retrieves all Alert Definitions in Alert State
@@ -89,7 +89,7 @@ export interface AlertApi {
89
89
  /**
90
90
  * Runs after a button in an Alert Form is clicked
91
91
  */
92
- executeAlertButton(button: AlertButton<AlertButtonContext>, context: AlertButtonContext): void;
92
+ executeAlertButton(button: AlertButton<AlertFormContext>, context: AlertFormContext): void;
93
93
  /**
94
94
  * Runs after an Alert Action is invoked
95
95
  * @param actionName Action which has been invoked
@@ -1,5 +1,4 @@
1
1
  import { AdaptableColumn, AdaptableColumnDataType } from '../PredefinedConfig/Common/AdaptableColumn';
2
- import { DataType } from '../PredefinedConfig/Common/Enums';
3
2
  import { Column, RowNode } from '@ag-grid-community/all-modules';
4
3
  import { GridCell } from '../../types';
5
4
  /**
@@ -59,7 +58,7 @@ export interface ColumnApi {
59
58
  * Returns all Columns that have given DataType
60
59
  * @param dataType the DataType of the Columns to retrieve
61
60
  */
62
- getColumnsOfType(dataType: DataType): AdaptableColumn[];
61
+ getColumnsOfType(dataType: AdaptableColumnDataType): AdaptableColumn[];
63
62
  /**
64
63
  * Selects (highlights) a Column
65
64
  * @param columnId Column to select
@@ -294,4 +293,10 @@ export interface ColumnApi {
294
293
  * @param expression Expression to Lookup
295
294
  */
296
295
  isColumnReferencedInExpression(columnId: string, expression: string): boolean;
296
+ /**
297
+ * Checks if a column is a ActionRowButton column (see UserInterfaceOptions.ActionOptions)
298
+ *
299
+ * @param columnId Column to Check
300
+ */
301
+ isActionRowButtonColumn(columnId: string): boolean;
297
302
  }
@@ -195,7 +195,18 @@ export interface EventApi {
195
195
  * Unsubscribe from LiveDataChanged
196
196
  */
197
197
  off(eventName: 'LiveDataChanged', callback: (liveDataChangedInfo: LiveDataChangedInfo) => void): void;
198
+ /**
199
+ * Event fired when a Row Form is submitted
200
+ *
201
+ * @param eventName RowFormSubmitted
202
+ * @param callback RowFormSubmittedInfo
203
+ */
198
204
  on(eventName: 'RowFormSubmitted', callback: (rowEditedFormInfo: RowFormSubmittedInfo) => void): () => void;
205
+ /**
206
+ * Unsubscribe from RowFormSubmitted
207
+ * @param eventName RowFormSubmitted
208
+ * @param callback
209
+ */
199
210
  off(eventName: 'RowFormSubmitted', callback: (rowEditedFormInfo: RowFormSubmittedInfo) => void): void;
200
211
  /**
201
212
  * Event fired when a DataSet is changed
@@ -1,18 +1,33 @@
1
1
  import { BaseEventInfo } from './BaseEventInfo';
2
2
  import { AdaptableFormData } from '../../PredefinedConfig/Common/AdaptableForm';
3
3
  import { RowNode } from '@ag-grid-community/all-modules';
4
+ /**
5
+ * Info passed into RowFormSubmitted Event - can be `CreatedRowFormInfo` or `EditedRowFormInfo` or `DeletedRowFormInfo`
6
+ */
4
7
  export declare type RowFormSubmittedInfo = CreatedRowFormInfo | EditedRowFormInfo | DeletedRowFormInfo;
8
+ /**
9
+ * Type of Row Form - Created, Edited or Deleted
10
+ */
5
11
  export declare type RowFormType = 'rowCreated' | 'rowEdited' | 'rowDeleted';
12
+ /**
13
+ * Info passed into RowFormSubmitted Event for Created Rows
14
+ */
6
15
  export interface CreatedRowFormInfo extends BaseEventInfo {
7
16
  type: 'rowCreated';
8
17
  formData: AdaptableFormData;
9
18
  clonedRowNode?: RowNode;
10
19
  }
20
+ /**
21
+ * Info passed into RowFormSubmitted Event for Edited Rows
22
+ */
11
23
  export interface EditedRowFormInfo extends BaseEventInfo {
12
24
  type: 'rowEdited';
13
25
  formData: AdaptableFormData;
14
26
  rowNode: RowNode;
15
27
  }
28
+ /**
29
+ * Info passed into RowFormSubmitted Event for Deleted Rows
30
+ */
16
31
  export interface DeletedRowFormInfo extends BaseEventInfo {
17
32
  type: 'rowDeleted';
18
33
  rowNode: RowNode;
@@ -24,7 +24,7 @@ export interface SearchChangedInfo extends BaseEventInfo {
24
24
  */
25
25
  export interface AdaptableSearchState {
26
26
  /**
27
- * Current Data Source (if one selected)
27
+ * Current DataSet (if one selected)
28
28
  */
29
29
  dataSet: DataSet | undefined;
30
30
  /**
@@ -1,7 +1,7 @@
1
1
  import { AdaptableForm } from '../PredefinedConfig/Common/AdaptableForm';
2
2
  import { ExportState, Report, ReportData, ReportSchedule, SystemReportNames } from '../PredefinedConfig/ExportState';
3
3
  import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
4
- import { CustomDestination, ExportButtonContext } from '../AdaptableOptions/ExportOptions';
4
+ import { CustomDestination, ExportFormContext } from '../AdaptableOptions/ExportOptions';
5
5
  import { ExportDestination } from '../PredefinedConfig/Common/Enums';
6
6
  /**
7
7
  * Provides run-time access to the Export Module and Report state
@@ -122,7 +122,7 @@ export interface ExportApi {
122
122
  * Form Data entered by the User in the UI for a Custom Destination
123
123
  * @param destination Custom Destination for which to get Form Def
124
124
  */
125
- getExportDestinationForm(destinationName: string): AdaptableForm<ExportButtonContext> | undefined;
125
+ getExportDestinationForm(destinationName: string): AdaptableForm<ExportFormContext> | undefined;
126
126
  /**
127
127
  * Whether given data change affects given report
128
128
  * @param cellDataChangedInfo data change to check
@@ -1,5 +1,6 @@
1
- import { AdaptableColumn, SystemFilterPredicateIds } from '../types';
1
+ import { AdaptableColumn, ColumnFilter, GridCell, SystemFilterPredicateIds } from '../types';
2
2
  import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredicate';
3
+ import { RowNode } from '@ag-grid-community/all-modules';
3
4
  /**
4
5
  * Provides run-time access to Filter section of Adaptable State.
5
6
  */
@@ -40,4 +41,71 @@ export interface FilterApi {
40
41
  * Whether Quick Filter Form is currently visible
41
42
  */
42
43
  isQuickFilterVisible(): boolean;
44
+ /**
45
+ * Retrieves all the Column Filters in the Column Filter State (of Predefined Config)
46
+ * @returns column filters
47
+ */
48
+ getColumnFilters(): ColumnFilter[];
49
+ /**
50
+ * Sets Column Filters - will replace filters for existing column and leave other column filters in place
51
+ * @param columnFilters Column Filters to set
52
+ * @returns column filters
53
+ */
54
+ setColumnFilter(columnFilters: ColumnFilter[]): ColumnFilter[] | null;
55
+ /**
56
+ * Clears given Column Filter
57
+ * @param columnFilter Column Filter to clear
58
+ */
59
+ clearColumnFilter(columnFilter: ColumnFilter): void;
60
+ /**
61
+ * Clears Column Filter for given Column
62
+ * @param columnId Column for which Column Filter should be cleared
63
+ */
64
+ clearColumnFilterByColumn(columnId: string): void;
65
+ /**
66
+ * Clears Column Filters for given set of Columns
67
+ * @param columns Columns for which Column Filte should be cleared
68
+ */
69
+ clearColumnFilterByColumns(columns: string[]): void;
70
+ /**
71
+ * Clears all Column Filters in the Current Layout
72
+ */
73
+ clearColumnFilters(): void;
74
+ /**
75
+ * Clears existing Column Filters and then sets the new ones
76
+ * @param columnFilters Column Filters to set
77
+ */
78
+ clearAndSetColumnFilter(columnFilters: ColumnFilter[]): void;
79
+ /**
80
+ * Retrieves all Column Filters for given Column
81
+ * @param columnId column to retrieve Column Filters for
82
+ * @returns column filters
83
+ */
84
+ getAllColumnFilterForColumn(columnId: string): ColumnFilter[];
85
+ /**
86
+ * Creates an Equality Filter based on given Grid Cells
87
+ * @param gridCells cells to create Filter for
88
+ */
89
+ createValuesColumnFilterForCells(gridCells: GridCell[]): ColumnFilter | null;
90
+ /**
91
+ * Creates an Equality Filter based on given Grid Cell
92
+ * @param gridCell cell to create Filter for
93
+ */
94
+ createEqualityColumnFilterForCell(gridCell: GridCell): ColumnFilter | null;
95
+ /**
96
+ * Retrieves description of given Column Filter
97
+ * @param columnFilter Column Filter to use
98
+ */
99
+ columnFilterToString(columnFilter: ColumnFilter): string;
100
+ /**
101
+ * Retrieves descriptions of given Column Filters
102
+ * @param columnFilters Column Filters to use
103
+ */
104
+ columnFiltersToString(columnFilters: ColumnFilter[]): string;
105
+ /**
106
+ * Calls AdapTableQL to evaluate Filter for given Row
107
+ * @param columnFilter Column Filter to use
108
+ * @param node Row Node to evaluate
109
+ */
110
+ evaluateColumnFilter(columnFilter: ColumnFilter, node: RowNode): boolean;
43
111
  }
@@ -6,12 +6,12 @@ import { AdaptableScope } from '../../PredefinedConfig/Common/AdaptableScope';
6
6
  import { AdaptablePredicateDef } from '../../PredefinedConfig/Common/AdaptablePredicate';
7
7
  import { AdaptableAlert } from '../../PredefinedConfig/Common/AdaptableAlert';
8
8
  import { AdaptableForm, AdaptableFormData } from '../../PredefinedConfig/Common/AdaptableForm';
9
- import { AlertButtonContext } from '../../AdaptableOptions/AlertOptions';
9
+ import { AlertFormContext } from '../../AdaptableOptions/AlertOptions';
10
10
  import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
11
11
  import { GridDataChangedInfo } from '../Events/GridDataChanged';
12
12
  export declare class AlertApiImpl extends ApiBase implements AlertApi {
13
13
  getAlertState(): AlertState;
14
- getAdaptableFormByName(name: string): AdaptableForm<AlertButtonContext> | undefined;
14
+ getAdaptableFormByName(name: string): AdaptableForm<AlertFormContext> | undefined;
15
15
  getAlertDefinitions(config?: {
16
16
  includeLayoutNotAssociatedObjects?: boolean;
17
17
  }): AlertDefinition[];
@@ -23,7 +23,7 @@ export declare class AlertApiImpl extends ApiBase implements AlertApi {
23
23
  getAlertDefinitionsWithPreventEdit(): AlertDefinition[];
24
24
  getAlertDefinitionsWithAllowEdit(): AlertDefinition[];
25
25
  addAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
26
- executeAlertButton(button: AlertButton<AlertButtonContext>, context: AlertButtonContext): void;
26
+ executeAlertButton(button: AlertButton<AlertFormContext>, context: AlertFormContext): void;
27
27
  executeAlertAction(actionName: AdaptableAlertAction, details: {
28
28
  alertDefinition: AlertDefinition;
29
29
  cellDataChangedInfo?: CellDataChangedInfo;
@@ -1,6 +1,5 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import { AdaptableColumn, AdaptableColumnDataType } from '../../PredefinedConfig/Common/AdaptableColumn';
3
- import { DataType } from '../../PredefinedConfig/Common/Enums';
4
3
  import { ColumnApi } from '../ColumnApi';
5
4
  import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
6
5
  import { Column, RowNode } from '@ag-grid-community/all-modules';
@@ -41,7 +40,7 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
41
40
  getAgGridColumnFieldForAdaptableColumn(colId: string): string;
42
41
  getAgGridColumnForAdaptableColumn(columnId: string): Column;
43
42
  getColumnFromFriendlyName(columnName: string, logWarning?: boolean): AdaptableColumn;
44
- getColumnsOfType(dataType: DataType): AdaptableColumn[];
43
+ getColumnsOfType(dataType: AdaptableColumnDataType): AdaptableColumn[];
45
44
  getNumericColumns(): AdaptableColumn[];
46
45
  getStringColumns(): AdaptableColumn[];
47
46
  getDateColumns(): AdaptableColumn[];
@@ -68,4 +67,5 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
68
67
  usesAdaptableFilterForm(columnId: string): boolean;
69
68
  usesAdaptableQuickFilter(columnId: string): boolean;
70
69
  isColumnReferencedInExpression(columnId: string, expression: string): boolean;
70
+ isActionRowButtonColumn(columnId: string): boolean;
71
71
  }
@@ -89,13 +89,13 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
89
89
  return false;
90
90
  }
91
91
  isNumericColumn(column) {
92
- return column.dataType == Enums_1.DataType.Number;
92
+ return column.dataType == 'Number';
93
93
  }
94
94
  isBooleanColumn(column) {
95
- return column.dataType == Enums_1.DataType.Boolean;
95
+ return column.dataType == 'Boolean';
96
96
  }
97
97
  isDateColumn(column) {
98
- return column.dataType == Enums_1.DataType.Date;
98
+ return column.dataType == 'Date';
99
99
  }
100
100
  getColumnDataTypeFromColumnId(columnId) {
101
101
  const column = this.getColumnFromId(columnId); // this.getColumns().find(c => c.ColumnId == columnId);
@@ -224,31 +224,29 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
224
224
  }
225
225
  getColumnsOfType(dataType) {
226
226
  switch (dataType) {
227
- case Enums_1.DataType.All:
228
- return this.getColumns();
229
- case Enums_1.DataType.Boolean:
227
+ case 'Boolean':
230
228
  return this.getBooleanColumns();
231
- case Enums_1.DataType.Date:
229
+ case 'Date':
232
230
  return this.getDateColumns();
233
- case Enums_1.DataType.Number:
231
+ case 'Number':
234
232
  return this.getNumericColumns();
235
- case Enums_1.DataType.String:
233
+ case 'String':
236
234
  return this.getStringColumns();
237
235
  default:
238
236
  return this.getColumns();
239
237
  }
240
238
  }
241
239
  getNumericColumns() {
242
- return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Number);
240
+ return this.getColumns().filter((c) => c.dataType == 'Number');
243
241
  }
244
242
  getStringColumns() {
245
- return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.String);
243
+ return this.getColumns().filter((c) => c.dataType == 'String');
246
244
  }
247
245
  getDateColumns() {
248
- return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Date);
246
+ return this.getColumns().filter((c) => c.dataType == 'Date');
249
247
  }
250
248
  getBooleanColumns() {
251
- return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Boolean);
249
+ return this.getColumns().filter((c) => c.dataType == 'Boolean');
252
250
  }
253
251
  getSortableColumns() {
254
252
  return this.getColumns().filter((c) => c.sortable);
@@ -262,7 +260,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
262
260
  getAggregetableColumns() {
263
261
  return this.getColumns()
264
262
  .filter((c) => c.aggregatable)
265
- .filter((c) => c.dataType == Enums_1.DataType.Number);
263
+ .filter((c) => c.dataType == 'Number');
266
264
  }
267
265
  getQueryableColumns() {
268
266
  return this.getColumns().filter((c) => c.queryable);
@@ -409,5 +407,8 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
409
407
  const colIds = this.adaptable.api.queryLanguageApi.getColumnsFromExpression(expression);
410
408
  return colIds.some((c) => c === columnId);
411
409
  }
410
+ isActionRowButtonColumn(columnId) {
411
+ return columnId === GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS;
412
+ }
412
413
  }
413
414
  exports.ColumnApiImpl = ColumnApiImpl;
@@ -91,7 +91,7 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
91
91
  queryAST: currentQuery
92
92
  ? this.adaptable.api.queryLanguageApi.getASTForExpression(currentQuery)
93
93
  : null,
94
- columnFilters: this.adaptable.api.layoutApi.getAllColumnFilter(),
94
+ columnFilters: this.adaptable.api.filterApi.getColumnFilters(),
95
95
  };
96
96
  return adaptableSearchState;
97
97
  }