From 3ed2355a4591a1b73eecf121f2826352396d3eb7 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 17 Apr 2023 09:30:28 +0300 Subject: [PATCH 1/6] 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)" >
- @@ -27,7 +27,7 @@
  • From 155a47936363085e7b37f370e7b1fb36b997025b Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot <> Date: Mon, 17 Apr 2023 06:35:39 +0000 Subject: [PATCH 4/6] Update API doc --- doc/common/apidoc/index.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/common/apidoc/index.json b/doc/common/apidoc/index.json index c0dcb39ac..a4b00ccbf 100644 --- a/doc/common/apidoc/index.json +++ b/doc/common/apidoc/index.json @@ -22751,6 +22751,19 @@ ], "returnType": "VNode[]", "description": "Custom content for each item." + }, + { + "name": "itemicon", + "parameters": [ + { + "name": "scope", + "optional": false, + "type": "{\n \t item: MenuItem, // Menuitem instance\n \t class: any, // Style class of the item icon element.\n }", + "description": "item icon slot's params." + } + ], + "returnType": "VNode[]", + "description": "Custom item icon template." } ] }, From 753abea7aed70e6af8e60b802427e125372ae895 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 17 Apr 2023 09:38:00 +0300 Subject: [PATCH 5/6] Refactor #3832 Refactor #3833 - For TieredMenu --- api-generator/components/tieredmenu.js | 4 ++++ components/lib/tieredmenu/TieredMenu.d.ts | 14 ++++++++++++++ components/lib/tieredmenu/TieredMenu.vue | 2 +- components/lib/tieredmenu/TieredMenuSub.vue | 10 +++++----- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/api-generator/components/tieredmenu.js b/api-generator/components/tieredmenu.js index 57b1b20d7..bbe629896 100644 --- a/api-generator/components/tieredmenu.js +++ b/api-generator/components/tieredmenu.js @@ -45,6 +45,10 @@ const TieredMenuSlots = [ { name: 'submenuicon', description: 'Custom submenu icon template.' + }, + { + name: 'itemicon', + description: 'Custom item icon template.' } ]; diff --git a/components/lib/tieredmenu/TieredMenu.d.ts b/components/lib/tieredmenu/TieredMenu.d.ts index a7edfd7c3..a8c124c1e 100755 --- a/components/lib/tieredmenu/TieredMenu.d.ts +++ b/components/lib/tieredmenu/TieredMenu.d.ts @@ -86,6 +86,20 @@ export interface TieredMenuSlots { */ active: boolean; }): 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/tieredmenu/TieredMenu.vue b/components/lib/tieredmenu/TieredMenu.vue index 255056b68..552ddb0eb 100755 --- a/components/lib/tieredmenu/TieredMenu.vue +++ b/components/lib/tieredmenu/TieredMenu.vue @@ -16,7 +16,7 @@ :menuId="id" :focusedItemId="focused ? focusedItemId : undefined" :items="processedItems" - :template="$slots" + :templates="$slots" :activeItemPath="activeItemPath" :exact="exact" :level="0" diff --git a/components/lib/tieredmenu/TieredMenuSub.vue b/components/lib/tieredmenu/TieredMenuSub.vue index fe189db2c..82cf151c4 100755 --- a/components/lib/tieredmenu/TieredMenuSub.vue +++ b/components/lib/tieredmenu/TieredMenuSub.vue @@ -16,7 +16,7 @@ :aria-posinset="getAriaPosInset(index)" >
    -