From 411d62df2cba3d3b5a15bfce203fbab48654c7b9 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: Mon, 4 Sep 2023 12:16:03 +0300 Subject: [PATCH] Fixed #4379 - Menu components: RouterBindProps typing --- components/lib/breadcrumb/Breadcrumb.d.ts | 20 ++++++++++++++++- components/lib/contextmenu/ContextMenu.d.ts | 24 ++++++++++++++++++++- components/lib/dock/Dock.d.ts | 16 +++++++++++++- components/lib/megamenu/MegaMenu.d.ts | 24 ++++++++++++++++++++- components/lib/menu/Menu.d.ts | 20 ++++++++++++++++- components/lib/menubar/Menubar.d.ts | 24 ++++++++++++++++++++- components/lib/panelmenu/PanelMenu.d.ts | 24 ++++++++++++++++++++- components/lib/steps/Steps.d.ts | 20 ++++++++++++++++- components/lib/tabmenu/TabMenu.d.ts | 20 ++++++++++++++++- components/lib/tieredmenu/TieredMenu.d.ts | 24 ++++++++++++++++++++- 10 files changed, 206 insertions(+), 10 deletions(-) diff --git a/components/lib/breadcrumb/Breadcrumb.d.ts b/components/lib/breadcrumb/Breadcrumb.d.ts index ea6db8c49..5642ae50a 100755 --- a/components/lib/breadcrumb/Breadcrumb.d.ts +++ b/components/lib/breadcrumb/Breadcrumb.d.ts @@ -88,6 +88,24 @@ export interface BreadcrumbContext { index: number; } +/** + * Defines valid router binding props in Breadcrumb component. + */ +export interface BreadcrumbRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; +} + /** * Defines valid properties in Breadcrumb component. */ @@ -145,7 +163,7 @@ export interface BreadcrumbSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: BreadcrumbRouterBindProps; }): VNode[]; /** * Custom separator template. diff --git a/components/lib/contextmenu/ContextMenu.d.ts b/components/lib/contextmenu/ContextMenu.d.ts index abc6840f6..5944a87e6 100755 --- a/components/lib/contextmenu/ContextMenu.d.ts +++ b/components/lib/contextmenu/ContextMenu.d.ts @@ -167,6 +167,28 @@ export interface ContextMenuContext { focused: boolean; } +/** + * Defines valid router binding props in ContextMenu component. + */ +export interface ContextMenuRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; + /** + * Submenuicon elemnt binding + */ + submenuicon: object; +} + /** * Defines valid properties in ContextMenu component. */ @@ -244,7 +266,7 @@ export interface ContextMenuSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: ContextMenuRouterBindProps; }): VNode[]; /** * Custom item icon template. diff --git a/components/lib/dock/Dock.d.ts b/components/lib/dock/Dock.d.ts index 9d80cb1f1..a1107727c 100644 --- a/components/lib/dock/Dock.d.ts +++ b/components/lib/dock/Dock.d.ts @@ -134,6 +134,20 @@ export interface DockTooltipOptions { [key: string]: any; } +/** + * Defines valid router binding props in Dock component. + */ +export interface DockRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; +} + /** * Defines valid properties in Dock component. */ @@ -217,7 +231,7 @@ export interface DockSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: DockRouterBindProps; }): VNode[]; /** * Custom icon content. diff --git a/components/lib/megamenu/MegaMenu.d.ts b/components/lib/megamenu/MegaMenu.d.ts index bb945707b..a801eb9bb 100755 --- a/components/lib/megamenu/MegaMenu.d.ts +++ b/components/lib/megamenu/MegaMenu.d.ts @@ -174,6 +174,28 @@ export interface MegaMenuContext { focused: boolean; } +/** + * Defines valid router binding props in MegaMenu component. + */ +export interface MegaMenuRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; + /** + * Submenuicon elemnt binding + */ + submenuicon: object; +} + /** * Defines valid properties in MegaMenu component. */ @@ -249,7 +271,7 @@ export interface MegaMenuSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: MegaMenuRouterBindProps; /** * Whether or not there is a submenu */ diff --git a/components/lib/menu/Menu.d.ts b/components/lib/menu/Menu.d.ts index b13531941..0d514b859 100755 --- a/components/lib/menu/Menu.d.ts +++ b/components/lib/menu/Menu.d.ts @@ -140,6 +140,24 @@ export interface MenuContext { focused: boolean; } +/** + * Defines valid router binding props in Menu component. + */ +export interface MenuRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; +} + /** * Defines valid properties in Menu component. */ @@ -225,7 +243,7 @@ export interface MenuSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: MenuRouterBindProps; }): VNode[]; /** * Custom item icon template. diff --git a/components/lib/menubar/Menubar.d.ts b/components/lib/menubar/Menubar.d.ts index 8e954a895..81248896e 100755 --- a/components/lib/menubar/Menubar.d.ts +++ b/components/lib/menubar/Menubar.d.ts @@ -175,6 +175,28 @@ export interface MenubarContext { level: number; } +/** + * Defines valid router binding props in Menubar component. + */ +export interface MenubarRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; + /** + * Submenuicon elemnt binding + */ + submenuicon: object; +} + /** * Defines valid properties in Menubar component. */ @@ -240,7 +262,7 @@ export interface MenubarSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: MenubarRouterBindProps; /** * State of the root */ diff --git a/components/lib/panelmenu/PanelMenu.d.ts b/components/lib/panelmenu/PanelMenu.d.ts index 69f4d8c5f..9f547ba1b 100755 --- a/components/lib/panelmenu/PanelMenu.d.ts +++ b/components/lib/panelmenu/PanelMenu.d.ts @@ -191,6 +191,28 @@ export interface PanelMenuPanelOpenEvent { */ export interface PanelMenuPanelCloseEvent extends PanelMenuPanelOpenEvent {} +/** + * Defines valid router binding props in PanelMenu component. + */ +export interface PanelMenuRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; + /** + * Submenuicon elemnt binding + */ + submenuicon: object; +} + /** * Defines valid properties in PanelMenu component. */ @@ -245,7 +267,7 @@ export interface PanelMenuSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: PanelMenuRouterBindProps; /** * Whether or not there is a submenu */ diff --git a/components/lib/steps/Steps.d.ts b/components/lib/steps/Steps.d.ts index 3b2563b6e..3e1634685 100755 --- a/components/lib/steps/Steps.d.ts +++ b/components/lib/steps/Steps.d.ts @@ -90,6 +90,24 @@ export interface StepsContext { disabled: boolean; } +/** + * Defines valid router binding props in Steps component. + */ +export interface StepsRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; +} + /** * Defines valid properties in Steps component. */ @@ -148,7 +166,7 @@ export interface StepsSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: StepsRouterBindProps; }): VNode[]; } diff --git a/components/lib/tabmenu/TabMenu.d.ts b/components/lib/tabmenu/TabMenu.d.ts index 02592b372..2c57ff05e 100755 --- a/components/lib/tabmenu/TabMenu.d.ts +++ b/components/lib/tabmenu/TabMenu.d.ts @@ -111,6 +111,24 @@ export interface TabMenuChangeEvent { index: number; } +/** + * Defines valid router binding props in TabMenu component. + */ +export interface TabMenuRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; +} + /** * Defines valid properties in TabMenu component. */ @@ -169,7 +187,7 @@ export interface TabMenuSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: TabMenuRouterBindProps; }): VNode[]; /** * Custom item icon template. diff --git a/components/lib/tieredmenu/TieredMenu.d.ts b/components/lib/tieredmenu/TieredMenu.d.ts index 2881e0a3f..92e0983b6 100755 --- a/components/lib/tieredmenu/TieredMenu.d.ts +++ b/components/lib/tieredmenu/TieredMenu.d.ts @@ -161,6 +161,28 @@ export interface TieredMenuContext { focused: boolean; } +/** + * Defines valid router binding props in TabMenu component. + */ +export interface TabMenuRouterBindProps { + /** + * Action element binding + */ + action: object; + /** + * Icon element binding + */ + icon: object; + /** + * Label element binding + */ + label: object; + /** + * Submenuicon elemnt binding + */ + submenuicon: object; +} + /** * Defines valid properties in TieredMenuMenu component. */ @@ -243,7 +265,7 @@ export interface TieredMenuSlots { /** * Binding properties of the menuitem */ - props: (...args: any) => string; + props: TabMenuRouterBindProps; /** * Whether or not there is a submenu */