@whitesev/pops 1.9.1 → 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 (55) hide show
  1. package/dist/index.amd.js +133 -94
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +133 -94
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +133 -94
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +133 -94
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +133 -94
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +133 -94
  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 +1 -0
  15. package/dist/types/src/components/rightClickMenu/indexType.d.ts +4 -21
  16. package/dist/types/src/components/searchSuggestion/indexType.d.ts +2 -10
  17. package/dist/types/src/components/tooltip/index.d.ts +2 -2
  18. package/dist/types/src/components/tooltip/indexType.d.ts +5 -24
  19. package/dist/types/src/handler/PopsElementHandler.d.ts +1 -1
  20. package/dist/types/src/handler/PopsHandler.d.ts +7 -3
  21. package/dist/types/src/types/components.d.ts +26 -11
  22. package/dist/types/src/types/event.d.ts +1 -1
  23. package/dist/types/src/types/layer.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/src/Pops.ts +1 -1
  26. package/src/components/alert/config.ts +1 -0
  27. package/src/components/alert/index.ts +9 -8
  28. package/src/components/confirm/config.ts +1 -0
  29. package/src/components/confirm/index.ts +9 -9
  30. package/src/components/drawer/config.ts +1 -0
  31. package/src/components/drawer/index.ts +9 -8
  32. package/src/components/folder/config.ts +1 -0
  33. package/src/components/folder/index.ts +31 -24
  34. package/src/components/iframe/config.ts +1 -0
  35. package/src/components/iframe/index.ts +15 -11
  36. package/src/components/loading/config.ts +1 -0
  37. package/src/components/panel/config.ts +1 -0
  38. package/src/components/panel/index.ts +13 -11
  39. package/src/components/prompt/config.ts +1 -0
  40. package/src/components/prompt/index.ts +10 -8
  41. package/src/components/rightClickMenu/config.ts +1 -0
  42. package/src/components/rightClickMenu/index.ts +11 -10
  43. package/src/components/rightClickMenu/indexType.ts +13 -24
  44. package/src/components/searchSuggestion/config.ts +1 -0
  45. package/src/components/searchSuggestion/index.ts +10 -8
  46. package/src/components/searchSuggestion/indexType.ts +4 -10
  47. package/src/components/tooltip/config.ts +1 -0
  48. package/src/components/tooltip/index.ts +13 -12
  49. package/src/components/tooltip/indexType.ts +10 -27
  50. package/src/css/index.css +1 -1
  51. package/src/handler/PopsElementHandler.ts +2 -2
  52. package/src/handler/PopsHandler.ts +19 -8
  53. package/src/types/components.d.ts +26 -11
  54. package/src/types/event.d.ts +1 -1
  55. package/src/types/layer.d.ts +1 -1
package/dist/index.umd.js CHANGED
@@ -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
  * 处理初始化
@@ -3202,6 +3210,7 @@
3202
3210
  },
3203
3211
  },
3204
3212
  },
3213
+ useShadowRoot: true,
3205
3214
  class: "",
3206
3215
  only: false,
3207
3216
  width: "350px",
@@ -3230,7 +3239,14 @@
3230
3239
 
3231
3240
  class PopsAlert {
3232
3241
  constructor(details) {
3233
- 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);
3234
3250
  PopsHandler.handleInit($shadowRoot, [
3235
3251
  pops.config.cssText.index,
3236
3252
  pops.config.cssText.ninePalaceGridPosition,
@@ -3240,13 +3256,6 @@
3240
3256
  pops.config.cssText.common,
3241
3257
  pops.config.cssText.alertCSS,
3242
3258
  ]);
3243
- let config = PopsAlertConfig();
3244
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3245
- config = popsUtils.assign(config, details);
3246
- let guid = popsUtils.getRandomGUID();
3247
- // 设置当前类型
3248
- const PopsType = "alert";
3249
- config = PopsHandler.handleOnly(PopsType, config);
3250
3259
  // 先把z-index提取出来
3251
3260
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3252
3261
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3392,6 +3401,7 @@
3392
3401
  },
3393
3402
  },
3394
3403
  },
3404
+ useShadowRoot: true,
3395
3405
  class: "",
3396
3406
  only: false,
3397
3407
  width: "350px",
@@ -3420,7 +3430,14 @@
3420
3430
 
