carbon-components-angular
Version:
Next generation components
114 lines (110 loc) • 4.09 kB
TypeScript
/**
*
* carbon-angular v0.0.0 | tab-header.directive.d.ts
*
* Copyright 2014, 2026 IBM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { EventEmitter, ElementRef, AfterViewInit, TemplateRef } from "@angular/core";
import { Tab } from "./tab.component";
import * as i0 from "@angular/core";
/**
* Shared inputs, outputs, and selection logic for `[cdsTabHeader]`
* and `cds-tab-header` as we prepare for deprecation.
* Groups use `@ContentChildren(TabHeaderBase)` so both forms appear in DOM order,
* subclasses supply the template and host behavior.
*/
export declare abstract class TabHeaderBase {
/**
* Set to 'true' to have pane reference cached and not reloaded on tab switching.
*/
set cacheActive(shouldCache: boolean);
get cacheActive(): boolean;
/**
* Sets `tabIndex` on the linked `Tab` pane when the pane reference is set.
*/
set paneTabIndex(tabIndex: number | null);
/**
* Selected tab; controls whether the linked pane content is shown.
*/
active: boolean;
/**
* Indicates whether or not the `Tab` item is disabled.
*/
disabled: boolean;
/**
* Icon template; used with `cds-tab-header` / `cds-tab-header-group`.
*/
icon: TemplateRef<any>;
/**
* Optional secondary label rendered below the primary tab label.
* Only displayed when the parent group is using `type="contained"`.
*/
secondaryLabel: string;
/**
* Set to `true` to render this tab header as dismissable.
*/
dismissable: boolean;
/**
* Reference to the corresponding tab pane.
*/
paneReference: Tab;
/**
* Title attribute used as the tooltip for the tab item. Falls back to the tab item's text content if not provided.
*/
title: string;
/**
* Emits when this header becomes selected.
*/
selected: EventEmitter<any>;
/**
* Emits when this tabs's close button is pressed.
*/
tabClose: EventEmitter<void>;
protected _cacheActive: boolean;
/**
* Move keyboard focus to the tab item.
*/
abstract focus(): void;
/**
* Activates the linked pane and emits `selected`.
*/
selectTab(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<TabHeaderBase, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<TabHeaderBase, never, never, { "cacheActive": "cacheActive"; "paneTabIndex": "paneTabIndex"; "active": "active"; "disabled": "disabled"; "icon": "icon"; "secondaryLabel": "secondaryLabel"; "dismissable": "dismissable"; "paneReference": "paneReference"; "title": "title"; }, { "selected": "selected"; "tabClose": "tabClose"; }, never, never, false>;
}
/**
* Tab header as an attribute on a focusable host inside `cds-tab-header-group`.
*
* @deprecated as of v5.
* Prefer `cds-tab-header` for icons, secondary labels, dismissable close, and icon-only tabs.
*/
export declare class TabHeader extends TabHeaderBase implements AfterViewInit {
private host;
get tabIndex(): 0 | -1;
get isSelected(): boolean;
get isDisabled(): boolean;
type: string;
get ariaSelected(): boolean;
get ariaDisabled(): boolean;
navItem: boolean;
navLink: boolean;
get hostTitle(): string;
constructor(host: ElementRef);
onClick(): void;
onKeyDown(event: KeyboardEvent): void;
ngAfterViewInit(): void;
focus(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<TabHeader, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<TabHeader, "[cdsTabHeader], [ibmTabHeader]", never, {}, {}, never, never, false>;
}