Skip to content

Commit

Permalink
feat: [Request] Date picker minimal prop #1818
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Mar 26, 2018
1 parent efca853 commit 39cb126
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/datetime/QDatetimePicker.ios.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="q-datetime" :class="['type-' + type, disable ? 'disabled' : '', readonly ? 'readonly' : '', dark ? 'q-datetime-dark' : '']">
<div class="q-datetime" :class="classes">
<slot></slot>
<div class="q-datetime-content non-selectable">
<div class="q-datetime-inner full-height flex justify-center" @touchstart.stop.prevent>
Expand Down Expand Up @@ -125,6 +125,14 @@ export default {
}
},
computed: {
classes () {
const cls = ['type-' + this.type]
this.disable && cls.push('disabled')
this.readonly && cls.push('readonly')
this.dark && cls.push('q-datetime-dark')
this.minimal && cls.push('q-datetime-minimal')
return cls
},
dayMin () {
return this.pmin !== null && isSameDate(this.pmin, this.model, 'month')
? this.pmin.getDate()
Expand Down
8 changes: 7 additions & 1 deletion src/components/datetime/QDatetimePicker.mat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</div>
</div>
</div>
<div class="q-datetime-content col-xs-12 col-md-8 column">
<div class="q-datetime-content col-xs-12 column" :class="contentClasses">
<div ref="selector" class="q-datetime-selector auto row flex-center">
<div
v-if="view === 'year'"
Expand Down Expand Up @@ -284,9 +284,15 @@ export default {
this.disable && cls.push('disabled')
this.readonly && cls.push('readonly')
this.dark && cls.push('q-datetime-dark')
this.minimal && cls.push('q-datetime-minimal')
this.color && cls.push(`text-${this.color}`)
return cls
},
contentClasses () {
if (!this.minimal) {
return 'col-md-8'
}
},
dateArrow () {
const val = [ this.$q.icon.datetime.arrowLeft, this.$q.icon.datetime.arrowRight ]
return this.$q.i18n.rtl ? val.reverse() : val
Expand Down
2 changes: 2 additions & 0 deletions src/components/datetime/datetime.mat.styl
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,5 @@ for $pos in 0..23
&.q-datetime-dark
border 1px solid $dark
border 1px solid var(--q-color-dark)
.q-datetime-minimal
width 320px

0 comments on commit 39cb126

Please sign in to comment.