primevue-mirror/components/lib/sidebar/Sidebar.d.ts

201 lines
4.9 KiB
TypeScript
Raw Normal View History

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
*
*/
2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
2023-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
2022-09-06 12:03:37 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type SidebarPassThroughOptionType = SidebarPassThroughAttributes | ((options: SidebarPassThroughMethodOptions) => SidebarPassThroughAttributes | string) | string | null | undefined;
2023-04-24 11:44:52 +00:00
/**
* Custom passthrough(pt) option method.
*/
export interface SidebarPassThroughMethodOptions {
2023-07-06 12:01:33 +00:00
instance: any;
2023-04-24 11:44:52 +00:00
props: SidebarProps;
state: SidebarState;
}
/**
* 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
*/
headerContent?: SidebarPassThroughOptionType;
/**
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-08-01 14:01:12 +00:00
* Used to manage all lifecycle hooks
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
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;
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.
* @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}
*/
pt?: SidebarPassThroughOptions;
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-03-01 10:19:16 +00:00
header(): VNode[];
/**
* Custom close icon template.
*/
closeicon(): 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;