module:MSearchField

module:MSearchField

Search field.

Constructor

new (require("MSearchField"))()

Extends

Members

MIN_CHAR_LENGTH :number

Description:
  • Minimum character length for search to be conducted.

Minimum character length for search to be conducted.

Type:
  • number

SEARCH_ICON_CSS_CLASSES :Array.<string>

Description:
  • Search icon classes.

Search icon classes.

Type:
  • Array.<string>

CANCEL_ICON_CSS_CLASSES :Array.<string>

Description:
  • Cancel icon classes.

Cancel icon classes.

Type:
  • Array.<string>

signalValidationCompleted :MSignal

Description:
  • Signal is emitted when the validation for this field is completed. Parameters to be emitted:

    • result {boolean}
    • errorMessages {string[]}
Inherited From:

Signal is emitted when the validation for this field is completed. Parameters to be emitted:

  • result {boolean}
  • errorMessages {string[]}
Type:
  • MSignal

signalFieldValueChangedByUser :MSignal

Description:
  • Signal is emitted when the value of this field is changed by the uer. Parameters to be emitted:

    • field {MWidget|MField}
    • value {*}
Inherited From:

Signal is emitted when the value of this field is changed by the uer. Parameters to be emitted:

  • field {MWidget|MField}
  • value {*}
Type:
  • MSignal

getFieldHTMLElementFieldName

Description:
  • Get widget HTML element field name.

Inherited From:

Get widget HTML element field name.

setFieldHTMLElementFieldName

Description:
  • Set widget HTML element field name.

Inherited From:

Set widget HTML element field name.

setPrimaryIconVisible

Description:
  • Set primary icon visible.

Inherited From:

Set primary icon visible.

setPrimaryIconHidden

Description:
  • Set primary icon hidden.

Inherited From:

Set primary icon hidden.

togglePrimaryIconVisibility

Description:
  • Set primary icon hidden.

Inherited From:

Set primary icon hidden.

setSecondaryIconVisible

Description:
  • Set secondary icon visible.

Inherited From:

Set secondary icon visible.

setSecondaryIconHidden

Description:
  • Set secondary icon hidden.

Inherited From:

Set secondary icon hidden.

toggleSecondaryIconVisibility

Description:
  • Set primary icon hidden.

Inherited From:

Set primary icon hidden.

signalSender

Description:
  • Property method.

Inherited From:

Property method.

setSignalSender

Description:
  • Property method.

Inherited From:

Property method.

setDisabled

Description:
  • Set the widget disabled.

Inherited From:

Set the widget disabled.

setEnabled

Description:
  • Set the widget enabled.

Inherited From:

Set the widget enabled.

setEnabledState

Description:
  • Set enabled state.

Inherited From:

Set enabled state.

setDisabledState

Description:
  • Set disabled state.

Inherited From:

Set disabled state.

toggleEnabledState

Description:
  • Toggle enabled state.

Inherited From:

Toggle enabled state.

setHidden

Description:
  • Set the widget hidden.

    Method uses style.display CSS to change the visibility.

Inherited From:

Set the widget hidden.

Method uses style.display CSS to change the visibility.

setVisible

Description:
  • Set the widget visible.

    Method uses style.display CSS to change the visibility.

Inherited From:

Set the widget visible.

Method uses style.display CSS to change the visibility.

setVisibilityState

Description:
  • Set visibility state.

Inherited From:

Set visibility state.

setHiddenState

Description:
  • Set hidden state.

Inherited From:

Set hidden state.

toggleVisibilityState

Description:
  • Toggle visibility state,

Inherited From:

Toggle visibility state,

Methods

lastUsedSearchText() → {null|string}

Description:
  • Property.

Returns:

Value.

Type
null | string

(static) getClassName() → {string}

Description:
  • Get class name of this widget.

    This method is needed to get the name of the class this widget since minifying of JS will omit it. The method must return the name of the widget class as string.

Returns:
Type
string

text() → {null|string}

Description:
  • Text.

Inherited From:
Returns:

Value.

Type
null | string

setText(text)

Description:
  • Set text.

Inherited From:
Parameters:
Name Type Description
text null | string

Text to be set.

getValue() → {null|string}

Description:
  • Get value.

Inherited From:
Returns:

Value.

Type
null | string

setValue(value)

Description:
  • Set value.

    If value is false the field will be cleared. If value is an array, first item in it will be set. If value is a JSON object, one of the following keys will be used if it's present in the order they appear.

    • name
Inherited From:
Parameters:
Name Type Description
value null | string | Array | Object

Value to be set.

clearValue()

Description:
  • Clear value.

Inherited From:

setPrimaryIcon(iconClasses)

Description:
  • Set primary icon classes.

Inherited From:
Parameters:
Name Type Description
iconClasses Array.<string>

Icon list.

setSecondaryIcon(iconClasses)

Description:
  • Set primary icon classes.

Inherited From:
Parameters:
Name Type Description
iconClasses Array.<string>

Icon list.

labelWidget() → {null|MLabelWidget}

Description:
  • Label widget.

