@live-change/vue3-components 0.8.143 → 0.8.145
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/logic/ExternalLink.vue +41 -0
- package/logic/index.js +3 -1
- package/logic/locale.js +0 -2
- package/package.json +3 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a target="_blank" :href="href" @click="handleClick">
|
|
3
|
+
<slot />
|
|
4
|
+
</a>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
|
|
9
|
+
import { computed, defineProps, defineEmits, toRefs, ref } from 'vue'
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
href: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
analytics: {
|
|
17
|
+
type: Object
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const { href, analytics: analyticsEvent } = toRefs(props)
|
|
22
|
+
|
|
23
|
+
import { analytics } from "@live-change/vue3-components"
|
|
24
|
+
|
|
25
|
+
function handleClick() {
|
|
26
|
+
if(analyticsEvent.value) {
|
|
27
|
+
analytics.emit(analyticsEvent.value.event ?? 'externalLink', {
|
|
28
|
+
...analyticsEvent.value,
|
|
29
|
+
event: undefined,
|
|
30
|
+
href: href.value
|
|
31
|
+
})
|
|
32
|
+
} else {
|
|
33
|
+
analytics.emit('externalLink', { href: href.value })
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style scoped>
|
|
40
|
+
|
|
41
|
+
</style>
|
package/logic/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import Loading from "./Loading.vue"
|
|
|
2
2
|
import LoadingZone from "./LoadingZone.vue"
|
|
3
3
|
import WorkingZone from "./WorkingZone.vue"
|
|
4
4
|
import Observe from "./Observe.vue"
|
|
5
|
+
import ExternalLink from "./ExternalLink.vue"
|
|
5
6
|
|
|
6
|
-
export { Loading, LoadingZone, WorkingZone, Observe }
|
|
7
|
+
export { Loading, LoadingZone, WorkingZone, Observe, ExternalLink }
|
|
7
8
|
|
|
8
9
|
import { analytics, useAnalytics, installRouterAnalytics } from "./analytics.js"
|
|
9
10
|
export { analytics, useAnalytics, installRouterAnalytics }
|
|
@@ -22,6 +23,7 @@ function registerLogicComponents(app) {
|
|
|
22
23
|
app.component("loading-zone", LoadingZone)
|
|
23
24
|
app.component("working-zone", WorkingZone)
|
|
24
25
|
app.component("observe", Observe)
|
|
26
|
+
app.component("external-link", ExternalLink)
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export { registerLogicComponents }
|
package/logic/locale.js
CHANGED
|
@@ -169,7 +169,6 @@ function nonEmptyObject(obj) { /// because command form can add empty objects on
|
|
|
169
169
|
return obj
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
173
172
|
export function useLocale(context) {
|
|
174
173
|
context = context ?? getCurrentInstance().appContext
|
|
175
174
|
if(!context.config.globalProperties.$locale) {
|
|
@@ -177,4 +176,3 @@ export function useLocale(context) {
|
|
|
177
176
|
}
|
|
178
177
|
return context = context.config.globalProperties.$locale
|
|
179
178
|
}
|
|
180
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/vue3-components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.145",
|
|
4
4
|
"description": "Live Change Framework - vue components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-stack",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/vue3-ssr": "^0.8.
|
|
24
|
+
"@live-change/vue3-ssr": "^0.8.145",
|
|
25
25
|
"debug": "^4.3.4",
|
|
26
26
|
"mitt": "3.0.1",
|
|
27
27
|
"vue": "^3.4.29"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "fadc33dc99f47714c3d40f2ce1b5cdf3f050a70a"
|
|
30
30
|
}
|