hosanna-ui-docs - v0.9.0
    Preparing search index...

    Class LabelView<T, R>

    LabelView is a primitive view for displaying text labels with rich font, color, alignment, and ellipsis/wrapping options.

    • Supports custom fonts and font styles via fontKey and fontStyleKey.
    • Handles text measurement and layout.
    • Integrates with the font manager for font resolution.
    • Provides error handling for missing fonts.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    __isMemoizedStateValid: boolean = false
    _cacheKey: string = ''
    _hid: string
    _isInFocusChain: boolean = false
    _rendereredTranslation: [number, number] = ...
    activeFont?: ISGNFont

    The currently active font object.

    activeFontKey: IStyle = ''

    The currently active font key or style.

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

    IHosannaView


    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 = false

    Whether the label 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[] = ...
    color: string = '#ffffff'
    compositeView: boolean = false

    Whether this is a composite view.

    customData?: unknown
    defaultValues: Partial<T> = {}
    displayPartialLines: boolean = false

    Whether to display partial lines.

    ellipsisText: string = '\u2026'

    The ellipsis character to use when text overflows.

    ellipsizeOnBoundary: boolean = false

    Whether to ellipsize on the boundary.

    eventHandlers: Record<string, Function> = {}
    focusedChildId?: string
    focusId: string = ''
    font?: string | ISGNFont
    fontKey: string = ''

    The key for the font to use.

    fontManager: IFontManager

    Font manager for resolving fonts.

    fontStyleKey: string = ''

    The key for the font style to use.

    height: number = 0
    horizontalAlignment: SGHorizontalAlignment = SGHorizontalAlignment.Left

    The horizontal alignment of the label text.

    id: string = ''
    includeInLayout: boolean = true
    initialFocusId: string = ''
    instancePool: IInstancePool
    isFocused: boolean = false

    Indicates whether the element is currently focused.

    isLayoutDirty: boolean = false
    isPresented: boolean = false

    If true, this view has been presented in an AggregateViewController

    isSkeleton: boolean = false
    isWaking: boolean = false
    leadingEllipsis: boolean = false

    Whether to show a leading ellipsis.

    lineSpacing: number = 12

    The spacing between lines.

    maxLines: number = 0

    The maximum number of lines to display.

    Utility for measuring text size.

    nextViewId: number = 0
    nodePool: INodePool
    numLines: number = 0

    The number of lines to use for the label.

    opacity: number = 1.0
    parent?: IHosannaView<ViewState> = undefined
    partialRendererHibernatedState: Partial<T> = {}
    rotation: number = 0
    scale: number[] = ...
    scaleRotateCenter: number[] = ...
    scrollablePositionX: undefined | number = undefined
    scrollablePositionY: undefined | number = undefined
    staticType: ViewStaticType = ViewStaticType.None
    styleRegistry: IStyleRegistry
    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
    text: string = ''
    translation: number[] = ...
    truncateOnDelimiter: string = ''

    Delimiter to use for truncation.

    verticalAlignment: SGVerticalAlignment = SGVerticalAlignment.Top

    The vertical alignment of the label text.

    viewOwner: IHosannaView<ViewState>

    The IHosannaView subclass that created us in getViews

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

    Indicates whether the navigatable entity is visible.

    width: number = 0
    wordBreakChars: string = ''

    Characters to use for word breaking.

    wrap: boolean = false

    Whether to wrap text.

    Accessors

    Methods

    • 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

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

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

    • Lays out the label at the specified position and size within its parent.

      Parameters

      • x: number

        The x-coordinate.

      • y: number

        The y-coordinate.

      • parentWidth: number

        The width of the parent container.

      • parentHeight: number

        The height of the parent container.

      Returns void

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

      Returns void