Merge branch 'polishing-calendar' into #74-vacation-calendar
# Conflicts: # resources/js/Pages/Calendar.vue
This commit is contained in:
		
							
								
								
									
										38
									
								
								resources/js/Shared/VacationType.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								resources/js/Shared/VacationType.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										51
									
								
								resources/js/Shared/VacationTypeCalendarIcon.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								resources/js/Shared/VacationTypeCalendarIcon.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
		Reference in New Issue
	
	Block a user