@adaptabletools/adaptable 15.4.1 → 15.4.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 (57) hide show
  1. package/bundle.cjs.js +117 -117
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +3 -0
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
  7. package/src/AdaptableOptions/FilterOptions.d.ts +3 -0
  8. package/src/AdaptableOptions/FinancePluginOptions.d.ts +24 -0
  9. package/src/AdaptableOptions/LayoutOptions.d.ts +3 -0
  10. package/src/AdaptableOptions/ToolPanelOptions.d.ts +3 -0
  11. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -0
  12. package/src/Api/BulkUpdateApi.d.ts +3 -3
  13. package/src/Api/ExportApi.d.ts +3 -3
  14. package/src/Api/GridApi.d.ts +30 -19
  15. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +2 -2
  16. package/src/Api/Implementation/BulkUpdateApiImpl.js +2 -2
  17. package/src/Api/Implementation/GridApiImpl.d.ts +5 -13
  18. package/src/Api/Implementation/GridApiImpl.js +46 -16
  19. package/src/Api/Implementation/PlusMinusApiImpl.d.ts +2 -2
  20. package/src/Api/Implementation/PlusMinusApiImpl.js +2 -2
  21. package/src/Api/Implementation/SmartEditApiImpl.d.ts +2 -2
  22. package/src/Api/Implementation/SmartEditApiImpl.js +2 -2
  23. package/src/Api/Internal/ActionInternalApi.d.ts +0 -1
  24. package/src/Api/Internal/ActionInternalApi.js +0 -28
  25. package/src/Api/Internal/GridInternalApi.d.ts +0 -3
  26. package/src/Api/Internal/GridInternalApi.js +0 -23
  27. package/src/Api/PlusMinusApi.d.ts +3 -3
  28. package/src/Api/SmartEditApi.d.ts +3 -3
  29. package/src/PredefinedConfig/AlertState.d.ts +8 -5
  30. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +13 -1
  31. package/src/PredefinedConfig/Common/Entitlement.d.ts +3 -0
  32. package/src/PredefinedConfig/Selection/GridCell.d.ts +21 -0
  33. package/src/PredefinedConfig/StyledColumnState.d.ts +3 -0
  34. package/src/Redux/ActionsReducers/BulkUpdateRedux.d.ts +3 -3
  35. package/src/Redux/ActionsReducers/BulkUpdateRedux.js +2 -2
  36. package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +3 -3
  37. package/src/Redux/ActionsReducers/PlusMinusRedux.js +2 -2
  38. package/src/Redux/ActionsReducers/SmartEditRedux.d.ts +3 -3
  39. package/src/Redux/ActionsReducers/SmartEditRedux.js +2 -2
  40. package/src/Redux/Store/AdaptableStore.js +5 -5
  41. package/src/Strategy/CalculatedColumnModule.d.ts +4 -1
  42. package/src/Strategy/CalculatedColumnModule.js +30 -13
  43. package/src/Strategy/Interface/ISmartEditModule.d.ts +2 -2
  44. package/src/Strategy/PlusMinusModule.js +10 -1
  45. package/src/Strategy/SmartEditModule.d.ts +2 -2
  46. package/src/Strategy/SmartEditModule.js +2 -2
  47. package/src/Utilities/Helpers/PreviewHelper.d.ts +3 -1
  48. package/src/Utilities/Helpers/PreviewHelper.js +31 -1
  49. package/src/View/Components/FilterForm/QuickFilterValues.js +8 -1
  50. package/src/agGrid/Adaptable.d.ts +0 -1
  51. package/src/agGrid/Adaptable.js +9 -11
  52. package/src/metamodel/adaptable.metamodel.d.ts +148 -0
  53. package/src/metamodel/adaptable.metamodel.js +1 -1
  54. package/src/parser/src/types.d.ts +3 -0
  55. package/src/types.d.ts +1 -1
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
@@ -37,11 +37,11 @@ export interface AlertDefinition extends SuspendableObject {
37
37
  */
38
38
  MessageType: AdaptableMessageType;
39
39
  /**
40
- * The Alert Title Message to display
40
+ * Title of dipslayed Alert Message
41
41
  */
42
42
  MessageHeader?: string;
43
43
  /**
44
- * Alert Message; if not provided AdapTable creates dynamically using Rule & Scope (Note: can be provided as a function in AlertOptions)
44
+ * Title of dipslayed Alert Message; if null, AdapTable creates dynamically using Rule & Scope
45
45
  */
46
46
  MessageText?: string;
47
47
  /**
@@ -53,6 +53,9 @@ export interface AlertDefinition extends SuspendableObject {
53
53
  */
54
54
  AlertForm?: string | AlertButtonForm;
55
55
  }
