From 9d1e98552413d3d76e40abfc3c05e808972aa133 Mon Sep 17 00:00:00 2001 From: Sacha STAFYNIAK Date: Sat, 14 Oct 2023 14:34:42 +0200 Subject: [PATCH] fix: improve checkbox typing --- .playground/pages/tests/form/input-models.vue | 29 +++++++++++++++---- components/form/BaseCheckbox.vue | 21 +++++++++----- components/form/BaseCheckboxAnimated.vue | 26 ++++++++++------- components/form/BaseCheckboxHeadless.vue | 29 ++++++++++++------- components/form/BaseListbox.vue | 2 +- 5 files changed, 72 insertions(+), 35 deletions(-) diff --git a/.playground/pages/tests/form/input-models.vue b/.playground/pages/tests/form/input-models.vue index 686b5237..57d75b72 100644 --- a/.playground/pages/tests/form/input-models.vue +++ b/.playground/pages/tests/form/input-models.vue @@ -8,16 +8,16 @@ definePageMeta({ const autocomplete1 = ref() const autocomplete2 = ref<{ name: string }>() -const checkbox1 = ref() -const checkbox2 = ref() -const checkbox3 = ref([]) +const checkbox1 = ref() +const checkbox2 = ref<{ checked: boolean }>() +const checkbox3 = ref([]) const radio1 = ref() const radio2 = ref() const radio3 = ref<{ [key: string]: number }>() const checkboxCustom1 = ref() const radioCustom1 = ref<'yes' | 'no'>() -const animatedCheckbox1 = ref() -const animatedCheckbox2 = ref([]) +const animatedCheckbox1 = ref() +const animatedCheckbox2 = ref([]) const switchBall = ref() const switchThin = ref() const input1 = ref() @@ -32,6 +32,7 @@ const select1 = ref() const select2 = ref() const textarea1 = ref() const textarea2 = ref() +const textarea3 = ref() diff --git a/components/form/BaseCheckbox.vue b/components/form/BaseCheckbox.vue index e3034555..019e6871 100644 --- a/components/form/BaseCheckbox.vue +++ b/components/form/BaseCheckbox.vue @@ -1,4 +1,4 @@ -