furo-data-flow-repeat

furo-data-flow-repeat #

@furo/data v2.18.0
import '@furo/data/src/furo-data-flow-repeat.js';
exports FuroDataFlowRepeat js
exports <furo-data-flow-repeat> custom-element-definition
superclass FlowRepeat
mixes FieldNodeAdapter

summary automatic display of repeated fields

furo-data-flow-repeat Is a bindable repeater.

1
2
3
4
5
6
<furo-data-flow-repeat identity-path="id" fn-bind-data="--data(*.repeaterfield)">
  <template>
    <furo-ui5-data-text-input-labeled
        fn-bind-data="--init"></furo-ui5-data-text-input-labeled>
  </template>
</furo-data-flow-repeat>

The wire --init is fired from furo-data-flow-repeat

If you want to delete a repeated item, implement something which triggers the deleteNode method on the fieldNode itself.

Available wires in the template: #

  • --init : contains the repeated item, fired only once on creation of the repeated node
  • --item : contains the repeated item, fired on every inject
  • --firstItem : contains the repeated item, fired on the first element.
  • --lastItem : contains the repeated item, fired on the last element.
  • --index : contains a number with the index of the element.
  • --host : contains a reference to the host component.
  • --trigger : contains what was passed in to the triggering method.
  • --triggerFirst : contains what was passed in to the triggering method.
  • --triggerLast : contains what was passed in to the triggering method.
  • --itemSelected : contains nothing, is triggered with select(index).
  • --itemDeSelected : contains nothing, is triggered when another item is selected with select(index).

Available attributes #

index contains the current index of the item. Use this to fire a event with an index like at-click="^^item-clicked(index)" item contains the current index of the item. Use this to fire a event with the repeated item like at-click="^^item-selected(item)"

Attributes and Properties #

selectAddedItem #

default: false

Enable this to select the created item. This will trigger a wire --itemSelected which can be wired to fn-focus="--itemSelected".

identityPath #

default: false

By setting this param, the repeater has not to rebuild the list on new data. It only updates the parts that have changed.

The path is a field, relative to the root of the repeated item.

Methods #

bindData #

bindData(fieldNode RepeaterNode ) ⟹ boolean

RepeaterNode fn-bind-data

Bind a repeater node.

If identity-path is not set, the list will be cleared every time it receives new data.

  • fieldNode Must be a repeater node.

add #

add(data Object ) ⟹ void

Object fn-add

Adds a repeated item of the same type.

If no object is set, a initial FieldNode of the same type is added to the repeats.

  • data Object that match the type of the repeated node.