@adaptabletools/adaptable-cjs 22.0.0-canary.3 → 22.0.0-canary.5

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 (150) hide show
  1. package/index.css +58 -29
  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/AdaptableStyle.d.ts +1 -1
  15. package/src/AdaptableState/Common/RowSummary.d.ts +1 -1
  16. package/src/AdaptableState/Common/Schedule.d.ts +3 -4
  17. package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +2 -2
  18. package/src/AdaptableState/CustomSortState.d.ts +2 -2
  19. package/src/AdaptableState/DashboardState.d.ts +2 -2
  20. package/src/AdaptableState/ExportState.d.ts +2 -2
  21. package/src/AdaptableState/FlashingCellState.d.ts +2 -2
  22. package/src/AdaptableState/FormatColumnState.d.ts +2 -2
  23. package/src/AdaptableState/LayoutState.d.ts +8 -3
  24. package/src/AdaptableState/NamedQueryState.d.ts +2 -2
  25. package/src/AdaptableState/PlusMinusState.d.ts +2 -2
  26. package/src/AdaptableState/ShortcutState.d.ts +2 -2
  27. package/src/AdaptableState/StyledColumnState.d.ts +1 -1
  28. package/src/AdaptableState/ThemeState.d.ts +2 -2
  29. package/src/Api/CustomSortApi.d.ts +6 -3
  30. package/src/Api/Implementation/CustomSortApiImpl.d.ts +5 -1
  31. package/src/Api/Implementation/CustomSortApiImpl.js +2 -2
  32. package/src/Api/Implementation/LayoutHelpers.js +7 -0
  33. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  34. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +1 -1
  35. package/src/Strategy/AlertModule.js +4 -0
  36. package/src/Strategy/CustomSortModule.js +4 -0
  37. package/src/Strategy/FlashingCellModule.js +5 -0
  38. package/src/Strategy/FormatColumnModule.js +4 -0
  39. package/src/Strategy/LayoutModule.js +4 -4
  40. package/src/Strategy/PlusMinusModule.js +4 -0
  41. package/src/Strategy/ScheduleModule.js +4 -0
  42. package/src/Strategy/ShortcutModule.js +4 -0
  43. package/src/Utilities/Extensions/StringExtensions.d.ts +2 -0
  44. package/src/Utilities/Extensions/StringExtensions.js +17 -0
  45. package/src/Utilities/Helpers/FormatHelper.js +9 -2
  46. package/src/Utilities/ObjectFactory.js +15 -2
  47. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +2 -1
  48. package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +5 -2
  49. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +48 -12
  50. package/src/View/Alert/Wizard/AlertWizard.js +12 -8
  51. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +1 -2
  52. package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -2
  53. package/src/View/Components/StyleComponent.d.ts +1 -0
  54. package/src/View/Components/StyleComponent.js +84 -33
  55. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
  56. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +39 -13
  57. package/src/View/CustomSort/Wizard/CustomSortWizard.js +4 -4
  58. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -0
  59. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.d.ts +2 -1
  60. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +36 -15
  61. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +13 -9
  62. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +47 -29
  63. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +22 -11
  64. package/src/View/GridFilter/GridFilterExpressionEditor.js +6 -1
  65. package/src/View/GridFilter/GridFilterViewPanel.js +33 -70
  66. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +8 -0
  67. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +32 -9
  68. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +20 -15
  69. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +12 -1
  70. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +12 -1
  71. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +12 -2
  72. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +12 -1
  73. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.d.ts +2 -1
  74. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +10 -1
  75. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.d.ts +2 -1
  76. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +25 -4
  77. package/src/View/Shortcut/Wizard/ShortcutWizard.js +18 -14
  78. package/src/components/ColorPicker/ColorPicker.js +5 -4
  79. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  80. package/src/env.js +2 -2
  81. package/src/layout-manager/src/LayoutManagerModel.d.ts +1 -0
  82. package/src/layout-manager/src/index.js +25 -7
  83. package/src/layout-manager/src/normalizeLayoutModel.js +3 -0
  84. package/src/metamodel/adaptable.metamodel.d.ts +30 -0
  85. package/src/metamodel/adaptable.metamodel.js +1 -1
  86. package/src/migration/AdaptableUpgradeHelper.js +1 -1
  87. package/src/migration/VersionUpgrade22.d.ts +15 -0
  88. package/src/migration/VersionUpgrade22.js +160 -0
  89. package/src/types.d.ts +1 -2
  90. package/tsconfig.cjs.tsbuildinfo +1 -1
  91. package/src/AdaptableState/Common/SuspendableObject.d.ts +0 -10
  92. package/src/AdaptableState/Common/SuspendableObject.js +0 -2
  93. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +0 -1
  94. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +0 -633
  95. package/src/View/Alert/AlertEntityRow.d.ts +0 -11
  96. package/src/View/Alert/AlertEntityRow.js +0 -33
  97. package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -21
  98. package/src/View/CalculatedColumn/CalculatedColumnSummary.js +0 -63
  99. package/src/View/Components/Buttons/ButtonFunction.d.ts +0 -7
  100. package/src/View/Components/Buttons/ButtonFunction.js +0 -13
  101. package/src/View/Components/Buttons/ButtonGeneral.d.ts +0 -5
  102. package/src/View/Components/Buttons/ButtonGeneral.js +0 -12
  103. package/src/View/Components/Buttons/ButtonPreviewDelete.d.ts +0 -4
  104. package/src/View/Components/Buttons/ButtonPreviewDelete.js +0 -8
  105. package/src/View/Components/Buttons/ButtonShow.d.ts +0 -5
  106. package/src/View/Components/Buttons/ButtonShow.js +0 -12
  107. package/src/View/Components/Buttons/ButtonShowChart.d.ts +0 -5
  108. package/src/View/Components/Buttons/ButtonShowChart.js +0 -12
  109. package/src/View/Components/Buttons/ButtonUndo.d.ts +0 -5
  110. package/src/View/Components/Buttons/ButtonUndo.js +0 -12
  111. package/src/View/Components/ExpressionWizard.d.ts +0 -24
  112. package/src/View/Components/ExpressionWizard.js +0 -82
  113. package/src/View/Components/FilterForm/Waiting.d.ts +0 -10
  114. package/src/View/Components/FilterForm/Waiting.js +0 -19
  115. package/src/View/Components/Panels/PanelFooter.d.ts +0 -10
  116. package/src/View/Components/Panels/PanelFooter.js +0 -14
  117. package/src/View/Components/Panels/PanelWithTwoButtons.d.ts +0 -12
  118. package/src/View/Components/Panels/PanelWithTwoButtons.js +0 -20
  119. package/src/View/Components/Panels/ToolPanelSettingsPanel.d.ts +0 -8
  120. package/src/View/Components/Panels/ToolPanelSettingsPanel.js +0 -31
  121. package/src/View/Components/Selectors/ColumnSelectorOld.d.ts +0 -18
  122. package/src/View/Components/Selectors/ColumnSelectorOld.js +0 -50
  123. package/src/View/Components/SharedProps/WizardScopeState.d.ts +0 -4
  124. package/src/View/Components/SharedProps/WizardScopeState.js +0 -2
  125. package/src/View/Components/WizardSummaryRow.d.ts +0 -9
  126. package/src/View/Components/WizardSummaryRow.js +0 -16
  127. package/src/View/CustomSort/CustomSortSummary.d.ts +0 -23
  128. package/src/View/CustomSort/CustomSortSummary.js +0 -110
  129. package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +0 -9
  130. package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +0 -24
  131. package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +0 -19
  132. package/src/View/Export/Wizard/ReportColumnTypeWizard.js +0 -73
  133. package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +0 -19
  134. package/src/View/Export/Wizard/ReportRowTypeWizard.js +0 -73
  135. package/src/View/Export/Wizard/ReportSettingsWizard.d.ts +0 -21
  136. package/src/View/Export/Wizard/ReportSettingsWizard.js +0 -61
  137. package/src/View/Export/Wizard/ReportSummaryWizard.d.ts +0 -15
  138. package/src/View/Export/Wizard/ReportSummaryWizard.js +0 -40
  139. package/src/View/Filter/FilterSummary.d.ts +0 -18
  140. package/src/View/Filter/FilterSummary.js +0 -53
  141. package/src/View/FormatColumn/FormatColumnSummary.d.ts +0 -22
  142. package/src/View/FormatColumn/FormatColumnSummary.js +0 -95
  143. package/src/View/FreeTextColumn/FreeTextColumnSummary.d.ts +0 -22
  144. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +0 -93
  145. package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.d.ts +0 -7
  146. package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.js +0 -99
  147. package/src/View/PlusMinus/PlusMinusSummary.d.ts +0 -22
  148. package/src/View/PlusMinus/PlusMinusSummary.js +0 -100
  149. package/src/View/Wizard/WizardLegend.d.ts +0 -12
  150. package/src/View/Wizard/WizardLegend.js +0 -28
