@singularsystems/neo-react 1.0.0-beta.6 → 1.0.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 +138 -0
- package/dist/Modules/Types.d.ts +4 -0
- package/dist/React/AutoRunner.js +5 -1
- package/dist/ReactComponents/Card.d.ts +1 -1
- package/dist/ReactComponents/Collapsable.d.ts +1 -1
- package/dist/ReactComponents/ColorPicker.d.ts +1 -1
- package/dist/ReactComponents/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ReactComponents/ContextMenu/ContextMenuContainer.d.ts +1 -1
- package/dist/ReactComponents/ContextMenu/ContextMenuState.js +2 -1
- package/dist/ReactComponents/DatePicker.d.ts +1 -1
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.d.ts +1 -1
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js +1 -2
- package/dist/ReactComponents/DropDown/DropDown.d.ts +1 -1
- package/dist/ReactComponents/DropDown/DropDown.js +11 -7
- package/dist/ReactComponents/DropDown/DropDownBase.d.ts +2 -2
- package/dist/ReactComponents/DropDown/LookupHelper.d.ts +4 -4
- package/dist/ReactComponents/ErrorHandler.js +2 -1
- package/dist/ReactComponents/FileManager/FileBasicInput.d.ts +1 -1
- package/dist/ReactComponents/FileManager/FileBasicInput.js +2 -1
- package/dist/ReactComponents/FileManager/FileContext.d.ts +1 -1
- package/dist/ReactComponents/FileManager/FileDropArea.d.ts +1 -1
- package/dist/ReactComponents/FileManager/FileInput.d.ts +1 -1
- package/dist/ReactComponents/FileManager/FileUploadButton.d.ts +1 -1
- package/dist/ReactComponents/FileManager/FileUploadProgress.d.ts +1 -1
- package/dist/ReactComponents/Form.d.ts +1 -1
- package/dist/ReactComponents/FormContext.d.ts +1 -1
- package/dist/ReactComponents/FormContext.js +2 -1
- package/dist/ReactComponents/FormGroup/FormGroup.d.ts +1 -1
- package/dist/ReactComponents/FormGroup/FormGroup.js +2 -1
- package/dist/ReactComponents/FormGroup/FormGroupFloating.d.ts +1 -1
- package/dist/ReactComponents/FormGroup/FormGroupInline.d.ts +1 -1
- package/dist/ReactComponents/Grid/ButtonColumn.d.ts +1 -1
- package/dist/ReactComponents/Grid/ButtonColumn.js +3 -2
- package/dist/ReactComponents/Grid/Column.d.ts +1 -1
- package/dist/ReactComponents/Grid/Grid.d.ts +2 -2
- package/dist/ReactComponents/Grid/Row.d.ts +2 -2
- package/dist/ReactComponents/Grid/Row.js +4 -2
- package/dist/ReactComponents/GridLayout.d.ts +1 -1
- package/dist/ReactComponents/Icons/FontAwesomeIconFactory.js +2 -1
- package/dist/ReactComponents/Icons/IconFactory.js +2 -1
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.js +1 -2
- package/dist/ReactComponents/Input.d.ts +1 -1
- package/dist/ReactComponents/InputHelpers.d.ts +1 -1
- package/dist/ReactComponents/Link.d.ts +1 -1
- package/dist/ReactComponents/Loader.d.ts +1 -1
- package/dist/ReactComponents/Modal/Modal.d.ts +1 -1
- package/dist/ReactComponents/Modal/ModalContainer.d.ts +1 -1
- package/dist/ReactComponents/Modal/ModalPortal.d.ts +1 -1
- package/dist/ReactComponents/Notifications/Alert.d.ts +1 -1
- package/dist/ReactComponents/Notifications/Toast.d.ts +1 -1
- package/dist/ReactComponents/Notifications/ToastContainer.d.ts +1 -1
- package/dist/ReactComponents/NumberInput.d.ts +1 -1
- package/dist/ReactComponents/Paging/BasicPagerControls.d.ts +1 -1
- package/dist/ReactComponents/Paging/PageSizeControl.d.ts +1 -1
- package/dist/ReactComponents/Paging/Pager.d.ts +1 -1
- package/dist/ReactComponents/ProgressBar.d.ts +1 -1
- package/dist/ReactComponents/PropTypes.d.ts +1 -1
- package/dist/ReactComponents/PropTypes.js +3 -1
- package/dist/ReactComponents/RadioList.d.ts +1 -1
- package/dist/ReactComponents/Slider.d.ts +1 -1
- package/dist/ReactComponents/Slider.js +1 -1
- package/dist/ReactComponents/Tabs/Tab.d.ts +3 -3
- package/dist/ReactComponents/Tabs/Tab.js +1 -2
- package/dist/ReactComponents/Tabs/TabContainer.d.ts +1 -1
- package/dist/ReactComponents/Tabs/TabContainer.js +1 -1
- package/dist/ReactComponents/Tabs/TabManager.d.ts +5 -4
- package/dist/ReactComponents/Tabs/TabManager.js +4 -2
- package/dist/ReactComponents/Tooltip.d.ts +7 -3
- package/dist/ReactComponents/TooltipHelper.d.ts +1 -0
- package/dist/ReactComponents/TooltipHelper.js +7 -3
- package/dist/ReactComponents/TooltipProvider.d.ts +1 -1
- package/dist/ReactComponents/ValidationSummary.d.ts +1 -1
- package/dist/Routing/MenuRoute.js +2 -0
- package/dist/Routing/PageLeaveHandler.js +2 -1
- package/dist/Routing/RoutingState.js +2 -1
- package/dist/Routing/ViewParameter.js +2 -1
- package/dist/Routing/ViewParameterList.d.ts +2 -1
- package/dist/Routing/ViewParameterList.js +5 -0
- package/dist/Services/DisposeHelper.js +2 -1
- package/dist/Views/ViewBase.js +1 -1
- package/dist/Views/ViewModelBase.d.ts +3 -1
- package/dist/Views/ViewModelBase.js +1 -5
- package/package.json +12 -10
- package/dist/React/Decorators.d.ts +0 -4
- package/dist/React/Decorators.js +0 -15
- package/dist/React/Utils.d.ts +0 -2
- package/dist/React/Utils.js +0 -15
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { injectable } from "inversify";
|
|
4
4
|
import { IconFactory } from "./IconFactory";
|
|
5
5
|
/** Icon factory supporting font-awesome string, as well as the font-awesome icon definition and component. */
|
|
6
|
-
|
|
6
|
+
var FontAwesomeIconFactory = /** @class */ (function (_super) {
|
|
7
7
|
__extends(FontAwesomeIconFactory, _super);
|
|
8
8
|
/**
|
|
9
9
|
* Creates a font awesome factory, allowing the use of IconDefinition on any neo icon prop.
|
|
@@ -41,3 +41,4 @@ export var FontAwesomeIconFactory = /** @class */ (function (_super) {
|
|
|
41
41
|
], FontAwesomeIconFactory);
|
|
42
42
|
return FontAwesomeIconFactory;
|
|
43
43
|
}(IconFactory));
|
|
44
|
+
export { FontAwesomeIconFactory };
|
|
@@ -3,7 +3,7 @@ import { Utils } from "@singularsystems/neo-core";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { injectable } from 'inversify';
|
|
5
5
|
/** Default icon factory supporting font-awesome strings. */
|
|
6
|
-
|
|
6
|
+
var IconFactory = /** @class */ (function () {
|
|
7
7
|
function IconFactory() {
|
|
8
8
|
}
|
|
9
9
|
IconFactory.prototype.getIconComponent = function (iconOrName, style) {
|
|
@@ -49,3 +49,4 @@ export var IconFactory = /** @class */ (function () {
|
|
|
49
49
|
], IconFactory);
|
|
50
50
|
return IconFactory;
|
|
51
51
|
}());
|
|
52
|
+
export { IconFactory };
|
|
@@ -8,9 +8,8 @@ import { IconFactory } from ".";
|
|
|
8
8
|
var MaterialSymbolsFontFactory = /** @class */ (function (_super) {
|
|
9
9
|
__extends(MaterialSymbolsFontFactory, _super);
|
|
10
10
|
function MaterialSymbolsFontFactory(options) {
|
|
11
|
-
var _this = this;
|
|
12
11
|
var _a;
|
|
13
|
-
_this = _super.call(this) || this;
|
|
12
|
+
var _this = _super.call(this) || this;
|
|
14
13
|
_this.filledByDefault = (_a = options === null || options === void 0 ? void 0 : options.fillDefault) !== null && _a !== void 0 ? _a : false;
|
|
15
14
|
if ((options === null || options === void 0 ? void 0 : options.fontAwesomeMappings) && (options === null || options === void 0 ? void 0 : options.replaceNeoMappings)) {
|
|
16
15
|
_this.fontAwesomeMap = new Map(options.fontAwesomeMappings);
|
|
@@ -31,7 +31,7 @@ export default class Input extends ComponentBase<IInputProps> {
|
|
|
31
31
|
private determineType;
|
|
32
32
|
afterRender(): void;
|
|
33
33
|
private onChanged;
|
|
34
|
-
render(): JSX.Element;
|
|
34
|
+
render(): React.JSX.Element;
|
|
35
35
|
}
|
|
36
36
|
export declare class Textbox extends Input {
|
|
37
37
|
constructor(props: any);
|
|
@@ -2,5 +2,5 @@ import * as React from 'react';
|
|
|
2
2
|
import { ICommonEditorProps } from './PropTypes';
|
|
3
3
|
export declare class InputHelpers {
|
|
4
4
|
private static iconFactory?;
|
|
5
|
-
static surroundWithInputGroup<T extends React.ReactNode>(element: T, props: ICommonEditorProps, inputRef?: React.RefObject<HTMLElement>): JSX.Element | T;
|
|
5
|
+
static surroundWithInputGroup<T extends React.ReactNode>(element: T, props: ICommonEditorProps, inputRef?: React.RefObject<HTMLElement>): React.JSX.Element | T;
|
|
6
6
|
}
|
|
@@ -12,7 +12,7 @@ export default class Loader extends ComponentBase<ILoaderProps> {
|
|
|
12
12
|
overlayRef: React.RefObject<HTMLDivElement>;
|
|
13
13
|
isShowing: boolean;
|
|
14
14
|
hasAnimated: boolean;
|
|
15
|
-
render(): JSX.Element;
|
|
15
|
+
render(): React.JSX.Element;
|
|
16
16
|
afterRender(): void;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -12,6 +12,6 @@ export default class ModalContainer extends React.Component<IModalContainerProps
|
|
|
12
12
|
private containerRef;
|
|
13
13
|
componentDidMount(): void;
|
|
14
14
|
componentDidUpdate(): void;
|
|
15
|
-
render(): JSX.Element | (0 | JSX.Element)[];
|
|
15
|
+
render(): React.JSX.Element | (0 | React.JSX.Element)[];
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -3,5 +3,5 @@ import { Components } from "@singularsystems/neo-core";
|
|
|
3
3
|
import CollapsableBase from '../CollapsableBase';
|
|
4
4
|
export default class Alert extends CollapsableBase<Components.INotificationOptions & React.HTMLProps<HTMLDivElement>> {
|
|
5
5
|
private iconFactory;
|
|
6
|
-
render(): JSX.Element;
|
|
6
|
+
render(): React.JSX.Element;
|
|
7
7
|
}
|
|
@@ -22,5 +22,5 @@ export interface IPagerControlsProps extends React.HTMLProps<HTMLUListElement> {
|
|
|
22
22
|
}
|
|
23
23
|
export default class SimplePagerControls extends React.Component<IPagerControlsProps> {
|
|
24
24
|
private iconFactory;
|
|
25
|
-
render(): false | JSX.Element;
|
|
25
|
+
render(): false | React.JSX.Element;
|
|
26
26
|
}
|
|
@@ -21,5 +21,5 @@ export default class Pager<TCriteria extends ValueObject, TModel extends Model.I
|
|
|
21
21
|
constructor(props: IPagerBaseProps<TCriteria, TModel>);
|
|
22
22
|
componentDidMount(): void;
|
|
23
23
|
componentDidUpdate(): void;
|
|
24
|
-
render(): JSX.Element | null;
|
|
24
|
+
render(): React.JSX.Element | null;
|
|
25
25
|
}
|
|
@@ -15,5 +15,5 @@ export interface IProgressBarProps {
|
|
|
15
15
|
export default class ProgressBar extends React.Component<IProgressBarProps & React.HTMLProps<HTMLDivElement>> {
|
|
16
16
|
innerRef: React.RefObject<HTMLDivElement>;
|
|
17
17
|
componentDidMount(): void;
|
|
18
|
-
render(): JSX.Element;
|
|
18
|
+
render(): React.JSX.Element;
|
|
19
19
|
}
|
|
@@ -137,7 +137,7 @@ export declare class BindPropsHelper {
|
|
|
137
137
|
static getBindProperty<T>(allProps: IEditorContainerProps<T, any>): Model.IPropertyInstance;
|
|
138
138
|
static splitCommonEditorProps<T extends ICommonEditorProps>(props: T): {
|
|
139
139
|
editor: ICommonEditorProps;
|
|
140
|
-
rest: Omit<T, "
|
|
140
|
+
rest: Omit<T, "append" | "prepend" | "disabled" | "readOnly" | "isDisabled" | "isReadOnly" | "prependText" | "appendText" | "inputElement">;
|
|
141
141
|
};
|
|
142
142
|
static normaliseContainerProps<T, TContainerDom = React.HTMLProps<T>, TData = any>(component: IComponentBase, props: IEditorContainerProps<T, TData>, inGroup: boolean, isBootstrap?: boolean): IEditorContainerNormalisedProps<TContainerDom, TData>;
|
|
143
143
|
static normaliseEditorProps<T, TDom = React.HTMLProps<T>>(component: IComponentBase, props: (IEditorAndSelectorProps<T, any> & TDom) | IEditorNormalisedProps<TDom, any>): IEditorNormalisedProps<TDom, any>;
|
|
@@ -24,7 +24,7 @@ export var CheckboxType;
|
|
|
24
24
|
CheckboxType[CheckboxType["Checkbox"] = 1] = "Checkbox";
|
|
25
25
|
CheckboxType[CheckboxType["Switch"] = 2] = "Switch";
|
|
26
26
|
})(CheckboxType || (CheckboxType = {}));
|
|
27
|
-
|
|
27
|
+
var BindPropsHelper = /** @class */ (function () {
|
|
28
28
|
function BindPropsHelper() {
|
|
29
29
|
}
|
|
30
30
|
Object.defineProperty(BindPropsHelper, "config", {
|
|
@@ -207,6 +207,7 @@ export var BindPropsHelper = /** @class */ (function () {
|
|
|
207
207
|
domProps.id = (_a = formContext.uniqueId) !== null && _a !== void 0 ? _a : props.uniqueID;
|
|
208
208
|
}
|
|
209
209
|
if (this.config.isTestOrDevelopment) {
|
|
210
|
+
//@ts-ignore
|
|
210
211
|
domProps[BindPropsHelper.DataFieldName] = props.bind.propertyInfo.propertyName;
|
|
211
212
|
}
|
|
212
213
|
if (this.isReadOnly(props.editor, formContext)) {
|
|
@@ -261,3 +262,4 @@ export var BindPropsHelper = /** @class */ (function () {
|
|
|
261
262
|
BindPropsHelper.DataFieldName = "data-field-name";
|
|
262
263
|
return BindPropsHelper;
|
|
263
264
|
}());
|
|
265
|
+
export { BindPropsHelper };
|
|
@@ -14,7 +14,7 @@ var Slider = /** @class */ (function (_super) {
|
|
|
14
14
|
_this.sliderImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.Slider);
|
|
15
15
|
_this.rangeImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.Range);
|
|
16
16
|
_this.onChangeHandler = function (value) {
|
|
17
|
-
if (
|
|
17
|
+
if (!(value instanceof Array)) {
|
|
18
18
|
// This is a <Slider/>
|
|
19
19
|
_this.props.bind.value = value;
|
|
20
20
|
}
|
|
@@ -34,9 +34,9 @@ export default class Tab extends React.Component<ITabProps> {
|
|
|
34
34
|
private iconFactory;
|
|
35
35
|
constructor(props: ITabProps);
|
|
36
36
|
componentDidMount(): void;
|
|
37
|
-
render(): false | JSX.Element;
|
|
37
|
+
render(): false | React.JSX.Element;
|
|
38
38
|
onClick(e: React.MouseEvent<HTMLAnchorElement>): void;
|
|
39
|
-
renderHeader(isSelected: boolean): JSX.Element;
|
|
40
|
-
renderBody(isSelected: boolean): false | JSX.Element;
|
|
39
|
+
renderHeader(isSelected: boolean): React.JSX.Element;
|
|
40
|
+
renderBody(isSelected: boolean): false | React.JSX.Element;
|
|
41
41
|
}
|
|
42
42
|
export {};
|
|
@@ -7,9 +7,8 @@ import { NeoReactTypes } from "../../Modules/Types";
|
|
|
7
7
|
var Tab = /** @class */ (function (_super) {
|
|
8
8
|
__extends(Tab, _super);
|
|
9
9
|
function Tab(props) {
|
|
10
|
-
var _this = this;
|
|
11
10
|
var _a;
|
|
12
|
-
_this = _super.call(this, props) || this;
|
|
11
|
+
var _this = _super.call(this, props) || this;
|
|
13
12
|
_this.hasRenderedContents = false;
|
|
14
13
|
_this.iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
|
|
15
14
|
_this.onClick = _this.onClick.bind(_this);
|
|
@@ -40,5 +40,5 @@ export default class TabContainer extends React.Component<ITabContainerProps & R
|
|
|
40
40
|
constructor(props: ITabContainerProps & React.HTMLProps<HTMLDivElement>);
|
|
41
41
|
componentDidMount(): void;
|
|
42
42
|
componentWillUnmount(): void;
|
|
43
|
-
render(): JSX.Element;
|
|
43
|
+
render(): React.JSX.Element;
|
|
44
44
|
}
|
|
@@ -35,7 +35,7 @@ var TabContainer = /** @class */ (function (_super) {
|
|
|
35
35
|
this.tabManager.initialise();
|
|
36
36
|
};
|
|
37
37
|
TabContainer.prototype.componentWillUnmount = function () {
|
|
38
|
-
this.tabManager.
|
|
38
|
+
this.tabManager.onUnmount();
|
|
39
39
|
};
|
|
40
40
|
TabContainer.prototype.render = function () {
|
|
41
41
|
var _a = this.props, tabManager = _a.tabManager, selectedTab = _a.selectedTab, variant = _a.variant, fillMode = _a.fillMode, align = _a.align, verticalSizes = _a.verticalSizes, keepMounted = _a.keepMounted, domProps = __rest(_a, ["tabManager", "selectedTab", "variant", "fillMode", "align", "verticalSizes", "keepMounted"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model } from '@singularsystems/neo-core';
|
|
1
|
+
import { Misc, Model } from '@singularsystems/neo-core';
|
|
2
2
|
import { ICancellableEvent } from '../Misc';
|
|
3
3
|
export interface ITabManager {
|
|
4
4
|
selectedTab: string;
|
|
@@ -14,13 +14,13 @@ export interface ITabManager {
|
|
|
14
14
|
export interface ITabManagerInternal extends ITabManager {
|
|
15
15
|
initialise(): void;
|
|
16
16
|
tabMounted(tabKey: string, onLeave?: (e: ICancellableEvent) => void): void;
|
|
17
|
-
|
|
17
|
+
onUnmount(): void;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Tab manager used to manage a tab component.
|
|
21
21
|
* @param T string union type of tab names.
|
|
22
22
|
*/
|
|
23
|
-
export declare class TabManager<T extends string = string> {
|
|
23
|
+
export declare class TabManager<T extends string = string> implements Misc.IDisposable {
|
|
24
24
|
private autoSelectFirstTab;
|
|
25
25
|
private reactionDisposer;
|
|
26
26
|
observable: Model.IObservableValue<T>;
|
|
@@ -33,7 +33,7 @@ export declare class TabManager<T extends string = string> {
|
|
|
33
33
|
/** Called by tab container. */
|
|
34
34
|
private initialise;
|
|
35
35
|
/** Called by tab container. */
|
|
36
|
-
private
|
|
36
|
+
private onUnmount;
|
|
37
37
|
get selectedTab(): T;
|
|
38
38
|
set selectedTab(value: T);
|
|
39
39
|
/**
|
|
@@ -61,4 +61,5 @@ export declare class TabManager<T extends string = string> {
|
|
|
61
61
|
resetAll(reInitialise?: boolean): void;
|
|
62
62
|
private tabs;
|
|
63
63
|
private onTabChanged;
|
|
64
|
+
dispose(): void;
|
|
64
65
|
}
|
|
@@ -33,8 +33,7 @@ var TabManager = /** @class */ (function () {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
/** Called by tab container. */
|
|
36
|
-
TabManager.prototype.
|
|
37
|
-
this.reactionDisposer();
|
|
36
|
+
TabManager.prototype.onUnmount = function () {
|
|
38
37
|
};
|
|
39
38
|
Object.defineProperty(TabManager.prototype, "selectedTab", {
|
|
40
39
|
get: function () {
|
|
@@ -142,6 +141,9 @@ var TabManager = /** @class */ (function () {
|
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
};
|
|
144
|
+
TabManager.prototype.dispose = function () {
|
|
145
|
+
this.reactionDisposer();
|
|
146
|
+
};
|
|
145
147
|
return TabManager;
|
|
146
148
|
}());
|
|
147
149
|
export { TabManager };
|
|
@@ -14,7 +14,11 @@ export default class Tooltip extends React.Component<ITooltipProps> {
|
|
|
14
14
|
componentWillUnmount(): void;
|
|
15
15
|
private onMouseEnter;
|
|
16
16
|
private onMouseLeave;
|
|
17
|
-
render(): JSX.Element;
|
|
18
|
-
static fromDataAttributes(element: JSX.Element, attributes: {
|
|
19
|
-
|
|
17
|
+
render(): React.JSX.Element;
|
|
18
|
+
static fromDataAttributes(element: JSX.Element, attributes: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
static setDomProperties(dom: HTMLProps<HTMLElement> & {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}, tooltipOptions: string | Components.Tooltip.ITooltipOptions): void;
|
|
20
24
|
}
|
|
@@ -4,5 +4,6 @@ export declare class TooltipHelper {
|
|
|
4
4
|
static showTooltip(on: HTMLElement, content: string, isHtml: boolean, aligmnent?: Components.Tooltip.Alignment, position?: Components.Tooltip.Position, className?: string): void;
|
|
5
5
|
static hideTooltip(): void;
|
|
6
6
|
private static positionTooltip;
|
|
7
|
+
private static getPrefixedWindowKey;
|
|
7
8
|
private static getPrefixedStyleName;
|
|
8
9
|
}
|
|
@@ -40,7 +40,7 @@ var TooltipHelper = /** @class */ (function () {
|
|
|
40
40
|
var ttRect = toolTipContainer.getBoundingClientRect();
|
|
41
41
|
var anchorRect = anchor.getBoundingClientRect();
|
|
42
42
|
if (alignment === "start-edge") {
|
|
43
|
-
alignment = (anchorRect[startName] + ttRect[dimensionName] + 20 > window[this.
|
|
43
|
+
alignment = (anchorRect[startName] + ttRect[dimensionName] + 20 > window[this.getPrefixedWindowKey("inner", dimensionName)]) ? "end" : "start";
|
|
44
44
|
}
|
|
45
45
|
else if (alignment === "end-edge") {
|
|
46
46
|
alignment = (anchorRect[endName] - ttRect[dimensionName] < 15) ? "start" : "end";
|
|
@@ -56,12 +56,12 @@ var TooltipHelper = /** @class */ (function () {
|
|
|
56
56
|
arrowPosition = anchorRect[dimensionName] - 20;
|
|
57
57
|
}
|
|
58
58
|
// Check if the tooltip is going to go off the edge of the screen.
|
|
59
|
-
var clampedStart = Math.max(Math.min(start, window[this.
|
|
59
|
+
var clampedStart = Math.max(Math.min(start, window[this.getPrefixedWindowKey("inner", dimensionName)] - ttRect[dimensionName] - 20), 15);
|
|
60
60
|
var arrowOffset = anchorRect[startName] - clampedStart;
|
|
61
61
|
ttArrow.removeAttribute("style");
|
|
62
62
|
ttArrow.style[startName] = (arrowOffset + arrowPosition) + "px";
|
|
63
63
|
var align = anchorRect[alignName] - ttRect[alignDimensionName] - arrowHeight;
|
|
64
|
-
if ((align < 20 || position === endAlignName) && anchorRect[endAlignName] + ttRect[alignDimensionName] + arrowHeight + 20 < window[this.
|
|
64
|
+
if ((align < 20 || position === endAlignName) && anchorRect[endAlignName] + ttRect[alignDimensionName] + arrowHeight + 20 < window[this.getPrefixedWindowKey("inner", alignDimensionName)]) {
|
|
65
65
|
align = anchorRect[endAlignName] + arrowHeight;
|
|
66
66
|
ttArrow.style[this.getPrefixedStyleName("border", endAlignName)] = "5px solid " + bgColor;
|
|
67
67
|
ttArrow.style[this.getPrefixedStyleName("border", alignName)] = "none";
|
|
@@ -76,7 +76,11 @@ var TooltipHelper = /** @class */ (function () {
|
|
|
76
76
|
toolTipContainer.style[alignName] = align + (isHorizontal ? window.scrollX : window.scrollY) + "px";
|
|
77
77
|
toolTipContainer.style[startName] = clampedStart + (isHorizontal ? window.scrollY : window.scrollX) + "px";
|
|
78
78
|
};
|
|
79
|
+
TooltipHelper.getPrefixedWindowKey = function (prefix, styleName) {
|
|
80
|
+
return prefix + styleName[0].toUpperCase() + styleName.substring(1);
|
|
81
|
+
};
|
|
79
82
|
TooltipHelper.getPrefixedStyleName = function (prefix, styleName) {
|
|
83
|
+
// This can return any style name, but is cast as "borderLeft" to keep typescript happy.
|
|
80
84
|
return prefix + styleName[0].toUpperCase() + styleName.substring(1);
|
|
81
85
|
};
|
|
82
86
|
return TooltipHelper;
|
|
@@ -9,9 +9,11 @@ var MenuRoute = /** @class */ (function () {
|
|
|
9
9
|
function MenuRoute(baseRoute, menuParams, viewParams) {
|
|
10
10
|
var _this = this;
|
|
11
11
|
Object.getOwnPropertyNames(baseRoute).forEach(function (propertyName) {
|
|
12
|
+
// @ts-ignore
|
|
12
13
|
_this[propertyName] = baseRoute[propertyName];
|
|
13
14
|
});
|
|
14
15
|
Object.getOwnPropertyNames(menuParams).forEach(function (propertyName) {
|
|
16
|
+
// @ts-ignore
|
|
15
17
|
_this[propertyName] = menuParams[propertyName];
|
|
16
18
|
});
|
|
17
19
|
this.basePath = this.path;
|
|
@@ -3,7 +3,7 @@ import { Routing, ModalUtils, Misc, AppServices } from '@singularsystems/neo-cor
|
|
|
3
3
|
import { inject, injectable } from 'inversify';
|
|
4
4
|
import { NeoReactTypes } from '../Modules/Types';
|
|
5
5
|
import { RoutingState } from './RoutingState';
|
|
6
|
-
|
|
6
|
+
var PageLeaveHandler = /** @class */ (function () {
|
|
7
7
|
function PageLeaveHandler(routingState) {
|
|
8
8
|
this.routingState = routingState;
|
|
9
9
|
}
|
|
@@ -72,3 +72,4 @@ export var PageLeaveHandler = /** @class */ (function () {
|
|
|
72
72
|
], PageLeaveHandler);
|
|
73
73
|
return PageLeaveHandler;
|
|
74
74
|
}());
|
|
75
|
+
export { PageLeaveHandler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { injectable } from 'inversify';
|
|
3
3
|
import { computed, makeObservable, observable } from 'mobx';
|
|
4
|
-
|
|
4
|
+
var RoutingState = /** @class */ (function () {
|
|
5
5
|
function RoutingState() {
|
|
6
6
|
this.observableRoute = null;
|
|
7
7
|
this.currentView = null;
|
|
@@ -69,3 +69,4 @@ export var RoutingState = /** @class */ (function () {
|
|
|
69
69
|
], RoutingState);
|
|
70
70
|
return RoutingState;
|
|
71
71
|
}());
|
|
72
|
+
export { RoutingState };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { makeObservable, observable } from 'mobx';
|
|
3
|
-
|
|
3
|
+
var ViewParameter = /** @class */ (function () {
|
|
4
4
|
function ViewParameter(parent, name, routeParameter) {
|
|
5
5
|
this.parent = parent;
|
|
6
6
|
this.name = name;
|
|
@@ -128,3 +128,4 @@ export var ViewParameter = /** @class */ (function () {
|
|
|
128
128
|
], ViewParameter.prototype, "_description", void 0);
|
|
129
129
|
return ViewParameter;
|
|
130
130
|
}());
|
|
131
|
+
export { ViewParameter };
|
|
@@ -3,6 +3,7 @@ import { RouteParameterObject } from './IRouteParameter';
|
|
|
3
3
|
import { match } from 'react-router';
|
|
4
4
|
import { BreadCrumbItem } from './BreadCrumbItem';
|
|
5
5
|
import { IViewBase } from '../Views/ViewBase';
|
|
6
|
+
import { ParamValues } from "./NavigationHelper";
|
|
6
7
|
export type TransformParamsType<T> = {
|
|
7
8
|
[P in keyof T]: IViewParameter;
|
|
8
9
|
};
|
|
@@ -54,6 +55,6 @@ export declare class ViewParameterList<TParams extends RouteParameterObject<TPar
|
|
|
54
55
|
* @param basePath Base path without parameters
|
|
55
56
|
* @param values Object of param names and values.
|
|
56
57
|
*/
|
|
57
|
-
static getPathForValues<TParams extends RouteParameterObject<TParams>>(basePath: string, params: TParams, values:
|
|
58
|
+
static getPathForValues<TParams extends RouteParameterObject<TParams>>(basePath: string, params: TParams, values: ParamValues<TParams>): string;
|
|
58
59
|
}
|
|
59
60
|
export {};
|
|
@@ -12,6 +12,7 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
12
12
|
if (routeParameterObject) {
|
|
13
13
|
for (var param in routeParameterObject) {
|
|
14
14
|
var viewParam = new ViewParameter(this, param, routeParameterObject[param]);
|
|
15
|
+
//@ts-ignore
|
|
15
16
|
this[param] = viewParam;
|
|
16
17
|
this.params.push(viewParam);
|
|
17
18
|
}
|
|
@@ -80,6 +81,7 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
80
81
|
options = { force: true }; // parameter used to be named 'force'- backwards compatibility.
|
|
81
82
|
}
|
|
82
83
|
for (var paramName in values) {
|
|
84
|
+
//@ts-ignore
|
|
83
85
|
this[paramName].value = (_a = values[paramName]) !== null && _a !== void 0 ? _a : null;
|
|
84
86
|
}
|
|
85
87
|
this.suppressNavigation = false;
|
|
@@ -111,8 +113,10 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
111
113
|
var hasChanged = false;
|
|
112
114
|
//Get url params
|
|
113
115
|
for (var param in match.params) {
|
|
116
|
+
//@ts-ignore
|
|
114
117
|
var viewParam = this[param];
|
|
115
118
|
if (viewParam) {
|
|
119
|
+
// @ts-ignore
|
|
116
120
|
var value = match.params[param];
|
|
117
121
|
if (value === undefined)
|
|
118
122
|
value = null;
|
|
@@ -140,6 +144,7 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
140
144
|
// TODO: This needs a rework.
|
|
141
145
|
var viewParameterList = new ViewParameterList(params);
|
|
142
146
|
for (var name_1 in values) {
|
|
147
|
+
//@ts-ignore
|
|
143
148
|
var viewParam = viewParameterList[name_1];
|
|
144
149
|
if (viewParam) {
|
|
145
150
|
var value = values[name_1];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { injectable } from "inversify";
|
|
3
3
|
import { reaction } from "mobx";
|
|
4
|
-
|
|
4
|
+
var DisposeHelper = /** @class */ (function () {
|
|
5
5
|
function DisposeHelper() {
|
|
6
6
|
this.registeredReactions = [];
|
|
7
7
|
this.registeredDisposables = [];
|
|
@@ -38,3 +38,4 @@ export var DisposeHelper = /** @class */ (function () {
|
|
|
38
38
|
], DisposeHelper);
|
|
39
39
|
return DisposeHelper;
|
|
40
40
|
}());
|
|
41
|
+
export { DisposeHelper };
|
package/dist/Views/ViewBase.js
CHANGED
|
@@ -72,7 +72,7 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
72
72
|
ViewBase.prototype.componentDidMount = function () {
|
|
73
73
|
var _this = this;
|
|
74
74
|
var paramsUpdated = this.navigation.currentRouteProps ? this.viewState.viewParams.update(this.navigation.currentRouteProps.match) : false;
|
|
75
|
-
var initPromise;
|
|
75
|
+
var initPromise = undefined;
|
|
76
76
|
if (!this.viewState.hasSetup) {
|
|
77
77
|
this.viewState.hasSetup = true;
|
|
78
78
|
initPromise = this.initialise();
|
|
@@ -4,6 +4,7 @@ import { IReactionDisposer } from 'mobx';
|
|
|
4
4
|
import { AxiosPromise } from 'axios';
|
|
5
5
|
import { WaitForTaskRunnerOptions } from '@singularsystems/neo-core/dist/Components/TaskRunner/TaskRunner';
|
|
6
6
|
import { BindableBase } from '@singularsystems/neo-core/dist/Model/BindableBase';
|
|
7
|
+
type VMConstructor<T> = (new (taskRunner?: ITaskRunner) => T);
|
|
7
8
|
export type valueOrLazy<T> = T | (() => T) | (new () => T);
|
|
8
9
|
export default abstract class ViewModelBase extends ModelBase implements IViewModel {
|
|
9
10
|
taskRunner: ITaskRunner;
|
|
@@ -22,7 +23,7 @@ export default abstract class ViewModelBase extends ModelBase implements IViewMo
|
|
|
22
23
|
* The task runner will be passed to the new vm from this one.
|
|
23
24
|
* @param viewModel View model type.
|
|
24
25
|
*/
|
|
25
|
-
registerViewModel<TViewModel extends IViewModel>(viewModel:
|
|
26
|
+
registerViewModel<TViewModel extends IViewModel>(viewModel: VMConstructor<TViewModel>, options?: {
|
|
26
27
|
initialise: boolean;
|
|
27
28
|
}): TViewModel;
|
|
28
29
|
/**
|
|
@@ -55,3 +56,4 @@ export default abstract class ViewModelBase extends ModelBase implements IViewMo
|
|
|
55
56
|
*/
|
|
56
57
|
static create<TViewModel extends IViewModel>(viewModel: valueOrLazy<TViewModel>, taskRunner?: ITaskRunner): TViewModel;
|
|
57
58
|
}
|
|
59
|
+
export {};
|
|
@@ -106,11 +106,7 @@ var ViewModelBase = /** @class */ (function (_super) {
|
|
|
106
106
|
}
|
|
107
107
|
else if (viewModel.neo) {
|
|
108
108
|
// Constructor
|
|
109
|
-
|
|
110
|
-
if (taskRunner) {
|
|
111
|
-
viewModelInstance.taskRunner = taskRunner;
|
|
112
|
-
}
|
|
113
|
-
return viewModelInstance;
|
|
109
|
+
return new viewModel(taskRunner);
|
|
114
110
|
}
|
|
115
111
|
else {
|
|
116
112
|
// Callback
|