File

core/forms/range.component.ts

Description

A component to render a range slider in Cumulocity UI. You need to wrap the default range input in this component, then use one of the four available options for the value display mode: pop, start, end, and inline

Example :
<c8y-range valueDisplayMode="inline">
  <input id="range" type="range" min="0" max="100000" value="0" step="1">
</c8y-range>

Implements

OnDestroy ControlValueAccessor

Metadata

Index

Properties
Methods
Inputs

Inputs

valueDisplayMode
Type : "pop" | "inline" | "end" | "start"
Default value : 'inline'

Value display mode, available options: pop, start, end, and inline (fallback)

Methods

updatePosition
updatePosition()

Updates the position of the slider

Returns : void

Properties

left
Type : string

The current position of the tooltip from left

range
Type : RangeDirective
Decorators :
@ContentChild(RangeDirective, {static: true})

The range input

rangeValue
Type : TemplateRef<>
Decorators :
@ContentChild('c8yRangeValue', {static: true})

The range value slider

value
Type : number

The current value.

<div
  class="range-wrap"
  [ngClass]="valueDisplayMode"
  style="--track-width: {{ left }}"
>
  <div
    class="range-value"
    [style.left]="left"
  >
    <span *ngIf="!rangeValue">{{ value }}</span>
    <ng-container *ngTemplateOutlet="rangeValue"></ng-container>
  </div>
  <ng-content></ng-content>
</div>

results matching ""

    No results matching ""