Updated tabler to 1.0.0-beta20

This commit is contained in:
Pinga 2023-08-29 11:37:36 +03:00
parent 9fafe701aa
commit ae0bfb08f3
429 changed files with 28170 additions and 18920 deletions

View file

@ -15,13 +15,14 @@ var CountUp = /** @class */ (function () {
var _this = this;
this.endVal = endVal;
this.options = options;
this.version = '2.3.2';
this.version = '2.6.2';
this.defaults = {
startVal: 0,
decimalPlaces: 0,
duration: 2,
useEasing: true,
useGrouping: true,
useIndianSeparators: false,
smartEasingThreshold: 999,
smartEasingAmount: 333,
separator: ',',
@ -73,8 +74,8 @@ var CountUp = /** @class */ (function () {
_this.update(_this.finalEndVal);
}
else {
if (_this.callback) {
_this.callback();
if (_this.options.onCompleteCallback) {
_this.options.onCompleteCallback();
}
}
};
@ -89,10 +90,16 @@ var CountUp = /** @class */ (function () {
x2 = x.length > 1 ? _this.options.decimal + x[1] : '';
if (_this.options.useGrouping) {
x3 = '';
var factor = 3, j = 0;
for (var i = 0, len = x1.length; i < len; ++i) {
if (i !== 0 && (i % 3) === 0) {
if (_this.options.useIndianSeparators && i === 4) {
factor = 2;
j = 1;
}
if (i !== 0 && (j % factor) === 0) {
x3 = _this.options.separator + x3;
}
j++;
x3 = x1[len - i - 1] + x3;
}
x1 = x3;
@ -151,6 +158,7 @@ var CountUp = /** @class */ (function () {
return;
var bottomOfScroll = window.innerHeight + window.scrollY;
var rect = self.el.getBoundingClientRect();
var topOfEl = rect.top + window.pageYOffset;
var bottomOfEl = rect.top + rect.height + window.pageYOffset;
if (bottomOfEl < bottomOfScroll && bottomOfEl > window.scrollY && self.paused) {
// in view
@ -159,8 +167,9 @@ var CountUp = /** @class */ (function () {
if (self.options.scrollSpyOnce)
self.once = true;
}
else if (window.scrollY > bottomOfEl && !self.paused) {
// scrolled past
else if ((window.scrollY > bottomOfEl || topOfEl > bottomOfScroll) &&
!self.paused) {
// out of view
self.reset();
}
};
@ -168,7 +177,7 @@ var CountUp = /** @class */ (function () {
* Smart easing works by breaking the animation into 2 parts, the second part being the
* smartEasingAmount and first part being the total amount minus the smartEasingAmount. It works
* by disabling easing for the first part and enabling it on the second part. It is used if
* usingEasing is true and the total animation amount exceeds the smartEasingThreshold.
* useEasing is true and the total animation amount exceeds the smartEasingThreshold.
*/
CountUp.prototype.determineDirectionAndSmartEasing = function () {
var end = (this.finalEndVal) ? this.finalEndVal : this.endVal;
@ -197,7 +206,9 @@ var CountUp = /** @class */ (function () {
if (this.error) {
return;
}
this.callback = callback;
if (callback) {
this.options.onCompleteCallback = callback;
}
if (this.duration > 0) {
this.determineDirectionAndSmartEasing();
this.paused = false;
@ -247,7 +258,14 @@ var CountUp = /** @class */ (function () {
this.rAF = requestAnimationFrame(this.count);
};
CountUp.prototype.printValue = function (val) {
var _a;
if (!this.el)
return;
var result = this.formattingFn(val);
if ((_a = this.options.plugin) === null || _a === void 0 ? void 0 : _a.render) {
this.options.plugin.render(this.el, result);
return;
}
if (this.el.tagName === 'INPUT') {
var input = this.el;
input.value = result;