Skip to content

Commit e27f32d

Browse files
committed
feat(QInput/QSelect/QField): ability to customize standout (now a Boolean or String prop) quasarframework#3914
1 parent cdc1015 commit e27f32d

File tree

11 files changed

+46
-6
lines changed

11 files changed

+46
-6
lines changed

docs/src/examples/QField/DesignOverview.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
</template>
2626
</q-field>
2727

28+
<q-field standout="bg-teal text-white" label="Custom standout" stack-label>
29+
<template v-slot:control>
30+
<div class="self-center full-width no-outline" tabindex="0">Field content</div>
31+
</template>
32+
</q-field>
33+
2834
<q-field borderless label="Borderless" stack-label>
2935
<template v-slot:control>
3036
<div class="self-center full-width no-outline" tabindex="0">Field content</div>

docs/src/examples/QField/DesignStandout.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
</template>
1616
</q-field>
1717

18+
<q-field standout="bg-teal text-white" label="Custom standout" stack-label :dense="dense">
19+
<template v-slot:control>
20+
<div class="self-center full-width no-outline" tabindex="0">{{text}}</div>
21+
</template>
22+
</q-field>
23+
1824
<q-field standout square hint="With perfect square borders" :dense="dense">
1925
<template v-slot:control>
2026
<div class="self-center full-width no-outline" tabindex="0">{{text}}</div>

docs/src/examples/QInput/DesignOverview.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
<q-input standout v-model="text" label="Standout" />
1111

12+
<q-input standout="bg-teal text-white" v-model="text" label="Custom standout" />
13+
1214
<q-input borderless v-model="text" label="Borderless" />
1315

1416
<q-input rounded filled v-model="text" label="Rounded filled" />

docs/src/examples/QInput/DesignStandout.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
<q-input standout v-model="text" :dense="dense" />
77

8+
<q-input standout="bg-teal text-white" v-model="text" label="Custom standout" :dense="dense" />
9+
810
<q-input standout v-model="text" label="Label (stacked)" stack-label :dense="dense" />
911

1012
<q-input standout v-model="text" label="Label" :dense="dense" />

docs/src/examples/QSelect/DesignOverview.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
<q-select standout v-model="model" :options="options" label="Standout" />
1111

12+
<q-select standout="bg-teal text-white" v-model="model" :options="options" label="Custom standout" />
13+
1214
<q-select borderless v-model="model" :options="options" label="Borderless" />
1315

1416
<q-select rounded filled v-model="model" :options="options" label="Rounded filled" />

docs/src/layouts/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ q-layout.doc-layout(view="lHh LpR lff", @scroll="onScroll")
4848
ref="docAlgolia"
4949
v-model="search"
5050
dense
51-
standout
51+
standout="bg-primary text-white"
5252
square
5353
placeholder="Search..."
5454
)

quasar/dev/components/form/input-validate.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
<q-btn label="Reset" @click="reset" color="primary" flat />
1717
</div>
1818

19+
<q-input
20+
v-model.number="model"
21+
type="number"
22+
:rules="[
23+
val => !!val || 'Type a number'
24+
]"
25+
/>
26+
1927
<q-input
2028
ref="input1"
2129
v-bind="{[type]: true}"
@@ -323,6 +331,7 @@ export default {
323331
const n = 7
324332
325333
const data = {
334+
model: null,
326335
n,
327336
type: 'filled',
328337
modelExternal: '',

quasar/dev/components/form/input.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@
244244
</q-input>
245245
</div>
246246

247+
<div class="bg-white q-pa-lg">
248+
<q-input :dense="dense" standout="bg-primary text-white" v-model="text">
249+
<q-icon slot="append" name="search" />
250+
</q-input>
251+
</div>
252+
247253
<div class="bg-primary q-pa-lg">
248254
<q-input :dense="dense" dark standout v-model="text">
249255
<q-icon slot="append" name="search" />

quasar/src/components/card/QCardActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default Vue.extend({
1515

1616
computed: {
1717
classes () {
18-
return `q-card__actions--${this.vertical ? 'vert column justify-start' : 'horiz row ' + this.alignClass}`
18+
return `q-card__actions--${this.vertical === true ? 'vert column justify-start' : 'horiz row ' + this.alignClass}`
1919
}
2020
},
2121

quasar/src/components/field/QField.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default Vue.extend({
2929
filled: Boolean,
3030
outlined: Boolean,
3131
borderless: Boolean,
32-
standout: Boolean,
32+
standout: [Boolean, String],
3333

3434
square: Boolean,
3535

@@ -132,7 +132,7 @@ export default Vue.extend({
132132
if (this.filled === true) { return 'filled' }
133133
if (this.outlined === true) { return 'outlined' }
134134
if (this.borderless === true) { return 'borderless' }
135-
if (this.standout === true) { return 'standout' }
135+
if (this.standout) { return 'standout' }
136136
return 'standard'
137137
},
138138

@@ -142,6 +142,9 @@ export default Vue.extend({
142142
if (this.hasError) {
143143
cls.push('text-negative')
144144
}
145+
else if (typeof this.standout === 'string' && this.standout.length > 0 && this.focused === true) {
146+
return this.standout
147+
}
145148
else if (this.color !== void 0) {
146149
cls.push('text-' + this.color)
147150
}

0 commit comments

Comments
 (0)