@whitesev/pops 1.7.7 → 1.7.9
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 +46 -24
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +46 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +46 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +46 -24
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +46 -24
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +46 -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 +12 -3
- package/dist/types/src/components/panel/PanelHandleContentDetails.d.ts +1 -1
- package/dist/types/src/components/panel/commonType.d.ts +4 -2
- package/package.json +1 -1
- package/src/GlobalConfig.ts +44 -25
- package/src/Pops.ts +1 -1
- package/src/components/panel/PanelHandleContentDetails.ts +5 -2
- package/src/components/panel/commonType.ts +4 -2
- package/src/components/panel/index.css +11 -8
|
@@ -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
|
@@ -215,7 +215,7 @@ declare class Pops {
|
|
|
215
215
|
createSectionContainerItem_own(formConfig: import("./components/panel/ownType").PopsPanelOwnDetails): HTMLLIElement;
|
|
216
216
|
createSectionContainerItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails): HTMLLIElement | undefined;
|
|
217
217
|
initFormItem(formConfig: import("./components/panel/indexType").PopsPanelContentConfig): void;
|
|
218
|
-
uListContainerAddItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails, containerOptions: import("./components/panel/commonType").PopsPanelRightAsideContainerOptions): void;
|
|
218
|
+
uListContainerAddItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails, containerOptions: Omit<import("./components/panel/commonType").PopsPanelRightAsideContainerOptions, "target">): void;
|
|
219
219
|
setAsideItemClickEvent(asideLiElement: HTMLElement, asideConfig: import("./components/panel/indexType").PopsPanelContentConfig): void;
|
|
220
220
|
};
|
|
221
221
|
};
|
|
@@ -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
|
/**
|
|
@@ -155,7 +155,7 @@ export declare const PanelHandleContentDetails: () => {
|
|
|
155
155
|
* @param formConfig
|
|
156
156
|
* @param containerOptions
|
|
157
157
|
*/
|
|
158
|
-
uListContainerAddItem(formConfig: PopsPanelFormsTotalDetails, containerOptions: PopsPanelRightAsideContainerOptions): void;
|
|
158
|
+
uListContainerAddItem(formConfig: PopsPanelFormsTotalDetails, containerOptions: Omit<PopsPanelRightAsideContainerOptions, "target">): void;
|
|
159
159
|
/**
|
|
160
160
|
* 为左侧容器元素添加点击事件
|
|
161
161
|
* @param asideLiElement 左侧的容器<li>元素
|
|
@@ -3,9 +3,11 @@ import { PopsPanelFormsTotalDetails } from "./indexType";
|
|
|
3
3
|
* 右侧容器的配置
|
|
4
4
|
*/
|
|
5
5
|
export interface PopsPanelRightAsideContainerOptions {
|
|
6
|
-
/**
|
|
6
|
+
/** 当前的<li>元素 */
|
|
7
|
+
target: HTMLLIElement | undefined;
|
|
8
|
+
/** 当前的<li>元素的父<ul>元素 */
|
|
7
9
|
ulElement: HTMLUListElement;
|
|
8
|
-
/**
|
|
10
|
+
/** 当前的<li>元素所在的统一的<ul>元素 */
|
|
9
11
|
sectionContainerULElement?: HTMLUListElement;
|
|
10
12
|
/** */
|
|
11
13
|
formContainerListElement?: HTMLLIElement;
|
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
|
};
|
package/src/Pops.ts
CHANGED
|
@@ -2577,14 +2577,17 @@ export const PanelHandleContentDetails = () => {
|
|
|
2577
2577
|
*/
|
|
2578
2578
|
uListContainerAddItem(
|
|
2579
2579
|
formConfig: PopsPanelFormsTotalDetails,
|
|
2580
|
-
containerOptions: PopsPanelRightAsideContainerOptions
|
|
2580
|
+
containerOptions: Omit<PopsPanelRightAsideContainerOptions, "target">
|
|
2581
2581
|
) {
|
|
2582
2582
|
let itemLiElement = this.createSectionContainerItem(formConfig);
|
|
2583
2583
|
if (itemLiElement) {
|
|
2584
2584
|
containerOptions["ulElement"].appendChild(itemLiElement);
|
|
2585
2585
|
}
|
|
2586
2586
|
if (typeof formConfig.afterAddToUListCallBack === "function") {
|
|
2587
|
-
formConfig.afterAddToUListCallBack(formConfig,
|
|
2587
|
+
formConfig.afterAddToUListCallBack(formConfig, {
|
|
2588
|
+
...containerOptions,
|
|
2589
|
+
target: itemLiElement,
|
|
2590
|
+
});
|
|
2588
2591
|
}
|
|
2589
2592
|
},
|
|
2590
2593
|
/**
|
|
@@ -4,9 +4,11 @@ import { PopsPanelFormsTotalDetails } from "./indexType";
|
|
|
4
4
|
* 右侧容器的配置
|
|
5
5
|
*/
|
|
6
6
|
export interface PopsPanelRightAsideContainerOptions {
|
|
7
|
-
/**
|
|
7
|
+
/** 当前的<li>元素 */
|
|
8
|
+
target: HTMLLIElement | undefined;
|
|
9
|
+
/** 当前的<li>元素的父<ul>元素 */
|
|
8
10
|
ulElement: HTMLUListElement;
|
|
9
|
-
/**
|
|
11
|
+
/** 当前的<li>元素所在的统一的<ul>元素 */
|
|
10
12
|
sectionContainerULElement?: HTMLUListElement;
|
|
11
13
|
/** */
|
|
12
14
|
formContainerListElement?: HTMLLIElement;
|
|
@@ -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;
|