From 4c8eb6cab2bfd53ba0279ba2ee41edcc41cb3308 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 30 Apr 2024 11:02:09 +0300 Subject: [PATCH] Refactor #5592, #5661, #5662 - For SplitButton --- components/lib/splitbutton/BaseSplitButton.vue | 4 ++++ components/lib/splitbutton/SplitButton.d.ts | 17 ++++++++++++++++- components/lib/splitbutton/SplitButton.vue | 14 +++++++++----- .../lib/splitbutton/style/SplitButtonStyle.js | 2 +- doc/splitbutton/IconsDoc.vue | 12 +++++++++++- 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/components/lib/splitbutton/BaseSplitButton.vue b/components/lib/splitbutton/BaseSplitButton.vue index 9efb25acc3..0b5de70ab9 100644 --- a/components/lib/splitbutton/BaseSplitButton.vue +++ b/components/lib/splitbutton/BaseSplitButton.vue @@ -54,6 +54,10 @@ export default { type: String, default: undefined }, + dropdownIcon: { + type: String, + default: undefined + }, severity: { type: String, default: null diff --git a/components/lib/splitbutton/SplitButton.d.ts b/components/lib/splitbutton/SplitButton.d.ts index 450871fa4c..e4adc2babe 100755 --- a/components/lib/splitbutton/SplitButton.d.ts +++ b/components/lib/splitbutton/SplitButton.d.ts @@ -78,7 +78,7 @@ export interface SplitButtonPassThroughOptions { * Used to pass attributes to the Button component. * @see {@link ButtonPassThroughOptions} */ - menuButton?: ButtonPassThroughOptions; + dropdown?: ButtonPassThroughOptions; /** * Used to pass attributes to the TieredMenu component. * @see {@link TieredMenuPassThroughOptions} @@ -168,6 +168,10 @@ export interface SplitButtonProps { * @deprecated since v3.27.0. Use 'menubuttonicon' slot. */ menuButtonIcon?: string | undefined; + /** + * Name of the menu button icon. + */ + dropdownIcon?: string | undefined; /** * Defines the style of the button. */ @@ -245,6 +249,7 @@ export interface SplitButtonSlots { class: string; }): VNode[]; /** + * @deprecated since v4.0. Use dropdownicon slot instead. * Custom menu button icon template. * @param {Object} scope - menubuttonicon slot's params. */ @@ -254,6 +259,16 @@ export interface SplitButtonSlots { */ class: string; }): VNode[]; + /** + * Custom menu button icon template. + * @param {Object} scope - menubuttonicon slot's params. + */ + dropdownicon(scope: { + /** + * Style class of the icon. + */ + class: string; + }): VNode[]; /** * Custom menu item icon template. * @param {Object} scope - menuitemicon slot's params. diff --git a/components/lib/splitbutton/SplitButton.vue b/components/lib/splitbutton/SplitButton.vue index 1efd3c1163..f6e0b8c5e2 100755 --- a/components/lib/splitbutton/SplitButton.vue +++ b/components/lib/splitbutton/SplitButton.vue @@ -27,7 +27,7 @@ diff --git a/components/lib/splitbutton/style/SplitButtonStyle.js b/components/lib/splitbutton/style/SplitButtonStyle.js index a4728e9389..5474140bcf 100644 --- a/components/lib/splitbutton/style/SplitButtonStyle.js +++ b/components/lib/splitbutton/style/SplitButtonStyle.js @@ -3,7 +3,7 @@ import BaseStyle from 'primevue/base/style'; const classes = { root: 'p-splitbutton p-component', button: 'p-splitbutton-button', - menuButton: 'p-splitbutton-dropdown' + dropdown: 'p-splitbutton-dropdown' }; export default BaseStyle.extend({ diff --git a/doc/splitbutton/IconsDoc.vue b/doc/splitbutton/IconsDoc.vue index d6bc5707ef..804f0453f6 100644 --- a/doc/splitbutton/IconsDoc.vue +++ b/doc/splitbutton/IconsDoc.vue @@ -3,7 +3,17 @@

The buttons and menuitems have support to display icons.

- + + + + + + +