From b1455db5d3850dd0ea8c02f4a41ddfca60ab828f Mon Sep 17 00:00:00 2001 From: saveliy Date: Sun, 17 Sep 2023 07:34:22 -0700 Subject: [PATCH 1/7] fix(Range): add default size --- src/runtime/components/forms/Range.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/forms/Range.vue b/src/runtime/components/forms/Range.vue index b8ae37f59d..beb0ce8dc2 100644 --- a/src/runtime/components/forms/Range.vue +++ b/src/runtime/components/forms/Range.vue @@ -89,7 +89,16 @@ export default defineComponent({ const { emitFormChange, formGroup } = useFormGroup() const color = computed(() => formGroup?.error?.value ? 'red' : props.color) - const size = computed(() => formGroup?.size?.value ?? props.size) + const size = computed(() => { + const size = formGroup?.size?.value ?? props.size + if (!ui.value.size[size.value] || + !ui.value.thumb[size.value] || + !ui.value.track[size.value] || + !ui.value.progress[size.value]) { + return appConfig.ui.range.default.size + } + return size + }) const value = computed({ get () { From d0afcd9afed28a40df17172b41562ba6c432f03f Mon Sep 17 00:00:00 2001 From: saveliy Date: Tue, 19 Sep 2023 10:03:25 -0700 Subject: [PATCH 2/7] fix(Range): fix default size --- src/runtime/components/forms/Range.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/runtime/components/forms/Range.vue b/src/runtime/components/forms/Range.vue index beb0ce8dc2..c50f908d51 100644 --- a/src/runtime/components/forms/Range.vue +++ b/src/runtime/components/forms/Range.vue @@ -91,10 +91,7 @@ export default defineComponent({ const color = computed(() => formGroup?.error?.value ? 'red' : props.color) const size = computed(() => { const size = formGroup?.size?.value ?? props.size - if (!ui.value.size[size.value] || - !ui.value.thumb[size.value] || - !ui.value.track[size.value] || - !ui.value.progress[size.value]) { + if (!ui.value.size[size.value]) { return appConfig.ui.range.default.size } return size From c3c87d7f68e667d0f8bd42ded4e7205a6cc9b9fd Mon Sep 17 00:00:00 2001 From: saveliy Date: Thu, 21 Sep 2023 08:57:16 -0700 Subject: [PATCH 3/7] fix(Range): set default size --- src/runtime/components/forms/Range.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/components/forms/Range.vue b/src/runtime/components/forms/Range.vue index c50f908d51..c33705d3eb 100644 --- a/src/runtime/components/forms/Range.vue +++ b/src/runtime/components/forms/Range.vue @@ -92,7 +92,7 @@ export default defineComponent({ const size = computed(() => { const size = formGroup?.size?.value ?? props.size if (!ui.value.size[size.value]) { - return appConfig.ui.range.default.size + return props.size } return size }) From f427c8c265bde97fd6e365187d923b4a157d4bf6 Mon Sep 17 00:00:00 2001 From: saveliy Date: Fri, 22 Sep 2023 08:25:03 -0700 Subject: [PATCH 4/7] fix(Range): defaul size --- src/runtime/components/forms/Range.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/components/forms/Range.vue b/src/runtime/components/forms/Range.vue index 3f6ac60792..89dcb0da68 100644 --- a/src/runtime/components/forms/Range.vue +++ b/src/runtime/components/forms/Range.vue @@ -93,7 +93,7 @@ export default defineComponent({ const { ui, attrs, attrsClass } = useUI('range', props.ui, config) const { emitFormChange, inputId, color, size: formGroupSize, name } = useFormGroup(props, config) - const size = computed(() => ui.value.size[formGroupSize] ? formGroupSize : config.default?.size) + const size = computed(() => ui.value.size[formGroupSize] ? formGroupSize : (props.size ?? config.default?.size)) const value = computed({ get () { From 2a6b4f731ee19b5a730f07bb62de84b3c2adf411 Mon Sep 17 00:00:00 2001 From: saveliy Date: Fri, 22 Sep 2023 16:17:46 -0700 Subject: [PATCH 5/7] fix(Range): adjust useFormGroup size var --- src/runtime/components/forms/Range.vue | 3 +-- src/runtime/composables/useFormGroup.ts | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/components/forms/Range.vue b/src/runtime/components/forms/Range.vue index 89dcb0da68..0477ad2e7e 100644 --- a/src/runtime/components/forms/Range.vue +++ b/src/runtime/components/forms/Range.vue @@ -92,8 +92,7 @@ export default defineComponent({ setup (props, { emit }) { const { ui, attrs, attrsClass } = useUI('range', props.ui, config) - const { emitFormChange, inputId, color, size: formGroupSize, name } = useFormGroup(props, config) - const size = computed(() => ui.value.size[formGroupSize] ? formGroupSize : (props.size ?? config.default?.size)) + const { emitFormChange, inputId, color, size, name } = useFormGroup(props, ui) const value = computed({ get () { diff --git a/src/runtime/composables/useFormGroup.ts b/src/runtime/composables/useFormGroup.ts index 2e54a8378a..a7a86a1d67 100644 --- a/src/runtime/composables/useFormGroup.ts +++ b/src/runtime/composables/useFormGroup.ts @@ -44,7 +44,10 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => { return { inputId: computed(() => inputProps.id ?? formGroup?.inputId.value), name: computed(() => inputProps?.name ?? formGroup?.name.value), - size: computed(() => inputProps?.size ?? formGroup?.size.value ?? config?.default?.size), + size: computed(() => { + const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null + return inputProps?.size ?? formGroupSize ?? config?.default?.size + }), color: computed(() => formGroup?.error?.value ? 'red' : inputProps?.color), emitFormBlur, emitFormInput, From a66e345e732655ebd39cc9749b06c9ac1af0f779 Mon Sep 17 00:00:00 2001 From: Levy <56026608+Levy-from-Odessa@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:36:25 +0300 Subject: [PATCH 6/7] Update src/runtime/composables/useFormGroup.ts Co-authored-by: Sma11X <540351143@qq.com> --- src/runtime/composables/useFormGroup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/composables/useFormGroup.ts b/src/runtime/composables/useFormGroup.ts index a7a86a1d67..d5a1a45ddb 100644 --- a/src/runtime/composables/useFormGroup.ts +++ b/src/runtime/composables/useFormGroup.ts @@ -44,7 +44,7 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => { return { inputId: computed(() => inputProps.id ?? formGroup?.inputId.value), name: computed(() => inputProps?.name ?? formGroup?.name.value), - size: computed(() => { + size: computed(() => inputProps?.size ?? config.size[formGroup?.size.value] ? formGroup?.size.value : config?.default?.size), const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null return inputProps?.size ?? formGroupSize ?? config?.default?.size }), From aafb767a56f3b4ab6e9b46912eabd02260bed067 Mon Sep 17 00:00:00 2001 From: saveliy Date: Mon, 2 Oct 2023 10:49:08 -0700 Subject: [PATCH 7/7] fix(Range): default size --- src/runtime/components/forms/Range.vue | 2 +- src/runtime/composables/useFormGroup.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/components/forms/Range.vue b/src/runtime/components/forms/Range.vue index 0477ad2e7e..17dd045054 100644 --- a/src/runtime/components/forms/Range.vue +++ b/src/runtime/components/forms/Range.vue @@ -92,7 +92,7 @@ export default defineComponent({ setup (props, { emit }) { const { ui, attrs, attrsClass } = useUI('range', props.ui, config) - const { emitFormChange, inputId, color, size, name } = useFormGroup(props, ui) + const { emitFormChange, inputId, color, size, name } = useFormGroup(props, config) const value = computed({ get () { diff --git a/src/runtime/composables/useFormGroup.ts b/src/runtime/composables/useFormGroup.ts index d5a1a45ddb..a7a86a1d67 100644 --- a/src/runtime/composables/useFormGroup.ts +++ b/src/runtime/composables/useFormGroup.ts @@ -44,7 +44,7 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => { return { inputId: computed(() => inputProps.id ?? formGroup?.inputId.value), name: computed(() => inputProps?.name ?? formGroup?.name.value), - size: computed(() => inputProps?.size ?? config.size[formGroup?.size.value] ? formGroup?.size.value : config?.default?.size), + size: computed(() => { const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null return inputProps?.size ?? formGroupSize ?? config?.default?.size }),