@whitesev/pops 1.8.9 → 1.9.1

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.
Files changed (61) hide show
  1. package/dist/index.amd.js +212 -108
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +212 -108
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +212 -108
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +212 -108
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +212 -108
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +212 -108
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +3 -2
  14. package/dist/types/src/components/alert/config.d.ts +1 -1
  15. package/dist/types/src/components/confirm/config.d.ts +1 -1
  16. package/dist/types/src/components/drawer/config.d.ts +1 -1
  17. package/dist/types/src/components/folder/config.d.ts +1 -1
  18. package/dist/types/src/components/iframe/config.d.ts +1 -1
  19. package/dist/types/src/components/loading/config.d.ts +1 -1
  20. package/dist/types/src/components/panel/config.d.ts +1 -1
  21. package/dist/types/src/components/prompt/config.d.ts +1 -1
  22. package/dist/types/src/components/rightClickMenu/config.d.ts +1 -1
  23. package/dist/types/src/components/searchSuggestion/config.d.ts +1 -1
  24. package/dist/types/src/components/tooltip/config.d.ts +1 -1
  25. package/dist/types/src/components/tooltip/index.d.ts +3 -3
  26. package/dist/types/src/components/tooltip/indexType.d.ts +27 -8
  27. package/dist/types/src/handler/PopsHandler.d.ts +3 -1
  28. package/dist/types/src/types/button.d.ts +13 -19
  29. package/dist/types/src/types/global.d.ts +9 -0
  30. package/dist/types/src/types/mask.d.ts +14 -11
  31. package/dist/types/src/utils/PopsInstanceUtils.d.ts +12 -9
  32. package/package.json +1 -1
  33. package/src/Pops.ts +1 -1
  34. package/src/components/alert/config.ts +9 -9
  35. package/src/components/alert/index.ts +1 -2
  36. package/src/components/confirm/config.ts +17 -24
  37. package/src/components/confirm/index.ts +1 -1
  38. package/src/components/drawer/config.ts +21 -21
  39. package/src/components/drawer/index.ts +1 -2
  40. package/src/components/folder/config.ts +16 -16
  41. package/src/components/folder/index.ts +2 -1
  42. package/src/components/iframe/config.ts +2 -3
  43. package/src/components/iframe/index.ts +1 -1
  44. package/src/components/loading/config.ts +2 -3
  45. package/src/components/loading/index.ts +1 -1
  46. package/src/components/panel/config.ts +64 -2
  47. package/src/components/panel/index.ts +5 -5
  48. package/src/components/prompt/config.ts +16 -27
  49. package/src/components/prompt/index.ts +1 -1
  50. package/src/components/rightClickMenu/config.ts +116 -109
  51. package/src/components/rightClickMenu/index.ts +2 -2
  52. package/src/components/searchSuggestion/config.ts +1 -1
  53. package/src/components/searchSuggestion/index.ts +1 -2
  54. package/src/components/tooltip/config.ts +6 -5
  55. package/src/components/tooltip/index.ts +21 -9
  56. package/src/components/tooltip/indexType.ts +32 -12
  57. package/src/handler/PopsHandler.ts +26 -28
  58. package/src/types/button.d.ts +13 -19
  59. package/src/types/global.d.ts +9 -0
  60. package/src/types/mask.d.ts +14 -11
  61. package/src/utils/PopsInstanceUtils.ts +46 -25
