From aec93e5eeafcaacd732e399df900bf0eed25d0ff Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 30 Apr 2024 16:02:03 +0300 Subject: [PATCH] Refactor #5592, #5661 - For Menu & MegaMenu --- components/lib/megamenu/MegaMenu.d.ts | 30 ++++++++-------- components/lib/megamenu/MegaMenu.vue | 12 +++---- components/lib/megamenu/MegaMenuSub.vue | 28 ++++++++------- .../lib/megamenu/style/MegaMenuStyle.js | 16 ++++----- components/lib/menu/Menu.d.ts | 35 ++++++++++++------- components/lib/menu/Menu.vue | 19 +++++----- components/lib/menu/Menuitem.vue | 20 +++++------ components/lib/menu/style/MenuStyle.js | 12 +++---- 8 files changed, 93 insertions(+), 79 deletions(-) diff --git a/components/lib/megamenu/MegaMenu.d.ts b/components/lib/megamenu/MegaMenu.d.ts index 492ff3557..d6ec226a3 100755 --- a/components/lib/megamenu/MegaMenu.d.ts +++ b/components/lib/megamenu/MegaMenu.d.ts @@ -59,25 +59,25 @@ export interface MegaMenuPassThroughOptions { */ root?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the list's DOM element. + * Used to pass attributes to the root list's DOM element. */ - menu?: MegaMenuPassThroughOptionType; + rootList?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the list item's DOM element. + * Used to pass attributes to the item's DOM element. */ - menuitem?: MegaMenuPassThroughOptionType; + item?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the content's DOM element. + * Used to pass attributes to the item content's DOM element. */ - content?: MegaMenuPassThroughOptionType; + itemContent?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the action's DOM element. + * Used to pass attributes to the item link's DOM element. */ - action?: MegaMenuPassThroughOptionType; + itemLink?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the icon's DOM element. + * Used to pass attributes to the item icon's DOM element. */ - icon?: MegaMenuPassThroughOptionType; + itemIcon?: MegaMenuPassThroughOptionType; /** * Used to pass attributes to the label's DOM element. */ @@ -99,17 +99,17 @@ export interface MegaMenuPassThroughOptions { */ column?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the submenu header's DOM element. + * Used to pass attributes to the submenu item's DOM element. */ - submenuHeader?: MegaMenuPassThroughOptionType; + submenuItem?: MegaMenuPassThroughOptionType; /** * Used to pass attributes to the submenu's DOM element. */ submenu?: MegaMenuPassThroughOptionType; /** - * Used to pass attributes to the submenu label's DOM element. + * Used to pass attributes to the submenu item label's DOM element. */ - submenuLabel?: MegaMenuPassThroughOptionType; + submenuItemLabel?: MegaMenuPassThroughOptionType; /** * Used to pass attributes to the separator's DOM element. */ @@ -117,7 +117,7 @@ export interface MegaMenuPassThroughOptions { /** * Used to pass attributes to the mobile popup menu button's DOM element. */ - menubutton?: MegaMenuPassThroughOptionType; + button?: MegaMenuPassThroughOptionType; /** * Used to pass attributes to the start of the component. */ diff --git a/components/lib/megamenu/MegaMenu.vue b/components/lib/megamenu/MegaMenu.vue index a34d0d55c..91b34f011 100755 --- a/components/lib/megamenu/MegaMenu.vue +++ b/components/lib/megamenu/MegaMenu.vue @@ -3,23 +3,23 @@
- + - - + + @@ -421,7 +421,7 @@ export default { onEnterKey(event) { if (this.focusedItemInfo.index !== -1) { const element = DomHandler.findSingle(this.menubar, `li[id="${`${this.focusedItemId}`}"]`); - const anchorElement = element && DomHandler.findSingle(element, 'a[data-pc-section="action"]'); + const anchorElement = element && DomHandler.findSingle(element, 'a[data-pc-section="itemlink"]'); anchorElement ? anchorElement.click() : element && element.click(); diff --git a/components/lib/megamenu/MegaMenuSub.vue b/components/lib/megamenu/MegaMenuSub.vue index 15cf7b491..8f4bd994d 100644 --- a/components/lib/megamenu/MegaMenuSub.vue +++ b/components/lib/megamenu/MegaMenuSub.vue @@ -1,12 +1,12 @@