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

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>

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

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

# getIconClasses() → {object}

Get the icon classes for each checkbox shape

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

object

# getLabel() → {string}

Get the field label

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

string

# getLabelPosition() → {string}

Get the label position

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

"left" | "right" | "top"

string

# getValue() → {number}

Get the field value

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

  • The field value
number

# setFieldWidth(width)

Set the input field width

Parameters:
Name Type Description
width *

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

this

# setInvalid()

Change the style when the field is invalid

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

this

# setLabel(newLabel)

Set the field label

Parameters:
Name Type Description
newLabel string

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

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 426

this

# setLabelWidth(width)

Set the label width

Parameters:
Name Type Description
width *

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

this

# setValid()

Remove the invalid style

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

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 260

this

# setWidth(width)

Set the field width

Parameters:
Name Type Description
width *

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

this

# validate() → {boolean}

Validate the field value against validation rules

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

boolean