UIFormAdd

Properties

Name Type
props props
state state

new UIFormAdd(props)

A form add component

Param Type
props props

Example

import {UIFormAdd} from 'writer'

render($$) {
    return $$(UIFormAdd, {
        existingItems: [{name: 'Test', value: 'test', uuid: '13c4d7f6-4ecb-4d93-905c-3f5752a04f8d', imType: 'x-im/author', shortDescription: 'My short description'}],
        onSelect: (item) => {
            console.info(item)
        },
        onCreate: (addedItem, doesItemAlreadyExist) => {
            console.info(addedItem, doesItemAlreadyExist)
        },
        createAllowed: true,
        placeholderText: this.getLabel('Enter text')
    })
}

UIFormAdd.props

Properties

Name Type Default Description
placeholderText string Placehold text inside input
createAllowed boolean If creation of new elements is allowed
[focusOnRender] boolean false Whether or not to focus on the input field after render. Default is false
onSelect function Triggers when selection of item happens
[onCreate] function If allowing to create new items, pass this function
existingItems Array.<Item> List of existing items

UIFormAdd.Item

Properties

Name Type
name string
value string
uuid string
imType string
shortDescription string

UIFormAdd.state

Properties

Name Type Default
[items] Array.<Item> []
currentSelectedIndex number

results matching ""

    No results matching ""