@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.
@@ -3953,7 +3953,7 @@ var Utils = (function () {
3953
3953
  this.windowApi = new WindowApi(option);
3954
3954
  }
3955
3955
  /** 版本号 */
3956
- version = "2024.9.28";
3956
+ version = "2024.10.13";
3957
3957
  addStyle(cssText) {
3958
3958
  if (typeof cssText !== "string") {
3959
3959
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");
@@ -4649,7 +4649,7 @@ var Utils = (function () {
4649
4649
  return Math.max(...newResult);
4650
4650
  }
4651
4651
  }
4652
- getMaxZIndexNodeInfo(deviation = 1) {
4652
+ getMaxZIndexNodeInfo(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
4653
4653
  deviation = Number.isNaN(deviation) ? 1 : deviation;
4654
4654
  const UtilsContext = this;
4655
4655
  // 最大值2147483647
@@ -4674,6 +4674,12 @@ var Utils = (function () {
4674
4674
  * @param $ele
4675
4675
  */
4676
4676
  function queryMaxZIndex($ele) {
4677
+ if (typeof ignoreCallBack === "function") {
4678
+ let ignoreResult = ignoreCallBack($ele);
4679
+ if (typeof ignoreResult === "boolean" && !ignoreResult) {
4680
+ return;
4681
+ }
4682
+ }
4677
4683
  /** 元素的样式 */
4678
4684
  const nodeStyle = UtilsContext.windowApi.window.getComputedStyle($ele);
4679
4685
  /* 不对position为static和display为none的元素进行获取它们的z-index */
@@ -4694,7 +4700,7 @@ var Utils = (function () {
4694
4700
  }
4695
4701
  }
4696
4702
  }
4697
- this.windowApi.document.querySelectorAll("*").forEach(($ele, index) => {
4703
+ target.querySelectorAll("*").forEach(($ele, index) => {
4698
4704
  queryMaxZIndex($ele);
4699
4705
  });
4700
4706
  zIndex += deviation;
@@ -4707,8 +4713,8 @@ var Utils = (function () {
4707
4713
  zIndex: zIndex,
4708
4714
  };
4709
4715
  }
4710
- getMaxZIndex(deviation = 1) {
4711
- return this.getMaxZIndexNodeInfo(deviation).zIndex;
4716
+ getMaxZIndex(deviation = 1, target = this.windowApi.document, ignoreCallBack) {
4717
+ return this.getMaxZIndexNodeInfo(deviation, target, ignoreCallBack).zIndex;
4712
4718
  }
4713
4719
  getMinValue(...args) {
4714
4720
  let result = [...args];