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

[core] feat: add SliderBaseProps replacement for I-prefixed interface #6189

Merged
merged 1 commit into from
May 30, 2023
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
8 changes: 6 additions & 2 deletions packages/core/src/components/slider/multiSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import { argMin, fillValues, formatPercentage } from "./sliderUtils";
const MultiSliderHandle: React.FC<HandleProps> = () => null;
MultiSliderHandle.displayName = `${DISPLAYNAME_PREFIX}.MultiSliderHandle`;

// eslint-disable-next-line deprecation/deprecation
export type SliderBaseProps = ISliderBaseProps;

/** @deprecated use SliderBaseProps */
export interface ISliderBaseProps extends Props, IntentProps {
children?: React.ReactNode;

Expand Down Expand Up @@ -116,7 +120,7 @@ export interface ISliderBaseProps extends Props, IntentProps {
// eslint-disable-next-line deprecation/deprecation
export type MultiSliderProps = IMultiSliderProps;
/** @deprecated use MultiSliderProps */
export interface IMultiSliderProps extends ISliderBaseProps {
export interface IMultiSliderProps extends SliderBaseProps {
/** Default intent of a track segment, used only if no handle specifies `intentBefore/After`. */
defaultTrackIntent?: Intent;

Expand All @@ -141,7 +145,7 @@ export interface ISliderState {
* @see https://blueprintjs.com/docs/#core/components/sliders.multi-slider
*/
export class MultiSlider extends AbstractPureComponent2<MultiSliderProps, ISliderState> {
public static defaultSliderProps: ISliderBaseProps = {
public static defaultSliderProps: SliderBaseProps = {
disabled: false,
max: 10,
min: 0,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/components/slider/rangeSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AbstractPureComponent2, Intent } from "../../common";
import * as Errors from "../../common/errors";
import { DISPLAYNAME_PREFIX } from "../../common/props";
import { HandleHtmlProps } from "./handleProps";
import { ISliderBaseProps, MultiSlider } from "./multiSlider";
import { MultiSlider, SliderBaseProps } from "./multiSlider";

export type NumberRange = [number, number];

Expand All @@ -32,7 +32,7 @@ enum RangeIndex {
// eslint-disable-next-line deprecation/deprecation
export type RangeSliderProps = IRangeSliderProps;
/** @deprecated use RangeSliderProps */
export interface IRangeSliderProps extends ISliderBaseProps {
export interface IRangeSliderProps extends SliderBaseProps {
/**
* Range value of slider. Handles will be rendered at each position in the range.
*
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/components/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import * as React from "react";
import { AbstractPureComponent2, Intent } from "../../common";
import { DISPLAYNAME_PREFIX } from "../../common/props";
import { HandleHtmlProps } from "./handleProps";
import { ISliderBaseProps, MultiSlider } from "./multiSlider";
import { MultiSlider, SliderBaseProps } from "./multiSlider";

// eslint-disable-next-line deprecation/deprecation
export type SliderProps = ISliderProps;
/** @deprecated use SliderProps */
export interface ISliderProps extends ISliderBaseProps {
export interface ISliderProps extends SliderBaseProps {
/**
* Initial value of the slider. This determines the other end of the
* track fill: from `initialValue` to `value`.
Expand Down