@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,123 +1,131 @@
|
|
|
1
|
-
import { __decorate, __extends, __metadata, __rest, __spreadArray } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import ComponentBase from './ComponentBase';
|
|
4
|
-
import { Components, Utils } from '@singularsystems/neo-core';
|
|
5
|
-
import Tooltip from './Tooltip';
|
|
6
|
-
import { observer } from 'mobx-react';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_this
|
|
12
|
-
_this.
|
|
13
|
-
_this.
|
|
14
|
-
_this.
|
|
15
|
-
_this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
variant = variant
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
buttonClasses += "
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
1
|
+
import { __decorate, __extends, __metadata, __rest, __spreadArray } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import ComponentBase from './ComponentBase';
|
|
4
|
+
import { Components, Misc, Utils } from '@singularsystems/neo-core';
|
|
5
|
+
import Tooltip from './Tooltip';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
7
|
+
import { NeoReactTypes } from '../Modules/Types';
|
|
8
|
+
var Button = /** @class */ (function (_super) {
|
|
9
|
+
__extends(Button, _super);
|
|
10
|
+
function Button(props) {
|
|
11
|
+
var _this = _super.call(this, props) || this;
|
|
12
|
+
_this.state = { isExpanded: false };
|
|
13
|
+
_this.btnGroupDom = React.createRef();
|
|
14
|
+
_this.menuDom = React.createRef();
|
|
15
|
+
_this.iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
|
|
16
|
+
_this.windowClickHandler = _this.windowClicked.bind(_this);
|
|
17
|
+
_this.showMenu = _this.showMenu.bind(_this);
|
|
18
|
+
return _this;
|
|
19
|
+
}
|
|
20
|
+
Button.prototype.showMenu = function () {
|
|
21
|
+
var _this = this;
|
|
22
|
+
if (!this.state.isExpanded) {
|
|
23
|
+
this.setState({ isExpanded: true });
|
|
24
|
+
setTimeout(function () { return window.addEventListener("click", _this.windowClickHandler); }, 0);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
Button.prototype.hideMenu = function () {
|
|
28
|
+
if (this.state.isExpanded) {
|
|
29
|
+
this.setState({ isExpanded: false });
|
|
30
|
+
}
|
|
31
|
+
window.removeEventListener("click", this.windowClickHandler);
|
|
32
|
+
};
|
|
33
|
+
Button.prototype.menuItemClicked = function (e, data, userEvent) {
|
|
34
|
+
this.hideMenu();
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
if (userEvent) {
|
|
37
|
+
userEvent(e, data);
|
|
38
|
+
}
|
|
39
|
+
else if (this.props.onClick && data !== undefined) {
|
|
40
|
+
this.props.onClick(e, data);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
Button.prototype.windowClicked = function (e) {
|
|
44
|
+
this.hideMenu();
|
|
45
|
+
};
|
|
46
|
+
Button.prototype.afterRender = function () {
|
|
47
|
+
if (this.btnGroupDom.current && this.menuDom.current) {
|
|
48
|
+
Components.PositionHelper.checkScreenBounds(this.btnGroupDom.current, this.menuDom.current, undefined, this.props.menuAlignment === "right");
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
Button.prototype.render = function () {
|
|
52
|
+
var _this = this;
|
|
53
|
+
var _a = this.props, isSubmit = _a.isSubmit, variant = _a.variant, size = _a.size, isOutline = _a.isOutline, icon = _a.icon, iconAlignment = _a.iconAlignment, text = _a.text, menuItems = _a.menuItems, splitMenu = _a.splitMenu, menuAlignment = _a.menuAlignment, buttonGroupClassName = _a.buttonGroupClassName, tooltip = _a.tooltip, task = _a.task, isBusy = _a.isBusy, pulse = _a.pulse, native = __rest(_a, ["isSubmit", "variant", "size", "isOutline", "icon", "iconAlignment", "text", "menuItems", "splitMenu", "menuAlignment", "buttonGroupClassName", "tooltip", "task", "isBusy", "pulse"]);
|
|
54
|
+
native.type = isSubmit ? "submit" : "button";
|
|
55
|
+
variant = variant !== null && variant !== void 0 ? variant : "primary";
|
|
56
|
+
var isDropDown = menuItems && menuItems.length;
|
|
57
|
+
var buttonClasses = "btn btn-" + (isOutline ? "outline-" : "") + variant;
|
|
58
|
+
if (size)
|
|
59
|
+
buttonClasses += " btn-" + size;
|
|
60
|
+
if (isDropDown && !splitMenu) {
|
|
61
|
+
buttonClasses += " dropdown-toggle";
|
|
62
|
+
native.onClick = this.showMenu;
|
|
63
|
+
}
|
|
64
|
+
var iconStyle = {};
|
|
65
|
+
if (isBusy !== undefined || task !== undefined) {
|
|
66
|
+
iconStyle = { fixedWidth: true };
|
|
67
|
+
}
|
|
68
|
+
if (isBusy || (task === null || task === void 0 ? void 0 : task.isBusy)) {
|
|
69
|
+
iconStyle.fixedWidth = true;
|
|
70
|
+
iconStyle.spin = true;
|
|
71
|
+
icon = Misc.Settings.icons.loadingIcon;
|
|
72
|
+
native.disabled = true;
|
|
73
|
+
}
|
|
74
|
+
if (pulse) {
|
|
75
|
+
buttonClasses += " ".concat(variant, "-color-pulse");
|
|
76
|
+
}
|
|
77
|
+
native.className = (native.className || "") + " " + buttonClasses;
|
|
78
|
+
// Button text
|
|
79
|
+
var innerText = this.props.children;
|
|
80
|
+
if (!innerText)
|
|
81
|
+
innerText = text;
|
|
82
|
+
var iconSpace = icon && innerText ? " " : "";
|
|
83
|
+
// Icon
|
|
84
|
+
var iconElement = this.iconFactory.getIconComponent(icon, iconStyle);
|
|
85
|
+
// Tooltip
|
|
86
|
+
if (tooltip) {
|
|
87
|
+
Tooltip.setDomProperties(native, tooltip);
|
|
88
|
+
}
|
|
89
|
+
var root;
|
|
90
|
+
// Main button
|
|
91
|
+
var buttonChildren = [];
|
|
92
|
+
if (icon && iconAlignment !== "right")
|
|
93
|
+
buttonChildren.push(iconElement, iconSpace);
|
|
94
|
+
buttonChildren.push(innerText);
|
|
95
|
+
if (isDropDown && !splitMenu) {
|
|
96
|
+
buttonChildren.push(" ");
|
|
97
|
+
}
|
|
98
|
+
if (icon && iconAlignment === "right")
|
|
99
|
+
buttonChildren.push(iconSpace, iconElement);
|
|
100
|
+
var mainButton = React.createElement.apply(React, __spreadArray(["button", native], buttonChildren, false));
|
|
101
|
+
var buttonGroupClasses = "btn-group";
|
|
102
|
+
// add custom css classes to the button group if applicable
|
|
103
|
+
if (buttonGroupClassName) {
|
|
104
|
+
buttonGroupClasses = Utils.joinWithSpaces(buttonGroupClasses, buttonGroupClassName);
|
|
105
|
+
}
|
|
106
|
+
// Button needs a container if this is a drop down button
|
|
107
|
+
if (isDropDown) {
|
|
108
|
+
var menu = React.createElement("div", { className: "dropdown-menu" + (this.state.isExpanded ? " show" : ""), ref: this.menuDom }, menuItems.map(function (item, index) { return (item.header ? React.createElement("h6", { key: index, className: "dropdown-header" }, item.header)
|
|
109
|
+
: item.isDivider ? React.createElement("div", { key: index, className: "dropdown-divider" })
|
|
110
|
+
: React.createElement("div", { key: index, className: "dropdown-item", onClick: function (e) { return _this.menuItemClicked(e, item.data, item.onClick); } },
|
|
111
|
+
_this.iconFactory.getIconComponent(item.icon, { fixedWidth: true }),
|
|
112
|
+
" ",
|
|
113
|
+
item.text)); }));
|
|
114
|
+
root =
|
|
115
|
+
React.createElement("div", { className: buttonGroupClasses, ref: this.btnGroupDom },
|
|
116
|
+
mainButton,
|
|
117
|
+
splitMenu && React.createElement("button", { type: "button", onClick: this.showMenu, className: buttonClasses + " dropdown-toggle dropdown-toggle-split" }),
|
|
118
|
+
menu);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
root = mainButton;
|
|
122
|
+
}
|
|
123
|
+
return root;
|
|
124
|
+
};
|
|
125
|
+
Button = __decorate([
|
|
126
|
+
observer,
|
|
127
|
+
__metadata("design:paramtypes", [Object])
|
|
128
|
+
], Button);
|
|
129
|
+
return Button;
|
|
130
|
+
}(ComponentBase));
|
|
131
|
+
export default Button;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Model } from '@singularsystems/neo-core';
|
|
3
|
-
interface ICardProps {
|
|
4
|
-
/** Icon to show next to title in header. */
|
|
5
|
-
icon?: string;
|
|
6
|
-
/** Title to show in header. */
|
|
7
|
-
title?: any;
|
|
8
|
-
/** Header elements to show on right hand side of header. */
|
|
9
|
-
headerElements?: JSX.Element;
|
|
10
|
-
/** Use a custom scrollbar instead of the browser scrollbar. */
|
|
11
|
-
useCustomScrollbar?: boolean;
|
|
12
|
-
/** Causes the card to be collapsible. Adds a collapse icon to the header. */
|
|
13
|
-
collapsible?: boolean;
|
|
14
|
-
/** Causes the card to be collapsed on first render. Sets the collapsible prop to true. */
|
|
15
|
-
initiallyCollapsed?: boolean;
|
|
16
|
-
/** Allows the collapse state to be set externally. Sets the collapsible prop to true. */
|
|
17
|
-
isExpanded?: Model.IObservableValue<boolean>;
|
|
18
|
-
}
|
|
19
|
-
export default class Card extends React.Component<ICardProps & React.HTMLProps<HTMLDivElement>> {
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Model } from '@singularsystems/neo-core';
|
|
3
|
+
interface ICardProps {
|
|
4
|
+
/** Icon to show next to title in header. */
|
|
5
|
+
icon?: string;
|
|
6
|
+
/** Title to show in header. */
|
|
7
|
+
title?: any;
|
|
8
|
+
/** Header elements to show on right hand side of header. */
|
|
9
|
+
headerElements?: JSX.Element;
|
|
10
|
+
/** Use a custom scrollbar instead of the browser scrollbar. */
|
|
11
|
+
useCustomScrollbar?: boolean;
|
|
12
|
+
/** Causes the card to be collapsible. Adds a collapse icon to the header. */
|
|
13
|
+
collapsible?: boolean;
|
|
14
|
+
/** Causes the card to be collapsed on first render. Sets the collapsible prop to true. */
|
|
15
|
+
initiallyCollapsed?: boolean;
|
|
16
|
+
/** Allows the collapse state to be set externally. Sets the collapsible prop to true. */
|
|
17
|
+
isExpanded?: Model.IObservableValue<boolean>;
|
|
18
|
+
}
|
|
19
|
+
export default class Card extends React.Component<ICardProps & React.HTMLProps<HTMLDivElement>> {
|
|
20
|
+
private iconFactory;
|
|
21
|
+
private expandState;
|
|
22
|
+
render(): JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Model, Utils } from '@singularsystems/neo-core';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import Scrollbar from 'react-custom-scrollbars';
|
|
6
|
-
import Collapsable from './Collapsable';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_this
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Misc, Model, Utils } from '@singularsystems/neo-core';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import Scrollbar from 'react-custom-scrollbars';
|
|
6
|
+
import Collapsable from './Collapsable';
|
|
7
|
+
import { NeoReactTypes } from '../Modules/Types';
|
|
8
|
+
var Card = /** @class */ (function (_super) {
|
|
9
|
+
__extends(Card, _super);
|
|
10
|
+
function Card() {
|
|
11
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
12
|
+
_this.iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
|
|
13
|
+
_this.expandState = new Model.ObservableValue(_this.props.initiallyCollapsed === undefined ? true : !_this.props.initiallyCollapsed);
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
Card.prototype.render = function () {
|
|
17
|
+
var _a = this.props, icon = _a.icon, title = _a.title, children = _a.children, headerElements = _a.headerElements, useCustomScrollbar = _a.useCustomScrollbar, collapsible = _a.collapsible, initiallyCollapsed = _a.initiallyCollapsed, isExpanded = _a.isExpanded, domProps = __rest(_a, ["icon", "title", "children", "headerElements", "useCustomScrollbar", "collapsible", "initiallyCollapsed", "isExpanded"]);
|
|
18
|
+
var className = Utils.joinWithSpaces("neo-card card", domProps.className);
|
|
19
|
+
var isCollapsible = collapsible || isExpanded !== undefined || initiallyCollapsed !== undefined;
|
|
20
|
+
var expandState = isExpanded !== null && isExpanded !== void 0 ? isExpanded : this.expandState;
|
|
21
|
+
if (isCollapsible) {
|
|
22
|
+
var expandIndicator = React.createElement("i", { onClick: function () { return expandState.value = !expandState.value; }, className: "card-expand-indicator fa fa-fw fa-angle-".concat(expandState.value ? "up" : "down") });
|
|
23
|
+
if (headerElements) {
|
|
24
|
+
headerElements = React.createElement(React.Fragment, null,
|
|
25
|
+
headerElements,
|
|
26
|
+
expandIndicator);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
headerElements = expandIndicator;
|
|
30
|
+
}
|
|
31
|
+
if (!expandState.value) {
|
|
32
|
+
className += " collapsed";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
var body = React.createElement("div", { className: "card-body" },
|
|
36
|
+
useCustomScrollbar && React.createElement(Scrollbar, null, children),
|
|
37
|
+
!useCustomScrollbar && children);
|
|
38
|
+
if (isCollapsible) {
|
|
39
|
+
body =
|
|
40
|
+
React.createElement(Collapsable, { show: expandState.value }, body);
|
|
41
|
+
}
|
|
42
|
+
return (React.createElement("div", __assign({}, domProps, { className: className }),
|
|
43
|
+
(icon || title) &&
|
|
44
|
+
React.createElement("div", { className: "card-header" },
|
|
45
|
+
React.createElement("div", { className: "card-header-title" },
|
|
46
|
+
this.iconFactory.getIconComponent(icon),
|
|
47
|
+
React.createElement("span", null, title)),
|
|
48
|
+
headerElements && React.createElement("div", { className: "card-header-right-section" }, headerElements)),
|
|
49
|
+
body));
|
|
50
|
+
};
|
|
51
|
+
Card = __decorate([
|
|
52
|
+
observer
|
|
53
|
+
], Card);
|
|
54
|
+
return Card;
|
|
55
|
+
}(React.Component));
|
|
56
|
+
export default Card;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Components } from '@singularsystems/neo-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ComponentBase from './ComponentBase';
|
|
4
|
-
interface ICollapsableProps extends React.HTMLProps<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* True if the div should be visible.
|
|
7
|
-
*/
|
|
8
|
-
show: boolean;
|
|
9
|
-
/** Callback to show */
|
|
10
|
-
onHidden?: () => void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Renders a div that shows and hides using a vertical collapse animation.
|
|
14
|
-
* Uses the collapsable and collapsed css classes.
|
|
15
|
-
*/
|
|
16
|
-
export default class Collapsable extends ComponentBase<ICollapsableProps> {
|
|
17
|
-
protected containerRef: React.RefObject<HTMLDivElement>;
|
|
18
|
-
protected animationHelper?: Components.CollapseAnimationHelper;
|
|
19
|
-
render(): JSX.Element;
|
|
20
|
-
afterRender(isInitial: boolean): void;
|
|
21
|
-
componentWillUnmount(): void;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
1
|
+
import { Components } from '@singularsystems/neo-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ComponentBase from './ComponentBase';
|
|
4
|
+
interface ICollapsableProps extends React.HTMLProps<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* True if the div should be visible.
|
|
7
|
+
*/
|
|
8
|
+
show: boolean;
|
|
9
|
+
/** Callback to show */
|
|
10
|
+
onHidden?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders a div that shows and hides using a vertical collapse animation.
|
|
14
|
+
* Uses the collapsable and collapsed css classes.
|
|
15
|
+
*/
|
|
16
|
+
export default class Collapsable extends ComponentBase<ICollapsableProps> {
|
|
17
|
+
protected containerRef: React.RefObject<HTMLDivElement>;
|
|
18
|
+
protected animationHelper?: Components.CollapseAnimationHelper;
|
|
19
|
+
render(): JSX.Element;
|
|
20
|
+
afterRender(isInitial: boolean): void;
|
|
21
|
+
componentWillUnmount(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { __assign, __extends, __rest } from "tslib";
|
|
2
|
-
import { Components, Utils } from '@singularsystems/neo-core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import ComponentBase from './ComponentBase';
|
|
5
|
-
/**
|
|
6
|
-
* Renders a div that shows and hides using a vertical collapse animation.
|
|
7
|
-
* Uses the collapsable and collapsed css classes.
|
|
8
|
-
*/
|
|
9
|
-
var Collapsable = /** @class */ (function (_super) {
|
|
10
|
-
__extends(Collapsable, _super);
|
|
11
|
-
function Collapsable() {
|
|
12
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
-
_this.containerRef = React.createRef();
|
|
14
|
-
return _this;
|
|
15
|
-
}
|
|
16
|
-
Collapsable.prototype.render = function () {
|
|
17
|
-
var _a = this.props, show = _a.show, hidden = _a.hidden, onHidden = _a.onHidden, domProps = __rest(_a, ["show", "hidden", "onHidden"]);
|
|
18
|
-
domProps.className = Utils.joinWithSpaces(domProps.className, "collapsable");
|
|
19
|
-
return React.createElement("div", __assign({}, domProps, { ref: this.containerRef }), this.props.children);
|
|
20
|
-
};
|
|
21
|
-
Collapsable.prototype.afterRender = function (isInitial) {
|
|
22
|
-
if (this.containerRef.current) {
|
|
23
|
-
if (!this.animationHelper) {
|
|
24
|
-
this.animationHelper = new Components.CollapseAnimationHelper(this.containerRef.current, this.props.show, undefined, this.props.onHidden);
|
|
25
|
-
}
|
|
26
|
-
if (!isInitial) {
|
|
27
|
-
this.animationHelper.showHide(this.props.show, isInitial);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
Collapsable.prototype.componentWillUnmount = function () {
|
|
32
|
-
if (this.animationHelper) {
|
|
33
|
-
this.animationHelper.destroy();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return Collapsable;
|
|
37
|
-
}(ComponentBase));
|
|
38
|
-
export default Collapsable;
|
|
1
|
+
import { __assign, __extends, __rest } from "tslib";
|
|
2
|
+
import { Components, Utils } from '@singularsystems/neo-core';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import ComponentBase from './ComponentBase';
|
|
5
|
+
/**
|
|
6
|
+
* Renders a div that shows and hides using a vertical collapse animation.
|
|
7
|
+
* Uses the collapsable and collapsed css classes.
|
|
8
|
+
*/
|
|
9
|
+
var Collapsable = /** @class */ (function (_super) {
|
|
10
|
+
__extends(Collapsable, _super);
|
|
11
|
+
function Collapsable() {
|
|
12
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
+
_this.containerRef = React.createRef();
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
Collapsable.prototype.render = function () {
|
|
17
|
+
var _a = this.props, show = _a.show, hidden = _a.hidden, onHidden = _a.onHidden, domProps = __rest(_a, ["show", "hidden", "onHidden"]);
|
|
18
|
+
domProps.className = Utils.joinWithSpaces(domProps.className, "collapsable");
|
|
19
|
+
return React.createElement("div", __assign({}, domProps, { ref: this.containerRef }), this.props.children);
|
|
20
|
+
};
|
|
21
|
+
Collapsable.prototype.afterRender = function (isInitial) {
|
|
22
|
+
if (this.containerRef.current) {
|
|
23
|
+
if (!this.animationHelper) {
|
|
24
|
+
this.animationHelper = new Components.CollapseAnimationHelper(this.containerRef.current, this.props.show, undefined, this.props.onHidden);
|
|
25
|
+
}
|
|
26
|
+
if (!isInitial) {
|
|
27
|
+
this.animationHelper.showHide(this.props.show, isInitial);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
Collapsable.prototype.componentWillUnmount = function () {
|
|
32
|
+
if (this.animationHelper) {
|
|
33
|
+
this.animationHelper.destroy();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return Collapsable;
|
|
37
|
+
}(ComponentBase));
|
|
38
|
+
export default Collapsable;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Components } from '@singularsystems/neo-core';
|
|
3
|
-
import ComponentBase from './ComponentBase';
|
|
4
|
-
export default class CollapsableBase<TProps extends Components.ICollapsableOptions> extends ComponentBase<TProps> {
|
|
5
|
-
private timer;
|
|
6
|
-
protected containerRef: React.RefObject<HTMLDivElement>;
|
|
7
|
-
protected shouldShow: boolean;
|
|
8
|
-
protected animationHelper?: Components.CollapseAnimationHelper;
|
|
9
|
-
constructor(props: TProps);
|
|
10
|
-
onClose(e: React.MouseEvent): void;
|
|
11
|
-
afterRender(isInitial: boolean): void;
|
|
12
|
-
componentWillUnmount(): void;
|
|
13
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Components } from '@singularsystems/neo-core';
|
|
3
|
+
import ComponentBase from './ComponentBase';
|
|
4
|
+
export default class CollapsableBase<TProps extends Components.ICollapsableOptions> extends ComponentBase<TProps> {
|
|
5
|
+
private timer;
|
|
6
|
+
protected containerRef: React.RefObject<HTMLDivElement>;
|
|
7
|
+
protected shouldShow: boolean;
|
|
8
|
+
protected animationHelper?: Components.CollapseAnimationHelper;
|
|
9
|
+
constructor(props: TProps);
|
|
10
|
+
onClose(e: React.MouseEvent): void;
|
|
11
|
+
afterRender(isInitial: boolean): void;
|
|
12
|
+
componentWillUnmount(): void;
|
|
13
|
+
}
|