@adaptabletools/adaptable 12.0.0-canary.0 → 12.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 (77) hide show
  1. package/base.css +546 -269
  2. package/bundle.cjs.js +102 -102
  3. package/index.css +616 -266
  4. package/package.json +2 -2
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableOptions/EditOptions.d.ts +4 -5
  8. package/src/AdaptableOptions/ExportOptions.d.ts +4 -7
  9. package/src/AdaptableOptions/GeneralOptions.d.ts +5 -2
  10. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +19 -1
  11. package/src/Api/ColumnApi.d.ts +7 -2
  12. package/src/Api/EventApi.d.ts +11 -0
  13. package/src/Api/Events/SearchChanged.d.ts +1 -1
  14. package/src/Api/ExportApi.d.ts +2 -2
  15. package/src/Api/FilterApi.d.ts +69 -1
  16. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  17. package/src/Api/Implementation/ColumnApiImpl.js +15 -14
  18. package/src/Api/Implementation/ConfigApiImpl.js +1 -1
  19. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
  20. package/src/Api/Implementation/FilterApiImpl.d.ts +16 -1
  21. package/src/Api/Implementation/FilterApiImpl.js +141 -0
  22. package/src/Api/Implementation/GridApiImpl.js +7 -3
  23. package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -15
  24. package/src/Api/Implementation/LayoutApiImpl.js +0 -152
  25. package/src/Api/Implementation/PredicateApiImpl.d.ts +2 -0
  26. package/src/Api/Implementation/PredicateApiImpl.js +18 -0
  27. package/src/Api/LayoutApi.d.ts +1 -72
  28. package/src/Api/PredicateApi.d.ts +7 -0
  29. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
  30. package/src/PredefinedConfig/Common/FormContext.d.ts +8 -0
  31. package/src/PredefinedConfig/Common/FormContext.js +2 -0
  32. package/src/Redux/ActionsReducers/LayoutRedux.js +0 -1
  33. package/src/Redux/ActionsReducers/PopupRedux.d.ts +3 -2
  34. package/src/Strategy/AdaptableModuleBase.js +1 -2
  35. package/src/Strategy/BulkUpdateModule.js +3 -4
  36. package/src/Strategy/CellSummaryModule.js +1 -2
  37. package/src/Strategy/FilterModule.js +15 -18
  38. package/src/Strategy/LayoutModule.js +1 -0
  39. package/src/Strategy/PlusMinusModule.js +1 -4
  40. package/src/Strategy/SmartEditModule.js +2 -2
  41. package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
  42. package/src/Utilities/Constants/GeneralConstants.js +3 -1
  43. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
  44. package/src/Utilities/Services/CalculatedColumnExpressionService.js +6 -7
  45. package/src/Utilities/Services/RowEditService.d.ts +1 -0
  46. package/src/Utilities/Services/RowEditService.js +34 -2
  47. package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -3
  48. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +2 -3
  49. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +4 -5
  50. package/src/View/CellSummary/CellSummaryDetails.js +2 -2
  51. package/src/View/Components/FilterForm/FilterForm.js +1 -1
  52. package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
  53. package/src/View/Components/PreviewResultsPanel.js +3 -3
  54. package/src/View/Components/WizardSummaryPage.js +2 -2
  55. package/src/View/Filter/ActiveFiltersPanel.js +1 -1
  56. package/src/View/Filter/FilterSummary.js +1 -1
  57. package/src/View/Filter/FilterViewPanel.js +2 -2
  58. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +4 -5
  59. package/src/View/GridInfo/ColumnInfoComponent.js +1 -1
  60. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  61. package/src/View/UIHelper.js +6 -6
  62. package/src/agGrid/Adaptable.js +25 -11
  63. package/src/agGrid/FilterWrapper.js +2 -2
  64. package/src/agGrid/agGridHelper.d.ts +2 -3
  65. package/src/agGrid/agGridHelper.js +37 -33
  66. package/src/agGrid/rowEditIcons.d.ts +1 -0
  67. package/src/agGrid/rowEditIcons.js +2 -1
  68. package/src/components/InfiniteTable/index.js +1 -0
  69. package/src/components/List/GridList/index.js +1 -1
  70. package/src/components/icons/add-row.d.ts +3 -0
  71. package/src/components/icons/add-row.js +7 -0
  72. package/src/components/icons/index.js +2 -0
  73. package/src/metamodel/adaptable.metamodel.d.ts +1 -1
  74. package/src/metamodel/adaptable.metamodel.js +122 -89
  75. package/src/types.d.ts +3 -2
  76. package/version.d.ts +1 -1
  77. 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.1",
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",
@@ -1,2 +1,2 @@
1
- declare const _default: 1654532122066;
1
+ declare const _default: 1654683345204;
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 = 1654683345204;
@@ -1,5 +1,6 @@
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';
@@ -108,14 +109,12 @@ export interface RowFormOptions {
108
109
  onFormSubmit?: (rowFormSubmittedInfo: RowFormSubmittedInfo) => void;
109
110
  }