@@ -1667,6 +1667,8 @@ var pops = (function () {
1667
1667
  /**
1668
1668
  * 获取页面中最大的z-index的元素信息
1669
1669
  * @param deviation 获取最大的z-index值的偏移,默认是+1
1670
+ * @param node 进行判断的元素,默认是document
1671
+ * @param ignoreCallBack 执行元素处理时调用的函数,返回false可忽略不想要处理的元素
1670
1672
  * @example
1671
1673
  * Utils.getMaxZIndexNodeInfo();
1672
1674
  * > {
@@ -1674,11 +1676,11 @@ var pops = (function () {
1674
1676
  * zIndex: 1001
1675
1677
  * }
1676
1678
  **/
1677
- getMaxZIndexNodeInfo(deviation = 1) {
1679
+ getMaxZIndexNodeInfo(deviation = 1, target = PopsCore.document, ignoreCallBack) {
1678
1680
  deviation = Number.isNaN(deviation) ? 1 : deviation;
1679
- // 最大值2147483647
1680
- const maxZIndex = Math.pow(2, 31) - 1;
1681
- // 比较值2000000000
1681
+ // 最大值 2147483647
1682
+ // const maxZIndex = Math.pow(2, 31) - 1;
1683
+ // 比较值 2000000000
1682
1684
  const maxZIndexCompare = 2 * Math.pow(10, 9);
1683
1685
  // 当前页面最大的z-index
1684
1686
  let zIndex = 0;
@@ -1698,6 +1700,12 @@ var pops = (function () {
1698
1700
  * @param $ele
1699
1701
  */
1700
1702
  function queryMaxZIndex($ele) {
1703
+ if (typeof ignoreCallBack === "function") {
1704
+ let ignoreResult = ignoreCallBack($ele);
1705
+ if (typeof ignoreResult === "boolean" && !ignoreResult) {
1706
+ return;
1707
+ }
1708
+ }
1701
1709
  /** 元素的样式 */
1702
1710
  const nodeStyle = PopsCore.window.getComputedStyle($ele);
1703
1711
  /* 不对position为static和display为none的元素进行获取它们的z-index */
@@ -1718,48 +1726,47 @@ var pops = (function () {
1718
1726
  }
1719
1727
  }
1720
1728
  }
1721
- PopsCore.document.querySelectorAll("*").forEach(($ele, index) => {
1729
+ target.querySelectorAll("*").forEach(($ele, index) => {
1722
1730
  queryMaxZIndex($ele);
1723
1731
  });
1724
1732
  zIndex += deviation;
1725
1733
  if (zIndex >= maxZIndexCompare) {
1726
1734
  // 最好不要超过最大值
1727
- zIndex = maxZIndex;
1735
+ zIndex = maxZIndexCompare;
1728
1736
  }
1729
1737
  return {
1730
1738
  node: maxZIndexNode,
1731
1739
  zIndex: zIndex,
1732
1740
  };
1733
1741
  },
1734
- /**
1735
- * 获取页面中最大的z-index
1736
- * @param deviation 获取最大的z-index值的偏移,默认是+1
1737
- * @example
1738
- * Utils.getMaxZIndex();
1739
- * > 1001
1740
- **/
1741
- getMaxZIndex(deviation = 1) {
1742
- return this.getMaxZIndexNodeInfo(deviation).zIndex;
1743
- },
1744
1742
  /**
1745
1743
  * 获取pops所有弹窗中的最大的z-index
1746
1744
  * @param deviation
1747
1745
  */
1748
1746
  getPopsMaxZIndex(deviation = 1) {
1749
1747
  deviation = Number.isNaN(deviation) ? 1 : deviation;
1750
- // 最大值2147483647
1751
- let maxZIndex = Math.pow(2, 31) - 1;
1748
+ // 最大值 2147483647
1749
+ // const browserMaxZIndex = Math.pow(2, 31) - 1;
1750
+ // 比较值 2000000000
1751
+ const maxZIndex = 2 * Math.pow(10, 9);
1752
1752
  // 当前页面最大的z-index
1753
1753
  let zIndex = 0;
1754
1754
  // 当前的最大z-index的元素,调试使用
1755
1755
  let maxZIndexNode = null;
1756
+ /**
1757
+ * 元素是否可见
1758
+ * @param $css
1759
+ */
1760
+ function isVisibleNode($css) {
1761
+ return $css.position !== "static" && $css.display !== "none";
1762
+ }
1756
1763
  Object.keys(pops.config.layer).forEach((layerName) => {
1757
1764
  let layerList = pops.config.layer[layerName];
1758
1765
  for (let index = 0; index < layerList.length; index++) {
1759
1766
  const layer = layerList[index];
1760
1767
  let nodeStyle = window.getComputedStyle(layer.animElement);
1761
1768
  /* 不对position为static和display为none的元素进行获取它们的z-index */
1762
- if (nodeStyle.position !== "static" && nodeStyle.display !== "none") {
1769
+ if (isVisibleNode(nodeStyle)) {
1763
1770
  let nodeZIndex = parseInt(nodeStyle.zIndex);
1764
1771
  if (!isNaN(nodeZIndex)) {
1765
1772
  if (nodeZIndex > zIndex) {
@@ -1771,13 +1778,22 @@ var pops = (function () {
1771
1778
  }
1772
1779
  });
1773
1780
  zIndex += deviation;
1774
- // 用于比较的值2000000000,大于该值就取该值
1775
- let maxZIndexCompare = 2 * Math.pow(10, 9);
1776
- if (zIndex >= maxZIndexCompare) {
1777
- // 最好不要超过最大值
1781
+ let isOverMaxZIndex = zIndex >= maxZIndex;
1782
+ if (isOverMaxZIndex) {
1783
+ // 超出z-index最大值
1778
1784
  zIndex = maxZIndex;
1779
1785
  }
1780
- return { zIndex: zIndex, animElement: maxZIndexNode };
1786
+ return { zIndex: zIndex, animElement: maxZIndexNode, isOverMaxZIndex };
1787
+ },
1788
+ /**
1789
+ * 获取页面中最大的z-index
1790
+ * @param deviation 获取最大的z-index值的偏移,默认是+1
1791
+ * @example
1792
+ * getMaxZIndex();
1793
+ * > 1001
1794
+ **/
1795
+ getMaxZIndex(deviation = 1) {
1796
+ return this.getMaxZIndexNodeInfo(deviation).zIndex;
1781
1797
  },
1782
1798
  /**
1783
1799
  * 获取CSS Rule
@@ -2762,6 +2778,8 @@ var pops = (function () {
2762
2778
  },
2763
2779
  /**
2764
2780
  * 处理遮罩层
2781
+ *
2782
+ * + 设置遮罩层的点击事件
2765
2783
  * @param details 传递的配置
2766
2784
  */
2767
2785
  handleMask(details = {}) {
@@ -2795,22 +2813,29 @@ var pops = (function () {
2795
2813
  }
2796
2814
  return false;
2797
2815
  }
2798
- function isAnimElement(element) {
2799
- return Boolean(element?.localName?.toLowerCase() === "div" &&
2800
- element.className &&
2801
- element.className === "pops-anim" &&
2802
- element.hasAttribute("anim"));
2803
- }
2816
+ // 判断是否启用了遮罩层点击动作
2804
2817
  if (details.config.mask.clickEvent.toClose ||
2805
2818
  details.config.mask.clickEvent.toHide) {
2819
+ /**
2820
+ * 判断点击的元素是否是动画层的元素
2821
+ * @param element
2822
+ * @returns
2823
+ */
2824
+ function isAnimElement(element) {
2825
+ return Boolean(element?.localName?.toLowerCase() === "div" &&
2826
+ element.className &&
2827
+ element.className === "pops-anim" &&
2828
+ element.hasAttribute("anim"));
2829
+ }
2806
2830
  /* 判断按下的元素是否是pops-anim */
2807
2831
  popsDOMUtils.on(details.animElement, ["touchstart", "mousedown"], void 0, (event) => {
2808
- isMaskClick = isAnimElement(event.composedPath()[0]);
2832
+ let $click = event.composedPath()[0];
2833
+ isMaskClick = isAnimElement($click);
2809
2834
  });
2810
2835
  /* 如果有动画层,在动画层上监听点击事件 */
2811
2836
  popsDOMUtils.on(details.animElement, "click", void 0, (event) => {
2812
- if (isAnimElement(event.composedPath()[0]) &&
2813
- isMaskClick) {
2837
+ let $click = event.composedPath()[0];
2838
+ if (isAnimElement($click) && isMaskClick) {
2814
2839
  return clickEvent(event);
2815
2840
  }
2816
2841
  });
@@ -2825,7 +2850,7 @@ var pops = (function () {
2825
2850
  },
2826
2851
  /**
2827
2852
  * 处理获取元素
2828
- * @param {HTMLDivElement} animElement
2853
+ * @param animElement
2829
2854
  * @param type
2830
2855
  */
2831
2856
  handleQueryElement(animElement, type) {
@@ -3122,17 +3147,11 @@ var pops = (function () {
3122
3147
  else {
3123
3148
  // 对配置进行处理
3124
3149
  // 选择配置的z-index和已有的pops实例的最大z-index值
3125
- if (typeof config.zIndex === "function") {
3126
- let originZIndexFn = config.zIndex;
3127
- config.zIndex = () => {
3128
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndexFn) + 100);
3129
- return maxZIndex;
3130
- };
3131
- }
3132
- else {
3133
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(config.zIndex) + 100);
3134
- config.zIndex = maxZIndex;
3135
- }
3150
+ let originZIndex = config.zIndex;
3151
+ config.zIndex = () => {
3152
+ const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndex) + 100);
3153
+ return maxZIndex;
3154
+ };
3136
3155
  }
3137
3156
  return config;
3138
3157
  },
@@ -3169,14 +3188,14 @@ var pops = (function () {
3169
3188
  iconIsLoading: false,
3170
3189
  text: "确定",
3171
3190
  type: "primary",
3172
- callback: function (event) {
3173
- event.close();
3191
+ callback: function (details) {
3192
+ details.close();
3174
3193
  },
3175
3194
  },
3176
3195
  close: {
3177
3196
  enable: true,
3178
- callback: function (event) {
3179
- event.close();
3197
+ callback: function (details) {
3198
+ details.close();
3180
3199
  },
3181
3200
  },
3182
3201
  },
@@ -3193,7 +3212,7 @@ var pops = (function () {
3193
3212
  toClose: false,
3194
3213
  toHide: false,
3195
3214
  },
3196
- clickCallBack: void 0,
3215
+ clickCallBack: null,
3197
3216
  },
3198
3217
  drag: false,
3199
3218
  dragLimit: true,
@@ -3335,8 +3354,8 @@ var pops = (function () {
3335
3354
  iconIsLoading: false,
3336
3355
  text: "确定",
3337
3356
  type: "primary",
3338
- callback(event) {
3339
- event.close();
3357
+ callback(detail) {
3358
+ detail.close();
3340
3359
  },
3341
3360
  },
3342
3361
  cancel: {
@@ -3347,8 +3366,8 @@ var pops = (function () {
3347
3366
  iconIsLoading: false,
3348
3367
  text: "关闭",
3349
3368
  type: "default",
3350
- callback(event) {
3351
- event.close();
3369
+ callback(detail) {
3370
+ detail.close();
3352
3371
  },
3353
3372
  },
3354
3373
  other: {
@@ -3359,14 +3378,14 @@ var pops = (function () {
3359
3378
  iconIsLoading: false,
3360
3379
  text: "其它按钮",
3361
3380
  type: "default",
3362
- callback(event) {
3363
- event.close();
3381
+ callback(detail) {
3382
+ detail.close();
3364
3383
  },
3365
3384
  },
3366
3385
  close: {
3367
3386
  enable: true,
3368
- callback(event) {
3369
- event.close();
3387
+ callback(detail) {
3388
+ detail.close();
3370
3389
  },
3371
3390
  },
3372
3391
  },
@@ -3383,7 +3402,7 @@ var pops = (function () {
3383
3402
  toClose: false,
3384
3403
  toHide: false,
3385
3404
  },
3386
- clickCallBack: void 0,
3405
+ clickCallBack: null,
3387
3406
  },
3388
3407
  drag: false,
3389
3408
  dragLimit: true,
@@ -3531,9 +3550,8 @@ var pops = (function () {
3531
3550
  iconIsLoading: false,
3532
3551
  text: "确定",
3533
3552
  type: "success",
3534
- callback(event) {
3535
- console.log(event);
3536
- event.close();
3553
+ callback(detail) {
3554
+ detail.close();
3537
3555
  },
3538
3556
  },
3539
3557
  cancel: {
@@ -3544,9 +3562,8 @@ var pops = (function () {
3544
3562
  iconIsLoading: false,
3545
3563
  text: "关闭",
3546
3564
  type: "default",
3547
- callback(event) {
3548
- console.log(event);
3549
- event.close();
3565
+ callback(detail) {
3566
+ detail.close();
3550
3567
  },
3551
3568
  },
3552
3569
  other: {
@@ -3557,16 +3574,14 @@ var pops = (function () {
3557
3574
  iconIsLoading: false,
3558
3575
  text: "其它按钮",
3559
3576
  type: "default",
3560
- callback(event) {
3561
- console.log(event);
3562
- event.close();
3577
+ callback(detail) {
3578
+ detail.close();
3563
3579
  },
3564
3580
  },
3565
3581
  close: {
3566
3582
  enable: true,
3567
- callback(event) {
3568
- console.log(event);
3569
- event.close();
3583
+ callback(detail) {
3584
+ detail.close();
3570
3585
  },
3571
3586
  },
3572
3587
  },
@@ -3583,7 +3598,7 @@ var pops = (function () {
3583
3598
  toClose: false,
3584
3599
  toHide: false,
3585
3600
  },
3586
- clickCallBack: void 0,
3601
+ clickCallBack: null,
3587
3602
  },
3588
3603
  drag: false,
3589
3604
  dragLimit: true,
@@ -3730,7 +3745,7 @@ var pops = (function () {
3730
3745
  toClose: false,
3731
3746
  toHide: false,
3732
3747
  },
3733
- clickCallBack: void 0,
3748
+ clickCallBack: null,
3734
3749
  },
3735
3750
  animation: "pops-anim-fadein-zoom",
3736
3751
  forbiddenScroll: false,
@@ -3831,7 +3846,7 @@ var pops = (function () {
3831
3846
  toClose: false,
3832
3847
  toHide: false,
3833
3848
  },
3834
- clickCallBack: void 0,
3849
+ clickCallBack: null,
3835
3850
  },
3836
3851
  animation: "pops-anim-fadein-zoom",
3837
3852
  position: "center",
@@ -4114,12 +4129,17 @@ var pops = (function () {
4114
4129
  position: "center",
4115
4130
  text: "默认标题",
4116
4131
  html: false,
4132
+ style: "",
4117
4133
  },
4118
4134
  content: {
4119
4135
  text: "默认内容",
4120
4136
  html: false,
4137
+ style: "",
4121
4138
  },
4122
4139
  btn: {
4140
+ merge: false,
4141
+ mergeReverse: false,
4142
+ reverse: false,
4123
4143
  position: "flex-end",
4124
4144
  ok: {
4125
4145
  enable: true,
@@ -4129,8 +4149,8 @@ var pops = (function () {
4129
4149
  iconIsLoading: false,
4130
4150
  text: "确定",
4131
4151
  type: "primary",
4132
- callback(event) {
4133
- event.close();
4152
+ callback(detail) {
4153
+ detail.close();
4134
4154
  },
4135
4155
  },
4136
4156
  cancel: {
@@ -4141,8 +4161,8 @@ var pops = (function () {
4141
4161
  iconIsLoading: false,
4142
4162
  text: "关闭",
4143
4163
  type: "default",
4144
- callback(event) {
4145
- event.close();
4164
+ callback(detail) {
4165
+ detail.close();
4146
4166
  },
4147
4167
  },
4148
4168
  other: {
@@ -4153,14 +4173,14 @@ var pops = (function () {
4153
4173
  iconIsLoading: false,
4154
4174
  text: "其它按钮",
4155
4175
  type: "default",
4156
- callback(event) {
4157
- event.close();
4176
+ callback(detail) {
4177
+ detail.close();
4158
4178
  },
4159
4179
  },
4160
4180
  close: {
4161
4181
  enable: true,
4162
- callback(event) {
4163
- event.close();
4182
+ callback(detail) {
4183
+ detail.close();
4164
4184
  },
4165
4185
  },
4166
4186
  },
@@ -4170,7 +4190,7 @@ var pops = (function () {
4170
4190
  toClose: true,
4171
4191
  toHide: false,
4172
4192
  },
4173
- clickCallBack: void 0,
4193
+ clickCallBack: null,
4174
4194
  },
4175
4195
  class: "",
4176
4196
  zIndex: 10000,
@@ -4438,8 +4458,8 @@ var pops = (function () {
4438
4458
  iconIsLoading: false,
4439
4459
  text: "确定",
4440
4460
  type: "primary",
4441
- callback(event) {
4442
- event.close();
4461
+ callback(detail) {
4462
+ detail.close();
4443
4463
  },
4444
4464
  },
4445
4465
  cancel: {
@@ -4450,8 +4470,8 @@ var pops = (function () {
4450
4470
  iconIsLoading: false,
4451
4471
  text: "关闭",
4452
4472
  type: "default",
4453
- callback(event) {
4454
- event.close();
4473
+ callback(detail) {
4474
+ detail.close();
4455
4475
  },
4456
4476
  },
4457
4477
  other: {
@@ -4462,14 +4482,14 @@ var pops = (function () {
4462
4482
  iconIsLoading: false,
4463
4483
  text: "其它按钮",
4464
4484
  type: "default",
4465
- callback(event) {
4466
- event.close();
4485
+ callback(detail) {
4486
+ detail.close();
4467
4487
  },
4468
4488
  },
4469
4489
  close: {
4470
4490
  enable: true,
4471
- callback(event) {
4472
- event.close();
4491
+ callback(detail) {
4492
+ detail.close();
4473
4493
  },
4474
4494
  },
4475
4495
  },
@@ -4486,7 +4506,7 @@ var pops = (function () {
4486
4506
  toClose: false,
4487
4507
  toHide: false,
4488
4508
  },
4489
- clickCallBack: void 0,
4509
+ clickCallBack: null,
4490
4510
  },
4491
4511
  drag: false,
4492
4512
  dragLimit: true,
@@ -4596,6 +4616,7 @@ var pops = (function () {
4596
4616
  Folder_ICON[keyName] = Folder_ICON.apk;
4597
4617
  });
4598
4618
  if (details?.folder) {
4619
+ // @ts-ignore
4599
4620
  config.folder = details.folder;
4600
4621
  }
4601
4622
  let guid = popsUtils.getRandomGUID();
@@ -5337,6 +5358,9 @@ var pops = (function () {
5337
5358
  className: "panel-switch",
5338
5359
  text: "switch",
5339
5360
  type: "switch",
5361
+ // @ts-ignore
5362
+ props: {},
5363
+ disabled: false,
5340
5364
  attributes: [],
5341
5365
  getValue() {
5342
5366
  return true;
@@ -5349,6 +5373,8 @@ var pops = (function () {
5349
5373
  className: "panel-slider",
5350
5374
  text: "slider",
5351
5375
  type: "slider",
5376
+ // @ts-ignore
5377
+ props: {},
5352
5378
  attributes: [],
5353
5379
  getValue() {
5354
5380
  return 50;
@@ -5363,6 +5389,8 @@ var pops = (function () {
5363
5389
  className: "panel-button",
5364
5390
  text: "button",
5365
5391
  type: "button",
5392
+ // @ts-ignore
5393
+ props: {},
5366
5394
  attributes: [],
5367
5395
  buttonIcon: "eleme",
5368
5396
  buttonIconIsLoading: true,
@@ -5375,6 +5403,8 @@ var pops = (function () {
5375
5403
  {
5376
5404
  className: "panel-button",
5377
5405
  text: "button",
5406
+ // @ts-ignore
5407
+ props: {},
5378
5408
  type: "button",
5379
5409
  attributes: [],
5380
5410
  buttonIcon: "chromeFilled",
@@ -5390,6 +5420,8 @@ var pops = (function () {
5390
5420
  text: "button",
5391
5421
  type: "button",
5392
5422
  attributes: [],
5423
+ // @ts-ignore
5424
+ props: {},
5393
5425
  buttonIcon: "upload",
5394
5426
  buttonIconIsLoading: false,
5395
5427
  buttonType: "info",
@@ -5418,6 +5450,8 @@ var pops = (function () {
5418
5450
  className: "panel-input",
5419
5451
  text: "input",
5420
5452
  type: "input",
5453
+ // @ts-ignore
5454
+ props: {},
5421
5455
  attributes: [],
5422
5456
  getValue() {
5423
5457
  return "50";
@@ -5431,6 +5465,8 @@ var pops = (function () {
5431
5465
  className: "panel-input-password",
5432
5466
  text: "input-password",
5433
5467
  type: "input",
5468
+ // @ts-ignore
5469
+ props: {},
5434
5470
  attributes: [],
5435
5471
  getValue() {
5436
5472
  return "123456";
@@ -5445,6 +5481,8 @@ var pops = (function () {
5445
5481
  className: "panel-textarea",
5446
5482
  text: "textarea",
5447
5483
  type: "textarea",
5484
+ // @ts-ignore
5485
+ props: {},
5448
5486
  attributes: [],
5449
5487
  getValue() {
5450
5488
  return "50";
@@ -5458,6 +5496,8 @@ var pops = (function () {
5458
5496
  className: "panel-select",
5459
5497
  text: "select",
5460
5498
  type: "select",
5499
+ // @ts-ignore
5500
+ props: {},
5461
5501
  attributes: [],
5462
5502
  getValue() {
5463
5503
  return 50;
@@ -5469,14 +5509,23 @@ var pops = (function () {
5469
5509
  {
5470
5510
  value: "all",
5471
5511
  text: "所有",
5512
+ disable() {
5513
+ return false;
5514
+ },
5472
5515
  },
5473
5516
  {
5474
5517
  value: "text",
5475
5518
  text: "文本",
5519
+ disable() {
5520
+ return false;
5521
+ },
5476
5522
  },
5477
5523
  {
5478
5524
  value: "html",
5479
5525
  text: "超文本",
5526
+ disable() {
5527
+ return false;
5528
+ },
5480
5529
  },
5481
5530
  ],
5482
5531
  },
@@ -5484,6 +5533,8 @@ var pops = (function () {
5484
5533
  className: "panel-select-multiple",
5485
5534
  type: "select-multiple",
5486
5535
  text: "select-multiple",
5536
+ // @ts-ignore
5537
+ props: {},
5487
5538
  attributes: [],
5488
5539
  placeholder: "请至少选择一个选项",
5489
5540
  getValue() {
@@ -5502,22 +5553,42 @@ var pops = (function () {
5502
5553
  {
5503
5554
  value: "select-1",
5504
5555
  text: "单选1",
5556
+ isHTML: false,
5557
+ disable() {
5558
+ return false;
5559
+ },
5505
5560
  },
5506
5561
  {
5507
5562
  value: "select-2",
5508
5563
  text: "单选2",
5564
+ isHTML: false,
5565
+ disable() {
5566
+ return false;
5567
+ },
5509
5568
  },
5510
5569
  {
5511
5570
  value: "select-3",
5512
5571
  text: "单选3",
5572
+ isHTML: false,
5573
+ disable() {
5574
+ return false;
5575
+ },
5513
5576
  },
5514
5577
  {
5515
5578
  value: "select-4",
5516
5579
  text: "单选4",
5580
+ isHTML: false,
5581
+ disable() {
5582
+ return false;
5583
+ },
5517
5584
  },
5518
5585
  {
5519
5586
  value: "select-5",
5520
5587
  text: "单选5",
5588
+ isHTML: false,
5589
+ disable() {
5590
+ return false;
5591
+ },
5521
5592
  },
5522
5593
  ],
5523
5594
  },
@@ -5549,6 +5620,8 @@ var pops = (function () {
5549
5620
  className: "panel-switch",
5550
5621
  text: "switch",
5551
5622
  type: "switch",
5623
+ // @ts-ignore
5624
+ props: {},
5552
5625
  attributes: [],
5553
5626
  getValue() {
5554
5627
  return true;
@@ -5560,6 +5633,8 @@ var pops = (function () {
5560
5633
  {
5561
5634
  className: "panel-slider",
5562
5635
  text: "slider",
5636
+ // @ts-ignore
5637
+ props: {},
5563
5638
  type: "slider",
5564
5639
  attributes: [],
5565
5640
  getValue() {
@@ -5574,6 +5649,8 @@ var pops = (function () {
5574
5649
  {
5575
5650
  className: "panel-button",
5576
5651
  text: "button",
5652
+ // @ts-ignore
5653
+ props: {},
5577
5654
  type: "button",
5578
5655
  attributes: [],
5579
5656
  buttonIcon: "eleme",
@@ -5588,6 +5665,8 @@ var pops = (function () {
5588
5665
  className: "panel-button",
5589
5666
  text: "button",
5590
5667
  type: "button",
5668
+ // @ts-ignore
5669
+ props: {},
5591
5670
  attributes: [],
5592
5671
  buttonIcon: "chromeFilled",
5593
5672
  buttonIconIsLoading: true,
@@ -5600,6 +5679,8 @@ var pops = (function () {
5600
5679
  {
5601
5680
  className: "panel-button",
5602
5681
  text: "button",
5682
+ // @ts-ignore
5683
+ props: {},
5603
5684
  type: "button",
5604
5685
  attributes: [],
5605
5686
  buttonIcon: "upload",
@@ -5627,6 +5708,8 @@ var pops = (function () {
5627
5708
  {
5628
5709
  className: "panel-switch",
5629
5710
  text: "switch",
5711
+ // @ts-ignore
5712
+ props: {},
5630
5713
  type: "switch",
5631
5714
  attributes: [],
5632
5715
  getValue() {
@@ -5655,7 +5738,7 @@ var pops = (function () {
5655
5738
  toClose: false,
5656
5739
  toHide: false,
5657
5740
  },
5658
- clickCallBack: void 0,
5741
+ clickCallBack: null,
5659
5742
  },
5660
5743
  class: "",
5661
5744
  mobileClassName: "pops-panel-is-mobile",
@@ -8224,25 +8307,25 @@ var pops = (function () {
8224
8307
  /**
8225
8308
  * 已创建的元素列表
8226
8309
  */
8227
- let elementList = [$anim];
8310
+ let isCreatedElementList = [$anim];
8228
8311
  /* 遮罩层元素 */
8229
8312
  if (config.mask.enable) {
8230
- let _handleMask_ = PopsHandler.handleMask({
8313
+ let { maskElement } = PopsHandler.handleMask({
8231
8314
  type: PopsType,
8232
8315
  guid: guid,
8233
8316
  config: config,
8234
8317
  animElement: $anim,
8235
8318
  maskHTML: maskHTML,
8236
8319
  });
8237
- $mask = _handleMask_.maskElement;
8238
- elementList.push($mask);
8320
+ $mask = maskElement;
8321
+ isCreatedElementList.push($mask);
8239
8322
  }
8240
8323
  /* 处理返回的配置 */
8241
8324
  let eventDetails = PopsHandler.handleEventDetails(guid, $shadowContainer, $shadowRoot, PopsType, $anim, $pops, $mask, config);
8242
8325
  /* 为顶部右边的关闭按钮添加点击事件 */
8243
8326
  PopsHandler.handleClickEvent("close", $headerCloseBtn, eventDetails, config.btn.close.callback);
8244
8327
  /* 创建到页面中 */
8245
- popsDOMUtils.append($shadowRoot, elementList);
8328
+ popsDOMUtils.append($shadowRoot, isCreatedElementList);
8246
8329
  if (typeof config.beforeAppendToPageCallBack === "function") {
8247
8330
  config.beforeAppendToPageCallBack($shadowRoot, $shadowContainer);
8248
8331
  }
@@ -8294,6 +8377,7 @@ var pops = (function () {
8294
8377
  icon: pops.config.iconSVG.search,
8295
8378
  iconIsLoading: false,
8296
8379
  text: "搜索",
8380
+ item: [],
8297
8381
  callback(clickEvent, contextMenuEvent, liElement) {
8298
8382
  console.log("点击:" + this.text, [
8299
8383
  clickEvent,
@@ -8306,6 +8390,7 @@ var pops = (function () {
8306
8390
  icon: pops.config.iconSVG.documentCopy,
8307
8391
  iconIsLoading: false,
8308
8392
  text: "复制",
8393
+ item: [],
8309
8394
  callback(clickEvent, contextMenuEvent, liElement) {
8310
8395
  console.log("点击:" + this.text, [
8311
8396
  clickEvent,
@@ -8318,6 +8403,7 @@ var pops = (function () {
8318
8403
  icon: pops.config.iconSVG.delete,
8319
8404
  text: "删除",
8320
8405
  iconIsLoading: false,
8406
+ item: [],
8321
8407
  callback(clickEvent, contextMenuEvent, liElement) {
8322
8408
  console.log("点击:" + this.text, [
8323
8409
  clickEvent,
@@ -8330,6 +8416,7 @@ var pops = (function () {
8330
8416
  icon: pops.config.iconSVG.loading,
8331
8417
  iconIsLoading: true,
8332
8418
  text: "加载",
8419
+ item: [],
8333
8420
  callback(clickEvent, contextMenuEvent, liElement) {
8334
8421
  console.log("点击:" + this.text, [
8335
8422
  clickEvent,
@@ -8356,6 +8443,7 @@ var pops = (function () {
8356
8443
  icon: "",
8357
8444
  iconIsLoading: false,
8358
8445
  text: "处理文件",
8446
+ item: [],
8359
8447
  callback(clickEvent, contextMenuEvent, liElement) {
8360
8448
  console.log("点击:" + this.text, [
8361
8449
  clickEvent,
@@ -8380,6 +8468,7 @@ var pops = (function () {
8380
8468
  icon: pops.config.iconSVG.view,
8381
8469
  iconIsLoading: false,
8382
8470
  text: "查看",
8471
+ item: [],
8383
8472
  callback(clickEvent, contextMenuEvent, liElement) {
8384
8473
  console.log("点击:" + this.text, [
8385
8474
  clickEvent,
@@ -8419,6 +8508,7 @@ var pops = (function () {
8419
8508
  throw "config.target 不能为空";
8420
8509
  }
8421
8510
  if (details.data) {
8511
+ // @ts-ignore
8422
8512
  config.data = details.data;
8423
8513
  }
8424
8514
  let guid = popsUtils.getRandomGUID();
@@ -9427,8 +9517,8 @@ var pops = (function () {
9427
9517
  }
9428
9518
 
9429
9519
  const PopsTooltipConfig = () => {
9520
+ // @ts-ignore
9430
9521
  return {
9431
- // @ts-ignore
9432
9522
  target: null,
9433
9523
  content: "默认文字",
9434
9524
  position: "top",
@@ -9448,6 +9538,8 @@ var pops = (function () {
9448
9538
  showAfterCallBack() { },
9449
9539
  closeBeforeCallBack() { },
9450
9540
  closeAfterCallBack() { },
9541
+ delayCloseTime: 100,
9542
+ showArrow: true,
9451
9543
  arrowDistance: 12.5,
9452
9544
  otherDistance: 0,
9453
9545
  style: "",
@@ -9522,6 +9614,10 @@ var pops = (function () {
9522
9614
  });
9523
9615
  $toolTipContainer.appendChild(cssNode);
9524
9616
  }
9617
+ // 处理是否显示箭头元素
9618
+ if (!this.$data.config.showArrow) {
9619
+ $toolTipArrow.remove();
9620
+ }
9525
9621
  return {
9526
9622
  $toolTipContainer: $toolTipContainer,
9527
9623
  $toolTipArrow: $toolTipArrow,
@@ -9561,12 +9657,12 @@ var pops = (function () {
9561
9657
  this.$el.$toolTip.style.setProperty("z-index", zIndex.toString());
9562
9658
  }
9563
9659
  /**
9564
- * 获取 提示框的位置
9660
+ * 计算 提示框的位置
9565
9661
  * @param targetElement 目标元素
9566
9662
  * @param arrowDistance 箭头和目标元素的距离
9567
9663
  * @param otherDistance 其它位置的偏移
9568
9664
  */
9569
- getPosition(targetElement, arrowDistance, otherDistance) {
9665
+ calcToolTipPosition(targetElement, arrowDistance, otherDistance) {
9570
9666
  let offsetInfo = popsDOMUtils.offset(targetElement, !this.$data.config.isFixed);
9571
9667
  // 目标 宽
9572
9668
  let targetElement_width = offsetInfo.width;
@@ -9615,7 +9711,7 @@ var pops = (function () {
9615
9711
  * 动态修改tooltip的位置
9616
9712
  */
9617
9713
  changePosition() {
9618
- let positionInfo = this.getPosition(this.$data.config.target, this.$data.config.arrowDistance, this.$data.config.otherDistance);
9714
+ let positionInfo = this.calcToolTipPosition(this.$data.config.target, this.$data.config.arrowDistance, this.$data.config.otherDistance);
9619
9715
  let positionKey = this.$data.config.position.toUpperCase();
9620
9716
  let positionDetail = positionInfo[positionKey];
9621
9717
  if (positionDetail) {
@@ -9744,8 +9840,8 @@ var pops = (function () {
9744
9840
  // 其它的如Touch事件不做处理
9745
9841
  if (event && event instanceof MouseEvent) {
9746
9842
  let $target = event.composedPath()[0];
9747
- // 如果是子元素触发的话,忽视
9748
- if ($target != this.$data.config.target) {
9843
+ // 如果是目标元素的子元素/tooltip元素的子元素触发的话,那就不管
9844
+ if ($target != this.$data.config.target && $target != this.$el.$toolTip) {
9749
9845
  return;
9750
9846
  }
9751
9847
  }
@@ -9763,6 +9859,10 @@ var pops = (function () {
9763
9859
  let timeId = setTimeout(() => {
9764
9860
  // 设置属性触发关闭动画
9765
9861
  this.clearCloseTimeoutId(eventType, timeId);
9862
+ if (this.$el.$toolTip == null) {
9863
+ // 已清除了
9864
+ return;
9865
+ }
9766
9866
  this.$el.$toolTip.setAttribute("data-motion", this.$el.$toolTip
9767
9867
  .getAttribute("data-motion")
9768
9868
  .replace("fadeIn", "fadeOut"));
@@ -9828,7 +9928,10 @@ var pops = (function () {
9828
9928
  * 鼠标|触摸进入事件
9829
9929
  */
9830
9930
  toolTipMouseEnterEvent() {
9831
- this.$el.$toolTip.style.animationPlayState = "paused";
9931
+ this.clearCloseTimeoutId("MouseEvent");
9932
+ this.clearCloseTimeoutId("TouchEvent");
9933
+ // 重置动画状态
9934
+ // this.$el.$toolTip.style.animationPlayState = "paused";
9832
9935
  // if (parseInt(getComputedStyle(toolTipElement)) > 0.5) {
9833
9936
  // toolTipElement.style.animationPlayState = "paused";
9834
9937
  // }
@@ -9850,8 +9953,9 @@ var pops = (function () {
9850
9953
  /**
9851
9954
  * 鼠标|触摸离开事件
9852
9955
  */
9853
- toolTipMouseLeaveEvent() {
9854
- this.$el.$toolTip.style.animationPlayState = "running";
9956
+ toolTipMouseLeaveEvent(event) {
9957
+ this.close(event);
9958
+ // this.$el.$toolTip.style.animationPlayState = "running";
9855
9959
  }
9856
9960
  /**
9857
9961
  * 监听鼠标|触摸离开事件
@@ -9907,7 +10011,7 @@ var pops = (function () {
9907
10011
  /** 配置 */
9908
10012
  config = {
9909
10013
  /** 版本号 */
9910
- version: "2024.11.3",
10014
+ version: "2024.11.21",
9911
10015
  cssText: {
9912
10016
  /** 主CSS */
9913
10017
  index: indexCSS,