@whitesev/pops 1.0.0 → 1.1.0

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 (64) hide show
  1. package/README.md +243 -0
  2. package/dist/index.amd.js +5656 -171
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.cjs.js +5656 -171
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.esm.js +5656 -171
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.iife.js +5656 -171
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.system.js +5656 -171
  11. package/dist/index.system.js.map +1 -1
  12. package/dist/index.umd.js +5656 -171
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/src/Pops.d.ts +148 -60
  15. package/dist/types/src/components/alert/index.d.ts +1 -1
  16. package/dist/types/src/components/alert/indexType.d.ts +16 -0
  17. package/dist/types/src/components/confirm/index.d.ts +1 -1
  18. package/dist/types/src/components/confirm/indexType.d.ts +6 -0
  19. package/dist/types/src/components/drawer/index.d.ts +2 -0
  20. package/dist/types/src/components/drawer/indexType.d.ts +43 -0
  21. package/dist/types/src/components/folder/folderIcon.d.ts +27 -0
  22. package/dist/types/src/components/folder/index.d.ts +2 -0
  23. package/dist/types/src/components/folder/indexType.d.ts +68 -0
  24. package/dist/types/src/components/iframe/index.d.ts +2 -0
  25. package/dist/types/src/components/iframe/indexType.d.ts +120 -0
  26. package/dist/types/src/components/loading/index.d.ts +2 -0
  27. package/dist/types/src/components/loading/indexType.d.ts +23 -0
  28. package/dist/types/src/components/panel/buttonType.d.ts +60 -0
  29. package/dist/types/src/components/panel/commonType.d.ts +46 -0
  30. package/dist/types/src/components/panel/deepMenuType.d.ts +56 -0
  31. package/dist/types/src/components/panel/formsType.d.ts +31 -0
  32. package/dist/types/src/components/panel/index.d.ts +2 -0
  33. package/dist/types/src/components/panel/indexType.d.ts +86 -0
  34. package/dist/types/src/components/panel/inputType.d.ts +61 -0
  35. package/dist/types/src/components/panel/ownType.d.ts +27 -0
  36. package/dist/types/src/components/panel/selectType.d.ts +71 -0
  37. package/dist/types/src/components/panel/sliderType.d.ts +58 -0
  38. package/dist/types/src/components/panel/switchType.d.ts +42 -0
  39. package/dist/types/src/components/panel/textareaType.d.ts +50 -0
  40. package/dist/types/src/components/prompt/index.d.ts +2 -0
  41. package/dist/types/src/components/prompt/indexType.d.ts +37 -0
  42. package/dist/types/src/components/rightClickMenu/index.d.ts +2 -0
  43. package/dist/types/src/components/rightClickMenu/indexType.d.ts +77 -0
  44. package/dist/types/src/components/searchSuggestion/index.d.ts +4 -0
  45. package/dist/types/src/components/searchSuggestion/indexType.d.ts +238 -0
  46. package/dist/types/src/components/tooltip/index.d.ts +2 -0
  47. package/dist/types/src/components/tooltip/indexType.d.ts +91 -0
  48. package/dist/types/src/handler/PopsHandler.d.ts +51 -39
  49. package/{src → dist/types/src}/types/PopsDOMUtilsEventType.d.ts +31 -33
  50. package/{src → dist/types/src}/types/animation.d.ts +1 -1
  51. package/{src → dist/types/src}/types/button.d.ts +21 -11
  52. package/{src → dist/types/src}/types/components.d.ts +9 -9
  53. package/{src → dist/types/src}/types/event.d.ts +6 -4
  54. package/{src → dist/types/src}/types/icon.d.ts +3 -1
  55. package/{src → dist/types/src}/types/layer.d.ts +2 -2
  56. package/{src → dist/types/src}/types/main.d.ts +22 -21
  57. package/{src → dist/types/src}/types/mask.d.ts +1 -1
  58. package/{src → dist/types/src}/types/position.d.ts +3 -3
  59. package/dist/types/src/utils/PopsDOMUtils.d.ts +334 -1
  60. package/dist/types/src/utils/{PopsUIUtils.d.ts → PopsInstanceUtils.d.ts} +13 -12
  61. package/dist/types/src/utils/PopsUtils.d.ts +2 -2
  62. package/package.json +2 -3
  63. package/dist/types/src/utils/PopsDOMUtilsEvent.d.ts +0 -332
  64. /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
+ ![pi72wJ1.png](https://s11.ax1x.com/2023/12/23/pi72wJ1.png)
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
+ ![pi720Rx.png](https://s11.ax1x.com/2023/12/23/pi720Rx.png)
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
+ ![pi72rQK.png](https://s11.ax1x.com/2023/12/23/pi72rQK.png)
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
+ ![pi72ssO.png](https://s11.ax1x.com/2023/12/23/pi72ssO.png)
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
+ ![pi722od.png](https://s11.ax1x.com/2023/12/23/pi722od.png)
129
+ ![pi72cee.png](https://s11.ax1x.com/2023/12/23/pi72cee.png)
130
+ ![pi72gdH.png](https://s11.ax1x.com/2023/12/23/pi72gdH.png)
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
+ ![pi72IQf.png](https://s11.ax1x.com/2023/12/23/pi72IQf.png)
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
+ ![o7kyTc.png](https://vip.helloimg.com/i/2024/03/17/65f68c239ece4.png)
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
+ ![o7rGnT.png](https://vip.helloimg.com/i/2024/03/17/65f68c25cf459.png)
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
+ ![o7r5Uq.png](https://vip.helloimg.com/i/2024/03/17/65f68c281dcb0.png)
220
+
221
+ ## pops.tooltip
222
+
223
+ 提示框
224
+
225
+ ```js
226
+ pops.tooltip({
227
+ target: document.querySelector("#user-container"),
228
+ content: "鼠标悬浮提示内容",
229
+ });
230
+ ```
231
+
232
+ ![o7rCFr.png](https://vip.helloimg.com/i/2024/03/17/65f68c299c729.png)
233
+
234
+ ## pops.searchSuggestion
235
+
236
+ ```js
237
+ let suggestion = pops.searchSuggestion({
238
+ target: document.querySelector("input"),
239
+ })
240
+ suggestion.init();
241
+ ```
242
+
243
+ ## 详情参数请看代码