@whitesev/utils 2.3.5 → 2.3.6
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 -5
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +11 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +11 -5
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +11 -5
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +11 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Utils.d.ts +8 -4
- package/package.json +1 -1
- package/src/Utils.ts +43 -9
package/dist/index.amd.js
CHANGED
|
@@ -3952,7 +3952,7 @@ define((function () { 'use strict';
|
|
|
3952
3952
|
this.windowApi = new WindowApi(option);
|
|
3953
3953
|
}
|
|
3954
3954
|
/** 版本号 */
|
|
3955
|
-
version = "2024.
|
|
3955
|
+
version = "2024.10.13";
|
|
3956
3956
|
addStyle(cssText) {
|
|
3957
3957
|
if (typeof cssText !== "string") {
|
|
3958
3958
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -4648,7 +4648,7 @@ define((function () { 'use strict';
|
|
|
4648
4648
|
return Math.max(...newResult);
|
|
4649
4649
|
}
|
|
4650
4650
|
}
|
|
4651
|
-
getMaxZIndexNodeInfo(deviation = 1) {
|
|
4651
|
+
getMaxZIndexNodeInfo(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
|
|
4652
4652
|
deviation = Number.isNaN(deviation) ? 1 : deviation;
|
|
4653
4653
|
const UtilsContext = this;
|
|
4654
4654
|
// 最大值2147483647
|
|
@@ -4673,6 +4673,12 @@ define((function () { 'use strict';
|
|
|
4673
4673
|
* @param $ele
|
|
4674
4674
|
*/
|
|
4675
4675
|
function queryMaxZIndex($ele) {
|
|
4676
|
+
if (typeof ignoreCallBack === "function") {
|
|
4677
|
+
let ignoreResult = ignoreCallBack($ele);
|
|
4678
|
+
if (typeof ignoreResult === "boolean" && !ignoreResult) {
|
|
4679
|
+
return;
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4676
4682
|
/** 元素的样式 */
|
|
4677
4683
|
const nodeStyle = UtilsContext.windowApi.window.getComputedStyle($ele);
|
|
4678
4684
|
/* 不对position为static和display为none的元素进行获取它们的z-index */
|
|
@@ -4693,7 +4699,7 @@ define((function () { 'use strict';
|
|
|
4693
4699
|
}
|
|
4694
4700
|
}
|
|
4695
4701
|
}
|
|
4696
|
-
|
|
4702
|
+
target.querySelectorAll("*").forEach(($ele, index) => {
|
|
4697
4703
|
queryMaxZIndex($ele);
|
|
4698
4704
|
});
|
|
4699
4705
|
zIndex += deviation;
|
|
@@ -4706,8 +4712,8 @@ define((function () { 'use strict';
|
|
|
4706
4712
|
zIndex: zIndex,
|
|
4707
4713
|
};
|
|
4708
4714
|
}
|
|
4709
|
-
getMaxZIndex(deviation = 1) {
|
|
4710
|
-
return this.getMaxZIndexNodeInfo(deviation).zIndex;
|
|
4715
|
+
getMaxZIndex(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
|
|
4716
|
+
return this.getMaxZIndexNodeInfo(deviation, target, ignoreCallBack).zIndex;
|
|
4711
4717
|
}
|
|
4712
4718
|
getMinValue(...args) {
|
|
4713
4719
|
let result = [...args];
|