MaterialSliderComponent class

A material slider which works for integer values.

The slider can be controlled by dragging it with the mouse, or by using the keyboard. In LTR, Left/down arrow keys decrease the value by 1, up/right keys increase by 1, page up increases by 10% (rounded up) and page down decreases by 10% (rounded up). In RTL, the keys have the opposite effect.

WARNING when using double values floating point math can cause the values to be non-exact. If displaying the value to the user consider formatting the result.

Implemented types
Annotations
  • @Component(selector: 'material-slider', providers: [ExistingProvider(HasDisabled, MaterialSliderComponent)], templateUrl: 'material_slider.html', styleUrls: ['material_slider.scss.css'], changeDetection: ChangeDetectionStrategy.onPush, directives: [NgIf], visibility: Visibility.all)

Constructors

MaterialSliderComponent(ChangeDetectorRef _changeDetector, DomService _domService)

Properties

classDisabledStr bool
True if the slider disabled.
no setter
container Element?
getter/setter pair
disabled bool
getter/setter pairoverride
disabledStr String
String value to be passed to aria-disabled.
no setter
hashCode int
The hash code for this object.
no setterinherited
isDragging bool
Whether the user is currently dragging either slider knob.
getter/setter pair
isLeftKnobSelected bool
True if mouse click event on left knob of a 2 sided slider.
getter/setter pair
isRightKnobSelected bool
True if mouse click event on right knob.
getter/setter pair
isRtl bool
Whether the current user locale is RTL.
no setter
isTwoSided bool
True if the slider is 2 sided.
getter/setter pair
leftProgressPercent double
The current progress of the leftValue input in percent.
no setter
leftValue num
The current value of the leftValue input in a 2 sided slider, defaults to 0.
getter/setter pair
leftValueChange Stream<num>
Publishes events when the value of the leftValue input is changed by the user in a 2 sided slider.
no setter
leftValueStr String
no setter
max num
The maximum progress value.
getter/setter pair
maxStr String
no setter
min num
The minimum progress value.
getter/setter pair
minStr String
no setter
progressPercent double
The current progress of the value input in percent.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
step num
The step size of the input.
getter/setter pair
value num
The current value of the input value element.
getter/setter pair
valueChange Stream<num>
Publishes events when the value of the value input is changed by the user.
no setter
valueStr String
no setter

Methods

knobKeyDown(KeyboardEvent event, {bool isLeftKnobPressed = false}) → void
Handles key press events on either slider knob.
mouseDown(MouseEvent event) → void
Handles mouse down events on either slider knob or the slider track.
ngAfterChanges() → void
Verifies that the input values of this control are consistent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
touchStart(TouchEvent event) → void
Handles touch start events on either slider knob.

Operators

operator ==(Object other) bool
The equality operator.
inherited