Usage
Signature:
interface CTabBarElement<K extends string | number = string | number>
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
-
context-menu-config :oj-c.TabBar.CTabBarContextMenuConfig.<K>
-
Specifies a context menu configuration. It takes the keys `accessibleLabel` and `items`, where `accessibleLabel` is optional and items required . `items` function returns an array of menu item object representations that indicates what menu items are going to be part of menu based on some specific context menu context.
Context Menu Item Type Def ContextMenuSeparator { type: 'separator'} MenuItem { type?: 'item'; label: string; key: string; disabled?: boolean; onAction?: () => void; startIcon?: MenuIcon; endIcon?: MenuIcon; variant?: 'standard' | 'destructive'; }; ContextMenuSubMenu { type: 'submenu'; label?: string; disabled?: boolean; startIcon?: string; items?: Array<ContextMenuItems>; }; ContextMenuSelectSingle { type: 'selectsingle'; key?: string; items?: Array<MenuSelectItem>; selection?: string; onSelection?: (detail: { value: string }) => void; }; ContextMenuSelectMultiple { type: 'selectmultiple'; key?: string; items?: Array<MenuSelectItem>; selection?: Array<string>; onSelection?: (detail: { value: Array<string> }) => void; }; MenuIcon { type?: 'class'; class: string; } | { type: 'img'; src: string; }; MenuSelectItem { label: string; disabled?: boolean; endIcon?: MenuIcon; value: string; } Names
Item Name Property contextMenuConfigProperty change event contextMenuConfigChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-context-menu-config-changed -
data :(Array.<(oj-c.TabBar.TabData.<K>|oj-c.TabBar.TabLinkItemData.<K>)>|DataProvider.<K, (oj-c.TabBar.TabData.<K>|oj-c.TabBar.TabLinkItemData.<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 -
truncation :"none"|"progressive"
-
Truncation applies to the tab labels when there is not enough room to display all tabs.
- Default Value:
"none"
Names
Item Name Property truncationProperty change event truncationChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-truncation-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 propertystring The 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 propertiesobject An 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 propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void
Type Definitions
Exported Types
Note: Type definitions in this section are exported by the module, and so can be imported for use in application code.
-
TabData<K extends string | number>
-
The data item object that represents a tab.
Typescript Import Format
//To import this type, use the format below.
import { TabData } from "oj-c/tab-bar";
Properties:
Name Type Argument Description badgenumber <optional>
The content to be rendered inside the Badge component. icon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
The icon before the label in non-stack case, icon above the label in stacked case or the stand alone icon when no label is specified. isRemovableboolean <optional>
Renders a remove icon allowing the tabs to be removed. itemKeyK Key of the TabBarItem labelstring Label of the TabBarItem. For icon only display this label is the content for aria-label and tooltip text of the Tab. metadatastring <optional>
The content to be rendered inside the Text component as a metadata, that appears after the label in non stack case only. severity"none" | "error" | "confirmation" | "info" | "warning" <optional>
The status icon to be rendered after the label in non stack case only. tabPanelIdstring <optional>
Accepts the tabpanel element's ID associated with the tab item -
TabLinkItemData<K extends string | number>
-
The data item object that represents a tab with link.
Typescript Import Format
//To import this type, use the format below.
import { TabLinkItemData } from "oj-c/tab-bar";
Properties:
Name Type Argument Description badgenumber <optional>
The content to be rendered inside the Badge component. hrefstring Sets the URL that the hyperlink points to. If there is no valid URL use "#" for href value to navigate to the top of the page. icon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
The icon before the label in non-stack case, icon above the label in stacked case or the stand alone icon when no label is specified. itemKeyK Key of the TabBarItem labelstring Label of the TabBarItem. For icon only display this label is the content for aria-label and tooltip text of the Tab. metadatastring <optional>
The content to be rendered inside the Text component as a metadata, that appears after the label in non stack case only. severity"none" | "error" | "confirmation" | "info" | "warning" <optional>
The status icon to be rendered after the label in non stack case only. tabPanelIdstring <optional>
Accepts the tabpanel element's ID associated with the tab item
Documentation-only Types
Note: Type definitions in this section have been provided for documentation purposes and cannot be imported into application code.
-
ContextMenuSelectMultiple
-
Properties:
Name Type Argument Description itemsArray.<oj-c.TabBar.MenuSelectItem> <optional>
Specifies the array of select items that make up the select multiple. keystring A unique key associated with the select multiple. onSelection(detail: oj-c.TabBar.SelectMenuItemDetail<string[]>) => void <optional>
selectionArray<string> <optional>
type"selectmultiple" Specifies a select multiple menu item. -
ContextMenuSelectSingle
-
Properties:
Name Type Argument Description itemsArray.<oj-c.TabBar.MenuSelectItem> <optional>
Specifies the array of select items that make up the select single. keystring A unique key associated with the select single. onSelection(detail: oj-c.TabBar.SelectMenuItemDetail<string>) => void <optional>
selectionstring <optional>
type"selectsingle" Specifies a select single menu item. -
ContextMenuSeparator
-
Properties:
Name Type type"separator" -
ContextMenuSubMenu
-
Properties:
Name Type Argument Description disabledboolean <optional>
Specifies if the submenu is disabled (enabled by default). itemsArray<string | oj-c.TabBar.MenuItem | oj-c.TabBar.ContextMenuSeparator | oj-c.TabBar.ContextMenuSubMenu | oj-c.TabBar.ContextMenuSelectSingle | oj-c.TabBar.ContextMenuSelectMultiple> <optional>
keystring <optional>
A unique key associated with the submenu menu item. labelstring <optional>
The submenu label. startIconstring <optional>
Optional icon to render at the start of the submenu. type"submenu" Specifies a submenu menu item. -
CTabBarContextMenuConfig<K>
-
Properties:
Name Type Argument accessibleLabelstring <optional>
items(context: oj-c.TabBar.CTabBarItemContextMenuContext<K>) => ("remove" | ContextMenuItems | "defaultMenuItems" | "reorder")[] -
CTabBarItemContextMenuContext<K>
-
Properties:
Name Type hasDefaultMenuItemsboolean itemKeyK -
MenuItem
-
Specifies a standard menu item.
Properties:
Name Type Argument Description disabledboolean <optional>
Specifies if the menu item is disabled (enabled by default). endIcon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
Optional icon to render at the end of the menu item. keystring A unique key associated with the menu item. labelstring The menu item label. onActionfunction <optional>
Optional callback function associated with the menu item. startIcon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
Optional icon to render at the start of the menu item. type"item" <optional>
Specifies a standard menu item. variant"standard" | "destructive" <optional>
Specifies the menu item behavior. -
MenuSelection
-
Properties:
Name Type Description at(index: number) => string | undefined Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. -
MenuSelectItem
-
Specifies a selectable item in a menu item.
Properties:
Name Type Argument Description disabledboolean <optional>
Specifies if the selectable item is disabled (enabled by default). endIcon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
Optional icon to render at the end of the selectable item. labelstring The selectable item label. valuestring The value associated with the selectable item. -
SelectMenuItemDetail<T extends oj-c.TabBar.MenuSelection>
-
Properties:
Name Type menuSelectionGroupKeystring valueT