Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.44",
"version": "1.0.45",
"private": false,
"publishConfig": {
"registry": "https://nexus.iroha.tech/repository/npm-soramitsu/"
Expand Down
5 changes: 3 additions & 2 deletions src/components/Dropdown/SDropdownItem/SDropdownItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import { Vue, Component, Prop } from 'vue-property-decorator'
import ElDropdownItem from 'element-ui/lib/dropdown-item'

import { iconClass } from '../../Icon/utils'

@Component({
components: { ElDropdownItem }
})
Expand Down Expand Up @@ -40,8 +42,7 @@ export default class SDropdownItem extends Vue {
@Prop({ type: String }) readonly icon!: string

get computedIcon (): string {
// TODO: add checks for invalid icons
return `s-icon-${this.icon}`
return iconClass(this.icon)
}
}
</script>
17 changes: 2 additions & 15 deletions src/components/Icon/SIcon/SIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { Vue, Component, Prop } from 'vue-property-decorator'
import last from 'lodash/fp/last'

import { Icons16, Icons24, StatusIcons } from '../consts'
import { iconClass } from '../utils'

@Component
export default class SIcon extends Vue {
Expand All @@ -33,20 +33,7 @@ export default class SIcon extends Vue {
}

get computedClass (): string {
if (!this.name) {
return ''
}
if (this.name.startsWith('el-icon')) {
return this.name
}
const is16Size = (Object.values(Icons16) as Array<string>).includes(this.name)
const is24Size = (Object.values(Icons24) as Array<string>).includes(this.name)
const isStatusIcon = (Object.values(StatusIcons) as Array<string>).includes(this.name)
if (!(is16Size || is24Size || isStatusIcon)) {
console.warn(`'${this.name}' was not found`)
return ''
}
return `s-icon-${this.name}`
return iconClass(this.name)
}

get computedStyles () {
Expand Down
18 changes: 18 additions & 0 deletions src/components/Icon/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Icons16, Icons24, StatusIcons } from './consts'

export const iconClass = (name: string): string => {
if (!name) {
return ''
}
if (name.startsWith('el-icon')) {
return name
}
const is16Size = (Object.values(Icons16) as Array<string>).includes(name)
const is24Size = (Object.values(Icons24) as Array<string>).includes(name)
const isStatusIcon = (Object.values(StatusIcons) as Array<string>).includes(name)
if (!(is16Size || is24Size || isStatusIcon)) {
console.warn(`'${name}' was not found`)
return ''
}
return `s-icon-${name}`
}
7 changes: 3 additions & 4 deletions src/styles/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
.el-table thead {
color: var(--s-color-base-content-tertiary);
}
.el-table__empty-block {
.el-table__empty-text {
color: var(--s-color-base-content-tertiary);
}
.el-table__empty-block,
.el-table__empty-text {
color: var(--s-color-base-content-tertiary);
}
.el-table--group,
.el-table--border,
Expand Down