133 lines
3.3 KiB
TypeScript
133 lines
3.3 KiB
TypeScript
/**
|
|
*
|
|
* ScrollTop gets displayed after a certain scroll position and used to navigates to the top of the page quickly.
|
|
*
|
|
* [Live Demo](https://www.primevue.org/scrolltop/)
|
|
*
|
|
* @module scrolltop
|
|
*
|
|
*/
|
|
import { VNode } from 'vue';
|
|
import { ComponentHooks } from '../basecomponent/BaseComponent';
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
export declare type ScrollTopPassThroughOptionType = ScrollTopPassThroughAttributes | ((options: ScrollTopPassThroughMethodOptions) => ScrollTopPassThroughAttributes) | null | undefined;
|
|
|
|
/**
|
|
* Custom passthrough(pt) option method.
|
|
*/
|
|
export interface ScrollTopPassThroughMethodOptions {
|
|
props: ScrollTopProps;
|
|
state: ScrollTopState;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough(pt) options.
|
|
* @see {@link ScrollTopProps.pt}
|
|
*/
|
|
export interface ScrollTopPassThroughOptions {
|
|
/**
|
|
* Uses to pass attributes to the root's DOM element.
|
|
*/
|
|
root?: ScrollTopPassThroughOptionType;
|
|
/**
|
|
* Uses to pass attributes to the icon's DOM element.
|
|
*/
|
|
icon?: ScrollTopPassThroughOptionType;
|
|
/**
|
|
* Uses to manage all lifecycle hooks
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
*/
|
|
hooks?: ComponentHooks;
|
|
}
|
|
|
|
/**
|
|
* Custom passthrough attributes for each DOM elements
|
|
*/
|
|
export interface ScrollTopPassThroughAttributes {
|
|
[key: string]: any;
|
|
}
|
|
|
|
/**
|
|
* Defines current inline state in ScrollTop component.
|
|
*/
|
|
export interface ScrollTopState {
|
|
/**
|
|
* Current visible state as a boolean.
|
|
* @defaultValue false
|
|
*/
|
|
visible: boolean;
|
|
}
|
|
|
|
/**
|
|
* Defines valid properties in ScrollTop component.
|
|
*/
|
|
export interface ScrollTopProps {
|
|
/**
|
|
* Target of the ScrollTop.
|
|
* @defaultValue window
|
|
*/
|
|
target?: 'window' | 'parent' | undefined;
|
|
/**
|
|
* Defines the threshold value of the vertical scroll position of the target to toggle the visibility.
|
|
* @defaultValue 400
|
|
*/
|
|
threshold?: number | undefined;
|
|
/**
|
|
* Icon to display.
|
|
* @deprecated since v3.27.0. Use 'icon' slot.
|
|
*/
|
|
icon?: string | undefined;
|
|
/**
|
|
* Defines the scrolling behaviour, 'smooth' adds an animation and 'auto' scrolls with a jump.
|
|
* @defaultValue smooth
|
|
*/
|
|
behavior?: string | undefined;
|
|
/**
|
|
* Uses to pass attributes to DOM elements inside the component.
|
|
* @type {ScrollTopPassThroughOptions}
|
|
*/
|
|
pt?: ScrollTopPassThroughOptions;
|
|
/**
|
|
* When enabled, it removes component related styles in the core.
|
|
* @defaultValue false
|
|
*/
|
|
unstyled?: boolean;
|
|
}
|
|
|
|
/**
|
|
* Defines valid slots in ScrollTop component.
|
|
*/
|
|
export interface ScrollTopSlots {
|
|
/**
|
|
* Custom scrolltop icon template.
|
|
*/
|
|
icon(): VNode[];
|
|
}
|
|
|
|
/**
|
|
* Defines valid emits in ScrollTop component.
|
|
*/
|
|
export interface ScrollTopEmits {}
|
|
|
|
/**
|
|
* **PrimeVue - ScrollTop**
|
|
*
|
|
* _ScrollTop gets displayed after a certain scroll position and used to navigates to the top of the page quickly._
|
|
*
|
|
* [Live Demo](https://www.primevue.org/scrolltop/)
|
|
* --- ---
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
*
|
|
* @group Component
|
|
*/
|
|
declare class ScrollTop extends ClassComponent<ScrollTopProps, ScrollTopSlots, ScrollTopEmits> {}
|
|
|
|
declare module '@vue/runtime-core' {
|
|
interface GlobalComponents {
|
|
ScrollTop: GlobalComponentConstructor<ScrollTop>;
|
|
}
|
|
}
|
|
|
|
export default ScrollTop;
|