From b85dbed88fef5728ce20964965864daecf53a661 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Fri, 6 Nov 2020 15:52:43 +0500 Subject: [PATCH 1/5] Add suffix, prefix and size for input --- src/components/Input/SInput.vue | 32 ++++++++++++++++++++++++++++++-- src/components/Input/consts.ts | 5 +++++ src/components/Input/index.ts | 4 ++-- src/stories/SInput.stories.ts | 14 +++++++++++++- src/styles/input.scss | 12 ++++++++++++ 5 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/components/Input/SInput.vue b/src/components/Input/SInput.vue index 757b52e3..2f933130 100644 --- a/src/components/Input/SInput.vue +++ b/src/components/Input/SInput.vue @@ -3,7 +3,7 @@ class="s-input" :class="computedClasses" > - {{ placeholder }} + {{ placeholder }} ({ :readonly="readonly" :show-text-limit="showTextLimit" :maxlength="maxlength" + :size="size" + :prefix="prefix" + :suffix="prefix" />`, data: () => ({ input: '' @@ -29,9 +32,18 @@ export const configurable = () => ({ type: { default: select('Type', Object.values(InputType), InputType.TEXT) }, + size: { + default: select('Size', Object.values(InputSize), InputSize.MEDIUM) + }, placeholder: { default: text('Placeholder', 'Placeholder') }, + prefix: { + default: text('Prefix icon', 'el-icon-search') + }, + suffix: { + default: text('Suffix icon', 'el-icon-search') + }, disabled: { default: boolean('Disabled', false) }, diff --git a/src/styles/input.scss b/src/styles/input.scss index 85ff393a..12564a8a 100644 --- a/src/styles/input.scss +++ b/src/styles/input.scss @@ -55,6 +55,18 @@ border-color: var(--s-color-base-background-hover); } } + &.s-size-small { + min-height: $s-size-medium; + + .el-input, + .el-textarea { + height: 100%; + > input, + > textarea { + height: $s-size-medium; + } + } + } &.s-focused { .s-placeholder, .el-input > input, From 3b531982bee082ab570fe205b60ed421afef7572 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Fri, 6 Nov 2020 15:53:10 +0500 Subject: [PATCH 2/5] Update version to 0.5.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ebe581b..e639ba48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.5.4", + "version": "0.5.5", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/" From ba5194bcd168cb10a3186dfa70ef5c8d1d1c701a Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Fri, 6 Nov 2020 15:59:42 +0500 Subject: [PATCH 3/5] Add comments for use prefix --- src/components/Input/SInput.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Input/SInput.vue b/src/components/Input/SInput.vue index 2f933130..2b943879 100644 --- a/src/components/Input/SInput.vue +++ b/src/components/Input/SInput.vue @@ -3,7 +3,7 @@ class="s-input" :class="computedClasses" > - {{ placeholder }} + {{ placeholder }} { const cssClasses: Array = [] if (this.focused) { From f0a3b3ea2de8578d4db55b63384c12cd9dfdd212 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Fri, 6 Nov 2020 16:22:11 +0500 Subject: [PATCH 4/5] Replace medium with big, small with medium --- src/components/Input/SInput.vue | 18 +++++++++--------- src/components/Input/consts.ts | 4 ++-- src/stories/SInput.stories.ts | 2 +- src/styles/input.scss | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/Input/SInput.vue b/src/components/Input/SInput.vue index 2b943879..4aa83ac4 100644 --- a/src/components/Input/SInput.vue +++ b/src/components/Input/SInput.vue @@ -3,7 +3,7 @@ class="s-input" :class="computedClasses" > - {{ placeholder }} + {{ placeholder }} { @@ -195,9 +195,9 @@ export default class SInput extends Vue { get sizeClass (): string { switch (this.size) { - case InputSize.SMALL: - return 's-size-small' case InputSize.MEDIUM: + return 's-size-medium' + case InputSize.BIG: default: return '' } diff --git a/src/components/Input/consts.ts b/src/components/Input/consts.ts index 05411a11..bce2e133 100644 --- a/src/components/Input/consts.ts +++ b/src/components/Input/consts.ts @@ -31,6 +31,6 @@ export enum InputType { } export enum InputSize { - SMALL = 'small', - MEDIUM = 'medium' + MEDIUM = 'medium', + BIG = 'BIG' } diff --git a/src/stories/SInput.stories.ts b/src/stories/SInput.stories.ts index 06d0989a..20b7525d 100644 --- a/src/stories/SInput.stories.ts +++ b/src/stories/SInput.stories.ts @@ -33,7 +33,7 @@ export const configurable = () => ({ default: select('Type', Object.values(InputType), InputType.TEXT) }, size: { - default: select('Size', Object.values(InputSize), InputSize.MEDIUM) + default: select('Size', Object.values(InputSize), InputSize.BIG) }, placeholder: { default: text('Placeholder', 'Placeholder') diff --git a/src/styles/input.scss b/src/styles/input.scss index 12564a8a..2e748fa6 100644 --- a/src/styles/input.scss +++ b/src/styles/input.scss @@ -55,7 +55,7 @@ border-color: var(--s-color-base-background-hover); } } - &.s-size-small { + &.s-size-medium { min-height: $s-size-medium; .el-input, From 193aaec6517288db7ceb3540a4961cf9536e9444 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Fri, 6 Nov 2020 16:51:21 +0500 Subject: [PATCH 5/5] Small fixes --- src/components/Input/consts.ts | 2 +- src/stories/SInput.stories.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Input/consts.ts b/src/components/Input/consts.ts index bce2e133..bb48a246 100644 --- a/src/components/Input/consts.ts +++ b/src/components/Input/consts.ts @@ -32,5 +32,5 @@ export enum InputType { export enum InputSize { MEDIUM = 'medium', - BIG = 'BIG' + BIG = 'big' } diff --git a/src/stories/SInput.stories.ts b/src/stories/SInput.stories.ts index 20b7525d..182d55e8 100644 --- a/src/stories/SInput.stories.ts +++ b/src/stories/SInput.stories.ts @@ -23,7 +23,7 @@ export const configurable = () => ({ :maxlength="maxlength" :size="size" :prefix="prefix" - :suffix="prefix" + :suffix="suffix" />`, data: () => ({ input: ''