From 2b1400a615c17e8349d08c0183fee9104f270eb5 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 24 Jan 2024 10:50:41 +0000 Subject: [PATCH] Refactor #5141 --- components/lib/dropdown/Dropdown.d.ts | 6 +++++- components/lib/dropdown/Dropdown.vue | 6 ++++-- components/lib/dropdown/style/DropdownStyle.js | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/lib/dropdown/Dropdown.d.ts b/components/lib/dropdown/Dropdown.d.ts index 52c75157e..f99debf03 100755 --- a/components/lib/dropdown/Dropdown.d.ts +++ b/components/lib/dropdown/Dropdown.d.ts @@ -139,6 +139,10 @@ export interface DropdownPassThroughOptions { * Used to pass attributes to the item group's DOM element. */ itemGroup?: DropdownPassThroughOptionType; + /** + * Used to pass attributes to the item group label's DOM element. + */ + itemGroupLabel?: DropdownPassThroughOptionType; /** * Used to pass attributes to the item's DOM element. */ @@ -431,7 +435,7 @@ export interface DropdownProps { */ focusOnHover?: boolean | undefined; /** - * Highlights automatically the first item. + * Whether the selected option will be add highlight class. * @defaultValue false */ highlightOnSelect?: boolean | undefined; diff --git a/components/lib/dropdown/Dropdown.vue b/components/lib/dropdown/Dropdown.vue index 90b5d33d1..6c74e0128 100755 --- a/components/lib/dropdown/Dropdown.vue +++ b/components/lib/dropdown/Dropdown.vue @@ -106,7 +106,9 @@
    - {{ getOptionLabel(option) }} + {{ getOptionLabel(option) }} diff --git a/components/lib/dropdown/style/DropdownStyle.js b/components/lib/dropdown/style/DropdownStyle.js index 95ee34469..60da6d0d4 100644 --- a/components/lib/dropdown/style/DropdownStyle.js +++ b/components/lib/dropdown/style/DropdownStyle.js @@ -136,6 +136,7 @@ const classes = { wrapper: 'p-dropdown-items-wrapper', list: 'p-dropdown-items', itemGroup: 'p-dropdown-item-group', + itemGroupLabel: 'p-dropdown-item-group-label', item: ({ instance, props, state, option, focusedOption }) => [ 'p-dropdown-item', { @@ -144,6 +145,7 @@ const classes = { 'p-disabled': instance.isOptionDisabled(option) } ], + itemLabel: 'p-dropdown-item-label', tickIcon: 'p-dropdown-tick-icon', blankIcon: 'p-dropdown-blank-icon', emptyMessage: 'p-dropdown-empty-message'