undefined

API Docs for: 5.4.1
Show:

Bricks Class

Module: Bricks
Parent Module: Utils

Methods

clear

() CheckboxBrick chainable

Clears the Brick by unchecking it.

Returns:

CheckboxBrick:

itself

isUserEntered

() Boolean

Checks if the checkbox was checked by the user or not.

Returns:

Boolean:

true if the user checked the checkbox; false, otherwise

isValid

() Boolean

Returns true. CheckboxBrick is always valid

Returns:

Boolean:

true

new

(
  • id
  • config
)
CheckboxBrick chainable

Initializes the CheckboxBrick by generating a specified template and setting defaults. Also sets a click listener on the template input checkbox. CheckboxBrick is a simple button in the Brick container.

If the header is provided, the Brick display it as a header element while hiding checkbox label and displaying on/off labels beside the checkbox depending on the state. If the header is no provided, Brick's label is displayed beside the checkbox.

Provide header if the checkbox is a standalone feature or you have lots of space; omit header if the checkbox is a part of a group of checkboxes or you want to conserve space.

Parameters:

  • id String

    specified id of the Brick

  • config Object

    a configuration object for the Brick

    • [header] String optional

      a Brick header

    • [instructions] String optional

      a configuration object for the Brick

    • [required] Array | Object optional

      collection of rules specifying what external conditions must be valid for the Brick to be enabled

    • [isEnabled] Boolean optional

      specifies if the brick is disabled from the start

    • [freezeStates] Array optional

      a set of rules specifying states Brick should be frozen

    • [baseTemplate] String optional

      a base template name to be used

    • [noticeTemplate] String optional

      a notice template name to be used

    • [containerClass] String optional

      a CSS class of the specific brick container

    • [customContainerClass] String optional

      any other optional CSS class to be added to the brick container

    • [template] String optional

      a name of the specific Brick template

    • [value] String optional

      a checkbox value

    • [label] String optional

      a checkbox label

    • [onLabel] String optional

      a checkbox on label

    • [offLabel] String optional

      a checkbox off label

Returns:

new

(
  • id
  • config
)
CheckboxfsBrick chainable

Initializes the CheckboxfsBrick by generating a specified template and setting defaults. Also sets a change listener on the template input checkbox. CheckboxfsBrick is a simple checkbox styles with a Formstone lib in the Brick container.

Parameters:

  • id String

    specified id of the Brick

  • config Object

    a configuration object for the Brick

    • [header] String optional

      a Brick header

    • [instructions] String optional

      a configuration object for the Brick

    • [required] Array | Object optional

      collection of rules specifying what external conditions must be valid for the Brick to be enabled

    • [isEnabled] Boolean optional

      specifies if the brick is disabled from the start

    • [freezeStates] Array optional

      a set of rules specifying states Brick should be frozen

    • [baseTemplate] String optional

      a base template name to be used

    • [noticeTemplate] String optional

      a notice template name to be used

    • [containerClass] String optional

      a CSS class of the specific brick container

    • [customContainerClass] String optional

      any other optional CSS class to be added to the brick container

    • [template] String optional

      a name of the specific Brick template

    • [value] String optional

      a checkbox value

    • [label] String optional

      a checkbox label

    • [onLabel] String optional

      a checkbox on label

    • [offLabel] String optional

      a checkbox off label

Returns:

new

(
  • id
  • config
)
ToggleBrick

Initializes the ToggleBrick by generating a specified template and setting defaults. Also sets a change listener on the template input checkbox. ToggleBrick is a simple toggle in the Brick container.

Parameters:

  • id String

    specified id of the Brick

  • config Object

    a configuration object for the Brick

    • [header] String optional

      a Brick header

    • [instructions] String optional

      a configuration object for the Brick

    • [required] Array | Object optional

      collection of rules specifying what external conditions must be valid for the Brick to be enabled

    • [isEnabled] Boolean optional

      specifies if the brick is disabled from the start

    • [freezeStates] Array optional

      a set of rules specifying states Brick should be frozen

    • [baseTemplate] String optional

      a base template name to be used

    • [noticeTemplate] String optional

      a notice template name to be used

    • [containerClass] String optional

      a CSS class of the specific brick container

    • [customContainerClass] String optional

      any other optional CSS class to be added to the brick container

    • [template] String optional

      a name of the specific Brick template

    • [value] String optional

      a checkbox value

    • [label] String optional

      a checkbox label

    • [onLabel] String optional

      a checkbox on label

    • [offLabel] String optional

      a checkbox off label

      • @chainable

Returns:

setChecked

(
  • value
  • userChecked
)
CheckboxBrick chainable

Check or uncheck the checkbox.

Parameters:

  • value Boolean

    true - checked; or false - unchecked

  • userChecked Boolean

    boolean value indicating if the user is the source of the value

Returns:

CheckboxBrick:

itself

setData

(
  • data
)
CheckboxBrick chainable

Sets CheckboxBrick's data. First calls setChecked and calls set data on the Brick prototype.

Parameters:

  • data Object

    a wrapper object for the data to be set.

Returns:

CheckboxBrick:

itself

Properties

Brick

Brick static

The basic Brick prototype with no special functions. A base from all other Bricks.

ButtonBrick

ButtonBrick static

The ButtonBrick prototype. A simple Brick with a button template.

CheckboxBrick

CheckboxBrick static

The CheckboxBrick prototype. A simple Brick with a checkbox template.

CheckboxfaBrick

CheckboxfaBrick static

The CheckboxfaBrick prototype. A simple Brick with a checkbox template styled with Formstone lib.

ChoiceBrick

ChoiceBrick static

The ChoiceBrick prototype. Provides a user the ability to choose a single item among several.

ColorPickerBrick

ColorPickerBrick static

The ColorPickerBrick prototype. Provides a control to select a color.

containerClass

String private

A container CSS class of the Brick.

Default: "checkbox-brick-container formstone-checkbox"

containerClass

String private

A CSS class of the ToggleBrick container node.

Default: "toggle-brick-container"

containerClass

String private

A CSS class of the CheckboxBrick container node.

Default: "checkbox-brick-container"

DropDownBrick

DropDownBrick static

The DropDownBrick prototype. Provides a dropdown control to choose an item from.

FileInputBrick

FileInputBrick static

The FileInputBrick prototype extends SimpleInputBrick. Provides a control to either select a local file or enter its URL.

label

String private

A checkbox label.

Default: "Ok"

label

String private

A toggle label.

Default: "Ok"

MultiBrick

MultiBrick static

The MultiBrick prototype. Used as a container for multiple independent Bricks if they are required to be displayed side by side.

offLabel

String private

A checkbox off label.

Default: "off"

OkCancelButtonBrick

OkCancelButtonBrick static

The OkCancelButtonBrick prototype. A MultiBrick with two ButtonBricks displayed side by side and styled as OK and Cancel buttons.

onLabel

String private

A checkbox on label.

Default: "on"

SimpleInputBrick

SimpleInputBrick static

The SimpleInputBrick prototype. Provides a control for a simple text input. Can be potentially extended to serve more specific purposes.

template

String private

A name of the default CheckboxBrick template.

Default: "default_checkbox_brick_template"

template

String private

A name of the default ToggleBrick template.

Default: "default_toggle_brick_template"

ToggleBrick

ToggleBrick static

The ToggleBrick prototype. A simple Brick with a checkbox toggle template.

value

String private

A checkbox value.

Default: "on"

value

String private

A toggle value.

Default: "on"