@adaptabletools/adaptable-cjs 20.2.5 → 20.2.7

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableOptions/AdaptableOptions.d.ts +4 -4
  3. package/src/AdaptableOptions/DataSetOptions.d.ts +1 -1
  4. package/src/AdaptableState/Common/AdaptableColumn.d.ts +4 -0
  5. package/src/AdaptableState/ExportState.d.ts +2 -2
  6. package/src/AdaptableState/FormatColumnState.d.ts +3 -3
  7. package/src/Api/AdaptableApi.d.ts +42 -42
  8. package/src/Api/EventApi.d.ts +1 -1
  9. package/src/Api/GridApi.d.ts +2 -2
  10. package/src/Api/GridFilterApi.d.ts +10 -1
  11. package/src/Api/Implementation/ColumnApiImpl.js +1 -0
  12. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  13. package/src/Api/Implementation/GridFilterApiImpl.d.ts +3 -1
  14. package/src/Api/Implementation/GridFilterApiImpl.js +10 -0
  15. package/src/Api/Implementation/LayoutHelpers.js +4 -4
  16. package/src/Api/Implementation/StateApiImpl.d.ts +1 -0
  17. package/src/Api/Implementation/StateApiImpl.js +7 -4
  18. package/src/Api/OptionsApi.d.ts +1 -7
  19. package/src/Api/StateApi.d.ts +7 -0
  20. package/src/Strategy/TeamSharingModule.js +2 -2
  21. package/src/View/Components/ReorderDraggable/index.js +2 -1
  22. package/src/View/Dashboard/Dashboard.js +1 -1
  23. package/src/View/Layout/Wizard/sections/ColumnsSection.js +4 -2
  24. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +1 -1
  25. package/src/View/QuickSearch/QuickSearchInput.d.ts +1 -0
  26. package/src/View/QuickSearch/QuickSearchInput.js +1 -1
  27. package/src/View/QuickSearch/QuickSearchStatusBarContent.js +2 -9
  28. package/src/View/StateManagement/components/ExportDropdown.js +1 -1
  29. package/src/agGrid/AdaptableAgGrid.js +1 -0
  30. package/src/agGrid/AgGridAdapter.js +3 -2
  31. package/src/agGrid/AgGridColumnAdapter.js +4 -3
  32. package/src/agGrid/AgGridExportAdapter.js +1 -1
  33. package/src/env.js +2 -2
  34. package/src/layout-manager/src/LayoutManagerModel.d.ts +4 -4
  35. package/src/layout-manager/src/index.js +5 -3
  36. package/src/layout-manager/src/isLayoutEqual.js +0 -1
  37. package/src/metamodel/adaptable.metamodel.js +1 -1
  38. package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "20.2.5",
