@adaptabletools/adaptable 10.0.4-canary.1 → 10.0.4-canary.2

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 (179) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +1 -1
  3. package/base.css +16 -6
  4. package/bundle.cjs.js +350 -0
  5. package/index.css +20 -6
  6. package/package.json +1 -5
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
  10. package/src/AdaptableInterfaces/IAdaptable.d.ts +14 -12
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
  12. package/src/AdaptableOptions/ContainerOptions.d.ts +4 -5
  13. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
  14. package/src/AdaptableOptions/DateInputOptions.d.ts +5 -1
  15. package/src/AdaptableOptions/EditOptions.d.ts +2 -3
  16. package/src/AdaptableOptions/FilterOptions.d.ts +8 -8
  17. package/src/AdaptableOptions/GeneralOptions.d.ts +3 -2
  18. package/src/AdaptableOptions/MenuOptions.d.ts +11 -11
  19. package/src/AdaptableOptions/NotificationsOptions.d.ts +8 -0
  20. package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
  21. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +3 -3
  22. package/src/Api/AdaptableApi.d.ts +12 -12
  23. package/src/Api/ColumnApi.d.ts +10 -5
  24. package/src/Api/EventApi.d.ts +1 -1
  25. package/src/Api/Events/AdaptableReady.d.ts +3 -2
  26. package/src/Api/GridApi.d.ts +10 -10
  27. package/src/Api/Implementation/ColumnApiImpl.d.ts +4 -3
  28. package/src/Api/Implementation/ColumnApiImpl.js +11 -9
  29. package/src/Api/Implementation/ConfigApiImpl.js +0 -24
  30. package/src/Api/Implementation/GridApiImpl.d.ts +2 -2
  31. package/src/Api/Implementation/GridApiImpl.js +3 -4
  32. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
  33. package/src/Api/Implementation/InternalApiImpl.js +2 -2
  34. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  35. package/src/Api/Implementation/LayoutApiImpl.js +15 -0
  36. package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -2
  37. package/src/Api/Implementation/PluginsApiImpl.js +1 -1
  38. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  39. package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
  40. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +3 -3
  41. package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -4
  42. package/src/Api/InternalApi.d.ts +1 -1
  43. package/src/Api/LayoutApi.d.ts +7 -0
  44. package/src/Api/PluginsApi.d.ts +1 -7
  45. package/src/Api/TeamSharingApi.d.ts +1 -1
  46. package/src/Api/ThemeApi.d.ts +2 -2
  47. package/src/Api/UserInterfaceApi.d.ts +3 -3
  48. package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
  49. package/src/PredefinedConfig/AlertState.d.ts +1 -1
  50. package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
  51. package/src/PredefinedConfig/CalculatedColumnState.d.ts +1 -1
  52. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +3 -3
  53. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
  54. package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
  55. package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
  56. package/src/PredefinedConfig/Common/Menu.d.ts +40 -17
  57. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
  58. package/src/PredefinedConfig/Common/Types.d.ts +5 -5
  59. package/src/PredefinedConfig/Common/Types.js +9 -7
  60. package/src/PredefinedConfig/ConditionalStyleState.d.ts +1 -1
  61. package/src/PredefinedConfig/CustomSortState.d.ts +1 -1
  62. package/src/PredefinedConfig/DataSourceState.d.ts +1 -1
  63. package/src/PredefinedConfig/ExportState.d.ts +3 -3
  64. package/src/PredefinedConfig/FilterState.d.ts +2 -2
  65. package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
  66. package/src/PredefinedConfig/FreeTextColumnState.d.ts +1 -1
  67. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  68. package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -40
  69. package/src/PredefinedConfig/QuickSearchState.d.ts +3 -3
  70. package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
  71. package/src/PredefinedConfig/ThemeState.d.ts +5 -1
  72. package/src/Redux/ActionsReducers/DashboardRedux.js +2 -1
  73. package/src/Redux/ActionsReducers/GridRedux.d.ts +3 -2
  74. package/src/Redux/ActionsReducers/GridRedux.js +2 -2
  75. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +12 -2
  76. package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
  77. package/src/Redux/DeadRedux.d.ts +4 -8
  78. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -1
  79. package/src/Redux/Store/AdaptableStore.d.ts +3 -3
  80. package/src/Redux/Store/AdaptableStore.js +18 -13
  81. package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
  82. package/src/Strategy/AlertModule.d.ts +2 -2
  83. package/src/Strategy/AlertModule.js +1 -94
  84. package/src/Strategy/BulkUpdateModule.d.ts +2 -2
  85. package/src/Strategy/BulkUpdateModule.js +4 -4
  86. package/src/Strategy/CellSummaryModule.d.ts +2 -2
  87. package/src/Strategy/DashboardModule.d.ts +2 -2
  88. package/src/Strategy/DataChangeHistoryModule.js +2 -2
  89. package/src/Strategy/ExportModule.d.ts +2 -2
  90. package/src/Strategy/FilterModule.d.ts +2 -2
  91. package/src/Strategy/FormatColumnModule.js +1 -1
  92. package/src/Strategy/GridInfoModule.d.ts +2 -2
  93. package/src/Strategy/Interface/IModule.d.ts +2 -2
  94. package/src/Strategy/LayoutModule.d.ts +2 -2
  95. package/src/Strategy/LayoutModule.js +21 -8
  96. package/src/Strategy/SmartEditModule.d.ts +2 -2
  97. package/src/Strategy/SmartEditModule.js +3 -4
  98. package/src/Strategy/SystemStatusModule.d.ts +2 -2
  99. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  100. package/src/Utilities/Constants/GeneralConstants.js +2 -1
  101. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  102. package/src/Utilities/Constants/ModuleConstants.js +7 -7
  103. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +8 -7
  104. package/src/Utilities/Helpers/PreviewHelper.js +2 -2
  105. package/src/Utilities/Interface/Preview.d.ts +2 -1
  106. package/src/Utilities/Services/LicenseService.js +16 -2
  107. package/src/Utilities/Services/ValidationService.js +1 -1
  108. package/src/View/AdaptableViewFactory.d.ts +2 -1
  109. package/src/View/AdaptableViewFactory.js +2 -0
  110. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +7 -7
  111. package/src/View/CellSummary/CellSummaryViewPanel.js +2 -2
  112. package/src/View/Components/FilterForm/FilterForm.js +5 -7
  113. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +1 -1
  114. package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
  115. package/src/View/Components/FilterForm/QuickFilterForm.js +3 -5
  116. package/src/View/Components/Panels/FilterFormPanel.d.ts +1 -1
  117. package/src/View/Components/Panels/PanelWithImage.d.ts +423 -1
  118. package/src/View/Components/Popups/AdaptablePopupAlert.js +22 -9
  119. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -4
  120. package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
  121. package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
  122. package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
  123. package/src/View/CustomSort/CustomSortPopup.js +1 -1
  124. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
  125. package/src/View/Dashboard/Dashboard.js +3 -3
  126. package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -1
  127. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +6 -5
  128. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
  129. package/src/View/Export/ExportViewPanel.js +6 -6
  130. package/src/View/GridInfo/GridOptionsComponent.js +1 -1
  131. package/src/View/Layout/LayoutViewPanel.js +2 -2
  132. package/src/View/Query/QueryViewPanel.js +1 -1
  133. package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
  134. package/src/View/Schedule/SchedulePopup.js +3 -3
  135. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
  136. package/src/View/SmartEdit/SmartEditPopup.js +1 -1
  137. package/src/View/StateManagement/StateManagementPopup.d.ts +2 -12
  138. package/src/View/StateManagement/StateManagementPopup.js +21 -114
  139. package/src/View/StateManagement/StateManagementViewPanel.d.ts +5 -0
  140. package/src/View/StateManagement/StateManagementViewPanel.js +22 -0
  141. package/src/View/StateManagement/components/ClearButton.d.ts +6 -0
  142. package/src/View/StateManagement/components/ClearButton.js +9 -0
  143. package/src/View/StateManagement/components/ExportDropdown.d.ts +8 -0
  144. package/src/View/StateManagement/components/ExportDropdown.js +43 -0
  145. package/src/View/StateManagement/components/LoadButton.d.ts +7 -0
  146. package/src/View/StateManagement/components/LoadButton.js +38 -0
  147. package/src/View/StateManagement/handleExportState.d.ts +1 -0
  148. package/src/View/StateManagement/handleExportState.js +22 -0
  149. package/src/View/Theme/ThemeViewPanel.js +1 -1
  150. package/src/agGrid/Adaptable.d.ts +9 -8
  151. package/src/agGrid/Adaptable.js +99 -78
  152. package/src/agGrid/agGridHelper.d.ts +4 -4
  153. package/src/agGrid/agGridHelper.js +15 -16
  154. package/src/agGrid/agGridMenuHelper.d.ts +15 -13
  155. package/src/agGrid/agGridMenuHelper.js +53 -45
  156. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +1 -1
  157. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -6
  158. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -2
  159. package/src/agGrid/editors/AdaptableDateEditor/index.js +16 -6
  160. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
  161. package/src/agGrid/editors/AdaptableNumberEditor/index.js +7 -2
  162. package/src/components/Datepicker/DatepickerContext.d.ts +2 -2
  163. package/src/components/Datepicker/index.js +9 -5
  164. package/src/components/Modal/index.d.ts +1 -1
  165. package/src/components/OverlayTrigger/index.js +3 -3
  166. package/src/components/OverlayTrigger/useAgGridClassName.d.ts +2 -0
  167. package/src/components/OverlayTrigger/{useVendorClassName.js → useAgGridClassName.js} +3 -3
  168. package/src/components/ProgressIndicator/ProgressIndicator.js +1 -1
  169. package/src/components/icons/index.js +2 -0
  170. package/src/components/icons/upload.d.ts +3 -0
  171. package/src/components/icons/upload.js +8 -0
  172. package/src/metamodel/adaptable.metamodel.d.ts +52 -37
  173. package/src/metamodel/adaptable.metamodel.js +261 -265
  174. package/src/types.d.ts +1 -1
  175. package/version.d.ts +1 -1
  176. package/version.js +1 -1
  177. package/src/PredefinedConfig/DeprecatedState.d.ts +0 -82
  178. package/src/PredefinedConfig/DeprecatedState.js +0 -5
  179. package/src/components/OverlayTrigger/useVendorClassName.d.ts +0 -2
