Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/

// Types
import type { PropType } from 'vue'
import type { GenericProps } from '@/util'

export type DatePickerEventColorValue = boolean | string | string[]

Expand Down Expand Up @@ -60,7 +61,13 @@ export const makeVDatePickerMonthProps = propsFactory({
...omit(makeCalendarProps(), ['displayValue']),
}, 'VDatePickerMonth')

export const VDatePickerMonth = genericComponent<VDatePickerMonthSlots>()({
export const VDatePickerMonth = genericComponent<new <TModel>(
props: {
modelValue?: TModel
'onUpdate:modelValue'?: (value: TModel) => void
},
slots: VDatePickerMonthSlots
) => GenericProps<typeof props, typeof slots>>()({
name: 'VDatePickerMonth',

props: makeVDatePickerMonthProps(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { genericComponent, pick, propsFactory, useRender } from '@/util'

// Types
import type { PropType } from 'vue'
import type { GenericProps } from '@/util'

const allowedVariants = ['default', 'accordion', 'inset', 'popout'] as const

Expand Down Expand Up @@ -62,7 +63,13 @@ export const makeVExpansionPanelsProps = propsFactory({
},
}, 'VExpansionPanels')

export const VExpansionPanels = genericComponent<VExpansionPanelSlots>()({
export const VExpansionPanels = genericComponent<new <TModel>(
props: {
modelValue?: TModel
'onUpdate:modelValue'?: (value: TModel) => void
},
slots: VExpansionPanelSlots
) => GenericProps<typeof props, typeof slots>>()({
name: 'VExpansionPanels',

props: makeVExpansionPanelsProps(),
Expand Down
12 changes: 5 additions & 7 deletions packages/vuetify/src/components/VList/VList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,21 @@ export const makeVListProps = propsFactory({

type ItemType<T> = T extends readonly (infer U)[] ? U : never

export const VList = genericComponent<new <
T extends readonly any[],
S = unknown,
O = unknown
>(
export const VList = genericComponent<new <S, A, O, T extends readonly any[]>(
props: {
items?: T
itemTitle?: SelectItemKey<ItemType<T>>
itemValue?: SelectItemKey<ItemType<T>>
itemChildren?: SelectItemKey<ItemType<T>>
itemProps?: SelectItemKey<ItemType<T>>
selected?: S
activated?: A
opened?: O
'onUpdate:selected'?: (value: S) => void
'onUpdate:activated'?: (value: A) => void
'onUpdate:opened'?: (value: O) => void
'onClick:open'?: (value: { id: unknown, value: boolean, path: unknown[] }) => void
'onClick:select'?: (value: { id: unknown, value: boolean, path: unknown[] }) => void
opened?: O
'onUpdate:opened'?: (value: O) => void
},
slots: VListChildrenSlots<ItemType<T>>
) => GenericProps<typeof props, typeof slots>>()({
Expand Down
10 changes: 8 additions & 2 deletions packages/vuetify/src/components/VStepper/VStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { genericComponent, getPropertyFromItem, pick, propsFactory, useRender }
// Types
import type { PropType } from 'vue'
import type { StepperItem, StepperItemSlot } from './VStepperItem'
import type { SelectItemKey } from '@/util'
import type { GenericProps, SelectItemKey } from '@/util'

export type VStepperSlot = {
prev: () => void
Expand Down Expand Up @@ -87,7 +87,13 @@ export const makeVStepperProps = propsFactory({
...pick(makeVStepperActionsProps(), ['prevText', 'nextText']),
}, 'VStepper')

export const VStepper = genericComponent<VStepperSlots>()({
export const VStepper = genericComponent<new <TModel>(
props: {
modelValue?: TModel
'onUpdate:modelValue'?: (value: TModel) => void
},
slots: VStepperSlots
) => GenericProps<typeof props, typeof slots>>()({
name: 'VStepper',

props: makeVStepperProps(),
Expand Down
12 changes: 11 additions & 1 deletion packages/vuetify/src/components/VStepper/VStepperWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ import { useProxiedModel } from '@/composables/proxiedModel'
import { computed, inject } from 'vue'
import { genericComponent, omit, propsFactory, useRender } from '@/util'

// Types
import type { VWindowSlots } from '@/components/VWindow/VWindow'
import type { GenericProps } from '@/util'

export const makeVStepperWindowProps = propsFactory({
...omit(makeVWindowProps(), ['continuous', 'nextIcon', 'prevIcon', 'showArrows', 'touch', 'mandatory']),
}, 'VStepperWindow')

export const VStepperWindow = genericComponent()({
export const VStepperWindow = genericComponent<new <TModel>(
props: {
modelValue?: TModel
'onUpdate:modelValue'?: (value: TModel) => void
},
slots: VWindowSlots
) => GenericProps<typeof props, typeof slots>>()({
name: 'VStepperWindow',

props: makeVStepperWindowProps(),
Expand Down
4 changes: 3 additions & 1 deletion packages/vuetify/src/components/VTabs/VTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ export const makeVTabsProps = propsFactory({
...makeTagProps(),
}, 'VTabs')

export const VTabs = genericComponent<new <T = TabItem>(
export const VTabs = genericComponent<new <TModel, T = TabItem>(
props: {
items?: T[]
modelValue?: TModel
'onUpdate:modelValue'?: (value: TModel) => void
},
slots: VTabsSlots<T>
) => GenericProps<typeof props, typeof slots>>()({
Expand Down
12 changes: 10 additions & 2 deletions packages/vuetify/src/components/VTabs/VTabsWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@ import { genericComponent, omit, propsFactory, useRender } from '@/util'

// Types
import { VTabsSymbol } from './shared'
import type { VWindowSlots } from '@/components/VWindow/VWindow'
import type { GenericProps } from '@/util'

export const makeVTabsWindowProps = propsFactory({
...omit(makeVWindowProps(), ['continuous', 'nextIcon', 'prevIcon', 'showArrows', 'touch', 'mandatory']),
}, 'VTabsWindow')

export const VTabsWindow = genericComponent()({
export const VTabsWindow = genericComponent<new <TModel>(
props: {
modelValue?: TModel
'onUpdate:modelValue'?: (value: TModel) => void
},
slots: VWindowSlots
) => GenericProps<typeof props, typeof slots>>()({
name: 'VTabsWindow',

props: makeVTabsWindowProps(),

emits: {
'update:modelValue': (v: unknown) => true,
'update:modelValue': (v: any) => true,
},

setup (props, { slots }) {
Expand Down
10 changes: 9 additions & 1 deletion packages/vuetify/src/components/VTreeview/VTreeview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ export const makeVTreeviewProps = propsFactory({
modelValue: Array,
}, 'VTreeview')

export const VTreeview = genericComponent<new <T>(
export const VTreeview = genericComponent<new <T, O, A, S, M>(
props: {
items?: T[]
opened?: O
activated?: A
selected?: S
modelValue?: M
'onUpdate:opened'?: (value: O) => void
'onUpdate:activated'?: (value: A) => void
'onUpdate:selected'?: (value: S) => void
'onUpdate:modelValue'?: (value: M) => void
},
slots: VTreeviewChildrenSlots<T> & {
'no-data': never
Expand Down