PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
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 / admin / customize / fields / PhoneFormField.vue
ameliabooking / v3 / src / views / admin / customize / fields Last commit date
EmailFormField.vue 1 month ago EmployeeFormField.vue 1 month ago FirstNameFormField.vue 1 month ago LastNameFormField.vue 1 month ago LocationFormField.vue 1 month ago PhoneFormField.vue 4 weeks ago ServiceFormField.vue 1 month ago
PhoneFormField.vue
83 lines
1 <template>
2 <!-- Phone Number -->
3 <el-form-item
4 v-if="amCustomize[pageRenderKey].infoStep.options.phone.visibility"
5 class="am-fs__info-form__item"
6 prop="phone"
7 label-position="top"
8 style="z-index: 10"
9 >
10 <template #label>
11 <span class="am-fs__info-form__label">
12 {{ labelsDisplay('phone_colon') }}
13 </span>
14 </template>
15 <AmInputPhone
16 v-model="infoFormData.phone"
17 v-model:country-code="countryCode"
18 :placeholder="labelsDisplay('enter_phone')"
19 :validation-error="true"
20 :phone-input-attributes="{ name: 'phone' }"
21 style="position: relative"
22 @data="handleData"
23 >
24 <template #no-results>
25 {{ labelsDisplay('no_results_found') }}
26 </template>
27 </AmInputPhone>
28 </el-form-item>
29 <!-- /Phone Number -->
30 </template>
31
32 <script setup>
33 import AmInputPhone from '../../../_components/input-phone/AmInputPhone.vue'
34 import { useReactiveCustomize } from '../../../../assets/js/admin/useReactiveCustomize.js'
35 import { getInternationalPhoneValue } from '../../../../assets/js/common/phone'
36
37 import { computed, inject, ref } from 'vue'
38
39 let langKey = inject('langKey')
40 let amLabels = inject('labels')
41
42 let pageRenderKey = inject('pageRenderKey')
43 const { amCustomize } = useReactiveCustomize()
44
45 const amSettings = inject('settings')
46
47 // * Label computed function
48 function labelsDisplay(label) {
49 let computedLabel = computed(() => {
50 return amCustomize.value[pageRenderKey.value].infoStep.translations &&
51 amCustomize.value[pageRenderKey.value].infoStep.translations[label] &&
52 amCustomize.value[pageRenderKey.value].infoStep.translations[label][langKey.value]
53 ? amCustomize.value[pageRenderKey.value].infoStep.translations[label][langKey.value]
54 : amLabels[label]
55 })
56
57 return computedLabel.value
58 }
59
60 // * Form field data
61 let infoFormData = inject('infoFormData')
62
63 let countryCode = ref(
64 amSettings.general.phoneDefaultCountryCode === 'auto'
65 ? ''
66 : amSettings.general.phoneDefaultCountryCode.toLowerCase(),
67 )
68
69 function handleData(phoneData) {
70 infoFormData.value.phone = getInternationalPhoneValue(
71 phoneData?.phoneNumber ?? phoneData?.e164,
72 phoneData,
73 phoneData?.countryCode,
74 )
75 }
76 </script>
77
78 <script>
79 export default {
80 name: 'PhoneFormField',
81 }
82 </script>
83