3421
3431
  class PopsConfirm {
3422
3432
  constructor(details) {
3423
- 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);
3424
3441
  PopsHandler.handleInit($shadowRoot, [
3425
3442
  pops.config.cssText.index,
3426
3443
  pops.config.cssText.ninePalaceGridPosition,
@@ -3430,13 +3447,6 @@
3430
3447
  pops.config.cssText.common,
3431
3448
  pops.config.cssText.confirmCSS,
3432
3449
  ]);
3433
- let config = PopsConfirmConfig();
3434
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3435
- config = popsUtils.assign(config, details);
3436
- let guid = popsUtils.getRandomGUID();
3437
- // 设置当前类型
3438
- const PopsType = "confirm";
3439
- config = PopsHandler.handleOnly(PopsType, config);
3440
3450
  // 先把z-index提取出来
3441
3451
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3442
3452
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3588,6 +3598,7 @@
3588
3598
  },
3589
3599
  },
3590
3600
  },
3601
+ useShadowRoot: true,
3591
3602
  class: "",
3592
3603
  only: false,
3593
3604
  width: "350px",
@@ -3616,7 +3627,14 @@
3616
3627
 
3617
3628
  class PopsPrompt {
3618
3629
  constructor(details) {
3619
- 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);
3620
3638
  PopsHandler.handleInit($shadowRoot, [
3621
3639
  pops.config.cssText.index,
3622
3640
  pops.config.cssText.ninePalaceGridPosition,
@@ -3626,12 +3644,6 @@
3626
3644
  pops.config.cssText.common,
3627
3645
  pops.config.cssText.promptCSS,
3628
3646
  ]);
3629
- let config = PopsPromptConfig();
3630
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3631
- config = popsUtils.assign(config, details);
3632
- let guid = popsUtils.getRandomGUID();
3633
- const PopsType = "prompt";
3634
- config = PopsHandler.handleOnly(PopsType, config);
3635
3647
  // 先把z-index提取出来
3636
3648
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
3637
3649
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -3739,6 +3751,7 @@
3739
3751
  icon: "loading",
3740
3752
  style: "",
3741
3753
  },
3754
+ useShadowRoot: true,
3742
3755
  class: "",
3743
3756
  only: false,
3744
3757
  zIndex: 10000,
@@ -3839,6 +3852,7 @@
3839
3852
  icon: true,
3840
3853
  text: "",
3841
3854
  },
3855
+ useShadowRoot: true,
3842
3856
  class: "",
3843
3857
  url: window.location.href,
3844
3858
  only: false,
@@ -3885,7 +3899,17 @@
3885
3899
 
3886
3900
  class PopsIframe {
3887
3901
  constructor(details) {
3888
- 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);
3889
3913
  PopsHandler.handleInit($shadowRoot, [
3890
3914
  pops.config.cssText.index,
3891
3915
  pops.config.cssText.ninePalaceGridPosition,
@@ -3894,16 +3918,9 @@
3894
3918
  pops.config.cssText.common,
3895
3919
  pops.config.cssText.iframeCSS,
3896
3920
  ]);
3897
- let config = PopsIframeConfig();
3898
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
3899
- config = popsUtils.assign(config, details);
3900
- if (config.url == null) {
3901
- throw "config.url不能为空";
3902
- }
3903
- let guid = popsUtils.getRandomGUID();
3904
- const PopsType = "iframe";
3905
- config = PopsHandler.handleOnly(PopsType, config);
3906
- let maskExtraStyle = config.animation != null && config.animation != ""
3921
+ let maskExtraStyle =
3922
+ // @ts-ignore
3923
+ config.animation != null && config.animation != ""
3907
3924
  ? "position:absolute;"
3908
3925
  : "";
3909
3926
  // 先把z-index提取出来
@@ -4195,6 +4212,7 @@
4195
4212
  },
4196
4213
  clickCallBack: null,
4197
4214
  },
4215
+ useShadowRoot: true,
4198
4216
  class: "",
4199
4217
  zIndex: 10000,
4200
4218
  only: false,
@@ -4213,7 +4231,14 @@
4213
4231
 
4214
4232
  class PopsDrawer {
4215
4233
  constructor(details) {
4216
- 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);
4217
4242
  PopsHandler.handleInit($shadowRoot, [
4218
4243
  pops.config.cssText.index,
4219
4244
  pops.config.cssText.ninePalaceGridPosition,
@@ -4223,12 +4248,6 @@
4223
4248
  pops.config.cssText.common,
4224
4249
  pops.config.cssText.drawerCSS,
4225
4250
  ]);
4226
- let config = PopsDrawerConfig();
4227
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4228
- config = popsUtils.assign(config, details);
4229
- let guid = popsUtils.getRandomGUID();
4230
- const PopsType = "drawer";
4231
- config = PopsHandler.handleOnly(PopsType, config);
4232
4251
  // 先把z-index提取出来
4233
4252
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
4234
4253
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -4496,6 +4515,7 @@
4496
4515
  },
