@rossigee/clarity-angular 18.2.1-fixed.1 → 18.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/clr-angular-accordion.mjs +355 -0
- package/fesm2022/clr-angular-accordion.mjs.map +1 -0
- package/fesm2022/clr-angular-button.mjs +713 -0
- package/fesm2022/clr-angular-button.mjs.map +1 -0
- package/fesm2022/clr-angular-collapsible-panel.mjs +201 -0
- package/fesm2022/clr-angular-collapsible-panel.mjs.map +1 -0
- package/fesm2022/clr-angular-data-datagrid.mjs +7635 -0
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -0
- package/fesm2022/clr-angular-data-stack-view.mjs +442 -0
- package/fesm2022/clr-angular-data-stack-view.mjs.map +1 -0
- package/fesm2022/clr-angular-data-tree-view.mjs +1106 -0
- package/fesm2022/clr-angular-data-tree-view.mjs.map +1 -0
- package/fesm2022/clr-angular-data.mjs +40 -0
- package/fesm2022/clr-angular-data.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-alert.mjs +624 -0
- package/fesm2022/clr-angular-emphasis-alert.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-badge.mjs +69 -0
- package/fesm2022/clr-angular-emphasis-badge.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-common.mjs +25 -0
- package/fesm2022/clr-angular-emphasis-common.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-label.mjs +105 -0
- package/fesm2022/clr-angular-emphasis-label.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis.mjs +41 -0
- package/fesm2022/clr-angular-emphasis.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-checkbox.mjs +270 -0
- package/fesm2022/clr-angular-forms-checkbox.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-combobox.mjs +1775 -0
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-common.mjs +1251 -0
- package/fesm2022/clr-angular-forms-common.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-datalist.mjs +263 -0
- package/fesm2022/clr-angular-forms-datalist.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-datepicker.mjs +3274 -0
- package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-file-input.mjs +826 -0
- package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-input.mjs +153 -0
- package/fesm2022/clr-angular-forms-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-number-input.mjs +236 -0
- package/fesm2022/clr-angular-forms-number-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-password.mjs +233 -0
- package/fesm2022/clr-angular-forms-password.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-radio.mjs +231 -0
- package/fesm2022/clr-angular-forms-radio.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-range.mjs +186 -0
- package/fesm2022/clr-angular-forms-range.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-select.mjs +153 -0
- package/fesm2022/clr-angular-forms-select.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-textarea.mjs +136 -0
- package/fesm2022/clr-angular-forms-textarea.mjs.map +1 -0
- package/fesm2022/clr-angular-forms.mjs +100 -0
- package/fesm2022/clr-angular-forms.mjs.map +1 -0
- package/fesm2022/clr-angular-icon.mjs +7397 -0
- package/fesm2022/clr-angular-icon.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-breadcrumbs.mjs +120 -0
- package/fesm2022/clr-angular-layout-breadcrumbs.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-main-container.mjs +100 -0
- package/fesm2022/clr-angular-layout-main-container.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-nav.mjs +582 -0
- package/fesm2022/clr-angular-layout-nav.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-tabs.mjs +807 -0
- package/fesm2022/clr-angular-layout-tabs.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-vertical-nav.mjs +507 -0
- package/fesm2022/clr-angular-layout-vertical-nav.mjs.map +1 -0
- package/fesm2022/clr-angular-layout.mjs +44 -0
- package/fesm2022/clr-angular-layout.mjs.map +1 -0
- package/fesm2022/clr-angular-modal.mjs +617 -0
- package/fesm2022/clr-angular-modal.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-common.mjs +1082 -0
- package/fesm2022/clr-angular-popover-common.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-dropdown.mjs +492 -0
- package/fesm2022/clr-angular-popover-dropdown.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-signpost.mjs +494 -0
- package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-tooltip.mjs +293 -0
- package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -0
- package/fesm2022/clr-angular-popover.mjs +41 -0
- package/fesm2022/clr-angular-popover.mjs.map +1 -0
- package/fesm2022/clr-angular-progress-progress-bars.mjs +217 -0
- package/fesm2022/clr-angular-progress-progress-bars.mjs.map +1 -0
- package/fesm2022/clr-angular-progress-spinner.mjs +132 -0
- package/fesm2022/clr-angular-progress-spinner.mjs.map +1 -0
- package/fesm2022/clr-angular-stepper.mjs +694 -0
- package/fesm2022/clr-angular-stepper.mjs.map +1 -0
- package/fesm2022/clr-angular-timeline.mjs +316 -0
- package/fesm2022/clr-angular-timeline.mjs.map +1 -0
- package/fesm2022/clr-angular-utils-conditional.mjs +351 -0
- package/fesm2022/clr-angular-utils-conditional.mjs.map +1 -0
- package/fesm2022/clr-angular-utils-loading.mjs +107 -0
- package/fesm2022/clr-angular-utils-loading.mjs.map +1 -0
- package/fesm2022/clr-angular-utils.mjs +2079 -0
- package/fesm2022/clr-angular-utils.mjs.map +1 -0
- package/fesm2022/clr-angular-wizard.mjs +3074 -0
- package/fesm2022/clr-angular-wizard.mjs.map +1 -0
- package/fesm2022/clr-angular.mjs +2 -2
- package/fesm2022/clr-angular.mjs.map +1 -1
- package/package.json +7 -5
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +69 -0
- package/schematics/ng-update/index.js.map +1 -0
- package/schematics/ng-update/migrations/css-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/css-migration.js +177 -0
- package/schematics/ng-update/migrations/css-migration.js.map +1 -0
- package/schematics/ng-update/migrations/import-migration.d.ts +4 -0
- package/schematics/ng-update/migrations/import-migration.js +187 -0
- package/schematics/ng-update/migrations/import-migration.js.map +1 -0
- package/schematics/ng-update/migrations/template-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/template-migration.js +261 -0
- package/schematics/ng-update/migrations/template-migration.js.map +1 -0
- package/schematics/ng-update/replacements/css-replacements.d.ts +17 -0
- package/schematics/ng-update/replacements/css-replacements.js +74 -0
- package/schematics/ng-update/replacements/css-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/import-replacements.d.ts +13 -0
- package/schematics/ng-update/replacements/import-replacements.js +108 -0
- package/schematics/ng-update/replacements/import-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/symbol-replacements.d.ts +12 -0
- package/schematics/ng-update/replacements/symbol-replacements.js +67 -0
- package/schematics/ng-update/replacements/symbol-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/template-replacements.d.ts +19 -0
- package/schematics/ng-update/replacements/template-replacements.js +57 -0
- package/schematics/ng-update/replacements/template-replacements.js.map +1 -0
- package/schematics/ng-update/tests/test-helpers.d.ts +6 -0
- package/schematics/ng-update/tests/test-helpers.js +34 -0
- package/schematics/ng-update/tests/test-helpers.js.map +1 -0
- package/schematics/ng-update/utils/file-visitor.d.ts +8 -0
- package/schematics/ng-update/utils/file-visitor.js +44 -0
- package/schematics/ng-update/utils/file-visitor.js.map +1 -0
- package/schematics/ng-update/utils/regexp-utils.d.ts +16 -0
- package/schematics/ng-update/utils/regexp-utils.js +34 -0
- package/schematics/ng-update/utils/regexp-utils.js.map +1 -0
- package/schematics/vitest.config.d.ts +2 -0
- package/schematics/vitest.config.js +17 -0
- package/schematics/vitest.config.js.map +1 -0
- package/types/clr-angular-accordion.d.ts +100 -0
- package/types/clr-angular-button.d.ts +169 -0
- package/types/clr-angular-collapsible-panel.d.ts +73 -0
- package/types/clr-angular-data-datagrid.d.ts +1843 -0
- package/types/clr-angular-data-stack-view.d.ts +87 -0
- package/types/clr-angular-data-tree-view.d.ts +229 -0
- package/types/clr-angular-data.d.ts +15 -0
- package/types/clr-angular-emphasis-alert.d.ts +175 -0
- package/types/clr-angular-emphasis-badge.d.ts +25 -0
- package/types/clr-angular-emphasis-common.d.ts +6 -0
- package/types/clr-angular-emphasis-label.d.ts +29 -0
- package/types/clr-angular-emphasis.d.ts +15 -0
- package/types/clr-angular-forms-checkbox.d.ts +69 -0
- package/types/clr-angular-forms-combobox.d.ts +353 -0
- package/types/clr-angular-forms-common.d.ts +339 -0
- package/types/clr-angular-forms-datalist.d.ts +59 -0
- package/types/clr-angular-forms-datepicker.d.ts +986 -0
- package/types/clr-angular-forms-file-input.d.ts +193 -0
- package/types/clr-angular-forms-input.d.ts +29 -0
- package/types/clr-angular-forms-number-input.d.ts +43 -0
- package/types/clr-angular-forms-password.d.ts +52 -0
- package/types/clr-angular-forms-radio.d.ts +50 -0
- package/types/clr-angular-forms-range.d.ts +37 -0
- package/types/clr-angular-forms-select.d.ts +36 -0
- package/types/clr-angular-forms-textarea.d.ts +29 -0
- package/types/clr-angular-forms.d.ts +36 -0
- package/types/clr-angular-icon.d.ts +1498 -0
- package/types/clr-angular-layout-breadcrumbs.d.ts +45 -0
- package/types/clr-angular-layout-main-container.d.ts +28 -0
- package/types/clr-angular-layout-nav.d.ts +142 -0
- package/types/clr-angular-layout-tabs.d.ts +158 -0
- package/types/clr-angular-layout-vertical-nav.d.ts +128 -0
- package/types/clr-angular-layout.d.ts +19 -0
- package/types/clr-angular-modal.d.ts +160 -0
- package/types/clr-angular-popover-common.d.ts +254 -0
- package/types/clr-angular-popover-dropdown.d.ts +123 -0
- package/types/clr-angular-popover-signpost.d.ts +157 -0
- package/types/clr-angular-popover-tooltip.d.ts +83 -0
- package/types/clr-angular-popover.d.ts +16 -0
- package/types/clr-angular-progress-progress-bars.d.ts +57 -0
- package/types/clr-angular-progress-spinner.d.ts +44 -0
- package/types/clr-angular-stepper.d.ts +179 -0
- package/types/clr-angular-timeline.d.ts +86 -0
- package/types/clr-angular-utils-conditional.d.ts +132 -0
- package/types/clr-angular-utils-loading.d.ts +38 -0
- package/types/clr-angular-utils.d.ts +913 -0
- package/types/clr-angular-wizard.d.ts +1508 -0
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, ViewChild, Input, Inject, Component, InjectionToken, HostListener, HostBinding, Directive, ContentChild, ElementRef, ViewContainerRef, ContentChildren, Optional, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@clr/angular/popover/common';
|
|
4
|
+
import { ClrPopoverHostDirective } from '@clr/angular/popover/common';
|
|
5
|
+
import * as i1 from '@clr/angular/utils';
|
|
6
|
+
import { IF_ACTIVE_ID, TemplateRefContainer, IF_ACTIVE_ID_PROVIDER, ClrKeyFocus, IfActiveService, WillyWonka, OompaLoompa, ClrConditionalModule, ClrTemplateRefModule, ClrKeyFocusModule } from '@clr/angular/utils';
|
|
7
|
+
import { startWith } from 'rxjs/operators';
|
|
8
|
+
import * as i4 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
import * as i5 from '@clr/angular/icon';
|
|
11
|
+
import { ClarityIcons, ellipsisHorizontalIcon, ClrIcon } from '@clr/angular/icon';
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
15
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
16
|
+
* This software is released under MIT license.
|
|
17
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
18
|
+
*/
|
|
19
|
+
var TabsLayout;
|
|
20
|
+
(function (TabsLayout) {
|
|
21
|
+
TabsLayout["HORIZONTAL"] = "horizontal";
|
|
22
|
+
TabsLayout["VERTICAL"] = "vertical";
|
|
23
|
+
})(TabsLayout || (TabsLayout = {}));
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
27
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
28
|
+
* This software is released under MIT license.
|
|
29
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
30
|
+
*/
|
|
31
|
+
class TabsService {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.layout = TabsLayout.HORIZONTAL;
|
|
34
|
+
this._children = [];
|
|
35
|
+
}
|
|
36
|
+
get children() {
|
|
37
|
+
return this._children;
|
|
38
|
+
}
|
|
39
|
+
get activeTab() {
|
|
40
|
+
return this.children.find((tab) => {
|
|
41
|
+
return tab.active;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get overflowTabs() {
|
|
45
|
+
if (this.layout === TabsLayout.VERTICAL) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return this.children.filter((tab) => tab.tabLink.inOverflow === true);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
register(tab) {
|
|
53
|
+
this._children.push(tab);
|
|
54
|
+
}
|
|
55
|
+
unregister(tab) {
|
|
56
|
+
const index = this.children.indexOf(tab);
|
|
57
|
+
if (index > -1) {
|
|
58
|
+
this.children.splice(index, 1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TabsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
62
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TabsService }); }
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TabsService, decorators: [{
|
|
65
|
+
type: Injectable
|
|
66
|
+
}] });
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
70
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
71
|
+
* This software is released under MIT license.
|
|
72
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
73
|
+
*/
|
|
74
|
+
let nbTabContentComponents = 0;
|
|
75
|
+
class ClrTabContent {
|
|
76
|
+
constructor(ifActiveService, id, tabsService) {
|
|
77
|
+
this.ifActiveService = ifActiveService;
|
|
78
|
+
this.id = id;
|
|
79
|
+
this.tabsService = tabsService;
|
|
80
|
+
if (!this.tabContentId) {
|
|
81
|
+
this.tabContentId = 'clr-tab-content-' + nbTabContentComponents++;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
get active() {
|
|
85
|
+
return this.ifActiveService.current === this.id;
|
|
86
|
+
}
|
|
87
|
+
get ariaLabelledBy() {
|
|
88
|
+
return this.tabsService.children.find(tab => tab.tabLink.id === this.id)?.tabLink?.tabLinkId;
|
|
89
|
+
}
|
|
90
|
+
// The template must be applied on the top-down phase of view-child initialization to prevent
|
|
91
|
+
// components in the content from initializing before a content container exists.
|
|
92
|
+
// Some child components need their container for sizing calculations.
|
|
93
|
+
set templateRef(value) {
|
|
94
|
+
this.viewRef = this.tabsService.tabContentViewContainer.createEmbeddedView(value);
|
|
95
|
+
}
|
|
96
|
+
ngOnDestroy() {
|
|
97
|
+
const index = this.tabsService.tabContentViewContainer.indexOf(this.viewRef);
|
|
98
|
+
if (index > -1) {
|
|
99
|
+
this.tabsService.tabContentViewContainer.remove(index);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabContent, deps: [{ token: i1.IfActiveService }, { token: IF_ACTIVE_ID }, { token: TabsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
103
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrTabContent, isStandalone: false, selector: "clr-tab-content", inputs: { tabContentId: ["id", "tabContentId"] }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["tabContentProjectedRef"], descendants: true, static: true }], ngImport: i0, template: `
|
|
104
|
+
<ng-template #tabContentProjectedRef>
|
|
105
|
+
<section
|
|
106
|
+
[id]="tabContentId"
|
|
107
|
+
role="tabpanel"
|
|
108
|
+
class="tab-content"
|
|
109
|
+
[class.active]="active"
|
|
110
|
+
[hidden]="!active"
|
|
111
|
+
[attr.aria-labelledby]="ariaLabelledBy"
|
|
112
|
+
[attr.aria-hidden]="!active"
|
|
113
|
+
>
|
|
114
|
+
<ng-content></ng-content>
|
|
115
|
+
</section>
|
|
116
|
+
</ng-template>
|
|
117
|
+
`, isInline: true }); }
|
|
118
|
+
}
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabContent, decorators: [{
|
|
120
|
+
type: Component,
|
|
121
|
+
args: [{
|
|
122
|
+
selector: 'clr-tab-content',
|
|
123
|
+
template: `
|
|
124
|
+
<ng-template #tabContentProjectedRef>
|
|
125
|
+
<section
|
|
126
|
+
[id]="tabContentId"
|
|
127
|
+
role="tabpanel"
|
|
128
|
+
class="tab-content"
|
|
129
|
+
[class.active]="active"
|
|
130
|
+
[hidden]="!active"
|
|
131
|
+
[attr.aria-labelledby]="ariaLabelledBy"
|
|
132
|
+
[attr.aria-hidden]="!active"
|
|
133
|
+
>
|
|
134
|
+
<ng-content></ng-content>
|
|
135
|
+
</section>
|
|
136
|
+
</ng-template>
|
|
137
|
+
`,
|
|
138
|
+
standalone: false,
|
|
139
|
+
}]
|
|
140
|
+
}], ctorParameters: () => [{ type: i1.IfActiveService }, { type: undefined, decorators: [{
|
|
141
|
+
type: Inject,
|
|
142
|
+
args: [IF_ACTIVE_ID]
|
|
143
|
+
}] }, { type: TabsService }], propDecorators: { tabContentId: [{
|
|
144
|
+
type: Input,
|
|
145
|
+
args: ['id']
|
|
146
|
+
}], templateRef: [{
|
|
147
|
+
type: ViewChild,
|
|
148
|
+
args: ['tabContentProjectedRef', { static: true }]
|
|
149
|
+
}] } });
|
|
150
|
+
|
|
151
|
+
/*
|
|
152
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
153
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
154
|
+
* This software is released under MIT license.
|
|
155
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
156
|
+
*/
|
|
157
|
+
let nbTabsComponent = 0;
|
|
158
|
+
const TABS_ID = new InjectionToken('TABS_ID');
|
|
159
|
+
function tokenFactory() {
|
|
160
|
+
return 'clr-tabs-' + nbTabsComponent++;
|
|
161
|
+
}
|
|
162
|
+
const TABS_ID_PROVIDER = {
|
|
163
|
+
provide: TABS_ID,
|
|
164
|
+
useFactory: tokenFactory,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
169
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
170
|
+
* This software is released under MIT license.
|
|
171
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
172
|
+
*/
|
|
173
|
+
let nbTabLinkComponents = 0;
|
|
174
|
+
class ClrTabLink {
|
|
175
|
+
constructor(ifActiveService, id, el, viewContainerRef, tabsService, tabsId) {
|
|
176
|
+
this.ifActiveService = ifActiveService;
|
|
177
|
+
this.id = id;
|
|
178
|
+
this.el = el;
|
|
179
|
+
this.tabsService = tabsService;
|
|
180
|
+
this.tabsId = tabsId;
|
|
181
|
+
if (!this.tabLinkId) {
|
|
182
|
+
this.tabLinkId = 'clr-tab-link-' + nbTabLinkComponents++;
|
|
183
|
+
}
|
|
184
|
+
// Tab links can be rendered in one of two places: in the main area or inside the overflow dropdown menu.
|
|
185
|
+
// Here, we create a container so that its template can be used to create embeddedView on the fly.
|
|
186
|
+
// See TabsService's renderView() method and how it's used in Tabs class for an example.
|
|
187
|
+
this.templateRefContainer = viewContainerRef.createComponent(TemplateRefContainer, {
|
|
188
|
+
projectableNodes: [[el.nativeElement]],
|
|
189
|
+
}).instance;
|
|
190
|
+
}
|
|
191
|
+
get inOverflow() {
|
|
192
|
+
return this._inOverflow && this.tabsService.layout !== TabsLayout.VERTICAL;
|
|
193
|
+
}
|
|
194
|
+
set inOverflow(inOverflow) {
|
|
195
|
+
this._inOverflow = inOverflow;
|
|
196
|
+
}
|
|
197
|
+
get addLinkClasses() {
|
|
198
|
+
return !this.inOverflow;
|
|
199
|
+
}
|
|
200
|
+
get ariaControls() {
|
|
201
|
+
return this.tabsService.children.find(tab => tab.tabLink === this)?.tabContent?.tabContentId;
|
|
202
|
+
}
|
|
203
|
+
get active() {
|
|
204
|
+
return this.ifActiveService.current === this.id;
|
|
205
|
+
}
|
|
206
|
+
get tabindex() {
|
|
207
|
+
return this.active ? 0 : -1;
|
|
208
|
+
}
|
|
209
|
+
activate() {
|
|
210
|
+
this.ifActiveService.current = this.id;
|
|
211
|
+
}
|
|
212
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabLink, deps: [{ token: i1.IfActiveService }, { token: IF_ACTIVE_ID }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: TabsService }, { token: TABS_ID }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
213
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrTabLink, isStandalone: false, selector: "[clrTabLink]", inputs: { tabLinkId: ["id", "tabLinkId"], inOverflow: ["clrTabLinkInOverflow", "inOverflow"] }, host: { attributes: { "role": "tab", "type": "button" }, listeners: { "click": "activate()" }, properties: { "class.btn": "true", "id": "this.tabLinkId", "class.btn-link": "this.addLinkClasses", "class.nav-link": "this.addLinkClasses", "attr.aria-controls": "this.ariaControls", "class.active": "this.active", "attr.aria-selected": "this.active", "attr.tabindex": "this.tabindex" } }, ngImport: i0 }); }
|
|
214
|
+
}
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabLink, decorators: [{
|
|
216
|
+
type: Directive,
|
|
217
|
+
args: [{
|
|
218
|
+
selector: '[clrTabLink]',
|
|
219
|
+
host: {
|
|
220
|
+
'[class.btn]': 'true',
|
|
221
|
+
role: 'tab',
|
|
222
|
+
type: 'button',
|
|
223
|
+
},
|
|
224
|
+
standalone: false,
|
|
225
|
+
}]
|
|
226
|
+
}], ctorParameters: () => [{ type: i1.IfActiveService }, { type: undefined, decorators: [{
|
|
227
|
+
type: Inject,
|
|
228
|
+
args: [IF_ACTIVE_ID]
|
|
229
|
+
}] }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: TabsService }, { type: undefined, decorators: [{
|
|
230
|
+
type: Inject,
|
|
231
|
+
args: [TABS_ID]
|
|
232
|
+
}] }], propDecorators: { tabLinkId: [{
|
|
233
|
+
type: Input,
|
|
234
|
+
args: ['id']
|
|
235
|
+
}, {
|
|
236
|
+
type: HostBinding,
|
|
237
|
+
args: ['id']
|
|
238
|
+
}], inOverflow: [{
|
|
239
|
+
type: Input,
|
|
240
|
+
args: ['clrTabLinkInOverflow']
|
|
241
|
+
}], addLinkClasses: [{
|
|
242
|
+
type: HostBinding,
|
|
243
|
+
args: ['class.btn-link']
|
|
244
|
+
}, {
|
|
245
|
+
type: HostBinding,
|
|
246
|
+
args: ['class.nav-link']
|
|
247
|
+
}], ariaControls: [{
|
|
248
|
+
type: HostBinding,
|
|
249
|
+
args: ['attr.aria-controls']
|
|
250
|
+
}], active: [{
|
|
251
|
+
type: HostBinding,
|
|
252
|
+
args: ['class.active']
|
|
253
|
+
}, {
|
|
254
|
+
type: HostBinding,
|
|
255
|
+
args: ['attr.aria-selected']
|
|
256
|
+
}], tabindex: [{
|
|
257
|
+
type: HostBinding,
|
|
258
|
+
args: ['attr.tabindex']
|
|
259
|
+
}], activate: [{
|
|
260
|
+
type: HostListener,
|
|
261
|
+
args: ['click']
|
|
262
|
+
}] } });
|
|
263
|
+
|
|
264
|
+
/*
|
|
265
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
266
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
267
|
+
* This software is released under MIT license.
|
|
268
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
269
|
+
*/
|
|
270
|
+
class ClrTab {
|
|
271
|
+
constructor(ifActiveService, id, tabsService) {
|
|
272
|
+
this.ifActiveService = ifActiveService;
|
|
273
|
+
this.id = id;
|
|
274
|
+
this.tabsService = tabsService;
|
|
275
|
+
tabsService.register(this);
|
|
276
|
+
}
|
|
277
|
+
get active() {
|
|
278
|
+
return this.ifActiveService.current === this.id;
|
|
279
|
+
}
|
|
280
|
+
ngOnDestroy() {
|
|
281
|
+
this.tabsService.unregister(this);
|
|
282
|
+
}
|
|
283
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTab, deps: [{ token: i1.IfActiveService }, { token: IF_ACTIVE_ID }, { token: TabsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
284
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrTab, isStandalone: false, selector: "clr-tab", providers: [IF_ACTIVE_ID_PROVIDER], queries: [{ propertyName: "tabLink", first: true, predicate: ClrTabLink, descendants: true, static: true }, { propertyName: "tabContent", first: true, predicate: ClrTabContent, descendants: true, static: true }], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
285
|
+
}
|
|
286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTab, decorators: [{
|
|
287
|
+
type: Component,
|
|
288
|
+
args: [{
|
|
289
|
+
selector: 'clr-tab',
|
|
290
|
+
template: `<ng-content></ng-content>`,
|
|
291
|
+
providers: [IF_ACTIVE_ID_PROVIDER],
|
|
292
|
+
standalone: false,
|
|
293
|
+
}]
|
|
294
|
+
}], ctorParameters: () => [{ type: i1.IfActiveService }, { type: undefined, decorators: [{
|
|
295
|
+
type: Inject,
|
|
296
|
+
args: [IF_ACTIVE_ID]
|
|
297
|
+
}] }, { type: TabsService }], propDecorators: { tabLink: [{
|
|
298
|
+
type: ContentChild,
|
|
299
|
+
args: [ClrTabLink, { static: true }]
|
|
300
|
+
}], tabContent: [{
|
|
301
|
+
type: ContentChild,
|
|
302
|
+
args: [ClrTabContent, { static: true }]
|
|
303
|
+
}] } });
|
|
304
|
+
|
|
305
|
+
/*
|
|
306
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
307
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
308
|
+
* This software is released under MIT license.
|
|
309
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
310
|
+
*/
|
|
311
|
+
class ClrTabAction {
|
|
312
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabAction, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
313
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrTabAction, isStandalone: false, selector: "[clrTabAction]", host: { attributes: { "tabindex": "0" } }, ngImport: i0 }); }
|
|
314
|
+
}
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabAction, decorators: [{
|
|
316
|
+
type: Directive,
|
|
317
|
+
args: [{
|
|
318
|
+
selector: '[clrTabAction]',
|
|
319
|
+
host: {
|
|
320
|
+
tabindex: '0',
|
|
321
|
+
},
|
|
322
|
+
standalone: false,
|
|
323
|
+
}]
|
|
324
|
+
}] });
|
|
325
|
+
|
|
326
|
+
/*
|
|
327
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
328
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
329
|
+
* This software is released under MIT license.
|
|
330
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
331
|
+
*/
|
|
332
|
+
class ClrTabOverflowContent {
|
|
333
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabOverflowContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
334
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrTabOverflowContent, isStandalone: false, selector: "clr-tab-overflow-content", host: { properties: { "class.dropdown-menu": "true" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
|
|
335
|
+
}
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabOverflowContent, decorators: [{
|
|
337
|
+
type: Component,
|
|
338
|
+
args: [{
|
|
339
|
+
selector: 'clr-tab-overflow-content',
|
|
340
|
+
template: `<ng-content></ng-content>`,
|
|
341
|
+
host: {
|
|
342
|
+
'[class.dropdown-menu]': 'true',
|
|
343
|
+
},
|
|
344
|
+
standalone: false,
|
|
345
|
+
}]
|
|
346
|
+
}] });
|
|
347
|
+
|
|
348
|
+
/*
|
|
349
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
350
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
351
|
+
* This software is released under MIT license.
|
|
352
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
353
|
+
*/
|
|
354
|
+
class ClrTabs {
|
|
355
|
+
constructor(ifActiveService, popoverService, tabsService, tabsId, commonStrings) {
|
|
356
|
+
this.ifActiveService = ifActiveService;
|
|
357
|
+
this.popoverService = popoverService;
|
|
358
|
+
this.tabsService = tabsService;
|
|
359
|
+
this.tabsId = tabsId;
|
|
360
|
+
this.commonStrings = commonStrings;
|
|
361
|
+
this.tabLinkElements = [];
|
|
362
|
+
// in order to check focus is triggered by click
|
|
363
|
+
// we are using this _mousedown flag
|
|
364
|
+
this._mousedown = false;
|
|
365
|
+
this.subscriptions = [];
|
|
366
|
+
this._tabLinkDirectives = [];
|
|
367
|
+
}
|
|
368
|
+
get layout() {
|
|
369
|
+
return this.tabsService.layout;
|
|
370
|
+
}
|
|
371
|
+
set layout(layout) {
|
|
372
|
+
if (Object.keys(TabsLayout)
|
|
373
|
+
.map(key => {
|
|
374
|
+
return TabsLayout[key];
|
|
375
|
+
})
|
|
376
|
+
.indexOf(layout) >= 0) {
|
|
377
|
+
this.tabsService.layout = layout;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
get tabLinkDirectives() {
|
|
381
|
+
return this._tabLinkDirectives;
|
|
382
|
+
}
|
|
383
|
+
get activeTabInOverflow() {
|
|
384
|
+
return this.tabsService.overflowTabs.indexOf(this.tabsService.activeTab) > -1;
|
|
385
|
+
}
|
|
386
|
+
get activeTabPosition() {
|
|
387
|
+
return this._tabLinkDirectives.findIndex(link => link.active);
|
|
388
|
+
}
|
|
389
|
+
get isCurrentInOverflow() {
|
|
390
|
+
return this.keyFocus.current >= this.overflowPosition;
|
|
391
|
+
}
|
|
392
|
+
get isVertical() {
|
|
393
|
+
return this.layout === TabsLayout.VERTICAL;
|
|
394
|
+
}
|
|
395
|
+
set tabOverflowEl(value) {
|
|
396
|
+
this._tabOverflowEl = value && value.nativeElement;
|
|
397
|
+
if (this.popoverService.open && value) {
|
|
398
|
+
// only when tab overflow view element is registered,
|
|
399
|
+
// we need to move the focus to the first item
|
|
400
|
+
this.keyFocus.focusCurrent();
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
get overflowPosition() {
|
|
404
|
+
return this._tabLinkDirectives.filter(link => !link.inOverflow).length;
|
|
405
|
+
}
|
|
406
|
+
set tabContentViewContainer(value) {
|
|
407
|
+
this.tabsService.tabContentViewContainer = value;
|
|
408
|
+
}
|
|
409
|
+
ngAfterContentInit() {
|
|
410
|
+
this.subscriptions.push(this.listenForTabLinkChanges());
|
|
411
|
+
this.subscriptions.push(this.listedForTabsActionsChanges());
|
|
412
|
+
if (typeof this.ifActiveService.current === 'undefined' && this.tabLinkDirectives[0]) {
|
|
413
|
+
this.tabLinkDirectives[0].activate();
|
|
414
|
+
}
|
|
415
|
+
// set initial current position
|
|
416
|
+
this.keyFocus.current = this.activeTabPosition;
|
|
417
|
+
}
|
|
418
|
+
ngOnDestroy() {
|
|
419
|
+
this.subscriptions.forEach(sub => {
|
|
420
|
+
sub.unsubscribe();
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
toggleOverflowOnPosition(position) {
|
|
424
|
+
// we need to check current position to determine
|
|
425
|
+
// whether we need to open the tab overflow or not
|
|
426
|
+
this.popoverService.open = position >= this.overflowPosition;
|
|
427
|
+
}
|
|
428
|
+
resetKeyFocusCurrentToActive(event) {
|
|
429
|
+
const keyFocusContainsFocus = this.keyFocus.nativeElement.contains(event.relatedTarget);
|
|
430
|
+
if (!keyFocusContainsFocus && this.keyFocus.current !== this.activeTabPosition) {
|
|
431
|
+
this.keyFocus.current = this.activeTabPosition;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
toggleOverflowOnClick() {
|
|
435
|
+
if (this.isCurrentInOverflow && this.popoverService.open) {
|
|
436
|
+
this.keyFocus.moveTo(this.overflowPosition - 1);
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
this.keyFocus.moveTo(this.overflowPosition);
|
|
440
|
+
}
|
|
441
|
+
// once click handler completes running,
|
|
442
|
+
// reset the _mousedown flag
|
|
443
|
+
this._mousedown = false;
|
|
444
|
+
}
|
|
445
|
+
openOverflowOnFocus() {
|
|
446
|
+
// This method should be called only on keyboard generated focus
|
|
447
|
+
// when the active tab is in the overflow
|
|
448
|
+
if (!this._mousedown && !this.popoverService.open) {
|
|
449
|
+
this.keyFocus.moveTo(this.activeTabPosition);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
closeOnFocusOut(event) {
|
|
453
|
+
if (!this._tabOverflowEl.contains(event.relatedTarget) &&
|
|
454
|
+
this.popoverService.open &&
|
|
455
|
+
!this._mousedown) {
|
|
456
|
+
this.popoverService.open = false;
|
|
457
|
+
// if the focus is out of overflow and lands on the active tab link
|
|
458
|
+
// which is currently visible, set the key focus current to activeTabPosition
|
|
459
|
+
if (this.tabLinkElements[this.activeTabPosition] === event.relatedTarget) {
|
|
460
|
+
this.keyFocus.current = this.activeTabPosition;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
closeOnEscapeKey() {
|
|
465
|
+
// Move current to the last visible focusable item
|
|
466
|
+
this.keyFocus.moveTo(this.overflowPosition - 1);
|
|
467
|
+
}
|
|
468
|
+
closeOnOutsideClick(event, tabOverflowTrigger) {
|
|
469
|
+
// Exit early if the event target is the trigger element itself or element that's inside the trigger element.
|
|
470
|
+
// This is because we have another handler on the tabOverflowTrigger element itself.
|
|
471
|
+
// As this handler method is on the document level so the event bubbles up to it and conflicts
|
|
472
|
+
// with the tabOverflowTrigger handler resulting in opening the tab overflow and closing it right away consecutively.
|
|
473
|
+
const isTabsAction = this.tabsActions.some(action => action.nativeElement.contains(event.target));
|
|
474
|
+
if (event.target === tabOverflowTrigger ||
|
|
475
|
+
tabOverflowTrigger.contains(event.target) ||
|
|
476
|
+
isTabsAction) {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
// Move current to the last visible focusable item
|
|
480
|
+
if (!this._tabOverflowEl.contains(event.target) && this.isCurrentInOverflow) {
|
|
481
|
+
this.keyFocus.moveTo(this.overflowPosition - 1);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
setTabLinkElements() {
|
|
485
|
+
this._tabLinkDirectives = this.tabs.map(tab => tab.tabLink);
|
|
486
|
+
this.tabLinkElements = this._tabLinkDirectives.map(tab => tab.el.nativeElement);
|
|
487
|
+
if (this.tabsActions && this.tabsActions) {
|
|
488
|
+
this.tabLinkElements.push(...this.tabsActions.map(action => action.nativeElement));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
listenForTabLinkChanges() {
|
|
492
|
+
return this.tabs.changes
|
|
493
|
+
.pipe(startWith(this.tabs.map(tab => tab.tabLink)))
|
|
494
|
+
.subscribe(() => this.setTabLinkElements());
|
|
495
|
+
}
|
|
496
|
+
listedForTabsActionsChanges() {
|
|
497
|
+
return this.tabsActions.changes.subscribe(() => this.setTabLinkElements());
|
|
498
|
+
}
|
|
499
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabs, deps: [{ token: i1.IfActiveService }, { token: i2.ClrPopoverService }, { token: TabsService }, { token: TABS_ID }, { token: i1.ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
500
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrTabs, isStandalone: false, selector: "clr-tabs", inputs: { layout: ["clrLayout", "layout"] }, host: { properties: { "class.tabs-vertical": "this.isVertical" } }, providers: [IfActiveService, TabsService, TABS_ID_PROVIDER], queries: [{ propertyName: "tabsActions", predicate: ClrTabAction, descendants: true, read: ElementRef }, { propertyName: "tabs", predicate: ClrTab }], viewQueries: [{ propertyName: "keyFocus", first: true, predicate: ClrKeyFocus, descendants: true, static: true }, { propertyName: "tabOverflowEl", first: true, predicate: ClrTabOverflowContent, descendants: true, read: ElementRef }, { propertyName: "tabContentViewContainer", first: true, predicate: ["tabContentViewContainer"], descendants: true, read: ViewContainerRef, static: true }], hostDirectives: [{ directive: i2.ClrPopoverHostDirective }], ngImport: i0, template: `
|
|
501
|
+
<ul
|
|
502
|
+
class="nav"
|
|
503
|
+
role="tablist"
|
|
504
|
+
[clrKeyFocus]="tabLinkElements"
|
|
505
|
+
clrDirection="both"
|
|
506
|
+
(clrFocusChange)="toggleOverflowOnPosition($event)"
|
|
507
|
+
(focusout)="resetKeyFocusCurrentToActive($event)"
|
|
508
|
+
>
|
|
509
|
+
<!--tab links-->
|
|
510
|
+
@for (link of tabLinkDirectives; track link) {
|
|
511
|
+
@if (link.tabsId === tabsId && !link.inOverflow) {
|
|
512
|
+
<li role="presentation" class="nav-item">
|
|
513
|
+
<ng-container [ngTemplateOutlet]="link.templateRefContainer.template"></ng-container>
|
|
514
|
+
</li>
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
@if (tabsService.overflowTabs.length > 0) {
|
|
518
|
+
<div class="tabs-overflow bottom-right" role="presentation" [class.open]="popoverService.open">
|
|
519
|
+
<li role="application" class="nav-item">
|
|
520
|
+
<button
|
|
521
|
+
#tabOverflowTrigger
|
|
522
|
+
class="btn btn-link nav-link dropdown-toggle"
|
|
523
|
+
type="button"
|
|
524
|
+
aria-hidden="true"
|
|
525
|
+
[attr.tabindex]="activeTabInOverflow && !popoverService.open ? 0 : -1"
|
|
526
|
+
[class.active]="activeTabInOverflow"
|
|
527
|
+
[class.open]="popoverService.open"
|
|
528
|
+
(mousedown)="_mousedown = true"
|
|
529
|
+
(focus)="openOverflowOnFocus()"
|
|
530
|
+
(click)="toggleOverflowOnClick()"
|
|
531
|
+
[attr.title]="commonStrings.keys.more"
|
|
532
|
+
>
|
|
533
|
+
<cds-icon
|
|
534
|
+
shape="ellipsis-horizontal"
|
|
535
|
+
[status]="popoverService.open ? 'info' : null"
|
|
536
|
+
[attr.title]="commonStrings.keys.more"
|
|
537
|
+
></cds-icon>
|
|
538
|
+
</button>
|
|
539
|
+
</li>
|
|
540
|
+
<!--tab links in overflow menu-->
|
|
541
|
+
@if (popoverService.open) {
|
|
542
|
+
<clr-tab-overflow-content
|
|
543
|
+
(document:keydown.escape)="closeOnEscapeKey()"
|
|
544
|
+
(document:click)="closeOnOutsideClick($event, tabOverflowTrigger)"
|
|
545
|
+
(focusout)="closeOnFocusOut($event)"
|
|
546
|
+
>
|
|
547
|
+
@for (link of tabLinkDirectives; track link) {
|
|
548
|
+
@if (link.tabsId === tabsId && link.inOverflow) {
|
|
549
|
+
<ng-container [ngTemplateOutlet]="link.templateRefContainer.template"></ng-container>
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
</clr-tab-overflow-content>
|
|
553
|
+
}
|
|
554
|
+
</div>
|
|
555
|
+
}
|
|
556
|
+
<ng-content select="clr-tabs-actions"></ng-content>
|
|
557
|
+
</ul>
|
|
558
|
+
<ng-container #tabContentViewContainer></ng-container>
|
|
559
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: i1.ClrKeyFocus, selector: "[clrKeyFocus]", inputs: ["clrDirection", "clrFocusOnLoad", "clrKeyFocus"], outputs: ["clrFocusChange"] }, { kind: "component", type: ClrTabOverflowContent, selector: "clr-tab-overflow-content" }] }); }
|
|
560
|
+
}
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabs, decorators: [{
|
|
562
|
+
type: Component,
|
|
563
|
+
args: [{
|
|
564
|
+
selector: 'clr-tabs',
|
|
565
|
+
template: `
|
|
566
|
+
<ul
|
|
567
|
+
class="nav"
|
|
568
|
+
role="tablist"
|
|
569
|
+
[clrKeyFocus]="tabLinkElements"
|
|
570
|
+
clrDirection="both"
|
|
571
|
+
(clrFocusChange)="toggleOverflowOnPosition($event)"
|
|
572
|
+
(focusout)="resetKeyFocusCurrentToActive($event)"
|
|
573
|
+
>
|
|
574
|
+
<!--tab links-->
|
|
575
|
+
@for (link of tabLinkDirectives; track link) {
|
|
576
|
+
@if (link.tabsId === tabsId && !link.inOverflow) {
|
|
577
|
+
<li role="presentation" class="nav-item">
|
|
578
|
+
<ng-container [ngTemplateOutlet]="link.templateRefContainer.template"></ng-container>
|
|
579
|
+
</li>
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
@if (tabsService.overflowTabs.length > 0) {
|
|
583
|
+
<div class="tabs-overflow bottom-right" role="presentation" [class.open]="popoverService.open">
|
|
584
|
+
<li role="application" class="nav-item">
|
|
585
|
+
<button
|
|
586
|
+
#tabOverflowTrigger
|
|
587
|
+
class="btn btn-link nav-link dropdown-toggle"
|
|
588
|
+
type="button"
|
|
589
|
+
aria-hidden="true"
|
|
590
|
+
[attr.tabindex]="activeTabInOverflow && !popoverService.open ? 0 : -1"
|
|
591
|
+
[class.active]="activeTabInOverflow"
|
|
592
|
+
[class.open]="popoverService.open"
|
|
593
|
+
(mousedown)="_mousedown = true"
|
|
594
|
+
(focus)="openOverflowOnFocus()"
|
|
595
|
+
(click)="toggleOverflowOnClick()"
|
|
596
|
+
[attr.title]="commonStrings.keys.more"
|
|
597
|
+
>
|
|
598
|
+
<cds-icon
|
|
599
|
+
shape="ellipsis-horizontal"
|
|
600
|
+
[status]="popoverService.open ? 'info' : null"
|
|
601
|
+
[attr.title]="commonStrings.keys.more"
|
|
602
|
+
></cds-icon>
|
|
603
|
+
</button>
|
|
604
|
+
</li>
|
|
605
|
+
<!--tab links in overflow menu-->
|
|
606
|
+
@if (popoverService.open) {
|
|
607
|
+
<clr-tab-overflow-content
|
|
608
|
+
(document:keydown.escape)="closeOnEscapeKey()"
|
|
609
|
+
(document:click)="closeOnOutsideClick($event, tabOverflowTrigger)"
|
|
610
|
+
(focusout)="closeOnFocusOut($event)"
|
|
611
|
+
>
|
|
612
|
+
@for (link of tabLinkDirectives; track link) {
|
|
613
|
+
@if (link.tabsId === tabsId && link.inOverflow) {
|
|
614
|
+
<ng-container [ngTemplateOutlet]="link.templateRefContainer.template"></ng-container>
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
</clr-tab-overflow-content>
|
|
618
|
+
}
|
|
619
|
+
</div>
|
|
620
|
+
}
|
|
621
|
+
<ng-content select="clr-tabs-actions"></ng-content>
|
|
622
|
+
</ul>
|
|
623
|
+
<ng-container #tabContentViewContainer></ng-container>
|
|
624
|
+
`,
|
|
625
|
+
providers: [IfActiveService, TabsService, TABS_ID_PROVIDER],
|
|
626
|
+
hostDirectives: [ClrPopoverHostDirective],
|
|
627
|
+
standalone: false,
|
|
628
|
+
}]
|
|
629
|
+
}], ctorParameters: () => [{ type: i1.IfActiveService }, { type: i2.ClrPopoverService }, { type: TabsService }, { type: undefined, decorators: [{
|
|
630
|
+
type: Inject,
|
|
631
|
+
args: [TABS_ID]
|
|
632
|
+
}] }, { type: i1.ClrCommonStringsService }], propDecorators: { keyFocus: [{
|
|
633
|
+
type: ViewChild,
|
|
634
|
+
args: [ClrKeyFocus, { static: true }]
|
|
635
|
+
}], tabsActions: [{
|
|
636
|
+
type: ContentChildren,
|
|
637
|
+
args: [ClrTabAction, { read: ElementRef, descendants: true }]
|
|
638
|
+
}], tabs: [{
|
|
639
|
+
type: ContentChildren,
|
|
640
|
+
args: [ClrTab]
|
|
641
|
+
}], layout: [{
|
|
642
|
+
type: Input,
|
|
643
|
+
args: ['clrLayout']
|
|
644
|
+
}], isVertical: [{
|
|
645
|
+
type: HostBinding,
|
|
646
|
+
args: ['class.tabs-vertical']
|
|
647
|
+
}], tabOverflowEl: [{
|
|
648
|
+
type: ViewChild,
|
|
649
|
+
args: [ClrTabOverflowContent, { read: ElementRef }]
|
|
650
|
+
}], tabContentViewContainer: [{
|
|
651
|
+
type: ViewChild,
|
|
652
|
+
args: ['tabContentViewContainer', { static: true, read: ViewContainerRef }]
|
|
653
|
+
}] } });
|
|
654
|
+
|
|
655
|
+
/*
|
|
656
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
657
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
658
|
+
* This software is released under MIT license.
|
|
659
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
660
|
+
*/
|
|
661
|
+
class ClrTabsActions {
|
|
662
|
+
constructor() {
|
|
663
|
+
this.position = 'right';
|
|
664
|
+
}
|
|
665
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabsActions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
666
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrTabsActions, isStandalone: false, selector: "clr-tabs-actions", inputs: { position: "position" }, host: { properties: { "class.tabs-actions": "true", "attr.position": "this.position" } }, ngImport: i0, template: `
|
|
667
|
+
<div class="tabs-actions-wrapper">
|
|
668
|
+
<ng-content></ng-content>
|
|
669
|
+
</div>
|
|
670
|
+
`, isInline: true }); }
|
|
671
|
+
}
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabsActions, decorators: [{
|
|
673
|
+
type: Component,
|
|
674
|
+
args: [{
|
|
675
|
+
selector: 'clr-tabs-actions',
|
|
676
|
+
template: `
|
|
677
|
+
<div class="tabs-actions-wrapper">
|
|
678
|
+
<ng-content></ng-content>
|
|
679
|
+
</div>
|
|
680
|
+
`,
|
|
681
|
+
host: {
|
|
682
|
+
'[class.tabs-actions]': 'true',
|
|
683
|
+
},
|
|
684
|
+
standalone: false,
|
|
685
|
+
}]
|
|
686
|
+
}], propDecorators: { position: [{
|
|
687
|
+
type: Input
|
|
688
|
+
}, {
|
|
689
|
+
type: HostBinding,
|
|
690
|
+
args: ['attr.position']
|
|
691
|
+
}] } });
|
|
692
|
+
|
|
693
|
+
/*
|
|
694
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
695
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
696
|
+
* This software is released under MIT license.
|
|
697
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
698
|
+
*/
|
|
699
|
+
class TabsWillyWonka extends WillyWonka {
|
|
700
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TabsWillyWonka, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
701
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: TabsWillyWonka, isStandalone: false, selector: "clr-tabs", usesInheritance: true, ngImport: i0 }); }
|
|
702
|
+
}
|
|
703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TabsWillyWonka, decorators: [{
|
|
704
|
+
type: Directive,
|
|
705
|
+
args: [{
|
|
706
|
+
selector: 'clr-tabs',
|
|
707
|
+
standalone: false,
|
|
708
|
+
}]
|
|
709
|
+
}] });
|
|
710
|
+
|
|
711
|
+
/*
|
|
712
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
713
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
714
|
+
* This software is released under MIT license.
|
|
715
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
716
|
+
*/
|
|
717
|
+
class ActiveOompaLoompa extends OompaLoompa {
|
|
718
|
+
constructor(cdr, willyWonka, id, ifActive) {
|
|
719
|
+
if (!willyWonka) {
|
|
720
|
+
throw new Error('clrTabLink and clr-tab-content should only be used inside of a clr-tabs');
|
|
721
|
+
}
|
|
722
|
+
super(cdr, willyWonka);
|
|
723
|
+
this.ifActive = ifActive;
|
|
724
|
+
this.id = id;
|
|
725
|
+
}
|
|
726
|
+
get flavor() {
|
|
727
|
+
return this.ifActive.current === this.id;
|
|
728
|
+
}
|
|
729
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ActiveOompaLoompa, deps: [{ token: i0.ChangeDetectorRef }, { token: TabsWillyWonka, optional: true }, { token: IF_ACTIVE_ID }, { token: i1.IfActiveService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
730
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ActiveOompaLoompa, isStandalone: false, selector: "[clrTabLink], clr-tab-content", usesInheritance: true, ngImport: i0 }); }
|
|
731
|
+
}
|
|
732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ActiveOompaLoompa, decorators: [{
|
|
733
|
+
type: Directive,
|
|
734
|
+
args: [{
|
|
735
|
+
selector: '[clrTabLink], clr-tab-content',
|
|
736
|
+
standalone: false,
|
|
737
|
+
}]
|
|
738
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: TabsWillyWonka, decorators: [{
|
|
739
|
+
type: Optional
|
|
740
|
+
}] }, { type: undefined, decorators: [{
|
|
741
|
+
type: Inject,
|
|
742
|
+
args: [IF_ACTIVE_ID]
|
|
743
|
+
}] }, { type: i1.IfActiveService }] });
|
|
744
|
+
|
|
745
|
+
/*
|
|
746
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
747
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
748
|
+
* This software is released under MIT license.
|
|
749
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
750
|
+
*/
|
|
751
|
+
const CLR_TABS_DIRECTIVES = [
|
|
752
|
+
ClrTabContent,
|
|
753
|
+
ClrTab,
|
|
754
|
+
ClrTabs,
|
|
755
|
+
ClrTabOverflowContent,
|
|
756
|
+
ClrTabLink,
|
|
757
|
+
ClrTabAction,
|
|
758
|
+
ClrTabsActions,
|
|
759
|
+
TabsWillyWonka,
|
|
760
|
+
ActiveOompaLoompa,
|
|
761
|
+
];
|
|
762
|
+
class ClrTabsModule {
|
|
763
|
+
constructor() {
|
|
764
|
+
ClarityIcons.addIcons(ellipsisHorizontalIcon);
|
|
765
|
+
}
|
|
766
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
767
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrTabsModule, declarations: [ClrTabContent,
|
|
768
|
+
ClrTab,
|
|
769
|
+
ClrTabs,
|
|
770
|
+
ClrTabOverflowContent,
|
|
771
|
+
ClrTabLink,
|
|
772
|
+
ClrTabAction,
|
|
773
|
+
ClrTabsActions,
|
|
774
|
+
TabsWillyWonka,
|
|
775
|
+
ActiveOompaLoompa], imports: [CommonModule, ClrConditionalModule, ClrIcon, ClrTemplateRefModule, ClrKeyFocusModule], exports: [ClrTabContent,
|
|
776
|
+
ClrTab,
|
|
777
|
+
ClrTabs,
|
|
778
|
+
ClrTabOverflowContent,
|
|
779
|
+
ClrTabLink,
|
|
780
|
+
ClrTabAction,
|
|
781
|
+
ClrTabsActions,
|
|
782
|
+
TabsWillyWonka,
|
|
783
|
+
ActiveOompaLoompa, ClrConditionalModule] }); }
|
|
784
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabsModule, imports: [CommonModule, ClrConditionalModule, ClrIcon, ClrTemplateRefModule, ClrKeyFocusModule, ClrConditionalModule] }); }
|
|
785
|
+
}
|
|
786
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrTabsModule, decorators: [{
|
|
787
|
+
type: NgModule,
|
|
788
|
+
args: [{
|
|
789
|
+
imports: [CommonModule, ClrConditionalModule, ClrIcon, ClrTemplateRefModule, ClrKeyFocusModule],
|
|
790
|
+
declarations: [CLR_TABS_DIRECTIVES],
|
|
791
|
+
exports: [CLR_TABS_DIRECTIVES, ClrConditionalModule],
|
|
792
|
+
}]
|
|
793
|
+
}], ctorParameters: () => [] });
|
|
794
|
+
|
|
795
|
+
/*
|
|
796
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
797
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
798
|
+
* This software is released under MIT license.
|
|
799
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
800
|
+
*/
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Generated bundle index. Do not edit.
|
|
804
|
+
*/
|
|
805
|
+
|
|
806
|
+
export { ActiveOompaLoompa, CLR_TABS_DIRECTIVES, ClrTab, ClrTabAction, ClrTabContent, ClrTabLink, ClrTabOverflowContent, ClrTabs, ClrTabsActions, ClrTabsModule, TabsWillyWonka };
|
|
807
|
+
//# sourceMappingURL=clr-angular-layout-tabs.mjs.map
|