3
+ "version": "20.2.7",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -92,10 +92,6 @@ export interface AdaptableOptions<TData = any, TContext = Record<string, any>> {
92
92
  * Options for managing Action Columns
93
93
  */
94
94
  actionColumnOptions?: ActionColumnOptions<TData>;
95
- /**
96
- * Options for managing Row Forms
97
- */
98
- rowFormOptions?: RowFormOptions<TData>;
99
95
  /**
100
96
  * Options for managing Alerts in AdapTable
101
97
  *
@@ -237,6 +233,10 @@ export interface AdaptableOptions<TData = any, TContext = Record<string, any>> {
237
233
  * @noCodeContainer
238
234
  */
239
235
  quickSearchOptions?: QuickSearchOptions<TData>;
236
+ /**
237
+ * Options for managing Row Forms
238
+ */
239
+ rowFormOptions?: RowFormOptions<TData>;
240
240
  /**
241
241
  * Setting panel options
242
242
  *
@@ -5,7 +5,7 @@ import { FormContext } from '../AdaptableState/Common/FormContext';
5
5
  */
6
6
  export interface DataSetOptions<TData = any> {
7
7
  /**
8
- * Collection of Data Sets to provide Data to AdapTable
8
+ * Collection of Data Sets to provide data to AdapTable
9
9
  */
10
10
  dataSets?: DataSet[];
11
11
  }
@@ -95,6 +95,10 @@ export interface AdaptableColumn<TData = any> extends AdaptableColumnBase {
95
95
  * Is Column editable; returns FALSE if Column has conditional/dynamic editability, assuming some rows are editable
96
96
  */
97
97
  readOnly: boolean;
98
+ /**
99
+ * Is Column resizable
100
+ */
101
+ resizable: boolean;
98
102
  /**
99
103
  * Is Column currently visible
100
104
  */
@@ -32,11 +32,11 @@ export interface Report extends AdaptableObject {
32
32
  */
33
33
  Name: ReportNameType;
34
34
  /**
35
- * Columns to display: 'AllColumns', 'VisibleColumns', 'SelectedColumns', 'ScopeColumns'
35
+ * Columns to display: `AllColumns`, `VisibleColumns`, `SelectedColumns`, `ScopeColumns`
36
36
  */
37
37
  ReportColumnScope: ReportColumnScope;
38
38
  /**
39
- * Rows to export: 'AllRows', 'VisibleRows', 'SelectedRows', 'ExpressionRows'
39
+ * Rows to export: `AllRows`, `VisibleRows`, `SelectedRows`, `ExpressionRows`
40
40
  */
41
41
  ReportRowScope: ReportRowScope;
42
42
  /**
@@ -22,11 +22,11 @@ export interface FormatColumnState extends BaseState {
22
22
  */
23
23
  export interface FormatColumn extends SuspendableObject {
24
24
  /**
25
- * Where Format will be applied - whole Row, some Columns or all Columns of given DataType
25
+ * Where Format will be applied: whole Row, some Columns, or Columns of DataType
26
26
  */
27
27
  Scope: ColumnScope;
28
28
  /**
29
- * Rule used to decide whether to apply the Format; if undefined Format is always applied
29
+ * Rule to decide whether to apply Format; if undefined Format is always applied
30
30
  */
31
31
  Rule?: FormatColumnRule;
32
32
  /**
@@ -46,7 +46,7 @@ export interface FormatColumn extends SuspendableObject {
46
46
  */
47
47
  RowScope?: RowScope;
48
48
  /**
49
- * When to format Columns in Column Groups (can be 'Expanded', 'Collapsed' or 'Both')
49
+ * When to format Columns in Column Groups ('Expanded', 'Collapsed' or 'Both')
50
50
  *
51
51
  */
52
52
  ColumnGroupScope?: ColumnGroupScope;
@@ -72,14 +72,14 @@ export interface AdaptableApi {
72
72
  * Provides access to the Bulk Update Module
73
73
  */
74
74
  bulkUpdateApi: BulkUpdateApi;
75
- /**
76
- * Functions for managing Holidays
77
- */
78
- calendarApi: CalendarApi;
79
75
  /**
80
76
  * Provides access to the Calculated Column Module
81
77
  */
82
78
  calculatedColumnApi: CalculatedColumnApi;
79
+ /**
80
+ * Functions for managing Holidays
81
+ */
82
+ calendarApi: CalendarApi;
83
83
  /**
84
84
  * Provides access to the Cell Summary Module
85
85
  */
@@ -93,9 +93,21 @@ export interface AdaptableApi {
93
93
  */
94
94
  columnApi: ColumnApi;
95
95
  /**
96
- * Methods giving access to Adaptable State
96
+ * Provides access to Column Menu
97
97
  */
98
- stateApi: StateApi;
98
+ columnMenuApi: ColumnMenuApi;
99
+ /**
100
+ * Provides access to Context Menu
101
+ */
102
+ contextMenuApi: ContextMenuApi;
103
+ /**
104
+ * Provides access to the Comment Module
105
+ */
106
+ commentApi: CommentApi;
107
+ /**
108
+ * Manages the `Scope` object - used widely to determine where objects are applied
109
+ */
110
+ columnScopeApi: ColumnScopeApi;
99
111
  /**
100
112
  * Provides access to the Custom Sort Module
101
113
  */
@@ -108,6 +120,10 @@ export interface AdaptableApi {
108
120
  * Provides run-time access to the Data Changes Module
109
121
  **/
110
122
  dataChangeHistoryApi: DataChangeHistoryApi;
123
+ /**
124
+ * Provides access to the Data Import Module
125
+ */
126
+ dataImportApi: DataImportApi;
111
127
  /**
112
128
  * Provides access to Data Sets
113
129
  */
@@ -124,6 +140,14 @@ export interface AdaptableApi {
124
140
  * Provides access to the Export Module and Reports
125
141
  */
126
142
  exportApi: ExportApi;
143
+ /**
144
+ * Manages AdapTableQL Expressions
145
+ */
146
+ expressionApi: ExpressionApi;
147
+ /**
148
+ * Manages the FDC3 capabilities of AdapTable
149
+ */
150
+ fdc3Api: Fdc3Api;
127
151
  /**
128
152
  * Provides access to Filtering in AdapTable
129
153
  */
@@ -148,6 +172,14 @@ export interface AdaptableApi {
148
172
  * Provides access to the Layout Module
149
173
  */
150
174
  layoutApi: LayoutApi;
175
+ /**
176
+ * Provides access to the Named Query Module
177
+ */
178
+ namedQueryApi: NamedQueryApi;
179
+ /**
180
+ * Provides access to the Note Module
181
+ */
182
+ noteApi: NoteApi;
151
183
  /**
152
184
  * Provides access to Adaptable Options
153
185
  */
@@ -164,14 +196,6 @@ export interface AdaptableApi {
164
196
  * Manages the Predicate - a boolean-return function used in Filters and Alerts
165
197
  */
166
198
  predicateApi: PredicateApi;
167
- /**
168
- * Provides access to the Named Query Module
169
- */
170
- namedQueryApi: NamedQueryApi;
171
- /**
172
- * Manages AdapTableQL Expressions
173
- */
174
- expressionApi: ExpressionApi;
175
199
  /**
176
200
  * Provides access to the Quick Search Module
177
201
  */
@@ -188,10 +212,6 @@ export interface AdaptableApi {
188
212
  * Provides access to the Settings Panel
189
213
  */
190
214
  settingsPanelApi: SettingsPanelApi;
191
- /**
192
- * Manages the `Scope` object - used widely to determine where objects are applied
193
- */
194
- columnScopeApi: ColumnScopeApi;
195
215
  /**
196
216
  * Provides access to the Shortcut Module
197
217
  */
@@ -200,6 +220,10 @@ export interface AdaptableApi {
200
220
  * Provides access to the Smart Edit Module
201
221
  */
202
222
  smartEditApi: SmartEditApi;
223
+ /**
224
+ * Methods giving access to Adaptable State
225
+ */
226
+ stateApi: StateApi;
203
227
  /**
204
228
  * Provides run-time access to the AdapTable Status Bar
205
229
  */
@@ -228,30 +252,6 @@ export interface AdaptableApi {
228
252
  * Manages User Interface Options where colours, styles and custom column values are configured
229
253
  */
230
254
  userInterfaceApi: UserInterfaceApi;
231
- /**
232
- * Provides access to the Note Module
233
- */
234
- noteApi: NoteApi;
235
- /**
236
- * Provides access to Column Menu
237
- */
238
- columnMenuApi: ColumnMenuApi;
239
- /**
240
- * Provides access to Context Menu
241
- */
242
- contextMenuApi: ContextMenuApi;
243
- /**
244
- * Provides access to the Comment Module
245
- */
246
- commentApi: CommentApi;
247
- /**
248
- * Provides access to the Data Import Module
249
- */
250
- dataImportApi: DataImportApi;
251
- /**
252
- * Manages the FDC3 capabilities of AdapTable
253
- */
254
- fdc3Api: Fdc3Api;
255
255
  /**
256
256
  * Cleanup method - call only for vanilla JavaScript components, as framework components handle cleanup on destroy/unmount. By default, it unmounts the Adaptable component and destroys the AG Grid instance.
257
257
  * @param config - optional configuration object
@@ -1,4 +1,4 @@
1
- import { AdaptableReadyInfo, AdaptableStateChangedInfo, AdaptableStateReloadedInfo, AlertFiredInfo, CalculatedColumnChangedInfo, CellChangedInfo, CellSelectionChangedInfo, ChartChangedInfo, ColumnFilterAppliedInfo, CommentChangedInfo, CustomToolbarConfiguredInfo, DashboardChangedInfo, DataImportedInfo, DataSetSelectedInfo, Fdc3MessageInfo, FlashingCellDisplayedInfo, RowChangedInfo, GridFilterAppliedInfo, GridSortedInfo, LayoutChangedInfo, LiveDataChangedInfo, RowFormSubmittedInfo, RowSelectionChangedInfo, ScheduleTriggeredInfo, SystemStatusMessageDisplayedInfo, TeamSharingEntityChangedInfo, ThemeChangedInfo } from '../types';
1
+ import { AdaptableReadyInfo, AdaptableStateChangedInfo, AdaptableStateReloadedInfo, AlertFiredInfo, CalculatedColumnChangedInfo, CellChangedInfo, CellSelectionChangedInfo, ChartChangedInfo, ColumnFilterAppliedInfo, CommentChangedInfo, CustomToolbarConfiguredInfo, DashboardChangedInfo, DataImportedInfo, DataSetSelectedInfo, Fdc3MessageInfo, FlashingCellDisplayedInfo, GridFilterAppliedInfo, GridSortedInfo, LayoutChangedInfo, LiveDataChangedInfo, RowChangedInfo, RowFormSubmittedInfo, RowSelectionChangedInfo, ScheduleTriggeredInfo, SystemStatusMessageDisplayedInfo, TeamSharingEntityChangedInfo, ThemeChangedInfo } from '../types';
2
2
  /**
3
3
  * Responsible for publishing the many Events that AdapTable fires
4
4
  */
@@ -503,10 +503,10 @@ export interface GridApi {
503
503
  */
504
504
  refreshRowNode(rowNode: IRowNode): void;
505
505
  /**
506
- * Forces a re-render of the given rows
506
+ * Forces re-render of given rows (if none provided, all rows are refreshed)
507
507
  * @param rowNodes AG Grid rows
508
508
  */
509
- refreshRowNodes(rowNodes: IRowNode[]): void;
509
+ refreshRowNodes(rowNodes?: IRowNode[]): void;
510
510
  /**
511
511
  * Forces a re-render of all Group Rows (including aggregations)
512
512
  */
@@ -1,4 +1,4 @@
1
- import { GridFilter } from '../types';
1
+ import { GridFilter, NamedQuery } from '../types';
2
2
  /**
3
3
  * Provides run-time access to Grid Filter section of Adaptable State.
4
4
  */
@@ -8,6 +8,10 @@ export interface GridFilterApi {
8
8
  * @returns Grid Filter
9
9
  */
10
10
  getCurrentGridFilter(): GridFilter | undefined;
11
+ /**
12
+ * Re-applies the Grid Filter
13
+ */
14
+ reApplyGridFilter(): void;
11
15
  /**
12
16
  * Retrieves the Grid Filter's Expression from the current layout
13
17
  * @returns Grid Filter Expression
@@ -18,6 +22,11 @@ export interface GridFilterApi {
18
22
  * @param expression filter string
19
23
  */
20
24
  setGridFilterExpression(expression: string): void;
25
+ /**
26
+ * Sets the Grid Filter (for the current layout)
27
+ * @param namedQuery: NamedQuery to use
28
+ */
29
+ setGridFilterExpressionUsingNamedQuery(namedQuery: NamedQuery): void;
21
30
  /**
22
31
  * Clears the Grid Filter (for the current Layout)
23
32
  */
@@ -16,6 +16,7 @@ const ROW_GROUP_COLUMN_DEFAULTS = {
16
16
  friendlyName: 'Group',
17
17
  isPrimaryKey: false,
18
18
  readOnly: false,
19
+ resizable: true,
19
20
  visible: true,
20
21
  alwaysHidden: false,
21
22
  fieldOnly: false,
@@ -126,7 +126,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
126
126
  refreshColumns(columnIds: string[]): void;
127
127
  refreshRowByPrimaryKey(primaryKey: any): void;
128
128
  refreshRowNode(rowNode: IRowNode): void;
129
- refreshRowNodes(rowNodes: IRowNode[]): void;
129
+ refreshRowNodes(rowNodes?: IRowNode[]): void;
130
130
  refreshGroupRowNodes(): void;
131
131
  isCellEditable(gridCell: GridCell): boolean;
132
132
  isCellEdited(gridCell: GridCell): boolean;
@@ -2,13 +2,15 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
2
  import { GridFilterApi } from '../GridFilterApi';
3
3
  import { GridFilterInternalApi } from '../Internal/GridFilterInternalApi';
4
4
  import { ApiBase } from './ApiBase';
5
- import { GridFilter } from '../../types';
5
+ import { GridFilter, NamedQuery } from '../../types';
6
6
  export declare class GridFilterApiImpl extends ApiBase implements GridFilterApi {
7
7
  internalApi: GridFilterInternalApi;
8
8
  constructor(_adaptable: IAdaptable);
9
+ reApplyGridFilter(): void;
9
10
  getCurrentGridFilter(): GridFilter | undefined;
10
11
  getCurrentGridFilterExpression(): string | undefined;
11
12
  setGridFilterExpression(filter: string): void;
13
+ setGridFilterExpressionUsingNamedQuery(namedQuery: NamedQuery): void;
12
14
  clearGridFilter(): void;
13
15
  openUIEditorForGridFilter(expression?: string): void;
14
16
  suspendGridFilter(): void;
@@ -12,6 +12,12 @@ class GridFilterApiImpl extends ApiBase_1.ApiBase {
12
12
  super(_adaptable);
13
13
  this.internalApi = new GridFilterInternalApi_1.GridFilterInternalApi(_adaptable);
14
14
  }
15
+ reApplyGridFilter() {
16
+ const currentGridFilter = this.getCurrentGridFilter();
17
+ if (currentGridFilter?.Expression) {
18
+ this.setGridFilterExpression(currentGridFilter.Expression);
19
+ }
20
+ }
15
21
  getCurrentGridFilter() {
16
22
  return this.getLayoutApi().getCurrentLayout()?.GridFilter;
17
23
  }
@@ -25,6 +31,10 @@ class GridFilterApiImpl extends ApiBase_1.ApiBase {
25
31
  setGridFilterExpression(filter) {
26
32
  this.dispatchAction(LayoutRedux.LayoutGridFilterSet(filter));
27
33
  }
34
+ setGridFilterExpressionUsingNamedQuery(namedQuery) {
35
+ const expressionString = 'QUERY("' + namedQuery.Name + '")';
36
+ this.setGridFilterExpression(expressionString);
37
+ }
28
38
  clearGridFilter() {
29
39
  this.dispatchAction(LayoutRedux.LayoutGridFilterClear());
30
40
  }
@@ -175,7 +175,7 @@ const tableLayoutToTableLayoutModel = (tableLayout) => {
175
175
  };
176
176
  });
177
177
  const result = (0, simplifyLayoutModel_1.simplifyTableLayoutModel)({
178
- Ignore_Name: tableLayout.Name,
178
+ Name: tableLayout.Name,
179
179
  SuppressAggFuncInHeader: tableLayout.SuppressAggFuncInHeader,
180
180
  TableColumns: tableLayout.TableColumns,
181
181
  ColumnWidths: tableLayout.ColumnWidths,
@@ -238,7 +238,7 @@ const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
238
238
  pivotLayout = structuredClone(pivotLayout);
239
239
  cleanupAdaptableObjectPrimitives(pivotLayout);
240
240
  const result = (0, simplifyLayoutModel_1.simplifyPivotLayoutModel)({
241
- Ignore_Name: pivotLayout.Name,
241
+ Name: pivotLayout.Name,
242
242
  SuppressAggFuncInHeader: pivotLayout.SuppressAggFuncInHeader,
243
243
  ColumnWidths: pivotLayout.ColumnWidths,
244
244
  ColumnVisibility: pivotLayout.ColumnVisibility,
@@ -308,7 +308,7 @@ function toAggFunc(aggFunc) {
308
308
  }
309
309
  const tableLayoutModelToTableLayout = (layoutModel) => {
310
310
  const tableLayout = {
311
- Name: layoutModel.Ignore_Name,
311
+ Name: layoutModel.Name,
312
312
  TableColumns: layoutModel.TableColumns,
313
313
  ColumnWidths: layoutModel.ColumnWidths,
314
314
  ColumnVisibility: layoutModel.ColumnVisibility,
@@ -412,7 +412,7 @@ function toAggregationColumnValue(columnAggregationModel) {
412
412
  }
413
413
  const pivotLayoutModelToPivotLayout = (layoutModel) => {
414
414
  const pivotLayout = {
415
- Name: layoutModel.Ignore_Name,
415
+ Name: layoutModel.Name,
416
416
  PivotColumns: layoutModel.PivotColumns,
417
417
  TableColumns: layoutModel.TableColumns,
418
418
  ColumnWidths: layoutModel.ColumnWidths,
@@ -31,6 +31,7 @@ export declare class StateApiImpl extends ApiBase implements StateApi {
31
31
  reloadInitialState(newInitialState?: InitialState): void;
32
32
  getAllState(): AdaptableState;
33
33
  getPersistedState(): AdaptablePersistentState;
34
+ getPersistentState(): AdaptablePersistentState;
34
35
  getAllUserState(): BaseState[];
35
36
  loadUserState(state: InitialState): void;
36
37
  getAdaptableFilterState(): AdaptableFilterState;
@@ -57,7 +57,7 @@ class StateApiImpl extends ApiBase_1.ApiBase {
57
57
  }
58
58
  reloadInitialState(newInitialState) {
59
59
  const adaptableOptions = this.getOptions();
60
- const oldState = this.getPersistedState();
60
+ const oldState = this.getPersistentState();
61
61
  // clearing filters so that AG Grid doesnt display the filter icon in a column header after grid reloads
62
62
  // but this is a hack so would be nicer if there was a better way to do this
63
63
  this.getGridApi().clearFiltering();
@@ -75,7 +75,7 @@ class StateApiImpl extends ApiBase_1.ApiBase {
75
75
  initialState: newInitialState || adaptableOptions.initialState,
76
76
  flushCurrentState: false,
77
77
  }).then(() => {
78
- const newState = this.getPersistedState();
78
+ const newState = this.getPersistentState();
79
79
  this.getEventApi().internalApi.fireAdaptableStateReloadedEvent(oldState, newState);
80
80
  });
81
81
  });
@@ -85,11 +85,14 @@ class StateApiImpl extends ApiBase_1.ApiBase {
85
85
  return this.getAdaptableState();
86
86
  }
87
87
  getPersistedState() {
88
- // no assertion should be required here as soon as we make order in our state typings
88
+ (0, logDeprecation_1.logDeprecation)(this.getAdatableLogger(), 'StateApi', 'getPersistedState', 'getPersistentState');
89
+ return this.getPersistentState();
90
+ }
91
+ getPersistentState() {
89
92
  return this.getAdaptableStore().getCurrentStorageState();
90
93
  }
91
94
  getAllUserState() {
92
- return Object.values(this.getPersistedState());
95
+ return Object.values(this.getPersistentState());
93
96
  }
94
97
  loadUserState(state) {
95
98
  this.setAdaptableStateKey(this.getOptions().adaptableStateKey, {
@@ -1,10 +1,4 @@
1
- import { CustomSortOptions } from '../AdaptableOptions/CustomSortOptions';
2
- import { DataSetOptions } from '../AdaptableOptions/DataSetOptions';
3
- import { ActionColumnOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnMenuOptions, ColumnOptions, ContainerOptions, ContextMenuOptions, DashboardOptions, DataChangeHistoryOptions, EditOptions, EntitlementOptions, ExportOptions, FilterOptions, FlashingCellOptions, FormatColumnOptions, LayoutOptions, NoteOptions, NotificationsOptions, PredicateOptions, QuickSearchOptions, RowFormOptions, SettingsPanelOptions, StateOptions, TeamSharingOptions, ToolPanelOptions, UserInterfaceOptions } from '../types';
4
- import { Fdc3Options } from '../AdaptableOptions/Fdc3Options';
5
- import { ExpressionOptions } from '../AdaptableOptions/ExpressionOptions';
6
- import { DataImportOptions } from '../AdaptableOptions/DataImportOptions';
7
- import { CommentOptions } from '../AdaptableOptions/CommentOptions';
1
+ import { ActionColumnOptions, AdaptableOptions, AlertOptions, CalendarOptions, CellSummaryOptions, ChartingOptions, ColumnMenuOptions, ColumnOptions, CommentOptions, ContainerOptions, ContextMenuOptions, CustomSortOptions, DashboardOptions, DataChangeHistoryOptions, DataImportOptions, DataSetOptions, EditOptions, EntitlementOptions, ExportOptions, ExpressionOptions, Fdc3Options, FilterOptions, FlashingCellOptions, FormatColumnOptions, LayoutOptions, NoteOptions, NotificationsOptions, PredicateOptions, QuickSearchOptions, RowFormOptions, SettingsPanelOptions, StateOptions, TeamSharingOptions, ToolPanelOptions, UserInterfaceOptions } from '../types';
8
2
  /**
9
3
  * Range of functions to access Adaptable Options
10
4
  */
@@ -69,8 +69,15 @@ export interface StateApi {
69
69
  getAllState(): AdaptableState;
70
70
  /**
71
71
  * Retrieves persisted state in AdapTable, i.e. state last stored with `StateOptions.persistState()` function
72
+ *
73
+ * @deprecated use `getPersistentState()` instead
72
74
  */
73
75
  getPersistedState(): AdaptablePersistentState;
76
+ /**
77
+ * Retrieves the persistent state in Adaptable, i.e. state that is passed to the `StateOptions.persistState()` function.
78
+ *
79
+ */
80
+ getPersistentState(): AdaptablePersistentState;
74
81
  /**
75
82
  * Gets filter-related sections of Adaptable State
76
83
  */
@@ -29,9 +29,9 @@ class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
29
29
  ];
30
30
  }
31
31
  onAdaptableReady() {
32
- // make sure there is no zombie import process remaining (in case a previous import crashed)
33
- this.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingCommitImport());
34
32
  if (this.api.teamSharingApi.isTeamSharingAvailable()) {
33
+ // make sure there is no zombie import process remaining (in case a previous import crashed)
34
+ this.api.internalApi.dispatchReduxAction(TeamSharingRedux.TeamSharingCommitImport());
35
35
  this.api.teamSharingApi.refreshTeamSharing();
36
36
  }
37
37
  this.api.eventApi.on('AdaptableStateChanged', (adaptableStateChangedInfo) => this.handleStateChanged(adaptableStateChangedInfo));
@@ -17,7 +17,8 @@ function ReorderDraggable(props) {
17
17
  return (React.createElement(rebass_1.Flex, { className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier ?? index, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option", ...flexProps },
18
18
  React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
19
19
  reorderable ? (React.createElement(rebass_1.Box, { mr: 3, ...dragHandleProps },
20
- React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) : null,
20
+ React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) : (React.createElement(rebass_1.Box, { mr: 3 },
21
+ React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'not-allowed', opacity: 0.3 } }))),
21
22
  props.renderOption(option, index))));
22
23
  };
23
24
  const reorderable = isOptionDraggable ? isOptionDraggable(option) : true;
@@ -91,7 +91,7 @@ const DashboardComponent = (props) => {
91
91
  };
92
92
  const renderQuickSearch = () => {
93
93
  return (React.createElement(rebass_1.Box, { ml: 2 },
94
- React.createElement(QuickSearchInput_1.QuickSearchInput, { width: '7rem' })));
94
+ React.createElement(QuickSearchInput_1.QuickSearchInput, { width: '7rem', className: "ab-DashboardToolbar__QuickSearch__text" })));
95
95
  };
96
96
  let instanceName = props.api.internalApi.getToolbarTitle();
97
97
  let dashboardOptions = props.api.optionsApi.getDashboardOptions();
@@ -189,7 +189,7 @@ const ColumnRow = (props) => {
189
189
  props.onColumnNameChange(props.column.columnId, event.target.value);
190
190
  }, value: customHeader })),
191
191
  React.createElement(FormLayout_1.FormRow, { label: "Width" },
192
- React.createElement(Input_1.default, { "data-name": "column-width", className: "ab-Layout-Wizard__ColumnRow__Input", type: "number", placeholder: "Column width", onChange: (event) => {
192
+ React.createElement(Input_1.default, { "data-name": "column-width", className: "ab-Layout-Wizard__ColumnRow__Input", type: "number", placeholder: "Column width", disabled: !props.column.resizable, onChange: (event) => {
193
193
  let value = parseFloat(event.target.value);
194
194
  value = typeof value === 'number' && !isNaN(value) ? value : void 0;
195
195
  props.onColumnWidthChange(props.column.columnId, value);
@@ -381,7 +381,9 @@ const ColumnsSection = (props) => {
381
381
  React.createElement(rebass_1.Box, null,
382
382
  React.createElement(icons_1.NaturallySizedIcon, { name: "info" })),
383
383
  React.createElement(rebass_1.Text, { ml: 1 }, "Expand each Column to set Width, Pinnning and a custom Header")),
384
- React.createElement(ReorderDraggable_1.ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`, order: currentOrder, renderOption: (option) => {
384
+ React.createElement(ReorderDraggable_1.ReorderDraggable, { toIdentifier: (option) => `${option.columnId}`, isOptionDraggable: (option) => {
385
+ return option.moveable;
386
+ }, order: currentOrder, renderOption: (option) => {
385
387
  return (React.createElement(ColumnRow, { onColumnNameChange: handleColumnNameChange, onColumnWidthChange: handleColumnWidthChange, onColumnVisibilityChange: handleColumnVisibilityChange, onPinChange: handlePinChange, layout: layout, column: option }));
386
388
  }, onChange: handleColumnsChange }),
387
389
  (0, ValueSelector_1.renderSelectionSection)({
@@ -27,7 +27,7 @@ const PivotRowGroupingSection = (props) => {
27
27
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
28
28
  const allGroupableColumns = adaptable.api.columnApi.getGroupableColumns();
29
29
  const sortedGroupableColumns = React.useMemo(() => {
30
- return ArrayExtensions_1.default.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.RowGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
30
+ return ArrayExtensions_1.default.sortArrayWithOrder(allGroupableColumns.map((col) => col.columnId), layout.PivotGroupedColumns ?? [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
31
31
  }, [layout, allGroupableColumns]);
32
32
  const onChange = (layout) => {
33
33
  props.onChange((0, LayoutHelpers_1.normalizeLayout)(layout));
@@ -3,5 +3,6 @@ export interface QuickSearchInputProps {
3
3
  className?: string;
4
4
  autoFocus?: boolean;
5
5
  width?: string | number;
6
+ onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
6
7
  }
7
8
  export declare const QuickSearchInput: React.FunctionComponent<QuickSearchInputProps>;
@@ -21,7 +21,7 @@ const QuickSearchInput = (props) => {
21
21
  QuickSearchText,
22
22
  onRunQuickSearch,
23
23
  });
24
- return (react_1.default.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { "aria-label": 'Quick Search', type: "text", autoFocus: props.autoFocus, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: (0, join_1.default)('ab-DashboardToolbar__QuickSearch__text', props.className), value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: props.width ?? '10rem' }, actionTools: isServerSideRowModel ? null : (react_1.default.createElement(rebass_1.Box, { display: "flex", flexDirection: "row", alignItems: "center", flex: 'none' },
24
+ return (react_1.default.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { onClick: props.onClick, "aria-label": 'Quick Search', type: "text", autoFocus: props.autoFocus, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: (0, join_1.default)('ab-QuickSearch__control', props.className), value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: props.width ?? '10rem' }, actionTools: isServerSideRowModel ? null : (react_1.default.createElement(rebass_1.Box, { display: "flex", flexDirection: "row", alignItems: "center", flex: 'none' },
25
25
  react_1.default.createElement(SimpleButton_1.default, { "aria-label": 'Previous Match', icon: "arrow-up", px: 0, py: 0, mr: 1, disabled: !searchText, variant: "text", onClick: () => adaptable.api.quickSearchApi.gotoPreviousMatch() }),
26
26
  react_1.default.createElement(SimpleButton_1.default, { "aria-label": 'Next Match', icon: "arrow-down", px: 0, py: 0, mr: 1, disabled: !searchText, variant: "text", onClick: () => adaptable.api.quickSearchApi.gotoNextMatch() }))) }));
27
27
  };
@@ -3,15 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QuickSearchStatusBarContent = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const react_redux_1 = require("react-redux");
7
- const AdaptableContext_1 = require("../AdaptableContext");
8
- const AdaptableFormControlTextClear_1 = require("../Components/Forms/AdaptableFormControlTextClear");
9
- const QuickSearchRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QuickSearchRedux"));
6
+ const QuickSearchInput_1 = require("./QuickSearchInput");
10
7
  const QuickSearchStatusBarContent = () => {
11
- const text = (0, react_redux_1.useSelector)((state) => state.QuickSearch.QuickSearchText);
12
- const dispatch = (0, react_redux_1.useDispatch)();
13
- const adaptable = (0, AdaptableContext_1.useAdaptable)();
14
- const handleTextChange = React.useCallback((text) => dispatch(QuickSearchRedux.QuickSearchRun(text)), []);
15
- return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { onClick: (event) => event.stopPropagation(), type: "text", inputStyle: { padding: '2px 3px', width: 90 }, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, value: text, OnTextChange: handleTextChange }));
8
+ return React.createElement(QuickSearchInput_1.QuickSearchInput, { onClick: (event) => event.stopPropagation() });
16
9
  };
17
10
  exports.QuickSearchStatusBarContent = QuickSearchStatusBarContent;
@@ -9,7 +9,7 @@ const ExportDropdown = (props) => {
9
9
  const handleChange = (destination) => {
10
10
  switch (props.type) {
11
11
  case 'adaptableState':
12
- const adaptableState = props.api.stateApi.getPersistedState();
12
+ const adaptableState = props.api.stateApi.getPersistentState();
13
13
  (0, handleExportState_1.handleExportState)(destination, 'adaptableState', adaptableState);
14
14
  break;
15
15
  case 'initialState':
@@ -438,6 +438,7 @@ class AdaptableAgGrid {
438
438
  this.refreshHeader();
439
439
  const currentLayout = this.api.layoutApi.getCurrentLayout();
440
440
  (0, LayoutHelpers_1.checkForDuplicateColumns)(currentLayout);
441
+ this._prevLayout = currentLayout;
441
442
  this.__prevLayoutForRefresh = currentLayout;
442
443
  if ((0, LayoutHelpers_1.isPivotLayout)(currentLayout)) {
443
444
  // this is very very strange!
@@ -475,6 +475,7 @@ class AgGridAdapter {
475
475
  isTreeColumn,
476
476
  columnId: ColumnId,
477
477
  field: colDef.field,
478
+ resizable: colDef.resizable !== false,
478
479
  friendlyName: friendlyName,
479
480
  isPrimaryKey: ColumnId === pkColumn,
480
481
  dataType: dataType,
@@ -624,8 +625,8 @@ class AgGridAdapter {
624
625
  return false;
625
626
  }
626
627
  isColumnSortable(colDef) {
627
- if (colDef && colDef.sortable != null) {
628
- return colDef.sortable;
628
+ if (colDef) {
629
+ return colDef.sortable ?? true;
629
630
  }
630
631
  return false;
631
632
  }
@@ -114,9 +114,10 @@ class AgGridColumnAdapter {
114
114
  this.agGridApi.getAllGridColumns();
115
115
  if (pivotMode) {
116
116
  const pivotResultColumns = this.agGridApi.getPivotResultColumns() || [];
117
- if (pivotResultColumns.length) {
118
- cols = [...cols, ...pivotResultColumns];
119
- }
117
+ const autoGroupColumns = this.agGridApi
118
+ .getAllGridColumns()
119
+ .filter((column) => this.adaptableApi.columnApi.isAutoRowGroupColumn(column.getColId()));
120
+ cols = [...autoGroupColumns, ...cols, ...pivotResultColumns];
120
121
  }
121
122
  // this needs to be here, before the other setup below
122
123
  // so the setup methods below reference the correct columns in adaptable store
@@ -423,7 +423,7 @@ class AgGridExportAdapter {
423
423
  let rawValue = rowNode.key;
424
424
  return { columnId, rawValue };
425
425
  }
426
- if (this.adaptableApi.columnApi.isPivotResultColumn(agColumn.getColId())) {
426
+ if (!!rowNode.aggData) {
427
427
  const columnId = agColumn.getColId();
428
428
  const rawValue = rowNode.aggData?.[columnId];
429
429
  return { columnId, rawValue };