56
+ /**
57
+ * Form triggered by an Alert which contains only Buttons
58
+ */
56
59
  export declare type AlertButtonForm = Omit<AdaptableForm<AlertFormContext>, 'title' | 'buttons' | 'description'> & {
57
60
  Buttons?: AlertButton<AlertFormContext>[];
58
61
  };
@@ -104,15 +107,15 @@ export interface AlertProperties {
104
107
  */
105
108
  DisplayNotification?: boolean;
106
109
  /**
107
- * Notifiction duration, it defaults to NotificationOptions.duration
110
+ * Notifiction duration(defaults to `NotificationOptions.duration`)
108
111
  */
109
112
  NotificationDuration?: NotificationsOptions['duration'];
110
113
  /**
111
- * Colours updated cell using `MessageType` property of triggering Alert Definition
114
+ * Colours updated Row using `MessageType` of triggering Alert Definition
112
115
  */
113
116
  HighlightCell?: boolean | AdaptableStyle;
114
117
  /**
115
- * Colours updated cell using `MessageType` property of triggering Alert Definition
118
+ * Colours updated Row using `MessageType` of triggering Alert Definition
116
119
  */
117
120
  HighlightRow?: boolean | AdaptableStyle;
118
121
  /**
@@ -15,9 +15,12 @@ export interface AdaptablePredicate {
15
15
  */
16
16
  Inputs?: any[];
17
17
  }
18
+ /**
19
+ * Restricts a Predicate to a given Column
20
+ */
18
21
  export interface AdaptableColumnPredicate extends AdaptablePredicate {
19
22
  /**
20
- * If specified, ColumnId restricts the predicate evaluation to the given column
23
+ * Id of Column which will be evaluated by the Predicate
21
24
  */
22
25
  ColumnId?: string;
23
26
  }
@@ -68,6 +71,9 @@ export interface AdaptablePredicateDef {
68
71
  */
69
72
  onlyQuickFilter?: boolean;
70
73
  }
