PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
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 / common / FormFields / AmPhoneFormField.vue
ameliabooking / v3 / src / views / common / FormFields Last commit date
AmAddressFormField.vue 1 year ago AmAttachmentFormField.vue 1 year ago AmCheckboxFormField.vue 2 years ago AmContentFormField.vue 2 years ago AmDatePickerFormField.vue 2 years ago AmInputFormField.vue 2 years ago AmPhoneFormField.vue 1 year ago AmRadioFormField.vue 2 years ago AmSelectFormField.vue 1 year ago
AmPhoneFormField.vue
151 lines
1 <template>
2 <el-form-item
3 v-if="props.visible"
4 ref="formFieldRef"
5 class="am-ff__item"
6 :prop="props.itemName"
7 :label-position="props.labelPosition"
8 :style="cssVars"
9 style="z-index: 10"
10 >
11 <template #label>
12 <span class="am-ff__item-label" v-html="props.label" />
13 </template>
14 <AmInputPhone
15 v-model="model"
16 :name="props.itemName"
17 :placeholder="props.placeholder"
18 :default-code="props.defaultCode"
19 :disabled="props.disabled"
20 style="position: relative"
21 @country-phone-iso-updated="countryPhoneIsoUpdated"
22 />
23 <div
24 v-if="props.isWhatsApp"
25 class="am-whatsapp-opt-in-text"
26 >
27 {{ props.whatsAppLabel }}
28 </div>
29 </el-form-item>
30 </template>
31
32 <script setup>
33 // * _components
34 import AmInputPhone from '../../_components/input-phone/AmInputPhone.vue'
35
36 // * Import from Vue
37 import {
38 computed,
39 inject,
40 ref,
41 toRefs
42 } from "vue";
43
44 // * Composables
45 import { useColorTransparency } from "../../../assets/js/common/colorManipulation";
46
47 // * Form Item Props
48 let props = defineProps({
49 modelValue: {
50 type: [String, Number, Object, Array],
51 required: true
52 },
53 itemName: {
54 type: String,
55 required: true
56 },
57 label: {
58 type: String
59 },
60 whatsAppLabel: {
61 type: String
62 },
63 labelPosition: {
64 type: String,
65 default: 'top'
66 },
67 placeholder: {
68 type: String
69 },
70 phoneError: {
71 type: Boolean,
72 default: false
73 },
74 visible: {
75 type: Boolean,
76 default: true
77 },
78 defaultCode: {
79 type: String,
80 default: ''
81 },
82 isWhatsApp: {
83 type: [Boolean, String, Number],
84 default: false
85 },
86 countryPhoneIso: {
87 type: [String, Object, Array, Number],
88 required: true
89 },
90 disabled: {
91 type: Boolean,
92 default: false
93 }
94 })
95
96 // * Define Emits
97 const emits = defineEmits(['update:modelValue', 'update:countryPhoneIso'])
98
99 // * Component model
100 let { modelValue } = toRefs(props)
101 let model = computed({
102 get: () => modelValue.value,
103 set: (val) => {
104 emits('update:modelValue', val ? val : '')
105 }
106 })
107
108 function countryPhoneIsoUpdated (val) {
109 emits('update:countryPhoneIso', val)
110 }
111
112 // * Colors
113 let amColors = inject('amColors')
114 let cssVars = computed(() => {
115 return {
116 // is - Info Step, wa - WhatsApp
117 '--am-c-is-wa-text': useColorTransparency(amColors.value.colorMainText, 0.5),
118 // ! Inline styles need to be removed
119 'margin-bottom': props.isWhatsApp && !props.phoneError ? '10px' : '24px'
120 }
121 })
122
123 let formFieldRef = ref(null)
124
125 defineExpose({
126 formFieldRef
127 })
128 </script>
129
130 <script>
131 export default {
132 name: "PhoneFormField"
133 }
134 </script>
135
136 <style lang="scss">
137 .amelia-v2-booking {
138 #amelia-container {
139 .am-fs__info-form__item, .am-ff__item {
140 .am-whatsapp-opt-in-text {
141 color: var(--am-c-is-wa-text);
142 font-weight: 400;
143 font-size: 10px;
144 line-height: 16px;
145 word-break: break-word;
146 }
147 }
148 }
149 }
150 </style>
151