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 / common / FormFields / AmDatePickerFormField.vue
ameliabooking / v3 / src / views / common / FormFields Last commit date
AmAddressFormField.vue 1 month ago AmAttachmentFormField.vue 1 month ago AmCheckboxFormField.vue 1 month ago AmContentFormField.vue 1 month ago AmDatePickerFormField.vue 1 month ago AmInputFormField.vue 1 month ago AmPhoneFormField.vue 1 month ago AmRadioFormField.vue 1 month ago AmSelectFormField.vue 1 month ago AmSocialButton.vue 1 month ago
AmDatePickerFormField.vue
112 lines
1 <template>
2 <el-form-item
3 ref="formFieldRef"
4 class="am-ff__item"
5 :prop="props.itemName"
6 :label-position="props.labelPosition"
7 >
8 <template #label>
9 <span class="am-ff__item-label" v-html="props.label" />
10 </template>
11 <AmDatePickerFull
12 :existing-date="model"
13 :persistent="false"
14 :disabled="false"
15 :clearable="props.clearable"
16 :readonly="props.readonly"
17 :week-starts-from-day="props.weekStartsFromDay"
18 :input-placeholder="props.placeholder"
19 :refresh-value="props.refreshValue"
20 @selected-date="
21 (dateString) => {
22 selectedDatePickerValue(dateString)
23 }
24 "
25 @clear-date="clearDate"
26 />
27 </el-form-item>
28 </template>
29
30 <script setup>
31 // * _components
32 import AmDatePickerFull from '../../_components/date-picker-full/AmDatePickerFull.vue'
33
34 // * Import from Vue
35 import { computed, ref, toRefs } from 'vue'
36
37 // * Moment
38 import moment from 'moment'
39
40 // * Form Item Props
41 let props = defineProps({
42 modelValue: {
43 type: [String, Array, Object, Number],
44 required: true,
45 },
46 itemName: {
47 type: String,
48 required: true,
49 },
50 label: {
51 type: String,
52 },
53 labelPosition: {
54 type: String,
55 default: 'top',
56 },
57 weekStartsFromDay: {
58 type: [String, Number],
59 default: 1,
60 },
61 placeholder: {
62 type: String,
63 default: '',
64 },
65 clearable: {
66 type: Boolean,
67 default: false,
68 },
69 readonly: {
70 type: Boolean,
71 default: true,
72 },
73 refreshValue: {
74 type: Boolean,
75 default: false,
76 },
77 })
78
79 // * Define Emits
80 const emits = defineEmits(['update:modelValue'])
81
82 // * Component model
83 let { modelValue } = toRefs(props)
84 let model = computed({
85 get: () => modelValue.value,
86 set: (val) => {
87 emits('update:modelValue', val)
88 },
89 })
90
91 // * Form Item Reference
92 let formFieldRef = ref(null)
93
94 defineExpose({
95 formFieldRef,
96 })
97
98 function selectedDatePickerValue(dateString) {
99 emits('update:modelValue', moment(dateString, 'YYYY-MM-DD').toDate())
100 }
101
102 function clearDate() {
103 emits('update:modelValue', '')
104 }
105 </script>
106
107 <script>
108 export default {
109 name: 'DatePickerFormField',
110 }
111 </script>
112