@adaptabletools/adaptable 23.0.5 → 23.0.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 (43) hide show
  1. package/index.css +10 -1
  2. package/package.json +1 -1
  3. package/src/AdaptableOptions/AdaptableOptions.d.ts +9 -0
  4. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +7 -0
  5. package/src/AdaptableOptions/DefaultAdaptableOptions.d.ts +17 -0
  6. package/src/AdaptableOptions/DefaultAdaptableOptions.js +8 -46
  7. package/src/AdaptableOptions/EditOptions.d.ts +10 -2
  8. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -28
  9. package/src/AdaptableOptions/WizardOptions.d.ts +25 -0
  10. package/src/AdaptableOptions/WizardOptions.js +1 -0
  11. package/src/AdaptableState/Common/CustomWindowConfig.d.ts +2 -14
  12. package/src/AdaptableState/Common/Window.d.ts +33 -0
  13. package/src/AdaptableState/Common/Window.js +1 -0
  14. package/src/AdaptableState/InitialState.d.ts +2 -1
  15. package/src/AdaptableState/PlusMinusState.d.ts +12 -2
  16. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +10 -9
  17. package/src/Redux/ActionsReducers/InternalRedux.d.ts +2 -1
  18. package/src/Redux/ActionsReducers/InternalRedux.js +25 -27
  19. package/src/Strategy/DataChangeHistoryModule.js +1 -1
  20. package/src/Strategy/PlusMinusModule.js +5 -3
  21. package/src/Utilities/Extensions/ObjectExtensions.d.ts +16 -0
  22. package/src/Utilities/Extensions/ObjectExtensions.js +41 -0
  23. package/src/Utilities/Helpers/PlusMinusHelper.d.ts +62 -9
  24. package/src/Utilities/Helpers/PlusMinusHelper.js +180 -25
  25. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +5 -1
  26. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +7 -3
  27. package/src/View/Components/Popups/Utilities.d.ts +11 -0
  28. package/src/View/Components/Popups/Utilities.js +8 -0
  29. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +3 -4
  30. package/src/View/DataChangeHistory/dataChangeHistoryHelpers.js +1 -1
  31. package/src/View/PlusMinus/Wizard/KeyComboCaptureInput.d.ts +30 -0
  32. package/src/View/PlusMinus/Wizard/KeyComboCaptureInput.js +161 -0
  33. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +30 -60
  34. package/src/View/Wizard/OnePageWizards.js +27 -2
  35. package/src/agGrid/AdaptableAgGrid.js +2 -0
  36. package/src/components/ui/input-group.js +0 -1
  37. package/src/env.js +2 -2
  38. package/src/migration/DeprecatedStateKeys.d.ts +37 -0
  39. package/src/migration/DeprecatedStateKeys.js +42 -0
  40. package/src/migration/VersionUpgrade23.d.ts +9 -0
  41. package/src/migration/VersionUpgrade23.js +1 -2
  42. package/src/types.d.ts +4 -2
  43. package/tsconfig.esm.tsbuildinfo +1 -1
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer adaptable.reset, adaptable.components, adaptable.utilities, adaptable.theming;
4
4
  @property --tw-animation-delay {
@@ -1556,6 +1556,9 @@
1556
1556
  .twa\:border-\[var\(--ab-cmp-wizard-type-selection-card__selected-border\)\] {
1557
1557
  border-color: var(--ab-cmp-wizard-type-selection-card__selected-border);
1558
1558
  }
1559
+ .twa\:border-accent {
1560
+ border-color: var(--ab-color-accent);
1561
+ }
1559
1562
  .twa\:border-border {
1560
1563
  border-color: var(--ab-color-border);
1561
1564
  }
@@ -1567,6 +1570,9 @@
1567
1570
  border-color: color-mix(in oklab, var(--ab-color-border) 60%, transparent);
1568
1571
  }
1569
1572
  }
1573
+ .twa\:border-destructive {
1574
+ border-color: var(--ab-color-destructive);
1575
+ }
1570
1576
  .twa\:border-foreground\/10 {
1571
1577
  border-color: var(--ab-color-foreground);
1572
1578
  }
@@ -1864,6 +1870,9 @@
1864
1870
  .twa\:py-3 {
1865
1871
  padding-block: calc(var(--ab-base-space) * 3);
1866
1872
  }
