Skip to content

Commit

Permalink
Merge pull request #1095 from rei/v12-release
Browse files Browse the repository at this point in the history
V12 release
  • Loading branch information
benjag authored Apr 29, 2022
2 parents c06fbeb + ac25eb7 commit 311523e
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 608 deletions.
1 change: 0 additions & 1 deletion build/component-variables-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const SUPPORTED_COMPONENTS = [
/* global vars */
'options.vars.scss',
/* component vars */
'CdrBanner.vars.scss',
'CdrButton.vars.scss',
'CdrCard.vars.scss',
'CdrChip.vars.scss',
Expand Down
230 changes: 123 additions & 107 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rei/cedar",
"version": "11.3.1",
"version": "12.0.0",
"description": "REI Cedar Component Library",
"homepage": "https://rei.github.io/rei-cedar/",
"license": "MIT",
Expand Down Expand Up @@ -67,7 +67,7 @@
"babel-plugin-istanbul": "^6.0.0",
"backstopjs": "^5.3.7",
"chalk": "^4.1.1",
"chromedriver": "^98.0.0",
"chromedriver": "^99.0.0",
"codecov": "^3.8.2",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
Expand Down
21 changes: 7 additions & 14 deletions src/components/breadcrumb/CdrBreadcrumb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,13 @@ export default {
key={breadcrumb.item.id || breadcrumb.item.name.replace(/ /g, '-').toLowerCase()}
v-show={!this.truncate || (index >= this.items.length - 2)}
>
{this.$scopedSlots.link
? this.$scopedSlots.link({
class: this.style['cdr-breadcrumb__link'],
href: breadcrumb.item.url,
content: breadcrumb.item.name,
})
: (<a
class={this.style['cdr-breadcrumb__link']}
href={breadcrumb.item.url}
onClick={(e) => this.$emit('navigate', breadcrumb, e)}
>
{ breadcrumb.item.name }
</a>)
}
<a
class={this.style['cdr-breadcrumb__link']}
href={breadcrumb.item.url}
onClick={(e) => this.$emit('navigate', breadcrumb, e)}
>
{ breadcrumb.item.name }
</a>
{delimiter}
</li>);
});
Expand Down
19 changes: 0 additions & 19 deletions src/components/breadcrumb/__tests__/CdrBreadcrumb.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,25 +114,6 @@ describe('CdrBreadcrumb', () => {
expect(wrapper.vm.truncate).toBe(true);
});

it('breadcrumb link can be overridden with link scopedSlot', () => {
const wrapper = shallowMount(CdrBreadcrumb, {
propsData: {
items: [
{
item: {
url: 'http://rei.com',
name: 'Scoped',
},
},
],
},
scopedSlots: {
link: '<p slot-scope="link">{{link.href}} TEST {{link.content}} {{link.class}}</p>'
}
});
expect(wrapper.text()).toBe('http://rei.com TEST Scoped cdr-breadcrumb__link');
});

it('applies focus to first breadcrumb on ellipsis click', async (done) => {
const elem = document.createElement('div')
if (document.body) {
Expand Down
16 changes: 0 additions & 16 deletions src/components/breadcrumb/examples/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@
data-backstop="breadcrumbs-default"
@navigate="handleClick"
/>
<h3>
Scoped Slot
</h3>
<cdr-breadcrumb :items="reiExampleBreadcrumbItems">
<template
slot="link"
slot-scope="link"
>
<a
:class="link.class"
:href="link.href"
>
{{ link.content }}
</a>
</template>
</cdr-breadcrumb>
</div>
</template>

Expand Down
51 changes: 17 additions & 34 deletions src/components/pagination/CdrPagination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,17 @@ export default {
const LinkTag = this.linkTag;
return this.innerValue > this.pages[0].page ? (
<li>
{this.$scopedSlots.prevLink
? this.$scopedSlots.prevLink(this.prevElAttrs)
: (<LinkTag
{... { attrs: this.prevElAttrs.attrs }}
href={LinkTag === 'a' && this.prevElAttrs.href}
ref={this.prevElAttrs.attrs.ref}
onClick={this.prevElAttrs.click}
>
<this.prevElAttrs.iconComponent
class={this.prevElAttrs.iconClass}
/>
{this.prevElAttrs.content}
</LinkTag>)
}
<LinkTag
{... { attrs: this.prevElAttrs.attrs }}
href={LinkTag === 'a' && this.prevElAttrs.href}
ref={this.prevElAttrs.attrs.ref}
onClick={this.prevElAttrs.click}
>
<this.prevElAttrs.iconComponent
class={this.prevElAttrs.iconClass}
/>
{this.prevElAttrs.content}
</LinkTag>
</li>
) : (
<li aria-hidden="true">
Expand Down Expand Up @@ -240,9 +237,7 @@ export default {
const LinkTag = this.linkTag;
return this.innerValue < this.pages[this.totalPageData - 1].page ? (
<li>
{this.$scopedSlots.nextLink
? this.$scopedSlots.nextLink(this.nextElAttrs)
: (<LinkTag
<LinkTag
{... { attrs: this.nextElAttrs.attrs }}
href={LinkTag === 'a' && this.nextElAttrs.href}
ref={this.nextElAttrs.attrs.ref}
Expand All @@ -252,9 +247,7 @@ export default {
<this.nextElAttrs.iconComponent
class={this.nextElAttrs.iconClass}
/>
</LinkTag>)
}

</LinkTag>
</li>
) : (
<li aria-hidden="true">
Expand Down Expand Up @@ -347,18 +340,8 @@ export default {
}
});
},
select(page, e) {
e.preventDefault();
if (this.$scopedSlots.link) {
const ref = this.$scopedSlots.link()[0].context.$refs[`page-link-${page}-${this.componentID}`]; // eslint-disable-line max-len
if (ref.$el) { // it's a component (like vue-router)
ref.$el.click();
} else { // it's standard markup
ref.click();
}
} else {
this.$refs[`page-link-${page}-${this.componentID}`].click();
}
select(page) {
this.$refs[`page-link-${page}-${this.componentID}`].click();
},
guid() {
function s4() {
Expand Down Expand Up @@ -387,8 +370,8 @@ export default {
};

const LinkTag = this.linkTag;
return (this.$scopedSlots.link ? this.$scopedSlots.link(linkData)
: <LinkTag
return (
<LinkTag
{... { attrs: linkData.attrs } }
href={LinkTag === 'a' && linkData.href}
onClick={linkData.click}
Expand Down
Loading

0 comments on commit 311523e

Please sign in to comment.