@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
package/dist/React/AutoRunner.js
CHANGED
|
@@ -19,12 +19,23 @@ 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
|
+
Object.defineProperty(AutoRunner.prototype, "hasPending", {
|
|
27
|
+
get: function () {
|
|
28
|
+
return DebounceHelper.hasPending(this);
|
|
29
|
+
},
|
|
30
|
+
enumerable: false,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
26
33
|
AutoRunner.prototype.cancelPending = function () {
|
|
27
|
-
DebounceHelper.
|
|
34
|
+
if (DebounceHelper.hasPending(this)) {
|
|
35
|
+
DebounceHelper.cancelPending(this);
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
28
39
|
};
|
|
29
40
|
AutoRunner.prototype.fireImmediate = function () {
|
|
30
41
|
DebounceHelper.executeImmediate(this);
|
|
@@ -67,8 +78,8 @@ var AutoRunner = /** @class */ (function () {
|
|
|
67
78
|
var useDelay = this.propertyMap[key];
|
|
68
79
|
if (useDelay === undefined) {
|
|
69
80
|
// 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"))
|
|
81
|
+
useDelay = (_a = propertyInfo.debounce) !== null && _a !== void 0 ? _a : ([Misc.DataType.Int, Misc.DataType.Float].indexOf(propertyInfo.propertyType) >= 0 ||
|
|
82
|
+
(typeof instance.meta[propertyInfo.propertyName].peek === "string"));
|
|
72
83
|
this.propertyMap[key] = useDelay;
|
|
73
84
|
}
|
|
74
85
|
if (useDelay === delayed) {
|
|
@@ -83,7 +94,7 @@ var AutoRunner = /** @class */ (function () {
|
|
|
83
94
|
var index = 0;
|
|
84
95
|
for (var _c = 0, _d = instance[propertyInfo.propertyName]; _c < _d.length; _c++) {
|
|
85
96
|
var child = _d[_c];
|
|
86
|
-
this.accessAllValues(child, delayed, trackedInstances, ""
|
|
97
|
+
this.accessAllValues(child, delayed, trackedInstances, "".concat(path).concat(propertyInfo.propertyName, "[").concat(index++, "]."));
|
|
87
98
|
}
|
|
88
99
|
}
|
|
89
100
|
}
|
|
@@ -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) {
|
|
@@ -26,6 +26,8 @@ export interface IDropDownSpecificProps<T> {
|
|
|
26
26
|
nullText?: string;
|
|
27
27
|
/** Text to display as the first item in the drop down list when the user is allowed to select a blank item. */
|
|
28
28
|
deSelectText?: string;
|
|
29
|
+
/** Set to true if the property should be sorted by value instead of display text. */
|
|
30
|
+
sortByValue?: boolean;
|
|
29
31
|
}
|
|
30
32
|
export interface IDropDownProps<T> extends IBindableEditorProps<HTMLSelectElement> {
|
|
31
33
|
select: IDropDownSpecificProps<T>;
|
|
@@ -34,6 +36,7 @@ export default class DropDown<T> extends DropDownBase<T, IDropDownProps<T>> {
|
|
|
34
36
|
static contextType: React.Context<import("../FormContext").FormContextParams>;
|
|
35
37
|
context: React.ContextType<typeof FormContext>;
|
|
36
38
|
private selectedItem;
|
|
39
|
+
private sortByValue?;
|
|
37
40
|
private listIndexSymbol;
|
|
38
41
|
constructor(props: IDropDownProps<T>);
|
|
39
42
|
private get items();
|
|
@@ -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) {
|
|
@@ -41,7 +41,9 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
41
41
|
list.forEach(function (item) { return index[item[_this.valueMember]] = item; });
|
|
42
42
|
};
|
|
43
43
|
DropDown.prototype.getSelectedOption = function (value) {
|
|
44
|
-
this.
|
|
44
|
+
if (!this.sortByValue) {
|
|
45
|
+
this.props.bind.propertyInfo.hasSortValue = true;
|
|
46
|
+
}
|
|
45
47
|
if (!this.selectedItem || this.selectedItem[this.valueMember] != value) {
|
|
46
48
|
var list = this.items;
|
|
47
49
|
var indexJustCreated = false;
|
|
@@ -61,7 +63,9 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
61
63
|
this.selectedItem[this.displayMember] = "";
|
|
62
64
|
this.selectedItem[this.valueMember] = null;
|
|
63
65
|
}
|
|
64
|
-
|
|
66
|
+
var displayValue = this.selectedItem[this.displayMember];
|
|
67
|
+
this.setFieldInfo(this.props.bind, displayValue);
|
|
68
|
+
this.props.bind.sortValue = this.sortByValue ? value : displayValue;
|
|
65
69
|
}
|
|
66
70
|
return this.selectedItem;
|
|
67
71
|
};
|
|
@@ -81,10 +85,11 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
81
85
|
};
|
|
82
86
|
DropDown.prototype.render = function () {
|
|
83
87
|
var _this = this;
|
|
84
|
-
var _a, _b, _c, _d, _e, _f;
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
85
89
|
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
86
90
|
var domProps = BindPropsHelper.autoSetDomProperties(splitProps, this.context);
|
|
87
91
|
domProps.className = Utils.joinWithSpaces(domProps.className, splitProps.isBootstrap ? "form-control" : "neo-forms-editor");
|
|
92
|
+
this.sortByValue = (_a = splitProps.select) === null || _a === void 0 ? void 0 : _a.sortByValue;
|
|
88
93
|
if (splitProps.select) {
|
|
89
94
|
if (splitProps.select.valueMember)
|
|
90
95
|
this.valueMember = splitProps.select.valueMember;
|
|
@@ -96,7 +101,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
96
101
|
var items = this.items;
|
|
97
102
|
var selectedItem = this.getSelectedOption(this.props.bind.value); // This sets the sort value to allow sorting of drop downs in grids.
|
|
98
103
|
var value = this.props.bind.value;
|
|
99
|
-
var addBlankItem = (
|
|
104
|
+
var addBlankItem = ((_c = (_b = splitProps.select) === null || _b === void 0 ? void 0 : _b.allowNulls) !== null && _c !== void 0 ? _c : this.props.bind.propertyInfo.allowNulls) || !value;
|
|
100
105
|
if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null || item[_this.valueMember] === ""; })) {
|
|
101
106
|
// If there is an item with a null value, don't add a blank drop down item.
|
|
102
107
|
addBlankItem = false;
|
|
@@ -106,7 +111,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
106
111
|
control = React.createElement("div", { className: "form-control form-control-loading" },
|
|
107
112
|
React.createElement("div", { className: "spinner-border" }));
|
|
108
113
|
}
|
|
109
|
-
else if ((
|
|
114
|
+
else if ((_d = splitProps.select) === null || _d === void 0 ? void 0 : _d.renderAsText) {
|
|
110
115
|
control = React.createElement("span", null, selectedItem ? selectedItem[this.displayMember] : "");
|
|
111
116
|
}
|
|
112
117
|
else if (splitProps.editor.isReadOnly) {
|
|
@@ -117,7 +122,7 @@ var DropDown = /** @class */ (function (_super) {
|
|
|
117
122
|
domProps.disabled = true;
|
|
118
123
|
}
|
|
119
124
|
var valueIsBlank = value === undefined || value === null;
|
|
120
|
-
var nullText = (valueIsBlank || ((
|
|
125
|
+
var nullText = (valueIsBlank || ((_e = splitProps.select) === null || _e === void 0 ? void 0 : _e.deSelectText) === undefined) ? (_f = splitProps.select) === null || _f === void 0 ? void 0 : _f.nullText : (_g = splitProps.select) === null || _g === void 0 ? void 0 : _g.deSelectText;
|
|
121
126
|
if (valueIsBlank) {
|
|
122
127
|
domProps.className = Utils.joinWithSpaces(domProps.className, "select-no-value");
|
|
123
128
|
}
|
|
@@ -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)));
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Components, Model } from '@singularsystems/neo-core';
|
|
3
|
-
import { ItemCallback } from './PropTypes';
|
|
4
3
|
export interface IFormProps<T extends Model.IModelBase> extends React.FormHTMLAttributes<HTMLElement>, Components.IFormOptions<T> {
|
|
5
4
|
/**
|
|
6
5
|
* Called when the form is submitted, but the model is not valid.
|
|
7
6
|
* The justValidated parameter will be true if the validationDisplayMode is 'AfterSubmit', and this is the first submit attempt.
|
|
8
7
|
*/
|
|
9
8
|
onInvalid?: (e: React.FormEvent, justValidated?: boolean) => void;
|
|
10
|
-
children: React.ReactNode | React.ReactNode[] |
|
|
9
|
+
children: React.ReactNode | React.ReactNode[] | ((item: T, meta: Model.TransformMetaType<T>) => React.ReactNode);
|
|
11
10
|
}
|
|
12
11
|
export default class Form<T extends Model.IModelBase> extends React.Component<IFormProps<T>> {
|
|
13
12
|
private reactionDisposer?;
|
|
@@ -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
|
};
|
|
@@ -11,6 +11,7 @@ export declare class GridContextParams<T> {
|
|
|
11
11
|
inFirstRowInGroup: boolean;
|
|
12
12
|
columnCount: number;
|
|
13
13
|
expandProperty?: Model.IPropertyInstance<boolean | null>;
|
|
14
|
+
hideExpandButton?: boolean;
|
|
14
15
|
expandAll?: boolean;
|
|
15
16
|
hasSummaries: boolean;
|
|
16
17
|
dataView: Data.DataViewBase<T>;
|
|
@@ -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) {
|
|
@@ -101,11 +101,11 @@ var Grid = /** @class */ (function (_super) {
|
|
|
101
101
|
}
|
|
102
102
|
return (React.createElement("table", __assign({}, domProps, { className: className, ref: this.domRef }),
|
|
103
103
|
React.createElement(GridContext.Provider, { value: this.gridContext },
|
|
104
|
-
React.createElement(TableSection, { type: "header" }, this.headerItem && this.props.children(this.headerItem, this.headerItem.meta)),
|
|
104
|
+
React.createElement(TableSection, { type: "header" }, this.headerItem && this.props.children(this.headerItem, this.headerItem.meta, true)),
|
|
105
105
|
React.createElement(TableSection, { type: "body" }, this.gridContext.dataView.getItems().map(function (item) { return (React.createElement(ItemGroup, { item: item, key: keyProperty ? item[keyProperty] : item.entityIdentifier, template: _this.props.children })); })),
|
|
106
106
|
React.createElement(Observer, null, function () { return (showAddButton || addButton || footerButtons || _this.gridContext.hasSummaries || footerContent !== undefined) &&
|
|
107
107
|
React.createElement(TableSection, { type: "footer" },
|
|
108
|
-
_this.gridContext.hasSummaries && _this.headerItem && _this.props.children(_this.headerItem, _this.headerItem.meta),
|
|
108
|
+
_this.gridContext.hasSummaries && _this.headerItem && _this.props.children(_this.headerItem, _this.headerItem.meta, true),
|
|
109
109
|
footerContent !== undefined && footerContent(_this.gridContext.dataView.getItems()),
|
|
110
110
|
(showAddButton || addButton || footerButtons) &&
|
|
111
111
|
React.createElement(AddButtonRow, { addButton: addButton, showAddButton: showAddButton, additionalContent: footerButtons })); }))));
|
|
@@ -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
|
}
|
|
@@ -206,7 +206,7 @@ var ItemGroup = /** @class */ (function (_super) {
|
|
|
206
206
|
ItemGroup.prototype.render = function () {
|
|
207
207
|
this.context.currentItem = this.props.item;
|
|
208
208
|
//this.context.inFirstRowInGroup = true;
|
|
209
|
-
return (this.props.template(this.props.item, this.props.item.meta));
|
|
209
|
+
return (this.props.template(this.props.item, this.props.item.meta, false));
|
|
210
210
|
};
|
|
211
211
|
ItemGroup.contextType = GridContext;
|
|
212
212
|
ItemGroup = __decorate([
|
|
@@ -71,6 +71,10 @@ interface INeoRowGroupProps {
|
|
|
71
71
|
* To hide the expand button, return null.
|
|
72
72
|
*/
|
|
73
73
|
expandProperty?: Model.IPropertyInstance<boolean | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Hides the expansion button on this row.
|
|
76
|
+
*/
|
|
77
|
+
hideExpandButton?: boolean;
|
|
74
78
|
}
|
|
75
79
|
export declare class RowGroup extends React.Component<INeoRowGroupProps> {
|
|
76
80
|
static contextType: React.Context<import("./Grid").GridContextParams<unknown>>;
|
|
@@ -75,7 +75,7 @@ var Row = /** @class */ (function (_super) {
|
|
|
75
75
|
var output = ((this.props.showInHeader || inBody) &&
|
|
76
76
|
React.createElement("tr", __assign({}, domProps),
|
|
77
77
|
this.expandProperty && this.context.expandAll === undefined &&
|
|
78
|
-
React.createElement(Column, { className: "neo-grid-expand-column" }, this.firstRowInGroup && inBody && this.expandProperty.value !== null &&
|
|
78
|
+
React.createElement(Column, { className: "neo-grid-expand-column" }, this.firstRowInGroup && inBody && this.context.hideExpandButton !== true && this.expandProperty.value !== null &&
|
|
79
79
|
React.createElement(NeoButton, __assign({}, expandButtonOptions))),
|
|
80
80
|
this.props.children));
|
|
81
81
|
this.setGridContext();
|
|
@@ -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;
|
|
@@ -193,6 +193,7 @@ var RowGroup = /** @class */ (function (_super) {
|
|
|
193
193
|
RowGroup.prototype.render = function () {
|
|
194
194
|
this.context.expandProperty = this.props.expandProperty;
|
|
195
195
|
this.context.inFirstRowInGroup = true;
|
|
196
|
+
this.context.hideExpandButton = this.props.hideExpandButton;
|
|
196
197
|
return this.props.children;
|
|
197
198
|
};
|
|
198
199
|
RowGroup.contextType = GridContext;
|