@tspro/ts-utils-lib 3.2.0 → 3.3.0
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 +9 -4
- package/dist/index.d.ts +7 -7
- package/dist/index.es5.iife.js +1 -1
- package/dist/index.es5.polyfilled.iife.js +1 -1
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
|
-
* TsUtilsLib v3.
|
|
4
|
+
* TsUtilsLib v3.3.0 (cjs)
|
|
5
5
|
* (c) 2023-2025 PahkaSoft
|
|
6
6
|
* Licensed under the MIT License
|
|
7
7
|
*/
|
|
@@ -1522,32 +1522,32 @@ function toPx(value) {
|
|
|
1522
1522
|
return value === void 0 ? void 0 : device_exports.unitToPx(value);
|
|
1523
1523
|
}
|
|
1524
1524
|
function hasClass(el, className) {
|
|
1525
|
-
if (className.length === 0)
|
|
1525
|
+
if (className.length === 0)
|
|
1526
1526
|
return false;
|
|
1527
|
-
|
|
1527
|
+
else if (el.classList)
|
|
1528
1528
|
return el.classList.contains(className);
|
|
1529
|
-
|
|
1529
|
+
else
|
|
1530
1530
|
return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)"));
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
function addClass(el, className) {
|
|
1534
|
-
if (className.length === 0) {
|
|
1535
|
-
return;
|
|
1536
|
-
} else if (el.classList) {
|
|
1537
|
-
el.classList.add(className);
|
|
1538
|
-
} else if (!hasClass(el, className)) {
|
|
1539
|
-
el.className += " " + className;
|
|
1540
|
-
}
|
|
1541
1531
|
}
|
|
1542
|
-
function
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
el.classList
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
}
|
|
1532
|
+
function addClass(el, ...className) {
|
|
1533
|
+
className.forEach((cls) => {
|
|
1534
|
+
if (cls.length === 0)
|
|
1535
|
+
return;
|
|
1536
|
+
else if (el.classList)
|
|
1537
|
+
el.classList.add(cls);
|
|
1538
|
+
else if (!hasClass(el, cls))
|
|
1539
|
+
el.className += " " + cls;
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
function removeClass(el, ...className) {
|
|
1543
|
+
className.forEach((cls) => {
|
|
1544
|
+
if (cls.length === 0)
|
|
1545
|
+
return;
|
|
1546
|
+
else if (el.classList)
|
|
1547
|
+
el.classList.remove(cls);
|
|
1548
|
+
else if (hasClass(el, cls))
|
|
1549
|
+
el.className = el.className.replace(new RegExp("(\\s|^)" + cls + "(\\s|$)"), " ");
|
|
1550
|
+
});
|
|
1551
1551
|
}
|
|
1552
1552
|
function setOffset(el, left, top, unit = "px") {
|
|
1553
1553
|
el.style.left = left + unit;
|
|
@@ -4466,7 +4466,7 @@ var CallTracker = _CallTracker;
|
|
|
4466
4466
|
|
|
4467
4467
|
// src/index.ts
|
|
4468
4468
|
function getLibInfo() {
|
|
4469
|
-
return "TsUtilsLib v3.
|
|
4469
|
+
return "TsUtilsLib v3.3.0 (cjs)";
|
|
4470
4470
|
}
|
|
4471
4471
|
|
|
4472
4472
|
exports.AnchoredRect = AnchoredRect;
|