From 2b1400a615c17e8349d08c0183fee9104f270eb5 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 24 Jan 2024 10:50:41 +0000 Subject: [PATCH 1/2] 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' From 4084113fd8ed1bb0b40e1a3622030bc8641bd18a Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot <> Date: Wed, 24 Jan 2024 10:51:51 +0000 Subject: [PATCH 2/2] Update API doc --- doc/common/apidoc/index.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/common/apidoc/index.json b/doc/common/apidoc/index.json index 1f47cec77..e7139bfb3 100644 --- a/doc/common/apidoc/index.json +++ b/doc/common/apidoc/index.json @@ -23735,6 +23735,14 @@ "default": "", "description": "Used to pass attributes to the item group's DOM element." }, + { + "name": "itemGroupLabel", + "optional": true, + "readonly": false, + "type": "DropdownPassThroughOptionType", + "default": "", + "description": "Used to pass attributes to the item group label's DOM element." + }, { "name": "item", "optional": true, @@ -24260,7 +24268,7 @@ "readonly": false, "type": "boolean", "default": "false", - "description": "Highlights automatically the first item." + "description": "Whether the selected option will be add highlight class." }, { "name": "showTick",