2020-09-26 21:02:37 +00:00
|
|
|
<template>
|
2022-11-14 18:02:28 +00:00
|
|
|
<modal variant="hint-modal">
|
2021-11-13 14:13:56 +00:00
|
|
|
<card class="has-no-shadow" :title="$t('filters.create.title')">
|
2021-01-17 17:57:57 +00:00
|
|
|
<p>
|
2021-06-23 23:24:57 +00:00
|
|
|
{{ $t('filters.create.description') }}
|
2021-01-17 17:57:57 +00:00
|
|
|
</p>
|
|
|
|
<div class="field">
|
2021-06-23 23:24:57 +00:00
|
|
|
<label class="label" for="title">{{ $t('filters.attributes.title') }}</label>
|
2021-01-17 17:57:57 +00:00
|
|
|
<div class="control">
|
|
|
|
<input
|
2022-10-27 19:56:14 +00:00
|
|
|
v-model="filter.title"
|
|
|
|
:class="{ 'disabled': filterService.loading}"
|
|
|
|
:disabled="filterService.loading || undefined"
|
2021-01-17 17:57:57 +00:00
|
|
|
class="input"
|
|
|
|
id="Title"
|
2021-06-23 23:24:57 +00:00
|
|
|
:placeholder="$t('filters.attributes.titlePlaceholder')"
|
2021-01-17 17:57:57 +00:00
|
|
|
type="text"
|
|
|
|
v-focus
|
|
|
|
/>
|
2020-09-26 21:02:37 +00:00
|
|
|
</div>
|
2021-01-17 17:57:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-06-23 23:24:57 +00:00
|
|
|
<label class="label" for="description">{{ $t('filters.attributes.description') }}</label>
|
2021-01-17 17:57:57 +00:00
|
|
|
<div class="control">
|
|
|
|
<editor
|
2022-10-27 19:56:14 +00:00
|
|
|
:key="filter.id"
|
|
|
|
v-model="filter.description"
|
|
|
|
:class="{ 'disabled': filterService.loading}"
|
|
|
|
:disabled="filterService.loading"
|
2021-01-17 17:57:57 +00:00
|
|
|
:preview-is-default="false"
|
|
|
|
id="description"
|
2021-06-23 23:24:57 +00:00
|
|
|
:placeholder="$t('filters.attributes.descriptionPlaceholder')"
|
2021-01-17 17:57:57 +00:00
|
|
|
/>
|
2020-09-26 21:02:37 +00:00
|
|
|
</div>
|
2021-01-17 17:57:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-06-23 23:24:57 +00:00
|
|
|
<label class="label" for="filters">{{ $t('filters.title') }}</label>
|
2021-01-17 17:57:57 +00:00
|
|
|
<div class="control">
|
2021-11-14 15:56:52 +00:00
|
|
|
<Filters
|
2022-10-27 19:56:14 +00:00
|
|
|
:class="{ 'disabled': filterService.loading}"
|
|
|
|
:disabled="filterService.loading"
|
2021-01-17 17:57:57 +00:00
|
|
|
class="has-no-shadow has-no-border"
|
|
|
|
v-model="filters"
|
|
|
|
/>
|
2020-09-26 21:02:37 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-01 16:09:50 +00:00
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
<x-button
|
2022-10-27 19:56:14 +00:00
|
|
|
:loading="filterService.loading"
|
|
|
|
:disabled="filterService.loading"
|
|
|
|
@click="createFilter()"
|
2022-09-01 16:09:50 +00:00
|
|
|
class="is-fullwidth"
|
|
|
|
>
|
|
|
|
{{ $t('filters.create.action') }}
|
|
|
|
</x-button>
|
|
|
|
</template>
|
2021-01-17 17:57:57 +00:00
|
|
|
</card>
|
2021-09-24 18:08:48 +00:00
|
|
|
</modal>
|
2020-09-26 21:02:37 +00:00
|
|
|
</template>
|
|
|
|
|
2022-02-15 12:07:34 +00:00
|
|
|
<script setup lang="ts">
|
2022-10-27 19:56:14 +00:00
|
|
|
import Editor from '@/components/input/AsyncEditor'
|
2021-07-25 13:27:15 +00:00
|
|
|
import Filters from '@/components/list/partials/filters.vue'
|
2021-11-14 15:56:52 +00:00
|
|
|
|
2022-10-27 19:56:14 +00:00
|
|
|
import {useSavedFilter} from '@/services/savedFilter'
|
2021-11-14 15:56:52 +00:00
|
|
|
|
2022-10-27 19:56:14 +00:00
|
|
|
const {
|
|
|
|
filter,
|
|
|
|
filters,
|
|
|
|
createFilter,
|
|
|
|
filterService,
|
|
|
|
} = useSavedFilter()
|
2020-09-26 21:02:37 +00:00
|
|
|
</script>
|