@whitesev/pops 4.2.2 → 4.2.3

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.
@@ -1,7 +1,7 @@
1
1
  var pops = (function () {
2
2
  'use strict';
3
3
 
4
- const version = "4.2.2";
4
+ const version = "4.2.3";
5
5
 
6
6
  const GlobalConfig = {
7
7
  config: {},
@@ -676,6 +676,10 @@ var pops = (function () {
676
676
  if (typeof deviation !== "number" || Number.isNaN(deviation)) {
677
677
  deviation = 10;
678
678
  }
679
+ // 最大值 2147483647
680
+ // const maxZIndex = Math.pow(2, 31) - 1;
681
+ // 比较值 2000000000
682
+ const maxZIndexCompare = 2 * Math.pow(10, 9);
679
683
  /** 坐标偏移 */
680
684
  const positionDistance = 10;
681
685
  const defaultCalcPostion = [];
@@ -770,9 +774,14 @@ var pops = (function () {
770
774
  left: maxRect.left,
771
775
  };
772
776
  }
777
+ const calcZIndex = zIndex + deviation;
778
+ if (calcZIndex >= maxZIndexCompare) {
779
+ // 不要超过最大值
780
+ return;
781
+ }
773
782
  return {
774
783
  /** 计算偏移量后的z-index值 */
775
- zIndex: zIndex + deviation,
784
+ zIndex: calcZIndex,
776
785
  /** 获取到的最大的z-index值 */
777
786
  originZIndex: zIndex,
778
787
  /** 拥有最大z-index的元素 */
@@ -3182,8 +3191,8 @@ var pops = (function () {
3182
3191
  * 获取pops所有弹窗中的最大的z-index
3183
3192
  * @param deviation
3184
3193
  */
3185
- getPopsMaxZIndex(deviation = 1) {
3186
- deviation = Number.isNaN(deviation) ? 1 : deviation;
3194
+ getPopsMaxZIndex(deviation = 10) {
3195
+ deviation = Number.isNaN(deviation) ? 10 : deviation;
3187
3196
  // 最大值 2147483647
3188
3197
  // const browserMaxZIndex = Math.pow(2, 31) - 1;
3189
3198
  // 比较值 2000000000
@@ -3198,8 +3207,7 @@ var pops = (function () {
3198
3207
  const inst = instData[index];
3199
3208
  // 不对position为static和display为none的元素进行获取它们的z-index
3200
3209
  const $elList = [inst.$anim, inst.$pops, inst.$mask].filter((it) => it instanceof HTMLElement);
3201
- const nodeZIndexInfoList = popsUtils.getMaxZIndexNodeInfoFromPoint($elList);
3202
- const maxNodeZIndexInfo = nodeZIndexInfoList[0];
3210
+ const maxNodeZIndexInfo = popsUtils.getMaxZIndexNodeInfoFromPoint($elList)[0];
3203
3211
  if (maxNodeZIndexInfo) {
3204
3212
  const nodeZIndex = maxNodeZIndexInfo.zIndex;
3205
3213
  if (nodeZIndex > zIndex) {