110
111
  export declare type RowFormContext = CreateRowFormContext | EditRowFormContext;
111
- export interface CreateRowFormContext extends BaseContext {
112
+ export interface CreateRowFormContext extends FormContext {
112
113
  type: Extract<RowFormType, 'rowCreated'>;
113
- formData: AdaptableFormData;
114
114
  clonedRowNode?: RowNode;
115
115
  }
116
- export interface EditRowFormContext extends BaseContext {
116
+ export interface EditRowFormContext extends FormContext {
117
117
  type: Extract<RowFormType, 'rowEdited'>;
118
- formData: AdaptableFormData;
119
118
  rowNode: RowNode;
120
119
  }
121
120
  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,7 @@ 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
+ export interface DataSetFormContext extends FormContext {
92
95
  }
@@ -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
@@ -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
@@ -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
  }
@@ -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
  }
@@ -3,7 +3,7 @@ import { ExportState, Report, ReportData, ReportSchedule, SystemReportNames } fr
3
3
  import { ApiBase } from './ApiBase';
4
4
  import { AdaptableForm } from '../../PredefinedConfig/Common/AdaptableForm';
5
5
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
6
- import { CustomDestination, ExportButtonContext } from '../../AdaptableOptions/ExportOptions';
6
+ import { CustomDestination, ExportFormContext } from '../../AdaptableOptions/ExportOptions';
7
7
  import { ExportDestination } from '../../PredefinedConfig/Common/Enums';
