@whitesev/pops 1.0.0 → 1.0.1
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 +243 -0
- package/dist/index.amd.js +5634 -151
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +5634 -151
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5634 -151
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +5634 -151
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +5634 -151
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +5634 -151
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +119 -60
- package/dist/types/src/components/alert/index.d.ts +1 -1
- package/dist/types/src/components/alert/indexType.d.ts +16 -0
- package/dist/types/src/components/confirm/index.d.ts +1 -1
- package/dist/types/src/components/confirm/indexType.d.ts +6 -0
- package/dist/types/src/components/drawer/index.d.ts +2 -0
- package/dist/types/src/components/drawer/indexType.d.ts +43 -0
- package/dist/types/src/components/folder/folderIcon.d.ts +27 -0
- package/dist/types/src/components/folder/index.d.ts +2 -0
- package/dist/types/src/components/folder/indexType.d.ts +68 -0
- package/dist/types/src/components/iframe/index.d.ts +2 -0
- package/dist/types/src/components/iframe/indexType.d.ts +120 -0
- package/dist/types/src/components/loading/index.d.ts +2 -0
- package/dist/types/src/components/loading/indexType.d.ts +23 -0
- package/dist/types/src/components/panel/buttonType.d.ts +60 -0
- package/dist/types/src/components/panel/commonType.d.ts +46 -0
- package/dist/types/src/components/panel/deepMenuType.d.ts +56 -0
- package/dist/types/src/components/panel/formsType.d.ts +31 -0
- package/dist/types/src/components/panel/index.d.ts +2 -0
- package/dist/types/src/components/panel/indexType.d.ts +86 -0
- package/dist/types/src/components/panel/inputType.d.ts +61 -0
- package/dist/types/src/components/panel/ownType.d.ts +27 -0
- package/dist/types/src/components/panel/selectType.d.ts +71 -0
- package/dist/types/src/components/panel/sliderType.d.ts +58 -0
- package/dist/types/src/components/panel/switchType.d.ts +42 -0
- package/dist/types/src/components/panel/textareaType.d.ts +50 -0
- package/dist/types/src/components/prompt/index.d.ts +2 -0
- package/dist/types/src/components/prompt/indexType.d.ts +37 -0
- package/dist/types/src/components/rightClickMenu/index.d.ts +2 -0
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +77 -0
- package/dist/types/src/components/searchSuggestion/index.d.ts +4 -0
- package/dist/types/src/components/searchSuggestion/indexType.d.ts +238 -0
- package/dist/types/src/components/tooltip/index.d.ts +2 -0
- package/dist/types/src/components/tooltip/indexType.d.ts +91 -0
- package/dist/types/src/handler/PopsHandler.d.ts +51 -39
- package/{src → dist/types/src}/types/PopsDOMUtilsEventType.d.ts +31 -33
- package/{src → dist/types/src}/types/animation.d.ts +1 -1
- package/{src → dist/types/src}/types/button.d.ts +21 -11
- package/{src → dist/types/src}/types/components.d.ts +9 -9
- package/{src → dist/types/src}/types/event.d.ts +6 -4
- package/{src → dist/types/src}/types/icon.d.ts +3 -1
- package/{src → dist/types/src}/types/layer.d.ts +2 -2
- package/{src → dist/types/src}/types/main.d.ts +22 -21
- package/{src → dist/types/src}/types/mask.d.ts +1 -1
- package/{src → dist/types/src}/types/position.d.ts +3 -3
- package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -0
- package/dist/types/src/utils/PopsDOMUtilsEvent.d.ts +2 -0
- package/dist/types/src/utils/PopsUIUtils.d.ts +10 -9
- package/dist/types/src/utils/PopsUtils.d.ts +2 -2
- package/package.json +2 -3
- /package/{src → dist/types/src}/types/global.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
export type PopsDOMUtilsEventObject<T extends Node> = Event & {
|
|
2
2
|
target: T;
|
|
3
3
|
};
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
export type PopsDOMUtilsCreateElementAttributesMap = {
|
|
6
6
|
style?: string;
|
|
7
7
|
id?: string;
|
|
8
8
|
class?: string;
|
|
@@ -15,7 +15,7 @@ declare type PopsDOMUtilsCreateElementAttributesMap = {
|
|
|
15
15
|
* + https://blog.csdn.net/weixin_68658847/article/details/126939879
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
export interface PopsDOMUtils_MouseEvent {
|
|
19
19
|
click: MouseEvent | PointerEvent;
|
|
20
20
|
contextmenu: MouseEvent | PointerEvent;
|
|
21
21
|
dblclick: MouseEvent | PointerEvent;
|
|
@@ -28,20 +28,20 @@ declare interface PopsDOMUtils_MouseEvent {
|
|
|
28
28
|
mouseup: MouseEvent | PointerEvent;
|
|
29
29
|
hover: MouseEvent;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
export type PopsDOMUtils_MouseEventType = keyof PopsDOMUtils_MouseEvent;
|
|
32
32
|
/**
|
|
33
33
|
* 鼠标事件
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
export interface PopsDOMUtils_KeyboardEvent {
|
|
36
36
|
keydown: KeyboardEvent;
|
|
37
37
|
keypress: KeyboardEvent;
|
|
38
38
|
keyup: KeyboardEvent;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
export type PopsDOMUtils_KeyboardEventType = keyof PopsDOMUtils_KeyboardEvent;
|
|
41
41
|
/**
|
|
42
42
|
* 框架/对象事件
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
export interface PopsDOMUtils_Frame_Object_Event {
|
|
45
45
|
abort: Event;
|
|
46
46
|
beforeunload: Event;
|
|
47
47
|
error: Event;
|
|
@@ -53,12 +53,12 @@ declare interface PopsDOMUtils_Frame_Object_Event {
|
|
|
53
53
|
scroll: Event;
|
|
54
54
|
unload: Event;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
export type PopsDOMUtils_Frame_Object_EventType =
|
|
57
57
|
keyof PopsDOMUtils_Frame_Object_Event;
|
|
58
58
|
/**
|
|
59
59
|
* 表单事件
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
export interface PopsDOMUtils_FormEvent {
|
|
62
62
|
blur: Event;
|
|
63
63
|
change: Event;
|
|
64
64
|
focus: Event;
|
|
@@ -68,32 +68,31 @@ declare interface PopsDOMUtils_FormEvent {
|
|
|
68
68
|
reset: Event;
|
|
69
69
|
search: Event;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
export type PopsDOMUtils_FormEventType = keyof PopsDOMUtils_FormEvent;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* 剪贴板事件
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
export interface PopsDOMUtils_ClipboardEvent {
|
|
77
77
|
copy: ClipboardEvent;
|
|
78
78
|
cut: ClipboardEvent;
|
|
79
79
|
paste: ClipboardEvent;
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
keyof PopsDOMUtils_ClipboardEvent;
|
|
81
|
+
export type PopsDOMUtils_ClipboardEventType = keyof PopsDOMUtils_ClipboardEvent;
|
|
83
82
|
|
|
84
83
|
/**
|
|
85
84
|
* 打印事件
|
|
86
85
|
*/
|
|
87
|
-
|
|
86
|
+
export interface PopsDOMUtils_PrintEvent {
|
|
88
87
|
afterprint: Event;
|
|
89
88
|
beforeprint: Event;
|
|
90
89
|
}
|
|
91
|
-
|
|
90
|
+
export type PopsDOMUtils_PrintEventType = keyof PopsDOMUtils_PrintEvent;
|
|
92
91
|
|
|
93
92
|
/**
|
|
94
93
|
* 拖动事件
|
|
95
94
|
*/
|
|
96
|
-
|
|
95
|
+
export interface PopsDOMUtils_DragEvent {
|
|
97
96
|
drag: DragEvent;
|
|
98
97
|
dragend: DragEvent;
|
|
99
98
|
dragenter: DragEvent;
|
|
@@ -102,12 +101,12 @@ declare interface PopsDOMUtils_DragEvent {
|
|
|
102
101
|
dragstart: DragEvent;
|
|
103
102
|
drop: DragEvent;
|
|
104
103
|
}
|
|
105
|
-
|
|
104
|
+
export type PopsDOMUtils_DragEventType = keyof PopsDOMUtils_DragEvent;
|
|
106
105
|
|
|
107
106
|
/**
|
|
108
107
|
* 多媒体(Media)事件
|
|
109
108
|
*/
|
|
110
|
-
|
|
109
|
+
export interface PopsDOMUtils_MediaEvent {
|
|
111
110
|
abort: Event;
|
|
112
111
|
canplay: Event;
|
|
113
112
|
canplaythrough: Event;
|
|
@@ -131,32 +130,31 @@ declare interface PopsDOMUtils_MediaEvent {
|
|
|
131
130
|
volumechange: Event;
|
|
132
131
|
waiting: Event;
|
|
133
132
|
}
|
|
134
|
-
|
|
133
|
+
export type PopsDOMUtils_MediaEventType = keyof PopsDOMUtils_MediaEvent;
|
|
135
134
|
|
|
136
135
|
/**
|
|
137
136
|
* 动画事件
|
|
138
137
|
*/
|
|
139
|
-
|
|
138
|
+
export interface PopsDOMUtils_AnimationEvent {
|
|
140
139
|
animationend: AnimationEvent;
|
|
141
140
|
animationiteration: AnimationEvent;
|
|
142
141
|
animationstart: AnimationEvent;
|
|
143
142
|
}
|
|
144
|
-
|
|
145
|
-
keyof PopsDOMUtils_AnimationEvent;
|
|
143
|
+
export type PopsDOMUtils_AnimationEventType = keyof PopsDOMUtils_AnimationEvent;
|
|
146
144
|
|
|
147
145
|
/**
|
|
148
146
|
* 过渡事件
|
|
149
147
|
*/
|
|
150
|
-
|
|
148
|
+
export interface PopsDOMUtils_TransitionEvent {
|
|
151
149
|
transitionend: TransitionEvent;
|
|
152
150
|
}
|
|
153
|
-
|
|
151
|
+
export type PopsDOMUtils_TransitionEventType =
|
|
154
152
|
keyof PopsDOMUtils_TransitionEvent;
|
|
155
153
|
|
|
156
154
|
/**
|
|
157
155
|
* 触摸事件
|
|
158
156
|
*/
|
|
159
|
-
|
|
157
|
+
export interface PopsDOMUtils_TouchEvent {
|
|
160
158
|
touchstart: TouchEvent;
|
|
161
159
|
touchmove: TouchEvent;
|
|
162
160
|
touchend: TouchEvent;
|
|
@@ -164,11 +162,11 @@ declare interface PopsDOMUtils_TouchEvent {
|
|
|
164
162
|
touchenter: TouchEvent;
|
|
165
163
|
touchleave: TouchEvent;
|
|
166
164
|
}
|
|
167
|
-
|
|
165
|
+
export type PopsDOMUtils_TouchEventType = keyof PopsDOMUtils_TouchEvent;
|
|
168
166
|
/**
|
|
169
167
|
* 其它事件
|
|
170
168
|
*/
|
|
171
|
-
|
|
169
|
+
export interface PopsDOMUtils_OtherEvent {
|
|
172
170
|
message: Event;
|
|
173
171
|
online: Event;
|
|
174
172
|
offline: Event;
|
|
@@ -181,12 +179,12 @@ declare interface PopsDOMUtils_OtherEvent {
|
|
|
181
179
|
fullscreenchange: Event;
|
|
182
180
|
DOMContentLoaded: Event;
|
|
183
181
|
}
|
|
184
|
-
|
|
182
|
+
export type PopsDOMUtils_OtherEventType = keyof PopsDOMUtils_OtherEvent;
|
|
185
183
|
|
|
186
184
|
/**
|
|
187
185
|
* 全部事件
|
|
188
186
|
*/
|
|
189
|
-
|
|
187
|
+
export type PopsDOMUtils_Event = PopsDOMUtils_MouseEvent &
|
|
190
188
|
PopsDOMUtils_KeyboardEvent &
|
|
191
189
|
PopsDOMUtils_Frame_Object_Event &
|
|
192
190
|
PopsDOMUtils_FormEvent &
|
|
@@ -202,12 +200,12 @@ declare type PopsDOMUtils_Event = PopsDOMUtils_MouseEvent &
|
|
|
202
200
|
/**
|
|
203
201
|
* 事件类型
|
|
204
202
|
*/
|
|
205
|
-
|
|
203
|
+
export type PopsDOMUtils_EventType = keyof PopsDOMUtils_Event;
|
|
206
204
|
|
|
207
205
|
/**
|
|
208
206
|
* 元素上的events属性
|
|
209
207
|
*/
|
|
210
|
-
|
|
208
|
+
export interface PopsDOMUtilsEventListenerOptionsAttribute {
|
|
211
209
|
/**
|
|
212
210
|
* 自定义的ownCallBack
|
|
213
211
|
*/
|
|
@@ -226,7 +224,7 @@ declare interface PopsDOMUtilsEventListenerOptionsAttribute {
|
|
|
226
224
|
selector?: string;
|
|
227
225
|
}
|
|
228
226
|
|
|
229
|
-
|
|
227
|
+
export type PopsDOMUtilsElementEventType =
|
|
230
228
|
| HTMLElement
|
|
231
229
|
| string
|
|
232
230
|
| NodeList
|
|
@@ -241,7 +239,7 @@ declare type PopsDOMUtilsElementEventType =
|
|
|
241
239
|
| ChildNode
|
|
242
240
|
| Node;
|
|
243
241
|
|
|
244
|
-
|
|
242
|
+
export type ParseHTMLReturnType<T1, T2> = T1 extends true
|
|
245
243
|
? T2 extends true
|
|
246
244
|
? Document
|
|
247
245
|
: HTMLElement
|
|
@@ -4,11 +4,11 @@ import type { PopsIcon } from "./icon";
|
|
|
4
4
|
/**
|
|
5
5
|
* 按钮类型
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
export type PopsButtonType = "close" | "ok" | "cancel" | "other";
|
|
8
8
|
/**
|
|
9
9
|
* 按钮样式类型
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
export type PopsButtonStyleType =
|
|
12
12
|
| "default"
|
|
13
13
|
| "primary"
|
|
14
14
|
| "xiaomi-primary"
|
|
@@ -20,12 +20,12 @@ declare type PopsButtonStyleType =
|
|
|
20
20
|
/**
|
|
21
21
|
* 按钮大小
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
export type PopsButtonSize = "large" | "small";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* 按钮的点击回调参数event
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
export interface PopsBtnCallBackEvent {
|
|
29
29
|
/**
|
|
30
30
|
* 元素
|
|
31
31
|
*/
|
|
@@ -71,7 +71,7 @@ declare interface PopsBtnCallBackEvent {
|
|
|
71
71
|
/**
|
|
72
72
|
* 按钮配置
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
export interface PopsButtonDetails<T = {}> {
|
|
75
75
|
/**
|
|
76
76
|
* 是否启用按钮
|
|
77
77
|
*/
|
|
@@ -104,7 +104,7 @@ declare interface PopsButtonDetails {
|
|
|
104
104
|
* 按钮点击的回调
|
|
105
105
|
*/
|
|
106
106
|
callback(
|
|
107
|
-
eventDetails: PopsHandlerEventDetails,
|
|
107
|
+
eventDetails: PopsHandlerEventDetails & T,
|
|
108
108
|
event: PointerEvent | MouseEvent
|
|
109
109
|
): void;
|
|
110
110
|
}
|
|
@@ -112,7 +112,7 @@ declare interface PopsButtonDetails {
|
|
|
112
112
|
/**
|
|
113
113
|
* 按钮配置(匹配任意类型)
|
|
114
114
|
*/
|
|
115
|
-
|
|
115
|
+
export interface PopsButtonDetailsAnyType<T = {}> {
|
|
116
116
|
/**
|
|
117
117
|
* 是否启用按钮
|
|
118
118
|
*/
|
|
@@ -145,14 +145,24 @@ declare interface PopsButtonDetailsAnyType {
|
|
|
145
145
|
* 按钮点击的回调
|
|
146
146
|
*/
|
|
147
147
|
callback(
|
|
148
|
-
eventDetails: PopsHandlerEventDetails,
|
|
148
|
+
eventDetails: PopsHandlerEventDetails & T,
|
|
149
|
+
event: PointerEvent | MouseEvent
|
|
150
|
+
): void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** prompt的点击回调 */
|
|
154
|
+
export interface PopsPromptButtonDetails extends PopsButtonDetails {
|
|
155
|
+
callback(
|
|
156
|
+
eventDetails: PopsHandlerEventDetails & {
|
|
157
|
+
text: string;
|
|
158
|
+
},
|
|
149
159
|
event: PointerEvent | MouseEvent
|
|
150
160
|
): void;
|
|
151
161
|
}
|
|
152
162
|
/**
|
|
153
163
|
* 右上角关闭按钮点击回调的配置
|
|
154
164
|
*/
|
|
155
|
-
|
|
165
|
+
export interface PopsHeaderCloseButtonClickCallBackEvent {
|
|
156
166
|
/**
|
|
157
167
|
* 动画元素(包裹着弹窗元素)
|
|
158
168
|
*/
|
|
@@ -164,7 +174,7 @@ declare interface PopsHeaderCloseButtonClickCallBackEvent {
|
|
|
164
174
|
/**
|
|
165
175
|
* 按钮调用类型
|
|
166
176
|
*/
|
|
167
|
-
type:
|
|
177
|
+
type: string;
|
|
168
178
|
/**
|
|
169
179
|
* 唯一id
|
|
170
180
|
*/
|
|
@@ -189,7 +199,7 @@ declare interface PopsHeaderCloseButtonClickCallBackEvent {
|
|
|
189
199
|
/**
|
|
190
200
|
* 顶部关闭按钮配置
|
|
191
201
|
*/
|
|
192
|
-
|
|
202
|
+
export interface PopsHeaderCloseButtonDetails {
|
|
193
203
|
/**
|
|
194
204
|
* 是否启用按钮
|
|
195
205
|
*/
|
|
@@ -14,7 +14,7 @@ import type { PopsMaskDetails } from "./mask";
|
|
|
14
14
|
/**
|
|
15
15
|
* 标题配置
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
export interface PopsTitleConfig {
|
|
18
18
|
title: {
|
|
19
19
|
/**
|
|
20
20
|
* 标题文字
|
|
@@ -38,7 +38,7 @@ declare interface PopsTitleConfig {
|
|
|
38
38
|
/**
|
|
39
39
|
* 内容配置
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
export interface PopsContentConfig {
|
|
42
42
|
content: {
|
|
43
43
|
/**
|
|
44
44
|
* 内容文字
|
|
@@ -57,7 +57,7 @@ declare interface PopsContentConfig {
|
|
|
57
57
|
/**
|
|
58
58
|
* 按钮配置
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
export interface PopsButtonConfig {
|
|
61
61
|
btn?: {
|
|
62
62
|
/**
|
|
63
63
|
* 按钮的位置,默认left
|
|
@@ -72,7 +72,7 @@ declare interface PopsButtonConfig {
|
|
|
72
72
|
/**
|
|
73
73
|
* 按钮的其它配置
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
export interface PopsMoreButtonConfig<T = {}> {
|
|
76
76
|
btn?: PopsButtonConfig["btn"] & {
|
|
77
77
|
/**
|
|
78
78
|
* 是否合并按钮
|
|
@@ -89,21 +89,21 @@ declare interface PopsMoreButtonConfig {
|
|
|
89
89
|
/**
|
|
90
90
|
* 确定按钮
|
|
91
91
|
*/
|
|
92
|
-
ok?: Partial<PopsButtonDetails | PopsButtonDetailsAnyType
|
|
92
|
+
ok?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
93
93
|
/**
|
|
94
94
|
* 取消按钮
|
|
95
95
|
*/
|
|
96
|
-
cancel?: Partial<PopsButtonDetails | PopsButtonDetailsAnyType
|
|
96
|
+
cancel?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
97
97
|
/**
|
|
98
98
|
* 其他按钮
|
|
99
99
|
*/
|
|
100
|
-
other?: Partial<PopsButtonDetails | PopsButtonDetailsAnyType
|
|
100
|
+
other?: Partial<PopsButtonDetails<T> | PopsButtonDetailsAnyType<T>>;
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* 拖拽(标题栏)的配置
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
export interface PopsDragConfig {
|
|
107
107
|
/**
|
|
108
108
|
* 是否可以按钮标题栏进行拖拽,默认false
|
|
109
109
|
*/
|
|
@@ -142,7 +142,7 @@ declare interface PopsDragConfig {
|
|
|
142
142
|
/**
|
|
143
143
|
* 通用配置
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
export interface PopsCommonConfig {
|
|
146
146
|
/**
|
|
147
147
|
* 自定义的className,默认为空
|
|
148
148
|
*/
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { PopsIframeDetails } from "../components/iframe/indexType";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* 事件配置
|
|
3
5
|
*/
|
|
4
|
-
|
|
6
|
+
export interface PopsIframeEventDetails {
|
|
5
7
|
/**
|
|
6
8
|
* 唯一id
|
|
7
9
|
*/
|
|
@@ -25,12 +27,12 @@ declare interface PopsIframeEventDetails {
|
|
|
25
27
|
/**
|
|
26
28
|
* 当前配置
|
|
27
29
|
*/
|
|
28
|
-
config:
|
|
30
|
+
config: PopsIframeDetails;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* 事件配置
|
|
32
34
|
*/
|
|
33
|
-
|
|
35
|
+
export interface PopsEventDetails {
|
|
34
36
|
/** 最外层包裹的元素 */
|
|
35
37
|
$shadowContainer: HTMLDivElement;
|
|
36
38
|
/** ShadowRoot */
|
|
@@ -54,7 +56,7 @@ declare interface PopsEventDetails {
|
|
|
54
56
|
/**
|
|
55
57
|
* 处理过的事件配置
|
|
56
58
|
*/
|
|
57
|
-
|
|
59
|
+
export interface PopsHandlerEventDetails extends PopsEventDetails {
|
|
58
60
|
/** 当前按钮类型 */
|
|
59
61
|
type: "cancel" | "close" | "ok" | "other";
|
|
60
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* config内存储饿实例配置
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
export interface PopsLayerConfig {
|
|
5
5
|
/** 固定id */
|
|
6
6
|
guid: string;
|
|
7
7
|
/** 动画元素 */
|
|
@@ -12,7 +12,7 @@ declare interface PopsLayerConfig {
|
|
|
12
12
|
maskElement?: HTMLDivElement;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
export interface PopsLayerCommonConfig extends PopsLayerConfig {
|
|
16
16
|
/** shadow容器 */
|
|
17
17
|
$shadowContainer: HTMLDivElement;
|
|
18
18
|
/** shadow容器的shandowRoot */
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsConfirmDetails } from "../components/confirm/
|
|
3
|
-
import type { PopsDrawerDetails } from "../components/drawer/
|
|
4
|
-
import type { PopsFolderDetails } from "../components/folder/
|
|
5
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
6
|
-
import type { PopsLoadingDetails } from "../components/loading/
|
|
7
|
-
import type { PopsPanelDetails } from "../components/panel/
|
|
8
|
-
import type { PopsPromptDetails } from "../components/prompt/
|
|
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
9
|
|
|
10
|
-
|
|
10
|
+
export interface PopsUtilsOwnObject<V extends any> {
|
|
11
11
|
[key: string]: V | PopsUtilsOwnObject<V>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** pops的类型 8个 */
|
|
15
|
-
|
|
15
|
+
export type PopsType =
|
|
16
16
|
| "alert"
|
|
17
17
|
| "confirm"
|
|
18
18
|
| "prompt"
|
|
@@ -25,13 +25,13 @@ declare type PopsType =
|
|
|
25
25
|
// | "rightClickMenu";
|
|
26
26
|
|
|
27
27
|
/** pops所有的类型 10个 */
|
|
28
|
-
|
|
28
|
+
export type PopsMode = PopsType | "tooltip" | "rightClickMenu";
|
|
29
29
|
|
|
30
30
|
/** 存储实例的类型 9个 */
|
|
31
|
-
|
|
31
|
+
export type PopsLayerMode = PopsType | "tooltip";
|
|
32
32
|
|
|
33
33
|
/** pops弹窗支持动画元素的配置 */
|
|
34
|
-
|
|
34
|
+
export interface PopsSupportAnim {
|
|
35
35
|
alert: PopsAlertDetails;
|
|
36
36
|
confirm: PopsConfirmDetails;
|
|
37
37
|
prompt: PopsPromptDetails;
|
|
@@ -42,10 +42,10 @@ declare interface PopsSupportAnim {
|
|
|
42
42
|
panel: PopsPanelDetails;
|
|
43
43
|
}
|
|
44
44
|
/** pops弹窗支持动画元素的类型 */
|
|
45
|
-
|
|
45
|
+
export type PopsTypeSupportAnim = keyof PopsSupportAnim;
|
|
46
46
|
|
|
47
47
|
/** pops弹窗支持标题栏的配置 */
|
|
48
|
-
|
|
48
|
+
export interface PopsSupportHeaderTitle {
|
|
49
49
|
alert: PopsAlertDetails;
|
|
50
50
|
confirm: PopsConfirmDetails;
|
|
51
51
|
prompt: PopsPromptDetails;
|
|
@@ -55,30 +55,31 @@ declare interface PopsSupportHeaderTitle {
|
|
|
55
55
|
panel: PopsPanelDetails;
|
|
56
56
|
}
|
|
57
57
|
/** pops弹窗支持标题栏的类型 */
|
|
58
|
-
|
|
58
|
+
export type PopsTypeSupportHeaderTitle = keyof PopsSupportHeaderTitle;
|
|
59
59
|
|
|
60
60
|
/** pops支持底部按钮的配置 */
|
|
61
|
-
|
|
61
|
+
export interface PopsSupportBottomBtn {
|
|
62
62
|
alert: PopsAlertDetails;
|
|
63
63
|
confirm: PopsConfirmDetails;
|
|
64
64
|
prompt: PopsPromptDetails;
|
|
65
65
|
drawer: PopsDrawerDetails;
|
|
66
66
|
}
|
|
67
67
|
/** pops支持底部按钮的类型 */
|
|
68
|
-
|
|
68
|
+
export type PopsTypeSupportBottomBtn = keyof PopsSupportHeaderTitle;
|
|
69
69
|
|
|
70
70
|
/** pops支持中间内容的配置 */
|
|
71
|
-
|
|
71
|
+
export interface PopsSupportContent {
|
|
72
72
|
alert: PopsAlertDetails;
|
|
73
73
|
confirm: PopsConfirmDetails;
|
|
74
74
|
prompt: PopsPromptDetails;
|
|
75
75
|
drawer: PopsDrawerDetails;
|
|
76
|
+
loading: PopsLoadingDetails;
|
|
76
77
|
}
|
|
77
78
|
/** pops支持中间内容的类型 */
|
|
78
|
-
|
|
79
|
+
export type PopsTypeSupportContent = keyof PopsSupportContent;
|
|
79
80
|
|
|
80
81
|
/** panel的各种类型的配置项 */
|
|
81
|
-
|
|
82
|
+
export type PopsPanelFormsTotalDetails =
|
|
82
83
|
| PopsPanelSwitchDetails
|
|
83
84
|
| PopsPanelSliderDetails
|
|
84
85
|
| PopsPanelInputDetails
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 弹窗位置
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
export type PopsPosition =
|
|
5
5
|
| "top_left"
|
|
6
6
|
| "top"
|
|
7
7
|
| "top_right"
|
|
@@ -15,7 +15,7 @@ declare type PopsPosition =
|
|
|
15
15
|
/**
|
|
16
16
|
* 按钮位置
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
export type PopsJustifyContent =
|
|
19
19
|
| "center"
|
|
20
20
|
| "end"
|
|
21
21
|
| "flex-end"
|
|
@@ -37,7 +37,7 @@ declare type PopsJustifyContent =
|
|
|
37
37
|
/**
|
|
38
38
|
* text-align
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
export type PopsTextAlign =
|
|
41
41
|
| "center"
|
|
42
42
|
| "end"
|
|
43
43
|
| "justify"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PopsDOMUtils_Event, PopsDOMUtils_EventType, PopsDOMUtilsElementEventType, PopsDOMUtilsEventListenerOptionsAttribute } from "../types/PopsDOMUtilsEventType";
|
|
1
2
|
declare class PopsDOMUtilsEvent {
|
|
2
3
|
/**
|
|
3
4
|
* 绑定事件
|
|
@@ -63,6 +64,7 @@ declare class PopsDOMUtilsEvent {
|
|
|
63
64
|
* })
|
|
64
65
|
*/
|
|
65
66
|
on<T extends PopsDOMUtils_EventType>(element: PopsDOMUtilsElementEventType, eventType: T | T[], selector: string | undefined | null, callback: (event: PopsDOMUtils_Event[T]) => void, option?: boolean | AddEventListenerOptions): void;
|
|
67
|
+
on<T extends Event>(element: PopsDOMUtilsElementEventType, eventType: string | string[], selector: string | undefined | null, callback: (event: T) => void, option?: boolean | AddEventListenerOptions): void;
|
|
66
68
|
/**
|
|
67
69
|
* 绑定事件
|
|
68
70
|
* @param element 需要绑定的元素|元素数组|window
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { PopsAlertDetails } from "../components/alert/
|
|
2
|
-
import type { PopsConfirmDetails } from "../components/confirm/
|
|
3
|
-
import type { PopsDrawerDetails } from "../components/drawer/
|
|
4
|
-
import type { PopsFolderDetails } from "../components/folder/
|
|
5
|
-
import type { PopsIframeDetails } from "../components/iframe/
|
|
6
|
-
import type { PopsLoadingDetails } from "../components/loading/
|
|
7
|
-
import type { PopsPanelDetails } from "../components/panel/
|
|
8
|
-
import type { PopsPromptDetails } from "../components/prompt/
|
|
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 type { PopsLayerCommonConfig } from "../types/layer";
|
|
9
10
|
import type { PopsLayerMode } from "../types/main";
|
|
10
11
|
export declare const PopsUIUtils: {
|
|
11
12
|
/**
|
|
@@ -81,5 +82,5 @@ export declare const PopsUIUtils: {
|
|
|
81
82
|
* @param getAfterValueFun
|
|
82
83
|
* @param sortByDesc 排序是否降序,默认降序
|
|
83
84
|
*/
|
|
84
|
-
sortElementListByProperty<T extends unknown>(getBeforeValueFun: (value: T) =>
|
|
85
|
+
sortElementListByProperty<T extends unknown, R>(getBeforeValueFun: (value: T) => R, getAfterValueFun: (value: T) => R, sortByDesc?: boolean): (after_obj: T, before_obj: T) => 1 | 0 | -1;
|
|
85
86
|
};
|
|
@@ -52,8 +52,8 @@ declare class PopsUtils {
|
|
|
52
52
|
* @param target 需要判断的元素
|
|
53
53
|
* @param context 默认为body
|
|
54
54
|
*/
|
|
55
|
-
contains(target:
|
|
56
|
-
contains(
|
|
55
|
+
contains(target: any): boolean;
|
|
56
|
+
contains(context: any, target?: any): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* 获取格式化后的时间
|
|
59
59
|
* @param text (可选)需要格式化的字符串或者时间戳,默认:new Date()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whitesev/pops",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "弹窗库",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/node/index.esm.js",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
"src/types"
|
|
18
|
+
"dist"
|
|
20
19
|
],
|
|
21
20
|
"scripts": {
|
|
22
21
|
"build": "rollup --config"
|
|
File without changes
|