Skip to content

Commit 39cb126

Browse files
committed
feat: [Request] Date picker minimal prop quasarframework#1818
1 parent efca853 commit 39cb126

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/components/datetime/QDatetimePicker.ios.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="q-datetime" :class="['type-' + type, disable ? 'disabled' : '', readonly ? 'readonly' : '', dark ? 'q-datetime-dark' : '']">
2+
<div class="q-datetime" :class="classes">
33
<slot></slot>
44
<div class="q-datetime-content non-selectable">
55
<div class="q-datetime-inner full-height flex justify-center" @touchstart.stop.prevent>
@@ -125,6 +125,14 @@ export default {
125125
}
126126
},
127127
computed: {
128+
classes () {
129+
const cls = ['type-' + this.type]
130+
this.disable && cls.push('disabled')
131+
this.readonly && cls.push('readonly')
132+
this.dark && cls.push('q-datetime-dark')
133+
this.minimal && cls.push('q-datetime-minimal')
134+
return cls
135+
},
128136
dayMin () {
129137
return this.pmin !== null && isSameDate(this.pmin, this.model, 'month')
130138
? this.pmin.getDate()

src/components/datetime/QDatetimePicker.mat.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</div>
6363
</div>
6464
</div>
65-
<div class="q-datetime-content col-xs-12 col-md-8 column">
65+
<div class="q-datetime-content col-xs-12 column" :class="contentClasses">
6666
<div ref="selector" class="q-datetime-selector auto row flex-center">
6767
<div
6868
v-if="view === 'year'"
@@ -284,9 +284,15 @@ export default {
284284
this.disable && cls.push('disabled')
285285
this.readonly && cls.push('readonly')
286286
this.dark && cls.push('q-datetime-dark')
287+
this.minimal && cls.push('q-datetime-minimal')
287288
this.color && cls.push(`text-${this.color}`)
288289
return cls
289290
},
291+
contentClasses () {
292+
if (!this.minimal) {
293+
return 'col-md-8'
294+
}
295+
},
290296
dateArrow () {
291297
const val = [ this.$q.icon.datetime.arrowLeft, this.$q.icon.datetime.arrowRight ]
292298
return this.$q.i18n.rtl ? val.reverse() : val

src/components/datetime/datetime.mat.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,5 @@ for $pos in 0..23
261261
&.q-datetime-dark
262262
border 1px solid $dark
263263
border 1px solid var(--q-color-dark)
264+
.q-datetime-minimal
265+
width 320px

0 commit comments

Comments
 (0)