Class TabView

Standard TabView class

Hierarchy

Constructors

Properties

#m_timers: Map<string, Function>
m_cards: ICardItemEx[]
m_cpage: ICardItemEx
m_ipage: string
m_menu: MenuItem
m_props: TabProps
m_tab_selector: boolean

Accessors

  • get dom(): HTMLElement
  • return the DOM associated with the Component (if any)

    Returns HTMLElement

Methods

  • Parameters

    • tabIndex: number | boolean
    • defValue: number = 0

    Returns void

  • a some classnames to the component classes can be separated by a space

    Example

    ```typescript addClass( 'my class name @flex' );

    Parameters

    • name: string

    Returns void

  • emit an event you can stop propagation of event or prevent default

    Type Parameters

    • K extends keyof CardViewEventMap

    Parameters

    • type: K
    • Optional event: CardViewEventMap[K]

      event data

    Returns void

  • enable or disable the element

    Parameters

    • Optional enable: boolean

    Returns void

  • get an attribute value

    Returns

    attribute value

    Example

    ```typescript let chk = el.getAttribute( 'checked' ); @review double cache

    Parameters

    • name: string

      attribute name

    Returns string

  • Returns

    the bounding rectangle

    Example

    ```typescript let rc = el.getBoundingRect( ); console.log( rc.left, rc.top, rc.right, rc.bottom );

    Parameters

    • withMargins: boolean = false

    Returns Rect

  • get the Component data value

    Parameters

    • name: string | Symbol

      name to get

    Returns any

  • check if the element has an attribute

    Returns

    true is attribute is present

    Example

    ```typescript if( el.hasAttribute('checked') ) { }

    Parameters

    • name: string

      attribute name

    Returns boolean

  • Type Parameters

    • N extends keyof CardViewEventMap

    Parameters

    • props: TabProps
    • Rest ...elements: N[]

    Returns void

  • stop listening to an event

    Type Parameters

    • K extends keyof CardViewEventMap

    Parameters

    • type: K
    • callback: ((ev: CardViewEventMap[K]) => any)

      callback to remove (must be the same as in on )

        • (ev: CardViewEventMap[K]): any
        • Parameters

          • ev: CardViewEventMap[K]

          Returns any

    Returns void

  • listen for an event

    Type Parameters

    • K extends keyof CardViewEventMap

    Parameters

    • type: K
    • callback: ((ev: CardViewEventMap[K]) => any)

      callback to call

        • (ev: CardViewEventMap[K]): any
        • Parameters

          • ev: CardViewEventMap[K]

          Returns any

    Returns EventDisposer

  • handle an event one time

    Returns

    Promise if callback is null

    take care with that because if the event is never fired and you await it, the system may overflow

    Type Parameters

    • K extends keyof CardViewEventMap

    Parameters

    • type: K
    • callback: ((ev: CardViewEventMap[K]) => any)

      callback to call when event is signaled

        • (ev: CardViewEventMap[K]): any
        • Parameters

          • ev: CardViewEventMap[K]

          Returns any

    Returns void

  • Remove a class from the element

    Example

    ```typescript el.removeClass( 'myclass' ); el.removeClass( 'myclass1 myclass2' );

    Parameters

    • name: string

      classes in string form can be space separated

    Returns void

  • ensure the component is visible @param: alignToTop

    Parameters

    • Optional arg: boolean | ScrollIntoViewOptions

    Returns void

  • change a single attribute

    Parameters

    • name: string

      attribute name

    • value: any

      new value

    Returns void

  • set the Component data value

    Parameters

    • name: string | Symbol

      name to get

    • value: any

    Returns void

  • change the object style

    Example

    ```typescript el.setStyle( {left:100} );

    Parameters

    • style: object

      style to add

    Returns void

  • change a style value

    Parameters

    • name: string

      string style nale

    • value: any

      any style value or null to remove style

    Returns void

  • Parameters

    • tag: string
    • Optional namespace: string

    Returns void

  • signal en event signaled event are notification : no way to prevent default not stop propagation

    Type Parameters

    • K extends keyof CardViewEventMap

    Parameters

    • type: K
    • event: CardViewEventMap[K]

      event data

    • delay: number = -1

    Returns void

  • start a new timer

    Parameters

    • name: string

      timer name

    • timeout: number

      time out in ms

    • repeat: boolean = true

      if true this is an auto repeat timer

    • callback: TimerCallback = null

      if !null, the callback to call else a EvTimer is fired

    Returns void

  • switch to a specific card

    Parameters

    • Optional name: string

      card name as define in constructor

    Returns void

  • Toggle a class from the element (if present remove, if absent add)

    Example

    ```typescript el.toggleClass( 'myclass' ); el.toggleClass( 'myclass1 myclass2'); el.toggleClass( ['myclass1','myclass2']);

    Parameters

    • name: string

      classes in string form can be space separated

    Returns void

  • get a component from a DOM element move up to the hierarchy to find the request class type.

    Returns

    Example

    with a DOM like that:
    Button
    Label
    Icon <- the DOM you have (dom-icon)

    let btn = Component.getElement( dom-icon, Button );

    Type Parameters

    Parameters

    • dom: Element | HTMLElement
    • Optional classname: string | Constructor<T>

    Returns T

Generated using TypeDoc