@whitesev/utils 2.11.9 → 2.11.10
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/dist/index.amd.js +11 -2
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +11 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +11 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +11 -2
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +11 -2
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +11 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Utils.d.ts +2 -2
- package/package.json +1 -1
- package/src/Utils.ts +13 -4
package/dist/index.system.js
CHANGED
|
@@ -242,7 +242,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
242
242
|
const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
|
|
243
243
|
const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
|
|
244
244
|
|
|
245
|
-
const version = "2.11.
|
|
245
|
+
const version = "2.11.10";
|
|
246
246
|
|
|
247
247
|
/* eslint-disable */
|
|
248
248
|
// ==UserScript==
|
|
@@ -6211,6 +6211,10 @@ System.register('Utils', [], (function (exports) {
|
|
|
6211
6211
|
if (typeof deviation !== "number" || Number.isNaN(deviation)) {
|
|
6212
6212
|
deviation = 10;
|
|
6213
6213
|
}
|
|
6214
|
+
// 最大值 2147483647
|
|
6215
|
+
// const maxZIndex = Math.pow(2, 31) - 1;
|
|
6216
|
+
// 比较值 2000000000
|
|
6217
|
+
const maxZIndexCompare = 2 * Math.pow(10, 9);
|
|
6214
6218
|
/** 坐标偏移 */
|
|
6215
6219
|
const positionDistance = 10;
|
|
6216
6220
|
const defaultCalcPostion = [];
|
|
@@ -6305,9 +6309,14 @@ System.register('Utils', [], (function (exports) {
|
|
|
6305
6309
|
left: maxRect.left,
|
|
6306
6310
|
};
|
|
6307
6311
|
}
|
|
6312
|
+
let calcZIndex = zIndex + deviation;
|
|
6313
|
+
if (calcZIndex >= maxZIndexCompare) {
|
|
6314
|
+
// 不要超过最大值
|
|
6315
|
+
calcZIndex = maxZIndexCompare;
|
|
6316
|
+
}
|
|
6308
6317
|
return {
|
|
6309
6318
|
/** 计算偏移量后的z-index值 */
|
|
6310
|
-
zIndex:
|
|
6319
|
+
zIndex: calcZIndex,
|
|
6311
6320
|
/** 获取到的最大的z-index值 */
|
|
6312
6321
|
originZIndex: zIndex,
|
|
6313
6322
|
/** 拥有最大z-index的元素 */
|