ViewActivity

class ViewActivity

extends AppActivity implements UIRenderable

View activity base class. Represents an application activity with content that can be rendered when activated.

Note: Nothing is rendered if the placement property is undefined (default). Make sure this property is set to a UIRenderPlacement value before rendering, or use a specific view activity class such as PageViewActivity.

Note: Most activities either display a full page view (see PageViewActivity) or a dialog (see DialogViewActivity), so it is usually not necessary to use this base class.

Constructor

(name?: string, path?: string): ViewActivity

.view

UIRenderable

The root component that makes up the content for this view, as a child component.

.placement

UIRenderPlacement

View placement mode, determines if and how view is rendered when activated.

.modalShadeOpacity

number

Modal shade backdrop opacity behind content (0-1), if supported by placement mode.

.modalShadeClickToClose

boolean

True if clicking outside a modal component should close it, defaults to false.

.render()

(callback?: RenderCallback<Output<UIRenderable, any>>): void

Render the view for this activity and display it, if it is not currently visible.

This method is called automatically after the root view component is created and/or when an application render context is made available or emits a change event, and should not be called directly.

.removeViewAsync()

(): Promise<void>

Remove the view output that was rendered by ViewActivity.render, if any.

This method is called automatically after the root view component or render context is removed, and should not be called directly.

.restoreFocus()

(firstFocused?: boolean): void

Request input focus on the last (or first) focused UI component, if any.

.firstFocused

UIComponent

The UI component that was focused first, if any.

.lastFocused

UIComponent

The UI component that was most recently focused, if any.

.showDialogAsync()

(View: UIRenderableConstructor, modalShadeClickToClose?: boolean, eventHandler?: (this: DialogViewActivity, e: ManagedEvent) => void): Promise<ViewActivity>

Create an instance of given view component, wrapped in a singleton dialog view activity, and adds it to the application to be displayed immediately.

  • View — A view component constructor.

  • modalShadeClickToClose — Set to true to allow the dialog to be closed by clicking outside of it.

  • eventHandler — A function that is invoked for all events that are emitted by the view; if no function is specified, the CloseModal event is handled by destroying the view activity instance.

Returns: A promise that resolves to the view activity instance after it has been activated.

.showConfirmationDialogAsync()

(message: string | string[], title?: string, confirmButtonLabel?: string, cancelButtonLabel?: string): Promise<boolean>

Display a confirmation/alert dialog with given content. If the ‘cancel’ button label is not provided, the dialog will only contain a ‘confirm’ button. All strings are automatically translated to the current locale using the tt function.

  • message — The message to be displayed, or multiple message paragraphs (for arrays).

  • title — The dialog title, displayed at the top of the dialog (optional).

  • confirmButtonLabel — The label for the ‘confirm’ button.

  • cancelButtonLabel — The label for the ‘cancel’ button, if any.

Returns: A promise that resolves to true if the OK button was clicked, false otherwise.

.name

string

Inherited from AppActivity.name.

.path

string

Inherited from AppActivity.path.

.match

Readonly<MatchedPath>

Inherited from AppActivity.match.

.getParentActivity()

(): AppActivity

Inherited from AppActivity.getParentActivity.

.getApplication()

(): Application

Inherited from AppActivity.getApplication.

.activateAsync()

(match?: MatchedPath): Promise<void>

Inherited from AppActivity.activateAsync.

.deactivateAsync()

(): Promise<void>

Inherited from AppActivity.deactivateAsync.

.destroyAsync()

(): Promise<void>

Inherited from AppActivity.destroyAsync.

.isActive()

(): boolean

Inherited from AppActivity.isActive.

.deactivated

number

Inherited from AppActivity.deactivated.

.renderContext

UIRenderContext

Inherited from AppComponent.renderContext.

.activationContext

AppActivationContext

Inherited from AppComponent.activationContext.

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.getParentComponent()

[1]. (): Component
[2]. <TParent extends Component>(ParentClass: ComponentConstructor<TParent>): TParent

Inherited from Component.getParentComponent.

.getCompositeParent()

<TParent extends Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getCompositeParent.

.propagateComponentEvent()

(name: string, inner?: ManagedEvent): void

Inherited from Component.propagateComponentEvent.

.managedId

number

Inherited from ManagedObject.managedId.

.managedState

ManagedState

Inherited from ManagedObject.managedState.

.getReferenceCount() protected

(): number

Inherited from ManagedObject.getReferenceCount.

.getManagedReferrers() protected

(): ManagedObject[]

Inherited from ManagedObject.getManagedReferrers.

.getManagedParent() protected

[1]. (): ManagedObject
[2]. <TParent extends ManagedObject>(ParentClass: ManagedObjectConstructor<TParent>): TParent

Inherited from ManagedObject.getManagedParent.

.emit()

<TEvent extends ManagedEvent = ManagedEvent, TConstructorArgs extends any[] = any[]>(e: string | TEvent | (new (...args: TConstructorArgs) => TEvent), ...constructorArgs: TConstructorArgs): this

Inherited from ManagedObject.emit.

.propagateChildEvents() protected

[1]. (f?: (this: this, e: ManagedEvent, propertyName: string) => void | ManagedEvent | ManagedEvent[]): this
[2]. (...types: (ManagedEvent | (new (...args: any[]) => ManagedEvent))[]): this

Inherited from ManagedObject.propagateChildEvents.

.activateManagedAsync() protected

(): Promise<any>

Inherited from ManagedObject.activateManagedAsync.

.deactivateManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.deactivateManagedAsync.

.destroyManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.destroyManagedAsync.

.onManagedStateActivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActivatingAsync.

.onManagedStateActiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActiveAsync.

.onManagedStateDeactivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDeactivatingAsync.

.onManagedStateInactiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateInactiveAsync.

.onManagedStateDestroyingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDestroyingAsync.


ViewActivity.Presets

extends AppActivity.Presets

View activity presets type, for use with Component.with.

.view

UIRenderableConstructor

View component constructor, to be instantiated and rendered when the activity is activated.

.placement

UIRenderPlacement

View placement mode.

.modalShadeOpacity

number

Modal shade backdrop opacity behind content (0-1), if supported by placement mode.

.modalShadeClickToClose

boolean

True if clicking outside a modal component should close it, defaults to false.

.name

string

Inherited from AppActivity.Presets.name.

.path

string

Inherited from AppActivity.Presets.path.