8
8
  export declare class ExportApiImpl extends ApiBase implements ExportApi {
9
9
  getExportState(): ExportState;
@@ -22,7 +22,7 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
22
22
  selectDestination(destinationName: string): void;
23
23
  getAllCustomDestination(): CustomDestination[];
24
24
  isExportDestinationCustom(destinationName: string): boolean;
25
- getExportDestinationForm(destinationName: string): AdaptableForm<ExportButtonContext> | undefined;
25
+ getExportDestinationForm(destinationName: string): AdaptableForm<ExportFormContext> | undefined;
26
26
  canExportToExcel(): boolean;
27
27
  exportDataToExcel(reportData: ReportData, fileName: string): void;
28
28
  showExportPopup(): void;
@@ -2,7 +2,8 @@ import { ApiBase } from './ApiBase';
2
2
  import { FilterApi } from '../FilterApi';
3
3
  import { AdaptablePredicateDef } from '../../PredefinedConfig/Common/AdaptablePredicate';
4
4
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
5
- import { SystemFilterPredicateIds } from '../../types';
5
+ import { ColumnFilter, GridCell, SystemFilterPredicateIds } from '../../types';
6
+ import { RowNode } from '@ag-grid-community/all-modules';
6
7
  export declare class FilterApiImpl extends ApiBase implements FilterApi {
7
8
  getAllSystemFilterIds(): SystemFilterPredicateIds;
8
9
  findPredicateDefByShortcut(shortcut: string, column: AdaptableColumn): AdaptablePredicateDef;
@@ -13,4 +14,18 @@ export declare class FilterApiImpl extends ApiBase implements FilterApi {
13
14
  hideQuickFilterBar(): void;
14
15
  isQuickFilterAvailable(): boolean;
15
16
  isQuickFilterVisible(): boolean;
17
+ getColumnFilters(): ColumnFilter[];
18
+ setColumnFilter(columnFilters: ColumnFilter[]): ColumnFilter[] | null;
19
+ clearColumnFilter(columnFilter: ColumnFilter): void;
20
+ clearColumnFilterByColumns(columns: string[]): void;
21
+ clearColumnFilterByColumn(column: string): void;
22
+ clearColumnFilters(): void;
23
+ clearAndSetColumnFilter(columnFilters: ColumnFilter[]): void;
24
+ getAllColumnFilterForColumn(column: string): ColumnFilter[];
25
+ createValuesColumnFilterForCells(gridCells: GridCell[]): ColumnFilter | null;
26
+ createEqualityColumnFilterForCell(gridCell: GridCell): ColumnFilter | null;
27
+ columnFilterToString(columnFilter: ColumnFilter): string;
28
+ columnFiltersToString(columnFilters: ColumnFilter[]): string;
29
+ evaluateColumnFilter(columnFilter: ColumnFilter, node: RowNode): boolean;
30
+ private getColumnFilterById;
16
31
  }
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FilterApiImpl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
6
+ const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
6
7
  const ApiBase_1 = require("./ApiBase");
8
+ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
9
+ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
7
10
  class FilterApiImpl extends ApiBase_1.ApiBase {
8
11
  getAllSystemFilterIds() {
9
12
  return this.getFilterOptions().systemFilters;
@@ -38,5 +41,143 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
38
41
  return (this.isQuickFilterAvailable() &&
39
42
  this.adaptable.api.internalApi.getSystemState().IsQuickFilterVisible);
40
43
  }
44
+ getColumnFilters() {
45
+ var _a;
46
+ const currentLayout = this.adaptable.api.layoutApi.getCurrentLayout();
47
+ return (_a = currentLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
48
+ }
49
+ setColumnFilter(columnFilters) {
50
+ columnFilters.forEach((columnFilter) => {
51
+ if (!columnFilter.Predicate) {
52
+ LoggingHelper_1.LogAdaptableWarning('Column Filter has no Predicate', columnFilter);
53
+ }
54
+ else {
55
+ const isValidPredicate = this.adaptable.api.predicateApi.isValidPredicate(columnFilter.Predicate);
56
+ if (!isValidPredicate) {
57
+ LoggingHelper_1.LogAdaptableWarning('Column Filter Predicate is not valid', columnFilter);
58
+ }
59
+ else {
60
+ this.addUidToAdaptableObject(columnFilter);
61
+ if (this.getColumnFilters().find((cf) => cf.ColumnId == columnFilter.ColumnId)) {
62
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterSet(columnFilter));
63
+ }
64
+ else {
65
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterAdd(columnFilter));
66
+ }
67
+ }
68
+ return columnFilters === null || columnFilters === void 0 ? void 0 : columnFilters.map((columnFilter) => this.getColumnFilterById(columnFilter.Uuid));
69
+ }
70
+ });
71
+ return null;
72
+ }
73
+ clearColumnFilter(columnFilter) {
74
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterClear(columnFilter));
75
+ }
76
+ clearColumnFilterByColumns(columns) {
77
+ columns.forEach((c) => {
78
+ this.clearColumnFilterByColumn(c);
79
+ });
80
+ }
81
+ clearColumnFilterByColumn(column) {
82
+ let columnFiltersForColumn = this.getAllColumnFilterForColumn(column);
83
+ if (columnFiltersForColumn) {
84
+ columnFiltersForColumn.forEach((cf) => {
85
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterClear(cf));
86
+ });
87
+ this.adaptable.clearColumnFiltering([column]);
88
+ }
89
+ }
90
+ clearColumnFilters() {
91
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterClearAll());
92
+ this.adaptable.clearGridFiltering();
93
+ }
94
+ clearAndSetColumnFilter(columnFilters) {
95
+ this.clearColumnFilters();
96
+ columnFilters.forEach((columnFilter) => {
97
+ if (this.getColumnFilters().find((cf) => cf.ColumnId == columnFilter.ColumnId)) {
98
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterSet(columnFilter));
99
+ }
100
+ else {
101
+ this.dispatchAction(LayoutRedux.LayoutColumnFilterAdd(columnFilter));
102
+ }
103
+ });
104
+ }
105
+ getAllColumnFilterForColumn(column) {
106
+ let columnFilters = this.getColumnFilters();
107
+ if (columnFilters) {
108
+ return columnFilters.filter((cf) => cf.ColumnId == column);
109
+ }
110
+ else {
111
+ return [];
112
+ }
113
+ }
114
+ createValuesColumnFilterForCells(gridCells) {
115
+ if (!gridCells) {
116
+ return null;
117
+ }
118
+ const filter = {
119
+ ColumnId: gridCells[0].column.columnId,
120
+ Predicate: {
121
+ PredicateId: 'Values',
122
+ Inputs: [...new Set(gridCells.map((gc) => gc.displayValue))],
123
+ },
124
+ };
125
+ const [savedFilter] = this.setColumnFilter([filter]) || [null];
126
+ return savedFilter;
127
+ }
128
+ createEqualityColumnFilterForCell(gridCell) {
129
+ if (!gridCell) {
130
+ return null;
131
+ }
132
+ const column = gridCell.column;
133
+ const filter = {
134
+ ColumnId: column.columnId,
135
+ Predicate: {
136
+ PredicateId: this.adaptable.api.predicateApi.getEqualityPredicateForDataType(column.dataType),
137
+ Inputs: [...new Set([gridCell.rawValue])],
138
+ },
139
+ };
140
+ const [savedFilter] = this.setColumnFilter([filter]) || [null];
141
+ return savedFilter;
142
+ }
143
+ columnFilterToString(columnFilter) {
144
+ const friendlyName = this.adaptable.api.columnApi.getFriendlyNameFromColumnId(columnFilter.ColumnId);
145
+ return ('[' +
146
+ friendlyName +
147
+ '] ' +
148
+ this.adaptable.api.predicateApi.predicateToString(columnFilter.Predicate));
149
+ }
150
+ columnFiltersToString(columnFilters) {
151
+ return columnFilters.map((cf) => this.columnFilterToString(cf)).join(', ');
152
+ }
153
+ evaluateColumnFilter(columnFilter, node) {
154
+ var _a;
155
+ if (!columnFilter.Predicate) {
156
+ return true;
157
+ }
158
+ if ((_a = columnFilter.Predicate.Inputs) === null || _a === void 0 ? void 0 : _a.some((input) => StringExtensions_1.default.IsNullOrEmpty(input))) {
159
+ return true;
160
+ }
161
+ const column = this.adaptable.api.columnApi.getColumnFromId(columnFilter.ColumnId);
162
+ if (!column) {
163
+ return true;
164
+ }
165
+ const gridCell = this.adaptable.api.gridApi.getGridCellFromRowNode(node, columnFilter.ColumnId);
166
+ if (!gridCell) {
167
+ return true;
168
+ }
169
+ let value = gridCell.normalisedValue;
170
+ return this.adaptable.api.predicateApi.handlePredicate(columnFilter.Predicate, {
171
+ value: value,
172
+ oldValue: null,
173
+ displayValue: gridCell.displayValue,
174
+ node,
175
+ column,
176
+ }, true);
177
+ }
178
+ getColumnFilterById(id) {
179
+ var _a;
180
+ return (_a = this.getColumnFilters()) === null || _a === void 0 ? void 0 : _a.find((columnFilter) => columnFilter.Uuid === id);
181
+ }
41
182
  }
