@whitesev/pops 1.4.0 → 1.5.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 (105) hide show
  1. package/dist/index.amd.js.map +1 -1
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.iife.js.map +1 -1
  5. package/dist/index.system.js.map +1 -1
  6. package/dist/index.umd.js.map +1 -1
  7. package/package.json +50 -48
  8. package/src/Config.ts +3 -0
  9. package/src/Core.ts +45 -0
  10. package/src/Pops.ts +340 -0
  11. package/src/components/alert/index.css +45 -0
  12. package/src/components/alert/index.ts +216 -0
  13. package/src/components/alert/indexType.ts +30 -0
  14. package/src/components/confirm/index.css +45 -0
  15. package/src/components/confirm/index.ts +264 -0
  16. package/src/components/confirm/indexType.ts +17 -0
  17. package/src/components/drawer/index.css +47 -0
  18. package/src/components/drawer/index.ts +338 -0
  19. package/src/components/drawer/indexType.ts +53 -0
  20. package/src/components/folder/folderIcon.ts +28 -0
  21. package/src/components/folder/index.css +291 -0
  22. package/src/components/folder/index.ts +1111 -0
  23. package/src/components/folder/indexType.ts +87 -0
  24. package/src/components/iframe/index.css +90 -0
  25. package/src/components/iframe/index.ts +415 -0
  26. package/src/components/iframe/indexType.ts +144 -0
  27. package/src/components/loading/index.css +60 -0
  28. package/src/components/loading/index.ts +123 -0
  29. package/src/components/loading/indexType.ts +31 -0
  30. package/src/components/panel/buttonType.ts +60 -0
  31. package/src/components/panel/commonType.ts +50 -0
  32. package/src/components/panel/deepMenuType.ts +59 -0
  33. package/src/components/panel/formsType.ts +32 -0
  34. package/src/components/panel/index.css +754 -0
  35. package/src/components/panel/index.ts +2435 -0
  36. package/src/components/panel/indexType.ts +107 -0
  37. package/src/components/panel/inputType.ts +65 -0
  38. package/src/components/panel/ownType.ts +28 -0
  39. package/src/components/panel/selectType.ts +80 -0
  40. package/src/components/panel/sliderType.ts +59 -0
  41. package/src/components/panel/switchType.ts +43 -0
  42. package/src/components/panel/textareaType.ts +54 -0
  43. package/src/components/prompt/index.css +60 -0
  44. package/src/components/prompt/index.ts +293 -0
  45. package/src/components/prompt/indexType.ts +47 -0
  46. package/src/components/rightClickMenu/index.ts +729 -0
  47. package/src/components/rightClickMenu/indexType.ts +89 -0
  48. package/src/components/searchSuggestion/index.css +0 -0
  49. package/src/components/searchSuggestion/index.ts +656 -0
  50. package/src/components/searchSuggestion/indexType.ts +238 -0
  51. package/src/components/tooltip/index.css +171 -0
  52. package/src/components/tooltip/index.ts +358 -0
  53. package/src/components/tooltip/indexType.ts +95 -0
  54. package/src/css/animation.css +2240 -0
  55. package/src/css/button.css +290 -0
  56. package/src/css/common.css +24 -0
  57. package/src/css/index.css +135 -0
  58. package/src/css/ninePalaceGridPosition.css +50 -0
  59. package/src/css/scrollbar.css +18 -0
  60. package/src/handler/PopsElementHandler.ts +353 -0
  61. package/src/handler/PopsHandler.ts +659 -0
  62. package/src/svg/arrowLeft.svg +4 -0
  63. package/src/svg/arrowRight.svg +4 -0
  64. package/src/svg/chromeFilled.svg +14 -0
  65. package/src/svg/circleClose.svg +8 -0
  66. package/src/svg/close.svg +5 -0
  67. package/src/svg/cpu.svg +8 -0
  68. package/src/svg/delete.svg +5 -0
  69. package/src/svg/documentCopy.svg +5 -0
  70. package/src/svg/edit.svg +8 -0
  71. package/src/svg/eleme.svg +5 -0
  72. package/src/svg/elemePlus.svg +5 -0
  73. package/src/svg/headset.svg +5 -0
  74. package/src/svg/hide.svg +8 -0
  75. package/src/svg/keyboard.svg +8 -0
  76. package/src/svg/loading.svg +5 -0
  77. package/src/svg/max.svg +5 -0
  78. package/src/svg/min.svg +5 -0
  79. package/src/svg/mise.svg +5 -0
  80. package/src/svg/monitor.svg +5 -0
  81. package/src/svg/next.svg +5 -0
  82. package/src/svg/picture.svg +8 -0
  83. package/src/svg/prev.svg +5 -0
  84. package/src/svg/search.svg +5 -0
  85. package/src/svg/share.svg +5 -0
  86. package/src/svg/upload.svg +5 -0
  87. package/src/svg/videoPause.svg +5 -0
  88. package/src/svg/videoPlay.svg +5 -0
  89. package/src/svg/view.svg +5 -0
  90. package/src/types/PopsDOMUtilsEventType.d.ts +246 -0
  91. package/src/types/animation.d.ts +19 -0
  92. package/src/types/button.d.ts +226 -0
  93. package/src/types/components.d.ts +197 -0
  94. package/src/types/event.d.ts +62 -0
  95. package/src/types/global.d.ts +11 -0
  96. package/src/types/icon.d.ts +32 -0
  97. package/src/types/layer.d.ts +20 -0
  98. package/src/types/main.d.ts +136 -0
  99. package/src/types/mask.d.ts +35 -0
  100. package/src/types/position.d.ts +60 -0
  101. package/src/utils/AnyTouch.js +1394 -0
  102. package/src/utils/PopsDOMUtils.ts +2013 -0
  103. package/src/utils/PopsInstanceUtils.ts +685 -0
  104. package/src/utils/PopsMathUtils.ts +77 -0
  105. package/src/utils/PopsUtils.ts +380 -0
