Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<script setup lang="ts">
import type { TTheme } from '@/app/interfaces/environment';
import { useVModels } from '@vueuse/core';
import type { IParagraph } from '@/app/interfaces/entities';
interface Props {
newEntityData: IParagraph;
isTitle: boolean;
isEntityWidthFull: boolean;
themeColor: TTheme;
entityPositionOptions: {
label: string;
value: number;
}[];
entityTitlePositionOptions: {
label: string;
value: number;
}[];
}
const props = defineProps<Props>();
const emit = defineEmits(['update:newEntityData', 'update:isTitle', 'update:isEntityWidthFull']);
const { newEntityData, isTitle, isEntityWidthFull } = useVModels(props, emit);
</script>
<template>
<ul class="flex gap-8 h-full" style="min-width: 35%">
<li class="flex flex-col items-center gap-4" style="min-width: 150px">
<div>
<p class="py-2 text-center">Title</p>
<div class="flex items-center">
Off
<ToggleSwitch v-model:isActive="isTitle" class="mx-2" :theme="themeColor" />
On
</div>
</div>
<div style="height: 108px" class="flex gap-8 items-center justify-between col-span-2">
<Transition name="fading">
<div v-show="isTitle" class="flex flex-col items-center">
<p class="py-2 text-center">Title position</p>
<Slider
v-model:value="newEntityData.entity_title_position"
:theme="themeColor"
width="150"
size="small"
isSmooth="true"
backgroundColor="white"
min="0"
max="2"
step="1"
:options="entityTitlePositionOptions"
/>
</div>
</Transition>
</div>
</li>
<li class="flex flex-col items-center gap-4" style="min-width: 150px">
<div>
<p class="py-2 text-center">Paragraph width</p>
<div class="flex items-center">
Half
<ToggleSwitch
v-model:isActive="isEntityWidthFull"
class="mx-2"
:theme="themeColor"
:negativeTheme="themeColor"
/>
Full
</div>
</div>
<div style="height: 108px" class="flex gap-8 items-center justify-between col-span-2">
<Transition name="fading">
<div v-show="!isEntityWidthFull" class="flex flex-col items-center">
<p class="py-2">Paragraph position</p>
<Slider
v-model:value="newEntityData.entity_position"
:theme="themeColor"
width="150"
size="small"
isSmooth="true"
backgroundColor="white"
min="0"
max="2"
step="1"
:options="entityPositionOptions"
/>
</div>
</Transition>
</div>
</li>
</ul>
</template>
<style scoped></style>