CustomizeCatalog.vue
1 year ago
CustomizeCustomerPanel.vue
1 year ago
CustomizeEmployeePanel.vue
1 year ago
CustomizeEventCalendar.vue
1 year ago
CustomizeEventList.vue
1 year ago
CustomizeSearch.vue
4 years ago
CustomizeStepNew.vue
1 year ago
CustomizeStepOld.vue
4 years ago
CustomizeStepNew.vue
761 lines
| 1 | <template> |
| 2 | <template v-if="!amCustomize.fonts.customFontSelected"> |
| 3 | <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 4 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 5 | <link rel="stylesheet" :href="`${baseUrls.wpAmeliaPluginURL}v3/src/assets/scss/common/fonts/font.css`" type="text/css" media="all"> |
| 6 | </template> |
| 7 | <div |
| 8 | id="amelia-container" |
| 9 | ref="ameliaContainer" |
| 10 | class="am-fs__wrapper" |
| 11 | :class="{'am-collapsed': sidebarCollapsed}" |
| 12 | :style="cssVars" |
| 13 | > |
| 14 | <SideBar |
| 15 | v-if="sidebarVisibility && containerWidth > 440" |
| 16 | class="am-fs-sb" |
| 17 | :class="{'am-collapsed': sidebarCollapsed}" |
| 18 | :style="{width: !sidebarCollapsed ? '240px' : '72px', paddingBottom: `${sidebarFooterHeight + 16}px` }" |
| 19 | > |
| 20 | <template #step-list> |
| 21 | <div class="am-fs-sb__step-wrapper" tabindex="0"> |
| 22 | <template v-if="stepsArray[stepIndex] !== congratulationsStep"> |
| 23 | <div |
| 24 | v-for="step in sidebarSteps" |
| 25 | :key="step.label" |
| 26 | class="am-fs-sb__step" |
| 27 | :class="useLicenceMenuClass(step.key, licence)" |
| 28 | > |
| 29 | <div class="am-fs-sb__step-inner"> |
| 30 | <div class="am-fs-sb__step-icon"> |
| 31 | <span :class="`am-icon-${step.icon}`"></span> |
| 32 | <span |
| 33 | v-if="step.key === 'cartStep'" |
| 34 | class="am-fs-sb__step-icon__number" |
| 35 | :class="sidebarCollapseItemsClass" |
| 36 | > |
| 37 | 3 |
| 38 | </span> |
| 39 | </div> |
| 40 | <transition name="fade"> |
| 41 | <p |
| 42 | v-if="!sidebarCollapsed" |
| 43 | class="am-fs-sb__step-heading" |
| 44 | :class="sidebarCollapseItemsClass" |
| 45 | > |
| 46 | {{ step.label }} |
| 47 | </p> |
| 48 | </transition> |
| 49 | <div |
| 50 | class="am-fs-sb__step-checker" |
| 51 | :class="[{'am-fs-sb__step-checker-selected': step.selected}, sidebarCollapseItemsClass]" |
| 52 | > |
| 53 | <transition name="fade"> |
| 54 | <span v-if="step.finished" class="am-icon-check"></span> |
| 55 | </transition> |
| 56 | </div> |
| 57 | </div> |
| 58 | <TransitionGroup |
| 59 | tag="span" |
| 60 | name="fade" |
| 61 | appear |
| 62 | class="am-fs-sb__step-selection__wrapper" |
| 63 | :class="{'am-fs-sb__step-selection-packages': step.key === packageAppointmentsStep.key && step.stepSelectedData.length > 3 }" |
| 64 | > |
| 65 | <p |
| 66 | v-for="(itemSelected, index) in step.stepSelectedData" |
| 67 | :key="itemSelected.position" |
| 68 | class="am-fs-sb__step-selection" |
| 69 | > |
| 70 | <span v-if="step.key !== packageAppointmentsStep.key || index < 3"> |
| 71 | {{ itemSelected.value }} |
| 72 | </span> |
| 73 | <span v-else> |
| 74 | {{ labelsDisplay('plus_more', 'sidebar') }} |
| 75 | </span> |
| 76 | </p> |
| 77 | </TransitionGroup> |
| 78 | </div> |
| 79 | </template> |
| 80 | <template v-else> |
| 81 | <div> |
| 82 | <transition name="fade"> |
| 83 | <AddToCalendar |
| 84 | v-if="!sidebarCollapsed" |
| 85 | :use-in-sb="true" |
| 86 | :calendar-string="labelsDisplay('add_to_calendar', 'congratulations')" |
| 87 | ></AddToCalendar> |
| 88 | </transition> |
| 89 | <div v-if="sidebarCollapsed" class="am-fs-sb__step"> |
| 90 | <div class="am-fs-sb__step-inner"> |
| 91 | <div class="am-fs-sb__step-icon"> |
| 92 | <span class="am-icon-pennant"></span> |
| 93 | </div> |
| 94 | <div |
| 95 | class="am-fs-sb__step-checker am-fs-sb__step-checker-selected" |
| 96 | :class="sidebarCollapseItemsClass" |
| 97 | > |
| 98 | <transition name="fade"> |
| 99 | <span class="am-icon-check"></span> |
| 100 | </transition> |
| 101 | </div> |
| 102 | </div> |
| 103 | </div> |
| 104 | </div> |
| 105 | </template> |
| 106 | </div> |
| 107 | </template> |
| 108 | <template #support-info> |
| 109 | <div |
| 110 | ref="sidebarFooterRef" |
| 111 | class="am-fs-sb__footer" |
| 112 | > |
| 113 | <div |
| 114 | v-if="amCustomize[pageRenderKey].sidebar.options.supportHeading.visibility || amCustomize[pageRenderKey].sidebar.options.companyPhone.visibility || amCustomize[pageRenderKey].sidebar.options.companyEmail.visibility" |
| 115 | class="am-fs-sb__support" |
| 116 | > |
| 117 | <transition name="fade"> |
| 118 | <div |
| 119 | v-if="!sidebarCollapsed && amCustomize[pageRenderKey].sidebar.options.supportHeading.visibility" |
| 120 | class="am-fs-sb__support-heading" |
| 121 | :class="sidebarCollapseItemsClass" |
| 122 | > |
| 123 | {{ labelsDisplay('get_in_touch', 'sidebar') }} |
| 124 | </div> |
| 125 | </transition> |
| 126 | <div |
| 127 | v-if="amCustomize[pageRenderKey].sidebar.options.companyPhone.visibility" |
| 128 | class="am-fs-sb__support-email" |
| 129 | > |
| 130 | <template v-if="!sidebarCollapsed"> |
| 131 | +111222333 |
| 132 | </template> |
| 133 | <template v-else> |
| 134 | <span class="am-icon-phone"></span> |
| 135 | </template> |
| 136 | </div> |
| 137 | <div |
| 138 | v-if="amCustomize[pageRenderKey].sidebar.options.companyEmail.visibility" |
| 139 | class="am-fs-sb__support-email" |
| 140 | > |
| 141 | <template v-if="!sidebarCollapsed"> |
| 142 | support@ameliatms.com |
| 143 | </template> |
| 144 | <template v-else> |
| 145 | <span class="am-icon-email"></span> |
| 146 | </template> |
| 147 | </div> |
| 148 | </div> |
| 149 | <div |
| 150 | class="am-fs-sb__menu" |
| 151 | :class="sidebarCollapseItemsClass" |
| 152 | @click="sidebarCollapsed = !sidebarCollapsed" |
| 153 | > |
| 154 | <Transition name="fade"> |
| 155 | <span |
| 156 | v-if="!sidebarCollapsed" |
| 157 | class="am-fs-sb__menu-text" |
| 158 | > |
| 159 | {{ labelsDisplay('collapse_menu', 'sidebar') }} |
| 160 | </span> |
| 161 | </Transition> |
| 162 | <span :class="`am-icon-arrow-circle-${sidebarCollapsed ? 'left' : 'right'}`"></span> |
| 163 | </div> |
| 164 | </div> |
| 165 | </template> |
| 166 | </SideBar> |
| 167 | <MainContent class="am-fs__main"> |
| 168 | <template v-if="stepsArray[stepIndex] !== congratulationsStep" #header> |
| 169 | <MainContentHeader |
| 170 | :sidebar-visible="amCustomize.sbsNew.sidebar.options.self.visibility" |
| 171 | ></MainContentHeader> |
| 172 | </template> |
| 173 | <template #step> |
| 174 | <component :is="stepsArray[stepIndex]" class="am-fs__main-content"></component> |
| 175 | </template> |
| 176 | <template #footer> |
| 177 | <MainContentFooter |
| 178 | :customized-labels="globalStepLabels()" |
| 179 | :primary-footer-button-type="amCustomize[pageRenderKey][stepName].options.primaryFooterButton.buttonType" |
| 180 | :secondary-footer-button-type="footerButtonType" |
| 181 | :second-button-show="!licence.isLite ? stepsArray[stepIndex] === congratulationsStep : false" |
| 182 | :add-to-cart-button-show="stepsArray[stepIndex] === cartStep" |
| 183 | :add-to-cart-button-type="amCustomize[pageRenderKey].cartStep.options.addToCart.buttonType" |
| 184 | :back-to-cart-button-show="!licence.isLite && !licence.isStarter && !licence.isBasic ? stepsArray.indexOf(cartStep) > stepIndex : false" |
| 185 | :back-to-cart-button-type="amCustomize[pageRenderKey].cartStep.options.backToCart.buttonType" |
| 186 | :back-to-cart-label="dedicatedStepLabel('cancel', 'cartStep')" |
| 187 | ></MainContentFooter> |
| 188 | </template> |
| 189 | </MainContent> |
| 190 | </div> |
| 191 | </template> |
| 192 | |
| 193 | <script setup> |
| 194 | // * Form construction |
| 195 | import SideBar from '../../../common/SbsFormConstruction/SideBar/SideBar.vue'; |
| 196 | import MainContent from '../../../common/SbsFormConstruction/MainContent/MainContent.vue'; |
| 197 | import MainContentHeader from '../../../common/SbsFormConstruction/MainContent/parts/MainContentHeader.vue' |
| 198 | import MainContentFooter from "../../../common/SbsFormConstruction/MainContent/parts/MainContentFooter.vue"; |
| 199 | |
| 200 | // * Parts |
| 201 | import AddToCalendar from '../steps/parts/AddToCalendar.vue' |
| 202 | |
| 203 | // * Step components |
| 204 | import InitStep from '../steps/InitStep.vue' |
| 205 | import Extras from '../steps/Extras.vue' |
| 206 | import DateTimeStep from '../steps/DateTimeStep.vue' |
| 207 | import CartStep from '../steps/CartStep.vue' |
| 208 | import RecurringStep from '../steps/RecurringStep.vue' |
| 209 | import RecurringSummary from '../steps/RecurringSummary.vue' |
| 210 | import InfoStep from '../steps/InfoStep.vue' |
| 211 | import PaymentStep from '../steps/PaymentStep.vue' |
| 212 | import Congratulations from '../steps/Congratulations.vue' |
| 213 | import PackageStep from '../steps/PackageStep.vue' |
| 214 | import PackageInfoStep from '../steps/PackageInfoStep.vue' |
| 215 | import PackageAppointmentsStep from '../steps/PackageAppointmentsStep.vue' |
| 216 | import PackageAppointmentsListStep from '../steps/PackageAppointmentsListStep.vue' |
| 217 | |
| 218 | // * Import from Vue |
| 219 | import { |
| 220 | ref, |
| 221 | provide, |
| 222 | inject, |
| 223 | markRaw, |
| 224 | watch, |
| 225 | watchEffect, |
| 226 | nextTick, |
| 227 | computed, |
| 228 | onBeforeMount, |
| 229 | onMounted |
| 230 | } from "vue"; |
| 231 | // * Import composables |
| 232 | import { usePopulateMultiDimensionalObject } from '../../../../assets/js/common/objectAndArrayManipulation.js' |
| 233 | import { defaultCustomizeSettings } from '../../../../assets/js/common/defaultCustomize.js' |
| 234 | import { useLicenceMenuClass } from '../../../../assets/js/admin/labelsAndOptionsTreatment.js' |
| 235 | |
| 236 | // * Plugin Licence |
| 237 | let licence = inject('licence') |
| 238 | |
| 239 | // * Base Urls |
| 240 | const baseUrls = inject('baseUrls') |
| 241 | |
| 242 | const amLabels = inject('labels') |
| 243 | let amTranslations = inject('translations') |
| 244 | let langKey = inject('langKey') |
| 245 | let stepName = inject('stepName') |
| 246 | let pageRenderKey = inject('pageRenderKey') |
| 247 | let amCustomize = inject('customize') |
| 248 | |
| 249 | let amFonts = computed(() => { |
| 250 | return amCustomize.value.fonts |
| 251 | }) |
| 252 | provide('amFonts', amFonts) |
| 253 | |
| 254 | // * Form Sidebar Collapse |
| 255 | let sidebarCollapsed = ref(false) |
| 256 | |
| 257 | let sidebarCollapseItemsClass = ref('') |
| 258 | |
| 259 | watch(sidebarCollapsed ,(current) => { |
| 260 | if (current) { |
| 261 | setTimeout(() => { |
| 262 | sidebarCollapseItemsClass.value = 'am-collapsed' |
| 263 | }, 1000) |
| 264 | } else { |
| 265 | sidebarCollapseItemsClass.value = '' |
| 266 | } |
| 267 | }) |
| 268 | |
| 269 | let sidebarFooterRef = ref(null) |
| 270 | let sidebarFooterHeight = ref(0) |
| 271 | |
| 272 | onMounted(() => { |
| 273 | if(sidebarFooterRef.value) { |
| 274 | setTimeout(() => { |
| 275 | sidebarFooterHeight.value = sidebarFooterRef.value.offsetHeight |
| 276 | }, 200) |
| 277 | } |
| 278 | }) |
| 279 | |
| 280 | const initStep = markRaw(InitStep) |
| 281 | const extras = markRaw(Extras) |
| 282 | const dateTimeStep = markRaw(DateTimeStep) |
| 283 | const cartStep = markRaw(CartStep) |
| 284 | const recurringStep = markRaw(RecurringStep) |
| 285 | const recurringSummary = markRaw(RecurringSummary) |
| 286 | const infoStep = markRaw(InfoStep) |
| 287 | const paymentStep = markRaw(PaymentStep) |
| 288 | const congratulationsStep = markRaw(Congratulations) |
| 289 | const packageStep = markRaw(PackageStep) |
| 290 | const packageInfoStep = markRaw(PackageInfoStep) |
| 291 | const packageAppointmentsStep = markRaw(PackageAppointmentsStep) |
| 292 | const packageAppointmentsListStep = markRaw(PackageAppointmentsListStep) |
| 293 | |
| 294 | let footerButtonType = computed(() => { |
| 295 | return amCustomize.value[pageRenderKey.value][stepName.value].options.secondaryFooterButton |
| 296 | ? amCustomize.value[pageRenderKey.value][stepName.value].options.secondaryFooterButton.buttonType |
| 297 | : 'text' |
| 298 | }) |
| 299 | |
| 300 | function getServiceFlow () { |
| 301 | let values = [] |
| 302 | |
| 303 | values.push(initStep) |
| 304 | |
| 305 | if (licence.isStarter || licence.isBasic || licence.isPro || licence.isDeveloper) { |
| 306 | values.push(extras) |
| 307 | } |
| 308 | |
| 309 | values.push(dateTimeStep) |
| 310 | |
| 311 | if (licence.isPro || licence.isDeveloper) { |
| 312 | values.push(cartStep) |
| 313 | } |
| 314 | |
| 315 | if (licence.isBasic || licence.isPro || licence.isDeveloper) { |
| 316 | values.push(recurringStep) |
| 317 | |
| 318 | values.push(recurringSummary) |
| 319 | } |
| 320 | |
| 321 | values.push(infoStep) |
| 322 | |
| 323 | values.push(paymentStep) |
| 324 | |
| 325 | values.push(congratulationsStep) |
| 326 | |
| 327 | return values |
| 328 | } |
| 329 | |
| 330 | let bookableType = inject('bookableType') |
| 331 | let serviceFlow = getServiceFlow() |
| 332 | |
| 333 | let packageFlow = [ |
| 334 | packageStep, |
| 335 | packageInfoStep, |
| 336 | packageAppointmentsStep, |
| 337 | packageAppointmentsListStep, |
| 338 | infoStep, |
| 339 | paymentStep, |
| 340 | congratulationsStep |
| 341 | ] |
| 342 | |
| 343 | let stepsArray = computed(() => { |
| 344 | if (bookableType.value === 'package') { |
| 345 | return packageFlow |
| 346 | } |
| 347 | |
| 348 | return serviceFlow |
| 349 | }) |
| 350 | |
| 351 | // * Step index |
| 352 | let stepIndex = inject('stepIndex') |
| 353 | |
| 354 | // * Array of Sidebar steps |
| 355 | const sidebarSteps = ref([]) |
| 356 | provide('sidebarSteps', sidebarSteps) |
| 357 | |
| 358 | // * Monitoring step index for step selection |
| 359 | watch(stepIndex, (currStepIndex) => { |
| 360 | if ('key' in stepsArray.value[stepIndex.value] && |
| 361 | currStepIndex in sidebarSteps.value && |
| 362 | 'selected' in sidebarSteps.value[currStepIndex] && |
| 363 | 'finished' in sidebarSteps.value[currStepIndex] && |
| 364 | stepsArray.value[stepIndex.value].key !== 'congratulations' |
| 365 | ) { |
| 366 | sidebarSteps.value[currStepIndex].selected = true |
| 367 | sidebarSteps.value[currStepIndex].finished = true |
| 368 | } |
| 369 | }) |
| 370 | |
| 371 | /** |
| 372 | * Collecting and rearranging selected data in form sidebar based on item position in form |
| 373 | * @param data |
| 374 | */ |
| 375 | function sidebarDataCollector (data) { |
| 376 | // Determines are selected data already exists |
| 377 | if (sidebarSteps.value[stepIndex.value].stepSelectedData.filter(item => item.reference === data.reference).length) { |
| 378 | sidebarSteps.value[stepIndex.value].stepSelectedData.forEach((item, index, array) => { |
| 379 | // Handles changing value of existing data |
| 380 | if ((item.reference === data.reference) && data.value) { |
| 381 | item.value = data.value |
| 382 | } |
| 383 | |
| 384 | // Removes un-selected form data from sidebar array |
| 385 | if ((item.reference === data.reference) && !data.value) { |
| 386 | array.splice(index, 1) |
| 387 | } |
| 388 | }) |
| 389 | } else { |
| 390 | // Handles the selection of new data |
| 391 | sidebarSteps.value[stepIndex.value].stepSelectedData.push(data) |
| 392 | } |
| 393 | |
| 394 | // Rearranges data in sidebar based on item position in the form |
| 395 | sidebarSteps.value[stepIndex.value].stepSelectedData.sort((a, b) => { |
| 396 | return a.position - b.position |
| 397 | }) |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Function that creates Data Array for SideBar |
| 402 | */ |
| 403 | function sidebarDataCreator () { |
| 404 | stepsArray.value.forEach((item, index) => { |
| 405 | if ('key' in item && item.key !== 'congratulations') { |
| 406 | let stepLabels = amCustomize.value[pageRenderKey.value][item.key].translations |
| 407 | let labelKey = item.sidebarData.label |
| 408 | let heading = stepLabels && stepLabels[labelKey] ? stepLabels[labelKey][langKey.value] : amLabels[labelKey] |
| 409 | |
| 410 | if (item.name !== "CongratulationsStep") { |
| 411 | let step = { |
| 412 | key: item.key, |
| 413 | label: heading, |
| 414 | icon: item.sidebarData.icon, |
| 415 | labelKey: labelKey, |
| 416 | stepSelectedData: [], |
| 417 | finished: false, |
| 418 | selected: index === stepIndex.value, |
| 419 | } |
| 420 | sidebarSteps.value.splice(index, 0, step) |
| 421 | } |
| 422 | } |
| 423 | }) |
| 424 | } |
| 425 | |
| 426 | watch(bookableType, () => { |
| 427 | sidebarSteps.value = [] |
| 428 | sidebarDataCreator() |
| 429 | }) |
| 430 | |
| 431 | watchEffect( () => { |
| 432 | stepName.value = stepsArray.value[stepIndex.value].key |
| 433 | |
| 434 | if (pageRenderKey.value === 'sbsNew') { |
| 435 | sidebarSteps.value.forEach(item => { |
| 436 | if ( |
| 437 | amCustomize.value[pageRenderKey.value][item.key].translations && |
| 438 | amCustomize.value[pageRenderKey.value][item.key].translations[item.labelKey] && |
| 439 | amCustomize.value[pageRenderKey.value][item.key].translations[item.labelKey][langKey.value] |
| 440 | ) { |
| 441 | item.label = amCustomize.value[pageRenderKey.value][item.key].translations[item.labelKey][langKey.value] |
| 442 | } else { |
| 443 | item.label = amLabels[item.labelKey] |
| 444 | } |
| 445 | }) |
| 446 | } |
| 447 | }) |
| 448 | |
| 449 | provide('sidebarStepsFunctions', { |
| 450 | sidebarDataCollector |
| 451 | }) |
| 452 | |
| 453 | let { pageNameHandler } = inject('headerFunctionality', { |
| 454 | pageNameHandler: () => 'Step-by-Step Booking Form' |
| 455 | }) |
| 456 | |
| 457 | pageNameHandler('Step-by-Step Booking Form') |
| 458 | |
| 459 | // * implementation of saved labels into amTranslation object |
| 460 | let stepKey = ref('') |
| 461 | function savedLabelsImplementation (labelObj) { |
| 462 | Object.keys(labelObj).forEach((labelKey) => { |
| 463 | if (labelKey in amCustomize.value[pageRenderKey.value][stepKey.value].translations) { |
| 464 | labelObj[labelKey] = {...labelObj[labelKey], ...amCustomize.value[pageRenderKey.value][stepKey.value].translations[labelKey]} |
| 465 | } |
| 466 | }) |
| 467 | } |
| 468 | |
| 469 | // * Component reference |
| 470 | let ameliaContainer = ref(null) |
| 471 | |
| 472 | // * Plugin wrapper width |
| 473 | let containerWidth = ref() |
| 474 | provide('containerWidth', containerWidth) |
| 475 | |
| 476 | // * window resize listener |
| 477 | window.addEventListener('resize', resize); |
| 478 | |
| 479 | // * resize function |
| 480 | function resize() { |
| 481 | if (ameliaContainer.value) { |
| 482 | containerWidth.value = ameliaContainer.value.offsetWidth |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | onMounted(() => { |
| 487 | containerWidth.value = ameliaContainer.value.offsetWidth |
| 488 | |
| 489 | if (amCustomize.value.fonts.customFontSelected) { |
| 490 | activateCustomFontStyles() |
| 491 | } |
| 492 | }) |
| 493 | |
| 494 | function activateCustomFontStyles () { |
| 495 | let head = document.head || document.getElementsByTagName('head')[0] |
| 496 | if (head.querySelector('#amCustomFont')) { |
| 497 | head.querySelector('#amCustomFont').remove() |
| 498 | } |
| 499 | |
| 500 | let css = `@font-face {font-family: '${amCustomize.value.fonts.fontFamily}'; src: url(${amCustomize.value.fonts.fontUrl});}` |
| 501 | let style = document.createElement('style') |
| 502 | head.appendChild(style) |
| 503 | style.setAttribute('type', 'text/css') |
| 504 | style.setAttribute('id', 'amCustomFont') |
| 505 | style.appendChild(document.createTextNode(css)) |
| 506 | } |
| 507 | |
| 508 | let sidebarVisibility = computed(() => { |
| 509 | nextTick(() => { |
| 510 | resize() |
| 511 | }) |
| 512 | return amCustomize.value.sbsNew.sidebar.options.self.visibility |
| 513 | }) |
| 514 | |
| 515 | /** |
| 516 | * Lifecycle Hooks |
| 517 | */ |
| 518 | onBeforeMount(() => { |
| 519 | window.scrollTo({ |
| 520 | top: 0, |
| 521 | left: 0, |
| 522 | behavior: 'smooth' |
| 523 | }) |
| 524 | sidebarDataCreator() |
| 525 | Object.keys(amCustomize.value[pageRenderKey.value]).forEach(step => { |
| 526 | // ! Customize ce puci ako se korisnik vrati na predthodnu verziju plugin_a gde ne postoje odradjeni stepovi |
| 527 | // ! a u bazi je sacuvan customize sa tim stepovima -- resenje je da se resetuje forma ili da se ubaci u uslov ispod |
| 528 | // ! amTranslations[pageRenderKey.value][step] |
| 529 | if (step !== 'colors' && amCustomize.value[pageRenderKey.value][step].translations) { |
| 530 | stepKey.value = step |
| 531 | usePopulateMultiDimensionalObject('labels', amTranslations[pageRenderKey.value][step], savedLabelsImplementation) |
| 532 | } |
| 533 | }) |
| 534 | }) |
| 535 | |
| 536 | function globalStepLabels () { |
| 537 | let stepLabels = {} |
| 538 | let customizedLabels = amCustomize.value[pageRenderKey.value][stepName.value].translations |
| 539 | if (customizedLabels && Object.keys(customizedLabels)) { |
| 540 | Object.keys(amCustomize.value[pageRenderKey.value][stepName.value].translations).forEach(label => { |
| 541 | stepLabels[label] = amCustomize.value[pageRenderKey.value][stepName.value].translations[label][langKey.value] |
| 542 | }) |
| 543 | } else { |
| 544 | stepLabels = {} |
| 545 | } |
| 546 | |
| 547 | return stepLabels |
| 548 | } |
| 549 | |
| 550 | function dedicatedStepLabel (label, stepKey) { |
| 551 | let computedLabel = computed(() => { |
| 552 | return amCustomize.value[pageRenderKey.value][stepKey].translations |
| 553 | && amCustomize.value[pageRenderKey.value][stepKey].translations[label] |
| 554 | && amCustomize.value[pageRenderKey.value][stepKey].translations[label][langKey.value] |
| 555 | ? amCustomize.value[pageRenderKey.value][stepKey].translations[label][langKey.value] |
| 556 | : amLabels[label] |
| 557 | }) |
| 558 | |
| 559 | return computedLabel.value |
| 560 | } |
| 561 | |
| 562 | // * Label computed function |
| 563 | function labelsDisplay (label, stepKey) { |
| 564 | let computedLabel = computed(() => { |
| 565 | return amCustomize.value[pageRenderKey.value][stepKey].translations |
| 566 | && amCustomize.value[pageRenderKey.value][stepKey].translations[label] |
| 567 | && amCustomize.value[pageRenderKey.value][stepKey].translations[label][langKey.value] |
| 568 | ? amCustomize.value[pageRenderKey.value][stepKey].translations[label][langKey.value] |
| 569 | : amLabels[label] |
| 570 | }) |
| 571 | |
| 572 | return computedLabel.value |
| 573 | } |
| 574 | |
| 575 | // * Colors |
| 576 | // * Customize colors |
| 577 | let amColors = computed(() => { |
| 578 | return amCustomize.value[pageRenderKey.value] ? amCustomize.value[pageRenderKey.value].colors : defaultCustomizeSettings[pageRenderKey.value].colors |
| 579 | }) |
| 580 | |
| 581 | provide('amColors', amColors); |
| 582 | let cssVars = computed(() => { |
| 583 | return { |
| 584 | '--am-c-primary': amColors.value.colorPrimary, |
| 585 | '--am-c-success': amColors.value.colorSuccess, |
| 586 | '--am-c-error': amColors.value.colorError, |
| 587 | '--am-c-warning': amColors.value.colorWarning, |
| 588 | // input global colors - usage input, textarea, checkbox, radio button, select input, adv select input |
| 589 | '--am-c-inp-bgr': amColors.value.colorInpBgr, |
| 590 | '--am-c-inp-border': amColors.value.colorInpBorder, |
| 591 | '--am-c-inp-text': amColors.value.colorInpText, |
| 592 | '--am-c-inp-placeholder': amColors.value.colorInpPlaceHolder, |
| 593 | // dropdown global colors - usage select dropdown, adv select dropdown |
| 594 | '--am-c-drop-bgr': amColors.value.colorDropBgr, |
| 595 | '--am-c-drop-text': amColors.value.colorDropText, |
| 596 | // sidebar container colors - left part of the form |
| 597 | '--am-c-sb-bgr': amColors.value.colorSbBgr, |
| 598 | '--am-c-sb-text': amColors.value.colorSbText, |
| 599 | // main container colors - right part of the form |
| 600 | '--am-c-main-bgr': amColors.value.colorMainBgr, |
| 601 | '--am-c-main-heading-text': amColors.value.colorMainHeadingText, |
| 602 | '--am-c-main-text': amColors.value.colorMainText, |
| 603 | // button global colors |
| 604 | '--am-c-btn-prim': amColors.value.colorBtnPrim, |
| 605 | '--am-c-btn-prim-text': amColors.value.colorBtnPrimText, |
| 606 | '--am-c-btn-sec': amColors.value.colorBtnSec, |
| 607 | '--am-c-btn-sec-text': amColors.value.colorBtnSecText, |
| 608 | '--am-font-family': amCustomize.value.fonts.fontFamily, |
| 609 | // css properties |
| 610 | // -mw- max width |
| 611 | // -brad- border-radius |
| 612 | '--am-mw-main': amCustomize.value.sbsNew.sidebar.options.self.visibility ? sidebarCollapsed.value ? '592px' : '760px' : '520px', |
| 613 | '--am-brad-main': amCustomize.value.sbsNew.sidebar.options.self.visibility ? '0 0.5rem 0.5rem 0' : '0.5rem' |
| 614 | } |
| 615 | }) |
| 616 | </script> |
| 617 | |
| 618 | <script> |
| 619 | export default { |
| 620 | name: "CustomizeStepNew" |
| 621 | } |
| 622 | </script> |
| 623 | |
| 624 | <style lang="scss"> |
| 625 | @import '../../../../assets/scss/common/reset/reset'; |
| 626 | |
| 627 | :root { |
| 628 | // Colors |
| 629 | // shortcuts |
| 630 | // -c- color |
| 631 | // -bgr- background |
| 632 | // -prim- primary |
| 633 | // -sec- secondary |
| 634 | // primitive colors |
| 635 | --am-c-primary: #{$blue-1000}; |
| 636 | --am-c-success: #{$green-1000}; |
| 637 | --am-c-error: #{$red-900}; |
| 638 | --am-c-warning: #{$yellow-1000}; |
| 639 | // main container colors - right part of the form |
| 640 | --am-c-main-bgr: #{$blue-900}; |
| 641 | --am-c-main-heading-text: #{$shade-800}; |
| 642 | --am-c-main-text: #{$shade-900}; |
| 643 | // sidebar container colors - left part of the form |
| 644 | --am-c-sb-bgr: #17295A; |
| 645 | --am-c-sb-text: #{$am-white}; |
| 646 | // input global colors - usage input, textarea, checkbox, radio button, select input, adv select input |
| 647 | --am-c-inp-bgr: #{$blue-900}; |
| 648 | --am-c-inp-border: #{$shade-250}; |
| 649 | --am-c-inp-text: #{$shade-900}; |
| 650 | --am-c-inp-placeholder: #{$shade-500}; |
| 651 | --am-c-checkbox-border: #{$shade-300}; |
| 652 | --am-c-checkbox-border-disabled: #{$blue-600}; |
| 653 | --am-c-checkbox-border-focused: #{$blue-700}; |
| 654 | --am-c-checkbox-label-disabled: #{$shade-600}; |
| 655 | // dropdown global colors - usage select dropdown, adv select dropdown |
| 656 | --am-c-drop-bgr: #{$am-white}; |
| 657 | --am-c-drop-text: #{$shade-1000}; |
| 658 | // button global colors |
| 659 | --am-c-btn-prim: #{$blue-900}; |
| 660 | --am-c-btn-prim-text: #{$am-white}; |
| 661 | --am-c-btn-sec: #{$am-white}; |
| 662 | --am-c-btn-sec-text: #{$shade-900}; |
| 663 | |
| 664 | // Properties |
| 665 | // shortcuts |
| 666 | // -h- height |
| 667 | // -fs- font size |
| 668 | // -rad- border radius |
| 669 | --am-h-inp: 40px; |
| 670 | --am-fs-inp: 15px; |
| 671 | --am-rad-inp: 6px; |
| 672 | --am-fs-label: 15px; |
| 673 | --am-fs-btn: 15px; |
| 674 | |
| 675 | // Font |
| 676 | --am-font-family: 'Amelia Roboto', sans-serif; |
| 677 | } |
| 678 | |
| 679 | //@import url('https://fonts.googleapis.com/css2?family=Rampart+One&display=swap'); |
| 680 | // am -- amelia |
| 681 | // fs -- form steps |
| 682 | // sb -- sidebar |
| 683 | #amelia-app-backend-new { |
| 684 | * { |
| 685 | font-family: var(--am-font-family); |
| 686 | font-style: initial; |
| 687 | box-sizing: border-box; |
| 688 | } |
| 689 | |
| 690 | #amelia-container { |
| 691 | &.am-fs { |
| 692 | // Container Wrapper |
| 693 | &__wrapper { |
| 694 | display: flex; |
| 695 | justify-content: center; |
| 696 | max-width: var(--am-mw-main); |
| 697 | height: 560px; |
| 698 | width: 100%; |
| 699 | box-shadow: 0 30px 40px rgba(0, 0, 0, 0.12); |
| 700 | margin: 16px auto 48px; |
| 701 | border-radius: 8px; |
| 702 | transition: max-width 0.3s ease-in-out; |
| 703 | |
| 704 | &.am-collapsed { |
| 705 | transition-delay: 1s; |
| 706 | } |
| 707 | |
| 708 | .el-form { |
| 709 | &-item { |
| 710 | display: block; |
| 711 | font-family: var(--am-font-family); |
| 712 | font-size: var(--am-fs-label); |
| 713 | margin-bottom: 24px; |
| 714 | |
| 715 | &__label { |
| 716 | flex: 0 0 auto; |
| 717 | text-align: left; |
| 718 | font-size: var(--am-fs-label); |
| 719 | line-height: 1.3; |
| 720 | color: var(--am-c-main-text); |
| 721 | box-sizing: border-box; |
| 722 | margin: 0; |
| 723 | |
| 724 | &:before { |
| 725 | color: var(--am-c-error); |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | &__content { |
| 730 | display: flex; |
| 731 | flex-wrap: wrap; |
| 732 | align-items: center; |
| 733 | flex: 1; |
| 734 | position: relative; |
| 735 | font-size: var(--am-fs-inp); |
| 736 | min-width: 0; |
| 737 | } |
| 738 | |
| 739 | &__error { |
| 740 | font-size: 12px; |
| 741 | color: var(--am-c-error); |
| 742 | padding-top: 4px; |
| 743 | } |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | .el-input { |
| 748 | &__inner { |
| 749 | margin: 0; |
| 750 | } |
| 751 | } |
| 752 | } |
| 753 | } |
| 754 | } |
| 755 | |
| 756 | .am-dialog-cs { |
| 757 | z-index: 10000 !important; |
| 758 | } |
| 759 | } |
| 760 | </style> |
| 761 |