2023-03-01 10:19:16 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Sidebar is a panel component displayed as an overlay at the edges of the screen.
|
|
|
|
*
|
2023-03-03 14:17:03 +00:00
|
|
|
* [Live Demo](https://primevue.org/sidebar)
|
2023-03-01 10:19:16 +00:00
|
|
|
*
|
|
|
|
* @module sidebar
|
|
|
|
*
|
|
|
|
*/
|
2023-08-02 14:07:22 +00:00
|
|
|
import { TransitionProps, VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2023-09-05 11:28:04 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type SidebarPassThroughOptionType = SidebarPassThroughAttributes | ((options: SidebarPassThroughMethodOptions) => SidebarPassThroughAttributes | string) | string | null | undefined;
|
2023-04-24 11:44:52 +00:00
|
|
|
|
2023-08-02 14:07:22 +00:00
|
|
|
export declare type SidebarPassThroughTransitionType = TransitionProps | ((options: SidebarPassThroughMethodOptions) => TransitionProps) | undefined;
|
|
|
|
|
2023-04-24 11:44:52 +00:00
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface SidebarPassThroughMethodOptions {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-04-24 11:44:52 +00:00
|
|
|
props: SidebarProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
2023-04-24 11:44:52 +00:00
|
|
|
state: SidebarState;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-04-24 11:44:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link SidebarProps.pt}
|
|
|
|
*/
|
|
|
|
export interface SidebarPassThroughOptions {
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-04-24 11:44:52 +00:00
|
|
|
*/
|
|
|
|
root?: SidebarPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the header's DOM element.
|
2023-04-24 11:44:52 +00:00
|
|
|
*/
|
|
|
|
header?: SidebarPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the header content's DOM element.
|
2023-04-24 11:44:52 +00:00
|
|
|
*/
|
2023-11-20 07:41:12 +00:00
|
|
|
title?: SidebarPassThroughOptionType;
|
2023-04-24 11:44:52 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the close button's DOM element.
|
2023-04-24 11:44:52 +00:00
|
|
|
*/
|
|
|
|
closeButton?: SidebarPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the close icon's DOM element.
|
2023-04-24 11:44:52 +00:00
|
|
|
*/
|
|
|
|
closeIcon?: SidebarPassThroughOptionType;
|
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the content's DOM element.
|
2023-04-24 11:44:52 +00:00
|
|
|
*/
|
|
|
|
content?: SidebarPassThroughOptionType;
|
2023-04-26 13:41:27 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the mask's DOM element.
|
2023-04-26 13:41:27 +00:00
|
|
|
*/
|
|
|
|
mask?: SidebarPassThroughOptionType;
|
2023-07-06 11:09:01 +00:00
|
|
|
/**
|
2023-11-07 06:16:39 +00:00
|
|
|
* Used to manage all lifecycle hooks.
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
|
|
*/
|
|
|
|
hooks?: ComponentHooks;
|
2023-08-02 12:02:43 +00:00
|
|
|
/**
|
|
|
|
* Used to control Vue Transition API.
|
|
|
|
*/
|
2023-08-02 14:07:22 +00:00
|
|
|
transition?: SidebarPassThroughTransitionType;
|
2023-04-24 11:44:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface SidebarPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines current inline state in Sidebar component.
|
|
|
|
*/
|
|
|
|
export interface SidebarState {
|
|
|
|
/**
|
|
|
|
* Current container visible state as a boolean.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
containerVisible: boolean;
|
|
|
|
}
|
|
|
|
|
2023-03-01 10:19:16 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Sidebar component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface SidebarProps {
|
|
|
|
/**
|
|
|
|
* Specifies the visibility of the dialog.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
visible?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Specifies the position of the sidebar.
|
2023-03-08 10:51:52 +00:00
|
|
|
* @defaultValue left
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 10:19:16 +00:00
|
|
|
position?: 'left' | 'right' | 'top' | 'bottom' | 'full' | undefined;
|
2023-11-20 07:41:12 +00:00
|
|
|
/**
|
|
|
|
* Title content of the dialog.
|
|
|
|
*/
|
|
|
|
header?: string | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Base zIndex value to use in layering.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue 0
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
baseZIndex?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to automatically manage layering.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
autoZIndex?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Whether clicking outside closes the panel.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
dismissable?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Whether to display a close icon inside the panel.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
showCloseIcon?: boolean | undefined;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Icon to display in the sidebar close button.
|
2023-04-18 10:51:10 +00:00
|
|
|
* @deprecated since v3.27.0. Use 'closeicon' slot.
|
2022-12-08 11:04:25 +00:00
|
|
|
*/
|
|
|
|
closeIcon?: string | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Whether to a modal layer behind the sidebar.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
modal?: boolean | undefined;
|
2023-01-04 10:12:04 +00:00
|
|
|
/**
|
|
|
|
* Whether background scroll should be blocked when sidebar is visible.
|
2023-03-01 10:19:16 +00:00
|
|
|
* @defaultValue false
|
2023-01-04 10:12:04 +00:00
|
|
|
*/
|
|
|
|
blockScroll?: boolean | undefined;
|
2023-04-24 11:44:52 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-04-24 11:44:52 +00:00
|
|
|
* @type {SidebarPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<SidebarPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-05-29 20:37:34 +00:00
|
|
|
/**
|
|
|
|
* When enabled, it removes component related styles in the core.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
unstyled?: boolean;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 10:19:16 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Sidebar component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface SidebarSlots {
|
|
|
|
/**
|
|
|
|
* Custom content template.
|
|
|
|
*/
|
2023-03-01 10:19:16 +00:00
|
|
|
default(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Custom header template.
|
2023-11-20 07:41:12 +00:00
|
|
|
* @param {Object} scope - header slot's params.
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-11-20 07:41:12 +00:00
|
|
|
header(scope: {
|
|
|
|
/**
|
|
|
|
* Style class of the header title
|
|
|
|
*/
|
|
|
|
class: any;
|
|
|
|
}): VNode[];
|
2023-04-07 20:36:13 +00:00
|
|
|
/**
|
|
|
|
* Custom close icon template.
|
2023-08-23 06:30:08 +00:00
|
|
|
* @param {Object} scope - close icon slot's params.
|
|
|
|
*/
|
|
|
|
closeicon(scope: {
|
|
|
|
/**
|
|
|
|
* Style class of the close icon
|
|
|
|
*/
|
|
|
|
class: any;
|
|
|
|
}): VNode[];
|
2023-09-19 10:23:58 +00:00
|
|
|
/**
|
|
|
|
* Custom container slot.
|
|
|
|
* @param {Object} scope - container slot's params.
|
|
|
|
*/
|
|
|
|
container(scope: {
|
|
|
|
/**
|
|
|
|
* Close sidebar function.
|
2023-10-31 12:52:10 +00:00
|
|
|
* @deprecated since v3.39.0. Use 'closeCallback' property instead.
|
2023-09-19 10:23:58 +00:00
|
|
|
*/
|
|
|
|
onClose: () => void;
|
2023-10-31 12:52:10 +00:00
|
|
|
/**
|
|
|
|
* Close sidebar function.
|
|
|
|
*/
|
|
|
|
closeCallback: () => void;
|
2023-09-19 10:23:58 +00:00
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 10:19:16 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Sidebar component.
|
|
|
|
*/
|
|
|
|
export interface SidebarEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the value changes.
|
|
|
|
* @param {boolean} value - New value.
|
|
|
|
*/
|
2023-03-01 10:19:16 +00:00
|
|
|
'update:modelValue'(value: boolean): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when sidebar gets shown.
|
|
|
|
*/
|
2023-03-01 10:19:16 +00:00
|
|
|
show(): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when sidebar gets hidden.
|
|
|
|
*/
|
2023-03-01 10:19:16 +00:00
|
|
|
hide(): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 10:19:16 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Sidebar**
|
|
|
|
*
|
|
|
|
* _Sidebar is a panel component displayed as an overlay._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/sidebar/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*/
|
2023-03-01 14:48:23 +00:00
|
|
|
declare class Sidebar extends ClassComponent<SidebarProps, SidebarSlots, SidebarEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Sidebar: GlobalComponentConstructor<Sidebar>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Sidebar;
|