@adaptabletools/adaptable 11.0.7 → 11.1.0

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 (132) hide show
  1. package/base.css +19 -11
  2. package/bundle.cjs.js +100 -100
  3. package/index.css +23 -11
  4. package/package.json +2 -2
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
  9. package/src/Api/AlertApi.d.ts +3 -2
  10. package/src/Api/BulkUpdateApi.d.ts +6 -1
  11. package/src/Api/CalculatedColumnApi.d.ts +1 -1
  12. package/src/Api/CellSummaryApi.d.ts +1 -1
  13. package/src/Api/ConditionalStyleApi.d.ts +1 -1
  14. package/src/Api/ConfigApi.d.ts +1 -1
  15. package/src/Api/CustomSortApi.d.ts +1 -1
  16. package/src/Api/DashboardApi.d.ts +1 -1
  17. package/src/Api/DataSourceApi.d.ts +1 -1
  18. package/src/Api/EventApi.d.ts +1 -1
  19. package/src/Api/Events/GridDataChanged.d.ts +5 -1
  20. package/src/Api/ExportApi.d.ts +7 -2
  21. package/src/Api/FormatColumnApi.d.ts +1 -1
  22. package/src/Api/FreeTextColumnApi.d.ts +1 -1
  23. package/src/Api/GridApi.d.ts +24 -3
  24. package/src/Api/Implementation/AlertApiImpl.d.ts +4 -1
  25. package/src/Api/Implementation/AlertApiImpl.js +79 -52
  26. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
  27. package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
  28. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
  29. package/src/Api/Implementation/ConfigApiImpl.js +7 -2
  30. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -1
  31. package/src/Api/Implementation/ExportApiImpl.js +14 -1
  32. package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
  33. package/src/Api/Implementation/GridApiImpl.js +24 -3
  34. package/src/Api/Implementation/InternalApiImpl.d.ts +9 -2
  35. package/src/Api/Implementation/InternalApiImpl.js +37 -1
  36. package/src/Api/Implementation/LayoutApiImpl.d.ts +6 -0
  37. package/src/Api/Implementation/LayoutApiImpl.js +48 -0
  38. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  39. package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
  40. package/src/Api/InternalApi.d.ts +9 -2
  41. package/src/Api/LayoutApi.d.ts +38 -1
  42. package/src/Api/PlusMinusApi.d.ts +1 -1
  43. package/src/Api/QueryApi.d.ts +1 -1
  44. package/src/Api/QuickSearchApi.d.ts +1 -1
  45. package/src/Api/ScheduleApi.d.ts +1 -1
  46. package/src/Api/ShortcutApi.d.ts +1 -1
  47. package/src/Api/SmartEditApi.d.ts +1 -1
  48. package/src/Api/TeamSharingApi.d.ts +1 -1
  49. package/src/Api/ThemeApi.d.ts +1 -1
  50. package/src/PredefinedConfig/AlertState.d.ts +7 -3
  51. package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
  52. package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
  53. package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
  54. package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
  55. package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
  56. package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
  57. package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
  58. package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
  59. package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
  60. package/src/PredefinedConfig/ConfigState.d.ts +4 -1
  61. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  62. package/src/PredefinedConfig/PopupState.d.ts +2 -1
  63. package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
  64. package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
  65. package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
  66. package/src/Redux/ActionsReducers/SystemRedux.d.ts +11 -0
  67. package/src/Redux/ActionsReducers/SystemRedux.js +32 -1
  68. package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
  69. package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
  70. package/src/Redux/Store/AdaptableStore.js +69 -27
  71. package/src/Strategy/AlertModule.d.ts +5 -3
  72. package/src/Strategy/AlertModule.js +60 -16
  73. package/src/Strategy/BulkUpdateModule.js +5 -0
  74. package/src/Strategy/ExportModule.js +1 -0
  75. package/src/Strategy/SmartEditModule.js +6 -0
  76. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
  77. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
  78. package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
  79. package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
  80. package/src/Utilities/ObjectFactory.d.ts +8 -6
  81. package/src/Utilities/ObjectFactory.js +26 -12
  82. package/src/Utilities/Services/LicenseService.js +1 -1
  83. package/src/Utilities/Services/ModuleService.js +1 -1
  84. package/src/Utilities/Services/ValidationService.js +1 -0
  85. package/src/View/AdaptableView.js +2 -0
  86. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
  87. package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
  88. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
  89. package/src/View/Alert/Wizard/AlertWizard.js +83 -1
  90. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  91. package/src/View/Components/FilterForm/FilterForm.js +2 -2
  92. package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
  93. package/src/View/Components/Panels/PanelFooter.js +14 -0
  94. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
  95. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
  96. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
  97. package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
  98. package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
  99. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
  100. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
  101. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
  102. package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
  103. package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
  104. package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
  105. package/src/View/Layout/LayoutPopup.js +3 -24
  106. package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
  107. package/src/View/Layout/LayoutViewPanel.js +5 -18
  108. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
  109. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
  110. package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
  111. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
  112. package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
  113. package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
  114. package/src/agGrid/Adaptable.d.ts +4 -2
  115. package/src/agGrid/Adaptable.js +65 -69
  116. package/src/agGrid/PercentBarRenderer.js +2 -1
  117. package/src/agGrid/agGridHelper.d.ts +1 -1
  118. package/src/agGrid/agGridHelper.js +23 -8
  119. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  120. package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
  121. package/src/components/Dialog/index.js +1 -1
  122. package/src/components/Modal/index.js +1 -1
  123. package/src/components/WindowModal/WindowModal.d.ts +10 -8
  124. package/src/components/WindowModal/WindowModal.js +4 -2
  125. package/src/components/WindowModal/useStacking.d.ts +9 -0
  126. package/src/components/WindowModal/useStacking.js +45 -0
  127. package/src/env.js +3 -3
  128. package/src/metamodel/adaptable.metamodel.d.ts +51 -11
  129. package/src/metamodel/adaptable.metamodel.js +183 -40
  130. package/src/types.d.ts +3 -2
  131. package/version.d.ts +1 -1
  132. package/version.js +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ObjectFactory = exports.CreateToastOptions = exports.CreateColumnFilter = exports.CreateEmptyCellSummmary = exports.CreateSystemStatusMessageInfo = exports.CreateEmptyStyle = exports.CreateEmptyLayout = exports.CreateEmptyFreeTextColumn = exports.CreateEmptyFormatColumn = exports.CreateEmptyConditionalStyle = exports.CreateEmptyShortcut = exports.CreateEmptySchedule = exports.CreateReportSchedule = exports.CreateGlue42Schedule = exports.CreateIPushPullSchedule = exports.CreateEmptyOpenFinSchedule = exports.CreateEmptyGlue42Schedule = exports.CreateEmptyIPushPullSchedule = exports.CreateEmptyOpenFinReport = exports.CreateEmptyGlue42Report = exports.CreateEmptyIPushPullReport = exports.CreateEmptyReportSchedule = exports.CreateEmptyReminderSchedule = exports.CreateEmptyBaseSchedule = exports.CreateEmptyReport = exports.CreateInternalAlertDefinitionForMessages = exports.CreateEmptyFlashingCellDefinition = exports.CreateEmptyAlertDefinition = exports.CreateAlert = exports.CreateEmptyAlert = exports.CreateEmptyPlusMinusNudge = exports.CreateEmptyNamedQuery = exports.CreateEmptyCalculatedColumn = exports.CreateEmptyDataSource = exports.CreateEmptyCustomSort = void 0;
