@whitesev/pops 1.9.0 → 1.9.2

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 (75) hide show
  1. package/dist/index.amd.js +288 -170
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +288 -170
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +288 -170
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +288 -170
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +288 -170
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +288 -170
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/GlobalConfig.d.ts +1 -0
  14. package/dist/types/src/Pops.d.ts +2 -0
  15. package/dist/types/src/components/alert/config.d.ts +1 -1
  16. package/dist/types/src/components/confirm/config.d.ts +1 -1
  17. package/dist/types/src/components/drawer/config.d.ts +1 -1
  18. package/dist/types/src/components/folder/config.d.ts +1 -1
  19. package/dist/types/src/components/iframe/config.d.ts +1 -1
  20. package/dist/types/src/components/loading/config.d.ts +1 -1
  21. package/dist/types/src/components/panel/config.d.ts +1 -1
  22. package/dist/types/src/components/prompt/config.d.ts +1 -1
  23. package/dist/types/src/components/rightClickMenu/config.d.ts +1 -1
  24. package/dist/types/src/components/rightClickMenu/indexType.d.ts +4 -21
  25. package/dist/types/src/components/searchSuggestion/config.d.ts +1 -1
  26. package/dist/types/src/components/searchSuggestion/indexType.d.ts +2 -10
  27. package/dist/types/src/components/tooltip/config.d.ts +1 -1
  28. package/dist/types/src/components/tooltip/index.d.ts +5 -5
  29. package/dist/types/src/components/tooltip/indexType.d.ts +28 -28
  30. package/dist/types/src/handler/PopsElementHandler.d.ts +1 -1
  31. package/dist/types/src/handler/PopsHandler.d.ts +7 -3
  32. package/dist/types/src/types/button.d.ts +13 -19
  33. package/dist/types/src/types/components.d.ts +26 -11
  34. package/dist/types/src/types/event.d.ts +1 -1
  35. package/dist/types/src/types/global.d.ts +9 -0
  36. package/dist/types/src/types/layer.d.ts +1 -1
  37. package/dist/types/src/types/mask.d.ts +14 -11
  38. package/dist/types/src/utils/PopsInstanceUtils.d.ts +2 -1
  39. package/package.json +1 -1
  40. package/src/Pops.ts +1 -1
  41. package/src/components/alert/config.ts +10 -9
  42. package/src/components/alert/index.ts +9 -9
  43. package/src/components/confirm/config.ts +18 -24
  44. package/src/components/confirm/index.ts +9 -9
  45. package/src/components/drawer/config.ts +22 -21
  46. package/src/components/drawer/index.ts +9 -9
  47. package/src/components/folder/config.ts +17 -16
  48. package/src/components/folder/index.ts +32 -24
  49. package/src/components/iframe/config.ts +3 -3
  50. package/src/components/iframe/index.ts +15 -11
  51. package/src/components/loading/config.ts +3 -3
  52. package/src/components/loading/index.ts +1 -1
  53. package/src/components/panel/config.ts +65 -2
  54. package/src/components/panel/index.ts +13 -11
  55. package/src/components/prompt/config.ts +17 -27
  56. package/src/components/prompt/index.ts +10 -8
  57. package/src/components/rightClickMenu/config.ts +117 -109
  58. package/src/components/rightClickMenu/index.ts +13 -12
  59. package/src/components/rightClickMenu/indexType.ts +13 -24
  60. package/src/components/searchSuggestion/config.ts +2 -1
  61. package/src/components/searchSuggestion/index.ts +11 -10
  62. package/src/components/searchSuggestion/indexType.ts +4 -10
  63. package/src/components/tooltip/config.ts +7 -5
  64. package/src/components/tooltip/index.ts +34 -21
  65. package/src/components/tooltip/indexType.ts +38 -35
  66. package/src/css/index.css +1 -1
  67. package/src/handler/PopsElementHandler.ts +2 -2
  68. package/src/handler/PopsHandler.ts +24 -20
  69. package/src/types/button.d.ts +13 -19
  70. package/src/types/components.d.ts +26 -11
  71. package/src/types/event.d.ts +1 -1
  72. package/src/types/global.d.ts +9 -0
  73. package/src/types/layer.d.ts +1 -1
  74. package/src/types/mask.d.ts +14 -11
  75. package/src/utils/PopsInstanceUtils.ts +8 -8
