@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,14 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare class BreadCrumbItem {
|
|
3
|
-
/** Text to show in the breadcrumb component. */
|
|
4
|
-
label: string | (() => string);
|
|
5
|
-
/** URL to use when the breadcrumb is clicked. */
|
|
6
|
-
link?: string | undefined;
|
|
7
|
-
constructor(
|
|
8
|
-
/** Text to show in the breadcrumb component. */
|
|
9
|
-
label: string | (() => string),
|
|
10
|
-
/** URL to use when the breadcrumb is clicked. */
|
|
11
|
-
link?: string | undefined);
|
|
12
|
-
/** Optional callback for when the breadcrumb is clicked. */
|
|
13
|
-
onClick?: (e: React.MouseEvent) => void;
|
|
14
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare class BreadCrumbItem {
|
|
3
|
+
/** Text to show in the breadcrumb component. */
|
|
4
|
+
label: string | (() => string);
|
|
5
|
+
/** URL to use when the breadcrumb is clicked. */
|
|
6
|
+
link?: string | undefined;
|
|
7
|
+
constructor(
|
|
8
|
+
/** Text to show in the breadcrumb component. */
|
|
9
|
+
label: string | (() => string),
|
|
10
|
+
/** URL to use when the breadcrumb is clicked. */
|
|
11
|
+
link?: string | undefined);
|
|
12
|
+
/** Optional callback for when the breadcrumb is clicked. */
|
|
13
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
14
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var BreadCrumbItem = /** @class */ (function () {
|
|
2
|
-
function BreadCrumbItem(
|
|
3
|
-
/** Text to show in the breadcrumb component. */
|
|
4
|
-
label,
|
|
5
|
-
/** URL to use when the breadcrumb is clicked. */
|
|
6
|
-
link) {
|
|
7
|
-
this.label = label;
|
|
8
|
-
this.link = link;
|
|
9
|
-
}
|
|
10
|
-
return BreadCrumbItem;
|
|
11
|
-
}());
|
|
12
|
-
export { BreadCrumbItem };
|
|
1
|
+
var BreadCrumbItem = /** @class */ (function () {
|
|
2
|
+
function BreadCrumbItem(
|
|
3
|
+
/** Text to show in the breadcrumb component. */
|
|
4
|
+
label,
|
|
5
|
+
/** URL to use when the breadcrumb is clicked. */
|
|
6
|
+
link) {
|
|
7
|
+
this.label = label;
|
|
8
|
+
this.link = link;
|
|
9
|
+
}
|
|
10
|
+
return BreadCrumbItem;
|
|
11
|
+
}());
|
|
12
|
+
export { BreadCrumbItem };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Misc, Routing, Views } from "@singularsystems/neo-core";
|
|
2
|
-
import { match } from "react-router-dom";
|
|
3
|
-
export interface IRouteChangedProps {
|
|
4
|
-
/**
|
|
5
|
-
* True if the user is navigating to a new view or leaving the site. False if navigating to a sub route in this view.
|
|
6
|
-
*/
|
|
7
|
-
readonly isNewView: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* True if the window is being unloaded. Either by closing the tab, or navigating to an external site.
|
|
10
|
-
*/
|
|
11
|
-
readonly isUnload: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* The view (if it inherits from ViewBase) currently being rendered.
|
|
14
|
-
*/
|
|
15
|
-
readonly currentView?: Views.IViewBase;
|
|
16
|
-
/**
|
|
17
|
-
* The route being navigated to.
|
|
18
|
-
*/
|
|
19
|
-
readonly newRoute?: Routing.IRoute;
|
|
20
|
-
/**
|
|
21
|
-
* The url match information. Url parameter values can be viewed on this object.
|
|
22
|
-
*/
|
|
23
|
-
readonly match?: match;
|
|
24
|
-
/**
|
|
25
|
-
* A leave prompt to show the user before the location is changed.
|
|
26
|
-
* If you want to display your own prompt, set this to the promise returned by the modal.
|
|
27
|
-
* If you want to block navigation (with no option for the user to continue), return false.
|
|
28
|
-
* Note: if `isUnload` is true, the browser will show a native leave prompt regardless of whether you show a custom prompt.
|
|
29
|
-
*/
|
|
30
|
-
leavePrompt?: string | false | Promise<boolean> | Promise<Misc.ModalResult> | Promise<void>;
|
|
31
|
-
}
|
|
1
|
+
import { Misc, Routing, Views } from "@singularsystems/neo-core";
|
|
2
|
+
import { match } from "react-router-dom";
|
|
3
|
+
export interface IRouteChangedProps {
|
|
4
|
+
/**
|
|
5
|
+
* True if the user is navigating to a new view or leaving the site. False if navigating to a sub route in this view.
|
|
6
|
+
*/
|
|
7
|
+
readonly isNewView: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* True if the window is being unloaded. Either by closing the tab, or navigating to an external site.
|
|
10
|
+
*/
|
|
11
|
+
readonly isUnload: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The view (if it inherits from ViewBase) currently being rendered.
|
|
14
|
+
*/
|
|
15
|
+
readonly currentView?: Views.IViewBase;
|
|
16
|
+
/**
|
|
17
|
+
* The route being navigated to.
|
|
18
|
+
*/
|
|
19
|
+
readonly newRoute?: Routing.IRoute;
|
|
20
|
+
/**
|
|
21
|
+
* The url match information. Url parameter values can be viewed on this object.
|
|
22
|
+
*/
|
|
23
|
+
readonly match?: match;
|
|
24
|
+
/**
|
|
25
|
+
* A leave prompt to show the user before the location is changed.
|
|
26
|
+
* If you want to display your own prompt, set this to the promise returned by the modal.
|
|
27
|
+
* If you want to block navigation (with no option for the user to continue), return false.
|
|
28
|
+
* Note: if `isUnload` is true, the browser will show a native leave prompt regardless of whether you show a custom prompt.
|
|
29
|
+
*/
|
|
30
|
+
leavePrompt?: string | false | Promise<boolean> | Promise<Misc.ModalResult> | Promise<void>;
|
|
31
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export interface IRouteParameter {
|
|
2
|
-
/** True if the parameter exists in the query string */
|
|
3
|
-
isQuery?: boolean;
|
|
4
|
-
/** True if the parameter is required for the route to match. Does not apply to query string parameters. */
|
|
5
|
-
required?: boolean;
|
|
6
|
-
/** Behaviour when this node is clicked on in the breadcrumb. Undefined is equivalent to BreadCrumbSelectMode.Default */
|
|
7
|
-
selection?: BreadCrumbSelectMode;
|
|
8
|
-
}
|
|
9
|
-
export declare enum BreadCrumbSelectMode {
|
|
10
|
-
/** Default behaviour, clicking this will clear the values of all child params. */
|
|
11
|
-
Default = 0,
|
|
12
|
-
/** Breadcrumb is not selectable. */
|
|
13
|
-
None = 1,
|
|
14
|
-
/** Clicking on the breadcrumb item will select the parent item. */
|
|
15
|
-
SelectParent = 2
|
|
16
|
-
}
|
|
17
|
-
export
|
|
18
|
-
[index: string]: IRouteParameter;
|
|
19
|
-
};
|
|
20
|
-
export
|
|
21
|
-
[P in keyof T]: IRouteParameter;
|
|
22
|
-
};
|
|
1
|
+
export interface IRouteParameter {
|
|
2
|
+
/** True if the parameter exists in the query string */
|
|
3
|
+
isQuery?: boolean;
|
|
4
|
+
/** True if the parameter is required for the route to match. Does not apply to query string parameters. */
|
|
5
|
+
required?: boolean;
|
|
6
|
+
/** Behaviour when this node is clicked on in the breadcrumb. Undefined is equivalent to BreadCrumbSelectMode.Default */
|
|
7
|
+
selection?: BreadCrumbSelectMode;
|
|
8
|
+
}
|
|
9
|
+
export declare enum BreadCrumbSelectMode {
|
|
10
|
+
/** Default behaviour, clicking this will clear the values of all child params. */
|
|
11
|
+
Default = 0,
|
|
12
|
+
/** Breadcrumb is not selectable. */
|
|
13
|
+
None = 1,
|
|
14
|
+
/** Clicking on the breadcrumb item will select the parent item. */
|
|
15
|
+
SelectParent = 2
|
|
16
|
+
}
|
|
17
|
+
export type RouteParameters = {
|
|
18
|
+
[index: string]: IRouteParameter;
|
|
19
|
+
};
|
|
20
|
+
export type RouteParameterObject<T> = {
|
|
21
|
+
[P in keyof T]: IRouteParameter;
|
|
22
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export var BreadCrumbSelectMode;
|
|
2
|
-
(function (BreadCrumbSelectMode) {
|
|
3
|
-
/** Default behaviour, clicking this will clear the values of all child params. */
|
|
4
|
-
BreadCrumbSelectMode[BreadCrumbSelectMode["Default"] = 0] = "Default";
|
|
5
|
-
/** Breadcrumb is not selectable. */
|
|
6
|
-
BreadCrumbSelectMode[BreadCrumbSelectMode["None"] = 1] = "None";
|
|
7
|
-
/** Clicking on the breadcrumb item will select the parent item. */
|
|
8
|
-
BreadCrumbSelectMode[BreadCrumbSelectMode["SelectParent"] = 2] = "SelectParent";
|
|
9
|
-
})(BreadCrumbSelectMode || (BreadCrumbSelectMode = {}));
|
|
1
|
+
export var BreadCrumbSelectMode;
|
|
2
|
+
(function (BreadCrumbSelectMode) {
|
|
3
|
+
/** Default behaviour, clicking this will clear the values of all child params. */
|
|
4
|
+
BreadCrumbSelectMode[BreadCrumbSelectMode["Default"] = 0] = "Default";
|
|
5
|
+
/** Breadcrumb is not selectable. */
|
|
6
|
+
BreadCrumbSelectMode[BreadCrumbSelectMode["None"] = 1] = "None";
|
|
7
|
+
/** Clicking on the breadcrumb item will select the parent item. */
|
|
8
|
+
BreadCrumbSelectMode[BreadCrumbSelectMode["SelectParent"] = 2] = "SelectParent";
|
|
9
|
+
})(BreadCrumbSelectMode || (BreadCrumbSelectMode = {}));
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import ViewBase from '../Views/ViewBase';
|
|
2
|
-
import { Routing } from '@singularsystems/neo-core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import ViewBase from '../Views/ViewBase';
|
|
2
|
+
import { Routing } from '@singularsystems/neo-core';
|
|
3
|
+
import { RouteParameterObject } from './IRouteParameter';
|
|
4
|
+
export interface IMenuRoute extends Routing.IMenuRoute {
|
|
5
|
+
}
|
|
6
|
+
export declare class MenuRoute<TParams extends RouteParameterObject<TParams>> implements IMenuRoute {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a menu route with view parameters specified.
|
|
9
|
+
* @param baseRoute Path and component
|
|
10
|
+
* @param menuParams Other menu options.
|
|
11
|
+
* @param viewParams View parameter values.
|
|
12
|
+
*/
|
|
13
|
+
constructor(baseRoute: {
|
|
14
|
+
path: string;
|
|
15
|
+
component: new (...args: any) => ViewBase<any, TParams>;
|
|
16
|
+
}, menuParams: Routing.IMenuRoute, viewParams?: {
|
|
17
|
+
[P in keyof TParams]?: number | string | null;
|
|
18
|
+
});
|
|
19
|
+
/** Path including view param values. */
|
|
20
|
+
path: string;
|
|
21
|
+
/** Path without parameter values or routing template. */
|
|
22
|
+
basePath: string;
|
|
23
|
+
/** Name to show in the menu item. */
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ViewParameterList } from './ViewParameterList';
|
|
2
|
-
var MenuRoute = /** @class */ (function () {
|
|
3
|
-
/**
|
|
4
|
-
* Creates a menu route with view parameters specified.
|
|
5
|
-
* @param baseRoute Path and component
|
|
6
|
-
* @param menuParams Other menu options.
|
|
7
|
-
* @param viewParams View parameter values.
|
|
8
|
-
*/
|
|
9
|
-
function MenuRoute(baseRoute, menuParams, viewParams) {
|
|
10
|
-
var _this = this;
|
|
11
|
-
Object.getOwnPropertyNames(baseRoute).forEach(function (propertyName) {
|
|
12
|
-
_this[propertyName] = baseRoute[propertyName];
|
|
13
|
-
});
|
|
14
|
-
Object.getOwnPropertyNames(menuParams).forEach(function (propertyName) {
|
|
15
|
-
_this[propertyName] = menuParams[propertyName];
|
|
16
|
-
});
|
|
17
|
-
this.basePath = this.path;
|
|
18
|
-
if (viewParams) {
|
|
19
|
-
this.path = ViewParameterList.getPathForValues(this.basePath, baseRoute.component.params, viewParams);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return MenuRoute;
|
|
23
|
-
}());
|
|
24
|
-
export { MenuRoute };
|
|
1
|
+
import { ViewParameterList } from './ViewParameterList';
|
|
2
|
+
var MenuRoute = /** @class */ (function () {
|
|
3
|
+
/**
|
|
4
|
+
* Creates a menu route with view parameters specified.
|
|
5
|
+
* @param baseRoute Path and component
|
|
6
|
+
* @param menuParams Other menu options.
|
|
7
|
+
* @param viewParams View parameter values.
|
|
8
|
+
*/
|
|
9
|
+
function MenuRoute(baseRoute, menuParams, viewParams) {
|
|
10
|
+
var _this = this;
|
|
11
|
+
Object.getOwnPropertyNames(baseRoute).forEach(function (propertyName) {
|
|
12
|
+
_this[propertyName] = baseRoute[propertyName];
|
|
13
|
+
});
|
|
14
|
+
Object.getOwnPropertyNames(menuParams).forEach(function (propertyName) {
|
|
15
|
+
_this[propertyName] = menuParams[propertyName];
|
|
16
|
+
});
|
|
17
|
+
this.basePath = this.path;
|
|
18
|
+
if (viewParams) {
|
|
19
|
+
this.path = ViewParameterList.getPathForValues(this.basePath, baseRoute.component.params, viewParams);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return MenuRoute;
|
|
23
|
+
}());
|
|
24
|
+
export { MenuRoute };
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import ViewBase from '../Views/ViewBase';
|
|
2
|
-
import { RouteComponentProps } from 'react-router';
|
|
3
|
-
import { RoutingState } from './RoutingState';
|
|
4
|
-
import { INavigationHelper as INeoNavigationHelper } from '@singularsystems/neo-core/dist/Routing/INavigationHelper';
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @param
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
* @param
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
1
|
+
import ViewBase from '../Views/ViewBase';
|
|
2
|
+
import { RouteComponentProps } from 'react-router';
|
|
3
|
+
import { RoutingState } from './RoutingState';
|
|
4
|
+
import { INavigationHelper as INeoNavigationHelper } from '@singularsystems/neo-core/dist/Routing/INavigationHelper';
|
|
5
|
+
import { RouteParameterObject } from './IRouteParameter';
|
|
6
|
+
export type ViewConstructor<TParams extends RouteParameterObject<TParams>> = new (...args: any) => ViewBase<any, TParams>;
|
|
7
|
+
export type ParamValues<TParams> = {
|
|
8
|
+
[P in keyof TParams]?: number | string | null;
|
|
9
|
+
};
|
|
10
|
+
export interface INavigationHelper extends INeoNavigationHelper {
|
|
11
|
+
/**
|
|
12
|
+
* Navigates to the view, if the view component is found in the routes definition.
|
|
13
|
+
* If the view is bound to multiple routes, the first one will be used.
|
|
14
|
+
* @param view View component which inherits from view base.
|
|
15
|
+
* @param paramValues View params to include in the url to pass to the view.
|
|
16
|
+
*/
|
|
17
|
+
navigateToView<TParams extends RouteParameterObject<TParams>>(view: ViewConstructor<TParams>, paramValues?: ParamValues<TParams>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the full path for a view including view parameter values.
|
|
20
|
+
* @param view View component which inherits from view base.
|
|
21
|
+
* @param paramValues View params to include in the url to pass to the view.
|
|
22
|
+
*/
|
|
23
|
+
getPathForView<TParams extends RouteParameterObject<TParams>>(view: ViewConstructor<TParams>, paramValues?: ParamValues<TParams>): string;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the path of the currently rendered view, without parameter components.
|
|
26
|
+
*/
|
|
27
|
+
getCurrentViewPath(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the react-router properties for the current route.
|
|
30
|
+
*/
|
|
31
|
+
readonly currentRouteProps: RouteComponentProps;
|
|
32
|
+
}
|
|
33
|
+
export default class NavigationHelper implements INavigationHelper {
|
|
34
|
+
private routingState;
|
|
35
|
+
constructor(routingState: RoutingState);
|
|
36
|
+
navigateInternal(url: string, replace?: boolean): void;
|
|
37
|
+
navigateToView<TParams extends RouteParameterObject<TParams>>(view: ViewConstructor<TParams>, paramValues?: ParamValues<TParams>): void;
|
|
38
|
+
getPathForView<TParams extends RouteParameterObject<TParams>>(view: ViewConstructor<TParams>, paramValues?: ParamValues<TParams>): string;
|
|
39
|
+
getCurrentViewPath(): string;
|
|
40
|
+
get currentRouteProps(): import("react-router").RouteComponentProps<{}, import("react-router").StaticContext, unknown>;
|
|
41
|
+
}
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import { ViewParameterList } from './ViewParameterList';
|
|
3
|
-
import { injectable, inject } from 'inversify';
|
|
4
|
-
import { NeoReactTypes } from '../Modules/Types';
|
|
5
|
-
import { RoutingState } from './RoutingState';
|
|
6
|
-
var NavigationHelper = /** @class */ (function () {
|
|
7
|
-
function NavigationHelper(routingState) {
|
|
8
|
-
this.routingState = routingState;
|
|
9
|
-
}
|
|
10
|
-
NavigationHelper.prototype.navigateInternal = function (url, replace) {
|
|
11
|
-
if (replace === void 0) { replace = false; }
|
|
12
|
-
if (replace) {
|
|
13
|
-
this.currentRouteProps.history.replace(url);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
this.currentRouteProps.history.push(url);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
NavigationHelper.prototype.navigateToView = function (view, paramValues) {
|
|
20
|
-
this.navigateInternal(this.getPathForView(view, paramValues));
|
|
21
|
-
};
|
|
22
|
-
NavigationHelper.prototype.getPathForView = function (view, paramValues) {
|
|
23
|
-
var basePath = this.routingState.appRouteProvider.getPathForComponent(view);
|
|
24
|
-
if (basePath) {
|
|
25
|
-
if (paramValues) {
|
|
26
|
-
return ViewParameterList.getPathForValues(basePath, view.params, paramValues);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return basePath;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
throw Error("Cannot find route for component " + view.name);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
NavigationHelper.prototype.getCurrentViewPath = function () {
|
|
37
|
-
var basePath = this.currentRouteProps.match.path;
|
|
38
|
-
var paramIndex = basePath.indexOf(":");
|
|
39
|
-
if (paramIndex > 0) {
|
|
40
|
-
basePath = basePath.substring(0, paramIndex);
|
|
41
|
-
if (basePath.endsWith("/")) {
|
|
42
|
-
basePath = basePath.substring(0, basePath.length - 1);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return basePath;
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(NavigationHelper.prototype, "currentRouteProps", {
|
|
48
|
-
get: function () {
|
|
49
|
-
return this.routingState.currentRouteProps;
|
|
50
|
-
},
|
|
51
|
-
enumerable: false,
|
|
52
|
-
configurable: true
|
|
53
|
-
});
|
|
54
|
-
NavigationHelper = __decorate([
|
|
55
|
-
injectable(),
|
|
56
|
-
__param(0, inject(NeoReactTypes.Routing.GlobalRoutingState.symbol)),
|
|
57
|
-
__metadata("design:paramtypes", [RoutingState])
|
|
58
|
-
], NavigationHelper);
|
|
59
|
-
return NavigationHelper;
|
|
60
|
-
}());
|
|
61
|
-
export default NavigationHelper;
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { ViewParameterList } from './ViewParameterList';
|
|
3
|
+
import { injectable, inject } from 'inversify';
|
|
4
|
+
import { NeoReactTypes } from '../Modules/Types';
|
|
5
|
+
import { RoutingState } from './RoutingState';
|
|
6
|
+
var NavigationHelper = /** @class */ (function () {
|
|
7
|
+
function NavigationHelper(routingState) {
|
|
8
|
+
this.routingState = routingState;
|
|
9
|
+
}
|
|
10
|
+
NavigationHelper.prototype.navigateInternal = function (url, replace) {
|
|
11
|
+
if (replace === void 0) { replace = false; }
|
|
12
|
+
if (replace) {
|
|
13
|
+
this.currentRouteProps.history.replace(url);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.currentRouteProps.history.push(url);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
NavigationHelper.prototype.navigateToView = function (view, paramValues) {
|
|
20
|
+
this.navigateInternal(this.getPathForView(view, paramValues));
|
|
21
|
+
};
|
|
22
|
+
NavigationHelper.prototype.getPathForView = function (view, paramValues) {
|
|
23
|
+
var basePath = this.routingState.appRouteProvider.getPathForComponent(view);
|
|
24
|
+
if (basePath) {
|
|
25
|
+
if (paramValues) {
|
|
26
|
+
return ViewParameterList.getPathForValues(basePath, view.params, paramValues);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return basePath;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw Error("Cannot find route for component " + view.name);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
NavigationHelper.prototype.getCurrentViewPath = function () {
|
|
37
|
+
var basePath = this.currentRouteProps.match.path;
|
|
38
|
+
var paramIndex = basePath.indexOf(":");
|
|
39
|
+
if (paramIndex > 0) {
|
|
40
|
+
basePath = basePath.substring(0, paramIndex);
|
|
41
|
+
if (basePath.endsWith("/")) {
|
|
42
|
+
basePath = basePath.substring(0, basePath.length - 1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return basePath;
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(NavigationHelper.prototype, "currentRouteProps", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return this.routingState.currentRouteProps;
|
|
50
|
+
},
|
|
51
|
+
enumerable: false,
|
|
52
|
+
configurable: true
|
|
53
|
+
});
|
|
54
|
+
NavigationHelper = __decorate([
|
|
55
|
+
injectable(),
|
|
56
|
+
__param(0, inject(NeoReactTypes.Routing.GlobalRoutingState.symbol)),
|
|
57
|
+
__metadata("design:paramtypes", [RoutingState])
|
|
58
|
+
], NavigationHelper);
|
|
59
|
+
return NavigationHelper;
|
|
60
|
+
}());
|
|
61
|
+
export default NavigationHelper;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Routing, Views } from '@singularsystems/neo-core';
|
|
2
|
-
import { RoutingState } from './RoutingState';
|
|
3
|
-
export declare class PageLeaveHandler implements Routing.IPageLeaveHandler {
|
|
4
|
-
private routingState;
|
|
5
|
-
constructor(routingState: RoutingState);
|
|
6
|
-
/**
|
|
7
|
-
* Handler for react-routers BrowserRouter.getUserConfirmation
|
|
8
|
-
*/
|
|
9
|
-
static showNavigationConfirmation(prompt: string, callback: (ok: boolean) => void): Promise<void>;
|
|
10
|
-
onWindowUnload(view: Views.IViewBase | null, e: BeforeUnloadEvent): void;
|
|
11
|
-
onLeavePage(view: Views.IViewBase | null, prompt: string, location: Routing.NavigateLocation): Promise<boolean>;
|
|
12
|
-
protected showDefaultConfirmation(view: Views.IViewBase | null, prompt: string, location: Routing.NavigateLocation): Promise<boolean>;
|
|
13
|
-
}
|
|
1
|
+
import { Routing, Views } from '@singularsystems/neo-core';
|
|
2
|
+
import { RoutingState } from './RoutingState';
|
|
3
|
+
export declare class PageLeaveHandler implements Routing.IPageLeaveHandler {
|
|
4
|
+
private routingState;
|
|
5
|
+
constructor(routingState: RoutingState);
|
|
6
|
+
/**
|
|
7
|
+
* Handler for react-routers BrowserRouter.getUserConfirmation
|
|
8
|
+
*/
|
|
9
|
+
static showNavigationConfirmation(prompt: string, callback: (ok: boolean) => void): Promise<void>;
|
|
10
|
+
onWindowUnload(view: Views.IViewBase | null, e: BeforeUnloadEvent): void;
|
|
11
|
+
onLeavePage(view: Views.IViewBase | null, prompt: string, location: Routing.NavigateLocation): Promise<boolean>;
|
|
12
|
+
protected showDefaultConfirmation(view: Views.IViewBase | null, prompt: string, location: Routing.NavigateLocation): Promise<boolean>;
|
|
13
|
+
}
|