@adaptabletools/adaptable 22.0.0-canary.3 → 22.0.0-canary.4

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 (85) hide show
  1. package/index.css +12 -3
  2. package/index.css.map +1 -1
  3. package/package.json +1 -1
  4. package/src/AdaptableOptions/ActionColumnOptions.d.ts +2 -2
  5. package/src/AdaptableOptions/CustomSortOptions.d.ts +5 -0
  6. package/src/AdaptableOptions/DashboardOptions.d.ts +1 -2
  7. package/src/AdaptableOptions/ToolPanelOptions.d.ts +1 -2
  8. package/src/AdaptableState/AlertState.d.ts +2 -2
  9. package/src/AdaptableState/ChartingState.d.ts +3 -3
  10. package/src/AdaptableState/Common/AdaptableAlert.d.ts +2 -2
  11. package/src/AdaptableState/Common/AdaptableButton.d.ts +2 -2
  12. package/src/AdaptableState/Common/AdaptableFlashingCell.d.ts +2 -2
  13. package/src/AdaptableState/Common/AdaptableObject.d.ts +25 -2
  14. package/src/AdaptableState/Common/RowSummary.d.ts +1 -1
  15. package/src/AdaptableState/Common/Schedule.d.ts +3 -4
  16. package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +2 -2
  17. package/src/AdaptableState/CustomSortState.d.ts +2 -2
  18. package/src/AdaptableState/DashboardState.d.ts +2 -2
  19. package/src/AdaptableState/ExportState.d.ts +2 -2
  20. package/src/AdaptableState/FlashingCellState.d.ts +2 -2
  21. package/src/AdaptableState/FormatColumnState.d.ts +2 -2
  22. package/src/AdaptableState/LayoutState.d.ts +8 -3
  23. package/src/AdaptableState/NamedQueryState.d.ts +2 -2
  24. package/src/AdaptableState/PlusMinusState.d.ts +2 -2
  25. package/src/AdaptableState/ShortcutState.d.ts +2 -2
  26. package/src/AdaptableState/StyledColumnState.d.ts +1 -1
  27. package/src/AdaptableState/ThemeState.d.ts +2 -2
  28. package/src/Api/CustomSortApi.d.ts +6 -3
  29. package/src/Api/Implementation/CustomSortApiImpl.d.ts +5 -1
  30. package/src/Api/Implementation/CustomSortApiImpl.js +2 -2
  31. package/src/Api/Implementation/LayoutHelpers.js +7 -0
  32. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  33. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +1 -1
  34. package/src/Strategy/AlertModule.js +4 -0
  35. package/src/Strategy/CustomSortModule.js +4 -0
  36. package/src/Strategy/FlashingCellModule.js +5 -0
  37. package/src/Strategy/FormatColumnModule.js +4 -0
  38. package/src/Strategy/LayoutModule.js +4 -4
  39. package/src/Strategy/PlusMinusModule.js +4 -0
  40. package/src/Strategy/ScheduleModule.js +4 -0
  41. package/src/Strategy/ShortcutModule.js +4 -0
  42. package/src/Utilities/Extensions/StringExtensions.d.ts +2 -0
  43. package/src/Utilities/Extensions/StringExtensions.js +16 -0
  44. package/src/Utilities/Helpers/FormatHelper.js +9 -2
  45. package/src/Utilities/ObjectFactory.js +15 -2
  46. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +2 -1
  47. package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +5 -2
  48. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +47 -12
  49. package/src/View/Alert/Wizard/AlertWizard.js +14 -10
  50. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +1 -2
  51. package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -2
  52. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
  53. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +40 -14
  54. package/src/View/CustomSort/Wizard/CustomSortWizard.js +4 -4
  55. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -0
  56. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.d.ts +2 -1
  57. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +34 -14
  58. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +14 -10
  59. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +47 -29
  60. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +20 -9
  61. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +8 -0
  62. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +32 -9
  63. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +20 -15
  64. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +12 -1
  65. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +12 -1
  66. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +12 -2
  67. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +12 -1
  68. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.d.ts +2 -1
  69. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +10 -1
  70. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.d.ts +2 -1
  71. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +25 -4
  72. package/src/View/Shortcut/Wizard/ShortcutWizard.js +18 -14
  73. package/src/env.js +2 -2
  74. package/src/layout-manager/src/LayoutManagerModel.d.ts +1 -0
  75. package/src/layout-manager/src/index.js +25 -7
  76. package/src/layout-manager/src/normalizeLayoutModel.js +3 -0
  77. package/src/metamodel/adaptable.metamodel.d.ts +30 -0
  78. package/src/metamodel/adaptable.metamodel.js +1 -1
  79. package/src/migration/AdaptableUpgradeHelper.js +1 -1
  80. package/src/migration/VersionUpgrade22.d.ts +15 -0
  81. package/src/migration/VersionUpgrade22.js +160 -0
  82. package/src/types.d.ts +1 -2
  83. package/tsconfig.esm.tsbuildinfo +1 -1
  84. package/src/AdaptableState/Common/SuspendableObject.d.ts +0 -10
  85. package/src/AdaptableState/Common/SuspendableObject.js +0 -1
