@singularsystems/neo-react 1.6.5 → 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 CHANGED
@@ -2,6 +2,13 @@
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
+
5
12
  ## Version 1.6.5 (3 August 2026)
6
13
 
7
14
  - Routing fix
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "React application logic and components for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",