Skip to content

vue-mvvm / alert / AlertControl

AlertControl ​

Abstract base class for implementing an universal Alert dialog.

Extends ​

Implements ​

Constructors ​

Constructor ​

ts
new AlertControl(options): AlertControl;

Parameters ​

options ​

AlertOptions

Returns ​

AlertControl

Overrides ​

DialogControl.constructor

Properties ​

ctx ​

ts
protected readonly ctx: ReadableGlobalContext;

Represents a readonly global context that provides features like DI

Inherited from ​

DialogControl.ctx


description ​

ts
readonly description: string;

destroyed ​

ts
readonly destroyed: boolean;

Inherited from ​

DialogControl.destroyed


options ​

ts
protected readonly options: AlertOptions;

title ​

ts
readonly title: string;

Methods ​

[asyncDispose]() ​

ts
asyncDispose: Promise<void>;

Returns ​

Promise<void>

Inherited from ​

DialogControl.[asyncDispose]


[dispose]() ​

ts
dispose: void;

Returns ​

void

Inherited from ​

DialogControl.[dispose]


activated() ​

ts
protected activated(): void | Promise<void>;

Hook for Vue's onActivated

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.activated


beforeMount() ​

ts
protected beforeMount(): void | Promise<void>;

Hook for Vue's onBeforeMount

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.beforeMount


beforeUnmount() ​

ts
protected beforeUnmount(): void | Promise<void>;

Hook for Vue's onBeforeUnmount

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.beforeUnmount


beforeUpdate() ​

ts
protected beforeUpdate(): void | Promise<void>;

Hook for Vue's onBeforeUpdate

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.beforeUpdate


closeDialog() ​

ts
closeDialog(): Promise<void>;

Requests the dialog to close, can be safely closed from the inheriting class for closing the dialog from the inside.

If the dialog has been destroyed, a warning is logged, and the method exits.

Returns ​

Promise<void>

Inherited from ​

DialogControl.closeDialog


computed() ​

Call Signature ​

ts
protected computed<T>(getter): T;
Type Parameters ​
T ​

T

Parameters ​
getter ​

ComputedGetter<T>

Returns ​

T

Inherited from ​

DialogControl.computed

Call Signature ​

ts
protected computed<T>(options): T;
Type Parameters ​
T ​

T

Parameters ​
options ​
get ​

ComputedGetter<T>

set ​

ComputedSetter<T>

Returns ​

T

Inherited from ​

DialogControl.computed


deactivated() ​

ts
protected deactivated(): void | Promise<void>;

Hook for Vue's onDeactivated

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.deactivated


destroy() ​

ts
destroy(): void;

Marks the current instance as destroyed. Additionally it will not longer be rendered by the DialogProvider

Returns ​

void

Inherited from ​

DialogControl.destroy


getUserControl() ​

ts
protected getUserControl<T>(ref): T | null;

Collect UserControl that are bound to the View using a Vue.js template ref

Type Parameters ​

T ​

T extends | UserControl | UserControl[]

Parameters ​

ref ​

string

The Vue.js Template ref

Returns ​

T | null

UserControl of the bounded UI Element

Inherited from ​

DialogControl.getUserControl


mounted() ​

ts
protected mounted(): void | Promise<void>;

Hook for Vue's onMounted

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.mounted


onAction() ​

ts
abstract onAction(ctx): void | Promise<void>;

Called when the action execution is initiated by an external ViewModel via ViewModel.runAction.

This method receives a new ActionContext representing the current execution flow.

Parameters ​

ctx ​

ActionContext<void>

The context object specific to this execution run, used to resolve or fail the action.

Returns ​

void | Promise<void>

Remarks ​

It is semantically possible for this method to be called multiple times on the same instance (e.g., if the caller does not await the previous runAction call). Implementations should decide whether to support concurrent executions or replace the active context (last-one-wins).

Implementation of ​

Action.onAction


onClose() ​

ts
abstract protected onClose(): void | Promise<void>;

Is executed when closing the dialog was requested

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.onClose


onOpen() ​

ts
abstract protected onOpen(): void | Promise<void>;

Is executed when opening the dialog was requested

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.onOpen


openDialog() ​

ts
openDialog(): Promise<void>;

Requests the dialog to open

If the dialog has been destroyed, a warning is logged, and the method exits.

Returns ​

Promise<void>

Inherited from ​

DialogControl.openDialog


readonly() ​

ts
protected readonly<T>(value): T;

Type Parameters ​

T ​

T

Parameters ​

value ​

T

Returns ​

T

Inherited from ​

DialogControl.readonly


ref() ​

ts
protected ref<T>(initial): T;

Type Parameters ​

T ​

T

Parameters ​

initial ​

T

Returns ​

T

Inherited from ​

DialogControl.ref


runAction() ​

ts
protected runAction<T>(action): Promise<ActionResult<T>>;

Executes an MVVM Action and returns its result as a promise.

Notes

  • The action body may be synchronous or asynchronous; both are supported.
  • If the action tries to complete/fail more than once, a Vue warning is emitted and further attempts are ignored.

Type Parameters ​

T ​

T

Parameters ​

action ​

Action<T>

The action object implementing Action interface.

Returns ​

Promise<ActionResult<T>>

A promise that resolves with an ActionResult carrying either the data on success or an error on failure.

Inherited from ​

DialogControl.runAction


unmounted() ​

ts
protected unmounted(): void | Promise<void>;

Hook for Vue's onUnmounted

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.unmounted


updated() ​

ts
protected updated(): void | Promise<void>;

Hook for Vue's onUpdated

Returns ​

void | Promise<void>

Inherited from ​

DialogControl.updated


watch() ​

ts
protected watch(
   source, 
   cb, 
   options?): WatchHandle;

Sets up a watch on a reactive source and registers the watch handle. Allows tracking and managing the lifecycle of the watch handle within the class.

Additionally, watchers are automatically disposed after the component is unmounted and all lifecycle hooks have finished executing.

Parameters ​

source ​

WatchSource

The reactive source to watch.

cb ​

WatchCallback

The callback function that gets triggered when the source changes.

options? ​

WatchOptions<boolean>

Optional configuration object for the watcher (e.g., deep, immediate).

Returns ​

WatchHandle

A custom watch handle with methods to stop, pause, and resume the watcher.

Inherited from ​

DialogControl.watch