@@ -43,7 +43,7 @@ export class AdaptableUpgradeHelper {
43
43
  }
44
44
  getCurrentMajorVersion(version) {
45
45
  // is good enough for now, we just need to make sure we don't forget to update it
46
- return parseInt(version.split('.')[0]) || 20;
46
+ return parseInt(version.split('.')[0]) || 22;
47
47
  }
48
48
  getConsoleLogger() {
49
49
  return {
@@ -2,5 +2,20 @@ import { VersionUpgrade } from './VersionUpgrade';
2
2
  import { AdaptableState } from '../AdaptableState/AdaptableState';
3
3
  export declare class VersionUpgrade22 extends VersionUpgrade {
4
4
  migrateState(state: AdaptableState): AdaptableState;
5
+ private migrateNamedObjectState;
5
6
  private migrateFormatColumnState;
7
+ private patchCustomSortName;
8
+ private patchFlashingCellName;
9
+ private patchFormatColumnName;
10
+ private patchPlusMinusNudgeName;
11
+ private patchShortcutName;
12
+ private patchAlertName;
13
+ private patchScheduleName;
14
+ private scopeToString;
15
+ private hashStrings;
16
+ /**
17
+ * Stringifies an object after removing metadata properties (Uuid, Source, AdaptableVersion)
18
+ * to ensure deterministic hashing regardless of generated values.
19
+ */
20
+ private stringifyWithoutMetadata;
6
21
  }
@@ -1,9 +1,20 @@
1
1
  import { VersionUpgrade } from './VersionUpgrade';
2
+ import { removeAdaptableObjectPrimitivesInlineDeep } from '../Utilities/Helpers/AdaptableHelper';
2
3
  export class VersionUpgrade22 extends VersionUpgrade {
3
4
  migrateState(state) {
4
5
  this.migrateFormatColumnState(state);
6
+ this.migrateNamedObjectState(state);
5
7
  return state;
6
8
  }
9
+ migrateNamedObjectState(state) {
10
+ this.patchCustomSortName(state.CustomSort);
11
+ this.patchFlashingCellName(state.FlashingCell);
12
+ this.patchFormatColumnName(state.FormatColumn);
13
+ this.patchPlusMinusNudgeName(state.PlusMinus);
14
+ this.patchShortcutName(state.Shortcut);
15
+ this.patchAlertName(state.Alert);
16
+ this.patchScheduleName(state.Schedule);
17
+ }
7
18
  // We have moved CellAlignment (renamed Alignment) from independent property into Style
8
19
  migrateFormatColumnState(state) {
9
20
  const formatColumnState = state.FormatColumn;
@@ -24,4 +35,153 @@ export class VersionUpgrade22 extends VersionUpgrade {
24
35
  }
25
36
  return state;
26
37
  }
38
+ patchCustomSortName(customSortState) {
39
+ if (!customSortState) {
40
+ return;
41
+ }
42
+ customSortState.CustomSorts?.forEach((customSort) => {
43
+ if (!customSort.Name) {
44
+ const sortedValues = (customSort.SortedValues || []).join();
45
+ customSort.Name = `CustomSort-${customSort.ColumnId}-${this.hashStrings(['CustomSort', customSort.ColumnId, sortedValues])}`;
46
+ }
47
+ });
48
+ }
49
+ patchFlashingCellName(flashingCellState) {
50
+ if (!flashingCellState) {
51
+ return;
52
+ }
53
+ flashingCellState.FlashingCellDefinitions?.forEach((flashingCell) => {
54
+ if (!flashingCell.Name) {
55
+ const scopeStr = this.scopeToString(flashingCell.Scope);
56
+ const ruleStr = flashingCell.Rule?.BooleanExpression || '';
57
+ flashingCell.Name = `FlashingCell-${this.hashStrings(['FlashingCell', scopeStr, ruleStr])}`;
58
+ }
59
+ });
60
+ }
61
+ patchFormatColumnName(formatColumnState) {
62
+ if (!formatColumnState) {
63
+ return;
64
+ }
65
+ formatColumnState.FormatColumns?.forEach((formatColumn) => {
66
+ if (!formatColumn.Name) {
67
+ const scopeStr = this.scopeToString(formatColumn.Scope);
68
+ const styleStr = this.stringifyWithoutMetadata(formatColumn.Style);
69
+ formatColumn.Name = `FormatColumn-${this.hashStrings(['FormatColumn', scopeStr, styleStr])}`;
70
+ }
71
+ });
72
+ }
73
+ patchPlusMinusNudgeName(plusMinusState) {
74
+ if (!plusMinusState) {
75
+ return;
76
+ }
77
+ plusMinusState.PlusMinusNudges?.forEach((nudge) => {
78
+ if (!nudge.Name) {
79
+ const scopeStr = this.scopeToString(nudge.Scope);
80
+ const nudgeValue = String(nudge.NudgeValue ?? '');
81
+ nudge.Name = `PlusMinus-${this.hashStrings(['PlusMinus', scopeStr, nudgeValue])}`;
82
+ }
83
+ });
84
+ }
85
+ patchShortcutName(shortcutState) {
86
+ if (!shortcutState) {
87
+ return;
88
+ }
89
+ shortcutState.Shortcuts?.forEach((shortcut) => {
90
+ if (!shortcut.Name) {
91
+ const key = shortcut.ShortcutKey || '';
92
+ const operation = shortcut.ShortcutOperation || '';
93
+ const value = String(shortcut.ShortcutValue ?? '');
94
+ shortcut.Name = `Shortcut-${key}-${this.hashStrings(['Shortcut', key, operation, value])}`;
95
+ }
96
+ });
97
+ }
98
+ patchAlertName(alertState) {
99
+ if (!alertState) {
100
+ return;
101
+ }
102
+ alertState.AlertDefinitions?.forEach((alert) => {
103
+ if (!alert.Name) {
104
+ const scopeStr = this.scopeToString(alert.Scope);
105
+ const messageType = alert.MessageType || '';
106
+ const ruleStr = this.stringifyWithoutMetadata(alert.Rule);
107
+ alert.Name = `Alert-${messageType}-${this.hashStrings(['Alert', scopeStr, messageType, ruleStr])}`;
108
+ }
109
+ });
110
+ }
111
+ patchScheduleName(scheduleState) {
112
+ if (!scheduleState) {
113
+ return;
114
+ }
115
+ // Patch Reminder Schedules
116
+ scheduleState.Reminders?.forEach((reminder) => {
117
+ if (!reminder.Name) {
118
+ const header = reminder.Header || '';
119
+ const message = reminder.Message || '';
120
+ reminder.Name = `Reminder-${this.hashStrings(['Reminder', header, message])}`;
121
+ }
122
+ });
123
+ // Patch Report Schedules
124
+ scheduleState.ReportSchedules?.forEach((report) => {
125
+ if (!report.Name) {
126
+ const reportName = report.ReportName || '';
127
+ const format = report.ReportFormat || '';
128
+ report.Name = `ReportSchedule-${this.hashStrings(['ReportSchedule', reportName, format])}`;
129
+ }
130
+ });
131
+ // Patch IPushPull Schedules
132
+ scheduleState.IPushPullSchedules?.forEach((ipp) => {
133
+ if (!ipp.Name) {
134
+ const reportName = ipp.IPushPullReport?.ReportName || '';
135
+ const folder = ipp.IPushPullReport?.Folder || '';
136
+ const page = ipp.IPushPullReport?.Page || '';
137
+ ipp.Name = `IPushPullSchedule-${this.hashStrings(['IPushPullSchedule', reportName, folder, page])}`;
138
+ }
139
+ });
140
+ // Patch OpenFin Schedules
141
+ scheduleState.OpenFinSchedules?.forEach((openfin) => {
142
+ if (!openfin.Name) {
143
+ const reportName = openfin.OpenFinReport?.ReportName || '';
144
+ openfin.Name = `OpenFinSchedule-${this.hashStrings(['OpenFinSchedule', reportName])}`;
145
+ }
146
+ });
147
+ }
148
+ scopeToString(scope) {
149
+ if (!scope) {
150
+ return '';
151
+ }
152
+ if ('All' in scope && scope.All) {
153
+ return 'All';
154
+ }
155
+ if ('ColumnIds' in scope && scope.ColumnIds) {
156
+ return scope.ColumnIds.join(',');
157
+ }
158
+ if ('DataTypes' in scope && scope.DataTypes) {
159
+ return scope.DataTypes.join(',');
160
+ }
161
+ if ('ColumnTypes' in scope && scope.ColumnTypes) {
162
+ return scope.ColumnTypes.join(',');
163
+ }
164
+ return '';
165
+ }
166
+ hashStrings(strings) {
167
+ let hash = 0;
168
+ for (const str of strings) {
169
+ for (let i = 0; i < str.length; i++) {
170
+ hash = (hash * 31 + str.charCodeAt(i)) % 9000;
171
+ }
172
+ }
173
+ return hash + 1000;
174
+ }
175
+ /**
176
+ * Stringifies an object after removing metadata properties (Uuid, Source, AdaptableVersion)
177
+ * to ensure deterministic hashing regardless of generated values.
178
+ */
179
+ stringifyWithoutMetadata(obj) {
180
+ if (!obj) {
181
+ return '';
182
+ }
183
+ const cloned = structuredClone(obj);
184
+ removeAdaptableObjectPrimitivesInlineDeep(cloned);
185
+ return JSON.stringify(cloned);
186
+ }
27
187
  }
package/src/types.d.ts CHANGED
@@ -157,8 +157,7 @@ export type { SystemStatusMessageInfo } from './AdaptableState/Common/SystemStat
157
157
  export type { AlternativeModuleName } from './AdaptableState/Common/AlternativeModuleName';
158
158
  export type { AdaptableFormat, DateFormatterOptions, NumberFormatterOptions, StringFormatterOptions, } from './AdaptableState/Common/AdaptableFormat';
159
159
  export type { AdaptableMessageType } from './AdaptableState/Common/AdaptableMessageType';
160
- export type { AdaptableObject, AdaptableObjectTag, AdaptableObjectLookupCriteria, AdaptableVersion, } from './AdaptableState/Common/AdaptableObject';
161
- export type { SuspendableObject } from './AdaptableState/Common/SuspendableObject';
160
+ export type { Identifiable, AdaptableObject, AdaptableObjectTag, AdaptableObjectLookupCriteria, AdaptableVersion, SuspendableObject, NamedObject, } from './AdaptableState/Common/AdaptableObject';
162
161
  export type { AdaptableQuery, AdaptableAggregatedBooleanQuery, AdaptableAggregatedScalarQuery, AdaptableBooleanQuery, AdaptableObservableQuery, AdaptableScalarQuery, } from './AdaptableState/Common/AdaptableQuery';
163
162
  export type { AdaptablePredicate, AdaptableColumnPredicate, AdaptablePredicateDef, PredicateModuleScope, PredicateDefHandlerContext, PredicateDefInput, PredicateDefToStringParams, ColumnFilterDef, } from './AdaptableState/Common/AdaptablePredicate';
164
163
  export type { ColumnScope } from './AdaptableState/Common/ColumnScope';