MoreInfoPopup.vue
400 lines
| 1 | <template> |
| 2 | <AmSlidePopup |
| 3 | v-if="props.visibility" |
| 4 | :visibility="props.visibility" |
| 5 | class="am-fs-iipu" |
| 6 | :footer-visibility="false" |
| 7 | :custom-css="cssVars" |
| 8 | @update:visibility="(value) => emits('update:visibility', value)" |
| 9 | > |
| 10 | <template #header> |
| 11 | <div class="am-fs-iipu__header" :aria-label="props.heading"> |
| 12 | {{ props.heading }} |
| 13 | </div> |
| 14 | </template> |
| 15 | <div class="am-fs-iipu__content"> |
| 16 | <div class="am-fs-iipu__heading"> |
| 17 | <img :src="usePictureLoad(baseUrls, props.item, props.isPerson)" :alt="props.itemName" /> |
| 18 | <div class="am-fs-iipu__name">{{ props.itemName }}</div> |
| 19 | </div> |
| 20 | |
| 21 | <!-- EMPLOYEES --> |
| 22 | <div v-if="props.employeesData.length" class="am-fs-iipu__employee"> |
| 23 | <div class="am-fs-iipu__employee-label"> |
| 24 | {{ `${props.employeesHeading}:` }} |
| 25 | </div> |
| 26 | <div class="am-fs-iipu__employee-wrapper" @click="expandEmployeesData()"> |
| 27 | <img |
| 28 | v-for="employee in props.employeesData" |
| 29 | :key="employee.id" |
| 30 | class="am-fs-iipu__employee-img" |
| 31 | :src="usePictureLoad(baseUrls, employee, true)" |
| 32 | :alt="`${employee.firstName} ${employee.lastName}`" |
| 33 | /> |
| 34 | </div> |
| 35 | <div v-if="expandEmployees" class="am-fs-iipu__employee-display__wrapper"> |
| 36 | <div |
| 37 | v-for="employee in props.employeesData" |
| 38 | :key="employee.id" |
| 39 | class="am-fs-iipu__employee-display" |
| 40 | > |
| 41 | <img |
| 42 | :src="usePictureLoad(baseUrls, employee, true)" |
| 43 | :alt="`${employee.firstName} ${employee.lastName}`" |
| 44 | /> |
| 45 | |
| 46 | <div class="am-fs-iipu__employee-display-name"> |
| 47 | {{ employee.firstName }} {{ employee.lastName }} |
| 48 | </div> |
| 49 | |
| 50 | <div class="am-fs-iipu__employee-display-price"> |
| 51 | {{ employee.price }} |
| 52 | </div> |
| 53 | </div> |
| 54 | </div> |
| 55 | </div> |
| 56 | <!-- /EMPLOYEES --> |
| 57 | |
| 58 | <!-- LOCATIONS --> |
| 59 | <div v-if="props.locationsData.length" class="am-fs-iipu__location"> |
| 60 | <div class="am-fs-iipu__location-label"> |
| 61 | {{ `${props.locationsHeading}:` }} |
| 62 | </div> |
| 63 | <div class="am-fs-iipu__location-wrapper"> |
| 64 | <div |
| 65 | v-for="location in props.locationsData" |
| 66 | :key="location.id" |
| 67 | class="am-fs-iipu__location-inner" |
| 68 | > |
| 69 | <span> |
| 70 | {{ location.name }} |
| 71 | <template v-if="location.address"> - </template> |
| 72 | </span> |
| 73 | <a |
| 74 | v-if="location.address" |
| 75 | class="am-cc__data-text" |
| 76 | :href="`https://maps.google.com/?q=${location.address}`" |
| 77 | target="_blank" |
| 78 | tabindex="-1" |
| 79 | > |
| 80 | {{ location.address }} |
| 81 | </a> |
| 82 | </div> |
| 83 | </div> |
| 84 | </div> |
| 85 | <!-- /LOCATIONS --> |
| 86 | |
| 87 | <!-- DESCRIPTION --> |
| 88 | <div |
| 89 | v-if="useDescriptionVisibility(props.item.description)" |
| 90 | class="am-fs-iipu__description ql-description" |
| 91 | :style="props.plainText ? 'white-space: pre-wrap' : ''" |
| 92 | v-html="props.item.description" |
| 93 | /> |
| 94 | <!-- /DESCRIPTION --> |
| 95 | </div> |
| 96 | </AmSlidePopup> |
| 97 | </template> |
| 98 | |
| 99 | <script setup> |
| 100 | // * Import from Vue |
| 101 | import { computed, inject, ref } from 'vue' |
| 102 | |
| 103 | // * Composables |
| 104 | import { usePictureLoad } from '../../../../assets/js/common/image' |
| 105 | import { useDescriptionVisibility } from '../../../../assets/js/common/helper' |
| 106 | import { useColorTransparency } from '../../../../assets/js/common/colorManipulation' |
| 107 | |
| 108 | // * Components |
| 109 | import AmSlidePopup from '../../../_components/slide-popup/AmSlidePopup.vue' |
| 110 | |
| 111 | const props = defineProps({ |
| 112 | visibility: { |
| 113 | type: Boolean, |
| 114 | default: false, |
| 115 | }, |
| 116 | heading: { |
| 117 | type: String, |
| 118 | required: '', |
| 119 | }, |
| 120 | item: { |
| 121 | type: Object, |
| 122 | required: true, |
| 123 | }, |
| 124 | itemName: { |
| 125 | type: String, |
| 126 | required: true, |
| 127 | }, |
| 128 | isPerson: { |
| 129 | type: Boolean, |
| 130 | default: false, |
| 131 | }, |
| 132 | employeesHeading: { |
| 133 | type: String, |
| 134 | default: 'Employees', |
| 135 | }, |
| 136 | employeesData: { |
| 137 | type: Array, |
| 138 | default: () => [], |
| 139 | }, |
| 140 | locationsHeading: { |
| 141 | type: String, |
| 142 | default: 'Locations', |
| 143 | }, |
| 144 | locationsData: { |
| 145 | type: Array, |
| 146 | default: () => [], |
| 147 | }, |
| 148 | plainText: { |
| 149 | type: Boolean, |
| 150 | default: false, |
| 151 | }, |
| 152 | }) |
| 153 | |
| 154 | const emits = defineEmits(['update:visibility']) |
| 155 | |
| 156 | // * Base URLs |
| 157 | const baseUrls = inject('baseUrls') |
| 158 | |
| 159 | // * EMPLOYEES |
| 160 | let expandEmployees = ref(false) |
| 161 | function expandEmployeesData() { |
| 162 | expandEmployees.value = !expandEmployees.value |
| 163 | } |
| 164 | |
| 165 | const amColors = inject( |
| 166 | 'amColors', |
| 167 | ref({ |
| 168 | colorPrimary: '#1246D6', |
| 169 | colorSuccess: '#019719', |
| 170 | colorError: '#B4190F', |
| 171 | colorWarning: '#CCA20C', |
| 172 | colorMainBgr: '#FFFFFF', |
| 173 | colorMainHeadingText: '#33434C', |
| 174 | colorMainText: '#1A2C37', |
| 175 | colorSbBgr: '#17295A', |
| 176 | colorSbText: '#FFFFFF', |
| 177 | colorInpBgr: '#FFFFFF', |
| 178 | colorInpBorder: '#D1D5D7', |
| 179 | colorInpText: '#1A2C37', |
| 180 | colorInpPlaceHolder: '#808A90', |
| 181 | colorDropBgr: '#FFFFFF', |
| 182 | colorDropBorder: '#D1D5D7', |
| 183 | colorDropText: '#0E1920', |
| 184 | colorBtnPrim: '#265CF2', |
| 185 | colorBtnPrimText: '#FFFFFF', |
| 186 | colorBtnSec: '#1A2C37', |
| 187 | colorBtnSecText: '#FFFFFF', |
| 188 | }), |
| 189 | ) |
| 190 | |
| 191 | let cssVars = computed(() => { |
| 192 | return { |
| 193 | '--am-c-primary-op05': useColorTransparency(amColors.value.colorPrimary, 0.05), |
| 194 | } |
| 195 | }) |
| 196 | </script> |
| 197 | |
| 198 | <style lang="scss"> |
| 199 | @import '../../../../../src/assets/scss/common/quill/_quill-mixin.scss'; |
| 200 | |
| 201 | @mixin init-info-popup { |
| 202 | // iipu - init info popup |
| 203 | .am-fs-iipu { |
| 204 | .am-slide-popup__block-header { |
| 205 | margin-bottom: 16px; |
| 206 | } |
| 207 | |
| 208 | &__header { |
| 209 | font-size: 15px; |
| 210 | font-weight: 500; |
| 211 | line-height: 1.6; |
| 212 | color: var(--am-c-main-heading-text); |
| 213 | } |
| 214 | |
| 215 | &__content { |
| 216 | display: flex; |
| 217 | flex-direction: column; |
| 218 | gap: 8px; |
| 219 | max-height: 426px; |
| 220 | overflow-x: hidden; |
| 221 | |
| 222 | // Scroll styles |
| 223 | &::-webkit-scrollbar { |
| 224 | width: 6px; |
| 225 | } |
| 226 | |
| 227 | &::-webkit-scrollbar-thumb { |
| 228 | border-radius: 6px; |
| 229 | background: var(--am-c-scroll-op30); |
| 230 | } |
| 231 | |
| 232 | &::-webkit-scrollbar-track { |
| 233 | border-radius: 6px; |
| 234 | background: var(--am-c-scroll-op10); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | &__heading { |
| 239 | display: flex; |
| 240 | align-items: center; |
| 241 | gap: 8px 12px; |
| 242 | |
| 243 | img { |
| 244 | width: 54px; |
| 245 | height: 54px; |
| 246 | border-radius: 50%; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | &__name { |
| 251 | font-size: 15px; |
| 252 | font-weight: 500; |
| 253 | line-height: 1.55556; |
| 254 | color: var(--am-c-main-text); |
| 255 | } |
| 256 | |
| 257 | // Employee section |
| 258 | &__employee { |
| 259 | display: flex; |
| 260 | flex-wrap: wrap; |
| 261 | align-items: center; |
| 262 | justify-content: flex-start; |
| 263 | gap: 8px; |
| 264 | |
| 265 | &-wrapper { |
| 266 | display: flex; |
| 267 | align-items: center; |
| 268 | cursor: pointer; |
| 269 | } |
| 270 | |
| 271 | &-label { |
| 272 | font-size: 15px; |
| 273 | font-weight: 500; |
| 274 | line-height: 1.42857; |
| 275 | color: var(--am-c-main-text); |
| 276 | text-transform: capitalize; |
| 277 | } |
| 278 | |
| 279 | &-img { |
| 280 | width: 32px; |
| 281 | height: 32px; |
| 282 | border-radius: 50%; |
| 283 | box-shadow: 0 0 0 2px var(--am-c-main-bgr); |
| 284 | margin-left: -8px; |
| 285 | |
| 286 | &:first-child { |
| 287 | margin-left: 0; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | &-display { |
| 292 | width: 100%; |
| 293 | display: flex; |
| 294 | flex-direction: row; |
| 295 | align-items: center; |
| 296 | gap: 4px 8px; |
| 297 | |
| 298 | &__wrapper { |
| 299 | width: 100%; |
| 300 | display: flex; |
| 301 | flex-direction: column; |
| 302 | gap: 8px; |
| 303 | border-bottom: 1px solid var(--am-c-inp-border); |
| 304 | padding: 0 0 8px; |
| 305 | } |
| 306 | |
| 307 | img { |
| 308 | width: 34px; |
| 309 | height: 34px; |
| 310 | border-radius: 50%; |
| 311 | } |
| 312 | |
| 313 | &-name { |
| 314 | font-size: 14px; |
| 315 | font-weight: 400; |
| 316 | line-height: 1.42857; |
| 317 | color: var(--am-c-main-text); |
| 318 | } |
| 319 | |
| 320 | &-price { |
| 321 | font-size: 13px; |
| 322 | font-weight: 500; |
| 323 | line-height: 1.38462; |
| 324 | color: var(--am-c-primary); |
| 325 | margin-left: auto; |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | // Location section |
| 331 | &__location { |
| 332 | display: flex; |
| 333 | flex-wrap: wrap; |
| 334 | align-items: center; |
| 335 | justify-content: flex-start; |
| 336 | gap: 4px 0; |
| 337 | |
| 338 | &-label { |
| 339 | font-size: 15px; |
| 340 | font-weight: 500; |
| 341 | line-height: 1.42857; |
| 342 | color: var(--am-c-main-text); |
| 343 | text-transform: capitalize; |
| 344 | } |
| 345 | |
| 346 | &-wrapper { |
| 347 | display: flex; |
| 348 | flex-direction: column; |
| 349 | gap: 4px; |
| 350 | width: 100%; |
| 351 | background-color: var(--am-c-primary-op05); |
| 352 | border-radius: 6px; |
| 353 | padding: 6px 12px; |
| 354 | } |
| 355 | |
| 356 | &-inner { |
| 357 | color: var(--am-c-main-text); |
| 358 | padding: 2px 0; |
| 359 | border-radius: 6px; |
| 360 | white-space: nowrap; |
| 361 | overflow: hidden; |
| 362 | text-overflow: ellipsis; |
| 363 | width: 100%; |
| 364 | |
| 365 | & span { |
| 366 | font-weight: 400; |
| 367 | font-size: 14px; |
| 368 | line-height: 24px; |
| 369 | } |
| 370 | |
| 371 | & a { |
| 372 | color: var(--am-c-primary); |
| 373 | text-decoration: none; |
| 374 | font-weight: 400; |
| 375 | font-size: 14px; |
| 376 | line-height: 24px; |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | // Description section |
| 382 | &__description { |
| 383 | color: var(--am-c-main-text); |
| 384 | |
| 385 | &.ql-description { |
| 386 | @include quill-styles; |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | .amelia-v2-booking #amelia-container { |
| 393 | @include init-info-popup; |
| 394 | } |
| 395 | |
| 396 | #amelia-app-backend-new #amelia-container { |
| 397 | @include init-info-popup; |
| 398 | } |
| 399 | </style> |
| 400 |