@whitesev/pops 3.2.1 → 3.3.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.
- package/README.md +249 -249
- package/dist/index.amd.js +736 -948
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +736 -948
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +736 -948
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +736 -948
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +736 -948
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +736 -948
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/PopsCore.d.ts +15 -7
- package/dist/types/src/components/folder/types/index.d.ts +43 -13
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +94 -94
- package/dist/types/src/types/components.d.ts +211 -211
- package/dist/types/src/types/event.d.ts +43 -43
- package/dist/types/src/types/global.d.ts +31 -31
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +28 -28
- package/dist/types/src/types/main.d.ts +66 -66
- package/dist/types/src/types/mask.d.ts +52 -52
- package/dist/types/src/types/position.d.ts +60 -60
- package/package.json +28 -27
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +53 -37
- package/src/PopsIcon.ts +95 -95
- package/src/PopsInst.ts +21 -21
- package/src/components/alert/defaultConfig.ts +62 -62
- package/src/components/alert/index.ts +163 -163
- package/src/components/alert/types/index.ts +23 -23
- package/src/components/confirm/defaultConfig.ts +90 -90
- package/src/components/confirm/index.ts +165 -165
- package/src/components/confirm/types/index.ts +13 -17
- package/src/components/drawer/defaultConfig.ts +89 -89
- package/src/components/drawer/index.css +37 -37
- package/src/components/drawer/index.ts +245 -245
- package/src/components/drawer/types/index.ts +62 -61
- package/src/components/folder/defaultConfig.ts +151 -151
- package/src/components/folder/folderIcon.ts +28 -28
- package/src/components/folder/index.css +303 -303
- package/src/components/folder/index.ts +953 -932
- package/src/components/folder/types/index.ts +143 -110
- package/src/components/iframe/defaultConfig.ts +60 -60
- package/src/components/iframe/index.css +76 -76
- package/src/components/iframe/index.ts +331 -331
- package/src/components/iframe/types/index.ts +96 -96
- package/src/components/loading/defaultConfig.ts +29 -29
- package/src/components/loading/index.css +66 -66
- package/src/components/loading/index.ts +101 -101
- package/src/components/loading/types/index.ts +36 -34
- package/src/components/panel/css/components-select.css +84 -84
- package/src/components/panel/defaultConfig.ts +868 -868
- package/src/components/panel/handlerComponents.ts +3993 -3993
- package/src/components/panel/index.css +1403 -1403
- package/src/components/panel/index.ts +221 -221
- package/src/components/panel/types/components-button.ts +56 -56
- package/src/components/panel/types/components-common.ts +73 -73
- package/src/components/panel/types/components-container.ts +25 -25
- package/src/components/panel/types/components-deepMenu.ts +64 -64
- package/src/components/panel/types/components-input.ts +90 -90
- package/src/components/panel/types/components-own.ts +16 -16
- package/src/components/panel/types/components-select.ts +169 -169
- package/src/components/panel/types/components-selectMultiple.ts +105 -104
- package/src/components/panel/types/components-slider.ts +55 -55
- package/src/components/panel/types/components-switch.ts +33 -33
- package/src/components/panel/types/components-textarea.ts +45 -45
- package/src/components/panel/types/index.ts +244 -244
- package/src/components/prompt/defaultConfig.ts +94 -94
- package/src/components/prompt/index.css +34 -34
- package/src/components/prompt/index.ts +187 -215
- package/src/components/prompt/types/index.ts +57 -56
- package/src/components/rightClickMenu/defaultConfig.ts +103 -103
- package/src/components/rightClickMenu/index.css +115 -115
- package/src/components/rightClickMenu/index.ts +662 -662
- package/src/components/rightClickMenu/types/index.ts +145 -143
- package/src/components/searchSuggestion/defaultConfig.ts +63 -63
- package/src/components/searchSuggestion/index.ts +813 -813
- package/src/components/searchSuggestion/types/index.ts +244 -242
- package/src/components/tooltip/defaultConfig.ts +33 -33
- package/src/components/tooltip/index.css +199 -199
- package/src/components/tooltip/index.ts +617 -617
- package/src/components/tooltip/types/index.ts +123 -121
- package/src/config/CommonCSSClassName.ts +17 -17
- package/src/config/GlobalConfig.ts +63 -63
- package/src/css/animation.css +987 -987
- package/src/css/button.css +551 -551
- package/src/css/common.css +54 -54
- package/src/css/index.css +253 -253
- package/src/css/ninePalaceGridPosition.css +50 -50
- package/src/css/scrollbar.css +22 -22
- package/src/handler/PopsElementHandler.ts +303 -303
- package/src/handler/PopsHandler.ts +611 -611
- package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/src/types/animation.d.ts +19 -19
- package/src/types/button.d.ts +94 -94
- package/src/types/components.d.ts +211 -211
- package/src/types/event.d.ts +43 -43
- package/src/types/global.d.ts +31 -31
- package/src/types/icon.d.ts +32 -32
- package/src/types/inst.d.ts +28 -28
- package/src/types/main.d.ts +66 -66
- package/src/types/mask.d.ts +52 -52
- package/src/types/position.d.ts +60 -60
- package/src/utils/PopsDOMUtils.ts +2483 -2483
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
- package/src/utils/PopsInstanceUtils.ts +714 -714
- package/src/utils/PopsMathUtils.ts +71 -71
- package/src/utils/PopsSafeUtils.ts +22 -22
- package/src/utils/PopsUtils.ts +391 -421
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import type { PopsEventConfig, PopsHandlerEventConfig } from "./event";
|
|
2
|
-
import type { PopsIconType } from "./icon";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 按钮类型
|
|
6
|
-
*/
|
|
7
|
-
export type PopsButtonType = "close" | "ok" | "cancel" | "other";
|
|
8
|
-
/**
|
|
9
|
-
* 按钮样式类型
|
|
10
|
-
*/
|
|
11
|
-
export type PopsButtonStyleType =
|
|
12
|
-
| "default"
|
|
13
|
-
| "primary"
|
|
14
|
-
| "xiaomi-primary"
|
|
15
|
-
| "success"
|
|
16
|
-
| "info"
|
|
17
|
-
| "warning"
|
|
18
|
-
| "danger"
|
|
19
|
-
| "violet";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 按钮大小
|
|
23
|
-
*/
|
|
24
|
-
export type PopsButtonSize = "large" | "small";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 按钮配置
|
|
28
|
-
*/
|
|
29
|
-
export interface PopsGlobalButtonConfig<T = object> {
|
|
30
|
-
/**
|
|
31
|
-
* 是否启用按钮
|
|
32
|
-
*/
|
|
33
|
-
enable: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
|
|
36
|
-
*/
|
|
37
|
-
icon: PopsIconType;
|
|
38
|
-
/**
|
|
39
|
-
* 图标按钮是否放在右边
|
|
40
|
-
*/
|
|
41
|
-
rightIcon: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* 图标按钮是否是旋转360°
|
|
44
|
-
* @default false
|
|
45
|
-
*/
|
|
46
|
-
iconIsLoading: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* 按钮尺寸大小
|
|
49
|
-
* @default ""
|
|
50
|
-
*/
|
|
51
|
-
size: PopsButtonSize | "";
|
|
52
|
-
/**
|
|
53
|
-
* 按钮样式类型
|
|
54
|
-
* @default "default"
|
|
55
|
-
*/
|
|
56
|
-
type: PopsButtonStyleType;
|
|
57
|
-
/**
|
|
58
|
-
* 按钮文字,默认为空
|
|
59
|
-
*/
|
|
60
|
-
text: string;
|
|
61
|
-
/**
|
|
62
|
-
* 按钮点击的回调
|
|
63
|
-
*
|
|
64
|
-
* 如果传入该值,那么将不会自动关闭弹窗
|
|
65
|
-
*/
|
|
66
|
-
callback(eventConfig: PopsHandlerEventConfig & T, event: PointerEvent | MouseEvent): void;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* 按钮配置(匹配任意类型)
|
|
71
|
-
*/
|
|
72
|
-
export type PopsButtonConfigAnyType<T = object> = Omit<PopsGlobalButtonConfig<T>, "type"> & {
|
|
73
|
-
/**
|
|
74
|
-
* 按钮样式类型
|
|
75
|
-
* @default "default"
|
|
76
|
-
*/
|
|
77
|
-
type: string;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* 顶部关闭按钮配置
|
|
82
|
-
*/
|
|
83
|
-
export interface PopsHeaderCloseButtonConfig {
|
|
84
|
-
/**
|
|
85
|
-
* 是否启用按钮
|
|
86
|
-
*/
|
|
87
|
-
enable?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* 按钮点击的回调
|
|
90
|
-
*
|
|
91
|
-
* 如果传入该值,那么将不会自动关闭弹窗
|
|
92
|
-
*/
|
|
93
|
-
callback?: (eventConfig: PopsEventConfig, event: PointerEvent | MouseEvent) => void;
|
|
94
|
-
}
|
|
1
|
+
import type { PopsEventConfig, PopsHandlerEventConfig } from "./event";
|
|
2
|
+
import type { PopsIconType } from "./icon";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 按钮类型
|
|
6
|
+
*/
|
|
7
|
+
export type PopsButtonType = "close" | "ok" | "cancel" | "other";
|
|
8
|
+
/**
|
|
9
|
+
* 按钮样式类型
|
|
10
|
+
*/
|
|
11
|
+
export type PopsButtonStyleType =
|
|
12
|
+
| "default"
|
|
13
|
+
| "primary"
|
|
14
|
+
| "xiaomi-primary"
|
|
15
|
+
| "success"
|
|
16
|
+
| "info"
|
|
17
|
+
| "warning"
|
|
18
|
+
| "danger"
|
|
19
|
+
| "violet";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 按钮大小
|
|
23
|
+
*/
|
|
24
|
+
export type PopsButtonSize = "large" | "small";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 按钮配置
|
|
28
|
+
*/
|
|
29
|
+
export interface PopsGlobalButtonConfig<T = object> {
|
|
30
|
+
/**
|
|
31
|
+
* 是否启用按钮
|
|
32
|
+
*/
|
|
33
|
+
enable: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
|
|
36
|
+
*/
|
|
37
|
+
icon: PopsIconType;
|
|
38
|
+
/**
|
|
39
|
+
* 图标按钮是否放在右边
|
|
40
|
+
*/
|
|
41
|
+
rightIcon: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 图标按钮是否是旋转360°
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
iconIsLoading: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 按钮尺寸大小
|
|
49
|
+
* @default ""
|
|
50
|
+
*/
|
|
51
|
+
size: PopsButtonSize | "";
|
|
52
|
+
/**
|
|
53
|
+
* 按钮样式类型
|
|
54
|
+
* @default "default"
|
|
55
|
+
*/
|
|
56
|
+
type: PopsButtonStyleType;
|
|
57
|
+
/**
|
|
58
|
+
* 按钮文字,默认为空
|
|
59
|
+
*/
|
|
60
|
+
text: string;
|
|
61
|
+
/**
|
|
62
|
+
* 按钮点击的回调
|
|
63
|
+
*
|
|
64
|
+
* 如果传入该值,那么将不会自动关闭弹窗
|
|
65
|
+
*/
|
|
66
|
+
callback(eventConfig: PopsHandlerEventConfig & T, event: PointerEvent | MouseEvent): void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 按钮配置(匹配任意类型)
|
|
71
|
+
*/
|
|
72
|
+
export type PopsButtonConfigAnyType<T = object> = Omit<PopsGlobalButtonConfig<T>, "type"> & {
|
|
73
|
+
/**
|
|
74
|
+
* 按钮样式类型
|
|
75
|
+
* @default "default"
|
|
76
|
+
*/
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 顶部关闭按钮配置
|
|
82
|
+
*/
|
|
83
|
+
export interface PopsHeaderCloseButtonConfig {
|
|
84
|
+
/**
|
|
85
|
+
* 是否启用按钮
|
|
86
|
+
*/
|
|
87
|
+
enable?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 按钮点击的回调
|
|
90
|
+
*
|
|
91
|
+
* 如果传入该值,那么将不会自动关闭弹窗
|
|
92
|
+
*/
|
|
93
|
+
callback?: (eventConfig: PopsEventConfig, event: PointerEvent | MouseEvent) => void;
|
|
94
|
+
}
|
|
@@ -1,211 +1,211 @@
|
|
|
1
|
-
import type { PopsAnimation } from "./animation";
|
|
2
|
-
import type { PopsPosition, PopsTextAlign, PopsJustifyContent } from "./position";
|
|
3
|
-
import type { PopsGlobalButtonConfig, PopsButtonConfigAnyType, PopsHeaderCloseButtonConfig } from "./button";
|
|
4
|
-
import type { PopsMaskConfig } from "./mask";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 标题配置
|
|
8
|
-
*/
|
|
9
|
-
export interface PopsTitleConfig {
|
|
10
|
-
title: {
|
|
11
|
-
/**
|
|
12
|
-
* 标题文字
|
|
13
|
-
*/
|
|
14
|
-
text?: string;
|
|
15
|
-
/**
|
|
16
|
-
* 标题文字的位置
|
|
17
|
-
* @default "left"
|
|
18
|
-
*/
|
|
19
|
-
position?: PopsTextAlign;
|
|
20
|
-
/**
|
|
21
|
-
* 标题文字是否是html
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
html?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 自定义CSS
|
|
27
|
-
*/
|
|
28
|
-
style?: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 内容配置
|
|
34
|
-
*/
|
|
35
|
-
export interface PopsContentConfig {
|
|
36
|
-
content: {
|
|
37
|
-
/**
|
|
38
|
-
* 内容文字
|
|
39
|
-
*/
|
|
40
|
-
text?: string;
|
|
41
|
-
/**
|
|
42
|
-
* 内容文字是否是html
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
html?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* 自定义CSS
|
|
48
|
-
*/
|
|
49
|
-
style?: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* 按钮配置
|
|
54
|
-
*/
|
|
55
|
-
export interface PopsButtonConfig {
|
|
56
|
-
btn?: {
|
|
57
|
-
/**
|
|
58
|
-
* 按钮的位置
|
|
59
|
-
* @default "flex-end"
|
|
60
|
-
*/
|
|
61
|
-
position?: PopsJustifyContent;
|
|
62
|
-
/**
|
|
63
|
-
* 右上角的关闭按钮
|
|
64
|
-
*/
|
|
65
|
-
close?: PopsHeaderCloseButtonConfig;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* 按钮的其它配置
|
|
70
|
-
*/
|
|
71
|
-
export interface PopsMoreButtonConfig<T = object> {
|
|
72
|
-
btn?: PopsButtonConfig["btn"] & {
|
|
73
|
-
/**
|
|
74
|
-
* 是否合并按钮
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
merge?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* 是否对合并的按钮逆反
|
|
80
|
-
* @default false
|
|
81
|
-
*/
|
|
82
|
-
mergeReverse?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* 是否逆反
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
reverse?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* 确定按钮
|
|
90
|
-
*/
|
|
91
|
-
ok?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
92
|
-
/**
|
|
93
|
-
* 取消按钮
|
|
94
|
-
*/
|
|
95
|
-
cancel?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
96
|
-
/**
|
|
97
|
-
* 其他按钮
|
|
98
|
-
*/
|
|
99
|
-
other?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* 拖拽(标题栏)的配置
|
|
104
|
-
*/
|
|
105
|
-
export interface PopsDragConfig {
|
|
106
|
-
/**
|
|
107
|
-
* 是否可以按钮标题栏进行拖拽,默认false
|
|
108
|
-
* @default false
|
|
109
|
-
*/
|
|
110
|
-
drag?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* 是否限制拖拽在浏览器窗口内移动,默认true
|
|
113
|
-
* @default true
|
|
114
|
-
*/
|
|
115
|
-
dragLimit?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* 当启用dragLimit时,该参数为弹窗在窗口中的距离边际的距离,默认为3(px)
|
|
118
|
-
* @default 3
|
|
119
|
-
*/
|
|
120
|
-
dragExtraDistance?: number;
|
|
121
|
-
/**
|
|
122
|
-
* (可选)拖动中的回调
|
|
123
|
-
* @param moveElement 当前拖动的元素
|
|
124
|
-
* @param left 当前left值
|
|
125
|
-
* @param top 当前的top值
|
|
126
|
-
*/
|
|
127
|
-
dragMoveCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
128
|
-
/**
|
|
129
|
-
* (可选)拖动结束的回调
|
|
130
|
-
* @param moveElement 当前拖动的元素
|
|
131
|
-
* @param left 当前left值
|
|
132
|
-
* @param top 当前的top值
|
|
133
|
-
*/
|
|
134
|
-
dragEndCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* 通用配置
|
|
138
|
-
*/
|
|
139
|
-
export interface PopsGeneralConfig {
|
|
140
|
-
/**
|
|
141
|
-
* 是否使用shadowRoot
|
|
142
|
-
*
|
|
143
|
-
* @default true
|
|
144
|
-
*/
|
|
145
|
-
useShadowRoot?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* 自定义的className
|
|
148
|
-
*
|
|
149
|
-
* @default ""
|
|
150
|
-
*/
|
|
151
|
-
class?: string;
|
|
152
|
-
/**
|
|
153
|
-
* 是否是唯一的
|
|
154
|
-
*
|
|
155
|
-
* @default false
|
|
156
|
-
*/
|
|
157
|
-
only?: boolean;
|
|
158
|
-
/**
|
|
159
|
-
* 宽度
|
|
160
|
-
*
|
|
161
|
-
* @default "350px"
|
|
162
|
-
*/
|
|
163
|
-
width: string;
|
|
164
|
-
/**
|
|
165
|
-
* 高度
|
|
166
|
-
*
|
|
167
|
-
* @default "200px"
|
|
168
|
-
*/
|
|
169
|
-
height: string;
|
|
170
|
-
/**
|
|
171
|
-
* 位置
|
|
172
|
-
*
|
|
173
|
-
* @default "center"
|
|
174
|
-
*/
|
|
175
|
-
position?: PopsPosition;
|
|
176
|
-
/**
|
|
177
|
-
* 动画
|
|
178
|
-
*
|
|
179
|
-
* @default "pops-anim-fadein-zoom"
|
|
180
|
-
*/
|
|
181
|
-
animation?: PopsAnimation;
|
|
182
|
-
/**
|
|
183
|
-
* z-index显示层级
|
|
184
|
-
*
|
|
185
|
-
* @default 10000
|
|
186
|
-
*/
|
|
187
|
-
zIndex?: IFunction<number>;
|
|
188
|
-
/**
|
|
189
|
-
* 遮罩层
|
|
190
|
-
*/
|
|
191
|
-
mask?: PopsMaskConfig;
|
|
192
|
-
/**
|
|
193
|
-
* 是否禁用页面滚动
|
|
194
|
-
*
|
|
195
|
-
* 暂时不会生效
|
|
196
|
-
*
|
|
197
|
-
* @default false
|
|
198
|
-
*/
|
|
199
|
-
forbiddenScroll?: boolean;
|
|
200
|
-
/**
|
|
201
|
-
* (可选)自定义style
|
|
202
|
-
* @default ""
|
|
203
|
-
*/
|
|
204
|
-
style?: string | null;
|
|
205
|
-
/**
|
|
206
|
-
* 在元素添加到页面前的事件
|
|
207
|
-
* @param $shadowRoot 根元素
|
|
208
|
-
* @param $shadowContainer 容器
|
|
209
|
-
*/
|
|
210
|
-
beforeAppendToPageCallBack?: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
|
|
211
|
-
}
|
|
1
|
+
import type { PopsAnimation } from "./animation";
|
|
2
|
+
import type { PopsPosition, PopsTextAlign, PopsJustifyContent } from "./position";
|
|
3
|
+
import type { PopsGlobalButtonConfig, PopsButtonConfigAnyType, PopsHeaderCloseButtonConfig } from "./button";
|
|
4
|
+
import type { PopsMaskConfig } from "./mask";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 标题配置
|
|
8
|
+
*/
|
|
9
|
+
export interface PopsTitleConfig {
|
|
10
|
+
title: {
|
|
11
|
+
/**
|
|
12
|
+
* 标题文字
|
|
13
|
+
*/
|
|
14
|
+
text?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 标题文字的位置
|
|
17
|
+
* @default "left"
|
|
18
|
+
*/
|
|
19
|
+
position?: PopsTextAlign;
|
|
20
|
+
/**
|
|
21
|
+
* 标题文字是否是html
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
html?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 自定义CSS
|
|
27
|
+
*/
|
|
28
|
+
style?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 内容配置
|
|
34
|
+
*/
|
|
35
|
+
export interface PopsContentConfig {
|
|
36
|
+
content: {
|
|
37
|
+
/**
|
|
38
|
+
* 内容文字
|
|
39
|
+
*/
|
|
40
|
+
text?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 内容文字是否是html
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
html?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 自定义CSS
|
|
48
|
+
*/
|
|
49
|
+
style?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 按钮配置
|
|
54
|
+
*/
|
|
55
|
+
export interface PopsButtonConfig {
|
|
56
|
+
btn?: {
|
|
57
|
+
/**
|
|
58
|
+
* 按钮的位置
|
|
59
|
+
* @default "flex-end"
|
|
60
|
+
*/
|
|
61
|
+
position?: PopsJustifyContent;
|
|
62
|
+
/**
|
|
63
|
+
* 右上角的关闭按钮
|
|
64
|
+
*/
|
|
65
|
+
close?: PopsHeaderCloseButtonConfig;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 按钮的其它配置
|
|
70
|
+
*/
|
|
71
|
+
export interface PopsMoreButtonConfig<T = object> {
|
|
72
|
+
btn?: PopsButtonConfig["btn"] & {
|
|
73
|
+
/**
|
|
74
|
+
* 是否合并按钮
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
merge?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 是否对合并的按钮逆反
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
mergeReverse?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 是否逆反
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
reverse?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 确定按钮
|
|
90
|
+
*/
|
|
91
|
+
ok?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
92
|
+
/**
|
|
93
|
+
* 取消按钮
|
|
94
|
+
*/
|
|
95
|
+
cancel?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
96
|
+
/**
|
|
97
|
+
* 其他按钮
|
|
98
|
+
*/
|
|
99
|
+
other?: Partial<PopsGlobalButtonConfig<T> | PopsButtonConfigAnyType<T>>;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 拖拽(标题栏)的配置
|
|
104
|
+
*/
|
|
105
|
+
export interface PopsDragConfig {
|
|
106
|
+
/**
|
|
107
|
+
* 是否可以按钮标题栏进行拖拽,默认false
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
drag?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* 是否限制拖拽在浏览器窗口内移动,默认true
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
dragLimit?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* 当启用dragLimit时,该参数为弹窗在窗口中的距离边际的距离,默认为3(px)
|
|
118
|
+
* @default 3
|
|
119
|
+
*/
|
|
120
|
+
dragExtraDistance?: number;
|
|
121
|
+
/**
|
|
122
|
+
* (可选)拖动中的回调
|
|
123
|
+
* @param moveElement 当前拖动的元素
|
|
124
|
+
* @param left 当前left值
|
|
125
|
+
* @param top 当前的top值
|
|
126
|
+
*/
|
|
127
|
+
dragMoveCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
128
|
+
/**
|
|
129
|
+
* (可选)拖动结束的回调
|
|
130
|
+
* @param moveElement 当前拖动的元素
|
|
131
|
+
* @param left 当前left值
|
|
132
|
+
* @param top 当前的top值
|
|
133
|
+
*/
|
|
134
|
+
dragEndCallBack?: (moveElement: HTMLElement, left: number, top: number) => void;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* 通用配置
|
|
138
|
+
*/
|
|
139
|
+
export interface PopsGeneralConfig {
|
|
140
|
+
/**
|
|
141
|
+
* 是否使用shadowRoot
|
|
142
|
+
*
|
|
143
|
+
* @default true
|
|
144
|
+
*/
|
|
145
|
+
useShadowRoot?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 自定义的className
|
|
148
|
+
*
|
|
149
|
+
* @default ""
|
|
150
|
+
*/
|
|
151
|
+
class?: string;
|
|
152
|
+
/**
|
|
153
|
+
* 是否是唯一的
|
|
154
|
+
*
|
|
155
|
+
* @default false
|
|
156
|
+
*/
|
|
157
|
+
only?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* 宽度
|
|
160
|
+
*
|
|
161
|
+
* @default "350px"
|
|
162
|
+
*/
|
|
163
|
+
width: string;
|
|
164
|
+
/**
|
|
165
|
+
* 高度
|
|
166
|
+
*
|
|
167
|
+
* @default "200px"
|
|
168
|
+
*/
|
|
169
|
+
height: string;
|
|
170
|
+
/**
|
|
171
|
+
* 位置
|
|
172
|
+
*
|
|
173
|
+
* @default "center"
|
|
174
|
+
*/
|
|
175
|
+
position?: PopsPosition;
|
|
176
|
+
/**
|
|
177
|
+
* 动画
|
|
178
|
+
*
|
|
179
|
+
* @default "pops-anim-fadein-zoom"
|
|
180
|
+
*/
|
|
181
|
+
animation?: PopsAnimation;
|
|
182
|
+
/**
|
|
183
|
+
* z-index显示层级
|
|
184
|
+
*
|
|
185
|
+
* @default 10000
|
|
186
|
+
*/
|
|
187
|
+
zIndex?: IFunction<number>;
|
|
188
|
+
/**
|
|
189
|
+
* 遮罩层
|
|
190
|
+
*/
|
|
191
|
+
mask?: PopsMaskConfig;
|
|
192
|
+
/**
|
|
193
|
+
* 是否禁用页面滚动
|
|
194
|
+
*
|
|
195
|
+
* 暂时不会生效
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
forbiddenScroll?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* (可选)自定义style
|
|
202
|
+
* @default ""
|
|
203
|
+
*/
|
|
204
|
+
style?: string | null;
|
|
205
|
+
/**
|
|
206
|
+
* 在元素添加到页面前的事件
|
|
207
|
+
* @param $shadowRoot 根元素
|
|
208
|
+
* @param $shadowContainer 容器
|
|
209
|
+
*/
|
|
210
|
+
beforeAppendToPageCallBack?: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
|
|
211
|
+
}
|