2022-12-08 11:04:25 +00:00
|
|
|
import { ButtonHTMLAttributes, VNode } from 'vue';
|
2022-09-06 12:03:37 +00:00
|
|
|
import { MenuItem } from '../menuitem';
|
2022-12-08 11:04:25 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
type SplitButtonAppendToType = 'body' | 'self' | string | undefined | HTMLElement;
|
|
|
|
|
|
|
|
export interface SplitButtonProps {
|
|
|
|
/**
|
|
|
|
* Text of the button.
|
|
|
|
*/
|
|
|
|
label?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Name of the icon.
|
|
|
|
*/
|
|
|
|
icon?: string | undefined;
|
|
|
|
/**
|
|
|
|
* MenuModel instance to define the overlay items.
|
|
|
|
*/
|
|
|
|
model?: MenuItem[] | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to automatically manage layering.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
autoZIndex?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Base zIndex value to use in layering.
|
|
|
|
* Default value is 0.
|
|
|
|
*/
|
|
|
|
baseZIndex?: number | undefined;
|
|
|
|
/**
|
|
|
|
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
|
|
|
|
* @see SplitButtonAppendToType
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
appendTo?: SplitButtonAppendToType;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* When present, it specifies that the element should be disabled.
|
|
|
|
*/
|
|
|
|
disabled?: boolean | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Style class of the component.
|
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
class?: any | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Inline style of the component.
|
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
style?: any | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the default button.
|
|
|
|
*/
|
|
|
|
buttonProps?: ButtonHTMLAttributes | undefined;
|
|
|
|
/**
|
|
|
|
* Uses to pass all properties of the HTMLButtonElement to the menu button.
|
|
|
|
*/
|
|
|
|
menuButtonProps?: ButtonHTMLAttributes | undefined;
|
2023-01-02 08:40:36 +00:00
|
|
|
/**
|
|
|
|
* Name of the menu button icon.
|
|
|
|
*/
|
|
|
|
menuButtonIcon?: string | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SplitButtonSlots {
|
|
|
|
/**
|
|
|
|
* Button part of the content can easily be customized with the default slot instead of using the built-in modes.
|
|
|
|
*/
|
|
|
|
default: () => VNode[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare type SplitButtonEmits = {
|
|
|
|
/**
|
|
|
|
* Callback to invoke when main button is clicked.
|
|
|
|
* @param {Event} event - Browser event.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
click: (event: Event) => void;
|
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class SplitButton extends ClassComponent<SplitButtonProps, SplitButtonSlots, SplitButtonEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
SplitButton: GlobalComponentConstructor<SplitButton>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* SplitButton groups a set of commands in an overlay with a default command.
|
|
|
|
*
|
|
|
|
* Helper API:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [MenuItem](https://www.primefaces.org/primevue/menumodel)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [SplitButton](https://www.primefaces.org/primevue/splitbutton)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default SplitButton;
|