From e8b1f0a854c939ddd5b42d12a947f0e429c8ec11 Mon Sep 17 00:00:00 2001 From: Vasiliy Rusin Date: Thu, 23 Jun 2022 18:27:16 +0700 Subject: [PATCH 1/3] feat(QCascade): fix types --- .../QCascader/src/QCascaderColumn/QCascaderColumn.vue | 4 ++-- .../QCascader/src/QCascaderInput/QCascaderInput.vue | 2 +- src/qComponents/QCascader/src/QCascaderInput/types.ts | 2 +- src/qComponents/QCascader/src/QCascaderRow/QCascaderRow.vue | 2 +- src/qComponents/QInput/src/QInput.vue | 5 +++-- src/qComponents/QInput/src/types.ts | 3 ++- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue b/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue index 87e29cd4..fe2a7913 100644 --- a/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue +++ b/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue @@ -6,8 +6,8 @@ >(() => { + const value = computed>(() => { const modelValue = qCascader.modelValue.value; if (Array.isArray(modelValue)) return null; diff --git a/src/qComponents/QCascader/src/QCascaderInput/types.ts b/src/qComponents/QCascader/src/QCascaderInput/types.ts index 465087bc..442f0a24 100644 --- a/src/qComponents/QCascader/src/QCascaderInput/types.ts +++ b/src/qComponents/QCascader/src/QCascaderInput/types.ts @@ -3,7 +3,7 @@ import type { Ref, ComputedRef } from 'vue'; import type { Nullable } from '#/helpers'; export interface QCascaderInputInstance { - value: ComputedRef>; + value: ComputedRef>; multiple: Ref>; disabled: ComputedRef; placeholder: ComputedRef>; diff --git a/src/qComponents/QCascader/src/QCascaderRow/QCascaderRow.vue b/src/qComponents/QCascader/src/QCascaderRow/QCascaderRow.vue index 0eb83862..d1701786 100644 --- a/src/qComponents/QCascader/src/QCascaderRow/QCascaderRow.vue +++ b/src/qComponents/QCascader/src/QCascaderRow/QCascaderRow.vue @@ -3,7 +3,7 @@ :id="uniqueId" :class="rootClasses" role="menuitem" - :tabindex="row.disabled ? false : -1" + :tabindex="row.disabled ? undefined : -1" @click="handleClick" @keyup.right="handleRightKeyUp" @keyup.enter="handleEnterKeyUp" diff --git a/src/qComponents/QInput/src/QInput.vue b/src/qComponents/QInput/src/QInput.vue index 9e2c33ba..5239cfb4 100644 --- a/src/qComponents/QInput/src/QInput.vue +++ b/src/qComponents/QInput/src/QInput.vue @@ -78,7 +78,8 @@ import type { QInputPropRootClass, QInputProps, QInputState, - QInputClass + QInputClass, + QInputPropModelValue } from './types'; export default defineComponent({ @@ -92,7 +93,7 @@ export default defineComponent({ * default to v-model */ modelValue: { - type: String, + type: String as PropType, default: null }, /** diff --git a/src/qComponents/QInput/src/types.ts b/src/qComponents/QInput/src/types.ts index 652aeda3..6f187883 100644 --- a/src/qComponents/QInput/src/types.ts +++ b/src/qComponents/QInput/src/types.ts @@ -5,10 +5,11 @@ import type { Nullable } from '#/helpers'; type Classes = Record; export type QInputClass = Nullable; +export type QInputPropModelValue = Nullable; export type QInputPropRootClass = QInputClass; export interface QInputProps { - modelValue: Nullable; + modelValue: QInputPropModelValue; disabled: Nullable; showSymbolLimit: Nullable; validateEvent: Nullable; From 120a5e15068b7b0c238f466daf3ffce672d56189 Mon Sep 17 00:00:00 2001 From: Vasiliy Rusin Date: Thu, 23 Jun 2022 18:29:42 +0700 Subject: [PATCH 2/3] feat(QCascade): revert fix types --- src/qComponents/QInput/src/QInput.vue | 5 ++--- src/qComponents/QInput/src/types.ts | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qComponents/QInput/src/QInput.vue b/src/qComponents/QInput/src/QInput.vue index 5239cfb4..9e2c33ba 100644 --- a/src/qComponents/QInput/src/QInput.vue +++ b/src/qComponents/QInput/src/QInput.vue @@ -78,8 +78,7 @@ import type { QInputPropRootClass, QInputProps, QInputState, - QInputClass, - QInputPropModelValue + QInputClass } from './types'; export default defineComponent({ @@ -93,7 +92,7 @@ export default defineComponent({ * default to v-model */ modelValue: { - type: String as PropType, + type: String, default: null }, /** diff --git a/src/qComponents/QInput/src/types.ts b/src/qComponents/QInput/src/types.ts index 6f187883..652aeda3 100644 --- a/src/qComponents/QInput/src/types.ts +++ b/src/qComponents/QInput/src/types.ts @@ -5,11 +5,10 @@ import type { Nullable } from '#/helpers'; type Classes = Record; export type QInputClass = Nullable; -export type QInputPropModelValue = Nullable; export type QInputPropRootClass = QInputClass; export interface QInputProps { - modelValue: QInputPropModelValue; + modelValue: Nullable; disabled: Nullable; showSymbolLimit: Nullable; validateEvent: Nullable; From e92dad25b144e35647dd26b41bf6bf9222b77c17 Mon Sep 17 00:00:00 2001 From: Vasiliy Rusin Date: Thu, 23 Jun 2022 20:34:50 +0700 Subject: [PATCH 3/3] feat(QCascade): remove quotes --- .../QCascader/src/QCascaderColumn/QCascaderColumn.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue b/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue index fe2a7913..87e29cd4 100644 --- a/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue +++ b/src/qComponents/QCascader/src/QCascaderColumn/QCascaderColumn.vue @@ -6,8 +6,8 @@