@@ -11,13 +11,13 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exten
11
11
  const Helper_1 = require("../../Utilities/Helpers/Helper");
12
12
  class CustomSortEntityRow extends React.Component {
13
13
  render() {
14
+ var _a;
14
15
  let customSort = this.props.adaptableObject;
15
16
  const columnSortComparer = this.props.api.internalApi.getCustomSortComparer(this.props.column);
16
17
  let colItems = Helper_1.cloneObject(this.props.colItems);
17
- colItems[0].Content = React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.column.friendlyName });
18
+ colItems[0].Content = this.props.column ? (React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.column.friendlyName })) : this.props.scope ? (React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.api.scopeApi.getScopeToString(this.props.scope) })) : (React.createElement("p", null, "Nothing"));
18
19
  colItems[1].Content = (React.createElement(EntityRowItem_1.EntityRowItem, { Content: customSort ? this.getCustomSortedValues(customSort) : 'Custom Sort Function' }));
19
- colItems[2].Content = (React.createElement(EntityListActionButtons_1.EntityListActionButtons, { showSuspend: true, suspendableObject: customSort, confirmDeleteAction: this.props.onDeleteConfirm, editClick: () => this.props.onEdit(customSort), shareClick: (config) => this.props.onShare(config), showShare: this.props.teamSharingActivated, overrideDisableEdit: columnSortComparer != undefined ||
20
- this.props.column.friendlyName.includes(GeneralConstants.MISSING_COLUMN), entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend }));
20
+ colItems[2].Content = (React.createElement(EntityListActionButtons_1.EntityListActionButtons, { showSuspend: true, suspendableObject: customSort, confirmDeleteAction: this.props.onDeleteConfirm, editClick: () => this.props.onEdit(customSort), shareClick: (config) => this.props.onShare(config), showShare: this.props.teamSharingActivated, overrideDisableEdit: columnSortComparer != undefined || ((_a = this.props.column) === null || _a === void 0 ? void 0 : _a.friendlyName.includes(GeneralConstants.MISSING_COLUMN)), entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend }));
21
21
  return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { isSuspended: customSort.IsSuspended, colItems: colItems });
