Indent dependent options to enlighten when they can be used

This commit is contained in:
Bubka
2023-12-05 11:37:40 +01:00
parent 93527696ab
commit c75e4eb047
4 changed files with 18 additions and 10 deletions

View File

@@ -22,6 +22,8 @@
type: String,
default: ''
},
isIndented: Boolean,
isDisabled: Boolean,
})
const emit = defineEmits(['update:modelValue'])
@@ -43,9 +45,14 @@
</script>
<template>
<div class="field">
<input :id="fieldName" type="checkbox" :name="fieldName" class="is-checkradio is-info" v-model="model" v-bind="$attrs"/>
<label tabindex="0" :for="fieldName" class="label" :class="labelClass" v-html="$t(label)" v-on:keypress.space.prevent="toggleModel" />
<p class="help" v-html="$t(help)" v-if="help" />
<div class="field is-flex">
<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>
<input :id="fieldName" type="checkbox" :name="fieldName" class="is-checkradio is-info" v-model="model" :disabled="isDisabled" />
<label tabindex="0" :for="fieldName" class="label" :class="labelClass" v-html="$t(label)" v-on:keypress.space.prevent="toggleModel" />
<p class="help" v-html="$t(help)" v-if="help" />
</div>
</div>
</template>