2017-11-13 01:23:39 -05:00
|
|
|
<template lang="html">
|
2018-03-30 17:58:56 -04:00
|
|
|
<div
|
|
|
|
:class="{inherits: isInherited, default: isDefault}"
|
|
|
|
class="ffz--widget ffz--checkbox"
|
|
|
|
>
|
2021-02-11 19:40:12 -05:00
|
|
|
<div class="tw-flex tw-align-items-center ffz-checkbox">
|
2018-03-30 17:58:56 -04:00
|
|
|
<input
|
|
|
|
:id="item.full_key"
|
2019-06-20 15:15:54 -04:00
|
|
|
ref="control"
|
2018-03-30 17:58:56 -04:00
|
|
|
:checked="value"
|
|
|
|
type="checkbox"
|
2021-02-11 19:40:12 -05:00
|
|
|
class="ffz-checkbox__input"
|
2018-03-30 17:58:56 -04:00
|
|
|
@change="onChange"
|
2017-11-13 01:23:39 -05:00
|
|
|
>
|
|
|
|
|
2021-02-11 19:40:12 -05:00
|
|
|
<label :for="item.full_key" class="ffz-checkbox__label">
|
2020-02-09 15:10:12 -05:00
|
|
|
<span class="tw-mg-l-1">
|
2021-11-12 16:58:35 -05:00
|
|
|
{{ item.i18n_key ? t(item.i18n_key, item.title) : item.title }}
|
2020-02-09 15:10:12 -05:00
|
|
|
<span v-if="unseen" class="tw-pill">{{ t('setting.new', 'New') }}</span>
|
|
|
|
</span>
|
2018-03-30 17:58:56 -04:00
|
|
|
</label>
|
|
|
|
|
2019-11-14 19:52:35 -05:00
|
|
|
<component
|
|
|
|
:is="item.buttons"
|
|
|
|
v-if="item.buttons"
|
|
|
|
:context="context"
|
|
|
|
:item="item"
|
|
|
|
:value="value"
|
|
|
|
/>
|
|
|
|
|
2018-03-30 17:58:56 -04:00
|
|
|
<button
|
|
|
|
v-if="source && source !== profile"
|
|
|
|
class="tw-mg-l-05 tw-button tw-button--text"
|
|
|
|
@click="context.currentProfile = source"
|
|
|
|
>
|
|
|
|
<span class="tw-button__text ffz-i-right-dir">
|
|
|
|
{{ sourceDisplay }}
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
|
2019-02-12 17:39:54 -05:00
|
|
|
<div class="ffz--reset-button">
|
2021-05-17 17:02:23 -04:00
|
|
|
<button v-if="has_value" class="tw-mg-l-05 tw-button tw-button--text ffz-il-tooltip__container" @click="clear">
|
2019-02-12 17:39:54 -05:00
|
|
|
<span class="tw-button__text ffz-i-cancel" />
|
2021-05-17 17:02:23 -04:00
|
|
|
<div class="ffz-il-tooltip ffz-il-tooltip--down ffz-il-tooltip--align-right">
|
2019-02-12 17:39:54 -05:00
|
|
|
{{ t('setting.reset', 'Reset to Default') }}
|
|
|
|
</div>
|
|
|
|
</button>
|
|
|
|
</div>
|
2018-03-30 17:58:56 -04:00
|
|
|
</div>
|
|
|
|
<section
|
|
|
|
v-if="item.description"
|
|
|
|
class="tw-c-text-alt-2"
|
2021-02-09 19:14:56 -05:00
|
|
|
style="padding-left:2.5rem"
|
2018-10-01 15:36:38 -04:00
|
|
|
>
|
2019-10-04 14:57:13 -04:00
|
|
|
<markdown :source="t(item.desc_i18n_key || `${item.i18n_key}.description`, item.description)" />
|
2018-10-01 15:36:38 -04:00
|
|
|
</section>
|
2019-09-12 13:11:08 -04:00
|
|
|
<section
|
|
|
|
v-if="item.extra"
|
2021-02-09 19:14:56 -05:00
|
|
|
style="padding-left:2.5rem"
|
2019-09-12 13:11:08 -04:00
|
|
|
>
|
|
|
|
<component :is="item.extra.component" :context="context" :item="item" />
|
|
|
|
</section>
|
2018-03-30 17:58:56 -04:00
|
|
|
</div>
|
2017-11-13 01:23:39 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import SettingMixin from '../setting-mixin';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
mixins: [SettingMixin],
|
|
|
|
props: ['item', 'context'],
|
|
|
|
|
2019-06-13 22:56:50 -04:00
|
|
|
watch: {
|
|
|
|
value() {
|
|
|
|
if ( this.$refs.control )
|
|
|
|
this.$refs.control.indeterminate = this.value == null;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
if ( this.$refs.control )
|
|
|
|
this.$refs.control.indeterminate = this.value == null;
|
|
|
|
},
|
|
|
|
|
2017-11-13 01:23:39 -05:00
|
|
|
methods: {
|
|
|
|
onChange() {
|
|
|
|
this.set(this.$refs.control.checked);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|