From b46caf18a62ce11edc0f8e86fcff890485705886 Mon Sep 17 00:00:00 2001 From: Yuchao Wu Date: Sat, 13 Apr 2024 10:14:54 +1000 Subject: [PATCH] feat(VInput): add dimention width-related support --- packages/vuetify/src/components/VInput/VInput.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/vuetify/src/components/VInput/VInput.tsx b/packages/vuetify/src/components/VInput/VInput.tsx index 7b79f1f4180..078292b0554 100644 --- a/packages/vuetify/src/components/VInput/VInput.tsx +++ b/packages/vuetify/src/components/VInput/VInput.tsx @@ -8,13 +8,14 @@ import { VMessages } from '@/components/VMessages/VMessages' // Composables import { makeComponentProps } from '@/composables/component' import { makeDensityProps, useDensity } from '@/composables/density' +import { makeDimensionProps, useDimension } from '@/composables/dimensions' import { IconValue } from '@/composables/icons' import { useRtl } from '@/composables/locale' import { makeValidationProps, useValidation } from '@/composables/validation' // Utilities import { computed } from 'vue' -import { EventProp, genericComponent, getUid, propsFactory, useRender } from '@/util' +import { EventProp, genericComponent, getUid, only, propsFactory, useRender } from '@/util' // Types import type { ComputedRef, PropType, Ref } from 'vue' @@ -62,6 +63,11 @@ export const makeVInputProps = propsFactory({ ...makeComponentProps(), ...makeDensityProps(), + ...only(makeDimensionProps(), [ + 'maxWidth', + 'minWidth', + 'width', + ]), ...makeValidationProps(), }, 'VInput') @@ -92,6 +98,7 @@ export const VInput = genericComponent( setup (props, { attrs, slots, emit }) { const { densityClasses } = useDensity(props) + const { dimensionStyles } = useDimension(props) const { rtlClasses } = useRtl() const { InputIcon } = useInputIcon(props) @@ -160,7 +167,10 @@ export const VInput = genericComponent( validationClasses.value, props.class, ]} - style={ props.style } + style={[ + dimensionStyles.value, + props.style, + ]} > { hasPrepend && (