Class

Slider

kiss.ui.Slider(config)

The Slider derives from Component.

Provides a progress bar field.

Constructor

# new Slider(config)

Its a Custom Web Component. Do not use the constructor directly with the new keyword. Instead, use one of the 3 following methods:

Create the Web Component and call its init method:

const mySlider = document.createElement("a-slider").init(config)

Or use the shorthand for it:

const mySlider = createSlider({
 label: "%complete",
 min: 0,
 max: 200
})

mySlider.render()

Or directly declare the config inside a container component:

const myPanel = createPanel({
  title: "My panel",
  items: [
      {
          type: "slider",
          label: "% complete",
          colorOn: "#00aaee",
          colorOff: "#dddddd"
      }
  ]
})
myPanel.render()
Parameters:
Name Type Attributes Description
config object
label string
value number <optional>

Default value

min number <optional>

Default 0

max number <optional>

Default 100

step number <optional>

Slider step - Default 5

labelWidth string <optional>
labelPosition string <optional>

left | right | top | bottom

labelAlign string <optional>

left | right

labelFontSize string <optional>

Any valid CSS value

labelFontWeight string <optional>

Any valid CSS value

labelColor string <optional>

Any valid CSS value

fontSize string <optional>
formula string <optional>
width string | number <optional>
height string | number <optional>
margin string <optional>
padding string <optional>
readOnly boolean <optional>
disabled boolean <optional>
record object <optional>

The record to bind the field to. This will automatically update the record when the field value changes, and the field will listen to database changes on the record.

View Source client/ui/fields/slider.js, line 41

this

Generated markup

<a-slider class="a-slider">
 <label class="field-label"></label>
 <span class="field-slider-container">
     <span class="field-slider" type="range">
     <span class="field-slider-value">
 </span>
</a-slider>

Methods

# clearValue()

Clear the field value

View Source client/ui/fields/slider.js, line 294

this

# getIconClasses() → {object}

Get the icon classes for each checkbox shape

View Source client/ui/fields/slider.js, line 177

object

# getLabel() → {string}

Get the field label

View Source client/ui/fields/slider.js, line 372

string

# getLabelPosition() → {string}

Get the label position

View Source client/ui/fields/slider.js, line 431

"left" | "right" | "top"

string

# getValue() → {number}

Get the field value

View Source client/ui/fields/slider.js, line 321

  • The field value
number

# setFieldWidth(width)

Set the input field width

Parameters:
Name Type Description
width *

View Source client/ui/fields/slider.js, line 408

this

# setInvalid()

Change the style when the field is invalid

View Source client/ui/fields/slider.js, line 359

this

# setLabel(newLabel)

Set the field label

Parameters:
Name Type Description
newLabel string

View Source client/ui/fields/slider.js, line 382

this

# setLabelPosition(position)

Set label position

Parameters:
Name Type Description
position string

"left" (default) | "right" | "top" | "bottom"

View Source client/ui/fields/slider.js, line 441

this

# setLabelWidth(width)

Set the label width

Parameters:
Name Type Description
width *

View Source client/ui/fields/slider.js, line 420

this

# setValid()

Remove the invalid style

View Source client/ui/fields/slider.js, line 348

this

# setValue(newValue, rawUpdateopt)

Set the field value

Parameters:
Name Type Attributes Description
newValue boolean

The new field value

rawUpdate boolean <optional>

If true, it doesn't update the associated record and doesn't trigger "change" event

View Source client/ui/fields/slider.js, line 264

this

# setWidth(width)

Set the field width

Parameters:
Name Type Description
width *

View Source client/ui/fields/slider.js, line 396

this

# validate() → {boolean}

Validate the field value against validation rules

View Source client/ui/fields/slider.js, line 330

boolean
new Slider

Methods