Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
MODUL-1110 - small visuals changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Atiomi authored and Mboulianne committed Jul 3, 2019
1 parent 5ce2890 commit def7ce0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
16 changes: 11 additions & 5 deletions src/components/copy-to-clipboard/copy-to-clipboard.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<div>
<div class="m-copy-to-clipboard">
<slot name="input"
:props="inputProps"
:handlers="inputHandlers">
<m-textfield v-bind="inputProps"
v-on="inputHandlers">

<template slot="suffix">
<slot name="button"
:handlers="buttonHandlers">
<m-link mode="button"
:underline="false"
v-on="buttonHandlers"
class="m-copy-to-clipboard__button">{{labelCopyBtn}}</m-link>
</slot>
</template>
</m-textfield>
</slot>
<slot name="button"
:handlers="buttonHandlers">
<m-button v-on="buttonHandlers">{{ labelCopyBtn }}</m-button>
</slot>
</div>
17 changes: 17 additions & 0 deletions src/components/copy-to-clipboard/copy-to-clipboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import 'commons';

.m-copy-to-clipboard {
&__button.m-link {
padding: 0 4px;
border-radius: 8px;
transition: background-color $m-transition-duration ease, color $m-transition-duration ease;

&:hover {
background-color: m-color(interactive, lightest);
}
}

.m-input-style.m--is-readonly .m-input-style__main {
border-style: solid;
}
}
7 changes: 4 additions & 3 deletions src/components/copy-to-clipboard/copy-to-clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import ClipboardJs from 'clipboard';
import { PluginObject } from 'vue';
import { Component, Prop } from 'vue-property-decorator';
import { ModulVue } from '../../utils/vue/vue';
import ButtonPlugin from '../button/button';
import { COPY_TO_CLIPBOARD_NAME } from '../component-names';
import I18nPlugin from '../i18n/i18n';
import LinkPlugin from '../link/link';
import TextfieldPlugin from '../textfield/textfield';
import ToastPlugin, { MToastPosition, MToastTimeout } from '../toast/toast';
import WithRender from './copy-to-clipboard.html';
import './copy-to-clipboard.scss';

export interface CopyToClipboardInputSupport {
value: any;
Expand Down Expand Up @@ -83,7 +84,7 @@ export class MCopyToClipboard extends ModulVue {
this.selectText();
this.$toast.show({
text: this.$i18n.translate('m-copy-to-clipboard:copied'),
position: MToastPosition.TopCenter,
position: MToastPosition.BottomLeft,
timeout: MToastTimeout.xshort
});
}
Expand All @@ -94,7 +95,7 @@ const CopyToClipboardPlugin: PluginObject<any> = {
v.component(COPY_TO_CLIPBOARD_NAME, MCopyToClipboard);
v.use(I18nPlugin);
v.use(TextfieldPlugin);
v.use(ButtonPlugin);
v.use(LinkPlugin);
v.use(ToastPlugin);
}
};
Expand Down
1 change: 1 addition & 0 deletions src/components/textfield/textfield.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
@click="togglePasswordVisibility"
key="passwordIcon"
button-size="22px"></m-icon-button>
<slot name="suffix"></slot>
</transition>
</template>
<textarea v-if="hasWordWrap"
Expand Down

0 comments on commit def7ce0

Please sign in to comment.