@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,77 +1,59 @@
|
|
|
1
|
-
import { __decorate, __extends } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { EnumHelper, Utils } from '@singularsystems/neo-core';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import { BindPropsHelper } from './PropTypes';
|
|
6
|
-
import ComponentBase from './ComponentBase';
|
|
7
|
-
import { FormContext } from './FormContext';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_this
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
RadioList
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// TODO, how must validation show if not in form group?
|
|
61
|
-
//const displayInfo = this.props.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
62
|
-
//displayInfo.applyToDom(domProps, !splitProps.inGroup);
|
|
63
|
-
var bindValue = this.props.bind.value;
|
|
64
|
-
var className = Utils.joinWithSpaces("neo-radio-list", (_a = splitProps.editorDom) === null || _a === void 0 ? void 0 : _a.className);
|
|
65
|
-
return React.createElement("div", { className: className }, this.items.map(function (item) {
|
|
66
|
-
return React.createElement("div", { className: "custom-control custom-radio " + (_this.props.radioList.inline ? "custom-control-inline" : "custom-control"), key: item.id },
|
|
67
|
-
React.createElement("input", { type: "radio", id: splitProps.uniqueID + item.id, name: splitProps.uniqueID, checked: bindValue === item.id, disabled: domProps.disabled || domProps.readOnly, onChange: function () { return _this.props.bind.value = item.id; }, className: "custom-control-input" }),
|
|
68
|
-
React.createElement("label", { className: "custom-control-label", htmlFor: splitProps.uniqueID + item.id }, item.name));
|
|
69
|
-
}));
|
|
70
|
-
};
|
|
71
|
-
RadioList.contextType = FormContext;
|
|
72
|
-
RadioList = __decorate([
|
|
73
|
-
observer
|
|
74
|
-
], RadioList);
|
|
75
|
-
return RadioList;
|
|
76
|
-
}(ComponentBase));
|
|
77
|
-
export default RadioList;
|
|
1
|
+
import { __decorate, __extends } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { EnumHelper, Utils } from '@singularsystems/neo-core';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { BindPropsHelper } from './PropTypes';
|
|
6
|
+
import ComponentBase from './ComponentBase';
|
|
7
|
+
import { FormContext } from './FormContext';
|
|
8
|
+
import LookupHelper from './DropDown/LookupHelper';
|
|
9
|
+
var RadioList = /** @class */ (function (_super) {
|
|
10
|
+
__extends(RadioList, _super);
|
|
11
|
+
function RadioList() {
|
|
12
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
+
_this.items = [];
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
RadioList.prototype.preRender = function () {
|
|
17
|
+
if (this.props.radioList.items && this.props.radioList.items !== this.previousList) {
|
|
18
|
+
this.previousList = this.props.radioList.items;
|
|
19
|
+
this.createEnumList(this.props.radioList.items);
|
|
20
|
+
}
|
|
21
|
+
else if (this.props.radioList.enumType && this.props.radioList.enumType !== this.previousEnumType) {
|
|
22
|
+
this.previousEnumType = this.props.radioList.enumType;
|
|
23
|
+
this.items = EnumHelper.asList(this.props.radioList.enumType);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
RadioList.prototype.createEnumList = function (list) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
if (list.length) {
|
|
29
|
+
var _c = LookupHelper.findMembers(list[0], (_a = this.props.radioList.valueMember) !== null && _a !== void 0 ? _a : "", (_b = this.props.radioList.displayMember) !== null && _b !== void 0 ? _b : "", true), valueMember_1 = _c.valueMember, displayMember_1 = _c.displayMember;
|
|
30
|
+
if (valueMember_1 && displayMember_1) {
|
|
31
|
+
this.items = list.map(function (item) { return ({ id: item[valueMember_1], name: item[displayMember_1] }); });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
RadioList.prototype.render = function () {
|
|
36
|
+
var _this = this;
|
|
37
|
+
var _a;
|
|
38
|
+
this.preRender();
|
|
39
|
+
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
40
|
+
var domProps = BindPropsHelper.autoSetDomProperties(splitProps, this.context);
|
|
41
|
+
// TODO, how must validation show if not in form group?
|
|
42
|
+
//const displayInfo = this.props.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
43
|
+
//displayInfo.applyToDom(domProps, !splitProps.inGroup);
|
|
44
|
+
var bindValue = this.props.bind.value;
|
|
45
|
+
var className = Utils.joinWithSpaces("neo-radio-list", (_a = splitProps.editorDom) === null || _a === void 0 ? void 0 : _a.className);
|
|
46
|
+
return React.createElement("div", { className: className }, this.items.map(function (item) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return React.createElement("div", { className: "custom-control custom-radio " + (_this.props.radioList.inline ? "custom-control-inline" : "custom-control"), key: item.id },
|
|
49
|
+
React.createElement("input", { type: "radio", id: splitProps.uniqueID + ((_a = item.id) !== null && _a !== void 0 ? _a : ""), name: splitProps.uniqueID, checked: bindValue === item.id, disabled: domProps.disabled || domProps.readOnly, onChange: function () { return _this.props.bind.value = item.id; }, className: "custom-control-input" }),
|
|
50
|
+
React.createElement("label", { className: "custom-control-label", htmlFor: splitProps.uniqueID + ((_b = item.id) !== null && _b !== void 0 ? _b : "") }, item.name));
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
RadioList.contextType = FormContext;
|
|
54
|
+
RadioList = __decorate([
|
|
55
|
+
observer
|
|
56
|
+
], RadioList);
|
|
57
|
+
return RadioList;
|
|
58
|
+
}(ComponentBase));
|
|
59
|
+
export default RadioList;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component uses the rc-slider module
|
|
3
|
-
* https://www.npmjs.com/package/rc-slider
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { Model } from '@singularsystems/neo-core';
|
|
7
|
-
import { SliderProps as ISliderLibProps, RangeProps as IRangeLibProps } from 'rc-slider';
|
|
8
|
-
interface ICommonSliderProps {
|
|
9
|
-
bind: Model.IPropertyInstance;
|
|
10
|
-
onChangeEvent?: () => void;
|
|
11
|
-
}
|
|
12
|
-
interface ISliderSpecificProps extends ISliderLibProps, ICommonSliderProps {
|
|
13
|
-
}
|
|
14
|
-
interface IRangeSpecificProps extends IRangeLibProps, ICommonSliderProps {
|
|
15
|
-
bindEnd: Model.IPropertyInstance;
|
|
16
|
-
}
|
|
17
|
-
export default class Slider extends React.Component<ISliderSpecificProps | IRangeSpecificProps> {
|
|
18
|
-
private sliderImplementation;
|
|
19
|
-
private rangeImplementation;
|
|
20
|
-
private get isRange();
|
|
21
|
-
private get rangeProps();
|
|
22
|
-
private get sliderProps();
|
|
23
|
-
onChangeHandler: (value: number | number[]) => void;
|
|
24
|
-
private getSlider;
|
|
25
|
-
private getRange;
|
|
26
|
-
render(): JSX.Element;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* This component uses the rc-slider module
|
|
3
|
+
* https://www.npmjs.com/package/rc-slider
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Model } from '@singularsystems/neo-core';
|
|
7
|
+
import { SliderProps as ISliderLibProps, RangeProps as IRangeLibProps } from 'rc-slider';
|
|
8
|
+
interface ICommonSliderProps {
|
|
9
|
+
bind: Model.IPropertyInstance;
|
|
10
|
+
onChangeEvent?: () => void;
|
|
11
|
+
}
|
|
12
|
+
interface ISliderSpecificProps extends ISliderLibProps, ICommonSliderProps {
|
|
13
|
+
}
|
|
14
|
+
interface IRangeSpecificProps extends IRangeLibProps, ICommonSliderProps {
|
|
15
|
+
bindEnd: Model.IPropertyInstance;
|
|
16
|
+
}
|
|
17
|
+
export default class Slider extends React.Component<ISliderSpecificProps | IRangeSpecificProps> {
|
|
18
|
+
private sliderImplementation;
|
|
19
|
+
private rangeImplementation;
|
|
20
|
+
private get isRange();
|
|
21
|
+
private get rangeProps();
|
|
22
|
+
private get sliderProps();
|
|
23
|
+
onChangeHandler: (value: number | number[]) => void;
|
|
24
|
+
private getSlider;
|
|
25
|
+
private getRange;
|
|
26
|
+
render(): JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
-
/**
|
|
3
|
-
* This component uses the rc-slider module
|
|
4
|
-
* https://www.npmjs.com/package/rc-slider
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { observer } from 'mobx-react';
|
|
8
|
-
import { Misc } from '@singularsystems/neo-core';
|
|
9
|
-
import { NeoReactTypes } from '../Modules/Types';
|
|
10
|
-
var Slider = /** @class */ (function (_super) {
|
|
11
|
-
__extends(Slider, _super);
|
|
12
|
-
function Slider() {
|
|
13
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
14
|
-
_this.sliderImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.Slider);
|
|
15
|
-
_this.rangeImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.Range);
|
|
16
|
-
_this.onChangeHandler = function (value) {
|
|
17
|
-
if (_this.isRange === false) {
|
|
18
|
-
// This is a <Slider/>
|
|
19
|
-
_this.props.bind.value = value;
|
|
20
|
-
}
|
|
21
|
-
else if (_this.isRange) {
|
|
22
|
-
// This is a <Range />
|
|
23
|
-
_this.props.bind.value = value[0];
|
|
24
|
-
_this.rangeProps.bindEnd.value = value[1];
|
|
25
|
-
}
|
|
26
|
-
// Check if there is a custom onChangeEvent prop
|
|
27
|
-
if (_this.props.onChangeEvent) {
|
|
28
|
-
_this.props.onChangeEvent();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(Slider.prototype, "isRange", {
|
|
34
|
-
get: function () {
|
|
35
|
-
return this.props.bindEnd !== undefined;
|
|
36
|
-
},
|
|
37
|
-
enumerable: false,
|
|
38
|
-
configurable: true
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(Slider.prototype, "rangeProps", {
|
|
41
|
-
get: function () {
|
|
42
|
-
return this.props;
|
|
43
|
-
},
|
|
44
|
-
enumerable: false,
|
|
45
|
-
configurable: true
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(Slider.prototype, "sliderProps", {
|
|
48
|
-
get: function () {
|
|
49
|
-
return this.props;
|
|
50
|
-
},
|
|
51
|
-
enumerable: false,
|
|
52
|
-
configurable: true
|
|
53
|
-
});
|
|
54
|
-
Slider.prototype.getSlider = function () {
|
|
55
|
-
var _a = this.sliderProps, bind = _a.bind, onChangeEvent = _a.onChangeEvent, other = __rest(_a, ["bind", "onChangeEvent"]);
|
|
56
|
-
other.defaultValue = bind.value;
|
|
57
|
-
other.value = bind.value;
|
|
58
|
-
return React.createElement(this.sliderImplementation, __assign({}, other, { onChange: this.onChangeHandler }));
|
|
59
|
-
};
|
|
60
|
-
Slider.prototype.getRange = function () {
|
|
61
|
-
var _a = this.rangeProps, bind = _a.bind, bindEnd = _a.bindEnd, onChangeEvent = _a.onChangeEvent, other = __rest(_a, ["bind", "bindEnd", "onChangeEvent"]);
|
|
62
|
-
other.defaultValue = [bind.value, bindEnd.value];
|
|
63
|
-
other.value = [bind.value, bindEnd.value];
|
|
64
|
-
return React.createElement(this.rangeImplementation, __assign({}, other, { onChange: this.onChangeHandler }));
|
|
65
|
-
};
|
|
66
|
-
Slider.prototype.render = function () {
|
|
67
|
-
return (React.createElement("div", { className: "Slider" },
|
|
68
|
-
this.isRange && this.getRange(),
|
|
69
|
-
!this.isRange && this.getSlider()));
|
|
70
|
-
};
|
|
71
|
-
Slider = __decorate([
|
|
72
|
-
observer
|
|
73
|
-
], Slider);
|
|
74
|
-
return Slider;
|
|
75
|
-
}(React.Component));
|
|
76
|
-
export default Slider;
|
|
1
|
+
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
+
/**
|
|
3
|
+
* This component uses the rc-slider module
|
|
4
|
+
* https://www.npmjs.com/package/rc-slider
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { observer } from 'mobx-react';
|
|
8
|
+
import { Misc } from '@singularsystems/neo-core';
|
|
9
|
+
import { NeoReactTypes } from '../Modules/Types';
|
|
10
|
+
var Slider = /** @class */ (function (_super) {
|
|
11
|
+
__extends(Slider, _super);
|
|
12
|
+
function Slider() {
|
|
13
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
14
|
+
_this.sliderImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.Slider);
|
|
15
|
+
_this.rangeImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.Range);
|
|
16
|
+
_this.onChangeHandler = function (value) {
|
|
17
|
+
if (_this.isRange === false) {
|
|
18
|
+
// This is a <Slider/>
|
|
19
|
+
_this.props.bind.value = value;
|
|
20
|
+
}
|
|
21
|
+
else if (_this.isRange) {
|
|
22
|
+
// This is a <Range />
|
|
23
|
+
_this.props.bind.value = value[0];
|
|
24
|
+
_this.rangeProps.bindEnd.value = value[1];
|
|
25
|
+
}
|
|
26
|
+
// Check if there is a custom onChangeEvent prop
|
|
27
|
+
if (_this.props.onChangeEvent) {
|
|
28
|
+
_this.props.onChangeEvent();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
Object.defineProperty(Slider.prototype, "isRange", {
|
|
34
|
+
get: function () {
|
|
35
|
+
return this.props.bindEnd !== undefined;
|
|
36
|
+
},
|
|
37
|
+
enumerable: false,
|
|
38
|
+
configurable: true
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(Slider.prototype, "rangeProps", {
|
|
41
|
+
get: function () {
|
|
42
|
+
return this.props;
|
|
43
|
+
},
|
|
44
|
+
enumerable: false,
|
|
45
|
+
configurable: true
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(Slider.prototype, "sliderProps", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return this.props;
|
|
50
|
+
},
|
|
51
|
+
enumerable: false,
|
|
52
|
+
configurable: true
|
|
53
|
+
});
|
|
54
|
+
Slider.prototype.getSlider = function () {
|
|
55
|
+
var _a = this.sliderProps, bind = _a.bind, onChangeEvent = _a.onChangeEvent, other = __rest(_a, ["bind", "onChangeEvent"]);
|
|
56
|
+
other.defaultValue = bind.value;
|
|
57
|
+
other.value = bind.value;
|
|
58
|
+
return React.createElement(this.sliderImplementation, __assign({}, other, { onChange: this.onChangeHandler }));
|
|
59
|
+
};
|
|
60
|
+
Slider.prototype.getRange = function () {
|
|
61
|
+
var _a = this.rangeProps, bind = _a.bind, bindEnd = _a.bindEnd, onChangeEvent = _a.onChangeEvent, other = __rest(_a, ["bind", "bindEnd", "onChangeEvent"]);
|
|
62
|
+
other.defaultValue = [bind.value, bindEnd.value];
|
|
63
|
+
other.value = [bind.value, bindEnd.value];
|
|
64
|
+
return React.createElement(this.rangeImplementation, __assign({}, other, { onChange: this.onChangeHandler }));
|
|
65
|
+
};
|
|
66
|
+
Slider.prototype.render = function () {
|
|
67
|
+
return (React.createElement("div", { className: "Slider" },
|
|
68
|
+
this.isRange && this.getRange(),
|
|
69
|
+
!this.isRange && this.getSlider()));
|
|
70
|
+
};
|
|
71
|
+
Slider = __decorate([
|
|
72
|
+
observer
|
|
73
|
+
], Slider);
|
|
74
|
+
return Slider;
|
|
75
|
+
}(React.Component));
|
|
76
|
+
export default Slider;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* Watches all observables accessed during the getState callback.
|
|
4
|
-
* When any of the value of these observables change, forceUpdate is called on the component.
|
|
5
|
-
*/
|
|
6
|
-
export declare class StateObserver<TState> {
|
|
7
|
-
private component;
|
|
8
|
-
private getState;
|
|
9
|
-
private _disposer?;
|
|
10
|
-
private inUpdate;
|
|
11
|
-
isPaused: boolean;
|
|
12
|
-
constructor(component: React.Component, getState: () => TState);
|
|
13
|
-
observe(): void;
|
|
14
|
-
dispose(): void;
|
|
15
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Watches all observables accessed during the getState callback.
|
|
4
|
+
* When any of the value of these observables change, forceUpdate is called on the component.
|
|
5
|
+
*/
|
|
6
|
+
export declare class StateObserver<TState> {
|
|
7
|
+
private component;
|
|
8
|
+
private getState;
|
|
9
|
+
private _disposer?;
|
|
10
|
+
private inUpdate;
|
|
11
|
+
isPaused: boolean;
|
|
12
|
+
constructor(component: React.Component, getState: () => TState);
|
|
13
|
+
observe(): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { reaction } from 'mobx';
|
|
2
|
-
/**
|
|
3
|
-
* Watches all observables accessed during the getState callback.
|
|
4
|
-
* When any of the value of these observables change, forceUpdate is called on the component.
|
|
5
|
-
*/
|
|
6
|
-
var StateObserver = /** @class */ (function () {
|
|
7
|
-
function StateObserver(component, getState) {
|
|
8
|
-
this.component = component;
|
|
9
|
-
this.getState = getState;
|
|
10
|
-
this.inUpdate = false;
|
|
11
|
-
this.isPaused = false;
|
|
12
|
-
}
|
|
13
|
-
StateObserver.prototype.observe = function () {
|
|
14
|
-
var _this = this;
|
|
15
|
-
if (!this.inUpdate) {
|
|
16
|
-
this.dispose();
|
|
17
|
-
this._disposer = reaction(function () {
|
|
18
|
-
return _this.getState();
|
|
19
|
-
}, function (newState) {
|
|
20
|
-
if (!_this.isPaused) {
|
|
21
|
-
_this.inUpdate = true;
|
|
22
|
-
_this.component.forceUpdate();
|
|
23
|
-
_this.inUpdate = false;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
StateObserver.prototype.dispose = function () {
|
|
29
|
-
if (this._disposer)
|
|
30
|
-
this._disposer();
|
|
31
|
-
this._disposer = undefined;
|
|
32
|
-
};
|
|
33
|
-
return StateObserver;
|
|
34
|
-
}());
|
|
35
|
-
export { StateObserver };
|
|
1
|
+
import { reaction } from 'mobx';
|
|
2
|
+
/**
|
|
3
|
+
* Watches all observables accessed during the getState callback.
|
|
4
|
+
* When any of the value of these observables change, forceUpdate is called on the component.
|
|
5
|
+
*/
|
|
6
|
+
var StateObserver = /** @class */ (function () {
|
|
7
|
+
function StateObserver(component, getState) {
|
|
8
|
+
this.component = component;
|
|
9
|
+
this.getState = getState;
|
|
10
|
+
this.inUpdate = false;
|
|
11
|
+
this.isPaused = false;
|
|
12
|
+
}
|
|
13
|
+
StateObserver.prototype.observe = function () {
|
|
14
|
+
var _this = this;
|
|
15
|
+
if (!this.inUpdate) {
|
|
16
|
+
this.dispose();
|
|
17
|
+
this._disposer = reaction(function () {
|
|
18
|
+
return _this.getState();
|
|
19
|
+
}, function (newState) {
|
|
20
|
+
if (!_this.isPaused) {
|
|
21
|
+
_this.inUpdate = true;
|
|
22
|
+
_this.component.forceUpdate();
|
|
23
|
+
_this.inUpdate = false;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
StateObserver.prototype.dispose = function () {
|
|
29
|
+
if (this._disposer)
|
|
30
|
+
this._disposer();
|
|
31
|
+
this._disposer = undefined;
|
|
32
|
+
};
|
|
33
|
+
return StateObserver;
|
|
34
|
+
}());
|
|
35
|
+
export { StateObserver };
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TabContext } from "./TabContainer";
|
|
3
|
-
import { ICancellableEvent } from "../Misc";
|
|
4
|
-
interface ITabProps {
|
|
5
|
-
/** Name to show in the tab header. */
|
|
6
|
-
header: string | JSX.Element;
|
|
7
|
-
/** Name used for binding to selected tab. */
|
|
8
|
-
id?: string;
|
|
9
|
-
/** Name used for binding to selected tab. (Same as id property) */
|
|
10
|
-
name?: string;
|
|
11
|
-
/** Icon to display in tab header. */
|
|
12
|
-
icon?: string;
|
|
13
|
-
/** True if the tab is disabled and not allowed to be clicked on. */
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Callback to run when this tab is first displayed, or when TabManager.reset is called with reInitialise=true
|
|
17
|
-
*/
|
|
18
|
-
onInitialise?: () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Callback to run whenever this tab is displayed.
|
|
21
|
-
*/
|
|
22
|
-
onDisplayed?: () => void;
|
|
23
|
-
/** Callback to run when selecting a different tab. The event can be cancelled. */
|
|
24
|
-
onLeave?: (e: ICancellableEvent) => void;
|
|
25
|
-
/** Child content is used as the tab body. */
|
|
26
|
-
children: React.ReactNode;
|
|
27
|
-
}
|
|
28
|
-
export default class Tab extends React.Component<ITabProps> {
|
|
29
|
-
static contextType: React.Context<import("./TabContainer").TabContextParams>;
|
|
30
|
-
context: React.ContextType<typeof TabContext>;
|
|
31
|
-
private isHeader?;
|
|
32
|
-
private tabKey;
|
|
33
|
-
private hasRenderedContents;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabContext } from "./TabContainer";
|
|
3
|
+
import { ICancellableEvent } from "../Misc";
|
|
4
|
+
interface ITabProps {
|
|
5
|
+
/** Name to show in the tab header. */
|
|
6
|
+
header: string | JSX.Element;
|
|
7
|
+
/** Name used for binding to selected tab. */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Name used for binding to selected tab. (Same as id property) */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Icon to display in tab header. */
|
|
12
|
+
icon?: string;
|
|
13
|
+
/** True if the tab is disabled and not allowed to be clicked on. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Callback to run when this tab is first displayed, or when TabManager.reset is called with reInitialise=true
|
|
17
|
+
*/
|
|
18
|
+
onInitialise?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Callback to run whenever this tab is displayed.
|
|
21
|
+
*/
|
|
22
|
+
onDisplayed?: () => void;
|
|
23
|
+
/** Callback to run when selecting a different tab. The event can be cancelled. */
|
|
24
|
+
onLeave?: (e: ICancellableEvent) => void;
|
|
25
|
+
/** Child content is used as the tab body. */
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export default class Tab extends React.Component<ITabProps> {
|
|
29
|
+
static contextType: React.Context<import("./TabContainer").TabContextParams>;
|
|
30
|
+
context: React.ContextType<typeof TabContext>;
|
|
31
|
+
private isHeader?;
|
|
32
|
+
private tabKey;
|
|
33
|
+
private hasRenderedContents;
|
|
34
|
+
private iconFactory;
|
|
35
|
+
constructor(props: ITabProps);
|
|
36
|
+
componentDidMount(): void;
|
|
37
|
+
render(): false | JSX.Element;
|
|
38
|
+
onClick(e: React.MouseEvent<HTMLAnchorElement>): void;
|
|
39
|
+
renderHeader(isSelected: boolean): JSX.Element;
|
|
40
|
+
renderBody(isSelected: boolean): false | JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
export {};
|