primevue-mirror/components/dock/Dock.d.ts

136 lines
3.2 KiB
TypeScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
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 DockPositionType = 'bottom' | 'top' | 'left' | 'right' | undefined;
type DockTooltipEventType = 'hover' | 'focus' | undefined;
export interface DockTooltipOptions {
/**
* Event to show the tooltip, valid values are hover and focus.
* @see DockTooltipEventType
*/
event: string;
/**
* Position of element.
* @see DockPositionType
* Default value is 'bottom'.
*/
position: string;
/**
* Optional options.
*/
[key: string]: string;
}
export interface DockProps {
/**
* MenuModel instance to define the action items.
*/
model?: MenuItem[] | undefined;
/**
* Position of element.
* @see DockPositionType
* Default value is 'bottom'.
*/
position?: DockPositionType;
/**
* Style class of the element.
*/
class?: any;
/**
* Inline style of the element.
*/
style?: any;
/**
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
* Default value is true.
*/
exact?: boolean | undefined;
/**
* 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 DockTooltipOptions
*/
tooltipOptions?: DockTooltipOptions;
2022-12-08 11:04:25 +00:00
/**
* Unique identifier of the menu.
*/
menuId?: string | undefined;
/**
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
2022-09-06 12:03:37 +00:00
}
export interface DockSlots {
/**
* Custom item content.
* @param {Object} scope - item slot's params.
*/
item: (scope: {
/**
* Custom content for item.
*/
item: MenuItem;
2022-12-08 11:04:25 +00:00
/**
* Index of the menuitem
*/
index: number;
2022-09-06 12:03:37 +00:00
}) => VNode[];
/**
* Custom icon content.
* @param {Object} scope - icon slot's params.
*/
icon: (scope: {
/**
* Custom content for icon.
*/
item: MenuItem;
}) => VNode[];
}
2022-12-08 11:04:25 +00:00
export declare type DockEmits = {
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
*/
focus: (event: Event) => void;
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
*/
blur: (event: Event) => void;
};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class Dock extends ClassComponent<DockProps, DockSlots, DockEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Dock: GlobalComponentConstructor<Dock>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* Dock is a navigation component consisting of menuitems.
*
* 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
* - [Dock](https://www.primefaces.org/primevue/dock)
2022-09-06 12:03:37 +00:00
*
*/
export default Dock;