improve(plugin): support textarea for settings input item

pull/6299/head
charlie 2022-07-29 22:44:55 +08:00 committed by Andelf
parent a14b397899
commit 3e7c20fd80
3 changed files with 8 additions and 3 deletions

View File

@ -232,7 +232,7 @@ export type SettingSchemaDesc = {
default: string | number | boolean | Array<any> | object | null
title: string
description: string // support markdown
inputAs?: 'color' | 'date' | 'datetime-local' | 'range'
inputAs?: 'color' | 'date' | 'datetime-local' | 'range' | 'textarea'
enumChoices?: Array<string>
enumPicker?: 'select' | 'radio' | 'checkbox' // default: select
}

View File

@ -545,7 +545,12 @@
.form-input {
padding: 5px;
width: 50%;
width: 70%;
}
textarea.form-input {
overflow-y: auto;
resize: vertical;
}
.form-select {

View File

@ -25,7 +25,7 @@
(let [input-as (util/safe-lower-case (or inputAs (name type)))
input-as (if (= input-as "string") :text (keyword input-as))]
[:input
[(if (= input-as :textarea) :textarea :input)
{:class (util/classnames [{:form-input (not (contains? #{:color :range} input-as))}])
:type (name input-as)
:defaultValue (or val default)