1873
+ .twa\:py-\[2px\] {
1874
+ padding-block: 2px;
1875
+ }
1867
1876
  .twa\:\!pt-0 {
1868
1877
  padding-top: 0 !important;
1869
1878
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "23.0.5",
3
+ "version": "23.0.7",
4
4
  "description": "Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -13,6 +13,7 @@ import { DashboardOptions } from './DashboardOptions';
13
13
  import { ToolPanelOptions } from './ToolPanelOptions';
14
14
  import { DataChangeHistoryOptions } from './DataChangeHistoryOptions';
15
15
  import { SettingsPanelOptions } from './SettingsPanelOptions';
16
+ import { WizardOptions } from './WizardOptions';
16
17
  import { FlashingCellOptions } from './FlashingCellOptions';
17
18
  import { AlertOptions } from './AlertOptions';
18
19
  import { ExpressionOptions } from './ExpressionOptions';
@@ -228,6 +229,14 @@ export interface AdaptableOptions<TData = any, TContext = Record<string, any>> {
228
229
  * @noCodeContainer
229
230
  */
230
231
  settingsPanelOptions?: SettingsPanelOptions;
232
+ /**
233
+ * Options for managing Wizards (and other action popups such as Bulk Update,
234
+ * Smart Edit and Cell Summary) — controls their `popupType`, initial
235
+ * `position` and `size` independently of the Settings Panel.
236
+ *
237
+ * @noCodeContainer
238
+ */
239
+ wizardOptions?: WizardOptions;
231
240
  /**
232
241
  * Options related to state hydration / dehydration - allows users to intercept state persistence and state loading and change default behaviour of saving to local storage
233
242
  */
@@ -28,6 +28,13 @@ export interface DataChangeHistoryOptions<TData = any> {
28
28
  * @defaultValue true
29
29
  */
30
30
  showLastDataChangeOnly?: boolean;
31
+ /**
32
+ * How many data changes are held in State at any one time; when the limit is breached, the oldest change(s) are evicted from memory
33
+ *
34
+ * @defaultValue undefined (all data changes are logged)
35
+ * @noCodeItem
36
+ */
37
+ maxDataChangesInStore?: number;
31
38
  }
32
39
  /**
33
40
  * Built in `undo` or `clear` data change action
@@ -1,3 +1,20 @@
1
1
  import { AdaptableOptions } from './AdaptableOptions';
2
+ /**
3
+ * Merges the user-supplied `adaptableOptions` with `DefaultAdaptableOptions`,
4
+ * filling in any missing values at any nesting depth.
5
+ *
6
+ * Behaviour:
7
+ * - User-supplied leaf values always win.
8
+ * - Nested plain-object blocks (e.g. `editOptions.plusMinusOptions`,
9
+ * `fdc3Options.actionColumnDefaultConfiguration.rowScope`) are recursively
10
+ * merged so the user can override individual leaves without losing other
11
+ * default leaves in the same block.
12
+ * - Arrays, functions, primitives and class instances are NOT element-merged —
13
+ * the user's value replaces the default entirely.
14
+ * - The caller's input object is never mutated.
15
+ *
16
+ * Adding a new options block or nested sub-block only requires updating
17
+ * `DefaultAdaptableOptions` above — this function does not need to be touched.
18
+ */
2
19
  export declare function applyDefaultAdaptableOptions(adaptableOptions: AdaptableOptions): AdaptableOptions;
3
20
  export declare const getDefaultAdaptableOptions: () => AdaptableOptions<any, Record<string, any>>;
@@ -4,6 +4,7 @@ import { ACCESS_LEVEL_FULL, EMPTY_STRING, EMPTY_ARRAY, DEFAULT_DATE_FORMAT_PATTE
4
4
  import { SystemAlertPredicateIds, SystemBadgeStylePredicateIds, SystemFilterPredicateIds, SystemFlashingCellPredicateIds, SystemFormatColumnPredicateIds, } from '../AdaptableState/Common/AdaptablePredicate';
5
5
  import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
6
6
  import { addUuidsToInitialState } from '../Utilities/Helpers/AdaptableHelper';
7
+ import { defaultsDeep } from '../Utilities/Extensions/ObjectExtensions';
7
8
  const DefaultAdaptableOptions = {
8
9
  adaptableId: GeneralConstants.ADAPTABLE_ID,
9
10
  adaptableStateKey: undefined,
@@ -82,6 +83,7 @@ const DefaultAdaptableOptions = {
82
83
  showDataChange: undefined,
83
84
  changeHistoryButton: undefined,
84
85
  showLastDataChangeOnly: true,
86
+ maxDataChangesInStore: undefined,
85
87
  },
86
88
  dataImportOptions: {
87
89
  fileHandlers: undefined,
@@ -275,6 +277,11 @@ const DefaultAdaptableOptions = {
275
277
  customSettingsPanels: undefined,
276
278
  gridInfoTabs: ['Grid Options', 'Grid Summary', 'Grid State'],
277
279
  },
280
+ wizardOptions: {
281
+ popupType: undefined,
282
+ position: undefined,
283
+ size: undefined,
284
+ },
278
285
  stateOptions: {
279
286
  debounceStateDelay: 400,
280
287
  applyState: (state) => state,
@@ -331,54 +338,9 @@ const DefaultAdaptableOptions = {
331
338
  },
332
339
  };
333
340
  export function applyDefaultAdaptableOptions(adaptableOptions) {
334
- const adaptableOptsWithDefaults = Object.assign({}, DefaultAdaptableOptions, adaptableOptions);
341
+ const adaptableOptsWithDefaults = defaultsDeep({ ...adaptableOptions }, DefaultAdaptableOptions);
335
342
  adaptableOptsWithDefaults.adaptableStateKey =
336
343
  adaptableOptsWithDefaults.adaptableStateKey ?? adaptableOptsWithDefaults.adaptableId;
337
- adaptableOptsWithDefaults.actionColumnOptions = Object.assign({}, DefaultAdaptableOptions.actionColumnOptions, adaptableOptions.actionColumnOptions);
338
- adaptableOptsWithDefaults.rowFormOptions = Object.assign({}, DefaultAdaptableOptions.rowFormOptions, adaptableOptions.rowFormOptions);
339
- adaptableOptsWithDefaults.alertOptions = Object.assign({}, DefaultAdaptableOptions.alertOptions, adaptableOptions.alertOptions);
340
- adaptableOptsWithDefaults.calendarOptions = Object.assign({}, DefaultAdaptableOptions.calendarOptions, adaptableOptions.calendarOptions);
341
- adaptableOptsWithDefaults.cellSummaryOptions = Object.assign({}, DefaultAdaptableOptions.cellSummaryOptions, adaptableOptions.cellSummaryOptions);
342
- adaptableOptsWithDefaults.chartingOptions = Object.assign({}, DefaultAdaptableOptions.chartingOptions, adaptableOptions.chartingOptions);
343
- adaptableOptsWithDefaults.chartingOptions.externalChartingOptions = Object.assign({}, DefaultAdaptableOptions.chartingOptions.externalChartingOptions, adaptableOptsWithDefaults.chartingOptions.externalChartingOptions);
344
- adaptableOptsWithDefaults.columnOptions = Object.assign({}, DefaultAdaptableOptions.columnOptions, adaptableOptions.columnOptions);
345
- adaptableOptsWithDefaults.filterOptions = Object.assign({}, DefaultAdaptableOptions.filterOptions, adaptableOptions.filterOptions);
346
- adaptableOptsWithDefaults.filterOptions.columnFilterOptions = Object.assign({}, DefaultAdaptableOptions.filterOptions.columnFilterOptions, adaptableOptsWithDefaults.filterOptions.columnFilterOptions);
347
- adaptableOptsWithDefaults.filterOptions.gridFilterOptions = Object.assign({}, DefaultAdaptableOptions.filterOptions.gridFilterOptions, adaptableOptsWithDefaults.filterOptions.gridFilterOptions);
348
- adaptableOptsWithDefaults.columnMenuOptions = Object.assign({}, DefaultAdaptableOptions.columnMenuOptions, adaptableOptions.columnMenuOptions);
349
- adaptableOptsWithDefaults.commentOptions = Object.assign({}, DefaultAdaptableOptions.commentOptions, adaptableOptions.commentOptions);
350
- adaptableOptsWithDefaults.containerOptions = Object.assign({}, DefaultAdaptableOptions.containerOptions, adaptableOptions.containerOptions);
351
- adaptableOptsWithDefaults.contextMenuOptions = Object.assign({}, DefaultAdaptableOptions.contextMenuOptions, adaptableOptions.contextMenuOptions);
352
- adaptableOptsWithDefaults.customSortOptions = Object.assign({}, DefaultAdaptableOptions.customSortOptions, adaptableOptions.customSortOptions);
353
- adaptableOptsWithDefaults.dashboardOptions = Object.assign({}, DefaultAdaptableOptions.dashboardOptions, adaptableOptions.dashboardOptions);
354
- adaptableOptsWithDefaults.dataImportOptions = Object.assign({}, DefaultAdaptableOptions.dataImportOptions, adaptableOptions.dataImportOptions);
355
- adaptableOptsWithDefaults.dataChangeHistoryOptions = Object.assign({}, DefaultAdaptableOptions.dataChangeHistoryOptions, adaptableOptions.dataChangeHistoryOptions);
356
- adaptableOptsWithDefaults.dataSetOptions = Object.assign({}, DefaultAdaptableOptions.dataSetOptions, adaptableOptions.dataSetOptions);
357
- adaptableOptsWithDefaults.editOptions = Object.assign({}, DefaultAdaptableOptions.editOptions, adaptableOptions.editOptions);
358
- adaptableOptsWithDefaults.editOptions.plusMinusOptions = Object.assign({}, DefaultAdaptableOptions.editOptions.plusMinusOptions, adaptableOptsWithDefaults.editOptions.plusMinusOptions);
359
- adaptableOptsWithDefaults.editOptions.smartEditOptions = Object.assign({}, DefaultAdaptableOptions.editOptions.smartEditOptions, adaptableOptsWithDefaults.editOptions.smartEditOptions);
360
- adaptableOptsWithDefaults.entitlementOptions = Object.assign({}, DefaultAdaptableOptions.entitlementOptions, adaptableOptions.entitlementOptions);
361
- adaptableOptsWithDefaults.exportOptions = Object.assign({}, DefaultAdaptableOptions.exportOptions, adaptableOptions.exportOptions);
362
- adaptableOptsWithDefaults.expressionOptions = Object.assign({}, DefaultAdaptableOptions.expressionOptions, adaptableOptions.expressionOptions);
363
- adaptableOptsWithDefaults.fdc3Options = Object.assign({}, DefaultAdaptableOptions.fdc3Options, adaptableOptions.fdc3Options);
364
- adaptableOptsWithDefaults.fdc3Options.actionColumnDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration, adaptableOptsWithDefaults.fdc3Options.actionColumnDefaultConfiguration);
365
- adaptableOptsWithDefaults.fdc3Options.uiControlsDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration, adaptableOptsWithDefaults.fdc3Options.uiControlsDefaultConfiguration);
366
- adaptableOptsWithDefaults.flashingCellOptions = Object.assign({}, DefaultAdaptableOptions.flashingCellOptions, adaptableOptions.flashingCellOptions);
367
- adaptableOptsWithDefaults.formatColumnOptions = Object.assign({}, DefaultAdaptableOptions.formatColumnOptions, adaptableOptions.formatColumnOptions);
368
- adaptableOptsWithDefaults.layoutOptions = Object.assign({}, DefaultAdaptableOptions.layoutOptions, adaptableOptions.layoutOptions);
369
- adaptableOptsWithDefaults.layoutOptions.layoutTagOptions = Object.assign({}, DefaultAdaptableOptions.layoutOptions.layoutTagOptions, adaptableOptsWithDefaults.layoutOptions.layoutTagOptions);
370
- adaptableOptsWithDefaults.layoutOptions.layoutViewOptions = Object.assign({}, DefaultAdaptableOptions.layoutOptions.layoutViewOptions, adaptableOptsWithDefaults.layoutOptions.layoutViewOptions);
371
- adaptableOptsWithDefaults.noteOptions = Object.assign({}, DefaultAdaptableOptions.noteOptions, adaptableOptions.noteOptions);
372
- adaptableOptsWithDefaults.notificationsOptions = Object.assign({}, DefaultAdaptableOptions.notificationsOptions, adaptableOptions.notificationsOptions);
373
- adaptableOptsWithDefaults.predicateOptions = Object.assign({}, DefaultAdaptableOptions.predicateOptions, adaptableOptsWithDefaults.predicateOptions);
374
- adaptableOptsWithDefaults.quickSearchOptions = Object.assign({}, DefaultAdaptableOptions.quickSearchOptions, adaptableOptions.quickSearchOptions);
375
- adaptableOptsWithDefaults.settingsPanelOptions = Object.assign({}, DefaultAdaptableOptions.settingsPanelOptions, adaptableOptions.settingsPanelOptions);
376
- adaptableOptsWithDefaults.stateOptions = Object.assign({}, DefaultAdaptableOptions.stateOptions, adaptableOptions.stateOptions);
377
- adaptableOptsWithDefaults.teamSharingOptions = Object.assign({}, DefaultAdaptableOptions.teamSharingOptions, adaptableOptions.teamSharingOptions);
378
- adaptableOptsWithDefaults.toolPanelOptions = Object.assign({}, DefaultAdaptableOptions.toolPanelOptions, adaptableOptions.toolPanelOptions);
379
- adaptableOptsWithDefaults.userInterfaceOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions, adaptableOptions.userInterfaceOptions);
380
- adaptableOptsWithDefaults.userInterfaceOptions.loadingScreenOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions.loadingScreenOptions, adaptableOptsWithDefaults.userInterfaceOptions.loadingScreenOptions);
381
- adaptableOptsWithDefaults.userInterfaceOptions.dateInputOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions.dateInputOptions, adaptableOptsWithDefaults.userInterfaceOptions.dateInputOptions);
382
344
  const { initialState } = adaptableOptsWithDefaults;
383
345
  adaptableOptsWithDefaults.initialState = addUuidsToInitialState(initialState);
384
346
  return adaptableOptsWithDefaults;
@@ -149,13 +149,21 @@ export interface CellEditableContext<TData = any> extends BaseContext {
149
149
  */
150
150
  export interface PlusMinusOptions {
151
151
  /**
152
- * Key to increase cell value for nudges (if not overriden in Plus Minus Rule)
152
+ * Key to increase cell value for nudges (if not overriden in Plus Minus Rule/Nudge).
153
+ *
154
+ * Can be a single key (e.g. `'+'`) or a keyboard shortcut combination that uses
155
+ * `+` as the glue between parts (e.g. `'shift+Enter'`, `'ctrl+ArrowUp'`).
156
+ * Supported modifiers are `ctrl`, `cmd`, `alt` and `shift`.
153
157
  *
154
158
  * @defaultValue '+'
155
159
  */
156
160
  incrementKey?: string;
157
161
  /**
158
- * Key to decrease cell value for nudges (if not overriden in Plus Minus Rule)
162
+ * Key to decrease cell value for nudges (if not overriden in Plus Minus Rule/Nudge).
163
+ *
164
+ * Can be a single key (e.g. `'-'`) or a keyboard shortcut combination that uses
165
+ * `+` as the glue between parts (e.g. `'shift+Backspace'`, `'ctrl+ArrowDown'`).
166
+ * Supported modifiers are `ctrl`, `cmd`, `alt` and `shift`.
159
167
  *
160
168
  * @defaultValue '-'
161
169
  */
@@ -2,6 +2,7 @@ import { AdaptableFrameworkComponent, AdaptableIcon } from '../../types';
2
2
  import { AdaptableSettingsPanel } from '../AdaptableState/Common/Types';
3
3
  import { BaseContext } from '../AdaptableState/Common/BaseContext';
4
4
  import { CustomRenderContext } from '../agGrid/AdaptableFrameworkComponent';
5
+ import { WindowPosition, WindowSize } from '../AdaptableState/Common/Window';
5
6
  /**
6
7
  * Options for managing the AdapTable Settings Panel
7
8
  */
@@ -44,13 +45,13 @@ export interface SettingsPanelOptions {
44
45
  *
45
46
  * @defaultValue Middle of Screen
46
47
  */
47
- position?: SettingsPanelPosition;
48
+ position?: WindowPosition;
48
49
  /**
49
50
  * Initial size (in pixels) of Settings Panel (requires `popupType` to be `'window'`)
50
51
  *
51
52
  * @defaultValue Computed based on size of screen
52
53
  */
53
- size?: SettingsPanelSize;
54
+ size?: WindowSize;
54
55
  /**
55
56
  * How the Settings Panel is rendered: `'modal'` (centred and unmovable and resizable) or `'window'` (supports size, position, drag and resize)
56
57
  *
@@ -68,32 +69,6 @@ export interface SettingsPanelOptions {
68
69
  */
69
70
  gridInfoTabs?: GridInfoTabs;
70
71
  }
71
- /**
72
- * Pixel offset of Settings Panel's top-left corner from top-left of the viewport
73
- */
74
- export interface SettingsPanelPosition {
75
- /**
76
- * Distance from the left edge of the viewport, in pixels.
77
- */
78
- x: number;
79
- /**
80
- * Distance from the top edge of the viewport, in pixels.
81
- */
82
- y: number;
83
- }
84
- /**
85
- * Initial dimensions (in pixels) of the Settings Panel
86
- */
87
- export interface SettingsPanelSize {
88
- /**
89
- * Width of the Settings Panel, in pixels.
90
- */
91
- width: number;
92
- /**
93
- * Height of the Settings Panel, in pixels.
94
- */
95
- height: number;
96
- }
97
72
  /**
98
73
  * A labelled group of Settings Panel navigation entries.
99
74
  */
@@ -0,0 +1,25 @@
1
+ import { WindowPosition, WindowSize } from '../AdaptableState/Common/Window';
2
+ import { PopupType } from './SettingsPanelOptions';
3
+ /**
4
+ * Options for managing AdapTable Wizards
5
+ */
6
+ export interface WizardOptions {
7
+ /**
8
+ * How wizards are rendered: `'modal'` (centred & unmovable) or `'window'` (supports size, position, drag, resize)
9
+ *
10
+ * @defaultValue inherits from `settingsPanelOptions.popupType`
11
+ */
12
+ popupType?: PopupType;
13
+ /**
14
+ * Initial position of wizard — pixel offset of top-left corner from top-left of viewport (requires `popupType`: `'window'`)
15
+ *
16
+ * @defaultValue Middle of Screen
17
+ */
18
+ position?: WindowPosition;
19
+ /**
20
+ * Initial size (in pixels) of wizard (requires `popupType`: `'window'`)
21
+ *
22
+ * @defaultValue Computed default sized for wizards
23
+ */
24
+ size?: WindowSize;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { AdaptableSystemIconName } from '../../types';
2
2
  import { CustomRenderContext, AdaptableFrameworkComponent } from '../../agGrid/AdaptableFrameworkComponent';
3
+ import { WindowPosition, WindowSize } from './Window';
3
4
  /**
4
5
  * Config used to open a Custom Window
5
6
  */
@@ -37,17 +38,4 @@ export interface CustomWindowConfig {
37
38
  */
38
39
  position?: WindowPosition;
39
40
  }
40
- /**
41
- * Defines size of a Custom Window
42
- */
43
- export interface WindowSize {
44
- width: number;
45
- height: number;
46
- }
47
- /**
48
- * Defines position of a Custom Window
49
- */
50
- export interface WindowPosition {
51
- x: number;
52
- y: number;
53
- }
41
+ export type { WindowPosition, WindowSize } from './Window';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Generic window-shaped types used wherever AdapTable needs a position and/or
3
+ * size in pixels (Settings Panel, Wizards, Custom Windows, etc.).
4
+ *
5
+ * Co-located in `AdaptableState/Common` so any options block can pull in the
6
+ * same shape without re-declaring it.
7
+ */
8
+ /**
9
+ * Pixel offset of a window's top-left corner from the top-left of the viewport.
10
+ */
11
+ export interface WindowPosition {
12
+ /**
13
+ * Distance from the left edge of the viewport, in pixels.
14
+ */
15
+ x: number;
16
+ /**
17
+ * Distance from the top edge of the viewport, in pixels.
18
+ */
19
+ y: number;
20
+ }
21
+ /**
22
+ * Initial dimensions (in pixels) of a window.
23
+ */
24
+ export interface WindowSize {
25
+ /**
26
+ * Width of the window, in pixels.
27
+ */
28
+ width: number;
29
+ /**
30
+ * Height of the window, in pixels.
31
+ */
32
+ height: number;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -77,7 +77,8 @@ export interface InitialState {
77
77
  Note?: NoteState;
78
78
  /**
79
79
  * Plus Minus module: nudge rules. Optional `IncrementKey` / `DecrementKey` on each nudge
80
- * use `KeyboardEvent.key`; when omitted, `AdaptableOptions.plusMinusOptions` applies, then `+` / `-`.
80
+ * accept either a single key or a keyboard shortcut combination (e.g. `shift+Enter`); when
81
+ * omitted, `AdaptableOptions.plusMinusOptions` applies, then `+` / `-`.
81
82
  */
82
83
  PlusMinus?: PlusMinusState;
83
84
  /**
@@ -32,11 +32,21 @@ export interface PlusMinusNudge extends SuspendableObject {
32
32
  */
33
33
  Rule?: AdaptableBooleanQuery;
34
34
  /**
35
- * Optional keyboard `key` that increases cell values for this nudge only (overrides global incrementKey)
35
+ * Optional keyboard key that increases cell values for this nudge only (overrides the
36
+ * global `incrementKey` in `plusMinusOptions`).
37
+ *
38
+ * Can be a single key (e.g. `'+'`) or a keyboard shortcut combination that uses `+` as the glue
39
+ * between parts (e.g. `'shift+Enter'`, `'ctrl+ArrowUp'`). Supported modifiers are `ctrl`, `cmd`,
40
+ * `alt` and `shift`.
36
41
  */
37
42
  IncrementKey?: string;
38
43
  /**
39
- * Optional keyboard `key` that decreases cell values for this nudge only (overrides global decrementKey)
44
+ * Optional keyboard key that decreases cell values for this nudge only (overrides the
45
+ * global `decrementKey` in `plusMinusOptions`).
46
+ *
47
+ * Can be a single key (e.g. `'-'`) or a keyboard shortcut combination that uses `+` as the glue
48
+ * between parts (e.g. `'shift+Backspace'`, `'ctrl+ArrowDown'`). Supported modifiers are `ctrl`,
49
+ * `cmd`, `alt` and `shift`.
40
50
  */
41
51
  DecrementKey?: string;
42
52
  }
@@ -10,16 +10,16 @@ export class DataChangeHistoryApiImpl extends ApiBase {
10
10
  if (currentMode === 'ACTIVE' && !forceReset) {
11
11
  return;
12
12
  }
13
- if (forceReset || currentMode === 'INACTIVE') {
14
- this.dispatchAction(DataChangeHistoryEnable());
15
- }
16
- else if (currentMode === 'SUSPENDED') {
13
+ if (currentMode === 'SUSPENDED' && !forceReset) {
17
14
  this.dispatchAction(DataChangeHistoryResume());
18
15
  }
16
+ else {
17
+ this.dispatchAction(DataChangeHistoryEnable());
18
+ }
19
19
  }
20
20
  deactivateDataChangeHistory() {
21
- if (this.getDataChangeHistoryMode() === 'ACTIVE' ||
22
- this.getDataChangeHistoryMode() === 'SUSPENDED') {
21
+ const currentMode = this.getDataChangeHistoryMode();
22
+ if (currentMode !== 'INACTIVE') {
23
23
  this.dispatchAction(DataChangeHistoryDisable());
24
24
  }
25
25
  }
@@ -39,7 +39,8 @@ export class DataChangeHistoryApiImpl extends ApiBase {
39
39
  }
40
40
  addDataChangeHistoryEntry(dataChangeInfo) {
41
41
  const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
42
- this.dispatchAction(DataChangeHistoryAdd(dataChangeInfo, uniqueKey));
42
+ const maxDataChangesInStore = this.getDataChangeHistoryOptions().maxDataChangesInStore;
43
+ this.dispatchAction(DataChangeHistoryAdd(dataChangeInfo, uniqueKey, maxDataChangesInStore));
43
44
  }
44
45
  undoDataChangeHistoryEntry(dataChangeInfo) {
45
46
  const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
@@ -65,10 +66,10 @@ export class DataChangeHistoryApiImpl extends ApiBase {
65
66
  const changedAt = dataChangeInfo.changedAt;
66
67
  const showLastDataChangeOnly = this.getDataChangeHistoryOptions().showLastDataChangeOnly;
67
68
  if (showLastDataChangeOnly) {
68
- return JSON.stringify({ columnId, primaryKeyValue });
69
+ return `${columnId}\u0000${primaryKeyValue}`;
69
70
  }
70
71
  else {
71
- return JSON.stringify({ columnId, primaryKeyValue, changedAt });
72
+ return `${columnId}\u0000${primaryKeyValue}\u0000${changedAt}`;
72
73
  }
73
74
  };
74
75
  }
@@ -247,6 +247,7 @@ export interface DataChangeHistoryAction extends Redux.Action {
247
247
  uniqueKey: string;
248
248
  }
249
249
  export interface DataChangeHistoryAddAction extends DataChangeHistoryAction {
250
+ maxDataChanges?: number;
250
251
  }
251
252
  export interface DataChangeHistoryUndoAction extends DataChangeHistoryAction {
252
253
  }
@@ -324,7 +325,7 @@ export declare const CachedQueryAdd: (cachedQuery: CachedQuery) => CachedQueryAd
324
325
  export declare const CellSummaryChangeOperation: (cellSummaryOperation: SummaryOperation | string) => CellSummaryChangeOperationAction;
325
326
  export declare const LicenseShowWatermark: (text: string) => LicenseShowWatermarkAction;
326
327
  export declare const LicenseDisablePersistence: () => LicenseDisablePersistenceAction;
327
- export declare const DataChangeHistoryAdd: (changeInfo: CellDataChangedInfo, uniqueKey: string) => DataChangeHistoryAddAction;
328
+ export declare const DataChangeHistoryAdd: (changeInfo: CellDataChangedInfo, uniqueKey: string, maxDataChanges?: number) => DataChangeHistoryAddAction;
328
329
  export declare const DataChangeHistoryUndo: (changeInfo: CellDataChangedInfo, uniqueKey: string) => DataChangeHistoryUndoAction;
329
330
  export declare const DataChangeHistoryClearRow: (changeInfo: CellDataChangedInfo, uniqueKey: string) => DataChangeHistoryClearRowAction;
330
331
  export declare const DataChangeHistoryEnable: () => DataChangeHistoryEnableAction;
@@ -213,10 +213,11 @@ export const LicenseShowWatermark = (text) => ({
213
213
  export const LicenseDisablePersistence = () => ({
214
214
  type: LICENSE_DISABLE_PERSISTENCE,
215
215
  });
216
- export const DataChangeHistoryAdd = (changeInfo, uniqueKey) => ({
216
+ export const DataChangeHistoryAdd = (changeInfo, uniqueKey, maxDataChanges) => ({
217
217
  type: DATA_CHANGE_HISTORY_ADD,
218
218
  changeInfo,
219
219
  uniqueKey,
220
+ maxDataChanges,
220
221
  });
221
222
  export const DataChangeHistoryUndo = (changeInfo, uniqueKey) => ({
222
223
  type: DATA_CHANGE_HISTORY_UNDO,
@@ -372,6 +373,17 @@ const initialState = {
372
373
  inProgress: null,
373
374
  },
374
375
  };
376
+ const removeDataChangeHistoryLog = (state, uniqueKey) => {
377
+ const updatedDataChangeHistoryLogs = { ...state.DataChangeHistory.logs };
378
+ delete updatedDataChangeHistoryLogs[uniqueKey];
379
+ return {
380
+ ...state,
381
+ DataChangeHistory: {
382
+ ...state.DataChangeHistory,
383
+ logs: updatedDataChangeHistoryLogs,
384
+ },
385
+ };
386
+ };
375
387
  export const InternalReducer = (state = initialState, action) => {
376
388
  let alerts;
377
389
  let systemStatusMessages;
@@ -673,21 +685,16 @@ export const InternalReducer = (state = initialState, action) => {
673
685
  const cellDataChangedInfo = actionTypedAdd.changeInfo;
674
686
  const uniqueKey = actionTypedAdd.uniqueKey;
675
687
  const updatedDataChangeHistoryLogs = { ...state.DataChangeHistory.logs };
676
- updatedDataChangeHistoryLogs[uniqueKey] = cellDataChangedInfo;
677
- return {
678
- ...state,
679
- DataChangeHistory: {
680
- ...state.DataChangeHistory,
681
- logs: updatedDataChangeHistoryLogs,
682
- },
683
- };
684
- }
685
- case DATA_CHANGE_HISTORY_UNDO: {
686
- const actionTypedUndo = action;
687
- const cellDataChangedInfo = actionTypedUndo.changeInfo;
688
- const uniqueKey = actionTypedUndo.uniqueKey;
689
- const updatedDataChangeHistoryLogs = { ...state.DataChangeHistory.logs };
690
688
  delete updatedDataChangeHistoryLogs[uniqueKey];
689
+ updatedDataChangeHistoryLogs[uniqueKey] = cellDataChangedInfo;
690
+ const maxDataChanges = actionTypedAdd.maxDataChanges;
691
+ if (maxDataChanges != null && maxDataChanges >= 0) {
692
+ const keys = Object.keys(updatedDataChangeHistoryLogs);
693
+ const overflow = keys.length - maxDataChanges;
694
+ for (let i = 0; i < overflow; i++) {
695
+ delete updatedDataChangeHistoryLogs[keys[i]];
696
+ }
697
+ }
691
698
  return {
692
699
  ...state,
693
700
  DataChangeHistory: {
@@ -696,19 +703,10 @@ export const InternalReducer = (state = initialState, action) => {
696
703
  },
697
704
  };
698
705
  }
706
+ case DATA_CHANGE_HISTORY_UNDO:
699
707
  case DATA_CHANGE_HISTORY_CLEAR_ROW: {
700
- const actionTypedClearRow = action;
701
- const cellDataChangedInfo = actionTypedClearRow.changeInfo;
702
- const uniqueKey = actionTypedClearRow.uniqueKey;
703
- const updatedDataChangeHistoryLogs = { ...state.DataChangeHistory.logs };
704
- delete updatedDataChangeHistoryLogs[uniqueKey];
705
- return {
706
- ...state,
707
- DataChangeHistory: {
708
- ...state.DataChangeHistory,
709
- logs: updatedDataChangeHistoryLogs,
710
- },
711
- };
708
+ const { uniqueKey } = action;
709
+ return removeDataChangeHistoryLog(state, uniqueKey);
712
710
  }
713
711
  case DATA_CHANGE_HISTORY_ENABLE: {
714
712
  return {
@@ -29,7 +29,7 @@ export class DataChangeHistoryModule extends AdaptableModuleBase {
29
29
  this.api.internalApi
30
30
  .getDataService()
31
31
  .on('CellDataChanged', (cellDataChangedInfo) => {
32
- if (this.isListeningToCellDataChanges &&
32
+ if (this.shouldListenToDataChanges() &&
33
33
  this.isDataChangeLoggable(cellDataChangedInfo) &&
34
34
  !cellDataChangedInfo.preventEdit) {
35
35
  this.api.dataChangeHistoryApi.addDataChangeHistoryEntry(cellDataChangedInfo);
@@ -11,7 +11,7 @@ import { MovePlusMinus } from '../View/PlusMinus/MovePlusMinus';
11
11
  import { PlusMinusWizard } from '../View/PlusMinus/Wizard/PlusMinusWizard';
12
12
  import { errorOnce } from '../agGrid/AdaptableLogger';
13
13
  import NumberExtensions from '../Utilities/Extensions/NumberExtensions';
14
- import { buildPlusMinusTriggerKeyLookup, plusMinusKeyCouldTrigger, plusMinusKeyMatches, resolvePlusMinusTriggerKeysForNudge, } from '../Utilities/Helpers/PlusMinusHelper';
14
+ import { buildPlusMinusTriggerKeyLookup, plusMinusEventMatchesTrigger, plusMinusKeyCouldTrigger, resolvePlusMinusTriggerKeysForNudge, } from '../Utilities/Helpers/PlusMinusHelper';
15
15
  export class PlusMinusModule extends AdaptableModuleBase {
16
16
  shouldHandleKeyDown;
17
17
  adaptable;
@@ -116,11 +116,11 @@ export class PlusMinusModule extends AdaptableModuleBase {
116
116
  }
117
117
  const decrementMatches = allActive.filter((nudge) => {
118
118
  const { decrementKey } = resolvePlusMinusTriggerKeysForNudge(nudge, pmOpts);
119
- return plusMinusKeyMatches(keyEventString, decrementKey);
119
+ return plusMinusEventMatchesTrigger(keyEvent, decrementKey);
120
120
  });
121
121
  const incrementMatches = allActive.filter((nudge) => {
122
122
  const { incrementKey } = resolvePlusMinusTriggerKeysForNudge(nudge, pmOpts);
123
- return plusMinusKeyMatches(keyEventString, incrementKey);
123
+ return plusMinusEventMatchesTrigger(keyEvent, incrementKey);
124
124
  });
125
125
  let side;
126
126
  let plusMinusNudges;
@@ -138,6 +138,8 @@ export class PlusMinusModule extends AdaptableModuleBase {
138
138
  const isPlusMinusApplicable = this.applyPlusMinus(plusMinusNudges, this.api.gridApi.getSelectedCellInfo().gridCells, side);
139
139
  if (isPlusMinusApplicable) {
140
140
  keyEvent.preventDefault();
141
+ keyEvent.stopImmediatePropagation?.();
142
+ keyEvent.stopPropagation?.();
141
143
  }
142
144
  }
143
145
  applyPlusMinus(plusMinusNudges, cellsToUpdate, direction) {
@@ -56,4 +56,20 @@ export declare function merge(target: any, ...sources: any[]): any;
56
56
  * Drop-in replacement for lodash/mergeWith.
57
57
  */
58
58
  export declare function mergeWith<T extends object>(target: T, ...args: any[]): T;
59
+ /**
60
+ * Recursively fills in missing properties on `target` from one or more
61
+ * `sources` (defaults). For each key:
62
+ *
63
+ * - if the target value is `undefined`, it is replaced with a fresh clone of
64
+ * the source value;
65
+ * - if both the target and source values are plain objects, the merge recurses
66
+ * into them (the target's nested object is shallow-copied first, so the
67
+ * caller's input is never mutated);
68
+ * - otherwise the target value wins as-is (arrays, functions, primitives, class
69
+ * instances etc. are NOT element-merged — the user's value replaces the
70
+ * default entirely).
71
+ *
72
+ * Drop-in replacement for lodash/defaultsDeep.
73
+ */
74
+ export declare function defaultsDeep<T extends object>(target: T, ...sources: any[]): T;
59
75
  export {};