Displays a pop-up text alert on screen.

sms

Hierarchy

  • ActionBehavior
    • ShowTextAlert

Accessors

Constructors

Methods

Properties - Appearance

Properties - Behavior

Properties - Other

Properties - ShowTextAlert

Accessors

  • get disposed(): boolean
  • Gets the disposed status of the entity.

    Returns boolean

    The disposed status.

Constructors

  • Creates an instance of ActionBehavior.

    Parameters

    • contextManager: ContextManager

      The current ContextManager

    • instance: Component<any, ConstructorProps>

      The instance of the component that this behavior is attached to

    • constructorProps: ActionBehaviorConstructorProps

      The constructor properties.

    Returns ShowTextAlert

Methods

  • Destroy this entity, cleaning up any resources that it has created and handler functions or callbacks it has registered.

    The base class implementation automatically unregisters any handler functions registered using register(...).

    Override this function in your own components and behaviors to clean up any resources you have created. If you do override this function, end it with:

    return super.dispose();
    

    This ensures that the dispose implementation of the parent class runs.

    Returns never

    The result of a call to super.dispose()

  • Get the instance of the ZComponent that constructed this entity.

    If you pass the class of a ZComponent as the type parameter, this function will ensure that it returns an instance of that ZComponent. If this component or behavior was constructed by a different ZComponent class, or by a different entity altogether, the function with throw an error.

    Type Parameters

    • T extends ZComponent<any, T> = ZComponent<any>

    Parameters

    • Optionaltype: ConstructorForComponent<T>

      The ZComponent class that you are expecting to receive

    Returns T

    The instance of the ZComponent that constructed this component or behavior

  • How long the alert will apear on the screen

    Returns void

  • Register a function to be called when an Event is fired, or an Observable's value changes. The function will only be bound to the underlying Event or Observable while this entity is enabled.

    Using this function, rather than attaching your handler directly to the Event or Observable, ensures your handler is automatically released when this entity is disposed.

    Type Parameters

    • Args extends any[]

    Parameters

    • evt: Event<Args>

      The Event or Observable to listen to

    • fn: ((...args: Args) => void)

      A function that will be called when the event fires, or the Observable value changes

        • (...args): void
        • Parameters

          Returns void

    • Optionalpriority: number

    Returns any

  • Type Parameters

    • Args extends any[]

    Parameters

    Returns any

  • Type Parameters

    • Type

    Parameters

    • observable: Observable<Type, never>
    • fn: ((v: Type) => void)
        • (v): void
        • Parameters

          Returns void

    • Optionalpriority: number

    Returns any

  • Type Parameters

    • Type

    Parameters

    Returns any

  • Unregisters a function that was previously registered to an Event or Observable.

    Type Parameters

    • Args extends any[]

    Parameters

    • evt: Event<Args>

      The Event or Observable

    • fn: ((...args: Args) => void)

      The function that was passed in the call to register

        • (...args): void
        • Parameters

          Returns void

    Returns any

  • Type Parameters

    • Type

    Parameters

    • observable: Observable<Type, never>
    • fn: ((v: Type) => void)
        • (v): void
        • Parameters

          Returns void

    Returns any

Properties - Appearance

backgroundColor: Observable<string, never> = ...

The color of the background of the text alert

10

black

color-hex

classNames: Observable<string[], never> = ...

Additional CSS class names to add to the alert DOM element

10

[]

textColor: Observable<string, never> = ...

The color of the text of the text alert

10

#ffffff

color-hex

timeout: Observable<number, never> = ...

The time (in milliseconds) that the text alert should remain on screen

10

3000

time-milliseconds

Properties - Behavior

enabled: Observable<boolean, never> = ...

If false, this entity and its children will no longer participate in the experience.

Note - to read this value, you may wish to use enabledResolved which will be false if this entity, or any of its parents, have enabled set to false.

The precise implications of enabled being false will vary between entities, but in general disabled entities:

  • should not emit any events,
  • should not take any action, e.g. navigate the user to a different page,
  • should not perform any network communication,
  • should not make changes to other behaviors or components in the experience,
  • should minimise any runtime performance cost (e.g. detach from any frame handlers).

true

10

Properties - Other

contextManager: ContextManager

The current ContextManager

enabledResolved: Observable<boolean, never> = ...

This will have value false if this entity, or any of its parents, have enabled set to false.

To change the enabled status of this entity, use the enabled property instead.

The precise implications of enabled being false will vary between entities, but in general disabled entities:

  • should not emit any events,
  • should not take any action, e.g. navigate the user to a different page,
  • should not perform any network communication,
  • should not make changes to other behaviors or components in the experience,
  • should minimise any runtime performance cost.

Disabled entities will typically remain visible (if they have a visible appearance).

instance: Component<any, ConstructorProps>

The instance of the component that this behavior is attached to

onDispose: Event<[]> = ...

An event that is fired as the last act of this entity being destroyed.

Properties - ShowTextAlert

text: Observable<string, never> = ...

The text to show in the alert

20