Home Reference Source
import {TabBar} from 'ink-splat/src/components/TabBar.js'
public class | source

TabBar

Extends:

react~React.ComponentControl → TabBar

Static Member Summary

Static Public Members
public static

This error will be thrown if you pass any children other than Tab components.

public static

This might not ever be thrown.

Static Method Summary

Static Public Methods
public static

isTabBar(anyComponentOrClass: *): *

Returns a boolean which indicates if the provided anyComponentOrClass parameter is an instance of TabBar (if passed an object) or a class derived from TabBar (if passed a function) or a component derived from TabBar.

public static

validateChildren(children: *, throwOnError: *): *

Validates a children array to make sure it is valid.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

state: {...undefined: Object, "activeTab": *}

Method Summary

Public Methods
public

handleTabIdChange(activeTab: *)

public

render(): *

Inherited Summary

From class Control
public static

BLUR_DIRECTION indicates the direction a onBlur() should move focus to next.

public static

buildControlForComponent(type: *, props: *, children: *): *

public static

componentHasChildren(component: *): *

Checks a React component to see if it has any children in props.

public static

firstFocusableControlOf(controlOrComponent: *): *

public static

isControl(anyComponentOrClass: *): *

Returns a boolean which indicates if the provided anyComponentOrClass parameter is an instance of Control (if passed an object) or a class derived from Control (if passed a function) or a component derived from Control.

public static

isReactComponent(anyComponentOrClass: *): *

Returns a boolean which indicates if the provided anyComponentOrClass parameter is an instance of React.Component (if passed an object) or a class derived from React.Component (if passed a function) or a component derived from React.Component.

public static

lastFocusableChild(controlOrComponent: *): *

public static
public static
public static

wrapComponent(component: *): *

public
public

state: {...undefined: Object, "canIReachThisState": string}

public

blur()

In a command line interface, where focusable controls exist (think Visual Basic for DOS) to get an idea of the concept, we can't completely blur out of EVERY single control.

Something is always going to ALWAYS need to be accept / capture input, be it a Button or TextField or a Menu or a Tab or Tree. But the concept of the Control component is that it can easily allow focus to shift from one component to the next, and allow those components which extend the Control class to easily display one type of blurred output while accepting input once focused.

In order to guarantee this, blur will locate the forward (or reverse component) and 'select' it instead.

public

canBlur(): *

Returns a boolean which indicates if the Control instance is un-focusable.

public

canFocus(): *

Returns a boolean which indicates if a Control instance is focusable.

public
public
public

focus()

public
public

isBlurred(): *

The isBlurred() method returns the inverse of the isFocused() method.

public

isDisabled(): *

The isDisabled() method returns a boolean which indicates the value of the disabled property as passed into the component.

public

isEnabled(): *

The isEnabled() method returns the inverse value of the isDisabled() method.

public

The isFocusable() method returns a boolean which indicates the value of the field, focusable.

public

isFocused(): *

The isFocused() method returns a boolean which indicates the value of the focused property as passed into the component, as long as it is not disabled.

public

render(): *

Static Public Members

public static ERROR_ONLY_TABS_ALLOWED: * source

This error will be thrown if you pass any children other than Tab components.

public static ERROR_UNKNOWN_ERROR: * source

This might not ever be thrown.

Static Public Methods

public static isTabBar(anyComponentOrClass: *): * source

Returns a boolean which indicates if the provided anyComponentOrClass parameter is an instance of TabBar (if passed an object) or a class derived from TabBar (if passed a function) or a component derived from TabBar.

Params:

NameTypeAttributeDescription
anyComponentOrClass *

Any valid React component or React component class or instance or derived component or class or instance.

Return:

*

true if anyComponentOrClass validates, false otherwise.

public static validateChildren(children: *, throwOnError: *): * source

Validates a children array to make sure it is valid.

Params:

NameTypeAttributeDescription
children *

An array of Tab components or null or undefined.

throwOnError *

If true, throws an error if invalid.

Return:

*

true if valid, false otherwise when throwOnError is false

Throw:

*

An error when throwOnError is true if children contains anything other than a Tab control or if it is an empty array [] or null or undefined.

Public Constructors

public constructor() source

Override:

Control#constructor

Public Members

public state: {...undefined: Object, "activeTab": *} source

Override:

Control#state

Public Methods

public handleTabIdChange(activeTab: *) source

Params:

NameTypeAttributeDescription
activeTab *

public render(): * source

Override:

Control#render

Return:

*