Back to Website
Show / Hide Table of Contents

Class AuWidgetInputText

A widget representing a text input field. For details, you can refer to the InputText widget topic.

{
  "widgets": [
    {
      {
        "name": "quantity-selector",
        "type": "input-text",
        "title": "How many cards?",
        "params": {
          "prompt": "Select quantity",
          "defaultValue": "{{ Math.max(order.quantity, 25) }}",
          "type": "number",
          "min": 25
        }
      }
    }
  ]
}
Package: ui-framework

Properties

defaultValue

The default value.

Declaration
defaultValue: string | number
Property Value
Type Description
string | number

The default value.

invalid

Declaration
any invalid
Property Value
Type Description
any

params

Properties of the widget.

Declaration
params: IInputTextConfig
Property Value
Type Description
IInputTextConfig

Properties of the widget.

value

The current value.

Declaration
value: string | number
Property Value
Type Description
string | number

The current value.

Methods

checkInitDependenciesWidgets()

Returns an array of widget names, due to which the current widget cannot receive parameters.

Declaration
function checkInitDependenciesWidgets()
Returns
Type Description
string[]

clearSelection()

Declaration
function clearSelection()

exportWidgetData(boolean)

Declaration
function exportWidgetData(force: boolean)
Parameters
Type Name Description
boolean force
Returns
Type Description
Promise<InputTextData>

resetPreloaderState()

Declaration
function resetPreloaderState()

restoreWidgetFromData(InputTextData, boolean)

Declaration
function restoreWidgetFromData(widgetData: InputTextData, force: boolean)
Parameters
Type Name Description
InputTextData widgetData
boolean force
Returns
Type Description
Promise<void>

showPreloader(boolean, string | string[], number)

Shows a preloader.

"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]
Declaration
function showPreloader(isPreload: boolean, message: string | string[], timeout: number)
Parameters
Type Name Description
boolean isPreload

If true, enables the preloader.

string | string[] message

A text message that appears next to the preloader.

number timeout

showToast(string, number)

Shows a toast.

return editor.loadUserInfo(data)
    .catch(err => {
        this.widget.showToast("Error: Invalid data");
        console.log(err);
    });
Declaration
function showToast(data?: string, duration?: number)
Parameters
Type Name Description
string data

A string message to display in the toast.

number duration

Defines how long to show the toast for.

Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback