@whitesev/pops 2.4.7 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/index.amd.js +319 -159
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +2 -0
  4. package/dist/index.amd.min.js.map +1 -0
  5. package/dist/index.cjs.js +319 -159
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +2 -0
  8. package/dist/index.cjs.min.js.map +1 -0
  9. package/dist/index.esm.js +319 -159
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +2 -0
  12. package/dist/index.esm.min.js.map +1 -0
  13. package/dist/index.iife.js +319 -159
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +2 -0
  16. package/dist/index.iife.min.js.map +1 -0
  17. package/dist/index.system.js +319 -159
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +2 -0
  20. package/dist/index.system.min.js.map +1 -0
  21. package/dist/index.umd.js +319 -159
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +2 -0
  24. package/dist/index.umd.min.js.map +1 -0
  25. package/dist/types/src/Pops.d.ts +35 -31
  26. package/dist/types/src/components/panel/handlerComponents.d.ts +40 -21
  27. package/dist/types/src/components/panel/index.d.ts +1 -1
  28. package/dist/types/src/components/panel/types/components-button.d.ts +8 -19
  29. package/dist/types/src/components/panel/types/components-common.d.ts +23 -0
  30. package/dist/types/src/components/panel/types/components-deepMenu.d.ts +0 -18
  31. package/dist/types/src/components/panel/types/components-forms.d.ts +0 -18
  32. package/dist/types/src/components/panel/types/components-input.d.ts +0 -21
  33. package/dist/types/src/components/panel/types/components-own.d.ts +0 -14
  34. package/dist/types/src/components/panel/types/components-select.d.ts +0 -21
  35. package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +0 -18
  36. package/dist/types/src/components/panel/types/components-slider.d.ts +0 -19
  37. package/dist/types/src/components/panel/types/components-switch.d.ts +0 -21
  38. package/dist/types/src/components/panel/types/components-textarea.d.ts +0 -21
  39. package/dist/types/src/components/panel/types/index.d.ts +78 -11
  40. package/dist/types/src/components/rightClickMenu/index.d.ts +5 -11
  41. package/dist/types/src/components/searchSuggestion/index.d.ts +1 -1
  42. package/dist/types/src/components/tooltip/index.d.ts +3 -3
  43. package/dist/types/src/handler/PopsHandler.d.ts +44 -28
  44. package/dist/types/src/types/global.d.ts +11 -9
  45. package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
  46. package/package.json +2 -1
  47. package/src/PopsAnimation.ts +6 -6
  48. package/src/components/alert/index.ts +4 -4
  49. package/src/components/confirm/index.ts +6 -6
  50. package/src/components/drawer/index.ts +7 -2
  51. package/src/components/folder/index.ts +22 -22
  52. package/src/components/iframe/index.ts +13 -12
  53. package/src/components/loading/index.ts +1 -1
  54. package/src/components/panel/config.ts +58 -5
  55. package/src/components/panel/handlerComponents.ts +161 -74
  56. package/src/components/panel/index.css +30 -6
  57. package/src/components/panel/index.ts +30 -15
  58. package/src/components/panel/types/components-button.ts +8 -21
  59. package/src/components/panel/types/components-common.ts +27 -0
  60. package/src/components/panel/types/components-deepMenu.ts +0 -20
  61. package/src/components/panel/types/components-forms.ts +0 -20
  62. package/src/components/panel/types/components-input.ts +0 -23
  63. package/src/components/panel/types/components-own.ts +0 -14
  64. package/src/components/panel/types/components-select.ts +0 -23
  65. package/src/components/panel/types/components-selectMultiple.ts +0 -20
  66. package/src/components/panel/types/components-slider.ts +0 -21
  67. package/src/components/panel/types/components-switch.ts +0 -23
  68. package/src/components/panel/types/components-textarea.ts +0 -23
  69. package/src/components/panel/types/index.ts +85 -13
  70. package/src/components/prompt/index.ts +7 -7
  71. package/src/components/searchSuggestion/index.ts +5 -11
  72. package/src/handler/PopsHandler.ts +47 -30
  73. package/src/types/global.d.ts +11 -9
  74. package/src/utils/PopsDOMUtils.ts +14 -14
