@whitesev/utils 2.3.4 → 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/dist/types/src/VueObject.d.ts +18 -5
- package/package.json +1 -1
- package/src/Utils.ts +43 -9
- package/src/VueObject.ts +18 -5
package/dist/index.system.js
CHANGED
|
@@ -3955,7 +3955,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
3955
3955
|
this.windowApi = new WindowApi(option);
|
|
3956
3956
|
}
|
|
3957
3957
|
/** 版本号 */
|
|
3958
|
-
version = "2024.
|
|
3958
|
+
version = "2024.10.13";
|
|
3959
3959
|
addStyle(cssText) {
|
|
3960
3960
|
if (typeof cssText !== "string") {
|
|
3961
3961
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -4651,7 +4651,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
4651
4651
|
return Math.max(...newResult);
|
|
4652
4652
|
}
|
|
4653
4653
|
}
|
|
4654
|
-
getMaxZIndexNodeInfo(deviation = 1) {
|
|
4654
|
+
getMaxZIndexNodeInfo(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
|
|
4655
4655
|
deviation = Number.isNaN(deviation) ? 1 : deviation;
|
|
4656
4656
|
const UtilsContext = this;
|
|
4657
4657
|
// 最大值2147483647
|
|
@@ -4676,6 +4676,12 @@ System.register('Utils', [], (function (exports) {
|
|
|
4676
4676
|
* @param $ele
|
|
4677
4677
|
*/
|
|
4678
4678
|
function queryMaxZIndex($ele) {
|
|
4679
|
+
if (typeof ignoreCallBack === "function") {
|
|
4680
|
+
let ignoreResult = ignoreCallBack($ele);
|
|
4681
|
+
if (typeof ignoreResult === "boolean" && !ignoreResult) {
|
|
4682
|
+
return;
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
4679
4685
|
/** 元素的样式 */
|
|
4680
4686
|
const nodeStyle = UtilsContext.windowApi.window.getComputedStyle($ele);
|
|
4681
4687
|
/* 不对position为static和display为none的元素进行获取它们的z-index */
|
|
@@ -4696,7 +4702,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
4696
4702
|
}
|
|
4697
4703
|
}
|
|
4698
4704
|
}
|
|
4699
|
-
|
|
4705
|
+
target.querySelectorAll("*").forEach(($ele, index) => {
|
|
4700
4706
|
queryMaxZIndex($ele);
|
|
4701
4707
|
});
|
|
4702
4708
|
zIndex += deviation;
|
|
@@ -4709,8 +4715,8 @@ System.register('Utils', [], (function (exports) {
|
|
|
4709
4715
|
zIndex: zIndex,
|
|
4710
4716
|
};
|
|
4711
4717
|
}
|
|
4712
|
-
getMaxZIndex(deviation = 1) {
|
|
4713
|
-
return this.getMaxZIndexNodeInfo(deviation).zIndex;
|
|
4718
|
+
getMaxZIndex(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
|
|
4719
|
+
return this.getMaxZIndexNodeInfo(deviation, target, ignoreCallBack).zIndex;
|
|
4714
4720
|
}
|
|
4715
4721
|
getMinValue(...args) {
|
|
4716
4722
|
let result = [...args];
|