-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from cosmos/peng/improve-copy-buttons
improve copy buttons
- Loading branch information
Showing
14 changed files
with
119 additions
and
189 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template lang="pug"> | ||
.ni-li-copy | ||
.value {{ value }} | ||
menu | ||
btn-copy(:value='value') | ||
</template> | ||
|
||
<script> | ||
import BtnCopy from 'common/NiBtnCopy' | ||
export default { | ||
name: 'ni-li-copy', | ||
components: { | ||
BtnCopy | ||
}, | ||
props: ['value'] | ||
} | ||
</script> | ||
|
||
<style lang="stylus"> | ||
@require '~variables' | ||
.ni-li-copy | ||
height 3rem | ||
display flex | ||
align-items center | ||
border-bottom px solid bc-dim | ||
&:only-child | ||
border-bottom none | ||
.value | ||
flex 1 | ||
padding 0 0.75em | ||
overflow hidden | ||
text-overflow ellipsis | ||
white-space nowrap | ||
menu | ||
display flex | ||
align-items center | ||
padding 0 0.75em | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { shallow } from 'vue-test-utils' | ||
import LiCopy from 'renderer/components/common/NiLiCopy' | ||
|
||
describe('LiCopy', () => { | ||
let wrapper | ||
let propsData = { | ||
value: 12345678 | ||
} | ||
|
||
beforeEach(() => { | ||
wrapper = shallow(LiCopy, { | ||
propsData | ||
}) | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(wrapper.vm.$el).toMatchSnapshot() | ||
}) | ||
|
||
it('has an address from props', () => { | ||
expect(wrapper.html()).toContain(propsData.value) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BtnCopy has the expected html structure 1`] = `"<button class=\\"ni-btn btn-copy\\" data-clipboard-text=\\"this is a test\\"><span class=\\"ni-btn-container\\"><i aria-hidden=\\"true\\" class=\\"ni-btn-icon material-icons\\">copy</i><span class=\\"ni-btn-value\\">Copy</span></span></button>"`; | ||
exports[`BtnCopy has the expected html structure 1`] = `"<button class=\\"ni-btn btn-copy\\" data-clipboard-text=\\"this is a test\\"><span class=\\"ni-btn-container\\"><i aria-hidden=\\"true\\" class=\\"ni-btn-icon material-icons\\">content_copy</i><span class=\\"ni-btn-value\\">Copy</span></span></button>"`; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.