@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.
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +50 -48
- package/src/Config.ts +3 -0
- package/src/Core.ts +45 -0
- package/src/Pops.ts +340 -0
- package/src/components/alert/index.css +45 -0
- package/src/components/alert/index.ts +216 -0
- package/src/components/alert/indexType.ts +30 -0
- package/src/components/confirm/index.css +45 -0
- package/src/components/confirm/index.ts +264 -0
- package/src/components/confirm/indexType.ts +17 -0
- package/src/components/drawer/index.css +47 -0
- package/src/components/drawer/index.ts +338 -0
- package/src/components/drawer/indexType.ts +53 -0
- package/src/components/folder/folderIcon.ts +28 -0
- package/src/components/folder/index.css +291 -0
- package/src/components/folder/index.ts +1111 -0
- package/src/components/folder/indexType.ts +87 -0
- package/src/components/iframe/index.css +90 -0
- package/src/components/iframe/index.ts +415 -0
- package/src/components/iframe/indexType.ts +144 -0
- package/src/components/loading/index.css +60 -0
- package/src/components/loading/index.ts +123 -0
- package/src/components/loading/indexType.ts +31 -0
- package/src/components/panel/buttonType.ts +60 -0
- package/src/components/panel/commonType.ts +50 -0
- package/src/components/panel/deepMenuType.ts +59 -0
- package/src/components/panel/formsType.ts +32 -0
- package/src/components/panel/index.css +754 -0
- package/src/components/panel/index.ts +2435 -0
- package/src/components/panel/indexType.ts +107 -0
- package/src/components/panel/inputType.ts +65 -0
- package/src/components/panel/ownType.ts +28 -0
- package/src/components/panel/selectType.ts +80 -0
- package/src/components/panel/sliderType.ts +59 -0
- package/src/components/panel/switchType.ts +43 -0
- package/src/components/panel/textareaType.ts +54 -0
- package/src/components/prompt/index.css +60 -0
- package/src/components/prompt/index.ts +293 -0
- package/src/components/prompt/indexType.ts +47 -0
- package/src/components/rightClickMenu/index.ts +729 -0
- package/src/components/rightClickMenu/indexType.ts +89 -0
- package/src/components/searchSuggestion/index.css +0 -0
- package/src/components/searchSuggestion/index.ts +656 -0
- package/src/components/searchSuggestion/indexType.ts +238 -0
- package/src/components/tooltip/index.css +171 -0
- package/src/components/tooltip/index.ts +358 -0
- package/src/components/tooltip/indexType.ts +95 -0
- package/src/css/animation.css +2240 -0
- package/src/css/button.css +290 -0
- package/src/css/common.css +24 -0
- package/src/css/index.css +135 -0
- package/src/css/ninePalaceGridPosition.css +50 -0
- package/src/css/scrollbar.css +18 -0
- package/src/handler/PopsElementHandler.ts +353 -0
- package/src/handler/PopsHandler.ts +659 -0
- package/src/svg/arrowLeft.svg +4 -0
- package/src/svg/arrowRight.svg +4 -0
- package/src/svg/chromeFilled.svg +14 -0
- package/src/svg/circleClose.svg +8 -0
- package/src/svg/close.svg +5 -0
- package/src/svg/cpu.svg +8 -0
- package/src/svg/delete.svg +5 -0
- package/src/svg/documentCopy.svg +5 -0
- package/src/svg/edit.svg +8 -0
- package/src/svg/eleme.svg +5 -0
- package/src/svg/elemePlus.svg +5 -0
- package/src/svg/headset.svg +5 -0
- package/src/svg/hide.svg +8 -0
- package/src/svg/keyboard.svg +8 -0
- package/src/svg/loading.svg +5 -0
- package/src/svg/max.svg +5 -0
- package/src/svg/min.svg +5 -0
- package/src/svg/mise.svg +5 -0
- package/src/svg/monitor.svg +5 -0
- package/src/svg/next.svg +5 -0
- package/src/svg/picture.svg +8 -0
- package/src/svg/prev.svg +5 -0
- package/src/svg/search.svg +5 -0
- package/src/svg/share.svg +5 -0
- package/src/svg/upload.svg +5 -0
- package/src/svg/videoPause.svg +5 -0
- package/src/svg/videoPlay.svg +5 -0
- package/src/svg/view.svg +5 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +246 -0
- package/src/types/animation.d.ts +19 -0
- package/src/types/button.d.ts +226 -0
- package/src/types/components.d.ts +197 -0
- package/src/types/event.d.ts +62 -0
- package/src/types/global.d.ts +11 -0
- package/src/types/icon.d.ts +32 -0
- package/src/types/layer.d.ts +20 -0
- package/src/types/main.d.ts +136 -0
- package/src/types/mask.d.ts +35 -0
- package/src/types/position.d.ts +60 -0
- package/src/utils/AnyTouch.js +1394 -0
- package/src/utils/PopsDOMUtils.ts +2013 -0
- package/src/utils/PopsInstanceUtils.ts +685 -0
- package/src/utils/PopsMathUtils.ts +77 -0
- package/src/utils/PopsUtils.ts +380 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { PopsAnimation } from "./animation";
|
|
2
|
+
import type {
|
|
3
|
+
PopsPosition,
|
|
4
|
+
PopsTextAlign,
|
|
5
|
+
PopsJustifyContent,
|
|
6
|
+
} from "./position";
|
|
7
|
+
import type {
|
|
8
|
+
PopsButtonDetails,
|
|
9
|
+
PopsButtonDetailsAnyType,
|
|
10
|
+
PopsHeaderCloseButtonDetails,
|
|
11
|
+
} from "./button";
|
|
12
|
+
import type { PopsMaskDetails } from "./mask";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 标题配置
|
|
16
|
+
*/
|
|
17
|
+
export interface PopsTitleConfig {
|
|
18
|
+
title: {
|
|
19
|
+
/**
|
|
20
|
+
* 标题文字
|
|
21
|
+
*/
|
|
22
|
+
text?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 文字的位置
|
|
25
|
+
*/
|
|
26
|
+
position?: PopsTextAlign;
|
|
27
|
+
/**
|
|
28
|
+
* 文字是否是html
|
|
29
|
+
*/
|
|
30
|
+
html?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 文字的自定义CSS
|
|
33
|
+
*/
|
|
34
|
+
style?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 内容配置
|
|
40
|
+
*/
|
|
41
|
+
export interface PopsContentConfig {
|
|
42
|
+
content: {
|
|
43
|
+
/**
|
|
44
|
+
* 内容文字
|
|
45
|
+
*/
|
|
46
|
+
text?: string;
|
|
47
|
+
/**
|
|
48
|
+
* 文字是否是html
|
|
49
|
+
*/
|
|
50
|
+
html?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 文字的自定义CSS
|
|
53
|
+
*/
|
|
54
|
+
style?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 按钮配置
|
|
59
|
+
*/
|
|
60
|
+
export interface PopsButtonConfig {
|
|
61
|
+
btn?: {
|
|
62
|
+
/**
|
|
63
|
+
* 按钮的位置,默认left
|
|
64
|
+
*/
|
|
65
|
+
position?: PopsJustifyContent;
|
|
66
|
+
/**
|
|
67
|
+
* 右上角的关闭按钮
|
|
68
|
+
*/
|
|
69
|
+
close?: PopsHeaderCloseButtonDetails;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 按钮的其它配置
|
|
74
|
+
*/
|
|
75
|
+
export interface PopsMoreButtonConfig<T = {}> {
|
|
76
|
+
btn?: PopsButtonConfig["btn"] & {
|
|
77
|
+
/**
|
|
78
|
+
* 是否合并按钮
|
|
79
|
+
*/
|
|
80
|
+
merge?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 是否对合并的按钮逆反
|
|
83
|
+
*/
|
|
84
|
+
mergeReverse?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 是否逆反
|
|
87
|
+
*/
|
|
88
|
+
reverse?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 确定按钮
|
|
91
|
+
*/
|
|
92
|
+
ok?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
93
|
+
/**
|
|
94
|
+
* 取消按钮
|
|
95
|
+
*/
|
|
96
|
+
cancel?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
97
|
+
/**
|
|
98
|
+
* 其他按钮
|
|
99
|
+
*/
|
|
100
|
+
other?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 拖拽(标题栏)的配置
|
|
105
|
+
*/
|
|
106
|
+
export interface PopsDragConfig {
|
|
107
|
+
/**
|
|
108
|
+
* 是否可以按钮标题栏进行拖拽,默认false
|
|
109
|
+
*/
|
|
110
|
+
drag?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* 是否限制拖拽在浏览器窗口内移动,默认true
|
|
113
|
+
*/
|
|
114
|
+
dragLimit?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 当启用dragLimit时,该参数为弹窗在窗口中的距离边际的距离,默认为3(px)
|
|
117
|
+
*/
|
|
118
|
+
dragExtraDistance?: number;
|
|
119
|
+
/**
|
|
120
|
+
* (可选)拖动中的回调
|
|
121
|
+
* @param moveElement 当前拖动的元素
|
|
122
|
+
* @param left 当前left值
|
|
123
|
+
* @param top 当前的top值
|
|
124
|
+
*/
|
|
125
|
+
dragMoveCallBack?: (
|
|
126
|
+
moveElement: HTMLElement,
|
|
127
|
+
left: number,
|
|
128
|
+
top: number
|
|
129
|
+
) => void;
|
|
130
|
+
/**
|
|
131
|
+
* (可选)拖动结束的回调
|
|
132
|
+
* @param moveElement 当前拖动的元素
|
|
133
|
+
* @param left 当前left值
|
|
134
|
+
* @param top 当前的top值
|
|
135
|
+
*/
|
|
136
|
+
dragEndCallBack?: (
|
|
137
|
+
moveElement: HTMLElement,
|
|
138
|
+
left: number,
|
|
139
|
+
top: number
|
|
140
|
+
) => void;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 通用配置
|
|
144
|
+
*/
|
|
145
|
+
export interface PopsCommonConfig {
|
|
146
|
+
/**
|
|
147
|
+
* 自定义的className,默认为空
|
|
148
|
+
*/
|
|
149
|
+
class?: string;
|
|
150
|
+
/**
|
|
151
|
+
* 是否是唯一的,默认false
|
|
152
|
+
*/
|
|
153
|
+
only?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* 宽度,默认350px
|
|
156
|
+
*/
|
|
157
|
+
width: string;
|
|
158
|
+
/**
|
|
159
|
+
* 高度,默认200px
|
|
160
|
+
*/
|
|
161
|
+
height: string;
|
|
162
|
+
/**
|
|
163
|
+
* 位置,默认center
|
|
164
|
+
*/
|
|
165
|
+
position?: PopsPosition;
|
|
166
|
+
/**
|
|
167
|
+
* 动画,默认pops-anim-fadein-zoom
|
|
168
|
+
*/
|
|
169
|
+
animation?: PopsAnimation;
|
|
170
|
+
/**
|
|
171
|
+
* z-index显示层级,默认10000
|
|
172
|
+
*/
|
|
173
|
+
zIndex?: number;
|
|
174
|
+
/**
|
|
175
|
+
* 遮罩层
|
|
176
|
+
*/
|
|
177
|
+
mask?: PopsMaskDetails;
|
|
178
|
+
/**
|
|
179
|
+
* 是否禁用页面滚动,默认false
|
|
180
|
+
*
|
|
181
|
+
* 暂时不会生效
|
|
182
|
+
*/
|
|
183
|
+
forbiddenScroll?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* (可选)自定义style
|
|
186
|
+
*/
|
|
187
|
+
style?: string | null;
|
|
188
|
+
/**
|
|
189
|
+
* 在元素添加到页面前的事件
|
|
190
|
+
* @param $shadowRoot 根元素
|
|
191
|
+
* @param $shadowContainer 容器
|
|
192
|
+
*/
|
|
193
|
+
beforeAppendToPageCallBack?: (
|
|
194
|
+
$shadowRoot: ShadowRoot,
|
|
195
|
+
$shadowContainer: HTMLDivElement
|
|
196
|
+
) => void;
|
|
197
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { PopsIframeDetails } from "../components/iframe/indexType";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 事件配置
|
|
5
|
+
*/
|
|
6
|
+
export interface PopsIframeEventDetails {
|
|
7
|
+
/**
|
|
8
|
+
* 唯一id
|
|
9
|
+
*/
|
|
10
|
+
guid: string;
|
|
11
|
+
/**
|
|
12
|
+
* 当前弹窗类型
|
|
13
|
+
*/
|
|
14
|
+
mode: PopsMode;
|
|
15
|
+
/**
|
|
16
|
+
* 动画层
|
|
17
|
+
*/
|
|
18
|
+
animElement: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* 主元素
|
|
21
|
+
*/
|
|
22
|
+
popsElement: HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
* 遮罩层
|
|
25
|
+
*/
|
|
26
|
+
maskElement: HTMLElement;
|
|
27
|
+
/**
|
|
28
|
+
* 当前配置
|
|
29
|
+
*/
|
|
30
|
+
config: PopsIframeDetails;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 事件配置
|
|
34
|
+
*/
|
|
35
|
+
export interface PopsEventDetails {
|
|
36
|
+
/** 最外层包裹的元素 */
|
|
37
|
+
$shadowContainer: HTMLDivElement;
|
|
38
|
+
/** ShadowRoot */
|
|
39
|
+
$shadowRoot: ShadowRoot;
|
|
40
|
+
/** -> 动画层 */
|
|
41
|
+
element: HTMLDivElement;
|
|
42
|
+
/** 动画层 */
|
|
43
|
+
animElement: HTMLDivElement;
|
|
44
|
+
/** 主元素 */
|
|
45
|
+
popsElement: HTMLDivElement;
|
|
46
|
+
/** 遮罩层 */
|
|
47
|
+
maskElement?: HTMLDivElement;
|
|
48
|
+
/** 当前弹窗类型 */
|
|
49
|
+
mode: mode;
|
|
50
|
+
guid: guid;
|
|
51
|
+
close: () => void;
|
|
52
|
+
hide: () => void;
|
|
53
|
+
show: () => void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 处理过的事件配置
|
|
58
|
+
*/
|
|
59
|
+
export interface PopsHandlerEventDetails extends PopsEventDetails {
|
|
60
|
+
/** 当前按钮类型 */
|
|
61
|
+
type: "cancel" | "close" | "ok" | "other";
|
|
62
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按钮svg图标
|
|
3
|
+
*/
|
|
4
|
+
export type PopsIcon =
|
|
5
|
+
| "min"
|
|
6
|
+
| "mise"
|
|
7
|
+
| "max"
|
|
8
|
+
| "close"
|
|
9
|
+
| "edit"
|
|
10
|
+
| "share"
|
|
11
|
+
| "delete"
|
|
12
|
+
| "search"
|
|
13
|
+
| "upload"
|
|
14
|
+
| "loading"
|
|
15
|
+
| "next"
|
|
16
|
+
| "prev"
|
|
17
|
+
| "eleme"
|
|
18
|
+
| "elemePlus"
|
|
19
|
+
| "chromeFilled"
|
|
20
|
+
| "cpu"
|
|
21
|
+
| "videoPlay"
|
|
22
|
+
| "videoPause"
|
|
23
|
+
| "headset"
|
|
24
|
+
| "monitor"
|
|
25
|
+
| "documentCopy"
|
|
26
|
+
| "picture"
|
|
27
|
+
| "circleClose"
|
|
28
|
+
| "view"
|
|
29
|
+
| "hide"
|
|
30
|
+
| "keyboard"
|
|
31
|
+
| "arrowRight"
|
|
32
|
+
| "arrowLeft";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config内存储饿实例配置
|
|
3
|
+
*/
|
|
4
|
+
export interface PopsLayerConfig {
|
|
5
|
+
/** 固定id */
|
|
6
|
+
guid: string;
|
|
7
|
+
/** 动画元素 */
|
|
8
|
+
animElement: HTMLDivElement;
|
|
9
|
+
/** 主元素 */
|
|
10
|
+
popsElement: HTMLDivElement;
|
|
11
|
+
/** 遮罩层元素 */
|
|
12
|
+
maskElement?: HTMLDivElement;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PopsLayerCommonConfig extends PopsLayerConfig {
|
|
16
|
+
/** shadow容器 */
|
|
17
|
+
$shadowContainer: HTMLDivElement;
|
|
18
|
+
/** shadow容器的shandowRoot */
|
|
19
|
+
$shadowRoot: ShadowRoot;
|
|
20
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/indexType";
|
|
2
|
+
import type { PopsConfirmDetails } from "../components/confirm/indexType";
|
|
3
|
+
import type { PopsDrawerDetails } from "../components/drawer/indexType";
|
|
4
|
+
import type { PopsFolderDetails } from "../components/folder/indexType";
|
|
5
|
+
import type { PopsIframeDetails } from "../components/iframe/indexType";
|
|
6
|
+
import type { PopsLoadingDetails } from "../components/loading/indexType";
|
|
7
|
+
import type { PopsPanelDetails } from "../components/panel/indexType";
|
|
8
|
+
import type { PopsPromptDetails } from "../components/prompt/indexType";
|
|
9
|
+
import { PopsRightClickMenuDetails } from "../components/rightClickMenu/indexType";
|
|
10
|
+
import { PopsToolTipDetails } from "../components/tooltip/indexType";
|
|
11
|
+
|
|
12
|
+
export interface PopsUtilsOwnObject<V extends any> {
|
|
13
|
+
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** pops的所有类型配置 10个 */
|
|
17
|
+
export interface PopsAllDetails {
|
|
18
|
+
alert: PopsAlertDetails;
|
|
19
|
+
confirm: PopsConfirmDetails;
|
|
20
|
+
prompt: PopsPromptDetails;
|
|
21
|
+
loading: PopsLoadingDetails;
|
|
22
|
+
iframe: PopsIframeDetails;
|
|
23
|
+
tooltip: PopsToolTipDetails;
|
|
24
|
+
drawer: PopsDrawerDetails;
|
|
25
|
+
folder: PopsFolderDetails;
|
|
26
|
+
panel: PopsPanelDetails;
|
|
27
|
+
rightClickMenu: PopsRightClickMenuDetails;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** pops的类型配置 8个 */
|
|
31
|
+
export interface PopsTypeDetails {
|
|
32
|
+
alert: PopsAlertDetails;
|
|
33
|
+
confirm: PopsConfirmDetails;
|
|
34
|
+
prompt: PopsPromptDetails;
|
|
35
|
+
loading: PopsLoadingDetails;
|
|
36
|
+
iframe: PopsIframeDetails;
|
|
37
|
+
// tooltip: PopsToolTipDetails;
|
|
38
|
+
drawer: PopsDrawerDetails;
|
|
39
|
+
folder: PopsFolderDetails;
|
|
40
|
+
panel: PopsPanelDetails;
|
|
41
|
+
// rightClickMenu: PopsRightClickMenuDetails;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** pops的类型 8个 */
|
|
45
|
+
export type PopsType = keyof PopsTypeDetails;
|
|
46
|
+
|
|
47
|
+
/** pops所有的类型 10个 */
|
|
48
|
+
export type PopsMode = PopsType | "tooltip" | "rightClickMenu";
|
|
49
|
+
|
|
50
|
+
/** 存储实例的类型 9个 */
|
|
51
|
+
export type PopsLayerMode = PopsType | "tooltip";
|
|
52
|
+
|
|
53
|
+
/** pops弹窗支持动画元素的配置 */
|
|
54
|
+
export interface PopsSupportAnim {
|
|
55
|
+
alert: PopsAlertDetails;
|
|
56
|
+
confirm: PopsConfirmDetails;
|
|
57
|
+
prompt: PopsPromptDetails;
|
|
58
|
+
loading: PopsLoadingDetails;
|
|
59
|
+
iframe: PopsIframeDetails;
|
|
60
|
+
drawer: PopsDrawerDetails;
|
|
61
|
+
folder: PopsFolderDetails;
|
|
62
|
+
panel: PopsPanelDetails;
|
|
63
|
+
}
|
|
64
|
+
/** pops弹窗支持动画元素的类型 */
|
|
65
|
+
export type PopsTypeSupportAnim = keyof PopsSupportAnim;
|
|
66
|
+
|
|
67
|
+
/** pops弹窗支持标题栏的配置 */
|
|
68
|
+
export interface PopsSupportHeaderTitle {
|
|
69
|
+
alert: PopsAlertDetails;
|
|
70
|
+
confirm: PopsConfirmDetails;
|
|
71
|
+
prompt: PopsPromptDetails;
|
|
72
|
+
iframe: PopsIframeDetails;
|
|
73
|
+
drawer: PopsDrawerDetails;
|
|
74
|
+
folder: PopsFolderDetails;
|
|
75
|
+
panel: PopsPanelDetails;
|
|
76
|
+
}
|
|
77
|
+
/** pops弹窗支持标题栏的类型 */
|
|
78
|
+
export type PopsTypeSupportHeaderTitle = keyof PopsSupportHeaderTitle;
|
|
79
|
+
|
|
80
|
+
/** pops支持底部按钮的配置 */
|
|
81
|
+
export interface PopsSupportBottomBtn {
|
|
82
|
+
alert: PopsAlertDetails;
|
|
83
|
+
confirm: PopsConfirmDetails;
|
|
84
|
+
prompt: PopsPromptDetails;
|
|
85
|
+
drawer: PopsDrawerDetails;
|
|
86
|
+
}
|
|
87
|
+
/** pops支持底部按钮的类型 */
|
|
88
|
+
export type PopsTypeSupportBottomBtn = keyof PopsSupportHeaderTitle;
|
|
89
|
+
|
|
90
|
+
/** pops支持中间内容的配置 */
|
|
91
|
+
export interface PopsSupportContent {
|
|
92
|
+
alert: PopsAlertDetails;
|
|
93
|
+
confirm: PopsConfirmDetails;
|
|
94
|
+
prompt: PopsPromptDetails;
|
|
95
|
+
drawer: PopsDrawerDetails;
|
|
96
|
+
loading: PopsLoadingDetails;
|
|
97
|
+
}
|
|
98
|
+
/** pops支持中间内容的类型 */
|
|
99
|
+
export type PopsTypeSupportContent = keyof PopsSupportContent;
|
|
100
|
+
|
|
101
|
+
/** panel的各种类型的配置项 */
|
|
102
|
+
export type PopsPanelFormsTotalDetails =
|
|
103
|
+
| PopsPanelSwitchDetails
|
|
104
|
+
| PopsPanelSliderDetails
|
|
105
|
+
| PopsPanelInputDetails
|
|
106
|
+
| PopsPanelTextAreaDetails
|
|
107
|
+
| PopsPanelSelectDetails<any>
|
|
108
|
+
| PopsPanelButtonDetails
|
|
109
|
+
| PopsPanelDeepMenuDetails
|
|
110
|
+
| PopsPanelOwnDetails;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* pops.xxx的调用返回值
|
|
114
|
+
*/
|
|
115
|
+
export interface PopsCallResult {
|
|
116
|
+
/** 唯一标识id */
|
|
117
|
+
guid: string;
|
|
118
|
+
/** 影子元素 */
|
|
119
|
+
$shadowContainer: HTMLDivElement;
|
|
120
|
+
/** 影子元素的根节点 */
|
|
121
|
+
$shadowRoot: ShadowRoot;
|
|
122
|
+
/** 元素 */
|
|
123
|
+
element: HTMLDivElement;
|
|
124
|
+
/** 动画层元素 */
|
|
125
|
+
animElement: HTMLDivElement;
|
|
126
|
+
/** pops元素 */
|
|
127
|
+
popsElement: HTMLDivElement;
|
|
128
|
+
/** 遮罩层元素 */
|
|
129
|
+
maskElement?: HTMLDivElement;
|
|
130
|
+
/** 关闭弹窗 */
|
|
131
|
+
close(): void;
|
|
132
|
+
/** 隐藏弹窗 */
|
|
133
|
+
hide(): void;
|
|
134
|
+
/** 显示弹窗 */
|
|
135
|
+
show(): void;
|
|
136
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 遮罩层配置
|
|
3
|
+
*/
|
|
4
|
+
export interface PopsMaskDetails {
|
|
5
|
+
/**
|
|
6
|
+
* 是否启用遮罩层,默认false
|
|
7
|
+
*/
|
|
8
|
+
enable?: boolean;
|
|
9
|
+
clickEvent?: {
|
|
10
|
+
/**
|
|
11
|
+
* 点击遮罩层是否触发关闭事件
|
|
12
|
+
*/
|
|
13
|
+
toClose?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 点击遮罩层是否触发隐藏事件
|
|
16
|
+
*/
|
|
17
|
+
toHide?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 遮罩层自定义的点击事件
|
|
21
|
+
* @param originalRun 当toClose为true,它是关闭弹窗,当toHide为true,它是隐藏弹窗
|
|
22
|
+
* @param config 配置信息
|
|
23
|
+
*/
|
|
24
|
+
clickCallBack?: (
|
|
25
|
+
originalRun: (originalRun: Function) => void,
|
|
26
|
+
config:
|
|
27
|
+
| PopsAlertDetails
|
|
28
|
+
| PopsDrawerDetails
|
|
29
|
+
| PopsIframeDetails
|
|
30
|
+
| PopsPromptDetails
|
|
31
|
+
| PopsFolderDetails
|
|
32
|
+
| PopsLoadingDetails
|
|
33
|
+
| PopsPanelDetails
|
|
34
|
+
) => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 弹窗位置
|
|
3
|
+
*/
|
|
4
|
+
export type PopsPosition =
|
|
5
|
+
| "top_left"
|
|
6
|
+
| "top"
|
|
7
|
+
| "top_right"
|
|
8
|
+
| "center_left"
|
|
9
|
+
| "center"
|
|
10
|
+
| "center_right"
|
|
11
|
+
| "bottom_left"
|
|
12
|
+
| "bottom"
|
|
13
|
+
| "bottom_right";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 按钮位置
|
|
17
|
+
*/
|
|
18
|
+
export type PopsJustifyContent =
|
|
19
|
+
| "center"
|
|
20
|
+
| "end"
|
|
21
|
+
| "flex-end"
|
|
22
|
+
| "flex-start"
|
|
23
|
+
| "left"
|
|
24
|
+
| "normal"
|
|
25
|
+
| "right"
|
|
26
|
+
| "space-around"
|
|
27
|
+
| "space-between"
|
|
28
|
+
| "space-evenly"
|
|
29
|
+
| "start"
|
|
30
|
+
| "stretch"
|
|
31
|
+
| "inherit"
|
|
32
|
+
| "initial"
|
|
33
|
+
| "revert"
|
|
34
|
+
| "revert-layer"
|
|
35
|
+
| "unset";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* text-align
|
|
39
|
+
*/
|
|
40
|
+
export type PopsTextAlign =
|
|
41
|
+
| "center"
|
|
42
|
+
| "end"
|
|
43
|
+
| "justify"
|
|
44
|
+
| "left"
|
|
45
|
+
| "right"
|
|
46
|
+
| "start"
|
|
47
|
+
| "-webkit-auto"
|
|
48
|
+
| "-moz-center-or-inherit"
|
|
49
|
+
| "-webkit-center"
|
|
50
|
+
| "-moz-center"
|
|
51
|
+
| "-webkit-left"
|
|
52
|
+
| "-moz-left"
|
|
53
|
+
| "-webkit-match-parent"
|
|
54
|
+
| "-webkit-right"
|
|
55
|
+
| "-moz-right"
|
|
56
|
+
| "inherit"
|
|
57
|
+
| "initial"
|
|
58
|
+
| "revert"
|
|
59
|
+
| "revert-layer"
|
|
60
|
+
| "unset";
|