Skip to content

Feat/slider thumbHitSlop prop #1729

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

Merged
merged 4 commits into from
Dec 26, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 7 additions & 0 deletions generatedTypes/src/components/slider/GradientSlider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ declare const _default: React.ComponentClass<{
containerStyle?: StyleProp<ViewStyle>;
trackStyle?: StyleProp<ViewStyle>;
thumbStyle?: ViewStyle | undefined;
thumbHitSlop?: import("react-native").Insets | undefined;
activeThumbStyle?: ViewStyle | undefined;
disableActiveStyling?: boolean | undefined;
disabled?: boolean | undefined;
Expand All @@ -118,6 +119,12 @@ declare const _default: React.ComponentClass<{
minimumValue: number;
maximumValue: number;
step: number;
thumbHitSlop: {
top: number;
bottom: number;
left: number;
right: number;
};
} & {
/**
* The gradient color
Expand Down
96 changes: 53 additions & 43 deletions generatedTypes/src/components/slider/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,78 +1,82 @@
import { PureComponent, ReactElement, ElementRef } from 'react';
import { Animated, StyleProp, ViewStyle, PanResponderGestureState, GestureResponderEvent, LayoutChangeEvent, AccessibilityActionEvent, AccessibilityRole, View as RNView } from 'react-native';
import { Animated, StyleProp, ViewStyle, PanResponderGestureState, GestureResponderEvent, LayoutChangeEvent, AccessibilityActionEvent, AccessibilityRole, View as RNView, ViewProps } from 'react-native';
export declare type SliderOnValueChange = (value: number) => void;
export declare type SliderProps = {
/**
* Initial value
*/
* Initial value
*/
value?: number;
/**
* Minimum value
*/
* Minimum value
*/
minimumValue?: number;
/**
* Maximum value
*/
* Maximum value
*/
maximumValue?: number;
/**
* Step value of the slider. The value should be between 0 and (maximumValue - minimumValue)
*/
* Step value of the slider. The value should be between 0 and (maximumValue - minimumValue)
*/
step?: number;
/**
* The color used for the track from minimum value to current value
*/
* The color used for the track from minimum value to current value
*/
minimumTrackTintColor?: string;
/**
* The track color
*/
* The track color
*/
maximumTrackTintColor?: string;
/**
* Custom render instead of rendering the track
*/
* Custom render instead of rendering the track
*/
renderTrack?: () => ReactElement | ReactElement[];
/**
* Thumb color
*/
* Thumb color
*/
thumbTintColor?: string;
/**
* Callback for onValueChange
*/
* Callback for onValueChange
*/
onValueChange?: SliderOnValueChange;
/**
* Callback that notifies about slider seeking is started
*/
* Callback that notifies about slider seeking is started
*/
onSeekStart?: () => void;
/**
* Callback that notifies about slider seeking is finished
*/
* Callback that notifies about slider seeking is finished
*/
onSeekEnd?: () => void;
/**
* The container style
*/
* The container style
*/
containerStyle?: StyleProp<ViewStyle>;
/**
* The track style
*/
* The track style
*/
trackStyle?: StyleProp<ViewStyle>;
/**
* The thumb style
*/
* The thumb style
*/
thumbStyle?: ViewStyle;
/**
* The active (during press) thumb style
*/
* Defines how far a touch event can start away from the thumb.
*/
thumbHitSlop?: ViewProps['hitSlop'];
/**
* The active (during press) thumb style
*/
activeThumbStyle?: ViewStyle;
/**
* If true the Slider will not change it's style on press
*/
* If true the Slider will not change it's style on press
*/
disableActiveStyling?: boolean;
/**
* If true the Slider will be disabled and will appear in disabled color
*/
* If true the Slider will be disabled and will appear in disabled color
*/
disabled?: boolean;
/**
* If true the component will have accessibility features enabled
*/
* If true the component will have accessibility features enabled
*/
accessible?: boolean;
/**
* The slider's test identifier
Expand All @@ -96,6 +100,12 @@ declare const defaultProps: {
minimumValue: number;
maximumValue: number;
step: number;
thumbHitSlop: {
top: number;
bottom: number;
left: number;
right: number;
};
};
/**
* @description: A Slider component
Expand All @@ -109,6 +119,12 @@ export default class Slider extends PureComponent<SliderProps, SliderState> {
minimumValue: number;
maximumValue: number;
step: number;
thumbHitSlop: {
top: number;
bottom: number;
left: number;
right: number;
};
};
private thumb;
private _thumbStyles;
Expand Down Expand Up @@ -170,12 +186,6 @@ export default class Slider extends PureComponent<SliderProps, SliderState> {
handleTrackPress: (event: GestureResponderEvent) => void;
handleMeasure: (name: MeasuredVariableName, { nativeEvent }: LayoutChangeEvent) => void;
onAccessibilityAction: (event: AccessibilityActionEvent) => void;
thumbHitSlop: {
top: number;
bottom: number;
left: number;
right: number;
};
renderThumb: () => JSX.Element;
render(): JSX.Element;
}
Expand Down
Loading