@@ -10,6 +10,7 @@ import type { PopsPanelDeepMenuDetails } from "./components-deepMenu";
10
10
  import type { PopsPanelOwnDetails } from "./components-own";
11
11
  import type { PopsHeaderCloseButtonDetails } from "../../../types/button";
12
12
  import type { PopsPanelSelectMultipleDetails } from "./components-selectMultiple";
13
+ import type { PopsPanelCommonDetails } from "./components-common";
13
14
  /** panel的各种类型的配置项 */
14
15
  export type PopsPanelFormsTotalDetails = PopsPanelSwitchDetails | PopsPanelSliderDetails | PopsPanelInputDetails | PopsPanelTextAreaDetails | PopsPanelSelectDetails<any> | PopsPanelSelectMultipleDetails<any> | PopsPanelButtonDetails | PopsPanelDeepMenuDetails | PopsPanelOwnDetails;
15
16
  /**
@@ -40,11 +41,11 @@ export interface PopsPanelContentConfig {
40
41
  */
41
42
  className?: string | string[];
42
43
  /**
43
- * 左侧的标题,可以是html格式
44
+ * 显示的文本,可以是html格式
44
45
  */
45
46
  title: string | (() => string);
46
47
  /**
47
- * (可选)中间顶部的标题,如果为空,则使用title的值代替
48
+ * (可选)中间顶部的文本,如果为空,则使用title的值代替
48
49
  * @default title
49
50
  */
50
51
  headerTitle?: string | (() => string);
