SideMenu.vue
187 lines
| 1 | <template> |
| 2 | <div class="am-cat__sidemenu" :style="cssVars"> |
| 3 | <div class="am-cat__sidemenu-item__wrapper"> |
| 4 | <div |
| 5 | v-for="(item, index) in menuItems" |
| 6 | :key="index" |
| 7 | class="am-cat__sidemenu-item" |
| 8 | :class="{'am-active': props.initSelection === item[props.identifier]}" |
| 9 | @click="() => selectItem(item)" |
| 10 | > |
| 11 | {{ item[props.nameIdentifier] }} |
| 12 | </div> |
| 13 | </div> |
| 14 | <div v-if="props.companyEmail" class="am-cat__sidemenu-footer"> |
| 15 | <span class="am-cat__sidemenu-footer__text"> |
| 16 | {{ props.footerString }} |
| 17 | </span> |
| 18 | <a class="am-cat__sidemenu-footer__email" :href="`mailto:${props.companyEmail}`"> |
| 19 | {{ props.companyEmail }} |
| 20 | </a> |
| 21 | </div> |
| 22 | </div> |
| 23 | </template> |
| 24 | |
| 25 | <script setup> |
| 26 | import { computed, inject } from "vue"; |
| 27 | import { useColorTransparency } from "../../../../assets/js/common/colorManipulation"; |
| 28 | |
| 29 | let props = defineProps({ |
| 30 | menuItems: { |
| 31 | type: Array, |
| 32 | required: true |
| 33 | }, |
| 34 | initSelection: { |
| 35 | type: [String, Number] |
| 36 | }, |
| 37 | identifier: { |
| 38 | type: String, |
| 39 | required: true |
| 40 | }, |
| 41 | nameIdentifier: { |
| 42 | type: String, |
| 43 | required: true |
| 44 | }, |
| 45 | footerString: { |
| 46 | type: String, |
| 47 | default: '' |
| 48 | }, |
| 49 | companyEmail: { |
| 50 | type: String, |
| 51 | default: '' |
| 52 | } |
| 53 | }) |
| 54 | let emits = defineEmits(['click']) |
| 55 | |
| 56 | function selectItem (item) { |
| 57 | emits('click', item) |
| 58 | } |
| 59 | |
| 60 | // * Colors |
| 61 | let amColors = inject('amColors') |
| 62 | |
| 63 | let cssVars = computed(() => { |
| 64 | return { |
| 65 | '--am-c-csm-text-op10': useColorTransparency(amColors.value.colorSbText, 0.1), |
| 66 | '--am-c-csm-primary-op10': useColorTransparency(amColors.value.colorPrimary, 0.1), |
| 67 | '--am-c-csm-text-op60': useColorTransparency(amColors.value.colorSbText, 0.6), |
| 68 | '--am-c-csm-text-op80': useColorTransparency(amColors.value.colorSbText, 0.8), |
| 69 | } |
| 70 | }) |
| 71 | </script> |
| 72 | |
| 73 | <script> |
| 74 | export default { |
| 75 | name: "SideMenu" |
| 76 | } |
| 77 | </script> |
| 78 | |
| 79 | <style lang="scss"> |
| 80 | @mixin catalog-sidebar { |
| 81 | // am- amelia |
| 82 | // -c- color |
| 83 | // -csm- category side menu |
| 84 | // -bgr background |
| 85 | .am-cat { |
| 86 | &__sidemenu { |
| 87 | --am-c-csm-bgr: var(--am-c-sb-bgr); |
| 88 | --am-c-csm-text: var(--am-c-sb-text); |
| 89 | --am-c-csm-primary: var(--am-c-primary); |
| 90 | |
| 91 | width: 100%; |
| 92 | max-width: 208px; |
| 93 | position: relative; |
| 94 | display: flex; |
| 95 | flex-direction: column; |
| 96 | background-color: var(--am-c-csm-bgr); |
| 97 | border-radius: 6px; |
| 98 | margin: 0 12px 0 0; |
| 99 | padding: 0 0 80px; |
| 100 | |
| 101 | &-item { |
| 102 | font-size: 14px; |
| 103 | font-weight: 500; |
| 104 | line-height: 1.42857; |
| 105 | text-overflow: ellipsis; |
| 106 | overflow: hidden; |
| 107 | white-space: nowrap; |
| 108 | color: var(--am-c-csm-text); |
| 109 | padding: 12px 8px; |
| 110 | margin: 0 0 2px; |
| 111 | border-radius: 6px; |
| 112 | cursor: pointer; |
| 113 | transition: all 0.2s ease-in-out; |
| 114 | |
| 115 | &:last-child { |
| 116 | margin-bottom: 0; |
| 117 | } |
| 118 | |
| 119 | &:hover { |
| 120 | background-color: var(--am-c-csm-text-op10); |
| 121 | } |
| 122 | |
| 123 | &.am-active { |
| 124 | color: var(--am-c-csm-primary); |
| 125 | background-color: var(--am-c-csm-primary-op10); |
| 126 | } |
| 127 | |
| 128 | &__wrapper { |
| 129 | margin: 8px; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | &-footer { |
| 134 | width: 100%; |
| 135 | position: absolute; |
| 136 | bottom: 0; |
| 137 | left: 0; |
| 138 | display: flex; |
| 139 | flex-direction: column; |
| 140 | align-items: center; |
| 141 | justify-content: center; |
| 142 | |
| 143 | &__text { |
| 144 | display: -webkit-box; |
| 145 | -webkit-line-clamp: 2; |
| 146 | -webkit-box-orient: vertical; |
| 147 | overflow: hidden; |
| 148 | text-overflow: ellipsis; |
| 149 | overflow: hidden; |
| 150 | text-align: center; |
| 151 | font-size: 14px; |
| 152 | font-weight: 500; |
| 153 | line-height: 1.428571; |
| 154 | color: var(--am-c-csm-text-op60); |
| 155 | } |
| 156 | |
| 157 | &__email { |
| 158 | display: -webkit-box; |
| 159 | -webkit-line-clamp: 2; |
| 160 | -webkit-box-orient: vertical; |
| 161 | overflow: hidden; |
| 162 | text-overflow: ellipsis; |
| 163 | overflow: hidden; |
| 164 | text-align: center; |
| 165 | color: var(--am-c-csm-text-op80); |
| 166 | text-decoration: none; |
| 167 | font-size: 14px; |
| 168 | font-weight: 400; |
| 169 | line-height: 1.428571; |
| 170 | |
| 171 | &:hover { |
| 172 | color: var(--am-c-csm-text); |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | .amelia-v2-booking #amelia-container { |
| 181 | @include catalog-sidebar; |
| 182 | } |
| 183 | |
| 184 | #amelia-app-backend-new #amelia-container { |
| 185 | @include catalog-sidebar; |
| 186 | } |
| 187 | </style> |