4497
4516
  },
4498
4517
  },
4518
+ useShadowRoot: true,
4499
4519
  class: "",
4500
4520
  only: false,
4501
4521
  width: "500px",
@@ -4552,7 +4572,14 @@
4552
4572
 
4553
4573
  class PopsFolder {
4554
4574
  constructor(details) {
4555
- 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);
4556
4583
  PopsHandler.handleInit($shadowRoot, [
4557
4584
  pops.config.cssText.index,
4558
4585
  pops.config.cssText.ninePalaceGridPosition,
@@ -4562,15 +4589,18 @@
4562
4589
  pops.config.cssText.common,
4563
4590
  pops.config.cssText.folderCSS,
4564
4591
  ]);
4565
- let config = PopsFolderConfig();
4566
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
4567
- config = popsUtils.assign(config, details);
4568
4592
  /* 办公几件套 */
4593
+ // @ts-ignore
4569
4594
  Folder_ICON.docx = Folder_ICON.doc;
4595
+ // @ts-ignore;
4570
4596
  Folder_ICON.rtf = Folder_ICON.doc;
4597
+ // @ts-ignore
4571
4598
  Folder_ICON.xlsx = Folder_ICON.xls;
4599
+ // @ts-ignore
4572
4600
  Folder_ICON.pptx = Folder_ICON.ppt;
4601
+ // @ts-ignore;
4573
4602
  Folder_ICON.dmg = Folder_ICON.ipa;
4603
+ // @ts-ignore
4574
4604
  Folder_ICON.json = Folder_ICON.js;
4575
4605
  /* 压缩包 */
4576
4606
  let zipIconList = [
@@ -4607,24 +4637,25 @@
4607
4637
  /* Android安装包 */
4608
4638
  let androidIconList = ["apk", "apkm", "xapk"];
4609
4639
  zipIconList.forEach((keyName) => {
4640
+ // @ts-ignore
4610
4641
  Folder_ICON[keyName] = Folder_ICON.zip;
4611
4642
  });
4612
4643
  imageIconList.forEach((keyName) => {
4644
+ // @ts-ignore
4613
4645
  Folder_ICON[keyName] = Folder_ICON.png;
4614
4646
  });
4615
4647
  codeLanguageIconList.forEach((keyName) => {
4648
+ // @ts-ignore
4616
4649
  Folder_ICON[keyName] = Folder_ICON.html;
4617
4650
  });
4618
4651
  androidIconList.forEach((keyName) => {
4652
+ // @ts-ignore
4619
4653
  Folder_ICON[keyName] = Folder_ICON.apk;
4620
4654
  });
4621
4655
  if (details?.folder) {
4622
4656
  // @ts-ignore
4623
4657
  config.folder = details.folder;
4624
4658
  }
4625
- let guid = popsUtils.getRandomGUID();
4626
- const PopsType = "folder";
4627
- config = PopsHandler.handleOnly(PopsType, config);
4628
4659
  // 先把z-index提取出来
4629
4660
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
4630
4661
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -5743,6 +5774,7 @@
5743
5774
  },
5744
5775
  clickCallBack: null,
5745
5776
  },
5777
+ useShadowRoot: true,
5746
5778
  class: "",
5747
5779
  mobileClassName: "pops-panel-is-mobile",
5748
5780
  isMobile: false,
@@ -8250,7 +8282,17 @@
8250
8282
 
8251
8283
  class PopsPanel {
8252
8284
  constructor(details) {
8253
- 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);
8254
8296
  PopsHandler.handleInit($shadowRoot, [
8255
8297
  pops.config.cssText.index,
8256
8298
  pops.config.cssText.ninePalaceGridPosition,
@@ -8260,15 +8302,6 @@
8260
8302
  pops.config.cssText.common,
8261
8303
  pops.config.cssText.panelCSS,
8262
8304
  ]);
8263
- let config = PopsPanelConfig();
8264
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8265
- config = popsUtils.assign(config, details);
8266
- if (details && Array.isArray(details.content)) {
8267
- config.content = details.content;
8268
- }
8269
- let guid = popsUtils.getRandomGUID();
8270
- const PopsType = "panel";
8271
- config = PopsHandler.handleOnly(PopsType, config);
8272
8305
  // 先把z-index提取出来
8273
8306
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
8274
8307
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
@@ -8485,6 +8518,7 @@
8485
8518
  ],
8486
8519
  },
8487
8520
  ],
