x-next 0.0.0-alpha.48 → 0.0.0-alpha.49
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 +21 -1
- package/dist/_container/resize-observer-2.d.ts +12 -0
- package/dist/_hooks/use-pick-slots.d.ts +2 -0
- package/dist/_hooks/use-teleport-container.d.ts +10 -0
- package/dist/_props/constant.d.ts +4 -0
- package/dist/_props/types.d.ts +1 -0
- package/dist/_utils/dom.d.ts +5 -0
- package/dist/_utils/omit.d.ts +2 -0
- package/dist/_utils/raf.d.ts +3 -0
- package/dist/_utils/throttle-by-raf.d.ts +4 -0
- package/dist/_utils/types.d.ts +1 -0
- package/dist/_utils/vue-eco.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +760 -0
- package/dist/components/tooltip/index.d.ts +1317 -0
- package/dist/components/trigger-v2/context.d.ts +8 -0
- package/dist/components/trigger-v2/index.d.ts +562 -0
- package/dist/components/trigger-v2/interface.d.ts +40 -0
- package/dist/components/trigger-v2/trigger.d.ts +627 -0
- package/dist/components/trigger-v2/utils.d.ts +51 -0
- package/dist/index.es.js +2756 -1596
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/volar.d.ts +1 -0
@@ -0,0 +1,627 @@
|
|
1
|
+
import { PropType, CSSProperties } from 'vue';
|
2
|
+
import { TriggerEvent, TriggerPosition } from '../../_props/constant';
|
3
|
+
import { TriggerPopupTranslate } from './interface';
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
5
|
+
/**
|
6
|
+
* @zh 弹出框是否可见
|
7
|
+
* @en Whether the popup is visible
|
8
|
+
* @vModel
|
9
|
+
*/
|
10
|
+
popupVisible: {
|
11
|
+
type: BooleanConstructor;
|
12
|
+
default: undefined;
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* @zh 弹出框默认是否可见(非受控模式)
|
16
|
+
* @en Whether the popup is visible by default (uncontrolled mode)
|
17
|
+
*/
|
18
|
+
defaultPopupVisible: {
|
19
|
+
type: BooleanConstructor;
|
20
|
+
default: boolean;
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* @zh 触发方式
|
24
|
+
* @en Trigger method
|
25
|
+
* @values 'hover','click','focus','contextMenu'
|
26
|
+
*/
|
27
|
+
trigger: {
|
28
|
+
type: PropType<TriggerEvent | TriggerEvent[]>;
|
29
|
+
default: string;
|
30
|
+
};
|
31
|
+
/**
|
32
|
+
* @zh 弹出位置
|
33
|
+
* @en Popup position
|
34
|
+
* @values 'top','tl','tr','bottom','bl','br','left','lt','lb','right','rt','rb'
|
35
|
+
*/
|
36
|
+
position: {
|
37
|
+
type: PropType<TriggerPosition>;
|
38
|
+
default: string;
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* @zh 触发器是否禁用
|
42
|
+
* @en Whether the trigger is disabled
|
43
|
+
*/
|
44
|
+
disabled: {
|
45
|
+
type: BooleanConstructor;
|
46
|
+
default: boolean;
|
47
|
+
};
|
48
|
+
/**
|
49
|
+
* @zh 弹出框的偏移量(弹出框距离触发器的偏移距离)
|
50
|
+
* @en The offset of the popup (the offset distance of the popup from the trigger)
|
51
|
+
*/
|
52
|
+
popupOffset: {
|
53
|
+
type: NumberConstructor;
|
54
|
+
default: number;
|
55
|
+
};
|
56
|
+
/**
|
57
|
+
* @zh 弹出框的移动距离
|
58
|
+
* @en The moving distance of the popup
|
59
|
+
*/
|
60
|
+
popupTranslate: {
|
61
|
+
type: PropType<TriggerPopupTranslate>;
|
62
|
+
};
|
63
|
+
/**
|
64
|
+
* @zh 弹出框是否显示箭头
|
65
|
+
* @en Whether the popup shows an arrow
|
66
|
+
*/
|
67
|
+
showArrow: {
|
68
|
+
type: BooleanConstructor;
|
69
|
+
default: boolean;
|
70
|
+
};
|
71
|
+
/**
|
72
|
+
* @zh 弹出框是否跟随鼠标
|
73
|
+
* @en Whether the popup follows the mouse
|
74
|
+
*/
|
75
|
+
alignPoint: {
|
76
|
+
type: BooleanConstructor;
|
77
|
+
default: boolean;
|
78
|
+
};
|
79
|
+
/**
|
80
|
+
* @zh 是否在移出触发器,并移入弹出框时保持弹出框显示
|
81
|
+
* @en Whether to keep the popup displayed when the trigger is moved out and moved into the popup
|
82
|
+
*/
|
83
|
+
popupHoverStay: {
|
84
|
+
type: BooleanConstructor;
|
85
|
+
default: boolean;
|
86
|
+
};
|
87
|
+
/**
|
88
|
+
* @zh 是否在触发器失去焦点时关闭弹出框
|
89
|
+
* @en Whether to close the popup when the trigger loses focus
|
90
|
+
*/
|
91
|
+
blurToClose: {
|
92
|
+
type: BooleanConstructor;
|
93
|
+
default: boolean;
|
94
|
+
};
|
95
|
+
/**
|
96
|
+
* @zh 是否在点击触发器时关闭弹出框
|
97
|
+
* @en Whether to close the popup when the trigger is clicked
|
98
|
+
*/
|
99
|
+
clickToClose: {
|
100
|
+
type: BooleanConstructor;
|
101
|
+
default: boolean;
|
102
|
+
};
|
103
|
+
/**
|
104
|
+
* @zh 是否在点击外部区域时关闭弹出框
|
105
|
+
* @en Whether to close the popup when clicking on the outer area
|
106
|
+
*/
|
107
|
+
clickOutsideToClose: {
|
108
|
+
type: BooleanConstructor;
|
109
|
+
default: boolean;
|
110
|
+
};
|
111
|
+
/**
|
112
|
+
* @zh 是否在关闭时卸载弹出框节点
|
113
|
+
* @en Whether to uninstall the popup node when closing
|
114
|
+
*/
|
115
|
+
unmountOnClose: {
|
116
|
+
type: BooleanConstructor;
|
117
|
+
default: boolean;
|
118
|
+
};
|
119
|
+
/**
|
120
|
+
* @zh 弹出框内容的类名
|
121
|
+
* @en The class name of the popup content
|
122
|
+
*/
|
123
|
+
contentClass: {
|
124
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
125
|
+
};
|
126
|
+
/**
|
127
|
+
* @zh 弹出框内容的样式
|
128
|
+
* @en The style of the popup content
|
129
|
+
*/
|
130
|
+
contentStyle: {
|
131
|
+
type: PropType<CSSProperties>;
|
132
|
+
};
|
133
|
+
/**
|
134
|
+
* @zh 弹出框箭头的类名
|
135
|
+
* @en The class name of the popup arrow
|
136
|
+
*/
|
137
|
+
arrowClass: {
|
138
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
139
|
+
};
|
140
|
+
/**
|
141
|
+
* @zh 弹出框箭头的样式
|
142
|
+
* @en The style of the popup arrow
|
143
|
+
*/
|
144
|
+
arrowStyle: {
|
145
|
+
type: PropType<CSSProperties>;
|
146
|
+
};
|
147
|
+
/**
|
148
|
+
* @zh 弹出框的样式
|
149
|
+
* @en The style of the popup
|
150
|
+
*/
|
151
|
+
popupStyle: {
|
152
|
+
type: PropType<CSSProperties>;
|
153
|
+
};
|
154
|
+
/**
|
155
|
+
* @zh 弹出动画的name
|
156
|
+
* @en The name of the popup animation
|
157
|
+
*/
|
158
|
+
animationName: {
|
159
|
+
type: StringConstructor;
|
160
|
+
default: string;
|
161
|
+
};
|
162
|
+
/**
|
163
|
+
* @zh 弹出动画的持续时间
|
164
|
+
* @en The duration of the popup animation
|
165
|
+
*/
|
166
|
+
duration: {
|
167
|
+
type: PropType<number | {
|
168
|
+
enter: number;
|
169
|
+
leave: number;
|
170
|
+
}>;
|
171
|
+
};
|
172
|
+
/**
|
173
|
+
* @zh mouseenter事件延时触发的时间(毫秒)
|
174
|
+
* @en Delay trigger time of mouseenter event (ms)
|
175
|
+
*/
|
176
|
+
mouseEnterDelay: {
|
177
|
+
type: NumberConstructor;
|
178
|
+
default: number;
|
179
|
+
};
|
180
|
+
/**
|
181
|
+
* @zh mouseleave事件延时触发的时间(毫秒)
|
182
|
+
* @en Delay trigger time of mouseleave event (ms)
|
183
|
+
*/
|
184
|
+
mouseLeaveDelay: {
|
185
|
+
type: NumberConstructor;
|
186
|
+
default: number;
|
187
|
+
};
|
188
|
+
/**
|
189
|
+
* @zh focus事件延时触发的时间(毫秒)
|
190
|
+
* @en Delay trigger time of focus event (ms)
|
191
|
+
*/
|
192
|
+
focusDelay: {
|
193
|
+
type: NumberConstructor;
|
194
|
+
default: number;
|
195
|
+
};
|
196
|
+
/**
|
197
|
+
* @zh 是否将弹出框宽度设置为触发器宽度
|
198
|
+
* @en Whether to set the width of the popup to the width of the trigger
|
199
|
+
*/
|
200
|
+
autoFitPopupWidth: {
|
201
|
+
type: BooleanConstructor;
|
202
|
+
default: boolean;
|
203
|
+
};
|
204
|
+
/**
|
205
|
+
* @zh 是否将弹出框的最小宽度设置为触发器宽度
|
206
|
+
* @en Whether to set the minimum width of the popup to the trigger width
|
207
|
+
*/
|
208
|
+
autoFitPopupMinWidth: {
|
209
|
+
type: BooleanConstructor;
|
210
|
+
default: boolean;
|
211
|
+
};
|
212
|
+
/**
|
213
|
+
* @zh 当触发器的尺寸发生变化时,是否重新计算弹出框位置
|
214
|
+
* @en When the size of the trigger changes, whether to recalculate the position of the popup
|
215
|
+
*/
|
216
|
+
autoFixPosition: {
|
217
|
+
type: BooleanConstructor;
|
218
|
+
default: boolean;
|
219
|
+
};
|
220
|
+
/**
|
221
|
+
* @zh 弹出框的挂载容器
|
222
|
+
* @en Mount container for popup
|
223
|
+
*/
|
224
|
+
popupContainer: {
|
225
|
+
type: PropType<string | HTMLElement>;
|
226
|
+
};
|
227
|
+
/**
|
228
|
+
* @zh 是否在容器滚动时更新弹出框的位置
|
229
|
+
* @us Whether to update the position of the popup when the container is scrolled
|
230
|
+
*/
|
231
|
+
updateAtScroll: {
|
232
|
+
type: BooleanConstructor;
|
233
|
+
default: boolean;
|
234
|
+
};
|
235
|
+
autoFitTransformOrigin: {
|
236
|
+
type: BooleanConstructor;
|
237
|
+
default: boolean;
|
238
|
+
};
|
239
|
+
hideEmpty: {
|
240
|
+
type: BooleanConstructor;
|
241
|
+
default: boolean;
|
242
|
+
};
|
243
|
+
openedClass: {
|
244
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
245
|
+
};
|
246
|
+
/**
|
247
|
+
* @zh 是否自动调整弹出框位置,以适应窗口大小
|
248
|
+
* @en Whether to automatically adjust the position of the popup to fit the window size
|
249
|
+
*/
|
250
|
+
autoFitPosition: {
|
251
|
+
type: BooleanConstructor;
|
252
|
+
default: boolean;
|
253
|
+
};
|
254
|
+
/**
|
255
|
+
* @zh 是否挂载在 `body` 元素下
|
256
|
+
* @en Whether to mount under the `body` element
|
257
|
+
*/
|
258
|
+
renderToBody: {
|
259
|
+
type: BooleanConstructor;
|
260
|
+
default: boolean;
|
261
|
+
};
|
262
|
+
/**
|
263
|
+
* @zh 是否阻止弹出层中的元素点击时获取焦点
|
264
|
+
* @en Whether to prevent elements in the pop-up layer from gaining focus when clicked
|
265
|
+
*/
|
266
|
+
preventFocus: {
|
267
|
+
type: BooleanConstructor;
|
268
|
+
default: boolean;
|
269
|
+
};
|
270
|
+
/**
|
271
|
+
* @zh 是否在滚动时关闭弹出框
|
272
|
+
* @en Whether to close the popover when scrolling
|
273
|
+
* @version 2.46.0
|
274
|
+
*/
|
275
|
+
scrollToClose: {
|
276
|
+
type: BooleanConstructor;
|
277
|
+
default: boolean;
|
278
|
+
};
|
279
|
+
/**
|
280
|
+
* @zh 滚动阈值,当滚动距离超过该值时触发关闭
|
281
|
+
* @en Scroll threshold, trigger close when the scroll distance exceeds this value
|
282
|
+
*/
|
283
|
+
scrollToCloseDistance: {
|
284
|
+
type: NumberConstructor;
|
285
|
+
default: number;
|
286
|
+
};
|
287
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
288
|
+
'update:popupVisible': (visible: boolean) => true;
|
289
|
+
/**
|
290
|
+
* @zh 弹出框显示状态改变时触发
|
291
|
+
* @en Emitted when the status of the popup changes
|
292
|
+
* @param {boolean} visible
|
293
|
+
*/
|
294
|
+
popupVisibleChange: (visible: boolean) => true;
|
295
|
+
/**
|
296
|
+
* @zh 弹出框显示后(动画结束)触发
|
297
|
+
* @en Triggered after the trigger is shown (the animation ends)
|
298
|
+
* @version 2.18.0
|
299
|
+
*/
|
300
|
+
show: () => true;
|
301
|
+
/**
|
302
|
+
* @zh 弹出框隐藏后(动画结束)触发
|
303
|
+
* @en Triggered after the popup is hidden (the animation ends)
|
304
|
+
* @version 2.18.0
|
305
|
+
*/
|
306
|
+
hide: () => true;
|
307
|
+
resize: () => true;
|
308
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
309
|
+
/**
|
310
|
+
* @zh 弹出框是否可见
|
311
|
+
* @en Whether the popup is visible
|
312
|
+
* @vModel
|
313
|
+
*/
|
314
|
+
popupVisible: {
|
315
|
+
type: BooleanConstructor;
|
316
|
+
default: undefined;
|
317
|
+
};
|
318
|
+
/**
|
319
|
+
* @zh 弹出框默认是否可见(非受控模式)
|
320
|
+
* @en Whether the popup is visible by default (uncontrolled mode)
|
321
|
+
*/
|
322
|
+
defaultPopupVisible: {
|
323
|
+
type: BooleanConstructor;
|
324
|
+
default: boolean;
|
325
|
+
};
|
326
|
+
/**
|
327
|
+
* @zh 触发方式
|
328
|
+
* @en Trigger method
|
329
|
+
* @values 'hover','click','focus','contextMenu'
|
330
|
+
*/
|
331
|
+
trigger: {
|
332
|
+
type: PropType<TriggerEvent | TriggerEvent[]>;
|
333
|
+
default: string;
|
334
|
+
};
|
335
|
+
/**
|
336
|
+
* @zh 弹出位置
|
337
|
+
* @en Popup position
|
338
|
+
* @values 'top','tl','tr','bottom','bl','br','left','lt','lb','right','rt','rb'
|
339
|
+
*/
|
340
|
+
position: {
|
341
|
+
type: PropType<TriggerPosition>;
|
342
|
+
default: string;
|
343
|
+
};
|
344
|
+
/**
|
345
|
+
* @zh 触发器是否禁用
|
346
|
+
* @en Whether the trigger is disabled
|
347
|
+
*/
|
348
|
+
disabled: {
|
349
|
+
type: BooleanConstructor;
|
350
|
+
default: boolean;
|
351
|
+
};
|
352
|
+
/**
|
353
|
+
* @zh 弹出框的偏移量(弹出框距离触发器的偏移距离)
|
354
|
+
* @en The offset of the popup (the offset distance of the popup from the trigger)
|
355
|
+
*/
|
356
|
+
popupOffset: {
|
357
|
+
type: NumberConstructor;
|
358
|
+
default: number;
|
359
|
+
};
|
360
|
+
/**
|
361
|
+
* @zh 弹出框的移动距离
|
362
|
+
* @en The moving distance of the popup
|
363
|
+
*/
|
364
|
+
popupTranslate: {
|
365
|
+
type: PropType<TriggerPopupTranslate>;
|
366
|
+
};
|
367
|
+
/**
|
368
|
+
* @zh 弹出框是否显示箭头
|
369
|
+
* @en Whether the popup shows an arrow
|
370
|
+
*/
|
371
|
+
showArrow: {
|
372
|
+
type: BooleanConstructor;
|
373
|
+
default: boolean;
|
374
|
+
};
|
375
|
+
/**
|
376
|
+
* @zh 弹出框是否跟随鼠标
|
377
|
+
* @en Whether the popup follows the mouse
|
378
|
+
*/
|
379
|
+
alignPoint: {
|
380
|
+
type: BooleanConstructor;
|
381
|
+
default: boolean;
|
382
|
+
};
|
383
|
+
/**
|
384
|
+
* @zh 是否在移出触发器,并移入弹出框时保持弹出框显示
|
385
|
+
* @en Whether to keep the popup displayed when the trigger is moved out and moved into the popup
|
386
|
+
*/
|
387
|
+
popupHoverStay: {
|
388
|
+
type: BooleanConstructor;
|
389
|
+
default: boolean;
|
390
|
+
};
|
391
|
+
/**
|
392
|
+
* @zh 是否在触发器失去焦点时关闭弹出框
|
393
|
+
* @en Whether to close the popup when the trigger loses focus
|
394
|
+
*/
|
395
|
+
blurToClose: {
|
396
|
+
type: BooleanConstructor;
|
397
|
+
default: boolean;
|
398
|
+
};
|
399
|
+
/**
|
400
|
+
* @zh 是否在点击触发器时关闭弹出框
|
401
|
+
* @en Whether to close the popup when the trigger is clicked
|
402
|
+
*/
|
403
|
+
clickToClose: {
|
404
|
+
type: BooleanConstructor;
|
405
|
+
default: boolean;
|
406
|
+
};
|
407
|
+
/**
|
408
|
+
* @zh 是否在点击外部区域时关闭弹出框
|
409
|
+
* @en Whether to close the popup when clicking on the outer area
|
410
|
+
*/
|
411
|
+
clickOutsideToClose: {
|
412
|
+
type: BooleanConstructor;
|
413
|
+
default: boolean;
|
414
|
+
};
|
415
|
+
/**
|
416
|
+
* @zh 是否在关闭时卸载弹出框节点
|
417
|
+
* @en Whether to uninstall the popup node when closing
|
418
|
+
*/
|
419
|
+
unmountOnClose: {
|
420
|
+
type: BooleanConstructor;
|
421
|
+
default: boolean;
|
422
|
+
};
|
423
|
+
/**
|
424
|
+
* @zh 弹出框内容的类名
|
425
|
+
* @en The class name of the popup content
|
426
|
+
*/
|
427
|
+
contentClass: {
|
428
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
429
|
+
};
|
430
|
+
/**
|
431
|
+
* @zh 弹出框内容的样式
|
432
|
+
* @en The style of the popup content
|
433
|
+
*/
|
434
|
+
contentStyle: {
|
435
|
+
type: PropType<CSSProperties>;
|
436
|
+
};
|
437
|
+
/**
|
438
|
+
* @zh 弹出框箭头的类名
|
439
|
+
* @en The class name of the popup arrow
|
440
|
+
*/
|
441
|
+
arrowClass: {
|
442
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
443
|
+
};
|
444
|
+
/**
|
445
|
+
* @zh 弹出框箭头的样式
|
446
|
+
* @en The style of the popup arrow
|
447
|
+
*/
|
448
|
+
arrowStyle: {
|
449
|
+
type: PropType<CSSProperties>;
|
450
|
+
};
|
451
|
+
/**
|
452
|
+
* @zh 弹出框的样式
|
453
|
+
* @en The style of the popup
|
454
|
+
*/
|
455
|
+
popupStyle: {
|
456
|
+
type: PropType<CSSProperties>;
|
457
|
+
};
|
458
|
+
/**
|
459
|
+
* @zh 弹出动画的name
|
460
|
+
* @en The name of the popup animation
|
461
|
+
*/
|
462
|
+
animationName: {
|
463
|
+
type: StringConstructor;
|
464
|
+
default: string;
|
465
|
+
};
|
466
|
+
/**
|
467
|
+
* @zh 弹出动画的持续时间
|
468
|
+
* @en The duration of the popup animation
|
469
|
+
*/
|
470
|
+
duration: {
|
471
|
+
type: PropType<number | {
|
472
|
+
enter: number;
|
473
|
+
leave: number;
|
474
|
+
}>;
|
475
|
+
};
|
476
|
+
/**
|
477
|
+
* @zh mouseenter事件延时触发的时间(毫秒)
|
478
|
+
* @en Delay trigger time of mouseenter event (ms)
|
479
|
+
*/
|
480
|
+
mouseEnterDelay: {
|
481
|
+
type: NumberConstructor;
|
482
|
+
default: number;
|
483
|
+
};
|
484
|
+
/**
|
485
|
+
* @zh mouseleave事件延时触发的时间(毫秒)
|
486
|
+
* @en Delay trigger time of mouseleave event (ms)
|
487
|
+
*/
|
488
|
+
mouseLeaveDelay: {
|
489
|
+
type: NumberConstructor;
|
490
|
+
default: number;
|
491
|
+
};
|
492
|
+
/**
|
493
|
+
* @zh focus事件延时触发的时间(毫秒)
|
494
|
+
* @en Delay trigger time of focus event (ms)
|
495
|
+
*/
|
496
|
+
focusDelay: {
|
497
|
+
type: NumberConstructor;
|
498
|
+
default: number;
|
499
|
+
};
|
500
|
+
/**
|
501
|
+
* @zh 是否将弹出框宽度设置为触发器宽度
|
502
|
+
* @en Whether to set the width of the popup to the width of the trigger
|
503
|
+
*/
|
504
|
+
autoFitPopupWidth: {
|
505
|
+
type: BooleanConstructor;
|
506
|
+
default: boolean;
|
507
|
+
};
|
508
|
+
/**
|
509
|
+
* @zh 是否将弹出框的最小宽度设置为触发器宽度
|
510
|
+
* @en Whether to set the minimum width of the popup to the trigger width
|
511
|
+
*/
|
512
|
+
autoFitPopupMinWidth: {
|
513
|
+
type: BooleanConstructor;
|
514
|
+
default: boolean;
|
515
|
+
};
|
516
|
+
/**
|
517
|
+
* @zh 当触发器的尺寸发生变化时,是否重新计算弹出框位置
|
518
|
+
* @en When the size of the trigger changes, whether to recalculate the position of the popup
|
519
|
+
*/
|
520
|
+
autoFixPosition: {
|
521
|
+
type: BooleanConstructor;
|
522
|
+
default: boolean;
|
523
|
+
};
|
524
|
+
/**
|
525
|
+
* @zh 弹出框的挂载容器
|
526
|
+
* @en Mount container for popup
|
527
|
+
*/
|
528
|
+
popupContainer: {
|
529
|
+
type: PropType<string | HTMLElement>;
|
530
|
+
};
|
531
|
+
/**
|
532
|
+
* @zh 是否在容器滚动时更新弹出框的位置
|
533
|
+
* @us Whether to update the position of the popup when the container is scrolled
|
534
|
+
*/
|
535
|
+
updateAtScroll: {
|
536
|
+
type: BooleanConstructor;
|
537
|
+
default: boolean;
|
538
|
+
};
|
539
|
+
autoFitTransformOrigin: {
|
540
|
+
type: BooleanConstructor;
|
541
|
+
default: boolean;
|
542
|
+
};
|
543
|
+
hideEmpty: {
|
544
|
+
type: BooleanConstructor;
|
545
|
+
default: boolean;
|
546
|
+
};
|
547
|
+
openedClass: {
|
548
|
+
type: (ObjectConstructor | StringConstructor | ArrayConstructor)[];
|
549
|
+
};
|
550
|
+
/**
|
551
|
+
* @zh 是否自动调整弹出框位置,以适应窗口大小
|
552
|
+
* @en Whether to automatically adjust the position of the popup to fit the window size
|
553
|
+
*/
|
554
|
+
autoFitPosition: {
|
555
|
+
type: BooleanConstructor;
|
556
|
+
default: boolean;
|
557
|
+
};
|
558
|
+
/**
|
559
|
+
* @zh 是否挂载在 `body` 元素下
|
560
|
+
* @en Whether to mount under the `body` element
|
561
|
+
*/
|
562
|
+
renderToBody: {
|
563
|
+
type: BooleanConstructor;
|
564
|
+
default: boolean;
|
565
|
+
};
|
566
|
+
/**
|
567
|
+
* @zh 是否阻止弹出层中的元素点击时获取焦点
|
568
|
+
* @en Whether to prevent elements in the pop-up layer from gaining focus when clicked
|
569
|
+
*/
|
570
|
+
preventFocus: {
|
571
|
+
type: BooleanConstructor;
|
572
|
+
default: boolean;
|
573
|
+
};
|
574
|
+
/**
|
575
|
+
* @zh 是否在滚动时关闭弹出框
|
576
|
+
* @en Whether to close the popover when scrolling
|
577
|
+
* @version 2.46.0
|
578
|
+
*/
|
579
|
+
scrollToClose: {
|
580
|
+
type: BooleanConstructor;
|
581
|
+
default: boolean;
|
582
|
+
};
|
583
|
+
/**
|
584
|
+
* @zh 滚动阈值,当滚动距离超过该值时触发关闭
|
585
|
+
* @en Scroll threshold, trigger close when the scroll distance exceeds this value
|
586
|
+
*/
|
587
|
+
scrollToCloseDistance: {
|
588
|
+
type: NumberConstructor;
|
589
|
+
default: number;
|
590
|
+
};
|
591
|
+
}>> & Readonly<{
|
592
|
+
onResize?: (() => any) | undefined;
|
593
|
+
onHide?: (() => any) | undefined;
|
594
|
+
onShow?: (() => any) | undefined;
|
595
|
+
"onUpdate:popupVisible"?: ((visible: boolean) => any) | undefined;
|
596
|
+
onPopupVisibleChange?: ((visible: boolean) => any) | undefined;
|
597
|
+
}>, {
|
598
|
+
disabled: boolean;
|
599
|
+
animationName: string;
|
600
|
+
position: "br" | "rt" | "tr" | "bottom" | "left" | "right" | "top" | "rb" | "tl" | "bl" | "lt" | "lb";
|
601
|
+
renderToBody: boolean;
|
602
|
+
popupVisible: boolean;
|
603
|
+
defaultPopupVisible: boolean;
|
604
|
+
trigger: "click" | "focus" | "hover" | "contextMenu" | ("click" | "focus" | "hover" | "contextMenu")[];
|
605
|
+
popupOffset: number;
|
606
|
+
showArrow: boolean;
|
607
|
+
alignPoint: boolean;
|
608
|
+
popupHoverStay: boolean;
|
609
|
+
blurToClose: boolean;
|
610
|
+
clickToClose: boolean;
|
611
|
+
clickOutsideToClose: boolean;
|
612
|
+
unmountOnClose: boolean;
|
613
|
+
mouseEnterDelay: number;
|
614
|
+
mouseLeaveDelay: number;
|
615
|
+
focusDelay: number;
|
616
|
+
autoFitPopupWidth: boolean;
|
617
|
+
autoFitPopupMinWidth: boolean;
|
618
|
+
autoFixPosition: boolean;
|
619
|
+
autoFitTransformOrigin: boolean;
|
620
|
+
autoFitPosition: boolean;
|
621
|
+
preventFocus: boolean;
|
622
|
+
updateAtScroll: boolean;
|
623
|
+
hideEmpty: boolean;
|
624
|
+
scrollToClose: boolean;
|
625
|
+
scrollToCloseDistance: number;
|
626
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
627
|
+
export default _default;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { CSSProperties } from 'vue';
|
2
|
+
import { TriggerPosition } from '../../_props/constant';
|
3
|
+
import { TriggerPopupTranslate } from './interface';
|
4
|
+
export interface ElementRect {
|
5
|
+
top: number;
|
6
|
+
bottom: number;
|
7
|
+
left: number;
|
8
|
+
right: number;
|
9
|
+
width: number;
|
10
|
+
height: number;
|
11
|
+
}
|
12
|
+
interface ScrollRect {
|
13
|
+
top: number;
|
14
|
+
bottom: number;
|
15
|
+
left: number;
|
16
|
+
right: number;
|
17
|
+
scrollTop: number;
|
18
|
+
scrollBottom: number;
|
19
|
+
scrollLeft: number;
|
20
|
+
scrollRight: number;
|
21
|
+
width: number;
|
22
|
+
height: number;
|
23
|
+
}
|
24
|
+
export declare const getElementScrollRect: (element: HTMLElement, containerRect: DOMRect) => {
|
25
|
+
top: number;
|
26
|
+
bottom: number;
|
27
|
+
left: number;
|
28
|
+
right: number;
|
29
|
+
scrollTop: number;
|
30
|
+
scrollBottom: number;
|
31
|
+
scrollLeft: number;
|
32
|
+
scrollRight: number;
|
33
|
+
width: number;
|
34
|
+
height: number;
|
35
|
+
};
|
36
|
+
export declare const getTransformOrigin: (position: TriggerPosition) => string;
|
37
|
+
export declare const getPopupStyle: (position: TriggerPosition, containerRect: DOMRect, triggerRect: ScrollRect, popupRect: ScrollRect, { offset, translate, customStyle, autoFitPosition, }?: {
|
38
|
+
offset?: number;
|
39
|
+
translate?: TriggerPopupTranslate;
|
40
|
+
customStyle?: CSSProperties;
|
41
|
+
autoFitPosition?: boolean;
|
42
|
+
}) => {
|
43
|
+
style: CSSProperties;
|
44
|
+
position: TriggerPosition;
|
45
|
+
};
|
46
|
+
export declare const getArrowStyle: (position: TriggerPosition, triggerRect: ScrollRect, popupRect: ScrollRect, { customStyle, }: {
|
47
|
+
customStyle?: CSSProperties;
|
48
|
+
}) => CSSProperties;
|
49
|
+
export declare const isScrollElement: (element: HTMLElement) => boolean;
|
50
|
+
export declare const getScrollElements: (container: HTMLElement | undefined) => HTMLElement[];
|
51
|
+
export {};
|