Inherited From:
Returns:

Label widget.

Type
null | MLabelWidget

setLabelWidget(widget)

Description:
  • Set label widget.

Inherited From:
Parameters:
Name Type Description
widget MLabelWidget

Label widget.

setInformationLabelWidgetText(text)

Description:
  • Set information label text.

Inherited From:
Parameters:
Name Type Description
text string

Text to be set.

formatters() → {Array.<MFormatter>}

Description:
  • Property method.

Inherited From:
Returns:

Validators

Type
Array.<MFormatter>

addFormatter(formatter)

Description:
  • Add a formatter.

Inherited From:
Parameters:
Name Type Description
formatter MFormatter

Formatter.

addFormatters(formatters)

Description:
  • Add formatters.

Inherited From:
Parameters:
Name Type Description
formatters Array.<MFormatter>

Formatters.

clearFormatters()

Description:
  • Clear formatters.

Inherited From:

validators() → {Array.<MValidator>}

Description:
  • Property method.

Inherited From:
Returns:

Validators

Type
Array.<MValidator>

addValidator(validator)

Description:
  • Add a validator.

Inherited From:
Parameters:
Name Type Description
validator MValidator

Validator.

addValidators(validators)

Description:
  • Add validators.

Inherited From:
Parameters:
Name Type Description
validators Array.<MValidator>

Validators.

clearValidators()

Description:
  • Clear validators.

Inherited From:

isValidated() → {boolean}

Description:
  • Whether this field is validated.

Inherited From:
Returns:

State.

Type
boolean

setValidated()

Description:
  • Set validated.

Inherited From:

setUnvalidated()

Description:
  • Set unvalidated.

Inherited From:

setValidationState(state)

Description:
  • Set validation state.

Inherited From:
Parameters:
Name Type Description
state boolean

State.

isRequired() → {boolean}

Description:
  • Property.

Inherited From:
Returns:

Value.

Type
boolean

setRequired()

Description:
  • Property.

Inherited From:

setNotRequired()

Description:
  • Property.

Inherited From:

setRequiredState(state)

Description:
  • Property.

Inherited From:
Parameters:
Name Type Description
state boolean

State.

doesOperateItself() → {boolean}

Description:
  • Property.

Inherited From:
Returns:

State.

Type
boolean

getDefaultValue() → {*}

Description:
  • Get default value.

Inherited From:
Returns:

Value.

Type
*

setDefaultValue(defaultValue)

Description:
  • Set default value.

Inherited From:
Parameters:
Name Type Description
defaultValue *

Default value to be set.

getPlaceholderText() → {null|string}

Description:
  • Set placeholder text.

Inherited From:
Returns:

Placeholder text.

Type
null | string

setPlaceholderText(text)

Description:
  • Set placeholder text.

Inherited From:
Parameters:
Name Type Description
text string

Placeholder text.

formatAndValidate(eventName)

Description:
  • Format and validate the current value for the given event.

Inherited From:
Parameters:
Name Type Description
eventName null | string

Event name.

primaryIcon() → {null|MFontAwesomeIconWidget}

Description:
Inherited From:
Returns:

Icon.

Type
null | MFontAwesomeIconWidget

setPrimaryIconAriaHidden(state)

Description:
  • Set primary icon aria hidden.

Inherited From:
Parameters:
Name Type Description
state boolean

State.

setPrimaryIconVisibilityState(state)

Description:
  • Set primary icon visibility state.

Inherited From:
Parameters:
Name Type Description
state boolean

State.

secondaryIcon() → {null|MFontAwesomeIconWidget}

Description:
Inherited From:
Returns:

Icon.

Type
null | MFontAwesomeIconWidget

setSecondaryIconAriaHidden(state)

Description:
  • Set secondary icon aria hidden.

Inherited From:
Parameters:
Name Type Description
state boolean

State.

setSecondaryIconVisibilityState(state)

Description:
  • Set secondary icon visibility state.

Inherited From:
Parameters:
Name Type Description
state boolean

State.

clearErrorMessages()

Description:
  • Clear all error messages.

    This method will remove all the error messages from the field.

Inherited From:

addErrorMessage(message)

Description:
  • Add an error message.

Inherited From:
Parameters:
Name Type Description
message string

Error message.

type() → {string}

Description:
  • Property Method.

Inherited From:
Returns:

Value from MWidgetType enum class.

Type
string

parentWidget() → {null|MWidget}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
null | MWidget

setParent(parentWidget)

Description:
  • Set parent of this widget.

    This widget will be placed under root HTML element of the given parentWidget.

    This method affects the hierarchy of this widget.

Inherited From:
Parameters:
Name Type Description
parentWidget MWidget

Parent widget.

setParentOfWidgetElement(parentWidget)

Description:
  • Set parent of this widget.

    This widget will be placed under widget HTML element of the given parentWidget.

    This method affects the hierarchy of this widget.

Inherited From:
Parameters:
Name Type Description
parentWidget MWidget

Parent widget.

setParentByHTMLElementID(parentHTMLElementID)

