@adaptabletools/adaptable 11.0.9 → 11.1.1-canary.1
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.
- package/base.css +19 -11
- package/bundle.cjs.js +125 -125
- package/index.css +23 -11
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -2
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/Api/AlertApi.d.ts +5 -6
- package/src/Api/BulkUpdateApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/DataChangeHistoryApi.d.ts +3 -3
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/CellChanged.d.ts +2 -2
- package/src/Api/Events/GridDataChanged.d.ts +5 -1
- package/src/Api/ExportApi.d.ts +3 -3
- package/src/Api/FreeTextColumnApi.d.ts +3 -3
- package/src/Api/GridApi.d.ts +27 -6
- package/src/Api/Implementation/AlertApiImpl.d.ts +7 -4
- package/src/Api/Implementation/AlertApiImpl.js +86 -59
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +7 -2
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +3 -3
- package/src/Api/Implementation/EventApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ExportApiImpl.js +7 -8
- package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -7
- package/src/Api/Implementation/GridApiImpl.d.ts +11 -3
- package/src/Api/Implementation/GridApiImpl.js +29 -8
- package/src/Api/Implementation/InternalApiImpl.d.ts +11 -4
- package/src/Api/Implementation/InternalApiImpl.js +41 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
- package/src/Api/Implementation/LayoutApiImpl.js +19 -4
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
- package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
- package/src/Api/InternalApi.d.ts +10 -3
- package/src/Api/LayoutApi.d.ts +14 -3
- package/src/PredefinedConfig/AlertState.d.ts +7 -3
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
- package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
- package/src/PredefinedConfig/Common/AdaptableFlashingCell.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
- package/src/PredefinedConfig/Common/{DataChangedInfo.d.ts → CellDataChangedInfo.d.ts} +2 -6
- package/src/PredefinedConfig/Common/{DataChangedInfo.js → CellDataChangedInfo.js} +0 -0
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/DataChangedScope.d.ts +4 -0
- package/src/PredefinedConfig/Common/DataChangedScope.js +2 -0
- package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
- package/src/PredefinedConfig/ConfigState.d.ts +4 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -2
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
- package/src/Redux/ActionsReducers/GridRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +16 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +37 -6
- package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
- package/src/Redux/Store/AdaptableStore.js +76 -34
- package/src/Strategy/AlertModule.d.ts +5 -3
- package/src/Strategy/AlertModule.js +68 -22
- package/src/Strategy/BulkUpdateModule.js +7 -2
- package/src/Strategy/DataChangeHistoryModule.js +8 -6
- package/src/Strategy/ExportModule.js +1 -0
- package/src/Strategy/FlashingCellModule.d.ts +2 -2
- package/src/Strategy/FlashingCellModule.js +21 -15
- package/src/Strategy/FormatColumnModule.js +4 -2
- package/src/Strategy/SmartEditModule.js +6 -0
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +6 -3
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
- package/src/Utilities/ObjectFactory.d.ts +9 -7
- package/src/Utilities/ObjectFactory.js +26 -12
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +3 -3
- package/src/Utilities/Services/DataService.d.ts +5 -5
- package/src/Utilities/Services/DataService.js +12 -10
- package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IDataService.d.ts +6 -6
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/Interface/IValidationService.d.ts +4 -4
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/ValidationService.d.ts +4 -4
- package/src/Utilities/Services/ValidationService.js +18 -17
- package/src/View/AdaptableView.js +2 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
- package/src/View/Alert/Wizard/AlertWizard.js +83 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -2
- package/src/View/Components/FilterForm/FilterForm.js +2 -2
- package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
- package/src/View/Components/Panels/PanelFooter.js +14 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +2 -2
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
- package/src/View/Layout/LayoutPopup.js +3 -24
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
- package/src/View/Layout/LayoutViewPanel.js +5 -18
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
- package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
- package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
- package/src/agGrid/Adaptable.d.ts +6 -4
- package/src/agGrid/Adaptable.js +115 -117
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +23 -8
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
- package/src/components/Dialog/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +10 -8
- package/src/components/WindowModal/WindowModal.js +4 -2
- package/src/components/WindowModal/useStacking.d.ts +9 -0
- package/src/components/WindowModal/useStacking.js +45 -0
- package/src/env.js +3 -3
- package/src/metamodel/adaptable.metamodel.d.ts +85 -45
- package/src/metamodel/adaptable.metamodel.js +185 -84
- package/src/types.d.ts +5 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
import { IValidationService } from './Interface/IValidationService';
|
|
4
4
|
import { AlertDefinition } from '../../PredefinedConfig/AlertState';
|
|
5
5
|
export declare class ValidationService implements IValidationService {
|
|
6
6
|
private adaptable;
|
|
7
7
|
constructor(adaptable: IAdaptable);
|
|
8
|
-
getValidationRulesForDataChange(
|
|
9
|
-
performValidation(
|
|
8
|
+
getValidationRulesForDataChange(cellDataChangedInfo: CellDataChangedInfo): AlertDefinition[];
|
|
9
|
+
performValidation(cellDataChangedInfo: CellDataChangedInfo): boolean;
|
|
10
10
|
private IsAlertDefinitionTriggered;
|
|
11
|
-
performServerValidation(
|
|
11
|
+
performServerValidation(cellDataChangedInfo: CellDataChangedInfo, config: {
|
|
12
12
|
onServerValidationCompleted: () => void;
|
|
13
13
|
}): () => boolean;
|
|
14
14
|
createValidationDescription(alertDefinition: AlertDefinition): string;
|
|
@@ -11,28 +11,28 @@ class ValidationService {
|
|
|
11
11
|
this.adaptable = adaptable;
|
|
12
12
|
}
|
|
13
13
|
// Not sure where to put this: was in the Module but might be better here until I can work out a way of having an event with a callback...
|
|
14
|
-
getValidationRulesForDataChange(
|
|
14
|
+
getValidationRulesForDataChange(cellDataChangedInfo) {
|
|
15
15
|
// if the new value is the same as the old value then we can get out as we dont see it as an edit?
|
|
16
|
-
if (
|
|
16
|
+
if (cellDataChangedInfo.oldValue == cellDataChangedInfo.newValue) {
|
|
17
17
|
return [];
|
|
18
18
|
}
|
|
19
19
|
let editingRules = this.adaptable.api.alertApi
|
|
20
20
|
.getAlertDefinitionsWithPreventEdit()
|
|
21
|
-
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(
|
|
21
|
+
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(cellDataChangedInfo.column, v.Scope));
|
|
22
22
|
let failedValidations = [];
|
|
23
23
|
if (ArrayExtensions_1.ArrayExtensions.IsNotEmpty(editingRules)) {
|
|
24
24
|
editingRules.forEach((alertDefinition) => {
|
|
25
25
|
if (alertDefinition.Rule.BooleanExpression) {
|
|
26
|
-
let isSatisfiedExpression =
|
|
26
|
+
let isSatisfiedExpression = cellDataChangedInfo.rowNode != null &&
|
|
27
27
|
this.adaptable.api.internalApi
|
|
28
28
|
.getQueryLanguageService()
|
|
29
|
-
.evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId,
|
|
29
|
+
.evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId, cellDataChangedInfo.rowNode);
|
|
30
30
|
if (isSatisfiedExpression) {
|
|
31
31
|
failedValidations.push(alertDefinition);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
if (this.IsAlertDefinitionTriggered(alertDefinition,
|
|
35
|
+
if (this.IsAlertDefinitionTriggered(alertDefinition, cellDataChangedInfo)) {
|
|
36
36
|
failedValidations.push(alertDefinition);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -40,14 +40,15 @@ class ValidationService {
|
|
|
40
40
|
}
|
|
41
41
|
return failedValidations;
|
|
42
42
|
}
|
|
43
|
-
performValidation(
|
|
44
|
-
const failedRules = this.getValidationRulesForDataChange(
|
|
43
|
+
performValidation(cellDataChangedInfo) {
|
|
44
|
+
const failedRules = this.getValidationRulesForDataChange(cellDataChangedInfo);
|
|
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],
|
|
50
|
-
|
|
51
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
51
52
|
};
|
|
52
53
|
this.adaptable.api.alertApi.publishAlertFiredEvent(alert);
|
|
53
54
|
return false;
|
|
@@ -63,25 +64,25 @@ class ValidationService {
|
|
|
63
64
|
column: dataChangedEvent.column,
|
|
64
65
|
}, false);
|
|
65
66
|
}
|
|
66
|
-
performServerValidation(
|
|
67
|
+
performServerValidation(cellDataChangedInfo, config) {
|
|
67
68
|
return () => {
|
|
68
69
|
this.adaptable.adaptableOptions.editOptions
|
|
69
|
-
.validateOnServer(
|
|
70
|
+
.validateOnServer(cellDataChangedInfo)
|
|
70
71
|
.then((validationResult) => {
|
|
71
72
|
var _a, _b;
|
|
72
73
|
if (validationResult.NewValue === undefined) {
|
|
73
|
-
validationResult.NewValue =
|
|
74
|
+
validationResult.NewValue = cellDataChangedInfo.newValue;
|
|
74
75
|
}
|
|
75
76
|
// If they have changed the return value then we should update the grid, log the function change
|
|
76
77
|
// otherwise the value will persist
|
|
77
|
-
if (validationResult.NewValue !==
|
|
78
|
-
|
|
79
|
-
// this.adaptable.setValue(
|
|
80
|
-
const row = (_a =
|
|
78
|
+
if (validationResult.NewValue !== cellDataChangedInfo.newValue) {
|
|
79
|
+
cellDataChangedInfo.newValue = validationResult.NewValue;
|
|
80
|
+
// this.adaptable.setValue(cellDataChangedInfo, false);
|
|
81
|
+
const row = (_a = cellDataChangedInfo.rowNode) === null || _a === void 0 ? void 0 : _a.data;
|
|
81
82
|
if (!row) {
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
|
-
row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(
|
|
85
|
+
row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(cellDataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : cellDataChangedInfo.column.columnId] = validationResult.NewValue;
|
|
85
86
|
this.adaptable.api.gridApi.updateGridData([row]);
|
|
86
87
|
if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
|
|
87
88
|
this.adaptable.adaptableOptions.editOptions.displayServerValidationMessages) {
|
|
@@ -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) => !
|
|
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
|
-
|
|
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:
|
|
145
|
+
render: () => React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { onChange: updateAlertDefinition, module: "alert" }),
|
|
64
146
|
renderSummary: AlertRulesWizardSection_1.renderAlertRulesSummary,
|
|
65
147
|
title: 'Rule',
|
|
66
148
|
},
|
|
@@ -38,8 +38,7 @@ class CellSummaryViewPanelComponent extends React.Component {
|
|
|
38
38
|
onClick: () => this.props.onCellSummaryOperationChange(summaryOperation),
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
const cellSummaryOperationDefinitions = this.props.api.internalApi.getAdaptableOptions()
|
|
42
|
-
.generalOptions.cellSummaryOperations;
|
|
41
|
+
const cellSummaryOperationDefinitions = this.props.api.internalApi.getAdaptableOptions().generalOptions.cellSummaryOperations;
|
|
43
42
|
const operationDefinitions = ArrayExtensions_1.default.IsNullOrEmpty(cellSummaryOperationDefinitions)
|
|
44
43
|
? []
|
|
45
44
|
: cellSummaryOperationDefinitions.map((operationDefinition) => {
|
|
@@ -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, {
|
|
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
|
-
|
|
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
|
-
|
|
58
|
+
isStandalone =
|
|
54
59
|
moduleInfo &&
|
|
55
|
-
(DefaultSettingsPanel_1.
|
|
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'}`,
|
|
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:
|
|
70
|
-
!
|
|
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
|
-
!
|
|
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("
|
|
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' &&
|
|
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;
|
|
@@ -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("
|
|
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,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,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
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
export interface DataChangeHistoryGridProps {
|
|
4
4
|
adaptableContainerId: string;
|
|
5
5
|
agGridContainerId: string;
|
|
6
|
-
changeHistoryLog: Record<string,
|
|
6
|
+
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
7
7
|
onUndoChange: (changeKey: string) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const DataChangeHistoryGrid: (props: DataChangeHistoryGridProps) => JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
4
4
|
import { SystemDataChangeHistoryDisableAction, SystemDataChangeHistoryEnableAction, SystemDataChangeHistoryResumeAction, SystemDataChangeHistorySuspendAction } from '../../Redux/ActionsReducers/SystemRedux';
|
|
5
5
|
import { DataChangeHistoryMode } from '../../PredefinedConfig/SystemState';
|
|
6
6
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
7
7
|
interface DataChangeHistoryPopupProps extends ModuleViewPopupProps<DataChangeHistoryPopupComponent> {
|
|
8
|
-
changeHistoryLog: Record<string,
|
|
8
|
+
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
9
9
|
changeHistoryMode: DataChangeHistoryMode;
|
|
10
10
|
activationTime: Date;
|
|
11
11
|
suspensionTime: Date;
|