@whitesev/pops 2.1.5 → 2.1.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.
- package/dist/index.amd.js +101 -49
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +101 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +101 -49
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +101 -49
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +101 -49
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +101 -49
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +13 -0
- package/dist/types/src/types/button.d.ts +8 -39
- package/package.json +3 -2
- package/src/Pops.ts +14 -1
- package/src/components/alert/index.css +0 -47
- package/src/components/alert/index.ts +2 -2
- package/src/components/confirm/index.css +0 -47
- package/src/components/confirm/index.ts +4 -4
- package/src/components/drawer/index.css +0 -17
- package/src/components/drawer/index.ts +2 -3
- package/src/components/folder/config.ts +23 -9
- package/src/components/folder/index.css +67 -62
- package/src/components/folder/index.ts +4 -4
- package/src/components/iframe/index.css +3 -33
- package/src/components/iframe/index.ts +5 -5
- package/src/components/loading/index.css +17 -12
- package/src/components/loading/index.ts +5 -5
- package/src/components/panel/handlerComponents.ts +12 -1
- package/src/components/panel/index.css +136 -63
- package/src/components/panel/index.ts +2 -2
- package/src/components/prompt/index.css +23 -51
- package/src/components/prompt/index.ts +6 -6
- package/src/components/rightClickMenu/index.css +14 -3
- package/src/components/searchSuggestion/index.ts +20 -5
- package/src/components/tooltip/index.css +39 -19
- package/src/css/button.css +354 -98
- package/src/css/index.css +88 -16
- package/src/handler/PopsElementHandler.ts +2 -2
- package/src/types/button.d.ts +8 -39
package/src/css/index.css
CHANGED
|
@@ -13,17 +13,37 @@
|
|
|
13
13
|
--pops-bd-opacity: 1;
|
|
14
14
|
--pops-font-size: 16px;
|
|
15
15
|
interpolate-size: allow-keywords;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
--pops-
|
|
16
|
+
--pops-bg-color: rgb(255, 255, 255, var(--pops-bg-opacity));
|
|
17
|
+
--pops-bd-color: rgb(235, 238, 245, var(--pops-bd-opacity));
|
|
18
|
+
--pops-box-shadow-color: rgba(0, 0, 0, 0.12);
|
|
19
|
+
--pops-title-color: #000000;
|
|
20
|
+
--pops-title-border-color: rgb(229, 229, 229, var(--pops-bd-opacity));
|
|
21
|
+
--pops-content-color: #000000;
|
|
22
|
+
--pops-bottom-btn-controls-border-color: rgb(
|
|
23
|
+
229,
|
|
24
|
+
229,
|
|
25
|
+
229,
|
|
26
|
+
var(--pops-bd-opacity)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
@media (prefers-color-scheme: dark) {
|
|
30
|
+
.pops {
|
|
31
|
+
--pops-mask-bg-opacity: 0.8;
|
|
32
|
+
--pops-bg-color: rgb(17, 17, 17, var(--pops-bg-opacity));
|
|
33
|
+
--pops-bd-color: rgb(55, 55, 55, var(--pops-bd-opacity));
|
|
34
|
+
--pops-box-shadow-color: rgba(81, 81, 81, 0.12);
|
|
35
|
+
--pops-title-color: #e8e8e8;
|
|
36
|
+
--pops-title-border-color: rgb(229, 229, 229, var(--pops-bd-opacity));
|
|
37
|
+
--pops-content-color: #e5e5e5;
|
|
38
|
+
}
|
|
19
39
|
}
|
|
20
40
|
.pops {
|
|
21
|
-
background-color:
|
|
41
|
+
background-color: var(--pops-bg-color);
|
|
42
|
+
border: 1px solid var(--pops-bd-color);
|
|
22
43
|
border-radius: 4px;
|
|
23
|
-
border: 1px solid rgb(235, 238, 245, var(--pops-bd-opacity));
|
|
24
44
|
font-size: var(--pops-font-size);
|
|
25
45
|
line-height: normal;
|
|
26
|
-
box-shadow: 0 0 12px
|
|
46
|
+
box-shadow: 0 0 12px var(--pops-box-shadow-color);
|
|
27
47
|
box-sizing: border-box;
|
|
28
48
|
overflow: hidden;
|
|
29
49
|
transition: all 0.35s;
|
|
@@ -66,6 +86,10 @@
|
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
/* 遮罩层样式 */
|
|
89
|
+
.pops-mask {
|
|
90
|
+
--pops-mask-bg-opacity: 0.4;
|
|
91
|
+
--pops-mask-bg-color: rgba(0, 0, 0, var(--pops-mask-bg-opacity));
|
|
92
|
+
}
|
|
69
93
|
.pops-mask {
|
|
70
94
|
position: fixed;
|
|
71
95
|
top: 0;
|
|
@@ -76,7 +100,7 @@
|
|
|
76
100
|
height: 100%;
|
|
77
101
|
border: 0;
|
|
78
102
|
border-radius: 0;
|
|
79
|
-
background-color:
|
|
103
|
+
background-color: var(--pops-mask-bg-color);
|
|
80
104
|
box-shadow: none;
|
|
81
105
|
transition: none;
|
|
82
106
|
}
|
|
@@ -138,15 +162,7 @@ button.pops-header-control i:hover {
|
|
|
138
162
|
gap: 6px;
|
|
139
163
|
}
|
|
140
164
|
|
|
141
|
-
/*
|
|
142
|
-
.pops [class^="pops"][class*="-title"] p[pops] {
|
|
143
|
-
-webkit-user-select: none;
|
|
144
|
-
-moz-user-select: none;
|
|
145
|
-
-ms-user-select: none;
|
|
146
|
-
user-select: none;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/* <code> */
|
|
165
|
+
/* 代码块 <code> */
|
|
150
166
|
.pops code {
|
|
151
167
|
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
152
168
|
font-size: 0.85em;
|
|
@@ -178,3 +194,59 @@ button.pops-header-control i:hover {
|
|
|
178
194
|
letter-spacing: -0.2em;
|
|
179
195
|
content: "\00a0";
|
|
180
196
|
}
|
|
197
|
+
|
|
198
|
+
/* 标题 */
|
|
199
|
+
.pops .pops-title {
|
|
200
|
+
-webkit-user-select: none;
|
|
201
|
+
-moz-user-select: none;
|
|
202
|
+
-ms-user-select: none;
|
|
203
|
+
user-select: none;
|
|
204
|
+
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: space-between;
|
|
208
|
+
border-bottom: 1px solid var(--pops-title-border-color);
|
|
209
|
+
width: 100%;
|
|
210
|
+
height: var(--container-title-height);
|
|
211
|
+
}
|
|
212
|
+
/* 标题-普通文本 */
|
|
213
|
+
.pops .pops-title p[pops] {
|
|
214
|
+
color: var(--pops-title-color);
|
|
215
|
+
width: 100%;
|
|
216
|
+
overflow: hidden;
|
|
217
|
+
text-indent: 15px;
|
|
218
|
+
text-overflow: ellipsis;
|
|
219
|
+
white-space: nowrap;
|
|
220
|
+
font-weight: 500;
|
|
221
|
+
line-height: normal;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* 内容 */
|
|
225
|
+
.pops .pops-content {
|
|
226
|
+
width: 100%;
|
|
227
|
+
/*height: calc(
|
|
228
|
+
100% - var(--container-title-height) - var(--container-bottom-btn-height)
|
|
229
|
+
);*/
|
|
230
|
+
flex: 1;
|
|
231
|
+
overflow: auto;
|
|
232
|
+
word-break: break-word;
|
|
233
|
+
}
|
|
234
|
+
/* 内容-普通文本 */
|
|
235
|
+
.pops .pops-content p[pops] {
|
|
236
|
+
color: var(--pops-content-color);
|
|
237
|
+
padding: 5px 10px;
|
|
238
|
+
text-indent: 15px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* 底部-按钮组 */
|
|
242
|
+
.pops .pops-botttom-btn-controls {
|
|
243
|
+
display: flex;
|
|
244
|
+
padding: 10px 10px 10px 10px;
|
|
245
|
+
width: 100%;
|
|
246
|
+
height: var(--container-bottom-btn-height);
|
|
247
|
+
max-height: var(--container-bottom-btn-height);
|
|
248
|
+
line-height: normal;
|
|
249
|
+
border-top: 1px solid var(--pops-bottom-btn-controls-border-color);
|
|
250
|
+
text-align: right;
|
|
251
|
+
align-items: center;
|
|
252
|
+
}
|
|
@@ -266,13 +266,13 @@ export const PopsElementHandler = {
|
|
|
266
266
|
flexStyle += "flex-direction: row;";
|
|
267
267
|
}
|
|
268
268
|
resultHTML = /*html*/ `
|
|
269
|
-
<div class="pops-${type}-btn" style="${btnStyle}">${ohterHTML}<div
|
|
269
|
+
<div class="pops-botttom-btn-controls pops-${type}-btn" style="${btnStyle}">${ohterHTML}<div
|
|
270
270
|
class="pops-${type}-btn-merge"
|
|
271
271
|
style="${flexStyle}">${okHTML}${cancelHTML}</div>
|
|
272
272
|
</div>
|
|
273
273
|
`;
|
|
274
274
|
} else {
|
|
275
|
-
resultHTML = /*html*/ `<div class="pops-${type}-btn" style="${btnStyle}">${okHTML}${cancelHTML}${ohterHTML}</div>`;
|
|
275
|
+
resultHTML = /*html*/ `<div class="pops-botttom-btn-controls pops-${type}-btn" style="${btnStyle}">${okHTML}${cancelHTML}${ohterHTML}</div>`;
|
|
276
276
|
}
|
|
277
277
|
return resultHTML;
|
|
278
278
|
},
|
package/src/types/button.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export type PopsButtonStyleType =
|
|
|
16
16
|
| "success"
|
|
17
17
|
| "info"
|
|
18
18
|
| "warning"
|
|
19
|
-
| "danger"
|
|
19
|
+
| "danger"
|
|
20
|
+
| "violet";
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* 按钮大小
|
|
@@ -118,48 +119,16 @@ export interface PopsButtonDetails<T = {}> {
|
|
|
118
119
|
/**
|
|
119
120
|
* 按钮配置(匹配任意类型)
|
|
120
121
|
*/
|
|
121
|
-
export
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
enable: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
|
|
128
|
-
*/
|
|
129
|
-
icon: PopsIconType;
|
|
130
|
-
/**
|
|
131
|
-
* 图标按钮是否放在右边
|
|
132
|
-
*/
|
|
133
|
-
rightIcon: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* 图标按钮是否是旋转360°
|
|
136
|
-
* @default false
|
|
137
|
-
*/
|
|
138
|
-
iconIsLoading: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* 按钮尺寸大小
|
|
141
|
-
* @default ""
|
|
142
|
-
*/
|
|
143
|
-
size: PopsButtonSize;
|
|
122
|
+
export type PopsButtonDetailsAnyType<T = {}> = Omit<
|
|
123
|
+
PopsButtonDetails<T>,
|
|
124
|
+
"type"
|
|
125
|
+
> & {
|
|
144
126
|
/**
|
|
145
127
|
* 按钮样式类型
|
|
128
|
+
* @default "default"
|
|
146
129
|
*/
|
|
147
130
|
type: string;
|
|
148
|
-
|
|
149
|
-
* 按钮文字
|
|
150
|
-
* @default ""
|
|
151
|
-
*/
|
|
152
|
-
text: string;
|
|
153
|
-
/**
|
|
154
|
-
* 按钮点击的回调
|
|
155
|
-
*
|
|
156
|
-
* 如果传入该值,那么将不会自动关闭弹窗
|
|
157
|
-
*/
|
|
158
|
-
callback(
|
|
159
|
-
eventDetails: PopsHandlerEventDetails & T,
|
|
160
|
-
event: PointerEvent | MouseEvent
|
|
161
|
-
): void;
|
|
162
|
-
}
|
|
131
|
+
};
|
|
163
132
|
|
|
164
133
|
/** prompt的点击回调 */
|
|
165
134
|
export interface PopsPromptButtonDetails extends PopsButtonDetails {
|