@@ -11,6 +11,7 @@ const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard
11
11
  const Utilities_1 = require("./Utilities");
12
12
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../../Utilities/Extensions/ArrayExtensions"));
13
13
  const Flex_1 = require("../../../../components/Flex");
14
+ const CheckBox_1 = require("../../../../components/CheckBox");
14
15
  const PivotColumnsSectionSummary = () => {
15
16
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
16
17
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
@@ -33,6 +34,13 @@ const PivotColumnsSection = (props) => {
33
34
  return (React.createElement(Tabs_1.Tabs, { className: "twa:h-full" },
34
35
  React.createElement(Tabs_1.Tabs.Tab, null, "Pivot Columns"),
35
36
  React.createElement(Tabs_1.Tabs.Content, null,
37
+ React.createElement(Flex_1.Box, { className: "twa:mb-3 twa:px-2" },
38
+ React.createElement(CheckBox_1.CheckBox, { checked: !!layout.PivotResultColumnsOrder, onChange: (checked) => {
39
+ props.onChange({
40
+ ...layout,
41
+ PivotResultColumnsOrder: checked,
42
+ });
43
+ } }, "Persist Order of Pivot Result Columns")),
36
44
  React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, options: sortedPivotColumns, value: layout.PivotColumns ?? [], allowReorder: true, onChange: handleColumnsChange }))));
37
45
  };
38
46
  exports.PivotColumnsSection = PivotColumnsSection;
@@ -4,7 +4,6 @@ exports.PlusMinusSettingsWizardSection = exports.isSettingsValid = exports.PlusM
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
7
- const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
8
7
  const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
9
8
  const Tabs_1 = require("../../../components/Tabs");
10
9
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
@@ -16,13 +15,27 @@ const Flex_1 = require("../../../components/Flex");
16
15
  const PlusMinusSettingsSummary = (props) => {
17
16
  const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
18
17
  return (React.createElement(React.Fragment, null,
18
+ React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
19
+ "Name ",
20
+ React.createElement(Tag_1.Tag, null, data.Name || 'Not specified')),
19
21
  React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
20
22
  "Nudge Value ",
21
23
  React.createElement(Tag_1.Tag, null, data.NudgeValue ?? 'Not selected')),
24
+ React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
25
+ "Nudge Type ",
26
+ React.createElement(Tag_1.Tag, null, props.hasCondition ? 'Conditional' : 'Always Apply')),
22
27
  props.hasCondition && React.createElement(PlusMinusRuleWizardSection_1.PlusMinusRuleSummary, null)));
