@singularsystems/neo-react 1.0.0-alpha.3 → 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 -89
- 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 -8
- package/dist/ReactComponents/ContextMenu/ContextMenuState.js +23 -24
- 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 -9
- package/dist/ReactComponents/ErrorHandler.js +92 -93
- 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 -19
- package/dist/ReactComponents/FileManager/FileDropArea.js +66 -66
- package/dist/ReactComponents/FileManager/FileInput.d.ts +44 -43
- package/dist/ReactComponents/FileManager/FileInput.js +191 -191
- 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 -19
- package/dist/ReactComponents/Form.js +90 -90
- package/dist/ReactComponents/FormContext.d.ts +33 -33
- 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 -87
- package/dist/ReactComponents/Grid/Grid.js +203 -203
- package/dist/ReactComponents/Grid/Row.d.ts +81 -81
- package/dist/ReactComponents/Grid/Row.js +200 -202
- 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 -153
- 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 -16
- 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 -20
- 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 -75
- 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 -143
- package/dist/Routing/RoutingState.d.ts +18 -18
- package/dist/Routing/RoutingState.js +45 -46
- package/dist/Routing/ViewParameter.d.ts +80 -58
- package/dist/Routing/ViewParameter.js +116 -96
- 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 -70
- package/dist/Views/ViewBase.js +166 -155
- 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 +18 -20
- package/styles/DatePicker.scss +2 -2
- package/styles/Forms.scss +5 -0
- package/styles/Validation.scss +0 -9
package/dist/Routing/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { default as RouteProvider } from './RouteProvider';
|
|
2
|
-
export { default as RouteView } from './RouteView';
|
|
3
|
-
export * from './BreadCrumbItem';
|
|
4
|
-
export { PageLeaveHandler } from './PageLeaveHandler';
|
|
5
|
-
export { IMenuRoute, MenuRoute } from './MenuRoute';
|
|
6
|
-
export { INavigationHelper } from './NavigationHelper';
|
|
7
|
-
export { IViewParameter } from './ViewParameter';
|
|
8
|
-
export { BreadCrumbSelectMode, IRouteParameter, RouteParameters } from './IRouteParameter';
|
|
9
|
-
export { IRouteChangedProps } from './IRouteChangedProps';
|
|
1
|
+
export { default as RouteProvider } from './RouteProvider';
|
|
2
|
+
export { default as RouteView } from './RouteView';
|
|
3
|
+
export * from './BreadCrumbItem';
|
|
4
|
+
export { PageLeaveHandler } from './PageLeaveHandler';
|
|
5
|
+
export { IMenuRoute, MenuRoute } from './MenuRoute';
|
|
6
|
+
export { INavigationHelper } from './NavigationHelper';
|
|
7
|
+
export { IViewParameter } from './ViewParameter';
|
|
8
|
+
export { BreadCrumbSelectMode, IRouteParameter, RouteParameters } from './IRouteParameter';
|
|
9
|
+
export { IRouteChangedProps } from './IRouteChangedProps';
|
package/dist/Routing/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as RouteProvider } from './RouteProvider';
|
|
2
|
-
export { default as RouteView } from './RouteView';
|
|
3
|
-
export * from './BreadCrumbItem';
|
|
4
|
-
export { PageLeaveHandler } from './PageLeaveHandler';
|
|
5
|
-
export { MenuRoute } from './MenuRoute';
|
|
6
|
-
export { BreadCrumbSelectMode } from './IRouteParameter';
|
|
1
|
+
export { default as RouteProvider } from './RouteProvider';
|
|
2
|
+
export { default as RouteView } from './RouteView';
|
|
3
|
+
export * from './BreadCrumbItem';
|
|
4
|
+
export { PageLeaveHandler } from './PageLeaveHandler';
|
|
5
|
+
export { MenuRoute } from './MenuRoute';
|
|
6
|
+
export { BreadCrumbSelectMode } from './IRouteParameter';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Misc } from "@singularsystems/neo-core";
|
|
2
|
-
import { IReactionDisposer } from "mobx";
|
|
3
|
-
import { IDisposeHelper } from "./IDisposeHelper";
|
|
4
|
-
export declare class DisposeHelper implements IDisposeHelper {
|
|
5
|
-
private registeredReactions;
|
|
6
|
-
private registeredDisposables;
|
|
7
|
-
/**
|
|
8
|
-
* Registers a mobx reaction, which will be disposed in the dispose() method when the view is unmounted.
|
|
9
|
-
* @param expression Expression to react to.
|
|
10
|
-
* @param effect Callback to run when the result of the expression changes.
|
|
11
|
-
*/
|
|
12
|
-
registerReaction<T>(expression: (vm: this) => T, effect: (value: T) => void): IReactionDisposer;
|
|
13
|
-
autoDispose<T extends Misc.IDisposable>(disposable: T): T;
|
|
14
|
-
dispose(): void;
|
|
15
|
-
}
|
|
1
|
+
import { Misc } from "@singularsystems/neo-core";
|
|
2
|
+
import { IReactionDisposer } from "mobx";
|
|
3
|
+
import { IDisposeHelper } from "./IDisposeHelper";
|
|
4
|
+
export declare class DisposeHelper implements IDisposeHelper {
|
|
5
|
+
private registeredReactions;
|
|
6
|
+
private registeredDisposables;
|
|
7
|
+
/**
|
|
8
|
+
* Registers a mobx reaction, which will be disposed in the dispose() method when the view is unmounted.
|
|
9
|
+
* @param expression Expression to react to.
|
|
10
|
+
* @param effect Callback to run when the result of the expression changes.
|
|
11
|
+
*/
|
|
12
|
+
registerReaction<T>(expression: (vm: this) => T, effect: (value: T) => void): IReactionDisposer;
|
|
13
|
+
autoDispose<T extends Misc.IDisposable>(disposable: T): T;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { injectable } from "inversify";
|
|
3
|
-
import { reaction } from "mobx";
|
|
4
|
-
var DisposeHelper = /** @class */ (function () {
|
|
5
|
-
function DisposeHelper() {
|
|
6
|
-
this.registeredReactions = [];
|
|
7
|
-
this.registeredDisposables = [];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Registers a mobx reaction, which will be disposed in the dispose() method when the view is unmounted.
|
|
11
|
-
* @param expression Expression to react to.
|
|
12
|
-
* @param effect Callback to run when the result of the expression changes.
|
|
13
|
-
*/
|
|
14
|
-
DisposeHelper.prototype.registerReaction = function (expression, effect) {
|
|
15
|
-
var _this = this;
|
|
16
|
-
var disposer = reaction(function () { return expression(_this); }, effect);
|
|
17
|
-
this.registeredReactions.push(disposer);
|
|
18
|
-
return disposer;
|
|
19
|
-
};
|
|
20
|
-
DisposeHelper.prototype.autoDispose = function (disposable) {
|
|
21
|
-
this.registeredDisposables.push(disposable);
|
|
22
|
-
return disposable;
|
|
23
|
-
};
|
|
24
|
-
DisposeHelper.prototype.dispose = function () {
|
|
25
|
-
for (var _i = 0, _a = this.registeredReactions; _i < _a.length; _i++) {
|
|
26
|
-
var disposer = _a[_i];
|
|
27
|
-
disposer();
|
|
28
|
-
}
|
|
29
|
-
this.registeredReactions = [];
|
|
30
|
-
for (var _b = 0, _c = this.registeredDisposables; _b < _c.length; _b++) {
|
|
31
|
-
var disposable = _c[_b];
|
|
32
|
-
disposable.dispose();
|
|
33
|
-
}
|
|
34
|
-
this.registeredDisposables = [];
|
|
35
|
-
};
|
|
36
|
-
DisposeHelper = __decorate([
|
|
37
|
-
injectable()
|
|
38
|
-
], DisposeHelper);
|
|
39
|
-
return DisposeHelper;
|
|
40
|
-
}());
|
|
41
|
-
export { DisposeHelper };
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { injectable } from "inversify";
|
|
3
|
+
import { reaction } from "mobx";
|
|
4
|
+
export var DisposeHelper = /** @class */ (function () {
|
|
5
|
+
function DisposeHelper() {
|
|
6
|
+
this.registeredReactions = [];
|
|
7
|
+
this.registeredDisposables = [];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Registers a mobx reaction, which will be disposed in the dispose() method when the view is unmounted.
|
|
11
|
+
* @param expression Expression to react to.
|
|
12
|
+
* @param effect Callback to run when the result of the expression changes.
|
|
13
|
+
*/
|
|
14
|
+
DisposeHelper.prototype.registerReaction = function (expression, effect) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
var disposer = reaction(function () { return expression(_this); }, effect);
|
|
17
|
+
this.registeredReactions.push(disposer);
|
|
18
|
+
return disposer;
|
|
19
|
+
};
|
|
20
|
+
DisposeHelper.prototype.autoDispose = function (disposable) {
|
|
21
|
+
this.registeredDisposables.push(disposable);
|
|
22
|
+
return disposable;
|
|
23
|
+
};
|
|
24
|
+
DisposeHelper.prototype.dispose = function () {
|
|
25
|
+
for (var _i = 0, _a = this.registeredReactions; _i < _a.length; _i++) {
|
|
26
|
+
var disposer = _a[_i];
|
|
27
|
+
disposer();
|
|
28
|
+
}
|
|
29
|
+
this.registeredReactions = [];
|
|
30
|
+
for (var _b = 0, _c = this.registeredDisposables; _b < _c.length; _b++) {
|
|
31
|
+
var disposable = _c[_b];
|
|
32
|
+
disposable.dispose();
|
|
33
|
+
}
|
|
34
|
+
this.registeredDisposables = [];
|
|
35
|
+
};
|
|
36
|
+
DisposeHelper = __decorate([
|
|
37
|
+
injectable()
|
|
38
|
+
], DisposeHelper);
|
|
39
|
+
return DisposeHelper;
|
|
40
|
+
}());
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Misc } from "@singularsystems/neo-core";
|
|
2
|
-
import { IReactionDisposer } from "mobx";
|
|
3
|
-
export interface IDisposeHelper extends Misc.IDisposable {
|
|
4
|
-
/**
|
|
5
|
-
* Registers a mobx reaction, which will be disposed in the dispose() method when the view is unmounted.
|
|
6
|
-
* @param expression Expression to react to.
|
|
7
|
-
* @param effect Callback to run when the result of the expression changes.
|
|
8
|
-
*/
|
|
9
|
-
registerReaction<T>(expression: (vm: this) => T, effect: (value: T) => void): IReactionDisposer;
|
|
10
|
-
autoDispose<T extends Misc.IDisposable>(disposable: T): T;
|
|
11
|
-
dispose(): void;
|
|
12
|
-
}
|
|
1
|
+
import { Misc } from "@singularsystems/neo-core";
|
|
2
|
+
import { IReactionDisposer } from "mobx";
|
|
3
|
+
export interface IDisposeHelper extends Misc.IDisposable {
|
|
4
|
+
/**
|
|
5
|
+
* Registers a mobx reaction, which will be disposed in the dispose() method when the view is unmounted.
|
|
6
|
+
* @param expression Expression to react to.
|
|
7
|
+
* @param effect Callback to run when the result of the expression changes.
|
|
8
|
+
*/
|
|
9
|
+
registerReaction<T>(expression: (vm: this) => T, effect: (value: T) => void): IReactionDisposer;
|
|
10
|
+
autoDispose<T extends Misc.IDisposable>(disposable: T): T;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ViewModelBase from "./ViewModelBase";
|
|
2
|
-
export default class EmptyViewModel extends ViewModelBase {
|
|
3
|
-
constructor(taskRunner?: import("@singularsystems/neo-core").ITaskRunner);
|
|
4
|
-
initialise(): void;
|
|
5
|
-
}
|
|
1
|
+
import ViewModelBase from "./ViewModelBase";
|
|
2
|
+
export default class EmptyViewModel extends ViewModelBase {
|
|
3
|
+
constructor(taskRunner?: import("@singularsystems/neo-core").ITaskRunner);
|
|
4
|
+
initialise(): void;
|
|
5
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import ViewModelBase from "./ViewModelBase";
|
|
3
|
-
import { Misc, AppServices } from '@singularsystems/neo-core';
|
|
4
|
-
var EmptyViewModel = /** @class */ (function (_super) {
|
|
5
|
-
__extends(EmptyViewModel, _super);
|
|
6
|
-
function EmptyViewModel(taskRunner) {
|
|
7
|
-
if (taskRunner === void 0) { taskRunner = Misc.Globals.appService.get(AppServices.NeoTypes.TaskRunner); }
|
|
8
|
-
return _super.call(this, taskRunner) || this;
|
|
9
|
-
}
|
|
10
|
-
EmptyViewModel.prototype.initialise = function () {
|
|
11
|
-
};
|
|
12
|
-
return EmptyViewModel;
|
|
13
|
-
}(ViewModelBase));
|
|
14
|
-
export default EmptyViewModel;
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import ViewModelBase from "./ViewModelBase";
|
|
3
|
+
import { Misc, AppServices } from '@singularsystems/neo-core';
|
|
4
|
+
var EmptyViewModel = /** @class */ (function (_super) {
|
|
5
|
+
__extends(EmptyViewModel, _super);
|
|
6
|
+
function EmptyViewModel(taskRunner) {
|
|
7
|
+
if (taskRunner === void 0) { taskRunner = Misc.Globals.appService.get(AppServices.NeoTypes.TaskRunner); }
|
|
8
|
+
return _super.call(this, taskRunner) || this;
|
|
9
|
+
}
|
|
10
|
+
EmptyViewModel.prototype.initialise = function () {
|
|
11
|
+
};
|
|
12
|
+
return EmptyViewModel;
|
|
13
|
+
}(ViewModelBase));
|
|
14
|
+
export default EmptyViewModel;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ITaskRunner } from '@singularsystems/neo-core';
|
|
2
|
-
import { IReactionDisposer } from 'mobx';
|
|
3
|
-
export interface IViewModel {
|
|
4
|
-
taskRunner: ITaskRunner;
|
|
5
|
-
/**
|
|
6
|
-
* initialise() is called from componentDidMount().
|
|
7
|
-
* For persistent views, this is only called once, not every time a user navigates to the view.
|
|
8
|
-
*/
|
|
9
|
-
initialise(): void | Promise<any>;
|
|
10
|
-
/**
|
|
11
|
-
* dispose() is called from componentWillUnmount().
|
|
12
|
-
* For persistent views, dispose is never called.
|
|
13
|
-
*/
|
|
14
|
-
dispose(): void;
|
|
15
|
-
registerReaction<T>(expression: () => T, effect: (value: T) => void): IReactionDisposer;
|
|
16
|
-
}
|
|
1
|
+
import { ITaskRunner } from '@singularsystems/neo-core';
|
|
2
|
+
import { IReactionDisposer } from 'mobx';
|
|
3
|
+
export interface IViewModel {
|
|
4
|
+
taskRunner: ITaskRunner;
|
|
5
|
+
/**
|
|
6
|
+
* initialise() is called from componentDidMount().
|
|
7
|
+
* For persistent views, this is only called once, not every time a user navigates to the view.
|
|
8
|
+
*/
|
|
9
|
+
initialise(): void | Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* dispose() is called from componentWillUnmount().
|
|
12
|
+
* For persistent views, dispose is never called.
|
|
13
|
+
*/
|
|
14
|
+
dispose(): void;
|
|
15
|
+
registerReaction<T>(expression: () => T, effect: (value: T) => void): IReactionDisposer;
|
|
16
|
+
}
|
package/dist/Views/IViewModel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import ViewBase from "./ViewBase";
|
|
2
|
-
import { ViewState } from './ViewState';
|
|
3
|
-
import { RouteParameterObject } from '../Routing/IRouteParameter';
|
|
4
|
-
import { IViewModel } from './IViewModel';
|
|
5
|
-
export default abstract class PersistentViewBase<TViewModel extends IViewModel, TParams extends RouteParameterObject<TParams> = {}> extends ViewBase<TViewModel, TParams> {
|
|
6
|
-
private static storedState;
|
|
7
|
-
constructor(viewName: string, createViewModel: (() => TViewModel) | (new () => TViewModel), props: any);
|
|
8
|
-
protected disposeViewModel(): void;
|
|
9
|
-
getStoredViewState(viewModel: (() => TViewModel) | (new () => TViewModel)): ViewState<TViewModel, TParams>;
|
|
10
|
-
}
|
|
1
|
+
import ViewBase from "./ViewBase";
|
|
2
|
+
import { ViewState } from './ViewState';
|
|
3
|
+
import { RouteParameterObject } from '../Routing/IRouteParameter';
|
|
4
|
+
import { IViewModel } from './IViewModel';
|
|
5
|
+
export default abstract class PersistentViewBase<TViewModel extends IViewModel, TParams extends RouteParameterObject<TParams> = {}> extends ViewBase<TViewModel, TParams> {
|
|
6
|
+
private static storedState;
|
|
7
|
+
constructor(viewName: string, createViewModel: (() => TViewModel) | (new () => TViewModel), props: any);
|
|
8
|
+
protected disposeViewModel(): void;
|
|
9
|
+
getStoredViewState(viewModel: (() => TViewModel) | (new () => TViewModel)): ViewState<TViewModel, TParams>;
|
|
10
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import ViewBase from "./ViewBase";
|
|
3
|
-
var PersistentViewBase = /** @class */ (function (_super) {
|
|
4
|
-
__extends(PersistentViewBase, _super);
|
|
5
|
-
function PersistentViewBase(viewName, createViewModel, props) {
|
|
6
|
-
return _super.call(this, viewName, createViewModel, props) || this;
|
|
7
|
-
}
|
|
8
|
-
PersistentViewBase.prototype.disposeViewModel = function () {
|
|
9
|
-
};
|
|
10
|
-
PersistentViewBase.prototype.getStoredViewState = function (viewModel) {
|
|
11
|
-
var storedState = PersistentViewBase.storedState[this.constructor.name];
|
|
12
|
-
if (!storedState) {
|
|
13
|
-
storedState = this.createViewState(viewModel);
|
|
14
|
-
PersistentViewBase.storedState[this.constructor.name] = storedState;
|
|
15
|
-
}
|
|
16
|
-
return storedState;
|
|
17
|
-
};
|
|
18
|
-
PersistentViewBase.storedState = {};
|
|
19
|
-
return PersistentViewBase;
|
|
20
|
-
}(ViewBase));
|
|
21
|
-
export default PersistentViewBase;
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import ViewBase from "./ViewBase";
|
|
3
|
+
var PersistentViewBase = /** @class */ (function (_super) {
|
|
4
|
+
__extends(PersistentViewBase, _super);
|
|
5
|
+
function PersistentViewBase(viewName, createViewModel, props) {
|
|
6
|
+
return _super.call(this, viewName, createViewModel, props) || this;
|
|
7
|
+
}
|
|
8
|
+
PersistentViewBase.prototype.disposeViewModel = function () {
|
|
9
|
+
};
|
|
10
|
+
PersistentViewBase.prototype.getStoredViewState = function (viewModel) {
|
|
11
|
+
var storedState = PersistentViewBase.storedState[this.constructor.name];
|
|
12
|
+
if (!storedState) {
|
|
13
|
+
storedState = this.createViewState(viewModel);
|
|
14
|
+
PersistentViewBase.storedState[this.constructor.name] = storedState;
|
|
15
|
+
}
|
|
16
|
+
return storedState;
|
|
17
|
+
};
|
|
18
|
+
PersistentViewBase.storedState = {};
|
|
19
|
+
return PersistentViewBase;
|
|
20
|
+
}(ViewBase));
|
|
21
|
+
export default PersistentViewBase;
|
package/dist/Views/ViewBase.d.ts
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Views, ITaskRunner } from '@singularsystems/neo-core';
|
|
3
|
-
import { RouteParameterObject } from '../Routing/IRouteParameter';
|
|
4
|
-
import { TransformParamsType, IViewParameterList, IViewParameterListOfT } from '../Routing/ViewParameterList';
|
|
5
|
-
import { match } from 'react-router';
|
|
6
|
-
import { ViewState } from './ViewState';
|
|
7
|
-
import { BreadCrumbItem } from '../Routing/BreadCrumbItem';
|
|
8
|
-
import { IViewModel } from './IViewModel';
|
|
9
|
-
import EmptyViewModel from './EmptyViewModel';
|
|
10
|
-
import { IRouteChangedProps } from '../Routing/IRouteChangedProps';
|
|
11
|
-
import { valueOrLazy } from './ViewModelBase';
|
|
12
|
-
export interface IViewBase extends Views.IViewBase {
|
|
13
|
-
viewParams: IViewParameterList;
|
|
14
|
-
updateViewParams(match: match): void;
|
|
15
|
-
getBreadCrumbList(): BreadCrumbItem[];
|
|
16
|
-
onLeave(): string | undefined;
|
|
17
|
-
beforeRouteChanged(props: IRouteChangedProps): void;
|
|
18
|
-
viewModel: IViewModel;
|
|
19
|
-
}
|
|
20
|
-
export interface IViewBaseConstructor {
|
|
21
|
-
params?: RouteParameterObject<any>;
|
|
22
|
-
}
|
|
23
|
-
export default abstract class ViewBase<TViewModel extends IViewModel = EmptyViewModel, TParams extends RouteParameterObject<TParams> = {}> extends React.Component implements IViewBase {
|
|
24
|
-
viewName: string;
|
|
25
|
-
static get currentView(): IViewBase | null;
|
|
26
|
-
private routingState;
|
|
27
|
-
navigation: import("../Routing").INavigationHelper;
|
|
28
|
-
private breadCrumbStartItems?;
|
|
29
|
-
protected viewState: ViewState<TViewModel, TParams>;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a view
|
|
32
|
-
* @param props React props.
|
|
33
|
-
* @param viewName Name of the view.
|
|
34
|
-
* @param viewModel Instance of view model, or view model type, or callback which returns a view model.
|
|
35
|
-
*/
|
|
36
|
-
constructor(viewName: string, viewModel: valueOrLazy<TViewModel>, props: any);
|
|
37
|
-
get viewModel(): TViewModel;
|
|
38
|
-
get taskRunner(): ITaskRunner;
|
|
39
|
-
get viewParams(): IViewParameterListOfT<TParams> & TransformParamsType<TParams>;
|
|
40
|
-
protected getStoredViewState(viewModel: valueOrLazy<TViewModel>): ViewState<TViewModel, TParams>;
|
|
41
|
-
protected createViewState(viewModel: valueOrLazy<TViewModel>): ViewState<TViewModel, TParams>;
|
|
42
|
-
componentDidMount(): void;
|
|
43
|
-
componentWillUnmount(): void;
|
|
44
|
-
updateViewParams(match: match): void;
|
|
45
|
-
/**
|
|
46
|
-
* viewParamsUpdated() is called when the component is mounted, and whenever a route parameter or query parameter gets a changed value.
|
|
47
|
-
*/
|
|
48
|
-
protected viewParamsUpdated(): void
|
|
49
|
-
/** Gets the parent breadcrumbs, and the breadcrumb for this view. */
|
|
50
|
-
protected getBreadCrumbStart(): BreadCrumbItem[];
|
|
51
|
-
/**
|
|
52
|
-
* Initialise is called from componentDidMount().
|
|
53
|
-
* Will only be called once per persistent view for the lifetime of the app.
|
|
54
|
-
* If overridden, you must call super.initialise() to initialise the ViewModel.
|
|
55
|
-
*/
|
|
56
|
-
protected initialise(): void | Promise<any>;
|
|
57
|
-
protected disposeViewModel(): void;
|
|
58
|
-
getBreadCrumbList(): BreadCrumbItem[];
|
|
59
|
-
/**
|
|
60
|
-
* Called when the user navigates to a new view, or when exiting the site.
|
|
61
|
-
* Return a string to show to the user in a dialog.
|
|
62
|
-
*/
|
|
63
|
-
onLeave(): string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Called whenever the route changes. Including navigating to a new view, leaving the site, or changing a route parameter in this view.
|
|
66
|
-
* Note: if props.leavePrompt is set, onLeave() will not be called.
|
|
67
|
-
* @param props
|
|
68
|
-
*/
|
|
69
|
-
beforeRouteChanged(props: IRouteChangedProps): void;
|
|
70
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Views, ITaskRunner } from '@singularsystems/neo-core';
|
|
3
|
+
import { RouteParameterObject } from '../Routing/IRouteParameter';
|
|
4
|
+
import { TransformParamsType, IViewParameterList, IViewParameterListOfT } from '../Routing/ViewParameterList';
|
|
5
|
+
import { match } from 'react-router';
|
|
6
|
+
import { ViewState } from './ViewState';
|
|
7
|
+
import { BreadCrumbItem } from '../Routing/BreadCrumbItem';
|
|
8
|
+
import { IViewModel } from './IViewModel';
|
|
9
|
+
import EmptyViewModel from './EmptyViewModel';
|
|
10
|
+
import { IRouteChangedProps } from '../Routing/IRouteChangedProps';
|
|
11
|
+
import { valueOrLazy } from './ViewModelBase';
|
|
12
|
+
export interface IViewBase extends Views.IViewBase {
|
|
13
|
+
viewParams: IViewParameterList;
|
|
14
|
+
updateViewParams(match: match): void;
|
|
15
|
+
getBreadCrumbList(): BreadCrumbItem[];
|
|
16
|
+
onLeave(): string | undefined;
|
|
17
|
+
beforeRouteChanged(props: IRouteChangedProps): void;
|
|
18
|
+
viewModel: IViewModel;
|
|
19
|
+
}
|
|
20
|
+
export interface IViewBaseConstructor {
|
|
21
|
+
params?: RouteParameterObject<any>;
|
|
22
|
+
}
|
|
23
|
+
export default abstract class ViewBase<TViewModel extends IViewModel = EmptyViewModel, TParams extends RouteParameterObject<TParams> = {}> extends React.Component implements IViewBase {
|
|
24
|
+
viewName: string;
|
|
25
|
+
static get currentView(): IViewBase | null;
|
|
26
|
+
private routingState;
|
|
27
|
+
navigation: import("../Routing").INavigationHelper;
|
|
28
|
+
private breadCrumbStartItems?;
|
|
29
|
+
protected viewState: ViewState<TViewModel, TParams>;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a view
|
|
32
|
+
* @param props React props.
|
|
33
|
+
* @param viewName Name of the view.
|
|
34
|
+
* @param viewModel Instance of view model, or view model type, or callback which returns a view model.
|
|
35
|
+
*/
|
|
36
|
+
constructor(viewName: string, viewModel: valueOrLazy<TViewModel>, props: any);
|
|
37
|
+
get viewModel(): TViewModel;
|
|
38
|
+
get taskRunner(): ITaskRunner;
|
|
39
|
+
get viewParams(): IViewParameterListOfT<TParams> & TransformParamsType<TParams>;
|
|
40
|
+
protected getStoredViewState(viewModel: valueOrLazy<TViewModel>): ViewState<TViewModel, TParams>;
|
|
41
|
+
protected createViewState(viewModel: valueOrLazy<TViewModel>): ViewState<TViewModel, TParams>;
|
|
42
|
+
componentDidMount(): void;
|
|
43
|
+
componentWillUnmount(): void;
|
|
44
|
+
updateViewParams(match: match): void;
|
|
45
|
+
/**
|
|
46
|
+
* viewParamsUpdated() is called when the component is mounted, and whenever a route parameter or query parameter gets a changed value.
|
|
47
|
+
*/
|
|
48
|
+
protected viewParamsUpdated(): void | Promise<void>;
|
|
49
|
+
/** Gets the parent breadcrumbs, and the breadcrumb for this view. */
|
|
50
|
+
protected getBreadCrumbStart(): BreadCrumbItem[];
|
|
51
|
+
/**
|
|
52
|
+
* Initialise is called from componentDidMount().
|
|
53
|
+
* Will only be called once per persistent view for the lifetime of the app.
|
|
54
|
+
* If overridden, you must call super.initialise() to initialise the ViewModel.
|
|
55
|
+
*/
|
|
56
|
+
protected initialise(): void | Promise<any>;
|
|
57
|
+
protected disposeViewModel(): void;
|
|
58
|
+
getBreadCrumbList(): BreadCrumbItem[];
|
|
59
|
+
/**
|
|
60
|
+
* Called when the user navigates to a new view, or when exiting the site.
|
|
61
|
+
* Return a string to show to the user in a dialog.
|
|
62
|
+
*/
|
|
63
|
+
onLeave(): string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Called whenever the route changes. Including navigating to a new view, leaving the site, or changing a route parameter in this view.
|
|
66
|
+
* Note: if props.leavePrompt is set, onLeave() will not be called.
|
|
67
|
+
* @param props
|
|
68
|
+
*/
|
|
69
|
+
beforeRouteChanged(props: IRouteChangedProps): void;
|
|
70
|
+
}
|