feat: prompt editor (#3929)

* feat(Prompt): editor

* docs(ui dev): update supported inquirer types

(cherry picked from commit 3f9838b649)
This commit is contained in:
Guillaume Chau
2019-05-18 13:32:48 +02:00
committed by Haoqun Jiang
parent 204e1fcf6b
commit dbac8171b9
3 changed files with 45 additions and 1 deletions

View File

@@ -526,7 +526,7 @@ However, you can add the following additional fields (which are optional and onl
}
```
Supported inquirer types: `checkbox`, `confirm`, `input`, `password`, `list`, `rawlist`.
Supported inquirer types: `checkbox`, `confirm`, `input`, `password`, `list`, `rawlist`, `editor`.
In addition to those, the UI supports special types that only works with it:

View File

@@ -52,6 +52,11 @@ export default {
align-items stretch
justify-content center
&.vertical
grid-template-columns auto
grid-template-areas "info" "input"
grid-gap $padding-item
.list-item-info
margin-right ($padding-item * 2)
</style>

View File

@@ -0,0 +1,39 @@
<template>
<VueDisable
:disabled="!prompt.enabled"
class="prompt prompt-editor"
>
<div class="prompt-content vertical">
<ListItemInfo
:name="$t(prompt.message)"
:description="$t(prompt.description)"
:link="prompt.link"
/>
<div class="prompt-input">
<VueInput
:value="value(prompt.value)"
type="textarea"
@update="value => answer(value)"
/>
</div>
</div>
<PromptError :error="prompt.error"/>
</VueDisable>
</template>
<script>
import Prompt from './Prompt'
export default {
extends: Prompt,
buffer: true
}
</script>
<style lang="stylus" scoped>
.vue-ui-input /deep/ > .content > .input-wrapper > textarea.input
min-height 16em
</style>