23
28
  };
24
29
  exports.PlusMinusSettingsSummary = PlusMinusSettingsSummary;
25
30
  const isSettingsValid = (hasCondition) => (data, api, context) => {
31
+ if (!data.Name?.trim()) {
32
+ return 'Name is required';
33
+ }
34
+ const allPlusMinusNudges = api.plusMinusApi.getAllPlusMinus();
35
+ const isDuplicateName = allPlusMinusNudges.some((nudge) => nudge.Name === data.Name && nudge.Uuid !== data.Uuid);
36
+ if (isDuplicateName) {
37
+ return 'A Plus Minus Nudge already exists with that name';
38
+ }
26
39
  if (hasCondition) {
27
40
  if (!data?.Rule?.BooleanExpression) {
28
41
  return 'No valid Rule is specified';
@@ -43,6 +56,12 @@ const isSettingsValid = (hasCondition) => (data, api, context) => {
43
56
  exports.isSettingsValid = isSettingsValid;
44
57
  const PlusMinusSettingsWizardSection = (props) => {
45
58
  const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
59
+ const handleNameChange = (event) => {
60
+ props.onChange({
61
+ ...data,
62
+ Name: event.target.value,
63
+ });
64
+ };
46
65
  const handleNudgeValueChange = (event) => {
47
66
  const newValue = parseFloat(event.target.value);
48
67
  props.onChange({
@@ -51,16 +70,20 @@ const PlusMinusSettingsWizardSection = (props) => {
51
70
  });
52
71
  };
53
72
  return (React.createElement(Flex_1.Flex, { flexDirection: "column", "data-name": "plus-minus-column-settings", className: "twa:h-full" },
54
- React.createElement(Tabs_1.Tabs, { autoFocus: false, className: "twa:p-2" },
55
- React.createElement(Tabs_1.Tabs.Tab, null, "Plus Minus Settings"),
73
+ React.createElement(Tabs_1.Tabs, { className: "twa:p-2" },
74
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
56
75
  React.createElement(Tabs_1.Tabs.Content, null,
57
76
  React.createElement(FormLayout_1.default, null,
77
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
78
+ React.createElement(Input_1.default, { "data-name": "plus-minus-name", className: "twa:flex-1 twa:mr-3", onChange: handleNameChange, placeholder: "Enter Name", value: data.Name ?? '' })),
58
79
  React.createElement(FormLayout_1.FormRow, { label: "Nudge Value" },
59
- React.createElement(Input_1.default, { "data-name": "nudge-value", className: "twa:flex-1 twa:mr-3", onChange: handleNudgeValueChange, placeholder: "Enter Number", type: "number", value: data.NudgeValue ?? '' })),
60
- React.createElement(FormLayout_1.FormRow, { label: "Nudge Type" },
61
- React.createElement(Flex_1.Flex, null,
62
- React.createElement(Radio_1.default, { "data-name": "nudge-type-always", value: "Always", checked: !props.hasCondition, onChange: () => props.onConditionChange(false) }, "Always Apply Nudge"),
63
- React.createElement(Radio_1.default, { "data-name": "nudge-type-condition", className: "twa:ml-3", value: "Expression", checked: props.hasCondition, onChange: () => props.onConditionChange(true) }, "Create a Rule")))))),
64
- props.hasCondition && (React.createElement(PlusMinusRuleWizardSection_1.PlusMinusRuleWizardSection, { defaultPredicateId: "NonBlanks", onChange: props.onChange }))));
80
+ React.createElement(Input_1.default, { "data-name": "nudge-value", className: "twa:flex-1 twa:mr-3", onChange: handleNudgeValueChange, placeholder: "Enter Number", type: "number", value: data.NudgeValue ?? '' }))))),
81
+ React.createElement(Tabs_1.Tabs, { className: "twa:p-2", selectedIndex: props.hasCondition ? 1 : 0, onSelectedIndexChange: (index) => props.onConditionChange(index === 1) },
82
+ React.createElement(Tabs_1.Tabs.Tab, { "data-name": "nudge-type-always" }, "Always Apply"),
83
+ React.createElement(Tabs_1.Tabs.Tab, { "data-name": "nudge-type-condition" }, "Conditional"),
84
+ React.createElement(Tabs_1.Tabs.Content, null,
85
+ React.createElement(Flex_1.Flex, { className: "twa:text-2 twa:py-2" }, "The nudge value is always applied when using Plus/Minus")),
86
+ React.createElement(Tabs_1.Tabs.Content, { className: "twa:p-0" },
87
+ React.createElement(PlusMinusRuleWizardSection_1.PlusMinusRuleWizardSection, { defaultPredicateId: "NonBlanks", onChange: props.onChange })))));
65
88
  };
66
89
  exports.PlusMinusSettingsWizardSection = PlusMinusSettingsWizardSection;
