@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
package/dist/index.umd.js CHANGED
@@ -1749,10 +1749,9 @@
1749
1749
  getPopsMaxZIndex(deviation = 1) {
1750
1750
  deviation = Number.isNaN(deviation) ? 1 : deviation;
1751
1751
  // 最大值 2147483647
1752
- // 最大值 2147483647
1753
- // const maxZIndex = Math.pow(2, 31) - 1;
1752
+ // const browserMaxZIndex = Math.pow(2, 31) - 1;
1754
1753
  // 比较值 2000000000
1755
- const maxZIndexCompare = 2 * Math.pow(10, 9);
1754
+ const maxZIndex = 2 * Math.pow(10, 9);
1756
1755
  // 当前页面最大的z-index
1757
1756
  let zIndex = 0;
1758
1757
  // 当前的最大z-index的元素,调试使用
@@ -1782,17 +1781,18 @@
1782
1781
  }
1783
1782
  });
1784
1783
  zIndex += deviation;
1785
- if (zIndex >= maxZIndexCompare) {
1786
- // 最好不要超过最大值
1787
- zIndex = maxZIndexCompare;
1784
+ let isOverMaxZIndex = zIndex >= maxZIndex;
1785
+ if (isOverMaxZIndex) {
1786
+ // 超出z-index最大值
1787
+ zIndex = maxZIndex;
1788
1788
  }
1789
- return { zIndex: zIndex, animElement: maxZIndexNode };
1789
+ return { zIndex: zIndex, animElement: maxZIndexNode, isOverMaxZIndex };
1790
1790
  },
1791
1791
  /**
1792
1792
  * 获取页面中最大的z-index
1793
1793
  * @param deviation 获取最大的z-index值的偏移,默认是+1
1794
1794
  * @example
1795
- * Utils.getMaxZIndex();
1795
+ * getMaxZIndex();
1796
1796
  * > 1001
1797
1797
  **/
1798
1798
  getMaxZIndex(deviation = 1) {
@@ -2282,7 +2282,7 @@
2282
2282
  },
2283
2283
  };
2284
2284
 
2285
- 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";
2285
+ 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";
2286
2286
 
2287
2287
  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";
2288
2288
 
@@ -2475,7 +2475,7 @@
2475
2475
  <div
2476
2476
  class="pops-anim"
2477
2477
  anim="${__config.animation || ""}"
2478
- style="${popsAnimStyle};"
2478
+ style="${popsAnimStyle}"
2479
2479
  data-guid="${guid}">
