@singularsystems/neo-react 1.6.4 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/ReactComponents/Grid/StickyTableHeader.d.ts +1 -3
- package/dist/ReactComponents/Grid/StickyTableHeader.js +12 -17
- package/dist/ReactComponents/NumberInput.d.ts +4 -0
- package/dist/ReactComponents/NumberInput.js +7 -2
- package/dist/Routing/RoutingState.js +3 -3
- package/dist/Routing/ViewParameterList.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
This file details all new features and changes to functionality. If you only need to see changes that require updates to your project, see the [breaking changes](./Breaking.md) readme.
|
|
4
4
|
|
|
5
|
+
## Version 1.6.6 (20 August 2026)
|
|
6
|
+
|
|
7
|
+
- Number input
|
|
8
|
+
- Can now suppress stepping value up and down on press of arrow keys.
|
|
9
|
+
- Set `suppressKeyDownStepping` per instance on numprops.
|
|
10
|
+
- Can be disabled globally using `Neo.NumberInput.suppressKeyDownStepping = true;`.
|
|
11
|
+
|
|
12
|
+
## Version 1.6.5 (3 August 2026)
|
|
13
|
+
|
|
14
|
+
- Routing fix
|
|
15
|
+
- Fixed params not updating when a view is referenced by 2 different routes.
|
|
16
|
+
- Breadcrumb
|
|
17
|
+
- Fixed breadcrumb item showing with blank description.
|
|
18
|
+
- Sticky table headers
|
|
19
|
+
- Fixed heading snapping to app header when grid is in a modal.
|
|
20
|
+
|
|
5
21
|
## Version 1.6.4 (20 July 2026)
|
|
6
22
|
|
|
7
23
|
- Neo.Card
|
|
@@ -14,9 +14,7 @@ export declare class StickyTableHeader {
|
|
|
14
14
|
private domObserver;
|
|
15
15
|
private originalWidths;
|
|
16
16
|
/** Parent element that may scroll, requiring a position update. */
|
|
17
|
-
private
|
|
18
|
-
/** Fixed height parent element that the grid scrolls within. */
|
|
19
|
-
private relativeParent?;
|
|
17
|
+
private scrollParent?;
|
|
20
18
|
private header;
|
|
21
19
|
private headerCopy?;
|
|
22
20
|
private headerHeight;
|
|
@@ -21,17 +21,12 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
21
21
|
throw Error("Table must have a header section.");
|
|
22
22
|
}
|
|
23
23
|
this.header = table.tHead;
|
|
24
|
-
this.
|
|
25
|
-
if (this.scrollElement) {
|
|
26
|
-
if (this.scrollElement.style.height || this.scrollElement.style.maxHeight) {
|
|
27
|
-
this.relativeParent = this.scrollElement;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
24
|
+
this.scrollParent = StickyTableHeader.getParentScrollElement(table);
|
|
30
25
|
this.handleScroll = this.handleScroll.bind(this);
|
|
31
26
|
this.onPossibleContentChange = this.onPossibleContentChange.bind(this);
|
|
32
27
|
document.addEventListener("scroll", this.handleScroll);
|
|
33
|
-
if (this.
|
|
34
|
-
this.
|
|
28
|
+
if (this.scrollParent) {
|
|
29
|
+
this.scrollParent.addEventListener("scroll", this.handleScroll);
|
|
35
30
|
}
|
|
36
31
|
table.addEventListener("keydown", this.onPossibleContentChange);
|
|
37
32
|
table.addEventListener("mouseup", this.onPossibleContentChange);
|
|
@@ -41,10 +36,11 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
41
36
|
// otherwise if there is a fixed (non scrolling) element at the top of the page, then the headers must appear below that.
|
|
42
37
|
// otherwise the headers will stick to the top of the screen.
|
|
43
38
|
var fixedElement = null;
|
|
44
|
-
if (
|
|
39
|
+
if (this.fixedElement && getComputedStyle(this.fixedElement).position === "fixed") {
|
|
45
40
|
fixedElement = this.fixedElement;
|
|
46
41
|
}
|
|
47
|
-
var
|
|
42
|
+
var headerBottom = fixedElement ? fixedElement.getBoundingClientRect().bottom : 0;
|
|
43
|
+
var topBoundary = this.scrollParent ? Math.max(this.scrollParent.getBoundingClientRect().top, headerBottom) : headerBottom;
|
|
48
44
|
var tableBounds = this.table.getBoundingClientRect();
|
|
49
45
|
var tbodyBounds = this.table.tBodies[this.table.tBodies.length - 1].getBoundingClientRect();
|
|
50
46
|
if (tableBounds.top < topBoundary && tbodyBounds.bottom - this.headerHeight > topBoundary) {
|
|
@@ -62,9 +58,9 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
62
58
|
}
|
|
63
59
|
this.header.style.left = tableBounds.left + "px";
|
|
64
60
|
this.header.style.top = topBoundary + "px";
|
|
65
|
-
if (this.
|
|
66
|
-
var left = this.
|
|
67
|
-
var width = this.
|
|
61
|
+
if (this.scrollParent) {
|
|
62
|
+
var left = this.scrollParent.scrollLeft;
|
|
63
|
+
var width = this.scrollParent.clientWidth + left - 1;
|
|
68
64
|
this.header.style.clipPath = "rect(0px ".concat(width, "px 100% ").concat(left, "px)");
|
|
69
65
|
}
|
|
70
66
|
}
|
|
@@ -128,8 +124,8 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
128
124
|
};
|
|
129
125
|
StickyTableHeader.prototype.dispose = function () {
|
|
130
126
|
document.removeEventListener("scroll", this.handleScroll);
|
|
131
|
-
if (this.
|
|
132
|
-
this.
|
|
127
|
+
if (this.scrollParent) {
|
|
128
|
+
this.scrollParent.removeEventListener("scroll", this.handleScroll);
|
|
133
129
|
}
|
|
134
130
|
this.table.removeEventListener("keydown", this.onPossibleContentChange);
|
|
135
131
|
this.table.removeEventListener("mouseup", this.onPossibleContentChange);
|
|
@@ -140,8 +136,7 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
140
136
|
*/
|
|
141
137
|
StickyTableHeader.getParentScrollElement = function (element) {
|
|
142
138
|
var current = element.parentElement;
|
|
143
|
-
|
|
144
|
-
while (current && depth < 5) {
|
|
139
|
+
while (current) {
|
|
145
140
|
var computedStyle = window.getComputedStyle(current);
|
|
146
141
|
if (computedStyle.overflowX === "auto" || computedStyle.overflowX === "scroll" || computedStyle.overflowY === "auto" || computedStyle.overflowY === "scroll") {
|
|
147
142
|
return current;
|
|
@@ -16,6 +16,8 @@ export interface INumberInputSpecificProps {
|
|
|
16
16
|
zeroText?: string;
|
|
17
17
|
/** Set to true to use the browsers native numeric input control. Note: only decimal place formatting is supported in this mode. */
|
|
18
18
|
native?: boolean;
|
|
19
|
+
/** Pressing up and down on the keyboard wont step the value up and down. */
|
|
20
|
+
suppressKeyDownStepping?: boolean;
|
|
19
21
|
}
|
|
20
22
|
export interface INumberInputProps extends IBindableEditorProps<HTMLInputElement> {
|
|
21
23
|
numProps?: INumberInputSpecificProps;
|
|
@@ -43,6 +45,8 @@ export default class NumberInput extends ComponentBase<INumberInputProps> {
|
|
|
43
45
|
private inputElement;
|
|
44
46
|
private recalcFormatState;
|
|
45
47
|
private formatState;
|
|
48
|
+
/** Pressing up and down on the keyboard wont step the value up and down. */
|
|
49
|
+
static suppressKeyDownStepping?: boolean;
|
|
46
50
|
constructor(props: INumberInputProps);
|
|
47
51
|
private onChanged;
|
|
48
52
|
private onFocus;
|
|
@@ -91,6 +91,7 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
91
91
|
_this.onKeyDown = _this.onKeyDown.bind(_this);
|
|
92
92
|
return _this;
|
|
93
93
|
}
|
|
94
|
+
NumberInput_1 = NumberInput;
|
|
94
95
|
NumberInput.prototype.onChanged = function (e) {
|
|
95
96
|
var newValue;
|
|
96
97
|
var stringValue = e.target.value;
|
|
@@ -174,9 +175,12 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
174
175
|
}
|
|
175
176
|
};
|
|
176
177
|
NumberInput.prototype.onKeyDown = function (e) {
|
|
178
|
+
var _a;
|
|
177
179
|
var decimal = NumberUtils.decimalService;
|
|
180
|
+
var numProps = this.props.numProps;
|
|
181
|
+
var suppressKeyDownStepping = (_a = numProps === null || numProps === void 0 ? void 0 : numProps.suppressKeyDownStepping) !== null && _a !== void 0 ? _a : NumberInput_1.suppressKeyDownStepping;
|
|
178
182
|
var element = this.inputElement.current;
|
|
179
|
-
if (!this.isReadOnly && element && (e.keyCode === 38 || e.keyCode === 40)) {
|
|
183
|
+
if (!this.isReadOnly && !suppressKeyDownStepping && element && (e.keyCode === 38 || e.keyCode === 40)) {
|
|
180
184
|
var value = decimal.createDecimal(this.props.bind.value);
|
|
181
185
|
if (value !== null) {
|
|
182
186
|
var selectionIndex = element.selectionEnd;
|
|
@@ -249,8 +253,9 @@ var NumberInput = /** @class */ (function (_super) {
|
|
|
249
253
|
}
|
|
250
254
|
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, domProps, this.inputElement));
|
|
251
255
|
};
|
|
256
|
+
var NumberInput_1;
|
|
252
257
|
NumberInput.contextType = FormContext;
|
|
253
|
-
NumberInput = __decorate([
|
|
258
|
+
NumberInput = NumberInput_1 = __decorate([
|
|
254
259
|
observer,
|
|
255
260
|
__metadata("design:paramtypes", [Object])
|
|
256
261
|
], NumberInput);
|
|
@@ -33,18 +33,18 @@ var RoutingState = /** @class */ (function () {
|
|
|
33
33
|
/** @internal */
|
|
34
34
|
RoutingState.prototype.updateRoute = function (match) {
|
|
35
35
|
var _this = this;
|
|
36
|
-
var _a, _b;
|
|
36
|
+
var _a, _b, _c;
|
|
37
37
|
var prevRoute = (_a = this.currentRoute) === null || _a === void 0 ? void 0 : _a.route;
|
|
38
38
|
runInAction(function () {
|
|
39
39
|
var _a;
|
|
40
40
|
_this.currentRoute = match;
|
|
41
41
|
_this.currentRouteBase = (_a = match === null || match === void 0 ? void 0 : match.route) !== null && _a !== void 0 ? _a : null;
|
|
42
42
|
});
|
|
43
|
-
if (prevRoute !== (match === null || match === void 0 ? void 0 : match.route)) {
|
|
43
|
+
if ((prevRoute === null || prevRoute === void 0 ? void 0 : prevRoute.component) !== ((_b = match === null || match === void 0 ? void 0 : match.route) === null || _b === void 0 ? void 0 : _b.component)) {
|
|
44
44
|
var prevIndex = prevRoute ? this.appRouteProvider.allRoutes.indexOf(prevRoute) : -1;
|
|
45
45
|
var newIndex = match ? this.appRouteProvider.allRoutes.indexOf(match.route) : -1;
|
|
46
46
|
this.direction = newIndex - prevIndex;
|
|
47
|
-
if (((
|
|
47
|
+
if (((_c = this.currentView) === null || _c === void 0 ? void 0 : _c.constructor) !== (match === null || match === void 0 ? void 0 : match.route.component)) {
|
|
48
48
|
this.currentView = null;
|
|
49
49
|
}
|
|
50
50
|
// Scroll back to top as if the browser had actually loaded a new page.
|
|
@@ -30,6 +30,7 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
30
30
|
var queryPath = RouteHelper.getQueryString(this._processedRoute, values);
|
|
31
31
|
var paramPath;
|
|
32
32
|
var selectablePath;
|
|
33
|
+
var queryDescription = "";
|
|
33
34
|
for (var _c = 0, _d = this.params; _c < _d.length; _c++) {
|
|
34
35
|
var viewParam = _d[_c];
|
|
35
36
|
if (!viewParam.routeParameter.isQuery) {
|
|
@@ -53,10 +54,18 @@ var ViewParameterList = /** @class */ (function () {
|
|
|
53
54
|
if (((_a = viewParam.routeParameter.selection) !== null && _a !== void 0 ? _a : BreadCrumbSelectMode.Default) === BreadCrumbSelectMode.Default) {
|
|
54
55
|
selectablePath = paramPath;
|
|
55
56
|
}
|
|
56
|
-
if (viewParam.description
|
|
57
|
+
if (viewParam.description) {
|
|
57
58
|
breadCrumbs.push(new BreadCrumbItem(viewParam.description, (viewParam.routeParameter.selection === BreadCrumbSelectMode.None) ? "" : (selectablePath + queryPath)));
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
else {
|
|
62
|
+
if (!queryDescription && viewParam.description) {
|
|
63
|
+
queryDescription = viewParam.description;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (queryDescription) {
|
|
68
|
+
breadCrumbs.push(new BreadCrumbItem(queryDescription, RouteHelper.hydrateRoute(this._processedRoute, values, false)));
|
|
60
69
|
}
|
|
61
70
|
return breadCrumbs;
|
|
62
71
|
};
|