Package io.kvision.progress

Bootstrap progress bar component.

Types

Link copied to clipboard
data class Bounds<T>(val min: T, val max: T)

Generic progress bounds.

Link copied to clipboard
fun interface ContentGenerator<T>

Generic interface for progress content generator.

Link copied to clipboard
class FormatFractionContentGenerator(numberFormat: <ERROR CLASS> = numberFormat { style = "percent" }) : ContentGenerator<Number>

Uses a Intl.NumberFormat to format the fraction of a value within bounds. E.g. if value = 2, bounds=1,10, then the fraction is 0.2 which is formatted using a given numberFormat.

Link copied to clipboard
class FormatNumberValueContentGenerator(numberFormat: <ERROR CLASS> = Intl.NumberFormat()) : ContentGenerator<Number>

Uses a Intl.NumberFormat to format a value.

Link copied to clipboard
class NumberProgressBarTag(    progress: Progress<out Number>,     initialValue: Number = 0,     contentGenerator: ContentGenerator<Number>,     bgColor: BsBgColor? = null,     className: String? = null,     init: NumberProgressBarTag.() -> Unit? = null) : ProgressBarTag<Number>

An implementation of the @see ProgressBarTag, which works with plain old numbers

Link copied to clipboard
class Progress<T>(    bounds: Bounds<T>,     className: String? = null,     init: Progress<T>.() -> Unit? = null)

The Bootstrap progress

Link copied to clipboard
abstract class ProgressBarTag<T>(className: String? = null, bgColor: BsBgColor? = null)

A base class for the progress bar tag. This class only exposes utility methods in order to set the typical attributes used by the bootstrap progress bar in a type-safe manner.

Functions

Link copied to clipboard
fun Bounds<out Number>.fraction(value: Double): Double

Calculate fraction for the given value and bounds.

Link copied to clipboard
fun <T> <ERROR CLASS>.progress(    bounds: Bounds<T>,     className: String? = null,     init: Progress<T>.() -> Unit? = null): Progress<T>
fun <ERROR CLASS>.progress(    min: Number = 0,     max: Number = 100,     className: String? = null,     init: Progress<Number>.() -> Unit? = null): Progress<Number>

DSL builder extension function.

Link copied to clipboard
fun Progress<out Number>.progressNumeric(    initialValue: Number = 0,     contentGenerator: ContentGenerator<Number> = ContentGenerator { _, _, _ -> },     bgColor: BsBgColor? = null,     className: String? = null,     init: NumberProgressBarTag.() -> Unit? = null): <ERROR CLASS>