feat(storepkg,ui): a package can declare a multi-line text setting (#2006)
This commit is contained in:
3 files changed
+6
-2
No files matched your search
@@ -4,6 +4,7 @@ import { computed } from "vue";
|
||||
import { DurationInput } from "@/components/ui/duration-input";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { NumberField, NumberFieldContent, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput } from "@/components/ui/number-field";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText } from "@/components/ui/tags-input";
|
||||
import type { ExtensionSettingSpec } from "@/stores/extensions";
|
||||
@@ -52,5 +53,6 @@ const options = computed(() => (props.spec.options ?? []).map((value) => ({ valu
|
||||
</TagsInput>
|
||||
</div>
|
||||
<OptionSelect v-else-if="spec.type === 'select'" :id="id" :model-value="model" :options="options" @update:model-value="(value) => (model = value)" />
|
||||
<Textarea v-else-if="spec.type === 'text'" :id="id" :model-value="model" rows="6" class="max-w-xl" @update:model-value="(value) => (model = String(value))" />
|
||||
<Input v-else :id="id" v-model="model" class="max-w-md font-mono" />
|
||||
</template>
|
||||
@@ -41,7 +41,7 @@ export interface ExtensionSettingSpec {
|
||||
secret?: boolean;
|
||||
required?: boolean;
|
||||
/** Absent means string. */
|
||||
type?: "string" | "number" | "boolean" | "duration" | "list" | "select";
|
||||
type?: "string" | "number" | "boolean" | "duration" | "list" | "select" | "text";
|
||||
/** Choices for a select. */
|
||||
options?: string[];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user