diff --git a/api-generator/components/inputtext.js b/api-generator/components/inputtext.js index 4541151ce..d59132d01 100644 --- a/api-generator/components/inputtext.js +++ b/api-generator/components/inputtext.js @@ -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', diff --git a/components/lib/inputtext/BaseInputText.vue b/components/lib/inputtext/BaseInputText.vue index c2af83bdc..816e8fcfd 100644 --- a/components/lib/inputtext/BaseInputText.vue +++ b/components/lib/inputtext/BaseInputText.vue @@ -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 diff --git a/components/lib/inputtext/InputText.d.ts b/components/lib/inputtext/InputText.d.ts index 853995c84..b4a8bd2df 100755 --- a/components/lib/inputtext/InputText.d.ts +++ b/components/lib/inputtext/InputText.d.ts @@ -38,6 +38,10 @@ export interface InputTextProps extends InputHTMLAttributes { * Value of the component. */ modelValue?: Nullable; + /** + * Defines the size of the component. + */ + size?: 'small' | 'large' | undefined; /** * Uses to pass attributes to DOM elements inside the component. * @type {InputTextPassThroughOptions}