Skip to content

Commit ae51c07

Browse files
committed
feat(VStepper): extend VSheet functionality
resolves #4076
1 parent 06c04bd commit ae51c07

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

packages/api-generator/src/locale/en/v-stepper.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"props": {
33
"altLabels": "Places the labels beneath the step",
4+
"flat": "Removes the stepper's elevation.",
45
"nonLinear": "Allow user to jump to any step",
56
"vertical": "Display steps vertically"
67
},

packages/vuetify/src/components/VStepper/VStepper.sass

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@
5858
+rtl()
5959
border-right: 1px solid rgba(map-get($material, 'fg-color'), map-get($material, 'divider-percent'))
6060

61+
+sheet(v-stepper, $stepper-elevation, $stepper-border-radius, $stepper-shaped-border-radius)
62+
6163
.v-stepper
6264
border-radius: $stepper-border-radius
6365
overflow: hidden
6466
position: relative
65-
+elevation($stepper-elevation)
6667

6768
&__header
6869
height: $stepper-header-height
@@ -170,6 +171,9 @@
170171
> .v-btn
171172
margin: $stepper-content-btn-margin
172173

174+
&--flat
175+
+elevation(0, true)
176+
173177
&--is-booted
174178
.v-stepper__content, .v-stepper__wrapper
175179
transition: .3s map-get($transition, 'swing')

packages/vuetify/src/components/VStepper/VStepper.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
// Styles
22
import './VStepper.sass'
33

4+
// Extensions
5+
import VSheet from '../VSheet'
6+
47
// Components
58
import VStepperStep from './VStepperStep'
69
import VStepperContent from './VStepperContent'
710

811
// Mixins
912
import { provide as RegistrableProvide } from '../../mixins/registrable'
1013
import Proxyable from '../../mixins/proxyable'
11-
import Themeable from '../../mixins/themeable'
1214

1315
// Utilities
1416
import mixins from '../../util/mixins'
@@ -18,9 +20,9 @@ import { breaking } from '../../util/console'
1820
import { VNode } from 'vue'
1921

2022
const baseMixins = mixins(
23+
VSheet,
2124
RegistrableProvide('stepper'),
2225
Proxyable,
23-
Themeable
2426
)
2527

2628
type VStepperStepInstance = InstanceType<typeof VStepperStep>
@@ -40,6 +42,7 @@ export default baseMixins.extend({
4042
props: {
4143
altLabels: Boolean,
4244
nonLinear: Boolean,
45+
flat: Boolean,
4346
vertical: Boolean,
4447
},
4548

@@ -61,11 +64,17 @@ export default baseMixins.extend({
6164
computed: {
6265
classes (): object {
6366
return {
67+
'v-stepper--flat': this.flat,
6468
'v-stepper--is-booted': this.isBooted,
6569
'v-stepper--vertical': this.vertical,
6670
'v-stepper--alt-labels': this.altLabels,
6771
'v-stepper--non-linear': this.nonLinear,
68-
...this.themeClasses,
72+
...VSheet.options.computed.classes.call(this),
73+
}
74+
},
75+
styles (): object {
76+
return {
77+
...VSheet.options.computed.styles.call(this),
6978
}
7079
},
7180
},
@@ -122,9 +131,10 @@ export default baseMixins.extend({
122131
},
123132

124133
render (h): VNode {
125-
return h('div', {
134+
return h(this.tag, {
126135
staticClass: 'v-stepper',
127136
class: this.classes,
137+
style: this.styles,
128138
}, this.$slots.default)
129139
},
130140
})

packages/vuetify/src/components/VStepper/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ $stepper-header-height: 72px !default;
1313
$stepper-label-line-height: 1 !default;
1414
$stepper-label-small-font-size: map-deep-get($headings, 'caption', 'size') !default;
1515
$stepper-label-small-font-weight: 300 !default;
16+
$stepper-shaped-border-radius: map-get($rounded, 'xl') $stepper-border-radius !default;
1617
$stepper-step-error-icon-font-size: map-deep-get($headings, 'h5', 'size') !default;
1718
$stepper-step-padding: 24px !default;
1819
$stepper-step-step-font-size: map-deep-get($headings, 'caption', 'size') !default;

0 commit comments

Comments
 (0)