@@ -72,17 +73,11 @@ export interface PopsPanelContentConfig {
72
73
  /**
73
74
  * (可选)自定义元素属性.setAttribute、.getAttribute
74
75
  */
75
- attributes?: {
76
- [key: string]: any;
77
- } | {
78
- [key: string]: any;
79
- }[];
76
+ attributes?: PopsPanelCommonDetails<any>["attributes"];
80
77
  /**
81
78
  * (可选)自定义元素内部的属性值
82
79
  */
83
- props?: {
84
- [K in keyof HTMLElement]?: HTMLElement[K];
85
- };
80
+ props?: PopsPanelCommonDetails<any>["props"];
86
81
  /**
87
82
  * 子配置
88
83
  */
@@ -106,13 +101,81 @@ export interface PopsPanelContentConfig {
106
101
  /**
107
102
  * 配置
108
103
  */
109
- data: {
104
+ config: {
110
105
  /** 容器配置 */
111
106
  asideConfig: PopsPanelContentConfig;
112
107
  /** 左侧容器的元素 */
113
108
  $asideLiElement: HTMLLIElement;
114
109
  }) => void;
115
110
  }
111
+ /**
112
+ * pops.panel的bottomContent配置信息
113
+ */
114
+ export interface PopsPanelBottomContentConfig {
115
+ /**
116
+ * (可选)元素的className,值为空的话就不设置
117
+ * @default ""
118
+ */
119
+ className?: string | string[];
120
+ /**
121
+ * (可选)配置所在位置
122
+ *
123
+ * @default "left"
124
+ */
125
+ position: "left" | "right";
126
+ /**
127
+ * 显示的文本,可以是html格式
128
+ */
129
+ text: string | (() => string);
130
+ /**
131
+ * (可选)是否禁用hover的CSS样式
132
+ * @default false
133
+ */
134
+ disableHoverCSS?: boolean | (() => boolean);
135
+ /**
136
+ * (可选)自定义元素属性.setAttribute、.getAttribute
137
+ * @default {}
138
+ */
139
+ attributes?: {
140
+ [key: string]: any;
141
+ } | {
142
+ [key: string]: any;
143
+ }[];
144
+ /**
145
+ * (可选)自定义元素内部的属性值
146
+ * @default {}
147
+ */
148
+ props?: {
149
+ [K in keyof HTMLElement]?: HTMLElement[K];
150
+ } | {
151
+ [key: string]: any;
152
+ };
153
+ /**
154
+ * 该项的点击回调
155
+ */
156
+ clickCallback?: (
157
+ /**
158
+ * 点击事件
159
+ */
160
+ event: MouseEvent | PointerEvent) => void;
161
+ /**
162
+ * 该项添加到panel后的回调
163
+ */
164
+ afterRender?: (
165
+ /**
166
+ * 配置
167
+ */
168
+ config: {
169
+ /** panel底部区域 */
170
+ $bottomWrapper: HTMLElement;
171
+ /** panel底部区域容器 */
172
+ $bottomContainer: HTMLElement;
173
+ /** panel底部区域左侧容器 */
174
+ $bottomLeftContainer: HTMLElement;
175
+ /** panel底部区域右侧容器 */
176
+ $bottomRightContainer: HTMLElement;
177
+ }) => void;
178
+ }
116
179
  /**
117
180
  * pops.panel
118
181
  */
@@ -121,6 +184,10 @@ export interface PopsPanelDetails extends PopsTitleConfig, PopsDragConfig, PopsC
121
184
  * 内容配置
122
185
  */
123
186
  content: PopsPanelContentConfig[];
187
+ /**
188
+ * 底部内容配置
189
+ */
190
+ bottomContentConfig?: PopsPanelBottomContentConfig[];
124
191
  /**
125
192
  * 右上角的按钮配置
126
193
  */
@@ -1,9 +1,9 @@
1
- import type { PopsRightClickMenuDetails } from "./types";
1
+ import type { PopsRightClickMenuDataDetails, PopsRightClickMenuDetails } from "./types";
2
2
  export declare const PopsRightClickMenu: {
3
3
  init(details: PopsRightClickMenuDetails): {
4
4
  guid: string;
5
5
  config: {
6
- target: HTMLElement | Node | {
6
+ target: Node | HTMLElement | {
7
7
  addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void;
8
8
  dispatchEvent: (event: Event) => boolean;
9
9
  removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void;
@@ -20941,23 +20941,17 @@ export declare const PopsRightClickMenu: {
20941
20941
  };
20942
20942
  };
20943
20943
  targetSelector: string | null;
20944
- data: {
20945
- icon: import("../../types/icon").PopsIconType | string;
20946
- iconIsLoading: boolean;
20947
- text: string | (() => string);
20948
- callback: (clickEvent: PointerEvent, contextMenuEvent: PointerEvent, liElement: HTMLLIElement, menuListenerRootNode: HTMLElement) => boolean | void | Promise<boolean | void>;
20949
- item: /*elided*/ any[] | null;
20950
- }[];
20944
+ data: PopsRightClickMenuDataDetails[];
20951
20945
  chileMenuLeftOrRightDistance: number;
20952
20946
  childMenuTopOrBottomDistance: number;
20953
20947
  className: string;
20954
20948
  isAnimation: boolean;
20955
20949
  useScaleAnimation: boolean;
20956
20950
  preventDefault: boolean;
20957
- useShadowRoot: boolean;
20958
- only: boolean;
20959
20951
  zIndex: number | (() => number);
20960
20952
  style: string | null;
20953
+ useShadowRoot: boolean;
20954
+ only: boolean;
20961
20955
  beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
20962
20956
  };
20963
20957
  removeWindowCheckClickListener: () => void;
@@ -4,7 +4,7 @@ export declare const PopsSearchSuggestion: {
4
4
  /**
5
5
  * 当前的环境,可以是document,可以是shadowroot,默认是document
6
6
  */
7
- selfDocument: Document | ShadowRoot | (Document | ShadowRoot)[];
7
+ selfDocument: ShadowRoot | Document | (ShadowRoot | Document)[];
8
8
  $el: {
9
9
  /** 根元素 */
10
10
  root: HTMLElement;
@@ -219,14 +219,14 @@ export declare const PopsTooltip: {
219
219
  showArrow: boolean;
220
220
  arrowDistance: number;
221
221
  otherDistance: number;
222
- useShadowRoot: boolean;
223
- only: boolean;
224
222
  zIndex: number | (() => number);
225
223
  style: string | null;
224
+ useShadowRoot: boolean;
225
+ only: boolean;
226
226
  beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
227
227
  };
228
228
  $shadowContainer: HTMLDivElement;
229
- $shadowRoot: HTMLDivElement | ShadowRoot;
229
+ $shadowRoot: ShadowRoot | HTMLDivElement;
230
230
  toolTip: ToolTip;
231
231
  };
232
232
  };
@@ -54,107 +54,123 @@ export declare const PopsHandler: {
54
54
  /**
55
55
  * 主元素
56
56
  */
57
- popsElement: HTMLDivElement;
57
+ $pops: HTMLDivElement;
58
58
  /**
59
59
  * 确认按钮
60
60
  */
61
- btnOkElement: HTMLDivElement;
61
+ $btnOk: HTMLDivElement;
62
62
  /**
63
63
  * 取消按钮
64
64
  */
65
- btnCancelElement: HTMLDivElement;
65
+ $btnCancel: HTMLDivElement;
66
66
  /**
67
67
  * 其它按钮
68
68
  */
69
- btnOtherElement: HTMLDivElement;
69
+ $btnOther: HTMLDivElement;
70
70
  /**
71
71
  * 标题元素
72
72
  */
73
- titleElement: HTMLDivElement;
73
+ $title: HTMLDivElement;
74
74
  /**
75
75
  * 输入框元素
76
76
  */
77
- inputElement: HTMLInputElement | HTMLTextAreaElement;
77
+ $input: HTMLInputElement | HTMLTextAreaElement;
78
78
  /**
79
79
  * 顶部按钮控制层元素
80
80
  */
81
- headerControlsElement: HTMLDivElement;
81
+ $headerControls: HTMLDivElement;
82
82
  /**
83
83
  * iframe元素
84
84
  */
85
- iframeElement: HTMLIFrameElement;
85
+ $iframe: HTMLIFrameElement;
86
86
  /**
87
87
  * 加载中元素
88
88
  */
89
- loadingElement: HTMLDivElement;
89
+ $loading: HTMLDivElement;
90
90
  /**
91
91
  * 内容元素
92
92
  */
93
- contentElement: HTMLDivElement;
93
+ $content: HTMLDivElement;
94
94
  /**
95
95
  * panel的右侧容器元素
96
96
  */
97
- panelSectionWrapper: HTMLDivElement;
97
+ $panelRightSectionWrapper: HTMLDivElement;
98
98
  /**
99
- * 内容侧边栏容器元素
99
+ * panel侧边栏容器元素
100
100
  */
101
- contentAsideElement: HTMLDivElement;
101
+ $panelLeftAside: HTMLDivElement;
102
102
  /**
103
- * 内容主要区域容器元素
103
+ * panel主要区域容器元素
104
104
  */
105
- contentSectionContainerElement: HTMLDivElement;
105
+ $panelContentSectionContainer: HTMLDivElement;
106
+ /**
107
+ * panel底部区域
108
+ */
109
+ $panelBottomWrapper: HTMLElement;
110
+ /**
111
+ * panel底部区域容器
112
+ */
113
+ $panelBottomContainer: HTMLElement;
114
+ /**
115
+ * panel底部区域左侧容器
116
+ */
117
+ $panelBottomLeftContainer: HTMLElement;
118
+ /**
119
+ * panel底部区域右侧容器
120
+ */
121
+ $panelBottomRightContainer: HTMLElement;
106
122
  /**
107
123
  * 内容加载中元素
108
124
  */
109
- contentLoadingElement: HTMLDivElement;
125
+ $contentLoading: HTMLDivElement;
110
126
  /**
111
127
  * 顶部缩小按钮
112
128
  */
113
- headerMinBtnElement: HTMLDivElement;
129
+ $headerBtnMin: HTMLDivElement;
114
130
  /**
115
131
  * 顶部放大按钮
116
132
  */
117
- headerMaxBtnElement: HTMLDivElement;
133
+ $headerBtnMax: HTMLDivElement;
118
134
  /**
119
135
  * 顶部恢复原样按钮
120
136
  */
121
- headerMiseBtnElement: HTMLDivElement;
137
+ $headerBtnMise: HTMLDivElement;
122
138
  /**
123
139
  * 顶部关闭按钮
124
140
  */
125
- headerCloseBtnElement: HTMLDivElement;
141
+ $headerBtnClose: HTMLDivElement;
126
142
  /**
127
143
  * 文件夹列表元素
128
144
  */
129
- folderListElement: HTMLDivElement;
145
+ $folderList: HTMLDivElement;
130
146
  /**
131
147
  * 文件夹列表顶部元素
132
148
  */
133
- folderListHeaderElement: HTMLDivElement;
149
+ $folderHeaderNav: HTMLDivElement;
134
150
  /**
135
151
  * 文件夹列表行元素
136
152
  */
137
- folderListHeaderRowElement: HTMLTableRowElement;
153
+ $folderHeaderRow: HTMLTableRowElement;
138
154
  /**
139
155
  * 文件夹列表tbody元素
140
156
  */
141
- folderListBodyElement: HTMLTableElement;
157
+ $folderTbody: HTMLTableElement;
142
158
  /**
143
159
  * 文件夹列表primary元素
144
160
  */
145
- folderFileListBreadcrumbPrimaryElement: HTMLDivElement;
161
+ $folderHeaderBreadcrumbPrimary: HTMLDivElement;
146
162
  /**
147
163
  * 文件夹排序按钮-文件名
148
164
  */
149
- folderListSortFileNameElement: HTMLDivElement;
165
+ $folderSortFileName: HTMLDivElement;
150
166
  /**
151
167
  * 文件夹排序按钮-修改时间
152
168
  */
153
- folderListSortLatestTimeElement: HTMLDivElement;
169
+ $folderSortLatestTime: HTMLDivElement;
154
170
  /**
155
171
  * 文件夹排序按钮-文件大小
156
172
  */
157
- folderListSortFileSizeElement: HTMLDivElement;
173
+ $folderSortFileSize: HTMLDivElement;
158
174
  };
159
175
  /**
160
176
  * 获取事件配置
@@ -13,13 +13,15 @@ declare interface Window {
13
13
  trustedTypes: any;
14
14
  }
15
15
 
16
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
17
- declare type DeepRequired<T> = T extends Function
16
+ declare type DeepRequired<T> = T extends any[]
18
17
  ? T
19
- : T extends object
20
- ? T extends Node
21
- ? T
22
- : {
23
- [K in keyof T]-?: DeepRequired<T[K]>;
24
- }
25
- : T;
18
+ : // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
19
+ T extends Function
20
+ ? T
21
+ : T extends object
22
+ ? T extends Node
23
+ ? T
24
+ : {
25
+ [K in keyof T]-?: DeepRequired<T[K]>;
26
+ }
27
+ : T;
@@ -657,7 +657,7 @@ declare class PopsDOMUtils extends PopsDOMUtilsEvent {
657
657
  * DOMUtils.parseHTML("<a href='xxxx'></a><a href='xxxx'></a>",true, true)
658
658
  * > #document
659
659
  */
660
- parseHTML<T1 extends boolean, T2 extends boolean>(html: string, useParser?: T1, isComplete?: T2): ParseHTMLReturnType<T1, T2>;
660
+ toElement<T1 extends boolean, T2 extends boolean>(html: string, useParser?: T1, isComplete?: T2): ParseHTMLReturnType<T1, T2>;
661
661
  /**
662
662
  * 函数在元素内部末尾添加子元素或HTML字符串
663
663
  * @param element 目标元素
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.4.7",
3
+ "version": "2.5.1",
4
4
  "description": "弹窗库",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/WhiteSevs/TamperMonkeyScript/tree/master/lib/pops#readme",
@@ -48,6 +48,7 @@
48
48
  "@rollup/plugin-commonjs": "^28.0.6",
49
49
  "@rollup/plugin-json": "^6.1.0",
50
50
  "@rollup/plugin-node-resolve": "^16.0.1",
51
+ "@rollup/plugin-terser": "^0.4.4",
51
52
  "@rollup/plugin-typescript": "12.1.4",
52
53
  "browserslist": "^4.26.2",
53
54
  "caniuse-lite": "^1.0.30001743",
@@ -1,6 +1,5 @@
1
1
  import { PopsCSS } from "./PopsCSS";
2
2
  import { popsDOMUtils } from "./utils/PopsDOMUtils";
3
- import { PopsSafeUtils } from "./utils/PopsSafeUtils";
4
3
  import { popsUtils } from "./utils/PopsUtils";
5
4
 
6
5
  export const PopsAnimation = {
@@ -13,13 +12,14 @@ export const PopsAnimation = {
13
12
  if (!this.$flag.isInit) {
14
13
  this.$flag.isInit = true;
15
14
  /* 处理获取当前所有的动画名 */
16
- const animationStyle = document.createElement("style");
17
- PopsSafeUtils.setSafeHTML(animationStyle, PopsCSS.anim);
18
- popsDOMUtils.appendHead(animationStyle);
15
+ const $style = popsDOMUtils.createElement("style", {
16
+ innerHTML: PopsCSS.anim,
17
+ });
18
+ popsDOMUtils.appendHead($style);
19
19
  this.$data = null as any;
20
- this.$data = popsDOMUtils.getKeyFrames(animationStyle.sheet!);
20
+ this.$data = popsDOMUtils.getKeyFrames($style.sheet!);
21
21
  popsUtils.setTimeout(() => {
22
- animationStyle.remove();
22
+ $style.remove();
23
23
  }, 50);
24
24
  }
25
25
  },
@@ -82,10 +82,10 @@ export const PopsAlert = {
82
82
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
83
83
 
84
84
  const {
85
- popsElement: $pops,
86
- headerCloseBtnElement: $headerCloseBtn,
87
- btnOkElement,
88
- titleElement: $title,
85
+ $pops: $pops,
86
+ $headerBtnClose: $headerCloseBtn,
87
+ $btnOk: btnOkElement,
88
+ $title: $title,
89
89
  } = PopsHandler.handleQueryElement($anim, popsType);
90
90
 
91
91
  /** 遮罩层元素 */
@@ -84,12 +84,12 @@ export const PopsConfirm = {
84
84
  */
85
85
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
86
86
  const {
87
- popsElement: $pops,
88
- titleElement: $title,
89
- headerCloseBtnElement: $btnClose,
90
- btnOkElement: $btnOk,
91
- btnCancelElement: $btnCancel,
92
- btnOtherElement: $btnOther,
87
+ $pops: $pops,
88
+ $title: $title,
89
+ $headerBtnClose: $btnClose,
90
+ $btnOk: $btnOk,
91
+ $btnCancel: $btnCancel,
92
+ $btnOther: $btnOther,
93
93
  } = PopsHandler.handleQueryElement($anim, popsType);
94
94
  /**
95
95
  * 遮罩层元素
@@ -84,8 +84,13 @@ export const PopsDrawer = {
84
84
  * 弹窗的主元素,包括动画层
85
85
  */
86
86
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
87
- const { popsElement, headerCloseBtnElement, btnCancelElement, btnOkElement, btnOtherElement } =
88
- PopsHandler.handleQueryElement($anim, popsType);
87
+ const {
88
+ $pops: popsElement,
89
+ $headerBtnClose: headerCloseBtnElement,
90
+ $btnCancel: btnCancelElement,
91
+ $btnOk: btnOkElement,
92
+ $btnOther: btnOtherElement,
93
+ } = PopsHandler.handleQueryElement($anim, popsType);
89
94
  const $pops = popsElement!;
90
95
  const $headerCloseBtn = headerCloseBtnElement!;
91
96
  const $btnCancel = btnCancelElement!;
@@ -232,21 +232,21 @@ export const PopsFolder = {
232
232
  */
233
233
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
234
234
  const {
235
- popsElement: $pops,
236
- titleElement: $title,
237
- contentElement: $content,
235
+ $pops: $pops,
236
+ $title: $title,
237
+ $content: $content,
238
238
  // folderListElement,
239
239
  // folderListHeaderElement,
240
240
  // folderListHeaderRowElement,
241
- folderListBodyElement,
242
- folderFileListBreadcrumbPrimaryElement,
243
- headerCloseBtnElement: $btnCloseBtn,
244
- btnOkElement,
245
- btnCancelElement,
246
- btnOtherElement,
247
- folderListSortFileNameElement,
248
- folderListSortLatestTimeElement,
249
- folderListSortFileSizeElement,
241
+ $folderTbody: folderListBodyElement,
242
+ $folderHeaderBreadcrumbPrimary: folderFileListBreadcrumbPrimaryElement,
243
+ $headerBtnClose: $btnCloseBtn,
244
+ $btnOk: btnOkElement,
245
+ $btnCancel: btnCancelElement,
246
+ $btnOther: btnOtherElement,
247
+ $folderSortFileName: folderListSortFileNameElement,
248
+ $folderSortLatestTime: folderListSortLatestTimeElement,
249
+ $folderSortFileSize: folderListSortFileSizeElement,
250
250
  } = PopsHandler.handleQueryElement($anim, popsType);
251
251
 
252
252
  /**
@@ -681,14 +681,14 @@ export const PopsFolder = {
681
681
  }
682
682
  if (downloadInfo.mode === "a" || downloadInfo.mode === "aBlank") {
683
683
  /* a标签下载 */
684
- const downloadLinkElement = document.createElement("a");
684
+ const $anchor = popsDOMUtils.createElement("a");
685
685
 
686
686
  if (downloadInfo.mode === "aBlank") {
687
- downloadLinkElement.setAttribute("target", "_blank");
687
+ $anchor.setAttribute("target", "_blank");
688
688
  }
689
689
 
690
- downloadLinkElement.href = downloadInfo.url;
691
- downloadLinkElement.click();
690
+ $anchor.href = downloadInfo.url;
691
+ $anchor.click();
692
692
  } else if (downloadInfo.mode === "open" || downloadInfo.mode === "openBlank") {
693
693
  /* window.open下载 */
694
694
 
@@ -699,18 +699,18 @@ export const PopsFolder = {
699
699
  }
700
700
  } else if (downloadInfo.mode === "iframe") {
701
701
  /* iframe下载 */
702
- const downloadIframeLinkElement = document.createElement("iframe");
702
+ const $downloadIframe = popsDOMUtils.createElement("iframe");
703
703
 
704
- downloadIframeLinkElement.src = downloadInfo.url;
705
- downloadIframeLinkElement.onload = function () {
704
+ $downloadIframe.src = downloadInfo.url;
705
+ $downloadIframe.onload = function () {
706
706
  popsUtils.setTimeout(() => {
707
- downloadIframeLinkElement.remove();
707
+ $downloadIframe.remove();
708
708
  }, 1000);
709
709
  };
710
- $shadowRoot.appendChild(downloadIframeLinkElement);
710
+ $shadowRoot.appendChild($downloadIframe);
711
711
  popsUtils.setTimeout(
712
712
  () => {
713
- downloadIframeLinkElement.remove();
713
+ $downloadIframe.remove();
714
714
  },
715
715
  3 * 60 * 1000
716
716
  );
@@ -92,21 +92,22 @@ export const PopsIframe = {
92
92
 
93
93
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
94
94
  const {
95
- popsElement: $pops,
96
- headerCloseBtnElement,
97
- headerControlsElement,
98
- titleElement: $title,
99
- iframeElement: $iframe,
100
- loadingElement,
101
- contentLoadingElement: $contentLoading,
102
- headerMinBtnElement,
103
- headerMaxBtnElement,
104
- headerMiseBtnElement,
95
+ $pops: $pops,
96
+ $headerBtnClose: headerCloseBtnElement,
97
+ $headerControls: headerControlsElement,
98
+ $title: $title,
99
+ $iframe: $iframe,
100
+ $loading: loadingElement,
101
+ $contentLoading: $contentLoading,
102
+ $headerBtnMin: headerMinBtnElement,
103
+ $headerBtnMax: headerMaxBtnElement,
104
+ $headerBtnMise: headerMiseBtnElement,
105
105
  } = PopsHandler.handleQueryElement($anim, popsType);
106
106
  let $iframeContainer = PopsCore.document.querySelector<HTMLDivElement>(".pops-iframe-container");
107
107
  if (!$iframeContainer) {
108
- $iframeContainer = PopsCore.document.createElement("div");
109
- $iframeContainer.className = "pops-iframe-container";
108
+ $iframeContainer = popsDOMUtils.createElement("div", {
109
+ className: "pops-iframe-container",
110
+ });
110
111
  $iframeContainer.style.cssText =
111
112
  "display: flex;position: fixed;bottom: 0px;flex-flow: wrap-reverse;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;";
112
113
  popsDOMUtils.appendBody($iframeContainer);
@@ -52,7 +52,7 @@ export const PopsLoading = {
52
52
 
53
53
  const $anim = PopsElementHandler.parseElement<HTMLDivElement>(animHTML);
54
54
 
55
- const { popsElement: $pops } = PopsHandler.handleQueryElement($anim, PopsType);
55
+ const { $pops: $pops } = PopsHandler.handleQueryElement($anim, PopsType);
56
56
  /**
57
57
  * 遮罩层元素
58
58
  */