CalendarDateTimeForm.vue
4 years ago
CatalogListForm.vue
4 years ago
CategoryListForm.vue
4 years ago
CategoryPackageForm.vue
4 years ago
CategoryServiceForm.vue
4 years ago
ConfirmBookingForm.vue
3 years ago
CongratulationsForm.vue
4 years ago
EventDetailsForm.vue
4 years ago
EventFilterForm.vue
5 years ago
InfoEventCalendarForm.vue
4 years ago
InviteEventCalendarForm.vue
4 years ago
PackageInfoForm.vue
4 years ago
PackageListForm.vue
4 years ago
PackageSetupForm.vue
1 year ago
RecurringDatesForm.vue
4 years ago
RecurringSetupForm.vue
4 years ago
SelectEventCalendarForm.vue
3 years ago
SelectPackageForm.vue
4 years ago
SelectServiceForm.vue
4 years ago
CongratulationsForm.vue
199 lines
| 1 | <template> |
| 2 | <div |
| 3 | class="am-congratulations" |
| 4 | :class="{'editable': editable}" |
| 5 | :style="{backgroundColor: formStepData.hasOwnProperty('globalSettings') ? customizationForm.formBackgroundColor : ''}" |
| 6 | > |
| 7 | <customization-form-header |
| 8 | v-if="formStepData.hasOwnProperty('globalSettings') && Object.keys(this.resetData).length && !customization.useGlobalColors[formName]" |
| 9 | :editable="editable" |
| 10 | :customization-form="customizationForm" |
| 11 | @resetForm="resetForm" |
| 12 | @saveFormEdit="saveFormEdit" |
| 13 | ></customization-form-header> |
| 14 | |
| 15 | <dialog-event-calendar-heading-form-field |
| 16 | v-if="customizeDisplay === 'event' && formStepData.itemsStatic.hasOwnProperty('dialogEventCalendarHeadingFormField')" |
| 17 | :language-short-code="languageShortCode" |
| 18 | :customization-edit="customizationEditDisplay" |
| 19 | :customization-form="customizationForm" |
| 20 | :form-field="formStepData.itemsStatic.dialogEventCalendarHeadingFormField" |
| 21 | @saveEdit="saveFormEdit" |
| 22 | ></dialog-event-calendar-heading-form-field> |
| 23 | |
| 24 | <congratulations-heading-form-field |
| 25 | :language-short-code="languageShortCode" |
| 26 | :customization="customization" |
| 27 | :customization-edit="customizationEditDisplay" |
| 28 | :customization-form="customizationForm" |
| 29 | :form-field="formStepData.itemsStatic.congratulationsHeadingFormField" |
| 30 | @saveEdit="saveFormEdit" |
| 31 | ></congratulations-heading-form-field> |
| 32 | |
| 33 | <congratulations-image-form-field |
| 34 | :language-short-code="languageShortCode" |
| 35 | :event-color="eventColor" |
| 36 | :customize-display="customizeDisplay" |
| 37 | :customization="customization" |
| 38 | :customization-edit="customizationEditDisplay" |
| 39 | :customization-form="customizationForm" |
| 40 | :form-field="formStepData.itemsStatic.congratulationsImageFormField" |
| 41 | @saveEdit="saveFormEdit" |
| 42 | ></congratulations-image-form-field> |
| 43 | |
| 44 | <congratulations-messages-form-field |
| 45 | :language-short-code="languageShortCode" |
| 46 | :customization="customization" |
| 47 | :customization-edit="customizationEditDisplay" |
| 48 | :customization-form="customizationForm" |
| 49 | :form-field="formStepData.itemsStatic.congratulationsMessagesFormField" |
| 50 | @saveEdit="saveFormEdit" |
| 51 | ></congratulations-messages-form-field> |
| 52 | |
| 53 | <br> |
| 54 | |
| 55 | <add-to-calendar-form-field |
| 56 | :language-short-code="languageShortCode" |
| 57 | :event-color="eventColor" |
| 58 | :customization="customization" |
| 59 | :customize-display="customizeDisplay" |
| 60 | :customization-edit="customizationEditDisplay" |
| 61 | :customization-form="customizationForm" |
| 62 | :form-field="formStepData.itemsStatic.addToCalendarFormField" |
| 63 | @saveEdit="saveFormEdit" |
| 64 | ></add-to-calendar-form-field> |
| 65 | |
| 66 | </div> |
| 67 | </template> |
| 68 | |
| 69 | <script> |
| 70 | import cssColorManipulationMixin from '../../../../js/common/mixins/cssColorManipulationMixin' |
| 71 | import customizationFormHeader from '../parts/CustomizationFormHeader' |
| 72 | import dialogEventCalendarHeadingFormField from '../formFields/DialogEventCalendarHeadingFormField' |
| 73 | import congratulationsHeadingFormField from '../formFields/CongratulationsHeadingFormField' |
| 74 | import congratulationsImageFormField from '../formFields/CongratulationsImageFormField' |
| 75 | import congratulationsMessagesFormField from '../formFields/CongratulationsMessagesFormField' |
| 76 | import addToCalendarFormField from '../formFields/AddToCalendarFormField' |
| 77 | |
| 78 | export default { |
| 79 | name: 'congratulationsForm', |
| 80 | |
| 81 | components: { |
| 82 | customizationFormHeader, |
| 83 | dialogEventCalendarHeadingFormField, |
| 84 | congratulationsHeadingFormField, |
| 85 | congratulationsImageFormField, |
| 86 | congratulationsMessagesFormField, |
| 87 | addToCalendarFormField |
| 88 | }, |
| 89 | |
| 90 | props: { |
| 91 | formName: { |
| 92 | type: String, |
| 93 | required: true |
| 94 | }, |
| 95 | editable: { |
| 96 | type: Boolean, |
| 97 | default: true |
| 98 | }, |
| 99 | languageShortCode: { |
| 100 | type: String, |
| 101 | default: '' |
| 102 | }, |
| 103 | eventColor: { |
| 104 | type: String, |
| 105 | default: '#1A84EE' |
| 106 | }, |
| 107 | customization: { |
| 108 | type: Object, |
| 109 | default: () => { |
| 110 | return {} |
| 111 | } |
| 112 | }, |
| 113 | customizeDisplay: { |
| 114 | type: String, |
| 115 | default: '' |
| 116 | }, |
| 117 | customizationForm: { |
| 118 | type: Object, |
| 119 | default: () => { |
| 120 | return {} |
| 121 | } |
| 122 | }, |
| 123 | formStepData: { |
| 124 | type: Object, |
| 125 | default: () => { |
| 126 | return {} |
| 127 | } |
| 128 | }, |
| 129 | resetData: { |
| 130 | type: Object, |
| 131 | default: () => { |
| 132 | return {} |
| 133 | } |
| 134 | } |
| 135 | }, |
| 136 | |
| 137 | mixins: [cssColorManipulationMixin], |
| 138 | |
| 139 | data () { |
| 140 | return { |
| 141 | calendarIndex: '', |
| 142 | calendars: [ |
| 143 | { |
| 144 | type: 'google', |
| 145 | label: 'Google Calendar' |
| 146 | }, |
| 147 | { |
| 148 | type: 'yahoo', |
| 149 | label: 'Yahoo! Calendar' |
| 150 | }, |
| 151 | { |
| 152 | type: 'ios', |
| 153 | label: 'iCal Calendar' |
| 154 | }, |
| 155 | { |
| 156 | 'type': 'outlook', |
| 157 | 'label': 'Outlook Calendar' |
| 158 | } |
| 159 | ], |
| 160 | resetFormData: Object.keys(this.resetData).length ? this.resetData[this.$options.name][this.customizeDisplay] : {}, |
| 161 | customizationEdit: { |
| 162 | editable: this.editable, |
| 163 | reverseBackgroundColorForm: this.oppositeColor(this.customizationForm.formBackgroundColor) |
| 164 | } |
| 165 | } |
| 166 | }, |
| 167 | |
| 168 | created () {}, |
| 169 | |
| 170 | mounted () {}, |
| 171 | |
| 172 | computed: { |
| 173 | customizationEditDisplay () { |
| 174 | this.customizationEdit.editable = this.editable |
| 175 | this.customizationEdit.reverseBackgroundColorForm = this.oppositeColor(this.customizationForm.formBackgroundColor) |
| 176 | return this.customizationEdit |
| 177 | } |
| 178 | }, |
| 179 | |
| 180 | methods: { |
| 181 | resetForm () { |
| 182 | let resetObj = {} |
| 183 | resetObj.data = this.resetFormData |
| 184 | resetObj.formStep = this.$options.name |
| 185 | resetObj.formPart = this.customizeDisplay |
| 186 | this.$emit('resetForm', resetObj) |
| 187 | }, |
| 188 | |
| 189 | saveFormEdit (dataObj) { |
| 190 | let formObj = {} |
| 191 | formObj[this.$options.name] = {} |
| 192 | formObj[this.$options.name][this.customizeDisplay] = JSON.parse(JSON.stringify(dataObj)) |
| 193 | |
| 194 | this.$emit('saveEdit', formObj) |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | </script> |
| 199 |