42
183
  exports.FilterApiImpl = FilterApiImpl;
@@ -90,7 +90,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
90
90
  }
91
91
  clearGridFiltering() {
92
92
  // slightly round the houses but we have to call FilterAPI as it does it properly
93
- this.adaptable.api.layoutApi.clearAllColumnFilter();
93
+ this.adaptable.api.filterApi.clearColumnFilters();
94
94
  }
95
95
  getAgGridInstance() {
96
96
  return this.adaptable.adaptableOptions.gridOptions;
@@ -378,7 +378,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
378
378
  if (!rowNode) {
379
379
  LoggingHelper_1.LogAdaptableWarning(`Can NOT edit row: rowNode not found for primaryKey ${primaryKey}`);
380
380
  }
381
- const editForm = this.adaptable.api.internalApi.getRowEditService().buildRowEditForm(rowNode);
381
+ const editForm = this.adaptable.api.internalApi
382
+ .getRowEditService()
383
+ .buildRowEditForm(rowNode);
382
384
  this.dispatchAction(PopupRedux_1.PopupShowForm({
383
385
  Id: 'edit_row_form',
384
386
  Form: editForm,
@@ -389,7 +391,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
389
391
  }));
390
392
  }
391
393
  openCreateRowForm(duplicatedRowNodePrimaryKey) {
392
- const createForm = this.adaptable.api.internalApi.getRowEditService().buildRowCreateForm();
394
+ const createForm = this.adaptable.api.internalApi
395
+ .getRowEditService()
396
+ .buildRowCreateForm();
393
397
  this.dispatchAction(PopupRedux_1.PopupShowForm({
394
398
  Id: 'create_row_form',
395
399
  Form: createForm,