From 151dfd8938457ac7718c384cd2304276caa9a3e3 Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Mon, 26 Jul 2021 11:03:07 +0400 Subject: [PATCH 01/10] Move storybook styles to separated file --- config/storybook/index.scss | 3 ++ config/storybook/preview.js | 1 + src/styles/common.scss | 63 ++++++++++++++++++------------------- 3 files changed, 34 insertions(+), 33 deletions(-) create mode 100644 config/storybook/index.scss diff --git a/config/storybook/index.scss b/config/storybook/index.scss new file mode 100644 index 00000000..5f7b3b62 --- /dev/null +++ b/config/storybook/index.scss @@ -0,0 +1,3 @@ +.sbdocs.sbdocs-preview div[id^='story--'] > * { + height: auto !important; +} diff --git a/config/storybook/preview.js b/config/storybook/preview.js index 14c5f9bc..1d12b586 100644 --- a/config/storybook/preview.js +++ b/config/storybook/preview.js @@ -5,6 +5,7 @@ import { DocsPage } from '@storybook/addon-docs/blocks' import ElColorPicker from 'element-ui/lib/color-picker' import '../../src/styles/index.scss' +import './index.scss' import mainStore from '../../src/store' import { ElementUIPlugin } from '../../src/plugins' diff --git a/src/styles/common.scss b/src/styles/common.scss index ed5c12c9..016330a6 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -192,11 +192,6 @@ button > span { position: relative; } -// TODO: move to separate file and import to storybook -.sbdocs.sbdocs-preview div[id^='story--'] > * { - height: auto !important; -} - @mixin res($key, $map: $--breakpoints) { @if map-has-key($map, $key) { @media only screen and #{inspect(map-get($map, $key))} { @@ -222,37 +217,39 @@ button > span { } .el-message-box { - .el-message-box__header { - .el-message-box__title { - color: var(--s-color-base-content-primary); - font-size: var(--s-heading5-font-size); - } - } - .el-message-box__btns { - button.el-button.el-button--default.el-button--small { - height: $s-size-medium; - font-size: var(--s-font-size-small); - border-radius: var(--s-border-radius-mini); - &:hover, &:active, &:focus { - color: var(--s-color-theme-accent); - background-color: var(--s-color-base-on-accent); - border-color: var(--s-color-theme-accent); + & & { + &__header { + .el-message-box__title { + color: var(--s-color-base-content-primary); + font-size: var(--s-heading5-font-size); } - &.el-button--primary { + } + &__btns { + button.el-button.el-button--default.el-button--small { + height: $s-size-medium; + font-size: var(--s-font-size-small); + border-radius: var(--s-border-radius-mini); &:hover, &:active, &:focus { - color: var(--s-color-base-on-accent); - } - &:hover { - background-color: var(--s-color-theme-accent-hover); - border-color: var(--s-color-theme-accent-hover); - } - &:active { - background-color: var(--s-color-theme-accent-pressed); - border-color: var(--s-color-theme-accent-pressed); + color: var(--s-color-theme-accent); + background-color: var(--s-color-base-on-accent); + border-color: var(--s-color-theme-accent); } - &:focus { - background-color: var(--s-color-theme-accent-focused); - border-color: var(--s-color-theme-accent-focused); + &.el-button--primary { + &:hover, &:active, &:focus { + color: var(--s-color-base-on-accent); + } + &:hover { + background-color: var(--s-color-theme-accent-hover); + border-color: var(--s-color-theme-accent-hover); + } + &:active { + background-color: var(--s-color-theme-accent-pressed); + border-color: var(--s-color-theme-accent-pressed); + } + &:focus { + background-color: var(--s-color-theme-accent-focused); + border-color: var(--s-color-theme-accent-focused); + } } } } From 8f9d7d56dc8e6286e9ca4049ffd8a350058a842a Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Mon, 26 Jul 2021 11:03:49 +0400 Subject: [PATCH 02/10] Remove status icon for form component --- src/components/Form/SForm/SForm.vue | 7 ------- src/stories/Form/SForm.stories.ts | 4 ---- 2 files changed, 11 deletions(-) diff --git a/src/components/Form/SForm/SForm.vue b/src/components/Form/SForm/SForm.vue index 613c06dc..0418a532 100644 --- a/src/components/Form/SForm/SForm.vue +++ b/src/components/Form/SForm/SForm.vue @@ -7,7 +7,6 @@ :label-width="labelWidth" :show-message="showMessage" :inline-message="inlineMessage" - :status-icon="statusIcon" :validate-on-rule-change="validateOnRuleChange" :disabled="disabled" :size="size" @@ -71,12 +70,6 @@ export default class SForm extends Vue { * `false` by default */ @Prop({ type: Boolean, default: false }) readonly inlineMessage!: boolean - /** - * Display an icon indicating the validation result. - * - * `false` by default - */ - @Prop({ type: Boolean, default: false }) readonly statusIcon!: boolean /** * Trigger validation when the `rules` property is changed. * diff --git a/src/stories/Form/SForm.stories.ts b/src/stories/Form/SForm.stories.ts index 594c1a63..ae01ad21 100644 --- a/src/stories/Form/SForm.stories.ts +++ b/src/stories/Form/SForm.stories.ts @@ -16,7 +16,6 @@ export const configurable = () => ({ :disabled="disabled" :inline="inline" :show-message="showMessage" - :status-icon="statusIcon" :rules="{ user: [ { required: true, message: 'Please input user name' }, @@ -54,9 +53,6 @@ export const configurable = () => ({ }, showMessage: { default: boolean('Show Message', true) - }, - statusIcon: { - default: boolean('Status Icon', false) } } }) From be82c8c96ec6f311e304d2eda36fe1ec8a949e8a Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Mon, 26 Jul 2021 11:04:48 +0400 Subject: [PATCH 03/10] Fix margin for form items without error message during error validation --- src/components/Form/SFormItem/SFormItem.vue | 9 +++++++++ src/styles/form.scss | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/Form/SFormItem/SFormItem.vue b/src/components/Form/SFormItem/SFormItem.vue index 6e489f15..8a46cded 100644 --- a/src/components/Form/SFormItem/SFormItem.vue +++ b/src/components/Form/SFormItem/SFormItem.vue @@ -1,6 +1,7 @@