Skip to content

Commit

Permalink
feat(VInput): add dimensions support to VInput (#19600)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwu9145 committed Apr 13, 2024
1 parent 3fca676 commit 45c8f61
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/vuetify/src/components/VInput/VInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -62,6 +63,11 @@ export const makeVInputProps = propsFactory({

...makeComponentProps(),
...makeDensityProps(),
...only(makeDimensionProps(), [
'maxWidth',
'minWidth',
'width',
]),
...makeValidationProps(),
}, 'VInput')

Expand Down Expand Up @@ -92,6 +98,7 @@ export const VInput = genericComponent<new <T>(

setup (props, { attrs, slots, emit }) {
const { densityClasses } = useDensity(props)
const { dimensionStyles } = useDimension(props)
const { rtlClasses } = useRtl()
const { InputIcon } = useInputIcon(props)

Expand Down Expand Up @@ -160,7 +167,10 @@ export const VInput = genericComponent<new <T>(
validationClasses.value,
props.class,
]}
style={ props.style }
style={[
dimensionStyles.value,
props.style,
]}
>
{ hasPrepend && (
<div key="prepend" class="v-input__prepend">
Expand Down

0 comments on commit 45c8f61

Please sign in to comment.