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.

See Also

PageViewActivity, DialogViewActivity.

Constructor

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

.autoUpdate() static

(module: any): void

  • module — Reference to the module that should be watched for updates (build system-specific).

Register this activity class with the application auto-update handler (for automatic reload/hot module update). When possible, updates to the module trigger updates to any existing activity instances, with new methods and a new view instance.

.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.

.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.

.onFocusIn() protected

(e: ComponentEvent<Component>): void

Handle FocusIn UI event, remember first/last focused component.

.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, eventHandler?: (this: DialogViewActivity, e: ManagedEvent) => void): Promise<ViewActivity>

  • View — A view component constructor.
  • eventHandler — A function that is invoked for all events that are emitted by the view.

Create an instance of given view component, wrapped in a singleton dialog view activity, and adds it to the application to be displayed immediately. The activity responds to the CloseModal event by destroying the activity, which removes the view as well.

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

Note: Use the Application.showViewActivityAsync method, or reference an activity using a managed child property to show a view that is already encapsulated in an activity.

.showConfirmationDialogAsync()

(message: Stringable | Stringable[], title?: Stringable, confirmButtonLabel?: Stringable, cancelButtonLabel?: Stringable): Promise<...>

  • 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.

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 strf function.

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.

.destroyAsync()

(): Promise<void>

Inherited from AppActivity.destroyAsync.

.isActive()

(): boolean

Inherited from AppActivity.isActive.

.activated

number

Inherited from AppActivity.activated.

.deactivated

number

Inherited from AppActivity.deactivated.

.renderContext

UIRenderContext

Inherited from AppComponent.renderContext.

.viewportContext

any

Inherited from AppComponent.viewportContext.

.activationContext

AppActivationContext

Inherited from AppComponent.activationContext.

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.delegateEvent() protected

(e: ManagedEvent, propertyName: string): boolean | void

Inherited from Component.delegateEvent.

.getParentComponent()

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

Inherited from Component.getParentComponent.

.getBoundParentComponent()

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

Inherited from Component.getBoundParentComponent.

.emitAction()

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

Inherited from Component.emitAction.

.propagateComponentEvent() deprecated

(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

<TParent extends ManagedObject = 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.

.emitChange()

(name?: string): void

Inherited from ManagedObject.emitChange.

.propagateChildEvents() protected deprecated

(...types: ((new (...args: any[]) => ManagedEvent) | ((e: ManagedEvent) => any))[]): 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.

.placement

UIRenderPlacement

View placement mode.

.modalShadeOpacity

number

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

.name

string

Inherited from AppActivity.Presets.name.

.path

string

Inherited from AppActivity.Presets.path.