rimelight-components 1.7.8 → 1.7.9
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/module.d.mts
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -5,37 +5,37 @@ const defaultOptions = {
|
|
|
5
5
|
info: {
|
|
6
6
|
icon: "lucide:shield-alert",
|
|
7
7
|
title: "",
|
|
8
|
-
|
|
8
|
+
tooltip: ""
|
|
9
9
|
},
|
|
10
10
|
success: {
|
|
11
11
|
icon: "lucide:circle-alert",
|
|
12
12
|
title: "",
|
|
13
|
-
|
|
13
|
+
tooltip: ""
|
|
14
14
|
},
|
|
15
15
|
warning: {
|
|
16
16
|
icon: "lucide:triangle-alert",
|
|
17
17
|
title: "",
|
|
18
|
-
|
|
18
|
+
tooltip: ""
|
|
19
19
|
},
|
|
20
20
|
error: {
|
|
21
21
|
icon: "lucide:octagon-alert",
|
|
22
22
|
title: "",
|
|
23
|
-
|
|
23
|
+
tooltip: ""
|
|
24
24
|
},
|
|
25
25
|
commentary: {
|
|
26
26
|
icon: "lucide:message-circle-warning",
|
|
27
27
|
title: "",
|
|
28
|
-
|
|
28
|
+
tooltip: ""
|
|
29
29
|
},
|
|
30
30
|
ideation: {
|
|
31
31
|
icon: "lucide:badge-alert",
|
|
32
32
|
title: "",
|
|
33
|
-
|
|
33
|
+
tooltip: ""
|
|
34
34
|
},
|
|
35
35
|
source: {
|
|
36
36
|
icon: "lucide:book-alert",
|
|
37
37
|
title: "",
|
|
38
|
-
|
|
38
|
+
tooltip: ""
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useAppConfig } from "#imports";
|
|
3
|
-
import { computed } from "#imports";
|
|
3
|
+
import { computed, defineAsyncComponent } from "#imports";
|
|
4
4
|
const appConfig = useAppConfig();
|
|
5
5
|
const {
|
|
6
6
|
variant,
|
|
@@ -21,10 +21,34 @@ const config = computed(() => {
|
|
|
21
21
|
const icon = computed(() => config.value.icon);
|
|
22
22
|
const title = computed(() => config.value.title);
|
|
23
23
|
const tooltip = computed(() => config.value.tooltip);
|
|
24
|
+
const RootComponent = computed(
|
|
25
|
+
() => to ? resolveComponent("NuxtLink") : "div"
|
|
26
|
+
);
|
|
27
|
+
const rootProps = computed(() => {
|
|
28
|
+
const commonClasses = {
|
|
29
|
+
class: "w-full block"
|
|
30
|
+
};
|
|
31
|
+
if (to) {
|
|
32
|
+
return {
|
|
33
|
+
...commonClasses,
|
|
34
|
+
to,
|
|
35
|
+
target: target || void 0
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return commonClasses;
|
|
39
|
+
});
|
|
40
|
+
const resolveComponent = (name) => {
|
|
41
|
+
if (name === "NuxtLink") {
|
|
42
|
+
return defineAsyncComponent(
|
|
43
|
+
() => import("#components").then((m) => m.NuxtLink || m.default)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return name;
|
|
47
|
+
};
|
|
24
48
|
</script>
|
|
25
49
|
|
|
26
50
|
<template>
|
|
27
|
-
<
|
|
51
|
+
<component :is="RootComponent" v-bind="rootProps">
|
|
28
52
|
<UAlert
|
|
29
53
|
:title="$t(title)"
|
|
30
54
|
:color="variant"
|
|
@@ -45,5 +69,5 @@ const tooltip = computed(() => config.value.tooltip);
|
|
|
45
69
|
</UTooltip>
|
|
46
70
|
</template>
|
|
47
71
|
</UAlert>
|
|
48
|
-
</
|
|
72
|
+
</component>
|
|
49
73
|
</template>
|