mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #32622 from nicholasmaddren/rc-slider-add-tabindex
[rc-slider] Adds tabIndex prop types
This commit is contained in:
Vendored
+24
-9
@@ -5,17 +5,18 @@
|
||||
// Austin Turner <https://github.com/paustint>
|
||||
// Jacob Froman <https://github.com/j-fro>
|
||||
// Deanna Veale <https://github.com/Deanna2>
|
||||
// Nick Maddren <https://github.com/nicholasmaddren>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
import { RCTooltip } from 'rc-tooltip';
|
||||
import { RCTooltip } from "rc-tooltip";
|
||||
|
||||
export interface Marks {
|
||||
[number: number]:
|
||||
| JSX.Element
|
||||
| string
|
||||
| { style: any; label: string | JSX.Element };
|
||||
| JSX.Element
|
||||
| string
|
||||
| { style: any; label: string | JSX.Element };
|
||||
}
|
||||
|
||||
export interface CommonApiProps {
|
||||
@@ -135,6 +136,11 @@ export interface SliderProps extends CommonApiProps {
|
||||
* Set current value of slider.
|
||||
*/
|
||||
value?: number;
|
||||
/**
|
||||
* Set the tabIndex of the slider handle.
|
||||
* @default 0
|
||||
*/
|
||||
tabIndex?: number;
|
||||
}
|
||||
|
||||
export interface RangeProps extends CommonApiProps {
|
||||
@@ -162,6 +168,11 @@ export interface RangeProps extends CommonApiProps {
|
||||
* Set current positions of handles.
|
||||
*/
|
||||
value?: number[];
|
||||
/**
|
||||
* Set the tabIndex of each handle.
|
||||
* @default [0,0]
|
||||
*/
|
||||
tabIndex?: number[];
|
||||
/**
|
||||
* Determine how many ranges to render, and multiple handles will be rendered (number + 1).
|
||||
* @default 1
|
||||
@@ -200,9 +211,13 @@ export interface WithTooltipProps {
|
||||
tipProps?: Partial<RCTooltip.Props>;
|
||||
}
|
||||
|
||||
export default class Slider extends React.Component<SliderProps> { }
|
||||
export class Range extends React.Component<RangeProps> { }
|
||||
export class Handle extends React.Component<HandleProps> { }
|
||||
export default class Slider extends React.Component<SliderProps> {}
|
||||
export class Range extends React.Component<RangeProps> {}
|
||||
export class Handle extends React.Component<HandleProps> {}
|
||||
|
||||
export function createSliderWithTooltip(slider: typeof Slider): new() => React.Component<WithTooltipProps & SliderProps>;
|
||||
export function createSliderWithTooltip(range: typeof Range): new() => React.Component<WithTooltipProps & RangeProps>;
|
||||
export function createSliderWithTooltip(
|
||||
slider: typeof Slider
|
||||
): new () => React.Component<WithTooltipProps & SliderProps>;
|
||||
export function createSliderWithTooltip(
|
||||
range: typeof Range
|
||||
): new () => React.Component<WithTooltipProps & RangeProps>;
|
||||
|
||||
Reference in New Issue
Block a user