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