UNPKG

8.47 kBTypeScriptView Raw
1import { EventEmitter, QueryList, AfterContentInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
2import { ActivatedRoute } from '@angular/router';
3import { NbBooleanInput } from '../helpers';
4import { NbComponentOrCustomStatus } from '../component-status';
5import { NbBadgePosition } from '../badge/badge.component';
6import { NbIconConfig } from '../icon/icon.component';
7import { NbTabContentDirective } from './tab-content.directive';
8import { NbTabTitleDirective } from './tab-title.directive';
9import * as i0 from "@angular/core";
10/**
11 * Specific tab container.
12 *
13 * ```ts
14 * <nb-tab tabTitle="Users"
15 * badgeText="99+"
16 * badgeStatus="danger">
17 * <p>List of <strong>users</strong>.</p>
18 * </nb-tab>
19 * ```
20 */
21export declare class NbTabComponent {
22 tabContentDirective: NbTabContentDirective;
23 tabTitleDirective: NbTabTitleDirective;
24 /**
25 * Tab title
26 * @type {string}
27 */
28 tabTitle: string;
29 /**
30 * Tab id
31 * @type {string}
32 */
33 tabId: string;
34 /**
35 * Use badge dot mode
36 * @type {boolean}
37 */
38 get badgeDot(): boolean;
39 set badgeDot(val: boolean);
40 protected _badgeDot: boolean;
41 static ngAcceptInputType_badgeDot: NbBooleanInput;
42 /**
43 * Tab icon name or icon config object
44 * @type {string | NbIconConfig}
45 */
46 tabIcon: string | NbIconConfig;
47 /**
48 * Item is disabled and cannot be opened.
49 * @type {boolean}
50 */
51 get disabled(): boolean;
52 set disabled(val: boolean);
53 static ngAcceptInputType_disabled: NbBooleanInput;
54 /**
55 * Show only icons when width is smaller than `tabs-icon-only-max-width`
56 * @type {boolean}
57 */
58 set responsive(val: boolean);
59 get responsive(): boolean;
60 static ngAcceptInputType_responsive: NbBooleanInput;
61 /**
62 * Makes this tab a link that initiates navigation to a route
63 * @type string
64 */
65 route: string;
66 activeValue: boolean;
67 responsiveValue: boolean;
68 disabledValue: boolean;
69 /**
70 * Specifies active tab
71 * @returns {boolean}
72 */
73 get active(): boolean;
74 set active(val: boolean);
75 static ngAcceptInputType_active: NbBooleanInput;
76 /**
77 * Lazy load content before tab selection
78 * @docs-private
79 * @deprecated This setting never worked. Wrap content into a `nbTabContent` to make it lazy.
80 * @breaking-change Remove 12.0.0
81 */
82 set lazyLoad(val: boolean);
83 static ngAcceptInputType_lazyLoad: NbBooleanInput;
84 /**
85 * Badge text to display
86 * @type string
87 */
88 badgeText: string;
89 /**
90 * Badge status (adds specific styles):
91 * 'primary', 'info', 'success', 'warning', 'danger'
92 * @param {string} val
93 */
94 badgeStatus: NbComponentOrCustomStatus;
95 /**
96 * Badge position.
97 * Can be set to any class or to one of predefined positions:
98 * 'top left', 'top right', 'bottom left', 'bottom right',
99 * 'top start', 'top end', 'bottom start', 'bottom end'
100 * @type string
101 */
102 badgePosition: NbBadgePosition;
103 /**
104 * @deprecated
105 * @breaking-change Remove 12.0.0
106 * @docs-private
107 */
108 init: boolean;
109 static ɵfac: i0.ɵɵFactoryDeclaration<NbTabComponent, never>;
110 static ɵcmp: i0.ɵɵComponentDeclaration<NbTabComponent, "nb-tab", never, { "tabTitle": { "alias": "tabTitle"; "required": false; }; "tabId": { "alias": "tabId"; "required": false; }; "badgeDot": { "alias": "badgeDot"; "required": false; }; "tabIcon": { "alias": "tabIcon"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "route": { "alias": "route"; "required": false; }; "active": { "alias": "active"; "required": false; }; "lazyLoad": { "alias": "lazyLoad"; "required": false; }; "badgeText": { "alias": "badgeText"; "required": false; }; "badgeStatus": { "alias": "badgeStatus"; "required": false; }; "badgePosition": { "alias": "badgePosition"; "required": false; }; }, {}, ["tabContentDirective", "tabTitleDirective"], ["*"], false, never>;
111}
112/**
113 *
114 * Dynamic tabset component.
115 * @stacked-example(Showcase, tabset/tabset-showcase.component)
116 *
117 * Basic tabset example
118 *
119 * ```html
120 * <nb-tabset>
121 * <nb-tab tabTitle="Simple Tab #1">
122 * Tab content 1
123 * </nb-tab>
124 * <nb-tab tabTitle="Simple Tab #2">
125 * Tab content 2
126 * </nb-tab>
127 * </nb-tabset>
128 * ```
129 *
130 * ### Installation
131 *
132 * Import `NbTabsetModule` to your feature module.
133 * ```ts
134 * @NgModule({
135 * imports: [
136 * // ...
137 * NbTabsetModule,
138 * ],
139 * })
140 * export class PageModule { }
141 * ```
142 * ### Usage
143 *
144 * It is also possible to set a badge to a particular tab:
145 * @stacked-example(Tab With Badge, tabset/tabset-badge.component)
146 *
147 * and we can set it to full a width of a parent component
148 * @stacked-example(Full Width, tabset/tabset-width.component)
149 *
150 * `tabIcon` should be used to add an icon to the tab. Icon can also be combined with title.
151 * `responsive` tab property if set allows you to hide the title on smaller screens
152 * (`$tabset-tab-text-hide-breakpoint` variable) for better responsive behaviour.
153 * You can open the following example and make
154 * your screen smaller - titles will be hidden in the last tabset in the list:
155 * @stacked-example(Icon, tabset/tabset-icon.component)
156 *
157 * It is also possible to disable a tab using `disabled` property:
158 * @stacked-example(Disabled Tab, tabset/tabset-disabled.component)
159 *
160 * By default, the tab contents instantiated straightaway. To make tab contents load lazy,
161 * declare the body of a tab in a template with `nbTabContent` directive.
162 * ```html
163 * <nb-tabset>
164 * <nb-tab>
165 * <some-component *nbTabContent>Lazy content</some-component>
166 * </nb-tab>
167 * <nb-tab>
168 * <ng-template nbTabContent>
169 * Lazy content with template syntax
170 * </ng-template>
171 * </nb-tab>
172 * </nb-tabset>
173 * ```
174 *
175 * You can provide a template as a tab title via `<ng-template nbTabTitle>`:
176 * @stacked-example(Tab title template, tabset/tabset-template-title.component)
177 *
178 * @styles
179 *
180 * tabset-background-color:
181 * tabset-border-radius:
182 * tabset-shadow:
183 * tabset-tab-background-color:
184 * tabset-tab-padding:
185 * tabset-tab-text-color:
186 * tabset-tab-text-font-family:
187 * tabset-tab-text-font-size:
188 * tabset-tab-text-font-weight:
189 * tabset-tab-text-line-height:
190 * tabset-tab-text-transform:
191 * tabset-tab-underline-width:
192 * tabset-tab-underline-color:
193 * tabset-tab-active-background-color:
194 * tabset-tab-active-text-color:
195 * tabset-tab-active-underline-color:
196 * tabset-tab-focus-background-color:
197 * tabset-tab-focus-text-color:
198 * tabset-tab-focus-underline-color:
199 * tabset-tab-hover-background-color:
200 * tabset-tab-hover-text-color:
201 * tabset-tab-hover-underline-color:
202 * tabset-tab-disabled-background-color:
203 * tabset-tab-disabled-text-color:
204 * tabset-tab-disabled-underline-color:
205 * tabset-divider-color:
206 * tabset-divider-style:
207 * tabset-divider-width:
208 * tabset-content-background-color:
209 * tabset-content-padding:
210 * tabset-content-text-color:
211 * tabset-content-text-font-family:
212 * tabset-content-text-font-size:
213 * tabset-content-text-font-weight:
214 * tabset-content-text-line-height:
215 * tabset-scrollbar-color:
216 * tabset-scrollbar-background-color:
217 * tabset-scrollbar-width:
218 */
219export declare class NbTabsetComponent implements AfterContentInit, OnDestroy {
220 private route;
221 private changeDetectorRef;
222 tabs: QueryList<NbTabComponent>;
223 fullWidthValue: boolean;
224 /**
225 * Take full width of a parent
226 * @param {boolean} val
227 */
228 set fullWidth(val: boolean);
229 static ngAcceptInputType_fullWidth: NbBooleanInput;
230 /**
231 * If specified - tabset listens to this parameter and selects corresponding tab.
232 * @type {string}
233 */
234 routeParam: string;
235 /**
236 * Emits when tab is selected
237 * @type EventEmitter<any>
238 */
239 changeTab: EventEmitter<any>;
240 private destroy$;
241 constructor(route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef);
242 ngAfterContentInit(): void;
243 ngOnDestroy(): void;
244 selectTab(selectedTab: NbTabComponent): void;
245 static ɵfac: i0.ɵɵFactoryDeclaration<NbTabsetComponent, never>;
246 static ɵcmp: i0.ɵɵComponentDeclaration<NbTabsetComponent, "nb-tabset", never, { "fullWidth": { "alias": "fullWidth"; "required": false; }; "routeParam": { "alias": "routeParam"; "required": false; }; }, { "changeTab": "changeTab"; }, ["tabs"], ["nb-tab"], false, never>;
247}