@meistrari/tela-build 1.59.1 → 1.60.0
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.
|
@@ -57,7 +57,20 @@ onBeforeUnmount(() => {
|
|
|
57
57
|
})
|
|
58
58
|
|
|
59
59
|
function handleInteractOutside(event: CustomEvent) {
|
|
60
|
-
|
|
60
|
+
const originalEvent = (event.detail as { originalEvent?: Event } | undefined)?.originalEvent
|
|
61
|
+
|
|
62
|
+
if (originalEvent?.type !== 'pointerdown') {
|
|
63
|
+
event.preventDefault()
|
|
64
|
+
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const target = event.target
|
|
69
|
+
|
|
70
|
+
if (!(target instanceof Element))
|
|
71
|
+
return
|
|
72
|
+
|
|
73
|
+
if (!target.isConnected || target.closest('[data-reka-popper-content-wrapper], [data-dismissable-layer]'))
|
|
61
74
|
event.preventDefault()
|
|
62
75
|
}
|
|
63
76
|
|
|
@@ -84,6 +97,7 @@ function focusEditor(event: Event) {
|
|
|
84
97
|
|
|
85
98
|
range.selectNodeContents(editor)
|
|
86
99
|
range.collapse(false)
|
|
100
|
+
|
|
87
101
|
selection.removeAllRanges()
|
|
88
102
|
selection.addRange(range)
|
|
89
103
|
})
|
|
@@ -110,6 +124,7 @@ function focusEditor(event: Event) {
|
|
|
110
124
|
)"
|
|
111
125
|
@open-auto-focus="focusEditor"
|
|
112
126
|
@interact-outside="handleInteractOutside"
|
|
127
|
+
@focus-outside.prevent
|
|
113
128
|
>
|
|
114
129
|
<slot />
|
|
115
130
|
</TelaPopoverContent>
|
|
@@ -15,6 +15,10 @@ const props = withDefaults(defineProps<{
|
|
|
15
15
|
isHovered: undefined,
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
+
const emit = defineEmits<{
|
|
19
|
+
copy: []
|
|
20
|
+
}>()
|
|
21
|
+
|
|
18
22
|
const showConfirmationIcon = ref(false)
|
|
19
23
|
|
|
20
24
|
const variantStyles = computed(() => ({
|
|
@@ -44,6 +48,7 @@ function onClick(copyFn: (content: string) => void) {
|
|
|
44
48
|
showConfirmationIcon.value = true
|
|
45
49
|
|
|
46
50
|
copyFn(props.content)
|
|
51
|
+
emit('copy')
|
|
47
52
|
|
|
48
53
|
setTimeout(() => {
|
|
49
54
|
showConfirmationIcon.value = false
|