2023-03-01 13:04:04 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Dock is a navigation component consisting of menuitems.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/dock/)
|
|
|
|
*
|
|
|
|
* @module dock
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
|
2023-03-01 13:04:04 +00:00
|
|
|
/**
|
|
|
|
* Defines tooltip options
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DockTooltipOptions {
|
|
|
|
/**
|
|
|
|
* Event to show the tooltip, valid values are hover and focus.
|
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
event: 'hover' | 'focus' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Position of element.
|
2023-03-03 08:18:55 +00:00
|
|
|
* @defaultValue 'bottom'
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
position: 'bottom' | 'top' | 'left' | 'right' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Optional options.
|
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
[key: string]: any;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Dock component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DockProps {
|
|
|
|
/**
|
|
|
|
* MenuModel instance to define the action items.
|
|
|
|
*/
|
|
|
|
model?: MenuItem[] | undefined;
|
|
|
|
/**
|
|
|
|
* Position of element.
|
2023-03-03 08:18:55 +00:00
|
|
|
* @defaultValue 'bottom'
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
position?: 'bottom' | 'top' | 'left' | 'right' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
2023-03-01 13:04:04 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
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'.
|
2023-03-01 13:04:04 +00:00
|
|
|
* @type {DockTooltipOptions}
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Dock component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface DockSlots {
|
|
|
|
/**
|
|
|
|
* Custom item content.
|
|
|
|
* @param {Object} scope - item slot's params.
|
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
item(scope: {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom content for item.
|
|
|
|
*/
|
|
|
|
item: MenuItem;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Index of the menuitem
|
|
|
|
*/
|
|
|
|
index: number;
|
2023-03-01 13:04:04 +00:00
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom icon content.
|
|
|
|
* @param {Object} scope - icon slot's params.
|
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
icon(scope: {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom content for icon.
|
|
|
|
*/
|
|
|
|
item: MenuItem;
|
2023-03-01 13:04:04 +00:00
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Dock component.
|
|
|
|
*/
|
|
|
|
export interface DockEmits {
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the component receives focus.
|
|
|
|
* @param {Event} event - Browser event.
|
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
focus(event: Event): void;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when the component loses focus.
|
|
|
|
* @param {Event} event - Browser event.
|
|
|
|
*/
|
2023-03-01 13:04:04 +00:00
|
|
|
blur(event: Event): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 13:04:04 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Dock**
|
|
|
|
*
|
|
|
|
* _Dock is a navigation component consisting of menuitems._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/dock/)
|
|
|
|
* --- ---
|
2023-03-03 10:55:20 +00:00
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
2023-03-01 13:04:04 +00:00
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Dock;
|