xd-dialog-helper

xd-dialog-helper

  • Docs
  • WYSIWYG-Editor
  • GitHub

›Reference

Getting started

  • Installation
  • The first dialog
  • WYSIWYG-Editor
  • Dialog validation
  • Options for showDialog()
  • Custom types

Examples

  • Hello World Dialog
  • Replace text dialog
  • Lorem Ipsum dialog

Reference

  • showDialog()
  • ActionList
  • ContentElementDeclaration
  • ContentElement
  • ContentElementType
  • Types

    • Checkbox
    • Header
    • Horizontal Rule
    • Select / Dropdown
    • Slider
    • Text
    • Text area
    • Text input

interface ContentElementType

Type

Interface

A content element type. Defines how an element should behave, render etc.

Members

render(dialogId: string, props: ContentElementDeclaration, actions: ActionList): ContentElement

Renders the component, returning a Content Element for the given input props. Every element id used should get prefixed by [dialogId]-.

Arguments

dialogId: string

The dialog's id. Should get used to prefix element ids.

props: ContentElementDeclaration

The declaration of the element. Contains all information about the element.

actions: ActionList

Actions that can get performed. See ActionList for futher details.

Note: actions.change() should get called whenever the element value changes to recheck dialog validation

Returns

The ContentElement for the passed props.

value(contentElement: ContentElement): *

Evaluates the value of the passed contentElement and returns it

Arguments

contentElement: ContentElement

The content element for which the value should get evaluated. Is of the current ContentElementType.

Returns

The value of the passed ContentElement. undefined, if no value is available, e.g., for static elements like DialogHelper.types.HEADER

valid(contentElement: ContentElement): boolean

Checks if input of the given ContentElement is valid. Returns true if it's valid and false if it's invalid.

Can, for example, get used for required checkboxes.

Arguments

contentElement: ContentElement

The ContentElement for which the function should check if the value is valid. Is of the current ContentElementType

Returns

true, if the values is valid and false, if it's not valid.

readonly type: string

A (readonly) string denoting the type in human-readable form (won't get used for technical purposes, meaning it can be any text that makes the type clear).

← ContentElementCheckbox →
  • Type
  • Members
    • render(dialogId: string, props: ContentElementDeclaration, actions: ActionList): ContentElement
    • value(contentElement: ContentElement): *
    • valid(contentElement: ContentElement): boolean
    • readonly type: string
xd-dialog-helper
Docs
Getting StartedExamplesAPI Reference
Community
User ShowcaseTwitter
More
GitHubLegal NoticePrivacy Policy
Copyright © 2019 Pablo Klaschka