From 7af707538f265258e4ab07a3f8002d2c106e8b87 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 16 Apr 2022 10:07:51 +0200 Subject: [PATCH] rework inputs, again... hopefully this is the last time, but code wise its nicer now and structure wise we can now have elements "inside" of the input for counter, loading, etc --- frontend-new/src/components/ui/InputDate.vue | 8 +++- frontend-new/src/components/ui/InputFile.vue | 8 +++- .../src/components/ui/InputSelect.vue | 22 ++++----- frontend-new/src/components/ui/InputTag.vue | 41 +++++++++------- frontend-new/src/components/ui/InputText.vue | 23 +++++---- .../src/components/ui/InputTextarea.vue | 26 +++++----- .../src/components/ui/InputWrapper.vue | 47 +++++++++++++++++++ .../src/composables/useInputHelper.ts | 31 ------------ .../src/composables/useValidationHelpers.ts | 5 +- 9 files changed, 125 insertions(+), 86 deletions(-) create mode 100644 frontend-new/src/components/ui/InputWrapper.vue delete mode 100644 frontend-new/src/composables/useInputHelper.ts diff --git a/frontend-new/src/components/ui/InputDate.vue b/frontend-new/src/components/ui/InputDate.vue index fb33c18e..97357cd2 100644 --- a/frontend-new/src/components/ui/InputDate.vue +++ b/frontend-new/src/components/ui/InputDate.vue @@ -2,6 +2,7 @@ import { computed } from "vue"; import { useValidation } from "~/composables/useValidationHelpers"; import { ValidationRule } from "@vuelidate/core"; +import InputWrapper from "~/components/ui/InputWrapper.vue"; const emit = defineEmits<{ (e: "update:modelValue", date: string): void; @@ -14,6 +15,7 @@ const props = defineProps<{ modelValue: string; label?: string; disabled?: boolean; + loading?: boolean; errorMessages?: string[]; rules?: ValidationRule[]; }>(); @@ -22,6 +24,8 @@ const { v, errors, hasError } = useValidation(props.label, props.rules, date, pr diff --git a/frontend-new/src/components/ui/InputFile.vue b/frontend-new/src/components/ui/InputFile.vue index 21e56efb..e7ddd52a 100644 --- a/frontend-new/src/components/ui/InputFile.vue +++ b/frontend-new/src/components/ui/InputFile.vue @@ -2,6 +2,7 @@ import { computed } from "vue"; import { useValidation } from "~/composables/useValidationHelpers"; import { ValidationRule } from "@vuelidate/core"; +import InputWrapper from "~/components/ui/InputWrapper.vue"; const emit = defineEmits<{ (e: "update:modelValue", file: string): void; @@ -15,6 +16,7 @@ const props = defineProps<{ label?: string; disabled?: boolean; showSize?: boolean; + loading?: boolean; errorMessages?: string[]; rules?: ValidationRule[]; }>(); @@ -23,6 +25,8 @@ const { v, errors, hasError } = useValidation(props.label, props.rules, file, pr diff --git a/frontend-new/src/components/ui/InputSelect.vue b/frontend-new/src/components/ui/InputSelect.vue index b028b229..b1338058 100644 --- a/frontend-new/src/components/ui/InputSelect.vue +++ b/frontend-new/src/components/ui/InputSelect.vue @@ -1,9 +1,8 @@ diff --git a/frontend-new/src/components/ui/InputTag.vue b/frontend-new/src/components/ui/InputTag.vue index 1090f4b9..92750197 100644 --- a/frontend-new/src/components/ui/InputTag.vue +++ b/frontend-new/src/components/ui/InputTag.vue @@ -1,9 +1,8 @@ diff --git a/frontend-new/src/components/ui/InputText.vue b/frontend-new/src/components/ui/InputText.vue index 87e7a275..3f712688 100644 --- a/frontend-new/src/components/ui/InputText.vue +++ b/frontend-new/src/components/ui/InputText.vue @@ -1,9 +1,8 @@ diff --git a/frontend-new/src/components/ui/InputTextarea.vue b/frontend-new/src/components/ui/InputTextarea.vue index 27cd9052..87b2a396 100644 --- a/frontend-new/src/components/ui/InputTextarea.vue +++ b/frontend-new/src/components/ui/InputTextarea.vue @@ -1,9 +1,8 @@