feat(UI): support to boolean fields

This commit is contained in:
Fabio Di Stasio 2021-03-18 12:59:46 +01:00
parent 9f6a183d9b
commit ffb1712a59
1 changed files with 12 additions and 3 deletions

View File

@ -34,6 +34,15 @@
class="editable-field px-2" class="editable-field px-2"
@blur="editOFF" @blur="editOFF"
> >
<select
v-else-if="inputProps.type === 'boolean'"
v-model="editingContent"
class="form-select small-select editable-field"
@blur="editOFF"
>
<option>true</option>
<option>false</option>
</select>
<input <input
v-else v-else
ref="editField" ref="editField"
@ -173,7 +182,7 @@ import { mimeFromHex } from 'common/libs/mimeFromHex';
import { formatBytes } from 'common/libs/formatBytes'; import { formatBytes } from 'common/libs/formatBytes';
import { bufferToBase64 } from 'common/libs/bufferToBase64'; import { bufferToBase64 } from 'common/libs/bufferToBase64';
import hexToBinary from 'common/libs/hexToBinary'; import hexToBinary from 'common/libs/hexToBinary';
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, DATE, TIME, DATETIME, BLOB, BIT } from 'common/fieldTypes'; import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BOOLEAN, DATE, TIME, DATETIME, BLOB, BIT } from 'common/fieldTypes';
import { VueMaskDirective } from 'v-mask'; import { VueMaskDirective } from 'v-mask';
import ConfirmModal from '@/components/BaseConfirmModal'; import ConfirmModal from '@/components/BaseConfirmModal';
import TextEditor from '@/components/BaseTextEditor'; import TextEditor from '@/components/BaseTextEditor';
@ -293,8 +302,8 @@ export default {
if (BLOB.includes(this.editingType)) if (BLOB.includes(this.editingType))
return { type: 'file', mask: false }; return { type: 'file', mask: false };
if (BIT.includes(this.editingType)) if (BOOLEAN.includes(this.editingType))
return { type: 'text', mask: false }; return { type: 'boolean', mask: false };
return { type: 'text', mask: false }; return { type: 'text', mask: false };
}, },