From 24538f0fd0fa69c6d05d7ee7ab7441cb60722b3d 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: Fri, 5 May 2023 15:53:35 +0300 Subject: [PATCH] Refactor #3922 - For InputText --- api-generator/components/inputtext.js | 6 ++++++ components/lib/config/PrimeVue.d.ts | 2 ++ components/lib/inputtext/InputText.d.ts | 25 +++++++++++++++++++++++++ components/lib/inputtext/InputText.vue | 5 ++++- 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/api-generator/components/inputtext.js b/api-generator/components/inputtext.js index 3b4110c74..4541151ce 100644 --- a/api-generator/components/inputtext.js +++ b/api-generator/components/inputtext.js @@ -4,6 +4,12 @@ const InputTextProps = [ type: 'any', default: 'null', description: 'Value of the component.' + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index 7696bd8f2..7594bd442 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -31,6 +31,7 @@ import { ImagePassThroughOptions } from '../image'; import { InlineMessagePassThroughOptions } from '../inlinemessage'; import { InplacePassThroughOptions } from '../inplace'; import { InputMaskPassThroughOptions } from '../inputmask'; +import { InputTextPassThroughOptions } from '../inputtext'; import { MegaMenuPassThroughOptions } from '../megamenu'; import { MenuPassThroughOptions } from '../menu'; import { MenubarPassThroughOptions } from '../menubar'; @@ -107,6 +108,7 @@ interface PrimeVuePTOptions { inlinemessage?: InlineMessagePassThroughOptions; inplace?: InplacePassThroughOptions; inputmask?: InputMaskPassThroughOptions; + inputtext?: InputTextPassThroughOptions; megamenu?: MegaMenuPassThroughOptions; menu?: MenuPassThroughOptions; menubar?: MenubarPassThroughOptions; diff --git a/components/lib/inputtext/InputText.d.ts b/components/lib/inputtext/InputText.d.ts index 9dba4ca93..65afbd458 100755 --- a/components/lib/inputtext/InputText.d.ts +++ b/components/lib/inputtext/InputText.d.ts @@ -10,6 +10,26 @@ import { InputHTMLAttributes } from 'vue'; import { ClassComponent, GlobalComponentConstructor, Nullable } from '../ts-helpers'; +export declare type InputTextPassThroughOptionType = InputTextPassThroughAttributes | null | undefined; + +/** + * Custom passthrough(pt) options. + * @see {@link InputTextProps.pt} + */ +export interface InputTextPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: InputTextPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface InputTextPassThroughAttributes { + [key: string]: any; +} + /** * Defines valid properties in InputText component. */ @@ -18,6 +38,11 @@ export interface InputTextProps extends InputHTMLAttributes { * Value of the component. */ modelValue?: Nullable; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {InputTextPassThroughOptions} + */ + pt?: InputTextPassThroughOptions; } /** diff --git a/components/lib/inputtext/InputText.vue b/components/lib/inputtext/InputText.vue index 18d5ba27e..d15a15b4c 100755 --- a/components/lib/inputtext/InputText.vue +++ b/components/lib/inputtext/InputText.vue @@ -1,10 +1,13 @@