From 06415fc6d203cfe0ee2ccdf313b6eafba9021463 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Thu, 29 Oct 2020 23:47:07 +0500 Subject: [PATCH 1/8] Add UMD build --- build/rollup.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/rollup.config.js b/build/rollup.config.js index e90b9bb0..aa95fda3 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -16,6 +16,11 @@ export default { file: 'lib/soramitsu-js-ui.esm.js', format: 'esm', sourcemap: true + }, { + name: 'SoramitsuJsUiUmd', + format: 'umd', + file: 'lib/soramitsu-js-ui.umd.js', + sourcemap: true } ], external: [ From 836214de109a0cf1f37d2b9b8d701904afaa4790 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Thu, 29 Oct 2020 23:48:28 +0500 Subject: [PATCH 2/8] Update version to 0.5.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa0b80b0..4894b105 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.5.2", + "version": "0.5.3", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/" From b5460dcf79f389a85657053670fbef9ed3b0f49c Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Mon, 2 Nov 2020 23:52:57 +0300 Subject: [PATCH 3/8] Dropdown icon prop (#81) * Add icon prop for dropdown component * Increase version --- package.json | 2 +- src/components/Dropdown/SDropdown.vue | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4894b105..7ebe581b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.5.3", + "version": "0.5.4", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/" diff --git a/src/components/Dropdown/SDropdown.vue b/src/components/Dropdown/SDropdown.vue index bc1e294b..679a9c9c 100644 --- a/src/components/Dropdown/SDropdown.vue +++ b/src/components/Dropdown/SDropdown.vue @@ -29,7 +29,7 @@ - + @@ -47,11 +47,13 @@ import { ElDropdown } from 'element-ui/types/dropdown' import { DropdownType, DropdownSize, DropdownPlacement, DropdownTrigger } from './consts' import { ButtonTypes, SButton } from '../Button' +import { Icons, SIcon } from '../Icon' import { STooltip } from '../Tooltip' @Component({ components: { SButton, + SIcon, STooltip } }) @@ -63,6 +65,12 @@ export default class SDropdown extends Vue { * By default, it's set to `"default"` */ @Prop({ type: String, default: DropdownType.DEFAULT }) readonly type!: string + /** + * An icon for dropdown with `type="ellipsis"`. + * + * By default, it's set to `"more-horizontal"` + */ + @Prop({ type: String, default: Icons.MoreHorizontal }) readonly icon!: string /** * Button type of dropdown component. It can be used with `type="button"`. * Possible values: `"primary"`, `"secondary"`, `"tertiary"`. From b85dbed88fef5728ce20964965864daecf53a661 Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Fri, 6 Nov 2020 15:52:43 +0500 Subject: [PATCH 4/8] 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 5/8] 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 6/8] 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 7/8] 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 8/8] 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: ''