Merge branch 'polishing-calendar' into #74-vacation-calendar

# Conflicts:
#	resources/js/Pages/Calendar.vue
This commit is contained in:
Adrian Hopek
2022-03-16 14:54:30 +01:00
12 changed files with 316 additions and 21 deletions

View File

@@ -0,0 +1,38 @@
<template>
<div class="flex items-center">
<component
:is="vacationTypeInfo.solid.icon"
:class="[vacationTypeInfo.solid.color ,'w-5 h-5 mr-1.5']"
:size="20"
/>
<span>{{ vacationTypeInfo.text }}</span>
</div>
</template>
<script>
import {computed} from 'vue'
import {useVacationTypeInfo} from '@/Composables/vacationTypeInfo'
export default {
name: 'VacationType',
props: {
type: {
type: String,
default: () => null,
},
last: {
type: Boolean,
default: () => false,
},
},
setup(props) {
const { findType } = useVacationTypeInfo()
const vacationTypeInfo = computed(() => findType(props.type))
return {
vacationTypeInfo,
}
},
}
</script>

View File

@@ -0,0 +1,51 @@
<template>
<Popper hover>
<div class="flex items-center">
<div>
<span :class="[typeInfo.outline.background, typeInfo.outline.foreground, 'flex items-center justify-center']">
<component
:is="typeInfo.outline.icon"
:class="typeInfo.outline.background"
/>
</span>
</div>
</div>
<template #content>
<div class="px-2 py-1 bg-white text-xs text-gray-900 shadow-md ">
{{ typeInfo.text }}
</div>
</template>
</Popper>
</template>
<script>
import {computed} from 'vue'
import {useVacationTypeInfo} from '@/Composables/vacationTypeInfo'
import Popper from 'vue3-popper'
export default {
name: 'VacationTypeCalendarIcon',
components: {
Popper,
},
props: {
type: {
type: String,
default: () => null,
},
last: {
type: Boolean,
default: () => false,
},
},
setup(props) {
const { findType } = useVacationTypeInfo()
const typeInfo = computed(() => findType(props.type))
return {
typeInfo,
}
},
}
</script>