@singularsystems/neo-react 1.3.9 → 1.4.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 +15 -0
- package/dist/React/ReactModelCreator.d.ts +1 -0
- package/dist/React/ReactModelCreator.js +13 -3
- package/dist/ReactComponents/Button.js +7 -1
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.d.ts +4 -4
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js +3 -2
- package/dist/ReactComponents/Grid/StickyTableHeader.d.ts +0 -1
- package/dist/ReactComponents/Grid/StickyTableHeader.js +16 -13
- package/dist/ReactComponents/GridLayout.js +0 -1
- package/dist/ReactComponents/Icons/IIconFactory.d.ts +3 -0
- package/dist/ReactComponents/Icons/IconFactory.js +10 -2
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.js +14 -3
- package/dist/ReactComponents/PropTypes.d.ts +3 -3
- package/dist/ReactComponents/PropTypes.js +1 -1
- package/dist/Routing/NavigationHelper.d.ts +8 -0
- package/dist/Routing/NavigationHelper.js +18 -0
- package/dist/Routing/ViewParameter.d.ts +1 -0
- package/dist/Routing/ViewParameter.js +9 -7
- package/dist/Routing/ViewParameterList.d.ts +2 -1
- package/dist/Routing/ViewParameterList.js +10 -3
- package/dist/Views/ViewBase.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
This file details all new features and changes to functionality. If you only need to see changes that require updates to your project, see the [breaking changes](./Breaking.md) readme.
|
|
4
4
|
|
|
5
|
+
## Version 1.4.0 (16 April 2026)
|
|
6
|
+
|
|
7
|
+
- Button
|
|
8
|
+
- Added an `isActive` prop to enable toggle buttons.
|
|
9
|
+
- Icons
|
|
10
|
+
- Added `tooltip` and `className` props to the `Neo.Icon` component.
|
|
11
|
+
- Added some missing material symbols mappings.
|
|
12
|
+
- Sticky table headers
|
|
13
|
+
- Fixed column widths not being restored properly.
|
|
14
|
+
|
|
15
|
+
## Version 1.3.10 (19 March 2026)
|
|
16
|
+
|
|
17
|
+
- AutoCompleteDropDown
|
|
18
|
+
- Fixed InputElement prop not being passed to underlying react-select component.
|
|
19
|
+
|
|
5
20
|
## Version 1.3.9 (4 March 2026)
|
|
6
21
|
|
|
7
22
|
- Dropdown
|
|
@@ -6,6 +6,7 @@ export declare class ReactModelCreator extends ModelCreatorBase {
|
|
|
6
6
|
setupModel(typeInfo: NeoTypeInfo, model: Model.IModelBase, options: Model.IMakeBindableOptions): void;
|
|
7
7
|
setupObject(typeInfo: NeoTypeInfo, object: any, options: Model.IMakeBindableOptions): void;
|
|
8
8
|
private setMobxObservableType;
|
|
9
|
+
private getObservableType;
|
|
9
10
|
private addChangeTracking;
|
|
10
11
|
private setupList;
|
|
11
12
|
}
|
|
@@ -81,17 +81,27 @@ var ReactModelCreator = /** @class */ (function (_super) {
|
|
|
81
81
|
ReactModelCreator.prototype.setMobxObservableType = function (object, propertyName, property, annotations) {
|
|
82
82
|
var propertyValue = object[propertyName], propertyInfo = property.propertyInfo;
|
|
83
83
|
this.ensureChildInfo(object, propertyInfo);
|
|
84
|
+
var observableType = this.getObservableType(propertyInfo);
|
|
84
85
|
if (propertyInfo.relationType === Misc.RelationType.ChildList) {
|
|
85
|
-
annotations[propertyName] = observable.shallow;
|
|
86
|
+
annotations[propertyName] = observableType !== null && observableType !== void 0 ? observableType : observable.shallow;
|
|
86
87
|
property.convertList = propertyValue;
|
|
87
88
|
}
|
|
88
89
|
else if (propertyValue instanceof Array) {
|
|
89
|
-
annotations[propertyName] = observable.shallow;
|
|
90
|
+
annotations[propertyName] = observableType !== null && observableType !== void 0 ? observableType : observable.shallow;
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
92
|
-
annotations[propertyName] = observable.ref;
|
|
93
|
+
annotations[propertyName] = observableType !== null && observableType !== void 0 ? observableType : observable.ref;
|
|
93
94
|
}
|
|
94
95
|
};
|
|
96
|
+
ReactModelCreator.prototype.getObservableType = function (propertyInfo) {
|
|
97
|
+
switch (propertyInfo.observableType) {
|
|
98
|
+
case Misc.ObservableType.Reference:
|
|
99
|
+
return observable.ref;
|
|
100
|
+
case Misc.ObservableType.Shallow:
|
|
101
|
+
return observable.shallow;
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
};
|
|
95
105
|
ReactModelCreator.prototype.addChangeTracking = function (object, propertyName, property) {
|
|
96
106
|
var _this = this;
|
|
97
107
|
var propertyInfo = property.propertyInfo, propertyInstance = property.propertyInstance;
|
|
@@ -21,6 +21,9 @@ var Button = /** @class */ (function (_super) {
|
|
|
21
21
|
var _this = this;
|
|
22
22
|
if (!this.state.isExpanded) {
|
|
23
23
|
this.setState({ isExpanded: true });
|
|
24
|
+
if (this.props.onMenuOpened !== undefined) {
|
|
25
|
+
this.props.onMenuOpened();
|
|
26
|
+
}
|
|
24
27
|
setTimeout(function () { return window.addEventListener("click", _this.windowClickHandler); }, 0);
|
|
25
28
|
}
|
|
26
29
|
};
|
|
@@ -61,7 +64,7 @@ var Button = /** @class */ (function (_super) {
|
|
|
61
64
|
Button.prototype.render = function () {
|
|
62
65
|
var _this = this;
|
|
63
66
|
var _a;
|
|
64
|
-
var _b = this.props, isSubmit = _b.isSubmit, variant = _b.variant, size = _b.size, isOutline = _b.isOutline, inline = _b.inline, icon = _b.icon, iconAlignment = _b.iconAlignment, text = _b.text, menuItems = _b.menuItems, splitMenu = _b.splitMenu, menuAlignment = _b.menuAlignment, buttonGroupClassName = _b.buttonGroupClassName, tooltip = _b.tooltip, task = _b.task, isBusy = _b.isBusy, pulse = _b.pulse, customVariant = _b.customVariant, native = __rest(_b, ["isSubmit", "variant", "size", "isOutline", "inline", "icon", "iconAlignment", "text", "menuItems", "splitMenu", "menuAlignment", "buttonGroupClassName", "tooltip", "task", "isBusy", "pulse", "customVariant"]);
|
|
67
|
+
var _b = this.props, isSubmit = _b.isSubmit, variant = _b.variant, size = _b.size, isOutline = _b.isOutline, inline = _b.inline, icon = _b.icon, iconAlignment = _b.iconAlignment, text = _b.text, menuItems = _b.menuItems, splitMenu = _b.splitMenu, menuAlignment = _b.menuAlignment, buttonGroupClassName = _b.buttonGroupClassName, tooltip = _b.tooltip, task = _b.task, isBusy = _b.isBusy, pulse = _b.pulse, customVariant = _b.customVariant, isActive = _b.isActive, onMenuOpened = _b.onMenuOpened, native = __rest(_b, ["isSubmit", "variant", "size", "isOutline", "inline", "icon", "iconAlignment", "text", "menuItems", "splitMenu", "menuAlignment", "buttonGroupClassName", "tooltip", "task", "isBusy", "pulse", "customVariant", "isActive", "onMenuOpened"]);
|
|
65
68
|
native.type = isSubmit ? "submit" : "button";
|
|
66
69
|
var variantClassName = ((_a = customVariant !== null && customVariant !== void 0 ? customVariant : variant) !== null && _a !== void 0 ? _a : "primary");
|
|
67
70
|
var isLoading = isBusy || (task === null || task === void 0 ? void 0 : task.isBusy);
|
|
@@ -90,6 +93,9 @@ var Button = /** @class */ (function (_super) {
|
|
|
90
93
|
if (pulse) {
|
|
91
94
|
buttonClasses += " ".concat(variantClassName, "-color-pulse");
|
|
92
95
|
}
|
|
96
|
+
if (isActive) {
|
|
97
|
+
buttonClasses += " active";
|
|
98
|
+
}
|
|
93
99
|
native.className = (native.className || "") + " " + buttonClasses;
|
|
94
100
|
// Button text
|
|
95
101
|
var innerText = this.props.children;
|
|
@@ -2,17 +2,17 @@ import React, { JSX } from 'react';
|
|
|
2
2
|
import { Model } from '@singularsystems/neo-core';
|
|
3
3
|
import { AxiosPromise } from 'axios';
|
|
4
4
|
import { DropDownBase, ItemSource } from './DropDownBase';
|
|
5
|
-
import type { Props } from 'react-select';
|
|
5
|
+
import type { Props, SelectInstance } from 'react-select';
|
|
6
6
|
import { ICommonEditorProps } from '../PropTypes';
|
|
7
7
|
import { FormContext } from '../FormContext';
|
|
8
|
-
interface IOption {
|
|
8
|
+
interface IOption<T = any> {
|
|
9
9
|
value: string | number;
|
|
10
10
|
label: string;
|
|
11
|
-
item?:
|
|
11
|
+
item?: T;
|
|
12
12
|
itemParent?: any;
|
|
13
13
|
options?: IOption[];
|
|
14
14
|
}
|
|
15
|
-
interface IAutoCompleteCommonProps<T, TChild = T> extends ICommonEditorProps
|
|
15
|
+
interface IAutoCompleteCommonProps<T, TChild = T> extends ICommonEditorProps<SelectInstance>, Props<IOption, true> {
|
|
16
16
|
/**
|
|
17
17
|
* Callback for loading data.
|
|
18
18
|
*/
|
|
@@ -309,11 +309,12 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
309
309
|
return !input || _this.props.inputFilter(input, option.data.item, option.data.itemParent);
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
+
var inputRef = splitProps.editor.inputElement;
|
|
312
313
|
if (this.props.itemSource !== undefined) {
|
|
313
|
-
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (_h = this.props.placeholder) !== null && _h !== void 0 ? _h : "", classNamePrefix: "react-select-bs", defaultOptions: defaultItems, loadOptions: this.onKeyPress, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a, _b; return c.inputValue && c.inputValue.length >= (minCharacters !== null && minCharacters !== void 0 ? minCharacters : 1) ? ((_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found") : ((_b = _this.props.typeToSearchPrompt) !== null && _b !== void 0 ? _b : "Type to search..."); }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
|
|
314
|
+
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (_h = this.props.placeholder) !== null && _h !== void 0 ? _h : "", classNamePrefix: "react-select-bs", defaultOptions: defaultItems, loadOptions: this.onKeyPress, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a, _b; return c.inputValue && c.inputValue.length >= (minCharacters !== null && minCharacters !== void 0 ? minCharacters : 1) ? ((_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found") : ((_b = _this.props.typeToSearchPrompt) !== null && _b !== void 0 ? _b : "Type to search..."); }, value: value, onChange: this.onItemSelected, components: components, ref: inputRef })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
|
|
314
315
|
}
|
|
315
316
|
else {
|
|
316
|
-
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_j = this.props.placeholder) !== null && _j !== void 0 ? _j : "", classNamePrefix: "react-select-bs", options: defaultItems, isLoading: this.isLoading, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a; return (_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found"; }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
|
|
317
|
+
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_j = this.props.placeholder) !== null && _j !== void 0 ? _j : "", classNamePrefix: "react-select-bs", options: defaultItems, isLoading: this.isLoading, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a; return (_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found"; }, value: value, onChange: this.onItemSelected, components: components, ref: inputRef })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
|
|
317
318
|
}
|
|
318
319
|
};
|
|
319
320
|
AutoCompleteDropDown.prototype.getOption = function (content, additionalClass) {
|
|
@@ -57,8 +57,7 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
57
57
|
this.headerCopy = this.header.cloneNode(true);
|
|
58
58
|
this.table.insertBefore(this.headerCopy, this.header);
|
|
59
59
|
this.header.classList.add("neo-grid-fixed-header");
|
|
60
|
-
this.
|
|
61
|
-
this.syncColumnWidths();
|
|
60
|
+
this.syncColumnWidths(true);
|
|
62
61
|
this.domObserver.observe(this.header, { childList: true, subtree: true, attributes: false });
|
|
63
62
|
}
|
|
64
63
|
this.header.style.left = tableBounds.left + "px";
|
|
@@ -89,7 +88,11 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
89
88
|
var _this = this;
|
|
90
89
|
setTimeout(function () { return _this.syncColumnWidths(); }, 0);
|
|
91
90
|
};
|
|
92
|
-
StickyTableHeader.prototype.syncColumnWidths = function () {
|
|
91
|
+
StickyTableHeader.prototype.syncColumnWidths = function (storeWidths) {
|
|
92
|
+
if (storeWidths === void 0) { storeWidths = false; }
|
|
93
|
+
if (storeWidths) {
|
|
94
|
+
this.originalWidths = [];
|
|
95
|
+
}
|
|
93
96
|
if (this.headerCopy) {
|
|
94
97
|
for (var i = 0; i < this.header.rows.length; i++) {
|
|
95
98
|
var originalRow = this.header.rows[i], copyRow = this.headerCopy.rows[i];
|
|
@@ -100,6 +103,14 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
100
103
|
}
|
|
101
104
|
for (var j = 0; j < originalRow.cells.length; j++) {
|
|
102
105
|
var originalCell = originalRow.cells[j], copyCell = copyRow.cells[j];
|
|
106
|
+
if (storeWidths) {
|
|
107
|
+
this.originalWidths.push({
|
|
108
|
+
cell: originalCell,
|
|
109
|
+
width: originalCell.style.width,
|
|
110
|
+
minWidth: originalCell.style.minWidth,
|
|
111
|
+
maxWidth: originalCell.style.maxWidth
|
|
112
|
+
});
|
|
113
|
+
}
|
|
103
114
|
originalCell.style.width = window.getComputedStyle(copyCell).width;
|
|
104
115
|
originalCell.style.minWidth = originalCell.style.width;
|
|
105
116
|
originalCell.style.maxWidth = originalCell.style.width;
|
|
@@ -107,20 +118,12 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
120
|
};
|
|
110
|
-
StickyTableHeader.prototype.storeColumnWidths = function () {
|
|
111
|
-
this.originalWidths = [];
|
|
112
|
-
for (var i = 0; i < this.header.rows.length; i++) {
|
|
113
|
-
var row = this.header.rows[i];
|
|
114
|
-
for (var j = 0; j < row.cells.length; j++) {
|
|
115
|
-
var cell = row.cells[j];
|
|
116
|
-
this.originalWidths.push({ cell: cell, width: cell.style.width });
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
121
|
StickyTableHeader.prototype.restoreColumnWidths = function () {
|
|
121
122
|
for (var _i = 0, _a = this.originalWidths; _i < _a.length; _i++) {
|
|
122
123
|
var cellRef = _a[_i];
|
|
123
124
|
cellRef.cell.style.width = cellRef.width;
|
|
125
|
+
cellRef.cell.style.minWidth = cellRef.minWidth;
|
|
126
|
+
cellRef.cell.style.maxWidth = cellRef.maxWidth;
|
|
124
127
|
}
|
|
125
128
|
};
|
|
126
129
|
StickyTableHeader.prototype.dispose = function () {
|
|
@@ -52,7 +52,6 @@ var GridLayout = /** @class */ (function (_super) {
|
|
|
52
52
|
var itemsPerRow = Math.ceil(childCount / maxColumns);
|
|
53
53
|
var rows = [];
|
|
54
54
|
for (var i = 0; i < maxColumns; i++) {
|
|
55
|
-
BootstrapUtils;
|
|
56
55
|
rows.push(React.createElement("div", { key: i }, childItems.splice(0, itemsPerRow)));
|
|
57
56
|
}
|
|
58
57
|
childItems = rows;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Components } from "@singularsystems/neo-core";
|
|
1
2
|
export interface IconStyle {
|
|
2
3
|
/** True if the icon should be fixed width */
|
|
3
4
|
fixedWidth?: boolean;
|
|
@@ -9,6 +10,8 @@ export interface IconStyle {
|
|
|
9
10
|
weight?: number;
|
|
10
11
|
/** Specific font size. Any valid css font size. */
|
|
11
12
|
size?: string;
|
|
13
|
+
tooltip?: string | Components.Tooltip.ITooltipOptions;
|
|
14
|
+
className?: string;
|
|
12
15
|
}
|
|
13
16
|
export interface IIconFactory {
|
|
14
17
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
1
|
+
import { __assign, __decorate } from "tslib";
|
|
2
2
|
import { Utils } from "@singularsystems/neo-core";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { injectable } from 'inversify';
|
|
5
|
+
import Tooltip from "../Tooltip";
|
|
5
6
|
/** Default icon factory supporting font-awesome strings. */
|
|
6
7
|
var IconFactory = /** @class */ (function () {
|
|
7
8
|
function IconFactory() {
|
|
@@ -44,7 +45,14 @@ var IconFactory = /** @class */ (function () {
|
|
|
44
45
|
inlineStyle = { fontSize: style.size };
|
|
45
46
|
}
|
|
46
47
|
className += " neo-icon";
|
|
47
|
-
|
|
48
|
+
if (style === null || style === void 0 ? void 0 : style.className) {
|
|
49
|
+
className += " " + style.className;
|
|
50
|
+
}
|
|
51
|
+
var tooltipProps = {};
|
|
52
|
+
if (style === null || style === void 0 ? void 0 : style.tooltip) {
|
|
53
|
+
Tooltip.setDomProperties(tooltipProps, style.tooltip);
|
|
54
|
+
}
|
|
55
|
+
return React.createElement("i", __assign({ className: className, style: inlineStyle }, tooltipProps));
|
|
48
56
|
};
|
|
49
57
|
IconFactory.prototype.createIconComponent = function (iconDescriptor, style) {
|
|
50
58
|
return iconDescriptor;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
1
|
+
import { __assign, __extends } from "tslib";
|
|
2
2
|
import { Utils } from "@singularsystems/neo-core";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { IconFactory } from ".";
|
|
5
|
+
import Tooltip from "../Tooltip";
|
|
5
6
|
/**
|
|
6
7
|
* Font factory that renders google material symbols icons.
|
|
7
8
|
*/
|
|
@@ -33,6 +34,9 @@ var MaterialSymbolsFontFactory = /** @class */ (function (_super) {
|
|
|
33
34
|
if (style === null || style === void 0 ? void 0 : style.spin) {
|
|
34
35
|
className += " fa fa-spin";
|
|
35
36
|
}
|
|
37
|
+
if (style === null || style === void 0 ? void 0 : style.className) {
|
|
38
|
+
className += " " + style.className;
|
|
39
|
+
}
|
|
36
40
|
// remove and extract convention styling
|
|
37
41
|
iconName = iconName.replace("fa-fw", "");
|
|
38
42
|
var faProps = Utils.getFontAwesomeIconProps(iconName);
|
|
@@ -66,7 +70,11 @@ var MaterialSymbolsFontFactory = /** @class */ (function (_super) {
|
|
|
66
70
|
cssStyle !== null && cssStyle !== void 0 ? cssStyle : (cssStyle = {});
|
|
67
71
|
cssStyle.fontSize = style.size;
|
|
68
72
|
}
|
|
69
|
-
|
|
73
|
+
var tooltipProps = {};
|
|
74
|
+
if (style === null || style === void 0 ? void 0 : style.tooltip) {
|
|
75
|
+
Tooltip.setDomProperties(tooltipProps, style.tooltip);
|
|
76
|
+
}
|
|
77
|
+
return React.createElement("span", __assign({ className: className, style: cssStyle }, tooltipProps), mappedName);
|
|
70
78
|
};
|
|
71
79
|
MaterialSymbolsFontFactory.prototype.mapFontAwesomeToMaterial = function (faName) {
|
|
72
80
|
return this.fontAwesomeMap.get(faName.trim());
|
|
@@ -119,5 +127,8 @@ var neoFontAwesomeMappings = [
|
|
|
119
127
|
["stamp", "approval"],
|
|
120
128
|
["circle-notch", "progress_activity"],
|
|
121
129
|
["cube", "deployed_code"],
|
|
122
|
-
["paper-plane", "send"]
|
|
130
|
+
["paper-plane", "send"],
|
|
131
|
+
["layer-group", "layers"],
|
|
132
|
+
["arrow-up-right-from-square", "open_in_new"],
|
|
133
|
+
["file", "draft"]
|
|
123
134
|
];
|
|
@@ -25,7 +25,7 @@ export declare enum CheckboxType {
|
|
|
25
25
|
Checkbox = 1,
|
|
26
26
|
Switch = 2
|
|
27
27
|
}
|
|
28
|
-
export interface ICommonEditorProps {
|
|
28
|
+
export interface ICommonEditorProps<TInputRef = HTMLElement> {
|
|
29
29
|
/** True if the editor should be readonly. This is set automatically if you use display instead of bind on a FormGroup / Column. */
|
|
30
30
|
isReadOnly?: boolean;
|
|
31
31
|
/** True if the editor should be readonly. This is set automatically if you use display instead of bind on a FormGroup / Column. */
|
|
@@ -49,7 +49,7 @@ export interface ICommonEditorProps {
|
|
|
49
49
|
/** True if append / prepend is set, which means this must be an editor as part of a bs editor group. */
|
|
50
50
|
requiresGroup?: boolean;
|
|
51
51
|
/** Reference to the input dom element */
|
|
52
|
-
inputElement?: React.RefObject<
|
|
52
|
+
inputElement?: React.RefObject<TInputRef | null>;
|
|
53
53
|
}
|
|
54
54
|
export interface IBindableEditorPropsNoBase extends ICommonEditorProps {
|
|
55
55
|
bind: Model.IPropertyInstance;
|
|
@@ -141,7 +141,7 @@ export declare class BindPropsHelper {
|
|
|
141
141
|
static getBindProperty<T>(allProps: IEditorContainerProps<T, any>): Model.IPropertyInstance;
|
|
142
142
|
static splitCommonEditorProps<T extends ICommonEditorProps>(props: T): {
|
|
143
143
|
editor: ICommonEditorProps;
|
|
144
|
-
rest: Omit<T, "disabled" | "readOnly" | "isReadOnly" | "isDisabled" | "prependText" | "appendText" | "prepend" | "append" | "prependIcon" | "appendIcon" | "inputElement">;
|
|
144
|
+
rest: Omit<T, "disabled" | "readOnly" | "isReadOnly" | "isDisabled" | "prependText" | "appendText" | "prepend" | "append" | "prependIcon" | "appendIcon" | "requiresGroup" | "inputElement">;
|
|
145
145
|
};
|
|
146
146
|
static normaliseContainerProps<T, TContainerDom = React.HTMLProps<T>, TData = any>(component: IComponentBase, props: IEditorContainerProps<T, TData>, inGroup: boolean, isBootstrap?: boolean): IEditorContainerNormalisedProps<TContainerDom, TData>;
|
|
147
147
|
static normaliseEditorProps<T, TDom = React.HTMLProps<T>>(component: IComponentBase, props: (IEditorAndSelectorProps<T, any> & TDom) | IEditorNormalisedProps<TDom, any>): IEditorNormalisedProps<TDom, any>;
|
|
@@ -102,7 +102,7 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
102
102
|
return (allProps.bind || allProps.display || allProps.bindContext);
|
|
103
103
|
};
|
|
104
104
|
BindPropsHelper.splitCommonEditorProps = function (props) {
|
|
105
|
-
var isReadOnly = props.isReadOnly, readOnly = props.readOnly, isDisabled = props.isDisabled, disabled = props.disabled, prependText = props.prependText, prepend = props.prepend, prependIcon = props.prependIcon, appendText = props.appendText, append = props.append, appendIcon = props.appendIcon, inputElement = props.inputElement, rest = __rest(props, ["isReadOnly", "readOnly", "isDisabled", "disabled", "prependText", "prepend", "prependIcon", "appendText", "append", "appendIcon", "inputElement"]);
|
|
105
|
+
var isReadOnly = props.isReadOnly, readOnly = props.readOnly, isDisabled = props.isDisabled, disabled = props.disabled, prependText = props.prependText, prepend = props.prepend, prependIcon = props.prependIcon, appendText = props.appendText, append = props.append, appendIcon = props.appendIcon, inputElement = props.inputElement, requiresGroup = props.requiresGroup, rest = __rest(props, ["isReadOnly", "readOnly", "isDisabled", "disabled", "prependText", "prepend", "prependIcon", "appendText", "append", "appendIcon", "inputElement", "requiresGroup"]);
|
|
106
106
|
return {
|
|
107
107
|
editor: {
|
|
108
108
|
isReadOnly: (isReadOnly !== null && isReadOnly !== void 0 ? isReadOnly : readOnly), isDisabled: (isDisabled !== null && isDisabled !== void 0 ? isDisabled : disabled),
|
|
@@ -34,6 +34,14 @@ export default class NavigationHelper implements INavigationHelper {
|
|
|
34
34
|
private isPrompting;
|
|
35
35
|
navigateInternal(url: string, replace?: boolean): Promise<boolean>;
|
|
36
36
|
navigateToView<TParams extends RouteParameterObject<TParams>>(view: ViewConstructor<TParams>, paramValues?: ParamValues<TParams>): void;
|
|
37
|
+
openWindow(path: string, state?: {
|
|
38
|
+
name: string;
|
|
39
|
+
value: object;
|
|
40
|
+
}, options?: {
|
|
41
|
+
target?: string;
|
|
42
|
+
features?: string;
|
|
43
|
+
}): Window | null;
|
|
44
|
+
readOpenerState(name: string, reset?: boolean): object | undefined;
|
|
37
45
|
getPathForView<TParams extends RouteParameterObject<TParams>>(view: ViewConstructor<TParams>, paramValues?: ParamValues<TParams>): string;
|
|
38
46
|
getCurrentViewPath(): string;
|
|
39
47
|
private historyPopState;
|
|
@@ -75,6 +75,24 @@ var NavigationHelper = /** @class */ (function () {
|
|
|
75
75
|
NavigationHelper.prototype.navigateToView = function (view, paramValues) {
|
|
76
76
|
this.navigateInternal(this.getPathForView(view, paramValues));
|
|
77
77
|
};
|
|
78
|
+
NavigationHelper.prototype.openWindow = function (path, state, options) {
|
|
79
|
+
var newWindow = window.open(this.routingState.basePath + path, options === null || options === void 0 ? void 0 : options.target, options === null || options === void 0 ? void 0 : options.features);
|
|
80
|
+
if (newWindow && state) {
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
newWindow["__neoOpenerState" + state.name] = state.value;
|
|
83
|
+
}
|
|
84
|
+
return newWindow;
|
|
85
|
+
};
|
|
86
|
+
NavigationHelper.prototype.readOpenerState = function (name, reset) {
|
|
87
|
+
if (reset === void 0) { reset = true; }
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
var openerState = window["__neoOpenerState" + name];
|
|
90
|
+
if (reset && openerState !== undefined) {
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
window["__neoOpenerState" + name] = undefined;
|
|
93
|
+
}
|
|
94
|
+
return openerState;
|
|
95
|
+
};
|
|
78
96
|
NavigationHelper.prototype.getPathForView = function (view, paramValues) {
|
|
79
97
|
var basePath = this.routingState.appRouteProvider.getPathForComponent(view);
|
|
80
98
|
if (basePath !== undefined) {
|
|
@@ -26,13 +26,7 @@ var ViewParameter = /** @class */ (function () {
|
|
|
26
26
|
return this._value;
|
|
27
27
|
},
|
|
28
28
|
set: function (value) {
|
|
29
|
-
var stringValue;
|
|
30
|
-
if (value instanceof Array) {
|
|
31
|
-
stringValue = value.join(",");
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
stringValue = value ? value.toString() : null;
|
|
35
|
-
}
|
|
29
|
+
var stringValue = this.getStringValue(value);
|
|
36
30
|
if (stringValue !== this._value) {
|
|
37
31
|
this.hasPendingValue = true;
|
|
38
32
|
this.pendingValue = stringValue;
|
|
@@ -122,6 +116,14 @@ var ViewParameter = /** @class */ (function () {
|
|
|
122
116
|
enumerable: false,
|
|
123
117
|
configurable: true
|
|
124
118
|
});
|
|
119
|
+
ViewParameter.prototype.getStringValue = function (value) {
|
|
120
|
+
if (value instanceof Array) {
|
|
121
|
+
return value.join(",");
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return value ? value.toString() : null;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
125
127
|
__decorate([
|
|
126
128
|
observable.ref,
|
|
127
129
|
__metadata("design:type", String)
|
|
@@ -16,7 +16,7 @@ export interface IViewParameterList {
|
|
|
16
16
|
/**
|
|
17
17
|
* Returns the breadcrumb items for all url parameters which have a value.
|
|
18
18
|
*/
|
|
19
|
-
getBreadCrumbList(): BreadCrumbItem[];
|
|
19
|
+
getBreadCrumbList(upTo?: ViewParameter): BreadCrumbItem[];
|
|
20
20
|
}
|
|
21
21
|
export interface IViewParameterListOfT<TParams extends RouteParameterObject<TParams>> extends IViewParameterList {
|
|
22
22
|
/**
|
|
@@ -43,6 +43,7 @@ export declare class ViewParameterList<TParams extends RouteParameterObject<TPar
|
|
|
43
43
|
[P in keyof TParams]?: number | string | string[] | null;
|
|
44
44
|
}, options?: ISetValuesOptions | boolean): void;
|
|
45
45
|
setUrl(viewParameter: ViewParameter | null, replace?: boolean): void;
|
|
46
|
+
getUrl(viewParameter: ViewParameter): string | undefined;
|
|
46
47
|
/**
|
|
47
48
|
* Gets a url for an object with view params specified.
|
|
48
49
|
* @param basePath Base path without parameters
|
|
@@ -97,15 +97,22 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
97
97
|
else {
|
|
98
98
|
var navigationHelper = Misc.Globals.appService.get(NeoReactTypes.Routing.NavigationHelper);
|
|
99
99
|
if (viewParameter) {
|
|
100
|
-
var
|
|
101
|
-
if (
|
|
102
|
-
navigationHelper.navigateInternal(
|
|
100
|
+
var url = this.getUrl(viewParameter);
|
|
101
|
+
if (url) {
|
|
102
|
+
navigationHelper.navigateInternal(url, replace);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
navigationHelper.navigateInternal(navigationHelper.getCurrentViewPath(), replace);
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
+
ViewParameterList.prototype.getUrl = function (viewParameter) {
|
|
110
|
+
var allItems = this.getBreadCrumbList(viewParameter);
|
|
111
|
+
if (allItems.length > 0) {
|
|
112
|
+
return allItems[allItems.length - 1].link;
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
};
|
|
109
116
|
/**
|
|
110
117
|
* @internal
|
|
111
118
|
* Updates the parameter values from the values in the url. Returns true if any of the values have changed.
|
package/dist/Views/ViewBase.js
CHANGED
|
@@ -29,8 +29,8 @@ var ViewBase = /** @class */ (function (_super) {
|
|
|
29
29
|
}
|
|
30
30
|
_this.viewName = viewName;
|
|
31
31
|
_this.viewState = _this.getStoredViewState(viewModel);
|
|
32
|
-
_this.routingState.currentView = _this;
|
|
33
32
|
makeObservable(_this);
|
|
33
|
+
_this.routingState.currentView = _this;
|
|
34
34
|
return _this;
|
|
35
35
|
}
|
|
36
36
|
Object.defineProperty(ViewBase, "currentView", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singularsystems/neo-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "React application logic and components for the Neo client library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tslib": "2.8.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@singularsystems/neo-core": ">=1.
|
|
45
|
+
"@singularsystems/neo-core": ">=1.4.0",
|
|
46
46
|
"axios": ">=1.6.2",
|
|
47
47
|
"inversify": ">=5.0.1",
|
|
48
48
|
"mobx": ">=6.9.0",
|