-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Guillaume Chau
committed
May 11, 2018
1 parent
017e7b9
commit 3742e65
Showing
5 changed files
with
96 additions
and
5 deletions.
There are no files selected for viewing
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 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,73 @@ | ||
<template> | ||
<VueDisable | ||
:disabled="!prompt.enabled" | ||
class="prompt prompt-color" | ||
> | ||
<div class="prompt-content"> | ||
<ListItemInfo | ||
:name="$t(prompt.message)" | ||
:description="$t(prompt.description)" | ||
:link="prompt.link" | ||
/> | ||
|
||
<VueDropdown | ||
class="prompt-input" | ||
> | ||
<VueInput | ||
slot="trigger" | ||
:value="value(prompt.value)" | ||
@input="value => answer(value)" | ||
> | ||
<div slot="right" class="color-preview"> | ||
<div class="color-swatch" :style="{ | ||
backgroundColor: value(prompt.value) | ||
}" /> | ||
</div> | ||
</VueInput> | ||
|
||
<ColorPicker | ||
class="color-picker" | ||
:value="value(prompt.value)" | ||
@input="value => answer(value.hex)" | ||
/> | ||
</VueDropdown> | ||
</div> | ||
|
||
<PromptError :error="prompt.error"/> | ||
</VueDisable> | ||
</template> | ||
|
||
<script> | ||
import Prompt from './Prompt' | ||
import { Sketch } from 'vue-color' | ||
export default { | ||
extends: Prompt, | ||
components: { | ||
ColorPicker: Sketch | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus" scoped> | ||
@import "~@/style/imports" | ||
.color-preview | ||
padding-left $padding-item | ||
.color-swatch | ||
width 18px | ||
height @width | ||
border-radius 50% | ||
.color-picker | ||
width 300px | ||
height 370px | ||
background none | ||
box-shadow none | ||
padding ($padding-item - 4px) $padding-item | ||
>>> .vc-sketch-presets | ||
border-top-color rgba(black, .1) | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ enum PromptType { | |
checkbox | ||
password | ||
editor | ||
color | ||
} | ||
` | ||
|
||
|
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