SpeedDial d.ts updated

pull/3689/head
mertsincan 2023-03-01 12:06:30 +00:00
parent bf79bd05b9
commit c2376c9639
1 changed files with 63 additions and 50 deletions

View File

@ -1,33 +1,39 @@
/**
*
* When pressed, a floating action button can display multiple primary actions that can be performed on a page.
*
* [Live Demo](https://www.primevue.org/speeddial/)
*
* @module speeddial
*
*/
import { VNode } from 'vue'; import { VNode } from 'vue';
import { MenuItem } from '../menuitem'; import { MenuItem } from '../menuitem';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type SpeedDialDirectionType = 'up' | 'down' | 'left' | 'right' | 'up-left' | 'up-right' | 'down-left' | 'down-right' | undefined; /**
* Defines tooltip options.
type SpeedDialType = 'linear' | 'circle' | 'semi-circle' | 'quarter-circle' | undefined; * @see {@link SpeedDialProps.tooltipOptions}
*/
type SpeedDialTooltipPositionType = 'bottom' | 'top' | 'left' | 'right' | undefined;
type SpeedDialTooltipEventType = 'hover' | 'focus' | undefined;
export interface SpeedDialTooltipOptions { export interface SpeedDialTooltipOptions {
/** /**
* Event to show the tooltip, valid values are hover and focus. * Event to show the tooltip, valid values are hover and focus.
* @see SpeedDialTooltipEventType
*/ */
event: string; event: 'hover' | 'focus' | undefined;
/** /**
* Position of element. * Position of element.
* @see SpeedDialTooltipPositionType
* Default value is 'bottom'. * Default value is 'bottom'.
*/ */
position: string; position: 'bottom' | 'top' | 'left' | 'right' | undefined;
/** /**
* Optional options. * Optional options.
*/ */
[key: string]: string; [key: string]: any;
} }
/**
* Defines valid properties in SpeedDial component.
*/
export interface SpeedDialProps { export interface SpeedDialProps {
/** /**
* MenuModel instance to define the action items. * MenuModel instance to define the action items.
@ -35,41 +41,42 @@ export interface SpeedDialProps {
model?: MenuItem[] | undefined; model?: MenuItem[] | undefined;
/** /**
* Specifies the visibility of the overlay. * Specifies the visibility of the overlay.
* @defaultValue false
*/ */
visible?: boolean | undefined; visible?: boolean | undefined;
/** /**
* Specifies the opening direction of actions. * Specifies the opening direction of actions.
* @see SpeedDialDirectionType * @defaultValue up
* Default value is 'up'.
*/ */
direction?: SpeedDialDirectionType; direction?: 'up' | 'down' | 'left' | 'right' | 'up-left' | 'up-right' | 'down-left' | 'down-right' | undefined;
/** /**
* Transition delay step for each action item. * Transition delay step for each action item.
* Default value is 30. * @defaultValue 30
*/ */
transitionDelay?: number | undefined; transitionDelay?: number | undefined;
/** /**
* Specifies the opening type of actions. * Specifies the opening type of actions.
* @see SpeedDialType * @defaultValue linear
* Default value is 'linear'.
*/ */
type?: SpeedDialType; type?: 'linear' | 'circle' | 'semi-circle' | 'quarter-circle' | undefined;
/** /**
* Radius for *circle types. * Radius for *circle types.
* Default value is 0. * @defaultValue 0
*/ */
radius?: number | undefined; radius?: number | undefined;
/** /**
* Whether to show a mask element behind the speeddial. * Whether to show a mask element behind the speeddial.
* @defaultValue false
*/ */
mask?: boolean | undefined; mask?: boolean | undefined;
/** /**
* Whether the component is disabled. * Whether the component is disabled.
* @defaultValue false
*/ */
disabled?: boolean | undefined; disabled?: boolean | undefined;
/** /**
* Whether the actions close when clicked outside. * Whether the actions close when clicked outside.
* Default value is true. * @defaultValue true
*/ */
hideOnClickOutside?: boolean | undefined; hideOnClickOutside?: boolean | undefined;
/** /**
@ -86,7 +93,7 @@ export interface SpeedDialProps {
maskClass?: string | undefined; maskClass?: string | undefined;
/** /**
* Show icon of the button element. * Show icon of the button element.
* Default value is 'pi pi-plus'. * @defaultValue pi pi-plus
*/ */
showIcon?: string | undefined; showIcon?: string | undefined;
/** /**
@ -95,7 +102,7 @@ export interface SpeedDialProps {
hideIcon?: string | undefined; hideIcon?: string | undefined;
/** /**
* Defined to rotate showIcon when hideIcon is not present. * Defined to rotate showIcon when hideIcon is not present.
* Default value is true. * @defaultValue true
*/ */
rotateAnimation?: boolean | undefined; rotateAnimation?: boolean | undefined;
/** /**
@ -108,7 +115,7 @@ export interface SpeedDialProps {
style?: any; style?: any;
/** /**
* Whether to display the tooltip on items. The modifiers of Tooltip can be used like an object in it. Valid keys are 'event' and 'position'. * Whether to display the tooltip on items. The modifiers of Tooltip can be used like an object in it. Valid keys are 'event' and 'position'.
* @see SpeedDialTooltipOptions * @type {SpeedDialTooltipOptions}
*/ */
tooltipOptions?: SpeedDialTooltipOptions; tooltipOptions?: SpeedDialTooltipOptions;
/** /**
@ -121,55 +128,74 @@ export interface SpeedDialProps {
'aria-labelledby'?: string | undefined; 'aria-labelledby'?: string | undefined;
} }
/**
* Defines valid slots in SpeedDial component.
*/
export interface SpeedDialSlots { export interface SpeedDialSlots {
/** /**
* Custom content for each item. * Custom content for each item.
* @param {Object} scope - item slot's params. * @param {Object} scope - item slot's params.
*/ */
item: (scope: { item(scope: {
/** /**
* Menuitem instance * Menuitem instance
* @type {MenuItem}
*/ */
item: MenuItem; item: MenuItem;
}) => VNode[]; }): VNode[];
/** /**
* Custom button template. * Custom button template.
* @param {Object} scope - button slot's params. * @param {Object} scope - button slot's params.
*/ */
button: (scope: { button(scope: {
/** /**
* Toggle metadata * Toggle metadata
*/ */
toggle: () => void; toggle(): void;
}) => VNode[]; }): VNode[];
} }
export declare type SpeedDialEmits = { /**
* Defines valid emits in SpeedDial component.
*/
export interface SpeedDialEmits {
/** /**
* Fired when the button element clicked. * Fired when the button element clicked.
* @param {Event} event - Browser event. * @param {Event} event - Browser event.
*/ */
click: (event: Event) => void; click(event: Event): void;
/** /**
* Fired when the actions are visible. * Fired when the actions are visible.
*/ */
show: () => void; show(): void;
/** /**
* Fired when the actions are hidden. * Fired when the actions are hidden.
*/ */
hide: () => void; hide(): void;
/** /**
* Callback to invoke when the component receives focus. * Callback to invoke when the component receives focus.
* @param {Event} event - Browser event. * @param {Event} event - Browser event.
*/ */
focus: (event: Event) => void; focus(event: Event): void;
/** /**
* Callback to invoke when the component loses focus. * Callback to invoke when the component loses focus.
* @param {Event} event - Browser event. * @param {Event} event - Browser event.
*/ */
blur: (event: Event) => void; blur(event: Event): void;
}; }
/**
* **PrimeVue - SpeedDial**
*
* _When pressed, a floating action button can display multiple primary actions that can be performed on a page._
*
* [Live Demo](https://www.primevue.org/speeddial/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
declare class SpeedDial extends ClassComponent<SpeedDialProps, SpeedDialSlots, SpeedDialEmits> {} declare class SpeedDial extends ClassComponent<SpeedDialProps, SpeedDialSlots, SpeedDialEmits> {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
@ -178,17 +204,4 @@ declare module '@vue/runtime-core' {
} }
} }
/**
*
* When pressed, a floating action button can display multiple primary actions that can be performed on a page.
*
* Helper API:
*
* - [MenuItem](https://www.primefaces.org/primevue/menumodel)
*
* Demos:
*
* - [SpeedDial](https://www.primefaces.org/primevue/speeddial)
*
*/
export default SpeedDial; export default SpeedDial;