Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(VInput): add dimensions support to VInput #19600

Merged
merged 1 commit into from
Apr 13, 2024
Merged
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
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
Loading