Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6c7f1e7
add check inside blur handler (#151)
Nikita-Polyakov Mar 3, 2021
1c75ceb
UNK-613 Accent rounded tabs
Sociopacific Mar 3, 2021
c0ab28c
Small fix
Sociopacific Mar 3, 2021
0b84361
Height var
Sociopacific Mar 3, 2021
5a2822c
change formatNumberField method (#154)
Nikita-Polyakov Mar 4, 2021
9bcba2f
Some fixes
Sociopacific Mar 4, 2021
eca5ada
Merge branch 'develop' into feature/accent-rounded-tabs
Sociopacific Mar 4, 2021
415918b
Merge pull request #153 from soramitsu/feature/accent-rounded-tabs
Sociopacific Mar 4, 2021
acf1be3
Typography Settings (#156)
alexnatalia Mar 5, 2021
b800c7f
Updated UI Lib version. (#159)
alexnatalia Mar 12, 2021
3518b46
Disable card shadow by default
Sociopacific Mar 17, 2021
d38b693
Merge pull request #161 from soramitsu/fix/disable-card-shadow-by-def…
Sociopacific Mar 17, 2021
6988aef
Add new icons font & update typography (#162)
stefashkaa Mar 17, 2021
c452877
Fix card shadow property
Sociopacific Mar 17, 2021
7443120
Small fix
Sociopacific Mar 17, 2021
5e1b99b
Change version to 0.8.1
Sociopacific Mar 17, 2021
ee8199f
Merge pull request #166 from soramitsu/fix/fix-card-shadow-property
Sociopacific Mar 17, 2021
6a55ea2
Fix error icon position
Sociopacific Mar 18, 2021
fc527f0
Merge pull request #168 from soramitsu/fix/fix-error-icon-position
Sociopacific Mar 18, 2021
5c14c38
Fix scroll section item detection
Sociopacific Mar 20, 2021
a82ac3d
Fix collapse item arrow margin
Sociopacific Mar 20, 2021
2e12326
Fix breadcrumb font size
Sociopacific Mar 20, 2021
53a8978
Fix icons (#173)
stefashkaa Mar 21, 2021
508ab0f
Merge branch 'develop' into fix/fix-scroll-section-item-detection
Sociopacific Mar 22, 2021
ce82f52
Update version to 0.8.3
Sociopacific Mar 22, 2021
70d80c6
Merge pull request #169 from soramitsu/fix/fix-scroll-section-item-de…
Sociopacific Mar 22, 2021
994df7f
Merge branch 'develop' into fix/fix-collapse-item-arrow-margin
Sociopacific Mar 22, 2021
5feee38
Add ";" to the end of the line
Sociopacific Mar 22, 2021
5fa956f
Merge pull request #170 from soramitsu/fix/fix-collapse-item-arrow-ma…
Sociopacific Mar 22, 2021
309f9e0
Merge branch 'develop' into fix/fix-breadcrumb-font-size
Sociopacific Mar 22, 2021
9b7aea7
Merge pull request #172 from soramitsu/fix/fix-breadcrumb-font-size
Sociopacific Mar 22, 2021
dea4f70
Merge branch 'master' into release/0.8.3
Sociopacific Mar 22, 2021
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": "0.8.2",
"version": "0.8.3",
"private": false,
"publishConfig": {
"registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/"
Expand Down
4 changes: 2 additions & 2 deletions src/components/ScrollSections/SScrollSectionItem.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<section :id="section" class="s-scroll-section-item">
<span v-if="title" class="title">{{ title }}</span>
<slot v-if="this.$slots.title && !title" name="title"></slot>
<span v-if="title && !this.$slots.title" class="title">{{ title }}</span>
<slot v-if="this.$slots.title" name="title"></slot>
<slot></slot>
<s-divider v-if="withDivider" type="primary" style="margin: 20px 0 0 0;"></s-divider>
</section>
Expand Down
43 changes: 31 additions & 12 deletions src/components/ScrollSections/SScrollSections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,17 @@ export default class SScrollSections extends Vue {

menuItems: Vue[] = []
activeSection = ''
isComponentDestroyed = false

mounted (): void {
this.$nextTick(() => {
if (this.$children.length === 0) {
return
}
let children = this.$children
while (!children.every((item: any) => item.section)) {
children = children[0].$children
const setState = () => {
this.setState()
if (!this.isComponentDestroyed) {
window.requestAnimationFrame(setState)
}
this.menuItems = children
this.scrollableParent.addEventListener('scroll', this.handleScroll)
this.handleInitialState()
})
}
setState()
this.scrollableParent.addEventListener('scroll', this.handleScroll)
}

destroyed (): void {
Expand Down Expand Up @@ -138,7 +135,29 @@ export default class SScrollSections extends Vue {
return this.parent ? this.$parent.$el : window
}

private handleInitialState (): void {
private setState (): void {
if (this.$children.length === 0) {
return
}
function findScrollSectionItems (children: Vue[]) {
return children.map((component: Vue) => {
if (component && component.$options && (component.$options as any)._componentTag === 's-scroll-section-item') {
return [component]
} else if (component && component.$children && component.$children.length) {
return findScrollSectionItems(component.$children)
}
return null
}).filter(component => component !== null).flat()
}
const menuItems = findScrollSectionItems(this.$children)
const isChanged = menuItems.length !== this.menuItems.length || menuItems.some((item: Vue, index: number) => item !== this.menuItems[index])
if (isChanged) {
this.menuItems = menuItems
this.handleState()
}
}

private handleState (): void {
if (this.router && this.router.currentRoute.hash) {
this.menuItems.forEach((sectionComponent: any) => {
if (this.router.currentRoute.hash === `#${sectionComponent.section}`) {
Expand Down
1 change: 1 addition & 0 deletions src/styles/breadcrumbs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@include font-weight(400);
}
.el-breadcrumb__inner {
font-size: var(--s-icon-font-size-mini);
color: var(--s-color-base-content-tertiary);
&.is-link {
color: var(--s-color-base-content-tertiary);
Expand Down
3 changes: 3 additions & 0 deletions src/styles/collapse.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
&content {
color: var(--s-color-base-content-primary);
}
&arrow {
margin: 0 0 0 auto;
}
}
.el-collapse-item.is-disabled .el-collapse-item__header {
color: var(--s-color-base-content-quaternary);
Expand Down