ameliabooking
/
v3
/
src
/
views
/
common
/
SbsFormConstruction
/
MainContent
/
parts
/
MainProfileFooter.vue
ameliabooking
/
v3
/
src
/
views
/
common
/
SbsFormConstruction
/
MainContent
/
parts
Last commit date
MainContentFooter.vue
5 days ago
MainContentHeader.vue
2 weeks ago
MainPanelHeader.vue
1 month ago
MainProfileFooter.vue
1 month ago
MainProfileFooter.vue
158 lines
| 1 | <template> |
| 2 | <div class="am-cappf" :style="cssVars"> |
| 3 | <div |
| 4 | class="am-cappf__options" |
| 5 | :class="{ |
| 6 | 'am-only-one': display === 'second' || !amSettings.roles.allowCustomerDeleteProfile, |
| 7 | }" |
| 8 | > |
| 9 | <div v-if="display === 'first' && amSettings.roles.allowCustomerDeleteProfile"> |
| 10 | <AmButton |
| 11 | category="danger" |
| 12 | :size="props.parentWidth <= 360 ? 'small' : 'default'" |
| 13 | :type="props.deleteFooterType" |
| 14 | class="am-cappf__delete" |
| 15 | :disabled="loading" |
| 16 | @click="deleteProfileDialog = true" |
| 17 | > |
| 18 | {{ displayLabels('delete_profile') }} |
| 19 | </AmButton> |
| 20 | </div> |
| 21 | <div v-if="display === 'first' || display === 'third'"> |
| 22 | <AmButton |
| 23 | :type="props.saveFooterButton" |
| 24 | :size="props.parentWidth <= 360 ? 'small' : 'default'" |
| 25 | :disabled="loading" |
| 26 | @click="display === 'first' ? saveProfileChanges() : saveCustomerCustomFields()" |
| 27 | > |
| 28 | {{ displayLabels('save_changes') }} |
| 29 | </AmButton> |
| 30 | </div> |
| 31 | <div v-if="display === 'second'"> |
| 32 | <AmButton |
| 33 | :type="props.passFooterButton" |
| 34 | :size="props.parentWidth <= 360 ? 'small' : 'default'" |
| 35 | :disabled="loading" |
| 36 | @click="changeProfilePassword()" |
| 37 | > |
| 38 | {{ displayLabels('change_password') }} |
| 39 | </AmButton> |
| 40 | </div> |
| 41 | </div> |
| 42 | </div> |
| 43 | </template> |
| 44 | |
| 45 | <script setup> |
| 46 | // * _components |
| 47 | import AmButton from '../../../../_components/button/AmButton.vue' |
| 48 | |
| 49 | // * Import from Vue |
| 50 | import { inject, computed, ref } from 'vue' |
| 51 | |
| 52 | // * Composables |
| 53 | import { useColorTransparency } from '../../../../../assets/js/common/colorManipulation' |
| 54 | |
| 55 | // * Components properties |
| 56 | let props = defineProps({ |
| 57 | parentWidth: { |
| 58 | type: Number, |
| 59 | default: 1200, |
| 60 | }, |
| 61 | display: { |
| 62 | type: String, |
| 63 | default: 'first', |
| 64 | }, |
| 65 | loading: { |
| 66 | type: Boolean, |
| 67 | default: false, |
| 68 | }, |
| 69 | customizedLabels: { |
| 70 | type: Object, |
| 71 | default: () => { |
| 72 | return {} |
| 73 | }, |
| 74 | }, |
| 75 | deleteFooterType: { |
| 76 | type: String, |
| 77 | default: 'plain', |
| 78 | }, |
| 79 | saveFooterButton: { |
| 80 | type: String, |
| 81 | default: 'filled', |
| 82 | }, |
| 83 | passFooterButton: { |
| 84 | type: String, |
| 85 | default: 'filled', |
| 86 | }, |
| 87 | }) |
| 88 | |
| 89 | // * Labels |
| 90 | const amLabels = inject('labels') |
| 91 | function displayLabels(label) { |
| 92 | return Object.keys(props.customizedLabels).length && props.customizedLabels[label] |
| 93 | ? props.customizedLabels[label] |
| 94 | : amLabels[label] |
| 95 | } |
| 96 | |
| 97 | // * Settings |
| 98 | const amSettings = inject('settings') |
| 99 | |
| 100 | // * Injected Functions |
| 101 | let deleteProfileDialog = inject('deleteProfileDialog', ref(false)) |
| 102 | let saveProfileChanges = inject('saveProfileChanges', () => {}) |
| 103 | let saveCustomerCustomFields = inject('saveCustomerCustomFields', () => {}) |
| 104 | let changeProfilePassword = inject('changeProfilePassword', () => {}) |
| 105 | |
| 106 | // * Colors |
| 107 | let amColors = inject('amColors') |
| 108 | |
| 109 | let cssVars = computed(() => { |
| 110 | return { |
| 111 | // am - amelia |
| 112 | // cappf - cabinet panel profile footer |
| 113 | '--am-c-cappf-bgr': amColors.value.colorMainBgr, |
| 114 | '--am-c-cappf-text': amColors.value.colorMainText, |
| 115 | '--am-c-cappf-text-op15': useColorTransparency(amColors.value.colorMainText, 0.15), |
| 116 | } |
| 117 | }) |
| 118 | </script> |
| 119 | |
| 120 | <script> |
| 121 | export default { |
| 122 | name: 'MainProfileFooter', |
| 123 | } |
| 124 | </script> |
| 125 | |
| 126 | <style lang="scss"> |
| 127 | @mixin profile-footer-block { |
| 128 | // am - amelia |
| 129 | // cappf - cabinet panel profile footer |
| 130 | .am-cappf { |
| 131 | position: absolute; |
| 132 | bottom: 0; |
| 133 | left: 0; |
| 134 | width: 100%; |
| 135 | padding: 12px; |
| 136 | background-color: var(--am-c-cappf-bgr); |
| 137 | box-shadow: 0 -2px 3px var(--am-c-cappf-text-op15); |
| 138 | |
| 139 | &__options { |
| 140 | display: flex; |
| 141 | justify-content: space-between; |
| 142 | |
| 143 | &.am-only-one { |
| 144 | justify-content: flex-end; |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | .amelia-v2-booking #amelia-container { |
| 151 | @include profile-footer-block; |
| 152 | } |
| 153 | |
| 154 | #amelia-app-backend-new #amelia-container { |
| 155 | @include profile-footer-block; |
| 156 | } |
| 157 | </style> |
| 158 |