@whitesev/pops 1.0.0 → 1.0.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.
- package/README.md +243 -0
- package/dist/index.amd.js +5634 -151
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +5634 -151
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5634 -151
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +5634 -151
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +5634 -151
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +5634 -151
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +119 -60
- package/dist/types/src/components/alert/index.d.ts +1 -1
- package/dist/types/src/components/alert/indexType.d.ts +16 -0
- package/dist/types/src/components/confirm/index.d.ts +1 -1
- package/dist/types/src/components/confirm/indexType.d.ts +6 -0
- package/dist/types/src/components/drawer/index.d.ts +2 -0
- package/dist/types/src/components/drawer/indexType.d.ts +43 -0
- package/dist/types/src/components/folder/folderIcon.d.ts +27 -0
- package/dist/types/src/components/folder/index.d.ts +2 -0
- package/dist/types/src/components/folder/indexType.d.ts +68 -0
- package/dist/types/src/components/iframe/index.d.ts +2 -0
- package/dist/types/src/components/iframe/indexType.d.ts +120 -0
- package/dist/types/src/components/loading/index.d.ts +2 -0
- package/dist/types/src/components/loading/indexType.d.ts +23 -0
- package/dist/types/src/components/panel/buttonType.d.ts +60 -0
- package/dist/types/src/components/panel/commonType.d.ts +46 -0
- package/dist/types/src/components/panel/deepMenuType.d.ts +56 -0
- package/dist/types/src/components/panel/formsType.d.ts +31 -0
- package/dist/types/src/components/panel/index.d.ts +2 -0
- package/dist/types/src/components/panel/indexType.d.ts +86 -0
- package/dist/types/src/components/panel/inputType.d.ts +61 -0
- package/dist/types/src/components/panel/ownType.d.ts +27 -0
- package/dist/types/src/components/panel/selectType.d.ts +71 -0
- package/dist/types/src/components/panel/sliderType.d.ts +58 -0
- package/dist/types/src/components/panel/switchType.d.ts +42 -0
- package/dist/types/src/components/panel/textareaType.d.ts +50 -0
- package/dist/types/src/components/prompt/index.d.ts +2 -0
- package/dist/types/src/components/prompt/indexType.d.ts +37 -0
- package/dist/types/src/components/rightClickMenu/index.d.ts +2 -0
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +77 -0
- package/dist/types/src/components/searchSuggestion/index.d.ts +4 -0
- package/dist/types/src/components/searchSuggestion/indexType.d.ts +238 -0
- package/dist/types/src/components/tooltip/index.d.ts +2 -0
- package/dist/types/src/components/tooltip/indexType.d.ts +91 -0
- package/dist/types/src/handler/PopsHandler.d.ts +51 -39
- package/{src → dist/types/src}/types/PopsDOMUtilsEventType.d.ts +31 -33
- package/{src → dist/types/src}/types/animation.d.ts +1 -1
- package/{src → dist/types/src}/types/button.d.ts +21 -11
- package/{src → dist/types/src}/types/components.d.ts +9 -9
- package/{src → dist/types/src}/types/event.d.ts +6 -4
- package/{src → dist/types/src}/types/icon.d.ts +3 -1
- package/{src → dist/types/src}/types/layer.d.ts +2 -2
- package/{src → dist/types/src}/types/main.d.ts +22 -21
- package/{src → dist/types/src}/types/mask.d.ts +1 -1
- package/{src → dist/types/src}/types/position.d.ts +3 -3
- package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -0
- package/dist/types/src/utils/PopsDOMUtilsEvent.d.ts +2 -0
- package/dist/types/src/utils/PopsUIUtils.d.ts +10 -9
- package/dist/types/src/utils/PopsUtils.d.ts +2 -2
- package/package.json +2 -3
- /package/{src → dist/types/src}/types/global.d.ts +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# 弹窗库
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
npm i @whitesev/pops
|
|
5
|
+
```
|
|
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
|
+
fileName: "测试文件.apk",
|
|
87
|
+
fileSize: 30125682,
|
|
88
|
+
fileType: "apk",
|
|
89
|
+
createTime: 1702036410440,
|
|
90
|
+
latestTime: 1702039410440,
|
|
91
|
+
isFolder: false,
|
|
92
|
+
index: 1,
|
|
93
|
+
clickEvent() {
|
|
94
|
+
console.log("下载文件:", this.fileName);
|
|
95
|
+
return "https://update.greasyfork.org/scripts/456485/pops.js";
|
|
96
|
+
},
|
|
97
|
+
}],
|
|
98
|
+
mask: {
|
|
99
|
+
enable: true,
|
|
100
|
+
clickEvent:{
|
|
101
|
+
toClose: true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+

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

|
|
129
|
+

|
|
130
|
+

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

|
|
153
|
+
|
|
154
|
+
## pops.panel
|
|
155
|
+
|
|
156
|
+
面板层
|
|
157
|
+
|
|
158
|
+
```js
|
|
159
|
+
pops.panel({
|
|
160
|
+
title: {
|
|
161
|
+
text: "面板层",
|
|
162
|
+
},
|
|
163
|
+
content: [{
|
|
164
|
+
id: "whitesev-panel-config",
|
|
165
|
+
title: "菜单配置",
|
|
166
|
+
headerTitle: "菜单配置",
|
|
167
|
+
isDefault: true,
|
|
168
|
+
forms: []
|
|
169
|
+
}],
|
|
170
|
+
mask: {
|
|
171
|
+
enable: true,
|
|
172
|
+
clickEvent:{
|
|
173
|
+
toClose: true
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+

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

|
|
200
|
+
|
|
201
|
+
## pops.rightClickMenu
|
|
202
|
+
|
|
203
|
+
右键菜单层
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
pops.rightClickMenu({
|
|
207
|
+
target: document.documentElement,
|
|
208
|
+
data: [{
|
|
209
|
+
icon: pops.config.iconSVG.search,
|
|
210
|
+
iconIsLoading: false,
|
|
211
|
+
text: "右键菜单",
|
|
212
|
+
callback(event) {
|
|
213
|
+
console.log("点击:" + this.text, event);
|
|
214
|
+
},
|
|
215
|
+
},]
|
|
216
|
+
});
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+

|
|
220
|
+
|
|
221
|
+
## pops.tooltip
|
|
222
|
+
|
|
223
|
+
提示框
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
pops.tooltip({
|
|
227
|
+
target: document.querySelector("#user-container"),
|
|
228
|
+
content: "鼠标悬浮提示内容",
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+

|
|
233
|
+
|
|
234
|
+
## pops.searchSuggestion
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
let suggestion = pops.searchSuggestion({
|
|
238
|
+
target: document.querySelector("input"),
|
|
239
|
+
})
|
|
240
|
+
suggestion.init();
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## 详情参数请看代码
|