ng-virtual-list 22.12.3 → 22.12.4

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.
@@ -4070,8 +4070,9 @@ class Animator {
4070
4070
  _diff = 0;
4071
4071
  _startValue = 0;
4072
4072
  _endValue = 0;
4073
- updateTo(value) {
4074
- this._endValue = value;
4073
+ _prevPos = 0;
4074
+ updateTo(end) {
4075
+ this._endValue = end;
4075
4076
  this._diff = this._endValue - this._startValue;
4076
4077
  return this.hasAnimation();
4077
4078
  }
@@ -4083,7 +4084,8 @@ class Animator {
4083
4084
  this._startValue = startValue;
4084
4085
  this._endValue = endValue;
4085
4086
  const startTime = performance.now();
4086
- let isCanceled = false, prevPos = startValue, startPosDelta = 0, delta = 0, prevTime = startTime, isFinished = false;
4087
+ let isCanceled = false, startPosDelta = 0, delta = 0, prevTime = startTime, isFinished = false;
4088
+ this._prevPos = startValue;
4087
4089
  this._diff = this._endValue - this._startValue;
4088
4090
  const step = (currentTime) => {
4089
4091
  if (id !== this._currentId) {
@@ -4094,22 +4096,22 @@ class Animator {
4094
4096
  }
4095
4097
  const cPos = getPropValue?.() || 0;
4096
4098
  let startDelta = 0;
4097
- if (cPos !== prevPos) {
4098
- startDelta = cPos - prevPos;
4099
+ if (cPos !== this._prevPos) {
4100
+ startDelta = cPos - this._prevPos;
4099
4101
  startPosDelta += startDelta;
4100
4102
  }
4101
- const elapsed = currentTime - startTime, progress = this._startValue === endValue ? 1 : Math.min(duration > 0 ? elapsed / duration : 0, 1), easedProgress = easingFunction(progress), val = (withDelta ? startPosDelta : 0) + this._startValue + this._diff * easedProgress, currentValue = val, t = performance.now();
4103
+ const elapsed = currentTime - startTime, progress = this._startValue === this._endValue ? 1 : Math.min(duration > 0 ? elapsed / duration : 0, 1), easedProgress = easingFunction(progress), val = (withDelta ? startPosDelta : 0) + this._startValue + this._diff * easedProgress, currentValue = val, t = performance.now();
4102
4104
  isFinished = progress === 1;
4103
- delta = currentValue - startDelta - prevPos;
4105
+ delta = currentValue - startDelta - this._prevPos;
4104
4106
  const frameTimestamp = t - prevTime, actualFrameTimestamp = frameTimestamp < ANIMATOR_MIN_TIMESTAMP ? ANIMATOR_MIN_TIMESTAMP : frameTimestamp;
4105
4107
  prevTime = t;
4106
- prevPos = currentValue;
4108
+ this._prevPos = currentValue;
4107
4109
  if (onUpdate !== undefined) {
4108
4110
  const data = {
4109
4111
  id,
4110
4112
  delta,
4111
4113
  elapsed,
4112
- value: !withDelta && isFinished ? endValue : currentValue,
4114
+ value: currentValue,
4113
4115
  timestamp: actualFrameTimestamp,
4114
4116
  };
4115
4117
  onUpdate(data);
@@ -4121,7 +4123,7 @@ class Animator {
4121
4123
  id,
4122
4124
  delta,
4123
4125
  elapsed,
4124
- value: withDelta ? currentValue : endValue,
4126
+ value: currentValue,
4125
4127
  timestamp: actualFrameTimestamp,
4126
4128
  };
4127
4129
  onComplete(data);