@whitesev/pops 3.2.0 → 3.2.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.
- package/README.md +249 -249
- package/dist/index.amd.js +702 -667
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +702 -667
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +702 -667
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +702 -667
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +702 -667
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +702 -667
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/components/folder/types/index.d.ts +43 -13
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +94 -94
- package/dist/types/src/types/components.d.ts +211 -211
- package/dist/types/src/types/event.d.ts +43 -43
- package/dist/types/src/types/global.d.ts +31 -31
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +28 -28
- package/dist/types/src/types/main.d.ts +66 -66
- package/dist/types/src/types/mask.d.ts +52 -52
- package/dist/types/src/types/position.d.ts +60 -60
- package/package.json +27 -25
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +37 -37
- package/src/PopsIcon.ts +95 -95
- package/src/PopsInst.ts +21 -21
- package/src/components/alert/defaultConfig.ts +62 -62
- package/src/components/alert/index.ts +163 -163
- package/src/components/alert/types/index.ts +23 -23
- package/src/components/confirm/defaultConfig.ts +90 -90
- package/src/components/confirm/index.ts +165 -165
- package/src/components/confirm/types/index.ts +13 -17
- package/src/components/drawer/defaultConfig.ts +89 -89
- package/src/components/drawer/index.css +37 -37
- package/src/components/drawer/index.ts +245 -245
- package/src/components/drawer/types/index.ts +62 -61
- package/src/components/folder/defaultConfig.ts +151 -151
- package/src/components/folder/folderIcon.ts +28 -28
- package/src/components/folder/index.css +303 -303
- package/src/components/folder/index.ts +953 -932
- package/src/components/folder/types/index.ts +143 -110
- package/src/components/iframe/defaultConfig.ts +60 -60
- package/src/components/iframe/index.css +76 -76
- package/src/components/iframe/index.ts +331 -331
- package/src/components/iframe/types/index.ts +96 -96
- package/src/components/loading/defaultConfig.ts +29 -29
- package/src/components/loading/index.css +66 -66
- package/src/components/loading/index.ts +101 -101
- package/src/components/loading/types/index.ts +36 -34
- package/src/components/panel/css/components-select.css +84 -84
- package/src/components/panel/defaultConfig.ts +868 -868
- package/src/components/panel/handlerComponents.ts +3993 -3993
- package/src/components/panel/index.css +1403 -1401
- package/src/components/panel/index.ts +221 -221
- package/src/components/panel/types/components-button.ts +56 -56
- package/src/components/panel/types/components-common.ts +73 -73
- package/src/components/panel/types/components-container.ts +25 -25
- package/src/components/panel/types/components-deepMenu.ts +64 -64
- package/src/components/panel/types/components-input.ts +90 -90
- package/src/components/panel/types/components-own.ts +16 -16
- package/src/components/panel/types/components-select.ts +169 -169
- package/src/components/panel/types/components-selectMultiple.ts +105 -104
- package/src/components/panel/types/components-slider.ts +55 -55
- package/src/components/panel/types/components-switch.ts +33 -33
- package/src/components/panel/types/components-textarea.ts +45 -45
- package/src/components/panel/types/index.ts +244 -244
- package/src/components/prompt/defaultConfig.ts +94 -94
- package/src/components/prompt/index.css +34 -34
- package/src/components/prompt/index.ts +187 -215
- package/src/components/prompt/types/index.ts +57 -56
- package/src/components/rightClickMenu/defaultConfig.ts +103 -103
- package/src/components/rightClickMenu/index.css +115 -115
- package/src/components/rightClickMenu/index.ts +662 -662
- package/src/components/rightClickMenu/types/index.ts +145 -143
- package/src/components/searchSuggestion/defaultConfig.ts +63 -63
- package/src/components/searchSuggestion/index.ts +813 -813
- package/src/components/searchSuggestion/types/index.ts +244 -242
- package/src/components/tooltip/defaultConfig.ts +33 -33
- package/src/components/tooltip/index.css +199 -199
- package/src/components/tooltip/index.ts +617 -617
- package/src/components/tooltip/types/index.ts +123 -121
- package/src/config/CommonCSSClassName.ts +17 -17
- package/src/config/GlobalConfig.ts +63 -63
- package/src/css/animation.css +987 -987
- package/src/css/button.css +551 -551
- package/src/css/common.css +54 -54
- package/src/css/index.css +253 -253
- package/src/css/ninePalaceGridPosition.css +50 -50
- package/src/css/scrollbar.css +22 -22
- package/src/handler/PopsElementHandler.ts +303 -303
- package/src/handler/PopsHandler.ts +611 -611
- package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/src/types/animation.d.ts +19 -19
- package/src/types/button.d.ts +94 -94
- package/src/types/components.d.ts +211 -211
- package/src/types/event.d.ts +43 -43
- package/src/types/global.d.ts +31 -31
- package/src/types/icon.d.ts +32 -32
- package/src/types/inst.d.ts +28 -28
- package/src/types/main.d.ts +66 -66
- package/src/types/mask.d.ts +52 -52
- package/src/types/position.d.ts +60 -60
- package/src/utils/PopsDOMUtils.ts +2483 -2483
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
- package/src/utils/PopsInstanceUtils.ts +714 -714
- package/src/utils/PopsMathUtils.ts +71 -71
- package/src/utils/PopsSafeUtils.ts +22 -22
- package/src/utils/PopsUtils.ts +421 -421
package/README.md
CHANGED
|
@@ -1,249 +1,249 @@
|
|
|
1
|
-
# 弹窗库
|
|
2
|
-
|
|
3
|
-
- 最新版本:[](https://www.npmjs.com/package/@whitesev/pops)
|
|
4
|
-
|
|
5
|
-
````js
|
|
6
|
-
|
|
7
|
-
## pops.isPhone
|
|
8
|
-
|
|
9
|
-
判断是否是手机访问
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
pops.iPhone()
|
|
13
|
-
-> true
|
|
14
|
-
````
|
|
15
|
-
|
|
16
|
-
## pops.alert
|
|
17
|
-
|
|
18
|
-
普通信息框
|
|
19
|
-
|
|
20
|
-
```js
|
|
21
|
-
pops.alert({
|
|
22
|
-
content: {
|
|
23
|
-
text: "普通信息框",
|
|
24
|
-
},
|
|
25
|
-
mask: {
|
|
26
|
-
enable: true,
|
|
27
|
-
clickEvent: {
|
|
28
|
-
toClose: true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-

|
|
35
|
-
|
|
36
|
-
## pops.confirm
|
|
37
|
-
|
|
38
|
-
询问框
|
|
39
|
-
|
|
40
|
-
```js
|
|
41
|
-
pops.confirm({
|
|
42
|
-
content: {
|
|
43
|
-
text: "询问框",
|
|
44
|
-
},
|
|
45
|
-
mask: {
|
|
46
|
-
enable: true,
|
|
47
|
-
clickEvent: {
|
|
48
|
-
toClose: true,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-

|
|
55
|
-
|
|
56
|
-
## pops.drawer
|
|
57
|
-
|
|
58
|
-
抽屉层
|
|
59
|
-
|
|
60
|
-
```js
|
|
61
|
-
pops.drawer({
|
|
62
|
-
content: {
|
|
63
|
-
text: "抽屉层",
|
|
64
|
-
},
|
|
65
|
-
mask: {
|
|
66
|
-
enable: true,
|
|
67
|
-
clickEvent: {
|
|
68
|
-
toClose: true,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-

|
|
75
|
-
|
|
76
|
-
## pops.folder
|
|
77
|
-
|
|
78
|
-
文件夹层
|
|
79
|
-
|
|
80
|
-
```js
|
|
81
|
-
pops.folder({
|
|
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
|
-
},
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-

|
|
110
|
-
|
|
111
|
-
## pops.iframe
|
|
112
|
-
|
|
113
|
-
iframe层
|
|
114
|
-
|
|
115
|
-
```js
|
|
116
|
-
pops.iframe({
|
|
117
|
-
url: window.location.href,
|
|
118
|
-
title: {
|
|
119
|
-
text: "iframe层",
|
|
120
|
-
},
|
|
121
|
-
mask: {
|
|
122
|
-
enable: true,
|
|
123
|
-
clickEvent: {
|
|
124
|
-
toClose: true,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-

|
|
131
|
-

|
|
132
|
-

|
|
133
|
-
|
|
134
|
-
## pops.loading
|
|
135
|
-
|
|
136
|
-
加载层
|
|
137
|
-
|
|
138
|
-
```js
|
|
139
|
-
pops.loading({
|
|
140
|
-
parent: document.body,
|
|
141
|
-
content: {
|
|
142
|
-
text: "加载中...",
|
|
143
|
-
icon: "loading",
|
|
144
|
-
},
|
|
145
|
-
mask: {
|
|
146
|
-
enable: true,
|
|
147
|
-
clickEvent: {
|
|
148
|
-
toClose: true,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-

|
|
155
|
-
|
|
156
|
-
## pops.panel
|
|
157
|
-
|
|
158
|
-
面板层
|
|
159
|
-
|
|
160
|
-
```js
|
|
161
|
-
pops.panel({
|
|
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
|
-
},
|
|
180
|
-
});
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-

|
|
184
|
-
|
|
185
|
-
## pops.prompt
|
|
186
|
-
|
|
187
|
-
输入框
|
|
188
|
-
|
|
189
|
-
```js
|
|
190
|
-
pops.prompt({
|
|
191
|
-
content: {
|
|
192
|
-
text: "输入框的内容",
|
|
193
|
-
},
|
|
194
|
-
mask: {
|
|
195
|
-
enable: true,
|
|
196
|
-
clickEvent: {
|
|
197
|
-
toClose: true,
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-

|
|
204
|
-
|
|
205
|
-
## pops.rightClickMenu
|
|
206
|
-
|
|
207
|
-
右键菜单层
|
|
208
|
-
|
|
209
|
-
```js
|
|
210
|
-
pops.rightClickMenu({
|
|
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
|
-
],
|
|
222
|
-
});
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-

|
|
226
|
-
|
|
227
|
-
## pops.tooltip
|
|
228
|
-
|
|
229
|
-
提示框
|
|
230
|
-
|
|
231
|
-
```js
|
|
232
|
-
pops.tooltip({
|
|
233
|
-
target: document.querySelector("#user-container"),
|
|
234
|
-
content: "鼠标悬浮提示内容",
|
|
235
|
-
});
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-

|
|
239
|
-
|
|
240
|
-
## pops.searchSuggestion
|
|
241
|
-
|
|
242
|
-
```js
|
|
243
|
-
let suggestion = pops.searchSuggestion({
|
|
244
|
-
target: document.querySelector("input"),
|
|
245
|
-
});
|
|
246
|
-
suggestion.init();
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## 详情参数请看代码
|
|
1
|
+
# 弹窗库
|
|
2
|
+
|
|
3
|
+
- 最新版本:[](https://www.npmjs.com/package/@whitesev/pops)
|
|
4
|
+
|
|
5
|
+
````js
|
|
6
|
+
|
|
7
|
+
## pops.isPhone
|
|
8
|
+
|
|
9
|
+
判断是否是手机访问
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
pops.iPhone()
|
|
13
|
+
-> true
|
|
14
|
+
````
|
|
15
|
+
|
|
16
|
+
## pops.alert
|
|
17
|
+
|
|
18
|
+
普通信息框
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
pops.alert({
|
|
22
|
+
content: {
|
|
23
|
+
text: "普通信息框",
|
|
24
|
+
},
|
|
25
|
+
mask: {
|
|
26
|
+
enable: true,
|
|
27
|
+
clickEvent: {
|
|
28
|
+
toClose: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
## pops.confirm
|
|
37
|
+
|
|
38
|
+
询问框
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
pops.confirm({
|
|
42
|
+
content: {
|
|
43
|
+
text: "询问框",
|
|
44
|
+
},
|
|
45
|
+
mask: {
|
|
46
|
+
enable: true,
|
|
47
|
+
clickEvent: {
|
|
48
|
+
toClose: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
## pops.drawer
|
|
57
|
+
|
|
58
|
+
抽屉层
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
pops.drawer({
|
|
62
|
+
content: {
|
|
63
|
+
text: "抽屉层",
|
|
64
|
+
},
|
|
65
|
+
mask: {
|
|
66
|
+
enable: true,
|
|
67
|
+
clickEvent: {
|
|
68
|
+
toClose: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+
## pops.folder
|
|
77
|
+
|
|
78
|
+
文件夹层
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
pops.folder({
|
|
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
|
+
},
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+

|
|
110
|
+
|
|
111
|
+
## pops.iframe
|
|
112
|
+
|
|
113
|
+
iframe层
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
pops.iframe({
|
|
117
|
+
url: window.location.href,
|
|
118
|
+
title: {
|
|
119
|
+
text: "iframe层",
|
|
120
|
+
},
|
|
121
|
+
mask: {
|
|
122
|
+
enable: true,
|
|
123
|
+
clickEvent: {
|
|
124
|
+
toClose: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+

|
|
132
|
+

|
|
133
|
+
|
|
134
|
+
## pops.loading
|
|
135
|
+
|
|
136
|
+
加载层
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
pops.loading({
|
|
140
|
+
parent: document.body,
|
|
141
|
+
content: {
|
|
142
|
+
text: "加载中...",
|
|
143
|
+
icon: "loading",
|
|
144
|
+
},
|
|
145
|
+
mask: {
|
|
146
|
+
enable: true,
|
|
147
|
+
clickEvent: {
|
|
148
|
+
toClose: true,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+

|
|
155
|
+
|
|
156
|
+
## pops.panel
|
|
157
|
+
|
|
158
|
+
面板层
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
pops.panel({
|
|
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
|
+
},
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+

|
|
184
|
+
|
|
185
|
+
## pops.prompt
|
|
186
|
+
|
|
187
|
+
输入框
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
pops.prompt({
|
|
191
|
+
content: {
|
|
192
|
+
text: "输入框的内容",
|
|
193
|
+
},
|
|
194
|
+
mask: {
|
|
195
|
+
enable: true,
|
|
196
|
+
clickEvent: {
|
|
197
|
+
toClose: true,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+

|
|
204
|
+
|
|
205
|
+
## pops.rightClickMenu
|
|
206
|
+
|
|
207
|
+
右键菜单层
|
|
208
|
+
|
|
209
|
+
```js
|
|
210
|
+
pops.rightClickMenu({
|
|
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
|
+
],
|
|
222
|
+
});
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+

|
|
226
|
+
|
|
227
|
+
## pops.tooltip
|
|
228
|
+
|
|
229
|
+
提示框
|
|
230
|
+
|
|
231
|
+
```js
|
|
232
|
+
pops.tooltip({
|
|
233
|
+
target: document.querySelector("#user-container"),
|
|
234
|
+
content: "鼠标悬浮提示内容",
|
|
235
|
+
});
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+

|
|
239
|
+
|
|
240
|
+
## pops.searchSuggestion
|
|
241
|
+
|
|
242
|
+
```js
|
|
243
|
+
let suggestion = pops.searchSuggestion({
|
|
244
|
+
target: document.querySelector("input"),
|
|
245
|
+
});
|
|
246
|
+
suggestion.init();
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## 详情参数请看代码
|