@singularsystems/neo-react 1.0.0-beta.1 → 1.0.0-beta.3
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/dist/React/AutoRunner.js +12 -1
- package/dist/React/Decorators.js +0 -1
- package/dist/ReactComponents/DropDown/DropDown.d.ts +3 -0
- package/dist/ReactComponents/DropDown/DropDown.js +11 -6
- package/dist/ReactComponents/Grid/Grid.d.ts +1 -0
- package/dist/ReactComponents/Grid/Grid.js +3 -3
- package/dist/ReactComponents/Grid/Row.d.ts +4 -0
- package/dist/ReactComponents/Grid/Row.js +2 -1
- package/dist/ReactComponents/Icons/IIconFactory.d.ts +6 -0
- package/dist/ReactComponents/Icons/Icon.d.ts +13 -0
- package/dist/ReactComponents/Icons/Icon.js +27 -0
- package/dist/ReactComponents/Icons/IconFactory.js +7 -1
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.d.ts +21 -0
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.js +114 -0
- package/dist/ReactComponents/Icons/index.d.ts +2 -1
- package/dist/ReactComponents/Icons/index.js +1 -0
- package/dist/ReactComponents/Paging/Pager.d.ts +1 -0
- package/dist/ReactComponents/Paging/Pager.js +3 -0
- package/dist/ReactComponents/PropTypes.d.ts +1 -1
- package/dist/ReactComponents/Tabs/Tab.d.ts +1 -1
- package/dist/ReactComponents/TooltipProvider.js +2 -1
- package/dist/ReactComponents/_Exports.d.ts +2 -1
- package/dist/ReactComponents/_Exports.js +2 -1
- package/dist/Routing/RoutingState.d.ts +2 -0
- package/dist/Routing/RoutingState.js +27 -1
- package/dist/Routing/ViewParameterList.d.ts +9 -3
- package/dist/Routing/ViewParameterList.js +7 -4
- package/dist/Views/ViewBase.d.ts +3 -0
- package/dist/Views/ViewBase.js +8 -1
- package/dist/Views/ViewModelBase.d.ts +1 -1
- package/package.json +3 -3
- package/CHANGELOG.md +0 -98
- package/dist/Declarations.d.ts +0 -3
- package/dist/Declarations.js +0 -0
- package/dist/Modules/NeoReactModule.js.map +0 -1
- package/dist/Modules/ReactSetup.js.map +0 -1
- package/dist/Modules/Types.js.map +0 -1
- package/dist/React/AutoRunner.js.map +0 -1
- package/dist/React/DataView.js.map +0 -1
- package/dist/React/Decorators.js.map +0 -1
- package/dist/React/ReactModelCreator.js.map +0 -1
- package/dist/React/Utils.js.map +0 -1
- package/dist/ReactComponents/Button.js.map +0 -1
- package/dist/ReactComponents/Card.js.map +0 -1
- package/dist/ReactComponents/Collapsable.js.map +0 -1
- package/dist/ReactComponents/CollapsableBase.js.map +0 -1
- package/dist/ReactComponents/ColorPicker.js.map +0 -1
- package/dist/ReactComponents/ComponentBase.js.map +0 -1
- package/dist/ReactComponents/ContextMenu/ContextMenu.js.map +0 -1
- package/dist/ReactComponents/ContextMenu/ContextMenuContainer.js.map +0 -1
- package/dist/ReactComponents/ContextMenu/ContextMenuState.js.map +0 -1
- package/dist/ReactComponents/DatePicker.js.map +0 -1
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js.map +0 -1
- package/dist/ReactComponents/DropDown/DropDown.js.map +0 -1
- package/dist/ReactComponents/DropDown/DropDownBase.js.map +0 -1
- package/dist/ReactComponents/ErrorHandler.js.map +0 -1
- package/dist/ReactComponents/FileManager/FileBasicInput.js.map +0 -1
- package/dist/ReactComponents/FileManager/FileContext.js.map +0 -1
- package/dist/ReactComponents/FileManager/FileDropArea.js.map +0 -1
- package/dist/ReactComponents/FileManager/FileInput.js.map +0 -1
- package/dist/ReactComponents/FileManager/FileUploadButton.js.map +0 -1
- package/dist/ReactComponents/FileManager/FileUploadProgress.js.map +0 -1
- package/dist/ReactComponents/Form.js.map +0 -1
- package/dist/ReactComponents/FormContext.js.map +0 -1
- package/dist/ReactComponents/FormGroup/FormGroup.js.map +0 -1
- package/dist/ReactComponents/FormGroup/FormGroupFloating.js.map +0 -1
- package/dist/ReactComponents/FormGroup/FormGroupInline.js.map +0 -1
- package/dist/ReactComponents/Grid/ButtonColumn.js.map +0 -1
- package/dist/ReactComponents/Grid/Column.js.map +0 -1
- package/dist/ReactComponents/Grid/ColumnHelper.js.map +0 -1
- package/dist/ReactComponents/Grid/Grid.js.map +0 -1
- package/dist/ReactComponents/Grid/Row.js.map +0 -1
- package/dist/ReactComponents/Grid/_Exports.js.map +0 -1
- package/dist/ReactComponents/GridLayout.js.map +0 -1
- package/dist/ReactComponents/Input.js.map +0 -1
- package/dist/ReactComponents/InputHelpers.js.map +0 -1
- package/dist/ReactComponents/Loader.js.map +0 -1
- package/dist/ReactComponents/Modal/Modal.js.map +0 -1
- package/dist/ReactComponents/Modal/ModalContainer.js.map +0 -1
- package/dist/ReactComponents/Modal/ModalPortal.js.map +0 -1
- package/dist/ReactComponents/Notifications/Alert.js.map +0 -1
- package/dist/ReactComponents/Notifications/Toast.js.map +0 -1
- package/dist/ReactComponents/Notifications/ToastContainer.js.map +0 -1
- package/dist/ReactComponents/NumberInput.js.map +0 -1
- package/dist/ReactComponents/Paging/BasicPagerControls.js.map +0 -1
- package/dist/ReactComponents/Paging/PageSizeControl.js.map +0 -1
- package/dist/ReactComponents/Paging/Pager.js.map +0 -1
- package/dist/ReactComponents/ProgressBar.js.map +0 -1
- package/dist/ReactComponents/PropTypes.js.map +0 -1
- package/dist/ReactComponents/RadioList.js.map +0 -1
- package/dist/ReactComponents/ReactHelpers.d.ts +0 -5
- package/dist/ReactComponents/ReactHelpers.js +0 -17
- package/dist/ReactComponents/ReactHelpers.js.map +0 -1
- package/dist/ReactComponents/Slider.js.map +0 -1
- package/dist/ReactComponents/StateObserver.js.map +0 -1
- package/dist/ReactComponents/Tabs/Tab.js.map +0 -1
- package/dist/ReactComponents/Tabs/TabContainer.js.map +0 -1
- package/dist/ReactComponents/Tabs/TabManager.js.map +0 -1
- package/dist/ReactComponents/Tooltip.js.map +0 -1
- package/dist/ReactComponents/TooltipHelper.js.map +0 -1
- package/dist/ReactComponents/TooltipProvider.js.map +0 -1
- package/dist/ReactComponents/ValidationSummary.js.map +0 -1
- package/dist/ReactComponents/_Exports.js.map +0 -1
- package/dist/ReactComponents/_Managers.js.map +0 -1
- package/dist/Routing/BreadCrumbItem.js.map +0 -1
- package/dist/Routing/IRouteChangedProps.js.map +0 -1
- package/dist/Routing/IRouteParameter.js.map +0 -1
- package/dist/Routing/MenuRoute.js.map +0 -1
- package/dist/Routing/NavigationHelper.js.map +0 -1
- package/dist/Routing/PageLeaveHandler.js.map +0 -1
- package/dist/Routing/RouteProvider.js.map +0 -1
- package/dist/Routing/RouteView.js.map +0 -1
- package/dist/Routing/RoutingState.js.map +0 -1
- package/dist/Routing/ViewParameter.js.map +0 -1
- package/dist/Routing/ViewParameterList.js.map +0 -1
- package/dist/Routing/index.js.map +0 -1
- package/dist/Services/DisposeHelper.js.map +0 -1
- package/dist/Services/IDisposeHelper.js.map +0 -1
- package/dist/Views/EmptyViewModel.js.map +0 -1
- package/dist/Views/IViewModel.js.map +0 -1
- package/dist/Views/PersistentViewBase.js.map +0 -1
- package/dist/Views/ViewBase.js.map +0 -1
- package/dist/Views/ViewComponentBase.js.map +0 -1
- package/dist/Views/ViewModelBase.js.map +0 -1
- package/dist/Views/ViewState.js.map +0 -1
- package/dist/Views/index.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/React/AutoRunner.js
CHANGED
|
@@ -22,8 +22,19 @@ var AutoRunner = /** @class */ (function () {
|
|
|
22
22
|
this.disposerDelayed = reaction(function () { return _this.accessAllValues(model, true, new Map(), ""); }, function () { var _a; return _this.runCallback(model, callback, (_a = _this.options.delayMs) !== null && _a !== void 0 ? _a : 500); });
|
|
23
23
|
this.disposerImmediate = reaction(function () { return _this.accessAllValues(model, false, new Map(), ""); }, function () { return _this.runCallback(model, callback, 0); });
|
|
24
24
|
}
|
|
25
|
+
Object.defineProperty(AutoRunner.prototype, "hasPending", {
|
|
26
|
+
get: function () {
|
|
27
|
+
return DebounceHelper.hasPending(this);
|
|
28
|
+
},
|
|
29
|
+
enumerable: false,
|
|
30
|
+
configurable: true
|
|
31
|
+
});
|
|
25
32
|
AutoRunner.prototype.cancelPending = function () {
|
|
26
|
-
DebounceHelper.
|
|
33
|
+
if (DebounceHelper.hasPending(this)) {
|
|
34
|
+
DebounceHelper.cancelPending(this);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
27
38
|
};
|
|
28
39
|
AutoRunner.prototype.fireImmediate = function () {
|
|
29
40
|
DebounceHelper.executeImmediate(this);
|
package/dist/React/Decorators.js
CHANGED
|
@@ -26,6 +26,8 @@ export interface IDropDownSpecificProps<T> {
|
|
|
26
26
|
nullText?: string;
|
|
27
27
|
/** Text to display as the first item in the drop down list when the user is allowed to select a blank item. */
|
|
28
28
|
deSelectText?: string;
|
|
29
|
+
/** Set to true if the property should be sorted by value instead of display text. */
|
|
30
|
+
sortByValue?: boolean;
|
|
29
31
|
}
|
|
30
32
|
export interface IDropDownProps<T> extends IBindableEditorProps<HTMLSelectElement> {
|
|
31
33
|
select: IDropDownSpecificProps<T>;
|
|
@@ -34,6 +36,7 @@ export default class DropDown<T> extends DropDownBase<T, IDropDownProps<T>> {
|
|
|
34
36
|
static contextType: React.Context<import("../FormContext").FormContextParams>;
|
|
35
37
|
context: React.ContextType<typeof FormContext>;
|
|
36
38
|
private selectedItem;
|
|
39
|
+
private sortByValue?;
|
|
37
40
|
private listIndexSymbol;
|
|
38
41
|
constructor(props: IDropDownProps<T>);
|
|
39
42
|
private get items();
|
|
@@ -41,7 +41,9 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
41
41
|
list.forEach(function (item) { return index[item[_this.valueMember]] = item; });
|
|
42
42
|
};
|
|
43
43
|
DropDown.prototype.getSelectedOption = function (value) {
|
|
44
|
-
this.
|
|
44
|
+
if (!this.sortByValue) {
|
|
45
|
+
this.props.bind.propertyInfo.hasSortValue = true;
|
|
46
|
+
}
|
|
45
47
|
if (!this.selectedItem || this.selectedItem[this.valueMember] != value) {
|
|
46
48
|
var list = this.items;
|
|
47
49
|
var indexJustCreated = false;
|
|
@@ -61,7 +63,9 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
61
63
|
this.selectedItem[this.displayMember] = "";
|
|
62
64
|
this.selectedItem[this.valueMember] = null;
|
|
63
65
|
}
|
|
64
|
-
|
|
66
|
+
var displayValue = this.selectedItem[this.displayMember];
|
|
67
|
+
this.setFieldInfo(this.props.bind, displayValue);
|
|
68
|
+
this.props.bind.sortValue = this.sortByValue ? value : displayValue;
|
|
65
69
|
}
|
|
66
70
|
return this.selectedItem;
|
|
67
71
|
};
|
|
@@ -81,10 +85,11 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
81
85
|
};
|
|
82
86
|
DropDown.prototype.render = function () {
|
|
83
87
|
var _this = this;
|
|
84
|
-
var _a, _b, _c, _d, _e, _f;
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
85
89
|
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
86
90
|
var domProps = BindPropsHelper.autoSetDomProperties(splitProps, this.context);
|
|
87
91
|
domProps.className = Utils.joinWithSpaces(domProps.className, splitProps.isBootstrap ? "form-control" : "neo-forms-editor");
|
|
92
|
+
this.sortByValue = (_a = splitProps.select) === null || _a === void 0 ? void 0 : _a.sortByValue;
|
|
88
93
|
if (splitProps.select) {
|
|
89
94
|
if (splitProps.select.valueMember)
|
|
90
95
|
this.valueMember = splitProps.select.valueMember;
|
|
@@ -96,7 +101,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
96
101
|
var items = this.items;
|
|
97
102
|
var selectedItem = this.getSelectedOption(this.props.bind.value); // This sets the sort value to allow sorting of drop downs in grids.
|
|
98
103
|
var value = this.props.bind.value;
|
|
99
|
-
var addBlankItem = ((
|
|
104
|
+
var addBlankItem = ((_c = (_b = splitProps.select) === null || _b === void 0 ? void 0 : _b.allowNulls) !== null && _c !== void 0 ? _c : this.props.bind.propertyInfo.allowNulls) || !value;
|
|
100
105
|
if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null || item[_this.valueMember] === ""; })) {
|
|
101
106
|
// If there is an item with a null value, don't add a blank drop down item.
|
|
102
107
|
addBlankItem = false;
|
|
@@ -106,7 +111,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
106
111
|
control = React.createElement("div", { className: "form-control form-control-loading" },
|
|
107
112
|
React.createElement("div", { className: "spinner-border" }));
|
|
108
113
|
}
|
|
109
|
-
else if ((
|
|
114
|
+
else if ((_d = splitProps.select) === null || _d === void 0 ? void 0 : _d.renderAsText) {
|
|
110
115
|
control = React.createElement("span", null, selectedItem ? selectedItem[this.displayMember] : "");
|
|
111
116
|
}
|
|
112
117
|
else if (splitProps.editor.isReadOnly) {
|
|
@@ -117,7 +122,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
117
122
|
domProps.disabled = true;
|
|
118
123
|
}
|
|
119
124
|
var valueIsBlank = value === undefined || value === null;
|
|
120
|
-
var nullText = (valueIsBlank || ((
|
|
125
|
+
var nullText = (valueIsBlank || ((_e = splitProps.select) === null || _e === void 0 ? void 0 : _e.deSelectText) === undefined) ? (_f = splitProps.select) === null || _f === void 0 ? void 0 : _f.nullText : (_g = splitProps.select) === null || _g === void 0 ? void 0 : _g.deSelectText;
|
|
121
126
|
if (valueIsBlank) {
|
|
122
127
|
domProps.className = Utils.joinWithSpaces(domProps.className, "select-no-value");
|
|
123
128
|
}
|
|
@@ -11,6 +11,7 @@ export declare class GridContextParams<T> {
|
|
|
11
11
|
inFirstRowInGroup: boolean;
|
|
12
12
|
columnCount: number;
|
|
13
13
|
expandProperty?: Model.IPropertyInstance<boolean | null>;
|
|
14
|
+
hideExpandButton?: boolean;
|
|
14
15
|
expandAll?: boolean;
|
|
15
16
|
hasSummaries: boolean;
|
|
16
17
|
dataView: Data.DataViewBase<T>;
|
|
@@ -101,12 +101,12 @@ var Grid = /** @class */ (function (_super) {
|
|
|
101
101
|
}
|
|
102
102
|
return (React.createElement("table", __assign({}, domProps, { className: className, ref: this.domRef }),
|
|
103
103
|
React.createElement(GridContext.Provider, { value: this.gridContext },
|
|
104
|
-
React.createElement(TableSection, { type: "header" }, this.headerItem && this.props.children(this.headerItem, this.headerItem.meta)),
|
|
104
|
+
React.createElement(TableSection, { type: "header" }, this.headerItem && this.props.children(this.headerItem, this.headerItem.meta, true)),
|
|
105
105
|
React.createElement(TableSection, { type: "body" }, this.gridContext.dataView.getItems().map(function (item) { return (React.createElement(ItemGroup, { item: item, key: keyProperty ? item[keyProperty] : item.entityIdentifier, template: _this.props.children })); })),
|
|
106
106
|
React.createElement(Observer, null, function () {
|
|
107
107
|
return React.createElement(React.Fragment, null, (showAddButton || addButton || footerButtons || _this.gridContext.hasSummaries || footerContent !== undefined) &&
|
|
108
108
|
React.createElement(TableSection, { type: "footer" },
|
|
109
|
-
_this.gridContext.hasSummaries && _this.headerItem && _this.props.children(_this.headerItem, _this.headerItem.meta),
|
|
109
|
+
_this.gridContext.hasSummaries && _this.headerItem && _this.props.children(_this.headerItem, _this.headerItem.meta, true),
|
|
110
110
|
footerContent !== undefined && footerContent(_this.gridContext.dataView.getItems()),
|
|
111
111
|
(showAddButton || addButton || footerButtons) &&
|
|
112
112
|
React.createElement(AddButtonRow, { addButton: addButton, showAddButton: showAddButton, additionalContent: footerButtons })));
|
|
@@ -208,7 +208,7 @@ var ItemGroup = /** @class */ (function (_super) {
|
|
|
208
208
|
ItemGroup.prototype.render = function () {
|
|
209
209
|
this.context.currentItem = this.props.item;
|
|
210
210
|
//this.context.inFirstRowInGroup = true;
|
|
211
|
-
return (this.props.template(this.props.item, this.props.item.meta));
|
|
211
|
+
return (this.props.template(this.props.item, this.props.item.meta, false));
|
|
212
212
|
};
|
|
213
213
|
ItemGroup.contextType = GridContext;
|
|
214
214
|
ItemGroup = __decorate([
|
|
@@ -71,6 +71,10 @@ interface INeoRowGroupProps {
|
|
|
71
71
|
* To hide the expand button, return null.
|
|
72
72
|
*/
|
|
73
73
|
expandProperty?: Model.IPropertyInstance<boolean | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Hides the expansion button on this row.
|
|
76
|
+
*/
|
|
77
|
+
hideExpandButton?: boolean;
|
|
74
78
|
children: React.ReactNode;
|
|
75
79
|
}
|
|
76
80
|
export declare class RowGroup extends React.Component<INeoRowGroupProps> {
|
|
@@ -76,7 +76,7 @@ var Row = /** @class */ (function (_super) {
|
|
|
76
76
|
var output = ((this.props.showInHeader || inBody) &&
|
|
77
77
|
React.createElement("tr", __assign({}, domProps),
|
|
78
78
|
this.expandProperty && this.context.expandAll === undefined &&
|
|
79
|
-
React.createElement(Column, { className: "neo-grid-expand-column" }, this.firstRowInGroup && inBody && this.expandProperty.value !== null &&
|
|
79
|
+
React.createElement(Column, { className: "neo-grid-expand-column" }, this.firstRowInGroup && inBody && this.context.hideExpandButton !== true && this.expandProperty.value !== null &&
|
|
80
80
|
React.createElement(NeoButton, __assign({}, expandButtonOptions))),
|
|
81
81
|
this.props.children));
|
|
82
82
|
this.setGridContext();
|
|
@@ -193,6 +193,7 @@ export var RowGroup = /** @class */ (function (_super) {
|
|
|
193
193
|
RowGroup.prototype.render = function () {
|
|
194
194
|
this.context.expandProperty = this.props.expandProperty;
|
|
195
195
|
this.context.inFirstRowInGroup = true;
|
|
196
|
+
this.context.hideExpandButton = this.props.hideExpandButton;
|
|
196
197
|
return this.props.children;
|
|
197
198
|
};
|
|
198
199
|
RowGroup.contextType = GridContext;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface IconStyle {
|
|
3
|
+
/** True if the icon should be fixed width */
|
|
3
4
|
fixedWidth?: boolean;
|
|
5
|
+
/** True if the icon should have a spin animation applied. E.g. loading spinner. */
|
|
4
6
|
spin?: boolean;
|
|
7
|
+
/** True if the icon should have a solid or filled in style. Set to false for font-awesome regular style. */
|
|
8
|
+
solid?: boolean;
|
|
9
|
+
/** How thin / thick the icon lines are. Only supported by material symbols. */
|
|
10
|
+
weight?: number;
|
|
5
11
|
}
|
|
6
12
|
export interface IIconFactory {
|
|
7
13
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconStyle, IIconFactory } from ".";
|
|
3
|
+
export interface IIconProps extends IconStyle {
|
|
4
|
+
name: string;
|
|
5
|
+
/** Optional icon factory if this icon uses a different icon set to the project default. */
|
|
6
|
+
factory?: IIconFactory;
|
|
7
|
+
}
|
|
8
|
+
/** Renders an icon using the icon factory specified at startup. */
|
|
9
|
+
export default class Icon extends React.Component<IIconProps> {
|
|
10
|
+
private static _iconFactory;
|
|
11
|
+
private get iconFactory();
|
|
12
|
+
render(): React.ReactNode;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __extends, __rest } from "tslib";
|
|
2
|
+
import { Misc } from "@singularsystems/neo-core";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { NeoReactTypes } from "../..";
|
|
5
|
+
/** Renders an icon using the icon factory specified at startup. */
|
|
6
|
+
var Icon = /** @class */ (function (_super) {
|
|
7
|
+
__extends(Icon, _super);
|
|
8
|
+
function Icon() {
|
|
9
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(Icon.prototype, "iconFactory", {
|
|
12
|
+
get: function () {
|
|
13
|
+
if (!Icon._iconFactory) {
|
|
14
|
+
Icon._iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
|
|
15
|
+
}
|
|
16
|
+
return Icon._iconFactory;
|
|
17
|
+
},
|
|
18
|
+
enumerable: false,
|
|
19
|
+
configurable: true
|
|
20
|
+
});
|
|
21
|
+
Icon.prototype.render = function () {
|
|
22
|
+
var _a = this.props, name = _a.name, factory = _a.factory, iconStyle = __rest(_a, ["name", "factory"]);
|
|
23
|
+
return (factory !== null && factory !== void 0 ? factory : this.iconFactory).getIconComponent(name, iconStyle);
|
|
24
|
+
};
|
|
25
|
+
return Icon;
|
|
26
|
+
}(React.Component));
|
|
27
|
+
export default Icon;
|
|
@@ -18,7 +18,7 @@ export var IconFactory = /** @class */ (function () {
|
|
|
18
18
|
return undefined;
|
|
19
19
|
};
|
|
20
20
|
IconFactory.prototype.textOrIcon = function (textOrIcon, style) {
|
|
21
|
-
if (textOrIcon.indexOf("fa-") === 0 || textOrIcon.indexOf("far-") === 0) {
|
|
21
|
+
if (textOrIcon.indexOf("fa-") === 0 || textOrIcon.indexOf("far-") === 0 || textOrIcon.indexOf("fas-") === 0) {
|
|
22
22
|
return this.getIconComponent(textOrIcon, style);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -27,6 +27,12 @@ export var IconFactory = /** @class */ (function () {
|
|
|
27
27
|
};
|
|
28
28
|
IconFactory.prototype.mapStringToIcon = function (iconName, style) {
|
|
29
29
|
var className = Utils.getFontAwesomeClass(iconName);
|
|
30
|
+
if ((style === null || style === void 0 ? void 0 : style.solid) === false) {
|
|
31
|
+
className = className.replace("fa ", "far ");
|
|
32
|
+
}
|
|
33
|
+
if ((style === null || style === void 0 ? void 0 : style.solid) === true) {
|
|
34
|
+
className = className.replace("fa ", "fas ");
|
|
35
|
+
}
|
|
30
36
|
if (style === null || style === void 0 ? void 0 : style.fixedWidth) {
|
|
31
37
|
className += " fa-fw";
|
|
32
38
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconFactory, IconStyle } from ".";
|
|
3
|
+
interface IMaterialSymbolsOptions {
|
|
4
|
+
/** Set to true if icon names with unspecified fill should be made solid/filled. */
|
|
5
|
+
fillDefault?: boolean;
|
|
6
|
+
/** Additional mappings between font-awesome, and material symbols. */
|
|
7
|
+
fontAwesomeMappings?: [string, string][];
|
|
8
|
+
/** Set to true if the provided mappings should completely replace the built in neo mappings. */
|
|
9
|
+
replaceNeoMappings?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Font factory that renders google material symbols icons.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MaterialSymbolsFontFactory extends IconFactory {
|
|
15
|
+
constructor(options?: IMaterialSymbolsOptions);
|
|
16
|
+
private filledByDefault;
|
|
17
|
+
private fontAwesomeMap;
|
|
18
|
+
protected mapStringToIcon(iconName: string, style?: IconStyle | undefined): React.ReactNode;
|
|
19
|
+
protected mapFontAwesomeToMaterial(faName: string): string | undefined;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { Utils } from "@singularsystems/neo-core";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { IconFactory } from ".";
|
|
5
|
+
/**
|
|
6
|
+
* Font factory that renders google material symbols icons.
|
|
7
|
+
*/
|
|
8
|
+
var MaterialSymbolsFontFactory = /** @class */ (function (_super) {
|
|
9
|
+
__extends(MaterialSymbolsFontFactory, _super);
|
|
10
|
+
function MaterialSymbolsFontFactory(options) {
|
|
11
|
+
var _this = this;
|
|
12
|
+
var _a;
|
|
13
|
+
_this = _super.call(this) || this;
|
|
14
|
+
_this.filledByDefault = (_a = options === null || options === void 0 ? void 0 : options.fillDefault) !== null && _a !== void 0 ? _a : false;
|
|
15
|
+
if ((options === null || options === void 0 ? void 0 : options.fontAwesomeMappings) && (options === null || options === void 0 ? void 0 : options.replaceNeoMappings)) {
|
|
16
|
+
_this.fontAwesomeMap = new Map(options.fontAwesomeMappings);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
_this.fontAwesomeMap = new Map(neoFontAwesomeMappings);
|
|
20
|
+
if (options === null || options === void 0 ? void 0 : options.fontAwesomeMappings) {
|
|
21
|
+
for (var _i = 0, _b = options.fontAwesomeMappings; _i < _b.length; _i++) {
|
|
22
|
+
var mapping = _b[_i];
|
|
23
|
+
_this.fontAwesomeMap.set(mapping[0], mapping[1]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
MaterialSymbolsFontFactory.prototype.mapStringToIcon = function (iconName, style) {
|
|
30
|
+
var _a;
|
|
31
|
+
var className = "material-symbols-outlined";
|
|
32
|
+
var isFilled = (_a = style === null || style === void 0 ? void 0 : style.solid) !== null && _a !== void 0 ? _a : this.filledByDefault;
|
|
33
|
+
// TODO: copy spin animation from font-awesome
|
|
34
|
+
if (style === null || style === void 0 ? void 0 : style.spin) {
|
|
35
|
+
className += " fa fa-spin";
|
|
36
|
+
}
|
|
37
|
+
// remove and extract convention styling
|
|
38
|
+
iconName = iconName.replace("fa-fw", "");
|
|
39
|
+
var faProps = Utils.getFontAwesomeIconProps(iconName);
|
|
40
|
+
iconName = faProps.name.trim();
|
|
41
|
+
if (faProps.isSolid !== undefined) {
|
|
42
|
+
isFilled = faProps.isSolid;
|
|
43
|
+
}
|
|
44
|
+
var mappedName = this.mapFontAwesomeToMaterial(iconName);
|
|
45
|
+
if (mappedName === undefined) {
|
|
46
|
+
// replace common differences.
|
|
47
|
+
mappedName = iconName.replace(/-/g, "_")
|
|
48
|
+
.replace("plus", "add")
|
|
49
|
+
.replace("square", "box");
|
|
50
|
+
}
|
|
51
|
+
if (mappedName === "") {
|
|
52
|
+
mappedName = '\u00A0';
|
|
53
|
+
}
|
|
54
|
+
var cssStyle;
|
|
55
|
+
if (isFilled || (style === null || style === void 0 ? void 0 : style.weight)) {
|
|
56
|
+
var styleText = "";
|
|
57
|
+
if (isFilled) {
|
|
58
|
+
styleText += "'FILL' 1";
|
|
59
|
+
}
|
|
60
|
+
if (style === null || style === void 0 ? void 0 : style.weight) {
|
|
61
|
+
styleText += " 'wght' " + style.weight;
|
|
62
|
+
}
|
|
63
|
+
cssStyle = { fontVariationSettings: styleText.trim() };
|
|
64
|
+
}
|
|
65
|
+
return React.createElement("span", { className: className, style: cssStyle }, mappedName);
|
|
66
|
+
};
|
|
67
|
+
MaterialSymbolsFontFactory.prototype.mapFontAwesomeToMaterial = function (faName) {
|
|
68
|
+
return this.fontAwesomeMap.get(faName.trim());
|
|
69
|
+
};
|
|
70
|
+
return MaterialSymbolsFontFactory;
|
|
71
|
+
}(IconFactory));
|
|
72
|
+
export { MaterialSymbolsFontFactory };
|
|
73
|
+
var neoFontAwesomeMappings = [
|
|
74
|
+
["plus", "add"],
|
|
75
|
+
["plus-square", "add_box"],
|
|
76
|
+
["minus", "remove"],
|
|
77
|
+
["minus-square", "indeterminate_check_box"],
|
|
78
|
+
["arrow-left", "arrow_back"],
|
|
79
|
+
["angle-left", "chevron_left"],
|
|
80
|
+
["caret-left", "arrow_left"],
|
|
81
|
+
["trash", "delete"],
|
|
82
|
+
["user", "person"],
|
|
83
|
+
["users", "groups"],
|
|
84
|
+
["user-shield", "admin_panel_settings"],
|
|
85
|
+
["user-plus", "person_add"],
|
|
86
|
+
["user-times", "person_remove"],
|
|
87
|
+
["user-lock", "manage_accounts"],
|
|
88
|
+
["unlock", "lock_open"],
|
|
89
|
+
["cogs", "settings"],
|
|
90
|
+
["file-excel", "text_snippet"],
|
|
91
|
+
["file-code", "code_blocks"],
|
|
92
|
+
["feather-alt", "filter_alt"],
|
|
93
|
+
["filter", "filter_alt"],
|
|
94
|
+
["eye", "visibility"],
|
|
95
|
+
["envelope", "mail"],
|
|
96
|
+
["address-book", "contact_mail"],
|
|
97
|
+
["at", "alternate_email"],
|
|
98
|
+
["bell", "notifications"],
|
|
99
|
+
["times", "close"],
|
|
100
|
+
["eraser", "ink_eraser"],
|
|
101
|
+
["align-left", "format_align_left"],
|
|
102
|
+
["align-center", "format_align_center"],
|
|
103
|
+
["align-right", "format_align_right"],
|
|
104
|
+
["equals", "equal"],
|
|
105
|
+
["not-equal", "block"],
|
|
106
|
+
["copy", "content_copy"],
|
|
107
|
+
["chart-bar", "bar_chart"],
|
|
108
|
+
["less-than", ""],
|
|
109
|
+
["less-than-equal", ""],
|
|
110
|
+
["greater-than", ""],
|
|
111
|
+
["greater-than-equal", ""],
|
|
112
|
+
["stamp", "approval"],
|
|
113
|
+
["circle-notch", "progress_activity"]
|
|
114
|
+
];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { IIconFactory, IconStyle } from './IIconFactory';
|
|
1
|
+
export type { IIconFactory, IconStyle } from './IIconFactory';
|
|
2
2
|
export { IconFactory } from './IconFactory';
|
|
3
3
|
export { FontAwesomeIconFactory } from './FontAwesomeIconFactory';
|
|
4
|
+
export { MaterialSymbolsFontFactory } from './MaterialSymbolsFontFactory';
|
|
@@ -20,5 +20,6 @@ export default class Pager<TCriteria extends ValueObject, TModel extends Model.I
|
|
|
20
20
|
dataViewContext: DataViewContextParams<TModel>;
|
|
21
21
|
constructor(props: IPagerBaseProps<TCriteria, TModel>);
|
|
22
22
|
componentDidMount(): void;
|
|
23
|
+
componentDidUpdate(): void;
|
|
23
24
|
render(): JSX.Element | null;
|
|
24
25
|
}
|
|
@@ -16,6 +16,9 @@ var Pager = /** @class */ (function (_super) {
|
|
|
16
16
|
Pager.prototype.componentDidMount = function () {
|
|
17
17
|
this.props.pageManager.initialise();
|
|
18
18
|
};
|
|
19
|
+
Pager.prototype.componentDidUpdate = function () {
|
|
20
|
+
this.props.pageManager.afterRender();
|
|
21
|
+
};
|
|
19
22
|
Pager.prototype.render = function () {
|
|
20
23
|
var _a = this.props, pageManager = _a.pageManager, pageControls = _a.pageControls, pageControlProps = _a.pageControlProps, suppressLoader = _a.suppressLoader, hideBeforeLoad = _a.hideBeforeLoad, domProps = __rest(_a, ["pageManager", "pageControls", "pageControlProps", "suppressLoader", "hideBeforeLoad"]);
|
|
21
24
|
if (!pageManager.hasFetched && !pageManager.taskRunner.isBusy && hideBeforeLoad !== false) {
|
|
@@ -11,7 +11,7 @@ import PropertyInfo from '@singularsystems/neo-core/dist/Model/PropertyInfo';
|
|
|
11
11
|
import { IComponentBase } from './ComponentBase';
|
|
12
12
|
import FileInput, { IFileEditorProps } from './FileManager/FileInput';
|
|
13
13
|
import { FormContextParams } from './FormContext';
|
|
14
|
-
export type ItemCallback<T> = (item: T, meta: TransformMetaType<T
|
|
14
|
+
export type ItemCallback<T> = (item: T, meta: TransformMetaType<T>, isHeader: boolean) => React.ReactNode;
|
|
15
15
|
export declare enum ControlType {
|
|
16
16
|
Date = 0,
|
|
17
17
|
Number = 1,
|
|
@@ -9,7 +9,7 @@ interface ITabProps {
|
|
|
9
9
|
/** Name used for binding to selected tab. (Same as id property) */
|
|
10
10
|
name?: string;
|
|
11
11
|
/** Icon to display in tab header. */
|
|
12
|
-
icon?:
|
|
12
|
+
icon?: any;
|
|
13
13
|
/** True if the tab is disabled and not allowed to be clicked on. */
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/**
|
|
@@ -57,9 +57,10 @@ var TooltipProvider = /** @class */ (function (_super) {
|
|
|
57
57
|
var anchor = element;
|
|
58
58
|
var toolTip = anchor.dataset["tip"];
|
|
59
59
|
var tryCount = 0;
|
|
60
|
-
while (!toolTip && tryCount <
|
|
60
|
+
while (!toolTip && tryCount < 8 && anchor) {
|
|
61
61
|
anchor = anchor.parentElement;
|
|
62
62
|
toolTip = anchor && anchor.dataset["tip"];
|
|
63
|
+
tryCount++;
|
|
63
64
|
}
|
|
64
65
|
if (toolTip && anchor) {
|
|
65
66
|
if (!this.currentInfo || this.currentInfo.anchor !== anchor || this.currentInfo.text !== toolTip) {
|
|
@@ -7,6 +7,7 @@ import ColorPicker from './ColorPicker';
|
|
|
7
7
|
import ContextMenuContainer from './ContextMenu/ContextMenuContainer';
|
|
8
8
|
import DatePicker from './DatePicker';
|
|
9
9
|
import DropDown from './DropDown/DropDown';
|
|
10
|
+
import Icon from './Icons/Icon';
|
|
10
11
|
import Input, { Textbox, Passwordbox, Checkbox } from './Input';
|
|
11
12
|
import FileBasicInput from './FileManager/FileBasicInput';
|
|
12
13
|
import FileContext from './FileManager/FileContext';
|
|
@@ -38,4 +39,4 @@ import ToastContainer from './Notifications/ToastContainer';
|
|
|
38
39
|
import Tooltip from './Tooltip';
|
|
39
40
|
import TooltipProvider from './TooltipProvider';
|
|
40
41
|
import ValidationSummary from './ValidationSummary';
|
|
41
|
-
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Input, Link, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
42
|
+
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Icon, Input, Link, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
@@ -7,6 +7,7 @@ import ColorPicker from './ColorPicker';
|
|
|
7
7
|
import ContextMenuContainer from './ContextMenu/ContextMenuContainer';
|
|
8
8
|
import DatePicker from './DatePicker';
|
|
9
9
|
import DropDown from './DropDown/DropDown';
|
|
10
|
+
import Icon from './Icons/Icon';
|
|
10
11
|
import Input, { Textbox, Passwordbox, Checkbox } from './Input';
|
|
11
12
|
import FileBasicInput from './FileManager/FileBasicInput';
|
|
12
13
|
import FileContext from './FileManager/FileContext';
|
|
@@ -38,4 +39,4 @@ import ToastContainer from './Notifications/ToastContainer';
|
|
|
38
39
|
import Tooltip from './Tooltip';
|
|
39
40
|
import TooltipProvider from './TooltipProvider';
|
|
40
41
|
import ValidationSummary from './ValidationSummary';
|
|
41
|
-
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Input, Link, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
42
|
+
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Icon, Input, Link, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
@@ -11,6 +11,8 @@ export declare class RoutingState {
|
|
|
11
11
|
leavePromise?: Promise<boolean> | Promise<Misc.ModalResult> | Promise<void>;
|
|
12
12
|
observableRoute: IProcessedRoute | null;
|
|
13
13
|
currentView: IViewBase | null;
|
|
14
|
+
get currentViewFullScreen(): boolean;
|
|
15
|
+
get taskRunner(): import("@singularsystems/neo-core").ITaskRunner | undefined;
|
|
14
16
|
constructor();
|
|
15
17
|
setCurrentRoute(routeProps: RouteComponentProps, route: IProcessedRoute): void;
|
|
16
18
|
private previousRoute?;
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { injectable } from 'inversify';
|
|
3
|
-
import { makeObservable, observable } from 'mobx';
|
|
3
|
+
import { computed, makeObservable, observable } from 'mobx';
|
|
4
4
|
export var RoutingState = /** @class */ (function () {
|
|
5
5
|
function RoutingState() {
|
|
6
6
|
this.observableRoute = null;
|
|
7
7
|
this.currentView = null;
|
|
8
8
|
makeObservable(this);
|
|
9
9
|
}
|
|
10
|
+
Object.defineProperty(RoutingState.prototype, "currentViewFullScreen", {
|
|
11
|
+
get: function () {
|
|
12
|
+
var _a;
|
|
13
|
+
return ((_a = this.currentView) === null || _a === void 0 ? void 0 : _a.fullScreen) === true;
|
|
14
|
+
},
|
|
15
|
+
enumerable: false,
|
|
16
|
+
configurable: true
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(RoutingState.prototype, "taskRunner", {
|
|
19
|
+
get: function () {
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = this.currentView) === null || _a === void 0 ? void 0 : _a.taskRunner;
|
|
22
|
+
},
|
|
23
|
+
enumerable: false,
|
|
24
|
+
configurable: true
|
|
25
|
+
});
|
|
10
26
|
RoutingState.prototype.setCurrentRoute = function (routeProps, route) {
|
|
11
27
|
this.currentRouteProps = routeProps;
|
|
12
28
|
this.currentRoute = route;
|
|
@@ -37,6 +53,16 @@ export var RoutingState = /** @class */ (function () {
|
|
|
37
53
|
observable.ref,
|
|
38
54
|
__metadata("design:type", Object)
|
|
39
55
|
], RoutingState.prototype, "currentView", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
computed,
|
|
58
|
+
__metadata("design:type", Object),
|
|
59
|
+
__metadata("design:paramtypes", [])
|
|
60
|
+
], RoutingState.prototype, "currentViewFullScreen", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
computed,
|
|
63
|
+
__metadata("design:type", Object),
|
|
64
|
+
__metadata("design:paramtypes", [])
|
|
65
|
+
], RoutingState.prototype, "taskRunner", null);
|
|
40
66
|
RoutingState = __decorate([
|
|
41
67
|
injectable(),
|
|
42
68
|
__metadata("design:paramtypes", [])
|
|
@@ -6,6 +6,12 @@ import { IViewBase } from '../Views/ViewBase';
|
|
|
6
6
|
export type TransformParamsType<T> = {
|
|
7
7
|
[P in keyof T]: IViewParameter;
|
|
8
8
|
};
|
|
9
|
+
interface ISetValuesOptions {
|
|
10
|
+
/** True if the url should be set even if none of the values have changed. */
|
|
11
|
+
force?: boolean;
|
|
12
|
+
/** True if the url should be replaced instead of added to the history. This prevents the back button returning the params to the current state. */
|
|
13
|
+
replace?: boolean;
|
|
14
|
+
}
|
|
9
15
|
export interface IViewParameterList {
|
|
10
16
|
/**
|
|
11
17
|
* Returns the breadcrumb items for all url parameters which have a value.
|
|
@@ -16,11 +22,10 @@ export interface IViewParameterListOfT<TParams extends RouteParameterObject<TPar
|
|
|
16
22
|
/**
|
|
17
23
|
* Set the view params for each of the provided values. Only 1 navigation event will occur.
|
|
18
24
|
* @param values New values.
|
|
19
|
-
* @param force True if the url should be set even if none of the values have changed.
|
|
20
25
|
*/
|
|
21
26
|
setValues(values: {
|
|
22
27
|
[P in keyof TParams]?: number | string | null;
|
|
23
|
-
},
|
|
28
|
+
}, options?: ISetValuesOptions | boolean): void;
|
|
24
29
|
}
|
|
25
30
|
export interface IViewParameterListInternal extends IViewParameterList {
|
|
26
31
|
update(match: match): boolean;
|
|
@@ -38,7 +43,7 @@ export declare class ViewParameterList<TParams extends RouteParameterObject<TPar
|
|
|
38
43
|
private getQueryString;
|
|
39
44
|
setValues(values: {
|
|
40
45
|
[P in keyof TParams]?: number | string | null;
|
|
41
|
-
},
|
|
46
|
+
}, options?: ISetValuesOptions | boolean): void;
|
|
42
47
|
setUrl(viewParameter: ViewParameter | null, replace?: boolean): void;
|
|
43
48
|
/**
|
|
44
49
|
* Updates the parameter values from the values in the url. Returns true if any of the values have changed.
|
|
@@ -51,3 +56,4 @@ export declare class ViewParameterList<TParams extends RouteParameterObject<TPar
|
|
|
51
56
|
*/
|
|
52
57
|
static getPathForValues<TParams extends RouteParameterObject<TParams>>(basePath: string, params: TParams, values: {}): string;
|
|
53
58
|
}
|
|
59
|
+
export {};
|
|
@@ -69,17 +69,20 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
69
69
|
}
|
|
70
70
|
return queryPath;
|
|
71
71
|
};
|
|
72
|
-
ViewParameterList.prototype.setValues = function (values,
|
|
72
|
+
ViewParameterList.prototype.setValues = function (values, options) {
|
|
73
73
|
var _a;
|
|
74
|
-
if (force === void 0) { force = false; }
|
|
75
74
|
this.suppressNavigation = true;
|
|
76
75
|
this.hasSuppressedNavigation = false;
|
|
76
|
+
options !== null && options !== void 0 ? options : (options = {});
|
|
77
|
+
if (typeof options === "boolean") {
|
|
78
|
+
options = { force: true }; // parameter used to be named 'force'- backwards compatibility.
|
|
79
|
+
}
|
|
77
80
|
for (var paramName in values) {
|
|
78
81
|
this[paramName].value = (_a = values[paramName]) !== null && _a !== void 0 ? _a : null;
|
|
79
82
|
}
|
|
80
83
|
this.suppressNavigation = false;
|
|
81
|
-
if (this.hasSuppressedNavigation || force) {
|
|
82
|
-
this.setUrl(this.params[this.params.length - 1]);
|
|
84
|
+
if (this.hasSuppressedNavigation || options.force) {
|
|
85
|
+
this.setUrl(this.params[this.params.length - 1], options.replace);
|
|
83
86
|
}
|
|
84
87
|
};
|
|
85
88
|
ViewParameterList.prototype.setUrl = function (viewParameter, replace) {
|
package/dist/Views/ViewBase.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import EmptyViewModel from './EmptyViewModel';
|
|
|
10
10
|
import { IRouteChangedProps } from '../Routing/IRouteChangedProps';
|
|
11
11
|
import { valueOrLazy } from './ViewModelBase';
|
|
12
12
|
export interface IViewBase extends Views.IViewBase {
|
|
13
|
+
readonly fullScreen: boolean;
|
|
13
14
|
viewParams: IViewParameterList;
|
|
14
15
|
updateViewParams(match: match): void;
|
|
15
16
|
getBreadCrumbList(): BreadCrumbItem[];
|
|
@@ -22,6 +23,8 @@ export interface IViewBaseConstructor {
|
|
|
22
23
|
}
|
|
23
24
|
export default abstract class ViewBase<TViewModel extends IViewModel = EmptyViewModel, TParams extends RouteParameterObject<TParams> = {}> extends React.Component implements IViewBase {
|
|
24
25
|
viewName: string;
|
|
26
|
+
/** Indicates that the view requests to be displayed full screen. Up to the main layout to accommodate this. */
|
|
27
|
+
fullScreen: boolean;
|
|
25
28
|
static get currentView(): IViewBase | null;
|
|
26
29
|
private routingState;
|
|
27
30
|
navigation: import("../Routing").INavigationHelper;
|