@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.
Files changed (153) hide show
  1. package/README.md +117 -111
  2. package/dist/index.amd.js +1248 -1287
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.cjs.js +1248 -1287
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.esm.js +1248 -1287
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.iife.js +1248 -1287
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.system.js +1248 -1287
  11. package/dist/index.system.js.map +1 -1
  12. package/dist/index.umd.js +1248 -1287
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/src/Pops.d.ts +9 -10
  15. package/dist/types/src/components/panel/types/components-common.d.ts +26 -26
  16. package/dist/types/src/components/panel/types/index.d.ts +1 -1
  17. package/dist/types/src/components/rightClickMenu/index.d.ts +3 -4
  18. package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
  19. package/dist/types/src/components/searchSuggestion/types/index.d.ts +2 -2
  20. package/dist/types/src/handler/PopsHandler.d.ts +3 -3
  21. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -256
  22. package/dist/types/src/types/animation.d.ts +19 -19
  23. package/dist/types/src/types/button.d.ts +187 -187
  24. package/dist/types/src/types/components.d.ts +210 -213
  25. package/dist/types/src/types/event.d.ts +63 -63
  26. package/dist/types/src/types/global.d.ts +25 -20
  27. package/dist/types/src/types/icon.d.ts +32 -32
  28. package/dist/types/src/types/inst.d.ts +24 -24
  29. package/dist/types/src/types/main.d.ts +111 -114
  30. package/dist/types/src/types/mask.d.ts +49 -49
  31. package/dist/types/src/types/position.d.ts +60 -60
  32. package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
  33. package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -1
  34. package/dist/types/src/utils/PopsUtils.d.ts +16 -16
  35. package/index.ts +3 -0
  36. package/package.json +20 -9
  37. package/src/Pops.ts +206 -0
  38. package/src/PopsAnimation.ts +32 -0
  39. package/src/PopsCSS.ts +51 -0
  40. package/src/PopsCore.ts +64 -0
  41. package/src/PopsIcon.ts +95 -0
  42. package/src/PopsInst.ts +21 -0
  43. package/src/components/alert/config.ts +62 -0
  44. package/src/components/alert/index.css +0 -0
  45. package/src/components/alert/index.ts +163 -0
  46. package/src/components/alert/types/index.ts +23 -0
  47. package/src/components/confirm/config.ts +90 -0
  48. package/src/components/confirm/index.css +0 -0
  49. package/src/components/confirm/index.ts +166 -0
  50. package/src/components/confirm/types/index.ts +17 -0
  51. package/src/components/drawer/config.ts +89 -0
  52. package/src/components/drawer/index.css +37 -0
  53. package/src/components/drawer/index.ts +237 -0
  54. package/src/components/drawer/types/index.ts +61 -0
  55. package/src/components/folder/config.ts +147 -0
  56. package/src/components/folder/folderIcon.ts +28 -0
  57. package/src/components/folder/index.css +303 -0
  58. package/src/components/folder/index.ts +929 -0
  59. package/src/components/folder/types/index.ts +97 -0
  60. package/src/components/iframe/config.ts +60 -0
  61. package/src/components/iframe/index.css +76 -0
  62. package/src/components/iframe/index.ts +334 -0
  63. package/src/components/iframe/types/index.ts +139 -0
  64. package/src/components/loading/config.ts +29 -0
  65. package/src/components/loading/index.css +66 -0
  66. package/src/components/loading/index.ts +99 -0
  67. package/src/components/loading/types/index.ts +34 -0
  68. package/src/components/panel/config.ts +519 -0
  69. package/src/components/panel/handlerComponents.ts +2900 -0
  70. package/src/components/panel/index.css +1222 -0
  71. package/src/components/panel/index.ts +207 -0
  72. package/src/components/panel/types/components-button.ts +68 -0
  73. package/src/components/panel/types/components-common.ts +50 -0
  74. package/src/components/panel/types/components-deepMenu.ts +84 -0
  75. package/src/components/panel/types/components-forms.ts +44 -0
  76. package/src/components/panel/types/components-input.ts +78 -0
  77. package/src/components/panel/types/components-own.ts +30 -0
  78. package/src/components/panel/types/components-select.ts +93 -0
  79. package/src/components/panel/types/components-selectMultiple.ts +130 -0
  80. package/src/components/panel/types/components-slider.ts +77 -0
  81. package/src/components/panel/types/components-switch.ts +56 -0
  82. package/src/components/panel/types/components-textarea.ts +68 -0
  83. package/src/components/panel/types/index.ts +177 -0
  84. package/src/components/prompt/config.ts +94 -0
  85. package/src/components/prompt/index.css +34 -0
  86. package/src/components/prompt/index.ts +216 -0
  87. package/src/components/prompt/types/index.ts +55 -0
  88. package/src/components/rightClickMenu/config.ts +98 -0
  89. package/src/components/rightClickMenu/index.css +112 -0
  90. package/src/components/rightClickMenu/index.ts +602 -0
  91. package/src/components/rightClickMenu/types/index.ts +97 -0
  92. package/src/components/searchSuggestion/config.ts +56 -0
  93. package/src/components/searchSuggestion/index.ts +856 -0
  94. package/src/components/searchSuggestion/types/index.ts +239 -0
  95. package/src/components/tooltip/config.ts +34 -0
  96. package/src/components/tooltip/index.css +199 -0
  97. package/src/components/tooltip/index.ts +604 -0
  98. package/src/components/tooltip/types/index.ts +117 -0
  99. package/src/config/CommonCSSClassName.ts +17 -0
  100. package/src/config/GlobalConfig.ts +63 -0
  101. package/src/css/animation.css +987 -0
  102. package/src/css/button.css +551 -0
  103. package/src/css/common.css +48 -0
  104. package/src/css/index.css +253 -0
  105. package/src/css/ninePalaceGridPosition.css +50 -0
  106. package/src/css/scrollbar.css +22 -0
  107. package/src/handler/PopsElementHandler.ts +304 -0
  108. package/src/handler/PopsHandler.ts +589 -0
  109. package/src/svg/arrowLeft.svg +4 -0
  110. package/src/svg/arrowRight.svg +4 -0
  111. package/src/svg/chromeFilled.svg +11 -0
  112. package/src/svg/circleClose.svg +8 -0
  113. package/src/svg/close.svg +5 -0
  114. package/src/svg/cpu.svg +8 -0
  115. package/src/svg/delete.svg +5 -0
  116. package/src/svg/documentCopy.svg +5 -0
  117. package/src/svg/edit.svg +8 -0
  118. package/src/svg/eleme.svg +5 -0
  119. package/src/svg/elemePlus.svg +5 -0
  120. package/src/svg/headset.svg +5 -0
  121. package/src/svg/hide.svg +8 -0
  122. package/src/svg/keyboard.svg +8 -0
  123. package/src/svg/loading.svg +5 -0
  124. package/src/svg/max.svg +5 -0
  125. package/src/svg/min.svg +5 -0
  126. package/src/svg/mise.svg +5 -0
  127. package/src/svg/monitor.svg +5 -0
  128. package/src/svg/next.svg +5 -0
  129. package/src/svg/picture.svg +8 -0
  130. package/src/svg/prev.svg +5 -0
  131. package/src/svg/search.svg +5 -0
  132. package/src/svg/share.svg +5 -0
  133. package/src/svg/upload.svg +5 -0
  134. package/src/svg/videoPause.svg +5 -0
  135. package/src/svg/videoPlay.svg +5 -0
  136. package/src/svg/view.svg +5 -0
  137. package/src/types/PopsDOMUtilsEventType.d.ts +252 -0
  138. package/src/types/animation.d.ts +19 -0
  139. package/src/types/button.d.ts +187 -0
  140. package/src/types/components.d.ts +210 -0
  141. package/src/types/event.d.ts +63 -0
  142. package/src/types/global.d.ts +25 -0
  143. package/src/types/icon.d.ts +32 -0
  144. package/src/types/inst.d.ts +24 -0
  145. package/src/types/main.d.ts +111 -0
  146. package/src/types/mask.d.ts +49 -0
  147. package/src/types/position.d.ts +60 -0
  148. package/src/utils/PopsDOMUtils.ts +2408 -0
  149. package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
  150. package/src/utils/PopsInstanceUtils.ts +688 -0
  151. package/src/utils/PopsMathUtils.ts +71 -0
  152. package/src/utils/PopsSafeUtils.ts +22 -0
  153. package/src/utils/PopsUtils.ts +406 -0
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # 弹窗库
2
2
 
