🍱 Adds icons for add + remove fields

This commit is contained in:
Alicia Sykes 2021-10-16 22:27:16 +01:00
parent b1e7ce22dd
commit 6ef202337e
3 changed files with 29 additions and 6 deletions

View File

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="plus" class="svg-inline--fa fa-plus fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></svg>

After

Width:  |  Height:  |  Size: 467 B

View File

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="trash-alt" class="svg-inline--fa fa-trash-alt fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z"></path></svg>

After

Width:  |  Height:  |  Size: 739 B

View File

@ -17,6 +17,7 @@
:type="row.type" :type="row.type"
layout="horizontal" layout="horizontal"
/> />
<BinIcon />
</div> </div>
<div class="add-more-inputs"> <div class="add-more-inputs">
<h4>More Fields</h4> <h4>More Fields</h4>
@ -26,7 +27,7 @@
:key="row.name" :key="row.name"
@click="() => appendNewField(row.name)" @click="() => appendNewField(row.name)"
class="add-field-tag"> class="add-field-tag">
{{ row.name }} <AddIcon /> {{ row.name }}
</span> </span>
</div> </div>
</div> </div>
@ -37,6 +38,8 @@
<script> <script>
import Input from '@/components/FormElements/Input'; import Input from '@/components/FormElements/Input';
import Button from '@/components/FormElements/Button'; import Button from '@/components/FormElements/Button';
import AddIcon from '@/assets/interface-icons/interactive-editor-add.svg';
import BinIcon from '@/assets/interface-icons/interactive-editor-remove.svg';
import StoreKeys from '@/utils/StoreMutations'; import StoreKeys from '@/utils/StoreMutations';
import DashySchema from '@/utils/ConfigSchema'; import DashySchema from '@/utils/ConfigSchema';
import { modalNames } from '@/utils/defaults'; import { modalNames } from '@/utils/defaults';
@ -59,6 +62,8 @@ export default {
components: { components: {
Input, Input,
Button, Button,
AddIcon,
BinIcon,
}, },
mounted() { mounted() {
this.item = this.getItemFromState(this.itemId); this.item = this.getItemFromState(this.itemId);
@ -69,7 +74,7 @@ export default {
makeInitialFormData() { makeInitialFormData() {
const formData = []; const formData = [];
const requiredFields = ['title', 'description', 'url', 'icon', 'target', 'hotkey', 'provider', 'tags']; const requiredFields = ['title', 'description', 'url', 'icon', 'target', 'hotkey', 'provider', 'tags'];
const acceptedTypes = ['text', 'number']; const acceptedTypes = ['text'];
const getType = (origType) => (acceptedTypes.includes(origType) ? origType : 'text'); const getType = (origType) => (acceptedTypes.includes(origType) ? origType : 'text');
Object.keys(this.schema).forEach((property) => { Object.keys(this.schema).forEach((property) => {
const singleRow = { const singleRow = {
@ -109,6 +114,7 @@ export default {
} }
}); });
}, },
// removeSomeField(filedId) {},
modalClosed() { modalClosed() {
this.$store.commit(StoreKeys.SET_MODAL_OPEN, false); this.$store.commit(StoreKeys.SET_MODAL_OPEN, false);
this.$emit('closeEditMenu'); this.$emit('closeEditMenu');
@ -127,6 +133,7 @@ export default {
color: var(--config-settings-color); color: var(--config-settings-color);
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
@extend .svg-button;
h3.title { h3.title {
font-size: 1.2rem; font-size: 1.2rem;
margin: 0.25rem 0; margin: 0.25rem 0;
@ -138,22 +145,28 @@ export default {
opacity: var(--dimming-factor); opacity: var(--dimming-factor);
} }
.row { .row {
display: flex;
padding: 0.5rem 0.25rem; padding: 0.5rem 0.25rem;
&:not(:last-child) { &:not(:last-child) {
border-bottom: 1px dotted var(--config-settings-color); border-bottom: 1px dotted var(--config-settings-color);
} }
.input-container input.input-field { .input-container {
font-size: 1rem; width: 100%;
padding: 0.35rem 0.5rem; input.input-field {
font-size: 1rem;
padding: 0.35rem 0.5rem;
}
} }
} }
.more-fields { .more-fields {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.add-field-tag { span.add-field-tag {
margin: 0.2rem; margin: 0.2rem;
padding: 0.2rem 0.5rem;; padding: 0.2rem 0.5rem;;
min-width: 2rem; min-width: 2rem;
display: flex;
align-items: center;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
border: 1px solid var(--config-settings-color); border: 1px solid var(--config-settings-color);
@ -161,6 +174,14 @@ export default {
&:hover { &:hover {
background: var(--config-settings-color); background: var(--config-settings-color);
color: var(--config-settings-background); color: var(--config-settings-background);
svg {
background: var(--config-settings-color);
path { fill: var(--config-settings-background); }
}
}
svg {
margin-right: 0.25rem;
border: none;
} }
} }
} }