@@ -13,7 +13,7 @@ const PlusMinusRedux = tslib_1.__importStar(require("../../../Redux/ActionsReduc
13
13
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
14
14
  const Flex_1 = require("../../../components/Flex");
15
15
  const PlusMinusWizard = (props) => {
16
- const [plusMinus, setPlusMinus] = React.useState(() => {
16
+ const [plusMinus, doSetPlusMinus] = React.useState(() => {
17
17
  const newPlusMinus = {
18
18
  ...(props.data ? props.data : ObjectFactory_1.default.CreateEmptyPlusMinusNudge()),
19
19
  Scope: props?.data?.Scope ?? { All: true },
@@ -26,19 +26,24 @@ const PlusMinusWizard = (props) => {
26
26
  }
27
27
  return newPlusMinus;
28
28
  });
29
+ const setPlusMinus = React.useCallback((data) => {
30
+ doSetPlusMinus(data);
31
+ }, []);
29
32
  const [hasCondition, setHasCondition] = React.useState(() => {
30
33
  // true if on edit and it has a condition
31
34
  return Boolean(props?.data?.Rule);
32
35
  });
33
36
  React.useEffect(() => {
34
- const preparedData = { ...plusMinus };
35
- if (hasCondition) {
36
- preparedData.Rule = preparedData.Rule ?? { BooleanExpression: '' };
37
- }
38
- else {
39
- delete preparedData.Rule;
40
- }
41
- setPlusMinus(preparedData);
37
+ doSetPlusMinus((prev) => {
38
+ const preparedData = { ...prev };
39
+ if (hasCondition) {
40
+ preparedData.Rule = preparedData.Rule ?? { BooleanExpression: '' };
41
+ }
42
+ else {
43
+ delete preparedData.Rule;
44
+ }
45
+ return preparedData;
46
+ });
42
47
  }, [hasCondition]);
43
48
  const dispatch = (0, react_redux_1.useDispatch)();
44
49
  const handleFinish = () => {
@@ -51,6 +56,12 @@ const PlusMinusWizard = (props) => {
51
56
  props.onFinishWizard(plusMinus);
52
57
  };
53
58
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: plusMinus, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
59
+ {
60
+ title: 'Settings',
61
+ isValid: (0, PlusMinusSettingsWizardSection_1.isSettingsValid)(hasCondition),
62
+ renderSummary: () => React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsSummary, { hasCondition: hasCondition }),
63
+ render: () => (React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsWizardSection, { hasCondition: hasCondition, onConditionChange: setHasCondition, onChange: setPlusMinus })),
64
+ },
54
65
  {
55
66
  title: 'Target',
56
67
  isValid: NewScopeComponent_1.isScopeValid,
@@ -63,12 +74,6 @@ const PlusMinusWizard = (props) => {
63
74
  render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
64
75
  React.createElement(PlusMinusScopeWizardSection_1.PlusMinusScopeWizardSection, { onChange: setPlusMinus }))),
65
76
  },
66
- {
67
- title: 'Settings',
68
- isValid: (0, PlusMinusSettingsWizardSection_1.isSettingsValid)(hasCondition),
69
- renderSummary: () => React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsSummary, { hasCondition: hasCondition }),
70
- render: () => (React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsWizardSection, { hasCondition: hasCondition, onConditionChange: setHasCondition, onChange: setPlusMinus })),
71
- },
72
77
  {
73
78
  details: 'Select Plus/Minus Tags',
74
79
  title: 'Tags',
@@ -5,11 +5,18 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Tabs_1 = require("../../../../components/Tabs");
7
7
  const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
8
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
8
9
  const Radio_1 = tslib_1.__importDefault(require("../../../../components/Radio"));
9
10
  const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
10
11
  const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
11
12
  const Flex_1 = require("../../../../components/Flex");
12
13
  const ScheduleSettingsIPushPull = (props) => {
14
+ const handleNameChange = (event) => {
15
+ props.onChange({
16
+ ...props.iPushPull,
17
+ Name: event.target.value,
18
+ });
19
+ };
13
20
  const reportOptions = props.allReports.map((report) => ({
14
21
  label: report.Name,
15
22
  value: report.Name,
@@ -49,9 +56,13 @@ const ScheduleSettingsIPushPull = (props) => {
49
56
  });
50
57
  return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-ipushpull" },
51
58
  React.createElement(Tabs_1.Tabs, { autoFocus: false },
52
- React.createElement(Tabs_1.Tabs.Tab, null, "Ipushpull Schedule Settings"),
59
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
53
60
  React.createElement(Tabs_1.Tabs.Content, null,
54
61
  React.createElement(FormLayout_1.default, null,
62
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
63
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.iPushPull?.Name ?? '' })),
64
+ React.createElement(FormLayout_1.FormRow, { label: "" },
65
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
55
66
  React.createElement(FormLayout_1.FormRow, { label: "Select Report" },
56
67
  React.createElement(DropdownButton_1.default, { "data-name": "report-name", disabled: props.allReports.length == 0, items: reportOptions, className: "twa:w-[300px]" }, props?.iPushPull?.IPushPullReport?.ReportName || 'Select Report')),
57
68
  React.createElement(FormLayout_1.FormRow, { label: "Select Folder" },
@@ -5,9 +5,16 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Tabs_1 = require("../../../../components/Tabs");
7
7
  const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
8
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
8
9
  const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
9
10
  const Flex_1 = require("../../../../components/Flex");
10
11
  const ScheduleSettingsOpenFin = (props) => {
12
+ const handleNameChange = (event) => {
13
+ props.onChange({
14
+ ...props.openFin,
15
+ Name: event.target.value,
16
+ });
17
+ };
11
18
  const reportOptions = props.allReports.map((report) => ({
12
19
  label: report.Name,
13
20
  value: report.Name,
@@ -21,9 +28,13 @@ const ScheduleSettingsOpenFin = (props) => {
21
28
  }));
22
29
  return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-openfin" },
23
30
  React.createElement(Tabs_1.Tabs, { autoFocus: false },
24
- React.createElement(Tabs_1.Tabs.Tab, null, "OpenFin Schedule Settings"),
31
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
25
32
  React.createElement(Tabs_1.Tabs.Content, null,
26
33
  React.createElement(FormLayout_1.default, null,
34
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
35
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.openFin?.Name ?? '' })),
36
+ React.createElement(FormLayout_1.FormRow, { label: "" },
37
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
27
38
  React.createElement(FormLayout_1.FormRow, { label: "Select Report" },
28
39
  React.createElement(DropdownButton_1.default, { "data-name": "select-report", columns: ['label'], className: "twa:w-[300px]", disabled: props.allReports.length == 0, items: reportOptions }, props?.openFin?.OpenFinReport?.ReportName || 'Select Report')))))));
29
40
  };
@@ -21,6 +21,12 @@ const ScheduleSettingsReminder = (props) => {
21
21
  });
22
22
  },
23
23
  }));
