@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.
Files changed (35) hide show
  1. package/README.md +117 -111
  2. package/dist/index.amd.js +687 -733
  3. package/dist/index.amd.js.map +1 -1
  4. package/dist/index.cjs.js +687 -733
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.esm.js +687 -733
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.iife.js +687 -733
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.system.js +687 -733
  11. package/dist/index.system.js.map +1 -1
  12. package/dist/index.umd.js +687 -733
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/src/Pops.d.ts +9 -10
  15. package/dist/types/src/components/panel/types/components-common.d.ts +26 -26
  16. package/dist/types/src/components/panel/types/index.d.ts +2 -2
  17. package/dist/types/src/components/rightClickMenu/index.d.ts +3 -4
  18. package/dist/types/src/components/searchSuggestion/index.d.ts +2 -2
  19. package/dist/types/src/components/searchSuggestion/types/index.d.ts +2 -2
  20. package/dist/types/src/handler/PopsHandler.d.ts +3 -3
  21. package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +141 -145
  22. package/dist/types/src/types/animation.d.ts +15 -15
  23. package/dist/types/src/types/button.d.ts +141 -141
  24. package/dist/types/src/types/components.d.ts +175 -178
  25. package/dist/types/src/types/event.d.ts +44 -44
  26. package/dist/types/src/types/global.d.ts +18 -13
  27. package/dist/types/src/types/icon.d.ts +28 -28
  28. package/dist/types/src/types/inst.d.ts +14 -14
  29. package/dist/types/src/types/main.d.ts +46 -49
  30. package/dist/types/src/types/mask.d.ts +36 -36
  31. package/dist/types/src/types/position.d.ts +46 -46
  32. package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
  33. package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -1
  34. package/dist/types/src/utils/PopsUtils.d.ts +16 -16
  35. 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
- | "default"
14
- | "primary"
15
- | "xiaomi-primary"
16
- | "success"
17
- | "info"
18
- | "warning"
19
- | "danger"
20
- | "violet";
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
- 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;
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
- 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;
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 = {}> = Omit<PopsButtonDetails<T>, "type"> & {
120
- /**
121
- * 按钮样式类型
122
- * @default "default"
123
- */
124
- type: string;
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
- callback(
130
- eventDetails: PopsHandlerEventDetails & {
131
- text: string;
132
- },
133
- event: PointerEvent | MouseEvent
134
- ): void;
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
- 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;
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
- enable?: boolean;
181
- /**
182
- * 按钮点击的回调
183
- *
184
- * 如果传入该值,那么将不会自动关闭弹窗
185
- */
186
- callback?: (details: PopsEventDetails, event: PointerEvent | MouseEvent) => void;
177
+ /**
178
+ * 是否启用按钮
179
+ */
180
+ enable?: boolean;
181
+ /**
182
+ * 按钮点击的回调
183
+ *
184
+ * 如果传入该值,那么将不会自动关闭弹窗
185
+ */
186
+ callback?: (details: PopsEventDetails, event: PointerEvent | MouseEvent) => void;
187
187
  }