3
- + 最新版本:[![npm version](https://img.shields.io/npm/v/@whitesev/pops)](https://www.npmjs.com/package/@whitesev/pops)
3
+ - 最新版本:[![npm version](https://img.shields.io/npm/v/@whitesev/pops)](https://www.npmjs.com/package/@whitesev/pops)
4
4
 
5
- ```js
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
- content: {
23
- text: "普通信息框",
24
- },
25
- mask: {
26
- enable: true,
27
- clickEvent:{
28
- toClose: true
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
- content: {
43
- text: "询问框",
44
- },
45
- mask: {
46
- enable: true,
47
- clickEvent:{
48
- toClose: true
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
- content: {
63
- text: "抽屉层",
64
- },
65
- mask: {
66
- enable: true,
67
- clickEvent:{
68
- toClose: true
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
- 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
- },
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
- url: window.location.href,
116
- title: {
117
- text: "iframe层"
118
- },
119
- mask: {
120
- enable: true,
121
- clickEvent:{
122
- toClose: true
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
- parent: document.body,
139
- content: {
140
- text: "加载中...",
141
- icon: "loading",
142
- },
143
- mask: {
144
- enable: true,
145
- clickEvent:{
146
- toClose: true
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
- 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
- },
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
- content: {
188
- text: "输入框的内容",
189
- },
190
- mask: {
191
- enable: true,
192
- clickEvent:{
193
- toClose: true
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
- 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
- },]
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
- target: document.querySelector("#user-container"),
228
- content: "鼠标悬浮提示内容",
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
- target: document.querySelector("input"),
239
- })
244
+ target: document.querySelector("input"),
245
+ });
240
246
  suggestion.init();
241
247
  ```
242
248