mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Refactor #3879 - For ScrollTop
This commit is contained in:
parent
1af654c740
commit
9dd6301979
3 changed files with 59 additions and 2 deletions
48
components/lib/scrolltop/ScrollTop.d.ts
vendored
48
components/lib/scrolltop/ScrollTop.d.ts
vendored
|
@ -10,6 +10,49 @@
|
|||
import { VNode } from 'vue';
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -34,6 +77,11 @@ export interface ScrollTopProps {
|
|||
* @defaultValue smooth
|
||||
*/
|
||||
behavior?: string | undefined;
|
||||
/**
|
||||
* Uses to pass attributes to DOM elements inside the component.
|
||||
* @type {ScrollTopPassThroughOptions}
|
||||
*/
|
||||
pt?: ScrollTopPassThroughOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue