@seniorsistemas/angular-components 14.5.0 → 14.5.1
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/bundles/seniorsistemas-angular-components.umd.js +22 -22
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/stats-card/stats-card.component.d.ts +2 -1
- package/esm2015/components/stats-card/stats-card.component.js +21 -19
- package/esm5/components/stats-card/stats-card.component.js +20 -19
- package/fesm2015/seniorsistemas-angular-components.js +20 -18
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +19 -18
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -41,6 +41,7 @@ import * as elementResizeDetectorMaker_ from 'element-resize-detector';
|
|
|
41
41
|
import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
|
|
42
42
|
import { ScrollPanelModule } from 'primeng/scrollpanel';
|
|
43
43
|
import { Sidebar, SidebarModule as SidebarModule$1 } from 'primeng/sidebar';
|
|
44
|
+
import { BigNumber } from 'bignumber.js';
|
|
44
45
|
|
|
45
46
|
var BreadcrumbComponent = /** @class */ (function () {
|
|
46
47
|
function BreadcrumbComponent(activatedRoute, router) {
|
|
@@ -6284,43 +6285,43 @@ var StatsCardComponent = /** @class */ (function () {
|
|
|
6284
6285
|
});
|
|
6285
6286
|
StatsCardComponent.prototype.updateDisplayValue = function () {
|
|
6286
6287
|
var _this = this;
|
|
6287
|
-
var previousRawValue =
|
|
6288
|
-
var rawValue =
|
|
6289
|
-
var
|
|
6290
|
-
var
|
|
6288
|
+
var previousRawValue = new BigNumber(this.previousValue.replace(/\D/g, ""));
|
|
6289
|
+
var rawValue = new BigNumber(this.value.replace(/\D/g, ""));
|
|
6290
|
+
var eachAnimationDuration = new BigNumber(this.ANIMATION_DURATION_MS).dividedBy(new BigNumber(this.STEP_DURATION_MS));
|
|
6291
|
+
var incrementValue = rawValue.minus(previousRawValue).absoluteValue().dividedBy(eachAnimationDuration).dp(0, 7);
|
|
6292
|
+
var incremental = previousRawValue.isLessThan(rawValue);
|
|
6291
6293
|
clearInterval(this.intervalId);
|
|
6292
6294
|
this.displayValue = this.replaceNumericPositions(this.value);
|
|
6293
6295
|
var counter = previousRawValue;
|
|
6294
6296
|
this.intervalId = setInterval(function () {
|
|
6295
|
-
if (incremental && counter
|
|
6296
|
-
_this.displayValue = _this.replaceNumericPositions(_this.displayValue,
|
|
6297
|
-
counter
|
|
6297
|
+
if (incremental && counter.isLessThan(rawValue)) {
|
|
6298
|
+
_this.displayValue = _this.replaceNumericPositions(_this.displayValue, counter);
|
|
6299
|
+
counter = counter.plus(incrementValue);
|
|
6298
6300
|
}
|
|
6299
|
-
else if (incremental) {
|
|
6300
|
-
_this.displayValue = _this.
|
|
6301
|
-
|
|
6301
|
+
else if (!incremental && counter.isGreaterThan(rawValue)) {
|
|
6302
|
+
_this.displayValue = _this.replaceNumericPositions(_this.displayValue, counter);
|
|
6303
|
+
counter = counter.minus(incrementValue);
|
|
6302
6304
|
}
|
|
6303
|
-
else
|
|
6304
|
-
_this.displayValue = _this.replaceNumericPositions(_this.displayValue, String(counter));
|
|
6305
|
-
counter -= incrementValue;
|
|
6306
|
-
}
|
|
6307
|
-
else if (!incremental) {
|
|
6305
|
+
else {
|
|
6308
6306
|
_this.displayValue = _this.value;
|
|
6309
6307
|
clearInterval(_this.intervalId);
|
|
6310
6308
|
}
|
|
6311
6309
|
}, this.STEP_DURATION_MS);
|
|
6312
6310
|
};
|
|
6313
6311
|
StatsCardComponent.prototype.replaceNumericPositions = function (value, newValue) {
|
|
6314
|
-
if (newValue === void 0) { newValue = ""; }
|
|
6315
6312
|
var rawValue = value.replace(/[^\d]/g, "");
|
|
6316
|
-
var newValueString = newValue.
|
|
6313
|
+
var newValueString = newValue ? newValue.toString() : "";
|
|
6314
|
+
var formattedNewValue = newValueString
|
|
6315
|
+
.toString()
|
|
6316
|
+
.replace(/\D/g, "")
|
|
6317
|
+
.padStart(rawValue.length, "0");
|
|
6317
6318
|
var newValueIndex = 0;
|
|
6318
6319
|
return value
|
|
6319
6320
|
.split("")
|
|
6320
6321
|
.map(function (char) {
|
|
6321
6322
|
var number = Number(char);
|
|
6322
6323
|
if (number || char === "0")
|
|
6323
|
-
return
|
|
6324
|
+
return formattedNewValue[newValueIndex++];
|
|
6324
6325
|
return char;
|
|
6325
6326
|
})
|
|
6326
6327
|
.join("");
|