@@ -0,0 +1,290 @@
1
+ .pops {
2
+ --button-font-size: 14px;
3
+ --button-height: 32px;
4
+ --button-color: rgb(51, 51, 51);
5
+ --button-bd-color: rgb(220, 223, 230, var(--pops-bd-opacity));
6
+ --button-bg-color: rgb(220, 223, 230, var(--pops-bg-opacity));
7
+ --button-margin-top: 0px;
8
+ --button-margin-bottom: 0px;
9
+ --button-margin-left: 5px;
10
+ --button-margin-right: 5px;
11
+ --button-padding-top: 6px;
12
+ --button-padding-bottom: 6px;
13
+ --button-padding-left: 12px;
14
+ --button-padding-right: 12px;
15
+ --button-radius: 4px;
16
+
17
+ --container-title-height: 55px;
18
+ --container-bottom-btn-height: 55px;
19
+ }
20
+ .pops[data-bottom-btn="false"] {
21
+ --container-bottom-btn-height: 0px;
22
+ }
23
+ .pops button {
24
+ white-space: nowrap;
25
+ float: right;
26
+ display: inline-block;
27
+ margin: var(--button-margin-top) var(--button-margin-right)
28
+ var(--button-margin-bottom) var(--button-margin-left);
29
+ padding: var(--button-padding-top) var(--button-padding-right)
30
+ var(--button-padding-bottom) var(--button-padding-left);
31
+ outline: 0;
32
+ }
33
+ .pops button[data-has-icon="false"] .pops-bottom-icon {
34
+ display: none;
35
+ }
36
+ .pops button {
37
+ border-radius: var(--button-radius);
38
+ box-shadow: none;
39
+ font-weight: 400;
40
+ font-size: var(--button-font-size);
41
+ cursor: pointer;
42
+ transition: all 0.3s ease-in-out;
43
+ }
44
+ .pops button {
45
+ display: flex;
46
+ align-items: center;
47
+ height: var(--button-height);
48
+ line-height: 1;
49
+ box-sizing: border-box;
50
+ user-select: none;
51
+ -webkit-user-select: none;
52
+ -moz-user-select: none;
53
+ -ms-user-select: none;
54
+ border: 1px solid var(--button-bd-color);
55
+ }
56
+ .pops button {
57
+ color: var(--button-color);
58
+ border-color: var(--button-bd-color);
59
+ background-color: var(--button-bg-color);
60
+ }
61
+ .pops button:active {
62
+ color: var(--button-color);
63
+ border-color: var(--button-bd-color);
64
+ background-color: var(--button-bg-color);
65
+ outline: 0;
66
+ }
67
+ .pops button:hover {
68
+ color: var(--button-color);
69
+ border-color: var(--button-bd-color);
70
+ background-color: var(--button-bg-color);
71
+ }
72
+ .pops button:focus-visible {
73
+ color: var(--button-color);
74
+ border-color: var(--button-bd-color);
75
+ background-color: var(--button-bg-color);
76
+ }
77
+ .pops button:disabled {
78
+ cursor: not-allowed;
79
+ color: var(--button-color);
80
+ border-color: var(--button-bd-color);
81
+ background-color: var(--button-bg-color);
82
+ }
83
+ .pops button.pops-button-large {
84
+ --button-height: 32px;
85
+ --button-padding-top: 12px;
86
+ --button-padding-bottom: 12px;
87
+ --button-padding-left: 19px;
88
+ --button-padding-right: 19px;
89
+ --button-font-size: 14px;
90
+ --button-border-radius: 4px;
91
+ }
92
+
93
+ .pops button.pops-button-small {
94
+ --button-height: 24px;
95
+ --button-padding-top: 5px;
96
+ --button-padding-bottom: 5px;
97
+ --button-padding-left: 11px;
98
+ --button-padding-right: 11px;
99
+ --button-font-size: 12px;
100
+ --button-border-radius: 4px;
101
+ }
102
+ .pops-panel-button-no-icon .pops-panel-button_inner i {
103
+ display: none;
104
+ }
105
+ .pops-panel-button-right-icon {
106
+ }
107
+ .pops-panel-button-right-icon .pops-panel-button_inner {
108
+ flex-direction: row-reverse;
109
+ }
110
+ .pops-panel-button-right-icon .pops-panel-button_inner i {
111
+ }
112
+ .pops-panel-button .pops-panel-button_inner i:has(svg),
113
+ .pops-panel-button-right-icon .pops-panel-button-text {
114
+ margin-right: 6px;
115
+ }
116
+
117
+ .pops button[type="default"] {
118
+ --button-color: #333333;
119
+ --button-bd-color: #dcdfe6;
120
+ --button-bg-color: #ffffff;
121
+ }
122
+ .pops button[type="default"]:active {
123
+ --button-color: #409eff;
124
+ --button-bd-color: #409eff;
125
+ --button-bg-color: #ecf5ff;
126
+ }
127
+ .pops button[type="default"]:hover {
128
+ --button-color: #409eff;
129
+ --button-bd-color: #c6e2ff;
130
+ --button-bg-color: #ecf5ff;
131
+ }
132
+ .pops button[type="default"]:focus-visible {
133
+ outline: 2px solid #a0cfff;
134
+ outline-offset: 1px;
135
+ }
136
+ .pops button[type="default"]:disabled {
137
+ --button-color: #a8abb2;
138
+ --button-bd-color: #fff;
139
+ --button-bg-color: #e4e7ed;
140
+ }
141
+
142
+ .pops button[type="primary"] {
143
+ --button-color: #ffffff;
144
+ --button-bd-color: #409eff;
145
+ --button-bg-color: #409eff;
146
+ }
147
+ .pops button[type="primary"]:active {
148
+ --button-color: #ffffff;
149
+ --button-bd-color: #337ecc;
150
+ --button-bg-color: #337ecc;
151
+ }
152
+ .pops button[type="primary"]:hover {
153
+ --button-color: #ffffff;
154
+ --button-bd-color: #79bbff;
155
+ --button-bg-color: #79bbff;
156
+ }
157
+ .pops button[type="primary"]:focus-visible {
158
+ outline: 2px solid #a0cfff;
159
+ outline-offset: 1px;
160
+ }
161
+ .pops button[type="primary"]:disabled {
162
+ --button-color: #ffffff;
163
+ --button-bd-color: #a0cfff;
164
+ --button-bg-color: #a0cfff;
165
+ }
166
+
167
+ .pops button[type="success"] {
168
+ --button-color: #ffffff;
169
+ --button-bd-color: #4cae4c;
170
+ --button-bg-color: #5cb85c;
171
+ }
172
+ .pops button[type="success"]:active {
173
+ --button-color: #ffffff;
174
+ --button-bd-color: #529b2e;
175
+ --button-bg-color: #529b2e;
176
+ }
177
+ .pops button[type="success"]:hover {
178
+ --button-color: #ffffff;
179
+ --button-bd-color: #95d475;
180
+ --button-bg-color: #95d475;
181
+ }
182
+ .pops button[type="success"]:focus-visible {
183
+ outline: 2px solid #b3e19d;
184
+ outline-offset: 1px;
185
+ }
186
+ .pops button[type="success"]:disabled {
187
+ --button-color: #ffffff;
188
+ --button-bd-color: #b3e19d;
189
+ --button-bg-color: #b3e19d;
190
+ }
191
+
192
+ .pops button[type="info"] {
193
+ --button-color: #ffffff;
194
+ --button-bd-color: #909399;
195
+ --button-bg-color: #909399;
196
+ }
197
+ .pops button[type="info"]:active {
198
+ --button-color: #ffffff;
199
+ --button-bd-color: #73767a;
200
+ --button-bg-color: #73767a;
201
+ }
202
+ .pops button[type="info"]:hover {
203
+ --button-color: #ffffff;
204
+ --button-bd-color: #b1b3b8;
205
+ --button-bg-color: #b1b3b8;
206
+ }
207
+ .pops button[type="info"]:focus-visible {
208
+ outline: 2px solid #c8c9cc;
209
+ outline-offset: 1px;
210
+ }
211
+ .pops button[type="info"]:disabled {
212
+ --button-color: #ffffff;
213
+ --button-bd-color: #c8c9cc;
214
+ --button-bg-color: #c8c9cc;
215
+ }
216
+
217
+ .pops button[type="warning"] {
218
+ --button-color: #ffffff;
219
+ --button-bd-color: #e6a23c;
220
+ --button-bg-color: #e6a23c;
221
+ }
222
+ .pops button[type="warning"]:active {
223
+ --button-color: #ffffff;
224
+ --button-bd-color: #b88230;
225
+ --button-bg-color: #b88230;
226
+ }
227
+ .pops button[type="warning"]:hover {
228
+ --button-color: #ffffff;
229
+ --button-bd-color: #eebe77;
230
+ --button-bg-color: #eebe77;
231
+ }
232
+ .pops button[type="warning"]:focus-visible {
233
+ outline: 2px solid #f3d19e;
234
+ outline-offset: 1px;
235
+ }
236
+ .pops button[type="warning"]:disabled {
237
+ --button-color: #ffffff;
238
+ --button-bd-color: #f3d19e;
239
+ --button-bg-color: #f3d19e;
240
+ }
241
+
242
+ .pops button[type="danger"] {
243
+ --button-color: #ffffff;
244
+ --button-bd-color: #f56c6c;
245
+ --button-bg-color: #f56c6c;
246
+ }
247
+ .pops button[type="danger"]:active {
248
+ --button-color: #ffffff;
249
+ --button-bd-color: #c45656;
250
+ --button-bg-color: #c45656;
251
+ }
252
+ .pops button[type="danger"]:hover {
253
+ --button-color: #ffffff;
254
+ --button-bd-color: #f89898;
255
+ --button-bg-color: #f89898;
256
+ }
257
+ .pops button[type="danger"]:focus-visible {
258
+ outline: 2px solid #fab6b6;
259
+ outline-offset: 1px;
260
+ }
261
+ .pops button[type="danger"]:disabled {
262
+ --button-color: #ffffff;
263
+ --button-bd-color: #fab6b6;
264
+ --button-bg-color: #fab6b6;
265
+ }
266
+
267
+ .pops button[type="xiaomi-primary"] {
268
+ --button-color: #ffffff;
269
+ --button-bd-color: #ff5c00;
270
+ --button-bg-color: #ff5c00;
271
+ }
272
+ .pops button[type="xiaomi-primary"]:active {
273
+ --button-color: #ffffff;
274
+ --button-bd-color: #da4f00;
275
+ --button-bg-color: #da4f00;
276
+ }
277
+ .pops button[type="xiaomi-primary"]:hover {
278
+ --button-color: #ffffff;
279
+ --button-bd-color: #ff7e29;
280
+ --button-bg-color: #ff7e29;
281
+ }
282
+ .pops button[type="xiaomi-primary"]:focus-visible {
283
+ outline: 2px solid #fab6b6;
284
+ outline-offset: 1px;
285
+ }
286
+ .pops button[type="xiaomi-primary"]:disabled {
287
+ --button-color: #ffffff;
288
+ --button-bd-color: #fad5b6;
289
+ --button-bg-color: #fad5b6;
290
+ }
@@ -0,0 +1,24 @@
1
+ .pops-flex-items-center {
2
+ display: flex;
3
+ align-items: center;
4
+ }
5
+ .pops-flex-y-center {
6
+ display: flex;
7
+ justify-content: space-between;
8
+ }
9
+ .pops-flex-x-center {
10
+ display: flex;
11
+ align-content: center;
12
+ }
13
+ .pops-hide {
14
+ display: none;
15
+ }
16
+ .pops-hide-important {
17
+ display: none !important;
18
+ }
19
+ .pops-no-border {
20
+ border: 0;
21
+ }
22
+ .pops-no-border-important {
23
+ border: 0;
24
+ }
@@ -0,0 +1,135 @@
1
+ @charset "utf-8";
2
+ * {
3
+ -webkit-box-sizing: border-box;
4
+ box-sizing: border-box;
5
+ margin: 0;
6
+ padding: 0;
7
+ -webkit-tap-highlight-color: transparent;
8
+ /* 代替::-webkit-scrollbar */
9
+ scrollbar-width: thin;
10
+ }
11
+ .pops {
12
+ --pops-bg-opacity: 1;
13
+ --pops-bd-opacity: 1;
14
+ --pops-font-size: 16px;
15
+ }
16
+ .pops-mask {
17
+ --pops-mask-bg-opacity: 0.4;
18
+ }
19
+ .pops {
20
+ background-color: rgb(255, 255, 255, var(--pops-bg-opacity));
21
+ border-radius: 4px;
22
+ border: 1px solid rgb(235, 238, 245, var(--pops-bd-opacity));
23
+ font-size: var(--pops-font-size);
24
+ box-shadow: 0 0 12px rgba(0, 0, 0, 0.12);
25
+ box-sizing: border-box;
26
+ overflow: hidden;
27
+ transition: all 0.35s;
28
+ }
29
+ .pops-anim {
30
+ position: fixed;
31
+ top: 0;
32
+ right: 0;
33
+ bottom: 0;
34
+ left: 0;
35
+ width: 100%;
36
+ height: 100%;
37
+ }
38
+ .pops-anim[anim=""] {
39
+ top: unset;
40
+ right: unset;
41
+ bottom: unset;
42
+ left: unset;
43
+ width: unset;
44
+ height: unset;
45
+ transition: none;
46
+ }
47
+ /* 底部图标动画和样式 */
48
+ .pops i.pops-bottom-icon[is-loading="true"] {
49
+ animation: rotating 2s linear infinite;
50
+ }
51
+ .pops i.pops-bottom-icon {
52
+ height: 1em;
53
+ width: 1em;
54
+ line-height: 1em;
55
+ display: inline-flex;
56
+ justify-content: center;
57
+ align-items: center;
58
+ position: relative;
59
+ fill: currentColor;
60
+ color: inherit;
61
+ font-size: inherit;
62
+ }
63
+
64
+ /* 遮罩层样式 */
65
+ .pops-mask {
66
+ position: fixed;
67
+ top: 0;
68
+ right: 0;
69
+ bottom: 0;
70
+ left: 0;
71
+ width: 100%;
72
+ height: 100%;
73
+ border: 0;
74
+ border-radius: 0;
75
+ background-color: rgba(0, 0, 0, var(--pops-mask-bg-opacity));
76
+ box-shadow: none;
77
+ transition: none;
78
+ }
79
+
80
+ .pops-header-controls button.pops-header-control[type][data-header] {
81
+ float: right;
82
+ margin: 0 0;
83
+ outline: 0;
84
+ border: 0;
85
+ border-color: rgb(136, 136, 136, var(--pops-bd-opacity));
86
+ background-color: transparent;
87
+ color: #888;
88
+ cursor: pointer;
89
+ }
90
+ .pops-header-controls button.pops-header-control[type="max"],
91
+ .pops-header-controls button.pops-header-control[type="mise"],
92
+ .pops-header-controls button.pops-header-control[type="min"] {
93
+ position: relative;
94
+ float: right;
95
+ margin: 0 2px;
96
+ outline: 0 !important;
97
+ border: 0;
98
+ border-color: rgb(136, 136, 136, var(--pops-bd-opacity));
99
+ background-color: transparent;
100
+ color: rgb(136, 136, 136);
101
+ cursor: pointer;
102
+ transition: all 0.3s ease-in-out;
103
+ }
104
+ button.pops-header-control i {
105
+ color: rgb(144, 147, 153);
106
+ font-size: inherit;
107
+ display: inline-flex;
108
+ justify-content: center;
109
+ align-items: center;
110
+ position: relative;
111
+ fill: currentColor;
112
+ }
113
+ button.pops-header-control svg {
114
+ height: 1.25em;
115
+ width: 1.25em;
116
+ }
117
+ button.pops-header-control {
118
+ right: 15px;
119
+ padding: 0;
120
+ border: none;
121
+ outline: 0;
122
+ background: 0 0;
123
+ cursor: pointer;
124
+ position: unset;
125
+ line-height: 1.15;
126
+ }
127
+ button.pops-header-control i:hover {
128
+ color: rgb(64, 158, 255);
129
+ }
130
+ .pops-header-controls[data-margin] button.pops-header-control {
131
+ margin: 0 6px;
132
+ }
133
+ .pops[type-value] .pops-header-controls {
134
+ display: flex;
135
+ }
@@ -0,0 +1,50 @@
1
+ .pops[position="top_left"] {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ }
6
+ .pops[position="top"] {
7
+ position: fixed;
8
+ top: 0;
9
+ left: 50%;
10
+ transform: translateX(-50%);
11
+ }
12
+ .pops[position="top_right"] {
13
+ position: fixed;
14
+ top: 0;
15
+ right: 0;
16
+ }
17
+ .pops[position="center_left"] {
18
+ position: fixed;
19
+ top: 50%;
20
+ left: 0;
21
+ transform: translateY(-50%);
22
+ }
23
+ .pops[position="center"] {
24
+ position: fixed;
25
+ top: 50%;
26
+ left: 50%;
27
+ transform: translate(-50%, -50%);
28
+ }
29
+ .pops[position="center_right"] {
30
+ position: fixed;
31
+ top: 50%;
32
+ right: 0;
33
+ transform: translateY(-50%);
34
+ }
35
+ .pops[position="bottom_left"] {
36
+ position: fixed;
37
+ bottom: 0;
38
+ left: 0;
39
+ }
40
+ .pops[position="bottom"] {
41
+ position: fixed;
42
+ bottom: 0;
43
+ left: 50%;
44
+ transform: translate(-50%, 0);
45
+ }
46
+ .pops[position="bottom_right"] {
47
+ position: fixed;
48
+ right: 0;
49
+ bottom: 0;
50
+ }
@@ -0,0 +1,18 @@
1
+ /* firefox上暂不支持::-webkit-scrollbar */
2
+ .pops ::-webkit-scrollbar {
3
+ width: 6px;
4
+ height: 0;
5
+ }
6
+
7
+ .pops ::-webkit-scrollbar-track {
8
+ width: 0;
9
+ }
10
+ .pops ::-webkit-scrollbar-thumb:hover {
11
+ background: rgb(178, 178, 178, var(--pops-bg-opacity));
12
+ }
13
+ .pops ::-webkit-scrollbar-thumb {
14
+ min-height: 28px;
15
+ border-radius: 2em;
16
+ background: rgb(204, 204, 204, var(--pops-bg-opacity));
17
+ background-clip: padding-box;
18
+ }