@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.
Files changed (196) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +4 -0
  3. package/dist/Modules/NeoReactModule.d.ts +4 -4
  4. package/dist/Modules/NeoReactModule.js +28 -26
  5. package/dist/Modules/ReactSetup.d.ts +2 -2
  6. package/dist/Modules/ReactSetup.js +17 -17
  7. package/dist/Modules/Types.d.ts +63 -61
  8. package/dist/Modules/Types.js +13 -12
  9. package/dist/React/AutoRunner.d.ts +5 -5
  10. package/dist/React/AutoRunner.js +94 -92
  11. package/dist/React/DataView.d.ts +6 -6
  12. package/dist/React/DataView.js +11 -11
  13. package/dist/React/ReactModelCreator.d.ts +11 -11
  14. package/dist/React/ReactModelCreator.js +165 -162
  15. package/dist/ReactComponents/Button.d.ts +24 -23
  16. package/dist/ReactComponents/Button.js +131 -123
  17. package/dist/ReactComponents/Card.d.ts +24 -23
  18. package/dist/ReactComponents/Card.js +56 -54
  19. package/dist/ReactComponents/Collapsable.d.ts +23 -23
  20. package/dist/ReactComponents/Collapsable.js +38 -38
  21. package/dist/ReactComponents/CollapsableBase.d.ts +13 -13
  22. package/dist/ReactComponents/CollapsableBase.js +42 -42
  23. package/dist/ReactComponents/ColorPicker.d.ts +26 -26
  24. package/dist/ReactComponents/ColorPicker.js +67 -67
  25. package/dist/ReactComponents/ComponentBase.d.ts +17 -17
  26. package/dist/ReactComponents/ComponentBase.js +33 -33
  27. package/dist/ReactComponents/ContextMenu/ContextMenu.d.ts +25 -24
  28. package/dist/ReactComponents/ContextMenu/ContextMenu.js +91 -88
  29. package/dist/ReactComponents/ContextMenu/ContextMenuContainer.d.ts +14 -14
  30. package/dist/ReactComponents/ContextMenu/ContextMenuContainer.js +48 -48
  31. package/dist/ReactComponents/ContextMenu/ContextMenuState.d.ts +8 -7
  32. package/dist/ReactComponents/ContextMenu/ContextMenuState.js +23 -23
  33. package/dist/ReactComponents/DatePicker.d.ts +19 -19
  34. package/dist/ReactComponents/DatePicker.js +53 -53
  35. package/dist/ReactComponents/DropDown/AutoCompleteDropDown.d.ts +93 -83
  36. package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js +222 -188
  37. package/dist/ReactComponents/DropDown/DropDown.d.ts +44 -44
  38. package/dist/ReactComponents/DropDown/DropDown.js +138 -134
  39. package/dist/ReactComponents/DropDown/DropDownBase.d.ts +16 -15
  40. package/dist/ReactComponents/DropDown/DropDownBase.js +86 -108
  41. package/dist/ReactComponents/DropDown/LookupHelper.d.ts +13 -0
  42. package/dist/ReactComponents/DropDown/LookupHelper.js +45 -0
  43. package/dist/ReactComponents/ErrorHandler.d.ts +9 -8
  44. package/dist/ReactComponents/ErrorHandler.js +92 -91
  45. package/dist/ReactComponents/FileManager/FileBasicInput.d.ts +20 -20
  46. package/dist/ReactComponents/FileManager/FileBasicInput.js +70 -70
  47. package/dist/ReactComponents/FileManager/FileContext.d.ts +16 -16
  48. package/dist/ReactComponents/FileManager/FileContext.js +24 -24
  49. package/dist/ReactComponents/FileManager/FileDropArea.d.ts +19 -18
  50. package/dist/ReactComponents/FileManager/FileDropArea.js +66 -64
  51. package/dist/ReactComponents/FileManager/FileInput.d.ts +44 -42
  52. package/dist/ReactComponents/FileManager/FileInput.js +191 -189
  53. package/dist/ReactComponents/FileManager/FileUploadButton.d.ts +17 -17
  54. package/dist/ReactComponents/FileManager/FileUploadButton.js +49 -49
  55. package/dist/ReactComponents/FileManager/FileUploadProgress.d.ts +14 -14
  56. package/dist/ReactComponents/FileManager/FileUploadProgress.js +35 -35
  57. package/dist/ReactComponents/Form.d.ts +19 -18
  58. package/dist/ReactComponents/Form.js +90 -90
  59. package/dist/ReactComponents/FormContext.d.ts +33 -31
  60. package/dist/ReactComponents/FormContext.js +39 -40
  61. package/dist/ReactComponents/FormGroup/FormGroup.d.ts +37 -37
  62. package/dist/ReactComponents/FormGroup/FormGroup.js +83 -84
  63. package/dist/ReactComponents/FormGroup/FormGroupFloating.d.ts +19 -19
  64. package/dist/ReactComponents/FormGroup/FormGroupFloating.js +97 -97
  65. package/dist/ReactComponents/FormGroup/FormGroupInline.d.ts +11 -11
  66. package/dist/ReactComponents/FormGroup/FormGroupInline.js +43 -43
  67. package/dist/ReactComponents/Grid/ButtonColumn.d.ts +47 -47
  68. package/dist/ReactComponents/Grid/ButtonColumn.js +81 -82
  69. package/dist/ReactComponents/Grid/Column.d.ts +47 -47
  70. package/dist/ReactComponents/Grid/Column.js +205 -205
  71. package/dist/ReactComponents/Grid/ColumnHelper.d.ts +12 -12
  72. package/dist/ReactComponents/Grid/ColumnHelper.js +19 -19
  73. package/dist/ReactComponents/Grid/Grid.d.ts +87 -90
  74. package/dist/ReactComponents/Grid/Grid.js +203 -203
  75. package/dist/ReactComponents/Grid/Row.d.ts +81 -81
  76. package/dist/ReactComponents/Grid/Row.js +200 -201
  77. package/dist/ReactComponents/Grid/_Exports.d.ts +5 -5
  78. package/dist/ReactComponents/Grid/_Exports.js +5 -5
  79. package/dist/ReactComponents/GridLayout.d.ts +20 -20
  80. package/dist/ReactComponents/GridLayout.js +38 -38
  81. package/dist/ReactComponents/Icons/FontAwesomeIconFactory.d.ts +23 -0
  82. package/dist/ReactComponents/Icons/FontAwesomeIconFactory.js +43 -0
  83. package/dist/ReactComponents/Icons/IIconFactory.d.ts +21 -0
  84. package/dist/ReactComponents/Icons/IIconFactory.js +1 -0
  85. package/dist/ReactComponents/Icons/IconFactory.d.ts +9 -0
  86. package/dist/ReactComponents/Icons/IconFactory.js +45 -0
  87. package/dist/ReactComponents/Icons/index.d.ts +3 -0
  88. package/dist/ReactComponents/Icons/index.js +2 -0
  89. package/dist/ReactComponents/Input.d.ts +45 -45
  90. package/dist/ReactComponents/Input.js +153 -152
  91. package/dist/ReactComponents/InputHelpers.d.ts +6 -5
  92. package/dist/ReactComponents/InputHelpers.js +29 -33
  93. package/dist/ReactComponents/Link.d.ts +13 -13
  94. package/dist/ReactComponents/Link.js +28 -28
  95. package/dist/ReactComponents/Loader.d.ts +18 -18
  96. package/dist/ReactComponents/Loader.js +57 -57
  97. package/dist/ReactComponents/Misc.d.ts +15 -15
  98. package/dist/ReactComponents/Misc.js +28 -28
  99. package/dist/ReactComponents/Modal/Modal.d.ts +11 -11
  100. package/dist/ReactComponents/Modal/Modal.js +129 -129
  101. package/dist/ReactComponents/Modal/ModalContainer.d.ts +17 -17
  102. package/dist/ReactComponents/Modal/ModalContainer.js +37 -37
  103. package/dist/ReactComponents/Modal/ModalPortal.d.ts +16 -15
  104. package/dist/ReactComponents/Modal/ModalPortal.js +27 -27
  105. package/dist/ReactComponents/Notifications/Alert.d.ts +7 -6
  106. package/dist/ReactComponents/Notifications/Alert.js +38 -35
  107. package/dist/ReactComponents/Notifications/Toast.d.ts +9 -8
  108. package/dist/ReactComponents/Notifications/Toast.js +47 -45
  109. package/dist/ReactComponents/Notifications/ToastContainer.d.ts +8 -8
  110. package/dist/ReactComponents/Notifications/ToastContainer.js +18 -18
  111. package/dist/ReactComponents/NumberInput.d.ts +57 -50
  112. package/dist/ReactComponents/NumberInput.js +260 -246
  113. package/dist/ReactComponents/Paging/BasicPagerControls.d.ts +26 -25
  114. package/dist/ReactComponents/Paging/BasicPagerControls.js +57 -55
  115. package/dist/ReactComponents/Paging/PageSizeControl.d.ts +11 -11
  116. package/dist/ReactComponents/Paging/PageSizeControl.js +21 -21
  117. package/dist/ReactComponents/Paging/Pager.d.ts +24 -24
  118. package/dist/ReactComponents/Paging/Pager.js +41 -41
  119. package/dist/ReactComponents/ProgressBar.d.ts +19 -19
  120. package/dist/ReactComponents/ProgressBar.js +52 -52
  121. package/dist/ReactComponents/PropTypes.d.ts +161 -161
  122. package/dist/ReactComponents/PropTypes.js +253 -236
  123. package/dist/ReactComponents/RadioList.d.ts +29 -29
  124. package/dist/ReactComponents/RadioList.js +59 -77
  125. package/dist/ReactComponents/Slider.d.ts +28 -28
  126. package/dist/ReactComponents/Slider.js +76 -76
  127. package/dist/ReactComponents/StateObserver.d.ts +15 -15
  128. package/dist/ReactComponents/StateObserver.js +35 -35
  129. package/dist/ReactComponents/Tabs/Tab.d.ts +42 -41
  130. package/dist/ReactComponents/Tabs/Tab.js +71 -72
  131. package/dist/ReactComponents/Tabs/TabContainer.d.ts +44 -44
  132. package/dist/ReactComponents/Tabs/TabContainer.js +98 -98
  133. package/dist/ReactComponents/Tabs/TabManager.d.ts +62 -62
  134. package/dist/ReactComponents/Tabs/TabManager.js +154 -154
  135. package/dist/ReactComponents/Tooltip.d.ts +20 -19
  136. package/dist/ReactComponents/Tooltip.js +51 -51
  137. package/dist/ReactComponents/TooltipHelper.d.ts +8 -8
  138. package/dist/ReactComponents/TooltipHelper.js +84 -84
  139. package/dist/ReactComponents/TooltipProvider.d.ts +30 -30
  140. package/dist/ReactComponents/TooltipProvider.js +111 -111
  141. package/dist/ReactComponents/ValidationSummary.d.ts +23 -22
  142. package/dist/ReactComponents/ValidationSummary.js +46 -43
  143. package/dist/ReactComponents/_Exports.d.ts +41 -41
  144. package/dist/ReactComponents/_Exports.js +41 -41
  145. package/dist/ReactComponents/_Managers.d.ts +4 -4
  146. package/dist/ReactComponents/_Managers.js +4 -4
  147. package/dist/Routing/BreadCrumbItem.d.ts +14 -14
  148. package/dist/Routing/BreadCrumbItem.js +12 -12
  149. package/dist/Routing/IRouteChangedProps.d.ts +31 -31
  150. package/dist/Routing/IRouteChangedProps.js +1 -1
  151. package/dist/Routing/IRouteParameter.d.ts +22 -22
  152. package/dist/Routing/IRouteParameter.js +9 -9
  153. package/dist/Routing/MenuRoute.d.ts +25 -24
  154. package/dist/Routing/MenuRoute.js +24 -24
  155. package/dist/Routing/NavigationHelper.d.ts +41 -40
  156. package/dist/Routing/NavigationHelper.js +61 -61
  157. package/dist/Routing/PageLeaveHandler.d.ts +13 -13
  158. package/dist/Routing/PageLeaveHandler.js +74 -74
  159. package/dist/Routing/RouteProvider.d.ts +31 -31
  160. package/dist/Routing/RouteProvider.js +92 -92
  161. package/dist/Routing/RouteView.d.ts +50 -50
  162. package/dist/Routing/RouteView.js +143 -144
  163. package/dist/Routing/RoutingState.d.ts +18 -15
  164. package/dist/Routing/RoutingState.js +45 -40
  165. package/dist/Routing/ViewParameter.d.ts +80 -58
  166. package/dist/Routing/ViewParameter.js +116 -95
  167. package/dist/Routing/ViewParameterList.d.ts +53 -53
  168. package/dist/Routing/ViewParameterList.js +163 -145
  169. package/dist/Routing/index.d.ts +9 -9
  170. package/dist/Routing/index.js +6 -6
  171. package/dist/Services/DisposeHelper.d.ts +15 -15
  172. package/dist/Services/DisposeHelper.js +40 -41
  173. package/dist/Services/IDisposeHelper.d.ts +12 -12
  174. package/dist/Services/IDisposeHelper.js +1 -1
  175. package/dist/Views/EmptyViewModel.d.ts +5 -5
  176. package/dist/Views/EmptyViewModel.js +14 -14
  177. package/dist/Views/IViewModel.d.ts +16 -16
  178. package/dist/Views/IViewModel.js +1 -1
  179. package/dist/Views/PersistentViewBase.d.ts +10 -10
  180. package/dist/Views/PersistentViewBase.js +21 -21
  181. package/dist/Views/ViewBase.d.ts +70 -71
  182. package/dist/Views/ViewBase.js +166 -153
  183. package/dist/Views/ViewComponentBase.d.ts +19 -13
  184. package/dist/Views/ViewComponentBase.js +24 -21
  185. package/dist/Views/ViewModelBase.d.ts +57 -56
  186. package/dist/Views/ViewModelBase.js +122 -118
  187. package/dist/Views/ViewState.d.ts +13 -13
  188. package/dist/Views/ViewState.js +9 -9
  189. package/dist/Views/index.d.ts +5 -5
  190. package/dist/Views/index.js +5 -5
  191. package/dist/index.d.ts +11 -10
  192. package/dist/index.js +10 -9
  193. package/package.json +26 -26
  194. package/styles/DatePicker.scss +2 -2
  195. package/styles/Forms.scss +5 -0
  196. 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
