Skip to content

Commit a2be67b

Browse files
committed
fix(QDatetime/QColor): fixes regarding dialog
1 parent b315aa4 commit a2be67b

File tree

10 files changed

+67
-48
lines changed

10 files changed

+67
-48
lines changed

dev/components/form/color-picker.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
<q-color :value="inputModelRgb" @change="val => inputModelRgb = val" default-value="#ccc" stack-label="default-value" />
1515
<q-color :value="inputModelRgb" @change="val => inputModelRgb = val" default-value="#ccc" clearable stack-label="default-value, clearable" />
1616

17+
<div class="bg-black q-pa-md q-my-md">
18+
<q-color dark v-model="inputModelRgb" />
19+
<q-color-picker dark v-model="modelHexa" />
20+
</div>
21+
1722
<br><br>
1823
<q-btn color="primary" label="Set to yellow" @click="setToYellow"/>
1924

dev/components/form/datetime.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@
184184
</p>
185185
<q-datetime-picker v-model="model" type="time" />
186186

187+
<q-datetime v-model="model" type="datetime" />
187188
<div class="bg-black q-pa-md">
189+
<q-datetime dark v-model="model" type="datetime" />
188190
<q-datetime-picker class="q-my-md" dark v-model="model" type="datetime" />
189191
<q-datetime-picker class="q-my-md" dark color="primary" v-model="model" type="datetime" />
190192
<q-datetime-picker class="q-my-md" dark color="secondary" v-model="model" type="datetime" />

src/components/color/QColor.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ export default {
6767
}
6868

