From 6a74a6be89899aa400e667557049c02f6aae975e Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 31 Oct 2023 16:38:09 +0300 Subject: [PATCH] Fixed #4729 - SplitButton: new buttoncontent and item slots --- components/lib/splitbutton/SplitButton.d.ts | 30 +++++++++++++++++++-- components/lib/splitbutton/SplitButton.vue | 6 +++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/components/lib/splitbutton/SplitButton.d.ts b/components/lib/splitbutton/SplitButton.d.ts index d6fb2348ff..8938fc4061 100755 --- a/components/lib/splitbutton/SplitButton.d.ts +++ b/components/lib/splitbutton/SplitButton.d.ts @@ -12,7 +12,7 @@ import { ComponentHooks } from '../basecomponent'; import { ButtonPassThroughOptions } from '../button'; import { MenuItem } from '../menuitem'; import { PassThroughOptions } from '../passthrough'; -import { TieredMenuPassThroughOptions } from '../tieredmenu'; +import { TieredMenuPassThroughOptions, TieredMenuRouterBindProps } from '../tieredmenu'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; export declare type SplitButtonPassThroughOptionType = SplitButtonPassThroughAttributes | ((options: SplitButtonPassThroughMethodOptions) => SplitButtonPassThroughAttributes | string) | string | null | undefined; @@ -205,7 +205,11 @@ export interface SplitButtonSlots { */ default(): VNode[]; /** - * Custom menu button icon template. + * Command button part of the content can easily be customized with the button content slot. + */ + buttoncontent(): VNode[]; + /** + * Custom button icon template. * @param {Object} scope - icon slot's params. */ icon(scope: { @@ -238,6 +242,28 @@ export interface SplitButtonSlots { */ class: any; }): VNode[]; + /** + * Custom content for each menu item. + * @param {Object} scope - item slot's params. + */ + item(scope: { + /** + * Menuitem instance + */ + item: MenuItem; + /** + * Label property of the menuitem + */ + label: string | ((...args: any) => string) | undefined; + /** + * Binding properties of the menuitem + */ + props: TieredMenuRouterBindProps; + /** + * Whether or not there is a submenu + */ + hasSubmenu: boolean; + }): VNode[]; } /** diff --git a/components/lib/splitbutton/SplitButton.vue b/components/lib/splitbutton/SplitButton.vue index 53094d3522..61fea74607 100755 --- a/components/lib/splitbutton/SplitButton.vue +++ b/components/lib/splitbutton/SplitButton.vue @@ -22,6 +22,9 @@ + +