Skip to content

Commit

Permalink
minor file format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasperrone committed Dec 24, 2020
1 parent ff1bdc9 commit 26c58b8
Show file tree
Hide file tree
Showing 10 changed files with 451 additions and 456 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
presets: ['@vue/cli-plugin-babel/preset'],
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
preset: '@vue/cli-plugin-unit-jest',
preset: '@vue/cli-plugin-unit-jest',
}
117 changes: 57 additions & 60 deletions src/DatePicker/components/BookingBullet.vue
Original file line number Diff line number Diff line change
@@ -1,68 +1,65 @@
<template>
<i class="vhd__parent-bullet">
<i
v-if="previousBooking && duplicateBookingDates.includes(formatDate)"
class="vhd__bullet"
:style="previousBooking.style"
:class="[
{
vhd__checkInCheckOut: duplicateBookingDates.includes(formatDate),
},
]"
/>
<i
v-if="previousBooking && duplicateBookingDates.includes(formatDate)"
class="vhd__pipe vhd__checkInCheckOut"
:style="previousBooking.style"
/>
<i
v-if="
currentBooking &&
(currentBooking.checkInDate === formatDate || currentBooking.checkOutDate === formatDate)
"
class="vhd__bullet"
:style="currentBooking.style"
:class="[
{
vhd__checkIn: currentBooking.checkInDate === formatDate,
vhd__checkOut: currentBooking.checkOutDate === formatDate,
},
]"
/>
<i
v-if="currentBooking"
class="vhd__pipe"
:class="[
{
vhd__checkIn: currentBooking.checkInDate === formatDate,
vhd__checkOut: currentBooking.checkOutDate === formatDate,
},
]"
:style="currentBooking.style"
/>
</i>
<i class="vhd__parent-bullet">
<i
v-if="previousBooking && duplicateBookingDates.includes(formatDate)"
class="vhd__bullet"
:style="previousBooking.style"
:class="[
{
vhd__checkInCheckOut: duplicateBookingDates.includes(formatDate),
},
]"
/>
<i
v-if="previousBooking && duplicateBookingDates.includes(formatDate)"
class="vhd__pipe vhd__checkInCheckOut"
:style="previousBooking.style"
/>
<i
v-if="currentBooking && (currentBooking.checkInDate === formatDate || currentBooking.checkOutDate === formatDate)"
class="vhd__bullet"
:style="currentBooking.style"
:class="[
{
vhd__checkIn: currentBooking.checkInDate === formatDate,
vhd__checkOut: currentBooking.checkOutDate === formatDate,
},
]"
/>
<i
v-if="currentBooking"
class="vhd__pipe"
:class="[
{
vhd__checkIn: currentBooking.checkInDate === formatDate,
vhd__checkOut: currentBooking.checkOutDate === formatDate,
},
]"
:style="currentBooking.style"
/>
</i>
</template>

<script>
export default {
name: 'BookingBullet',
props: {
currentBooking: {
type: Object,
default: () => ({}),
},
duplicateBookingDates: {
type: Array,
default: () => [],
},
formatDate: {
type: String,
default: '',
},
previousBooking: {
type: Object,
default: () => ({}),
},
name: 'BookingBullet',
props: {
currentBooking: {
type: Object,
default: () => ({}),
},
duplicateBookingDates: {
type: Array,
default: () => [],
},
formatDate: {
type: String,
default: '',
},
previousBooking: {
type: Object,
default: () => ({}),
},
},
}
</script>
92 changes: 46 additions & 46 deletions src/DatePicker/components/DateInput.vue
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
<template>
<div
class="vhd__datepicker__input"
@click="toggleDatepicker"
@keyup.enter.stop.prevent="toggleDatepicker"
data-qa="vhd__datepickerInput"
:class="inputClass"
:tabindex="tabIndex"
>
{{ inputDate ? inputDate : i18n[inputDateType] }}
</div>
<div
class="vhd__datepicker__input"
@click="toggleDatepicker"
@keyup.enter.stop.prevent="toggleDatepicker"
data-qa="vhd__datepickerInput"
:class="inputClass"
:tabindex="tabIndex"
>
{{ inputDate ? inputDate : i18n[inputDateType] }}
</div>
</template>

<script>
export default {
props: {
isOpen: {
type: Boolean,
required: true,
},
inputDate: {
type: String,
default: null,
},
inputDateType: {
type: String,
default: 'check-in',
},
singleDaySelection: {
type: Boolean,
default: false,
},
toggleDatepicker: {
type: Function,
required: true,
},
i18n: {
type: Object,
required: true,
},
},
computed: {
inputClass() {
return {
'vhd__datepicker__input--is-active': this.isOpen && this.inputDate == null,
'vhd__datepicker__input--single-date': this.singleDaySelection,
}
},
tabIndex() {
return this.inputDateType === 'check-in' ? 0 : -1
},
props: {
isOpen: {
type: Boolean,
required: true,
},
inputDate: {
type: String,
default: null,
},
inputDateType: {
type: String,
default: 'check-in',
},
singleDaySelection: {
type: Boolean,
default: false,
},
toggleDatepicker: {
type: Function,
required: true,
},
i18n: {
type: Object,
required: true,
},
},
computed: {
inputClass() {
return {
'vhd__datepicker__input--is-active': this.isOpen && this.inputDate == null,
'vhd__datepicker__input--single-date': this.singleDaySelection,
}
},
tabIndex() {
return this.inputDateType === 'check-in' ? 0 : -1
},
},
}
</script>
Loading

0 comments on commit 26c58b8

Please sign in to comment.