6969
return ''
70+
},
71+
modalBtnColor () {
72+
return this.$q.theme === 'mat'
73+
? this.color
74+
: (this.dark ? 'light' : 'dark')
7075
}
7176
},
7277
methods: {
@@ -159,12 +164,13 @@ export default {
159164

160165
if (modal) {
161166
child[__THEME__ === 'mat' ? 'push' : 'unshift'](h('div', {
162-
staticClass: 'modal-buttons modal-buttons-top row full-width'
167+
staticClass: 'modal-buttons modal-buttons-top row full-width',
168+
'class': this.dark ? 'bg-black' : null
163169
}, [
164170
h('div', { staticClass: 'col' }),
165171
h(QBtn, {
166172
props: {
167-
color: this.color,
173+
color: this.modalBtnColor,
168174
flat: true,
169175
label: this.cancelLabel || this.$q.i18n.label.cancel,
170176
waitForRipple: true
@@ -174,7 +180,7 @@ export default {
174180
this.editable
175181
? h(QBtn, {
176182
props: {
177-
color: this.color,
183+
color: this.modalBtnColor,
178184
flat: true,
179185
label: this.okLabel || this.$q.i18n.label.set,
180186
waitForRipple: true

src/components/color/QColorPicker.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default {
8282
? this.value.length > 7
8383
: this.value && this.value.a !== void 0
8484
},
85-
swatchStyle () {
85+
swatchColor () {
8686
return {
8787
backgroundColor: `rgba(${this.model.r},${this.model.g},${this.model.b},${(this.model.a === void 0 ? 100 : this.model.a) / 100})`
8888
}
@@ -155,9 +155,10 @@ export default {
155155
staticClass: 'q-color-sliders row items-center'
156156
}, [
157157
h('div', {
158-
staticClass: 'q-color-swatch q-mt-sm q-ml-sm q-mb-sm non-selectable overflow-hidden',
159-
style: this.swatchStyle
160-
}),
158+
staticClass: 'q-color-swatch q-mt-sm q-ml-md q-mb-sm non-selectable overflow-hidden'
159+
}, [
160+
h('div', { style: this.swatchColor, staticClass: 'fit' })
161+
]),
161162
h('div', { staticClass: 'col q-pa-sm' }, [
162163
h('div', { staticClass: 'q-color-hue non-selectable' }, [
163164
h(QSlider, {

src/components/color/color.ios.styl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@
3131
width 32px
3232
height 32px
3333
border-radius 50%
34-
&:after
35-
content ''
36-
position absolute
37-
left 0
38-
right 0
39-
top 0
40-
bottom 0
41-
border-radius 50%
42-
background-color inherit
34+
background white
4335

4436
.q-color-hue .q-slider-track
4537
border-radius 2px
@@ -70,6 +62,8 @@
7062
.q-slider
7163
height 20px
7264
.q-slider-handle
65+
height 18px
66+
width 18px
7367
box-shadow 0 1px 4px 0 rgba(0, 0, 0, .37)
7468
.q-slider-ring
7569
display none
@@ -86,11 +80,13 @@
8680
padding-top 4px
8781

8882
.q-color-dark
89-
background $dark
83+
background black
9084
border 1px solid $grey-9
9185
input
92-
background $dark
86+
background black
9387
color $light
94-
border 1px solid $light
88+
border 1px solid $dark
9589
.q-color-inputs
9690
color $light
91+
.q-color-swatch
92+
border 1px solid $dark

src/components/color/color.mat.styl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@
3131
width 32px
3232
height 32px
3333
border-radius 50%
34-
&:after
35-
content ''
36-
position absolute
37-
left 0
38-
right 0
39-
top 0
40-
bottom 0
41-
border-radius 50%
42-
background-color inherit
34+
background white
4335

4436
.q-color-hue .q-slider-track
4537
border-radius 2px
@@ -86,11 +78,13 @@
8678
padding-top 4px
8779

8880
.q-color-dark
89-
background $dark
81+
background black
9082
border 1px solid $grey-9
9183
input
92-
background $dark
84+
background black
9385
color $light
94-
border 1px solid $light
86+
border 1px solid $dark
9587
.q-color-inputs
9688
color $light
89+
.q-color-swatch
90+
border 1px solid $dark

src/components/datetime/QDatetime.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export default {
6262
}
6363

6464
return formatDate(this.value, format, /* for reactiveness */ this.$q.i18n.date)
65+
},
66+
modalBtnColor () {
67+
return this.$q.theme === 'mat'
68+
? this.color
69+
: (this.dark ? 'light' : 'dark')
6570
}
6671
},
6772
methods: {
@@ -144,7 +149,6 @@ export default {
144149
},
145150

146151
__getPicker (h, modal) {
147-
const btnColor = !this.dark === !this.invertedLight ? this.color : (this.dark ? 'white' : 'dark')
148152
return [
149153
h(QDatetimePicker, {
150154
ref: 'target',
@@ -183,7 +187,7 @@ export default {
183187
h('div', { staticClass: 'col' }),
184188
h(QBtn, {
185189
props: {
186-
color: btnColor,
190+
color: this.modalBtnColor,
187191
flat: true,
188192
label: this.cancelLabel || this.$q.i18n.label.cancel,
189193
waitForRipple: true
@@ -193,7 +197,7 @@ export default {
193197
this.editable
194198
? h(QBtn, {
195199
props: {
196-
color: btnColor,
200+
color: this.modalBtnColor,
197201
flat: true,
198202
label: this.okLabel || this.$q.i18n.label.set,
199203
waitForRipple: true

src/components/datetime/QDatetimePicker.mat.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@
107107
round
108108
dense
109109
flat
110-
:color="color"
110+
class="q-datetime-arrow"
111111
:icon="$q.icon.datetime.arrowLeft"
112112
:repeatTimeout="__repeatTimeout"
113113
:disable="beforeMinDays > 0 || disable || readonly"
114114
@click="setMonth(month - 1)"
115115
></q-btn>
116-
<div class="col">
116+
<div class="col q-datetime-month-stamp">
117117
{{ monthStamp }}
118118
</div>
119119
<q-btn
120120
round
121121
dense
122122
flat
123-
:color="color"
123+
class="q-datetime-arrow"
124124
:icon="$q.icon.datetime.arrowRight"
125125
:repeatTimeout="__repeatTimeout"
126126
:disable="afterMaxDays > 0 || disable || readonly"

src/components/datetime/datetime.ios.styl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104

105105
.modal-buttons
106106
background black
107-
border-top 1px solid $dark
108107

109108
.q-datetime-item
110109
color rgba(255, 255, 255, .87)
@@ -119,3 +118,6 @@
119118
&.type-time
120119
min-width 250px
121120
width auto
121+
@media (min-width $breakpoint-md-min)
122+
.datetime-ios-modal.type-time
123+
min-width 280px

src/components/datetime/datetime.mat.styl

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
padding 0 10px 8px
66

77
.q-datetime
8-
font-size 1rem
8+
font-size 12px
99
text-align center
1010
user-select none
1111
line-height initial
12+
.modal-buttons
13+
padding-top 8px
1214

1315
.q-datetime-header
1416
background currentColor
@@ -49,16 +51,17 @@ div + .q-datetime-time
4951

5052
.q-datetime-view-day
5153
width 250px
52-
height 300px
54+
height 285px
5355
color black
5456

5557
.q-datetime-view-year, .q-datetime-view-month
5658
> .q-btn:not(.active)
5759
color black
5860

61+
.q-datetime-month-stamp
62+
font-size 16px
63+
5964
.q-datetime-weekdays
60-
font-size .75rem
61-
margin-top 10px
6265
margin-bottom 5px
6366
div
6467
opacity .6
@@ -72,20 +75,21 @@ div + .q-datetime-time
7275
background transparent
7376

7477
.q-datetime-days div
75-
font-size 12px
76-
line-height 35px
77-
width 35px
78-
height 35px
78+
margin 1px
79+
line-height 33px
80+
width 33px
81+
height 33px
7982
border-radius 50%
8083

8184
&.q-datetime-day-active
8285
background currentColor
8386
> span
8487
color white
88+
font-weight bold
8589
&.q-datetime-day-today
8690
color currentColor
8791
font-weight bold
88-
font-size 105%
92+
font-size 14px
8993
&:not(.q-datetime-fillerday):not(.disabled):not(.q-datetime-day-active):hover
9094
background $grey-4
9195

@@ -143,8 +147,13 @@ div + .q-datetime-time
143147
transform translate(-50%, -50%)
144148
background currentColor
145149

150+
.q-datetime-arrow
151+
color $grey-7
152+
146153
.q-datetime-dark
147154
background $dark
155+
.q-datetime-arrow
156+
color $light
148157
.q-datetime-header, .q-datetime-clock
149158
background $grey-8
150159
.q-datetime-view-day
@@ -153,7 +162,7 @@ div + .q-datetime-time
153162
> .q-btn:not(.active)
154163
color white
155164
.q-datetime-days div
156-
&:not(.q-datetime-fillerday):not(.disabled):not(.q-datetime-day-active):hover
165+
&.q-datetime-day-active > span, &:not(.q-datetime-fillerday):not(.disabled):not(.q-datetime-day-active):hover
157166
color black
158167

159168
body.desktop .q-datetime-clock-position:not(.active):hover

0 commit comments

Comments
 (0)