2018-10-07 09:59:22 -07:00
|
|
|
<template>
|
2019-07-05 00:17:44 -07:00
|
|
|
<div
|
|
|
|
class="opacity-control style-control"
|
|
|
|
:class="{ disabled: !present || disabled }"
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
:for="name"
|
|
|
|
class="label"
|
|
|
|
>
|
|
|
|
{{ $t('settings.style.common.opacity') }}
|
|
|
|
</label>
|
2020-01-02 12:44:54 -08:00
|
|
|
<Checkbox
|
2019-07-05 00:17:44 -07:00
|
|
|
v-if="typeof fallback !== 'undefined'"
|
2022-03-29 05:35:18 -07:00
|
|
|
:model-value="present"
|
2020-01-02 12:44:54 -08:00
|
|
|
:disabled="disabled"
|
|
|
|
class="opt"
|
2022-03-27 04:18:02 -07:00
|
|
|
@update:modelValue="$emit('update:modelValue', !present ? fallback : undefined)"
|
2019-07-05 00:17:44 -07:00
|
|
|
/>
|
|
|
|
<input
|
|
|
|
:id="name"
|
|
|
|
class="input-number"
|
|
|
|
type="number"
|
2022-03-28 13:55:11 -07:00
|
|
|
:value="modelValue || fallback"
|
2019-07-05 00:17:44 -07:00
|
|
|
:disabled="!present || disabled"
|
|
|
|
max="1"
|
|
|
|
min="0"
|
|
|
|
step=".05"
|
2021-04-25 03:23:16 -07:00
|
|
|
@input="$emit('update:modelValue', $event.target.value)"
|
2019-07-05 00:17:44 -07:00
|
|
|
>
|
|
|
|
</div>
|
2018-10-07 09:59:22 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-01-02 12:44:54 -08:00
|
|
|
import Checkbox from '../checkbox/checkbox.vue'
|
2018-10-07 09:59:22 -07:00
|
|
|
export default {
|
2020-01-02 12:44:54 -08:00
|
|
|
components: {
|
|
|
|
Checkbox
|
2020-01-02 11:36:01 -08:00
|
|
|
},
|
2020-01-12 07:59:41 -08:00
|
|
|
props: [
|
2022-03-27 04:18:02 -07:00
|
|
|
'name', 'modelValue', 'fallback', 'disabled'
|
2020-01-12 07:59:41 -08:00
|
|
|
],
|
2022-03-27 04:18:02 -07:00
|
|
|
emits: ['update:modelValue'],
|
2018-10-07 09:59:22 -07:00
|
|
|
computed: {
|
|
|
|
present () {
|
2022-03-27 04:18:02 -07:00
|
|
|
return typeof this.modelValue !== 'undefined'
|
2018-10-07 09:59:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|