@whitesev/pops 2.4.5 → 2.4.7
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/README.md +117 -111
- package/dist/index.amd.js +1248 -1287
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +1248 -1287
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1248 -1287
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +1248 -1287
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +1248 -1287
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +1248 -1287
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +9 -10
- package/dist/types/src/components/panel/types/components-common.d.ts +26 -26
- package/dist/types/src/components/panel/types/index.d.ts +1 -1
- package/dist/types/src/components/rightClickMenu/index.d.ts +3 -4
- package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +2 -2
- package/dist/types/src/handler/PopsHandler.d.ts +3 -3
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -256
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +187 -187
- package/dist/types/src/types/components.d.ts +210 -213
- package/dist/types/src/types/event.d.ts +63 -63
- package/dist/types/src/types/global.d.ts +25 -20
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +24 -24
- package/dist/types/src/types/main.d.ts +111 -114
- package/dist/types/src/types/mask.d.ts +49 -49
- package/dist/types/src/types/position.d.ts +60 -60
- package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -1
- package/dist/types/src/utils/PopsUtils.d.ts +16 -16
- package/index.ts +3 -0
- package/package.json +20 -9
- package/src/Pops.ts +206 -0
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsCore.ts +64 -0
- package/src/PopsIcon.ts +95 -0
- package/src/PopsInst.ts +21 -0
- package/src/components/alert/config.ts +62 -0
- package/src/components/alert/index.css +0 -0
- package/src/components/alert/index.ts +163 -0
- package/src/components/alert/types/index.ts +23 -0
- package/src/components/confirm/config.ts +90 -0
- package/src/components/confirm/index.css +0 -0
- package/src/components/confirm/index.ts +166 -0
- package/src/components/confirm/types/index.ts +17 -0
- package/src/components/drawer/config.ts +89 -0
- package/src/components/drawer/index.css +37 -0
- package/src/components/drawer/index.ts +237 -0
- package/src/components/drawer/types/index.ts +61 -0
- package/src/components/folder/config.ts +147 -0
- package/src/components/folder/folderIcon.ts +28 -0
- package/src/components/folder/index.css +303 -0
- package/src/components/folder/index.ts +929 -0
- package/src/components/folder/types/index.ts +97 -0
- package/src/components/iframe/config.ts +60 -0
- package/src/components/iframe/index.css +76 -0
- package/src/components/iframe/index.ts +334 -0
- package/src/components/iframe/types/index.ts +139 -0
- package/src/components/loading/config.ts +29 -0
- package/src/components/loading/index.css +66 -0
- package/src/components/loading/index.ts +99 -0
- package/src/components/loading/types/index.ts +34 -0
- package/src/components/panel/config.ts +519 -0
- package/src/components/panel/handlerComponents.ts +2900 -0
- package/src/components/panel/index.css +1222 -0
- package/src/components/panel/index.ts +207 -0
- package/src/components/panel/types/components-button.ts +68 -0
- package/src/components/panel/types/components-common.ts +50 -0
- package/src/components/panel/types/components-deepMenu.ts +84 -0
- package/src/components/panel/types/components-forms.ts +44 -0
- package/src/components/panel/types/components-input.ts +78 -0
- package/src/components/panel/types/components-own.ts +30 -0
- package/src/components/panel/types/components-select.ts +93 -0
- package/src/components/panel/types/components-selectMultiple.ts +130 -0
- package/src/components/panel/types/components-slider.ts +77 -0
- package/src/components/panel/types/components-switch.ts +56 -0
- package/src/components/panel/types/components-textarea.ts +68 -0
- package/src/components/panel/types/index.ts +177 -0
- package/src/components/prompt/config.ts +94 -0
- package/src/components/prompt/index.css +34 -0
- package/src/components/prompt/index.ts +216 -0
- package/src/components/prompt/types/index.ts +55 -0
- package/src/components/rightClickMenu/config.ts +98 -0
- package/src/components/rightClickMenu/index.css +112 -0
- package/src/components/rightClickMenu/index.ts +602 -0
- package/src/components/rightClickMenu/types/index.ts +97 -0
- package/src/components/searchSuggestion/config.ts +56 -0
- package/src/components/searchSuggestion/index.ts +856 -0
- package/src/components/searchSuggestion/types/index.ts +239 -0
- package/src/components/tooltip/config.ts +34 -0
- package/src/components/tooltip/index.css +199 -0
- package/src/components/tooltip/index.ts +604 -0
- package/src/components/tooltip/types/index.ts +117 -0
- package/src/config/CommonCSSClassName.ts +17 -0
- package/src/config/GlobalConfig.ts +63 -0
- package/src/css/animation.css +987 -0
- package/src/css/button.css +551 -0
- package/src/css/common.css +48 -0
- package/src/css/index.css +253 -0
- package/src/css/ninePalaceGridPosition.css +50 -0
- package/src/css/scrollbar.css +22 -0
- package/src/handler/PopsElementHandler.ts +304 -0
- package/src/handler/PopsHandler.ts +589 -0
- package/src/svg/arrowLeft.svg +4 -0
- package/src/svg/arrowRight.svg +4 -0
- package/src/svg/chromeFilled.svg +11 -0
- package/src/svg/circleClose.svg +8 -0
- package/src/svg/close.svg +5 -0
- package/src/svg/cpu.svg +8 -0
- package/src/svg/delete.svg +5 -0
- package/src/svg/documentCopy.svg +5 -0
- package/src/svg/edit.svg +8 -0
- package/src/svg/eleme.svg +5 -0
- package/src/svg/elemePlus.svg +5 -0
- package/src/svg/headset.svg +5 -0
- package/src/svg/hide.svg +8 -0
- package/src/svg/keyboard.svg +8 -0
- package/src/svg/loading.svg +5 -0
- package/src/svg/max.svg +5 -0
- package/src/svg/min.svg +5 -0
- package/src/svg/mise.svg +5 -0
- package/src/svg/monitor.svg +5 -0
- package/src/svg/next.svg +5 -0
- package/src/svg/picture.svg +8 -0
- package/src/svg/prev.svg +5 -0
- package/src/svg/search.svg +5 -0
- package/src/svg/share.svg +5 -0
- package/src/svg/upload.svg +5 -0
- package/src/svg/videoPause.svg +5 -0
- package/src/svg/videoPlay.svg +5 -0
- package/src/svg/view.svg +5 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +252 -0
- package/src/types/animation.d.ts +19 -0
- package/src/types/button.d.ts +187 -0
- package/src/types/components.d.ts +210 -0
- package/src/types/event.d.ts +63 -0
- package/src/types/global.d.ts +25 -0
- package/src/types/icon.d.ts +32 -0
- package/src/types/inst.d.ts +24 -0
- package/src/types/main.d.ts +111 -0
- package/src/types/mask.d.ts +49 -0
- package/src/types/position.d.ts +60 -0
- package/src/utils/PopsDOMUtils.ts +2408 -0
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
- package/src/utils/PopsInstanceUtils.ts +688 -0
- package/src/utils/PopsMathUtils.ts +71 -0
- package/src/utils/PopsSafeUtils.ts +22 -0
- package/src/utils/PopsUtils.ts +406 -0
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# 弹窗库
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
- 最新版本:[](https://www.npmjs.com/package/@whitesev/pops)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
````js
|
|
6
6
|
|
|
7
7
|
## pops.isPhone
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
```js
|
|
12
12
|
pops.iPhone()
|
|
13
13
|
-> true
|
|
14
|
-
|
|
14
|
+
````
|
|
15
15
|
|
|
16
16
|
## pops.alert
|
|
17
17
|
|
|
@@ -19,15 +19,15 @@ pops.iPhone()
|
|
|
19
19
|
|
|
20
20
|
```js
|
|
21
21
|
pops.alert({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
content: {
|
|
23
|
+
text: "普通信息框",
|
|
24
|
+
},
|
|
25
|
+
mask: {
|
|
26
|
+
enable: true,
|
|
27
|
+
clickEvent: {
|
|
28
|
+
toClose: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
31
|
});
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -39,15 +39,15 @@ pops.alert({
|
|
|
39
39
|
|
|
40
40
|
```js
|
|
41
41
|
pops.confirm({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
content: {
|
|
43
|
+
text: "询问框",
|
|
44
|
+
},
|
|
45
|
+
mask: {
|
|
46
|
+
enable: true,
|
|
47
|
+
clickEvent: {
|
|
48
|
+
toClose: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
51
|
});
|
|
52
52
|
```
|
|
53
53
|
|
|
@@ -59,15 +59,15 @@ pops.confirm({
|
|
|
59
59
|
|
|
60
60
|
```js
|
|
61
61
|
pops.drawer({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
content: {
|
|
63
|
+
text: "抽屉层",
|
|
64
|
+
},
|
|
65
|
+
mask: {
|
|
66
|
+
enable: true,
|
|
67
|
+
clickEvent: {
|
|
68
|
+
toClose: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
71
|
});
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -79,28 +79,30 @@ pops.drawer({
|
|
|
79
79
|
|
|
80
80
|
```js
|
|
81
81
|
pops.folder({
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
title: {
|
|
83
|
+
text: "文件夹层",
|
|
84
|
+
},
|
|
85
|
+
folder: [
|
|
86
|
+
{
|
|
87
|
+
fileName: "测试文件.apk",
|
|
88
|
+
fileSize: 30125682,
|
|
89
|
+
fileType: "apk",
|
|
90
|
+
createTime: 1702036410440,
|
|
91
|
+
latestTime: 1702039410440,
|
|
92
|
+
isFolder: false,
|
|
93
|
+
index: 1,
|
|
94
|
+
clickEvent() {
|
|
95
|
+
console.log("下载文件:", this.fileName);
|
|
96
|
+
return "https://update.greasyfork.org/scripts/456485/pops.js";
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
mask: {
|
|
101
|
+
enable: true,
|
|
102
|
+
clickEvent: {
|
|
103
|
+
toClose: true,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
104
106
|
});
|
|
105
107
|
```
|
|
106
108
|
|
|
@@ -112,16 +114,16 @@ iframe层
|
|
|
112
114
|
|
|
113
115
|
```js
|
|
114
116
|
pops.iframe({
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
url: window.location.href,
|
|
118
|
+
title: {
|
|
119
|
+
text: "iframe层",
|
|
120
|
+
},
|
|
121
|
+
mask: {
|
|
122
|
+
enable: true,
|
|
123
|
+
clickEvent: {
|
|
124
|
+
toClose: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
125
127
|
});
|
|
126
128
|
```
|
|
127
129
|
|
|
@@ -135,17 +137,17 @@ pops.iframe({
|
|
|
135
137
|
|
|
136
138
|
```js
|
|
137
139
|
pops.loading({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
140
|
+
parent: document.body,
|
|
141
|
+
content: {
|
|
142
|
+
text: "加载中...",
|
|
143
|
+
icon: "loading",
|
|
144
|
+
},
|
|
145
|
+
mask: {
|
|
146
|
+
enable: true,
|
|
147
|
+
clickEvent: {
|
|
148
|
+
toClose: true,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
149
151
|
});
|
|
150
152
|
```
|
|
151
153
|
|
|
@@ -157,22 +159,24 @@ pops.loading({
|
|
|
157
159
|
|
|
158
160
|
```js
|
|
159
161
|
pops.panel({
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
162
|
+
title: {
|
|
163
|
+
text: "面板层",
|
|
164
|
+
},
|
|
165
|
+
content: [
|
|
166
|
+
{
|
|
167
|
+
id: "whitesev-panel-config",
|
|
168
|
+
title: "菜单配置",
|
|
169
|
+
headerTitle: "菜单配置",
|
|
170
|
+
isDefault: true,
|
|
171
|
+
forms: [],
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
mask: {
|
|
175
|
+
enable: true,
|
|
176
|
+
clickEvent: {
|
|
177
|
+
toClose: true,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
176
180
|
});
|
|
177
181
|
```
|
|
178
182
|
|
|
@@ -184,15 +188,15 @@ pops.panel({
|
|
|
184
188
|
|
|
185
189
|
```js
|
|
186
190
|
pops.prompt({
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
content: {
|
|
192
|
+
text: "输入框的内容",
|
|
193
|
+
},
|
|
194
|
+
mask: {
|
|
195
|
+
enable: true,
|
|
196
|
+
clickEvent: {
|
|
197
|
+
toClose: true,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
196
200
|
});
|
|
197
201
|
```
|
|
198
202
|
|
|
@@ -204,15 +208,17 @@ pops.prompt({
|
|
|
204
208
|
|
|
205
209
|
```js
|
|
206
210
|
pops.rightClickMenu({
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
target: document.documentElement,
|
|
212
|
+
data: [
|
|
213
|
+
{
|
|
214
|
+
icon: pops.config.iconSVG.search,
|
|
215
|
+
iconIsLoading: false,
|
|
216
|
+
text: "右键菜单",
|
|
217
|
+
callback(event) {
|
|
218
|
+
console.log("点击:" + this.text, event);
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
],
|
|
216
222
|
});
|
|
217
223
|
```
|
|
218
224
|
|
|
@@ -224,8 +230,8 @@ pops.rightClickMenu({
|
|
|
224
230
|
|
|
225
231
|
```js
|
|
226
232
|
pops.tooltip({
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
target: document.querySelector("#user-container"),
|
|
234
|
+
content: "鼠标悬浮提示内容",
|
|
229
235
|
});
|
|
230
236
|
```
|
|
231
237
|
|
|
@@ -235,8 +241,8 @@ pops.tooltip({
|
|
|
235
241
|
|
|
236
242
|
```js
|
|
237
243
|
let suggestion = pops.searchSuggestion({
|
|
238
|
-
|
|
239
|
-
})
|
|
244
|
+
target: document.querySelector("input"),
|
|
245
|
+
});
|
|
240
246
|
suggestion.init();
|
|
241
247
|
```
|
|
242
248
|
|