@@ -1746,10 +1746,9 @@ var pops = (function () {
1746
1746
  getPopsMaxZIndex(deviation = 1) {
1747
1747
  deviation = Number.isNaN(deviation) ? 1 : deviation;
1748
1748
  // 最大值 2147483647
1749
- // 最大值 2147483647
1750
- // const maxZIndex = Math.pow(2, 31) - 1;
1749
+ // const browserMaxZIndex = Math.pow(2, 31) - 1;
1751
1750
  // 比较值 2000000000
1752
- const maxZIndexCompare = 2 * Math.pow(10, 9);
1751
+ const maxZIndex = 2 * Math.pow(10, 9);
1753
1752
  // 当前页面最大的z-index
1754
1753
  let zIndex = 0;
1755
1754
  // 当前的最大z-index的元素,调试使用
@@ -1779,17 +1778,18 @@ var pops = (function () {
1779
1778
  }
1780
1779
  });
1781
1780
  zIndex += deviation;
1782
- if (zIndex >= maxZIndexCompare) {
1783
- // 最好不要超过最大值
1784
- zIndex = maxZIndexCompare;
1781
+ let isOverMaxZIndex = zIndex >= maxZIndex;
1782
+ if (isOverMaxZIndex) {
1783
+ // 超出z-index最大值
1784
+ zIndex = maxZIndex;
1785
1785
  }
1786
- return { zIndex: zIndex, animElement: maxZIndexNode };
1786
+ return { zIndex: zIndex, animElement: maxZIndexNode, isOverMaxZIndex };
1787
1787
  },
1788
1788
  /**
1789
1789
  * 获取页面中最大的z-index
1790
1790
  * @param deviation 获取最大的z-index值的偏移,默认是+1
1791
1791
  * @example
1792
- * Utils.getMaxZIndex();
1792
+ * getMaxZIndex();
1793
1793
  * > 1001
1794
1794
  **/
1795
1795
  getMaxZIndex(deviation = 1) {
@@ -2279,7 +2279,7 @@ var pops = (function () {
2279
2279
  },
2280
2280
  };
2281
2281
 
2282
- var indexCSS = "@charset \"utf-8\";\r\n* {\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\t-webkit-tap-highlight-color: transparent;\r\n\t/* 代替::-webkit-scrollbar */\r\n\tscrollbar-width: thin;\r\n}\r\n.pops {\r\n\t--pops-bg-opacity: 1;\r\n\t--pops-bd-opacity: 1;\r\n\t--pops-font-size: 16px;\r\n\tinterpolate-size: allow-keywords;\r\n}\r\n.pops-mask {\r\n\t--pops-mask-bg-opacity: 0.4;\r\n}\r\n.pops {\r\n\tbackground-color: rgb(255, 255, 255, var(--pops-bg-opacity));\r\n\tborder-radius: 4px;\r\n\tborder: 1px solid rgb(235, 238, 245, var(--pops-bd-opacity));\r\n\tfont-size: var(--pops-font-size);\r\n\tbox-shadow: 0 0 12px rgba(0, 0, 0, 0.12);\r\n\tbox-sizing: border-box;\r\n\toverflow: hidden;\r\n\ttransition: all 0.35s;\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n}\r\n.pops-anim {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n}\r\n.pops-anim[anim=\"\"] {\r\n\ttop: unset;\r\n\tright: unset;\r\n\tbottom: unset;\r\n\tleft: unset;\r\n\twidth: unset;\r\n\theight: unset;\r\n\ttransition: none;\r\n}\r\n/* 底部图标动画和样式 */\r\n.pops i.pops-bottom-icon[is-loading=\"true\"] {\r\n\tanimation: rotating 2s linear infinite;\r\n}\r\n.pops i.pops-bottom-icon {\r\n\theight: 1em;\r\n\twidth: 1em;\r\n\tline-height: normal;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n\tcolor: inherit;\r\n\tfont-size: inherit;\r\n}\r\n\r\n/* 遮罩层样式 */\r\n.pops-mask {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tborder: 0;\r\n\tborder-radius: 0;\r\n\tbackground-color: rgba(0, 0, 0, var(--pops-mask-bg-opacity));\r\n\tbox-shadow: none;\r\n\ttransition: none;\r\n}\r\n\r\n.pops-header-controls button.pops-header-control[type][data-header] {\r\n\tfloat: right;\r\n\tmargin: 0 0;\r\n\toutline: 0;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: #888;\r\n\tcursor: pointer;\r\n}\r\n.pops-header-controls button.pops-header-control[type=\"max\"],\r\n.pops-header-controls button.pops-header-control[type=\"mise\"],\r\n.pops-header-controls button.pops-header-control[type=\"min\"] {\r\n\toutline: 0 !important;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: rgb(136, 136, 136);\r\n\tcursor: pointer;\r\n\ttransition: all 0.3s ease-in-out;\r\n}\r\nbutton.pops-header-control i {\r\n\tcolor: rgb(144, 147, 153);\r\n\tfont-size: inherit;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n}\r\nbutton.pops-header-control svg {\r\n\theight: 1.25em;\r\n\twidth: 1.25em;\r\n}\r\nbutton.pops-header-control {\r\n\tright: 15px;\r\n\tpadding: 0;\r\n\tborder: none;\r\n\toutline: 0;\r\n\tbackground: 0 0;\r\n\tcursor: pointer;\r\n\tposition: unset;\r\n\tline-height: normal;\r\n}\r\nbutton.pops-header-control i:hover {\r\n\tcolor: rgb(64, 158, 255);\r\n}\r\n.pops-header-controls[data-margin] button.pops-header-control {\r\n\tmargin: 0 6px;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n}\r\n.pops[type-value] .pops-header-controls {\r\n\tdisplay: flex;\r\n\tgap: 6px;\r\n}\r\n\r\n/* 标题禁止选中文字 */\r\n.pops [class^=\"pops\"][class*=\"-title\"] p[pops] {\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n}\r\n";
2282
+ var indexCSS = "@charset \"utf-8\";\r\n.pops * {\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\t-webkit-tap-highlight-color: transparent;\r\n\t/* 代替::-webkit-scrollbar */\r\n\tscrollbar-width: thin;\r\n}\r\n.pops {\r\n\t--pops-bg-opacity: 1;\r\n\t--pops-bd-opacity: 1;\r\n\t--pops-font-size: 16px;\r\n\tinterpolate-size: allow-keywords;\r\n}\r\n.pops-mask {\r\n\t--pops-mask-bg-opacity: 0.4;\r\n}\r\n.pops {\r\n\tbackground-color: rgb(255, 255, 255, var(--pops-bg-opacity));\r\n\tborder-radius: 4px;\r\n\tborder: 1px solid rgb(235, 238, 245, var(--pops-bd-opacity));\r\n\tfont-size: var(--pops-font-size);\r\n\tbox-shadow: 0 0 12px rgba(0, 0, 0, 0.12);\r\n\tbox-sizing: border-box;\r\n\toverflow: hidden;\r\n\ttransition: all 0.35s;\r\n\tdisplay: flex;\r\n\tflex-direction: column;\r\n}\r\n.pops-anim {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n}\r\n.pops-anim[anim=\"\"] {\r\n\ttop: unset;\r\n\tright: unset;\r\n\tbottom: unset;\r\n\tleft: unset;\r\n\twidth: unset;\r\n\theight: unset;\r\n\ttransition: none;\r\n}\r\n/* 底部图标动画和样式 */\r\n.pops i.pops-bottom-icon[is-loading=\"true\"] {\r\n\tanimation: rotating 2s linear infinite;\r\n}\r\n.pops i.pops-bottom-icon {\r\n\theight: 1em;\r\n\twidth: 1em;\r\n\tline-height: normal;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n\tcolor: inherit;\r\n\tfont-size: inherit;\r\n}\r\n\r\n/* 遮罩层样式 */\r\n.pops-mask {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tborder: 0;\r\n\tborder-radius: 0;\r\n\tbackground-color: rgba(0, 0, 0, var(--pops-mask-bg-opacity));\r\n\tbox-shadow: none;\r\n\ttransition: none;\r\n}\r\n\r\n.pops-header-controls button.pops-header-control[type][data-header] {\r\n\tfloat: right;\r\n\tmargin: 0 0;\r\n\toutline: 0;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: #888;\r\n\tcursor: pointer;\r\n}\r\n.pops-header-controls button.pops-header-control[type=\"max\"],\r\n.pops-header-controls button.pops-header-control[type=\"mise\"],\r\n.pops-header-controls button.pops-header-control[type=\"min\"] {\r\n\toutline: 0 !important;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: rgb(136, 136, 136);\r\n\tcursor: pointer;\r\n\ttransition: all 0.3s ease-in-out;\r\n}\r\nbutton.pops-header-control i {\r\n\tcolor: rgb(144, 147, 153);\r\n\tfont-size: inherit;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n}\r\nbutton.pops-header-control svg {\r\n\theight: 1.25em;\r\n\twidth: 1.25em;\r\n}\r\nbutton.pops-header-control {\r\n\tright: 15px;\r\n\tpadding: 0;\r\n\tborder: none;\r\n\toutline: 0;\r\n\tbackground: 0 0;\r\n\tcursor: pointer;\r\n\tposition: unset;\r\n\tline-height: normal;\r\n}\r\nbutton.pops-header-control i:hover {\r\n\tcolor: rgb(64, 158, 255);\r\n}\r\n.pops-header-controls[data-margin] button.pops-header-control {\r\n\tmargin: 0 6px;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n}\r\n.pops[type-value] .pops-header-controls {\r\n\tdisplay: flex;\r\n\tgap: 6px;\r\n}\r\n\r\n/* 标题禁止选中文字 */\r\n.pops [class^=\"pops\"][class*=\"-title\"] p[pops] {\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n}\r\n";
2283
2283
 
2284
2284
  var ninePalaceGridPositionCSS = ".pops[position=\"top_left\"] {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tleft: 0;\r\n}\r\n.pops[position=\"top\"] {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tleft: 50%;\r\n\ttransform: translateX(-50%);\r\n}\r\n.pops[position=\"top_right\"] {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n}\r\n.pops[position=\"center_left\"] {\r\n\tposition: fixed;\r\n\ttop: 50%;\r\n\tleft: 0;\r\n\ttransform: translateY(-50%);\r\n}\r\n.pops[position=\"center\"] {\r\n\tposition: fixed;\r\n\ttop: 50%;\r\n\tleft: 50%;\r\n\ttransform: translate(-50%, -50%);\r\n}\r\n.pops[position=\"center_right\"] {\r\n\tposition: fixed;\r\n\ttop: 50%;\r\n\tright: 0;\r\n\ttransform: translateY(-50%);\r\n}\r\n.pops[position=\"bottom_left\"] {\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n}\r\n.pops[position=\"bottom\"] {\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tleft: 50%;\r\n\ttransform: translate(-50%, 0);\r\n}\r\n.pops[position=\"bottom_right\"] {\r\n\tposition: fixed;\r\n\tright: 0;\r\n\tbottom: 0;\r\n}\r\n";
2285
2285
 
@@ -2472,7 +2472,7 @@ var pops = (function () {
2472
2472
  <div
2473
2473
  class="pops-anim"
2474
2474
  anim="${__config.animation || ""}"
2475
- style="${popsAnimStyle};"
2475
+ style="${popsAnimStyle}"
2476
2476
  data-guid="${guid}">
2477
2477
  ${config.style != null
2478
2478
  ? `<style tyle="text/css">${config.style}</style>`
@@ -2743,14 +2743,22 @@ var pops = (function () {
2743
2743
  /**
2744
2744
  * 创建shadow
2745
2745
  */
2746
- handlerShadow() {
2746
+ handlerShadow(config) {
2747
2747
  let $shadowContainer = document.createElement("div");
2748
2748
  $shadowContainer.className = "pops-shadow-container";
2749
- let $shadowRoot = $shadowContainer.attachShadow({ mode: "open" });
2750
- return {
2751
- $shadowContainer,
2752
- $shadowRoot,
2753
- };
2749
+ if (config.useShadowRoot) {
2750
+ let $shadowRoot = $shadowContainer.attachShadow({ mode: "open" });
2751
+ return {
2752
+ $shadowContainer,
2753
+ $shadowRoot,
2754
+ };
2755
+ }
2756
+ else {
2757
+ return {
2758
+ $shadowContainer,
2759
+ $shadowRoot: $shadowContainer,
2760
+ };
2761
+ }
2754
2762
  },
2755
2763
  /**
2756
2764
  * 处理初始化
@@ -3147,17 +3155,11 @@ var pops = (function () {
3147
3155
  else {
3148
3156
  // 对配置进行处理
3149
3157
  // 选择配置的z-index和已有的pops实例的最大z-index值
3150
- if (typeof config.zIndex === "function") {
3151
- let originZIndexFn = config.zIndex;
3152
- config.zIndex = () => {
3153
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndexFn) + 100);
3154
- return maxZIndex;
3155
- };
3156
- }
3157
- else {
3158
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(config.zIndex) + 100);
3159
- config.zIndex = maxZIndex;
3160
- }
3158
+ let originZIndex = config.zIndex;
3159
+ config.zIndex = () => {
3160
+ const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndex) + 100);
3161
+ return maxZIndex;
3162
+ };
3161
3163
  }
3162
3164
  return config;
3163
3165
  },
@@ -3194,17 +3196,18 @@ var pops = (function () {
3194
3196
  iconIsLoading: false,
3195
3197
  text: "确定",
3196
3198
  type: "primary",
3197
- callback: function (event) {
3198
- event.close();
3199
+ callback: function (details) {
3200
+ details.close();
3199
3201
  },
3200
3202
  },
3201
3203
  close: {
3202
3204
  enable: true,
3203
- callback: function (event) {
3204
- event.close();
3205
+ callback: function (details) {
3206
+ details.close();
3205
3207
  },
3206
3208
  },
3207
3209
  },
3210
+ useShadowRoot: true,
3208
3211
  class: "",
3209
3212
  only: false,
3210
3213
  width: "350px",
@@ -3218,7 +3221,7 @@ var pops = (function () {
3218
3221
  toClose: false,
3219
3222
  toHide: false,
3220
3223
  },
3221
- clickCallBack: void 0,
3224
+ clickCallBack: null,
3222
3225
  },
3223
3226
  drag: false,
3224
3227
  dragLimit: true,
@@ -3233,7 +3236,14 @@ var pops = (function () {
3233
3236
 
3234
3237
  class PopsAlert {
3235
3238
  constructor(details) {
3236
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3239
+ const guid = popsUtils.getRandomGUID();
3240
+ // 设置当前类型
3241
+ const PopsType = "alert";
3242
+ let config = PopsAlertConfig();
3243
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3244
+ config = popsUtils.assign(config, details);
3245
+ config = PopsHandler.handleOnly(PopsType, config);
3246
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3237
3247
  PopsHandler.handleInit($shadowRoot, [
3238
3248
  pops.config.cssText.index,
3239
3249
  pops.config.cssText.ninePalaceGridPosition,
@@ -3243,13 +3253,6 @@ var pops = (function () {
3243
3253
  pops.config.cssText.common,
3244
3254
  pops.config.cssText.alertCSS,
3245
3255
  ]);
3246
- let config = PopsAlertConfig();
3247
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3248
- config = popsUtils.assign(config, details);
3249
- let guid = popsUtils.getRandomGUID();
3250
- // 设置当前类型
3251
- const PopsType = "alert";
3252
- config = PopsHandler.handleOnly(PopsType, config);
3253
3256
  // 先把z-index提取出来
3254
3257
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3255
3258
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3360,8 +3363,8 @@ var pops = (function () {
3360
3363
  iconIsLoading: false,
3361
3364
  text: "确定",
3362
3365
  type: "primary",
3363
- callback(event) {
3364
- event.close();
3366
+ callback(detail) {
3367
+ detail.close();
3365
3368
  },
3366
3369
  },
3367
3370
  cancel: {
@@ -3372,8 +3375,8 @@ var pops = (function () {
3372
3375
  iconIsLoading: false,
3373
3376
  text: "关闭",
3374
3377
  type: "default",
3375
- callback(event) {
3376
- event.close();
3378
+ callback(detail) {
3379
+ detail.close();
3377
3380
  },
3378
3381
  },
3379
3382
  other: {
@@ -3384,17 +3387,18 @@ var pops = (function () {
3384
3387
  iconIsLoading: false,
3385
3388
  text: "其它按钮",
3386
3389
  type: "default",
3387
- callback(event) {
3388
- event.close();
3390
+ callback(detail) {
3391
+ detail.close();
3389
3392
  },
3390
3393
  },
3391
3394
  close: {
3392
3395
  enable: true,
3393
- callback(event) {
3394
- event.close();
3396
+ callback(detail) {
3397
+ detail.close();
3395
3398
  },
3396
3399
  },
3397
3400
  },
3401
+ useShadowRoot: true,
3398
3402
  class: "",
3399
3403
  only: false,
3400
3404
  width: "350px",
@@ -3408,7 +3412,7 @@ var pops = (function () {
3408
3412
  toClose: false,
3409
3413
  toHide: false,
3410
3414
  },
3411
- clickCallBack: void 0,
3415
+ clickCallBack: null,
3412
3416
  },
3413
3417
  drag: false,
3414
3418
  dragLimit: true,
@@ -3423,7 +3427,14 @@ var pops = (function () {
3423
3427
 
3424
3428
  class PopsConfirm {
3425
3429
  constructor(details) {
3426
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3430
+ const guid = popsUtils.getRandomGUID();
3431
+ // 设置当前类型
3432
+ const PopsType = "confirm";
3433
+ let config = PopsConfirmConfig();
3434
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3435
+ config = popsUtils.assign(config, details);
3436
+ config = PopsHandler.handleOnly(PopsType, config);
3437
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3427
3438
  PopsHandler.handleInit($shadowRoot, [
3428
3439
  pops.config.cssText.index,
3429
3440
  pops.config.cssText.ninePalaceGridPosition,
@@ -3433,13 +3444,6 @@ var pops = (function () {
3433
3444
  pops.config.cssText.common,
3434
3445
  pops.config.cssText.confirmCSS,
3435
3446
  ]);
3436
- let config = PopsConfirmConfig();
3437
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3438
- config = popsUtils.assign(config, details);
3439
- let guid = popsUtils.getRandomGUID();
3440
- // 设置当前类型
3441
- const PopsType = "confirm";
3442
- config = PopsHandler.handleOnly(PopsType, config);
3443
3447
  // 先把z-index提取出来
3444
3448
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3445
3449
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3556,9 +3560,8 @@ var pops = (function () {
3556
3560
  iconIsLoading: false,
3557
3561
  text: "确定",
3558
3562
  type: "success",
3559
- callback(event) {
3560
- console.log(event);
3561
- event.close();
3563
+ callback(detail) {
3564
+ detail.close();
3562
3565
  },
3563
3566
  },
3564
3567
  cancel: {
@@ -3569,9 +3572,8 @@ var pops = (function () {
3569
3572
  iconIsLoading: false,
3570
3573
  text: "关闭",
3571
3574
  type: "default",
3572
- callback(event) {
3573
- console.log(event);
3574
- event.close();
3575
+ callback(detail) {
3576
+ detail.close();
3575
3577
  },
3576
3578
  },
3577
3579
  other: {
@@ -3582,19 +3584,18 @@ var pops = (function () {
3582
3584
  iconIsLoading: false,
3583
3585
  text: "其它按钮",
3584
3586
  type: "default",
3585
- callback(event) {
3586
- console.log(event);
3587
- event.close();
3587
+ callback(detail) {
3588
+ detail.close();
3588
3589
  },
3589
3590
  },
3590
3591
  close: {
3591
3592
  enable: true,
3592
- callback(event) {
3593
- console.log(event);
3594
- event.close();
3593
+ callback(detail) {
3594
+ detail.close();
3595
3595
  },
3596
3596
  },
3597
3597
  },
3598
+ useShadowRoot: true,
3598
3599
  class: "",
3599
3600
  only: false,
3600
3601
  width: "350px",
@@ -3608,7 +3609,7 @@ var pops = (function () {
3608
3609
  toClose: false,
3609
3610
  toHide: false,
3610
3611
  },
3611
- clickCallBack: void 0,
3612
+ clickCallBack: null,
3612
3613
  },
3613
3614
  drag: false,
3614
3615
  dragLimit: true,
@@ -3623,7 +3624,14 @@ var pops = (function () {
3623
3624
 
3624
3625
  class PopsPrompt {
3625
3626
  constructor(details) {
3626
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3627
+ const guid = popsUtils.getRandomGUID();
3628
+ // 设置当前类型
3629
+ const PopsType = "prompt";
3630
+ let config = PopsPromptConfig();
3631
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3632
+ config = popsUtils.assign(config, details);
3633
+ config = PopsHandler.handleOnly(PopsType, config);
3634
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3627
3635
  PopsHandler.handleInit($shadowRoot, [
3628
3636
  pops.config.cssText.index,
3629
3637
  pops.config.cssText.ninePalaceGridPosition,
@@ -3633,12 +3641,6 @@ var pops = (function () {
3633
3641
  pops.config.cssText.common,
3634
3642
  pops.config.cssText.promptCSS,
3635
3643
  ]);
3636
- let config = PopsPromptConfig();
3637
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3638
- config = popsUtils.assign(config, details);
3639
- let guid = popsUtils.getRandomGUID();
3640
- const PopsType = "prompt";
3641
- config = PopsHandler.handleOnly(PopsType, config);
3642
3644
  // 先把z-index提取出来
3643
3645
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3644
3646
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3746,6 +3748,7 @@ var pops = (function () {
3746
3748
  icon: "loading",
3747
3749
  style: "",
3748
3750
  },
3751
+ useShadowRoot: true,
3749
3752
  class: "",
3750
3753
  only: false,
3751
3754
  zIndex: 10000,
@@ -3755,7 +3758,7 @@ var pops = (function () {
3755
3758
  toClose: false,
3756
3759
  toHide: false,
3757
3760
  },
3758
- clickCallBack: void 0,
3761
+ clickCallBack: null,
3759
3762
  },
3760
3763
  animation: "pops-anim-fadein-zoom",
3761
3764
  forbiddenScroll: false,
@@ -3846,6 +3849,7 @@ var pops = (function () {
3846
3849
  icon: true,
3847
3850
  text: "",
3848
3851
  },
3852
+ useShadowRoot: true,
3849
3853
  class: "",
3850
3854
  url: window.location.href,
3851
3855
  only: false,
@@ -3856,7 +3860,7 @@ var pops = (function () {
3856
3860
  toClose: false,
3857
3861
  toHide: false,
3858
3862
  },
3859
- clickCallBack: void 0,
3863
+ clickCallBack: null,
3860
3864
  },
3861
3865
  animation: "pops-anim-fadein-zoom",
3862
3866
  position: "center",
@@ -3892,7 +3896,17 @@ var pops = (function () {
3892
3896
 
3893
3897
  class PopsIframe {
3894
3898
  constructor(details) {
3895
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3899
+ const guid = popsUtils.getRandomGUID();
3900
+ // 设置当前类型
3901
+ const PopsType = "iframe";
3902
+ let config = PopsIframeConfig();
3903
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3904
+ config = popsUtils.assign(config, details);
3905
+ if (config.url == null) {
3906
+ throw "config.url不能为空";
3907
+ }
3908
+ config = PopsHandler.handleOnly(PopsType, config);
3909
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3896
3910
  PopsHandler.handleInit($shadowRoot, [
3897
3911
  pops.config.cssText.index,
3898
3912
  pops.config.cssText.ninePalaceGridPosition,
@@ -3901,16 +3915,9 @@ var pops = (function () {
3901
3915
  pops.config.cssText.common,
3902
3916
  pops.config.cssText.iframeCSS,
3903
3917
  ]);
3904
- let config = PopsIframeConfig();
3905
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3906
- config = popsUtils.assign(config, details);
3907
- if (config.url == null) {
3908
- throw "config.url不能为空";
3909
- }
3910
- let guid = popsUtils.getRandomGUID();
3911
- const PopsType = "iframe";
3912
- config = PopsHandler.handleOnly(PopsType, config);
3913
- let maskExtraStyle = config.animation != null && config.animation != ""
3918
+ let maskExtraStyle =
3919
+ // @ts-ignore
3920
+ config.animation != null && config.animation != ""
3914
3921
  ? "position:absolute;"
3915
3922
  : "";
3916
3923
  // 先把z-index提取出来
@@ -4139,12 +4146,17 @@ var pops = (function () {
4139
4146
  position: "center",
4140
4147
  text: "默认标题",
4141
4148
  html: false,
4149
+ style: "",
4142
4150
  },
4143
4151
  content: {
4144
4152
  text: "默认内容",
4145
4153
  html: false,
4154
+ style: "",
4146
4155
  },
4147
4156
  btn: {
4157
+ merge: false,
4158
+ mergeReverse: false,
4159
+ reverse: false,
4148
4160
  position: "flex-end",
4149
4161
  ok: {
4150
4162
  enable: true,
@@ -4154,8 +4166,8 @@ var pops = (function () {
4154
4166
  iconIsLoading: false,
4155
4167
  text: "确定",
4156
4168
  type: "primary",
4157
- callback(event) {
4158
- event.close();
4169
+ callback(detail) {
4170
+ detail.close();
4159
4171
  },
4160
4172
  },
4161
4173
  cancel: {
@@ -4166,8 +4178,8 @@ var pops = (function () {
4166
4178
  iconIsLoading: false,
4167
4179
  text: "关闭",
4168
4180
  type: "default",
4169
- callback(event) {
4170
- event.close();
4181
+ callback(detail) {
4182
+ detail.close();
4171
4183
  },
4172
4184
  },
4173
4185
  other: {
@@ -4178,14 +4190,14 @@ var pops = (function () {
4178
4190
  iconIsLoading: false,
4179
4191
  text: "其它按钮",
4180
4192
  type: "default",
4181
- callback(event) {
4182
- event.close();
4193
+ callback(detail) {
4194
+ detail.close();
4183
4195
  },
4184
4196
  },
4185
4197
  close: {
4186
4198
  enable: true,
4187
- callback(event) {
4188
- event.close();
4199
+ callback(detail) {
4200
+ detail.close();
4189
4201
  },
4190
4202
  },
4191
4203
  },
@@ -4195,8 +4207,9 @@ var pops = (function () {
4195
4207
  toClose: true,
4196
4208
  toHide: false,
4197
4209
  },
4198
- clickCallBack: void 0,
4210
+ clickCallBack: null,
4199
4211
  },
4212
+ useShadowRoot: true,
4200
4213
  class: "",
4201
4214
  zIndex: 10000,
4202
4215
  only: false,
@@ -4215,7 +4228,14 @@ var pops = (function () {
4215
4228
 
4216
4229
  class PopsDrawer {
4217
4230
  constructor(details) {
4218
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
4231
+ const guid = popsUtils.getRandomGUID();
4232
+ // 设置当前类型
4233
+ const PopsType = "drawer";
4234
+ let config = PopsDrawerConfig();
4235
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4236
+ config = popsUtils.assign(config, details);
4237
+ config = PopsHandler.handleOnly(PopsType, config);
4238
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
4219
4239
  PopsHandler.handleInit($shadowRoot, [
4220
4240
  pops.config.cssText.index,
4221
4241
  pops.config.cssText.ninePalaceGridPosition,
@@ -4225,12 +4245,6 @@ var pops = (function () {
4225
4245
  pops.config.cssText.common,
4226
4246
  pops.config.cssText.drawerCSS,
4227
4247
  ]);
4228
- let config = PopsDrawerConfig();
4229
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4230
- config = popsUtils.assign(config, details);
4231
- let guid = popsUtils.getRandomGUID();
4232
- const PopsType = "drawer";
4233
- config = PopsHandler.handleOnly(PopsType, config);
4234
4248
  // 先把z-index提取出来
4235
4249
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
4236
4250
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -4463,8 +4477,8 @@ var pops = (function () {
4463
4477
  iconIsLoading: false,
4464
4478
  text: "确定",
4465
4479
  type: "primary",
4466
- callback(event) {
4467
- event.close();
4480
+ callback(detail) {
4481
+ detail.close();
4468
4482
  },
4469
4483
  },
4470
4484
  cancel: {
@@ -4475,8 +4489,8 @@ var pops = (function () {
4475
4489
  iconIsLoading: false,
4476
4490
  text: "关闭",
4477
4491
  type: "default",
4478
- callback(event) {
4479
- event.close();
4492
+ callback(detail) {
4493
+ detail.close();
4480
4494
  },
4481
4495
  },
4482
4496
  other: {
@@ -4487,17 +4501,18 @@ var pops = (function () {
4487
4501
  iconIsLoading: false,
4488
4502
  text: "其它按钮",
4489
4503
  type: "default",
4490
- callback(event) {
4491
- event.close();
4504
+ callback(detail) {
4505
+ detail.close();
4492
4506
  },
4493
4507
  },
4494
4508
  close: {
4495
4509
  enable: true,
4496
- callback(event) {
4497
- event.close();
4510
+ callback(detail) {
4511
+ detail.close();
4498
4512
  },
4499
4513
  },
4500
4514
  },
4515
+ useShadowRoot: true,
4501
4516
  class: "",
4502
4517
  only: false,
4503
4518
  width: "500px",
@@ -4511,7 +4526,7 @@ var pops = (function () {
4511
4526
  toClose: false,
4512
4527
  toHide: false,
4513
4528
  },
4514
- clickCallBack: void 0,
4529
+ clickCallBack: null,
4515
4530
  },
4516
4531
  drag: false,
4517
4532
  dragLimit: true,
@@ -4554,7 +4569,14 @@ var pops = (function () {
4554
4569
 
4555
4570
  class PopsFolder {
4556
4571
  constructor(details) {
4557
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
4572
+ const guid = popsUtils.getRandomGUID();
4573
+ // 设置当前类型
4574
+ const PopsType = "folder";
4575
+ let config = PopsFolderConfig();
4576
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4577
+ config = popsUtils.assign(config, details);
4578
+ config = PopsHandler.handleOnly(PopsType, config);
4579
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
4558
4580
  PopsHandler.handleInit($shadowRoot, [
4559
4581
  pops.config.cssText.index,
4560
4582
  pops.config.cssText.ninePalaceGridPosition,
@@ -4564,15 +4586,18 @@ var pops = (function () {
4564
4586
  pops.config.cssText.common,
4565
4587
  pops.config.cssText.folderCSS,
4566
4588
  ]);
4567
- let config = PopsFolderConfig();
4568
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4569
- config = popsUtils.assign(config, details);
4570
4589
  /* 办公几件套 */
4590
+ // @ts-ignore
4571
4591
  Folder_ICON.docx = Folder_ICON.doc;
4592
+ // @ts-ignore;
4572
4593
  Folder_ICON.rtf = Folder_ICON.doc;
4594
+ // @ts-ignore
4573
4595
  Folder_ICON.xlsx = Folder_ICON.xls;
4596
+ // @ts-ignore
4574
4597
  Folder_ICON.pptx = Folder_ICON.ppt;
4598
+ // @ts-ignore;
4575
4599
  Folder_ICON.dmg = Folder_ICON.ipa;
4600
+ // @ts-ignore
4576
4601
  Folder_ICON.json = Folder_ICON.js;
4577
4602
  /* 压缩包 */
4578
4603
  let zipIconList = [
@@ -4609,23 +4634,25 @@ var pops = (function () {
4609
4634
  /* Android安装包 */
4610
4635
  let androidIconList = ["apk", "apkm", "xapk"];
4611
4636
  zipIconList.forEach((keyName) => {
4637
+ // @ts-ignore
4612
4638
  Folder_ICON[keyName] = Folder_ICON.zip;
4613
4639
  });
4614
4640
  imageIconList.forEach((keyName) => {
4641
+ // @ts-ignore
4615
4642
  Folder_ICON[keyName] = Folder_ICON.png;
4616
4643
  });
4617
4644
  codeLanguageIconList.forEach((keyName) => {
4645
+ // @ts-ignore
4618
4646
  Folder_ICON[keyName] = Folder_ICON.html;
4619
4647
  });
4620
4648
  androidIconList.forEach((keyName) => {
4649
+ // @ts-ignore
4621
4650
  Folder_ICON[keyName] = Folder_ICON.apk;
4622
4651
  });
4623
4652
  if (details?.folder) {
4653
+ // @ts-ignore
4624
4654
  config.folder = details.folder;
4625
4655
  }
4626
- let guid = popsUtils.getRandomGUID();
4627
- const PopsType = "folder";
4628
- config = PopsHandler.handleOnly(PopsType, config);
4629
4656
  // 先把z-index提取出来
4630
4657
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
4631
4658
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -5362,6 +5389,9 @@ var pops = (function () {
5362
5389
  className: "panel-switch",
5363
5390
  text: "switch",
5364
5391
  type: "switch",
5392
+ // @ts-ignore
5393
+ props: {},
5394
+ disabled: false,
5365
5395
  attributes: [],
5366
5396
  getValue() {
5367
5397
  return true;
@@ -5374,6 +5404,8 @@ var pops = (function () {
5374
5404
  className: "panel-slider",
5375
5405
  text: "slider",
5376
5406
  type: "slider",
5407
+ // @ts-ignore
5408
+ props: {},
5377
5409
  attributes: [],
5378
5410
  getValue() {
5379
5411
  return 50;
@@ -5388,6 +5420,8 @@ var pops = (function () {
5388
5420
  className: "panel-button",
5389
5421
  text: "button",
5390
5422
  type: "button",
5423
+ // @ts-ignore
5424
+ props: {},
5391
5425
  attributes: [],
5392
5426
  buttonIcon: "eleme",
5393
5427
  buttonIconIsLoading: true,
@@ -5400,6 +5434,8 @@ var pops = (function () {
5400
5434
  {
5401
5435
  className: "panel-button",
5402
5436
  text: "button",
5437
+ // @ts-ignore
5438
+ props: {},
5403
5439
  type: "button",
5404
5440
  attributes: [],
5405
5441
  buttonIcon: "chromeFilled",
@@ -5415,6 +5451,8 @@ var pops = (function () {
5415
5451
  text: "button",
5416
5452
  type: "button",
5417
5453
  attributes: [],
5454
+ // @ts-ignore
5455
+ props: {},
5418
5456
  buttonIcon: "upload",
5419
5457
  buttonIconIsLoading: false,
5420
5458
  buttonType: "info",
@@ -5443,6 +5481,8 @@ var pops = (function () {
5443
5481
  className: "panel-input",
5444
5482
  text: "input",
5445
5483
  type: "input",
5484
+ // @ts-ignore
5485
+ props: {},
5446
5486
  attributes: [],
5447
5487
  getValue() {
5448
5488
  return "50";
@@ -5456,6 +5496,8 @@ var pops = (function () {
5456
5496
  className: "panel-input-password",
5457
5497
  text: "input-password",
5458
5498
  type: "input",
5499
+ // @ts-ignore
5500
+ props: {},
5459
5501
  attributes: [],
5460
5502
  getValue() {
5461
5503
  return "123456";
@@ -5470,6 +5512,8 @@ var pops = (function () {
5470
5512
  className: "panel-textarea",
5471
5513
  text: "textarea",
5472
5514
  type: "textarea",
5515
+ // @ts-ignore
5516
+ props: {},
5473
5517
  attributes: [],
5474
5518
  getValue() {
5475
5519
  return "50";
@@ -5483,6 +5527,8 @@ var pops = (function () {
5483
5527
  className: "panel-select",
5484
5528
  text: "select",
5485
5529
  type: "select",
5530
+ // @ts-ignore
5531
+ props: {},
5486
5532
  attributes: [],
5487
5533
  getValue() {
5488
5534
  return 50;
@@ -5494,14 +5540,23 @@ var pops = (function () {
5494
5540
  {
5495
5541
  value: "all",
5496
5542
  text: "所有",
5543
+ disable() {
5544
+ return false;
5545
+ },
5497
5546
  },
5498
5547
  {
5499
5548
  value: "text",
5500
5549
  text: "文本",
5550
+ disable() {
5551
+ return false;
5552
+ },
5501
5553
  },
5502
5554
  {
5503
5555
  value: "html",
5504
5556
  text: "超文本",
5557
+ disable() {
5558
+ return false;
5559
+ },
5505
5560
  },
5506
5561
  ],
5507
5562
  },
@@ -5509,6 +5564,8 @@ var pops = (function () {
5509
5564
  className: "panel-select-multiple",
5510
5565
  type: "select-multiple",
5511
5566
  text: "select-multiple",
5567
+ // @ts-ignore
5568
+ props: {},
5512
5569
  attributes: [],
5513
5570
  placeholder: "请至少选择一个选项",
5514
5571
  getValue() {
@@ -5527,22 +5584,42 @@ var pops = (function () {
5527
5584
  {
5528
5585
  value: "select-1",
5529
5586
  text: "单选1",
5587
+ isHTML: false,
5588
+ disable() {
5589
+ return false;
5590
+ },
5530
5591
  },
5531
5592
  {
5532
5593
  value: "select-2",
5533
5594
  text: "单选2",
5595
+ isHTML: false,
5596
+ disable() {
5597
+ return false;
5598
+ },
5534
5599
  },
5535
5600
  {
5536
5601
  value: "select-3",
5537
5602
  text: "单选3",
5603
+ isHTML: false,
5604
+ disable() {
5605
+ return false;
5606
+ },
5538
5607
  },
5539
5608
  {
5540
5609
  value: "select-4",
5541
5610
  text: "单选4",
5611
+ isHTML: false,
5612
+ disable() {
5613
+ return false;
5614
+ },
5542
5615
  },
5543
5616
  {
5544
5617
  value: "select-5",
5545
5618
  text: "单选5",
5619
+ isHTML: false,
5620
+ disable() {
5621
+ return false;
5622
+ },
5546
5623
  },
5547
5624
  ],
5548
5625
  },
@@ -5574,6 +5651,8 @@ var pops = (function () {
5574
5651
  className: "panel-switch",
5575
5652
  text: "switch",
5576
5653
  type: "switch",
5654
+ // @ts-ignore
5655
+ props: {},
5577
5656
  attributes: [],
5578
5657
  getValue() {
5579
5658
  return true;
@@ -5585,6 +5664,8 @@ var pops = (function () {
5585
5664
  {
5586
5665
  className: "panel-slider",
5587
5666
  text: "slider",
5667
+ // @ts-ignore
5668
+ props: {},
5588
5669
  type: "slider",
5589
5670
  attributes: [],
5590
5671
  getValue() {
@@ -5599,6 +5680,8 @@ var pops = (function () {
5599
5680
  {
5600
5681
  className: "panel-button",
5601
5682
  text: "button",
5683
+ // @ts-ignore
5684
+ props: {},
5602
5685
  type: "button",
5603
5686
  attributes: [],
5604
5687
  buttonIcon: "eleme",
@@ -5613,6 +5696,8 @@ var pops = (function () {
5613
5696
  className: "panel-button",
5614
5697
  text: "button",
5615
5698
  type: "button",
5699
+ // @ts-ignore
5700
+ props: {},
5616
5701
  attributes: [],
5617
5702
  buttonIcon: "chromeFilled",
5618
5703
  buttonIconIsLoading: true,
@@ -5625,6 +5710,8 @@ var pops = (function () {
5625
5710
  {
5626
5711
  className: "panel-button",
5627
5712
  text: "button",
5713
+ // @ts-ignore
5714
+ props: {},
5628
5715
  type: "button",
5629
5716
  attributes: [],
5630
5717
  buttonIcon: "upload",
@@ -5652,6 +5739,8 @@ var pops = (function () {
5652
5739
  {
5653
5740
  className: "panel-switch",
5654
5741
  text: "switch",
5742
+ // @ts-ignore
5743
+ props: {},
5655
5744
  type: "switch",
5656
5745
  attributes: [],
5657
5746
  getValue() {
@@ -5680,8 +5769,9 @@ var pops = (function () {
5680
5769
  toClose: false,
5681
5770
  toHide: false,
5682
5771
  },
5683
- clickCallBack: void 0,
5772
+ clickCallBack: null,
5684
5773
  },
5774
+ useShadowRoot: true,
5685
5775
  class: "",
5686
5776
  mobileClassName: "pops-panel-is-mobile",
5687
5777
  isMobile: false,
@@ -8189,7 +8279,17 @@ var pops = (function () {
8189
8279
 
8190
8280
  class PopsPanel {
8191
8281
  constructor(details) {
8192
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8282
+ const guid = popsUtils.getRandomGUID();
8283
+ // 设置当前类型
8284
+ const PopsType = "panel";
8285
+ let config = PopsPanelConfig();
8286
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8287
+ config = popsUtils.assign(config, details);
8288
+ if (details && Array.isArray(details.content)) {
8289
+ config.content = details.content;
8290
+ }
8291
+ config = PopsHandler.handleOnly(PopsType, config);
8292
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
8193
8293
  PopsHandler.handleInit($shadowRoot, [
8194
8294
  pops.config.cssText.index,
8195
8295
  pops.config.cssText.ninePalaceGridPosition,
@@ -8199,15 +8299,6 @@ var pops = (function () {
8199
8299
  pops.config.cssText.common,
8200
8300
  pops.config.cssText.panelCSS,
8201
8301
  ]);
8202
- let config = PopsPanelConfig();
8203
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8204
- config = popsUtils.assign(config, details);
8205
- if (details && Array.isArray(details.content)) {
8206
- config.content = details.content;
8207
- }
8208
- let guid = popsUtils.getRandomGUID();
8209
- const PopsType = "panel";
8210
- config = PopsHandler.handleOnly(PopsType, config);
8211
8302
  // 先把z-index提取出来
8212
8303
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
8213
8304
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -8319,6 +8410,7 @@ var pops = (function () {
8319
8410
  icon: pops.config.iconSVG.search,
8320
8411
  iconIsLoading: false,
8321
8412
  text: "搜索",
8413
+ item: [],
8322
8414
  callback(clickEvent, contextMenuEvent, liElement) {
8323
8415
  console.log("点击:" + this.text, [
8324
8416
  clickEvent,
@@ -8331,6 +8423,7 @@ var pops = (function () {
8331
8423
  icon: pops.config.iconSVG.documentCopy,
8332
8424
  iconIsLoading: false,
8333
8425
  text: "复制",
8426
+ item: [],
8334
8427
  callback(clickEvent, contextMenuEvent, liElement) {
8335
8428
  console.log("点击:" + this.text, [
8336
8429
  clickEvent,
@@ -8343,6 +8436,7 @@ var pops = (function () {
8343
8436
  icon: pops.config.iconSVG.delete,
8344
8437
  text: "删除",
8345
8438
  iconIsLoading: false,
8439
+ item: [],
8346
8440
  callback(clickEvent, contextMenuEvent, liElement) {
8347
8441
  console.log("点击:" + this.text, [
8348
8442
  clickEvent,
@@ -8355,6 +8449,7 @@ var pops = (function () {
8355
8449
  icon: pops.config.iconSVG.loading,
8356
8450
  iconIsLoading: true,
8357
8451
  text: "加载",
8452
+ item: [],
8358
8453
  callback(clickEvent, contextMenuEvent, liElement) {
8359
8454
  console.log("点击:" + this.text, [
8360
8455
  clickEvent,
@@ -8381,6 +8476,7 @@ var pops = (function () {
8381
8476
  icon: "",
8382
8477
  iconIsLoading: false,
8383
8478
  text: "处理文件",
8479
+ item: [],
8384
8480
  callback(clickEvent, contextMenuEvent, liElement) {
8385
8481
  console.log("点击:" + this.text, [
8386
8482
  clickEvent,
@@ -8405,6 +8501,7 @@ var pops = (function () {
8405
8501
  icon: pops.config.iconSVG.view,
8406
8502
  iconIsLoading: false,
8407
8503
  text: "查看",
8504
+ item: [],
8408
8505
  callback(clickEvent, contextMenuEvent, liElement) {
8409
8506
  console.log("点击:" + this.text, [
8410
8507
  clickEvent,
@@ -8418,6 +8515,7 @@ var pops = (function () {
8418
8515
  ],
8419
8516
  },
8420
8517
  ],
8518
+ useShadowRoot: true,
8421
8519
  className: "",
8422
8520
  isAnimation: true,
8423
8521
  only: false,
@@ -8430,25 +8528,27 @@ var pops = (function () {
8430
8528
 
8431
8529
  class PopsRightClickMenu {
8432
8530
  constructor(details) {
8433
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8434
- PopsHandler.handleInit($shadowRoot, [
8435
- pops.config.cssText.index,
8436
- pops.config.cssText.anim,
8437
- pops.config.cssText.common,
8438
- pops.config.cssText.rightClickMenu,
8439
- ]);
8531
+ const guid = popsUtils.getRandomGUID();
8532
+ // 设置当前类型
8533
+ const PopsType = "rightClickMenu";
8440
8534
  let config = rightClickMenuConfig();
8441
8535
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8442
8536
  config = popsUtils.assign(config, details);
8537
+ config = PopsHandler.handleOnly(PopsType, config);
8443
8538
  if (config.target == null) {
8444
8539
  throw "config.target 不能为空";
8445
8540
  }
8446
8541
  if (details.data) {
8542
+ // @ts-ignore
8447
8543
  config.data = details.data;
8448
8544
  }
8449
- let guid = popsUtils.getRandomGUID();
8450
- const PopsType = "rightClickMenu";
8451
- config = PopsHandler.handleOnly(PopsType, config);
8545
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
8546
+ PopsHandler.handleInit($shadowRoot, [
8547
+ pops.config.cssText.index,
8548
+ pops.config.cssText.anim,
8549
+ pops.config.cssText.common,
8550
+ pops.config.cssText.rightClickMenu,
8551
+ ]);
8452
8552
  if (config.style != null) {
8453
8553
  let cssNode = document.createElement("style");
8454
8554
  cssNode.setAttribute("type", "text/css");
@@ -8875,6 +8975,7 @@ var pops = (function () {
8875
8975
  liElement.remove();
8876
8976
  },
8877
8977
  },
8978
+ useShadowRoot: true,
8878
8979
  className: "",
8879
8980
  isAbsolute: true,
8880
8981
  isAnimation: true,
@@ -8909,12 +9010,9 @@ var pops = (function () {
8909
9010
 
8910
9011
  class PopsSearchSuggestion {
8911
9012
  constructor(details) {
8912
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8913
- PopsHandler.handleInit($shadowRoot, [
8914
- pops.config.cssText.index,
8915
- pops.config.cssText.anim,
8916
- pops.config.cssText.common,
8917
- ]);
9013
+ const guid = popsUtils.getRandomGUID();
9014
+ // 设置当前类型
9015
+ const PopsType = "searchSuggestion";
8918
9016
  let config = searchSuggestionConfig();
8919
9017
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8920
9018
  config = popsUtils.assign(config, details);
@@ -8928,8 +9026,12 @@ var pops = (function () {
8928
9026
  if (details.data) {
8929
9027
  config.data = details.data;
8930
9028
  }
8931
- const guid = popsUtils.getRandomGUID();
8932
- const PopsType = "searchSuggestion";
9029
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
9030
+ PopsHandler.handleInit($shadowRoot, [
9031
+ pops.config.cssText.index,
9032
+ pops.config.cssText.anim,
9033
+ pops.config.cssText.common,
9034
+ ]);
8933
9035
  if (config.style != null) {
8934
9036
  let cssNode = document.createElement("style");
8935
9037
  cssNode.setAttribute("type", "text/css");
@@ -9452,8 +9554,9 @@ var pops = (function () {
9452
9554
  }
9453
9555
 
9454
9556
  const PopsTooltipConfig = () => {
9557
+ // @ts-ignore
9455
9558
  return {
9456
- // @ts-ignore
9559
+ useShadowRoot: true,
9457
9560
  target: null,
9458
9561
  content: "默认文字",
9459
9562
  position: "top",
@@ -9473,6 +9576,8 @@ var pops = (function () {
9473
9576
  showAfterCallBack() { },
9474
9577
  closeBeforeCallBack() { },
9475
9578
  closeAfterCallBack() { },
9579
+ delayCloseTime: 100,
9580
+ showArrow: true,
9476
9581
  arrowDistance: 12.5,
9477
9582
  otherDistance: 0,
9478
9583
  style: "",
@@ -9547,6 +9652,10 @@ var pops = (function () {
9547
9652
  });
9548
9653
  $toolTipContainer.appendChild(cssNode);
9549
9654
  }
9655
+ // 处理是否显示箭头元素
9656
+ if (!this.$data.config.showArrow) {
9657
+ $toolTipArrow.remove();
9658
+ }
9550
9659
  return {
9551
9660
  $toolTipContainer: $toolTipContainer,
9552
9661
  $toolTipArrow: $toolTipArrow,
@@ -9586,12 +9695,12 @@ var pops = (function () {
9586
9695
  this.$el.$toolTip.style.setProperty("z-index", zIndex.toString());
9587
9696
  }
9588
9697
  /**
9589
- * 获取 提示框的位置
9698
+ * 计算 提示框的位置
9590
9699
  * @param targetElement 目标元素
9591
9700
  * @param arrowDistance 箭头和目标元素的距离
9592
9701
  * @param otherDistance 其它位置的偏移
9593
9702
  */
9594
- getPosition(targetElement, arrowDistance, otherDistance) {
9703
+ calcToolTipPosition(targetElement, arrowDistance, otherDistance) {
9595
9704
  let offsetInfo = popsDOMUtils.offset(targetElement, !this.$data.config.isFixed);
9596
9705
  // 目标 宽
9597
9706
  let targetElement_width = offsetInfo.width;
@@ -9640,7 +9749,7 @@ var pops = (function () {
9640
9749
  * 动态修改tooltip的位置
9641
9750
  */
9642
9751
  changePosition() {
9643
- let positionInfo = this.getPosition(this.$data.config.target, this.$data.config.arrowDistance, this.$data.config.otherDistance);
9752
+ let positionInfo = this.calcToolTipPosition(this.$data.config.target, this.$data.config.arrowDistance, this.$data.config.otherDistance);
9644
9753
  let positionKey = this.$data.config.position.toUpperCase();
9645
9754
  let positionDetail = positionInfo[positionKey];
9646
9755
  if (positionDetail) {
@@ -9769,8 +9878,8 @@ var pops = (function () {
9769
9878
  // 其它的如Touch事件不做处理
9770
9879
  if (event && event instanceof MouseEvent) {
9771
9880
  let $target = event.composedPath()[0];
9772
- // 如果是子元素触发的话,忽视
9773
- if ($target != this.$data.config.target) {
9881
+ // 如果是目标元素的子元素/tooltip元素的子元素触发的话,那就不管
9882
+ if ($target != this.$data.config.target && $target != this.$el.$toolTip) {
9774
9883
  return;
9775
9884
  }
9776
9885
  }
@@ -9788,6 +9897,10 @@ var pops = (function () {
9788
9897
  let timeId = setTimeout(() => {
9789
9898
  // 设置属性触发关闭动画
9790
9899
  this.clearCloseTimeoutId(eventType, timeId);
9900
+ if (this.$el.$toolTip == null) {
9901
+ // 已清除了
9902
+ return;
9903
+ }
9791
9904
  this.$el.$toolTip.setAttribute("data-motion", this.$el.$toolTip
9792
9905
  .getAttribute("data-motion")
9793
9906
  .replace("fadeIn", "fadeOut"));
@@ -9853,7 +9966,10 @@ var pops = (function () {
9853
9966
  * 鼠标|触摸进入事件
9854
9967
  */
9855
9968
  toolTipMouseEnterEvent() {
9856
- this.$el.$toolTip.style.animationPlayState = "paused";
9969
+ this.clearCloseTimeoutId("MouseEvent");
9970
+ this.clearCloseTimeoutId("TouchEvent");
9971
+ // 重置动画状态
9972
+ // this.$el.$toolTip.style.animationPlayState = "paused";
9857
9973
  // if (parseInt(getComputedStyle(toolTipElement)) > 0.5) {
9858
9974
  // toolTipElement.style.animationPlayState = "paused";
9859
9975
  // }
@@ -9875,8 +9991,9 @@ var pops = (function () {
9875
9991
  /**
9876
9992
  * 鼠标|触摸离开事件
9877
9993
  */
9878
- toolTipMouseLeaveEvent() {
9879
- this.$el.$toolTip.style.animationPlayState = "running";
9994
+ toolTipMouseLeaveEvent(event) {
9995
+ this.close(event);
9996
+ // this.$el.$toolTip.style.animationPlayState = "running";
9880
9997
  }
9881
9998
  /**
9882
9999
  * 监听鼠标|触摸离开事件
@@ -9893,22 +10010,23 @@ var pops = (function () {
9893
10010
  }
9894
10011
  class PopsTooltip {
9895
10012
  constructor(details) {
9896
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
9897
- PopsHandler.handleInit($shadowRoot, [
9898
- pops.config.cssText.index,
9899
- pops.config.cssText.anim,
9900
- pops.config.cssText.common,
9901
- pops.config.cssText.tooltipCSS,
9902
- ]);
10013
+ const guid = popsUtils.getRandomGUID();
10014
+ // 设置当前类型
10015
+ const PopsType = "tooltip";
9903
10016
  let config = PopsTooltipConfig();
9904
10017
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
9905
10018
  config = popsUtils.assign(config, details);
9906
10019
  if (!(config.target instanceof HTMLElement)) {
9907
10020
  throw "config.target 必须是HTMLElement类型";
9908
10021
  }
9909
- let guid = popsUtils.getRandomGUID();
9910
- const PopsType = "tooltip";
9911
10022
  config = PopsHandler.handleOnly(PopsType, config);
10023
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
10024
+ PopsHandler.handleInit($shadowRoot, [
10025
+ pops.config.cssText.index,
10026
+ pops.config.cssText.anim,
10027
+ pops.config.cssText.common,
10028
+ pops.config.cssText.tooltipCSS,
10029
+ ]);
9912
10030
  let toolTip = new ToolTip(config, guid, {
9913
10031
  $shadowContainer,
9914
10032
  $shadowRoot,
@@ -9932,7 +10050,7 @@ var pops = (function () {
9932
10050
  /** 配置 */
9933
10051
  config = {
9934
10052
  /** 版本号 */
9935
- version: "2024.11.3",
10053
+ version: "2024.11.24",
9936
10054
  cssText: {
9937
10055
  /** 主CSS */
9938
10056
  index: indexCSS,