2480
2480
  ${config.style != null
2481
2481
  ? `<style tyle="text/css">${config.style}</style>`
@@ -2746,14 +2746,22 @@
2746
2746
  /**
2747
2747
  * 创建shadow
2748
2748
  */
2749
- handlerShadow() {
2749
+ handlerShadow(config) {
2750
2750
  let $shadowContainer = document.createElement("div");
2751
2751
  $shadowContainer.className = "pops-shadow-container";
2752
- let $shadowRoot = $shadowContainer.attachShadow({ mode: "open" });
2753
- return {
2754
- $shadowContainer,
2755
- $shadowRoot,
2756
- };
2752
+ if (config.useShadowRoot) {
2753
+ let $shadowRoot = $shadowContainer.attachShadow({ mode: "open" });
2754
+ return {
2755
+ $shadowContainer,
2756
+ $shadowRoot,
2757
+ };
2758
+ }
2759
+ else {
2760
+ return {
2761
+ $shadowContainer,
2762
+ $shadowRoot: $shadowContainer,
2763
+ };
2764
+ }
2757
2765
  },
2758
2766
  /**
2759
2767
  * 处理初始化
@@ -3150,17 +3158,11 @@
3150
3158
  else {
3151
3159
  // 对配置进行处理
3152
3160
  // 选择配置的z-index和已有的pops实例的最大z-index值
3153
- if (typeof config.zIndex === "function") {
3154
- let originZIndexFn = config.zIndex;
3155
- config.zIndex = () => {
3156
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndexFn) + 100);
3157
- return maxZIndex;
3158
- };
3159
- }
3160
- else {
3161
- const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(config.zIndex) + 100);
3162
- config.zIndex = maxZIndex;
3163
- }
3161
+ let originZIndex = config.zIndex;
3162
+ config.zIndex = () => {
3163
+ const { zIndex: maxZIndex } = PopsInstanceUtils.getPopsMaxZIndex(PopsHandler.handleZIndex(originZIndex) + 100);
3164
+ return maxZIndex;
3165
+ };
3164
3166
  }
3165
3167
  return config;
3166
3168
  },
@@ -3197,17 +3199,18 @@
3197
3199
  iconIsLoading: false,
3198
3200
  text: "确定",
3199
3201
  type: "primary",
3200
- callback: function (event) {
3201
- event.close();
3202
+ callback: function (details) {
3203
+ details.close();
3202
3204
  },
3203
3205
  },
3204
3206
  close: {
3205
3207
  enable: true,
3206
- callback: function (event) {
3207
- event.close();
3208
+ callback: function (details) {
3209
+ details.close();
3208
3210
  },
3209
3211
  },
3210
3212
  },
3213
+ useShadowRoot: true,
3211
3214
  class: "",
3212
3215
  only: false,
3213
3216
  width: "350px",
@@ -3221,7 +3224,7 @@
3221
3224
  toClose: false,
3222
3225
  toHide: false,
3223
3226
  },
3224
- clickCallBack: void 0,
3227
+ clickCallBack: null,
3225
3228
  },
3226
3229
  drag: false,
3227
3230
  dragLimit: true,
@@ -3236,7 +3239,14 @@
3236
3239
 
3237
3240
  class PopsAlert {
3238
3241
  constructor(details) {
3239
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3242
+ const guid = popsUtils.getRandomGUID();
3243
+ // 设置当前类型
3244
+ const PopsType = "alert";
3245
+ let config = PopsAlertConfig();
3246
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3247
+ config = popsUtils.assign(config, details);
3248
+ config = PopsHandler.handleOnly(PopsType, config);
3249
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3240
3250
  PopsHandler.handleInit($shadowRoot, [
3241
3251
  pops.config.cssText.index,
3242
3252
  pops.config.cssText.ninePalaceGridPosition,
@@ -3246,13 +3256,6 @@
3246
3256
  pops.config.cssText.common,
3247
3257
  pops.config.cssText.alertCSS,
3248
3258
  ]);
3249
- let config = PopsAlertConfig();
3250
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3251
- config = popsUtils.assign(config, details);
3252
- let guid = popsUtils.getRandomGUID();
3253
- // 设置当前类型
3254
- const PopsType = "alert";
3255
- config = PopsHandler.handleOnly(PopsType, config);
3256
3259
  // 先把z-index提取出来
3257
3260
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3258
3261
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3363,8 +3366,8 @@
3363
3366
  iconIsLoading: false,
3364
3367
  text: "确定",
3365
3368
  type: "primary",
3366
- callback(event) {
3367
- event.close();
3369
+ callback(detail) {
3370
+ detail.close();
3368
3371
  },
3369
3372
  },
3370
3373
  cancel: {
@@ -3375,8 +3378,8 @@
3375
3378
  iconIsLoading: false,
3376
3379
  text: "关闭",
3377
3380
  type: "default",
3378
- callback(event) {
3379
- event.close();
3381
+ callback(detail) {
3382
+ detail.close();
3380
3383
  },
3381
3384
  },
3382
3385
  other: {
@@ -3387,17 +3390,18 @@
3387
3390
  iconIsLoading: false,
3388
3391
  text: "其它按钮",
3389
3392
  type: "default",
3390
- callback(event) {
3391
- event.close();
3393
+ callback(detail) {
3394
+ detail.close();
3392
3395
  },
3393
3396
  },
3394
3397
  close: {
3395
3398
  enable: true,
3396
- callback(event) {
3397
- event.close();
3399
+ callback(detail) {
3400
+ detail.close();
3398
3401
  },
3399
3402
  },
3400
3403
  },
3404
+ useShadowRoot: true,
3401
3405
  class: "",
3402
3406
  only: false,
3403
3407
  width: "350px",
@@ -3411,7 +3415,7 @@
3411
3415
  toClose: false,
3412
3416
  toHide: false,
3413
3417
  },
3414
- clickCallBack: void 0,
3418
+ clickCallBack: null,
3415
3419
  },
3416
3420
  drag: false,
3417
3421
  dragLimit: true,
@@ -3426,7 +3430,14 @@
3426
3430
 
3427
3431
  class PopsConfirm {
3428
3432
  constructor(details) {
3429
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3433
+ const guid = popsUtils.getRandomGUID();
3434
+ // 设置当前类型
3435
+ const PopsType = "confirm";
3436
+ let config = PopsConfirmConfig();
3437
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3438
+ config = popsUtils.assign(config, details);
3439
+ config = PopsHandler.handleOnly(PopsType, config);
3440
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3430
3441
  PopsHandler.handleInit($shadowRoot, [
3431
3442
  pops.config.cssText.index,
3432
3443
  pops.config.cssText.ninePalaceGridPosition,
@@ -3436,13 +3447,6 @@
3436
3447
  pops.config.cssText.common,
3437
3448
  pops.config.cssText.confirmCSS,
3438
3449
  ]);
3439
- let config = PopsConfirmConfig();
3440
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3441
- config = popsUtils.assign(config, details);
3442
- let guid = popsUtils.getRandomGUID();
3443
- // 设置当前类型
3444
- const PopsType = "confirm";
3445
- config = PopsHandler.handleOnly(PopsType, config);
3446
3450
  // 先把z-index提取出来
3447
3451
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3448
3452
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3559,9 +3563,8 @@
3559
3563
  iconIsLoading: false,
3560
3564
  text: "确定",
3561
3565
  type: "success",
3562
- callback(event) {
3563
- console.log(event);
3564
- event.close();
3566
+ callback(detail) {
3567
+ detail.close();
3565
3568
  },
3566
3569
  },
3567
3570
  cancel: {
@@ -3572,9 +3575,8 @@
3572
3575
  iconIsLoading: false,
3573
3576
  text: "关闭",
3574
3577
  type: "default",
3575
- callback(event) {
3576
- console.log(event);
3577
- event.close();
3578
+ callback(detail) {
3579
+ detail.close();
3578
3580
  },
3579
3581
  },
3580
3582
  other: {
@@ -3585,19 +3587,18 @@
3585
3587
  iconIsLoading: false,
3586
3588
  text: "其它按钮",
3587
3589
  type: "default",
3588
- callback(event) {
3589
- console.log(event);
3590
- event.close();
3590
+ callback(detail) {
3591
+ detail.close();
3591
3592
  },
3592
3593
  },
3593
3594
  close: {
3594
3595
  enable: true,
3595
- callback(event) {
3596
- console.log(event);
3597
- event.close();
3596
+ callback(detail) {
3597
+ detail.close();
3598
3598
  },
3599
3599
  },
3600
3600
  },
3601
+ useShadowRoot: true,
3601
3602
  class: "",
3602
3603
  only: false,
3603
3604
  width: "350px",
@@ -3611,7 +3612,7 @@
3611
3612
  toClose: false,
3612
3613
  toHide: false,
3613
3614
  },
3614
- clickCallBack: void 0,
3615
+ clickCallBack: null,
3615
3616
  },
3616
3617
  drag: false,
3617
3618
  dragLimit: true,
@@ -3626,7 +3627,14 @@
3626
3627
 
3627
3628
  class PopsPrompt {
3628
3629
  constructor(details) {
3629
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3630
+ const guid = popsUtils.getRandomGUID();
3631
+ // 设置当前类型
3632
+ const PopsType = "prompt";
3633
+ let config = PopsPromptConfig();
3634
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3635
+ config = popsUtils.assign(config, details);
3636
+ config = PopsHandler.handleOnly(PopsType, config);
3637
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3630
3638
  PopsHandler.handleInit($shadowRoot, [
3631
3639
  pops.config.cssText.index,
3632
3640
  pops.config.cssText.ninePalaceGridPosition,
@@ -3636,12 +3644,6 @@
3636
3644
  pops.config.cssText.common,
3637
3645
  pops.config.cssText.promptCSS,
3638
3646
  ]);
3639
- let config = PopsPromptConfig();
3640
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3641
- config = popsUtils.assign(config, details);
3642
- let guid = popsUtils.getRandomGUID();
3643
- const PopsType = "prompt";
3644
- config = PopsHandler.handleOnly(PopsType, config);
3645
3647
  // 先把z-index提取出来
3646
3648
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3647
3649
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3749,6 +3751,7 @@
3749
3751
  icon: "loading",
3750
3752
  style: "",
3751
3753
  },
3754
+ useShadowRoot: true,
3752
3755
  class: "",
3753
3756
  only: false,
3754
3757
  zIndex: 10000,
@@ -3758,7 +3761,7 @@
3758
3761
  toClose: false,
3759
3762
  toHide: false,
3760
3763
  },
3761
- clickCallBack: void 0,
3764
+ clickCallBack: null,
3762
3765
  },
3763
3766
  animation: "pops-anim-fadein-zoom",
3764
3767
  forbiddenScroll: false,
@@ -3849,6 +3852,7 @@
3849
3852
  icon: true,
3850
3853
  text: "",
3851
3854
  },
3855
+ useShadowRoot: true,
3852
3856
  class: "",
3853
3857
  url: window.location.href,
3854
3858
  only: false,
@@ -3859,7 +3863,7 @@
3859
3863
  toClose: false,
3860
3864
  toHide: false,
3861
3865
  },
3862
- clickCallBack: void 0,
3866
+ clickCallBack: null,
3863
3867
  },
3864
3868
  animation: "pops-anim-fadein-zoom",
3865
3869
  position: "center",
@@ -3895,7 +3899,17 @@
3895
3899
 
3896
3900
  class PopsIframe {
3897
3901
  constructor(details) {
3898
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
3902
+ const guid = popsUtils.getRandomGUID();
3903
+ // 设置当前类型
3904
+ const PopsType = "iframe";
3905
+ let config = PopsIframeConfig();
3906
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3907
+ config = popsUtils.assign(config, details);
3908
+ if (config.url == null) {
3909
+ throw "config.url不能为空";
3910
+ }
3911
+ config = PopsHandler.handleOnly(PopsType, config);
3912
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
3899
3913
  PopsHandler.handleInit($shadowRoot, [
3900
3914
  pops.config.cssText.index,
3901
3915
  pops.config.cssText.ninePalaceGridPosition,
@@ -3904,16 +3918,9 @@
3904
3918
  pops.config.cssText.common,
3905
3919
  pops.config.cssText.iframeCSS,
3906
3920
  ]);
3907
- let config = PopsIframeConfig();
3908
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3909
- config = popsUtils.assign(config, details);
3910
- if (config.url == null) {
3911
- throw "config.url不能为空";
3912
- }
3913
- let guid = popsUtils.getRandomGUID();
3914
- const PopsType = "iframe";
3915
- config = PopsHandler.handleOnly(PopsType, config);
3916
- let maskExtraStyle = config.animation != null && config.animation != ""
3921
+ let maskExtraStyle =
3922
+ // @ts-ignore
3923
+ config.animation != null && config.animation != ""
3917
3924
  ? "position:absolute;"
3918
3925
  : "";
3919
3926
  // 先把z-index提取出来
@@ -4142,12 +4149,17 @@
4142
4149
  position: "center",
4143
4150
  text: "默认标题",
4144
4151
  html: false,
4152
+ style: "",
4145
4153
  },
4146
4154
  content: {
4147
4155
  text: "默认内容",
4148
4156
  html: false,
4157
+ style: "",
4149
4158
  },
4150
4159
  btn: {
4160
+ merge: false,
4161
+ mergeReverse: false,
4162
+ reverse: false,
4151
4163
  position: "flex-end",
4152
4164
  ok: {
4153
4165
  enable: true,
@@ -4157,8 +4169,8 @@
4157
4169
  iconIsLoading: false,
4158
4170
  text: "确定",
4159
4171
  type: "primary",
4160
- callback(event) {
4161
- event.close();
4172
+ callback(detail) {
4173
+ detail.close();
4162
4174
  },
4163
4175
  },
4164
4176
  cancel: {
@@ -4169,8 +4181,8 @@
4169
4181
  iconIsLoading: false,
4170
4182
  text: "关闭",
4171
4183
  type: "default",
4172
- callback(event) {
4173
- event.close();
4184
+ callback(detail) {
4185
+ detail.close();
4174
4186
  },
4175
4187
  },
4176
4188
  other: {
@@ -4181,14 +4193,14 @@
4181
4193
  iconIsLoading: false,
4182
4194
  text: "其它按钮",
4183
4195
  type: "default",
4184
- callback(event) {
4185
- event.close();
4196
+ callback(detail) {
4197
+ detail.close();
4186
4198
  },
4187
4199
  },
4188
4200
  close: {
4189
4201
  enable: true,
4190
- callback(event) {
4191
- event.close();
4202
+ callback(detail) {
4203
+ detail.close();
4192
4204
  },
4193
4205
  },
4194
4206
  },
@@ -4198,8 +4210,9 @@
4198
4210
  toClose: true,
4199
4211
  toHide: false,
4200
4212
  },
4201
- clickCallBack: void 0,
4213
+ clickCallBack: null,
4202
4214
  },
4215
+ useShadowRoot: true,
4203
4216
  class: "",
4204
4217
  zIndex: 10000,
4205
4218
  only: false,
@@ -4218,7 +4231,14 @@
4218
4231
 
4219
4232
  class PopsDrawer {
4220
4233
  constructor(details) {
4221
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
4234
+ const guid = popsUtils.getRandomGUID();
4235
+ // 设置当前类型
4236
+ const PopsType = "drawer";
4237
+ let config = PopsDrawerConfig();
4238
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4239
+ config = popsUtils.assign(config, details);
4240
+ config = PopsHandler.handleOnly(PopsType, config);
4241
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
4222
4242
  PopsHandler.handleInit($shadowRoot, [
4223
4243
  pops.config.cssText.index,
4224
4244
  pops.config.cssText.ninePalaceGridPosition,
@@ -4228,12 +4248,6 @@
4228
4248
  pops.config.cssText.common,
4229
4249
  pops.config.cssText.drawerCSS,
4230
4250
  ]);
4231
- let config = PopsDrawerConfig();
4232
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4233
- config = popsUtils.assign(config, details);
4234
- let guid = popsUtils.getRandomGUID();
4235
- const PopsType = "drawer";
4236
- config = PopsHandler.handleOnly(PopsType, config);
4237
4251
  // 先把z-index提取出来
4238
4252
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
4239
4253
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -4466,8 +4480,8 @@
4466
4480
  iconIsLoading: false,
4467
4481
  text: "确定",
4468
4482
  type: "primary",
4469
- callback(event) {
4470
- event.close();
4483
+ callback(detail) {
4484
+ detail.close();
4471
4485
  },
4472
4486
  },
4473
4487
  cancel: {
@@ -4478,8 +4492,8 @@
4478
4492
  iconIsLoading: false,
4479
4493
  text: "关闭",
4480
4494
  type: "default",
4481
- callback(event) {
4482
- event.close();
4495
+ callback(detail) {
4496
+ detail.close();
4483
4497
  },
4484
4498
  },
4485
4499
  other: {
@@ -4490,17 +4504,18 @@
4490
4504
  iconIsLoading: false,
4491
4505
  text: "其它按钮",
4492
4506
  type: "default",
4493
- callback(event) {
4494
- event.close();
4507
+ callback(detail) {
4508
+ detail.close();
4495
4509
  },
4496
4510
  },
4497
4511
  close: {
4498
4512
  enable: true,
4499
- callback(event) {
4500
- event.close();
4513
+ callback(detail) {
4514
+ detail.close();
4501
4515
  },
4502
4516
  },
4503
4517
  },
4518
+ useShadowRoot: true,
4504
4519
  class: "",
4505
4520
  only: false,
4506
4521
  width: "500px",
@@ -4514,7 +4529,7 @@
4514
4529
  toClose: false,
4515
4530
  toHide: false,
4516
4531
  },
4517
- clickCallBack: void 0,
4532
+ clickCallBack: null,
4518
4533
  },
4519
4534
  drag: false,
4520
4535
  dragLimit: true,
@@ -4557,7 +4572,14 @@
4557
4572
 
4558
4573
  class PopsFolder {
4559
4574
  constructor(details) {
4560
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
4575
+ const guid = popsUtils.getRandomGUID();
4576
+ // 设置当前类型
4577
+ const PopsType = "folder";
4578
+ let config = PopsFolderConfig();
4579
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4580
+ config = popsUtils.assign(config, details);
4581
+ config = PopsHandler.handleOnly(PopsType, config);
4582
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
4561
4583
  PopsHandler.handleInit($shadowRoot, [
4562
4584
  pops.config.cssText.index,
4563
4585
  pops.config.cssText.ninePalaceGridPosition,
@@ -4567,15 +4589,18 @@
4567
4589
  pops.config.cssText.common,
4568
4590
  pops.config.cssText.folderCSS,
4569
4591
  ]);
4570
- let config = PopsFolderConfig();
4571
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4572
- config = popsUtils.assign(config, details);
4573
4592
  /* 办公几件套 */
4593
+ // @ts-ignore
4574
4594
  Folder_ICON.docx = Folder_ICON.doc;
4595
+ // @ts-ignore;
4575
4596
  Folder_ICON.rtf = Folder_ICON.doc;
4597
+ // @ts-ignore
4576
4598
  Folder_ICON.xlsx = Folder_ICON.xls;
4599
+ // @ts-ignore
4577
4600
  Folder_ICON.pptx = Folder_ICON.ppt;
4601
+ // @ts-ignore;
4578
4602
  Folder_ICON.dmg = Folder_ICON.ipa;
4603
+ // @ts-ignore
4579
4604
  Folder_ICON.json = Folder_ICON.js;
4580
4605
  /* 压缩包 */
4581
4606
  let zipIconList = [
@@ -4612,23 +4637,25 @@
4612
4637
  /* Android安装包 */
4613
4638
  let androidIconList = ["apk", "apkm", "xapk"];
4614
4639
  zipIconList.forEach((keyName) => {
4640
+ // @ts-ignore
4615
4641
  Folder_ICON[keyName] = Folder_ICON.zip;
4616
4642
  });
4617
4643
  imageIconList.forEach((keyName) => {
4644
+ // @ts-ignore
4618
4645
  Folder_ICON[keyName] = Folder_ICON.png;
4619
4646
  });
4620
4647
  codeLanguageIconList.forEach((keyName) => {
4648
+ // @ts-ignore
4621
4649
  Folder_ICON[keyName] = Folder_ICON.html;
4622
4650
  });
4623
4651
  androidIconList.forEach((keyName) => {
4652
+ // @ts-ignore
4624
4653
  Folder_ICON[keyName] = Folder_ICON.apk;
4625
4654
  });
4626
4655
  if (details?.folder) {
4656
+ // @ts-ignore
4627
4657
  config.folder = details.folder;
4628
4658
  }
4629
- let guid = popsUtils.getRandomGUID();
4630
- const PopsType = "folder";
4631
- config = PopsHandler.handleOnly(PopsType, config);
4632
4659
  // 先把z-index提取出来
4633
4660
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
4634
4661
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -5365,6 +5392,9 @@
5365
5392
  className: "panel-switch",
5366
5393
  text: "switch",
5367
5394
  type: "switch",
5395
+ // @ts-ignore
5396
+ props: {},
5397
+ disabled: false,
5368
5398
  attributes: [],
5369
5399
  getValue() {
5370
5400
  return true;
@@ -5377,6 +5407,8 @@
5377
5407
  className: "panel-slider",
5378
5408
  text: "slider",
5379
5409
  type: "slider",
5410
+ // @ts-ignore
5411
+ props: {},
5380
5412
  attributes: [],
5381
5413
  getValue() {
5382
5414
  return 50;
@@ -5391,6 +5423,8 @@
5391
5423
  className: "panel-button",
5392
5424
  text: "button",
5393
5425
  type: "button",
5426
+ // @ts-ignore
5427
+ props: {},
5394
5428
  attributes: [],
5395
5429
  buttonIcon: "eleme",
5396
5430
  buttonIconIsLoading: true,
@@ -5403,6 +5437,8 @@
5403
5437
  {
5404
5438
  className: "panel-button",
5405
5439
  text: "button",
5440
+ // @ts-ignore
5441
+ props: {},
5406
5442
  type: "button",
5407
5443
  attributes: [],
5408
5444
  buttonIcon: "chromeFilled",
@@ -5418,6 +5454,8 @@
5418
5454
  text: "button",
5419
5455
  type: "button",
5420
5456
  attributes: [],
5457
+ // @ts-ignore
5458
+ props: {},
5421
5459
  buttonIcon: "upload",
5422
5460
  buttonIconIsLoading: false,
5423
5461
  buttonType: "info",
@@ -5446,6 +5484,8 @@
5446
5484
  className: "panel-input",
5447
5485
  text: "input",
5448
5486
  type: "input",
5487
+ // @ts-ignore
5488
+ props: {},
5449
5489
  attributes: [],
5450
5490
  getValue() {
5451
5491
  return "50";
@@ -5459,6 +5499,8 @@
5459
5499
  className: "panel-input-password",
5460
5500
  text: "input-password",
5461
5501
  type: "input",
5502
+ // @ts-ignore
5503
+ props: {},
5462
5504
  attributes: [],
5463
5505
  getValue() {
5464
5506
  return "123456";
@@ -5473,6 +5515,8 @@
5473
5515
  className: "panel-textarea",
5474
5516
  text: "textarea",
5475
5517
  type: "textarea",
5518
+ // @ts-ignore
5519
+ props: {},
5476
5520
  attributes: [],
5477
5521
  getValue() {
5478
5522
  return "50";
@@ -5486,6 +5530,8 @@
5486
5530
  className: "panel-select",
5487
5531
  text: "select",
5488
5532
  type: "select",
5533
+ // @ts-ignore
5534
+ props: {},
5489
5535
  attributes: [],
5490
5536
  getValue() {
5491
5537
  return 50;
@@ -5497,14 +5543,23 @@
5497
5543
  {
5498
5544
  value: "all",
5499
5545
  text: "所有",
5546
+ disable() {
5547
+ return false;
5548
+ },
5500
5549
  },
5501
5550
  {
5502
5551
  value: "text",
5503
5552
  text: "文本",
5553
+ disable() {
5554
+ return false;
5555
+ },
5504
5556
  },
5505
5557
  {
5506
5558
  value: "html",
5507
5559
  text: "超文本",
5560
+ disable() {
5561
+ return false;
5562
+ },
5508
5563
  },
5509
5564
  ],
5510
5565
  },
@@ -5512,6 +5567,8 @@
5512
5567
  className: "panel-select-multiple",
5513
5568
  type: "select-multiple",
5514
5569
  text: "select-multiple",
5570
+ // @ts-ignore
5571
+ props: {},
5515
5572
  attributes: [],
5516
5573
  placeholder: "请至少选择一个选项",
5517
5574
  getValue() {
@@ -5530,22 +5587,42 @@
5530
5587
  {
5531
5588
  value: "select-1",
5532
5589
  text: "单选1",
5590
+ isHTML: false,
5591
+ disable() {
5592
+ return false;
5593
+ },
5533
5594
  },
5534
5595
  {
5535
5596
  value: "select-2",
5536
5597
  text: "单选2",
5598
+ isHTML: false,
5599
+ disable() {
5600
+ return false;
5601
+ },
5537
5602
  },
5538
5603
  {
5539
5604
  value: "select-3",
5540
5605
  text: "单选3",
5606
+ isHTML: false,
5607
+ disable() {
5608
+ return false;
5609
+ },
5541
5610
  },
5542
5611
  {
5543
5612
  value: "select-4",
5544
5613
  text: "单选4",
5614
+ isHTML: false,
5615
+ disable() {
5616
+ return false;
5617
+ },
5545
5618
  },
5546
5619
  {
5547
5620
  value: "select-5",
5548
5621
  text: "单选5",
5622
+ isHTML: false,
5623
+ disable() {
5624
+ return false;
5625
+ },
5549
5626
  },
5550
5627
  ],
5551
5628
  },
@@ -5577,6 +5654,8 @@
5577
5654
  className: "panel-switch",
5578
5655
  text: "switch",
5579
5656
  type: "switch",
5657
+ // @ts-ignore
5658
+ props: {},
5580
5659
  attributes: [],
5581
5660
  getValue() {
5582
5661
  return true;
@@ -5588,6 +5667,8 @@
5588
5667
  {
5589
5668
  className: "panel-slider",
5590
5669
  text: "slider",
5670
+ // @ts-ignore
5671
+ props: {},
5591
5672
  type: "slider",
5592
5673
  attributes: [],
5593
5674
  getValue() {
@@ -5602,6 +5683,8 @@
5602
5683
  {
5603
5684
  className: "panel-button",
5604
5685
  text: "button",
5686
+ // @ts-ignore
5687
+ props: {},
5605
5688
  type: "button",
5606
5689
  attributes: [],
5607
5690
  buttonIcon: "eleme",
@@ -5616,6 +5699,8 @@
5616
5699
  className: "panel-button",
5617
5700
  text: "button",
5618
5701
  type: "button",
5702
+ // @ts-ignore
5703
+ props: {},
5619
5704
  attributes: [],
5620
5705
  buttonIcon: "chromeFilled",
5621
5706
  buttonIconIsLoading: true,
@@ -5628,6 +5713,8 @@
5628
5713
  {
5629
5714
  className: "panel-button",
5630
5715
  text: "button",
5716
+ // @ts-ignore
5717
+ props: {},
5631
5718
  type: "button",
5632
5719
  attributes: [],
5633
5720
  buttonIcon: "upload",
@@ -5655,6 +5742,8 @@
5655
5742
  {
5656
5743
  className: "panel-switch",
5657
5744
  text: "switch",
5745
+ // @ts-ignore
5746
+ props: {},
5658
5747
  type: "switch",
5659
5748
  attributes: [],
5660
5749
  getValue() {
@@ -5683,8 +5772,9 @@
5683
5772
  toClose: false,
5684
5773
  toHide: false,
5685
5774
  },
5686
- clickCallBack: void 0,
5775
+ clickCallBack: null,
5687
5776
  },
5777
+ useShadowRoot: true,
5688
5778
  class: "",
5689
5779
  mobileClassName: "pops-panel-is-mobile",
5690
5780
  isMobile: false,
@@ -8192,7 +8282,17 @@
8192
8282
 
8193
8283
  class PopsPanel {
8194
8284
  constructor(details) {
8195
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8285
+ const guid = popsUtils.getRandomGUID();
8286
+ // 设置当前类型
8287
+ const PopsType = "panel";
8288
+ let config = PopsPanelConfig();
8289
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8290
+ config = popsUtils.assign(config, details);
8291
+ if (details && Array.isArray(details.content)) {
8292
+ config.content = details.content;
8293
+ }
8294
+ config = PopsHandler.handleOnly(PopsType, config);
8295
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
8196
8296
  PopsHandler.handleInit($shadowRoot, [
8197
8297
  pops.config.cssText.index,
8198
8298
  pops.config.cssText.ninePalaceGridPosition,
@@ -8202,15 +8302,6 @@
8202
8302
  pops.config.cssText.common,
8203
8303
  pops.config.cssText.panelCSS,
8204
8304
  ]);
8205
- let config = PopsPanelConfig();
8206
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8207
- config = popsUtils.assign(config, details);
8208
- if (details && Array.isArray(details.content)) {
8209
- config.content = details.content;
8210
- }
8211
- let guid = popsUtils.getRandomGUID();
8212
- const PopsType = "panel";
8213
- config = PopsHandler.handleOnly(PopsType, config);
8214
8305
  // 先把z-index提取出来
8215
8306
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
8216
8307
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -8322,6 +8413,7 @@
8322
8413
  icon: pops.config.iconSVG.search,
8323
8414
  iconIsLoading: false,
8324
8415
  text: "搜索",
8416
+ item: [],
8325
8417
  callback(clickEvent, contextMenuEvent, liElement) {
8326
8418
  console.log("点击:" + this.text, [
8327
8419
  clickEvent,
@@ -8334,6 +8426,7 @@
8334
8426
  icon: pops.config.iconSVG.documentCopy,
8335
8427
  iconIsLoading: false,
8336
8428
  text: "复制",
8429
+ item: [],
8337
8430
  callback(clickEvent, contextMenuEvent, liElement) {
8338
8431
  console.log("点击:" + this.text, [
8339
8432
  clickEvent,
@@ -8346,6 +8439,7 @@
8346
8439
  icon: pops.config.iconSVG.delete,
8347
8440
  text: "删除",
8348
8441
  iconIsLoading: false,
8442
+ item: [],
8349
8443
  callback(clickEvent, contextMenuEvent, liElement) {
8350
8444
  console.log("点击:" + this.text, [
8351
8445
  clickEvent,
@@ -8358,6 +8452,7 @@
8358
8452
  icon: pops.config.iconSVG.loading,
8359
8453
  iconIsLoading: true,
8360
8454
  text: "加载",
8455
+ item: [],
8361
8456
  callback(clickEvent, contextMenuEvent, liElement) {
8362
8457
  console.log("点击:" + this.text, [
8363
8458
  clickEvent,
@@ -8384,6 +8479,7 @@
8384
8479
  icon: "",
8385
8480
  iconIsLoading: false,
8386
8481
  text: "处理文件",
8482
+ item: [],
8387
8483
  callback(clickEvent, contextMenuEvent, liElement) {
8388
8484
  console.log("点击:" + this.text, [
8389
8485
  clickEvent,
@@ -8408,6 +8504,7 @@
8408
8504
  icon: pops.config.iconSVG.view,
8409
8505
  iconIsLoading: false,
8410
8506
  text: "查看",
8507
+ item: [],
8411
8508
  callback(clickEvent, contextMenuEvent, liElement) {
8412
8509
  console.log("点击:" + this.text, [
8413
8510
  clickEvent,
@@ -8421,6 +8518,7 @@
8421
8518
  ],
8422
8519
  },
8423
8520
  ],
8521
+ useShadowRoot: true,
8424
8522
  className: "",
8425
8523
  isAnimation: true,
8426
8524
  only: false,
@@ -8433,25 +8531,27 @@
8433
8531
 
8434
8532
  class PopsRightClickMenu {
8435
8533
  constructor(details) {
8436
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8437
- PopsHandler.handleInit($shadowRoot, [
8438
- pops.config.cssText.index,
8439
- pops.config.cssText.anim,
8440
- pops.config.cssText.common,
8441
- pops.config.cssText.rightClickMenu,
8442
- ]);
8534
+ const guid = popsUtils.getRandomGUID();
8535
+ // 设置当前类型
8536
+ const PopsType = "rightClickMenu";
8443
8537
  let config = rightClickMenuConfig();
8444
8538
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8445
8539
  config = popsUtils.assign(config, details);
8540
+ config = PopsHandler.handleOnly(PopsType, config);
8446
8541
  if (config.target == null) {
8447
8542
  throw "config.target 不能为空";
8448
8543
  }
8449
8544
  if (details.data) {
8545
+ // @ts-ignore
8450
8546
  config.data = details.data;
8451
8547
  }
8452
- let guid = popsUtils.getRandomGUID();
8453
- const PopsType = "rightClickMenu";
8454
- config = PopsHandler.handleOnly(PopsType, config);
8548
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
8549
+ PopsHandler.handleInit($shadowRoot, [
8550
+ pops.config.cssText.index,
8551
+ pops.config.cssText.anim,
8552
+ pops.config.cssText.common,
8553
+ pops.config.cssText.rightClickMenu,
8554
+ ]);
8455
8555
  if (config.style != null) {
8456
8556
  let cssNode = document.createElement("style");
8457
8557
  cssNode.setAttribute("type", "text/css");
@@ -8878,6 +8978,7 @@
8878
8978
  liElement.remove();
8879
8979
  },
8880
8980
  },
8981
+ useShadowRoot: true,
8881
8982
  className: "",
8882
8983
  isAbsolute: true,
8883
8984
  isAnimation: true,
@@ -8912,12 +9013,9 @@
8912
9013
 
8913
9014
  class PopsSearchSuggestion {
8914
9015
  constructor(details) {
8915
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8916
- PopsHandler.handleInit($shadowRoot, [
8917
- pops.config.cssText.index,
8918
- pops.config.cssText.anim,
8919
- pops.config.cssText.common,
8920
- ]);
9016
+ const guid = popsUtils.getRandomGUID();
9017
+ // 设置当前类型
9018
+ const PopsType = "searchSuggestion";
8921
9019
  let config = searchSuggestionConfig();
8922
9020
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8923
9021
  config = popsUtils.assign(config, details);
@@ -8931,8 +9029,12 @@
8931
9029
  if (details.data) {
8932
9030
  config.data = details.data;
8933
9031
  }
8934
- const guid = popsUtils.getRandomGUID();
8935
- const PopsType = "searchSuggestion";
9032
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
9033
+ PopsHandler.handleInit($shadowRoot, [
9034
+ pops.config.cssText.index,
9035
+ pops.config.cssText.anim,
9036
+ pops.config.cssText.common,
9037
+ ]);
8936
9038
  if (config.style != null) {
8937
9039
  let cssNode = document.createElement("style");
8938
9040
  cssNode.setAttribute("type", "text/css");
@@ -9455,8 +9557,9 @@
9455
9557
  }
9456
9558
 
9457
9559
  const PopsTooltipConfig = () => {
9560
+ // @ts-ignore
9458
9561
  return {
9459
- // @ts-ignore
9562
+ useShadowRoot: true,
9460
9563
  target: null,
9461
9564
  content: "默认文字",
9462
9565
  position: "top",
@@ -9476,6 +9579,8 @@
9476
9579
  showAfterCallBack() { },
9477
9580
  closeBeforeCallBack() { },
9478
9581
  closeAfterCallBack() { },
9582
+ delayCloseTime: 100,
9583
+ showArrow: true,
9479
9584
  arrowDistance: 12.5,
9480
9585
  otherDistance: 0,
9481
9586
  style: "",
@@ -9550,6 +9655,10 @@
9550
9655
  });
9551
9656
  $toolTipContainer.appendChild(cssNode);
9552
9657
  }
9658
+ // 处理是否显示箭头元素
9659
+ if (!this.$data.config.showArrow) {
9660
+ $toolTipArrow.remove();
9661
+ }
9553
9662
  return {
9554
9663
  $toolTipContainer: $toolTipContainer,
9555
9664
  $toolTipArrow: $toolTipArrow,
@@ -9589,12 +9698,12 @@
9589
9698
  this.$el.$toolTip.style.setProperty("z-index", zIndex.toString());
9590
9699
  }
9591
9700
  /**
9592
- * 获取 提示框的位置
9701
+ * 计算 提示框的位置
9593
9702
  * @param targetElement 目标元素
9594
9703
  * @param arrowDistance 箭头和目标元素的距离
9595
9704
  * @param otherDistance 其它位置的偏移
9596
9705
  */
9597
- getPosition(targetElement, arrowDistance, otherDistance) {
9706
+ calcToolTipPosition(targetElement, arrowDistance, otherDistance) {
9598
9707
  let offsetInfo = popsDOMUtils.offset(targetElement, !this.$data.config.isFixed);
9599
9708
  // 目标 宽
9600
9709
  let targetElement_width = offsetInfo.width;
@@ -9643,7 +9752,7 @@
9643
9752
  * 动态修改tooltip的位置
9644
9753
  */
9645
9754
  changePosition() {
9646
- let positionInfo = this.getPosition(this.$data.config.target, this.$data.config.arrowDistance, this.$data.config.otherDistance);
9755
+ let positionInfo = this.calcToolTipPosition(this.$data.config.target, this.$data.config.arrowDistance, this.$data.config.otherDistance);
9647
9756
  let positionKey = this.$data.config.position.toUpperCase();
9648
9757
  let positionDetail = positionInfo[positionKey];
9649
9758
  if (positionDetail) {
@@ -9772,8 +9881,8 @@
9772
9881
  // 其它的如Touch事件不做处理
9773
9882
  if (event && event instanceof MouseEvent) {
9774
9883
  let $target = event.composedPath()[0];
9775
- // 如果是子元素触发的话,忽视
9776
- if ($target != this.$data.config.target) {
9884
+ // 如果是目标元素的子元素/tooltip元素的子元素触发的话,那就不管
9885
+ if ($target != this.$data.config.target && $target != this.$el.$toolTip) {
9777
9886
  return;
9778
9887
  }
9779
9888
  }
@@ -9791,6 +9900,10 @@
9791
9900
  let timeId = setTimeout(() => {
9792
9901
  // 设置属性触发关闭动画
9793
9902
  this.clearCloseTimeoutId(eventType, timeId);
9903
+ if (this.$el.$toolTip == null) {
9904
+ // 已清除了
9905
+ return;
9906
+ }
9794
9907
  this.$el.$toolTip.setAttribute("data-motion", this.$el.$toolTip
9795
9908
  .getAttribute("data-motion")
9796
9909
  .replace("fadeIn", "fadeOut"));
@@ -9856,7 +9969,10 @@
9856
9969
  * 鼠标|触摸进入事件
9857
9970
  */
9858
9971
  toolTipMouseEnterEvent() {
9859
- this.$el.$toolTip.style.animationPlayState = "paused";
9972
+ this.clearCloseTimeoutId("MouseEvent");
9973
+ this.clearCloseTimeoutId("TouchEvent");
9974
+ // 重置动画状态
9975
+ // this.$el.$toolTip.style.animationPlayState = "paused";
9860
9976
  // if (parseInt(getComputedStyle(toolTipElement)) > 0.5) {
9861
9977
  // toolTipElement.style.animationPlayState = "paused";
9862
9978
  // }
@@ -9878,8 +9994,9 @@
9878
9994
  /**
9879
9995
  * 鼠标|触摸离开事件
9880
9996
  */
9881
- toolTipMouseLeaveEvent() {
9882
- this.$el.$toolTip.style.animationPlayState = "running";
9997
+ toolTipMouseLeaveEvent(event) {
9998
+ this.close(event);
9999
+ // this.$el.$toolTip.style.animationPlayState = "running";
9883
10000
  }
9884
10001
  /**
9885
10002
  * 监听鼠标|触摸离开事件
@@ -9896,22 +10013,23 @@
9896
10013
  }
9897
10014
  class PopsTooltip {
9898
10015
  constructor(details) {
9899
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
9900
- PopsHandler.handleInit($shadowRoot, [
9901
- pops.config.cssText.index,
9902
- pops.config.cssText.anim,
9903
- pops.config.cssText.common,
9904
- pops.config.cssText.tooltipCSS,
9905
- ]);
10016
+ const guid = popsUtils.getRandomGUID();
10017
+ // 设置当前类型
10018
+ const PopsType = "tooltip";
9906
10019
  let config = PopsTooltipConfig();
9907
10020
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
9908
10021
  config = popsUtils.assign(config, details);
9909
10022
  if (!(config.target instanceof HTMLElement)) {
9910
10023
  throw "config.target 必须是HTMLElement类型";
9911
10024
  }
9912
- let guid = popsUtils.getRandomGUID();
9913
- const PopsType = "tooltip";
9914
10025
  config = PopsHandler.handleOnly(PopsType, config);
10026
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
10027
+ PopsHandler.handleInit($shadowRoot, [
10028
+ pops.config.cssText.index,
10029
+ pops.config.cssText.anim,
10030
+ pops.config.cssText.common,
10031
+ pops.config.cssText.tooltipCSS,
10032
+ ]);
9915
10033
  let toolTip = new ToolTip(config, guid, {
9916
10034
  $shadowContainer,
9917
10035
  $shadowRoot,
@@ -9935,7 +10053,7 @@
9935
10053
  /** 配置 */
9936
10054
  config = {
9937
10055
  /** 版本号 */
9938
- version: "2024.11.3",
10056
+ version: "2024.11.24",
9939
10057
  cssText: {
9940
10058
  /** 主CSS */
9941
10059
  index: indexCSS,