Skip to content

Commit

Permalink
fix(VStepper): disabled actions & colors
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Aug 3, 2023
1 parent c02fda4 commit 3d1b12d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/vuetify/src/labs/VStepper/VStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { makeGroupProps, useGroup } from '@/composables/group'

// Utilities
import { computed, toRefs } from 'vue'
import { genericComponent, getPropertyFromItem, omit, propsFactory, useRender } from '@/util'
import { genericComponent, getPropertyFromItem, only, propsFactory, useRender } from '@/util'

// Types
import type { InjectionKey, PropType } from 'vue'
Expand Down Expand Up @@ -71,8 +71,8 @@ export const makeVStepperProps = propsFactory({
mandatory: 'force' as const,
selectedClass: 'v-stepper-item--selected',
}),
...omit(makeVSheetProps(), ['color']),
...makeVStepperActionsProps(),
...makeVSheetProps(),
...only(makeVStepperActionsProps(), ['prevText', 'nextText']),
}, 'VStepper')

export const VStepper = genericComponent<VStepperSlots>()({
Expand All @@ -87,7 +87,7 @@ export const VStepper = genericComponent<VStepperSlots>()({
setup (props, { slots }) {
// TODO: fix typing
const { items: _items, next, prev, selected } = useGroup(props as any, VStepperSymbol)
const { editable, prevText, nextText } = toRefs(props)
const { color, editable, prevText, nextText } = toRefs(props)

const items = computed(() => props.items.map((item, index) => {
const title = getPropertyFromItem(item, props.itemTitle, item)
Expand Down Expand Up @@ -117,13 +117,15 @@ export const VStepper = genericComponent<VStepperSlots>()({
nextText,
},
VStepperActions: {
color,
disabled,
prevText,
nextText,
},
})

useRender(() => {
const [sheetProps] = VSheet.filterProps(props)
const [stepperActionProps] = VStepperActions.filterProps(props)

const hasHeader = !!(slots.header || props.items.length)
const hasWindow = props.items.length > 0
Expand All @@ -132,6 +134,7 @@ export const VStepper = genericComponent<VStepperSlots>()({
return (
<VSheet
{ ...sheetProps }
color={ props.bgColor }
class={[
'v-stepper',
{
Expand Down Expand Up @@ -183,7 +186,6 @@ export const VStepper = genericComponent<VStepperSlots>()({
slots.actions?.({ next, prev }) ?? (
<VStepperActions
key="stepper-actions"
{ ...stepperActionProps }
onClick:prev={ prev }
onClick:next={ next }
/>
Expand Down

0 comments on commit 3d1b12d

Please sign in to comment.