remove component scope

This commit is contained in:
Laila Los
2022-12-08 14:05:53 +01:00
parent 2235366ce3
commit 2c6f825c6d
2 changed files with 15 additions and 21 deletions
@@ -6,15 +6,17 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { useUserTags } from "composables/user";
import { useToast } from "composables/toast";
import { useUid } from "composables/utils/uid";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faTags, faCheck, faTimes, faPlus } from "@fortawesome/free-solid-svg-icons";
import type { Ref } from "vue";
export interface StatelessTagsProps {
value: string[];
disabled: boolean;
clickable: boolean;
useToggleLink: boolean;
maxVisibleTags: number;
value?: string[];
disabled?: boolean;
clickable?: boolean;
useToggleLink?: boolean;
maxVisibleTags?: number;
}
const props = withDefaults(defineProps<StatelessTagsProps>(), {
@@ -30,6 +32,9 @@ const emit = defineEmits<{
(e: "tag-click", tag: string): void;
}>();
//@ts-ignore bad library types
library.add(faTags, faCheck, faTimes, faPlus);
const { userTags, addLocalTag } = useUserTags();
const { warning } = useToast();
@@ -108,14 +113,6 @@ function onTagClicked(tag: string) {
}
</script>
<script lang="ts">
import { library } from "@fortawesome/fontawesome-svg-core";
import { faTags, faCheck, faTimes, faPlus } from "@fortawesome/free-solid-svg-icons";
//@ts-ignore bad library types
library.add(faTags, faCheck, faTimes, faPlus);
</script>
<template>
<div class="stateless-tags px-1">
<Multiselect
@@ -2,6 +2,8 @@
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { keyedColorScheme } from "utils/color";
import { computed } from "vue";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faTimes } from "@fortawesome/free-solid-svg-icons";
export interface TagProps {
option: string;
@@ -17,6 +19,9 @@ const emit = defineEmits<{
(e: "deleted", tag: string): void;
}>();
//@ts-ignore bad types
library.add(faTimes);
const color = computed(() => keyedColorScheme(props.option));
function onClick() {
@@ -31,14 +36,6 @@ const named = computed(() => props.option?.startsWith("#"));
const searched = computed(() => props.option?.toLowerCase() === props.search?.toLowerCase());
</script>
<script lang="ts">
import { library } from "@fortawesome/fontawesome-svg-core";
import { faTimes } from "@fortawesome/free-solid-svg-icons";
//@ts-ignore bad library types
library.add(faTimes);
</script>
<template>
<div
class="tag btn-transparent-background"