Description:
  • Set parent by element ID.

    This method affects the hierarchy of this widget.

Inherited From:
Parameters:
Name Type Description
parentHTMLElementID string

Parent HTML element ID.

setParentByHTMLElement(parentHTMLElement)

Description:
  • Set parent by HTML element.

    This method affects the hierarchy of this widget.

Inherited From:
Parameters:
Name Type Description
parentHTMLElement HTMLElement

Parent HTML element.

assignParentWidget(parentWidget)

Description:
  • Assign parent widget.

    This method doesn't change hierarchy, simple sets the given widget as parent widget of this widget.

Inherited From:
Parameters:
Name Type Description
parentWidget MWidget

Widget.

rootHTMLElement() → {null|HTMLElement}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
null | HTMLElement

widgetHTMLElement() → {null|HTMLElement}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
null | HTMLElement

childrenLayouts() → {Array.<MLayout>}

Description:
  • Property method.

Inherited From:
Returns:

Value.

Type
Array.<MLayout>

addChildLayout(layout)

Description:
  • Property method

Inherited From:
Parameters:
Name Type Description
layout MWidget | MLayout

Layout.

removeChildLayout(layout) → {boolean}

Description:
  • Property method.

Inherited From:
Parameters:
Name Type Description
layout MWidget | MLayout

Layout.

Returns:

Whether the given layout found and removed.

Type
boolean

childrenWidgets() → {Array.<MWidget>}

Description:
  • Property method.

Inherited From:
Returns:

Value.

Type
Array.<MWidget>

addChildWidget(widget)

Description:
  • Property method

Inherited From:
Parameters:
Name Type Description
widget MWidget

Widget.

removeChildWidget(widget) → {boolean}

Description:
  • Property method.

Inherited From:
Parameters:
Name Type Description
widget MWidget

Widget.

Returns:

Whether the given widget found and removed.

Type
boolean

childrenFields() → {Array.<MField>}

Description:
  • Property method.

Inherited From:
Returns:

Value.

Type
Array.<MField>

addChildField(field)

Description:
  • Property method

Inherited From:
Parameters:
Name Type Description
field MWidget | MField

Field.

removeChildField(field) → {boolean}

Description:
  • Property method.

Inherited From:
Parameters:
Name Type Description
field MWidget | MField

Field.

Returns:

Whether the given field found and removed.

Type
boolean

childrenHTMLElements() → {Array.<HTMLElement>}

Description:
  • Property method.

Inherited From:
Returns:

Value.

Type
Array.<HTMLElement>

addChildHTMLElement(htmlElement)

Description:
  • Add given htmlElement as a child to this widget.

Inherited From:
Parameters:
Name Type Description
htmlElement HTMLElement

HTML element.

removeChildHTMLElement(htmlElement) → {boolean}

Description:
  • Property method.

Inherited From:
Parameters:
Name Type Description
htmlElement htmlElement

HTML element.

Returns:

Whether the given htmlElement found and removed.

Type
boolean

className() → {null|string}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
null | string

cssClassesNamespace() → {null|string}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
null | string

data() → {null|*}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
null | *

setData(data)

Description:
  • Property Method.

Inherited From:
Parameters:
Name Type Description
data *

Data to be set.

isDisabled() → {boolean}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
boolean

isHidden() → {boolean}

Description:
  • Property Method.

Inherited From:
Returns:

Value.

Type
boolean

setRootHTMLElementID(id)

Description:
  • Set root HTML element ID.

Inherited From:
Parameters:
Name Type Description
id string

ID.

getWidgetHTMLElementName() → {null|string}

Description:
  • Get widget HTML element name.

Inherited From:
Returns:

Name.

Type
null | string

setWidgetHTMLElementName(name)

Description:
  • Set widget HTML element name.

Inherited From:
Parameters:
Name Type Description
name string

Name.

setWidgetHTMLElementAttribute(attributeName, value)

Description:
  • Set widget HTML element attribute.

Inherited From:
Parameters:
Name Type Description
attributeName string

Attribute name.

value *

Value to be set.

getWidgetHTMLElementAttribute(attributeName) → {*}

Description:
  • Set widget HTML element attribute.

Inherited From:
Parameters:
Name Type Description
attributeName string

Attribute name.

Returns:

Value.

Type
*

remove()

Description:
  • Remove the widget from its parent.

Inherited From:

addRootHTMLElementEventListener(event, callback, context)

Description:
  • Add event listener to the root HTML element.

Inherited From:
Parameters:
Name Type Description
event string

Event.

callback function

Callback.

context any

Context, namely this.

addWidgetHTMLElementEventListener(event, callback, context)

Description:
  • Add event listener to the widget HTML element.

Inherited From:
Parameters:
Name Type Description
event string

Event.

callback function

Callback.

context any

Context, namely this.

removed()

Description:
  • This method is invoked when a widget is removed for deletion from memory.

Inherited From:

initializeDescendantData()

Description:
  • Data block data initialized.

    This method is usually invoked explicitly by the parent object.

Inherited From:

initializeData()

Description:
  • Initialize data by using data block.

Inherited From: