primevue-mirror/components/lib/scrollpanel/ScrollPanel.d.ts

166 lines
4.1 KiB
TypeScript
Raw Normal View History

2023-02-28 17:39:29 +00:00
/**
*
* ScrollPanel is a cross browser, lightweight and themable alternative to native browser scrollbar.
*
* [Live Demo](https://www.primevue.org/scrollpanel/)
*
* @module scrollpanel
*
*/
2022-09-06 12:03:37 +00:00
import { 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';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
export declare type ScrollPanelPassThroughOptionType = ScrollPanelPassThroughAttributes | ((options: ScrollPanelPassThroughMethodOptions) => ScrollPanelPassThroughAttributes | string) | string | null | undefined;
2023-03-27 06:27:52 +00:00
/**
* Custom passthrough(pt) option method.
*/
export interface ScrollPanelPassThroughMethodOptions {
/**
* Defines instance.
*/
2023-07-06 12:01:33 +00:00
instance: any;
/**
* Defines valid properties.
*/
2023-03-27 06:27:52 +00:00
props: ScrollPanelProps;
/**
* Defines current inline state.
*/
2023-03-27 06:27:52 +00:00
state: ScrollPanelState;
/**
* Defines parent options.
*/
parent: any;
2023-09-05 08:50:46 +00:00
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
2023-03-27 06:27:52 +00:00
}
/**
* Custom passthrough(pt) options.
* @see {@link ScrollPanelProps.pt}
*/
export interface ScrollPanelPassThroughOptions {
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the root's DOM element.
2023-03-27 06:27:52 +00:00
*/
root?: ScrollPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the wrapper's DOM element.
2023-03-27 06:27:52 +00:00
*/
wrapper?: ScrollPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the content's DOM element.
2023-03-27 06:27:52 +00:00
*/
content?: ScrollPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the horizontal panel's DOM element.
2023-03-27 06:27:52 +00:00
*/
2023-04-19 08:00:52 +00:00
barX?: ScrollPanelPassThroughOptionType;
2023-03-27 06:27:52 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the vertical panel's DOM element.
2023-03-27 06:27:52 +00:00
*/
2023-04-19 08:00:52 +00:00
barY?: ScrollPanelPassThroughOptionType;
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-03-27 06:27:52 +00:00
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface ScrollPanelPassThroughAttributes {
[key: string]: any;
}
/**
* Defines current inline state in Panel component.
*/
export interface ScrollPanelState {
/**
* Current id state as a string.
*/
id: string;
/**
* Current scrollpanel orientation.
* @defaultValue vertical
*/
orientation: string;
/**
* Latest scroll top position.
* @defaultValue 0
*/
lastScrollTop: number;
/**
* Latest scroll left position.
* @defaultValue 0
*/
lastScrollLeft: number;
}
2023-02-28 17:39:29 +00:00
/**
* Defines valid properties in ScrollPanel component.
*/
2022-09-06 12:03:37 +00:00
export interface ScrollPanelProps {
2022-09-14 11:26:01 +00:00
/**
* Step factor to scroll the content while pressing the arrow keys.
2023-02-28 17:39:29 +00:00
* @defaultValue 5
2022-09-14 11:26:01 +00:00
*/
step?: number | undefined;
2023-03-27 06:27:52 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-03-27 06:27:52 +00:00
* @type {ScrollPanelPassThroughOptions}
*/
pt?: PassThrough<ScrollPanelPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2023-05-24 14:08:05 +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-02-28 17:39:29 +00:00
/**
* Defines valid slots in Accordion slots.
*/
2022-09-06 12:03:37 +00:00
export interface ScrollPanelSlots {
/**
* Custom content slot.
*/
default: () => VNode[];
}
2023-02-28 17:39:29 +00:00
export interface ScrollPanelEmits {}
2022-09-06 12:03:37 +00:00
2023-02-28 17:39:29 +00:00
/**
* **PrimeVue - ScrollPanel**
*
* _ScrollPanel is a cross browser, lightweight and themable alternative to native browser scrollbar.._
*
* [Live Demo](https://www.primevue.org/scrollpanel/)
* --- ---
2023-03-03 10:55:20 +00:00
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
2023-02-28 17:39:29 +00:00
*
* @group Component
*
*/
2023-03-01 12:30:54 +00:00
declare class ScrollPanel extends ClassComponent<ScrollPanelProps, ScrollPanelSlots, ScrollPanelEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
ScrollPanel: GlobalComponentConstructor<ScrollPanel>;
2022-09-06 12:03:37 +00:00
}
}
export default ScrollPanel;