@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PopsEventDetails, PopsHandlerEventDetails } from "./event";
|
|
1
|
+
import type { PopsEventDetails, PopsHandlerEventDetails } from "./event";
|
|
2
2
|
import type { PopsIconType } from "./icon";
|
|
3
3
|
import type { PopsType } from "./main";
|
|
4
4
|
|
|
@@ -10,14 +10,14 @@ export type PopsButtonType = "close" | "ok" | "cancel" | "other";
|
|
|
10
10
|
* 按钮样式类型
|
|
11
11
|
*/
|
|
12
12
|
export type PopsButtonStyleType =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
| "default"
|
|
14
|
+
| "primary"
|
|
15
|
+
| "xiaomi-primary"
|
|
16
|
+
| "success"
|
|
17
|
+
| "info"
|
|
18
|
+
| "warning"
|
|
19
|
+
| "danger"
|
|
20
|
+
| "violet";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* 按钮大小
|
|
@@ -28,160 +28,160 @@ export type PopsButtonSize = "large" | "small";
|
|
|
28
28
|
* 按钮的点击回调参数event
|
|
29
29
|
*/
|
|
30
30
|
export interface PopsBtnCallBackEvent {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
31
|
+
/**
|
|
32
|
+
* 元素
|
|
33
|
+
*/
|
|
34
|
+
element: HTMLElement;
|
|
35
|
+
/**
|
|
36
|
+
* 动画元素(包裹着弹窗元素)
|
|
37
|
+
*/
|
|
38
|
+
animElement: HTMLElement;
|
|
39
|
+
/**
|
|
40
|
+
* 弹窗元素
|
|
41
|
+
*/
|
|
42
|
+
popsElement: HTMLElement;
|
|
43
|
+
/**
|
|
44
|
+
* 遮罩层元素
|
|
45
|
+
*/
|
|
46
|
+
maskElement: HTMLElement | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* 按钮调用类型
|
|
49
|
+
*/
|
|
50
|
+
type: PopsButtonType;
|
|
51
|
+
/**
|
|
52
|
+
* 调用的方法
|
|
53
|
+
*/
|
|
54
|
+
mode: PopsType;
|
|
55
|
+
/**
|
|
56
|
+
* 唯一id
|
|
57
|
+
*/
|
|
58
|
+
guid: string;
|
|
59
|
+
/**
|
|
60
|
+
* 关闭弹窗
|
|
61
|
+
*/
|
|
62
|
+
close(): void;
|
|
63
|
+
/**
|
|
64
|
+
* 隐藏弹窗
|
|
65
|
+
*/
|
|
66
|
+
hide(): void;
|
|
67
|
+
/**
|
|
68
|
+
* 显示弹窗
|
|
69
|
+
*/
|
|
70
|
+
show(): void;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* 按钮配置
|
|
75
75
|
*/
|
|
76
|
-
export interface PopsButtonDetails<T =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
76
|
+
export interface PopsButtonDetails<T = object> {
|
|
77
|
+
/**
|
|
78
|
+
* 是否启用按钮
|
|
79
|
+
*/
|
|
80
|
+
enable: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 图标按钮,如果名字为内置的,则使用内置的,否则为自定义的svg
|
|
83
|
+
*/
|
|
84
|
+
icon: PopsIconType;
|
|
85
|
+
/**
|
|
86
|
+
* 图标按钮是否放在右边
|
|
87
|
+
*/
|
|
88
|
+
rightIcon: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 图标按钮是否是旋转360°
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
iconIsLoading: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 按钮尺寸大小
|
|
96
|
+
* @default ""
|
|
97
|
+
*/
|
|
98
|
+
size: PopsButtonSize | "";
|
|
99
|
+
/**
|
|
100
|
+
* 按钮样式类型
|
|
101
|
+
* @default "default"
|
|
102
|
+
*/
|
|
103
|
+
type: PopsButtonStyleType;
|
|
104
|
+
/**
|
|
105
|
+
* 按钮文字,默认为空
|
|
106
|
+
*/
|
|
107
|
+
text: string;
|
|
108
|
+
/**
|
|
109
|
+
* 按钮点击的回调
|
|
110
|
+
*
|
|
111
|
+
* 如果传入该值,那么将不会自动关闭弹窗
|
|
112
|
+
*/
|
|
113
|
+
callback(eventDetails: PopsHandlerEventDetails & T, event: PointerEvent | MouseEvent): void;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* 按钮配置(匹配任意类型)
|
|
118
118
|
*/
|
|
119
|
-
export type PopsButtonDetailsAnyType<T =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
export type PopsButtonDetailsAnyType<T = object> = Omit<PopsButtonDetails<T>, "type"> & {
|
|
120
|
+
/**
|
|
121
|
+
* 按钮样式类型
|
|
122
|
+
* @default "default"
|
|
123
|
+
*/
|
|
124
|
+
type: string;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
/** prompt的点击回调 */
|
|
128
128
|
export interface PopsPromptButtonDetails extends PopsButtonDetails {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
callback(
|
|
130
|
+
eventDetails: PopsHandlerEventDetails & {
|
|
131
|
+
text: string;
|
|
132
|
+
},
|
|
133
|
+
event: PointerEvent | MouseEvent
|
|
134
|
+
): void;
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* 右上角关闭按钮点击回调的配置
|
|
138
138
|
*/
|
|
139
139
|
export interface PopsHeaderCloseButtonClickCallBackEvent {
|
|
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
|
-
|
|
140
|
+
/**
|
|
141
|
+
* 动画元素(包裹着弹窗元素)
|
|
142
|
+
*/
|
|
143
|
+
animElement: HTMLElement;
|
|
144
|
+
/**
|
|
145
|
+
* 遮罩层元素,如果未设置,那么不存在
|
|
146
|
+
*/
|
|
147
|
+
maskElement?: HTMLElement;
|
|
148
|
+
/**
|
|
149
|
+
* 按钮调用类型
|
|
150
|
+
*/
|
|
151
|
+
type: string;
|
|
152
|
+
/**
|
|
153
|
+
* 唯一id
|
|
154
|
+
*/
|
|
155
|
+
guid: string;
|
|
156
|
+
/**
|
|
157
|
+
* 关闭弹窗
|
|
158
|
+
*/
|
|
159
|
+
close(): void;
|
|
160
|
+
/**
|
|
161
|
+
* 隐藏弹窗
|
|
162
|
+
*/
|
|
163
|
+
hide(): void;
|
|
164
|
+
/**
|
|
165
|
+
* 显示弹窗
|
|
166
|
+
*/
|
|
167
|
+
show(): void;
|
|
168
|
+
/**
|
|
169
|
+
* 输入的内容
|
|
170
|
+
*/
|
|
171
|
+
text: string;
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* 顶部关闭按钮配置
|
|
175
175
|
*/
|
|
176
176
|
export interface PopsHeaderCloseButtonDetails {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
177
|
+
/**
|
|
178
|
+
* 是否启用按钮
|
|
179
|
+
*/
|
|
180
|
+
enable?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* 按钮点击的回调
|
|
183
|
+
*
|
|
184
|
+
* 如果传入该值,那么将不会自动关闭弹窗
|
|
185
|
+
*/
|
|
186
|
+
callback?: (details: PopsEventDetails, event: PointerEvent | MouseEvent) => void;
|
|
187
187
|
}
|