From bf53873e468c02d986d3bba36d3998dc7253fa63 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:19:26 +0100 Subject: [PATCH 1/5] fix typescript errors --- .../Form/Elements/FormData/FormData.vue | 19 ++++++++++--------- .../Form/Elements/FormData/types.ts | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/client/src/components/Form/Elements/FormData/FormData.vue b/client/src/components/Form/Elements/FormData/FormData.vue index fcf318eed156..47b8eb3b76e8 100644 --- a/client/src/components/Form/Elements/FormData/FormData.vue +++ b/client/src/components/Form/Elements/FormData/FormData.vue @@ -16,10 +16,10 @@ import FormSelect from "@/components/Form/Elements/FormSelect.vue"; library.add(faCopy, faExclamation, faFile, faFolder, faLink, faUnlink); -interface SelectOption { +type SelectOption = { label: string; value: DataOption | null; -} +}; const props = withDefaults( defineProps<{ @@ -39,11 +39,11 @@ const props = withDefaults( loading: false, multiple: false, optional: false, - value: null, + value: undefined, extensions: () => [], type: "data", - flavor: null, - tag: null, + flavor: undefined, + tag: undefined, } ); @@ -106,7 +106,7 @@ const currentValue = computed({ return value; } } - return null; + return undefined; }, set: (val) => { $emit("input", createValue(val)); @@ -219,7 +219,7 @@ function clearHighlighting(timeout = 1000) { /** * Create final input element value */ -function createValue(val: Array | DataOption | null) { +function createValue(val?: Array | DataOption | null) { if (val) { const values = Array.isArray(val) ? val : [val]; if (variant.value && values.length > 0 && values[0]) { @@ -429,6 +429,7 @@ watch(