@eturnity/eturnity_reusable_components 7.48.1-EPDM-12680.17 → 7.48.1-EPDM-12680.18
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/package.json
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
<div
|
4
4
|
ref="icon"
|
5
5
|
data-test-id="infoText_trigger"
|
6
|
-
@click="openTrigger === 'onClick' && toggleInfo()"
|
7
|
-
@mouseenter="openTrigger === 'onHover' && showInfo()"
|
8
|
-
@mouseleave="openTrigger === 'onHover' && hideInfo()"
|
6
|
+
@click=";(isMobile || openTrigger === 'onClick') && toggleInfo()"
|
7
|
+
@mouseenter="!isMobile && openTrigger === 'onHover' && showInfo()"
|
8
|
+
@mouseleave="!isMobile && openTrigger === 'onHover' && hideInfo()"
|
9
9
|
>
|
10
10
|
<IconComponent
|
11
11
|
:color="iconColor"
|
@@ -157,6 +157,7 @@
|
|
157
157
|
const boxStyle = ref({})
|
158
158
|
const arrowStyle = ref({})
|
159
159
|
const wrapperStyle = ref({})
|
160
|
+
const isMobile = ref(window.innerWidth <= 768)
|
160
161
|
|
161
162
|
const textStyle = computed(() => ({
|
162
163
|
fontSize: props.image ? '12px' : '13px',
|
@@ -289,7 +290,10 @@
|
|
289
290
|
}
|
290
291
|
|
291
292
|
const handleClickOutside = (event) => {
|
292
|
-
if (
|
293
|
+
if (
|
294
|
+
(props.openTrigger === 'onClick' || isMobile.value) &&
|
295
|
+
isVisible.value
|
296
|
+
) {
|
293
297
|
const clickedElement = event.target
|
294
298
|
if (
|
295
299
|
infoBox.value &&
|
@@ -301,9 +305,14 @@
|
|
301
305
|
}
|
302
306
|
}
|
303
307
|
|
308
|
+
const handleResize = () => {
|
309
|
+
isMobile.value = window.innerWidth <= 768
|
310
|
+
updatePosition()
|
311
|
+
}
|
312
|
+
|
304
313
|
onMounted(() => {
|
305
314
|
window.addEventListener('scroll', handleScroll, { passive: true })
|
306
|
-
window.addEventListener('resize',
|
315
|
+
window.addEventListener('resize', handleResize)
|
307
316
|
document.addEventListener('scroll', handleScroll, {
|
308
317
|
passive: true,
|
309
318
|
capture: true,
|
@@ -313,7 +322,7 @@
|
|
313
322
|
|
314
323
|
onUnmounted(() => {
|
315
324
|
window.removeEventListener('scroll', handleScroll)
|
316
|
-
window.removeEventListener('resize',
|
325
|
+
window.removeEventListener('resize', handleResize)
|
317
326
|
document.removeEventListener('scroll', handleScroll, { capture: true })
|
318
327
|
document.removeEventListener('click', handleClickOutside)
|
319
328
|
})
|
@@ -341,6 +350,7 @@
|
|
341
350
|
wrapperStyle,
|
342
351
|
textStyle,
|
343
352
|
onImageLoad,
|
353
|
+
isMobile,
|
344
354
|
}
|
345
355
|
},
|
346
356
|
computed: {
|