Refactor #5176 - invalid property added

This commit is contained in:
tugcekucukoglu 2024-01-30 14:27:56 +03:00
parent b42c9eb7ee
commit a9a254915c
54 changed files with 198 additions and 12 deletions

View file

@ -10,6 +10,10 @@ export default {
size: {
type: String,
default: null
},
invalid: {
type: Boolean,
default: false
}
},
style: InputTextStyle,

View file

@ -91,6 +91,11 @@ export interface InputTextProps extends InputHTMLAttributes {
* Defines the size of the component.
*/
size?: 'small' | 'large' | undefined;
/**
* When present, it specifies that the component should have invalid state style.
* @defaultValue false
*/
invalid?: boolean | undefined;
/**
* Used to pass attributes to DOM elements inside the component.
* @type {InputTextPassThroughOptions}

View file

@ -6,7 +6,8 @@ const classes = {
{
'p-filled': instance.filled,
'p-inputtext-sm': props.size === 'small',
'p-inputtext-lg': props.size === 'large'
'p-inputtext-lg': props.size === 'large',
'p-invalid': props.invalid
}
]
};