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