Skip to content

Commit b8a8bc2

Browse files
committed
refactor(VField): replace filterFieldProps with filterProps
closes #21087
1 parent bfa2d48 commit b8a8bc2

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

packages/vuetify/src/components/VField/VField.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ import {
2525
EventProp,
2626
genericComponent,
2727
getUid,
28-
isOn,
2928
nullifyTransforms,
30-
pick,
3129
propsFactory,
3230
standardEasing,
3331
useRender,
@@ -407,9 +405,3 @@ export const VField = genericComponent<new <T>(
407405
})
408406

409407
export type VField = InstanceType<typeof VField>
410-
411-
// TODO: this is kinda slow, might be better to implicitly inherit props instead
412-
export function filterFieldProps (attrs: Record<string, unknown>) {
413-
const keys = Object.keys(VField.props).filter(k => !isOn(k) && k !== 'class' && k !== 'style')
414-
return pick(attrs, keys)
415-
}

packages/vuetify/src/components/VFileInput/VFileInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import './VFileInput.sass'
55
import { VChip } from '@/components/VChip'
66
import { VCounter } from '@/components/VCounter'
77
import { VField } from '@/components/VField'
8-
import { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'
8+
import { makeVFieldProps } from '@/components/VField/VField'
99
import { makeVInputProps, VInput } from '@/components/VInput/VInput'
1010

1111
// Composables
@@ -179,7 +179,7 @@ export const VFileInput = genericComponent<VFileInputSlots>()({
179179
const hasDetails = !!(hasCounter || slots.details)
180180
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)
181181
const { modelValue: _, ...inputProps } = VInput.filterProps(props)
182-
const fieldProps = filterFieldProps(props)
182+
const fieldProps = VField.filterProps(props)
183183

184184
return (
185185
<VInput

packages/vuetify/src/components/VTextField/VTextField.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './VTextField.sass'
33

44
// Components
55
import { VCounter } from '@/components/VCounter/VCounter'
6-
import { filterFieldProps, makeVFieldProps, VField } from '@/components/VField/VField'
6+
import { makeVFieldProps, VField } from '@/components/VField/VField'
77
import { makeVInputProps, VInput } from '@/components/VInput/VInput'
88

99
// Composables
@@ -158,7 +158,7 @@ export const VTextField = genericComponent<VTextFieldSlots>()({
158158
const hasDetails = !!(hasCounter || slots.details)
159159
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)
160160
const { modelValue: _, ...inputProps } = VInput.filterProps(props)
161-
const fieldProps = filterFieldProps(props)
161+
const fieldProps = VField.filterProps(props)
162162

163163
return (
164164
<VInput

packages/vuetify/src/components/VTextarea/VTextarea.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import '../VTextField/VTextField.sass'
55
// Components
66
import { VCounter } from '@/components/VCounter/VCounter'
77
import { VField } from '@/components/VField'
8-
import { filterFieldProps, makeVFieldProps } from '@/components/VField/VField'
8+
import { makeVFieldProps } from '@/components/VField/VField'
99
import { makeVInputProps, VInput } from '@/components/VInput/VInput'
1010

1111
// Composables
@@ -206,7 +206,7 @@ export const VTextarea = genericComponent<VTextareaSlots>()({
206206
const hasDetails = !!(hasCounter || slots.details)
207207
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)
208208
const { modelValue: _, ...inputProps } = VInput.filterProps(props)
209-
const fieldProps = filterFieldProps(props)
209+
const fieldProps = VField.filterProps(props)
210210

211211
return (
212212
<VInput

0 commit comments

Comments
 (0)