fixed boolean, color display and repeater options

This commit is contained in:
Nitwel
2020-09-21 09:44:40 +02:00
parent c67b608d0a
commit f4dee0b10b
5 changed files with 900 additions and 94 deletions

966
api/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,10 @@
<template>
<div class="boolean" :style="styles">
<value-null v-if="value === null" />
<v-icon v-if="iconOn !== null && iconOff !== null" :name="value ? iconOn : iconOff"></v-icon>
<span v-if="labelOn !== null && labelOff !== null">{{ value ? labelOn : labelOff }}</span>
<template v-else>
<v-icon v-if="iconOn !== null && iconOff !== null" :name="value ? iconOn : iconOff"></v-icon>
<span v-if="labelOn !== null && labelOff !== null">{{ value ? labelOn : labelOff }}</span>
</template>
</div>
</template>
@@ -31,11 +33,11 @@ export default defineComponent({
},
iconOn: {
type: String,
default: null,
default: 'check',
},
iconOff: {
type: String,
default: null,
default: 'close',
},
colorOn: {
type: String,

View File

@@ -8,7 +8,7 @@ export default defineInterface(({ i18n }) => ({
icon: 'palette',
component: InterfaceColor,
types: ['string'],
recommendedDisplays: ['color-dot'],
recommendedDisplays: ['color'],
options: [
{
field: 'presets',

View File

@@ -6,17 +6,13 @@
</div>
<div class="grid-element half">
<p class="type-label">{{ $t('interfaces.repeater.edit_fields') }}</p>
<repeater
v-model="repeaterValue"
:template="`{{ field }} — {{ interface }}`"
:fields="repeaterFields"
/>
<p class="type-label">{{ $t('interfaces.repeater.add_label') }}</p>
<v-input class="input" v-model="addLabel" :placeholder="$t('add_a_new_item')" />
</div>
<div class="grid-element full">
<p class="type-label">{{ $t('interfaces.repeater.add_label') }}</p>
<v-input class="input" v-model="addLabel" :placeholder="$t('add_a_new_item')" />
<p class="type-label">{{ $t('interfaces.repeater.edit_fields') }}</p>
<repeater v-model="repeaterValue" :template="`{{ field }} — {{ interface }}`" :fields="repeaterFields" />
</div>
</div>
</template>

View File

@@ -17,8 +17,8 @@
"description": "Display a collection",
"icon_label": "Show the collection's icon"
},
"color-dot": {
"color-dot": "Color Dot",
"color": {
"color": "Color",
"description": "Display a colored dot",
"default_color": "Default Color",
"choices_note": "Set colors relative to the text"