Tab class
Class represents dialog tab.
Constructor
__construct(array $options)
Creates object of class Tab
.
$options
— array with item options. Defined by structure TabOptions
:
id: string
Tab ID. Required option.
title: string | TextNodeOptions
Tab title. Defined either by string or structure TextNodeOptions.
icon
Tab icon. Indicate either image path or file in format Data URL.
Value is indicated either for all tab tag statuses or separately for each status according to structure TabLabelStates.textColor
Tab title text color.
Values is indicated either for all tab tag statuses or separately for each status according to structure TabLabelStates.bgColor
Tab title background.
Values is indicated either for all tab tag statuses or separately for each status according to structure TabLabelStates.visible: bool
Tab visibility.
When set asfalse
, tab is deemed as invisible, and title as tag is not displayed for it next to dialog. Default value:true
.itemOrder: array
Item sorting at the tab. Specified by array with structure matching with type ItemNodeOrder.
itemMaxDepth: number
Maximum level of item nesting depth, displayed by visual shift. Default value:
5
.stub: boolean | string
Defines "stub" for empty tab list. Default value:
true
— shows standard stub. Also, you can indicate full class name as a string.stubOptions: array
Additional stub options. Specified by array. Standard stub (
stub: true
) has the following settings.footer: string
Defines tab footer. Indicates either layout or full footer class name.
footerOptions
Additional footer options. Passed to footer class constructor.
showDefaultFooter?: boolean
Defines the requirement to show dialog footer. Default value:
true
.showAvatars
Show item avatars. Default value is not specified.
Methods
Method | Description | Available from version |
---|---|---|
getId(): ?string | Returns tab ID. | |
getTitle(): string | Returns tab title. | |
setTitle($title): self | Sets tab title. Title is defined by either a string or structure TextNodeOptions. | |
setIcon(array $icon): self | Sets tab icon either for all tag statuses or separately for each status according to structure TabLabelStates. | |
setTextColor(array $textColor): self | Sets tab title text color either for all tag statuses or separately for each status according to structure TabLabelStates. | |
setBgColor(array $bgColor): self | Sets tab title background color either for all tag statuses or separately for each status according to structure TabLabelStates. | |
setVisible(bool $flag): self | Sets tab visibility. | |
isVisible() | Returns true when tab is visible in the dialog (shows title as tag next to dialog).
| |
setItemOrder(array $order): self | Sets item sorting at the tab. Specified by array with structure matching the type ItemNodeOrder. | |
setItemMaxDepth(int $depth): self | Sets maximum level of item nesting depth, displayed by visual offset. | |
getItemMaxDepth(): ?int | Returns maximum levels of item nesting depth, displayed by visual offset. | |
setStub(bool|string $stub): self | Sets "stub" for tab empty list. Default value: true — shows standard stub. Also, you can indicate full class name as a string.
| |
setStubOptions(array $options): self | Sets stub options. | |
setFooter(string $footer, array $options = []): self | Sets or deletes tab footer. | |
enableDefaultFooter(): self | Enables display for footer dialog. | |
disableDefaultFooter(): self | Disables display for dialog footer. | |
setShowAvatars(bool $flag): self | Enables or disables avatar display in tab. |