SystemBar.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!--
  2. System bars
  3. -->
  4. <template>
  5. <v-system-bar
  6. height="50"
  7. :class="
  8. 'd-flex flex-row justify-center align-center text-center ' + classes
  9. "
  10. @click="onClick !== undefined ? onClick() : null"
  11. >
  12. <slot>
  13. <v-icon v-if="icon" small :icon="icon" />
  14. {{ text }}
  15. </slot>
  16. </v-system-bar>
  17. </template>
  18. <script setup lang="ts">
  19. const props = defineProps({
  20. text: {
  21. type: String,
  22. required: false,
  23. default: '',
  24. },
  25. icon: {
  26. type: String,
  27. required: false,
  28. default: undefined,
  29. },
  30. backgroundColor: {
  31. type: String,
  32. required: false,
  33. default: 'neutral-soft',
  34. },
  35. textColor: {
  36. type: String,
  37. required: false,
  38. default: 'on-neutral-soft',
  39. },
  40. onClick: {
  41. type: Function,
  42. required: false,
  43. default: undefined,
  44. },
  45. })
  46. // TODO: voir si possible d'utiliser les variables sass à la place?
  47. const classes = [
  48. 'bg-' + props.backgroundColor,
  49. 'text-' + props.textColor,
  50. props.onClick !== undefined ? 'clickable' : '',
  51. ].join(' ')
  52. </script>
  53. <style scoped lang="scss">
  54. .v-system-bar {
  55. font-size: 14px;
  56. }
  57. .v-icon {
  58. height: 20px;
  59. margin: 0 6px;
  60. }
  61. .clickable {
  62. cursor: pointer;
  63. }
  64. .clickable:hover {
  65. text-decoration: underline;
  66. }
  67. </style>