@whitesev/pops 3.2.1 → 3.3.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 (127) hide show
  1. package/README.md +249 -249
  2. package/dist/index.amd.js +736 -948
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.amd.min.js +1 -1
  5. package/dist/index.amd.min.js.map +1 -1
  6. package/dist/index.cjs.js +736 -948
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.cjs.min.js +1 -1
  9. package/dist/index.cjs.min.js.map +1 -1
  10. package/dist/index.esm.js +736 -948
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.esm.min.js +1 -1
  13. package/dist/index.esm.min.js.map +1 -1
  14. package/dist/index.iife.js +736 -948
  15. package/dist/index.iife.js.map +1 -1
  16. package/dist/index.iife.min.js +1 -1
  17. package/dist/index.iife.min.js.map +1 -1
  18. package/dist/index.system.js +736 -948
  19. package/dist/index.system.js.map +1 -1
  20. package/dist/index.system.min.js +1 -1
  21. package/dist/index.system.min.js.map +1 -1
  22. package/dist/index.umd.js +736 -948
  23. package/dist/index.umd.js.map +1 -1
  24. package/dist/index.umd.min.js +1 -1
  25. package/dist/index.umd.min.js.map +1 -1
  26. package/dist/types/src/PopsCore.d.ts +15 -7
  27. package/dist/types/src/components/folder/types/index.d.ts +43 -13
  28. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
  29. package/dist/types/src/types/animation.d.ts +19 -19
  30. package/dist/types/src/types/button.d.ts +94 -94
  31. package/dist/types/src/types/components.d.ts +211 -211
  32. package/dist/types/src/types/event.d.ts +43 -43
  33. package/dist/types/src/types/global.d.ts +31 -31
  34. package/dist/types/src/types/icon.d.ts +32 -32
  35. package/dist/types/src/types/inst.d.ts +28 -28
  36. package/dist/types/src/types/main.d.ts +66 -66
  37. package/dist/types/src/types/mask.d.ts +52 -52
  38. package/dist/types/src/types/position.d.ts +60 -60
  39. package/package.json +28 -27
  40. package/src/Pops.ts +206 -206
  41. package/src/PopsAnimation.ts +32 -32
  42. package/src/PopsCSS.ts +54 -54
  43. package/src/PopsCore.ts +53 -37
  44. package/src/PopsIcon.ts +95 -95
  45. package/src/PopsInst.ts +21 -21
  46. package/src/components/alert/defaultConfig.ts +62 -62
  47. package/src/components/alert/index.ts +163 -163
  48. package/src/components/alert/types/index.ts +23 -23
  49. package/src/components/confirm/defaultConfig.ts +90 -90
  50. package/src/components/confirm/index.ts +165 -165
  51. package/src/components/confirm/types/index.ts +13 -17
  52. package/src/components/drawer/defaultConfig.ts +89 -89
  53. package/src/components/drawer/index.css +37 -37
  54. package/src/components/drawer/index.ts +245 -245
  55. package/src/components/drawer/types/index.ts +62 -61
  56. package/src/components/folder/defaultConfig.ts +151 -151
  57. package/src/components/folder/folderIcon.ts +28 -28
  58. package/src/components/folder/index.css +303 -303
  59. package/src/components/folder/index.ts +953 -932
  60. package/src/components/folder/types/index.ts +143 -110
  61. package/src/components/iframe/defaultConfig.ts +60 -60
  62. package/src/components/iframe/index.css +76 -76
  63. package/src/components/iframe/index.ts +331 -331
  64. package/src/components/iframe/types/index.ts +96 -96
  65. package/src/components/loading/defaultConfig.ts +29 -29
  66. package/src/components/loading/index.css +66 -66
  67. package/src/components/loading/index.ts +101 -101
  68. package/src/components/loading/types/index.ts +36 -34
  69. package/src/components/panel/css/components-select.css +84 -84
  70. package/src/components/panel/defaultConfig.ts +868 -868
  71. package/src/components/panel/handlerComponents.ts +3993 -3993
  72. package/src/components/panel/index.css +1403 -1403
  73. package/src/components/panel/index.ts +221 -221
  74. package/src/components/panel/types/components-button.ts +56 -56
  75. package/src/components/panel/types/components-common.ts +73 -73
  76. package/src/components/panel/types/components-container.ts +25 -25
  77. package/src/components/panel/types/components-deepMenu.ts +64 -64
  78. package/src/components/panel/types/components-input.ts +90 -90
  79. package/src/components/panel/types/components-own.ts +16 -16
  80. package/src/components/panel/types/components-select.ts +169 -169
  81. package/src/components/panel/types/components-selectMultiple.ts +105 -104
  82. package/src/components/panel/types/components-slider.ts +55 -55
  83. package/src/components/panel/types/components-switch.ts +33 -33
  84. package/src/components/panel/types/components-textarea.ts +45 -45
  85. package/src/components/panel/types/index.ts +244 -244
  86. package/src/components/prompt/defaultConfig.ts +94 -94
  87. package/src/components/prompt/index.css +34 -34
  88. package/src/components/prompt/index.ts +187 -215
  89. package/src/components/prompt/types/index.ts +57 -56
  90. package/src/components/rightClickMenu/defaultConfig.ts +103 -103
  91. package/src/components/rightClickMenu/index.css +115 -115
  92. package/src/components/rightClickMenu/index.ts +662 -662
  93. package/src/components/rightClickMenu/types/index.ts +145 -143
  94. package/src/components/searchSuggestion/defaultConfig.ts +63 -63
  95. package/src/components/searchSuggestion/index.ts +813 -813
  96. package/src/components/searchSuggestion/types/index.ts +244 -242
  97. package/src/components/tooltip/defaultConfig.ts +33 -33
  98. package/src/components/tooltip/index.css +199 -199
  99. package/src/components/tooltip/index.ts +617 -617
  100. package/src/components/tooltip/types/index.ts +123 -121
  101. package/src/config/CommonCSSClassName.ts +17 -17
  102. package/src/config/GlobalConfig.ts +63 -63
  103. package/src/css/animation.css +987 -987
  104. package/src/css/button.css +551 -551
  105. package/src/css/common.css +54 -54
  106. package/src/css/index.css +253 -253
  107. package/src/css/ninePalaceGridPosition.css +50 -50
  108. package/src/css/scrollbar.css +22 -22
  109. package/src/handler/PopsElementHandler.ts +303 -303
  110. package/src/handler/PopsHandler.ts +611 -611
  111. package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
  112. package/src/types/animation.d.ts +19 -19
  113. package/src/types/button.d.ts +94 -94
  114. package/src/types/components.d.ts +211 -211
  115. package/src/types/event.d.ts +43 -43
  116. package/src/types/global.d.ts +31 -31
  117. package/src/types/icon.d.ts +32 -32
  118. package/src/types/inst.d.ts +28 -28
  119. package/src/types/main.d.ts +66 -66
  120. package/src/types/mask.d.ts +52 -52
  121. package/src/types/position.d.ts +60 -60
  122. package/src/utils/PopsDOMUtils.ts +2483 -2483
  123. package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
  124. package/src/utils/PopsInstanceUtils.ts +714 -714
  125. package/src/utils/PopsMathUtils.ts +71 -71
  126. package/src/utils/PopsSafeUtils.ts +22 -22
  127. package/src/utils/PopsUtils.ts +391 -421
