Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SfListBuilderComponent

API reference for SfListBuilderComponent

import {SfListBuilderComponent} from "@progress/sitefinity-component-framework";


selector: sf-list-builder

Hierarchy

  • SfListBuilderComponent

Index

Constructors

constructor

Properties

addButtonTitle

addButtonTitle: string

Sets the title attribute of the add button

Protected createField

createField: SfInputComponent

The create input from the template

createFieldName

createFieldName: string

Sets the name attribute of the create input

items

items: Array<ListBuilderItem>

Sets the list of already create items

newValue

newValue: string = stringConstants.EMPTY_STRING

Holds the value of the newly created item

onBlur

onBlur: EventEmitter<Event> = new EventEmitter<Event>()

Emits when the list builder is focused out

onEscapeKey

onEscapeKey: EventEmitter<Event> = new EventEmitter<Event>()

Emits on escape key

onFocus

onFocus: EventEmitter<Event> = new EventEmitter<Event>()

Emits on when the list builder and/or the create input are focused

onItemsChange

onItemsChange: EventEmitter<ListBuilderItem[]> = new EventEmitter<ListBuilderItem[]>()

Emits when the items list is changed

Private previousValue

previousValue: string

Holds the previous value of edited item

Private scrollService

scrollService: SfScrollService

showCreateButton

showCreateButton: boolean = true

Toggles the visibility of the create button

showCreateField

showCreateField: boolean

Toggles the visibility of the create input

Methods

closeAllEditFields

  • closeAllEditFields(): void
  • Closes all edit fields

    Returns void

collapseCreateField

  • collapseCreateField(): void
  • Collapses the create field Shows the add button

    Returns void

commitValue

  • commitValue(): void
  • Returns void

handleBlur

  • handleBlur(ev?: Event): void
  • On blur handler Adds the new value to the list of items and collapses the create field Emits onItemsChange event

    Parameters

    • Optional ev: Event

    Returns void

handleFocus

  • handleFocus(ev?: Event): void
  • On focus handler

    Parameters

    • Optional ev: Event

    Returns void

handleOnEscapeKey

  • handleOnEscapeKey(ev: Event): void
  • Executed on escape key pressed Adds the new value to the list of items and collapses the create field Emits onEscapeKey event

    Parameters

    • ev: Event

    Returns void

isItemValueEmpty

  • isItemValueEmpty(item: string): boolean
  • Check if item's value is empty

    Parameters

    • item: string

    Returns boolean

onEditTrigger

  • onEditTrigger(index: number): void
  • Handles item editing Closes all edit fields

    Parameters

    • index: number

    Returns void

onItemEdit

  • onItemEdit(index: number): void
  • Persists the new value after editing an item Closes all edit fields

    Parameters

    • index: number

    Returns void

Private pushValue

  • pushValue(itemStruct: ListBuilderItem, index: number, shouldClearPreviousValue?: boolean): void
  • Persists changes on existing items

    Parameters

    • itemStruct: ListBuilderItem
    • index: number
    • Default value shouldClearPreviousValue: boolean = false

    Returns void

removeItem

  • removeItem(itemValue: string): void
  • Removes item from the list Emits onItemsChange

    Parameters

    • itemValue: string

    Returns void

toggleEditableField

  • toggleEditableField(shouldClearErrors: boolean, shouldFocusField: boolean): void
  • Shows the create field and focuses it Scrolls to the create field

    Parameters

    • shouldClearErrors: boolean
    • shouldFocusField: boolean

    Returns void

Generated using TypeDoc