Module

ui/labeledfield/utils

@ckeditor/ckeditor5-ui/src/labeledfield/utils

module

Filtering

Functions

  • createLabeledDropdown( labeledFieldView, viewUid, statusUid ) → DropdownView

    A helper for creating labeled dropdowns.

    It creates an instance of a dropdown that is logically related to a labeled field view.

    The helper does the following:

    • It sets dropdown's id and ariaDescribedById attributes.
    • It binds input's isEnabled to the labeled view.

    Usage:

    const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
    console.log( labeledInputView.fieldView ); // A dropdown instance.

    Parameters

    labeledFieldView : LabeledFieldView

    The instance of the labeled field view.

    viewUid : String

    An UID string that allows DOM logical connection between the labeled view label and the dropdown.

    statusUid : String

    An UID string that allows DOM logical connection between the labeled view status and the dropdown.

    Returns

    DropdownView

    The dropdown view instance.

  • createLabeledInputNumber( labeledFieldView, viewUid, statusUid ) → InputNumberView

    A helper for creating labeled number inputs.

    It creates an instance of a input number that is logically related to a labeled view in DOM.

    The helper does the following:

    • It sets input's id and ariaDescribedById attributes.
    • It binds input's isReadOnly to the labeled view.
    • It binds input's hasError to the labeled view.
    • It enables a logic that cleans up the error when user starts typing in the input.

    Usage:

    const labeledInputView = new LabeledFieldView( locale, createLabeledInputNumber );
    console.log( labeledInputView.fieldView ); // A number input instance.

    Parameters

    labeledFieldView : LabeledFieldView

    The instance of the labeled field view.

    viewUid : String

    An UID string that allows DOM logical connection between the labeled view's label and the input.

    statusUid : String

    An UID string that allows DOM logical connection between the labeled view's status and the input.

    Returns

    InputNumberView

    The input number view instance.

  • createLabeledInputText( labeledFieldView, viewUid, statusUid ) → InputTextView

    A helper for creating labeled inputs.

    It creates an instance of a input text that is logically related to a labeled view in DOM.

    The helper does the following:

    • It sets input's id and ariaDescribedById attributes.
    • It binds input's isReadOnly to the labeled view.
    • It binds input's hasError to the labeled view.
    • It enables a logic that cleans up the error when user starts typing in the input.

    Usage:

    const labeledInputView = new LabeledFieldView( locale, createLabeledInputText );
    console.log( labeledInputView.fieldView ); // A text input instance.

    Parameters

    labeledFieldView : LabeledFieldView

    The instance of the labeled field view.

    viewUid : String

    An UID string that allows DOM logical connection between the labeled view's label and the input.

    statusUid : String

    An UID string that allows DOM logical connection between the labeled view's status and the input.

    Returns

    InputTextView

    The input text view instance.