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-08-17 23:51:01 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +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 {
|
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-03-27 06:27:52 +00:00
|
|
|
props: ScrollPanelProps;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines current inline state.
|
|
|
|
*/
|
2023-03-27 06:27:52 +00:00
|
|
|
state: ScrollPanelState;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-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-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}
|
|
|
|
*/
|
2023-08-17 23:51:01 +00:00
|
|
|
pt?: PTOptions<ScrollPanelPassThroughOptions>;
|
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;
|