From 8c397592ea2ae872e509944f29207bf60ecb1113 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, 23 May 2023 15:44:11 +0300 Subject: [PATCH] Refactor #3965 - For AutoComplete --- components/lib/autocomplete/AutoComplete.d.ts | 18 +- components/lib/autocomplete/AutoComplete.vue | 348 ++---------------- .../lib/autocomplete/BaseAutoComplete.vue | 328 +++++++++++++++++ 3 files changed, 378 insertions(+), 316 deletions(-) create mode 100644 components/lib/autocomplete/BaseAutoComplete.vue diff --git a/components/lib/autocomplete/AutoComplete.d.ts b/components/lib/autocomplete/AutoComplete.d.ts index d3fa36748..0a1bb7145 100755 --- a/components/lib/autocomplete/AutoComplete.d.ts +++ b/components/lib/autocomplete/AutoComplete.d.ts @@ -108,7 +108,7 @@ export interface AutoCompletePassThroughOptions { */ container?: AutoCompletePassThroughOptionType; /** - * Uses to pass attributes to the token' DOM element. + * Uses to pass attributes to the token's DOM element. */ token?: AutoCompletePassThroughOptionType; /** @@ -119,6 +119,10 @@ export interface AutoCompletePassThroughOptions { * Uses to pass attributes to the remove token icon's DOM element. */ removeTokenIcon?: AutoCompletePassThroughOptionType; + /** + * Uses to pass attributes to the input token's DOM element. + */ + inputToken?: AutoCompletePassThroughOptionType; /** * Uses to pass attributes to the loading icon's DOM element. */ @@ -426,6 +430,11 @@ export interface AutoCompleteProps { * @type {AutoCompletePassThroughOptions} */ pt?: AutoCompletePassThroughOptions; + /** + * When enabled, it removes component related styles in the core. + * @defaultValue false + */ + unstyled?: boolean; } /** @@ -561,7 +570,12 @@ export interface AutoCompleteSlots { /** * Custom dropdown icon template. */ - dropdownicon(): VNode[]; + dropdownicon(scope: { + /** + * Style class of the icon. + */ + class: string; + }): VNode[]; /** * Custom remove token icon template in multiple mode. */ diff --git a/components/lib/autocomplete/AutoComplete.vue b/components/lib/autocomplete/AutoComplete.vue index 2b90502d3..a6abe1254 100755 --- a/components/lib/autocomplete/AutoComplete.vue +++ b/components/lib/autocomplete/AutoComplete.vue @@ -1,12 +1,12 @@ - - diff --git a/components/lib/autocomplete/BaseAutoComplete.vue b/components/lib/autocomplete/BaseAutoComplete.vue new file mode 100644 index 000000000..a5e799099 --- /dev/null +++ b/components/lib/autocomplete/BaseAutoComplete.vue @@ -0,0 +1,328 @@ +