Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ecec57e
Change Dockefile
Feb 3, 2022
0411c91
Delete EXPOSE from Dockerfile
Feb 7, 2022
e2fcdf8
Merge pull request #370 from soramitsu/origin/feature/DOPS-1632/revie…
f33r0 Feb 9, 2022
2b5db01
fix leading dot (#385)
Nikita-Polyakov Feb 24, 2022
8842a08
Fix dialog structure search for computed props (#392)
stefashkaa Mar 3, 2022
f858cba
Feature/add preview image option (#399)
RustemYuzlibaev Mar 29, 2022
f806bb1
Bump minimist from 1.2.5 to 1.2.6 (#402)
dependabot[bot] Apr 14, 2022
456825d
Bump lodash from 4.17.15 to 4.17.21 (#400)
dependabot[bot] Apr 14, 2022
0fc14e7
Bump nanoid from 3.1.23 to 3.3.2 (#401)
dependabot[bot] Apr 14, 2022
dc83219
Bump follow-redirects from 1.11.0 to 1.14.9 (#387)
dependabot[bot] Apr 14, 2022
4b8c8c5
Bump postcss from 8.2.10 to 8.2.13 (#364)
dependabot[bot] Apr 14, 2022
6417492
Bump node-fetch from 2.6.0 to 2.6.7 (#366)
dependabot[bot] Apr 15, 2022
225bb6b
Bump tmpl from 1.0.4 to 1.0.5 (#331)
dependabot[bot] Apr 15, 2022
ac1dc0e
Bump ws from 5.2.2 to 5.2.3 (#332)
dependabot[bot] Apr 15, 2022
b57d244
Bump ajv from 6.12.2 to 6.12.6 (#388)
dependabot[bot] Apr 15, 2022
14bea29
Fix image preview (#407)
stefashkaa Apr 15, 2022
9dc135b
add Sonar
May 25, 2022
90bf40c
fix
May 25, 2022
06bd95f
STooltip: Added center alignment for the arrow. (#416)
alexnatalia May 30, 2022
7f95ca3
STooltip: Reverted Popper Arrow Styles Update (#418)
alexnatalia May 31, 2022
1b42253
STooltip: Decreased Open Delay. (#419)
alexnatalia Jun 2, 2022
58500be
Merge branch 'develop' into feature/SNE-132/add-sonar
Cre-eD Jun 2, 2022
dc3a59a
Merge pull request #413 from soramitsu/feature/SNE-132/add-sonar
wpi86 Jun 3, 2022
9feb3ea
Fixed Receive Misspelling. (#444)
alexnatalia Jul 14, 2022
4b688f6
[DOPS-1857] Add publish button for all libraries PRs & branches in Je…
baotn166 Jul 17, 2022
47039de
Merge pull request #454 from soramitsu/feature/DOPS-1857
baotn166 Jul 18, 2022
3389b1c
[DOPS-1857] Add publish button for all libraries PRs & branches in Je…
baotn166 Aug 4, 2022
8c1f18a
Merge pull request #457 from soramitsu/feature/DOPS-1857
baotn166 Aug 4, 2022
8022d6c
add neu select styles (#458)
Nikita-Polyakov Aug 9, 2022
a4c87bf
Differences in Tabindex Types Fix, V-Button Directive (#462)
alexnatalia Aug 29, 2022
3bd6990
Merge branch 'develop' into release/1.0.36
Aug 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def pipeline = new org.js.LibPipeline(steps: this,
dockerImageName: 'soramitsu/soramitsu-js-ui-library',
libExamplesBuildCmds: ['yarn storybook:build'],
sonarProjectName: 'soramitsu-js-ui-library',
sonarProjectKey: 'jp.co.soramitsu:soramitsu-js-ui-library',
sonarProjectKey: 'jp.co.soramitsu:soramitsu-js-ui-library'
)
pipeline.runPipeline()
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@soramitsu/soramitsu-js-ui",
"version": "1.0.35",
"version": "1.0.36",
"private": false,
"publishConfig": {
"registry": "https://nexus.iroha.tech/repository/npm-soramitsu/"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Button/SButton/SButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class SButton extends Mixins(SizeMixin, BorderRadiusMixin, Design
/**
* Button tabindex
*/
@Prop({ default: '0', type: String }) readonly tabindex!: string
@Prop({ default: 0, type: [Number, String] }) readonly tabindex!: number | string
/**
* Placement of the tooltip. You can use any value from the `TooltipPlacement` enum.
*
Expand Down Expand Up @@ -202,7 +202,7 @@ export default class SButton extends Mixins(SizeMixin, BorderRadiusMixin, Design
}

mounted (): void {
this.$el.setAttribute('tabindex', this.tabindex)
this.$el.setAttribute('tabindex', this.tabindex.toString())
this.$watch('loading', (value) => {
if (!value) {
return
Expand Down
8 changes: 6 additions & 2 deletions src/components/Dropdown/SDropdown/SDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:hide-on-click="hideOnClick"
:show-timeout="showTimeout"
:hide-timeout="hideTimeout"
:tabindex="tabindex"
:tabindex="tabindexFormatted"
@click="handleClick"
@command="handleSelect"
@visible-change="handleVisibleChange"
Expand Down Expand Up @@ -129,7 +129,7 @@ export default class SDropdown extends Mixins(SizeMixin, BorderRadiusMixin) {
*
* `0` by default
*/
@Prop({ type: Number, default: 0 }) readonly tabindex!: number
@Prop({ type: [Number, String], default: 0 }) readonly tabindex!: number | string
/**
* Popper class
*/
Expand All @@ -139,6 +139,10 @@ export default class SDropdown extends Mixins(SizeMixin, BorderRadiusMixin) {

willTooltipBeDisabled = false

get tabindexFormatted (): number {
return +this.tabindex
}

get computedClasses (): Array<string> {
const cssClasses: Array<string> = []
if (this.isStandardBorderRadius) {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Input/SInput/SInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
:form="form"
:label="label"
:accept="accept"
:tabindex="tabindex"
:tabindex="tabindexFormatted"
:prefix-icon="prefix"
:suffix-icon="suffix"
:rows="rows"
Expand Down Expand Up @@ -154,7 +154,7 @@ export default class SInput extends Mixins(BorderRadiusMixin, DesignSystemInject
/**
* Input tabindex
*/
@Prop({ default: '', type: String }) readonly tabindex!: string
@Prop({ default: 0, type: [Number, String] }) readonly tabindex!: number | string
/**
* Icon prefix, works only with medium input
*/
Expand Down Expand Up @@ -214,6 +214,10 @@ export default class SInput extends Mixins(BorderRadiusMixin, DesignSystemInject
return (this.type === InputType.TEXT && this.size === InputSize.BIG) || (this.type === InputType.TEXTAREA)
}

get tabindexFormatted (): string {
return this.tabindex.toString()
}

get computedClasses (): Array<string> {
const cssClasses: Array<string> = []
if (this.designSystemClass) {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Tooltip/STooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:popper-class="computedPopperClass"
:manual="manual"
:hide-after="hideAfter"
:tabindex="tabindex"
:tabindex="tabindexFormatted"
>
<slot slot="content" name="content"></slot>
<slot></slot>
Expand Down Expand Up @@ -116,12 +116,16 @@ export default class STooltip extends Mixins(BorderRadiusMixin, DesignSystemInje
*
* `0` by default
*/
@Prop({ default: 0, type: Number }) readonly tabindex!: number
@Prop({ default: 0, type: [Number, String] }) readonly tabindex!: number | string

@Ref('tooltip') tooltip!: any

@Getter libraryTheme!: Theme

get tabindexFormatted (): number {
return +this.tabindex
}

get computedPopperClass (): string {
const cssClasses: Array<string> = []
if (this.designSystemClass) {
Expand Down
33 changes: 33 additions & 0 deletions src/directives/button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { DirectiveOptions } from 'vue'

import KeyValues from '../utils/KeyValues'

const onEnterKeyDown = (e: any) => {
if (KeyValues.isEnter(e.key)) {
e.preventDefault()
e.target.click()
}
}

export const Button = {
bind (el, binding, vnode) {
if (binding.value || typeof binding.value === 'undefined') {
const button = el as HTMLDivElement
button.setAttribute('role', 'button')
button.addEventListener(
'keydown',
onEnterKeyDown
)
}
},
unbind (el, binding, vnode) {
if (binding.value || typeof binding.value === 'undefined') {
const button = el as HTMLDivElement
button.removeAttribute('role')
button.removeEventListener(
'keydown',
onEnterKeyDown
)
}
}
} as DirectiveOptions
1 change: 1 addition & 0 deletions src/directives/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { Float, Integer } from './number'
export { Button } from './button'
20 changes: 10 additions & 10 deletions src/directives/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { DirectiveOptions } from 'vue'

import KeyValues from '../utils/KeyValues'

const onDigitKeyPress = (e: any) => {
const onDigitKeyDown = (e: any) => {
if (!KeyValues.isDigit(e.key)) {
e.preventDefault()
} else {
return true
}
}

const onNumberKeyPress = (e: any) => {
const onNumberKeyDown = (e: any) => {
if (!KeyValues.isNumber(e.key) || (!KeyValues.isDigit(e.key) && e.target.value.includes('.'))) {
e.preventDefault()
} else {
Expand All @@ -23,17 +23,17 @@ export const Integer = {
const input = el.querySelector('input[type="text"]') as HTMLInputElement
if (input) {
input.addEventListener(
'keypress',
onDigitKeyPress
'keydown',
onDigitKeyDown
)
}
},
unbind (el, binding, vnode) {
const input = el.querySelector('input[type="text"]') as HTMLInputElement
if (input) {
input.removeEventListener(
'keypress',
onDigitKeyPress
'keydown',
onDigitKeyDown
)
}
}
Expand All @@ -44,17 +44,17 @@ export const Float = {
const input = el.querySelector('input[type="text"]') as HTMLInputElement
if (input) {
input.addEventListener(
'keypress',
onNumberKeyPress
'keydown',
onNumberKeyDown
)
}
},
unbind (el, binding, vnode) {
const input = el.querySelector('input[type="text"]') as HTMLInputElement
if (input) {
input.removeEventListener(
'keypress',
onNumberKeyPress
'keydown',
onNumberKeyDown
)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
STableColumn,
STooltip
} from './components'
import { Float, Integer } from './directives'
import { Float, Integer, Button } from './directives'
import { Components } from './types/components'
import { Directives } from './types/directives'
import { setTheme, setDesignSystem, setLocale } from './utils'
Expand All @@ -72,6 +72,7 @@ const SoramitsuElements = {
vue.use(ElementUIPlugin)
vue.directive(Directives.Float, Float)
vue.directive(Directives.Integer, Integer)
vue.directive(Directives.Button, Button)
vue.use(SApp)
vue.use(SAside)
vue.use(SBreadcrumb)
Expand Down
3 changes: 2 additions & 1 deletion src/types/directives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum Directives {
Float = 'Float',
Integer = 'Integer'
Integer = 'Integer',
Button = 'Button'
}
5 changes: 5 additions & 0 deletions src/utils/KeyValues.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default class KeyValues {
private static readonly digits = /[0-9]/
private static readonly numbers = /[0-9.]/
private static readonly Enter = 'Enter'

public static isDigit (digit: string): boolean {
return this.digits.test(digit)
Expand All @@ -9,4 +10,8 @@ export default class KeyValues {
public static isNumber (number: string): boolean {
return this.numbers.test(number)
}

public static isEnter (key: string): boolean {
return key === this.Enter
}
}