Usage
Signature:
interface CTabBarElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CTabBarElement } from "oj-c/tab-bar";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/tab-bar";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Attributes
-
data :(Array.<TabData.<(string|number)>>|DataProvider.<K, TabData.<K>>)
-
Specifies the data definitions for the tabs.
- Default Value:
[]
Names
Item Name Property dataProperty change event dataChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed -
display :"standard"|"icons"|"stacked"
-
Whether to display both the label and icons ("standard") or just the icons ("icons") or to render stacked display ("stacked"). In the latter case, the label is displayed in a tooltip instead.
- Default Value:
"standard"
Supported Values:
Value Description iconsOnly icons are shown for all tabs. stackedStacks the badge over the icon and icon over the label when applicable. standardLabel and icon are shown for all tabs. Names
Item Name Property displayProperty change event displayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-changed -
edge :"top"|"bottom"
-
The position of the TabBar.
- Default Value:
"top"
Names
Item Name Property edgeProperty change event edgeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-edge-changed -
layout :"stretch"|"condense"
-
Whether to stretch the tab bar items to occupy available space or to condense items
- Default Value:
"stretch"
Supported Values:
Value Description condenseCondenses the space occupied by tab bar items stretchStretches the tab bar items to occupy available space Names
Item Name Property layoutProperty change event layoutChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-layout-changed -
overflow :"hidden"|"popup"|"conveyor"
-
Specifies the overflow behavior
- Default Value:
"hidden"
Names
Item Name Property overflowProperty change event overflowChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-overflow-changed -
reorderable :"enabled"|"disabled"
-
Specifies if the tabs can be reordered within the tab bar. Note: Do not use with
overflow="popup"as reorder is not supported with popup.- Default Value:
"disabled"
Supported Values:
Value Description disabledDisables reordering of items in tabbar. enabledEnables reordering of items in tabbar. Names
Item Name Property reorderableProperty change event reorderableChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-reorderable-changed -
selection :K
-
The key of the currently selected tab.
- Supports writeback:
true
Names
Item Name Property selectionProperty change event selectionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changed
Events
-
ojBeforeSelect
-
Triggered before user selects a tab which includes user gestures or selection is changed programmatically.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description acceptfunction This method can be called with an application-created Promise to cancel this event asynchronously. The Promise should be resolved or rejected to accept or cancel the event, respectively. keyK -
ojRemove
-
Triggered when user performs a remove gesture on a tab. The remove gestures include:
- User clicks the remove icon in a tab
- User presses Delete key on a tab
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type keyK -
ojReorder
-
Triggered when user performs a reorder gesture on a tab. The reorder gestures include:
- User drags a tab and drops it in a new drop location
- User presses Command + Shift + Arrow key(s) on a tab
overflow="popup"as reorder is not supported with popup.Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description reorderedKeysArray<K> The new order of keys after reorder -
ojSelectionAction
-
Triggered when user performs a selection action gesture on a tab. The action gestures include:
- User clicks anywhere in a tab
- User taps anywhere in a tab
- User pressed spacebar or enter key on a tab
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type previousValueK valueK
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertyThe property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesAn object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description propertyThe property name to set. Supports dot notation for subproperty access. valueThe new value to set the property to. Returns:
- Type
- void