From 1ef8cfdec8e1d2e3a94811edafc583ddba685b56 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 28 Jun 2024 11:49:47 +0200 Subject: [PATCH] Mod text component --- resources/js/components/form/Text.vue | 187 ++++++++++---------------- 1 file changed, 74 insertions(+), 113 deletions(-) diff --git a/resources/js/components/form/Text.vue b/resources/js/components/form/Text.vue index ebb81c12..172d1f42 100644 --- a/resources/js/components/form/Text.vue +++ b/resources/js/components/form/Text.vue @@ -14,11 +14,10 @@ :min="min" :max="max" class="group-[.field-base]:h-[35px] group-[.field-sm]:h-[23px] group-[.field-base]:border-2 group-[.field-sm]:border border-gray-600 border-solid text-gray-300 bg-gray-700 leading-none rounded-lg group-[.field-base]:text-sm group-[.field-sm]:text-xs py-0 group-[.field-base]:px-2 group-[.field-sm]:px-1 w-full" - @keypress="$emit('keypress', $event)" @input="onInput" @change="onChange" - @focus="onFocus" - @blur="onBlur" + @focus="focus = true" + @blur="focus = false" />
@@ -29,8 +28,11 @@ - +const focus = ref(false); +const sizes = ref({ + sm: 'field-sm', + base: 'field-base', + lg: 'field-lg', +}); - +function onInput(v) { + if (props.mode === 'none') { + transformedValue.value = v.target.value; + } +} +