22
22
  }
23
23
  getCustomSortedValues(customSort) {
@@ -82,7 +82,7 @@ class CustomSortPopupComponent extends React.Component {
82
82
  const columnSortComparers = (_a = this.props.api.internalApi
83
83
  .getAdaptableOptions()
84
84
  .generalOptions.customSortComparers) === null || _a === void 0 ? void 0 : _a.map((comparer, index) => {
85
- return (React.createElement(CustomSortEntityRow_1.CustomSortEntityRow, { colItems: colItems, api: this.props.api, adaptableObject: comparer, moduleInfo: this.props.moduleInfo, key: comparer.columnId + index, teamSharingActivated: this.props.teamSharingActivated, onShare: null, onEdit: null, onDeleteConfirm: null, column: this.props.api.columnApi.getColumnFromId(comparer.columnId), accessLevel: 'ReadOnly' }));
85
+ return (React.createElement(CustomSortEntityRow_1.CustomSortEntityRow, { colItems: colItems, api: this.props.api, adaptableObject: comparer, moduleInfo: this.props.moduleInfo, key: 'columnValuesComparer' + index, teamSharingActivated: this.props.teamSharingActivated, onShare: null, onEdit: null, onDeleteConfirm: null, scope: comparer.scope, accessLevel: 'ReadOnly' }));
86
86
  });
87
87
  let newButton = (React.createElement(ButtonNew_1.ButtonNew, { onClick: () => this.onNew(), tooltip: "Create Custom Sort", accessLevel: this.props.accessLevel, style: {
88
88
  color: 'var(--ab-color-text-on-add)',
@@ -30,7 +30,7 @@ exports.CustomSortColumnWizardSection = (props) => {
30
30
  const columnSortComparers = ((_b = (_a = api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.generalOptions) === null || _b === void 0 ? void 0 : _b.customSortComparers) || [];
31
31
  const usedColumnIds = [
32
32
  ...customSorts.map((customSort) => customSort.ColumnId),
33
- ...columnSortComparers.map((comparer) => comparer.columnId),
33
+ ...columnSortComparers.map((comparer) => api.scopeApi.getColumnIdsInScope(comparer.scope)),
34
34
  ];
35
35
  // filter out used colum ids, but include the current one
36
36
  return sortableColumns.filter((column) => {
@@ -84,7 +84,8 @@ const DashboardComponent = (props) => {
84
84
  };
85
85
  const renderDashboardButtons = () => {
86
86
  var _a;
87
- let dashboardButtonsArray = (_a = props.api.dashboardApi.getCustomDashboardButtons()) === null || _a === void 0 ? void 0 : _a.filter((c) => c);
87
+ let dashboardButtonsArray = (_a = props.api.dashboardApi
88
+ .getCustomDashboardButtons()) === null || _a === void 0 ? void 0 : _a.filter((c) => c);
88
89
  let customDashboardButtons = null;
89
90
  if (dashboardButtonsArray) {
90
91
  customDashboardButtons = dashboardButtonsArray.map((button) => {
@@ -140,8 +141,7 @@ const DashboardComponent = (props) => {
140
141
  label: menuItem.label,
141
142
  };
142
143
  });
143
- let dashboardOptions = props.api.internalApi.getAdaptableOptions()
144
- .dashboardOptions;
144
+ let dashboardOptions = props.api.internalApi.getAdaptableOptions().dashboardOptions;
145
145
  if (dashboardAccessLevel == 'Full' || dashboardAccessLevel == 'ReadOnly') {
146
146
  menuItems.unshift(dashboardAccessLevel == 'Full'
147
147
  ? {
@@ -2,7 +2,7 @@
2
2
  import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
3
3
  export interface DataChangeHistoryGridProps {
4
4
  adaptableContainerId: string;
5
- vendorContainerId: string;
5
+ agGridContainerId: string;
6
6
  changeHistoryLog: Record<string, DataChangedInfo>;
7
7
  onUndoChange: (changeKey: string) => void;
8
8
  }
@@ -9,7 +9,7 @@ const react_1 = require("react");
9
9
  const usePrevious_1 = tslib_1.__importDefault(require("../../components/utils/usePrevious"));
10
10
  const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
11
11
  exports.DataChangeHistoryGrid = (props) => {
12
- const { changeHistoryLog, adaptableContainerId, vendorContainerId, onUndoChange } = props;
12
+ const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange } = props;
13
13
  const mainAdaptableInstance = AdaptableContext_1.useAdaptable();
14
14
  const [_adaptableApi, setAdaptableApi] = react_1.useState(null);
15
15
  const adaptableApiRef = react_1.useRef(null);
@@ -22,7 +22,7 @@ exports.DataChangeHistoryGrid = (props) => {
22
22
  react_1.useEffect(() => {
23
23
  const initializeAdaptableGrid = async () => {
24
24
  const gridOptions = buildGridOptions(mainAdaptableInstance, changeHistoryLog);
25
- const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, vendorContainerId, undoChangeEnabled, onUndoChange);
25
+ const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange);
26
26
  // to avoid direct dependency to Adaptable.ts and thus creating a circular dependency;
27
27
  const adaptableInitFn = Object.getPrototypeOf(mainAdaptableInstance).constructor.init;
28
28
  const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions);
@@ -71,7 +71,7 @@ exports.DataChangeHistoryGrid = (props) => {
71
71
  }, [changeHistoryLog]);
72
72
  return React.createElement(React.Fragment, null);
73
73
  };
74
- const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, vendorContainerId, undoChangeEnabled, onUndoChange) => {
74
+ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange) => {
75
75
  var _a, _b;
76
76
  const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
77
77
  const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
@@ -88,7 +88,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
88
88
  adaptableId: `${mainAdaptableOptions.adaptableId}::DataChangeHistory`,
89
89
  containerOptions: {
90
90
  adaptableContainer: adaptableContainerId,
91
- vendorContainer: vendorContainerId,
91
+ agGridContainer: agGridContainerId,
92
92
  },
93
93
  entitlementOptions: {
94
94
  defaultAccessLevel: 'Hidden',
@@ -188,7 +188,8 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
188
188
  const layoutColumns = options.predefinedConfig.Layout.Layouts[0].Columns;
189
189
  if (layoutColumns.includes('undoActionColumn')) {
190
190
  // remove action column from layout
191
- options.predefinedConfig.Layout.Layouts[0].Columns = layoutColumns.filter((columnId) => columnId !== 'undoActionColumn');
191
+ options.predefinedConfig.Layout.Layouts[0].Columns =
192
+ layoutColumns.filter((columnId) => columnId !== 'undoActionColumn');
192
193
  }
193
194
  }
194
195
  return options;
@@ -21,8 +21,8 @@ class DataChangeHistoryPopupComponent extends React.Component {
21
21
  }
22
22
  render() {
23
23
  const { changeHistoryMode, activationTime, suspensionTime, onChangeHistoryEnable, onChangeHistoryDisable, onChangeHistorySuspend, onChangeHistoryResume, } = this.props;
24
- const adaptableContainerId = 'dataChangeHistoryAdaptableGrid';
25
- const vendorContainerId = 'dataChangeHistoryVendorGrid';
24
+ const adaptableContainerId = 'dataChangeHistoryAdaptableContainer';
25
+ const agGridContainerId = 'dataChangeHistoryAgGridContainer';
26
26
  const enabled = changeHistoryMode === 'ACTIVE';
27
27
  const disabled = changeHistoryMode === 'INACTIVE';
28
28
  const suspended = changeHistoryMode === 'SUSPENDED';
@@ -53,9 +53,9 @@ class DataChangeHistoryPopupComponent extends React.Component {
53
53
  this.props.api.dataChangeHistoryApi.undoDataChangeHistoryEntry(changeToBeUndone);
54
54
  }
55
55
  };
56
- const currentVendorTheme = this.props.api.internalApi
56
+ const currentAgGridTheme = this.props.api.internalApi
57
57
  .getAdaptableInstance()
58
- .getVendorGridCurrentThemeName();
58
+ .getAgGridCurrentThemeName();
59
59
  return (React.createElement(PanelWithButton_1.PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), border: "none", bodyProps: { padding: 0 } },
60
60
  React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup", flexDirection: "column", style: { height: '100%' } },
61
61
  React.createElement(rebass_1.Flex, { style: {
@@ -67,8 +67,8 @@ class DataChangeHistoryPopupComponent extends React.Component {
67
67
  statusPanel)),
68
68
  React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup--grid", "data-name": 'data-change-history--grid', flex: 1, alignSelf: 'stretch', flexDirection: 'column' },
69
69
  React.createElement("div", { id: adaptableContainerId }),
70
- React.createElement("div", { id: vendorContainerId, className: currentVendorTheme, style: { height: '100%', width: '1000px' } }),
71
- React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId, vendorContainerId: vendorContainerId, changeHistoryLog: this.props.changeHistoryLog, onUndoChange: handleChangeUndo })))));
70
+ React.createElement("div", { id: agGridContainerId, className: currentAgGridTheme, style: { height: '100%', width: '1000px' } }),
71
+ React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId, agGridContainerId: agGridContainerId, changeHistoryLog: this.props.changeHistoryLog, onUndoChange: handleChangeUndo })))));
72
72
  }
73
73
  }
74
74
  function mapStateToProps(state, ownProps) {
@@ -92,12 +92,12 @@ class ExportViewPanelComponent extends React.Component {
92
92
  }
93
93
  };
94
94
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
95
- return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Export__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
96
- React.createElement(rebass_1.Flex, null,
97
- React.createElement(DropdownButton_1.default, { disabled: allReportNames.length == 0, style: { minWidth: 168, fontSize: 'small' }, items: reportItems, columns: ['label'], className: `ab-${elementType}__Export__select`, onClear: () => this.onSelectedReportChanged(null), showClearButton: !!currentReport, variant: "outlined", marginRight: 2 }, currentReportId)),
98
- React.createElement(rebass_1.Flex, null,
99
- React.createElement(DropdownButton_1.default, { disabled: currentReportId === SELECT_REPORT_STRING, style: { minWidth: 168, fontSize: 'small' }, items: destinationItems, columns: ['label'], className: `ab-${elementType}__Export__export`, onClear: () => this.onSelectedDestinationChanged(null), showClearButton: !!currentDestination, variant: "outlined", marginRight: 2 }, currentDestinationId)),
100
- React.createElement(rebass_1.Flex, { className: join_1.default(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls`), style: { minWidth: '168px' } },
95
+ return (React.createElement(rebass_1.Flex, { style: { gap: 5 }, flexDirection: "row", className: `ab-${elementType}__Export__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
96
+ React.createElement(rebass_1.Flex, { flex: 1 },
97
+ React.createElement(DropdownButton_1.default, { disabled: allReportNames.length == 0, style: { width: '100%', fontSize: 'small' }, items: reportItems, columns: ['label'], className: `ab-${elementType}__Export__select`, onClear: () => this.onSelectedReportChanged(null), showClearButton: !!currentReport, variant: "outlined", marginRight: 2 }, currentReportId)),
98
+ React.createElement(rebass_1.Flex, { flex: 1 },
99
+ React.createElement(DropdownButton_1.default, { disabled: currentReportId === SELECT_REPORT_STRING, style: { width: '100%', fontSize: 'small' }, items: destinationItems, columns: ['label'], className: `ab-${elementType}__Export__export`, onClear: () => this.onSelectedDestinationChanged(null), showClearButton: !!currentDestination, variant: "outlined", marginRight: 2 }, currentDestinationId)),
100
+ React.createElement(rebass_1.Flex, { className: join_1.default(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls`), style: { width: '100%' } },
101
101
  React.createElement(ButtonExport_1.ButtonExport, { onClick: () => onApplyExport(), tooltip: "Export Report", className: `ab-${elementType}__Export__export`, disabled: currentReport == null || currentDestination == null }),
102
102
  React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.onEditReport(this.props.moduleInfo.Popup), tooltip: "Edit Report", className: `ab-${elementType}__Export__edit`, disabled: currentReport == null || currentReport.ReportColumnScope == 'CustomColumns', accessLevel: accessLevel }),
103
103
  React.createElement(ButtonNew_1.ButtonNew, { variant: "text", className: `ab-${elementType}__Export__new`, tone: "neutral", children: null, onClick: () => this.props.onNewReport(this.props.moduleInfo.Popup), tooltip: "Create New Report", accessLevel: accessLevel }),
@@ -9,7 +9,7 @@ const CheckBox_1 = require("../../components/CheckBox");
9
9
  class GridOptionsComponent extends React.Component {
10
10
  constructor(props) {
11
11
  super(props);
12
- const gridOptions = props.api.internalApi.getVendorGridInstance();
12
+ const gridOptions = props.api.internalApi.getAgGridInstance();
13
13
  this.state = {
14
14
  testString: 'Hello world',
15
15
  showTotalFooter: gridOptions.groupIncludeTotalFooter,
@@ -30,8 +30,8 @@ class LayoutViewPanelComponent extends React.Component {
30
30
  });
31
31
  const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
32
32
  return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
33
- React.createElement(rebass_1.Flex, null,
34
- React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], style: { minWidth: 168, fontSize: 'small' }, className: `ab-${elementType}__Layout__select`, items: availableLayoutOptions, disabled: availableLayoutOptions.length == 0 }, layoutEntity ? layoutEntity.Name : null)),
33
+ React.createElement(rebass_1.Flex, { flex: 1 },
34
+ React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], style: { width: '100%', fontSize: 'small' }, className: `ab-${elementType}__Layout__select`, items: availableLayoutOptions, disabled: availableLayoutOptions.length == 0 }, layoutEntity ? layoutEntity.Name : null)),
35
35
  React.createElement(rebass_1.Flex, { flexDirection: "row", className: join_1.default(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Layout__wrap`) },
36
36
  isManualSaveLayout && (React.createElement(ButtonSave_1.ButtonSave, { className: `ab-${elementType}__Layout__save`, onClick: () => this.onSaveLayout(), tooltip: "Save Changes to Current Layout", disabled: !this.props.CanSave, accessLevel: accessLevel })),
37
37
  React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.onEditLayout(this.props.moduleInfo.Popup), tooltip: "Edit Layout", className: `ab-${elementType}__Layout__edit`, accessLevel: accessLevel }),
@@ -88,7 +88,7 @@ class QueryViewPanelComponent extends React.Component {
88
88
  } }),
89
89
  isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
90
90
  ' ',
91
- this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.props.onRunQuery(''), tooltip: "Clear Query", accessLevel: 'Full' })))) : (React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { width: '100%', minWidth: 168 } }));
91
+ this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.props.onRunQuery(''), tooltip: "Clear Query", accessLevel: 'Full' })))) : (React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { width: '100%' } }));
92
92
  };