24
+ const handleNameChange = (event) => {
25
+ props.onChange({
26
+ ...props.reminderSchedule,
27
+ Name: event.target.value,
28
+ });
29
+ };
24
30
  const handleHeaderChange = (event) => {
25
31
  props.onChange({
26
32
  ...props.reminderSchedule,
@@ -45,11 +51,15 @@ const ScheduleSettingsReminder = (props) => {
45
51
  DisplaySystemStatusMessage: checked,
46
52
  });
47
53
  };
48
- return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-remainder" },
54
+ return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-reminder" },
49
55
  React.createElement(Tabs_1.Tabs, { autoFocus: false },
50
- React.createElement(Tabs_1.Tabs.Tab, null, "Reminder Schedule Settings"),
56
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
51
57
  React.createElement(Tabs_1.Tabs.Content, null,
52
58
  React.createElement(FormLayout_1.default, null,
59
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
60
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.reminderSchedule?.Name ?? '' })),
61
+ React.createElement(FormLayout_1.FormRow, { label: "" },
62
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
53
63
  React.createElement(FormLayout_1.FormRow, { label: "Header" },
54
64
  React.createElement(Input_1.default, { "data-name": "header", className: "twa:w-[300px]", onChange: handleHeaderChange, placeholder: "Enter Reminder Header", type: "string", value: props.reminderSchedule?.Header })),
55
65
  React.createElement(FormLayout_1.FormRow, { label: "Message" },
@@ -4,10 +4,17 @@ exports.ScheduleSettingsReport = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
7
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
7
8
  const Select_1 = require("../../../../components/Select");
8
9
  const Tabs_1 = require("../../../../components/Tabs");
9
10
  const Flex_1 = require("../../../../components/Flex");
10
11
  const ScheduleSettingsReport = (props) => {
12
+ const handleNameChange = (event) => {
13
+ props.onChange({
14
+ ...props.report,
15
+ Name: event.target.value,
16
+ });
17
+ };
11
18
  const reportOptions = props.allReports.map((report) => ({
12
19
  label: report.Name,
13
20
  value: report.Name,
@@ -34,9 +41,13 @@ const ScheduleSettingsReport = (props) => {
34
41
  }));
35
42
  return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-report" },
36
43
  React.createElement(Tabs_1.Tabs, { autoFocus: false, className: "twa:mb-3" },
37
- React.createElement(Tabs_1.Tabs.Tab, null, "Report Settings"),
44
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
38
45
  React.createElement(Tabs_1.Tabs.Content, null,
39
46
  React.createElement(FormLayout_1.default, null,
47
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
48
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.report?.Name ?? '' })),
49
+ React.createElement(FormLayout_1.FormRow, { label: "" },
50
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
40
51
  React.createElement(FormLayout_1.FormRow, { label: "Export" },
41
52
  React.createElement(Flex_1.Box, { className: "twa:max-w-[300px]" },
42
53
  React.createElement(Select_1.Select, { "data-name": "select-report", options: reportOptions, value: props?.report?.ReportName, placeholder: "Select Export", onChange: (value) => props.onChange({
@@ -1,2 +1,3 @@
1
+ import { AdaptableApi } from '../../../../Api/AdaptableApi';
1
2
  import { BaseSchedule } from '../../../../AdaptableState/Common/Schedule';
2
- export declare const isSettingsValid: (schedule: BaseSchedule) => true | "Message type not selected" | "Reminder header not specified" | "Reminder message not specified" | "Report source not specified" | "Report format not selected" | "Report not selected" | "Report folder not selected" | "Report page not selected";
3
+ export declare const isSettingsValid: (schedule: BaseSchedule, api: AdaptableApi) => true | "Name is required" | "A Schedule with this name already exists" | "Message type not selected" | "Reminder header not specified" | "Reminder message not specified" | "Report source not specified" | "Report format not selected" | "Report not selected" | "Report folder not selected" | "Report page not selected";
@@ -4,7 +4,16 @@ exports.isSettingsValid = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Enums_1 = require("../../../../AdaptableState/Common/Enums");
6
6
  const StringExtensions_1 = tslib_1.__importDefault(require("../../../../Utilities/Extensions/StringExtensions"));
7
- const isSettingsValid = (schedule) => {
7
+ const isSettingsValid = (schedule, api) => {
8
+ // Validate Name - mandatory and unique
9
+ if (!schedule.Name?.trim()) {
10
+ return 'Name is required';
11
+ }
12
+ const allSchedules = api.scheduleApi.getSchedules();
13
+ const isDuplicateName = allSchedules.some((s) => s.Name === schedule.Name && s.Uuid !== schedule.Uuid);
14
+ if (isDuplicateName) {
15
+ return 'A Schedule with this name already exists';
16
+ }
8
17
  if (schedule.ScheduleType === Enums_1.ScheduleType.Reminder) {
9
18
  const reminder = schedule;
10
19
  if (!reminder.MessageType) {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Shortcut } from '../../../AdaptableState/ShortcutState';
3
- export declare const isSettingsValid: (data: Shortcut) => string | true;
3
+ import { AdaptableApi } from '../../../types';
4
+ export declare const isSettingsValid: (data: Shortcut, api: AdaptableApi) => string | true;
4
5
  export declare const ShortcutSettingsSummary: React.FunctionComponent;
5
6
  interface ShortcutSettingsWizardProps {
6
7
  availableKeys: Array<string>;
@@ -13,7 +13,15 @@ const Tag_1 = require("../../../components/Tag");
13
13
  const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
14
14
  const Select_1 = require("../../../components/Select");
15
15
  const Flex_1 = require("../../../components/Flex");
16
- const isSettingsValid = (data) => {
16
+ const isSettingsValid = (data, api) => {
17
+ if (!data.Name?.trim()) {
18
+ return 'Name is required';
19
+ }
20
+ const allShortcuts = api.shortcutApi.getShortcuts();
21
+ const isDuplicateName = allShortcuts.some((s) => s.Name === data.Name && s.Uuid !== data.Uuid);
22
+ if (isDuplicateName) {
23
+ return 'A Shortcut already exists with that name';
24
+ }
17
25
  const shortcutKey = data.ShortcutKey && typeof data.ShortcutKey === 'string' ? '' : 'Shortcut key is not selected';
18
26
  const shortcutValue = typeof data.ShortcutValue === 'number' ? '' : 'Shortcut value is not specified';
19
27
  const shortcutOperation = data.ShortcutOperation && typeof data.ShortcutOperation === 'string'
@@ -26,6 +34,9 @@ exports.isSettingsValid = isSettingsValid;
26
34
  const ShortcutSettingsSummary = () => {
27
35
  const { data: shortcut } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
28
36
  return (React.createElement(React.Fragment, null,
37
+ React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
38
+ "Name ",
39
+ React.createElement(Tag_1.Tag, null, shortcut.Name || 'Not specified')),
29
40
  React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
30
41
  "Shortcut Key ",
31
42
  React.createElement(Tag_1.Tag, null, shortcut.ShortcutKey || 'Not selected')),
@@ -39,6 +50,12 @@ const ShortcutSettingsSummary = () => {
39
50
  exports.ShortcutSettingsSummary = ShortcutSettingsSummary;
40
51
  const ShortcutSettingsWizard = (props) => {
41
52
  const { data: shortcut } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
53
+ const handleNameChange = (event) => {
54
+ props.onChange({
55
+ ...shortcut,
56
+ Name: event.target.value,
57
+ });
58
+ };
42
59
  const handleKeyChange = React.useCallback((ShortcutKey) => {
43
60
  props.onChange({
44
61
  ...shortcut,
@@ -69,17 +86,21 @@ const ShortcutSettingsWizard = (props) => {
69
86
  React.createElement(Tabs_1.Tabs.Tab, null, "Shortcut Settings"),
70
87
  React.createElement(Tabs_1.Tabs.Content, null,
71
88
  React.createElement(FormLayout_1.default, null,
72
- React.createElement(FormLayout_1.FormRow, null,
89
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
90
+ React.createElement(Input_1.default, { "data-name": "shortcut-name", className: "twa:flex-1 twa:max-w-[200px] twa:mr-3", onChange: handleNameChange, placeholder: "Enter Name", value: shortcut.Name ?? '' })),
91
+ React.createElement(FormLayout_1.FormRow, { label: "" },
92
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
93
+ React.createElement(FormLayout_1.FormRow, { label: "" },
73
94
  React.createElement(HelpBlock_1.default, { className: "twa:text-2 twa:mb-0" }, "Keyboard key that, when pressed, triggers the Shortcut")),
74
95
  React.createElement(FormLayout_1.FormRow, { label: "Key" },
75
96
  React.createElement(Flex_1.Flex, { flexDirection: "row" },
76
97
  React.createElement(Select_1.Select, { "data-name": "shortcut-key", placeholder: "Select Key", options: optionKeys, onChange: (key) => handleKeyChange(key), value: shortcut.ShortcutKey || 'Select Key' }))),
77
- React.createElement(FormLayout_1.FormRow, null,
98
+ React.createElement(FormLayout_1.FormRow, { label: "" },
78
99
  React.createElement(HelpBlock_1.default, { className: "twa:text-2 twa:mb-0" }, "Mathematical operation performed on Cell's current value (using the Shortcut's 'value') - used to calculate the Cell's new total")),
79
100
  React.createElement(FormLayout_1.FormRow, { label: "Operation" },
80
101
  React.createElement(Flex_1.Flex, { flexDirection: "row" },
81
102
  React.createElement(Select_1.Select, { "data-name": "shortcut-operation", placeholder: "Select Operation", options: optionActions, onChange: (operation) => handleOperationChange(operation), value: shortcut.ShortcutOperation }))),
82
- React.createElement(FormLayout_1.FormRow, null,
103
+ React.createElement(FormLayout_1.FormRow, { label: "" },
83
104
  React.createElement(HelpBlock_1.default, { className: "twa:text-2 twa:mb-0" }, "Number that is used - together with the 'Operation' and the current cell value - to calculate the new total for the cell")),
84
105
  React.createElement(FormLayout_1.FormRow, { label: "Value" },
85
106
  React.createElement(Flex_1.Flex, { flexDirection: "row" },
@@ -15,8 +15,9 @@ const shortcutKeys_1 = require("../shortcutKeys");
15
15
  const AdaptableContext_1 = require("../../AdaptableContext");
16
16
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
17
17
  const Flex_1 = require("../../../components/Flex");
18
+ const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
18
19
  const ShortcutWizard = (props) => {
19
- const [shortcut, setShortcut] = React.useState(() => {
20
+ const [shortcut, doSetShortcut] = React.useState(() => {
20
21
  const shortcut = props.data ? (0, Helper_1.cloneObject)(props.data) : ObjectFactory_1.default.CreateEmptyShortcut();
21
22
  shortcut.Scope = shortcut.Scope ?? { All: true };
22
23
  if (props.popupParams?.column && props.popupParams?.action === 'New') {
@@ -26,10 +27,13 @@ const ShortcutWizard = (props) => {
26
27
  }
27
28
  return shortcut;
28
29
  });
30
+ const setShortcut = React.useCallback((data) => {
31
+ doSetShortcut(data);
32
+ }, []);
29
33
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
30
34
  const availableKeys = React.useMemo(() => {
31
35
  const availableKeys = shortcutKeys_1.shortcutKeys.filter((key) => adaptable.api.shortcutApi.getShortcuts().every((shortcut) => shortcut.ShortcutKey !== key));
32
- if (shortcut) {
36
+ if (shortcut && StringExtensions_1.default.IsNotNullOrEmptyOrWhiteSpace(shortcut.ShortcutKey)) {
33
37
  availableKeys.push(shortcut.ShortcutKey);
34
38
  }
35
39
  availableKeys.sort();
@@ -46,18 +50,6 @@ const ShortcutWizard = (props) => {
46
50
  props.onFinishWizard(shortcut);
47
51
  };
48
52
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: shortcut, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
49
- {
50
- title: 'Target',
51
- isValid: NewScopeComponent_1.isScopeValid,
52
- details: 'Specify where Shortcut should be applied',
53
- renderSummary: () => (0, NewScopeComponent_1.renderScopeSummary)(shortcut.Scope, {
54
- scopeWholeRow: 'Shortcut is triggered for all numeric cells',
55
- scopeColumns: 'Shortcut is triggered for cells in selected columns',
56
- scopeDataTypes: 'Shortcut is triggered for all numeric cells',
57
- }),
58
- render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
59
- React.createElement(ShortcutScopeWizardSection_1.ShortcutScopeWizardSection, { onChange: setShortcut }))),
60
- },
61
53
  {
62
54
  title: 'Settings',
63
55
  isValid: ShortcutSettingsWizard_1.isSettingsValid,
@@ -73,6 +65,18 @@ const ShortcutWizard = (props) => {
73
65
  render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
74
66
  React.createElement(ShortcutSettingsWizard_1.ShortcutSettingsWizard, { availableKeys: props.availableKeys ?? availableKeys, onChange: setShortcut }))),
75
67
  },
68
+ {
69
+ title: 'Target',
70
+ isValid: NewScopeComponent_1.isScopeValid,
71
+ details: 'Specify where Shortcut should be applied',
72
+ renderSummary: () => (0, NewScopeComponent_1.renderScopeSummary)(shortcut.Scope, {
73
+ scopeWholeRow: 'Shortcut is triggered for all numeric cells',
74
+ scopeColumns: 'Shortcut is triggered for cells in selected columns',
75
+ scopeDataTypes: 'Shortcut is triggered for all numeric cells',
76
+ }),
77
+ render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
78
+ React.createElement(ShortcutScopeWizardSection_1.ShortcutScopeWizardSection, { onChange: setShortcut }))),
79
+ },
76
80
  {
77
81
  details: 'Select Shortcut Tags',
78
82
  title: 'Tags',
@@ -53,8 +53,9 @@ exports.ColorPicker = React.forwardRef((props, ref) => {
53
53
  ABcolorChoices,
54
54
  includeAlpha && (React.createElement(Flex_1.Flex, { alignItems: "center", className: "twa:gap-1" },
55
55
  React.createElement(Flex_1.Box, null, "Opacity"),
56
- React.createElement(Input_1.default, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
57
- const color = (0, tinycolor2_1.default)(value).setAlpha(event.target.value).toRgbString();
58
- debouncedOnChange(color);
59
- }, min: 0, max: 1, step: 0.01, type: "range" })))));
56
+ React.createElement(Flex_1.Flex, { alignItems: "center", className: "twa:min-h-input" },
57
+ React.createElement(Input_1.default, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
58
+ const color = (0, tinycolor2_1.default)(value).setAlpha(event.target.value).toRgbString();
59
+ debouncedOnChange(color);
60
+ }, min: 0, max: 1, step: 0.01, type: "range" }))))));
60
61
  });
@@ -19,6 +19,6 @@ const ExpressionFunctionDocumentation = (props) => {
19
19
  React.createElement("pre", { className: signatureClassName }, example))))))),
20
20
  props.expressionFunction.returnType && (React.createElement(Flex_1.Box, { "data-name": "expression-editor-documentation-examples" },
21
21
  React.createElement("b", null, "Return Type"),
22
- React.createElement(Tag_1.Tag, { className: "twa:bg-accentlight twa:text-accent twa:ml-3 twa:rounded-full" }, props.expressionFunction.returnType))))) : null;
22
+ React.createElement(Tag_1.Tag, { className: "twa:bg-accentlight twa:text-accent twa:ml-3 twa:rounded-full twa:py-1" }, props.expressionFunction.returnType))))) : null;
23
23
  };
24
24
  exports.ExpressionFunctionDocumentation = ExpressionFunctionDocumentation;
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1770107080647 || Date.now(),
6
- VERSION: "22.0.0-canary.3" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1770330519921 || Date.now(),
6
+ VERSION: "22.0.0-canary.5" || '--current-version--',
7
7
  };
@@ -172,5 +172,6 @@ export interface PivotLayoutModel extends BaseLayoutModel {
172
172
  * Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
173
173
  */
174
174
  PivotColumnTotal?: 'before' | 'after' | boolean;
175
+ PivotResultColumnsOrder?: string[] | boolean;
175
176
  }
176
177
  export type LayoutModel = TableLayoutModel | PivotLayoutModel;
@@ -169,7 +169,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
169
169
  this.setupEvents();
170
170
  this.indexColumns();
171
171
  this.setupPivotTotals();
172
- globalThis.layoutManager = this;
172
+ // (globalThis as any).layoutManager = this;
173
173
  }
174
174
  destroy() {
175
175
  if (this.destroyed) {
@@ -347,10 +347,11 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
347
347
  const columnState = this.gridApi
348
348
  .getColumnState()
349
349
  .filter((col) => !pivotResultColumnsSet.has(col.colId));
350
- let PivotColumns = this.gridApi.getPivotColumns().map((col) => col.getColId());
350
+ const PivotColumns = this.gridApi.getPivotColumns().map((col) => col.getColId());
351
351
  const layout = this.getUndecidedLayoutModelFromGrid(columnState);
352
352
  let ColumnSizing = layout.ColumnSizing || {};
353
353
  let ColumnVisibility = { ...layout.ColumnVisibility };
354
+ const storePivotResultColumns = !!prevLayout?.PivotResultColumnsOrder;
354
355
  //let's also include the column widths of the pivotResult columns
355
356
  pivotResultColumns.forEach((col) => {
356
357
  const colId = col.getColId();
@@ -404,6 +405,13 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
404
405
  GrandTotalRow: layout.GrandTotalRow,
405
406
  PivotExpandLevel: prevLayout?.PivotExpandLevel ?? -1,
406
407
  };
408
+ if (storePivotResultColumns) {
409
+ // Get pivot result columns in display order (not creation order)
410
+ const displayedPivotResultColumns = this.gridApi
411
+ .getAllDisplayedColumns()
412
+ .filter((col) => pivotResultColumnsSet.has(col.getColId()));
413
+ pivotLayout.PivotResultColumnsOrder = displayedPivotResultColumns.map((col) => col.getColId());
414
+ }
407
415
  if (layout.SuppressAggFuncInHeader) {
408
416
  pivotLayout.SuppressAggFuncInHeader = layout.SuppressAggFuncInHeader;
409
417
  }
@@ -427,20 +435,20 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
427
435
  let TableColumns = columnState.map((c) => c.colId);
428
436
  // .filter((colId) => colId !== 'ag-Grid-SelectionColumn');
429
437
  let ColumnSorts = [];
430
- let RowGroupedColumns = [];
438
+ const RowGroupedColumns = [];
431
439
  let RowGroupValues = undefined;
432
440
  let ColumnGroupValues = undefined;
433
441
  let TableAggregationColumns = [];
434
- let ColumnPinning = {};
442
+ const ColumnPinning = {};
435
443
  const gridState = this.gridApi.getState();
436
444
  const prevLayout = this.currentLayout;
437
445
  const prevAggColumns = prevLayout?.TableAggregationColumns ?? prevLayout?.PivotAggregationColumns;
438
- let ColumnSizing = { ...prevLayout?.ColumnSizing };
446
+ const ColumnSizing = { ...prevLayout?.ColumnSizing };
439
447
  const prevAggColumnsMap = prevAggColumns?.reduce((acc, agg) => {
440
448
  acc[agg.ColumnId] = agg;
441
449
  return acc;
442
450
  }, {});
443
- let ColumnVisibility = columnState.reduce((acc, colState) => {
451
+ const ColumnVisibility = columnState.reduce((acc, colState) => {
444
452
  const colId = colState.colId;
445
453
  // normally we take the initial width from this object
446
454
  let initialWidth = this.initialColumnWidths[colId];
@@ -1242,7 +1250,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1242
1250
  }
1243
1251
  }
1244
1252
  computeColumnStateForPivotLayout(layout) {
1245
- let columnState = {};
1253
+ const columnState = {};
1246
1254
  const pivotColumnsToIndexes = (layout.PivotColumns || []).reduce((acc, colId, index) => {
1247
1255
  acc[colId] = index;
1248
1256
  return acc;
@@ -1273,6 +1281,12 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1273
1281
  this.computeColumnSorts(layout, columnState);
1274
1282
  this.computePinnedColumns(layout, columnState);
1275
1283
  this.computePivotAggregations(layout, columnState);
1284
+ // Add pivot result columns to the state for ordering (will be applied with applyOrder: true later)
1285
+ if (Array.isArray(layout.PivotResultColumnsOrder)) {
1286
+ layout.PivotResultColumnsOrder.forEach((colId) => {
1287
+ columnState.state.push({ colId });
1288
+ });
1289
+ }
1276
1290
  return columnState;
1277
1291
  }
1278
1292
  computePivotAggregations(layout, columnState) {
@@ -1513,6 +1527,10 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1513
1527
  });
1514
1528
  // now recompute and apply the last one
1515
1529
  this.computePivotAggregations(layout, columnState);
1530
+ // Apply order only on the final call when PivotResultColumns is specified
1531
+ if (Array.isArray(layout.PivotResultColumnsOrder)) {
1532
+ columnState.applyOrder = true;
1533
+ }
1516
1534
  this.gridApi.applyColumnState(columnState);
1517
1535
  // let's also include the column widths of the pivotResult columns
1518
1536
  // we can't simply include those in the columnState because the columnState will also apply order
@@ -138,6 +138,9 @@ function normalizePivotLayoutModel(layout) {
138
138
  if (!layout.ColumnPinning) {
139
139
  layout.ColumnPinning = {};
140
140
  }
141
+ if (!layout.PivotResultColumnsOrder) {
142
+ layout.PivotResultColumnsOrder = false;
143
+ }
141
144
  if (!layout.ColumnSizing) {
142
145
  layout.ColumnSizing = {};
143
146
  }