From 5b2f6e44b118bd67f811e2d71cb018776c2154bc Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 28 Jul 2023 14:06:27 +1000 Subject: [PATCH] fix label padding --- resources/js/components/SMCheckbox.vue | 30 +++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/resources/js/components/SMCheckbox.vue b/resources/js/components/SMCheckbox.vue index 991a47e..c13697b 100644 --- a/resources/js/components/SMCheckbox.vue +++ b/resources/js/components/SMCheckbox.vue @@ -33,9 +33,15 @@ 'rotate-45', disabled ? 'border-gray' : 'border-sky-5', ]"> {{ - label - }}{{ label }}

@@ -125,21 +131,21 @@ const label = ref( ? props.label : typeof props.control == "string" ? toTitleCase(props.control) - : "" + : "", ); const value = ref( props.modelValue != undefined ? props.modelValue : control != null ? control.value - : "" + : "", ); const id = ref( props.id != undefined ? props.id : typeof props.control == "string" && props.control.length > 0 ? props.control - : generateRandomElementId() + : generateRandomElementId(), ); const feedbackInvalid = ref(props.feedbackInvalid); const active = ref(value.value?.toString().length ?? 0 > 0); @@ -161,7 +167,7 @@ watch( () => value.value, (newValue) => { active.value = newValue.toString().length > 0 || focused.value == true; - } + }, ); if (props.modelValue != undefined) { @@ -169,7 +175,7 @@ if (props.modelValue != undefined) { () => props.modelValue, (newValue) => { value.value = newValue; - } + }, ); } @@ -177,14 +183,14 @@ watch( () => props.feedbackInvalid, (newValue) => { feedbackInvalid.value = newValue; - } + }, ); watch( () => props.disabled, (newValue) => { disabled.value = newValue; - } + }, ); if (typeof control === "object" && control !== null) { @@ -195,7 +201,7 @@ if (typeof control === "object" && control !== null) { ? "" : control.validation.result.invalidMessages[0]; }, - { deep: true } + { deep: true }, ); watch( @@ -203,7 +209,7 @@ if (typeof control === "object" && control !== null) { (newValue) => { value.value = newValue; }, - { deep: true } + { deep: true }, ); }