feat(core): first class a11y support (#8909)

This commit is contained in:
Morten Sjøgren
2021-01-29 20:51:51 +01:00
committed by Nathan Walker
parent ef9c3b1f5f
commit c46da3fad9
43 changed files with 2938 additions and 47 deletions

View File

@ -1,10 +1,14 @@
import { View } from '../core/view';
import { Property, CoercibleProperty } from '../core/properties';
import { EventData } from '../../data/observable';
/**
* Represents a slider component.
*/
export class Slider extends View {
static readonly accessibilityDecrementEvent = 'accessibilityDecrement';
static readonly accessibilityIncrementEvent = 'accessibilityIncrement';
/**
* Gets the native [android widget](http://developer.android.com/reference/android/widget/SeekBar.html) that represents the user interface for this component. Valid only when running on Android OS.
*/
@ -29,6 +33,11 @@ export class Slider extends View {
* Gets or sets a slider max value. The default value is 100.
*/
maxValue: number;
/**
* Increase/Decrease step size for iOS Increment-/Decrement events
*/
accessibilityStep: number;
}
/**
@ -45,3 +54,18 @@ export const minValueProperty: Property<Slider, number>;
* Represents the observable property backing the maxValue property of each Slider instance.
*/
export const maxValueProperty: CoercibleProperty<Slider, number>;
/**
* Represents the observable property backing the accessibilityStep property of each Slider instance.
*/
export const accessibilityStepProperty: Property<SliderBase, number>;
interface AccessibilityIncrementEventData extends EventData {
object: Slider;
value?: number;
}
interface AccessibilityDecrementEventData extends EventData {
object: Slider;
value?: number;
}