93
93
  const queryModuleAccessLevel = this.props.api.internalApi
94
94
  .getEntitlementService()
@@ -4,12 +4,11 @@ exports.useQuickSearchDebounced = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = require("react");
6
6
  const debounce_1 = tslib_1.__importDefault(require("lodash-es/debounce"));
7
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
7
8
  exports.useQuickSearchDebounced = (props) => {
8
9
  var _a;
9
10
  const [searchText, setSearchText] = react_1.useState((_a = props.QuickSearchText) !== null && _a !== void 0 ? _a : '');
10
- const debouncedRunQuickSearch = react_1.useMemo(() => debounce_1.default(props.onRunQuickSearch, 350), [
11
- props.onRunQuickSearch,
12
- ]);
11
+ const debouncedRunQuickSearch = react_1.useMemo(() => debounce_1.default(props.onRunQuickSearch, GeneralConstants_1.QUICK_SEARCH_DEBOUNCE_TIME), [props.onRunQuickSearch]);
13
12
  react_1.useEffect(() => {
14
13
  setSearchText(props.QuickSearchText);
15
14
  }, [props.QuickSearchText]);
@@ -156,15 +156,15 @@ class SchedulePopupComponent extends React.Component {
156
156
  if (exportModuleAccessLevel !== 'Hidden') {
157
157
  allSchedules.push(...this.props.ReportSchedules);
158
158
  }
159
- const ippApi = this.props.api.pluginsApi.getPluginApi('ipushpull');
159
+ const ippApi = this.props.api.pluginsApi.getipushpullPluginApi();
160
160
  if (ippApi && ippApi.isIPushPullRunning()) {
161
161
  allSchedules.push(...this.props.IPushPullSchedules);
162
162
  }
163
- const glue42Api = this.props.api.pluginsApi.getPluginApi('glue42');
163
+ const glue42Api = this.props.api.pluginsApi.getGlue42PluginApi();
164
164
  if (glue42Api && glue42Api.isGlue42Running()) {
165
165
  allSchedules.push(...this.props.Glue42Schedules);
166
166
  }
167
- const openFinApi = this.props.api.pluginsApi.getPluginApi('openfin');
167
+ const openFinApi = this.props.api.pluginsApi.getOpenFinPluginApi();
168
168
  if (openFinApi && openFinApi.isOpenFinRunning()) {
169
169
  allSchedules.push(...this.props.OpenFinSchedules);
170
170
  }
@@ -21,7 +21,7 @@ exports.ScheduleSettingsWizard = (props) => {
21
21
  return (React.createElement(ScheduleSettingsReport_1.ScheduleSettingsReport, { allReports: allReports !== null && allReports !== void 0 ? allReports : [], customDestinations: customDestinations || [], report: data, onChange: props.onChange }));
22
22
  }
23
23
  if ((data === null || data === void 0 ? void 0 : data.ScheduleType) === Enums_1.ScheduleType.ipushpull) {
24
- const ippApi = api.pluginsApi.getPluginApi('ipushpull');
24
+ const ippApi = api.pluginsApi.getipushpullPluginApi();
25
25
  const allFolders = ippApi && ippApi.getIPushPullDomains();
26
26
  const folderName = data.IPushPullReport.Folder;
27
27
  const availablePages = ippApi && folderName && ippApi.getPagesForIPushPullDomain(folderName);
@@ -29,7 +29,7 @@ class SmartEditPopupComponent extends React.Component {
29
29
  render() {
30
30
  let col;
31
31
  if (this.props.PreviewInfo) {
32
- col = this.props.api.columnApi.getColumnFromId(this.props.PreviewInfo.columnId);
32
+ col = this.props.PreviewInfo.column;
33
33
  }
34
34
  let globalValidationMessage = PreviewHelper_1.PreviewHelper.GetValidationMessage(this.props.PreviewInfo, `${this.props.SmartEditValue}`);
35
35
  let showPanel = this.props.PreviewInfo && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(`${this.props.SmartEditValue}`);
@@ -1,16 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
3
- interface StateManagementPopupProps extends ModuleViewPopupProps<StateManagementPopupComponent> {
3
+ interface StateManagementPopupProps extends ModuleViewPopupProps<typeof StateManagementPopup> {
4
4
  }
5
- declare class StateManagementPopupComponent extends React.Component<StateManagementPopupProps, {}> {
6
- constructor(props: StateManagementPopupProps);
7
- render(): JSX.Element;
8
- onClearLocalStorage(): void;
9
- onLoadPredefinedConfig(e: any): void;
10
- onExportAllState(type: any): void;
11
- onExportUserState(type: any): void;
12
- onExportPredefinedConfig(type: any): void;
13
- onExportState(type: any, name: string, state: any): void;
14
- }
15
- export declare let StateManagementPopup: import("react-redux").ConnectedComponent<typeof StateManagementPopupComponent, any>;
5
+ export declare const StateManagementPopup: React.FunctionComponent<StateManagementPopupProps>;
16
6
  export {};
@@ -3,120 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StateManagementPopup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
- const react_redux_1 = require("react-redux");
7
6
  const PanelWithButton_1 = require("../Components/Panels/PanelWithButton");
8
- const UIHelper_1 = require("../UIHelper");
9
7
  const rebass_1 = require("rebass");
10
- const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
11
8
  const HelpBlock_1 = tslib_1.__importDefault(require("../../components/HelpBlock"));
12
- const Dropdown_1 = tslib_1.__importDefault(require("../../components/Dropdown"));
13
- const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
14
- const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
15
- const FileDroppable_1 = require("../../components/FileDroppable");
16
- class StateManagementPopupComponent extends React.Component {
17
- constructor(props) {
18
- super(props);
19
- this.state = UIHelper_1.UIHelper.getEmptyConfigState();
20
- }
21
- render() {
22
- // sort out actions
23
- let destinationOptions = [
24
- {
25
- value: 'Clipboard',
26
- label: 'Clipboard',
27
- },
28
- {
29
- value: 'Console',
30
- label: 'Console',
31
- },
32
- {
33
- value: 'JSON',
34
- label: 'JSON',
35
- },
36
- ];
37
- let clearButton = (React.createElement(SimpleButton_1.default, { onClick: () => this.onClearLocalStorage(), tooltip: "Clear User State", tone: "error", variant: "raised", marginTop: 2, accessLevel: this.props.accessLevel }, "Clear User State"));
38
- let loadButton = (React.createElement(SimpleButton_1.default, { marginTop: 2, tone: "info", variant: "raised", accessLevel: this.props.accessLevel },
39
- React.createElement("input", { type: "file", onChange: (json) => this.onLoadPredefinedConfig(json), accept: '.json', style: {
40
- opacity: 0,
41
- position: 'absolute',
42
- cursor: 'pointer',
43
- fontSize: 0,
44
- lineHeight: 0,
45
- top: 0,
46
- left: 0,
47
- width: '100%',
48
- height: '100%',
49
- zIndex: 1,
50
- } }),
51
- ' ',
52
- "Load Predefined Config"));
53
- return (React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "column" },
54
- React.createElement(PanelWithButton_1.PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, button: null, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() },
55
- React.createElement(rebass_1.Box, null,
56
- React.createElement(HelpBlock_1.default, null, 'Clear all current user state that has been applied. When you restart / refresh Adaptable any state that you have previously created will be lost. However your Predefined Config will then be re-applied.'),
57
- clearButton,
58
- React.createElement(HelpBlock_1.default, { marginTop: 3 }, 'Load Predefined Config (from a .json file). This will cause this window to close.'),
59
- ' ',
60
- loadButton,
61
- React.createElement(HelpBlock_1.default, { marginTop: 3, marginBottom: 2 }, 'Export All Adaptable State'),
62
- React.createElement(Dropdown_1.default, { key: 'exportAllState', placeholder: "Select Export Destination", style: { flex: 1, maxWidth: 'none' }, value: undefined, onChange: (x) => this.onExportAllState(x), marginRight: 3, options: destinationOptions }),
63
- React.createElement(HelpBlock_1.default, { marginTop: 3, marginBottom: 2 }, 'Export User State'),
64
- ' ',
65
- React.createElement(Dropdown_1.default, { key: 'exportUserState', placeholder: "Select Export Destination", style: { flex: 1, maxWidth: 'none' }, value: undefined, onChange: (x) => this.onExportUserState(x), marginRight: 3, options: destinationOptions }),
66
- React.createElement(HelpBlock_1.default, { marginTop: 3, marginBottom: 2 }, 'Export Initial Predefined Config'),
67
- ' ',
68
- React.createElement(Dropdown_1.default, { key: 'exportPredefinedConfig', placeholder: "Select Export Destination", style: { flex: 1, maxWidth: 'none' }, value: undefined, onChange: (x) => this.onExportPredefinedConfig(x), marginRight: 3, options: destinationOptions })))));
69
- }
70
- onClearLocalStorage() {
71
- this.props.api.configApi.reloadPredefinedConfig();
72
- }
73
- onLoadPredefinedConfig(e) {
74
- let nativeEvent = e.nativeEvent;
75
- let files;
76
- if (nativeEvent && nativeEvent.dataTransfer) {
77
- files = nativeEvent.dataTransfer.files;
78
- }
79
- else {
80
- files = e.target.files;
81
- }
82
- const file = files[0];
83
- FileDroppable_1.readJSONFile(file).then((json) => {
84
- this.props.api.configApi.reloadPredefinedConfig(json);
85
- });
86
- }
87
- onExportAllState(type) {
88
- let allState = this.props.api.configApi.getAllState();
89
- this.onExportState(type, 'allState', allState);
90
- }
91
- onExportUserState(type) {
92
- let userState = this.props.api.configApi.getAllUserState();
93
- this.onExportState(type, 'userState', userState);
94
- }
95
- onExportPredefinedConfig(type) {
96
- let predefinedConfig = this.props.api.configApi.getPredefinedConfig();
97
- this.onExportState(type, 'predefinedConfig', predefinedConfig);
98
- }
99
- onExportState(type, name, state) {
100
- switch (type) {
101
- case 'Clipboard':
102
- let stringifiedState = JSON.stringify(state);
103
- Helper_1.default.copyToClipboard(stringifiedState);
104
- break;
105
- case 'Console':
106
- LoggingHelper_1.ConsoleLog(state);
107
- break;
108
- case 'JSON':
109
- const jsonFileName = name + '.json';
110
- const jsonContent = JSON.stringify(state);
111
- Helper_1.default.createDownloadedFile(jsonContent, jsonFileName, 'application/json');
112
- break;
113
- }
114
- }
115
- }
116
- function mapStateToProps(state, ownProps) {
117
- return {};
118
- }
119
- function mapDispatchToProps(dispatch) {
120
- return {};
121
- }
122
- exports.StateManagementPopup = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(StateManagementPopupComponent);
9
+ const LoadButton_1 = require("./components/LoadButton");
10
+ const ClearButton_1 = require("./components/ClearButton");
11
+ const ExportDropdown_1 = require("./components/ExportDropdown");
12
+ exports.StateManagementPopup = (props) => {
13
+ return (React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "column" },
14
+ React.createElement(PanelWithButton_1.PanelWithButton, { headerText: props.moduleInfo.FriendlyName, button: null, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
15
+ React.createElement(rebass_1.Box, null,
16
+ React.createElement(HelpBlock_1.default, null, 'Clear all current user state that has been applied. When you restart / refresh Adaptable any state that you have previously created will be lost. However your Predefined Config will then be re-applied.'),
17
+ React.createElement(ClearButton_1.ClearButton, { tone: "error", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onClick: () => props.api.configApi.reloadPredefinedConfig() }, "Clear User State"),
18
+ React.createElement(HelpBlock_1.default, { marginTop: 3 }, 'Load Predefined Config (from a .json file). This will cause this window to close.'),
19
+ ' ',
20
+ React.createElement(LoadButton_1.LoadButton, { tone: "info", variant: "raised", marginTop: 2, accessLevel: props.accessLevel, onLoad: (json) => props.api.configApi.reloadPredefinedConfig(json) }, "Load Predefined Config"),
21
+ React.createElement(HelpBlock_1.default, { marginTop: 3, marginBottom: 2 }, 'Export All Adaptable State'),
22
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "allState", marginRight: 3, style: { flex: 1, maxWidth: 'none' } }, "Select Export Destination"),
23
+ React.createElement(HelpBlock_1.default, { marginTop: 3, marginBottom: 2 }, 'Export User State'),
24
+ ' ',
25
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "userState", marginRight: 3, style: { flex: 1, maxWidth: 'none' } }, "Select Export Destination"),
26
+ React.createElement(HelpBlock_1.default, { marginTop: 3, marginBottom: 2 }, 'Export Initial Predefined Config'),
27
+ ' ',
28
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "predefinedConfig", marginRight: 3, style: { flex: 1, maxWidth: 'none' } }, "Select Export Destination")))));
29
+ };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
3
+ export interface ThemeViewPanelComponentProps extends ViewPanelProps {
4
+ }
5
+ export declare const StateManagementViewPanel: React.FunctionComponent<ThemeViewPanelComponentProps>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StateManagementViewPanel = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
7
+ const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
8
+ const LoadButton_1 = require("./components/LoadButton");
9
+ const ClearButton_1 = require("./components/ClearButton");
10
+ const rebass_1 = require("rebass");
11
+ const ExportDropdown_1 = require("./components/ExportDropdown");
12
+ exports.StateManagementViewPanel = (props) => {
13
+ const isToolbar = props.viewType === 'Toolbar';
14
+ const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
15
+ return (React.createElement(rebass_1.Flex, { flexDirection: isToolbar ? 'row' : 'column', className: join_1.default(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__StateManagement__wrap`) },
16
+ React.createElement(rebass_1.Flex, { flexDirection: "row" },
17
+ React.createElement(LoadButton_1.LoadButton, { tooltip: "Load Predefined Config", variant: "text", icon: "upload", onLoad: (json) => props.api.configApi.reloadPredefinedConfig(json), accessLevel: props.accessLevel }, !isToolbar && 'Load'),
18
+ React.createElement(ClearButton_1.ClearButton, { icon: "trash", tooltip: "Clear User State", variant: "text", onClick: () => props.api.configApi.reloadPredefinedConfig(), accessLevel: props.accessLevel }, !isToolbar && 'Clear')),
19
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "allState" }, "All State"),
20
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "userState" }, "User State"),
21
+ React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "predefinedConfig" }, "Predefined Config")));
22
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { SimpleButtonProps } from '../../../components/SimpleButton';
3
+ interface ClearButtonProps extends SimpleButtonProps {
4
+ }
5
+ export declare const ClearButton: React.FunctionComponent<ClearButtonProps>;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClearButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
7
+ exports.ClearButton = (props) => {
8
+ return (React.createElement(SimpleButton_1.default, Object.assign({}, props, { className: "ab-StateManagement__Clear-Button", tooltip: "Clear User State" }), props.children));
9
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { AdaptableApi } from '../../../../types';
3
+ import { DropdownButtonProps } from '../../../components/DropdownButton';
4
+ export interface ExportDropdownProps extends Omit<DropdownButtonProps, 'options' | 'value'> {
5
+ api: AdaptableApi;
6
+ type: 'allState' | 'userState' | 'predefinedConfig';
7
+ }
8
+ export declare const ExportDropdown: React.FunctionComponent<ExportDropdownProps>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExportDropdown = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
7
+ const handleExportState_1 = require("../handleExportState");
8
+ exports.ExportDropdown = (props) => {
9
+ const handleChange = (destination) => {
10
+ switch (props.type) {
11
+ case 'allState':
12
+ const allState = props.api.configApi.getAllState();
13
+ handleExportState_1.handleExportState(destination, 'allState', allState);
14
+ break;
15
+ case 'userState':
16
+ const userState = props.api.configApi.getAllUserState();
17
+ handleExportState_1.handleExportState(destination, 'userState', userState);
18
+ break;
19
+ case 'predefinedConfig':
20
+ const predefinedConfig = props.api.configApi.getPredefinedConfig();
21
+ handleExportState_1.handleExportState(destination, 'predefinedConfig', predefinedConfig);
22
+ break;
23
+ }
24
+ };
25
+ const destinationOptions = [
26
+ {
27
+ value: 'Clipboard',
28
+ label: 'Clipboard',
29
+ onClick: () => handleChange('Clipboard'),
30
+ },
31
+ {
32
+ value: 'Console',
33
+ label: 'Console',
34
+ onClick: () => handleChange('Console'),
35
+ },
36
+ {
37
+ value: 'JSON',
38
+ label: 'JSON',
39
+ onClick: () => handleChange('JSON'),
40
+ },
41
+ ];
42
+ return (React.createElement(DropdownButton_1.default, Object.assign({ className: "ab-StateManagement__Export-Dropdown" }, props, { items: destinationOptions, value: undefined })));
43
+ };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { SimpleButtonProps } from '../../../components/SimpleButton';
3
+ interface LoadButtonProps extends SimpleButtonProps {
4
+ onLoad: (json: any) => void;
5
+ }
6
+ export declare const LoadButton: React.FunctionComponent<LoadButtonProps>;
7
+ export {};
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const FileDroppable_1 = require("../../../components/FileDroppable");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
8
+ exports.LoadButton = (props) => {
9
+ const onLoadPredefinedConfig = (e) => {
10
+ const nativeEvent = e.nativeEvent;
11
+ let files;
12
+ if (nativeEvent && nativeEvent.dataTransfer) {
13
+ files = nativeEvent.dataTransfer.files;
14
+ }
15
+ else {
16
+ files = e.target.files;
17
+ }
18
+ const file = files[0];
19
+ FileDroppable_1.readJSONFile(file).then((json) => {
20
+ props.onLoad(json);
21
+ });
22
+ };
23
+ return (React.createElement(SimpleButton_1.default, Object.assign({}, props, { className: "ab-StateManagement__Load-Button" }),
24
+ React.createElement("input", { type: "file", onChange: (json) => onLoadPredefinedConfig(json), accept: '.json', style: {
25
+ opacity: 0,
26
+ position: 'absolute',
27
+ cursor: 'pointer',
28
+ fontSize: 0,
29
+ lineHeight: 0,
30
+ top: 0,
31
+ left: 0,
32
+ width: '100%',
33
+ height: '100%',
34
+ zIndex: 1,
35
+ } }),
36
+ ' ',
37
+ props.children));
38
+ };
@@ -0,0 +1 @@
1
+ export declare const handleExportState: (type: 'Clipboard' | 'Console' | 'JSON', name: string, state: any) => void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleExportState = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
6
+ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
7
+ exports.handleExportState = (type, name, state) => {
8
+ switch (type) {
9
+ case 'Clipboard':
10
+ let stringifiedState = JSON.stringify(state);
11
+ Helper_1.default.copyToClipboard(stringifiedState);
12
+ break;
13
+ case 'Console':
14
+ LoggingHelper_1.ConsoleLog(state);
15
+ break;
16
+ case 'JSON':
17
+ const jsonFileName = name + '.json';
18
+ const jsonContent = JSON.stringify(state);
19
+ Helper_1.default.createDownloadedFile(jsonContent, jsonFileName, 'application/json');
20
+ break;
21
+ }
22
+ };