@singularsystems/neo-react 1.0.0-alpha.2 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -0
- package/README.md +4 -0
- package/dist/Modules/NeoReactModule.d.ts +4 -4
- package/dist/Modules/NeoReactModule.js +28 -26
- package/dist/Modules/ReactSetup.d.ts +2 -2
- package/dist/Modules/ReactSetup.js +17 -17
- package/dist/Modules/Types.d.ts +63 -61
- package/dist/Modules/Types.js +13 -12
- package/dist/React/AutoRunner.d.ts +5 -5
- package/dist/React/AutoRunner.js +94 -92
- package/dist/React/DataView.d.ts +6 -6
- package/dist/React/DataView.js +11 -11
- package/dist/React/ReactModelCreator.d.ts +11 -11
- package/dist/React/ReactModelCreator.js +165 -162
- package/dist/ReactComponents/Button.d.ts +24 -23
- package/dist/ReactComponents/Button.js +131 -123
- package/dist/ReactComponents/Card.d.ts +24 -23
- package/dist/ReactComponents/Card.js +56 -54
- package/dist/ReactComponents/Collapsable.d.ts +23 -23
- package/dist/ReactComponents/Collapsable.js +38 -38
- package/dist/ReactComponents/CollapsableBase.d.ts +13 -13
- package/dist/ReactComponents/CollapsableBase.js +42 -42
- package/dist/ReactComponents/ColorPicker.d.ts +26 -26
- package/dist/ReactComponents/ColorPicker.js +67 -67
- package/dist/ReactComponents/ComponentBase.d.ts +17 -17
- package/dist/ReactComponents/ComponentBase.js +33 -33
- package/dist/ReactComponents/ContextMenu/ContextMenu.d.ts +25 -24
- package/dist/ReactComponents/ContextMenu/ContextMenu.js +91 -88
- package/dist/ReactComponents/ContextMenu/ContextMenuContainer.d.ts +14 -14
- package/dist/ReactComponents/ContextMenu/ContextMenuContainer.js +48 -48
- package/dist/ReactComponents/ContextMenu/ContextMenuState.d.ts +8 -7
- package/dist/ReactComponents/ContextMenu/ContextMenuState.js +23 -23
- package/dist/ReactComponents/DatePicker.d.ts +19 -19
- package/dist/ReactComponents/DatePicker.js +53 -53
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.d.ts +93 -83
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js +222 -188
- package/dist/ReactComponents/DropDown/DropDown.d.ts +44 -44
- package/dist/ReactComponents/DropDown/DropDown.js +138 -134
- package/dist/ReactComponents/DropDown/DropDownBase.d.ts +16 -15
- package/dist/ReactComponents/DropDown/DropDownBase.js +86 -108
- package/dist/ReactComponents/DropDown/LookupHelper.d.ts +13 -0
- package/dist/ReactComponents/DropDown/LookupHelper.js +45 -0
- package/dist/ReactComponents/ErrorHandler.d.ts +9 -8
- package/dist/ReactComponents/ErrorHandler.js +92 -91
- package/dist/ReactComponents/FileManager/FileBasicInput.d.ts +20 -20
- package/dist/ReactComponents/FileManager/FileBasicInput.js +70 -70
- package/dist/ReactComponents/FileManager/FileContext.d.ts +16 -16
- package/dist/ReactComponents/FileManager/FileContext.js +24 -24
- package/dist/ReactComponents/FileManager/FileDropArea.d.ts +19 -18
- package/dist/ReactComponents/FileManager/FileDropArea.js +66 -64
- package/dist/ReactComponents/FileManager/FileInput.d.ts +44 -42
- package/dist/ReactComponents/FileManager/FileInput.js +191 -189
- package/dist/ReactComponents/FileManager/FileUploadButton.d.ts +17 -17
- package/dist/ReactComponents/FileManager/FileUploadButton.js +49 -49
- package/dist/ReactComponents/FileManager/FileUploadProgress.d.ts +14 -14
- package/dist/ReactComponents/FileManager/FileUploadProgress.js +35 -35
- package/dist/ReactComponents/Form.d.ts +19 -18
- package/dist/ReactComponents/Form.js +90 -90
- package/dist/ReactComponents/FormContext.d.ts +33 -31
- package/dist/ReactComponents/FormContext.js +39 -40
- package/dist/ReactComponents/FormGroup/FormGroup.d.ts +37 -37
- package/dist/ReactComponents/FormGroup/FormGroup.js +83 -84
- package/dist/ReactComponents/FormGroup/FormGroupFloating.d.ts +19 -19
- package/dist/ReactComponents/FormGroup/FormGroupFloating.js +97 -97
- package/dist/ReactComponents/FormGroup/FormGroupInline.d.ts +11 -11
- package/dist/ReactComponents/FormGroup/FormGroupInline.js +43 -43
- package/dist/ReactComponents/Grid/ButtonColumn.d.ts +47 -47
- package/dist/ReactComponents/Grid/ButtonColumn.js +81 -82
- package/dist/ReactComponents/Grid/Column.d.ts +47 -47
- package/dist/ReactComponents/Grid/Column.js +205 -205
- package/dist/ReactComponents/Grid/ColumnHelper.d.ts +12 -12
- package/dist/ReactComponents/Grid/ColumnHelper.js +19 -19
- package/dist/ReactComponents/Grid/Grid.d.ts +87 -90
- package/dist/ReactComponents/Grid/Grid.js +203 -203
- package/dist/ReactComponents/Grid/Row.d.ts +81 -81
- package/dist/ReactComponents/Grid/Row.js +200 -201
- package/dist/ReactComponents/Grid/_Exports.d.ts +5 -5
- package/dist/ReactComponents/Grid/_Exports.js +5 -5
- package/dist/ReactComponents/GridLayout.d.ts +20 -20
- package/dist/ReactComponents/GridLayout.js +38 -38
- package/dist/ReactComponents/Icons/FontAwesomeIconFactory.d.ts +23 -0
- package/dist/ReactComponents/Icons/FontAwesomeIconFactory.js +43 -0
- package/dist/ReactComponents/Icons/IIconFactory.d.ts +21 -0
- package/dist/ReactComponents/Icons/IIconFactory.js +1 -0
- package/dist/ReactComponents/Icons/IconFactory.d.ts +9 -0
- package/dist/ReactComponents/Icons/IconFactory.js +45 -0
- package/dist/ReactComponents/Icons/index.d.ts +3 -0
- package/dist/ReactComponents/Icons/index.js +2 -0
- package/dist/ReactComponents/Input.d.ts +45 -45
- package/dist/ReactComponents/Input.js +153 -152
- package/dist/ReactComponents/InputHelpers.d.ts +6 -5
- package/dist/ReactComponents/InputHelpers.js +29 -33
- package/dist/ReactComponents/Link.d.ts +13 -13
- package/dist/ReactComponents/Link.js +28 -28
- package/dist/ReactComponents/Loader.d.ts +18 -18
- package/dist/ReactComponents/Loader.js +57 -57
- package/dist/ReactComponents/Misc.d.ts +15 -15
- package/dist/ReactComponents/Misc.js +28 -28
- package/dist/ReactComponents/Modal/Modal.d.ts +11 -11
- package/dist/ReactComponents/Modal/Modal.js +129 -129
- package/dist/ReactComponents/Modal/ModalContainer.d.ts +17 -17
- package/dist/ReactComponents/Modal/ModalContainer.js +37 -37
- package/dist/ReactComponents/Modal/ModalPortal.d.ts +16 -15
- package/dist/ReactComponents/Modal/ModalPortal.js +27 -27
- package/dist/ReactComponents/Notifications/Alert.d.ts +7 -6
- package/dist/ReactComponents/Notifications/Alert.js +38 -35
- package/dist/ReactComponents/Notifications/Toast.d.ts +9 -8
- package/dist/ReactComponents/Notifications/Toast.js +47 -45
- package/dist/ReactComponents/Notifications/ToastContainer.d.ts +8 -8
- package/dist/ReactComponents/Notifications/ToastContainer.js +18 -18
- package/dist/ReactComponents/NumberInput.d.ts +57 -50
- package/dist/ReactComponents/NumberInput.js +260 -246
- package/dist/ReactComponents/Paging/BasicPagerControls.d.ts +26 -25
- package/dist/ReactComponents/Paging/BasicPagerControls.js +57 -55
- package/dist/ReactComponents/Paging/PageSizeControl.d.ts +11 -11
- package/dist/ReactComponents/Paging/PageSizeControl.js +21 -21
- package/dist/ReactComponents/Paging/Pager.d.ts +24 -24
- package/dist/ReactComponents/Paging/Pager.js +41 -41
- package/dist/ReactComponents/ProgressBar.d.ts +19 -19
- package/dist/ReactComponents/ProgressBar.js +52 -52
- package/dist/ReactComponents/PropTypes.d.ts +161 -161
- package/dist/ReactComponents/PropTypes.js +253 -236
- package/dist/ReactComponents/RadioList.d.ts +29 -29
- package/dist/ReactComponents/RadioList.js +59 -77
- package/dist/ReactComponents/Slider.d.ts +28 -28
- package/dist/ReactComponents/Slider.js +76 -76
- package/dist/ReactComponents/StateObserver.d.ts +15 -15
- package/dist/ReactComponents/StateObserver.js +35 -35
- package/dist/ReactComponents/Tabs/Tab.d.ts +42 -41
- package/dist/ReactComponents/Tabs/Tab.js +71 -72
- package/dist/ReactComponents/Tabs/TabContainer.d.ts +44 -44
- package/dist/ReactComponents/Tabs/TabContainer.js +98 -98
- package/dist/ReactComponents/Tabs/TabManager.d.ts +62 -62
- package/dist/ReactComponents/Tabs/TabManager.js +154 -154
- package/dist/ReactComponents/Tooltip.d.ts +20 -19
- package/dist/ReactComponents/Tooltip.js +51 -51
- package/dist/ReactComponents/TooltipHelper.d.ts +8 -8
- package/dist/ReactComponents/TooltipHelper.js +84 -84
- package/dist/ReactComponents/TooltipProvider.d.ts +30 -30
- package/dist/ReactComponents/TooltipProvider.js +111 -111
- package/dist/ReactComponents/ValidationSummary.d.ts +23 -22
- package/dist/ReactComponents/ValidationSummary.js +46 -43
- package/dist/ReactComponents/_Exports.d.ts +41 -41
- package/dist/ReactComponents/_Exports.js +41 -41
- package/dist/ReactComponents/_Managers.d.ts +4 -4
- package/dist/ReactComponents/_Managers.js +4 -4
- package/dist/Routing/BreadCrumbItem.d.ts +14 -14
- package/dist/Routing/BreadCrumbItem.js +12 -12
- package/dist/Routing/IRouteChangedProps.d.ts +31 -31
- package/dist/Routing/IRouteChangedProps.js +1 -1
- package/dist/Routing/IRouteParameter.d.ts +22 -22
- package/dist/Routing/IRouteParameter.js +9 -9
- package/dist/Routing/MenuRoute.d.ts +25 -24
- package/dist/Routing/MenuRoute.js +24 -24
- package/dist/Routing/NavigationHelper.d.ts +41 -40
- package/dist/Routing/NavigationHelper.js +61 -61
- package/dist/Routing/PageLeaveHandler.d.ts +13 -13
- package/dist/Routing/PageLeaveHandler.js +74 -74
- package/dist/Routing/RouteProvider.d.ts +31 -31
- package/dist/Routing/RouteProvider.js +92 -92
- package/dist/Routing/RouteView.d.ts +50 -50
- package/dist/Routing/RouteView.js +143 -144
- package/dist/Routing/RoutingState.d.ts +18 -15
- package/dist/Routing/RoutingState.js +45 -40
- package/dist/Routing/ViewParameter.d.ts +80 -58
- package/dist/Routing/ViewParameter.js +116 -95
- package/dist/Routing/ViewParameterList.d.ts +53 -53
- package/dist/Routing/ViewParameterList.js +163 -145
- package/dist/Routing/index.d.ts +9 -9
- package/dist/Routing/index.js +6 -6
- package/dist/Services/DisposeHelper.d.ts +15 -15
- package/dist/Services/DisposeHelper.js +40 -41
- package/dist/Services/IDisposeHelper.d.ts +12 -12
- package/dist/Services/IDisposeHelper.js +1 -1
- package/dist/Views/EmptyViewModel.d.ts +5 -5
- package/dist/Views/EmptyViewModel.js +14 -14
- package/dist/Views/IViewModel.d.ts +16 -16
- package/dist/Views/IViewModel.js +1 -1
- package/dist/Views/PersistentViewBase.d.ts +10 -10
- package/dist/Views/PersistentViewBase.js +21 -21
- package/dist/Views/ViewBase.d.ts +70 -71
- package/dist/Views/ViewBase.js +166 -153
- package/dist/Views/ViewComponentBase.d.ts +19 -13
- package/dist/Views/ViewComponentBase.js +24 -21
- package/dist/Views/ViewModelBase.d.ts +57 -56
- package/dist/Views/ViewModelBase.js +122 -118
- package/dist/Views/ViewState.d.ts +13 -13
- package/dist/Views/ViewState.js +9 -9
- package/dist/Views/index.d.ts +5 -5
- package/dist/Views/index.js +5 -5
- package/dist/index.d.ts +11 -10
- package/dist/index.js +10 -9
- package/package.json +26 -26
- package/styles/DatePicker.scss +2 -2
- package/styles/Forms.scss +5 -0
- package/styles/Validation.scss +0 -9
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import ModalPortal from './ModalPortal';
|
|
4
|
-
import { Misc, Utils } from '@singularsystems/neo-core';
|
|
5
|
-
import Button from '../Button';
|
|
6
|
-
import { Settings } from '@singularsystems/neo-core/dist/Settings';
|
|
7
|
-
import { Neo } from '../..';
|
|
8
|
-
import { observer } from 'mobx-react';
|
|
9
|
-
var Modal = /** @class */ (function (_super) {
|
|
10
|
-
__extends(Modal, _super);
|
|
11
|
-
function Modal() {
|
|
12
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
-
_this.visible = false;
|
|
14
|
-
_this.hasUnmounted = false;
|
|
15
|
-
return _this;
|
|
16
|
-
}
|
|
17
|
-
Modal.prototype.componentWillUnmount = function () {
|
|
18
|
-
this.hasUnmounted = true;
|
|
19
|
-
};
|
|
20
|
-
Modal.prototype.render = function () {
|
|
21
|
-
var _this = this;
|
|
22
|
-
var _a = this.props, closeButton = _a.closeButton, acceptButton = _a.acceptButton, buttons = _a.buttons, showCancelButton = _a.showCancelButton, title = _a.title, size = _a.size, formProps = _a.formProps, suppressForm = _a.suppressForm, className = _a.className, footer = _a.footer, footerContent = _a.footerContent, other = __rest(_a, ["closeButton", "acceptButton", "buttons", "showCancelButton", "title", "size", "formProps", "suppressForm", "className", "footer", "footerContent"]);
|
|
23
|
-
var renderOnCollapse = false;
|
|
24
|
-
var onClose;
|
|
25
|
-
var show;
|
|
26
|
-
var propertyInstance = this.props.bind;
|
|
27
|
-
if (!propertyInstance) {
|
|
28
|
-
propertyInstance = this.props.bindModel;
|
|
29
|
-
if (propertyInstance) {
|
|
30
|
-
renderOnCollapse = true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (propertyInstance) {
|
|
34
|
-
if (propertyInstance.value) {
|
|
35
|
-
this.lastBindValue = propertyInstance.value;
|
|
36
|
-
}
|
|
37
|
-
if (typeof propertyInstance.value === "object") {
|
|
38
|
-
formProps = formProps !== null && formProps !== void 0 ? formProps : {};
|
|
39
|
-
if (!formProps.model) {
|
|
40
|
-
formProps.model = propertyInstance.value;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
show = !!propertyInstance.value;
|
|
44
|
-
onClose = function (event) {
|
|
45
|
-
if (propertyInstance.value === true) {
|
|
46
|
-
propertyInstance.value = false;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
propertyInstance.value = null;
|
|
50
|
-
}
|
|
51
|
-
if (_this.props.onClose) {
|
|
52
|
-
_this.props.onClose(event);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
var manualProps = this.props;
|
|
58
|
-
show = manualProps.show;
|
|
59
|
-
onClose = manualProps.onClose;
|
|
60
|
-
}
|
|
61
|
-
if (show) {
|
|
62
|
-
this.visible = true;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
if (this.visible) {
|
|
66
|
-
// Fade out
|
|
67
|
-
if (!this.closeTimer) {
|
|
68
|
-
this.closeTimer = setTimeout(function () {
|
|
69
|
-
if (!_this.hasUnmounted) {
|
|
70
|
-
_this.visible = false;
|
|
71
|
-
_this.forceUpdate();
|
|
72
|
-
}
|
|
73
|
-
_this.closeTimer = null;
|
|
74
|
-
}, Misc.Settings.modalAnimationTimeMs);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (!buttons) {
|
|
79
|
-
buttons = [];
|
|
80
|
-
if (acceptButton) {
|
|
81
|
-
acceptButton = Utils.populatePartialWithDefaults(acceptButton, __assign({}, Settings.modal.acceptButton));
|
|
82
|
-
buttons.push(acceptButton);
|
|
83
|
-
if (!suppressForm) {
|
|
84
|
-
if (!this.onSubmit) {
|
|
85
|
-
this.onSubmit = acceptButton.onClick || onClose;
|
|
86
|
-
}
|
|
87
|
-
acceptButton.onClick = undefined;
|
|
88
|
-
acceptButton.isSubmit = true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
suppressForm = true;
|
|
93
|
-
}
|
|
94
|
-
if (closeButton === undefined) {
|
|
95
|
-
closeButton = {};
|
|
96
|
-
}
|
|
97
|
-
if (closeButton) {
|
|
98
|
-
buttons.push(Utils.populatePartialWithDefaults(closeButton, __assign(__assign({}, Settings.modal.closeButton), { onClick: onClose })));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
var content = this.visible && React.createElement(React.Fragment, null,
|
|
102
|
-
React.createElement("div", { className: "modal-body" }, this.props.children instanceof Function ? (show ? this.props.children(this.lastBindValue) : (renderOnCollapse ? this.props.children(this.lastBindValue) : undefined)) : this.props.children),
|
|
103
|
-
React.createElement("div", { className: "modal-footer" }, footer ? footer : React.createElement(React.Fragment, null,
|
|
104
|
-
footerContent && React.createElement("div", { className: "modal-footer-content" }, footerContent),
|
|
105
|
-
buttons.map(function (buttonProps, index) { return React.createElement(Button, __assign({ key: index }, buttonProps)); }))));
|
|
106
|
-
var container;
|
|
107
|
-
if (suppressForm) {
|
|
108
|
-
container = React.createElement(React.Fragment, null, content);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
container = React.createElement(Neo.Form, __assign({}, formProps, { onSubmit: function (e) { _this.onSubmit && _this.onSubmit(e); } }), content);
|
|
112
|
-
}
|
|
113
|
-
return (this.visible &&
|
|
114
|
-
React.createElement(ModalPortal, { show: show, onDismiss: onClose, options: this.props },
|
|
115
|
-
React.createElement("div", { className: "modal-dialog" + (size ? " modal-" + size : "") + (className ? " " + className : "") },
|
|
116
|
-
React.createElement("div", { className: "modal-content" },
|
|
117
|
-
React.createElement("div", { className: "modal-header" },
|
|
118
|
-
React.createElement("h5", { className: "modal-title" }, this.props.title),
|
|
119
|
-
this.props.showCancelButton !== false &&
|
|
120
|
-
React.createElement("button", { type: "button", className: "close", "aria-label": "Close", onClick: onClose },
|
|
121
|
-
React.createElement("span", { "aria-hidden": "true" }, "\u00D7"))),
|
|
122
|
-
container))));
|
|
123
|
-
};
|
|
124
|
-
Modal = __decorate([
|
|
125
|
-
observer
|
|
126
|
-
], Modal);
|
|
127
|
-
return Modal;
|
|
128
|
-
}(React.Component));
|
|
129
|
-
export default Modal;
|
|
1
|
+
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import ModalPortal from './ModalPortal';
|
|
4
|
+
import { Misc, Utils } from '@singularsystems/neo-core';
|
|
5
|
+
import Button from '../Button';
|
|
6
|
+
import { Settings } from '@singularsystems/neo-core/dist/Settings';
|
|
7
|
+
import { Neo } from '../..';
|
|
8
|
+
import { observer } from 'mobx-react';
|
|
9
|
+
var Modal = /** @class */ (function (_super) {
|
|
10
|
+
__extends(Modal, _super);
|
|
11
|
+
function Modal() {
|
|
12
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
+
_this.visible = false;
|
|
14
|
+
_this.hasUnmounted = false;
|
|
15
|
+
return _this;
|
|
16
|
+
}
|
|
17
|
+
Modal.prototype.componentWillUnmount = function () {
|
|
18
|
+
this.hasUnmounted = true;
|
|
19
|
+
};
|
|
20
|
+
Modal.prototype.render = function () {
|
|
21
|
+
var _this = this;
|
|
22
|
+
var _a = this.props, closeButton = _a.closeButton, acceptButton = _a.acceptButton, buttons = _a.buttons, showCancelButton = _a.showCancelButton, title = _a.title, size = _a.size, formProps = _a.formProps, suppressForm = _a.suppressForm, className = _a.className, footer = _a.footer, footerContent = _a.footerContent, other = __rest(_a, ["closeButton", "acceptButton", "buttons", "showCancelButton", "title", "size", "formProps", "suppressForm", "className", "footer", "footerContent"]);
|
|
23
|
+
var renderOnCollapse = false;
|
|
24
|
+
var onClose;
|
|
25
|
+
var show;
|
|
26
|
+
var propertyInstance = this.props.bind;
|
|
27
|
+
if (!propertyInstance) {
|
|
28
|
+
propertyInstance = this.props.bindModel;
|
|
29
|
+
if (propertyInstance) {
|
|
30
|
+
renderOnCollapse = true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (propertyInstance) {
|
|
34
|
+
if (propertyInstance.value) {
|
|
35
|
+
this.lastBindValue = propertyInstance.value;
|
|
36
|
+
}
|
|
37
|
+
if (typeof propertyInstance.value === "object") {
|
|
38
|
+
formProps = formProps !== null && formProps !== void 0 ? formProps : {};
|
|
39
|
+
if (!formProps.model) {
|
|
40
|
+
formProps.model = propertyInstance.value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
show = !!propertyInstance.value;
|
|
44
|
+
onClose = function (event) {
|
|
45
|
+
if (propertyInstance.value === true) {
|
|
46
|
+
propertyInstance.value = false;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
propertyInstance.value = null;
|
|
50
|
+
}
|
|
51
|
+
if (_this.props.onClose) {
|
|
52
|
+
_this.props.onClose(event);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
var manualProps = this.props;
|
|
58
|
+
show = manualProps.show;
|
|
59
|
+
onClose = manualProps.onClose;
|
|
60
|
+
}
|
|
61
|
+
if (show) {
|
|
62
|
+
this.visible = true;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if (this.visible) {
|
|
66
|
+
// Fade out
|
|
67
|
+
if (!this.closeTimer) {
|
|
68
|
+
this.closeTimer = setTimeout(function () {
|
|
69
|
+
if (!_this.hasUnmounted) {
|
|
70
|
+
_this.visible = false;
|
|
71
|
+
_this.forceUpdate();
|
|
72
|
+
}
|
|
73
|
+
_this.closeTimer = null;
|
|
74
|
+
}, Misc.Settings.modalAnimationTimeMs);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!buttons) {
|
|
79
|
+
buttons = [];
|
|
80
|
+
if (acceptButton) {
|
|
81
|
+
acceptButton = Utils.populatePartialWithDefaults(acceptButton, __assign({}, Settings.modal.acceptButton));
|
|
82
|
+
buttons.push(acceptButton);
|
|
83
|
+
if (!suppressForm) {
|
|
84
|
+
if (!this.onSubmit) {
|
|
85
|
+
this.onSubmit = acceptButton.onClick || onClose;
|
|
86
|
+
}
|
|
87
|
+
acceptButton.onClick = undefined;
|
|
88
|
+
acceptButton.isSubmit = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
suppressForm = true;
|
|
93
|
+
}
|
|
94
|
+
if (closeButton === undefined) {
|
|
95
|
+
closeButton = {};
|
|
96
|
+
}
|
|
97
|
+
if (closeButton) {
|
|
98
|
+
buttons.push(Utils.populatePartialWithDefaults(closeButton, __assign(__assign({}, Settings.modal.closeButton), { onClick: onClose })));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
var content = this.visible && React.createElement(React.Fragment, null,
|
|
102
|
+
React.createElement("div", { className: "modal-body" }, this.props.children instanceof Function ? (show ? this.props.children(this.lastBindValue) : (renderOnCollapse ? this.props.children(this.lastBindValue) : undefined)) : this.props.children),
|
|
103
|
+
React.createElement("div", { className: "modal-footer" }, footer ? footer : React.createElement(React.Fragment, null,
|
|
104
|
+
footerContent && React.createElement("div", { className: "modal-footer-content" }, footerContent),
|
|
105
|
+
buttons.map(function (buttonProps, index) { return React.createElement(Button, __assign({ key: index }, buttonProps)); }))));
|
|
106
|
+
var container;
|
|
107
|
+
if (suppressForm) {
|
|
108
|
+
container = React.createElement(React.Fragment, null, content);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
container = React.createElement(Neo.Form, __assign({}, formProps, { onSubmit: function (e) { _this.onSubmit && _this.onSubmit(e); } }), content);
|
|
112
|
+
}
|
|
113
|
+
return (this.visible &&
|
|
114
|
+
React.createElement(ModalPortal, { show: show, onDismiss: onClose, options: this.props },
|
|
115
|
+
React.createElement("div", { className: "modal-dialog" + (size ? " modal-" + size : "") + (className ? " " + className : "") },
|
|
116
|
+
React.createElement("div", { className: "modal-content" },
|
|
117
|
+
React.createElement("div", { className: "modal-header" },
|
|
118
|
+
React.createElement("h5", { className: "modal-title" }, this.props.title),
|
|
119
|
+
this.props.showCancelButton !== false &&
|
|
120
|
+
React.createElement("button", { type: "button", className: "close", "aria-label": "Close", onClick: onClose },
|
|
121
|
+
React.createElement("span", { "aria-hidden": "true" }, "\u00D7"))),
|
|
122
|
+
container))));
|
|
123
|
+
};
|
|
124
|
+
Modal = __decorate([
|
|
125
|
+
observer
|
|
126
|
+
], Modal);
|
|
127
|
+
return Modal;
|
|
128
|
+
}(React.Component));
|
|
129
|
+
export default Modal;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IModalContainerOptions } from '@singularsystems/neo-core/dist/Components/Modal/ModalHelper';
|
|
3
|
-
interface IModalContainerProps extends IModalContainerOptions {
|
|
4
|
-
/**
|
|
5
|
-
* By default, the modal container will be added at the root level of the document.
|
|
6
|
-
* This prop will make it render in the current position of the ModalContainer component.
|
|
7
|
-
*/
|
|
8
|
-
renderInPlace?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export default class ModalContainer extends React.Component<IModalContainerProps> {
|
|
11
|
-
private modalStore;
|
|
12
|
-
private containerRef;
|
|
13
|
-
componentDidMount(): void;
|
|
14
|
-
componentDidUpdate(): void;
|
|
15
|
-
render(): JSX.Element | (0 | JSX.Element)[];
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IModalContainerOptions } from '@singularsystems/neo-core/dist/Components/Modal/ModalHelper';
|
|
3
|
+
interface IModalContainerProps extends IModalContainerOptions {
|
|
4
|
+
/**
|
|
5
|
+
* By default, the modal container will be added at the root level of the document.
|
|
6
|
+
* This prop will make it render in the current position of the ModalContainer component.
|
|
7
|
+
*/
|
|
8
|
+
renderInPlace?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export default class ModalContainer extends React.Component<IModalContainerProps> {
|
|
11
|
+
private modalStore;
|
|
12
|
+
private containerRef;
|
|
13
|
+
componentDidMount(): void;
|
|
14
|
+
componentDidUpdate(): void;
|
|
15
|
+
render(): JSX.Element | (0 | JSX.Element)[];
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { AppServices, Misc } from '@singularsystems/neo-core';
|
|
4
|
-
import Modal from './Modal';
|
|
5
|
-
import { observer } from 'mobx-react';
|
|
6
|
-
import ModalHelper from '@singularsystems/neo-core/dist/Components/Modal/ModalHelper';
|
|
7
|
-
var ModalContainer = /** @class */ (function (_super) {
|
|
8
|
-
__extends(ModalContainer, _super);
|
|
9
|
-
function ModalContainer() {
|
|
10
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
11
|
-
_this.modalStore = Misc.Globals.appService.get(AppServices.NeoTypes.UI.ModalStore);
|
|
12
|
-
_this.containerRef = React.createRef();
|
|
13
|
-
return _this;
|
|
14
|
-
}
|
|
15
|
-
ModalContainer.prototype.componentDidMount = function () {
|
|
16
|
-
var _a;
|
|
17
|
-
ModalHelper.initialise(this.props, (_a = this.containerRef.current) !== null && _a !== void 0 ? _a : undefined);
|
|
18
|
-
};
|
|
19
|
-
ModalContainer.prototype.componentDidUpdate = function () {
|
|
20
|
-
ModalHelper.appInstance.updateProps(this.props);
|
|
21
|
-
};
|
|
22
|
-
ModalContainer.prototype.render = function () {
|
|
23
|
-
var modalList = this.modalStore.modals.map(function (modal) { return (modal.refreshValue &&
|
|
24
|
-
React.createElement(Modal, __assign({ key: modal.id }, modal.options), modal.content)); });
|
|
25
|
-
if (this.props.renderInPlace) {
|
|
26
|
-
return React.createElement("div", { ref: this.containerRef }, modalList);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return modalList;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
ModalContainer = __decorate([
|
|
33
|
-
observer
|
|
34
|
-
], ModalContainer);
|
|
35
|
-
return ModalContainer;
|
|
36
|
-
}(React.Component));
|
|
37
|
-
export default ModalContainer;
|
|
1
|
+
import { __assign, __decorate, __extends } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AppServices, Misc } from '@singularsystems/neo-core';
|
|
4
|
+
import Modal from './Modal';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
|
+
import ModalHelper from '@singularsystems/neo-core/dist/Components/Modal/ModalHelper';
|
|
7
|
+
var ModalContainer = /** @class */ (function (_super) {
|
|
8
|
+
__extends(ModalContainer, _super);
|
|
9
|
+
function ModalContainer() {
|
|
10
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
11
|
+
_this.modalStore = Misc.Globals.appService.get(AppServices.NeoTypes.UI.ModalStore);
|
|
12
|
+
_this.containerRef = React.createRef();
|
|
13
|
+
return _this;
|
|
14
|
+
}
|
|
15
|
+
ModalContainer.prototype.componentDidMount = function () {
|
|
16
|
+
var _a;
|
|
17
|
+
ModalHelper.initialise(this.props, (_a = this.containerRef.current) !== null && _a !== void 0 ? _a : undefined);
|
|
18
|
+
};
|
|
19
|
+
ModalContainer.prototype.componentDidUpdate = function () {
|
|
20
|
+
ModalHelper.appInstance.updateProps(this.props);
|
|
21
|
+
};
|
|
22
|
+
ModalContainer.prototype.render = function () {
|
|
23
|
+
var modalList = this.modalStore.modals.map(function (modal) { return (modal.refreshValue &&
|
|
24
|
+
React.createElement(Modal, __assign({ key: modal.id }, modal.options), modal.content)); });
|
|
25
|
+
if (this.props.renderInPlace) {
|
|
26
|
+
return React.createElement("div", { ref: this.containerRef }, modalList);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return modalList;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
ModalContainer = __decorate([
|
|
33
|
+
observer
|
|
34
|
+
], ModalContainer);
|
|
35
|
+
return ModalContainer;
|
|
36
|
+
}(React.Component));
|
|
37
|
+
export default ModalContainer;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IModalOptionsBase } from '@singularsystems/neo-core/dist/Components/Modal/ModalOptions';
|
|
3
|
-
export interface IModalPortalProps {
|
|
4
|
-
show: boolean;
|
|
5
|
-
onDismiss: (e: any) => void;
|
|
6
|
-
options: IModalOptionsBase;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IModalOptionsBase } from '@singularsystems/neo-core/dist/Components/Modal/ModalOptions';
|
|
3
|
+
export interface IModalPortalProps {
|
|
4
|
+
show: boolean;
|
|
5
|
+
onDismiss: (e: any) => void;
|
|
6
|
+
options: IModalOptionsBase;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export default class ModalPortal extends React.Component<IModalPortalProps> {
|
|
10
|
+
private modalContainer;
|
|
11
|
+
private modalInstance;
|
|
12
|
+
constructor(props: IModalPortalProps);
|
|
13
|
+
componentDidMount(): void;
|
|
14
|
+
componentWillUnmount(): void;
|
|
15
|
+
render(): import("react").ReactPortal;
|
|
16
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import ModalHelper from '@singularsystems/neo-core/dist/Components/Modal/ModalHelper';
|
|
5
|
-
var ModalPortal = /** @class */ (function (_super) {
|
|
6
|
-
__extends(ModalPortal, _super);
|
|
7
|
-
function ModalPortal(props) {
|
|
8
|
-
var _this = _super.call(this, props) || this;
|
|
9
|
-
_this.modalContainer = document.createElement("div");
|
|
10
|
-
return _this;
|
|
11
|
-
}
|
|
12
|
-
ModalPortal.prototype.componentDidMount = function () {
|
|
13
|
-
var options = this.props.options;
|
|
14
|
-
this.modalInstance = ModalHelper.appInstance.addModal(this.modalContainer, options, options.showCancelButton !== false ? this.props.onDismiss : undefined);
|
|
15
|
-
};
|
|
16
|
-
ModalPortal.prototype.componentWillUnmount = function () {
|
|
17
|
-
ModalHelper.appInstance.endRemove(this.modalInstance);
|
|
18
|
-
};
|
|
19
|
-
ModalPortal.prototype.render = function () {
|
|
20
|
-
if (!this.props.show && !this.modalInstance.isRemoving) {
|
|
21
|
-
ModalHelper.appInstance.beginRemove(this.modalInstance);
|
|
22
|
-
}
|
|
23
|
-
return createPortal(this.props.children, this.modalContainer);
|
|
24
|
-
};
|
|
25
|
-
return ModalPortal;
|
|
26
|
-
}(React.Component));
|
|
27
|
-
export default ModalPortal;
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import ModalHelper from '@singularsystems/neo-core/dist/Components/Modal/ModalHelper';
|
|
5
|
+
var ModalPortal = /** @class */ (function (_super) {
|
|
6
|
+
__extends(ModalPortal, _super);
|
|
7
|
+
function ModalPortal(props) {
|
|
8
|
+
var _this = _super.call(this, props) || this;
|
|
9
|
+
_this.modalContainer = document.createElement("div");
|
|
10
|
+
return _this;
|
|
11
|
+
}
|
|
12
|
+
ModalPortal.prototype.componentDidMount = function () {
|
|
13
|
+
var options = this.props.options;
|
|
14
|
+
this.modalInstance = ModalHelper.appInstance.addModal(this.modalContainer, options, options.showCancelButton !== false ? this.props.onDismiss : undefined);
|
|
15
|
+
};
|
|
16
|
+
ModalPortal.prototype.componentWillUnmount = function () {
|
|
17
|
+
ModalHelper.appInstance.endRemove(this.modalInstance);
|
|
18
|
+
};
|
|
19
|
+
ModalPortal.prototype.render = function () {
|
|
20
|
+
if (!this.props.show && !this.modalInstance.isRemoving) {
|
|
21
|
+
ModalHelper.appInstance.beginRemove(this.modalInstance);
|
|
22
|
+
}
|
|
23
|
+
return createPortal(this.props.children, this.modalContainer);
|
|
24
|
+
};
|
|
25
|
+
return ModalPortal;
|
|
26
|
+
}(React.Component));
|
|
27
|
+
export default ModalPortal;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Components } from "@singularsystems/neo-core";
|
|
3
|
-
import CollapsableBase from '../CollapsableBase';
|
|
4
|
-
export default class Alert extends CollapsableBase<Components.INotificationOptions & React.HTMLProps<HTMLDivElement>> {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Components } from "@singularsystems/neo-core";
|
|
3
|
+
import CollapsableBase from '../CollapsableBase';
|
|
4
|
+
export default class Alert extends CollapsableBase<Components.INotificationOptions & React.HTMLProps<HTMLDivElement>> {
|
|
5
|
+
private iconFactory;
|
|
6
|
+
render(): JSX.Element;
|
|
7
|
+
}
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Utils } from "@singularsystems/neo-core";
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import CollapsableBase from '../CollapsableBase';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Misc, Utils } from "@singularsystems/neo-core";
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import CollapsableBase from '../CollapsableBase';
|
|
6
|
+
import { NeoReactTypes } from "../../Modules/Types";
|
|
7
|
+
var Alert = /** @class */ (function (_super) {
|
|
8
|
+
__extends(Alert, _super);
|
|
9
|
+
function Alert() {
|
|
10
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
11
|
+
_this.iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
|
|
12
|
+
return _this;
|
|
13
|
+
}
|
|
14
|
+
Alert.prototype.render = function () {
|
|
15
|
+
var _a = this.props, variant = _a.variant, heading = _a.heading, show = _a.show, bindShow = _a.bindShow, autoCloseTimeout = _a.autoCloseTimeout, animateInitial = _a.animateInitial, state = _a.state, onHidden = _a.onHidden, refreshValue = _a.refreshValue, icon = _a.icon, native = __rest(_a, ["variant", "heading", "show", "bindShow", "autoCloseTimeout", "animateInitial", "state", "onHidden", "refreshValue", "icon"]);
|
|
16
|
+
var className = Utils.joinWithSpaces(native.className, "alert", "alert-" + variant, "collapsable");
|
|
17
|
+
if (bindShow) {
|
|
18
|
+
className += " alert-dismissible";
|
|
19
|
+
}
|
|
20
|
+
this.shouldShow = show !== false && (!bindShow || bindShow.value);
|
|
21
|
+
return (React.createElement("div", __assign({}, native, { className: className, ref: this.containerRef }),
|
|
22
|
+
heading &&
|
|
23
|
+
React.createElement("h6", null, heading),
|
|
24
|
+
icon &&
|
|
25
|
+
React.createElement("div", { className: "notification-icon-container" },
|
|
26
|
+
this.iconFactory.getIconComponent(icon),
|
|
27
|
+
React.createElement("div", null, this.props.children)),
|
|
28
|
+
!icon && this.props.children,
|
|
29
|
+
bindShow &&
|
|
30
|
+
React.createElement("button", { type: "button", className: "close", onClick: this.onClose },
|
|
31
|
+
React.createElement("span", null, "\u00D7"))));
|
|
32
|
+
};
|
|
33
|
+
Alert = __decorate([
|
|
34
|
+
observer
|
|
35
|
+
], Alert);
|
|
36
|
+
return Alert;
|
|
37
|
+
}(CollapsableBase));
|
|
38
|
+
export default Alert;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import CollapsableBase from '../CollapsableBase';
|
|
3
|
-
import { Components } from '@singularsystems/neo-core';
|
|
4
|
-
export default class Toast extends CollapsableBase<Components.INotificationOptions & React.HTMLProps<HTMLDivElement>> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CollapsableBase from '../CollapsableBase';
|
|
3
|
+
import { Components } from '@singularsystems/neo-core';
|
|
4
|
+
export default class Toast extends CollapsableBase<Components.INotificationOptions & React.HTMLProps<HTMLDivElement>> {
|
|
5
|
+
private iconFactory;
|
|
6
|
+
countDownRef: React.RefObject<HTMLDivElement>;
|
|
7
|
+
afterRender(isInitial: boolean): void;
|
|
8
|
+
render(): JSX.Element;
|
|
9
|
+
}
|