Skip to content

Commit f3dce45

Browse files
committed
chore: fix build errors
1 parent 7503530 commit f3dce45

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

packages/vuetify/src/components/VDataIterator/composables/items.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getPropertyFromItem, propsFactory } from '@/util'
66
import type { PropType } from 'vue'
77
import type { GroupableItem } from '@/components/VDataTable/composables/group'
88
import type { SelectableItem } from '@/components/VDataTable/composables/select'
9+
import type { InternalItem } from '@/composables/filter'
910
import type { SelectItemKey } from '@/util'
1011

1112
export interface DataIteratorItemProps {
@@ -15,7 +16,7 @@ export interface DataIteratorItemProps {
1516
returnObject: boolean
1617
}
1718

18-
export interface DataIteratorItem<T = any> extends GroupableItem<T>, SelectableItem {
19+
export interface DataIteratorItem<T = any> extends Omit<InternalItem<T>, 'type'>, GroupableItem<T>, SelectableItem {
1920
value: unknown
2021
}
2122

packages/vuetify/src/components/VDataTable/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export type InternalDataTableHeader = Omit<DataTableHeader, 'key' | 'value' | 'c
4545
children?: InternalDataTableHeader[]
4646
}
4747

48-
export interface DataTableItem<T = any> extends InternalItem<T>, GroupableItem<T>, SelectableItem {
48+
export interface DataTableItem<T = any> extends Omit<InternalItem<T>, 'type'>, GroupableItem<T>, SelectableItem {
4949
key: any
5050
index: number
5151
columns: {

packages/vuetify/src/components/VList/VList.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ import type { VListChildrenSlots } from './VListChildren'
4040
import type { ItemProps, ListItem } from '@/composables/list-items'
4141
import type { GenericProps, SelectItemKey } from '@/util'
4242

43-
export interface InternalListItem<T = any> extends ListItem<T> {
44-
type?: 'item' | 'subheader' | 'divider'
45-
}
43+
export interface InternalListItem<T = any> extends ListItem<T> {}
4644

47-
function transformItem (props: ItemProps & { itemType?: string }, item: any): InternalListItem {
45+
function transformItem (props: ItemProps, item: any): ListItem {
4846
const type = getPropertyFromItem(item, props.itemType, 'item')
4947
const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle)
5048
const value = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemValue, undefined)
@@ -69,7 +67,7 @@ function transformItem (props: ItemProps & { itemType?: string }, item: any): In
6967
}
7068
}
7169

72-
function transformItems (props: ItemProps & { itemType?: string }, items: (string | object)[]) {
70+
function transformItems (props: ItemProps, items: (string | object)[]) {
7371
const array: InternalListItem[] = []
7472

7573
for (const item of items) {
@@ -79,7 +77,7 @@ function transformItems (props: ItemProps & { itemType?: string }, items: (strin
7977
return array
8078
}
8179

82-
export function useListItems (props: ItemProps & { itemType?: string }) {
80+
export function useListItems (props: ItemProps) {
8381
const items = computed(() => transformItems(props, props.items))
8482

8583
return { items }
@@ -114,10 +112,6 @@ export const makeVListProps = propsFactory({
114112
...makeDensityProps(),
115113
...makeDimensionProps(),
116114
...makeElevationProps(),
117-
itemType: {
118-
type: String,
119-
default: 'type',
120-
},
121115
...makeItemsProps(),
122116
...makeRoundedProps(),
123117
...makeTagProps(),

packages/vuetify/src/composables/__tests__/items.spec.ts renamed to packages/vuetify/src/composables/__tests__/list-items.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useItems } from '../list-items'
44
// Utilities
55
import { deepEqual } from '@/util'
66

7-
describe('items', () => {
7+
describe('list-items', () => {
88
const defaults = {
99
itemTitle: 'title',
1010
itemValue: 'value',
@@ -24,6 +24,7 @@ describe('items', () => {
2424
const { items } = useItems({ ...defaults, items: ['Foo'] })
2525
expect(items.value).toEqual([
2626
{
27+
type: 'item',
2728
title: 'Foo',
2829
value: 'Foo',
2930
props: {
@@ -39,6 +40,7 @@ describe('items', () => {
3940
const { items } = useItems({ ...defaults, items: [{ title: 'Foo' }] })
4041
expect(items.value).toEqual([
4142
{
43+
type: 'item',
4244
title: 'Foo',
4345
value: 'Foo',
4446
props: {
@@ -54,6 +56,7 @@ describe('items', () => {
5456
const { items } = useItems({ ...defaults, itemTitle: 'text', items: [{ text: 'Foo' }] })
5557
expect(items.value).toEqual([
5658
{
59+
type: 'item',
5760
title: 'Foo',
5861
value: 'Foo',
5962
props: {
@@ -69,6 +72,7 @@ describe('items', () => {
6972
const { items } = useItems({ ...defaults, itemValue: 'id', items: [{ title: 'Foo', id: 1 }] })
7073
expect(items.value).toEqual([
7174
{
75+
type: 'item',
7276
title: 'Foo',
7377
value: 1,
7478
props: {
@@ -94,6 +98,7 @@ describe('items', () => {
9498
const { items } = useItems({ ...defaults, items: rawItems })
9599
expect(items.value).toEqual([
96100
{
101+
type: 'item',
97102
title: 'Foo',
98103
value: 'Foo',
99104
props: {
@@ -102,6 +107,7 @@ describe('items', () => {
102107
},
103108
children: [
104109
{
110+
type: 'item',
105111
title: 'Bar',
106112
value: 'Bar',
107113
props: {
@@ -130,6 +136,7 @@ describe('items', () => {
130136
const { items } = useItems({ ...defaults, itemChildren: 'labels', items: rawItems })
131137
expect(items.value).toEqual([
132138
{
139+
type: 'item',
133140
title: 'Foo',
134141
value: 'Foo',
135142
props: {
@@ -138,6 +145,7 @@ describe('items', () => {
138145
},
139146
children: [
140147
{
148+
type: 'item',
141149
title: 'Bar',
142150
value: 'Bar',
143151
props: {
@@ -171,6 +179,7 @@ describe('items', () => {
171179

172180
expect(items.value).toEqual([
173181
{
182+
type: 'item',
174183
title: 'Foo',
175184
value: 'Foo',
176185
props: {
@@ -182,6 +191,7 @@ describe('items', () => {
182191
raw: rawItems[0],
183192
},
184193
{
194+
type: 'item',
185195
title: 'Bar',
186196
value: 'Bar',
187197
props: {

packages/vuetify/src/composables/list-items.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface ItemProps {
2424
itemValue: SelectItemKey
2525
itemChildren: SelectItemKey
2626
itemProps: SelectItemKey
27-
itemType: SelectItemKey
27+
itemType?: SelectItemKey
2828
returnObject: boolean
2929
valueComparator: typeof deepEqual | undefined
3030
}

0 commit comments

Comments
 (0)