@whitesev/pops 2.0.9 → 2.0.11
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.
- package/dist/index.amd.js +1904 -1733
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +1904 -1733
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1904 -1733
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +1904 -1733
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +1904 -1733
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +1904 -1733
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +50 -30
- package/dist/types/src/PopsAnimation.d.ts +14 -0
- package/dist/types/src/PopsCSS.d.ts +34 -0
- package/dist/types/src/PopsIcon.d.ts +25 -0
- package/dist/types/src/PopsLayer.d.ts +3 -0
- package/dist/types/src/components/panel/buttonType.d.ts +2 -2
- package/dist/types/src/components/panel/selectMultipleType.d.ts +12 -15
- package/dist/types/src/components/rightClickMenu/index.d.ts +1 -2
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +2 -2
- package/dist/types/src/types/button.d.ts +3 -3
- package/dist/types/src/types/icon.d.ts +1 -1
- package/dist/types/src/utils/PopsDOMUtils.d.ts +12 -0
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +0 -6
- package/dist/types/src/utils/PopsUtils.d.ts +5 -6
- package/package.json +3 -2
- package/src/Pops.ts +12 -152
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsIcon.ts +93 -0
- package/src/PopsLayer.ts +17 -0
- package/src/components/alert/index.ts +8 -8
- package/src/components/confirm/index.ts +8 -8
- package/src/components/drawer/index.ts +8 -8
- package/src/components/folder/index.ts +15 -15
- package/src/components/iframe/index.ts +9 -12
- package/src/components/loading/index.ts +5 -5
- package/src/components/panel/PanelHandleContentDetails.ts +338 -220
- package/src/components/panel/buttonType.ts +2 -2
- package/src/components/panel/config.ts +41 -11
- package/src/components/panel/index.css +33 -0
- package/src/components/panel/index.ts +9 -9
- package/src/components/panel/selectMultipleType.ts +18 -15
- package/src/components/prompt/index.ts +8 -8
- package/src/components/rightClickMenu/config.ts +7 -7
- package/src/components/rightClickMenu/index.ts +9 -10
- package/src/components/rightClickMenu/indexType.ts +2 -2
- package/src/components/searchSuggestion/index.ts +5 -5
- package/src/components/tooltip/index.ts +5 -5
- package/src/handler/PopsElementHandler.ts +17 -17
- package/src/handler/PopsHandler.ts +22 -19
- package/src/types/button.d.ts +3 -3
- package/src/types/icon.d.ts +1 -1
- package/src/utils/PopsDOMUtils.ts +34 -1
- package/src/utils/PopsInstanceUtils.ts +13 -31
- package/src/utils/PopsUtils.ts +7 -16
package/src/Pops.ts
CHANGED
|
@@ -1,57 +1,11 @@
|
|
|
1
1
|
import { popsDOMUtils } from "./utils/PopsDOMUtils";
|
|
2
2
|
import { PopsInstanceUtils } from "./utils/PopsInstanceUtils";
|
|
3
3
|
import { popsUtils } from "./utils/PopsUtils";
|
|
4
|
-
import indexCSS from "./css/index.css";
|
|
5
|
-
import ninePalaceGridPositionCSS from "./css/ninePalaceGridPosition.css";
|
|
6
|
-
import scrollbarCSS from "./css/scrollbar.css";
|
|
7
|
-
import buttonCSS from "./css/button.css";
|
|
8
|
-
import commonCSS from "./css/common.css";
|
|
9
|
-
import animCSS from "./css/animation.css";
|
|
10
|
-
import alertCSS from "./components/alert/index.css";
|
|
11
|
-
import confirmCSS from "./components/confirm/index.css";
|
|
12
|
-
import promptCSS from "./components/prompt/index.css";
|
|
13
|
-
import loadingCSS from "./components/loading/index.css";
|
|
14
|
-
import iframeCSS from "./components/iframe/index.css";
|
|
15
|
-
import tooltipCSS from "./components/tooltip/index.css";
|
|
16
|
-
import drawerCSS from "./components/drawer/index.css";
|
|
17
|
-
import folderCSS from "./components/folder/index.css";
|
|
18
|
-
import panelCSS from "./components/panel/index.css";
|
|
19
|
-
import rightClickMenuCSS from "./components/rightClickMenu/index.css";
|
|
20
|
-
import SVG_min from "./svg/min.svg";
|
|
21
|
-
import SVG_mise from "./svg/mise.svg";
|
|
22
|
-
import SVG_max from "./svg/max.svg";
|
|
23
|
-
import SVG_close from "./svg/close.svg";
|
|
24
|
-
import SVG_edit from "./svg/edit.svg";
|
|
25
|
-
import SVG_share from "./svg/share.svg";
|
|
26
|
-
import SVG_delete from "./svg/delete.svg";
|
|
27
|
-
import SVG_search from "./svg/search.svg";
|
|
28
|
-
import SVG_upload from "./svg/upload.svg";
|
|
29
|
-
import SVG_loading from "./svg/loading.svg";
|
|
30
|
-
import SVG_next from "./svg/next.svg";
|
|
31
|
-
import SVG_prev from "./svg/prev.svg";
|
|
32
|
-
import SVG_eleme from "./svg/eleme.svg";
|
|
33
|
-
import SVG_elemePlus from "./svg/elemePlus.svg";
|
|
34
|
-
import SVG_chromeFilled from "./svg/chromeFilled.svg";
|
|
35
|
-
import SVG_cpu from "./svg/cpu.svg";
|
|
36
|
-
import SVG_videoPlay from "./svg/videoPlay.svg";
|
|
37
|
-
import SVG_videoPause from "./svg/videoPause.svg";
|
|
38
|
-
import SVG_headset from "./svg/headset.svg";
|
|
39
|
-
import SVG_monitor from "./svg/monitor.svg";
|
|
40
|
-
import SVG_documentCopy from "./svg/documentCopy.svg";
|
|
41
|
-
import SVG_picture from "./svg/picture.svg";
|
|
42
|
-
import SVG_circleClose from "./svg/circleClose.svg";
|
|
43
|
-
import SVG_view from "./svg/view.svg";
|
|
44
|
-
import SVG_hide from "./svg/hide.svg";
|
|
45
|
-
import SVG_keyboard from "./svg/keyboard.svg";
|
|
46
|
-
import SVG_arrowRight from "./svg/arrowRight.svg";
|
|
47
|
-
import SVG_arrowLeft from "./svg/arrowLeft.svg";
|
|
48
4
|
import { PopsCore } from "./Core";
|
|
49
|
-
import { PopsLayerMode } from "./types/main";
|
|
50
5
|
import { PopsAlert } from "./components/alert";
|
|
51
6
|
import type { PopsAlertDetails } from "./components/alert/indexType";
|
|
52
7
|
import { PopsConfirm } from "./components/confirm";
|
|
53
8
|
import type { PopsConfirmDetails } from "./components/confirm/indexType";
|
|
54
|
-
import type { PopsLayerCommonConfig } from "./types/layer";
|
|
55
9
|
import type { PopsPromptDetails } from "./components/prompt/indexType";
|
|
56
10
|
import { PopsPrompt } from "./components/prompt";
|
|
57
11
|
import type { PopsLoadingDetails } from "./components/loading/indexType";
|
|
@@ -67,108 +21,29 @@ import type { PopsPanelDetails } from "./components/panel/indexType";
|
|
|
67
21
|
import { PopsPanel } from "./components/panel";
|
|
68
22
|
import { PopsRightClickMenu } from "./components/rightClickMenu";
|
|
69
23
|
import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/indexType";
|
|
70
|
-
import type { PopsIcon } from "./types/icon";
|
|
71
24
|
import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/indexType";
|
|
72
25
|
import { PopsSearchSuggestion } from "./components/searchSuggestion";
|
|
73
26
|
import { PopsMathFloatUtils } from "./utils/PopsMathUtils";
|
|
74
27
|
import { PanelHandleContentDetails } from "./components/panel/PanelHandleContentDetails";
|
|
75
28
|
import { GlobalConfig } from "./GlobalConfig";
|
|
76
29
|
import { PopsTooltip } from "./components/tooltip";
|
|
77
|
-
import {
|
|
30
|
+
import { PopsCSS } from "./PopsCSS";
|
|
31
|
+
import { PopsIcon } from "./PopsIcon";
|
|
32
|
+
import { PopsLayer } from "./PopsLayer";
|
|
33
|
+
import { PopsAnimation } from "./PopsAnimation";
|
|
78
34
|
|
|
79
35
|
class Pops {
|
|
80
36
|
/** 配置 */
|
|
81
37
|
config = {
|
|
82
38
|
/** 版本号 */
|
|
83
|
-
version: "2025.
|
|
84
|
-
cssText:
|
|
85
|
-
/** 主CSS */
|
|
86
|
-
index: indexCSS,
|
|
87
|
-
/** 九宫格位置CSS */
|
|
88
|
-
ninePalaceGridPosition: ninePalaceGridPositionCSS,
|
|
89
|
-
/** 滚动条CSS */
|
|
90
|
-
scrollbar: scrollbarCSS,
|
|
91
|
-
/** 按钮CSS */
|
|
92
|
-
button: buttonCSS,
|
|
93
|
-
/** 通用的CSS */
|
|
94
|
-
common: commonCSS,
|
|
95
|
-
/** 动画 */
|
|
96
|
-
anim: animCSS,
|
|
97
|
-
/** pops.alert */
|
|
98
|
-
alertCSS: alertCSS,
|
|
99
|
-
/** pops.cponfirm */
|
|
100
|
-
confirmCSS: confirmCSS,
|
|
101
|
-
/** pops.prompt */
|
|
102
|
-
promptCSS: promptCSS,
|
|
103
|
-
/** pops.loading */
|
|
104
|
-
loadingCSS: loadingCSS,
|
|
105
|
-
/** pops.iframe */
|
|
106
|
-
iframeCSS: iframeCSS,
|
|
107
|
-
/** pops.tooltip */
|
|
108
|
-
tooltipCSS: tooltipCSS,
|
|
109
|
-
/** pops.drawer */
|
|
110
|
-
drawerCSS: drawerCSS,
|
|
111
|
-
/** pops.folder */
|
|
112
|
-
folderCSS: folderCSS,
|
|
113
|
-
/** pops.folder */
|
|
114
|
-
panelCSS: panelCSS,
|
|
115
|
-
/** pops.rightClickMenu */
|
|
116
|
-
rightClickMenu: rightClickMenuCSS,
|
|
117
|
-
},
|
|
39
|
+
version: "2025.6.4",
|
|
40
|
+
cssText: PopsCSS,
|
|
118
41
|
/** icon图标的svg代码 */
|
|
119
|
-
iconSVG:
|
|
120
|
-
min: SVG_min,
|
|
121
|
-
mise: SVG_mise,
|
|
122
|
-
max: SVG_max,
|
|
123
|
-
close: SVG_close,
|
|
124
|
-
edit: SVG_edit,
|
|
125
|
-
share: SVG_share,
|
|
126
|
-
delete: SVG_delete,
|
|
127
|
-
search: SVG_search,
|
|
128
|
-
upload: SVG_upload,
|
|
129
|
-
loading: SVG_loading,
|
|
130
|
-
next: SVG_next,
|
|
131
|
-
prev: SVG_prev,
|
|
132
|
-
eleme: SVG_eleme,
|
|
133
|
-
elemePlus: SVG_elemePlus,
|
|
134
|
-
chromeFilled: SVG_chromeFilled,
|
|
135
|
-
cpu: SVG_cpu,
|
|
136
|
-
videoPlay: SVG_videoPlay,
|
|
137
|
-
videoPause: SVG_videoPause,
|
|
138
|
-
headset: SVG_headset,
|
|
139
|
-
monitor: SVG_monitor,
|
|
140
|
-
documentCopy: SVG_documentCopy,
|
|
141
|
-
picture: SVG_picture,
|
|
142
|
-
circleClose: SVG_circleClose,
|
|
143
|
-
view: SVG_view,
|
|
144
|
-
hide: SVG_hide,
|
|
145
|
-
keyboard: SVG_keyboard,
|
|
146
|
-
arrowRight: SVG_arrowRight,
|
|
147
|
-
arrowLeft: SVG_arrowLeft,
|
|
148
|
-
} as {
|
|
149
|
-
[key in PopsIcon]: string;
|
|
150
|
-
},
|
|
42
|
+
iconSVG: PopsIcon.$data,
|
|
151
43
|
/** 当前已配置的动画@keyframes名字映射(初始化时生成) */
|
|
152
|
-
animation:
|
|
153
|
-
[key: string]: CSSKeyframesRule;
|
|
154
|
-
},
|
|
155
|
-
/** 是否初始化 */
|
|
156
|
-
isInit: false,
|
|
44
|
+
animation: PopsAnimation.$data,
|
|
157
45
|
/** 存储已创建的元素 */
|
|
158
|
-
layer:
|
|
159
|
-
alert: [],
|
|
160
|
-
confirm: [],
|
|
161
|
-
prompt: [],
|
|
162
|
-
loading: [],
|
|
163
|
-
iframe: [],
|
|
164
|
-
tooltip: [],
|
|
165
|
-
drawer: [],
|
|
166
|
-
folder: [],
|
|
167
|
-
panel: [],
|
|
168
|
-
rightClickMenu: [],
|
|
169
|
-
} as {
|
|
170
|
-
[key in PopsLayerMode]: PopsLayerCommonConfig[];
|
|
171
|
-
},
|
|
46
|
+
layer: PopsLayer,
|
|
172
47
|
/** 禁止滚动 */
|
|
173
48
|
forbiddenScroll: {
|
|
174
49
|
event(event: Event) {
|
|
@@ -186,22 +61,7 @@ class Pops {
|
|
|
186
61
|
/** pops.panel中用于处理各个类型的工具 */
|
|
187
62
|
panelHandleContentUtils: PanelHandleContentDetails,
|
|
188
63
|
};
|
|
189
|
-
init() {
|
|
190
|
-
if (!this.config.isInit) {
|
|
191
|
-
/* 处理获取当前所有的动画名 */
|
|
192
|
-
this.config.isInit = true;
|
|
193
|
-
let animationStyle = document.createElement("style");
|
|
194
|
-
PopsSafeUtils.setSafeHTML(animationStyle, this.config.cssText.anim);
|
|
195
|
-
popsDOMUtils.appendHead(animationStyle);
|
|
196
|
-
this.config.animation = null as any;
|
|
197
|
-
this.config.animation = PopsInstanceUtils.getKeyFrames(
|
|
198
|
-
animationStyle.sheet!
|
|
199
|
-
);
|
|
200
|
-
popsUtils.setTimeout(() => {
|
|
201
|
-
animationStyle.remove();
|
|
202
|
-
}, 50);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
64
|
+
init() {}
|
|
205
65
|
/**
|
|
206
66
|
* 释放原有的pops控制权
|
|
207
67
|
* @example
|
|
@@ -224,8 +84,8 @@ class Pops {
|
|
|
224
84
|
* 通过navigator.userAgent判断是否是手机访问
|
|
225
85
|
* @param userAgent
|
|
226
86
|
*/
|
|
227
|
-
isPhone(userAgent
|
|
228
|
-
return
|
|
87
|
+
isPhone(userAgent?: string) {
|
|
88
|
+
return popsUtils.isPhone(userAgent);
|
|
229
89
|
}
|
|
230
90
|
/**
|
|
231
91
|
* 为所有弹窗设置全局属性
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PopsCSS } from "./PopsCSS";
|
|
2
|
+
import { popsDOMUtils } from "./utils/PopsDOMUtils";
|
|
3
|
+
import { PopsSafeUtils } from "./utils/PopsSafeUtils";
|
|
4
|
+
import { popsUtils } from "./utils/PopsUtils";
|
|
5
|
+
|
|
6
|
+
export const PopsAnimation = {
|
|
7
|
+
$data: {} as { [key: string]: CSSKeyframesRule },
|
|
8
|
+
$flag: {
|
|
9
|
+
/** 是否初始化 */
|
|
10
|
+
isInit: false,
|
|
11
|
+
},
|
|
12
|
+
init() {
|
|
13
|
+
if (!this.$flag.isInit) {
|
|
14
|
+
this.$flag.isInit = true;
|
|
15
|
+
/* 处理获取当前所有的动画名 */
|
|
16
|
+
let animationStyle = document.createElement("style");
|
|
17
|
+
PopsSafeUtils.setSafeHTML(animationStyle, PopsCSS.anim);
|
|
18
|
+
popsDOMUtils.appendHead(animationStyle);
|
|
19
|
+
this.$data = null as any;
|
|
20
|
+
this.$data = popsDOMUtils.getKeyFrames(animationStyle.sheet!);
|
|
21
|
+
popsUtils.setTimeout(() => {
|
|
22
|
+
animationStyle.remove();
|
|
23
|
+
}, 50);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* 判断是否存在某个动画名
|
|
28
|
+
*/
|
|
29
|
+
hasAnim(name: string) {
|
|
30
|
+
return this.$data.hasOwnProperty(name);
|
|
31
|
+
},
|
|
32
|
+
};
|
package/src/PopsCSS.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import indexCSS from "./css/index.css";
|
|
2
|
+
import ninePalaceGridPositionCSS from "./css/ninePalaceGridPosition.css";
|
|
3
|
+
import scrollbarCSS from "./css/scrollbar.css";
|
|
4
|
+
import buttonCSS from "./css/button.css";
|
|
5
|
+
import commonCSS from "./css/common.css";
|
|
6
|
+
import animCSS from "./css/animation.css";
|
|
7
|
+
import alertCSS from "./components/alert/index.css";
|
|
8
|
+
import confirmCSS from "./components/confirm/index.css";
|
|
9
|
+
import promptCSS from "./components/prompt/index.css";
|
|
10
|
+
import loadingCSS from "./components/loading/index.css";
|
|
11
|
+
import iframeCSS from "./components/iframe/index.css";
|
|
12
|
+
import tooltipCSS from "./components/tooltip/index.css";
|
|
13
|
+
import drawerCSS from "./components/drawer/index.css";
|
|
14
|
+
import folderCSS from "./components/folder/index.css";
|
|
15
|
+
import panelCSS from "./components/panel/index.css";
|
|
16
|
+
import rightClickMenuCSS from "./components/rightClickMenu/index.css";
|
|
17
|
+
|
|
18
|
+
export const PopsCSS = {
|
|
19
|
+
/** 主CSS */
|
|
20
|
+
index: indexCSS,
|
|
21
|
+
/** 九宫格位置CSS */
|
|
22
|
+
ninePalaceGridPosition: ninePalaceGridPositionCSS,
|
|
23
|
+
/** 滚动条CSS */
|
|
24
|
+
scrollbar: scrollbarCSS,
|
|
25
|
+
/** 按钮CSS */
|
|
26
|
+
button: buttonCSS,
|
|
27
|
+
/** 通用的CSS */
|
|
28
|
+
common: commonCSS,
|
|
29
|
+
/** 动画 */
|
|
30
|
+
anim: animCSS,
|
|
31
|
+
/** pops.alert */
|
|
32
|
+
alertCSS: alertCSS,
|
|
33
|
+
/** pops.cponfirm */
|
|
34
|
+
confirmCSS: confirmCSS,
|
|
35
|
+
/** pops.prompt */
|
|
36
|
+
promptCSS: promptCSS,
|
|
37
|
+
/** pops.loading */
|
|
38
|
+
loadingCSS: loadingCSS,
|
|
39
|
+
/** pops.iframe */
|
|
40
|
+
iframeCSS: iframeCSS,
|
|
41
|
+
/** pops.tooltip */
|
|
42
|
+
tooltipCSS: tooltipCSS,
|
|
43
|
+
/** pops.drawer */
|
|
44
|
+
drawerCSS: drawerCSS,
|
|
45
|
+
/** pops.folder */
|
|
46
|
+
folderCSS: folderCSS,
|
|
47
|
+
/** pops.folder */
|
|
48
|
+
panelCSS: panelCSS,
|
|
49
|
+
/** pops.rightClickMenu */
|
|
50
|
+
rightClickMenu: rightClickMenuCSS,
|
|
51
|
+
};
|
package/src/PopsIcon.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { PopsIconType } from "./types/icon";
|
|
2
|
+
import SVG_min from "./svg/min.svg";
|
|
3
|
+
import SVG_mise from "./svg/mise.svg";
|
|
4
|
+
import SVG_max from "./svg/max.svg";
|
|
5
|
+
import SVG_close from "./svg/close.svg";
|
|
6
|
+
import SVG_edit from "./svg/edit.svg";
|
|
7
|
+
import SVG_share from "./svg/share.svg";
|
|
8
|
+
import SVG_delete from "./svg/delete.svg";
|
|
9
|
+
import SVG_search from "./svg/search.svg";
|
|
10
|
+
import SVG_upload from "./svg/upload.svg";
|
|
11
|
+
import SVG_loading from "./svg/loading.svg";
|
|
12
|
+
import SVG_next from "./svg/next.svg";
|
|
13
|
+
import SVG_prev from "./svg/prev.svg";
|
|
14
|
+
import SVG_eleme from "./svg/eleme.svg";
|
|
15
|
+
import SVG_elemePlus from "./svg/elemePlus.svg";
|
|
16
|
+
import SVG_chromeFilled from "./svg/chromeFilled.svg";
|
|
17
|
+
import SVG_cpu from "./svg/cpu.svg";
|
|
18
|
+
import SVG_videoPlay from "./svg/videoPlay.svg";
|
|
19
|
+
import SVG_videoPause from "./svg/videoPause.svg";
|
|
20
|
+
import SVG_headset from "./svg/headset.svg";
|
|
21
|
+
import SVG_monitor from "./svg/monitor.svg";
|
|
22
|
+
import SVG_documentCopy from "./svg/documentCopy.svg";
|
|
23
|
+
import SVG_picture from "./svg/picture.svg";
|
|
24
|
+
import SVG_circleClose from "./svg/circleClose.svg";
|
|
25
|
+
import SVG_view from "./svg/view.svg";
|
|
26
|
+
import SVG_hide from "./svg/hide.svg";
|
|
27
|
+
import SVG_keyboard from "./svg/keyboard.svg";
|
|
28
|
+
import SVG_arrowRight from "./svg/arrowRight.svg";
|
|
29
|
+
import SVG_arrowLeft from "./svg/arrowLeft.svg";
|
|
30
|
+
|
|
31
|
+
export const PopsIcon = {
|
|
32
|
+
$data: {
|
|
33
|
+
min: SVG_min,
|
|
34
|
+
mise: SVG_mise,
|
|
35
|
+
max: SVG_max,
|
|
36
|
+
close: SVG_close,
|
|
37
|
+
edit: SVG_edit,
|
|
38
|
+
share: SVG_share,
|
|
39
|
+
delete: SVG_delete,
|
|
40
|
+
search: SVG_search,
|
|
41
|
+
upload: SVG_upload,
|
|
42
|
+
loading: SVG_loading,
|
|
43
|
+
next: SVG_next,
|
|
44
|
+
prev: SVG_prev,
|
|
45
|
+
eleme: SVG_eleme,
|
|
46
|
+
elemePlus: SVG_elemePlus,
|
|
47
|
+
chromeFilled: SVG_chromeFilled,
|
|
48
|
+
cpu: SVG_cpu,
|
|
49
|
+
videoPlay: SVG_videoPlay,
|
|
50
|
+
videoPause: SVG_videoPause,
|
|
51
|
+
headset: SVG_headset,
|
|
52
|
+
monitor: SVG_monitor,
|
|
53
|
+
documentCopy: SVG_documentCopy,
|
|
54
|
+
picture: SVG_picture,
|
|
55
|
+
circleClose: SVG_circleClose,
|
|
56
|
+
view: SVG_view,
|
|
57
|
+
hide: SVG_hide,
|
|
58
|
+
keyboard: SVG_keyboard,
|
|
59
|
+
arrowRight: SVG_arrowRight,
|
|
60
|
+
arrowLeft: SVG_arrowLeft,
|
|
61
|
+
} as {
|
|
62
|
+
[key in PopsIconType]: string;
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* 判断是否存在某个icon
|
|
66
|
+
* @param iconName 图标名
|
|
67
|
+
*/
|
|
68
|
+
hasIcon(iconName: string) {
|
|
69
|
+
return Object.keys(PopsIcon.$data).includes(iconName);
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* 获取icon
|
|
73
|
+
* @param iconName 图标名
|
|
74
|
+
*/
|
|
75
|
+
getIcon(iconName: string): string | null {
|
|
76
|
+
return PopsIcon.$data[iconName as keyof typeof this.$data];
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* 删除图标
|
|
80
|
+
* @param iconName 图标名
|
|
81
|
+
*/
|
|
82
|
+
deleteIcon(iconName: string) {
|
|
83
|
+
return Reflect.deleteProperty(PopsIcon.$data, iconName);
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* 设置图标
|
|
87
|
+
* @param iconName 图标名
|
|
88
|
+
* @param iconHTML 图标html
|
|
89
|
+
*/
|
|
90
|
+
setIcon(iconName: string, iconHTML: string) {
|
|
91
|
+
Reflect.set(PopsIcon.$data, iconName, iconHTML);
|
|
92
|
+
},
|
|
93
|
+
};
|
package/src/PopsLayer.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PopsLayerCommonConfig } from "./types/layer";
|
|
2
|
+
import type { PopsLayerMode } from "./types/main";
|
|
3
|
+
|
|
4
|
+
export const PopsLayer = {
|
|
5
|
+
alert: [],
|
|
6
|
+
confirm: [],
|
|
7
|
+
prompt: [],
|
|
8
|
+
loading: [],
|
|
9
|
+
iframe: [],
|
|
10
|
+
tooltip: [],
|
|
11
|
+
drawer: [],
|
|
12
|
+
folder: [],
|
|
13
|
+
panel: [],
|
|
14
|
+
rightClickMenu: [],
|
|
15
|
+
} as {
|
|
16
|
+
[key in PopsLayerMode]: PopsLayerCommonConfig[];
|
|
17
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
2
2
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
|
-
import { pops } from "../../Pops";
|
|
5
4
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
5
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
7
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
8
7
|
import { PopsAlertConfig } from "./config";
|
|
9
8
|
import type { PopsMode } from "../../types/main";
|
|
10
9
|
import type { PopsAlertDetails } from "./indexType";
|
|
10
|
+
import { PopsCSS } from "../../PopsCSS";
|
|
11
11
|
|
|
12
12
|
export const PopsAlert = {
|
|
13
13
|
init(details: PopsAlertDetails) {
|
|
@@ -21,13 +21,13 @@ export const PopsAlert = {
|
|
|
21
21
|
|
|
22
22
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
23
23
|
PopsHandler.handleInit($shadowRoot, [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
PopsCSS.index,
|
|
25
|
+
PopsCSS.ninePalaceGridPosition,
|
|
26
|
+
PopsCSS.scrollbar,
|
|
27
|
+
PopsCSS.button,
|
|
28
|
+
PopsCSS.anim,
|
|
29
|
+
PopsCSS.common,
|
|
30
|
+
PopsCSS.alertCSS,
|
|
31
31
|
]);
|
|
32
32
|
|
|
33
33
|
// 先把z-index提取出来
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
2
2
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
|
-
import {
|
|
4
|
+
import { PopsCSS } from "../../PopsCSS";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
7
7
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
@@ -20,13 +20,13 @@ export const PopsConfirm = {
|
|
|
20
20
|
|
|
21
21
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
22
22
|
PopsHandler.handleInit($shadowRoot, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
PopsCSS.index,
|
|
24
|
+
PopsCSS.ninePalaceGridPosition,
|
|
25
|
+
PopsCSS.scrollbar,
|
|
26
|
+
PopsCSS.button,
|
|
27
|
+
PopsCSS.anim,
|
|
28
|
+
PopsCSS.common,
|
|
29
|
+
PopsCSS.confirmCSS,
|
|
30
30
|
]);
|
|
31
31
|
|
|
32
32
|
// 先把z-index提取出来
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
2
2
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
|
-
import {
|
|
4
|
+
import { PopsCSS } from "../../PopsCSS";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
7
|
import { PopsDrawerConfig } from "./config";
|
|
@@ -19,13 +19,13 @@ export const PopsDrawer = {
|
|
|
19
19
|
|
|
20
20
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
21
21
|
PopsHandler.handleInit($shadowRoot, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
PopsCSS.index,
|
|
23
|
+
PopsCSS.ninePalaceGridPosition,
|
|
24
|
+
PopsCSS.scrollbar,
|
|
25
|
+
PopsCSS.button,
|
|
26
|
+
PopsCSS.anim,
|
|
27
|
+
PopsCSS.common,
|
|
28
|
+
PopsCSS.drawerCSS,
|
|
29
29
|
]);
|
|
30
30
|
|
|
31
31
|
// 先把z-index提取出来
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
2
2
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
|
-
import {
|
|
4
|
+
import { PopsCSS } from "../../PopsCSS";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
7
7
|
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
8
8
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
9
|
+
import { PopsLoading } from "../loading";
|
|
9
10
|
import { PopsFolderConfig } from "./config";
|
|
10
11
|
import { Folder_ICON } from "./folderIcon";
|
|
11
12
|
import type { PopsFolderDataConfig, PopsFolderDetails } from "./indexType";
|
|
@@ -23,13 +24,13 @@ export const PopsFolder = {
|
|
|
23
24
|
|
|
24
25
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
25
26
|
PopsHandler.handleInit($shadowRoot, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
PopsCSS.index,
|
|
28
|
+
PopsCSS.ninePalaceGridPosition,
|
|
29
|
+
PopsCSS.scrollbar,
|
|
30
|
+
PopsCSS.button,
|
|
31
|
+
PopsCSS.anim,
|
|
32
|
+
PopsCSS.common,
|
|
33
|
+
PopsCSS.folderCSS,
|
|
33
34
|
]);
|
|
34
35
|
|
|
35
36
|
/* 办公几件套 */
|
|
@@ -129,7 +130,7 @@ export const PopsFolder = {
|
|
|
129
130
|
: `<p pops style="${headerPStyle}">${config.title.text}</p>`
|
|
130
131
|
}${headerBtnHTML}</div>
|
|
131
132
|
<div class="pops-folder-content ${
|
|
132
|
-
|
|
133
|
+
popsUtils.isPhone() ? "pops-mobile-folder-content" : ""
|
|
133
134
|
}">
|
|
134
135
|
<div class="pops-folder-list">
|
|
135
136
|
<div class="pops-folder-file-list-breadcrumb">
|
|
@@ -213,7 +214,7 @@ export const PopsFolder = {
|
|
|
213
214
|
<table class="pops-folder-list-table__body">
|
|
214
215
|
<colgroup>
|
|
215
216
|
${
|
|
216
|
-
|
|
217
|
+
popsUtils.isPhone()
|
|
217
218
|
? `<col width="100%">`
|
|
218
219
|
: `
|
|
219
220
|
<col width="52%">
|
|
@@ -572,9 +573,8 @@ export const PopsFolder = {
|
|
|
572
573
|
} else {
|
|
573
574
|
console.error("获取导航按钮失败");
|
|
574
575
|
}
|
|
575
|
-
let loadingMask =
|
|
576
|
+
let loadingMask = PopsLoading.init({
|
|
576
577
|
parent: $content,
|
|
577
|
-
|
|
578
578
|
content: {
|
|
579
579
|
text: "获取文件列表中...",
|
|
580
580
|
},
|
|
@@ -600,7 +600,7 @@ export const PopsFolder = {
|
|
|
600
600
|
_config_: PopsFolderDataConfig
|
|
601
601
|
) {
|
|
602
602
|
clearFolerRow();
|
|
603
|
-
let loadingMask =
|
|
603
|
+
let loadingMask = PopsLoading.init({
|
|
604
604
|
parent: $content,
|
|
605
605
|
|
|
606
606
|
content: {
|
|
@@ -828,7 +828,7 @@ export const PopsFolder = {
|
|
|
828
828
|
sortFolderConfig(_config_, config.sort.name, config.sort.isDesc);
|
|
829
829
|
_config_.forEach((item) => {
|
|
830
830
|
if (item["isFolder"]) {
|
|
831
|
-
let { folderELement, fileNameElement } =
|
|
831
|
+
let { folderELement, fileNameElement } = popsUtils.isPhone()
|
|
832
832
|
? createMobileFolderRowElement(item["fileName"], "", "", true)
|
|
833
833
|
: createFolderRowElement(item["fileName"], "", "", true);
|
|
834
834
|
|
|
@@ -842,7 +842,7 @@ export const PopsFolder = {
|
|
|
842
842
|
|
|
843
843
|
folderListBodyElement.appendChild(folderELement);
|
|
844
844
|
} else {
|
|
845
|
-
let { folderELement, fileNameElement } =
|
|
845
|
+
let { folderELement, fileNameElement } = popsUtils.isPhone()
|
|
846
846
|
? createMobileFolderRowElement(
|
|
847
847
|
item["fileName"],
|
|
848
848
|
item.latestTime,
|
|
@@ -2,7 +2,8 @@ import { PopsCore } from "../../Core";
|
|
|
2
2
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
3
3
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
4
4
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
5
|
-
import {
|
|
5
|
+
import { PopsCSS } from "../../PopsCSS";
|
|
6
|
+
import { PopsLayer } from "../../PopsLayer";
|
|
6
7
|
import type { PopsEventDetails } from "../../types/event";
|
|
7
8
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
8
9
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
@@ -26,12 +27,12 @@ export const PopsIframe = {
|
|
|
26
27
|
|
|
27
28
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
28
29
|
PopsHandler.handleInit($shadowRoot, [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
PopsCSS.index,
|
|
31
|
+
PopsCSS.ninePalaceGridPosition,
|
|
32
|
+
PopsCSS.scrollbar,
|
|
33
|
+
PopsCSS.anim,
|
|
34
|
+
PopsCSS.common,
|
|
35
|
+
PopsCSS.iframeCSS,
|
|
35
36
|
]);
|
|
36
37
|
|
|
37
38
|
let maskExtraStyle =
|
|
@@ -304,11 +305,7 @@ export const PopsIframe = {
|
|
|
304
305
|
(event) => {
|
|
305
306
|
event.preventDefault();
|
|
306
307
|
event.stopPropagation();
|
|
307
|
-
PopsInstanceUtils.removeInstance(
|
|
308
|
-
[pops.config.layer.iframe],
|
|
309
|
-
guid,
|
|
310
|
-
false
|
|
311
|
-
);
|
|
308
|
+
PopsInstanceUtils.removeInstance([PopsLayer.iframe], guid, false);
|
|
312
309
|
if (typeof config?.btn?.close?.callback === "function") {
|
|
313
310
|
config.btn.close.callback(eventDetails, event);
|
|
314
311
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GlobalConfig } from "../../GlobalConfig";
|
|
2
2
|
import { PopsElementHandler } from "../../handler/PopsElementHandler";
|
|
3
3
|
import { PopsHandler } from "../../handler/PopsHandler";
|
|
4
|
-
import {
|
|
4
|
+
import { PopsCSS } from "../../PopsCSS";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
7
|
import { PopsLoadingConfig } from "./config";
|
|
@@ -33,14 +33,14 @@ export const PopsLoading = {
|
|
|
33
33
|
<div class="pops-loading-content">${
|
|
34
34
|
config.addIndexCSS
|
|
35
35
|
? /*html*/ `
|
|
36
|
-
<style data-model-name="index">${
|
|
37
|
-
<style data-model-name="anim">${
|
|
38
|
-
<style data-model-name="common">${
|
|
36
|
+
<style data-model-name="index">${PopsCSS.index}</style>
|
|
37
|
+
<style data-model-name="anim">${PopsCSS.anim}</style>
|
|
38
|
+
<style data-model-name="common">${PopsCSS.common}</style>
|
|
39
39
|
`
|
|
40
40
|
: ""
|
|
41
41
|
}
|
|
42
42
|
<style data-model-name="loadingCSS">
|
|
43
|
-
${
|
|
43
|
+
${PopsCSS.loadingCSS}
|
|
44
44
|
</style>
|
|
45
45
|
${config.style != null ? `<style>${config.style}</style>` : ""}
|
|
46
46
|
<p pops style="${contentPStyle}">${config.content.text}</p>
|