From 79e5a5745ce670e6690da480ea2e9a0f375b557f 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, 30 May 2023 08:51:28 +0300 Subject: [PATCH] Revert "Refactor #3965 - Menu components cx implementation fixes" This reverts commit 8181d7ee8525d78a21c7e5c5d425910966491923. --- components/lib/contextmenu/BaseContextMenu.vue | 5 ++--- components/lib/contextmenu/ContextMenuSub.vue | 12 ++++++------ components/lib/menu/BaseMenu.vue | 7 +++---- components/lib/menu/Menu.vue | 4 ++-- components/lib/menu/Menuitem.vue | 10 +++++----- components/lib/tieredmenu/BaseTieredMenu.vue | 6 ++---- components/lib/tieredmenu/TieredMenuSub.vue | 15 +++++++++------ 7 files changed, 29 insertions(+), 30 deletions(-) diff --git a/components/lib/contextmenu/BaseContextMenu.vue b/components/lib/contextmenu/BaseContextMenu.vue index 887dce3f6..e62cfe3ce 100644 --- a/components/lib/contextmenu/BaseContextMenu.vue +++ b/components/lib/contextmenu/BaseContextMenu.vue @@ -56,7 +56,6 @@ const classes = { menu: 'p-contextmenu-root-list', menuitem: ({ context, processedItem }) => [ 'p-menuitem', - context.getItemProp(processedItem, 'class'), { 'p-menuitem-active p-highlight': context.isItemActive(processedItem), 'p-focus': context.isItemFocused(processedItem), @@ -71,11 +70,11 @@ const classes = { 'router-link-active-exact': context.exact && isExactActive } ], - icon: ({ context, processedItem }) => ['p-menuitem-icon', context.getItemProp(processedItem, 'icon')], + icon: 'p-menuitem-icon', label: 'p-menuitem-text', submenuIcon: 'p-submenu-icon', submenu: 'p-submenu-list', - separator: ({ context, processedItem }) => ['p-menuitem-separator', context.getItemProp(processedItem, 'class')] + separator: 'p-menuitem-separator' }; const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_contextmenu_style', manual: true }); diff --git a/components/lib/contextmenu/ContextMenuSub.vue b/components/lib/contextmenu/ContextMenuSub.vue index 06b6252de..37b933854 100755 --- a/components/lib/contextmenu/ContextMenuSub.vue +++ b/components/lib/contextmenu/ContextMenuSub.vue @@ -6,7 +6,7 @@ v-if="isItemVisible(processedItem) && !getItemProp(processedItem, 'separator')" :id="getItemId(processedItem)" :style="getItemProp(processedItem, 'style')" - :class="getCXOptions('menuitem', { processedItem })" + :class="[getCXOptions('menuitem', { processedItem }), getItemProp(processedItem, 'class')]" role="menuitem" :aria-label="getItemLabel(processedItem)" :aria-disabled="isItemDisabled(processedItem) || undefined" @@ -24,14 +24,14 @@ diff --git a/components/lib/menu/Menuitem.vue b/components/lib/menu/Menuitem.vue index d9ce19b72..9bd715539 100644 --- a/components/lib/menu/Menuitem.vue +++ b/components/lib/menu/Menuitem.vue @@ -2,7 +2,7 @@
  • diff --git a/components/lib/tieredmenu/BaseTieredMenu.vue b/components/lib/tieredmenu/BaseTieredMenu.vue index 0c692148c..8757cd979 100644 --- a/components/lib/tieredmenu/BaseTieredMenu.vue +++ b/components/lib/tieredmenu/BaseTieredMenu.vue @@ -60,7 +60,6 @@ const classes = { menu: 'p-tieredmenu-root-list', menuitem: ({ context, processedItem }) => [ 'p-menuitem', - context.getItemProp(processedItem, 'class'), { 'p-menuitem-active p-highlight': context.isItemActive(processedItem), 'p-focus': context.isItemFocused(processedItem), @@ -75,11 +74,10 @@ const classes = { 'router-link-active-exact': context.exact && isExactActive } ], - icon: ({ context, processedItem }) => ['p-menuitem-icon', context.getItemProp(processedItem, 'icon')], + icon: 'p-menuitem-icon', text: 'p-menuitem-text', submenuIcon: 'p-submenu-icon', - submenu: 'p-submenu-list', - separator: ({ context, processedItem }) => ['p-menuitem-separator', context.getItemProp(processedItem, 'class')] + submenu: 'p-submenu-list' }; const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_tieredmenu_style', manual: true }); diff --git a/components/lib/tieredmenu/TieredMenuSub.vue b/components/lib/tieredmenu/TieredMenuSub.vue index cad3d7aba..68e1ca6d4 100755 --- a/components/lib/tieredmenu/TieredMenuSub.vue +++ b/components/lib/tieredmenu/TieredMenuSub.vue @@ -5,7 +5,7 @@ v-if="isItemVisible(processedItem) && !getItemProp(processedItem, 'separator')" :id="getItemId(processedItem)" :style="getItemProp(processedItem, 'style')" - :class="getCXOptions('menuitem', { processedItem })" + :class="[getCXOptions('menuitem', { processedItem }), getItemProp(processedItem, 'class')]" role="menuitem" :aria-label="getItemLabel(processedItem)" :aria-disabled="isItemDisabled(processedItem) || undefined" @@ -23,14 +23,14 @@