@farm-investimentos/front-mfe-components 15.14.7 → 15.14.8
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/dist/front-mfe-components.common.js +132 -108
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +132 -108
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Tooltip/Tooltip.vue +23 -4
package/package.json
CHANGED
|
@@ -96,6 +96,10 @@ export default defineComponent({
|
|
|
96
96
|
type: String,
|
|
97
97
|
default: undefined,
|
|
98
98
|
},
|
|
99
|
+
hideOnScroll: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: true,
|
|
102
|
+
},
|
|
99
103
|
},
|
|
100
104
|
emits: ['input', 'show', 'hide'],
|
|
101
105
|
setup(props, { emit, slots }) {
|
|
@@ -292,21 +296,36 @@ export default defineComponent({
|
|
|
292
296
|
return scrollableElementsRef.value;
|
|
293
297
|
};
|
|
294
298
|
|
|
299
|
+
|
|
300
|
+
const onAnyScroll = () => {
|
|
301
|
+
if (props.disabled || isControlled.value) return;
|
|
302
|
+
if (props.hideOnScroll) {
|
|
303
|
+
hide();
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
updatePosition();
|
|
307
|
+
};
|
|
308
|
+
|
|
295
309
|
const addScrollListener = () => {
|
|
296
|
-
window.addEventListener('scroll',
|
|
310
|
+
window.addEventListener('scroll', onAnyScroll, { passive: true });
|
|
311
|
+
// Opcionalmente também reagir a wheel/touchmove para UX mais fluida
|
|
312
|
+
window.addEventListener('wheel', onAnyScroll, { passive: true });
|
|
313
|
+
window.addEventListener('touchmove', onAnyScroll, { passive: true });
|
|
297
314
|
|
|
298
315
|
const scrollableElements = getScrollableElements();
|
|
299
316
|
scrollableElements.forEach(element => {
|
|
300
|
-
element.addEventListener('scroll',
|
|
317
|
+
element.addEventListener('scroll', onAnyScroll, { passive: true });
|
|
301
318
|
});
|
|
302
319
|
};
|
|
303
320
|
|
|
304
321
|
const removeScrollListener = () => {
|
|
305
|
-
window.removeEventListener('scroll',
|
|
322
|
+
window.removeEventListener('scroll', onAnyScroll);
|
|
323
|
+
window.removeEventListener('wheel', onAnyScroll);
|
|
324
|
+
window.removeEventListener('touchmove', onAnyScroll);
|
|
306
325
|
|
|
307
326
|
const scrollableElements = getScrollableElements();
|
|
308
327
|
scrollableElements.forEach(element => {
|
|
309
|
-
element.removeEventListener('scroll',
|
|
328
|
+
element.removeEventListener('scroll', onAnyScroll);
|
|
310
329
|
});
|
|
311
330
|
};
|
|
312
331
|
|