8521
+ useShadowRoot: true,
8488
8522
  className: "",
8489
8523
  isAnimation: true,
8490
8524
  only: false,
@@ -8497,16 +8531,13 @@
8497
8531
 
8498
8532
  class PopsRightClickMenu {
8499
8533
  constructor(details) {
8500
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8501
- PopsHandler.handleInit($shadowRoot, [
8502
- pops.config.cssText.index,
8503
- pops.config.cssText.anim,
8504
- pops.config.cssText.common,
8505
- pops.config.cssText.rightClickMenu,
8506
- ]);
8534
+ const guid = popsUtils.getRandomGUID();
8535
+ // 设置当前类型
8536
+ const PopsType = "rightClickMenu";
8507
8537
  let config = rightClickMenuConfig();
8508
8538
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8509
8539
  config = popsUtils.assign(config, details);
8540
+ config = PopsHandler.handleOnly(PopsType, config);
8510
8541
  if (config.target == null) {
8511
8542
  throw "config.target 不能为空";
8512
8543
  }
@@ -8514,9 +8545,13 @@
8514
8545
  // @ts-ignore
8515
8546
  config.data = details.data;
8516
8547
  }
8517
- let guid = popsUtils.getRandomGUID();
8518
- const PopsType = "rightClickMenu";
8519
- 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
+ ]);
8520
8555
  if (config.style != null) {
8521
8556
  let cssNode = document.createElement("style");
8522
8557
  cssNode.setAttribute("type", "text/css");
@@ -8943,6 +8978,7 @@
8943
8978
  liElement.remove();
8944
8979
  },
8945
8980
  },
8981
+ useShadowRoot: true,
8946
8982
  className: "",
8947
8983
  isAbsolute: true,
8948
8984
  isAnimation: true,
@@ -8977,12 +9013,9 @@
8977
9013
 
8978
9014
  class PopsSearchSuggestion {
8979
9015
  constructor(details) {
8980
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
8981
- PopsHandler.handleInit($shadowRoot, [
8982
- pops.config.cssText.index,
8983
- pops.config.cssText.anim,
8984
- pops.config.cssText.common,
8985
- ]);
9016
+ const guid = popsUtils.getRandomGUID();
9017
+ // 设置当前类型
9018
+ const PopsType = "searchSuggestion";
8986
9019
  let config = searchSuggestionConfig();
8987
9020
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
8988
9021
  config = popsUtils.assign(config, details);
@@ -8996,8 +9029,12 @@
8996
9029
  if (details.data) {
8997
9030
  config.data = details.data;
8998
9031
  }
8999
- const guid = popsUtils.getRandomGUID();
9000
- 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
+ ]);
9001
9038
  if (config.style != null) {
9002
9039
  let cssNode = document.createElement("style");
9003
9040
  cssNode.setAttribute("type", "text/css");
@@ -9522,6 +9559,7 @@
9522
9559
  const PopsTooltipConfig = () => {
9523
9560
  // @ts-ignore
9524
9561
  return {
9562
+ useShadowRoot: true,
9525
9563
  target: null,
9526
9564
  content: "默认文字",
9527
9565
  position: "top",
@@ -9975,22 +10013,23 @@
9975
10013
  }
9976
10014
  class PopsTooltip {
9977
10015
  constructor(details) {
9978
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
9979
- PopsHandler.handleInit($shadowRoot, [
9980
- pops.config.cssText.index,
9981
- pops.config.cssText.anim,
9982
- pops.config.cssText.common,
9983
- pops.config.cssText.tooltipCSS,
9984
- ]);
10016
+ const guid = popsUtils.getRandomGUID();
10017
+ // 设置当前类型
10018
+ const PopsType = "tooltip";
9985
10019
  let config = PopsTooltipConfig();
9986
10020
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
9987
10021
  config = popsUtils.assign(config, details);
9988
10022
  if (!(config.target instanceof HTMLElement)) {
9989
10023
  throw "config.target 必须是HTMLElement类型";
9990
10024
  }
9991
- let guid = popsUtils.getRandomGUID();
9992
- const PopsType = "tooltip";
9993
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
+ ]);
9994
10033
  let toolTip = new ToolTip(config, guid, {
9995
10034
  $shadowContainer,
9996
10035
  $shadowRoot,
@@ -10014,7 +10053,7 @@
10014
10053
  /** 配置 */
10015
10054
  config = {
10016
10055
  /** 版本号 */
10017
- version: "2024.11.21",
10056
+ version: "2024.11.24",
10018
10057
  cssText: {
10019
10058
  /** 主CSS */
10020
10059
  index: indexCSS,