Add dropdown interface (#461)

* Add show-deselect option to v-select

* Add parse-choices util

* Add dropdown interface

* Add allow-other prop to v-select (single only)

* Check for custom state correctly

* Treat empty custom value as null

* Set full-width to true by default for inputs / selects

* Add allow-other support to multiple dropdown

* Upgrade display value to show item count

* Fix custom deletion

* Fix tests

* Pass allow other on in dropdown interface
This commit is contained in:
Rijk van Zanten
2020-04-23 18:16:17 -04:00
committed by GitHub
parent 571412ff2c
commit 0b05613a55
42 changed files with 663 additions and 150 deletions

View File

@@ -9,7 +9,7 @@
<v-card>
<v-card-title>{{ $t('add_new_folder') }}</v-card-title>
<v-card-text>
<v-input :placeholder="$t('folder_name')" v-model="newFolderName" full-width />
<v-input :placeholder="$t('folder_name')" v-model="newFolderName" />
</v-card-text>
<v-card-actions>
<v-button secondary @click="dialogActive = false">{{ $t('cancel') }}</v-button>

View File

@@ -33,17 +33,16 @@
<v-tab-item value="collection">
<h2 class="type-title">{{ $t('creating_collection_info') }}</h2>
<div class="type-label">{{ $t('name') }}</div>
<v-input full-width class="monospace" v-model="collectionName" />
<v-input class="monospace" v-model="collectionName" />
<v-divider />
<div class="grid">
<div>
<div class="type-label">{{ $t('primary_key_field') }}</div>
<v-input full-width class="monospace" v-model="primaryKeyFieldName" />
<v-input class="monospace" v-model="primaryKeyFieldName" />
</div>
<div>
<div class="type-label">{{ $t('type') }}</div>
<v-select
full-width
:items="[
{
text: $t('auto_increment_integer'),

View File

@@ -7,7 +7,6 @@
readonly
@click="toggle"
:value="field.name"
full-width
>
<template #prepend>
<v-icon class="drag-handle" name="drag_indicator" @click.stop />
@@ -41,15 +40,10 @@
<v-card-title>{{ $t('duplicate_where_to') }}</v-card-title>
<v-card-text>
<span class="label">{{ $tc('collection', 0) }}</span>
<v-select
class="monospace"
:items="collections"
v-model="duplicateTo"
full-width
/>
<v-select class="monospace" :items="collections" v-model="duplicateTo" />
<span class="label">{{ $tc('field', 0) }}</span>
<v-input class="monospace" v-model="duplicateName" full-width />
<v-input class="monospace" v-model="duplicateName" />
</v-card-text>
<v-card-actions>
<v-button secondary @click="duplicateActive = false">

View File

@@ -7,7 +7,6 @@
:disabled="isNew === false"
id="name"
v-model="_field"
full-width
:placeholder="$t('enter_field_name')"
/>

View File

@@ -16,15 +16,7 @@
/>
</draggable>
<v-button
class="add-field"
align="left"
dashed
outlined
full-width
large
@click="openFieldSetup()"
>
<v-button class="add-field" align="left" dashed outlined large @click="openFieldSetup()">
<v-icon name="add" />
{{ $t('add_field') }}
</v-button>