Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualScroller/Ripple TS updates #6472

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/lib/api/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import { ProgressBarPassThroughOptions } from '../progressbar/progressbar';
import { ProgressSpinnerPassThroughOptions } from '../progressspinner/progressspinner';
import { RadioButtonPassThroughOptions } from '../radiobutton/radiobutton';
import { RatingPassThroughOptions } from '../rating/rating';
import { RipplePassThroughOptions } from '../ripple/ripple';
import { RowPassThroughOptions } from '../row/row';
import { ScrollPanelPassThroughOptions } from '../scrollpanel/scrollpanel';
import { ScrollTopPassThroughOptions } from '../scrolltop/scrolltop';
Expand Down Expand Up @@ -546,6 +547,10 @@ export interface PrimeReactPTOptions {
* Custom passthrough(pt) options for Rating.
*/
rating?: RatingPassThroughOptions;
/**
* Custom passthrough(pt) options for Ripple.
*/
ripple?: RipplePassThroughOptions;
/**
* Custom passthrough(pt) options for Row.
*/
Expand Down
32 changes: 32 additions & 0 deletions components/lib/ripple/ripple.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@
*
*/
import * as React from 'react';
import { PassThroughOptions } from '../passthrough';
import { PassThroughType } from '../utils';

export declare type RipplePassThroughType<T> = PassThroughType<T, RipplePassThroughMethodOptions>;

/**
* Custom passthrough(pt) option method.
*/
export interface RipplePassThroughMethodOptions {
props: RippleProps;
}

/**
* Custom passthrough(pt) options.
* @see {@link RippleProps.pt}
*/
export interface RipplePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
*/
root?: RipplePassThroughType<React.HTMLAttributes<HTMLDivElement>>;
}

/**
* Defines valid properties in Ripple component.
Expand All @@ -24,6 +46,16 @@ export interface RippleProps {
* @defaultValue false
*/
unstyled?: boolean;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {RipplePassThroughOptions}
*/
pt?: RipplePassThroughOptions;
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions components/lib/virtualscroller/virtualscroller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,17 @@ export declare class VirtualScroller extends React.Component<VirtualScrollerProp
public scrollTo(options: VirtualScrollerOptionsType): void;
/**
* Scroll to move to a specific item.
* @param {number} index - Index of item according to orientation mode.
* @param {number | number[]} index - Index of item according to orientation mode.
* @param {'auto' | 'smooth'} behavior - Behavior of scroll, valid values are 'auto' and 'smooth'
*/
public scrollToIndex(index: number | number[], behavior?: 'auto' | 'smooth'): void;
/**
* It is used to move the specified index into the view. It is a method that will usually be needed when keyboard support is added to the virtualScroller component.
* @param {number} index - Index of item according to orientation mode.
* @param {number | number[]} index - Index of item according to orientation mode.
* @param {'to-start' | 'to-end'} to - Defines the location of the item in view, valid values are 'to-start' and 'to-end'.
* @param {'auto' | 'smooth'} behavior - Behavior of scroll, valid values are 'auto' and 'smooth'
*/
public scrollInView(index: number | number[], to: 'to-start' | 'to-end', behavior?: 'auto' | 'smooth'): void;
public scrollInView(index: number | number[], to?: 'to-start' | 'to-end', behavior?: 'auto' | 'smooth'): void;
/**
* Returns the range of items added to the DOM.
*/
Expand Down
Loading