Co-authored-by: Jonathan Malessa <13995942+Xyolyp@users.noreply.github.com> Co-authored-by: Michael Genson <genson.michael@gmail.com>
60 lines
1.5 KiB
Vue
60 lines
1.5 KiB
Vue
<template>
|
|
<div>
|
|
<v-card-text
|
|
v-if="cookbook"
|
|
class="px-1"
|
|
>
|
|
<v-text-field
|
|
v-model="cookbook.name"
|
|
:label="$t('cookbook.cookbook-name')"
|
|
variant="underlined"
|
|
color="primary"
|
|
/>
|
|
<v-textarea
|
|
v-model="cookbook.description"
|
|
auto-grow
|
|
:rows="2"
|
|
:label="$t('recipe.description')"
|
|
variant="underlined"
|
|
color="primary"
|
|
/>
|
|
<QueryFilterBuilder
|
|
:field-defs="fieldDefs"
|
|
:initial-query-filter="cookbook.queryFilter"
|
|
@input="handleInput"
|
|
/>
|
|
<v-switch
|
|
v-model="cookbook.public"
|
|
hide-details
|
|
single-line
|
|
color="primary"
|
|
>
|
|
<template #label>
|
|
{{ $t('cookbook.public-cookbook') }}
|
|
<HelpIcon
|
|
size="small"
|
|
right
|
|
class="ml-2"
|
|
>
|
|
{{ $t('cookbook.public-cookbook-description') }}
|
|
</HelpIcon>
|
|
</template>
|
|
</v-switch>
|
|
</v-card-text>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import QueryFilterBuilder from "~/components/Domain/QueryFilterBuilder.vue";
|
|
import { useRecipeFilterFields } from "~/composables/use-recipe-filter-fields";
|
|
import type { CookBookOut } from "~/lib/api/types/cookbook";
|
|
|
|
const modelValue = defineModel<CookBookOut>({ required: true });
|
|
const cookbook = toRef(modelValue);
|
|
function handleInput(value: string | undefined) {
|
|
cookbook.value.queryFilterString = value || "";
|
|
}
|
|
|
|
const fieldDefs = useRecipeFilterFields();
|
|
</script>
|