From 019f1607e96bd7c3c770eb573addde54bad30826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 4 Jul 2023 12:28:31 +0300 Subject: [PATCH] Fixed #4106 - InputText: size property --- api-generator/components/inputtext.js | 6 ++++++ components/lib/inputtext/BaseInputText.vue | 15 +++++++++++++-- components/lib/inputtext/InputText.d.ts | 4 ++++ 3 files changed, 23 insertions(+), 2 deletions(-) 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}