@try-at-software/input-elements 1.2.0-beta.1 → 1.2.0-beta.2

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.
@@ -63,15 +63,16 @@ class SingleValueInputElement extends ExtendedInputElement_1.ExtendedInputElemen
63
63
  var _a;
64
64
  if (this._isInvalidated)
65
65
  this._isInvalidated = false;
66
+ const previousValue = this.value;
66
67
  this.value = value;
67
68
  if ((_a = this._componentRef) === null || _a === void 0 ? void 0 : _a.current)
68
69
  this._componentRef.current.update(value);
69
70
  this.validate();
70
71
  if (this.isValid) {
71
72
  if (isInitial)
72
- this.initialValueChangeSubscriptions.forEach((x) => x === null || x === void 0 ? void 0 : x(this.value));
73
+ this.initialValueChangeSubscriptions.forEach((x) => x === null || x === void 0 ? void 0 : x(this.value, previousValue));
73
74
  else
74
- this.valueChangeSubscriptions.forEach((x) => x === null || x === void 0 ? void 0 : x(this.value));
75
+ this.valueChangeSubscriptions.forEach((x) => x === null || x === void 0 ? void 0 : x(this.value, previousValue));
75
76
  }
76
77
  else
77
78
  this.invalidValueChangeSubscriptions.forEach((x) => x === null || x === void 0 ? void 0 : x());
@@ -1,2 +1,2 @@
1
- export declare type ValueChangeSubscription<TValue> = (newValue: TValue) => void;
1
+ export declare type ValueChangeSubscription<TValue> = (newValue: TValue, previousValue: TValue) => void;
2
2
  export declare type InvalidValueChangeSubscription = () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@try-at-software/input-elements",
3
- "version": "1.2.0-beta.1",
3
+ "version": "1.2.0-beta.2",
4
4
  "description": "A package providing different input elements that are extensible and easily configurable for your custom needs.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",