@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.
- package/dist/index.amd.js +14 -6
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +14 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +14 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +14 -6
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +14 -6
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +14 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/utils/PopsUtils.d.ts +2 -2
- package/package.json +3 -3
- package/src/utils/PopsInstanceUtils.ts +3 -4
- package/src/utils/PopsUtils.ts +13 -4
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const version = "4.2.
|
|
1
|
+
const version = "4.2.3";
|
|
2
2
|
|
|
3
3
|
const GlobalConfig = {
|
|
4
4
|
config: {},
|
|
@@ -673,6 +673,10 @@ class PopsUtils {
|
|
|
673
673
|
if (typeof deviation !== "number" || Number.isNaN(deviation)) {
|
|
674
674
|
deviation = 10;
|
|
675
675
|
}
|
|
676
|
+
// 最大值 2147483647
|
|
677
|
+
// const maxZIndex = Math.pow(2, 31) - 1;
|
|
678
|
+
// 比较值 2000000000
|
|
679
|
+
const maxZIndexCompare = 2 * Math.pow(10, 9);
|
|
676
680
|
/** 坐标偏移 */
|
|
677
681
|
const positionDistance = 10;
|
|
678
682
|
const defaultCalcPostion = [];
|
|
@@ -767,9 +771,14 @@ class PopsUtils {
|
|
|
767
771
|
left: maxRect.left,
|
|
768
772
|
};
|
|
769
773
|
}
|
|
774
|
+
const calcZIndex = zIndex + deviation;
|
|
775
|
+
if (calcZIndex >= maxZIndexCompare) {
|
|
776
|
+
// 不要超过最大值
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
770
779
|
return {
|
|
771
780
|
/** 计算偏移量后的z-index值 */
|
|
772
|
-
zIndex:
|
|
781
|
+
zIndex: calcZIndex,
|
|
773
782
|
/** 获取到的最大的z-index值 */
|
|
774
783
|
originZIndex: zIndex,
|
|
775
784
|
/** 拥有最大z-index的元素 */
|
|
@@ -3179,8 +3188,8 @@ const PopsInstanceUtils = {
|
|
|
3179
3188
|
* 获取pops所有弹窗中的最大的z-index
|
|
3180
3189
|
* @param deviation
|
|
3181
3190
|
*/
|
|
3182
|
-
getPopsMaxZIndex(deviation =
|
|
3183
|
-
deviation = Number.isNaN(deviation) ?
|
|
3191
|
+
getPopsMaxZIndex(deviation = 10) {
|
|
3192
|
+
deviation = Number.isNaN(deviation) ? 10 : deviation;
|
|
3184
3193
|
// 最大值 2147483647
|
|
3185
3194
|
// const browserMaxZIndex = Math.pow(2, 31) - 1;
|
|
3186
3195
|
// 比较值 2000000000
|
|
@@ -3195,8 +3204,7 @@ const PopsInstanceUtils = {
|
|
|
3195
3204
|
const inst = instData[index];
|
|
3196
3205
|
// 不对position为static和display为none的元素进行获取它们的z-index
|
|
3197
3206
|
const $elList = [inst.$anim, inst.$pops, inst.$mask].filter((it) => it instanceof HTMLElement);
|
|
3198
|
-
const
|
|
3199
|
-
const maxNodeZIndexInfo = nodeZIndexInfoList[0];
|
|
3207
|
+
const maxNodeZIndexInfo = popsUtils.getMaxZIndexNodeInfoFromPoint($elList)[0];
|
|
3200
3208
|
if (maxNodeZIndexInfo) {
|
|
3201
3209
|
const nodeZIndex = maxNodeZIndexInfo.zIndex;
|
|
3202
3210
|
if (nodeZIndex > zIndex) {
|