package/README.md CHANGED
@@ -1,249 +1,249 @@
1
- # 弹窗库
2
-
3
- - 最新版本:[![npm version](https://img.shields.io/npm/v/@whitesev/pops)](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
- ![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
- {
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
- ![pi72ssO.png](https://s11.ax1x.com/2023/12/23/pi72ssO.png)
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
- ![pi722od.png](https://s11.ax1x.com/2023/12/23/pi722od.png)
131
- ![pi72cee.png](https://s11.ax1x.com/2023/12/23/pi72cee.png)
132
- ![pi72gdH.png](https://s11.ax1x.com/2023/12/23/pi72gdH.png)
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
- ![pi72IQf.png](https://s11.ax1x.com/2023/12/23/pi72IQf.png)
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
- ![o7kyTc.png](https://vip.helloimg.com/i/2024/03/17/65f68c239ece4.png)
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
- ![o7rGnT.png](https://vip.helloimg.com/i/2024/03/17/65f68c25cf459.png)
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
- ![o7r5Uq.png](https://vip.helloimg.com/i/2024/03/17/65f68c281dcb0.png)
226
-
227
- ## pops.tooltip
228
-
229
- 提示框
230
-
231
- ```js
232
- pops.tooltip({
233
- target: document.querySelector("#user-container"),
234
- content: "鼠标悬浮提示内容",
235
- });
236
- ```
237
-
238
- ![o7rCFr.png](https://vip.helloimg.com/i/2024/03/17/65f68c299c729.png)
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
+ - 最新版本:[![npm version](https://img.shields.io/npm/v/@whitesev/pops)](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
+ ![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
+ {
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
+ ![pi72ssO.png](https://s11.ax1x.com/2023/12/23/pi72ssO.png)
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
+ ![pi722od.png](https://s11.ax1x.com/2023/12/23/pi722od.png)
131
+ ![pi72cee.png](https://s11.ax1x.com/2023/12/23/pi72cee.png)
132
+ ![pi72gdH.png](https://s11.ax1x.com/2023/12/23/pi72gdH.png)
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
+ ![pi72IQf.png](https://s11.ax1x.com/2023/12/23/pi72IQf.png)
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
+ ![o7kyTc.png](https://vip.helloimg.com/i/2024/03/17/65f68c239ece4.png)
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
+ ![o7rGnT.png](https://vip.helloimg.com/i/2024/03/17/65f68c25cf459.png)
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
+ ![o7r5Uq.png](https://vip.helloimg.com/i/2024/03/17/65f68c281dcb0.png)
226
+
227
+ ## pops.tooltip
228
+
229
+ 提示框
230
+
231
+ ```js
232
+ pops.tooltip({
233
+ target: document.querySelector("#user-container"),
234
+ content: "鼠标悬浮提示内容",
235
+ });
236
+ ```
237
+
238
+ ![o7rCFr.png](https://vip.helloimg.com/i/2024/03/17/65f68c299c729.png)
239
+
240
+ ## pops.searchSuggestion
241
+
242
+ ```js
243
+ let suggestion = pops.searchSuggestion({
244
+ target: document.querySelector("input"),
245
+ });
246
+ suggestion.init();
247
+ ```
248
+
249
+ ## 详情参数请看代码