@whitesev/pops 3.2.0 → 3.2.2
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 +249 -249
- package/dist/index.amd.js +702 -667
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +702 -667
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +702 -667
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +702 -667
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +702 -667
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +702 -667
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/components/folder/types/index.d.ts +43 -13
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +94 -94
- package/dist/types/src/types/components.d.ts +211 -211
- package/dist/types/src/types/event.d.ts +43 -43
- package/dist/types/src/types/global.d.ts +31 -31
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +28 -28
- package/dist/types/src/types/main.d.ts +66 -66
- package/dist/types/src/types/mask.d.ts +52 -52
- package/dist/types/src/types/position.d.ts +60 -60
- package/package.json +27 -25
- package/src/Pops.ts +206 -206
- package/src/PopsAnimation.ts +32 -32
- package/src/PopsCSS.ts +54 -54
- package/src/PopsCore.ts +37 -37
- package/src/PopsIcon.ts +95 -95
- package/src/PopsInst.ts +21 -21
- package/src/components/alert/defaultConfig.ts +62 -62
- package/src/components/alert/index.ts +163 -163
- package/src/components/alert/types/index.ts +23 -23
- package/src/components/confirm/defaultConfig.ts +90 -90
- package/src/components/confirm/index.ts +165 -165
- package/src/components/confirm/types/index.ts +13 -17
- package/src/components/drawer/defaultConfig.ts +89 -89
- package/src/components/drawer/index.css +37 -37
- package/src/components/drawer/index.ts +245 -245
- package/src/components/drawer/types/index.ts +62 -61
- package/src/components/folder/defaultConfig.ts +151 -151
- package/src/components/folder/folderIcon.ts +28 -28
- package/src/components/folder/index.css +303 -303
- package/src/components/folder/index.ts +953 -932
- package/src/components/folder/types/index.ts +143 -110
- package/src/components/iframe/defaultConfig.ts +60 -60
- package/src/components/iframe/index.css +76 -76
- package/src/components/iframe/index.ts +331 -331
- package/src/components/iframe/types/index.ts +96 -96
- package/src/components/loading/defaultConfig.ts +29 -29
- package/src/components/loading/index.css +66 -66
- package/src/components/loading/index.ts +101 -101
- package/src/components/loading/types/index.ts +36 -34
- package/src/components/panel/css/components-select.css +84 -84
- package/src/components/panel/defaultConfig.ts +868 -868
- package/src/components/panel/handlerComponents.ts +3993 -3993
- package/src/components/panel/index.css +1403 -1401
- package/src/components/panel/index.ts +221 -221
- package/src/components/panel/types/components-button.ts +56 -56
- package/src/components/panel/types/components-common.ts +73 -73
- package/src/components/panel/types/components-container.ts +25 -25
- package/src/components/panel/types/components-deepMenu.ts +64 -64
- package/src/components/panel/types/components-input.ts +90 -90
- package/src/components/panel/types/components-own.ts +16 -16
- package/src/components/panel/types/components-select.ts +169 -169
- package/src/components/panel/types/components-selectMultiple.ts +105 -104
- package/src/components/panel/types/components-slider.ts +55 -55
- package/src/components/panel/types/components-switch.ts +33 -33
- package/src/components/panel/types/components-textarea.ts +45 -45
- package/src/components/panel/types/index.ts +244 -244
- package/src/components/prompt/defaultConfig.ts +94 -94
- package/src/components/prompt/index.css +34 -34
- package/src/components/prompt/index.ts +187 -215
- package/src/components/prompt/types/index.ts +57 -56
- package/src/components/rightClickMenu/defaultConfig.ts +103 -103
- package/src/components/rightClickMenu/index.css +115 -115
- package/src/components/rightClickMenu/index.ts +662 -662
- package/src/components/rightClickMenu/types/index.ts +145 -143
- package/src/components/searchSuggestion/defaultConfig.ts +63 -63
- package/src/components/searchSuggestion/index.ts +813 -813
- package/src/components/searchSuggestion/types/index.ts +244 -242
- package/src/components/tooltip/defaultConfig.ts +33 -33
- package/src/components/tooltip/index.css +199 -199
- package/src/components/tooltip/index.ts +617 -617
- package/src/components/tooltip/types/index.ts +123 -121
- package/src/config/CommonCSSClassName.ts +17 -17
- package/src/config/GlobalConfig.ts +63 -63
- package/src/css/animation.css +987 -987
- package/src/css/button.css +551 -551
- package/src/css/common.css +54 -54
- package/src/css/index.css +253 -253
- package/src/css/ninePalaceGridPosition.css +50 -50
- package/src/css/scrollbar.css +22 -22
- package/src/handler/PopsElementHandler.ts +303 -303
- package/src/handler/PopsHandler.ts +611 -611
- package/src/types/PopsDOMUtilsEventType.d.ts +313 -313
- package/src/types/animation.d.ts +19 -19
- package/src/types/button.d.ts +94 -94
- package/src/types/components.d.ts +211 -211
- package/src/types/event.d.ts +43 -43
- package/src/types/global.d.ts +31 -31
- package/src/types/icon.d.ts +32 -32
- package/src/types/inst.d.ts +28 -28
- package/src/types/main.d.ts +66 -66
- package/src/types/mask.d.ts +52 -52
- package/src/types/position.d.ts +60 -60
- package/src/utils/PopsDOMUtils.ts +2483 -2483
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -4
- package/src/utils/PopsInstanceUtils.ts +714 -714
- package/src/utils/PopsMathUtils.ts +71 -71
- package/src/utils/PopsSafeUtils.ts +22 -22
- package/src/utils/PopsUtils.ts +421 -421
|
@@ -1,242 +1,244 @@
|
|
|
1
|
-
import type { PopsGeneralConfig } from "../../../types/components";
|
|
2
|
-
import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
|
|
3
|
-
|
|
4
|
-
export type PopsSearchSuggestionData<T> = {
|
|
5
|
-
/**
|
|
6
|
-
* 值
|
|
7
|
-
*/
|
|
8
|
-
value: T;
|
|
9
|
-
/**
|
|
10
|
-
* 是否启用右侧的删除按钮
|
|
11
|
-
* @default true
|
|
12
|
-
*/
|
|
13
|
-
enableDeleteButton?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* 删除按钮的点击回调
|
|
16
|
-
* @returns
|
|
17
|
-
*
|
|
18
|
-
* + true 移除该元素并且从data中移除该数据, 如果data是函数返回数组的话,那么不会生效
|
|
19
|
-
*/
|
|
20
|
-
deleteButtonClickCallback?: (
|
|
21
|
-
/**
|
|
22
|
-
* 点击事件
|
|
23
|
-
*/
|
|
24
|
-
event: MouseEvent | PointerEvent,
|
|
25
|
-
/**
|
|
26
|
-
* 当前项的元素
|
|
27
|
-
*/
|
|
28
|
-
$dataItem: HTMLLIElement,
|
|
29
|
-
/**
|
|
30
|
-
* 数据项
|
|
31
|
-
*/
|
|
32
|
-
dataItem: PopsSearchSuggestionData<T>,
|
|
33
|
-
/**
|
|
34
|
-
* 当前配置
|
|
35
|
-
*/
|
|
36
|
-
config: PopsSearchSuggestionConfig<T>
|
|
37
|
-
) => void | boolean | Promise<void | boolean>;
|
|
38
|
-
/**
|
|
39
|
-
* 获取每一项的html,在显示的时候会调用该函数
|
|
40
|
-
*
|
|
41
|
-
* 它的父元素是一个\<li>元素
|
|
42
|
-
*/
|
|
43
|
-
itemView: (
|
|
44
|
-
/**
|
|
45
|
-
* 数据项
|
|
46
|
-
*/
|
|
47
|
-
dateItem: PopsSearchSuggestionData<T>,
|
|
48
|
-
/**
|
|
49
|
-
* 父元素\<li>
|
|
50
|
-
*/
|
|
51
|
-
$parent: HTMLLIElement,
|
|
52
|
-
/**
|
|
53
|
-
* 当前配置
|
|
54
|
-
*/
|
|
55
|
-
config: PopsSearchSuggestionConfig<T>
|
|
56
|
-
) => HTMLElement | string;
|
|
57
|
-
/**
|
|
58
|
-
* 每一项的点击回调
|
|
59
|
-
* @returns
|
|
60
|
-
*
|
|
61
|
-
* + true 如果设置了inputTarget且类型是input或textarea的话,那么将自动设置目标值为当前点击项的value值
|
|
62
|
-
*/
|
|
63
|
-
clickCallback?: (
|
|
64
|
-
/**
|
|
65
|
-
* 点击事件
|
|
66
|
-
*/
|
|
67
|
-
event: MouseEvent | PointerEvent,
|
|
68
|
-
/**
|
|
69
|
-
* 当前项的元素
|
|
70
|
-
*/
|
|
71
|
-
$dataItem: HTMLLIElement,
|
|
72
|
-
/**
|
|
73
|
-
* 数据项
|
|
74
|
-
*/
|
|
75
|
-
dataItem: PopsSearchSuggestionData<T>,
|
|
76
|
-
/**
|
|
77
|
-
* 当前配置
|
|
78
|
-
*/
|
|
79
|
-
config: PopsSearchSuggestionConfig<T>
|
|
80
|
-
) => IPromise<void | boolean>;
|
|
81
|
-
/**
|
|
82
|
-
* 键盘的上下键选择的回调
|
|
83
|
-
*/
|
|
84
|
-
selectCallback?: (
|
|
85
|
-
/**
|
|
86
|
-
* 键盘事件
|
|
87
|
-
*/
|
|
88
|
-
event: KeyboardEvent,
|
|
89
|
-
/**
|
|
90
|
-
* 当前项的元素
|
|
91
|
-
*/
|
|
92
|
-
$dataItem: HTMLLIElement,
|
|
93
|
-
/**
|
|
94
|
-
* 数据项
|
|
95
|
-
*/
|
|
96
|
-
dataItem: PopsSearchSuggestionData<T>,
|
|
97
|
-
/**
|
|
98
|
-
* 当前配置
|
|
99
|
-
*/
|
|
100
|
-
config: PopsSearchSuggestionConfig<T>
|
|
101
|
-
) => void;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* 搜索建议悬浮窗
|
|
105
|
-
* pops.searchSuggestion
|
|
106
|
-
*/
|
|
107
|
-
export interface PopsSearchSuggestionConfig<T = any>
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* + `
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
1
|
+
import type { PopsGeneralConfig } from "../../../types/components";
|
|
2
|
+
import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
|
|
3
|
+
|
|
4
|
+
export type PopsSearchSuggestionData<T> = {
|
|
5
|
+
/**
|
|
6
|
+
* 值
|
|
7
|
+
*/
|
|
8
|
+
value: T;
|
|
9
|
+
/**
|
|
10
|
+
* 是否启用右侧的删除按钮
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
enableDeleteButton?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 删除按钮的点击回调
|
|
16
|
+
* @returns
|
|
17
|
+
*
|
|
18
|
+
* + true 移除该元素并且从data中移除该数据, 如果data是函数返回数组的话,那么不会生效
|
|
19
|
+
*/
|
|
20
|
+
deleteButtonClickCallback?: (
|
|
21
|
+
/**
|
|
22
|
+
* 点击事件
|
|
23
|
+
*/
|
|
24
|
+
event: MouseEvent | PointerEvent,
|
|
25
|
+
/**
|
|
26
|
+
* 当前项的元素
|
|
27
|
+
*/
|
|
28
|
+
$dataItem: HTMLLIElement,
|
|
29
|
+
/**
|
|
30
|
+
* 数据项
|
|
31
|
+
*/
|
|
32
|
+
dataItem: PopsSearchSuggestionData<T>,
|
|
33
|
+
/**
|
|
34
|
+
* 当前配置
|
|
35
|
+
*/
|
|
36
|
+
config: PopsSearchSuggestionConfig<T>
|
|
37
|
+
) => void | boolean | Promise<void | boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* 获取每一项的html,在显示的时候会调用该函数
|
|
40
|
+
*
|
|
41
|
+
* 它的父元素是一个\<li>元素
|
|
42
|
+
*/
|
|
43
|
+
itemView: (
|
|
44
|
+
/**
|
|
45
|
+
* 数据项
|
|
46
|
+
*/
|
|
47
|
+
dateItem: PopsSearchSuggestionData<T>,
|
|
48
|
+
/**
|
|
49
|
+
* 父元素\<li>
|
|
50
|
+
*/
|
|
51
|
+
$parent: HTMLLIElement,
|
|
52
|
+
/**
|
|
53
|
+
* 当前配置
|
|
54
|
+
*/
|
|
55
|
+
config: PopsSearchSuggestionConfig<T>
|
|
56
|
+
) => HTMLElement | string;
|
|
57
|
+
/**
|
|
58
|
+
* 每一项的点击回调
|
|
59
|
+
* @returns
|
|
60
|
+
*
|
|
61
|
+
* + true 如果设置了inputTarget且类型是input或textarea的话,那么将自动设置目标值为当前点击项的value值
|
|
62
|
+
*/
|
|
63
|
+
clickCallback?: (
|
|
64
|
+
/**
|
|
65
|
+
* 点击事件
|
|
66
|
+
*/
|
|
67
|
+
event: MouseEvent | PointerEvent,
|
|
68
|
+
/**
|
|
69
|
+
* 当前项的元素
|
|
70
|
+
*/
|
|
71
|
+
$dataItem: HTMLLIElement,
|
|
72
|
+
/**
|
|
73
|
+
* 数据项
|
|
74
|
+
*/
|
|
75
|
+
dataItem: PopsSearchSuggestionData<T>,
|
|
76
|
+
/**
|
|
77
|
+
* 当前配置
|
|
78
|
+
*/
|
|
79
|
+
config: PopsSearchSuggestionConfig<T>
|
|
80
|
+
) => IPromise<void | boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* 键盘的上下键选择的回调
|
|
83
|
+
*/
|
|
84
|
+
selectCallback?: (
|
|
85
|
+
/**
|
|
86
|
+
* 键盘事件
|
|
87
|
+
*/
|
|
88
|
+
event: KeyboardEvent,
|
|
89
|
+
/**
|
|
90
|
+
* 当前项的元素
|
|
91
|
+
*/
|
|
92
|
+
$dataItem: HTMLLIElement,
|
|
93
|
+
/**
|
|
94
|
+
* 数据项
|
|
95
|
+
*/
|
|
96
|
+
dataItem: PopsSearchSuggestionData<T>,
|
|
97
|
+
/**
|
|
98
|
+
* 当前配置
|
|
99
|
+
*/
|
|
100
|
+
config: PopsSearchSuggestionConfig<T>
|
|
101
|
+
) => void;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* 搜索建议悬浮窗
|
|
105
|
+
* pops.searchSuggestion
|
|
106
|
+
*/
|
|
107
|
+
export interface PopsSearchSuggestionConfig<T = any> extends Pick<
|
|
108
|
+
PopsGeneralConfig,
|
|
109
|
+
"useShadowRoot" | "zIndex" | "style"
|
|
110
|
+
> {
|
|
111
|
+
/**
|
|
112
|
+
* 当前的环境,可以是document,可以是shadowroot,默认是document
|
|
113
|
+
*
|
|
114
|
+
* 用于检测监听全局点击事件
|
|
115
|
+
* @default document
|
|
116
|
+
*/
|
|
117
|
+
$selfDocument?: Document | ShadowRoot | (Document | ShadowRoot)[];
|
|
118
|
+
/**
|
|
119
|
+
* 目标元素,一般是跟随它的位置变化,监听它的focus/click
|
|
120
|
+
*/
|
|
121
|
+
$target: HTMLElement;
|
|
122
|
+
/**
|
|
123
|
+
* 目标input元素,监听它的focus/click/input事件
|
|
124
|
+
*
|
|
125
|
+
* 如果未填,那么自动使用target的值
|
|
126
|
+
* @default config.target
|
|
127
|
+
*/
|
|
128
|
+
$inputTarget?: HTMLInputElement | HTMLTextAreaElement;
|
|
129
|
+
/**
|
|
130
|
+
* 数据
|
|
131
|
+
*/
|
|
132
|
+
data: PopsSearchSuggestionData<T>[] | (() => PopsSearchSuggestionData<T>[]);
|
|
133
|
+
/**
|
|
134
|
+
* (可选)元素的className,值为空的话就不设置
|
|
135
|
+
* @default ""
|
|
136
|
+
*/
|
|
137
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
138
|
+
/**
|
|
139
|
+
* 建议框的position位置
|
|
140
|
+
*
|
|
141
|
+
* + `true`:absolute
|
|
142
|
+
* + `false`:relative
|
|
143
|
+
* @default true
|
|
144
|
+
*/
|
|
145
|
+
isAbsolute?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 是否启用动画
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
150
|
+
isAnimation?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* 是否启用折叠动画
|
|
153
|
+
* @default true
|
|
154
|
+
*/
|
|
155
|
+
useFoldAnimation?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* 是否启用箭头
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
160
|
+
useArrow?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* 建议框的宽度
|
|
163
|
+
* @default "250px"
|
|
164
|
+
*/
|
|
165
|
+
width?: string;
|
|
166
|
+
/**
|
|
167
|
+
* 是否和config.target的宽度同步
|
|
168
|
+
* @default true
|
|
169
|
+
*/
|
|
170
|
+
followTargetWidth?: true;
|
|
171
|
+
/**
|
|
172
|
+
* 建议框的最大高度
|
|
173
|
+
* @default "300px"
|
|
174
|
+
*/
|
|
175
|
+
maxHeight?: string;
|
|
176
|
+
/**
|
|
177
|
+
* 建议框距离元素的距离
|
|
178
|
+
* @default 0
|
|
179
|
+
*/
|
|
180
|
+
topDistance?: number;
|
|
181
|
+
/**
|
|
182
|
+
* 建议框显示的位置,默认是auto(自动判断位置)
|
|
183
|
+
* @default "auto"
|
|
184
|
+
*/
|
|
185
|
+
position?: "top" | "bottom" | "auto";
|
|
186
|
+
/**
|
|
187
|
+
* 当位置在上面时(包括auto自动判断在上面时),是否对搜索项进行反转
|
|
188
|
+
* @default true
|
|
189
|
+
*/
|
|
190
|
+
positionTopToReverse?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* 搜索中的提示,可以是html
|
|
193
|
+
*
|
|
194
|
+
* 前提:inputTarget是input/textarea
|
|
195
|
+
*
|
|
196
|
+
* 触发change事件,且没有搜索到数据,则显示此提示
|
|
197
|
+
*/
|
|
198
|
+
searchingTip?: string;
|
|
199
|
+
/**
|
|
200
|
+
* 没有搜索结果的提示的html
|
|
201
|
+
*
|
|
202
|
+
* 前提:inputTarget是input/textarea
|
|
203
|
+
*
|
|
204
|
+
* 触发change事件,且没有搜索到数据,则显示此结果项
|
|
205
|
+
*
|
|
206
|
+
* 如果该值是函数,需要返回的\<li>元素属性上存在data-none="true"
|
|
207
|
+
* @example
|
|
208
|
+
* <li data-none="true">暂无结果</li>
|
|
209
|
+
*/
|
|
210
|
+
toSearhNotResultHTML?: string | (() => HTMLLIElement);
|
|
211
|
+
/**
|
|
212
|
+
* 当没有搜索结果时,是否隐藏建议框
|
|
213
|
+
* @default false
|
|
214
|
+
*/
|
|
215
|
+
toHideWithNotResult?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* 跟随目标的位置
|
|
218
|
+
*
|
|
219
|
+
* + `target`:跟随config.target的位置
|
|
220
|
+
* + `input`:跟随config.inputTarget的位置
|
|
221
|
+
* + `inputCursor`:跟随config.inputTarget的输入框光标位置
|
|
222
|
+
*
|
|
223
|
+
* @default "target"
|
|
224
|
+
*/
|
|
225
|
+
followPosition?: "target" | "input" | "inputCursor";
|
|
226
|
+
/**
|
|
227
|
+
* 当config.target触发input时自动调用该函数来获取数据
|
|
228
|
+
* @returns 返回是需要显示的数据
|
|
229
|
+
*/
|
|
230
|
+
inputTargetChangeRefreshShowDataCallback?: (
|
|
231
|
+
/**
|
|
232
|
+
* 当前输入框的值
|
|
233
|
+
*/
|
|
234
|
+
inputValue: string,
|
|
235
|
+
/**
|
|
236
|
+
* config.data的数据
|
|
237
|
+
*/
|
|
238
|
+
data: PopsSearchSuggestionData<T>[],
|
|
239
|
+
/**
|
|
240
|
+
* 当前配置
|
|
241
|
+
*/
|
|
242
|
+
config: PopsSearchSuggestionConfig<T>
|
|
243
|
+
) => Promise<PopsSearchSuggestionData<T>[]> | PopsSearchSuggestionData<T>[];
|
|
244
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import type { PopsToolTipConfig } from "./types/index";
|
|
2
|
-
|
|
3
|
-
export const PopsTooltipDefaultConfig = (): DeepRequired<PopsToolTipConfig> => {
|
|
4
|
-
return {
|
|
5
|
-
useShadowRoot: true,
|
|
6
|
-
$target: null as any,
|
|
7
|
-
content: "默认文字",
|
|
8
|
-
isDiffContent: false,
|
|
9
|
-
position: "top",
|
|
10
|
-
className: "",
|
|
11
|
-
isFixed: false,
|
|
12
|
-
alwaysShow: false,
|
|
13
|
-
onShowEventName: "mouseenter touchstart",
|
|
14
|
-
onCloseEventName: "mouseleave touchend touchcancel",
|
|
15
|
-
zIndex: 10000,
|
|
16
|
-
only: false,
|
|
17
|
-
eventOption: {
|
|
18
|
-
once: false,
|
|
19
|
-
passive: false,
|
|
20
|
-
capture: true,
|
|
21
|
-
},
|
|
22
|
-
showBeforeCallBack() {},
|
|
23
|
-
showAfterCallBack() {},
|
|
24
|
-
closeBeforeCallBack() {},
|
|
25
|
-
closeAfterCallBack() {},
|
|
26
|
-
delayCloseTime: 100,
|
|
27
|
-
showArrow: true,
|
|
28
|
-
arrowDistance: 12.5,
|
|
29
|
-
otherDistance: 0,
|
|
30
|
-
style: "",
|
|
31
|
-
beforeAppendToPageCallBack() {},
|
|
32
|
-
};
|
|
33
|
-
};
|
|
1
|
+
import type { PopsToolTipConfig } from "./types/index";
|
|
2
|
+
|
|
3
|
+
export const PopsTooltipDefaultConfig = (): DeepRequired<PopsToolTipConfig> => {
|
|
4
|
+
return {
|
|
5
|
+
useShadowRoot: true,
|
|
6
|
+
$target: null as any,
|
|
7
|
+
content: "默认文字",
|
|
8
|
+
isDiffContent: false,
|
|
9
|
+
position: "top",
|
|
10
|
+
className: "",
|
|
11
|
+
isFixed: false,
|
|
12
|
+
alwaysShow: false,
|
|
13
|
+
onShowEventName: "mouseenter touchstart",
|
|
14
|
+
onCloseEventName: "mouseleave touchend touchcancel",
|
|
15
|
+
zIndex: 10000,
|
|
16
|
+
only: false,
|
|
17
|
+
eventOption: {
|
|
18
|
+
once: false,
|
|
19
|
+
passive: false,
|
|
20
|
+
capture: true,
|
|
21
|
+
},
|
|
22
|
+
showBeforeCallBack() {},
|
|
23
|
+
showAfterCallBack() {},
|
|
24
|
+
closeBeforeCallBack() {},
|
|
25
|
+
closeAfterCallBack() {},
|
|
26
|
+
delayCloseTime: 100,
|
|
27
|
+
showArrow: true,
|
|
28
|
+
arrowDistance: 12.5,
|
|
29
|
+
otherDistance: 0,
|
|
30
|
+
style: "",
|
|
31
|
+
beforeAppendToPageCallBack() {},
|
|
32
|
+
};
|
|
33
|
+
};
|