3
+ exports.ObjectFactory = exports.CreateToastOptions = exports.CreateColumnFilter = exports.CreateEmptyCellSummmary = exports.CreateSystemStatusMessageInfo = exports.CreateEmptyStyle = exports.CreateEmptyLayout = exports.CreateEmptyFreeTextColumn = exports.CreateEmptyFormatColumn = exports.CreateEmptyConditionalStyle = exports.CreateEmptyShortcut = exports.CreateEmptySchedule = exports.CreateReportSchedule = exports.CreateGlue42Schedule = exports.CreateIPushPullSchedule = exports.CreateEmptyOpenFinSchedule = exports.CreateEmptyGlue42Schedule = exports.CreateEmptyIPushPullSchedule = exports.CreateEmptyOpenFinReport = exports.CreateEmptyGlue42Report = exports.CreateEmptyIPushPullReport = exports.CreateEmptyReportSchedule = exports.CreateEmptyReminderSchedule = exports.CreateEmptyBaseSchedule = exports.CreateEmptyReport = exports.CreateInternalAlertDefinitionForMessages = exports.CreateEmptyFlashingCellDefinition = exports.CreateEmptyAlertDefinition = exports.CreateRowChangedAlert = exports.CreateCellChangedAlert = exports.CreateGenericAlert = exports.CreateEmptyPlusMinusNudge = exports.CreateEmptyNamedQuery = exports.CreateEmptyCalculatedColumn = exports.CreateEmptyDataSource = exports.CreateEmptyCustomSort = void 0;
4
4
  const Enums_1 = require("../PredefinedConfig/Common/Enums");
5
5
  const GeneralConstants_1 = require("./Constants/GeneralConstants");
6
6
  const Uuid_1 = require("../PredefinedConfig/Uuid");
@@ -51,25 +51,38 @@ function CreateEmptyPlusMinusNudge() {
51
51
  };
52
52
  }
53
53
  exports.CreateEmptyPlusMinusNudge = CreateEmptyPlusMinusNudge;
