PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.8
Booking for Appointments and Events Calendar – Amelia v2.4.8
2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / v3 / src / views / public / StepForm / InfoStep / parts / PhoneFormField.vue
ameliabooking / v3 / src / views / public / StepForm / InfoStep / parts Last commit date
EmailFormField.vue 1 month ago FirstNameFormField.vue 1 month ago LastNameFormField.vue 1 month ago PhoneFormField.vue 1 month ago
PhoneFormField.vue
149 lines
1 <template>
2 <!-- Phone Number -->
3 <el-form-item
4 v-if="amCustomize.infoStep.options.phone.visibility"
5 ref="primeFieldRef"
6 class="am-fs__info-form__item"
7 prop="phone"
8 label-position="top"
9 style="z-index: 10"
10 :style="cssVars"
11 >
12 <template #label>
13 <span class="am-fs__info-form__label">
14 {{ amLabels.phone_colon }}
15 </span>
16 </template>
17 <AmInputPhone
18 :key="`phone-${props.refreshTrigger}`"
19 v-model="model"
20 v-model:country-code="countryCode"
21 :placeholder="amLabels.enter_phone"
22 :validation-error="true"
23 :error="props.phoneError"
24 :phone-input-attributes="{ name: 'phone' }"
25 style="position: relative"
26 @data="handleData"
27 >
28 <template #no-results>
29 {{ amLabels.no_results_found }}
30 </template>
31 </AmInputPhone>
32 <template #error v-if="props.errorMessage">
33 <span class="el-form-item__error" role="alert" aria-live="assertive" aria-atomic="true">
34 {{ props.errorMessage }}
35 </span>
36 </template>
37 <div v-if="whatsAppSetUp() && !props.phoneError" class="am-whatsapp-opt-in-text">
38 {{ amLabels.whatsapp_opt_in_text }}
39 </div>
40 </el-form-item>
41 <!-- /Phone Number -->
42 </template>
43
44 <script setup>
45 import AmInputPhone from '../../../../_components/input-phone/AmInputPhone.vue'
46 import { settings } from '../../../../../plugins/settings'
47
48 // * Vue
49 import { computed, inject, ref } from 'vue'
50
51 // * Composables
52 import { useColorTransparency } from '../../../../../assets/js/common/colorManipulation'
53
54 // * Emits
55
56 // * Props
57 let props = defineProps({
58 modelValue: {
59 type: String,
60 default: '',
61 },
62 countryCode: {
63 type: String,
64 default: '',
65 },
66 phoneError: {
67 type: Boolean,
68 default: false,
69 },
70 errorMessage: {
71 type: String,
72 default: '',
73 },
74 refreshTrigger: {
75 type: Number,
76 default: 0,
77 },
78 })
79
80 let emits = defineEmits(['update:modelValue', 'update:countryCode', 'handlePhoneData'])
81
82 const model = computed({
83 get: () => props.modelValue,
84 set: (val) => {
85 emits('update:modelValue', val)
86 },
87 })
88
89 const countryCode = computed({
90 get: () => props.countryCode,
91 set: (val) => {
92 emits('update:countryCode', val)
93 },
94 })
95
96 // * Colors
97 let amColors = inject('amColors')
98 let cssVars = computed(() => {
99 return {
100 // is - Info Step, wa - WhatsApp
101 '--am-c-is-wa-text': useColorTransparency(amColors.value.colorMainText, 0.5),
102 'margin-bottom': whatsAppSetUp() && !props.phoneError ? '10px' : '24px',
103 }
104 })
105
106 let primeFieldRef = ref(null)
107
108 // * Labels
109 let amLabels = inject('amLabels')
110
111 // * Customize
112 let amCustomize = inject('amCustomize')
113
114 function whatsAppSetUp() {
115 return settings.notifications.whatsAppEnabled
116 }
117
118 function handleData(val) {
119 emits('handlePhoneData', val)
120 }
121
122 defineExpose({
123 primeFieldRef,
124 })
125 </script>
126
127 <script>
128 export default {
129 name: 'PhoneFormField',
130 }
131 </script>
132
133 <style lang="scss">
134 .amelia-v2-booking {
135 #amelia-container {
136 .am-fs__info-form__item,
137 .am-elfci__item {
138 .am-whatsapp-opt-in-text {
139 color: var(--am-c-is-wa-text);
140 font-weight: 400;
141 font-size: 10px;
142 line-height: 16px;
143 word-break: break-word;
144 }
145 }
146 }
147 }
148 </style>
149