74
+ /**
75
+ * Defines an Input to a Predicate
76
+ */
71
77
  export interface PredicateDefInput {
72
78
  type: 'number' | 'text' | 'date' | 'boolean';
73
79
  label?: string;
@@ -106,9 +112,15 @@ export interface PredicateDefHandlerParams {
106
112
  */
107
113
  api: AdaptableApi;
108
114
  }
115
+ /**
116
+ * Inputs required for a Predicate
117
+ */
109
118
  export interface PredicateDefToStringParams {
110
119
  inputs: any[];
111
120
  }
121
+ /**
122
+ * Defines which in Modules the Predicate is available
123
+ */
112
124
  export declare type PredicateModuleScope = 'filter' | 'alert' | 'flashingcell' | 'formatColumn' | 'badgeStyle';
113
125
  /**
114
126
  * Array of Predicate Defs which are shipped by AdapTable
@@ -1,4 +1,7 @@
1
1
  import { AdaptableModule } from './Types';
2
+ /**
3
+ * Defines a Permission in AdapTable - Module and Access Level
4
+ */
2
5
  export interface Entitlement {
3
6
  /**
4
7
  * Name of Adaptable Module that has the Entitlement applied
@@ -29,3 +29,24 @@ export interface GridCell<TData = any> {
29
29
  */
30
30
  rowNode: IRowNode<TData>;
31
31
  }
32
+ /**
33
+ * Lightweight object used for identifying a Cell to be updated
34
+ */
35
+ export interface CellUpdateRequest<TData = any> {
36
+ /**
37
+ * Id of Column in which edited cell is situated
38
+ */
39
+ columnId: string;
40
+ /**
41
+ * New Value for the cell
42
+ */
43
+ newValue: any;
44
+ /**
45
+ * Primary Key column's value in row - how Adaptable locates the cell
46
+ */
47
+ primaryKeyValue?: any;
48
+ /**
49
+ * AG Grid Row Node that contains the cell (optional)
50
+ */
51
+ rowNode?: IRowNode<TData>;
52
+ }
@@ -69,6 +69,9 @@ export interface PercentBarStyle extends NumericStyledColumn {
69
69
  */
70
70
  BackColor?: string;
71
71
  }
72
+ /**
73
+ * Base type for Numeric Styled Columns (i.e. Gradient and Percent Bar)
74
+ */
72
75
  export interface NumericStyledColumn {
73
76
  /**
74
77
  * Ranges (e.g. to create traffic light effect)
@@ -1,5 +1,5 @@
1
1
  import * as Redux from 'redux';
2
- import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
2
+ import { CellUpdateRequest } from '../../PredefinedConfig/Selection/GridCell';
3
3
  /**
4
4
  * @ReduxAction Bulk Update has been completed
5
5
  */
@@ -16,10 +16,10 @@ export interface BulkUpdateCompleteAction extends Redux.Action {
16
16
  bypassValidationWarnings: boolean;
17
17
  }
18
18
  export interface BulkUpdateApplyAction extends Redux.Action {
19
- gridCells: GridCell[];
19
+ cellUpdateRequests: CellUpdateRequest[];
20
20
  }
21
21
  export interface BulkUpdateReadyAction extends Redux.Action {
22
22
  }
23
23
  export declare const BulkUpdateComplete: (bypassValidationWarnings: boolean) => BulkUpdateCompleteAction;
24
- export declare const BulkUpdateApply: (gridCells: GridCell[]) => BulkUpdateApplyAction;
24
+ export declare const BulkUpdateApply: (cellUpdateRequests: CellUpdateRequest[]) => BulkUpdateApplyAction;
25
25
  export declare const BulkUpdateReady: () => BulkUpdateReadyAction;
@@ -18,9 +18,9 @@ const BulkUpdateComplete = (bypassValidationWarnings) => ({
18
18
  bypassValidationWarnings: bypassValidationWarnings,
19
19
  });
20
20
  exports.BulkUpdateComplete = BulkUpdateComplete;
21
- const BulkUpdateApply = (gridCells) => ({
21
+ const BulkUpdateApply = (cellUpdateRequests) => ({
22
22
  type: exports.BULK_UPDATE_APPLY,
23
- gridCells,
23
+ cellUpdateRequests,
24
24
  });
25
25
  exports.BulkUpdateApply = BulkUpdateApply;
26
26
  const BulkUpdateReady = () => ({
@@ -1,6 +1,6 @@
1
1
  import { PlusMinusState, PlusMinusNudge } from '../../PredefinedConfig/PlusMinusState';
2
2
  import * as Redux from 'redux';
3
- import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
3
+ import { CellUpdateRequest } from '../../PredefinedConfig/Selection/GridCell';
4
4
  /**
5
5
  * @ReduxAction A Plus Minus Rule has been applied
6
6
  */
@@ -38,7 +38,7 @@ export declare const PLUS_MINUS_RULE_UNSUSPEND_ALL = "PLUS_MINUS_RULE_UNSUSPEND_
38
38
  */
39
39
  export declare const PLUS_MINUS_READY = "PLUS_MINUS_READY";
40
40
  export interface PlusMinusApplyAction extends Redux.Action {
41
- gridCells: GridCell[];
41
+ cellUpdateRequests: CellUpdateRequest[];
42
42
  }
43
43
  export interface PlusMinusNudgeAction extends Redux.Action {
44
44
  plusMinusNudge: PlusMinusNudge;
@@ -60,7 +60,7 @@ export interface PlusMinusNudgeUnSuspendAllAction extends Redux.Action {
60
60
  export interface PlusMinusReadyAction extends Redux.Action {
61
61
  plusMinusState: PlusMinusState;
62
62
  }
63
- export declare const PlusMinusApply: (gridCells: GridCell[]) => PlusMinusApplyAction;
63
+ export declare const PlusMinusApply: (cellUpdateRequests: CellUpdateRequest[]) => PlusMinusApplyAction;
64
64
  export declare const PlusMinusNudgeAdd: (plusMinusNudge: PlusMinusNudge) => PlusMinusNudgeAddAction;
65
65
  export declare const PlusMinusNudgeEdit: (plusMinusNudge: PlusMinusNudge) => PlusMinusNudgeEditAction;
66
66
  export declare const PlusMinusNudgeDelete: (plusMinusNudge: PlusMinusNudge) => PlusMinusNudgeDeleteAction;
@@ -41,9 +41,9 @@ exports.PLUS_MINUS_RULE_UNSUSPEND_ALL = 'PLUS_MINUS_RULE_UNSUSPEND_ALL';
41
41
  * @ReduxAction PlusMinus Module is ready
42
42
  */
43
43
  exports.PLUS_MINUS_READY = 'PLUS_MINUS_READY';
44
- const PlusMinusApply = (gridCells) => ({
44
+ const PlusMinusApply = (cellUpdateRequests) => ({
45
45
  type: exports.PLUS_MINUS_APPLY,
46
- gridCells,
46
+ cellUpdateRequests,
47
47
  });
48
48
  exports.PlusMinusApply = PlusMinusApply;
49
49
  const PlusMinusNudgeAdd = (plusMinusNudge) => ({
@@ -1,5 +1,5 @@
1
1
  import * as Redux from 'redux';
2
- import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
2
+ import { CellUpdateRequest } from '../../PredefinedConfig/Selection/GridCell';
3
3
  /**
4
4
  * @ReduxAction Smart Edit has been completed
5
5
  */
@@ -16,10 +16,10 @@ export interface SmartEditRunAction extends Redux.Action {
16
16
  bypassValidationWarnings: boolean;
17
17
  }
18
18
  export interface SmartEditApplyAction extends Redux.Action {
19
- gridCells: GridCell[];
19
+ cellUpdateRequests: CellUpdateRequest[];
20
20
  }
21
21
  export interface SmartEditReadyAction extends Redux.Action {
22
22
  }
23
23
  export declare const SmartEditRun: (bypassValidationWarnings: boolean) => SmartEditRunAction;
24
- export declare const SmartEditApply: (gridCells: GridCell[]) => SmartEditApplyAction;
24
+ export declare const SmartEditApply: (cellUpdateRequests: CellUpdateRequest[]) => SmartEditApplyAction;
25
25
  export declare const SmartEditReady: () => SmartEditReadyAction;
@@ -18,9 +18,9 @@ const SmartEditRun = (bypassValidationWarnings) => ({
18
18
  bypassValidationWarnings: bypassValidationWarnings,
19
19
  });
20
20
  exports.SmartEditRun = SmartEditRun;
21
- const SmartEditApply = (gridCells) => ({
21
+ const SmartEditApply = (cellUpdateRequests) => ({
22
22
  type: exports.SMART_EDIT_APPLY,
23
- gridCells,
23
+ cellUpdateRequests,
24
24
  });
25
25
  exports.SmartEditApply = SmartEditApply;
26
26
  const SmartEditReady = () => ({
@@ -1035,7 +1035,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1035
1035
  let module = (adaptable.adaptableModules.get(ModuleConstants.SmartEditModuleId));
1036
1036
  const actionTyped = action;
1037
1037
  let thePreview = middlewareAPI.getState().System.SmartEditPreviewInfo;
1038
- let newValues = PreviewHelper_1.PreviewHelper.GetCellInfosFromPreview(thePreview, actionTyped.bypassValidationWarnings);
1038
+ let newValues = PreviewHelper_1.PreviewHelper.GetCellUpdateRequestsFromPreview(thePreview, actionTyped.bypassValidationWarnings);
1039
1039
  module.ApplySmartEdit(newValues);
1040
1040
  middlewareAPI.dispatch(PopupRedux.PopupHideScreen());
1041
1041
  return next(action);
@@ -1047,7 +1047,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1047
1047
  case SmartEditRedux.SMART_EDIT_APPLY: {
1048
1048
  let returnAction = next(action);
1049
1049
  const actionTyped = action;
1050
- adaptable.api.gridApi.internalApi.setGridCells(actionTyped.gridCells);
1050
+ adaptable.api.gridApi.setCellValues(actionTyped.cellUpdateRequests);
1051
1051
  return returnAction;
1052
1052
  }
1053
1053
  /*******************
@@ -1090,7 +1090,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1090
1090
  case BulkUpdateRedux.BULK_UPDATE_COMPLETE: {
1091
1091
  const actionTyped = action;
1092
1092
  let thePreview = middlewareAPI.getState().System.BulkUpdatePreviewInfo;
1093
- let newValues = PreviewHelper_1.PreviewHelper.GetCellInfosFromPreview(thePreview, actionTyped.bypassValidationWarnings);
1093
+ let newValues = PreviewHelper_1.PreviewHelper.GetCellUpdateRequestsFromPreview(thePreview, actionTyped.bypassValidationWarnings);
1094
1094
  adaptable.api.bulkUpdateApi.applyBulkUpdate(newValues);
1095
1095
  middlewareAPI.dispatch(PopupRedux.PopupHideScreen());
1096
1096
  return next(action);
@@ -1098,7 +1098,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1098
1098
  case BulkUpdateRedux.BULK_UPDATE_APPLY: {
1099
1099
  let returnAction = next(action);
1100
1100
  const actionTyped = action;
1101
- adaptable.api.gridApi.internalApi.setGridCells(actionTyped.gridCells);
1101
+ adaptable.api.gridApi.setCellValues(actionTyped.cellUpdateRequests);
1102
1102
  return returnAction;
1103
1103
  }
1104
1104
  /*******************
@@ -1125,7 +1125,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1125
1125
  case PlusMinusRedux.PLUS_MINUS_APPLY: {
1126
1126
  let returnAction = next(action);
1127
1127
  const actionTyped = action;
1128
- adaptable.api.gridApi.internalApi.setGridCells(actionTyped.gridCells);
1128
+ adaptable.api.gridApi.setCellValues(actionTyped.cellUpdateRequests);
1129
1129
  return returnAction;
1130
1130
  }
1131
1131
  /*******************
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
- import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
4
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
5
5
  import * as CalculatedColumnRedux from '../Redux/ActionsReducers/CalculatedColumnRedux';
6
6
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
7
7
  import { CalculatedColumn } from '../PredefinedConfig/CalculatedColumnState';
@@ -16,7 +16,10 @@ export declare class CalculatedColumnModule extends AdaptableModuleBase implemen
16
16
  updateOldConfig(): void;
17
17
  getExplicitlyReferencedColumnIds(calculatedColumn: CalculatedColumn): string[];
18
18
  getReferencedNamedQueryNames(calculatedColumn: CalculatedColumn): string[];
19
+ private isCalculatedColumn;
19
20
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
21
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
22
+ createEditCalculatedColumnMenuItem(column: AdaptableColumn): AdaptableMenuItem[];
20
23
  getTeamSharingAction(): TeamSharingImportInfo<CalculatedColumn>;
21
24
  toView(calculateColumn: CalculatedColumn): {
22
25
  items: AdaptableObjectItemView[];
@@ -10,6 +10,7 @@ const CalculatedColumnWizard_1 = require("../View/CalculatedColumn/Wizard/Calcul
10
10
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
11
11
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
12
12
  const getCalculatedColumnSettingsTags_1 = require("../View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags");
13
+ const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
13
14
  class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
14
15
  constructor(api) {
15
16
  super(ModuleConstants.CalculatedColumnModuleId, ModuleConstants.CalculatedColumnFriendlyName, 'chart-and-grid', 'CalculatedColumnPopup', 'Create bespoke columns whose cell value is derived dynamically from an Expression', api);
@@ -51,22 +52,38 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
51
52
  var _a;
52
53
  return ((_a = this.api.queryApi.internalApi.getReferencedNamedQueryNames(this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query))) !== null && _a !== void 0 ? _a : []);
53
54
  }
54
- addColumnMenuItems(column) {
55
- if (column && this.isModuleEditable()) {
56
- if (this.api.calculatedColumnApi
55
+ isCalculatedColumn(column) {
56
+ return (column &&
57
+ Helper_1.default.objectExists(this.api.calculatedColumnApi
57
58
  .getCalculatedColumns()
58
- .find((cc) => cc.ColumnId == column.columnId)) {
59
- let popupParam = {
60
- column: column,
61
- action: 'Edit',
62
- source: 'ColumnMenu',
63
- };
64
- return [
65
- this.createColumnMenuItemShowPopup('Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
66
- ];
67
- }
59
+ .find((cc) => cc.ColumnId == column.columnId)));
60
+ }
61
+ addColumnMenuItems(column) {
62
+ if (this.isModuleEditable() && this.isCalculatedColumn(column)) {
63
+ return this.createEditCalculatedColumnMenuItem(column);
68
64
  }
69
65
  }
66
+ addContextMenuItems(menuContext) {
67
+ if (!this.isModuleAvailable()) {
68
+ return;
69
+ }
70
+ if (this.isModuleEditable() &&
71
+ this.isCalculatedColumn(menuContext.adaptableColumn) &&
72
+ !menuContext.isRowGroupColumn &&
73
+ menuContext.isSingleSelectedCell) {
74
+ return this.createEditCalculatedColumnMenuItem(menuContext.adaptableColumn);
75
+ }
76
+ }
77
+ createEditCalculatedColumnMenuItem(column) {
78
+ let popupParam = {
79
+ column: column,
80
+ action: 'Edit',
81
+ source: 'ColumnMenu',
82
+ };
83
+ return [
84
+ this.createColumnMenuItemShowPopup('Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
85
+ ];
86
+ }
70
87
  getTeamSharingAction() {
71
88
  return {
72
89
  ModuleEntities: this.api.calculatedColumnApi.getCalculatedColumns(),
@@ -2,9 +2,9 @@ import { IModule } from './IModule';
2
2
  import { IModuleActionReturn } from './IModuleActionReturn';
3
3
  import { MathOperation } from '../../PredefinedConfig/Common/Enums';
4
4
  import { PreviewInfo } from '../../Utilities/Interface/Preview';
5
- import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
5
+ import { CellUpdateRequest } from '../../PredefinedConfig/Selection/GridCell';
6
6
  export interface ISmartEditModule extends IModule {
7
7
  CheckCorrectCellSelection(): IModuleActionReturn<boolean>;
8
8
  BuildPreviewValues(smartEditValue: number, smartEditOperation: MathOperation): PreviewInfo;
9
- ApplySmartEdit(newValues: GridCell[]): void;
9
+ ApplySmartEdit(cellUpdateRequests: CellUpdateRequest[]): void;
10
10
  }
@@ -144,7 +144,16 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
144
144
  });
145
145
  this.ShowErrorPreventMessage(failedPreventEdits);
146
146
  if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(successfulValues)) {
147
- this.api.plusMinusApi.applyPlusMinus(successfulValues);
147
+ const cellUpdateRequests = [];
148
+ successfulValues.forEach((gridCell) => {
149
+ cellUpdateRequests.push({
150
+ columnId: gridCell.column.columnId,
151
+ newValue: gridCell.normalisedValue,
152
+ primaryKeyValue: gridCell.primaryKeyValue,
153
+ rowNode: gridCell.rowNode,
154
+ });
155
+ });
156
+ this.api.plusMinusApi.applyPlusMinus(cellUpdateRequests);
148
157
  }
149
158
  return shouldApplyPlusMinus;
150
159
  }
@@ -2,7 +2,7 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import { IModuleActionReturn } from './Interface/IModuleActionReturn';
3
3
  import { ISmartEditModule } from './Interface/ISmartEditModule';
4
4
  import { PreviewInfo } from '../Utilities/Interface/Preview';
5
- import { GridCell } from '../PredefinedConfig/Selection/GridCell';
5
+ import { CellUpdateRequest } from '../PredefinedConfig/Selection/GridCell';
6
6
  import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
7
7
  import { AdaptableApi } from '../Api/AdaptableApi';
8
8
  import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
@@ -11,7 +11,7 @@ export declare class SmartEditModule extends AdaptableModuleBase implements ISma
11
11
  constructor(api: AdaptableApi);
12
12
  getViewAccessLevel(): AccessLevel;
13
13
  addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
14
- ApplySmartEdit(newValues: GridCell[]): void;
14
+ ApplySmartEdit(cellUpdateRequests: CellUpdateRequest[]): void;
15
15
  CheckCorrectCellSelection(): IModuleActionReturn<boolean>;
16
16
  BuildPreviewValues(smartEditValue: number, smartEditOperation: SmartEditOperation): PreviewInfo;
17
17
  }
@@ -41,8 +41,8 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
41
41
  }
42
42
  return [menuItemShowPopup];
43
43
  }
44
- ApplySmartEdit(newValues) {
45
- this.api.smartEditApi.applySmartEdit(newValues);
44
+ ApplySmartEdit(cellUpdateRequests) {
45
+ this.api.smartEditApi.applySmartEdit(cellUpdateRequests);
46
46
  }
47
47
  CheckCorrectCellSelection() {
48
48
  let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
@@ -1,11 +1,13 @@
1
1
  import { PreviewResult, PreviewValidationSummary, PreviewInfo } from '../Interface/Preview';
2
- import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
2
+ import { CellUpdateRequest, GridCell } from '../../PredefinedConfig/Selection/GridCell';
3
3
  export declare function GetPreviewValidationSummary(previewResults: PreviewResult[]): PreviewValidationSummary;
4
4
  export declare function GetValidationMessage(previewInfo: PreviewInfo, newValue: string): string;
5
5
  export declare function GetCellInfosFromPreview(previewInfo: PreviewInfo, bypassValidationWarnings: boolean): GridCell[];
6
+ export declare function GetCellUpdateRequestsFromPreview(previewInfo: PreviewInfo, bypassValidationWarnings: boolean): CellUpdateRequest[];
6
7
  export declare const PreviewHelper: {
7
8
  GetPreviewValidationSummary: typeof GetPreviewValidationSummary;
8
9
  GetValidationMessage: typeof GetValidationMessage;
9
10
  GetCellInfosFromPreview: typeof GetCellInfosFromPreview;
11
+ GetCellUpdateRequestsFromPreview: typeof GetCellUpdateRequestsFromPreview;
10
12
  };
11
13
  export default PreviewHelper;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PreviewHelper = exports.GetCellInfosFromPreview = exports.GetValidationMessage = exports.GetPreviewValidationSummary = void 0;
3
+ exports.PreviewHelper = exports.GetCellUpdateRequestsFromPreview = exports.GetCellInfosFromPreview = exports.GetValidationMessage = exports.GetPreviewValidationSummary = void 0;
4
4
  const StringExtensions_1 = require("../Extensions/StringExtensions");
5
5
  function GetPreviewValidationSummary(previewResults) {
6
6
  let hasAnyValidation = false;
@@ -65,9 +65,39 @@ function GetCellInfosFromPreview(previewInfo, bypassValidationWarnings) {
65
65
  return newValues;
66
66
  }
67
67
  exports.GetCellInfosFromPreview = GetCellInfosFromPreview;
68
+ function GetCellUpdateRequestsFromPreview(previewInfo, bypassValidationWarnings) {
69
+ let newValues = [];
70
+ if (bypassValidationWarnings) {
71
+ for (let previewResult of previewInfo.previewResults) {
72
+ if (previewResult.validationRules.length == 0) {
73
+ newValues.push({
74
+ primaryKeyValue: previewResult.id,
75
+ newValue: previewResult.computedValue,
76
+ rowNode: previewResult.rowNode,
77
+ columnId: previewInfo.column.columnId,
78
+ });
79
+ }
80
+ }
81
+ }
82
+ else {
83
+ previewInfo.previewResults
84
+ .filter((p) => p.validationRules.length == 0)
85
+ .forEach((pr) => {
86
+ newValues.push({
87
+ primaryKeyValue: pr.id,
88
+ columnId: previewInfo.column.columnId,
89
+ newValue: pr.computedValue,
90
+ rowNode: pr.rowNode,
91
+ });
92
+ });
93
+ }
94
+ return newValues;
95
+ }
96
+ exports.GetCellUpdateRequestsFromPreview = GetCellUpdateRequestsFromPreview;
68
97
  exports.PreviewHelper = {
69
98
  GetPreviewValidationSummary,
70
99
  GetValidationMessage,
71
100
  GetCellInfosFromPreview,
101
+ GetCellUpdateRequestsFromPreview,
72
102
  };
73
103
  exports.default = exports.PreviewHelper;
@@ -21,6 +21,13 @@ const QuickFilterValues = (props) => {
21
21
  counter: 0,
22
22
  });
23
23
  const [transientColumnFilter, setTransientColumnFilter] = React.useState(null);
24
+ const clearColumnFilter = () => {
25
+ var _a;
26
+ props.clearColumnFilter();
27
+ if (!((_a = props.api.optionsApi.getFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter)) {
28
+ props.api.gridApi.applyGridFiltering();
29
+ }
30
+ };
24
31
  const onColumnValueSelectedChange = (columnValues) => {
25
32
  var _a;
26
33
  const { columnFilter } = props;
@@ -151,7 +158,7 @@ const QuickFilterValues = (props) => {
151
158
  width: getPopoverWidth(targetWidth),
152
159
  } },
153
160
  React.createElement(rebass_1.Flex, { m: 2 },
154
- React.createElement(SimpleButton_1.default, { onClick: () => props.clearColumnFilter() }, "Clear Filter"),
161
+ React.createElement(SimpleButton_1.default, { onClick: () => clearColumnFilter() }, "Clear Filter"),
155
162
  ((_a = api.optionsApi.getFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) == false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => {
156
163
  if (transientColumnFilter) {
157
164
  props.updateColumnFilter(transientColumnFilter);
@@ -199,7 +199,6 @@ export declare class Adaptable implements IAdaptable {
199
199
  setSelectedCells(): SelectedCellInfo | undefined;
200
200
  setSelectedRows(): SelectedRowInfo | undefined;
201
201
  setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: IRowNode): void;
202
- setCellValue(cellDataChangedInfo: CellDataChangedInfo): void;
203
202
  cancelEdit(): void;
204
203
  isCellEditable(rowNode: IRowNode, column: Column): boolean;
205
204
  getGridCellsForColumn(columnId: string): GridCell[] | undefined;
@@ -67,6 +67,7 @@ const ChartingService_1 = require("../Utilities/Services/ChartingService");
67
67
  const ThemeService_1 = require("../Utilities/Services/ThemeService");
68
68
  const AdaptableLogger_1 = require("./AdaptableLogger");
69
69
  const attachAddaptableColumnTypes_1 = require("./attachAddaptableColumnTypes");
70
+ const FormatHelper_1 = require("../Utilities/Helpers/FormatHelper");
70
71
  const tinycolor = require('tinycolor2');
71
72
  const GROUP_PATH_SEPARATOR = '/';
72
73
  // IMPORTANT - we need colId to be set in order for safeSetColDefs to work correctly
@@ -1779,9 +1780,6 @@ class Adaptable {
1779
1780
  }
1780
1781
  }
1781
1782
  }
1782
- setCellValue(cellDataChangedInfo) {
1783
- this.setDataValue(cellDataChangedInfo.newValue, cellDataChangedInfo.column, cellDataChangedInfo.primaryKeyValue, cellDataChangedInfo.rowNode);
1784
- }
1785
1783
  cancelEdit() {
1786
1784
  this.gridOptions.api.stopEditing(true);
1787
1785
  }
@@ -4654,11 +4652,10 @@ class Adaptable {
4654
4652
  }
4655
4653
  const excelDataType = this.api.exportApi.internalApi.getExcelDataType(colDef === null || colDef === void 0 ? void 0 : colDef.type);
4656
4654
  const rawValue = this.getRawValueFromRowNode(node, column.getId());
4657
- // don't add the cell style if it has no adaptable custom styles or user defined styles
4658
- if (rawValue == undefined ||
4659
- (!excelStyles.length &&
4660
- // if this is a formatted Date value, we still need to add the AG GRID specific type & numberFormat below
4661
- !(excelDataType === 'DateTime' && isDateCellExportedAsFormattedValue))) {
4655
+ // don't add the cell style if it has no adaptable custom styles
4656
+ if (!excelStyles.length &&
4657
+ // if this is a formatted Date value, we still need to add the AG GRID specific type & numberFormat below
4658
+ !(excelDataType === 'DateTime' && isDateCellExportedAsFormattedValue)) {
4662
4659
  return;
4663
4660
  }
4664
4661
  const cellClassId = this.getExcelClassNameForCell(column.getId(), this.getPrimaryKeyValueFromRowNode(node), userDefinedCellClass);
@@ -4677,9 +4674,10 @@ class Adaptable {
4677
4674
  if (normalisedValue) {
4678
4675
  // we have to pass the date in the ISO format to Excel
4679
4676
  // see https://www.ag-grid.com/javascript-data-grid/excel-export-data-types/#dates
4680
- // we also need to remove the timezone info from the date
4681
- const dateWithoutTimezoneCorrection = new Date(Date.UTC(normalisedValue.getFullYear(), normalisedValue.getMonth(), normalisedValue.getDate()));
4682
- const isoFormattedValue = dateWithoutTimezoneCorrection.toISOString();
4677
+ // we can NOT use Date.toISOString() because we don't want the timezone corrections to kick in
4678
+ const isoFormattedValue = (0, FormatHelper_1.DateFormatter)(normalisedValue, {
4679
+ Pattern: `yyyy-MM-dd'T'HH:mm:ss.SSS`,
4680
+ });
4683
4681
  if (isoFormattedValue) {
4684
4682
  finalCellExcelStyle.dataType = 'DateTime';
4685
4683
  finalCellExcelStyle.numberFormat = { format: dateFormatPattern };