Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 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
5c899e6
Fix directives (#464)
stefashkaa Aug 30, 2022
757157d
Focus Behaviour Improvements (#466)
alexnatalia Sep 20, 2022
2a80622
Improved Focus Outline Mixin. (#468)
alexnatalia Sep 26, 2022
f5a8d82
Update packages & storybook to 6 version (#479)
Nikita-Polyakov Nov 30, 2022
2b2cb65
Update Dockerfile
Dec 5, 2022
708704c
Merge pull request #486 from soramitsu/fix-vulns
Dec 5, 2022
130a589
Fix/storybook 6 build (#484)
Nikita-Polyakov Dec 8, 2022
f5c2d79
update input event firing (#491)
Nikita-Polyakov Dec 9, 2022
fc8dbff
merge origin/develop into release/1.0.42
Nikita-Polyakov Dec 9, 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@soramitsu/soramitsu-js-ui",
"version": "1.0.41",
"version": "1.0.42",
"private": false,
"publishConfig": {
"registry": "https://nexus.iroha.tech/repository/npm-soramitsu/"
Expand Down
21 changes: 15 additions & 6 deletions src/components/Checkbox/SCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</template>

<script lang="ts">
import { Component, Mixins, ModelSync, Prop } from 'vue-property-decorator'
import { Component, Mixins, Prop } from 'vue-property-decorator'
import ElCheckbox from 'element-ui/lib/checkbox'

import SizeMixin from '../../mixins/SizeMixin'
Expand All @@ -26,6 +26,10 @@ import BorderRadiusMixin from '../../mixins/BorderRadiusMixin'
components: { ElCheckbox }
})
export default class SCheckbox extends Mixins(SizeMixin, BorderRadiusMixin) {
/**
* Value of the checkbox item. Can be `string / number / boolean`
*/
@Prop() readonly value!: string | number | boolean
/**
* Label of the checkbox item
*/
Expand Down Expand Up @@ -58,11 +62,16 @@ export default class SCheckbox extends Mixins(SizeMixin, BorderRadiusMixin) {
* `false` by default
*/
@Prop({ default: false, type: Boolean }) readonly indeterminate!: boolean
/**
* Value of the checkbox item. Can be `string / number / boolean`
*/
@ModelSync('value', 'input', { type: [String, Number, Boolean] })
readonly model!: string | number | boolean

get model (): string | number | boolean {
return this.value
}

set model (value: string | number | boolean) {
if (this.value !== value) {
this.$emit('input', value)
}
}

get computedClasses (): Array<string> {
const cssClasses: Array<string> = []
Expand Down
23 changes: 16 additions & 7 deletions src/components/DatePicker/SDatePicker/SDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</template>

<script lang="ts">
import { Component, Mixins, ModelSync, Prop, Watch, Ref, Inject } from 'vue-property-decorator'
import { Component, Mixins, Prop, Watch, Ref, Inject } from 'vue-property-decorator'
import ElDatePicker from 'element-ui/lib/date-picker'
import { ElForm } from 'element-ui/types/form'
import { ElFormItem } from 'element-ui/types/form-item'
Expand All @@ -52,6 +52,11 @@ import { PickerTypes, PickerAlignment, InputTypes } from '../consts'
components: { ElDatePicker, SIcon }
})
export default class SDatePicker extends Mixins(SizeMixin, BorderRadiusMixin) {
/**
* Value of date picker component. Can be used with `v-model`.
* Can be date object / array with date objects for date range picker
*/
@Prop() readonly value!: any
/**
* Type of the date picker component. Available values:
*
Expand Down Expand Up @@ -172,12 +177,16 @@ export default class SDatePicker extends Mixins(SizeMixin, BorderRadiusMixin) {
* `true` by default
*/
@Prop({ type: Boolean, default: true }) readonly validateEvent!: boolean
/**
* Value of date picker component. Can be used with `v-model`.
* Can be date object / array with date objects for date range picker
*/
@ModelSync('value', 'input')
readonly model!: any

get model (): any {
return this.value
}

set model (value: any) {
if (JSON.stringify(value) !== JSON.stringify(this.value)) {
this.$emit('input', value)
}
}

@Watch('value')
private handlePropChange (value: any): void {
Expand Down
19 changes: 17 additions & 2 deletions src/components/Radio/SRadio/SRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
:disabled="disabled"
:border="border"
:name="name"
@change="handleChange"
>
<slot></slot>
</component>
</template>

<script lang="ts">
import { Component, Mixins, Prop, ModelSync } from 'vue-property-decorator'
import { Component, Mixins, Prop } from 'vue-property-decorator'
import ElRadio from 'element-ui/lib/radio'
import ElRadioButton from 'element-ui/lib/radio-button'

Expand Down Expand Up @@ -51,7 +52,17 @@ export default class SRadio extends Mixins(SizeMixin, DesignSystemInject) {
/**
* Binding value of the radio component. Can be `string` / `number` / `boolean`
*/
@ModelSync('value', 'input', { type: [String, Number, Boolean] }) readonly model!: string | number | boolean
@Prop({ type: [String, Number, Boolean] }) readonly value!: string | number | boolean

get model (): string | number | boolean {
return this.value
}

set model (value: string | number | boolean) {
if (this.value !== value) {
this.$emit('input', value)
}
}

get radioComponent () {
return this.isRadioButton ? 'el-radio-button' : 'el-radio'
Expand All @@ -67,5 +78,9 @@ export default class SRadio extends Mixins(SizeMixin, DesignSystemInject) {
}
return cssClasses
}

handleChange (value: string | number | boolean): void {
this.$emit('change', value)
}
}
</script>
14 changes: 12 additions & 2 deletions src/components/Radio/SRadioGroup/SRadioGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</template>

<script lang="ts">
import { Component, Mixins, Prop, ModelSync } from 'vue-property-decorator'
import { Component, Mixins, Prop } from 'vue-property-decorator'
import ElRadioGroup from 'element-ui/lib/radio-group'

import SizeMixin from '../../../mixins/SizeMixin'
Expand All @@ -25,6 +25,16 @@ export default class SRadio extends Mixins(SizeMixin) {
/**
* Binding value of the radio group. Can be `string` / `number` / `boolean`
*/
@ModelSync('value', 'input', { type: [String, Number, Boolean] }) readonly groupModel!: string | number | boolean
@Prop({ type: [String, Number, Boolean] }) readonly value!: string | number | boolean

get groupModel (): string | number | boolean {
return this.value
}

set groupModel (value: string | number | boolean) {
if (this.value !== value) {
this.$emit('input', value)
}
}
}
</script>
36 changes: 27 additions & 9 deletions src/components/Select/SSelect/SSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@focus="handleFocus"
@visible-change="handleVisibleChange"
@clear="handleClear"
@change="handleChange"
:filterable="filterable"
>
<slot name="prefix" slot="prefix"></slot>
Expand All @@ -28,7 +29,7 @@
</template>

<script lang="ts">
import { Component, Mixins, ModelSync, Prop, Watch, Ref, Inject } from 'vue-property-decorator'
import { Component, Mixins, Prop, Watch, Ref, Inject } from 'vue-property-decorator'
import ElSelect from 'element-ui/lib/select'
import { ElForm } from 'element-ui/types/form'
import { ElFormItem } from 'element-ui/types/form-item'
Expand All @@ -39,10 +40,18 @@ import DesignSystemInject from '../../DesignSystem/DesignSystemInject'
import { Autocomplete } from '../../Input/consts'
import { InputTypes } from '../consts'

type SingleSelectValue = boolean | string | number;
type MultipleSelectValue = Array<string | number>;
type SelectValue = SingleSelectValue | MultipleSelectValue;

@Component({
components: { ElSelect }
})
export default class SSelect extends Mixins(SizeMixin, BorderRadiusMixin, DesignSystemInject) {
/**
* Selected value. Can be used with `v-model`
*/
@Prop({ type: [Boolean, String, Number, Array] }) readonly value!: SelectValue
/**
* Input type of the select component. Available values: `"input"`, `"select"`.
*
Expand Down Expand Up @@ -121,19 +130,24 @@ export default class SSelect extends Mixins(SizeMixin, BorderRadiusMixin, Design
* `false` by default
*/
@Prop({ type: Boolean, default: false }) readonly filterable!: boolean
/**
* Selected value. Can be used with `v-model`
*/
@ModelSync('value', 'input')
readonly model!: any

get model (): SelectValue {
return this.value
}

set model (value: SelectValue) {
if (JSON.stringify(value) !== JSON.stringify(this.value)) {
this.$emit('input', value)
}
}

@Ref('select') select!: any

@Inject({ default: '', from: 'elForm' }) elForm!: ElForm
@Inject({ default: '', from: 'elFormItem' }) elFormItem!: ElFormItem

@Watch('model')
private handleValueChange (value: any): void {
private handleValueChange (): void {
this.updateInputValue()
}

Expand All @@ -148,7 +162,7 @@ export default class SSelect extends Mixins(SizeMixin, BorderRadiusMixin, Design
tags.remove()
}
const input = this.select.$el.getElementsByClassName('el-input__inner')[0] as HTMLInputElement
input.value = this.model && this.model.length ? `${this.multipleTextPrefix || this.placeholder} (${this.model.length})` : ''
input.value = Array.isArray(this.model) && (this.model as MultipleSelectValue).length ? `${this.multipleTextPrefix || this.placeholder} (${this.model.length})` : ''
}

mounted (): void {
Expand Down Expand Up @@ -193,7 +207,7 @@ export default class SSelect extends Mixins(SizeMixin, BorderRadiusMixin, Design
if (this.disabled) {
cssClasses.push('s-disabled')
}
if ((!this.multiple && this.model) || (this.multiple && this.model.length !== 0)) {
if ((!this.multiple && this.model) || (this.multiple && Array.isArray(this.model) && this.model.length !== 0)) {
cssClasses.push('s-has-value')
}
return cssClasses
Expand Down Expand Up @@ -233,6 +247,10 @@ export default class SSelect extends Mixins(SizeMixin, BorderRadiusMixin, Design
this.$emit('clear')
}

handleChange (value: SelectValue): void {
this.$emit('change', value)
}

public focus (): void {
this.select.focus()
}
Expand Down
22 changes: 13 additions & 9 deletions src/components/Slider/SSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
:range="range"
:marks="marks"
:disabled="disabled"
@input="handleInput"
@change="handleChange"
/>
</div>
</template>

<script lang="ts">
import { Vue, Component, ModelSync, Prop, Watch } from 'vue-property-decorator'
import { Vue, Component, Prop } from 'vue-property-decorator'
import ElSlider from 'element-ui/lib/slider'

import { SliderInputSize } from './consts'
Expand All @@ -35,6 +34,10 @@ import { SliderInputSize } from './consts'
components: { ElSlider }
})
export default class SSlider extends Vue {
/**
* Binding value
*/
@Prop({ default: 0, type: [Number, Array] }) readonly value!: number | number[]
/**
* Minimum value
*/
Expand Down Expand Up @@ -99,14 +102,15 @@ export default class SSlider extends Vue {
* Whether Slider is disabled
*/
@Prop({ default: false, type: Boolean }) readonly disabled!: boolean
/**
* Binding value
*/
@ModelSync('value', 'input', { default: 0, type: [Number, Array] })
readonly model!: number | number[]

handleInput (value: number): void {
this.$emit('input', value)
get model (): number | number[] {
return this.value
}

set model (value: number | number[]) {
if (JSON.stringify(value) !== JSON.stringify(this.value)) {
this.$emit('input', value)
}
}

handleChange (value: number): void {
Expand Down
15 changes: 12 additions & 3 deletions src/components/Switch/SSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</template>

<script lang="ts">
import { Component, Mixins, ModelSync, Prop, Watch } from 'vue-property-decorator'
import { Component, Mixins, Prop } from 'vue-property-decorator'
import ElSwitch from 'element-ui/lib/switch'

import DesignSystemInject from '../DesignSystem/DesignSystemInject'
Expand Down Expand Up @@ -65,8 +65,17 @@ export default class SSwitch extends Mixins(DesignSystemInject) {
/**
* Value of switch
*/
@ModelSync('value', 'input', { type: [Boolean, String, Number] })
readonly model!: boolean | string | number
@Prop({ type: [Boolean, String, Number] }) readonly value!: boolean | string | number

get model (): boolean | string | number {
return this.value
}

set model (value: boolean | string | number) {
if (this.value !== value) {
this.$emit('input', value)
}
}

handleChange (value: boolean | string | number): void {
this.$emit('change', value)
Expand Down
25 changes: 17 additions & 8 deletions src/components/Tab/STabs/STabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<script lang="ts">
import Vue from 'vue'
import { Component, Mixins, ModelSync, Prop } from 'vue-property-decorator'
import { Component, Mixins, Prop } from 'vue-property-decorator'
import ElTabs from 'element-ui/lib/tabs'

import DesignSystemInject from '../../DesignSystem/DesignSystemInject'
Expand All @@ -32,6 +32,12 @@ import { TabsType, TabsPosition } from '../consts'
components: { ElTabs }
})
export default class STabs extends Mixins(BorderRadiusMixin, DesignSystemInject) {
/**
* Name of the selected tab. Can be used with `v-model`.
*
* First value by default
*/
@Prop({ type: String }) readonly value!: string
/**
* Type of tabs. Can be `"card"`/`"border-card"`/`"rounded"` or unset.
*
Expand Down Expand Up @@ -73,13 +79,16 @@ export default class STabs extends Mixins(BorderRadiusMixin, DesignSystemInject)
* If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented
*/
@Prop({ type: Function }) readonly beforeLeave!: (activeName: string, oldActiveName: string) => (false | Promise<any>)
/**
* Name of the selected tab. Can be used with `v-model`.
*
* First value by default
*/
@ModelSync('value', 'input', { type: String })
readonly model!: string

get model (): string {
return this.value
}

set model (value: string) {
if (this.value !== value) {
this.$emit('input', value)
}
}

get computedType (): string {
// neu tabs implemented only with TabsType.ROUNDED type
Expand Down
Loading