54
- function CreateEmptyAlert() {
54
+ function CreateGenericAlert(alertHeader, alertMessage, alertDefinition) {
55
55
  return {
56
+ alertType: 'generic',
56
57
  Uuid: Uuid_1.createUuid(),
57
- header: GeneralConstants_1.EMPTY_STRING,
58
- message: GeneralConstants_1.EMPTY_STRING,
59
- alertDefinition: CreateInternalAlertDefinitionForMessages('Info'),
58
+ header: alertHeader,
59
+ message: alertMessage,
60
+ alertDefinition: alertDefinition,
60
61
  };
61
62
  }
62
- exports.CreateEmptyAlert = CreateEmptyAlert;
63
- function CreateAlert(alertHeader, alertMessage, alertDefinition, dataChangedInfo) {
63
+ exports.CreateGenericAlert = CreateGenericAlert;
64
+ function CreateCellChangedAlert(alertHeader, alertMessage, alertDefinition, dataChangedInfo) {
64
65
  return {
66
+ alertType: 'cellChanged',
65
67
  Uuid: Uuid_1.createUuid(),
66
68
  header: alertHeader,
67
69
  message: alertMessage,
68
- alertDefinition: alertDefinition,
69
- dataChangedInfo: dataChangedInfo,
70
+ alertDefinition,
71
+ dataChangedInfo,
72
+ };
73
+ }
74
+ exports.CreateCellChangedAlert = CreateCellChangedAlert;
75
+ function CreateRowChangedAlert(alertHeader, alertMessage, alertDefinition, gridDataChange) {
76
+ return {
77
+ alertType: 'rowChanged',
78
+ Uuid: Uuid_1.createUuid(),
79
+ header: alertHeader,
80
+ message: alertMessage,
81
+ alertDefinition,
82
+ gridDataChangedInfo: gridDataChange,
70
83
  };
71
84
  }
72
- exports.CreateAlert = CreateAlert;
85
+ exports.CreateRowChangedAlert = CreateRowChangedAlert;
73
86
  function CreateEmptyAlertDefinition() {
74
87
  return {
75
88
  Uuid: Uuid_1.createUuid(),
@@ -403,8 +416,9 @@ exports.ObjectFactory = {
403
416
  CreateEmptyCalculatedColumn,
404
417
  CreateEmptyNamedQuery,
405
418
  CreateEmptyPlusMinusNudge,
406
- CreateEmptyAlert,
407
- CreateAlert,
419
+ CreateGenericAlert,
420
+ CreateCellChangedAlert,
421
+ CreateRowChangedAlert,
408
422
  CreateEmptyAlertDefinition,
409
423
  CreateEmptyFlashingCellDefinition,
410
424
  CreateInternalAlertDefinitionForMessages,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../Redux/ActionsReducers/SystemRedux"),t=require("../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../ObjectFactory")),o=require("../Helpers/LoggingHelper"),i=e.__importDefault(require("lodash/clamp")),n=require("../Constants/DocumentationLinkConstants"),r=require("../license/decode"),c="sales@adaptabletools.com",l=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const E=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,I=/(https):\/\/\S+(\.csb\.app)/g,_=/(https):\/\/\S+(\.adaptabletools\.com)/g,O="undefined"!=typeof window?window.location.origin:"",h=()=>{const[e,a,t]=Array.from(E.exec(O)||[]);return"https"===a&&"sandpack.codesandbox.io"===t},u=()=>{const[e,a,t]=Array.from(I.exec(O)||[]);return"https"===a&&".csb.app"===t},L=()=>{const[e,a,t]=Array.from(_.exec(O)||[]);return"https"===a&&".adaptabletools.com"===t};class A{constructor(e,a,t){this.adaptable=e,this.adaptable=e;let s=null;if(a)try{s=r.decode(a)}catch(e){s=e}h()||u()||L()||this.handleLicenseValidation(s,this.getValidityType(s,t))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),o=s<new Date,i=e.trial;let n=null;return n=o?s>t?i?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:i?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:i?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let r=0;e instanceof Error||!(null==e?void 0:e.end)||(r=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/864e5),r=i.default(r,0,1/0));const l=(e,a=n.LicenseDocsLink,t=c,s=r)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":o.ConsoleLogByMessageType(l("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":o.ConsoleLogByMessageType(l("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":r<=10&&o.ConsoleLogByMessageType(l("This AdapTable license expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)"),"Info");break;case"COMMERCIAL_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)"),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license."),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t.PopupShowAlert({header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseShowWatermark(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseDisablePersistence())}destroy(){}}exports.LicenseService=A;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../Redux/ActionsReducers/SystemRedux"),t=require("../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../ObjectFactory")),o=require("../Helpers/LoggingHelper"),i=e.__importDefault(require("lodash/clamp")),n=require("../Constants/DocumentationLinkConstants"),r=require("../license/decode"),c="sales@adaptabletools.com",l=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const E=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,I=/(https):\/\/\S+(\.csb\.app)/g,_=/(https):\/\/\S+(\.adaptabletools\.com)/g,O="undefined"!=typeof window?window.location.origin:"",h=()=>{const[e,a,t]=Array.from(E.exec(O)||[]);return"https"===a&&"sandpack.codesandbox.io"===t},u=()=>{const[e,a,t]=Array.from(I.exec(O)||[]);return"https"===a&&".csb.app"===t},L=()=>{const[e,a,t]=Array.from(_.exec(O)||[]);return"https"===a&&".adaptabletools.com"===t};class A{constructor(e,a,t){this.adaptable=e,this.adaptable=e;let s=null;if(a)try{s=r.decode(a)}catch(e){s=e}h()||u()||L()||this.handleLicenseValidation(s,this.getValidityType(s,t))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),o=s<new Date,i=e.trial;let n=null;return n=o?s>t?i?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:i?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:i?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let r=0;e instanceof Error||!(null==e?void 0:e.end)||(r=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/864e5),r=i.default(r,0,1/0));const l=(e,a=n.LicenseDocsLink,t=c,s=r)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":o.ConsoleLogByMessageType(l("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":o.ConsoleLogByMessageType(l("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":r<=10&&o.ConsoleLogByMessageType(l("This AdapTable license expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)"),"Info");break;case"COMMERCIAL_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)"),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license."),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t.PopupShowAlert({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseShowWatermark(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseDisablePersistence())}destroy(){}}exports.LicenseService=A;
@@ -76,7 +76,7 @@ class ModuleService {
76
76
  }
77
77
  getModuleDocumentationPageByModule(adaptableModule) {
78
78
  let url = `${DocumentationLinkConstants_1.HOST_URL_DOCS}/`;
79
- let learnUrl = url + 'learn/';
79
+ let learnUrl = url + 'guide/';
80
80
  switch (adaptableModule) {
81
81
  case 'Alert':
82
82
  return learnUrl + 'handbook-alerting';
@@ -44,6 +44,7 @@ class ValidationService {
44
44
  const failedRules = this.getValidationRulesForDataChange(dataChangedInfo);
45
45
  if (failedRules.length > 0) {
46
46
  let alert = {
47
+ alertType: 'cellChanged',
47
48
  header: 'Alert',
48
49
  message: 'Perform Edit Alert Fired',
49
50
  alertDefinition: failedRules[0],
@@ -15,6 +15,7 @@ const License_1 = require("./License");
15
15
  const ExportCustomDestinationFormPopups_1 = require("./Export/ExportCustomDestinationFormPopups");
16
16
  const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
17
17
  const react_toastify_1 = require("react-toastify");
18
+ const WindowPopups_1 = require("./Components/Popups/WindowPopups/WindowPopups");
18
19
  class AdaptableView extends React.Component {
19
20
  render() {
20
21
  var _a, _b, _c, _d;
@@ -29,6 +30,7 @@ class AdaptableView extends React.Component {
29
30
  React.createElement(react_toastify_1.ToastContainer, { limit: this.props.AdaptableApi.internalApi.getAdaptableOptions().notificationsOptions
30
31
  .maxNotifications, closeButton: false, icon: false, theme: "colored" }),
31
32
  (watermark === null || watermark === void 0 ? void 0 : watermark.show) && React.createElement(License_1.LicenseWatermark, null, watermark === null || watermark === void 0 ? void 0 : watermark.text),
33
+ React.createElement(WindowPopups_1.WindowPopups, null),
32
34
  React.createElement(ProgressIndicator_1.ProgressIndicator, null)));
33
35
  }
34
36
  }
@@ -17,6 +17,7 @@ exports.renderAlertBehaviourSummary = (alert, api, allowWrap = false) => {
17
17
  AlertProperties.HighlightCell ? { label: 'Highlight Cell', id: 'highlightCell' } : null,
18
18
  AlertProperties.HighlightRow ? { label: 'Highlight Row', id: 'highlightRow' } : null,
19
19
  AlertProperties.JumpToCell ? { label: 'Jump To Cell', id: 'jumptocell' } : null,
20
+ AlertProperties.JumpToRow ? { label: 'Jump To Row', id: 'jumptorow' } : null,
20
21
  AlertProperties.ShowInDiv
21
22
  ? {
22
23
  label: (React.createElement(React.Fragment, null,
@@ -33,34 +34,40 @@ exports.renderAlertBehaviourSummary = (alert, api, allowWrap = false) => {
33
34
  return (React.createElement(ValueSelector_1.ValueOptionsTags, { allowWrap: allowWrap, options: values, value: values.map((v) => v.id), readOnly: true, toIdentifier: (x) => x.id, toLabel: (x) => React.createElement(React.Fragment, null, x.label) }));
34
35
  };
35
36
  exports.AlertBehaviourWizardSection = (props) => {
36
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
37
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
37
38
  const { AlertProperties = {} } = data;
39
+ const rowAddedAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(data);
40
+ const rowRemovedAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(data);
41
+ const cellChangedAlert = !rowAddedAlert && !rowRemovedAlert;
38
42
  const onChange = (AlertProperties) => {
39
43
  props.onChange(Object.assign(Object.assign({}, data), { AlertProperties: Object.assign(Object.assign({}, data.AlertProperties), AlertProperties) }));
40
44
  };
41
45
  return (React.createElement(Tabs_1.Tabs, null,
42
46
  React.createElement(Tabs_1.Tabs.Tab, null, "Behaviour"),
43
47
  React.createElement(Tabs_1.Tabs.Content, null,
44
- React.createElement(CheckBox_1.CheckBox, { style: { alignItems: 'flex-start' }, checked: AlertProperties.PreventEdit, onChange: (PreventEdit) => {
48
+ cellChangedAlert && (React.createElement(CheckBox_1.CheckBox, { style: { alignItems: 'flex-start' }, checked: AlertProperties.PreventEdit, onChange: (PreventEdit) => {
45
49
  onChange({
46
50
  PreventEdit,
47
51
  });
48
52
  } },
49
53
  "Prevent Cell Edit",
50
- React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(automatically undo data change which triggered Alert)")),
51
- React.createElement(CheckBox_1.CheckBox, { style: { alignItems: 'flex-start' }, checked: Boolean(AlertProperties.HighlightCell), onChange: (HighlightCell) => {
54
+ React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(automatically undo data change which triggered Alert)"))),
55
+ cellChangedAlert && (React.createElement(CheckBox_1.CheckBox, { style: { alignItems: 'flex-start' }, checked: Boolean(AlertProperties.HighlightCell), onChange: (HighlightCell) => {
52
56
  onChange({ HighlightCell });
53
57
  } },
54
58
  "Highlight Cell",
55
- React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(using the Alert message type)")),
56
- React.createElement(CheckBox_1.CheckBox, { style: { alignItems: 'flex-start' }, checked: Boolean(AlertProperties.HighlightRow), onChange: (HighlightRow) => {
59
+ React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(using the Alert message type)"))),
60
+ rowAddedAlert && (React.createElement(CheckBox_1.CheckBox, { style: { alignItems: 'flex-start' }, checked: Boolean(AlertProperties.HighlightRow), onChange: (HighlightRow) => {
57
61
  onChange({ HighlightRow });
58
62
  } },
59
63
  "Highlight Row",
60
- React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(using the Alert message type)")),
61
- React.createElement(CheckBox_1.CheckBox, { checked: AlertProperties.JumpToCell, onChange: (JumpToCell) => {
64
+ React.createElement(rebass_1.Text, { fontSize: 2, mt: 1 }, "(using the Alert message type)"))),
65
+ cellChangedAlert && (React.createElement(CheckBox_1.CheckBox, { checked: AlertProperties.JumpToCell, onChange: (JumpToCell) => {
62
66
  onChange({ JumpToCell });
63
- } }, "Jump To Cell"),
67
+ } }, "Jump To Cell")),
68
+ rowAddedAlert && (React.createElement(CheckBox_1.CheckBox, { checked: AlertProperties.JumpToRow, onChange: (JumpToRow) => {
69
+ onChange({ JumpToRow });
70
+ } }, "Jump To Row")),
64
71
  React.createElement(CheckBox_1.CheckBox, { checked: AlertProperties.ShowInDiv, onChange: (ShowInDiv) => {
65
72
  onChange({ ShowInDiv });
66
73
  } },
@@ -12,12 +12,22 @@ const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayou
12
12
  const CheckBox_1 = require("../../../components/CheckBox");
13
13
  const Helper_1 = require("../../../Utilities/Helpers/Helper");
14
14
  const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
15
- const BUTTON_ACTIONS = ['highlight-cell', 'jump-to-cell', 'undo', 'suspend'];
16
15
  exports.AlertButtonsEditor = (props) => {
16
+ const { api, adaptableAlert } = props;
17
17
  const onChange = (newButtons) => {
18
18
  props.onChange(newButtons);
19
19
  };
20
20
  const AlertButtons = Helper_1.cloneObject(props.AlertButtons || []) || [];
21
+ const rowAddedAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(adaptableAlert.alertDefinition);
22
+ const rowRemovedAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(adaptableAlert.alertDefinition);
23
+ const buttonActions = [];
24
+ if (rowAddedAlert) {
25
+ buttonActions.push('highlight-row', 'jump-to-row');
26
+ }
27
+ if (!rowAddedAlert && !rowRemovedAlert) {
28
+ buttonActions.push('highlight-cell', 'jump-to-cell', 'undo');
29
+ }
30
+ buttonActions.push('suspend');
21
31
  return (React.createElement(React.Fragment, null,
22
32
  React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between" },
23
33
  React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "Add buttons to Alert, and Actions to perform when button is clicked"),
@@ -42,7 +52,7 @@ exports.AlertButtonsEditor = (props) => {
42
52
  : button.Action
43
53
  : [];
44
54
  // filter out the adaptable standard actions
45
- const btnUserFunctions = btnActions.filter((action) => !BUTTON_ACTIONS.includes(action));
55
+ const btnUserFunctions = btnActions.filter((action) => !buttonActions.includes(action));
46
56
  const setVariant = (variant) => {
47
57
  onChange(AlertButtons.map((btn, i) => {
48
58
  if (i === index) {
@@ -115,7 +125,7 @@ exports.AlertButtonsEditor = (props) => {
115
125
  onChange(AlertButtons.filter((btn) => btn !== button));
116
126
  } }))),
117
127
  React.createElement(FormLayout_1.FormRow, { label: React.createElement(rebass_1.Text, { fontSize: 2 }, "Actions") },
118
- BUTTON_ACTIONS.map((actionName) => {
128
+ buttonActions.map((actionName) => {
119
129
  return (React.createElement(CheckBox_1.CheckBox, { key: actionName, marginRight: 3, onChange: (checked) => {
120
130
  let actions = btnActions;
121
131
  if (!checked) {
@@ -45,6 +45,7 @@ exports.AlertPreview = (_a) => {
45
45
  const alertForm = alertDefinition.AlertForm || {};
46
46
  const Buttons = (((_a = alertForm === null || alertForm === void 0 ? void 0 : alertForm.Buttons) === null || _a === void 0 ? void 0 : _a.length) ? alertForm.Buttons : DEFAULT_BUTTONS).map(mapButtons);
47
47
  const result = {
48
+ alertType: 'generic',
48
49
  header: alertDefinition.MessageType,
49
50
  message: api.alertApi.getAlertDescription(alertDefinition),
50
51
  alertDefinition: Object.assign(Object.assign({}, alertDefinition), { AlertForm: Object.assign(Object.assign({}, alertForm), { Buttons }) }),
@@ -60,6 +61,7 @@ exports.AlertDisplayWizardSection = (props) => {
60
61
  const messageType = data.MessageType;
61
62
  const messageText = api.alertApi.getAlertDescription(data);
62
63
  const adaptableAlert = {
64
+ alertType: 'generic',
63
65
  header: data.MessageType,
64
66
  message: '',
65
67
  alertDefinition: data,
@@ -18,6 +18,7 @@ const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
18
18
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
19
19
  const react_redux_1 = require("react-redux");
20
20
  const AlertRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/AlertRedux"));
21
+ const AdaptableContext_1 = require("../../AdaptableContext");
21
22
  exports.AlertWizard = (props) => {
22
23
  const [alertDefinition, setAlertDefinition] = react_1.useState(() => {
23
24
  var _a;
@@ -33,6 +34,87 @@ exports.AlertWizard = (props) => {
33
34
  alertDefinition.MessageType = (_a = alertDefinition.MessageType) !== null && _a !== void 0 ? _a : GeneralConstants_1.ALERT_DEFAULT_MESSAGE_TYPE;
34
35
  return alertDefinition;
35
36
  });
37
+ const { api } = AdaptableContext_1.useAdaptable();
38
+ const updateAlertDefinition = (alertDefinition) => {
39
+ var _a;
40
+ // we need to adjust the alert actions&behaviours based on the predicate type(row/cell based)
41
+ const isAddedRowChangeAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
42
+ const isRemovedRowChangeAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
43
+ const isCellChangeAlert = !isAddedRowChangeAlert && !isRemovedRowChangeAlert;
44
+ // map FormButton Actions
45
+ const mapValidButtonActions = (alertAction) => {
46
+ if (isCellChangeAlert) {
47
+ if (alertAction === 'highlight-row') {
48
+ return 'highlight-cell';
49
+ }
50
+ if (alertAction === 'jump-to-row') {
51
+ return 'jump-to-cell';
52
+ }
53
+ return alertAction;
54
+ }
55
+ if (isAddedRowChangeAlert) {
56
+ if (alertAction === 'highlight-cell') {
57
+ return 'highlight-row';
58
+ }
59
+ if (alertAction === 'jump-to-cell') {
60
+ return 'jump-to-row';
61
+ }
62
+ if (alertAction === 'jump-to-column' || alertAction === 'undo') {
63
+ return null;
64
+ }
65
+ return alertAction;
66
+ }
67
+ if (isRemovedRowChangeAlert) {
68
+ if (alertAction === 'highlight-cell' ||
69
+ alertAction === 'jump-to-cell' ||
70
+ alertAction === 'highlight-row' ||
71
+ alertAction === 'jump-to-row' ||
72
+ alertAction === 'jump-to-column' ||
73
+ alertAction === 'undo') {
74
+ return null;
75
+ }
76
+ return alertAction;
77
+ }
78
+ };
79
+ if (alertDefinition.AlertForm && typeof alertDefinition.AlertForm !== 'string') {
80
+ const alertButtons = (_a = alertDefinition.AlertForm) === null || _a === void 0 ? void 0 : _a.Buttons;
81
+ alertButtons.forEach((alertButton) => {
82
+ const alertAction = alertButton.Action;
83
+ if (Array.isArray(alertAction)) {
84
+ alertButton.Action = alertAction
85
+ .map(mapValidButtonActions)
86
+ .filter(Boolean);
87
+ }
88
+ else {
89
+ alertButton.Action = mapValidButtonActions(alertAction);
90
+ }
91
+ });
92
+ // map Alert Properties(Behaviour)
93
+ if (isCellChangeAlert) {
94
+ alertDefinition.AlertProperties.HighlightCell =
95
+ alertDefinition.AlertProperties.HighlightRow;
96
+ delete alertDefinition.AlertProperties.HighlightRow;
97
+ alertDefinition.AlertProperties.JumpToCell = alertDefinition.AlertProperties.JumpToRow;
98
+ delete alertDefinition.AlertProperties.JumpToRow;
99
+ }
100
+ if (isAddedRowChangeAlert) {
101
+ alertDefinition.AlertProperties.HighlightRow =
102
+ alertDefinition.AlertProperties.HighlightCell;
103
+ delete alertDefinition.AlertProperties.HighlightCell;
104
+ alertDefinition.AlertProperties.JumpToRow = alertDefinition.AlertProperties.JumpToCell;
105
+ delete alertDefinition.AlertProperties.JumpToCell;
106
+ delete alertDefinition.AlertProperties.PreventEdit;
107
+ }
108
+ if (isRemovedRowChangeAlert) {
109
+ delete alertDefinition.AlertProperties.PreventEdit;
110
+ delete alertDefinition.AlertProperties.HighlightRow;
111
+ delete alertDefinition.AlertProperties.JumpToRow;
112
+ delete alertDefinition.AlertProperties.HighlightCell;
113
+ delete alertDefinition.AlertProperties.JumpToCell;
114
+ }
115
+ }
116
+ setAlertDefinition(alertDefinition);
117
+ };
36
118
  const dispatch = react_redux_1.useDispatch();
37
119
  const handleFinish = () => {
38
120
  if (props.data) {
@@ -60,7 +142,7 @@ exports.AlertWizard = (props) => {
60
142
  React.createElement("b", null, "when"),
61
143
  " the Alert should trigger")),
62
144
  isValid: isValidAlertRules_1.isValidAlertRules,
63
- render: () => React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { onChange: setAlertDefinition, module: "alert" }),
145
+ render: () => React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { onChange: updateAlertDefinition, module: "alert" }),
64
146
  renderSummary: AlertRulesWizardSection_1.renderAlertRulesSummary,
65
147
  title: 'Rule',
66
148
  },
@@ -59,7 +59,7 @@ class CellSummaryViewPanelComponent extends React.Component {
59
59
  if (operationValue == undefined) {
60
60
  return;
61
61
  }
62
- return this.props.viewType === 'ToolPanel' ? (React.createElement(rebass_1.Flex, { className: `ab-${elementType}__CellSummary__value`, style: { borderRadius: 'var(--ab__border-radius)' }, marginRight: 2, padding: 2, color: 'var( --ab-color-text-on-info)', backgroundColor: 'var(--ab-color-info)', fontSize: 'var( --ab-font-size-2)' }, operationValue)) : (React.createElement(rebass_1.Flex, { flex: 1, marginRight: 2, justifyContent: "center", className: `ab-${elementType}__CellSummary__value`, color: 'var(--ab-color-text-on-primary)' }, operationValue));
62
+ return this.props.viewType === 'ToolPanel' ? (React.createElement(rebass_1.Flex, { className: `ab-${elementType}__CellSummary__value`, style: { borderRadius: 'var(--ab__border-radius)' }, marginRight: 2, padding: 2, color: 'var( --ab-color-text-on-info)', backgroundColor: 'var(--ab-color-info)', fontSize: 'var( --ab-font-size-2)' }, operationValue)) : (React.createElement(rebass_1.Flex, { flex: 1, marginRight: 2, marginLeft: 1, justifyContent: "center", className: `ab-${elementType}__CellSummary__value`, color: 'var(--ab-color-text-on-primary)' }, operationValue));
63
63
  };
64
64
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
65
65
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: shouldDisable ? GeneralConstants.READ_ONLY_STYLE : `ab-${elementType}__CellSummary__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
@@ -177,8 +177,8 @@ class FilterFormComponent extends React.Component {
177
177
  this.changeColumnPredicateInput(newCheckedValue, 0);
178
178
  } })));
179
179
  }
180
- return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => (React.createElement(rebass_1.Flex, { flexDirection: "row" },
181
- React.createElement(AdaptableInput_1.default, { key: index, type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), style: {
180
+ return (_a = predicateDef.inputs) === null || _a === void 0 ? void 0 : _a.map((predicateInput, index) => (React.createElement(rebass_1.Flex, { key: index, flexDirection: "row" },
181
+ React.createElement(AdaptableInput_1.default, { type: predicateInput.type, autoFocus: index === 0, value: filter.Predicate.Inputs[index], onChange: (e) => this.changeColumnPredicateInput(e.target.value, index), style: {
182
182
  marginBottom: 5,
183
183
  flex: 1,
184
184
  fontSize: 'var( --ab-font-size-2)',
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ export interface PanelFooterProps {
3
+ onCancel: () => void;
4
+ onAccept: () => void;
5
+ cancelDisabled?: boolean;
6
+ acceptDisabled?: boolean;
7
+ acceptText?: React.ReactElement;
8
+ cancelText?: React.ReactElement;
9
+ }
10
+ export declare const PanelFooter: React.FunctionComponent<PanelFooterProps>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PanelFooter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
8
+ exports.PanelFooter = (props) => {
9
+ var _a, _b;
10
+ return (React.createElement(rebass_1.Flex, { className: "ab-Panel__Footer", flexDirection: "row", padding: 1, backgroundColor: "primary", alignItems: "center" },
11
+ React.createElement(SimpleButton_1.default, { margin: 1, variant: "text", "data-name": "action-cancel", onClick: props.onCancel, disabled: props.cancelDisabled }, (_a = props.cancelText) !== null && _a !== void 0 ? _a : 'CANCEL'),
12
+ React.createElement(rebass_1.Box, { flex: 1 }),
13
+ React.createElement(SimpleButton_1.default, { variant: "raised", tone: "accent", "data-name": "action-finish", margin: 1, onClick: props.onAccept, disabled: props.acceptDisabled }, (_b = props.cancelText) !== null && _b !== void 0 ? _b : 'Finish')));
14
+ };
@@ -24,7 +24,12 @@ exports.AdaptablePopup = (props) => {
24
24
  const isWindowModal = settingsPanelOptions.popupType === 'window';
25
25
  const modalContainer = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.containerOptions) === null || _b === void 0 ? void 0 : _b.modalContainer;
26
26
  let friendlyName = null;
27
- let isActionModule = false;
27
+ /**
28
+ * This means that it is not rendered in the context of Settings Panel
29
+ * - no topbar
30
+ * - no navigation
31
+ */
32
+ let isStandalone = false;
28
33
  let moduleViewContent = null;
29
34
  let activeItem = null;
30
35
  let accessLevel = 'Full';
@@ -50,15 +55,15 @@ exports.AdaptablePopup = (props) => {
50
55
  .getEntitlementService()
51
56
  .getEntitlementAccessLevelForModule(componentModule);
52
57
  friendlyName = moduleInfo.FriendlyName;
53
- isActionModule =
58
+ isStandalone =
54
59
  moduleInfo &&
55
- (DefaultSettingsPanel_1.ACTION_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
60
+ (DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
56
61
  (props.componentName && props.componentName !== (moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.Popup)));
57
62
  activeItem = moduleInfo.ModuleName;
58
63
  moduleViewContent = (React.createElement(AdaptablePopupBody_1.AdaptablePopupBody, { api: props.api, module: module, componentName: props.componentName, moduleParams: props.moduleParams, onClearParams: props.onClearParams, onHide: props.onHide }));
59
64
  }
60
65
  const baseClassName = 'ab-Adaptable-Popup';
61
- const className = join_1.default(baseClassName, `${baseClassName}--${isWindowModal ? 'window' : 'modal'}`, isActionModule ? `${baseClassName}--action-popup` : `${baseClassName}--settings-popup`);
66
+ const className = join_1.default(baseClassName, `${baseClassName}--${isWindowModal ? 'window' : 'modal'}`, isStandalone ? `${baseClassName}--action-popup` : `${baseClassName}--settings-popup`);
62
67
  return (React.createElement(PopupContext_1.default.Provider, { value: {
63
68
  hidePopup: () => {
64
69
  if (props.onHide) {
@@ -66,9 +71,9 @@ exports.AdaptablePopup = (props) => {
66
71
  }
67
72
  },
68
73
  } },
69
- React.createElement(AdaptablePopupDialog_1.AdaptablePopupDialog, { baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isActionModule, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer },
70
- !isActionModule && React.createElement(TopBar_1.default, { icon: settingsPanelOptions.icon }, settingsPanelTitle),
74
+ React.createElement(AdaptablePopupDialog_1.AdaptablePopupDialog, { baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isStandalone, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer },
75
+ !isStandalone && React.createElement(TopBar_1.default, { icon: settingsPanelOptions.icon }, settingsPanelTitle),
71
76
  React.createElement(rebass_1.Flex, { "data-name": props.componentName, flexDirection: "row", flex: "1 1 0", style: { minHeight: 0 }, className: accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '' },
72
- !isActionModule && (React.createElement(Navigation_1.Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })),
77
+ !isStandalone && (React.createElement(Navigation_1.Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })),
73
78
  React.createElement(rebass_1.Flex, { flex: 1, className: "ab-Adaptable-Popup__Body" }, moduleViewContent)))));
74
79
  };
@@ -8,7 +8,7 @@ const react_redux_1 = require("react-redux");
8
8
  const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
9
9
  const SystemRedux_1 = require("../../../../Redux/ActionsReducers/SystemRedux");
10
10
  const AdaptableContext_1 = require("../../../AdaptableContext");
11
- const Utilities_1 = require("./Utilities");
11
+ const Utilities_1 = require("../Utilities");
12
12
  const WindowDialog = (props) => {
13
13
  var _a, _b;
14
14
  const { onChange, style, baseClassName, className, isActionModule, settingsPanelOptionsKey, onHide } = props, dialogProps = tslib_1.__rest(props, ["onChange", "style", "baseClassName", "className", "isActionModule", "settingsPanelOptionsKey", "onHide"]);
@@ -20,7 +20,9 @@ exports.useMenuItems = () => {
20
20
  navigationItems.push(...settingsPanelOptions.customSettingsPanels.map((panel) => panel.name));
21
21
  }
22
22
  }
23
- const visibleItems = allMenuItems.filter((item) => item.module !== 'General' && !DefaultSettingsPanel_1.ACTION_POPUPS.includes(item.module) && item.isVisible);
23
+ const visibleItems = allMenuItems.filter((item) => item.module !== 'General' &&
24
+ !DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(item.module) &&
25
+ item.isVisible);
24
26
  return navigationItems
25
27
  .map((moduleName) => {
26
28
  var _a, _b;
@@ -13,3 +13,7 @@ export declare const getSettingsPanelSize: () => {
13
13
  height: number;
14
14
  width: number;
15
15
  };
16
+ export declare const getWindowPopupSize: () => {
17
+ height: number;
18
+ width: number;
19
+ };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSettingsPanelSize = exports.getActionPanelSize = exports.getMiddlePosition = void 0;
4
- const Helper_1 = require("../../../../Utilities/Helpers/Helper");
3
+ exports.getWindowPopupSize = exports.getSettingsPanelSize = exports.getActionPanelSize = exports.getMiddlePosition = void 0;
4
+ const Helper_1 = require("../../../Utilities/Helpers/Helper");
5
5
  exports.getMiddlePosition = (size) => {
6
6
  const height = window.innerHeight;
7
7
  const width = window.innerWidth;
@@ -26,3 +26,6 @@ exports.getSettingsPanelSize = () => {
26
26
  width: Helper_1.clamp(width * 0.9, 0, 800),
27
27
  };
28
28
  };
29
+ exports.getWindowPopupSize = () => {
30
+ return exports.getSettingsPanelSize();
31
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface WindowPopupChildProps {
3
+ onDismiss: () => void;
4
+ popupProps: any;
5
+ }
6
+ export declare const WindowPopups: React.FunctionComponent;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WindowPopups = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const react_redux_1 = require("react-redux");
7
+ const Dialog_1 = tslib_1.__importDefault(require("../../../../components/Dialog"));
8
+ const PopupRedux_1 = require("../../../../Redux/ActionsReducers/PopupRedux");
9
+ const Utilities_1 = require("../Utilities");
10
+ const windowFactory_1 = require("./windowFactory");
11
+ const NoopComponent = () => {
12
+ return React.createElement(React.Fragment, null);
13
+ };
14
+ exports.WindowPopups = () => {
15
+ const [windowModalSettings, setWindowModalSettings] = React.useState({});
16
+ const dispatch = react_redux_1.useDispatch();
17
+ const windowItems = react_redux_1.useSelector((state) => state.Popup.WindowPopup.PopupList);
18
+ return (React.createElement(React.Fragment, null, windowItems === null || windowItems === void 0 ? void 0 : windowItems.map((windowItem, index) => {
19
+ var _a, _b, _c, _d, _e;
20
+ const Component = (_a = windowFactory_1.windowFactory[windowItem.Id]) !== null && _a !== void 0 ? _a : NoopComponent;
21
+ const _f = windowItem.PopupProps, { windowModalProps } = _f, restPopupProps = tslib_1.__rest(_f, ["windowModalProps"]);
22
+ const handleDismiss = () => {
23
+ dispatch(PopupRedux_1.PopupWindowHide(windowItem.Id));
24
+ };
25
+ const size = (_c = (_b = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _b === void 0 ? void 0 : _b.size) !== null && _c !== void 0 ? _c : Utilities_1.getWindowPopupSize();
26
+ const position = (_e = (_d = windowModalSettings === null || windowModalSettings === void 0 ? void 0 : windowModalSettings[windowItem.Id]) === null || _d === void 0 ? void 0 : _d.position) !== null && _e !== void 0 ? _e : Utilities_1.getMiddlePosition(size);
27
+ return (React.createElement(Dialog_1.default, { "data-name": windowItem.Id, style: { height: '100%' }, className: "ab-Window-Modal", key: windowItem.Id, windowModal: true, windowModalProps: Object.assign(Object.assign({}, windowModalProps), { onChange: (settings) => {
28
+ setWindowModalSettings((settingsMap) => (Object.assign(Object.assign({}, settingsMap), { [windowItem.Id]: settings })));
29
+ }, handleSelector: '.ab-Window-Modal .ab-Panel__header', size: size, position: position }), fixed: false, padding: 0, onDismiss: handleDismiss, isOpen: true, showCloseButton: true },
30
+ React.createElement(Component, { onDismiss: handleDismiss, popupProps: restPopupProps })));
31
+ })));
32
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { WindowPopupChildProps } from './WindowPopups';
3
+ export declare const WINDOW_LAYOUT_EDITOR = "WINDOW_LAYOUT_EDITOR";
4
+ export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.windowFactory = exports.WINDOW_LAYOUT_EDITOR = void 0;
4
+ const LayoutEditorStandalonePopup_1 = require("../../../Layout/LayoutEditorStandalonePopup");
5
+ exports.WINDOW_LAYOUT_EDITOR = 'WINDOW_LAYOUT_EDITOR';
6
+ exports.windowFactory = {
7
+ [exports.WINDOW_LAYOUT_EDITOR]: LayoutEditorStandalonePopup_1.LayoutEditorStandalonePopup,
8
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { WindowPopupChildProps } from '../Components/Popups/WindowPopups/WindowPopups';
3
+ export declare const LayoutEditorStandalonePopup: React.FunctionComponent<WindowPopupChildProps>;