@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
@@ -16,6 +16,7 @@ export declare const GlobalConfig: {
16
16
  getGlobalConfig(): {
17
17
  style?: string | undefined;
18
18
  zIndex?: string | number | undefined;
19
+ useShadowRoot?: boolean | undefined;
19
20
  class?: string | undefined;
20
21
  only?: boolean | undefined;
21
22
  width?: string | undefined;
@@ -248,6 +248,7 @@ declare class Pops {
248
248
  getGlobalConfig(): {
249
249
  style?: string | undefined;
250
250
  zIndex?: string | number | undefined;
251
+ useShadowRoot?: boolean | undefined;
251
252
  class?: string | undefined;
252
253
  only?: boolean | undefined;
253
254
  width?: string | undefined;
@@ -1,3 +1,4 @@
1
+ import type { PopsCommonConfig } from "../../types/components";
1
2
  import type { PopsIcon } from "../../types/icon";
2
3
  /**
3
4
  * pops.rightClickMenu的右键菜单配置
@@ -34,11 +35,11 @@ export interface PopsRightClickMenuDataDetails {
34
35
  /**
35
36
  * pops.rightClickMenu
36
37
  */
37
- export interface PopsRightClickMenuDetails {
38
+ export interface PopsRightClickMenuDetails extends Pick<PopsCommonConfig, "useShadowRoot" | "beforeAppendToPageCallBack" | "zIndex" | "style" | "only"> {
38
39
  /**
39
- * 目标,默认为document.documentElement
40
+ * 目标,默认为document.documentElement G
40
41
  */
41
- target?: HTMLElement | typeof globalThis | Window | EventTarget | Node;
42
+ target?: HTMLElement | (typeof globalThis & Window) | Window | EventTarget | Node;
42
43
  /**
43
44
  * 目标的子元素选择器,默认为空
44
45
  */
@@ -51,30 +52,12 @@ export interface PopsRightClickMenuDetails {
51
52
  * 自定义className,默认为空
52
53
  */
53
54
  className?: string;
54
- /**
55
- * 是否是唯一的弹窗,默认false
56
- */
57
- only?: boolean;
58
55
  /**
59
56
  * 是否启用动画,默认true
60
57
  */
61
58
  isAnimation?: boolean;
62
- /**
63
- * 弹窗的显示层级,默认10000
64
- */
65
- zIndex?: number | (() => number);
66
59
  /**
67
60
  * 是否阻止默认contextmenu事件
68
61
  */
69
62
  preventDefault?: boolean;
70
- /**
71
- * (可选)自定义style
72
- */
73
- style?: string | null;
74
- /**
75
- * 在元素添加到页面前的事件
76
- * @param $shadowRoot 根元素
77
- * @param $shadowContainer 容器
78
- */
79
- beforeAppendToPageCallBack?: ($shadowRoot: ShadowRoot, $shadowContainer: HTMLDivElement) => void;
80
63
  }
@@ -1,8 +1,9 @@
1
+ import type { PopsCommonConfig } from "../../types/components";
1
2
  /**
2
3
  * 搜索建议悬浮窗
3
4
  * pops.searchSuggestion
4
5
  */
5
- export interface PopsSearchSuggestionDetails<T = any> {
6
+ export interface PopsSearchSuggestionDetails<T = any> extends Pick<PopsCommonConfig, "useShadowRoot" | "zIndex" | "style"> {
6
7
  /**
7
8
  * 当前的环境,可以是document,可以是shadowroot,默认是document
8
9
  * @default document
@@ -78,11 +79,6 @@ export interface PopsSearchSuggestionDetails<T = any> {
78
79
  * @default true
79
80
  */
80
81
  positionTopToReverse?: boolean;
81
- /**
82
- * 层级,默认10000
83
- * @default 10000
84
- */
85
- zIndex?: number | (() => number);
86
82
  /**
87
83
  * 搜索中的提示
88
84
  *
@@ -134,10 +130,6 @@ export interface PopsSearchSuggestionDetails<T = any> {
134
130
  * @param data config.data的数据
135
131
  */
136
132
  selectCallBack?: (event: MouseEvent, liElement: HTMLLIElement, data: T) => void;
137
- /**
138
- * (可选)自定义style
139
- */
140
- style?: string;
141
133
  }
142
134
  /**
143
135
  * pops.searchSuggestion的函数返回值
@@ -3,7 +3,7 @@ type ToolTipEventTypeName = "MouseEvent" | "TouchEvent";
3
3
  export declare class ToolTip {
4
4
  $el: {
5
5
  $shadowContainer: HTMLDivElement;
6
- $shadowRoot: ShadowRoot;
6
+ $shadowRoot: ShadowRoot | HTMLElement;
7
7
  $toolTip: HTMLElement;
8
8
  $content: HTMLElement;
9
9
  $arrow: HTMLElement;
@@ -16,7 +16,7 @@ export declare class ToolTip {
16
16
  };
17
17
  constructor(config: Required<PopsToolTipDetails>, guid: string, ShadowInfo: {
18
18
  $shadowContainer: HTMLDivElement;
19
- $shadowRoot: ShadowRoot;
19
+ $shadowRoot: ShadowRoot | HTMLElement;
20
20
  });
21
21
  init(): void;
22
22
  /**
@@ -1,9 +1,10 @@
1
+ import type { PopsCommonConfig } from "../../types/components";
1
2
  /** tooltip的出现位置 */
2
3
  export type PopsTooltipPosition = "top" | "right" | "bottom" | "left";
3
4
  /**
4
5
  * pops.tooltip
5
6
  */
6
- export interface PopsToolTipDetails {
7
+ export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoot" | "only" | "zIndex" | "style" | "beforeAppendToPageCallBack"> {
7
8
  /**
8
9
  * 目标元素
9
10
  */
@@ -52,20 +53,12 @@ export interface PopsToolTipDetails {
52
53
  * @default "mouseleave touchend"
53
54
  */
54
55
  triggerCloseEventName?: string;
55
- /**
56
- * z-index
57
- * @default 10000
58
- */
59
- zIndex?: number | (() => number);
60
- /**
61
- * 是否唯一
62
- * @default false
63
- */
64
- only?: boolean;
65
56
  /**
66
57
  * 监听的事件配置
67
58
  */
68
- eventOption?: AddEventListenerOptions;
59
+ eventOption?: {
60
+ [P in keyof AddEventListenerOptions]: AddEventListenerOptions[P];
61
+ };
69
62
  /**
70
63
  * 触发显示前的回调
71
64
  * @returns
@@ -108,16 +101,4 @@ export interface PopsToolTipDetails {
108
101
  * @default 0
109
102
  */
110
103
  otherDistance?: number;
111
- /**
112
- * (可选)自定义style
113
- */
114
- style?: string;
115
- /**
116
- * 在元素添加到页面前的事件
117
- *
118
- * 当tooltip添加到ShadowRoot内时也会触发
119
- * @param $shadowRoot 根元素
120
- * @param $shadowContainer 容器
121
- */
122
- beforeAppendToPageCallBack?: ($shadowRoot: ShadowRoot, $shadowContainer: HTMLDivElement) => void;
123
104
  }
@@ -28,7 +28,7 @@ export declare const PopsElementHandler: {
28
28
  * @param type
29
29
  * @param config
30
30
  */
31
- getBottomBtnHTML(type: PopsTypeSupportBottomBtn, config: PopsSupportBottomBtn[keyof PopsSupportBottomBtn]): string;
31
+ getBottomBtnHTML(type: PopsTypeSupportBottomBtn, config: Omit<PopsSupportBottomBtn[keyof PopsSupportBottomBtn], "content">): string;
32
32
  /**
33
33
  * 获取标题style
34
34
  * @param type
@@ -6,6 +6,7 @@ import type { PopsIframeDetails } from "../components/iframe/indexType";
6
6
  import type { PopsLoadingDetails } from "../components/loading/indexType";
7
7
  import type { PopsPanelDetails } from "../components/panel/indexType";
8
8
  import type { PopsPromptDetails } from "../components/prompt/indexType";
9
+ import type { PopsCommonConfig } from "../types/components";
9
10
  import { PopsEventDetails, PopsHandlerEventDetails } from "../types/event";
10
11
  import { PopsLayerCommonConfig } from "../types/layer";
11
12
  import type { PopsAllDetails, PopsLayerMode, PopsMode, PopsType } from "../types/main";
@@ -13,16 +14,19 @@ export declare const PopsHandler: {
13
14
  /**
14
15
  * 创建shadow
15
16
  */
16
- handlerShadow(): {
17
+ handlerShadow(config: Pick<PopsCommonConfig, "useShadowRoot">): {
17
18
  $shadowContainer: HTMLDivElement;
18
19
  $shadowRoot: ShadowRoot;
20
+ } | {
21
+ $shadowContainer: HTMLDivElement;
22
+ $shadowRoot: HTMLDivElement;
19
23
  };
20
24
  /**
21
25
  * 处理初始化
22
26
  * @param $shadowRoot 所在的shadowRoot
23
27
  * @param cssText 添加进ShadowRoot的CSS
24
28
  */
25
- handleInit($shadowRoot?: ShadowRoot, cssText?: string | string[]): void;
29
+ handleInit($shadowRoot?: ShadowRoot | HTMLElement, cssText?: string | string[]): void;
26
30
  /**
27
31
  * 处理遮罩层
28
32
  *
@@ -156,7 +160,7 @@ export declare const PopsHandler: {
156
160
  * @param maskElement 遮罩层
157
161
  * @param config 当前配置
158
162
  */
159
- handleEventDetails(guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot, mode: PopsLayerMode, animElement: HTMLDivElement, popsElement: HTMLDivElement, maskElement: HTMLDivElement, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails): PopsEventDetails;
163
+ handleEventDetails(guid: string, $shadowContainer: HTMLDivElement, $shadowRoot: ShadowRoot | HTMLElement, mode: PopsLayerMode, animElement: HTMLDivElement, popsElement: HTMLDivElement, maskElement: HTMLDivElement, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails): PopsEventDetails;
160
164
  /**
161
165
  * 获取loading的事件配置
162
166
  * @param guid
@@ -154,36 +154,50 @@ export interface PopsDragConfig {
154
154
  */
155
155
  export interface PopsCommonConfig {
156
156
  /**
157
- * 自定义的className,默认为空
157
+ * 是否使用shadowRoot
158
+ *
159
+ * @default true
160
+ */
161
+ useShadowRoot?: boolean;
162
+ /**
163
+ * 自定义的className
164
+ *
165
+ * @default ""
158
166
  */
159
167
  class?: string;
160
168
  /**
161
- * 是否是唯一的,默认false
169
+ * 是否是唯一的
170
+ *
162
171
  * @default false
163
172
  */
164
173
  only?: boolean;
165
174
  /**
166
- * 宽度,默认350px
167
- * @default 350
175
+ * 宽度
176
+ *
177
+ * @default "350px"
168
178
  */
169
179
  width: string;
170
180
  /**
171
- * 高度,默认200px
172
- * @default 200
181
+ * 高度
182
+ *
183
+ * @default "200px"
173
184
  */
174
185
  height: string;
175
186
  /**
176
- * 位置,默认center
187
+ * 位置
188
+ *
177
189
  * @default "center"
178
190
  */
179
191
  position?: PopsPosition;
180
192
  /**
181
- * 动画,默认pops-anim-fadein-zoom
193
+ * 动画
194
+ *
182
195
  * @default "pops-anim-fadein-zoom"
183
196
  */
184
197
  animation?: PopsAnimation;
185
198
  /**
186
- * z-index显示层级,默认10000
199
+ * z-index显示层级
200
+ *
187
201
  * @default 10000
188
202
  */
189
203
  zIndex?: number | (() => number);
@@ -192,9 +206,10 @@ export interface PopsCommonConfig {
192
206
  */
193
207
  mask?: PopsMaskDetails;
194
208
  /**
195
- * 是否禁用页面滚动,默认false
209
+ * 是否禁用页面滚动
196
210
  *
197
211
  * 暂时不会生效
212
+ *
198
213
  * @default false
199
214
  */
200
215
  forbiddenScroll?: boolean;
@@ -208,7 +223,7 @@ export interface PopsCommonConfig {
208
223
  * @param $shadowContainer 容器
209
224
  */
210
225
  beforeAppendToPageCallBack?: (
211
- $shadowRoot: ShadowRoot,
226
+ $shadowRoot: ShadowRoot | HTMLElement,
212
227
  $shadowContainer: HTMLDivElement
213
228
  ) => void;
214
229
  }
@@ -36,7 +36,7 @@ export interface PopsEventDetails {
36
36
  /** 最外层包裹的元素 */
37
37
  $shadowContainer: HTMLDivElement;
38
38
  /** ShadowRoot */
39
- $shadowRoot: ShadowRoot;
39
+ $shadowRoot: ShadowRoot | HTMLElement;
40
40
  /** -> 动画层 */
41
41
  element: HTMLDivElement;
42
42
  /** 动画层 */
@@ -16,7 +16,7 @@ export interface PopsLayerCommonConfig extends PopsLayerConfig {
16
16
  /** shadow容器 */
17
17
  $shadowContainer: HTMLDivElement;
18
18
  /** shadow容器的shandowRoot */
19
- $shadowRoot: ShadowRoot;
19
+ $shadowRoot: ShadowRoot | HTMLElement;
20
20
  /** 移除实例前的回调函数 */
21
21
  beforeRemoveCallBack?: (layerCommonConfig: PopsLayerCommonConfig) => void;
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "弹窗库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Pops.ts CHANGED
@@ -83,7 +83,7 @@ class Pops {
83
83
  /** 配置 */
84
84
  config = {
85
85
  /** 版本号 */
86
- version: "2024.11.21",
86
+ version: "2024.11.24",
87
87
  cssText: {
88
88
  /** 主CSS */
89
89
  index: indexCSS,
@@ -34,6 +34,7 @@ export const PopsAlertConfig = (): DeepRequired<PopsAlertDetails> => {
34
34
  },
35
35
  },
36
36
  },
37
+ useShadowRoot: true,
37
38
  class: "",
38
39
  only: false,
39
40
  width: "350px",
@@ -11,7 +11,15 @@ import type { PopsAlertDetails } from "./indexType";
11
11
 
12
12
  export class PopsAlert {
13
13
  constructor(details: PopsAlertDetails) {
14
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
14
+ const guid = popsUtils.getRandomGUID();
15
+ // 设置当前类型
16
+ const PopsType: PopsMode = "alert";
17
+ let config = PopsAlertConfig();
18
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
19
+ config = popsUtils.assign(config, details);
20
+ config = PopsHandler.handleOnly(PopsType, config);
21
+
22
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
15
23
  PopsHandler.handleInit($shadowRoot, [
16
24
  pops.config.cssText.index,
17
25
  pops.config.cssText.ninePalaceGridPosition,
@@ -21,13 +29,6 @@ export class PopsAlert {
21
29
  pops.config.cssText.common,
22
30
  pops.config.cssText.alertCSS,
23
31
  ]);
24
- let config = PopsAlertConfig();
25
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
26
- config = popsUtils.assign(config, details);
27
- let guid = popsUtils.getRandomGUID();
28
- // 设置当前类型
29
- const PopsType: PopsMode = "alert";
30
- config = PopsHandler.handleOnly(PopsType, config);
31
32
 
32
33
  // 先把z-index提取出来
33
34
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
@@ -61,6 +61,7 @@ export const PopsConfirmConfig = (): DeepRequired<PopsConfirmDetails> => {
61
61
  },
62
62
  },
63
63
  },
64
+ useShadowRoot: true,
64
65
  class: "",
65
66
  only: false,
66
67
  width: "350px",
@@ -10,7 +10,15 @@ import type { PopsConfirmDetails } from "./indexType";
10
10
 
11
11
  export class PopsConfirm {
12
12
  constructor(details: PopsConfirmDetails) {
13
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
13
+ const guid = popsUtils.getRandomGUID();
14
+ // 设置当前类型
15
+ const PopsType = "confirm";
16
+ let config = PopsConfirmConfig();
17
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
18
+ config = popsUtils.assign(config, details);
19
+ config = PopsHandler.handleOnly(PopsType, config);
20
+
21
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
14
22
  PopsHandler.handleInit($shadowRoot, [
15
23
  pops.config.cssText.index,
16
24
  pops.config.cssText.ninePalaceGridPosition,
@@ -20,14 +28,6 @@ export class PopsConfirm {
20
28
  pops.config.cssText.common,
21
29
  pops.config.cssText.confirmCSS,
22
30
  ]);
23
- let config = PopsConfirmConfig();
24
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
25
- config = popsUtils.assign(config, details);
26
- let guid = popsUtils.getRandomGUID();
27
- // 设置当前类型
28
- const PopsType = "confirm";
29
-
30
- config = PopsHandler.handleOnly(PopsType, config);
31
31
 
32
32
  // 先把z-index提取出来
33
33
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
@@ -70,6 +70,7 @@ export const PopsDrawerConfig = (): DeepRequired<PopsDrawerDetails> => {
70
70
  },
71
71
  clickCallBack: null,
72
72
  },
73
+ useShadowRoot: true,
73
74
  class: "",
74
75
  zIndex: 10000,
75
76
  only: false,
@@ -9,7 +9,15 @@ import type { PopsDrawerDetails } from "./indexType";
9
9
 
10
10
  export class PopsDrawer {
11
11
  constructor(details: PopsDrawerDetails) {
12
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
12
+ const guid = popsUtils.getRandomGUID();
13
+ // 设置当前类型
14
+ const PopsType = "drawer";
15
+ let config = PopsDrawerConfig();
16
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
17
+ config = popsUtils.assign(config, details);
18
+ config = PopsHandler.handleOnly(PopsType, config);
19
+
20
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
13
21
  PopsHandler.handleInit($shadowRoot, [
14
22
  pops.config.cssText.index,
15
23
  pops.config.cssText.ninePalaceGridPosition,
@@ -19,13 +27,6 @@ export class PopsDrawer {
19
27
  pops.config.cssText.common,
20
28
  pops.config.cssText.drawerCSS,
21
29
  ]);
22
- let config = PopsDrawerConfig();
23
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
24
- config = popsUtils.assign(config, details);
25
- let guid = popsUtils.getRandomGUID();
26
- const PopsType = "drawer";
27
-
28
- config = PopsHandler.handleOnly(PopsType, config);
29
30
 
30
31
  // 先把z-index提取出来
31
32
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
@@ -105,6 +105,7 @@ export const PopsFolderConfig = (): DeepRequired<PopsFolderDetails> => {
105
105
  },
106
106
  },
107
107
  },
108
+ useShadowRoot: true,
108
109
  class: "",
109
110
  only: false,
110
111
  width: "500px",
@@ -11,7 +11,16 @@ import type { PopsFolderDataConfig, PopsFolderDetails } from "./indexType";
11
11
 
12
12
  export class PopsFolder {
13
13
  constructor(details: PopsFolderDetails) {
14
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
14
+ const guid = popsUtils.getRandomGUID();
15
+ // 设置当前类型
16
+ const PopsType = "folder";
17
+
18
+ let config = PopsFolderConfig();
19
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
20
+ config = popsUtils.assign(config, details);
21
+ config = PopsHandler.handleOnly(PopsType, config);
22
+
23
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
15
24
  PopsHandler.handleInit($shadowRoot, [
16
25
  pops.config.cssText.index,
17
26
  pops.config.cssText.ninePalaceGridPosition,
@@ -22,17 +31,19 @@ export class PopsFolder {
22
31
  pops.config.cssText.folderCSS,
23
32
  ]);
24
33
 
25
- let config = PopsFolderConfig();
26
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
27
- config = popsUtils.assign(config, details);
28
-
29
34
  /* 办公几件套 */
30
- (Folder_ICON as any).docx = Folder_ICON.doc;
31
- (Folder_ICON as any).rtf = Folder_ICON.doc;
32
- (Folder_ICON as any).xlsx = Folder_ICON.xls;
33
- (Folder_ICON as any).pptx = Folder_ICON.ppt;
34
- (Folder_ICON as any).dmg = Folder_ICON.ipa;
35
- (Folder_ICON as any).json = Folder_ICON.js;
35
+ // @ts-ignore
36
+ Folder_ICON.docx = Folder_ICON.doc;
37
+ // @ts-ignore;
38
+ Folder_ICON.rtf = Folder_ICON.doc;
39
+ // @ts-ignore
40
+ Folder_ICON.xlsx = Folder_ICON.xls;
41
+ // @ts-ignore
42
+ Folder_ICON.pptx = Folder_ICON.ppt;
43
+ // @ts-ignore;
44
+ Folder_ICON.dmg = Folder_ICON.ipa;
45
+ // @ts-ignore
46
+ Folder_ICON.json = Folder_ICON.js;
36
47
 
37
48
  /* 压缩包 */
38
49
  let zipIconList = [
@@ -73,39 +84,35 @@ export class PopsFolder {
73
84
  let androidIconList = ["apk", "apkm", "xapk"];
74
85
 
75
86
  zipIconList.forEach((keyName) => {
76
- (Folder_ICON as any)[keyName] = Folder_ICON.zip;
87
+ // @ts-ignore
88
+ Folder_ICON[keyName] = Folder_ICON.zip;
77
89
  });
78
90
  imageIconList.forEach((keyName) => {
79
- (Folder_ICON as any)[keyName] = Folder_ICON.png;
91
+ // @ts-ignore
92
+ Folder_ICON[keyName] = Folder_ICON.png;
80
93
  });
81
94
  codeLanguageIconList.forEach((keyName) => {
82
- (Folder_ICON as any)[keyName] = Folder_ICON.html;
95
+ // @ts-ignore
96
+ Folder_ICON[keyName] = Folder_ICON.html;
83
97
  });
84
98
  androidIconList.forEach((keyName) => {
85
- (Folder_ICON as any)[keyName] = Folder_ICON.apk;
99
+ // @ts-ignore
100
+ Folder_ICON[keyName] = Folder_ICON.apk;
86
101
  });
87
102
 
88
103
  if (details?.folder) {
89
104
  // @ts-ignore
90
105
  config.folder = details.folder;
91
106
  }
92
- let guid = popsUtils.getRandomGUID();
93
- const PopsType = "folder";
94
-
95
- config = PopsHandler.handleOnly(PopsType, config);
96
107
 
97
108
  // 先把z-index提取出来
98
109
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
99
110
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
100
111
 
101
112
  let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
102
- let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(
103
- PopsType,
104
- config as any
105
- );
113
+ let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
106
114
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
107
115
  PopsType,
108
-
109
116
  config
110
117
  );
111
118
  let animHTML = PopsElementHandler.getAnimHTML(
@@ -13,6 +13,7 @@ export const PopsIframeConfig = (): DeepRequired<PopsIframeDetails> => {
13
13
  icon: true,
14
14
  text: "",
15
15
  },
16
+ useShadowRoot: true,
16
17
  class: "",
17
18
  url: window.location.href,
18
19
  only: false,
@@ -12,7 +12,19 @@ import type { PopsIframeDetails } from "./indexType";
12
12
 
13
13
  export class PopsIframe {
14
14
  constructor(details: PopsIframeDetails) {
15
- const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow();
15
+ const guid = popsUtils.getRandomGUID();
16
+ // 设置当前类型
17
+ const PopsType = "iframe";
18
+
19
+ let config = PopsIframeConfig();
20
+ config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
21
+ config = popsUtils.assign(config, details);
22
+ if (config.url == null) {
23
+ throw "config.url不能为空";
24
+ }
25
+ config = PopsHandler.handleOnly(PopsType, config);
26
+
27
+ const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
16
28
  PopsHandler.handleInit($shadowRoot, [
17
29
  pops.config.cssText.index,
18
30
  pops.config.cssText.ninePalaceGridPosition,
@@ -21,18 +33,10 @@ export class PopsIframe {
21
33
  pops.config.cssText.common,
22
34
  pops.config.cssText.iframeCSS,
23
35
  ]);
24
- let config = PopsIframeConfig();
25
- config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
26
- config = popsUtils.assign(config, details);
27
- if (config.url == null) {
28
- throw "config.url不能为空";
29
- }
30
- let guid = popsUtils.getRandomGUID();
31
- const PopsType = "iframe";
32
36
 
33
- config = PopsHandler.handleOnly(PopsType, config);
34
37
  let maskExtraStyle =
35
- config.animation != null && (config as any).animation != ""
38
+ // @ts-ignore
39
+ config.animation != null && config.animation != ""
36
40
  ? "position:absolute;"
37
41
  : "";
38
42
 
@@ -8,6 +8,7 @@ export const PopsLoadingConfig = (): DeepRequired<PopsLoadingDetails> => {
8
8
  icon: "loading",
9
9
  style: "",
10
10
  },
11
+ useShadowRoot: true,
11
12
  class: "",
12
13
  only: false,
13
14
  zIndex: 10000,
@@ -416,6 +416,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
416
416
  },
417
417
  clickCallBack: null,
418
418
  },
419
+ useShadowRoot: true,
419
420
  class: "",
420
421
  mobileClassName: "pops-panel-is-mobile",
421
422
  isMobile: false,