- export default class ModalPortal extends React.Component<IModalPortalProps> {
9
- private modalContainer;
10
- private modalInstance;
11
- constructor(props: IModalPortalProps);
12
- componentDidMount(): void;
13
- componentWillUnmount(): void;
14
- render(): React.ReactPortal;
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
- render(): JSX.Element;
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
- var Alert = /** @class */ (function (_super) {
7
- __extends(Alert, _super);
8
- function Alert() {
9
- return _super !== null && _super.apply(this, arguments) || this;
10
- }
11
- Alert.prototype.render = function () {
12
- 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"]);
13
- var className = Utils.joinWithSpaces(native.className, "alert", "alert-" + variant, "collapsable");
14
- if (bindShow) {
15
- className += " alert-dismissible";
16
- }
17
- this.shouldShow = show !== false && (!bindShow || bindShow.value);
18
- return (React.createElement("div", __assign({}, native, { className: className, ref: this.containerRef }),
19
- heading &&
20
- React.createElement("h6", null, heading),
21
- icon &&
22
- React.createElement("div", { className: "notification-icon-container" },
23
- React.createElement("i", { className: Utils.getFontAwesomeClass(icon) }),
24
- React.createElement("div", null, this.props.children)),
25
- !icon && this.props.children,
26
- bindShow &&
27
- React.createElement("button", { type: "button", className: "close", onClick: this.onClose },
28
- React.createElement("span", null, "\u00D7"))));
29
- };
30
- Alert = __decorate([
31
- observer
32
- ], Alert);
33
- return Alert;
34
- }(CollapsableBase));
35
- export default Alert;
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
- countDownRef: React.RefObject<HTMLDivElement>;
6
- afterRender(isInitial: boolean): void;
7
- render(): JSX.Element;
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
+ }