@singularsystems/neo-react 0.10.64 → 0.10.66
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 +17 -6
- package/dist/ReactComponents/Button.js +7 -7
- package/dist/ReactComponents/Card.js +2 -2
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js +17 -17
- package/dist/ReactComponents/DropDown/DropDown.d.ts +3 -0
- package/dist/ReactComponents/DropDown/DropDown.js +13 -8
- package/dist/ReactComponents/ErrorHandler.js +1 -1
- package/dist/ReactComponents/FileManager/FileBasicInput.js +1 -1
- package/dist/ReactComponents/FileManager/FileInput.js +2 -2
- package/dist/ReactComponents/Form.d.ts +1 -2
- package/dist/ReactComponents/Form.js +1 -1
- package/dist/ReactComponents/FormGroup/FormGroup.js +1 -1
- package/dist/ReactComponents/Grid/ButtonColumn.js +1 -1
- package/dist/ReactComponents/Grid/Column.js +2 -3
- package/dist/ReactComponents/Grid/ColumnHelper.d.ts +1 -1
- package/dist/ReactComponents/Grid/ColumnHelper.js +3 -3
- package/dist/ReactComponents/Grid/Grid.d.ts +1 -0
- package/dist/ReactComponents/Grid/Grid.js +12 -12
- package/dist/ReactComponents/Grid/Row.d.ts +4 -0
- package/dist/ReactComponents/Grid/Row.js +4 -3
- package/dist/ReactComponents/Icons/FontAwesomeIconFactory.js +4 -5
- package/dist/ReactComponents/Icons/IIconFactory.d.ts +6 -0
- package/dist/ReactComponents/Icons/IIconFactory.js +1 -0
- package/dist/ReactComponents/Icons/Icon.d.ts +13 -0
- package/dist/ReactComponents/Icons/Icon.js +27 -0
- package/dist/ReactComponents/Icons/IconFactory.d.ts +2 -2
- package/dist/ReactComponents/Icons/IconFactory.js +9 -4
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.d.ts +21 -0
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.js +113 -0
- package/dist/ReactComponents/Icons/index.d.ts +2 -1
- package/dist/ReactComponents/Icons/index.js +1 -0
- package/dist/ReactComponents/Input.js +4 -4
- package/dist/ReactComponents/InputHelpers.js +2 -2
- package/dist/ReactComponents/Link.js +1 -1
- package/dist/ReactComponents/Modal/Modal.js +1 -1
- package/dist/ReactComponents/Modal/ModalContainer.js +1 -1
- package/dist/ReactComponents/NumberInput.js +6 -7
- package/dist/ReactComponents/Paging/PageSizeControl.js +1 -1
- package/dist/ReactComponents/Paging/Pager.d.ts +1 -0
- package/dist/ReactComponents/Paging/Pager.js +3 -0
- package/dist/ReactComponents/PropTypes.d.ts +3 -3
- package/dist/ReactComponents/PropTypes.js +18 -13
- package/dist/ReactComponents/RadioList.js +3 -3
- package/dist/ReactComponents/Slider.js +3 -3
- package/dist/ReactComponents/Tabs/Tab.d.ts +1 -1
- package/dist/ReactComponents/Tabs/Tab.js +1 -1
- package/dist/ReactComponents/Tabs/TabContainer.js +1 -1
- package/dist/ReactComponents/Tabs/TabManager.js +2 -3
- 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/IRouteChangedProps.js +1 -0
- package/dist/Routing/NavigationHelper.d.ts +1 -1
- package/dist/Routing/NavigationHelper.js +1 -1
- package/dist/Routing/RouteProvider.js +2 -2
- package/dist/Routing/RouteView.js +6 -6
- package/dist/Routing/RoutingState.d.ts +4 -0
- package/dist/Routing/RoutingState.js +37 -7
- package/dist/Routing/ViewParameter.js +3 -3
- package/dist/Routing/ViewParameterList.d.ts +9 -3
- package/dist/Routing/ViewParameterList.js +9 -6
- package/dist/Services/IDisposeHelper.js +1 -0
- package/dist/Views/IViewModel.js +1 -0
- package/dist/Views/ViewBase.d.ts +4 -2
- package/dist/Views/ViewBase.js +17 -10
- package/dist/Views/ViewModelBase.d.ts +1 -1
- package/dist/Views/ViewModelBase.js +1 -2
- package/package.json +19 -10
- package/dist/ReactComponents/IconFactory.d.ts +0 -27
- package/dist/ReactComponents/IconFactory.js +0 -46
- package/dist/ReactComponents/ReactHelpers.d.ts +0 -5
- package/dist/ReactComponents/ReactHelpers.js +0 -17
|
@@ -15,22 +15,21 @@ var FontAwesomeIconFactory = /** @class */ (function (_super) {
|
|
|
15
15
|
return _this;
|
|
16
16
|
}
|
|
17
17
|
FontAwesomeIconFactory.prototype.createIconComponent = function (iconComponent, iconStyle) {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
18
|
if (iconComponent.iconName) {
|
|
20
19
|
// Icon was specified using a font-awesome icon descriptor, return the font-awesome icon component.
|
|
21
20
|
return React.createElement(this.fontAwesomeComponentType, {
|
|
22
21
|
icon: iconComponent,
|
|
23
|
-
fixedWidth:
|
|
24
|
-
spin:
|
|
22
|
+
fixedWidth: iconStyle === null || iconStyle === void 0 ? void 0 : iconStyle.fixedWidth,
|
|
23
|
+
spin: iconStyle === null || iconStyle === void 0 ? void 0 : iconStyle.spin
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
26
|
else {
|
|
28
27
|
// Icon was specified as a font-awesome component. Extract the props, and override using the requested style.
|
|
29
28
|
var props = __assign({}, iconComponent.props);
|
|
30
|
-
if (
|
|
29
|
+
if (iconStyle === null || iconStyle === void 0 ? void 0 : iconStyle.fixedWidth) {
|
|
31
30
|
props.fixedWidth = iconStyle.fixedWidth;
|
|
32
31
|
}
|
|
33
|
-
if (
|
|
32
|
+
if (iconStyle === null || iconStyle === void 0 ? void 0 : iconStyle.spin) {
|
|
34
33
|
props.spin = iconStyle.spin;
|
|
35
34
|
}
|
|
36
35
|
return React.createElement(iconComponent.type, props);
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { IconStyle, IIconFactory } from "./IIconFactory";
|
|
3
3
|
/** Default icon factory supporting font-awesome strings. */
|
|
4
4
|
export declare class IconFactory implements IIconFactory {
|
|
5
|
-
getIconComponent(iconOrName: any, style?: IconStyle):
|
|
6
|
-
textOrIcon(textOrIcon: string, style?: IconStyle):
|
|
5
|
+
getIconComponent(iconOrName: any, style?: IconStyle): React.ReactNode;
|
|
6
|
+
textOrIcon(textOrIcon: string, style?: IconStyle): React.ReactNode;
|
|
7
7
|
protected mapStringToIcon(iconName: string, style?: IconStyle): React.ReactNode;
|
|
8
8
|
protected createIconComponent(iconDescriptor: any, style?: IconStyle): React.ReactNode;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ 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 {
|
|
@@ -26,12 +26,17 @@ var IconFactory = /** @class */ (function () {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
IconFactory.prototype.mapStringToIcon = function (iconName, style) {
|
|
29
|
-
var _a, _b;
|
|
30
29
|
var className = Utils.getFontAwesomeClass(iconName);
|
|
31
|
-
if ((
|
|
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
|
+
}
|
|
36
|
+
if (style === null || style === void 0 ? void 0 : style.fixedWidth) {
|
|
32
37
|
className += " fa-fw";
|
|
33
38
|
}
|
|
34
|
-
if (
|
|
39
|
+
if (style === null || style === void 0 ? void 0 : style.spin) {
|
|
35
40
|
className += " fa-spin";
|
|
36
41
|
}
|
|
37
42
|
return React.createElement("i", { className: className });
|
|
@@ -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,113 @@
|
|
|
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 _a;
|
|
12
|
+
var _this = _super.call(this) || this;
|
|
13
|
+
_this.filledByDefault = (_a = options === null || options === void 0 ? void 0 : options.fillDefault) !== null && _a !== void 0 ? _a : false;
|
|
14
|
+
if ((options === null || options === void 0 ? void 0 : options.fontAwesomeMappings) && (options === null || options === void 0 ? void 0 : options.replaceNeoMappings)) {
|
|
15
|
+
_this.fontAwesomeMap = new Map(options.fontAwesomeMappings);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
_this.fontAwesomeMap = new Map(neoFontAwesomeMappings);
|
|
19
|
+
if (options === null || options === void 0 ? void 0 : options.fontAwesomeMappings) {
|
|
20
|
+
for (var _i = 0, _b = options.fontAwesomeMappings; _i < _b.length; _i++) {
|
|
21
|
+
var mapping = _b[_i];
|
|
22
|
+
_this.fontAwesomeMap.set(mapping[0], mapping[1]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
MaterialSymbolsFontFactory.prototype.mapStringToIcon = function (iconName, style) {
|
|
29
|
+
var _a;
|
|
30
|
+
var className = "material-symbols-outlined";
|
|
31
|
+
var isFilled = (_a = style === null || style === void 0 ? void 0 : style.solid) !== null && _a !== void 0 ? _a : this.filledByDefault;
|
|
32
|
+
// TODO: copy spin animation from font-awesome
|
|
33
|
+
if (style === null || style === void 0 ? void 0 : style.spin) {
|
|
34
|
+
className += " fa fa-spin";
|
|
35
|
+
}
|
|
36
|
+
// remove and extract convention styling
|
|
37
|
+
iconName = iconName.replace("fa-fw", "");
|
|
38
|
+
var faProps = Utils.getFontAwesomeIconProps(iconName);
|
|
39
|
+
iconName = faProps.name.trim();
|
|
40
|
+
if (faProps.isSolid !== undefined) {
|
|
41
|
+
isFilled = faProps.isSolid;
|
|
42
|
+
}
|
|
43
|
+
var mappedName = this.mapFontAwesomeToMaterial(iconName);
|
|
44
|
+
if (mappedName === undefined) {
|
|
45
|
+
// replace common differences.
|
|
46
|
+
mappedName = iconName.replace(/-/g, "_")
|
|
47
|
+
.replace("plus", "add")
|
|
48
|
+
.replace("square", "box");
|
|
49
|
+
}
|
|
50
|
+
if (mappedName === "") {
|
|
51
|
+
mappedName = '\u00A0';
|
|
52
|
+
}
|
|
53
|
+
var cssStyle;
|
|
54
|
+
if (isFilled || (style === null || style === void 0 ? void 0 : style.weight)) {
|
|
55
|
+
var styleText = "";
|
|
56
|
+
if (isFilled) {
|
|
57
|
+
styleText += "'FILL' 1";
|
|
58
|
+
}
|
|
59
|
+
if (style === null || style === void 0 ? void 0 : style.weight) {
|
|
60
|
+
styleText += " 'wght' " + style.weight;
|
|
61
|
+
}
|
|
62
|
+
cssStyle = { fontVariationSettings: styleText.trim() };
|
|
63
|
+
}
|
|
64
|
+
return React.createElement("span", { className: className, style: cssStyle }, mappedName);
|
|
65
|
+
};
|
|
66
|
+
MaterialSymbolsFontFactory.prototype.mapFontAwesomeToMaterial = function (faName) {
|
|
67
|
+
return this.fontAwesomeMap.get(faName.trim());
|
|
68
|
+
};
|
|
69
|
+
return MaterialSymbolsFontFactory;
|
|
70
|
+
}(IconFactory));
|
|
71
|
+
export { MaterialSymbolsFontFactory };
|
|
72
|
+
var neoFontAwesomeMappings = [
|
|
73
|
+
["plus", "add"],
|
|
74
|
+
["plus-square", "add_box"],
|
|
75
|
+
["minus", "remove"],
|
|
76
|
+
["minus-square", "indeterminate_check_box"],
|
|
77
|
+
["arrow-left", "arrow_back"],
|
|
78
|
+
["angle-left", "chevron_left"],
|
|
79
|
+
["caret-left", "arrow_left"],
|
|
80
|
+
["trash", "delete"],
|
|
81
|
+
["user", "person"],
|
|
82
|
+
["users", "groups"],
|
|
83
|
+
["user-shield", "admin_panel_settings"],
|
|
84
|
+
["user-plus", "person_add"],
|
|
85
|
+
["user-times", "person_remove"],
|
|
86
|
+
["user-lock", "manage_accounts"],
|
|
87
|
+
["unlock", "lock_open"],
|
|
88
|
+
["cogs", "settings"],
|
|
89
|
+
["file-excel", "text_snippet"],
|
|
90
|
+
["file-code", "code_blocks"],
|
|
91
|
+
["feather-alt", "filter_alt"],
|
|
92
|
+
["filter", "filter_alt"],
|
|
93
|
+
["eye", "visibility"],
|
|
94
|
+
["envelope", "mail"],
|
|
95
|
+
["address-book", "contact_mail"],
|
|
96
|
+
["at", "alternate_email"],
|
|
97
|
+
["bell", "notifications"],
|
|
98
|
+
["times", "close"],
|
|
99
|
+
["eraser", "ink_eraser"],
|
|
100
|
+
["align-left", "format_align_left"],
|
|
101
|
+
["align-center", "format_align_center"],
|
|
102
|
+
["align-right", "format_align_right"],
|
|
103
|
+
["equals", "equal"],
|
|
104
|
+
["not-equal", "block"],
|
|
105
|
+
["copy", "content_copy"],
|
|
106
|
+
["chart-bar", "bar_chart"],
|
|
107
|
+
["less-than", ""],
|
|
108
|
+
["less-than-equal", ""],
|
|
109
|
+
["greater-than", ""],
|
|
110
|
+
["greater-than-equal", ""],
|
|
111
|
+
["stamp", "approval"],
|
|
112
|
+
["circle-notch", "progress_activity"]
|
|
113
|
+
];
|
|
@@ -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';
|
|
@@ -56,12 +56,12 @@ var Input = /** @class */ (function (_super) {
|
|
|
56
56
|
};
|
|
57
57
|
Input.prototype.render = function () {
|
|
58
58
|
var _this = this;
|
|
59
|
-
var _a
|
|
59
|
+
var _a;
|
|
60
60
|
this.type = this.determineType();
|
|
61
61
|
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
62
62
|
var domProps = BindPropsHelper.autoSetDomProperties(splitProps, this.context);
|
|
63
|
-
var inputProps = (_a = splitProps.input
|
|
64
|
-
var showPasswordButton =
|
|
63
|
+
var inputProps = (_a = splitProps.input) !== null && _a !== void 0 ? _a : {};
|
|
64
|
+
var showPasswordButton = inputProps === null || inputProps === void 0 ? void 0 : inputProps.showPasswordButton;
|
|
65
65
|
var displayInfo = this.props.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
66
66
|
displayInfo.applyToDom(domProps, !splitProps.inGroup);
|
|
67
67
|
var bindValue = this.props.bind.value;
|
|
@@ -93,7 +93,7 @@ var Input = /** @class */ (function (_super) {
|
|
|
93
93
|
inputElement = React.createElement("textarea", __assign({}, domProps, { ref: this.domRef, rows: inputProps.rows }));
|
|
94
94
|
}
|
|
95
95
|
if (this.type === "checkbox") {
|
|
96
|
-
inputElement = React.createElement("div", { className: "custom-control custom-" + ((
|
|
96
|
+
inputElement = React.createElement("div", { className: "custom-control custom-" + ((inputProps === null || inputProps === void 0 ? void 0 : inputProps.type) === "switch" ? "switch" : "checkbox") },
|
|
97
97
|
inputElement,
|
|
98
98
|
React.createElement("label", { htmlFor: domProps.id, className: "custom-control-label" }, (inputProps.label ? inputProps.label : "")));
|
|
99
99
|
}
|
|
@@ -13,12 +13,12 @@ var InputHelpers = /** @class */ (function () {
|
|
|
13
13
|
(props.prependText || props.prepend) &&
|
|
14
14
|
React.createElement("div", { className: "input-group-prepend" },
|
|
15
15
|
props.prepend && (props.prepend instanceof Function ? props.prepend() : props.prepend),
|
|
16
|
-
props.prependText && React.createElement("span", { className: "input-group-text", onClick: function () { var _a
|
|
16
|
+
props.prependText && React.createElement("span", { className: "input-group-text", onClick: function () { var _a; return (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } }, this.iconFactory.textOrIcon(props.prependText))),
|
|
17
17
|
element,
|
|
18
18
|
(props.appendText || props.append) &&
|
|
19
19
|
React.createElement("div", { className: "input-group-append" },
|
|
20
20
|
props.append && (props.append instanceof Function ? props.append() : props.append),
|
|
21
|
-
props.appendText && React.createElement("span", { className: "input-group-text", onClick: function () { var _a
|
|
21
|
+
props.appendText && React.createElement("span", { className: "input-group-text", onClick: function () { var _a; return (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } }, this.iconFactory.textOrIcon(props.appendText)))));
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
return element;
|
|
@@ -20,7 +20,7 @@ var Link = /** @class */ (function (_super) {
|
|
|
20
20
|
Link.prototype.render = function () {
|
|
21
21
|
var _a;
|
|
22
22
|
var props = this.props;
|
|
23
|
-
var href = (_a = props.href
|
|
23
|
+
var href = (_a = props.href) !== null && _a !== void 0 ? _a : "/";
|
|
24
24
|
return React.createElement("a", __assign({}, props, { href: href, onClick: this.onClick }), this.props.children);
|
|
25
25
|
};
|
|
26
26
|
return Link;
|
|
@@ -35,7 +35,7 @@ var Modal = /** @class */ (function (_super) {
|
|
|
35
35
|
this.lastBindValue = propertyInstance.value;
|
|
36
36
|
}
|
|
37
37
|
if (typeof propertyInstance.value === "object") {
|
|
38
|
-
formProps =
|
|
38
|
+
formProps = formProps !== null && formProps !== void 0 ? formProps : {};
|
|
39
39
|
if (!formProps.model) {
|
|
40
40
|
formProps.model = propertyInstance.value;
|
|
41
41
|
}
|
|
@@ -14,7 +14,7 @@ var ModalContainer = /** @class */ (function (_super) {
|
|
|
14
14
|
}
|
|
15
15
|
ModalContainer.prototype.componentDidMount = function () {
|
|
16
16
|
var _a;
|
|
17
|
-
ModalHelper.initialise(this.props, (_a = this.containerRef.current
|
|
17
|
+
ModalHelper.initialise(this.props, (_a = this.containerRef.current) !== null && _a !== void 0 ? _a : undefined);
|
|
18
18
|
};
|
|
19
19
|
ModalContainer.prototype.componentDidUpdate = function () {
|
|
20
20
|
ModalHelper.appInstance.updateProps(this.props);
|
|
@@ -20,20 +20,19 @@ var FormatState = /** @class */ (function () {
|
|
|
20
20
|
this.useNative = useNative;
|
|
21
21
|
}
|
|
22
22
|
FormatState.create = function (propertyInfo, numericType, numProps, appendText) {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
24
23
|
var isPercent = false;
|
|
25
24
|
var hasExternalPercentSymbol = false;
|
|
26
25
|
var formatString = numProps ? numProps.formatString : "";
|
|
27
26
|
var displayDecimals = 2;
|
|
28
27
|
if ((formatString && formatString.indexOf("%") >= 0)
|
|
29
28
|
|| appendText === "%"
|
|
30
|
-
|| (
|
|
29
|
+
|| (numProps === null || numProps === void 0 ? void 0 : numProps.format) === Misc.NumberFormat.PercentDecimals || (numProps === null || numProps === void 0 ? void 0 : numProps.format) === Misc.NumberFormat.PercentNoDecimals) {
|
|
31
30
|
isPercent = true;
|
|
32
31
|
}
|
|
33
32
|
if (propertyInfo.allowedDecimals !== undefined) {
|
|
34
33
|
displayDecimals = propertyInfo.allowedDecimals - (isPercent ? 2 : 0);
|
|
35
34
|
}
|
|
36
|
-
else if (
|
|
35
|
+
else if (numProps === null || numProps === void 0 ? void 0 : numProps.formatString) {
|
|
37
36
|
displayDecimals = NumberUtils.getDecimalPlaces(numProps.formatString);
|
|
38
37
|
}
|
|
39
38
|
if (!formatString) {
|
|
@@ -42,16 +41,16 @@ var FormatState = /** @class */ (function () {
|
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
44
43
|
var hasDecimals = numericType === Misc.DataType.Float || numericType === Misc.DataType.Decimal;
|
|
45
|
-
var format = (
|
|
44
|
+
var format = (numProps === null || numProps === void 0 ? void 0 : numProps.currencySymbol) ?
|
|
46
45
|
(hasDecimals ? Misc.NumberFormat.CurrencyDecimals : Misc.NumberFormat.CurrencyNoDecimals) :
|
|
47
46
|
(hasDecimals ? Misc.NumberFormat.Decimals : Misc.NumberFormat.NoDecimals);
|
|
48
|
-
formatString = NumberUtils.getFormatString(format,
|
|
47
|
+
formatString = NumberUtils.getFormatString(format, numProps === null || numProps === void 0 ? void 0 : numProps.currencySymbol, displayDecimals);
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
if (formatString.indexOf("%") < 0 && appendText === "%") {
|
|
52
51
|
hasExternalPercentSymbol = true;
|
|
53
52
|
}
|
|
54
|
-
return new FormatState(isPercent, hasExternalPercentSymbol, formatString, displayDecimals + (isPercent ? 2 : 0),
|
|
53
|
+
return new FormatState(isPercent, hasExternalPercentSymbol, formatString, displayDecimals + (isPercent ? 2 : 0), numProps === null || numProps === void 0 ? void 0 : numProps.zeroText, numProps === null || numProps === void 0 ? void 0 : numProps.native);
|
|
55
54
|
};
|
|
56
55
|
FormatState.prototype.getFormattedValue = function (value) {
|
|
57
56
|
if (!value && this.zeroText !== undefined) {
|
|
@@ -254,7 +253,7 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
254
253
|
}
|
|
255
254
|
if (useNative && !domProps.step) {
|
|
256
255
|
var decimals = NumberUtils.getDecimalPlaces(this.formatState.formatString);
|
|
257
|
-
domProps.step = decimals === 0 ? "1" : "0."
|
|
256
|
+
domProps.step = decimals === 0 ? "1" : "0.".concat("0".repeat(decimals - 1), "1");
|
|
258
257
|
}
|
|
259
258
|
return (InputHelpers.surroundWithInputGroup(React.createElement("input", __assign({}, domProps, { defaultValue: this.formatState.getFormattedValue(editorProps.bind.value), type: useNative ? "number" : "text", onChange: this.onChanged, ref: this.inputElement })), editorProps, this.inputElement));
|
|
260
259
|
};
|
|
@@ -12,7 +12,7 @@ var PageSizeControl = /** @class */ (function (_super) {
|
|
|
12
12
|
PageSizeControl.prototype.render = function () {
|
|
13
13
|
var _a;
|
|
14
14
|
return (React.createElement("div", { className: "neo-pager-page-size" },
|
|
15
|
-
React.createElement("span", null, (_a = this.props.label
|
|
15
|
+
React.createElement("span", null, (_a = this.props.label) !== null && _a !== void 0 ? _a : "Show: ",
|
|
16
16
|
" "),
|
|
17
17
|
React.createElement(DropDown, { select: { items: this.props.pageManager.pageSizeOptions.map(function (i) { return ({ id: i, name: i.toString() }); }) }, bind: this.pageSize })));
|
|
18
18
|
};
|
|
@@ -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 declare type ItemCallback<T> = (item: T, meta: TransformMetaType<T
|
|
14
|
+
export declare 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,
|
|
@@ -136,9 +136,9 @@ export declare class BindPropsHelper {
|
|
|
136
136
|
static getBindProperty<T>(allProps: IEditorContainerProps<T, any>): Model.IPropertyInstance;
|
|
137
137
|
static splitCommonEditorProps<T extends ICommonEditorProps>(props: T): {
|
|
138
138
|
editor: ICommonEditorProps;
|
|
139
|
-
rest:
|
|
139
|
+
rest: Omit<T, "disabled" | "readOnly" | "isReadOnly" | "isDisabled" | "prependText" | "appendText" | "prepend" | "append" | "inputElement">;
|
|
140
140
|
};
|
|
141
|
-
static normaliseContainerProps<T, TContainerDom = React.HTMLProps<T
|
|
141
|
+
static normaliseContainerProps<T, TContainerDom = React.HTMLProps<T>, TData = any>(component: IComponentBase, props: IEditorContainerProps<T, TData>, inGroup: boolean, isBootstrap?: boolean): IEditorContainerNormalisedProps<TContainerDom, TData>;
|
|
142
142
|
static normaliseEditorProps<T, TDom = React.HTMLProps<T>>(component: IComponentBase, props: (IEditorAndSelectorProps<T, any> & TDom) | IEditorNormalisedProps<TDom, any>): IEditorNormalisedProps<TDom, any>;
|
|
143
143
|
static getPlaceholderText(placeholder: string | boolean | undefined, property: PropertyInfo): string | undefined;
|
|
144
144
|
static autoSetDomProperties<TDom extends React.HTMLProps<HTMLElement>>(props: IEditorNormalisedProps<TDom, any>, formContext: FormContextParams, componentBlurFn?: (e: React.FocusEvent<HTMLElement>) => void, componentFocusFn?: (e: React.FocusEvent<HTMLElement>) => void): TDom;
|
|
@@ -34,7 +34,7 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
34
34
|
}
|
|
35
35
|
return this._config;
|
|
36
36
|
},
|
|
37
|
-
enumerable:
|
|
37
|
+
enumerable: false,
|
|
38
38
|
configurable: true
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
@@ -105,7 +105,12 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
105
105
|
var isReadOnly = props.isReadOnly, readOnly = props.readOnly, isDisabled = props.isDisabled, disabled = props.disabled, prependText = props.prependText, prepend = props.prepend, appendText = props.appendText, append = props.append, inputElement = props.inputElement, rest = __rest(props, ["isReadOnly", "readOnly", "isDisabled", "disabled", "prependText", "prepend", "appendText", "append", "inputElement"]);
|
|
106
106
|
return {
|
|
107
107
|
editor: {
|
|
108
|
-
isReadOnly: (
|
|
108
|
+
isReadOnly: (isReadOnly !== null && isReadOnly !== void 0 ? isReadOnly : readOnly), isDisabled: (isDisabled !== null && isDisabled !== void 0 ? isDisabled : disabled),
|
|
109
|
+
prependText: prependText,
|
|
110
|
+
prepend: prepend,
|
|
111
|
+
appendText: appendText,
|
|
112
|
+
append: append,
|
|
113
|
+
inputElement: inputElement,
|
|
109
114
|
requiresGroup: prependText !== undefined || prepend !== undefined || appendText !== undefined || append !== undefined
|
|
110
115
|
},
|
|
111
116
|
rest: rest
|
|
@@ -113,18 +118,18 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
113
118
|
};
|
|
114
119
|
BindPropsHelper.normaliseContainerProps = function (component, props, inGroup, isBootstrap) {
|
|
115
120
|
// Split flattened props into components.
|
|
121
|
+
var _a, _b, _c;
|
|
116
122
|
if (isBootstrap === void 0) { isBootstrap = true; }
|
|
117
|
-
var _a, _b, _c, _d, _e;
|
|
118
123
|
var splitProps = this.splitCommonEditorProps(props);
|
|
119
|
-
var
|
|
124
|
+
var _d = splitProps.rest,
|
|
120
125
|
// Bindable editor props
|
|
121
|
-
bind =
|
|
126
|
+
bind = _d.bind, display = _d.display, placeholder = _d.placeholder,
|
|
122
127
|
// Editor selector props
|
|
123
|
-
select =
|
|
128
|
+
select = _d.select, input = _d.input, dateProps = _d.dateProps, numProps = _d.numProps, fileProps = _d.fileProps, radioList = _d.radioList,
|
|
124
129
|
// Common container props
|
|
125
|
-
label =
|
|
130
|
+
label = _d.label, editorProps = _d.editorProps, editorTooltip = _d.editorTooltip, editorClassName = _d.editorClassName, editorStyle = _d.editorStyle, suppressDefaultContent = _d.suppressDefaultContent, bindContext = _d.bindContext,
|
|
126
131
|
// Container dom
|
|
127
|
-
containerDom = __rest(
|
|
132
|
+
containerDom = __rest(_d, ["bind", "display", "placeholder", "select", "input", "dateProps", "numProps", "fileProps", "radioList", "label", "editorProps", "editorTooltip", "editorClassName", "editorStyle", "suppressDefaultContent", "bindContext"]);
|
|
128
133
|
var bindOrDisplay = BindPropsHelper.getBindProperty(props);
|
|
129
134
|
if (!bindOrDisplay) {
|
|
130
135
|
var child = containerDom.children;
|
|
@@ -162,7 +167,7 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
162
167
|
}
|
|
163
168
|
return {
|
|
164
169
|
bind: bindOrDisplay,
|
|
165
|
-
editor: __assign({ bind: bindOrDisplay, placeholder: this.getPlaceholderText(placeholder,
|
|
170
|
+
editor: __assign({ bind: bindOrDisplay, placeholder: this.getPlaceholderText(placeholder, bindOrDisplay === null || bindOrDisplay === void 0 ? void 0 : bindOrDisplay.propertyInfo) }, splitProps.editor),
|
|
166
171
|
editorDom: editorProps,
|
|
167
172
|
container: { label: label, editorTooltip: editorTooltip, editorClassName: editorClassName, editorStyle: editorStyle, bindContext: bindContext, suppressDefaultContent: suppressDefaultContent },
|
|
168
173
|
select: select,
|
|
@@ -172,7 +177,7 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
172
177
|
fileProps: fileProps,
|
|
173
178
|
radioList: radioList,
|
|
174
179
|
inGroup: inGroup,
|
|
175
|
-
uniqueID: (
|
|
180
|
+
uniqueID: (bindOrDisplay === null || bindOrDisplay === void 0 ? void 0 : bindOrDisplay.uniqueID) + "!" + component.uniqueId,
|
|
176
181
|
containerDom: containerDom,
|
|
177
182
|
isBootstrap: isBootstrap
|
|
178
183
|
};
|
|
@@ -199,7 +204,7 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
199
204
|
var _a;
|
|
200
205
|
var domProps = __assign({}, props.editorDom);
|
|
201
206
|
if (props.uniqueID) {
|
|
202
|
-
domProps.id = (_a = formContext.uniqueId
|
|
207
|
+
domProps.id = (_a = formContext.uniqueId) !== null && _a !== void 0 ? _a : props.uniqueID;
|
|
203
208
|
}
|
|
204
209
|
if (this.config.isTestOrDevelopment) {
|
|
205
210
|
domProps[BindPropsHelper.DataFieldName] = props.bind.propertyInfo.propertyName;
|
|
@@ -228,12 +233,12 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
228
233
|
};
|
|
229
234
|
BindPropsHelper.isReadOnly = function (editorProps, formContext) {
|
|
230
235
|
var _a;
|
|
231
|
-
var propsReadOnly = (_a = editorProps.isReadOnly
|
|
236
|
+
var propsReadOnly = (_a = editorProps.isReadOnly) !== null && _a !== void 0 ? _a : editorProps.readOnly;
|
|
232
237
|
return propsReadOnly || (formContext.allReadOnly && propsReadOnly === undefined);
|
|
233
238
|
};
|
|
234
239
|
BindPropsHelper.isDisabled = function (editorProps, formContext) {
|
|
235
240
|
var _a;
|
|
236
|
-
var propsDisabled = (_a = editorProps.isDisabled
|
|
241
|
+
var propsDisabled = (_a = editorProps.isDisabled) !== null && _a !== void 0 ? _a : editorProps.disabled;
|
|
237
242
|
return propsDisabled || (formContext.allDisabled && propsDisabled === undefined);
|
|
238
243
|
};
|
|
239
244
|
/**
|
|
@@ -26,7 +26,7 @@ var RadioList = /** @class */ (function (_super) {
|
|
|
26
26
|
RadioList.prototype.createEnumList = function (list) {
|
|
27
27
|
var _a, _b;
|
|
28
28
|
if (list.length) {
|
|
29
|
-
var _c = LookupHelper.findMembers(list[0], (_a = this.props.radioList.valueMember
|
|
29
|
+
var _c = LookupHelper.findMembers(list[0], (_a = this.props.radioList.valueMember) !== null && _a !== void 0 ? _a : "", (_b = this.props.radioList.displayMember) !== null && _b !== void 0 ? _b : "", true), valueMember_1 = _c.valueMember, displayMember_1 = _c.displayMember;
|
|
30
30
|
if (valueMember_1 && displayMember_1) {
|
|
31
31
|
this.items = list.map(function (item) { return ({ id: item[valueMember_1], name: item[displayMember_1] }); });
|
|
32
32
|
}
|
|
@@ -46,8 +46,8 @@ var RadioList = /** @class */ (function (_super) {
|
|
|
46
46
|
return React.createElement("div", { className: className }, this.items.map(function (item) {
|
|
47
47
|
var _a, _b;
|
|
48
48
|
return React.createElement("div", { className: "custom-control custom-radio " + (_this.props.radioList.inline ? "custom-control-inline" : "custom-control"), key: item.id },
|
|
49
|
-
React.createElement("input", { type: "radio", id: splitProps.uniqueID + (_a = item.id
|
|
50
|
-
React.createElement("label", { className: "custom-control-label", htmlFor: splitProps.uniqueID + (_b = item.id
|
|
49
|
+
React.createElement("input", { type: "radio", id: splitProps.uniqueID + ((_a = item.id) !== null && _a !== void 0 ? _a : ""), name: splitProps.uniqueID, checked: bindValue === item.id, disabled: domProps.disabled || domProps.readOnly, onChange: function () { return _this.props.bind.value = item.id; }, className: "custom-control-input" }),
|
|
50
|
+
React.createElement("label", { className: "custom-control-label", htmlFor: splitProps.uniqueID + ((_b = item.id) !== null && _b !== void 0 ? _b : "") }, item.name));
|
|
51
51
|
}));
|
|
52
52
|
};
|
|
53
53
|
RadioList.contextType = FormContext;
|
|
@@ -34,21 +34,21 @@ var Slider = /** @class */ (function (_super) {
|
|
|
34
34
|
get: function () {
|
|
35
35
|
return this.props.bindEnd !== undefined;
|
|
36
36
|
},
|
|
37
|
-
enumerable:
|
|
37
|
+
enumerable: false,
|
|
38
38
|
configurable: true
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(Slider.prototype, "rangeProps", {
|
|
41
41
|
get: function () {
|
|
42
42
|
return this.props;
|
|
43
43
|
},
|
|
44
|
-
enumerable:
|
|
44
|
+
enumerable: false,
|
|
45
45
|
configurable: true
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(Slider.prototype, "sliderProps", {
|
|
48
48
|
get: function () {
|
|
49
49
|
return this.props;
|
|
50
50
|
},
|
|
51
|
-
enumerable:
|
|
51
|
+
enumerable: false,
|
|
52
52
|
configurable: true
|
|
53
53
|
});
|
|
54
54
|
Slider.prototype.getSlider = function () {
|
|
@@ -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
|
/**
|
|
@@ -12,7 +12,7 @@ var Tab = /** @class */ (function (_super) {
|
|
|
12
12
|
_this.hasRenderedContents = false;
|
|
13
13
|
_this.iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
|
|
14
14
|
_this.onClick = _this.onClick.bind(_this);
|
|
15
|
-
var tabKey = (_a = _this.props.id
|
|
15
|
+
var tabKey = (_a = _this.props.id) !== null && _a !== void 0 ? _a : _this.props.name;
|
|
16
16
|
if (!tabKey) {
|
|
17
17
|
if (typeof _this.props.header === "string") {
|
|
18
18
|
tabKey = _this.props.header;
|