From 3ed2355a4591a1b73eecf121f2826352396d3eb7 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 17 Apr 2023 09:30:28 +0300 Subject: [PATCH] Refactor #3832 Refactor #3833 - For PanelMenu --- api-generator/components/panelmenu.js | 8 +++++++ components/lib/panelmenu/PanelMenu.d.ts | 28 ++++++++++++++++++++++ components/lib/panelmenu/PanelMenu.vue | 6 ++--- components/lib/panelmenu/PanelMenuList.vue | 4 ++-- components/lib/panelmenu/PanelMenuSub.vue | 14 +++++------ 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/api-generator/components/panelmenu.js b/api-generator/components/panelmenu.js index a534bc763..d15581799 100644 --- a/api-generator/components/panelmenu.js +++ b/api-generator/components/panelmenu.js @@ -27,6 +27,14 @@ const PanelMenuSlots = [ { name: 'submenuicon', description: 'Custom submenu icon template.' + }, + { + name: 'headericon', + description: 'Custom header icon template.' + }, + { + name: 'itemicon', + description: 'Custom item icon template.' } ]; diff --git a/components/lib/panelmenu/PanelMenu.d.ts b/components/lib/panelmenu/PanelMenu.d.ts index 94cb98495..6785b8abc 100755 --- a/components/lib/panelmenu/PanelMenu.d.ts +++ b/components/lib/panelmenu/PanelMenu.d.ts @@ -89,6 +89,34 @@ export interface PanelMenuSlots { */ active: boolean; }): VNode[]; + /** + * Custom header icon template. + * @param {Object} scope - header icon slot's params. + */ + headericon(scope: { + /** + * Menuitem instance + */ + item: MenuItem; + /** + * Style class of the item icon element. + */ + class: any; + }): VNode[]; + /** + * Custom item icon template. + * @param {Object} scope - item icon slot's params. + */ + itemicon(scope: { + /** + * Menuitem instance + */ + item: MenuItem; + /** + * Style class of the item icon element. + */ + class: any; + }): VNode[]; } /** diff --git a/components/lib/panelmenu/PanelMenu.vue b/components/lib/panelmenu/PanelMenu.vue index 1b926ac0f..6db4b4516 100644 --- a/components/lib/panelmenu/PanelMenu.vue +++ b/components/lib/panelmenu/PanelMenu.vue @@ -18,7 +18,7 @@ @@ -36,7 +36,7 @@
- +
diff --git a/components/lib/panelmenu/PanelMenuList.vue b/components/lib/panelmenu/PanelMenuList.vue index 05cf8acb7..83cdf691d 100644 --- a/components/lib/panelmenu/PanelMenuList.vue +++ b/components/lib/panelmenu/PanelMenuList.vue @@ -8,7 +8,7 @@ :panelId="panelId" :focusedItemId="focused ? focusedItemId : undefined" :items="processedItems" - :template="template" + :templates="templates" :activeItemPath="activeItemPath" :exact="exact" @focus="onFocus" @@ -34,7 +34,7 @@ export default { type: Array, default: null }, - template: { + templates: { type: Object, default: null }, diff --git a/components/lib/panelmenu/PanelMenuSub.vue b/components/lib/panelmenu/PanelMenuSub.vue index 342f7ac51..277110132 100755 --- a/components/lib/panelmenu/PanelMenuSub.vue +++ b/components/lib/panelmenu/PanelMenuSub.vue @@ -14,20 +14,20 @@ :aria-posinset="getAriaPosInset(index)" >
-