@whitesev/pops 2.4.6 → 2.4.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 +578 -571
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +578 -571
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +578 -571
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +578 -571
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +578 -571
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +578 -571
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -252
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +187 -187
- package/dist/types/src/types/components.d.ts +210 -210
- package/dist/types/src/types/event.d.ts +63 -63
- package/dist/types/src/types/global.d.ts +25 -25
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +24 -24
- package/dist/types/src/types/main.d.ts +111 -111
- package/dist/types/src/types/mask.d.ts +49 -49
- package/dist/types/src/types/position.d.ts +60 -60
- package/index.ts +3 -0
- package/package.json +4 -2
- package/src/Pops.ts +206 -0
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsCore.ts +64 -0
- package/src/PopsIcon.ts +95 -0
- package/src/PopsInst.ts +21 -0
- package/src/components/alert/config.ts +62 -0
- package/src/components/alert/index.css +0 -0
- package/src/components/alert/index.ts +163 -0
- package/src/components/alert/types/index.ts +23 -0
- package/src/components/confirm/config.ts +90 -0
- package/src/components/confirm/index.css +0 -0
- package/src/components/confirm/index.ts +166 -0
- package/src/components/confirm/types/index.ts +17 -0
- package/src/components/drawer/config.ts +89 -0
- package/src/components/drawer/index.css +37 -0
- package/src/components/drawer/index.ts +237 -0
- package/src/components/drawer/types/index.ts +61 -0
- package/src/components/folder/config.ts +147 -0
- package/src/components/folder/folderIcon.ts +28 -0
- package/src/components/folder/index.css +303 -0
- package/src/components/folder/index.ts +929 -0
- package/src/components/folder/types/index.ts +97 -0
- package/src/components/iframe/config.ts +60 -0
- package/src/components/iframe/index.css +76 -0
- package/src/components/iframe/index.ts +334 -0
- package/src/components/iframe/types/index.ts +139 -0
- package/src/components/loading/config.ts +29 -0
- package/src/components/loading/index.css +66 -0
- package/src/components/loading/index.ts +99 -0
- package/src/components/loading/types/index.ts +34 -0
- package/src/components/panel/config.ts +519 -0
- package/src/components/panel/handlerComponents.ts +2900 -0
- package/src/components/panel/index.css +1222 -0
- package/src/components/panel/index.ts +207 -0
- package/src/components/panel/types/components-button.ts +68 -0
- package/src/components/panel/types/components-common.ts +50 -0
- package/src/components/panel/types/components-deepMenu.ts +84 -0
- package/src/components/panel/types/components-forms.ts +44 -0
- package/src/components/panel/types/components-input.ts +78 -0
- package/src/components/panel/types/components-own.ts +30 -0
- package/src/components/panel/types/components-select.ts +93 -0
- package/src/components/panel/types/components-selectMultiple.ts +130 -0
- package/src/components/panel/types/components-slider.ts +77 -0
- package/src/components/panel/types/components-switch.ts +56 -0
- package/src/components/panel/types/components-textarea.ts +68 -0
- package/src/components/panel/types/index.ts +177 -0
- package/src/components/prompt/config.ts +94 -0
- package/src/components/prompt/index.css +34 -0
- package/src/components/prompt/index.ts +216 -0
- package/src/components/prompt/types/index.ts +55 -0
- package/src/components/rightClickMenu/config.ts +98 -0
- package/src/components/rightClickMenu/index.css +112 -0
- package/src/components/rightClickMenu/index.ts +602 -0
- package/src/components/rightClickMenu/types/index.ts +97 -0
- package/src/components/searchSuggestion/config.ts +56 -0
- package/src/components/searchSuggestion/index.ts +856 -0
- package/src/components/searchSuggestion/types/index.ts +239 -0
- package/src/components/tooltip/config.ts +34 -0
- package/src/components/tooltip/index.css +199 -0
- package/src/components/tooltip/index.ts +604 -0
- package/src/components/tooltip/types/index.ts +117 -0
- package/src/config/CommonCSSClassName.ts +17 -0
- package/src/config/GlobalConfig.ts +63 -0
- package/src/css/animation.css +987 -0
- package/src/css/button.css +551 -0
- package/src/css/common.css +48 -0
- package/src/css/index.css +253 -0
- package/src/css/ninePalaceGridPosition.css +50 -0
- package/src/css/scrollbar.css +22 -0
- package/src/handler/PopsElementHandler.ts +304 -0
- package/src/handler/PopsHandler.ts +589 -0
- package/src/svg/arrowLeft.svg +4 -0
- package/src/svg/arrowRight.svg +4 -0
- package/src/svg/chromeFilled.svg +11 -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 +252 -0
- package/src/types/animation.d.ts +19 -0
- package/src/types/button.d.ts +187 -0
- package/src/types/components.d.ts +210 -0
- package/src/types/event.d.ts +63 -0
- package/src/types/global.d.ts +25 -0
- package/src/types/icon.d.ts +32 -0
- package/src/types/inst.d.ts +24 -0
- package/src/types/main.d.ts +111 -0
- package/src/types/mask.d.ts +49 -0
- package/src/types/position.d.ts +60 -0
- package/src/utils/PopsDOMUtils.ts +2408 -0
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
- package/src/utils/PopsInstanceUtils.ts +688 -0
- package/src/utils/PopsMathUtils.ts +71 -0
- package/src/utils/PopsSafeUtils.ts +22 -0
- package/src/utils/PopsUtils.ts +406 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { PopsAnimation } from "./animation";
|
|
2
|
+
import type { PopsPosition, PopsTextAlign, PopsJustifyContent } from "./position";
|
|
3
|
+
import type { PopsButtonDetails, PopsButtonDetailsAnyType, PopsHeaderCloseButtonDetails } from "./button";
|
|
4
|
+
import type { PopsMaskDetails } 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?: PopsHeaderCloseButtonDetails;
|
|
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<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
92
|
+
/**
|
|
93
|
+
* 取消按钮
|
|
94
|
+
*/
|
|
95
|
+
cancel?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
96
|
+
/**
|
|
97
|
+
* 其他按钮
|
|
98
|
+
*/
|
|
99
|
+
other?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<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 PopsCommonConfig {
|
|
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?: number | (() => number);
|
|
188
|
+
/**
|
|
189
|
+
* 遮罩层
|
|
190
|
+
*/
|
|
191
|
+
mask?: PopsMaskDetails;
|
|
192
|
+
/**
|
|
193
|
+
* 是否禁用页面滚动
|
|
194
|
+
*
|
|
195
|
+
* 暂时不会生效
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
forbiddenScroll?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* (可选)自定义style
|
|
202
|
+
*/
|
|
203
|
+
style?: string | null;
|
|
204
|
+
/**
|
|
205
|
+
* 在元素添加到页面前的事件
|
|
206
|
+
* @param $shadowRoot 根元素
|
|
207
|
+
* @param $shadowContainer 容器
|
|
208
|
+
*/
|
|
209
|
+
beforeAppendToPageCallBack?: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void;
|
|
210
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
2
|
+
import type { PopsType } from "./main";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 事件配置
|
|
6
|
+
*/
|
|
7
|
+
export interface PopsIframeEventDetails {
|
|
8
|
+
/**
|
|
9
|
+
* 唯一id
|
|
10
|
+
*/
|
|
11
|
+
guid: string;
|
|
12
|
+
/**
|
|
13
|
+
* 当前弹窗类型
|
|
14
|
+
*/
|
|
15
|
+
mode: PopsType;
|
|
16
|
+
/**
|
|
17
|
+
* 动画层
|
|
18
|
+
*/
|
|
19
|
+
animElement: HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* 主元素
|
|
22
|
+
*/
|
|
23
|
+
popsElement: HTMLElement;
|
|
24
|
+
/**
|
|
25
|
+
* 遮罩层
|
|
26
|
+
*/
|
|
27
|
+
maskElement: HTMLElement;
|
|
28
|
+
/**
|
|
29
|
+
* 当前配置
|
|
30
|
+
*/
|
|
31
|
+
config: PopsIframeDetails;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 事件配置
|
|
35
|
+
*/
|
|
36
|
+
export interface PopsEventDetails {
|
|
37
|
+
/** 最外层包裹的元素 */
|
|
38
|
+
$shadowContainer: HTMLDivElement;
|
|
39
|
+
/** ShadowRoot */
|
|
40
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
41
|
+
/** -> 动画层 */
|
|
42
|
+
element: HTMLDivElement;
|
|
43
|
+
/** 动画层 */
|
|
44
|
+
animElement: HTMLDivElement;
|
|
45
|
+
/** 主元素 */
|
|
46
|
+
popsElement: HTMLDivElement;
|
|
47
|
+
/** 遮罩层 */
|
|
48
|
+
maskElement?: HTMLDivElement;
|
|
49
|
+
/** 当前弹窗类型 */
|
|
50
|
+
mode: PopsType;
|
|
51
|
+
guid: string;
|
|
52
|
+
close: () => Promise<void>;
|
|
53
|
+
hide: () => Promise<void>;
|
|
54
|
+
show: () => Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 处理过的事件配置
|
|
59
|
+
*/
|
|
60
|
+
export interface PopsHandlerEventDetails extends PopsEventDetails {
|
|
61
|
+
/** 当前按钮类型 */
|
|
62
|
+
type: "cancel" | "close" | "ok" | "other";
|
|
63
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare module "*.css" {
|
|
2
|
+
const content: string;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
declare module "*.svg" {
|
|
6
|
+
const content: string;
|
|
7
|
+
export default content;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare let unsafeWindow: Window & typeof globalThis;
|
|
11
|
+
|
|
12
|
+
declare interface Window {
|
|
13
|
+
trustedTypes: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
17
|
+
declare type DeepRequired<T> = T extends Function
|
|
18
|
+
? T
|
|
19
|
+
: T extends object
|
|
20
|
+
? T extends Node
|
|
21
|
+
? T
|
|
22
|
+
: {
|
|
23
|
+
[K in keyof T]-?: DeepRequired<T[K]>;
|
|
24
|
+
}
|
|
25
|
+
: T;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按钮svg图标
|
|
3
|
+
*/
|
|
4
|
+
export type PopsIconType =
|
|
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,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config实例配置
|
|
3
|
+
*/
|
|
4
|
+
export interface PopsInstConfig {
|
|
5
|
+
/** 固定id */
|
|
6
|
+
guid: string;
|
|
7
|
+
/** 动画元素 */
|
|
8
|
+
animElement: HTMLDivElement;
|
|
9
|
+
/** 主元素 */
|
|
10
|
+
popsElement: HTMLDivElement;
|
|
11
|
+
/** 遮罩层元素 */
|
|
12
|
+
maskElement?: HTMLDivElement;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* config实例通用配置
|
|
16
|
+
*/
|
|
17
|
+
export interface PopsInstCommonConfig extends PopsInstConfig {
|
|
18
|
+
/** shadow容器 */
|
|
19
|
+
$shadowContainer: HTMLDivElement;
|
|
20
|
+
/** shadow容器的shandowRoot */
|
|
21
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
22
|
+
/** 移除实例前的回调函数 */
|
|
23
|
+
beforeRemoveCallBack?: (instCommonConfig: PopsInstCommonConfig) => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsConfirmDetails } from "../components/confirm/types";
|
|
3
|
+
import type { PopsDrawerDetails } from "../components/drawer/types";
|
|
4
|
+
import type { PopsFolderDetails } from "../components/folder/types";
|
|
5
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
6
|
+
import type { PopsLoadingDetails } from "../components/loading/types";
|
|
7
|
+
import type { PopsPanelButtonDetails } from "../components/panel/types/components-button";
|
|
8
|
+
import type { PopsPanelDeepMenuDetails } from "../components/panel/types/components-deepMenu";
|
|
9
|
+
import type { PopsPanelDetails } from "../components/panel/types";
|
|
10
|
+
import type { PopsPanelInputDetails } from "../components/panel/types/components-input";
|
|
11
|
+
import type { PopsPanelOwnDetails } from "../components/panel/types/components-own";
|
|
12
|
+
import type { PopsPanelSelectDetails } from "../components/panel/types/components-select";
|
|
13
|
+
import type { PopsPanelSliderDetails } from "../components/panel/types/components-slider";
|
|
14
|
+
import type { PopsPanelSwitchDetails } from "../components/panel/types/components-switch";
|
|
15
|
+
import type { PopsPanelTextAreaDetails } from "../components/panel/types/components-textarea";
|
|
16
|
+
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
17
|
+
import type { PopsRightClickMenuDetails } from "../components/rightClickMenu/types";
|
|
18
|
+
import type { PopsToolTipDetails } from "../components/tooltip/types/index";
|
|
19
|
+
import type { PopsSearchSuggestionDetails } from "../components/searchSuggestion/types";
|
|
20
|
+
|
|
21
|
+
export interface PopsUtilsOwnObject<V> {
|
|
22
|
+
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** pops所有的类型配置 11个*/
|
|
26
|
+
export interface PopsDetails {
|
|
27
|
+
alert: PopsAlertDetails;
|
|
28
|
+
confirm: PopsConfirmDetails;
|
|
29
|
+
prompt: PopsPromptDetails;
|
|
30
|
+
loading: PopsLoadingDetails;
|
|
31
|
+
iframe: PopsIframeDetails;
|
|
32
|
+
tooltip: PopsToolTipDetails;
|
|
33
|
+
drawer: PopsDrawerDetails;
|
|
34
|
+
folder: PopsFolderDetails;
|
|
35
|
+
panel: PopsPanelDetails;
|
|
36
|
+
rightClickMenu: PopsRightClickMenuDetails;
|
|
37
|
+
searchSuggestion: PopsSearchSuggestionDetails;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** pops的类型 */
|
|
41
|
+
export type PopsType = keyof PopsDetails;
|
|
42
|
+
|
|
43
|
+
/** pops中支持only的配置 */
|
|
44
|
+
export type PopsSupportOnlyDetails = Omit<PopsDetails, "searchSuggestion">;
|
|
45
|
+
|
|
46
|
+
/** 存储实例的类型 */
|
|
47
|
+
export type PopsInstStoreType = keyof Omit<PopsDetails, "searchSuggestion">;
|
|
48
|
+
|
|
49
|
+
/** pops弹窗支持动画元素的配置 8个 */
|
|
50
|
+
export type PopsSupportAnimDetails = Omit<PopsDetails, "tooltip" | "rightClickMenu" | "searchSuggestion">;
|
|
51
|
+
|
|
52
|
+
/** pops弹窗支持动画元素的类型 */
|
|
53
|
+
export type PopsSupportAnimDetailsType = keyof PopsSupportAnimDetails;
|
|
54
|
+
|
|
55
|
+
/** pops弹窗支持标题栏的配置 */
|
|
56
|
+
export type PopsSupportHeaderTitleDetails = Pick<
|
|
57
|
+
PopsDetails,
|
|
58
|
+
"alert" | "confirm" | "prompt" | "iframe" | "drawer" | "folder" | "panel"
|
|
59
|
+
>;
|
|
60
|
+
|
|
61
|
+
/** pops弹窗支持标题栏的类型 */
|
|
62
|
+
export type PopsSupportHeaderTitleDetailsType = keyof PopsSupportHeaderTitleDetails;
|
|
63
|
+
|
|
64
|
+
/** pops支持底部按钮的配置 */
|
|
65
|
+
export type PopsSupportBottomBtnDetails = Pick<PopsDetails, "alert" | "confirm" | "prompt" | "drawer">;
|
|
66
|
+
|
|
67
|
+
/** pops支持底部按钮的类型 */
|
|
68
|
+
export type PopsSupportBottomBtnDetailsType = keyof PopsSupportHeaderTitleDetails;
|
|
69
|
+
|
|
70
|
+
/** pops支持中间内容的配置 */
|
|
71
|
+
export type PopsSupportContentDetails = Pick<PopsDetails, "alert" | "confirm" | "prompt" | "drawer" | "loading">;
|
|
72
|
+
|
|
73
|
+
/** pops支持中间内容的类型 */
|
|
74
|
+
export type PopsSupportContentDetailsType = keyof PopsSupportContentDetails;
|
|
75
|
+
|
|
76
|
+
/** panel的各种类型的配置项 */
|
|
77
|
+
export type PopsPanelFormsTotalDetails =
|
|
78
|
+
| PopsPanelSwitchDetails
|
|
79
|
+
| PopsPanelSliderDetails
|
|
80
|
+
| PopsPanelInputDetails
|
|
81
|
+
| PopsPanelTextAreaDetails
|
|
82
|
+
| PopsPanelSelectDetails<any>
|
|
83
|
+
| PopsPanelButtonDetails
|
|
84
|
+
| PopsPanelDeepMenuDetails
|
|
85
|
+
| PopsPanelOwnDetails;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* pops.xxx的调用返回值
|
|
89
|
+
*/
|
|
90
|
+
export interface PopsCallResult {
|
|
91
|
+
/** 唯一标识id */
|
|
92
|
+
guid: string;
|
|
93
|
+
/** 影子元素 */
|
|
94
|
+
$shadowContainer: HTMLDivElement;
|
|
95
|
+
/** 影子元素的根节点 */
|
|
96
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
97
|
+
/** 元素 */
|
|
98
|
+
element: HTMLDivElement;
|
|
99
|
+
/** 动画层元素 */
|
|
100
|
+
animElement: HTMLDivElement;
|
|
101
|
+
/** pops元素 */
|
|
102
|
+
popsElement: HTMLDivElement;
|
|
103
|
+
/** 遮罩层元素 */
|
|
104
|
+
maskElement?: HTMLDivElement;
|
|
105
|
+
/** 关闭弹窗 */
|
|
106
|
+
close(): void;
|
|
107
|
+
/** 隐藏弹窗 */
|
|
108
|
+
hide(): void;
|
|
109
|
+
/** 显示弹窗 */
|
|
110
|
+
show(): void;
|
|
111
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { PopsAlertDetails } from "../components/alert/types";
|
|
2
|
+
import type { PopsDrawerDetails } from "../components/drawer/types";
|
|
3
|
+
import type { PopsFolderDetails } from "../components/folder/types";
|
|
4
|
+
import type { PopsIframeDetails } from "../components/iframe/types";
|
|
5
|
+
import type { PopsLoadingDetails } from "../components/loading/types";
|
|
6
|
+
import type { PopsPanelDetails } from "../components/panel/types";
|
|
7
|
+
import type { PopsPromptDetails } from "../components/prompt/types/index";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 遮罩层配置
|
|
11
|
+
*/
|
|
12
|
+
export interface PopsMaskDetails {
|
|
13
|
+
/**
|
|
14
|
+
* 是否启用遮罩层,默认false
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
enable?: boolean;
|
|
18
|
+
clickEvent?: {
|
|
19
|
+
/**
|
|
20
|
+
* 点击遮罩层是否触发关闭事件
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
toClose?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 点击遮罩层是否触发隐藏事件
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
toHide?: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 遮罩层自定义的点击事件
|
|
32
|
+
* @param originalRun 当toClose为true,它是关闭弹窗,当toHide为true,它是隐藏弹窗
|
|
33
|
+
* @param config 配置信息
|
|
34
|
+
*/
|
|
35
|
+
clickCallBack?:
|
|
36
|
+
| ((
|
|
37
|
+
originalRun: () => void | Promise<void>,
|
|
38
|
+
config:
|
|
39
|
+
| PopsAlertDetails
|
|
40
|
+
| PopsDrawerDetails
|
|
41
|
+
| PopsIframeDetails
|
|
42
|
+
| PopsPromptDetails
|
|
43
|
+
| PopsFolderDetails
|
|
44
|
+
| PopsLoadingDetails
|
|
45
|
+
| PopsPanelDetails
|
|
46
|
+
) => void)
|
|
47
|
+
| undefined
|
|
48
|
+
| null;
|
|
49
|
+
}
|
|
@@ -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";
|