add trim, mask and clean up text-input

This commit is contained in:
Nitwel
2020-09-04 11:04:31 +02:00
parent cab4cac71e
commit 882bfda164
5 changed files with 43 additions and 3 deletions

View File

@@ -22,10 +22,10 @@ export default defineInterface(({ i18n }) => ({
{
field: 'font',
name: i18n.t('font'),
type: 'string',
meta: {
width: 'half',
interface: 'dropdown',
default: 'sans-serif',
options: {
choices: [
{ text: i18n.t('sans_serif'), value: 'sans-serif' },
@@ -34,10 +34,14 @@ export default defineInterface(({ i18n }) => ({
],
},
},
schema: {
default_value: 'sans-serif',
},
},
{
field: 'iconLeft',
name: i18n.t('icon_left'),
type: 'string',
meta: {
width: 'half',
interface: 'icon',
@@ -46,10 +50,35 @@ export default defineInterface(({ i18n }) => ({
{
field: 'iconRight',
name: i18n.t('icon_right'),
type: 'string',
meta: {
width: 'half',
interface: 'icon',
},
},
{
field: 'trim',
name: i18n.t('trimed'),
type: 'boolean',
meta: {
width: 'half',
interface: 'toggle',
},
schema: {
default_value: false,
},
},
{
field: 'mask',
name: i18n.t('masked'),
type: 'boolean',
meta: {
width: 'half',
interface: 'toggle',
},
schema: {
default_value: false,
},
},
],
}));

View File

@@ -3,9 +3,10 @@
:value="value"
:placeholder="placeholder"
:disabled="disabled"
:trim="trim"
:type="masked ? 'password' : 'text'"
:class="font"
:maxlength="length"
:max="length"
@input="$listeners.input"
>
<template v-if="iconLeft" #prepend><v-icon :name="iconLeft" /></template>
@@ -67,7 +68,7 @@ export default defineComponent({
default: 'sans-serif',
},
length: {
type: [Number, String],
type: Number,
default: null,
},
},