mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 03:38:06 +02:00
Add Indentation prop & Left/Right icons props
This commit is contained in:
parent
88d37394d3
commit
fd5520c1cf
@ -42,14 +42,21 @@
|
|||||||
maxLength: {
|
maxLength: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null
|
default: null
|
||||||
}
|
},
|
||||||
|
isIndented: Boolean,
|
||||||
|
leftIcon: '',
|
||||||
|
rightIcon: '',
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="field" :class="{ 'pt-3' : hasOffset }">
|
<div class="mb-3" :class="{ 'pt-3' : hasOffset, 'is-flex' : isIndented }">
|
||||||
|
<div v-if="isIndented" class="mx-2 pr-1" :style="{ 'opacity': isDisabled ? '0.5' : '1' }">
|
||||||
|
<FontAwesomeIcon class="has-text-grey" :icon="['fas', 'chevron-right']" transform="rotate-135"/>
|
||||||
|
</div>
|
||||||
|
<div class="field" :class="{ 'is-flex-grow-5' : isIndented }">
|
||||||
<label :for="inputId" class="label" v-html="$t(label)"></label>
|
<label :for="inputId" class="label" v-html="$t(label)"></label>
|
||||||
<div class="control">
|
<div class="control" :class="{ 'has-icons-left' : leftIcon, 'has-icons-right': rightIcon }">
|
||||||
<input
|
<input
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
@ -59,10 +66,18 @@
|
|||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
v-on:input="$emit('update:modelValue', $event.target.value)"
|
v-on:input="$emit('update:modelValue', $event.target.value)"
|
||||||
|
v-on:change="$emit('change:modelValue', $event.target.value)"
|
||||||
:maxlength="maxLength"
|
:maxlength="maxLength"
|
||||||
/>
|
/>
|
||||||
|
<span v-if="leftIcon" class="icon is-small is-left">
|
||||||
|
<FontAwesomeIcon :icon="['fas', leftIcon]" transform="rotate-75" size="xs" />
|
||||||
|
</span>
|
||||||
|
<span v-if="rightIcon" class="icon is-small is-right">
|
||||||
|
<FontAwesomeIcon :icon="['fas', rightIcon]" transform="rotate-75" size="xs" />
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<FieldError v-if="fieldError != undefined" :error="fieldError" :field="fieldName" />
|
<FieldError v-if="fieldError != undefined" :error="fieldError" :field="fieldName" />
|
||||||
<p class="help" v-html="$t(help)" v-if="help"></p>
|
<p class="help" v-html="$t(help)" v-if="help"></p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user