Class

ListWalker (list/documentlist/utils)

@ckeditor/ckeditor5-list/src/documentlist/utils/listwalker

class

Document list blocks iterator.

Filtering

Properties

  • _higherIndent : Boolean

    private

    Whether blocks with a higher indent level than the start block should be included in the result.

  • _includeSelf : Boolean

    private

    Whether start block should be included in the result (if it's matching other criteria).

  • _isForward : Boolean

    private

    The iterating direction.

  • _lowerIndent : Boolean

    private

    Whether blocks with a lower indent level than the start block should be included in the result.

  • _referenceIndent : Number

    private

    The reference indent. Initialized by the indent of the start block.

  • _sameAttributes : Array.<String>

    private

    Additional attributes that must be the same for each block.

  • _sameIndent : Boolean

    private

    Whether blocks with the same indent level as the start block should be included in the result.

  • _startElement : Element

    private

    The start list item block element.

Methods

  • constructor( startElement, options = { [options.direction], [options.includeSelf], [options.sameAttributes], [options.sameIndent], [options.lowerIndent], [options.higherIndent] } )

    Creates a document list iterator.

    Parameters

    startElement : Element

    The start list item block element.

    options : Object
    Properties
    [ options.direction ] : 'forward' | 'backward'

    The iterating direction.

    Defaults to 'backward'

    [ options.includeSelf ] : Boolean

    Whether start block should be included in the result (if it's matching other criteria).

    Defaults to false

    [ options.sameAttributes ] : Array.<String> | String

    Additional attributes that must be the same for each block.

    Defaults to []

    [ options.sameIndent ] : Boolean

    Whether blocks with the same indent level as the start block should be included in the result.

    Defaults to false

    [ options.lowerIndent ] : Boolean

    Whether blocks with a lower indent level than the start block should be included in the result.

    Defaults to false

    [ options.higherIndent ] : Boolean

    Whether blocks with a higher indent level than the start block should be included in the result.

    Defaults to false

  • Symbol.iterator() → Iterable.<Element>

    Iterable interface.

    Returns

    Iterable.<Element>
  • _getStartNode() → Element

    private

    Returns the model element to start iterating.

    Returns

    Element

Static methods

  • first( startElement, options = { [options.direction], [options.includeSelf], [options.sameAttributes], [options.sameIndent], [options.lowerIndent], [options.higherIndent] } ) → Element | null

    static

    Performs only first step of iteration and returns the result.

    Parameters

    startElement : Element

    The start list item block element.

    options : Object
    Properties
    [ options.direction ] : 'forward' | 'backward'

    The iterating direction.

    Defaults to 'backward'

    [ options.includeSelf ] : Boolean

    Whether start block should be included in the result (if it's matching other criteria).

    Defaults to false

    [ options.sameAttributes ] : Array.<String> | String

    Additional attributes that must be the same for each block.

    Defaults to []

    [ options.sameIndent ] : Boolean

    Whether blocks with the same indent level as the start block should be included in the result.

    Defaults to false

    [ options.lowerIndent ] : Boolean

    Whether blocks with a lower indent level than the start block should be included in the result.

    Defaults to false

    [ options.higherIndent ] : Boolean

    Whether blocks with a higher indent level than the start block should be included in the result.

    Defaults to false

    Returns

    Element | null