Hosanna UI API v2.3.0-next
    Preparing search index...

    NavControllerView manages a stack of navigatable views and transitions between them.

    • Only one view is visible at a time (or two during transitions).
    • Supports push, pop, reset, and replace operations with optional transitions.
    • Notifies when the last view is removed.
    NavController({ id: 'dialogNavController' })
    .isInitialFocus()
    .onViewRemoved((view: IHosannaView<ViewState>) => {
    console.info('[DialogManager] Dialog removed', view);
    this.focusManager._setFocusUnlocked();
    this?.state?.onDialogDismissed?.(view as IDialogView<ViewState>);
    })
    .onLastViewRemoved(() => {
    console.info('[DialogManager] Last dialog removed');
    this?.state?.onLastDialogDismissed?.();
    })
    .onViewAdded((view: IHosannaView<ViewState>) => {
    console.info('[DialogManager] Dialog added', view);
    this.focusManager._setFocusLocked(this);
    this.onDialogPresented?.(view as IDialogView<ViewState>);
    })

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    addChild addChildren addRendererToParentViewRenderer addSubView animateViews applyIdsToViewStructs applyInitialState applyLayoutStateToNativeRenderer applyStateChanges beginDrag bindViewModel bringChildInFrontOfChild bringChildToFront buildView cancelDrag canChangeOrientation canMeasureBounds clearErrorByErrorField clearErrors clearNavStackTopSeenForView configureAudioGuideItem containsChild createDataEvent dismiss dispatch dispatchAction dispatchAsync dispatchSelection endDrag findNextFocusable findNextFocusableView findNextFocusableViewByDirection getAnimationPropsForStateProperty getAudioGuideItem getBounds getBoundsInApp getBoundsInParent getChangedField getChildView getCustomData getDragController getField getFlattenedStructs getFlattenedStructsById getNavController getObservableField getPointInLocalCoordinates getSubView getSubViewRenderer hibernateView hideView inflateViewStructs insertChild insertChildAfterOtherChild insertChildBeforeOtherChild insertSubView invalidateAnimationPresentation invalidateLayout invalidateParentLayout isDescendantOf isFirstAppear isInFocusChain isTransitionValid layoutAt layoutChildren markStateDirtyForViewManager navStackTopSeenKeyForView notifyOnFocusedChildChange onAppear onAppearAgain onBlur onDidAddToAggregateView onDidAppearInAggregateView onDidChangeOrientation onDidReappearInAggregateView onDidRemoveFromAggregateView onDisappear onDisappearFromAggregateView onFirstAppear onFocus onInputEvent onMount onTransitionRemoveView onUnmount onWillAddToAggregateView onWillApplyStateChanges onWillChangeOrientation onWillRemoveFromAggregateView onWillReuse performViewManagerLayoutChildren pop present push reconcileChildren recycle registerControlWithErrorMessage registerControlWithKnownError release removeChild removeSubView render replace requestFocusedChild reset resolveFocusEntryTarget sendChildBehindOtherChild sendChildToBack setChildIndex setError setField setLayoutField setObservableField setObservableStateField setShowOnScreen setState showDialog showToast transitionToView unobserveObservableObjects updateDrag updateNavStackTopSeenForView wakeView

    Constructors

    Properties

    __isMemoizedStateValid: boolean = false
    _cacheKey: string = ''
    _hid: string
    _isInFocusChain: boolean = false
    _navScreenTopSeen: Record<string, boolean> = {}

    Tracks which stack views have already been the visible top at least once in this controller. Keys combine _hid and id (see navStackTopSeenKeyForView); entries are removed when a view leaves the stack so instance-pool reuse with a stable _hid still yields First on a fresh push.

    _pendingNavDirection: undefined | "forward" | "backward"

    Consumed by transitionToView to set AggregateViewTransition.navDirection. 'forward' for push/replace, 'backward' for pop/reset.

    _pendingNavStackDepthForPolicy: undefined | number
    activeAnimation?: HosannaViewAnimator

    If present, an animation currently targeting this view (or its subviews).

    activeStyleViewStatus: ViewStatus = ViewStatus.Normal
    aggregateView: undefined | IAggregateView.IAggregateView

    IHosannaView


    appConfig: IAppConfig
    audioGuideHint?: string = ''

    This hint can be used in conjunction with the audio guide item

    audioGuideItem?: string | IAudioGuideItem
    calculatedHeight: number = 0
    calculatedWidth: number = 0
    calculatedX: number = 0
    calculatedY: number = 0
    canReceiveFocus: boolean = true

    Indicates whether the element can receive focus.

    children: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    These are the children that are rendered on screen in the tree structure of the view

    childrenChanged: boolean = false
    clippingRect: number[] = ...
    compositeView: boolean = true

    Indicdates whether the view is a focus group which means it can have a focused child Otherwise it will be focused itself

    currentTransition: undefined | AggregateViewTransition.AggregateViewTransition

    The current transition being used for the view.

    currentView: undefined | IHosannaView<ViewState> = undefined

    The currently visible view.

    customData?: unknown
    defaultValues: Partial<T> = {}
    eventHandlers: Record<string, Function> = {}
    focusedChildId?: string
    focusId: string = ''
    height: number = 0
    id: string = ''
    includeInLayout: boolean = true
    initialFocusId: string = ''
    initialView?: IHosannaView<ViewState> | ViewStruct<ViewState>
    instancePool: IInstancePool
    isAggregateView: boolean = true
    isAutoFocusEnabled: boolean = true

    Indicates whether auto-focus is enabled for the view.

    isFocused: boolean = false

    Indicates whether the element is currently focused.

    isLayoutDirty: boolean = false
    isManagingVisibilityCallbacks: boolean = true

    Indicates whether the view is managing visibility callbacks.

    isNavController: true = ...

    Indicates this is a NavController.

    isPresented: boolean = false

    If true, this view has been presented in an AggregateViewController

    isSkeleton: boolean = false
    isWaking: boolean = false
    keyboardAvoidance: "none" | "auto" = 'auto'

    Automatic keyboard avoidance opt-out. When a software keyboard appears, the framework translates the visible screen to keep the editing input in view; set 'none' on the screen or the input to disable. Plain field (not reactive) — checked at keyboard-show time.

    nextViewId: number = 0
    nodePool: INodePool
    onLastViewRemoved: onLastViewRemovedHandler = ...

    Callback invoked when the last view is removed from the stack.

    onViewAdded?: onViewAddedHandler
    onViewRemoved?: onViewRemovedHandler
    opacity: number = 1.0
    parent?: IHosannaView<ViewState> = undefined

    The parent focusable element, if any.

    partialRendererHibernatedState: Partial<T> = {}
    rotation: number = 0
    scale: number[] = ...
    scaleRotateCenter: number[] = ...
    scrollablePositionX: undefined | number = undefined
    scrollablePositionY: undefined | number = undefined
    shouldRemoveFromAggregateView: boolean = true

    Indicates whether the view should be removed from the aggregate view.

    staticType: ViewStaticType = ViewStaticType.None
    subViews: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    These are the children that were created in getViews, in a flat strcuture - it contains EVERYTHING that we declared.

    subViewsChanged: boolean = false

    A temporary transition for the view.

    transitionStyleKey: string = ""

    Specifies the key used to determine the transition style for the view. This string can be used to select or identify different animation or transition effects when navigating between views or states within the application.

    translation: number[] = ...
    viewModel?: HsViewModel

    The screen's view model: behaviour that lives outside the view. A plain property, so this.viewModel is an ordinary read. See createViewModel.

    viewOwner: IHosannaView<ViewState>

    The IHosannaView subclass that created us in getViews

    viewStack: IHosannaView<ViewState>[] = []

    This is a virtual stack, showing you what's in the NavController - however, the navController, only shows one view at a time (or 2 if you are in a transition).

    viewStatus: ViewStatus = ViewStatus.Normal
    visible: boolean = true

    Indicates whether the navigatable entity is visible.

    width: number = 0

    Accessors

    • get _rendereredTranslation(): [number, number]

      Returns [number, number]

    • set _rendereredTranslation(value: [number, number]): void

      Parameters

      • value: [number, number]

      Returns void

    • get isDragActive(): boolean

      Returns boolean

    • get numberOfViews(): number

      Gets the number of views in the stack.

      Returns number

    • get renderer(): undefined | R

      Returns undefined | R

    • set renderer(value: undefined | R): void

      Parameters

      • value: undefined | R

      Returns void

    • get viewPhase(): ViewPhase

      Returns ViewPhase

    • set viewPhase(phase: ViewPhase): void

      Parameters

      Returns void

    Methods


    • Children


      Parameters

      • child: IHosannaView<ViewState>
      • OptionalmountTarget: IHosannaView<ViewState>

      Returns void

    • Parameters

      • parent: undefined | IHosannaView<ViewState>
      • childIndex: number = -1

      Returns void

    • Parameters

      • nextViewStructs: undefined | ViewStruct<ViewState>[]
      • parentId: string = ""
      • level: number = 0

      Returns void

    • Builds the view and attaches it to the view owner.

      Parameters

      • struct: ViewStruct<ViewState>
      • OptionalmountTarget: IHosannaView<ViewState>

        The target to mount the view.

      • childIndex: number = -1

      Returns undefined | IHosannaView<ViewState>

      The built view or undefined.

    • Parameters

      • view: undefined | IHosannaView<ViewState>

      Returns void

    • Type Parameters

      • T extends IHosannaView<ViewState>

      Parameters

      • id: string

      Returns undefined | T

    • Type Parameters

      • K extends keyof NavControllerState

      Parameters

      • field: K

      Returns any

    • Parameters

      • nextStructs: ViewStruct<ViewState>[]

      Returns ViewStruct<ViewState>[]

    • Parameters

      • nextStructs: ViewStruct<ViewState>[]
      • map: Record<string, ViewStruct<ViewState>> = {}
      • idList: { childIndex: number; id: string }[] = []

      Returns {
          idList: { childIndex: number; id: string }[];
          mappedNextStructs: Record<string, ViewStruct<ViewState>>;
      }


    • Rendererers


      Type Parameters

      • T extends IHosannaView<ViewState>

      Parameters

      • id: string
      • isDeepSearch: boolean = false

      Returns undefined | T

    • Aggregate views only hibernate the currently visible view — not all children. Hidden views in the stack (NavController) or inactive tabs (TabController) must stay as-is; waking them all at once corrupts the hierarchy.

      Returns void

    • Parameters

      • child: IHosannaView<ViewState>
      • OptionalmountTarget: IHosannaView<ViewState>
      • index: number = -1

      Returns void

    • Parameters

      • view: IHosannaView<ViewState>

        The view to be added as a subview.

      • index: number = -1

        index of the child in the parent view, -1 means add to end

      Returns void

    • Parameters

      • target: IHosannaView<ViewState>

      Returns boolean

    • Stable key for _navScreenTopSeen: combines instance id (_hid) and logical id so pooled instances and duplicate logical ids are not conflated; hibernation does not change these fields.

      Parameters

      • view: IHosannaView<ViewState>

      Returns string

    • Returns void

      Prefer BaseView.onDidAppearInAggregateView / BaseView.onDidReappearInAggregateView when shown via an aggregate transition. The framework still invokes this for other paths until migrated.

      IHosannaView.onAppear

    • Returns void

      Prefer BaseView.onDisappearFromAggregateView when leaving an aggregate context during a transition. The framework still invokes this for other paths until migrated.

      IHosannaView.onDisappear

    • Called when the NavController is mounted.

      Parameters

      • mountTarget: IHosannaView<ViewState>

        The parent view to mount into.

      • childIndex: -1

        The index at which to mount.

      Returns void

    • This method is called before applying state changes to the view. It is used to perform any necessary preparations before the state changes are applied.

      Returns void

    • Called by InstancePool.get() before a pooled instance is handed out. Restores the view to a construction-equivalent state so that stale lifecycle data (focus, viewStatus, old text, dirty flags, etc.) from the previous owner does not bleed into the new one.

      Class-default

      Returns void

      values (captured on first construction into the InstancePool per-class-name registry) are placed into pendingState with state left empty — matching a freshly-constructed view. This guarantees that every subsequent setField call (in applyInitialState) detects a difference against the empty state and pushes the value into pendingState, so applyLayoutStateToNativeRenderer applies ALL layout props (opacity, visible, translation, …) to the newly-acquired renderer even when the logical value equals the class default.

    • Pops the current view off the stack.

      Parameters

      • animated: boolean = true

        Whether the transition should be animated.

      • transitionStyleKey: undefined | string = undefined

      Returns undefined | IHosannaView<ViewState>

      The view that was popped off the stack.

    • Presents a new screen in the navigation stack or as a dialog.

      Parameters

      • screen: ViewStruct<ViewState>

        The screen to be presented, represented by a ViewStruct<ViewState>.

      • Optionaloptions: IScreenPresentationOptions

        Optional presentation options.

        • isDialog

          If true, the screen will be presented as a dialog.

        • animated

          If true, the screen transition will be animated.

        • transitionStyleKey

          App-config style key selecting the transition type and options.

      Returns void

    • Pushes a new view onto the stack.

      Parameters

      • view: IHosannaView<ViewState> | ViewStruct<ViewState>

        The view to be pushed onto the stack.

      • animated: boolean = true

        Whether the transition should be animated.

      • transitionStyleKey: undefined | string = undefined

      Returns void


    • IReusable implementation


      Parameters

      • initialState: NavControllerState

      Returns void

    • Replaces the current view with a new view.

      Parameters

      • newView: undefined | IHosannaView<ViewState> | ViewStruct<ViewState> = undefined

        The new view to replace the current view.

      • animated: boolean = false

        Whether the transition should be animated.

      • transitionStyleKey: undefined | string = undefined

      Returns undefined | IHosannaView<ViewState>

      The view that was replaced.

    • Sets which direct child this composite prefers on the next focus cascade, or moves focus to that child if this view is already in the focus chain.

      • First / Last: first or last direct child in children order with canReceiveFocus && visible.
      • Default: clears focusedChildId only (next cascade uses getInitialFocusId()); does not call setFocus.
      • Specific: same behavior as setFocusedSubview for a known child id.

      Parameters

      • target: ChildFocusTarget
      • OptionalchildId: string

      Returns void

    • Resets the stack to a new state.

      Parameters

      • endIndex: number = 0

        The index of the last screen to pop - by default it will clear all screens (0).

      • newFirstScreen: undefined | IHosannaView<ViewState> | ViewStruct<ViewState> = undefined

        The new first screen to be pushed onto the stack.

      • animated: boolean = false

        Whether the transition should be animated.

      • transitionStyleKey: undefined | string = undefined

      Returns boolean

      true if the reset ran; false if the operation was skipped (e.g. a transition is already in progress).

    • Changes the visual z-order of a child by moving it to a new index. Higher indices render on top. Updates both the children array and the renderer. Requires removeChild before insertChild because the SG node's insertChild always adds (splices in) and does not move; calling it on an already-present child would duplicate.

      Parameters

      • child: IHosannaView<ViewState>
      • newIndex: number

      Returns void

    • Type Parameters

      • K extends keyof NavControllerState

      Parameters

      • field: K
      • value: NavControllerState[K]

      Returns void

    • Type Parameters

      • K extends keyof NavControllerState

      Parameters

      • field: K
      • value: NavControllerState[K]

      Returns void

    • Assignment to an @observable field: observe the new object, then store it.

      Parameters

      • key: string
      • newVal: unknown

      Returns void

    • Parameters

      • dialog: ViewStruct<ViewState>
      • Optionaloptions: INavigationPresentationOptions

      Returns void

    • Presents passive toast content through the app-owned ToastManager.

      Parameters

      • toast: ViewStruct<ViewState>
      • Optionaloptions: ToastOptions

      Returns string

    • Transitions to the specified navigatable view.

      Parameters

      • view: undefined | IHosannaView<ViewState>

        The view to transition to.

      • animated: boolean = true

        Whether the transition should be animated.

      • removeSourceWhenComplete: boolean = true

      Returns void

    • Parameters

      • view: undefined | IHosannaView<ViewState>

      Returns void

    • Wakes up the view and its subviews by reserving native renderers and setting the view phase to Mounted.

      Returns void