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