From 61451f64694d8f0ddf77dc858065727271729699 Mon Sep 17 00:00:00 2001 From: smithoo Date: Wed, 11 Sep 2024 11:23:40 +0900 Subject: [PATCH] fix(VsStepper): apply index-selector-composable (#280) --- .../src/components/vs-stepper/VsStepper.scss | 24 +- .../src/components/vs-stepper/VsStepper.vue | 155 ++---- .../vs-stepper/__tests__/vs-stepper.test.ts | 457 ++++++++++++++---- .../vlossom/src/components/vs-tabs/VsTabs.vue | 113 +---- .../vs-tabs/__tests__/vs-tabs.test.ts | 2 +- .../index-selector-composable.test.ts | 233 +++++++++ .../composables/index-selector-composable.ts | 121 +++++ packages/vlossom/src/composables/index.ts | 1 + 8 files changed, 793 insertions(+), 313 deletions(-) create mode 100644 packages/vlossom/src/composables/__tests__/index-selector-composable.test.ts create mode 100644 packages/vlossom/src/composables/index-selector-composable.ts diff --git a/packages/vlossom/src/components/vs-stepper/VsStepper.scss b/packages/vlossom/src/components/vs-stepper/VsStepper.scss index 81a8b5c83..1de7b9e7a 100644 --- a/packages/vlossom/src/components/vs-stepper/VsStepper.scss +++ b/packages/vlossom/src/components/vs-stepper/VsStepper.scss @@ -7,7 +7,7 @@ $stepButtonW: var(--vs-stepper-stepSize, 2.4rem); position: relative; -webkit-tap-highlight-color: transparent; - .vs-item-line { + .vs-step-line { background-color: var(--vs-area-bg-active); height: 0.3rem; left: $stepButtonW; @@ -16,7 +16,7 @@ $stepButtonW: var(--vs-stepper-stepSize, 2.4rem); top: 50%; transform: translateY(-50%); - .vs-progress-line { + .vs-step-progress { background-color: var(--vs-stepper-activeColor, var(--vs-primary-comp-bg-active)); height: 100%; opacity: 0.8; @@ -33,7 +33,11 @@ $stepButtonW: var(--vs-stepper-stepSize, 2.4rem); list-style: none; margin-bottom: 4rem; - .vs-step { + &.vs-stepper-no-label { + margin-bottom: 0; + } + + .vs-step-item { align-items: center; cursor: pointer; display: flex; @@ -41,7 +45,7 @@ $stepButtonW: var(--vs-stepper-stepSize, 2.4rem); justify-content: center; position: relative; - .vs-item-step { + .vs-step-num { align-items: center; background-color: var(--vs-comp-bg); color: var(--vs-comp-font); @@ -67,7 +71,7 @@ $stepButtonW: var(--vs-stepper-stepSize, 2.4rem); } } - .vs-item-name { + .vs-step-label { color: var(--vs-stepper-labelFontColor, var(--vs-font-color)); font-size: $fontSize; font-weight: 400; @@ -83,28 +87,30 @@ $stepButtonW: var(--vs-stepper-stepSize, 2.4rem); } &.vs-previous { - .vs-item-step { + .vs-step-num { border: var(--vs-stepper-activeColor, var(--vs-primary-comp-bg)); background-color: var(--vs-stepper-activeBackgroundColor, var(--vs-primary-comp-bg)); color: var(--vs-primary-comp-font); } - .vs-item-name { + .vs-step-label { color: var(--vs-stepper-labelFontColor, var(--vs-primary-comp-bg-active)); } } &.vs-selected { - .vs-item-step { + .vs-step-num { border: 1px solid var(--vs-stepper-activeColor, var(--vs-primary-comp-bg)); background-color: var(--vs-stepper-activeBackgroundColor, var(--vs-primary-comp-bg)); color: var(--vs-primary-comp-font); outline: 3px solid var(--vs-primary-comp-bg); outline-offset: 3px; + transition: outline; + transition-delay: 0.15s; } - .vs-item-name { + .vs-step-label { font-weight: 600; color: var(--vs-stepper-labelFontColor, var(--vs-primary-comp-bg)); } diff --git a/packages/vlossom/src/components/vs-stepper/VsStepper.vue b/packages/vlossom/src/components/vs-stepper/VsStepper.vue index 18d9ca747..5e8966e54 100644 --- a/packages/vlossom/src/components/vs-stepper/VsStepper.vue +++ b/packages/vlossom/src/components/vs-stepper/VsStepper.vue @@ -1,15 +1,15 @@