@whitesev/pops 1.7.6 → 1.7.8
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 +54 -24
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +54 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +54 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +54 -24
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +54 -24
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +54 -24
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/GlobalConfig.d.ts +11 -1
- package/dist/types/src/Pops.d.ts +11 -2
- package/package.json +1 -1
- package/src/GlobalConfig.ts +44 -25
- package/src/components/iframe/index.ts +14 -0
- package/src/components/panel/index.css +11 -8
- package/src/utils/PopsInstanceUtils.ts +2 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { PopsCommonConfig } from "./types/components";
|
|
1
2
|
type EnterReturnType<T> = null | T | (() => T);
|
|
2
3
|
type GlobalConfigOption = {
|
|
3
4
|
style?: EnterReturnType<string>;
|
|
4
5
|
zIndex?: EnterReturnType<number> | EnterReturnType<string>;
|
|
5
|
-
}
|
|
6
|
+
} & Partial<PopsCommonConfig>;
|
|
6
7
|
export declare const GlobalConfig: {
|
|
7
8
|
config: GlobalConfigOption;
|
|
8
9
|
/**
|
|
@@ -15,6 +16,15 @@ export declare const GlobalConfig: {
|
|
|
15
16
|
getGlobalConfig(): {
|
|
16
17
|
style?: string | undefined;
|
|
17
18
|
zIndex?: string | number | undefined;
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
only?: boolean | undefined;
|
|
21
|
+
width?: string | undefined;
|
|
22
|
+
height?: string | undefined;
|
|
23
|
+
position?: import("./types/position").PopsPosition | undefined;
|
|
24
|
+
animation?: import("./types/animation").PopsAnimation | undefined;
|
|
25
|
+
mask?: import("./types/mask").PopsMaskDetails | undefined;
|
|
26
|
+
forbiddenScroll?: boolean | undefined;
|
|
27
|
+
beforeAppendToPageCallBack?: void;
|
|
18
28
|
};
|
|
19
29
|
};
|
|
20
30
|
export {};
|
package/dist/types/src/Pops.d.ts
CHANGED
|
@@ -239,14 +239,23 @@ declare class Pops {
|
|
|
239
239
|
config: {
|
|
240
240
|
style?: string | (() => string) | null;
|
|
241
241
|
zIndex?: (number | (() => number) | null) | (string | (() => string) | null);
|
|
242
|
-
}
|
|
242
|
+
} & Partial<import("./types/components").PopsCommonConfig>;
|
|
243
243
|
setGlobalConfig(config: {
|
|
244
244
|
style?: string | (() => string) | null;
|
|
245
245
|
zIndex?: (number | (() => number) | null) | (string | (() => string) | null);
|
|
246
|
-
}): void;
|
|
246
|
+
} & Partial<import("./types/components").PopsCommonConfig>): void;
|
|
247
247
|
getGlobalConfig(): {
|
|
248
248
|
style?: string | undefined;
|
|
249
249
|
zIndex?: string | number | undefined;
|
|
250
|
+
class?: string | undefined;
|
|
251
|
+
only?: boolean | undefined;
|
|
252
|
+
width?: string | undefined;
|
|
253
|
+
height?: string | undefined;
|
|
254
|
+
position?: import("./types/position").PopsPosition | undefined;
|
|
255
|
+
animation?: import("./types/animation").PopsAnimation | undefined;
|
|
256
|
+
mask?: import("./types/mask").PopsMaskDetails | undefined;
|
|
257
|
+
forbiddenScroll?: boolean | undefined;
|
|
258
|
+
beforeAppendToPageCallBack?: void;
|
|
250
259
|
};
|
|
251
260
|
};
|
|
252
261
|
/**
|
package/package.json
CHANGED
package/src/GlobalConfig.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { PopsCommonConfig } from "./types/components";
|
|
2
|
+
|
|
1
3
|
type EnterReturnType<T> = null | T | (() => T);
|
|
2
4
|
|
|
3
5
|
type GlobalConfigOption = {
|
|
4
6
|
style?: EnterReturnType<string>;
|
|
5
7
|
zIndex?: EnterReturnType<number> | EnterReturnType<string>;
|
|
6
|
-
}
|
|
8
|
+
} & Partial<PopsCommonConfig>;
|
|
7
9
|
|
|
8
10
|
type ResultGlobalConfigOption<T> = T extends null | undefined
|
|
9
11
|
? never
|
|
@@ -29,32 +31,49 @@ export const GlobalConfig = {
|
|
|
29
31
|
GlobalConfigOption[P]
|
|
30
32
|
>;
|
|
31
33
|
} = {};
|
|
32
|
-
|
|
33
|
-
GlobalConfig.config
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
Object.keys(GlobalConfig.config).forEach((keyName) => {
|
|
35
|
+
let configValue = Reflect.get(GlobalConfig.config, keyName);
|
|
36
|
+
if (keyName === "style") {
|
|
37
|
+
// 设置style属性
|
|
38
|
+
let style =
|
|
39
|
+
configValue == null
|
|
40
|
+
? ""
|
|
41
|
+
: typeof configValue === "function"
|
|
42
|
+
? // @ts-ignore
|
|
43
|
+
configValue()
|
|
44
|
+
: configValue;
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if (typeof style === "string") {
|
|
47
|
+
result.style = style;
|
|
48
|
+
}
|
|
49
|
+
} else if (keyName === "zIndex") {
|
|
50
|
+
// 设置zIndex属性
|
|
51
|
+
let zIndex =
|
|
52
|
+
configValue == null
|
|
53
|
+
? ""
|
|
54
|
+
: typeof configValue === "function"
|
|
55
|
+
? configValue()
|
|
56
|
+
: configValue;
|
|
57
|
+
if (typeof zIndex === "string") {
|
|
58
|
+
let newIndex = (zIndex = parseInt(zIndex));
|
|
59
|
+
if (!isNaN(newIndex)) {
|
|
60
|
+
result.zIndex = newIndex;
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
if (!isNaN(zIndex)) {
|
|
64
|
+
result.zIndex = zIndex;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} else if (keyName === "mask") {
|
|
68
|
+
let mask =
|
|
69
|
+
GlobalConfig.config.mask == null ? {} : GlobalConfig.config.mask;
|
|
70
|
+
if (typeof mask === "object" && mask != null) {
|
|
71
|
+
result.mask = mask;
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
Reflect.set(result, keyName, configValue);
|
|
52
75
|
}
|
|
53
|
-
}
|
|
54
|
-
if (!isNaN(zIndex)) {
|
|
55
|
-
result.zIndex = zIndex;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
76
|
+
});
|
|
58
77
|
return result;
|
|
59
78
|
},
|
|
60
79
|
};
|
|
@@ -221,6 +221,9 @@ export class PopsIframe {
|
|
|
221
221
|
if (typeof config?.btn?.min?.callback === "function") {
|
|
222
222
|
config.btn.min.callback(eventDetails, event);
|
|
223
223
|
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
capture: true,
|
|
224
227
|
}
|
|
225
228
|
);
|
|
226
229
|
/* 最大化按钮点击事件 */
|
|
@@ -252,6 +255,9 @@ export class PopsIframe {
|
|
|
252
255
|
if (typeof config?.btn?.max?.callback === "function") {
|
|
253
256
|
config.btn.max.callback(eventDetails, event);
|
|
254
257
|
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
capture: true,
|
|
255
261
|
}
|
|
256
262
|
);
|
|
257
263
|
/* 先隐藏窗口化按钮 */
|
|
@@ -291,6 +297,9 @@ export class PopsIframe {
|
|
|
291
297
|
if (typeof config?.btn?.mise?.callback === "function") {
|
|
292
298
|
config.btn.mise.callback(eventDetails, event);
|
|
293
299
|
}
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
capture: true,
|
|
294
303
|
}
|
|
295
304
|
);
|
|
296
305
|
/* 关闭按钮点击事件 */
|
|
@@ -298,6 +307,8 @@ export class PopsIframe {
|
|
|
298
307
|
headerCloseBtnElement,
|
|
299
308
|
"click",
|
|
300
309
|
(event) => {
|
|
310
|
+
event.preventDefault();
|
|
311
|
+
event.stopPropagation();
|
|
301
312
|
PopsInstanceUtils.removeInstance(
|
|
302
313
|
[pops.config.layer.iframe],
|
|
303
314
|
guid,
|
|
@@ -306,6 +317,9 @@ export class PopsIframe {
|
|
|
306
317
|
if (typeof config?.btn?.close?.callback === "function") {
|
|
307
318
|
config.btn.close.callback(eventDetails, event);
|
|
308
319
|
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
capture: true,
|
|
309
323
|
}
|
|
310
324
|
);
|
|
311
325
|
|
|
@@ -573,6 +573,7 @@ section.pops-panel-container
|
|
|
573
573
|
border: 1px solid #dcdfe6;
|
|
574
574
|
border-radius: 4px;
|
|
575
575
|
background-color: #ffffff;
|
|
576
|
+
position: relative;
|
|
576
577
|
}
|
|
577
578
|
.pops-panel-input:hover {
|
|
578
579
|
box-shadow: 0 0 0 1px #c0c4cc inset;
|
|
@@ -586,17 +587,12 @@ section.pops-panel-container
|
|
|
586
587
|
.pops-panel-input input {
|
|
587
588
|
display: inline-flex;
|
|
588
589
|
justify-content: center;
|
|
590
|
+
text-align: start;
|
|
589
591
|
align-items: center;
|
|
590
|
-
line-height: normal;
|
|
591
592
|
align-content: center;
|
|
592
|
-
height: 32px;
|
|
593
593
|
white-space: nowrap;
|
|
594
594
|
cursor: text;
|
|
595
|
-
text-align: center;
|
|
596
595
|
box-sizing: border-box;
|
|
597
|
-
outline: 0;
|
|
598
|
-
transition: 0.1s;
|
|
599
|
-
font-weight: 500;
|
|
600
596
|
user-select: none;
|
|
601
597
|
-webkit-user-select: none;
|
|
602
598
|
-moz-user-select: none;
|
|
@@ -605,12 +601,17 @@ section.pops-panel-container
|
|
|
605
601
|
-webkit-appearance: none;
|
|
606
602
|
appearance: none;
|
|
607
603
|
background-color: transparent;
|
|
604
|
+
outline: 0;
|
|
605
|
+
transition: 0.1s;
|
|
608
606
|
border: 0;
|
|
609
|
-
padding: 8px 8px;
|
|
610
607
|
font-size: 14px;
|
|
611
|
-
|
|
608
|
+
font-weight: 500;
|
|
609
|
+
line-height: normal;
|
|
610
|
+
height: 32px;
|
|
612
611
|
width: 100%;
|
|
613
612
|
flex: 1;
|
|
613
|
+
margin-right: calc(1em + 8px);
|
|
614
|
+
padding: 8px 8px;
|
|
614
615
|
}
|
|
615
616
|
.pops-panel-input span.pops-panel-input__suffix {
|
|
616
617
|
display: inline-flex;
|
|
@@ -623,6 +624,8 @@ section.pops-panel-container
|
|
|
623
624
|
transition: all 0.3s;
|
|
624
625
|
pointer-events: none;
|
|
625
626
|
margin: 0 8px;
|
|
627
|
+
position: absolute;
|
|
628
|
+
right: 0px;
|
|
626
629
|
}
|
|
627
630
|
.pops-panel-input span.pops-panel-input__suffix-inner {
|
|
628
631
|
pointer-events: all;
|