@whitesev/pops 2.4.4 → 2.4.6
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 +117 -111
- package/dist/index.amd.js +687 -733
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +687 -733
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +687 -733
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +687 -733
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +687 -733
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +687 -733
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +9 -10
- package/dist/types/src/components/panel/types/components-common.d.ts +26 -26
- package/dist/types/src/components/panel/types/index.d.ts +2 -2
- package/dist/types/src/components/rightClickMenu/index.d.ts +3 -4
- package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +2 -2
- package/dist/types/src/handler/PopsHandler.d.ts +3 -3
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +141 -145
- package/dist/types/src/types/animation.d.ts +15 -15
- package/dist/types/src/types/button.d.ts +141 -141
- package/dist/types/src/types/components.d.ts +175 -178
- package/dist/types/src/types/event.d.ts +44 -44
- package/dist/types/src/types/global.d.ts +18 -13
- package/dist/types/src/types/icon.d.ts +28 -28
- package/dist/types/src/types/inst.d.ts +14 -14
- package/dist/types/src/types/main.d.ts +46 -49
- package/dist/types/src/types/mask.d.ts +36 -36
- package/dist/types/src/types/position.d.ts +46 -46
- package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -1
- package/dist/types/src/utils/PopsUtils.d.ts +16 -16
- package/package.json +17 -8
|
@@ -7,207 +7,204 @@ import type { PopsMaskDetails } from "./mask";
|
|
|
7
7
|
* 标题配置
|
|
8
8
|
*/
|
|
9
9
|
export interface PopsTitleConfig {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* 内容配置
|
|
34
34
|
*/
|
|
35
35
|
export interface PopsContentConfig {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* 按钮配置
|
|
54
54
|
*/
|
|
55
55
|
export interface PopsButtonConfig {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
btn?: {
|
|
57
|
+
/**
|
|
58
|
+
* 按钮的位置
|
|
59
|
+
* @default "flex-end"
|
|
60
|
+
*/
|
|
61
|
+
position?: PopsJustifyContent;
|
|
62
|
+
/**
|
|
63
|
+
* 右上角的关闭按钮
|
|
64
|
+
*/
|
|
65
|
+
close?: PopsHeaderCloseButtonDetails;
|
|
66
|
+
};
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* 按钮的其它配置
|
|
70
70
|
*/
|
|
71
|
-
export interface PopsMoreButtonConfig<T =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* 拖拽(标题栏)的配置
|
|
104
104
|
*/
|
|
105
105
|
export interface PopsDragConfig {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* 通用配置
|
|
138
138
|
*/
|
|
139
139
|
export interface PopsCommonConfig {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
$shadowRoot: ShadowRoot | HTMLElement,
|
|
211
|
-
$shadowContainer: HTMLDivElement
|
|
212
|
-
) => void;
|
|
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;
|
|
213
210
|
}
|
|
@@ -5,59 +5,59 @@ import type { PopsType } from "./main";
|
|
|
5
5
|
* 事件配置
|
|
6
6
|
*/
|
|
7
7
|
export interface PopsIframeEventDetails {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* 事件配置
|
|
35
35
|
*/
|
|
36
36
|
export interface PopsEventDetails {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* 处理过的事件配置
|
|
59
59
|
*/
|
|
60
60
|
export interface PopsHandlerEventDetails extends PopsEventDetails {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
/** 当前按钮类型 */
|
|
62
|
+
type: "cancel" | "close" | "ok" | "other";
|
|
63
63
|
}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
declare module "*.css" {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const content: string;
|
|
3
|
+
export default content;
|
|
4
4
|
}
|
|
5
5
|
declare module "*.svg" {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const content: string;
|
|
7
|
+
export default content;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
declare
|
|
10
|
+
declare let unsafeWindow: Window & typeof globalThis;
|
|
11
11
|
|
|
12
|
+
declare interface Window {
|
|
13
|
+
trustedTypes: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
12
17
|
declare type DeepRequired<T> = T extends Function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
? T
|
|
19
|
+
: T extends object
|
|
20
|
+
? T extends Node
|
|
21
|
+
? T
|
|
22
|
+
: {
|
|
23
|
+
[K in keyof T]-?: DeepRequired<T[K]>;
|
|
24
|
+
}
|
|
25
|
+
: T;
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
* 按钮svg图标
|
|
3
3
|
*/
|
|
4
4
|
export type PopsIconType =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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";
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
* config实例配置
|
|
3
3
|
*/
|
|
4
4
|
export interface PopsInstConfig {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
/** 固定id */
|
|
6
|
+
guid: string;
|
|
7
|
+
/** 动画元素 */
|
|
8
|
+
animElement: HTMLDivElement;
|
|
9
|
+
/** 主元素 */
|
|
10
|
+
popsElement: HTMLDivElement;
|
|
11
|
+
/** 遮罩层元素 */
|
|
12
|
+
maskElement?: HTMLDivElement;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* config实例通用配置
|
|
16
16
|
*/
|
|
17
17
|
export interface PopsInstCommonConfig extends PopsInstConfig {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
/** shadow容器 */
|
|
19
|
+
$shadowContainer: HTMLDivElement;
|
|
20
|
+
/** shadow容器的shandowRoot */
|
|
21
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
22
|
+
/** 移除实例前的回调函数 */
|
|
23
|
+
beforeRemoveCallBack?: (instCommonConfig: PopsInstCommonConfig) => void;
|
|
24
24
|
}
|