@singularsystems/neo-react 0.10.64 → 0.10.65
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 +5 -5
- 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.js +3 -3
- 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.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.js +9 -9
- package/dist/ReactComponents/Grid/Row.js +2 -2
- 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 +2 -2
- 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.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
package/dist/React/AutoRunner.js
CHANGED
|
@@ -19,8 +19,8 @@ var AutoRunner = /** @class */ (function () {
|
|
|
19
19
|
var _this = this;
|
|
20
20
|
this.isPaused = false;
|
|
21
21
|
this.propertyMap = {};
|
|
22
|
-
this.options =
|
|
23
|
-
this.disposerDelayed = reaction(function () { return _this.accessAllValues(model, true, new Map(), ""); }, function () { var _a; return _this.runCallback(model, callback, (_a = _this.options.delayMs
|
|
22
|
+
this.options = options !== null && options !== void 0 ? options : {};
|
|
23
|
+
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); });
|
|
24
24
|
this.disposerImmediate = reaction(function () { return _this.accessAllValues(model, false, new Map(), ""); }, function () { return _this.runCallback(model, callback, 0); });
|
|
25
25
|
}
|
|
26
26
|
AutoRunner.prototype.cancelPending = function () {
|
|
@@ -67,8 +67,8 @@ var AutoRunner = /** @class */ (function () {
|
|
|
67
67
|
var useDelay = this.propertyMap[key];
|
|
68
68
|
if (useDelay === undefined) {
|
|
69
69
|
// This needs to be calculated once, otherwise null -> string value changes cause properties to no longer be tracked.
|
|
70
|
-
useDelay = (_a = propertyInfo.debounce
|
|
71
|
-
(typeof instance.meta[propertyInfo.propertyName].peek === "string"))
|
|
70
|
+
useDelay = (_a = propertyInfo.debounce) !== null && _a !== void 0 ? _a : ([Misc.DataType.Int, Misc.DataType.Float].indexOf(propertyInfo.propertyType) >= 0 ||
|
|
71
|
+
(typeof instance.meta[propertyInfo.propertyName].peek === "string"));
|
|
72
72
|
this.propertyMap[key] = useDelay;
|
|
73
73
|
}
|
|
74
74
|
if (useDelay === delayed) {
|
|
@@ -83,7 +83,7 @@ var AutoRunner = /** @class */ (function () {
|
|
|
83
83
|
var index = 0;
|
|
84
84
|
for (var _c = 0, _d = instance[propertyInfo.propertyName]; _c < _d.length; _c++) {
|
|
85
85
|
var child = _d[_c];
|
|
86
|
-
this.accessAllValues(child, delayed, trackedInstances, ""
|
|
86
|
+
this.accessAllValues(child, delayed, trackedInstances, "".concat(path).concat(propertyInfo.propertyName, "[").concat(index++, "]."));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate, __extends, __metadata, __rest,
|
|
1
|
+
import { __decorate, __extends, __metadata, __rest, __spreadArray } from "tslib";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import ComponentBase from './ComponentBase';
|
|
4
4
|
import { Components, Misc, Utils } from '@singularsystems/neo-core';
|
|
@@ -50,10 +50,10 @@ var Button = /** @class */ (function (_super) {
|
|
|
50
50
|
};
|
|
51
51
|
Button.prototype.render = function () {
|
|
52
52
|
var _this = this;
|
|
53
|
-
var _a
|
|
54
|
-
var
|
|
53
|
+
var _a;
|
|
54
|
+
var _b = this.props, isSubmit = _b.isSubmit, variant = _b.variant, size = _b.size, isOutline = _b.isOutline, 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", "icon", "iconAlignment", "text", "menuItems", "splitMenu", "menuAlignment", "buttonGroupClassName", "tooltip", "task", "isBusy", "pulse", "customVariant"]);
|
|
55
55
|
native.type = isSubmit ? "submit" : "button";
|
|
56
|
-
var variantClassName = (_a =
|
|
56
|
+
var variantClassName = ((_a = customVariant !== null && customVariant !== void 0 ? customVariant : variant) !== null && _a !== void 0 ? _a : "primary");
|
|
57
57
|
var isDropDown = menuItems && menuItems.length;
|
|
58
58
|
var buttonClasses = "btn btn-" + (isOutline ? "outline-" : "") + variantClassName;
|
|
59
59
|
if (size)
|
|
@@ -66,14 +66,14 @@ var Button = /** @class */ (function (_super) {
|
|
|
66
66
|
if (isBusy !== undefined || task !== undefined) {
|
|
67
67
|
iconStyle = { fixedWidth: true };
|
|
68
68
|
}
|
|
69
|
-
if (isBusy || (
|
|
69
|
+
if (isBusy || (task === null || task === void 0 ? void 0 : task.isBusy)) {
|
|
70
70
|
iconStyle.fixedWidth = true;
|
|
71
71
|
iconStyle.spin = true;
|
|
72
72
|
icon = Misc.Settings.icons.loadingIcon;
|
|
73
73
|
native.disabled = true;
|
|
74
74
|
}
|
|
75
75
|
if (pulse) {
|
|
76
|
-
buttonClasses += " "
|
|
76
|
+
buttonClasses += " ".concat(variantClassName, "-color-pulse");
|
|
77
77
|
}
|
|
78
78
|
native.className = (native.className || "") + " " + buttonClasses;
|
|
79
79
|
// Button text
|
|
@@ -98,7 +98,7 @@ var Button = /** @class */ (function (_super) {
|
|
|
98
98
|
}
|
|
99
99
|
if (icon && iconAlignment === "right")
|
|
100
100
|
buttonChildren.push(iconSpace, iconElement);
|
|
101
|
-
var mainButton = React.createElement.apply(React,
|
|
101
|
+
var mainButton = React.createElement.apply(React, __spreadArray(["button", native], buttonChildren, false));
|
|
102
102
|
var buttonGroupClasses = "btn-group";
|
|
103
103
|
// add custom css classes to the button group if applicable
|
|
104
104
|
if (buttonGroupClassName) {
|
|
@@ -17,9 +17,9 @@ var Card = /** @class */ (function (_super) {
|
|
|
17
17
|
var _a = this.props, icon = _a.icon, title = _a.title, children = _a.children, headerElements = _a.headerElements, useCustomScrollbar = _a.useCustomScrollbar, collapsible = _a.collapsible, initiallyCollapsed = _a.initiallyCollapsed, isExpanded = _a.isExpanded, domProps = __rest(_a, ["icon", "title", "children", "headerElements", "useCustomScrollbar", "collapsible", "initiallyCollapsed", "isExpanded"]);
|
|
18
18
|
var className = Utils.joinWithSpaces("neo-card card", domProps.className);
|
|
19
19
|
var isCollapsible = collapsible || isExpanded !== undefined || initiallyCollapsed !== undefined;
|
|
20
|
-
var expandState =
|
|
20
|
+
var expandState = isExpanded !== null && isExpanded !== void 0 ? isExpanded : this.expandState;
|
|
21
21
|
if (isCollapsible) {
|
|
22
|
-
var expandIndicator = React.createElement("i", { onClick: function (e) { return expandState.value = !expandState.value; }, className: "card-expand-indicator fa fa-fw fa-angle-"
|
|
22
|
+
var expandIndicator = React.createElement("i", { onClick: function (e) { return expandState.value = !expandState.value; }, className: "card-expand-indicator fa fa-fw fa-angle-".concat(expandState.value ? "up" : "down") });
|
|
23
23
|
if (headerElements) {
|
|
24
24
|
headerElements = React.createElement(React.Fragment, null,
|
|
25
25
|
headerElements,
|
|
@@ -17,7 +17,7 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
17
17
|
_this.selectImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.ReactSelect);
|
|
18
18
|
_this.onKeyPress = _this.onKeyPress.bind(_this);
|
|
19
19
|
_this.onItemSelected = _this.onItemSelected.bind(_this);
|
|
20
|
-
_this.bindProperty = (_a = _this.props.bind
|
|
20
|
+
_this.bindProperty = (_a = _this.props.bind) !== null && _a !== void 0 ? _a : _this.props.bindItems;
|
|
21
21
|
_this.fieldInfoContainer = Model.ModelFieldInfo.asModelFieldInfoContainer(_this.bindProperty.attachedTo);
|
|
22
22
|
if (_this.props.bindIds) {
|
|
23
23
|
if (_this.props.bindIds.propertyInfo) {
|
|
@@ -36,12 +36,12 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
36
36
|
}
|
|
37
37
|
AutoCompleteDropDown.getBindProp = function (props) {
|
|
38
38
|
var _a;
|
|
39
|
-
return _a = props.bind
|
|
39
|
+
return (_a = props.bind) !== null && _a !== void 0 ? _a : props.bindItems;
|
|
40
40
|
};
|
|
41
41
|
AutoCompleteDropDown.prototype.onKeyPress = function (searchValue, dataReceived) {
|
|
42
42
|
var _this = this;
|
|
43
43
|
var _a, _b;
|
|
44
|
-
if (searchValue && searchValue.length >= (_a = this.props.minCharacters
|
|
44
|
+
if (searchValue && searchValue.length >= ((_a = this.props.minCharacters) !== null && _a !== void 0 ? _a : 1)) {
|
|
45
45
|
Utils.debounce(this, function () {
|
|
46
46
|
_this.props.itemSource(searchValue).then(function (list) {
|
|
47
47
|
var items;
|
|
@@ -53,7 +53,7 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
53
53
|
}
|
|
54
54
|
dataReceived(_this.mapTArrayToOptions(items));
|
|
55
55
|
});
|
|
56
|
-
}, (_b = this.props.delayMs
|
|
56
|
+
}, (_b = this.props.delayMs) !== null && _b !== void 0 ? _b : 500);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
dataReceived([]);
|
|
@@ -119,18 +119,18 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
119
119
|
};
|
|
120
120
|
AutoCompleteDropDown.prototype.render = function () {
|
|
121
121
|
var _this = this;
|
|
122
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
123
|
-
var
|
|
122
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
123
|
+
var _j = this.props, bind = _j.bind, bindDisplay = _j.bindDisplay, bindItems = _j.bindItems, bindIds = _j.bindIds, itemSource = _j.itemSource, items = _j.items, displayMember = _j.displayMember, valueMember = _j.valueMember, descriptionMember = _j.descriptionMember, option = _j.option, noRecordsPrompt = _j.noRecordsPrompt, typeToSearchPrompt = _j.typeToSearchPrompt, delayMs = _j.delayMs, minCharacters = _j.minCharacters, onItemSelected = _j.onItemSelected, fieldInfoLimit = _j.fieldInfoLimit, otherProps = __rest(_j, ["bind", "bindDisplay", "bindItems", "bindIds", "itemSource", "items", "displayMember", "valueMember", "descriptionMember", "option", "noRecordsPrompt", "typeToSearchPrompt", "delayMs", "minCharacters", "onItemSelected", "fieldInfoLimit"]);
|
|
124
124
|
var splitProps = BindPropsHelper.splitCommonEditorProps(otherProps);
|
|
125
125
|
var nativeProps = splitProps.rest;
|
|
126
126
|
var bindItemsProperty = bindItems;
|
|
127
|
-
var itemList =
|
|
127
|
+
var itemList = bindItemsProperty === null || bindItemsProperty === void 0 ? void 0 : bindItemsProperty.value;
|
|
128
128
|
var bindValue = bind;
|
|
129
129
|
var bindDisplayProperty = bindDisplay;
|
|
130
130
|
var displayInfo = this.bindProperty.validator.getDisplayState(this.context.validationDisplayMode);
|
|
131
131
|
displayInfo.applyToDom(nativeProps, this.context.parentType !== EditorParentType.FormGroup);
|
|
132
|
-
this.displayMember = (
|
|
133
|
-
this.valueMember = (
|
|
132
|
+
this.displayMember = (_a = this.props.displayMember) !== null && _a !== void 0 ? _a : "";
|
|
133
|
+
this.valueMember = (_b = this.props.valueMember) !== null && _b !== void 0 ? _b : "";
|
|
134
134
|
var defaultItems = undefined;
|
|
135
135
|
if (this.props.items) {
|
|
136
136
|
var items_1 = this.getItems(this.props.items);
|
|
@@ -149,8 +149,8 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
149
149
|
value = itemList.map(function (c) { return ({ value: c.id, label: c.display }); });
|
|
150
150
|
if (this.fieldInfoContainer && this.bindIdsProperty) {
|
|
151
151
|
var itemListString = "";
|
|
152
|
-
if (value.length > (
|
|
153
|
-
itemListString = value.length
|
|
152
|
+
if (value.length > (fieldInfoLimit !== null && fieldInfoLimit !== void 0 ? fieldInfoLimit : 5)) {
|
|
153
|
+
itemListString = "".concat(value.length, " items selected");
|
|
154
154
|
}
|
|
155
155
|
else if (value.length > 0) {
|
|
156
156
|
itemListString = value.map(function (c) { return c.label; }).join(", ");
|
|
@@ -160,10 +160,10 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
162
|
if (bindValue.value !== null) {
|
|
163
|
-
var displayValue =
|
|
163
|
+
var displayValue = bindDisplayProperty === null || bindDisplayProperty === void 0 ? void 0 : bindDisplayProperty.value;
|
|
164
164
|
if (!bindDisplayProperty) {
|
|
165
165
|
if (defaultItems) {
|
|
166
|
-
displayValue = (
|
|
166
|
+
displayValue = (_d = (_c = defaultItems.find(function (c) { return c.value === bindValue.value; })) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : "";
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
169
169
|
throw "bindDisplay is required when the items prop is not set.";
|
|
@@ -171,9 +171,9 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
171
171
|
}
|
|
172
172
|
value = { value: bindValue.value, label: displayValue };
|
|
173
173
|
}
|
|
174
|
-
this.setFieldInfo(bindValue, (
|
|
174
|
+
this.setFieldInfo(bindValue, (_e = value === null || value === void 0 ? void 0 : value.label) !== null && _e !== void 0 ? _e : "");
|
|
175
175
|
}
|
|
176
|
-
var components = (
|
|
176
|
+
var components = (_f = nativeProps.components) !== null && _f !== void 0 ? _f : {};
|
|
177
177
|
if (this.props.option) {
|
|
178
178
|
components.Option = this.getOption(this.props.option);
|
|
179
179
|
}
|
|
@@ -203,10 +203,10 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
if (this.props.itemSource !== undefined) {
|
|
206
|
-
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (
|
|
206
|
+
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (_g = this.props.placeholder) !== null && _g !== void 0 ? _g : "", 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), nativeProps);
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
|
-
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (
|
|
209
|
+
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_h = this.props.placeholder) !== null && _h !== void 0 ? _h : "", 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), nativeProps);
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
212
|
AutoCompleteDropDown.prototype.getOption = function (content, additionalClass) {
|
|
@@ -19,7 +19,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
19
19
|
get: function () {
|
|
20
20
|
var _this = this;
|
|
21
21
|
var _a;
|
|
22
|
-
var items = this.getItems((_a = this.props.select.items
|
|
22
|
+
var items = this.getItems((_a = this.props.select.items) !== null && _a !== void 0 ? _a : this.props.select.itemSource);
|
|
23
23
|
if (items && items.length > 0) {
|
|
24
24
|
var item = items[0];
|
|
25
25
|
this.findMembers(item);
|
|
@@ -31,7 +31,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
31
31
|
return items;
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
enumerable:
|
|
34
|
+
enumerable: false,
|
|
35
35
|
configurable: true
|
|
36
36
|
});
|
|
37
37
|
DropDown.prototype.createLookupIndex = function (list) {
|
|
@@ -96,7 +96,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
96
96
|
var items = this.items;
|
|
97
97
|
var selectedItem = this.getSelectedOption(this.props.bind.value); // This sets the sort value to allow sorting of drop downs in grids.
|
|
98
98
|
var value = this.props.bind.value;
|
|
99
|
-
var addBlankItem = (_b = (_a = splitProps.select) === null || _a === void 0 ? void 0 : _a.allowNulls
|
|
99
|
+
var addBlankItem = ((_b = (_a = splitProps.select) === null || _a === void 0 ? void 0 : _a.allowNulls) !== null && _b !== void 0 ? _b : this.props.bind.propertyInfo.allowNulls) || !value;
|
|
100
100
|
if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null || item[_this.valueMember] === ""; })) {
|
|
101
101
|
// If there is an item with a null value, don't add a blank drop down item.
|
|
102
102
|
addBlankItem = false;
|
|
@@ -56,7 +56,7 @@ var ErrorHandler = /** @class */ (function (_super) {
|
|
|
56
56
|
};
|
|
57
57
|
ModalUtils.showModal(errorDisplay.header, React.createElement(Observer, null, function () {
|
|
58
58
|
var _a;
|
|
59
|
-
return (_a = _this.hidingErrorList
|
|
59
|
+
return ((_a = _this.hidingErrorList) !== null && _a !== void 0 ? _a : _this.errorList).map(function (errorGroup, index) { return (React.createElement("div", { key: index, className: "neo-error-modal-body" },
|
|
60
60
|
React.createElement("div", { className: "neo-error-modal-body-icon" }, errorGroup.count === 1 ?
|
|
61
61
|
React.createElement("i", { className: _this.getIcon(errorGroup.errorDisplay) }) :
|
|
62
62
|
React.createElement("span", { className: "badge badge-danger" }, errorGroup.count)),
|
|
@@ -29,7 +29,7 @@ var FileBasicInput = /** @class */ (function (_super) {
|
|
|
29
29
|
_c.sent();
|
|
30
30
|
return [3 /*break*/, 4];
|
|
31
31
|
case 3:
|
|
32
|
-
input = (_a = e.target
|
|
32
|
+
input = (_a = e.target) !== null && _a !== void 0 ? _a : (_b = this.props.inputRef) === null || _b === void 0 ? void 0 : _b.current;
|
|
33
33
|
if (input) {
|
|
34
34
|
input.value = "";
|
|
35
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __assign, __awaiter, __decorate, __extends, __generator, __metadata,
|
|
1
|
+
import { __assign, __awaiter, __decorate, __extends, __generator, __metadata, __spreadArray } from "tslib";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Components, Utils, Misc, Validation } from '@singularsystems/neo-core';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
@@ -136,7 +136,7 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
136
136
|
var append = null;
|
|
137
137
|
if (editorProps.isReadOnly !== true) {
|
|
138
138
|
var buttonOptions = Utils.populatePartialWithDefaults(Utils.populatePartialWithDefaults(__assign({}, props.browseButton), Misc.Settings.fileManager.fileEditorButton), { text: "Options", variant: "dark" });
|
|
139
|
-
buttonOptions.menuItems = buttonOptions.menuItems ?
|
|
139
|
+
buttonOptions.menuItems = buttonOptions.menuItems ? __spreadArray([], buttonOptions.menuItems, true) : [];
|
|
140
140
|
buttonOptions.menuItems.splice(0, 0, { text: props.changeFileText || "Change file", onClick: function () { return _this.fileManager.showFileDialog(); } }, { text: "Unlink file", onClick: function () { return _this.fileManager.clearFile(); } });
|
|
141
141
|
append = React.createElement("div", { className: "input-group-append" },
|
|
142
142
|
React.createElement(Button, __assign({}, buttonOptions)));
|
|
@@ -80,7 +80,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
return (React.createElement("form", __assign({}, native, { onSubmit: function (e) { return _this.onSubmit(e, formModel); } }),
|
|
83
|
-
React.createElement(FormContextProvider, { validationDisplayMode:
|
|
83
|
+
React.createElement(FormContextProvider, { validationDisplayMode: validationDisplayMode !== null && validationDisplayMode !== void 0 ? validationDisplayMode : Misc.Settings.form.validationDisplayMode, allReadOnly: allReadOnly, allDisabled: allDisabled }, (this.props.children instanceof Function) ? this.props.children(model, model.meta) : this.props.children)));
|
|
84
84
|
};
|
|
85
85
|
Form = __decorate([
|
|
86
86
|
observer
|
|
@@ -42,7 +42,7 @@ var FormGroupBase = /** @class */ (function (_super) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
var label;
|
|
45
|
-
if (!(_a = this.context.suppressLabels
|
|
45
|
+
if (!((_a = this.context.suppressLabels) !== null && _a !== void 0 ? _a : suppressLabel)) {
|
|
46
46
|
label = React.createElement("label", __assign({}, labelProps, { htmlFor: allProps.uniqueID, className: labelClassName }),
|
|
47
47
|
labelText,
|
|
48
48
|
" ");
|
|
@@ -23,7 +23,7 @@ var ButtonColumn = /** @class */ (function (_super) {
|
|
|
23
23
|
return __generator(this, function (_c) {
|
|
24
24
|
switch (_c.label) {
|
|
25
25
|
case 0:
|
|
26
|
-
item = (_a = this.props.item
|
|
26
|
+
item = (_a = this.props.item) !== null && _a !== void 0 ? _a : this.item;
|
|
27
27
|
if (!(item.isNew === false && ((_b = this.props.deleteButton) === null || _b === void 0 ? void 0 : _b.onDeleteExisting) !== undefined)) return [3 /*break*/, 2];
|
|
28
28
|
return [4 /*yield*/, this.props.deleteButton.onDeleteExisting(item)];
|
|
29
29
|
case 1:
|
|
@@ -88,15 +88,14 @@ var Column = /** @class */ (function (_super) {
|
|
|
88
88
|
this.stateObserver.dispose();
|
|
89
89
|
};
|
|
90
90
|
Column.prototype.render = function () {
|
|
91
|
-
var _a;
|
|
92
91
|
this.onRender();
|
|
93
92
|
var allProps = BindPropsHelper.normaliseContainerProps(this, this.props, false);
|
|
94
|
-
var
|
|
93
|
+
var _a = allProps.containerDom, width = _a.width, hideBelow = _a.hideBelow, hideAbove = _a.hideAbove, headerTooltip = _a.headerTooltip, cellTooltip = _a.cellTooltip, alignment = _a.alignment, sort = _a.sort, sum = _a.sum, footerContent = _a.footerContent, headerClassName = _a.headerClassName, cellClassName = _a.cellClassName, onHeaderClick = _a.onHeaderClick, domProps = __rest(_a, ["width", "hideBelow", "hideAbove", "headerTooltip", "cellTooltip", "alignment", "sort", "sum", "footerContent", "headerClassName", "cellClassName", "onHeaderClick"]);
|
|
95
94
|
if (allProps.bind !== undefined) {
|
|
96
95
|
if (!this.controlType || this.isHeader) {
|
|
97
96
|
this.controlType = BindPropsHelper.getControlType(allProps);
|
|
98
97
|
var items = this.context.dataView.rawItems;
|
|
99
|
-
this.checkboxType = BindPropsHelper.getCheckBoxType(allProps, this.isHeader && (
|
|
98
|
+
this.checkboxType = BindPropsHelper.getCheckBoxType(allProps, this.isHeader && (items === null || items === void 0 ? void 0 : items.length) && items[0]);
|
|
100
99
|
if (this.isHeader) {
|
|
101
100
|
// Prevent sorting if the bind property is not on the root object. E.g. item.child.meta.property
|
|
102
101
|
this.suppressSort = items.length === 0 || items[0].meta[allProps.bind.propertyInfo.propertyName] === undefined;
|
|
@@ -8,5 +8,5 @@ export interface INeoCommonColumnProps {
|
|
|
8
8
|
alignment?: "left" | "center" | "right";
|
|
9
9
|
}
|
|
10
10
|
export declare class ColumnHelper {
|
|
11
|
-
static addCommonClasses(className: string, props: INeoCommonColumnProps): string;
|
|
11
|
+
static addCommonClasses(className: string | undefined, props: INeoCommonColumnProps): string | undefined;
|
|
12
12
|
}
|
|
@@ -4,13 +4,13 @@ var ColumnHelper = /** @class */ (function () {
|
|
|
4
4
|
}
|
|
5
5
|
ColumnHelper.addCommonClasses = function (className, props) {
|
|
6
6
|
if (props.hideBelow) {
|
|
7
|
-
className = Utils.joinWithSpaces(className, "d-none d-"
|
|
7
|
+
className = Utils.joinWithSpaces(className, "d-none d-".concat(props.hideBelow, "-table-cell"));
|
|
8
8
|
}
|
|
9
9
|
if (props.hideAbove) {
|
|
10
|
-
className = Utils.joinWithSpaces(className, "d-table-cell d-"
|
|
10
|
+
className = Utils.joinWithSpaces(className, "d-table-cell d-".concat(props.hideAbove, "-none"));
|
|
11
11
|
}
|
|
12
12
|
if (props.alignment) {
|
|
13
|
-
className = Utils.joinWithSpaces(className, "col-align-"
|
|
13
|
+
className = Utils.joinWithSpaces(className, "col-align-".concat(props.alignment));
|
|
14
14
|
}
|
|
15
15
|
return className;
|
|
16
16
|
};
|
|
@@ -16,7 +16,7 @@ var GridContextParams = /** @class */ (function () {
|
|
|
16
16
|
get: function () {
|
|
17
17
|
return this.section === "body";
|
|
18
18
|
},
|
|
19
|
-
enumerable:
|
|
19
|
+
enumerable: false,
|
|
20
20
|
configurable: true
|
|
21
21
|
});
|
|
22
22
|
return GridContextParams;
|
|
@@ -34,7 +34,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
34
34
|
}
|
|
35
35
|
Grid.prototype.componentDidMount = function () {
|
|
36
36
|
var _a, _b;
|
|
37
|
-
if (this.domRef.current && (_a = this.props.stickyHeader
|
|
37
|
+
if (this.domRef.current && ((_a = this.props.stickyHeader) !== null && _a !== void 0 ? _a : Misc.Settings.grid.useStickyHeaders)) {
|
|
38
38
|
this.stickyHeaderHelper = new StickyTableHeader(this.domRef.current, (_b = Misc.Settings.fixedAppHeaderElement) === null || _b === void 0 ? void 0 : _b.call(undefined));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -57,23 +57,23 @@ var Grid = /** @class */ (function (_super) {
|
|
|
57
57
|
}
|
|
58
58
|
var className = Utils.joinWithSpaces(domProps.className, "table neo-grid");
|
|
59
59
|
// apply bordered styling
|
|
60
|
-
if (
|
|
60
|
+
if (isBordered !== null && isBordered !== void 0 ? isBordered : Misc.Settings.grid.isBordered) {
|
|
61
61
|
className += " table-bordered";
|
|
62
62
|
}
|
|
63
63
|
// apply striped styling
|
|
64
|
-
if (
|
|
64
|
+
if (isStriped !== null && isStriped !== void 0 ? isStriped : Misc.Settings.grid.isStriped) {
|
|
65
65
|
className += " table-striped";
|
|
66
66
|
}
|
|
67
67
|
// apply borderless styling
|
|
68
|
-
if (
|
|
68
|
+
if (isBorderless !== null && isBorderless !== void 0 ? isBorderless : Misc.Settings.grid.isBorderless) {
|
|
69
69
|
className += " table-borderless";
|
|
70
70
|
}
|
|
71
71
|
// apply hover styling
|
|
72
|
-
if (
|
|
72
|
+
if (showHover !== null && showHover !== void 0 ? showHover : Misc.Settings.grid.showHover) {
|
|
73
73
|
className += " table-hover";
|
|
74
74
|
}
|
|
75
75
|
// use small table sizing
|
|
76
|
-
if (
|
|
76
|
+
if (isSmallTable !== null && isSmallTable !== void 0 ? isSmallTable : Misc.Settings.grid.isSmallTable) {
|
|
77
77
|
className += " table-sm";
|
|
78
78
|
}
|
|
79
79
|
if (!this.gridContext.dataView || items !== this.prevItems) {
|
|
@@ -118,7 +118,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
118
118
|
var sortAsc_1;
|
|
119
119
|
if (initialSort instanceof Array) {
|
|
120
120
|
sortColumns = initialSort;
|
|
121
|
-
sortAsc_1 = (
|
|
121
|
+
sortAsc_1 = (initialSortAscending !== null && initialSortAscending !== void 0 ? initialSortAscending : []);
|
|
122
122
|
}
|
|
123
123
|
else {
|
|
124
124
|
sortColumns = [initialSort];
|
|
@@ -176,7 +176,7 @@ var AddButtonRow = /** @class */ (function (_super) {
|
|
|
176
176
|
setTimeout(function () {
|
|
177
177
|
if (_this.domRef.current) {
|
|
178
178
|
var tableParent = _this.domRef.current.parentElement.parentElement;
|
|
179
|
-
var firstElement = tableParent.querySelector("[id^=\""
|
|
179
|
+
var firstElement = tableParent.querySelector("[id^=\"".concat(entityIdentifier, "\"]"));
|
|
180
180
|
if (firstElement && firstElement.focus) {
|
|
181
181
|
firstElement.focus();
|
|
182
182
|
}
|
|
@@ -106,7 +106,7 @@ var ChildRow = /** @class */ (function (_super) {
|
|
|
106
106
|
}
|
|
107
107
|
return !this.expandProperty || this.expandProperty.value;
|
|
108
108
|
},
|
|
109
|
-
enumerable:
|
|
109
|
+
enumerable: false,
|
|
110
110
|
configurable: true
|
|
111
111
|
});
|
|
112
112
|
ChildRow.prototype.onFirstRender = function () {
|
|
@@ -156,7 +156,7 @@ var ChildRow = /** @class */ (function (_super) {
|
|
|
156
156
|
var _a;
|
|
157
157
|
this.onRender();
|
|
158
158
|
var _b = this.props, isExpanded = _b.isExpanded, isFullWidth = _b.isFullWidth, childCellProps = _b.childCellProps, domProps = __rest(_b, ["isExpanded", "isFullWidth", "childCellProps"]);
|
|
159
|
-
isExpanded = this.inBody && (_a = this.context.expandAll
|
|
159
|
+
isExpanded = this.inBody && ((_a = this.context.expandAll) !== null && _a !== void 0 ? _a : this.isExpanded);
|
|
160
160
|
if (this.context.expandAll !== undefined) {
|
|
161
161
|
// Prevent animation on whole table expand change.
|
|
162
162
|
this.wasExpanded = false;
|
|
@@ -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 {};
|