AddExtraFormField.vue
4 years ago
AddToCalendarFormField.vue
4 years ago
BringingFormField.vue
4 years ago
CalendarAppointmentFormField.vue
4 years ago
CalendarHeadingFormField.vue
4 years ago
ConfirmHeadingDataFormField.vue
5 years ago
ConfirmServiceHeadingFormField.vue
5 years ago
CongratulationsHeadingFormField.vue
5 years ago
CongratulationsImageFormField.vue
5 years ago
CongratulationsMessagesFormField.vue
5 years ago
DialogEventCalendarHeadingFormField.vue
4 years ago
EmailFormField.vue
5 years ago
EmployeeFormField.vue
4 years ago
EventDetailsFormField.vue
4 years ago
EventFilterFormField.vue
4 years ago
FirstNameFormField.vue
5 years ago
LastNameFormField.vue
5 years ago
LocationFormField.vue
4 years ago
PackageCalendarFormField.vue
4 years ago
PackageEmployeeFormField.vue
4 years ago
PackageFormField.vue
4 years ago
PackageHeadingFormField.vue
5 years ago
PackageInfoFormField.vue
4 years ago
PackageListFormField.vue
4 years ago
PackageLocationFormField.vue
4 years ago
PackageRulesFormField.vue
4 years ago
PaymentMethodFormField.vue
3 years ago
PaymentTypeFormField.vue
4 years ago
PhoneFormField.vue
5 years ago
RecurringDatesHeadingFormField.vue
5 years ago
RecurringInfoFormField.vue
3 years ago
RecurringSettingsFormField.vue
4 years ago
RecurringSetupHeadingFormField.vue
4 years ago
RecurringStringFormField.vue
5 years ago
RecurringSwitchFormField.vue
4 years ago
ServiceFormField.vue
4 years ago
ServiceHeadingFormField.vue
5 years ago
ServicePackageFormField.vue
3 years ago
StripeCardFormField.vue
5 years ago
TimeZoneFormField.vue
4 years ago
PackageRulesFormField.vue
106 lines
| 1 | <template> |
| 2 | <div |
| 3 | v-show="customizationEdit.editable ? customizationEdit.editable : componentDisplay()" |
| 4 | class="am-customize-field" |
| 5 | :class="{'editable': customizationEdit.editable}" |
| 6 | :style="{borderColor: customizationEdit.reverseBackgroundColorForm}" |
| 7 | > |
| 8 | <p class="am-package-appointments-rules" :style="{color: customizationEdit.useGlobalColors ? customizationForm.textColorOnBackground : customizationForm.formTextColor}"> |
| 9 | <template v-if="!languageShortCode"> |
| 10 | 1 {{ labelPackageRules.value || $root.labels.package_min_book }} |
| 11 | </template> |
| 12 | <template v-else> |
| 13 | 1 {{ labelPackageRules.translations[languageShortCode] || $root.labels.package_min_book }} |
| 14 | </template> |
| 15 | </p> |
| 16 | |
| 17 | <!-- Edit Dialog --> |
| 18 | <customize-edit-dialog |
| 19 | :form-field="formField" |
| 20 | :language-short-code="languageShortCode" |
| 21 | @saveEdit="saveFormFiledEdit" |
| 22 | > |
| 23 | <template v-slot:fieldEdit> |
| 24 | <span v-show="customizationEdit.editable" class="am-customize-field__edit"> |
| 25 | <img :src="$root.getUrl + 'public/img/am-customize-icon-edit.svg'" /> |
| 26 | </span> |
| 27 | </template> |
| 28 | </customize-edit-dialog> |
| 29 | <!-- /Edit Dialog --> |
| 30 | </div> |
| 31 | </template> |
| 32 | |
| 33 | <script> |
| 34 | import customizeEditDialog from '../dialogs/CustomizeEditDialog' |
| 35 | |
| 36 | export default { |
| 37 | name: 'packageRulesFormField', |
| 38 | |
| 39 | components: { |
| 40 | customizeEditDialog |
| 41 | }, |
| 42 | |
| 43 | props: { |
| 44 | languageShortCode: { |
| 45 | type: String, |
| 46 | default: '' |
| 47 | }, |
| 48 | customization: { |
| 49 | type: Object, |
| 50 | default: () => { |
| 51 | return {} |
| 52 | } |
| 53 | }, |
| 54 | customizationEdit: { |
| 55 | type: Object, |
| 56 | default: () => { |
| 57 | return {} |
| 58 | } |
| 59 | }, |
| 60 | customizationForm: { |
| 61 | type: Object, |
| 62 | default: () => { |
| 63 | return {} |
| 64 | } |
| 65 | }, |
| 66 | formField: { |
| 67 | type: Object, |
| 68 | default: () => { |
| 69 | return {} |
| 70 | } |
| 71 | } |
| 72 | }, |
| 73 | |
| 74 | data () { |
| 75 | return { |
| 76 | labelPackageRules: this.formField.labels.package_min_book |
| 77 | } |
| 78 | }, |
| 79 | |
| 80 | mounted () {}, |
| 81 | |
| 82 | methods: { |
| 83 | componentDisplay () { |
| 84 | if (this.formField.hasOwnProperty('visibility')) { |
| 85 | return this.formField.visibility |
| 86 | } |
| 87 | |
| 88 | return true |
| 89 | }, |
| 90 | |
| 91 | saveFormFiledEdit (objData) { |
| 92 | let fieldData = {} |
| 93 | fieldData['itemsStatic'] = {} |
| 94 | fieldData['itemsStatic'][this.$options.name] = JSON.parse(JSON.stringify(objData)) |
| 95 | this.$emit('saveEdit', fieldData) |
| 96 | } |
| 97 | }, |
| 98 | |
| 99 | watch: { |
| 100 | 'formField' () { |
| 101 | this.labelPackageRules = this.formField.labels.package_min_book |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | </script> |
| 106 |