Fixed #4106 - InputText: size property
parent
3d49b11814
commit
019f1607e9
|
@ -5,6 +5,12 @@ const InputTextProps = [
|
|||
default: 'null',
|
||||
description: 'Value of the component.'
|
||||
},
|
||||
{
|
||||
name: 'size',
|
||||
type: 'string',
|
||||
default: 'null',
|
||||
description: 'Defines the size of the component, valid values are "small" and "large".'
|
||||
},
|
||||
{
|
||||
name: 'pt',
|
||||
type: 'any',
|
||||
|
|
|
@ -2,14 +2,25 @@
|
|||
import BaseComponent from 'primevue/basecomponent';
|
||||
|
||||
const classes = {
|
||||
root: ({ instance }) => ['p-inputtext p-component', { 'p-filled': instance.filled }]
|
||||
root: ({ instance, props }) => [
|
||||
'p-inputtext p-component',
|
||||
{
|
||||
'p-filled': instance.filled,
|
||||
'p-inputtext-sm': props.size === 'small',
|
||||
'p-inputtext-lg': props.size === 'large'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'BaseInputText',
|
||||
extends: BaseComponent,
|
||||
props: {
|
||||
modelValue: null
|
||||
modelValue: null,
|
||||
size: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
|
|
|
@ -38,6 +38,10 @@ export interface InputTextProps extends InputHTMLAttributes {
|
|||
* Value of the component.
|
||||
*/
|
||||
modelValue?: Nullable<string>;
|
||||
/**
|
||||
* Defines the size of the component.
|
||||
*/
|
||||
size?: 'small' | 'large' | undefined;
|
||||
/**
|
||||
* Uses to pass attributes to DOM elements inside the component.
|
||||
* @type {InputTextPassThroughOptions}
|
||||
|
|
Loading…
Reference in New Issue