@tectra-ng/ui 0.1.2 → 0.1.4
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/README.md +36 -19
- package/accordion/README.md +61 -0
- package/analog-clock/README.md +31 -0
- package/breadcrumb/README.md +57 -0
- package/countdown/README.md +45 -0
- package/datepicker/README.md +109 -0
- package/export/README.md +79 -0
- package/export-font/OFL.txt +93 -0
- package/export-font/README.md +7 -0
- package/fesm2022/tectra-ng-ui-accordion.mjs +980 -0
- package/fesm2022/tectra-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +386 -0
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +2 -2
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs +382 -0
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +2 -2
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-countdown.mjs +513 -0
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-datepicker.mjs +2640 -0
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-export-font.mjs +7 -0
- package/fesm2022/tectra-ng-ui-export-font.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-export.mjs +2574 -0
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-file-upload.mjs +1452 -0
- package/fesm2022/tectra-ng-ui-file-upload.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +4 -4
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-listbox.mjs +2 -2
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menubar.mjs +742 -0
- package/fesm2022/tectra-ng-ui-menubar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +601 -0
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +2 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +610 -0
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs +319 -0
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-sparkline.mjs +240 -0
- package/fesm2022/tectra-ng-ui-sparkline.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-splitter.mjs +750 -0
- package/fesm2022/tectra-ng-ui-splitter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +661 -0
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-stepper.mjs +1166 -0
- package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +195 -71
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tabs.mjs +1218 -0
- package/fesm2022/tectra-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +4 -1
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-timeline.mjs +407 -0
- package/fesm2022/tectra-ng-ui-timeline.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toolbar.mjs +348 -0
- package/fesm2022/tectra-ng-ui-toolbar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +80 -2
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/field/README.md +1 -1
- package/file-upload/README.md +85 -0
- package/menubar/README.md +51 -0
- package/month-calendar/README.md +46 -0
- package/package.json +80 -4
- package/panel-menu/README.md +45 -0
- package/scroll-panel/README.md +35 -0
- package/sparkline/README.md +27 -0
- package/splitter/README.md +62 -0
- package/stat-tiles/README.md +53 -0
- package/stepper/README.md +66 -0
- package/table/README.md +1 -1
- package/tabs/README.md +69 -0
- package/timeline/README.md +42 -0
- package/toolbar/README.md +35 -0
- package/types/tectra-ng-ui-accordion.d.ts +304 -0
- package/types/tectra-ng-ui-accordion.d.ts.map +1 -0
- package/types/tectra-ng-ui-analog-clock.d.ts +127 -0
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -0
- package/types/tectra-ng-ui-breadcrumb.d.ts +157 -0
- package/types/tectra-ng-ui-breadcrumb.d.ts.map +1 -0
- package/types/tectra-ng-ui-countdown.d.ts +150 -0
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -0
- package/types/tectra-ng-ui-datepicker.d.ts +801 -0
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -0
- package/types/tectra-ng-ui-export-font.d.ts +5 -0
- package/types/tectra-ng-ui-export-font.d.ts.map +1 -0
- package/types/tectra-ng-ui-export.d.ts +427 -0
- package/types/tectra-ng-ui-export.d.ts.map +1 -0
- package/types/tectra-ng-ui-file-upload.d.ts +527 -0
- package/types/tectra-ng-ui-file-upload.d.ts.map +1 -0
- package/types/tectra-ng-ui-menubar.d.ts +201 -0
- package/types/tectra-ng-ui-menubar.d.ts.map +1 -0
- package/types/tectra-ng-ui-month-calendar.d.ts +287 -0
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel-menu.d.ts +244 -0
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-scroll-panel.d.ts +94 -0
- package/types/tectra-ng-ui-scroll-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-sparkline.d.ts +80 -0
- package/types/tectra-ng-ui-sparkline.d.ts.map +1 -0
- package/types/tectra-ng-ui-splitter.d.ts +226 -0
- package/types/tectra-ng-ui-splitter.d.ts.map +1 -0
- package/types/tectra-ng-ui-stat-tiles.d.ts +287 -0
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -0
- package/types/tectra-ng-ui-stepper.d.ts +446 -0
- package/types/tectra-ng-ui-stepper.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +2 -4
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tabs.d.ts +420 -0
- package/types/tectra-ng-ui-tabs.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +1 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-timeline.d.ts +129 -0
- package/types/tectra-ng-ui-timeline.d.ts.map +1 -0
- package/types/tectra-ng-ui-toolbar.d.ts +85 -0
- package/types/tectra-ng-ui-toolbar.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-table.d.ts.map +1 -1
|
@@ -0,0 +1,1218 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, InjectionToken, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, contentChildren, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
4
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
import { TxTooltip } from "@tectra-ng/ui/tooltip";
|
|
8
|
+
import { TxIcon, TxIconRegistry } from "@tectra-ng/icons";
|
|
9
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
10
|
+
const TX_TABS = new InjectionToken("TX_TABS");
|
|
11
|
+
var TxTab = class TxTab {
|
|
12
|
+
tabs = inject(TX_TABS);
|
|
13
|
+
txIconRegistry = inject(TxIconRegistry);
|
|
14
|
+
element = inject(ElementRef).nativeElement;
|
|
15
|
+
isButton = this.element.tagName === "BUTTON";
|
|
16
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
17
|
+
icon = input(void 0, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
18
|
+
badge = input(void 0, ...ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []);
|
|
19
|
+
description = input(void 0, ...ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []);
|
|
20
|
+
disabled = input(false, {
|
|
21
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
22
|
+
transform: booleanAttribute
|
|
23
|
+
});
|
|
24
|
+
active = computed(() => this.tabs.value() === this.value(), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
25
|
+
hasBadge = computed(() => this.badge() !== void 0 && this.badge() !== null && this.badge() !== "", ...ngDevMode ? [{ debugName: "hasBadge" }] : /* istanbul ignore next */ []);
|
|
26
|
+
iconName = computed(() => {
|
|
27
|
+
const icon = this.icon();
|
|
28
|
+
return icon && this.txIconRegistry.has(icon) ? icon : null;
|
|
29
|
+
}, ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
|
|
30
|
+
destroyRef = inject(DestroyRef);
|
|
31
|
+
ngOnInit() {
|
|
32
|
+
const unregister = this.tabs.registerTab({
|
|
33
|
+
value: this.value,
|
|
34
|
+
description: this.description,
|
|
35
|
+
disabled: this.disabled
|
|
36
|
+
});
|
|
37
|
+
this.destroyRef.onDestroy(unregister);
|
|
38
|
+
}
|
|
39
|
+
focus() {
|
|
40
|
+
this.element.focus();
|
|
41
|
+
}
|
|
42
|
+
onClick(event) {
|
|
43
|
+
if (this.disabled()) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
event.stopImmediatePropagation();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.tabs.select(this.value());
|
|
49
|
+
}
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
51
|
+
minVersion: "12.0.0",
|
|
52
|
+
version: "22.2.3",
|
|
53
|
+
ngImport: i0,
|
|
54
|
+
type: TxTab,
|
|
55
|
+
deps: [],
|
|
56
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
57
|
+
});
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
59
|
+
minVersion: "17.0.0",
|
|
60
|
+
version: "22.2.3",
|
|
61
|
+
type: TxTab,
|
|
62
|
+
isStandalone: true,
|
|
63
|
+
selector: "tx-tab, a[txTab], button[txTab]",
|
|
64
|
+
inputs: {
|
|
65
|
+
value: {
|
|
66
|
+
classPropertyName: "value",
|
|
67
|
+
publicName: "value",
|
|
68
|
+
isSignal: true,
|
|
69
|
+
isRequired: true,
|
|
70
|
+
transformFunction: null
|
|
71
|
+
},
|
|
72
|
+
icon: {
|
|
73
|
+
classPropertyName: "icon",
|
|
74
|
+
publicName: "icon",
|
|
75
|
+
isSignal: true,
|
|
76
|
+
isRequired: false,
|
|
77
|
+
transformFunction: null
|
|
78
|
+
},
|
|
79
|
+
badge: {
|
|
80
|
+
classPropertyName: "badge",
|
|
81
|
+
publicName: "badge",
|
|
82
|
+
isSignal: true,
|
|
83
|
+
isRequired: false,
|
|
84
|
+
transformFunction: null
|
|
85
|
+
},
|
|
86
|
+
description: {
|
|
87
|
+
classPropertyName: "description",
|
|
88
|
+
publicName: "description",
|
|
89
|
+
isSignal: true,
|
|
90
|
+
isRequired: false,
|
|
91
|
+
transformFunction: null
|
|
92
|
+
},
|
|
93
|
+
disabled: {
|
|
94
|
+
classPropertyName: "disabled",
|
|
95
|
+
publicName: "disabled",
|
|
96
|
+
isSignal: true,
|
|
97
|
+
isRequired: false,
|
|
98
|
+
transformFunction: null
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
host: {
|
|
102
|
+
attributes: { "role": "tab" },
|
|
103
|
+
listeners: { "click": "onClick($event)" },
|
|
104
|
+
properties: {
|
|
105
|
+
"class": "tabs.passThrough().tab?.class",
|
|
106
|
+
"style": "tabs.passThrough().tab?.style",
|
|
107
|
+
"attr.data-styled": "!tabs.isUnstyled() || null",
|
|
108
|
+
"attr.data-variant": "tabs.variant()",
|
|
109
|
+
"attr.data-size": "tabs.size()",
|
|
110
|
+
"attr.data-orientation": "tabs.orientation()",
|
|
111
|
+
"class.tx-tab--raised": "tabs.raised()",
|
|
112
|
+
"class.tx-tab--active": "active()",
|
|
113
|
+
"class.tx-tab--disabled": "disabled()",
|
|
114
|
+
"id": "tabs.tabId(value())",
|
|
115
|
+
"attr.type": "isButton ? \"button\" : null",
|
|
116
|
+
"attr.tabindex": "tabs.focusValue() === value() ? 0 : -1",
|
|
117
|
+
"attr.aria-selected": "active()",
|
|
118
|
+
"attr.aria-disabled": "disabled() || null",
|
|
119
|
+
"attr.aria-controls": "tabs.hasPanel(value()) ? tabs.panelId(value()) : null",
|
|
120
|
+
"attr.data-value": "value()"
|
|
121
|
+
},
|
|
122
|
+
classAttribute: "tx-tab"
|
|
123
|
+
},
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
template: `
|
|
126
|
+
@if (icon(); as icon) {
|
|
127
|
+
<span class="tx-tab__icon" aria-hidden="true" [class]="tabs.passThrough().icon?.class" [style]="tabs.passThrough().icon?.style">
|
|
128
|
+
@if (iconName(); as name) {
|
|
129
|
+
<tx-icon [name]="name" />
|
|
130
|
+
} @else {
|
|
131
|
+
<span [class]="icon"></span>
|
|
132
|
+
}
|
|
133
|
+
</span>
|
|
134
|
+
}
|
|
135
|
+
<span class="tx-tab__label" [class]="tabs.passThrough().label?.class" [style]="tabs.passThrough().label?.style"><ng-content /></span>
|
|
136
|
+
@if (hasBadge()) {
|
|
137
|
+
<span class="tx-tab__badge" [class]="tabs.passThrough().badge?.class" [style]="tabs.passThrough().badge?.style">{{ badge() }}</span>
|
|
138
|
+
}
|
|
139
|
+
`,
|
|
140
|
+
isInline: true,
|
|
141
|
+
styles: [":host{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;box-sizing:border-box;white-space:nowrap;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none}:host([data-orientation=vertical]){justify-content:flex-start;text-align:start}:host(.tx-tab--disabled){cursor:default}.tx-tab__icon{display:inline-flex;flex-shrink:0}.tx-tab__label{min-width:0}.tx-tab__badge{display:inline-flex;align-items:center;justify-content:center}:host([data-styled]){--_padding: var(--tx-tabs-segmented-tab-padding);--_gap: var(--tx-tabs-segmented-tab-gap);--_radius: var(--tx-tabs-segmented-tab-border-radius);--_font-size: var(--tx-tabs-segmented-tab-font-size);--_font-weight: var(--tx-tabs-segmented-tab-font-weight);--_line-height: var(--tx-tabs-segmented-tab-line-height);--_color: var(--tx-tabs-segmented-tab-color);--_hover-color: var(--tx-tabs-segmented-tab-hover-color);--_active-background: var(--tx-tabs-segmented-tab-active-background);--_active-color: var(--tx-tabs-segmented-tab-active-color);--_active-shadow: var(--tx-tabs-segmented-tab-active-shadow);--_focus-offset: var(--tx-tabs-segmented-focus-ring-offset);--_duration: var(--tx-tabs-transition-duration);--_badge-active-background: var(--tx-tabs-badge-solid-active-background);--_badge-active-color: var(--tx-tabs-badge-solid-active-color);flex:1 1 0%;gap:var(--_gap);margin:0;padding:var(--_padding);border:none;border-radius:var(--_radius);outline:none;background:transparent;color:var(--_color);font-family:inherit;font-size:var(--_font-size);font-weight:var(--_font-weight);line-height:var(--_line-height);transition:color var(--_duration) ease-out,background-color var(--_duration) ease-out,box-shadow var(--_duration) ease-out,opacity var(--_duration) ease-out}:host([data-styled][data-variant=segmented][data-size=small]){--_padding: var(--tx-tabs-segmented-sm-tab-padding);--_gap: var(--tx-tabs-segmented-sm-tab-gap);--_radius: var(--tx-tabs-segmented-sm-tab-border-radius);--_font-size: var(--tx-tabs-segmented-sm-tab-font-size)}:host([data-styled][data-variant=pills]){--_padding: var(--tx-tabs-pills-tab-padding);--_gap: var(--tx-tabs-pills-tab-gap);--_radius: var(--tx-tabs-pills-tab-border-radius);--_font-size: var(--tx-tabs-pills-tab-font-size);--_font-weight: var(--tx-tabs-pills-tab-font-weight);--_line-height: var(--tx-tabs-pills-tab-line-height);--_color: var(--tx-tabs-pills-tab-color);--_hover-color: var(--tx-tabs-pills-tab-hover-color);--_active-background: var(--tx-tabs-pills-tab-active-background);--_active-color: var(--tx-tabs-pills-tab-active-color);--_active-shadow: var(--tx-tabs-pills-tab-active-shadow);--_focus-offset: var(--tx-tabs-pills-focus-ring-offset);--_duration: var(--tx-tabs-pills-transition-duration);--_badge-active-background: var(--tx-tabs-badge-active-background);--_badge-active-color: var(--tx-tabs-badge-active-color);flex:none}:host([data-styled][data-variant=pills].tx-tab--raised){--_active-background: var(--tx-tabs-raised-pills-active-background);--_active-color: var(--tx-tabs-raised-pills-active-color);--_active-shadow: var(--tx-tabs-raised-pills-active-shadow)}:host([data-styled][data-variant=line]){--_padding: var(--tx-tabs-line-tab-padding);--_gap: var(--tx-tabs-line-tab-gap);--_radius: var(--tx-tabs-line-tab-border-radius);--_font-size: var(--tx-tabs-line-tab-font-size);--_font-weight: var(--tx-tabs-line-tab-font-weight);--_line-height: var(--tx-tabs-line-tab-line-height);--_color: var(--tx-tabs-line-tab-color);--_hover-color: var(--tx-tabs-line-tab-hover-color);--_active-background: var(--tx-tabs-line-tab-active-background);--_active-color: var(--tx-tabs-line-tab-active-color);--_active-shadow: var(--tx-tabs-line-tab-active-shadow);--_focus-offset: var(--tx-tabs-line-focus-ring-offset);--_duration: var(--tx-tabs-line-transition-duration);--_badge-active-background: var(--tx-tabs-badge-active-background);--_badge-active-color: var(--tx-tabs-badge-active-color);flex:none}:host([data-styled][data-orientation=vertical]){flex:none}:host([data-styled]:not(.tx-tab--active):not(.tx-tab--disabled):hover){color:var(--_hover-color)}:host([data-styled].tx-tab--active){background:var(--_active-background);box-shadow:var(--_active-shadow);color:var(--_active-color)}:host([data-styled][data-variant=segmented].tx-tab--active),:host([data-styled][data-variant=pills].tx-tab--active){animation:tx-tab-activate var(--tx-tabs-activate-duration) var(--tx-tabs-activate-easing)}:host([data-styled]:focus-visible){z-index:1;outline:var(--tx-tabs-focus-ring-width) solid var(--tx-tabs-focus-ring-color);outline-offset:var(--_focus-offset)}:host([data-styled].tx-tab--disabled){opacity:var(--tx-tabs-disabled-opacity)}:host([data-styled]) .tx-tab__badge{min-width:var(--tx-tabs-badge-size);height:var(--tx-tabs-badge-size);box-sizing:border-box;padding:var(--tx-tabs-badge-padding);border-radius:var(--tx-radius-full);background:var(--tx-tabs-badge-background);color:var(--tx-tabs-badge-color);font-size:var(--tx-tabs-badge-font-size);font-weight:var(--tx-tabs-badge-font-weight);font-variant-numeric:tabular-nums;line-height:1;transition:color var(--_duration) ease-out,background-color var(--_duration) ease-out}:host([data-styled].tx-tab--active) .tx-tab__badge{background:var(--_badge-active-background);color:var(--_badge-active-color)}@keyframes tx-tab-activate{0%{transform:scale(var(--tx-tabs-activate-scale))}}@media(prefers-reduced-motion:reduce){:host([data-styled]),:host([data-styled]) .tx-tab__badge{transition:none}:host([data-styled][data-variant=segmented].tx-tab--active),:host([data-styled][data-variant=pills].tx-tab--active){animation:none}}\n"],
|
|
142
|
+
dependencies: [{
|
|
143
|
+
kind: "component",
|
|
144
|
+
type: TxIcon,
|
|
145
|
+
selector: "tx-icon",
|
|
146
|
+
inputs: ["name"]
|
|
147
|
+
}],
|
|
148
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
152
|
+
minVersion: "12.0.0",
|
|
153
|
+
version: "22.2.3",
|
|
154
|
+
ngImport: i0,
|
|
155
|
+
type: TxTab,
|
|
156
|
+
decorators: [{
|
|
157
|
+
type: Component,
|
|
158
|
+
args: [{
|
|
159
|
+
selector: "tx-tab, a[txTab], button[txTab]",
|
|
160
|
+
imports: [TxIcon],
|
|
161
|
+
template: `
|
|
162
|
+
@if (icon(); as icon) {
|
|
163
|
+
<span class="tx-tab__icon" aria-hidden="true" [class]="tabs.passThrough().icon?.class" [style]="tabs.passThrough().icon?.style">
|
|
164
|
+
@if (iconName(); as name) {
|
|
165
|
+
<tx-icon [name]="name" />
|
|
166
|
+
} @else {
|
|
167
|
+
<span [class]="icon"></span>
|
|
168
|
+
}
|
|
169
|
+
</span>
|
|
170
|
+
}
|
|
171
|
+
<span class="tx-tab__label" [class]="tabs.passThrough().label?.class" [style]="tabs.passThrough().label?.style"><ng-content /></span>
|
|
172
|
+
@if (hasBadge()) {
|
|
173
|
+
<span class="tx-tab__badge" [class]="tabs.passThrough().badge?.class" [style]="tabs.passThrough().badge?.style">{{ badge() }}</span>
|
|
174
|
+
}
|
|
175
|
+
`,
|
|
176
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
177
|
+
host: {
|
|
178
|
+
class: "tx-tab",
|
|
179
|
+
role: "tab",
|
|
180
|
+
"[class]": "tabs.passThrough().tab?.class",
|
|
181
|
+
"[style]": "tabs.passThrough().tab?.style",
|
|
182
|
+
"[attr.data-styled]": "!tabs.isUnstyled() || null",
|
|
183
|
+
"[attr.data-variant]": "tabs.variant()",
|
|
184
|
+
"[attr.data-size]": "tabs.size()",
|
|
185
|
+
"[attr.data-orientation]": "tabs.orientation()",
|
|
186
|
+
"[class.tx-tab--raised]": "tabs.raised()",
|
|
187
|
+
"[class.tx-tab--active]": "active()",
|
|
188
|
+
"[class.tx-tab--disabled]": "disabled()",
|
|
189
|
+
"[id]": "tabs.tabId(value())",
|
|
190
|
+
"[attr.type]": "isButton ? \"button\" : null",
|
|
191
|
+
"[attr.tabindex]": "tabs.focusValue() === value() ? 0 : -1",
|
|
192
|
+
"[attr.aria-selected]": "active()",
|
|
193
|
+
"[attr.aria-disabled]": "disabled() || null",
|
|
194
|
+
"[attr.aria-controls]": "tabs.hasPanel(value()) ? tabs.panelId(value()) : null",
|
|
195
|
+
"[attr.data-value]": "value()",
|
|
196
|
+
"(click)": "onClick($event)"
|
|
197
|
+
},
|
|
198
|
+
styles: [":host{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;box-sizing:border-box;white-space:nowrap;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none}:host([data-orientation=vertical]){justify-content:flex-start;text-align:start}:host(.tx-tab--disabled){cursor:default}.tx-tab__icon{display:inline-flex;flex-shrink:0}.tx-tab__label{min-width:0}.tx-tab__badge{display:inline-flex;align-items:center;justify-content:center}:host([data-styled]){--_padding: var(--tx-tabs-segmented-tab-padding);--_gap: var(--tx-tabs-segmented-tab-gap);--_radius: var(--tx-tabs-segmented-tab-border-radius);--_font-size: var(--tx-tabs-segmented-tab-font-size);--_font-weight: var(--tx-tabs-segmented-tab-font-weight);--_line-height: var(--tx-tabs-segmented-tab-line-height);--_color: var(--tx-tabs-segmented-tab-color);--_hover-color: var(--tx-tabs-segmented-tab-hover-color);--_active-background: var(--tx-tabs-segmented-tab-active-background);--_active-color: var(--tx-tabs-segmented-tab-active-color);--_active-shadow: var(--tx-tabs-segmented-tab-active-shadow);--_focus-offset: var(--tx-tabs-segmented-focus-ring-offset);--_duration: var(--tx-tabs-transition-duration);--_badge-active-background: var(--tx-tabs-badge-solid-active-background);--_badge-active-color: var(--tx-tabs-badge-solid-active-color);flex:1 1 0%;gap:var(--_gap);margin:0;padding:var(--_padding);border:none;border-radius:var(--_radius);outline:none;background:transparent;color:var(--_color);font-family:inherit;font-size:var(--_font-size);font-weight:var(--_font-weight);line-height:var(--_line-height);transition:color var(--_duration) ease-out,background-color var(--_duration) ease-out,box-shadow var(--_duration) ease-out,opacity var(--_duration) ease-out}:host([data-styled][data-variant=segmented][data-size=small]){--_padding: var(--tx-tabs-segmented-sm-tab-padding);--_gap: var(--tx-tabs-segmented-sm-tab-gap);--_radius: var(--tx-tabs-segmented-sm-tab-border-radius);--_font-size: var(--tx-tabs-segmented-sm-tab-font-size)}:host([data-styled][data-variant=pills]){--_padding: var(--tx-tabs-pills-tab-padding);--_gap: var(--tx-tabs-pills-tab-gap);--_radius: var(--tx-tabs-pills-tab-border-radius);--_font-size: var(--tx-tabs-pills-tab-font-size);--_font-weight: var(--tx-tabs-pills-tab-font-weight);--_line-height: var(--tx-tabs-pills-tab-line-height);--_color: var(--tx-tabs-pills-tab-color);--_hover-color: var(--tx-tabs-pills-tab-hover-color);--_active-background: var(--tx-tabs-pills-tab-active-background);--_active-color: var(--tx-tabs-pills-tab-active-color);--_active-shadow: var(--tx-tabs-pills-tab-active-shadow);--_focus-offset: var(--tx-tabs-pills-focus-ring-offset);--_duration: var(--tx-tabs-pills-transition-duration);--_badge-active-background: var(--tx-tabs-badge-active-background);--_badge-active-color: var(--tx-tabs-badge-active-color);flex:none}:host([data-styled][data-variant=pills].tx-tab--raised){--_active-background: var(--tx-tabs-raised-pills-active-background);--_active-color: var(--tx-tabs-raised-pills-active-color);--_active-shadow: var(--tx-tabs-raised-pills-active-shadow)}:host([data-styled][data-variant=line]){--_padding: var(--tx-tabs-line-tab-padding);--_gap: var(--tx-tabs-line-tab-gap);--_radius: var(--tx-tabs-line-tab-border-radius);--_font-size: var(--tx-tabs-line-tab-font-size);--_font-weight: var(--tx-tabs-line-tab-font-weight);--_line-height: var(--tx-tabs-line-tab-line-height);--_color: var(--tx-tabs-line-tab-color);--_hover-color: var(--tx-tabs-line-tab-hover-color);--_active-background: var(--tx-tabs-line-tab-active-background);--_active-color: var(--tx-tabs-line-tab-active-color);--_active-shadow: var(--tx-tabs-line-tab-active-shadow);--_focus-offset: var(--tx-tabs-line-focus-ring-offset);--_duration: var(--tx-tabs-line-transition-duration);--_badge-active-background: var(--tx-tabs-badge-active-background);--_badge-active-color: var(--tx-tabs-badge-active-color);flex:none}:host([data-styled][data-orientation=vertical]){flex:none}:host([data-styled]:not(.tx-tab--active):not(.tx-tab--disabled):hover){color:var(--_hover-color)}:host([data-styled].tx-tab--active){background:var(--_active-background);box-shadow:var(--_active-shadow);color:var(--_active-color)}:host([data-styled][data-variant=segmented].tx-tab--active),:host([data-styled][data-variant=pills].tx-tab--active){animation:tx-tab-activate var(--tx-tabs-activate-duration) var(--tx-tabs-activate-easing)}:host([data-styled]:focus-visible){z-index:1;outline:var(--tx-tabs-focus-ring-width) solid var(--tx-tabs-focus-ring-color);outline-offset:var(--_focus-offset)}:host([data-styled].tx-tab--disabled){opacity:var(--tx-tabs-disabled-opacity)}:host([data-styled]) .tx-tab__badge{min-width:var(--tx-tabs-badge-size);height:var(--tx-tabs-badge-size);box-sizing:border-box;padding:var(--tx-tabs-badge-padding);border-radius:var(--tx-radius-full);background:var(--tx-tabs-badge-background);color:var(--tx-tabs-badge-color);font-size:var(--tx-tabs-badge-font-size);font-weight:var(--tx-tabs-badge-font-weight);font-variant-numeric:tabular-nums;line-height:1;transition:color var(--_duration) ease-out,background-color var(--_duration) ease-out}:host([data-styled].tx-tab--active) .tx-tab__badge{background:var(--_badge-active-background);color:var(--_badge-active-color)}@keyframes tx-tab-activate{0%{transform:scale(var(--tx-tabs-activate-scale))}}@media(prefers-reduced-motion:reduce){:host([data-styled]),:host([data-styled]) .tx-tab__badge{transition:none}:host([data-styled][data-variant=segmented].tx-tab--active),:host([data-styled][data-variant=pills].tx-tab--active){animation:none}}\n"]
|
|
199
|
+
}]
|
|
200
|
+
}],
|
|
201
|
+
propDecorators: {
|
|
202
|
+
value: [{
|
|
203
|
+
type: i0.Input,
|
|
204
|
+
args: [{
|
|
205
|
+
isSignal: true,
|
|
206
|
+
alias: "value",
|
|
207
|
+
required: true
|
|
208
|
+
}]
|
|
209
|
+
}],
|
|
210
|
+
icon: [{
|
|
211
|
+
type: i0.Input,
|
|
212
|
+
args: [{
|
|
213
|
+
isSignal: true,
|
|
214
|
+
alias: "icon",
|
|
215
|
+
required: false
|
|
216
|
+
}]
|
|
217
|
+
}],
|
|
218
|
+
badge: [{
|
|
219
|
+
type: i0.Input,
|
|
220
|
+
args: [{
|
|
221
|
+
isSignal: true,
|
|
222
|
+
alias: "badge",
|
|
223
|
+
required: false
|
|
224
|
+
}]
|
|
225
|
+
}],
|
|
226
|
+
description: [{
|
|
227
|
+
type: i0.Input,
|
|
228
|
+
args: [{
|
|
229
|
+
isSignal: true,
|
|
230
|
+
alias: "description",
|
|
231
|
+
required: false
|
|
232
|
+
}]
|
|
233
|
+
}],
|
|
234
|
+
disabled: [{
|
|
235
|
+
type: i0.Input,
|
|
236
|
+
args: [{
|
|
237
|
+
isSignal: true,
|
|
238
|
+
alias: "disabled",
|
|
239
|
+
required: false
|
|
240
|
+
}]
|
|
241
|
+
}]
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
const SCROLL_GAP = 8;
|
|
245
|
+
var TxTabList = class TxTabList {
|
|
246
|
+
tabs = inject(TX_TABS);
|
|
247
|
+
items = contentChildren(TxTab, {
|
|
248
|
+
...ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {},
|
|
249
|
+
descendants: true
|
|
250
|
+
});
|
|
251
|
+
destroyRef = inject(DestroyRef);
|
|
252
|
+
content = viewChild.required("content", ...ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []);
|
|
253
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
254
|
+
ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
255
|
+
canScrollPrevious = signal(false, ...ngDevMode ? [{ debugName: "canScrollPrevious" }] : /* istanbul ignore next */ []);
|
|
256
|
+
canScrollNext = signal(false, ...ngDevMode ? [{ debugName: "canScrollNext" }] : /* istanbul ignore next */ []);
|
|
257
|
+
bar = signal(null, ...ngDevMode ? [{ debugName: "bar" }] : /* istanbul ignore next */ []);
|
|
258
|
+
vertical = computed(() => this.tabs.orientation() === "vertical", ...ngDevMode ? [{ debugName: "vertical" }] : /* istanbul ignore next */ []);
|
|
259
|
+
navigators = computed(() => this.tabs.scrollable() && this.tabs.showNavigators() && !this.vertical(), ...ngDevMode ? [{ debugName: "navigators" }] : /* istanbul ignore next */ []);
|
|
260
|
+
constructor() {
|
|
261
|
+
afterRenderEffect(() => {
|
|
262
|
+
this.tabs.value();
|
|
263
|
+
this.items();
|
|
264
|
+
this.vertical();
|
|
265
|
+
this.navigators();
|
|
266
|
+
this.tabs.variant();
|
|
267
|
+
untracked(() => {
|
|
268
|
+
this.observe();
|
|
269
|
+
this.scrollToActive();
|
|
270
|
+
this.updateBar();
|
|
271
|
+
this.updateNavigators();
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
afterNextRender(() => {
|
|
275
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
276
|
+
const observer = new ResizeObserver(() => {
|
|
277
|
+
this.updateBar();
|
|
278
|
+
this.updateNavigators();
|
|
279
|
+
});
|
|
280
|
+
this.observer = observer;
|
|
281
|
+
this.observe();
|
|
282
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
observer = null;
|
|
286
|
+
observe() {
|
|
287
|
+
const observer = this.observer;
|
|
288
|
+
if (!observer) return;
|
|
289
|
+
observer.disconnect();
|
|
290
|
+
observer.observe(this.content().nativeElement);
|
|
291
|
+
for (const tab of this.items()) observer.observe(tab.element);
|
|
292
|
+
}
|
|
293
|
+
onKeydown(event) {
|
|
294
|
+
const enabled = this.items().filter((tab) => !tab.disabled());
|
|
295
|
+
if (!enabled.length) return;
|
|
296
|
+
const current = enabled.findIndex((tab) => tab.element === document.activeElement);
|
|
297
|
+
const nextKey = this.vertical() ? "ArrowDown" : "ArrowRight";
|
|
298
|
+
const previousKey = this.vertical() ? "ArrowUp" : "ArrowLeft";
|
|
299
|
+
let target;
|
|
300
|
+
switch (event.key) {
|
|
301
|
+
case nextKey:
|
|
302
|
+
target = enabled[(current + 1) % enabled.length];
|
|
303
|
+
break;
|
|
304
|
+
case previousKey:
|
|
305
|
+
target = enabled[(current - 1 + enabled.length) % enabled.length];
|
|
306
|
+
break;
|
|
307
|
+
case "Home":
|
|
308
|
+
target = enabled[0];
|
|
309
|
+
break;
|
|
310
|
+
case "End":
|
|
311
|
+
target = enabled[enabled.length - 1];
|
|
312
|
+
break;
|
|
313
|
+
case "Enter":
|
|
314
|
+
case " ":
|
|
315
|
+
if (current >= 0) {
|
|
316
|
+
event.preventDefault();
|
|
317
|
+
enabled[current].element.click();
|
|
318
|
+
}
|
|
319
|
+
return;
|
|
320
|
+
default: return;
|
|
321
|
+
}
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
target.focus();
|
|
324
|
+
if (this.tabs.selectOnFocus()) this.tabs.select(target.value());
|
|
325
|
+
}
|
|
326
|
+
scrollPrevious() {
|
|
327
|
+
const content = this.content().nativeElement;
|
|
328
|
+
content.scrollLeft = Math.max(0, content.scrollLeft - this.scrollStep());
|
|
329
|
+
}
|
|
330
|
+
scrollNext() {
|
|
331
|
+
const content = this.content().nativeElement;
|
|
332
|
+
content.scrollLeft = content.scrollLeft + this.scrollStep();
|
|
333
|
+
}
|
|
334
|
+
updateNavigators() {
|
|
335
|
+
if (!this.navigators()) {
|
|
336
|
+
this.canScrollPrevious.set(false);
|
|
337
|
+
this.canScrollNext.set(false);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const content = this.content().nativeElement;
|
|
341
|
+
const max = content.scrollWidth - content.clientWidth;
|
|
342
|
+
this.canScrollPrevious.set(content.scrollLeft > 1);
|
|
343
|
+
this.canScrollNext.set(max - content.scrollLeft > 1);
|
|
344
|
+
}
|
|
345
|
+
scrollStep() {
|
|
346
|
+
const content = this.content().nativeElement;
|
|
347
|
+
return Math.max(content.clientWidth * .8, 1);
|
|
348
|
+
}
|
|
349
|
+
activeTab() {
|
|
350
|
+
const value = this.tabs.value();
|
|
351
|
+
return this.items().find((tab) => tab.value() === value);
|
|
352
|
+
}
|
|
353
|
+
scrollToActive() {
|
|
354
|
+
const tab = this.activeTab();
|
|
355
|
+
if (!tab || this.vertical()) return;
|
|
356
|
+
const content = this.content().nativeElement;
|
|
357
|
+
const listRect = content.getBoundingClientRect();
|
|
358
|
+
const itemRect = tab.element.getBoundingClientRect();
|
|
359
|
+
if (itemRect.left < listRect.left) content.scrollLeft -= listRect.left - itemRect.left + SCROLL_GAP;
|
|
360
|
+
else if (itemRect.right > listRect.right) content.scrollLeft += itemRect.right - listRect.right + SCROLL_GAP;
|
|
361
|
+
}
|
|
362
|
+
updateBar() {
|
|
363
|
+
const tab = this.tabs.variant() === "line" ? this.activeTab() : void 0;
|
|
364
|
+
if (!tab) {
|
|
365
|
+
this.bar.set(null);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const element = tab.element;
|
|
369
|
+
const next = this.vertical() ? {
|
|
370
|
+
start: element.offsetTop,
|
|
371
|
+
size: element.offsetHeight
|
|
372
|
+
} : {
|
|
373
|
+
start: element.offsetLeft,
|
|
374
|
+
size: element.offsetWidth
|
|
375
|
+
};
|
|
376
|
+
const current = this.bar();
|
|
377
|
+
if (!current || current.start !== next.start || current.size !== next.size) this.bar.set(next);
|
|
378
|
+
}
|
|
379
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
380
|
+
minVersion: "12.0.0",
|
|
381
|
+
version: "22.2.3",
|
|
382
|
+
ngImport: i0,
|
|
383
|
+
type: TxTabList,
|
|
384
|
+
deps: [],
|
|
385
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
386
|
+
});
|
|
387
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
388
|
+
minVersion: "17.0.0",
|
|
389
|
+
version: "22.2.3",
|
|
390
|
+
type: TxTabList,
|
|
391
|
+
isStandalone: true,
|
|
392
|
+
selector: "tx-tab-list",
|
|
393
|
+
inputs: {
|
|
394
|
+
ariaLabel: {
|
|
395
|
+
classPropertyName: "ariaLabel",
|
|
396
|
+
publicName: "ariaLabel",
|
|
397
|
+
isSignal: true,
|
|
398
|
+
isRequired: false,
|
|
399
|
+
transformFunction: null
|
|
400
|
+
},
|
|
401
|
+
ariaLabelledBy: {
|
|
402
|
+
classPropertyName: "ariaLabelledBy",
|
|
403
|
+
publicName: "ariaLabelledBy",
|
|
404
|
+
isSignal: true,
|
|
405
|
+
isRequired: false,
|
|
406
|
+
transformFunction: null
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
host: {
|
|
410
|
+
properties: {
|
|
411
|
+
"class": "tabs.passThrough().list?.class",
|
|
412
|
+
"style": "tabs.passThrough().list?.style",
|
|
413
|
+
"attr.data-styled": "!tabs.isUnstyled() || null",
|
|
414
|
+
"attr.data-variant": "tabs.variant()",
|
|
415
|
+
"attr.data-size": "tabs.size()",
|
|
416
|
+
"attr.data-orientation": "tabs.orientation()",
|
|
417
|
+
"class.tx-tab-list--raised": "tabs.raised()",
|
|
418
|
+
"class.tx-tab-list--scrollable": "tabs.scrollable()"
|
|
419
|
+
},
|
|
420
|
+
classAttribute: "tx-tab-list"
|
|
421
|
+
},
|
|
422
|
+
queries: [{
|
|
423
|
+
propertyName: "items",
|
|
424
|
+
predicate: TxTab,
|
|
425
|
+
descendants: true,
|
|
426
|
+
isSignal: true
|
|
427
|
+
}],
|
|
428
|
+
viewQueries: [{
|
|
429
|
+
propertyName: "content",
|
|
430
|
+
first: true,
|
|
431
|
+
predicate: ["content"],
|
|
432
|
+
descendants: true,
|
|
433
|
+
isSignal: true
|
|
434
|
+
}],
|
|
435
|
+
ngImport: i0,
|
|
436
|
+
template: "<div class=\"tx-tab-list__track\" [class]=\"tabs.passThrough().track?.class\" [style]=\"tabs.passThrough().track?.style\">\n @if (navigators()) {\n <button\n type=\"button\"\n class=\"tx-tab-list__nav tx-tab-list__nav--previous\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [class.tx-tab-list__nav--hidden]=\"!canScrollPrevious()\"\n [class]=\"tabs.passThrough().previousButton?.class\"\n [style]=\"tabs.passThrough().previousButton?.style\"\n (click)=\"scrollPrevious()\"\n >\n <tx-icon name=\"chevron-left\" />\n </button>\n }\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the tabs inside the list take focus; the list handles their arrow keys -->\n <div\n #content\n class=\"tx-tab-list__content\"\n role=\"tablist\"\n [attr.aria-orientation]=\"tabs.orientation()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [class]=\"tabs.passThrough().content?.class\"\n [style]=\"tabs.passThrough().content?.style\"\n (keydown)=\"onKeydown($event)\"\n (scroll)=\"updateNavigators()\"\n >\n <ng-content />\n @if (bar(); as bar) {\n <span\n class=\"tx-tab-list__active-bar\"\n aria-hidden=\"true\"\n [style.--_bar-start.px]=\"bar.start\"\n [style.--_bar-size.px]=\"bar.size\"\n [class]=\"tabs.passThrough().activeBar?.class\"\n [style]=\"tabs.passThrough().activeBar?.style\"\n ></span>\n }\n </div>\n @if (navigators()) {\n <button\n type=\"button\"\n class=\"tx-tab-list__nav tx-tab-list__nav--next\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [class.tx-tab-list__nav--hidden]=\"!canScrollNext()\"\n [class]=\"tabs.passThrough().nextButton?.class\"\n [style]=\"tabs.passThrough().nextButton?.style\"\n (click)=\"scrollNext()\"\n >\n <tx-icon name=\"chevron-right\" />\n </button>\n }\n</div>\n@if (tabs.activeDescription(); as description) {\n <span class=\"tx-tab-list__description\" [class]=\"tabs.passThrough().description?.class\" [style]=\"tabs.passThrough().description?.style\">{{ description }}</span>\n}\n",
|
|
437
|
+
styles: [":host{display:flex;flex-direction:column;min-width:0}:host([data-variant=pills]){align-items:flex-start}.tx-tab-list__track{position:relative;display:flex;min-width:0;max-width:100%}:host([data-variant=pills]) .tx-tab-list__track{display:inline-flex}.tx-tab-list__content{position:relative;display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-behavior:smooth;scrollbar-width:none}.tx-tab-list__content::-webkit-scrollbar{display:none}:host([data-orientation=vertical]) .tx-tab-list__content{flex-direction:column;overflow:visible}.tx-tab-list__nav{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:none;font:inherit;cursor:pointer}.tx-tab-list__nav--previous{inset-inline-start:0}.tx-tab-list__nav--next{inset-inline-end:0}.tx-tab-list__nav--hidden{visibility:hidden;opacity:0;pointer-events:none}.tx-tab-list__active-bar{position:absolute;z-index:1;pointer-events:none}.tx-tab-list__description{display:block}:host([data-styled]){--_nav-background: var(--tx-tabs-segmented-background);--_duration: var(--tx-tabs-transition-duration)}:host([data-styled]) .tx-tab-list__track{overflow:hidden;transition:background-color var(--_duration),border-color var(--_duration),box-shadow var(--_duration)}:host([data-styled][data-variant=segmented]) .tx-tab-list__track{border:var(--tx-tabs-segmented-border-width) solid var(--tx-tabs-segmented-border-color);border-radius:var(--tx-tabs-segmented-border-radius);background:var(--tx-tabs-segmented-background)}:host([data-styled][data-variant=segmented]) .tx-tab-list__content{gap:var(--tx-tabs-segmented-gap);padding:var(--tx-tabs-segmented-padding)}:host([data-styled][data-variant=segmented][data-size=small]) .tx-tab-list__track{border-radius:var(--tx-tabs-segmented-sm-border-radius)}:host([data-styled][data-variant=segmented][data-size=small]) .tx-tab-list__content{gap:var(--tx-tabs-segmented-sm-gap);padding:var(--tx-tabs-segmented-sm-padding)}:host([data-styled][data-variant=pills]){--_nav-background: var(--tx-tabs-pills-background);--_duration: var(--tx-tabs-pills-transition-duration)}:host([data-styled][data-variant=pills]) .tx-tab-list__track{border-radius:var(--tx-tabs-pills-border-radius);background:var(--tx-tabs-pills-background);box-shadow:inset 0 0 0 1px var(--tx-tabs-pills-ring-color)}:host([data-styled][data-variant=pills]) .tx-tab-list__content{gap:var(--tx-tabs-pills-gap);padding:var(--tx-tabs-pills-padding)}:host([data-styled].tx-tab-list--raised){--_nav-background: var(--tx-tabs-raised-background)}:host([data-styled][data-variant=segmented].tx-tab-list--raised) .tx-tab-list__track{border-color:var(--tx-tabs-raised-ring-color);background:var(--tx-tabs-raised-background);box-shadow:var(--tx-tabs-raised-shadow)}:host([data-styled][data-variant=pills].tx-tab-list--raised) .tx-tab-list__track{background:var(--tx-tabs-raised-background);box-shadow:inset 0 0 0 1px var(--tx-tabs-raised-ring-color),var(--tx-tabs-raised-shadow)}:host([data-styled][data-variant=line]){--_nav-background: var(--tx-tabs-line-background);--_duration: var(--tx-tabs-line-transition-duration)}:host([data-styled][data-variant=line]) .tx-tab-list__track{border-style:solid;border-width:var(--tx-tabs-line-border-width);border-color:var(--tx-tabs-line-border-color);background:var(--tx-tabs-line-background)}:host([data-styled][data-variant=line]) .tx-tab-list__active-bar{bottom:var(--tx-tabs-line-active-bar-bottom);left:var(--_bar-start);width:var(--_bar-size);height:var(--tx-tabs-line-active-bar-height);background:var(--tx-tabs-line-active-bar-background);transition:width var(--tx-tabs-line-active-bar-transition),left var(--tx-tabs-line-active-bar-transition)}:host([data-styled][data-variant=line][data-orientation=vertical]) .tx-tab-list__track{border-width:0;border-inline-end-width:1px}:host([data-styled][data-variant=line][data-orientation=vertical]) .tx-tab-list__active-bar{top:var(--_bar-start);right:0;bottom:auto;left:auto;width:var(--tx-tabs-line-active-bar-height);height:var(--_bar-size);transition:height var(--tx-tabs-line-active-bar-transition),top var(--tx-tabs-line-active-bar-transition)}:host([data-styled]) .tx-tab-list__nav{width:var(--tx-tabs-nav-button-width);background:var(--_nav-background);box-shadow:var(--tx-tabs-nav-button-shadow-size) var(--tx-tabs-nav-button-shadow-color);color:var(--tx-tabs-nav-button-color);font-size:var(--tx-font-size-md);transition:color var(--_duration),opacity var(--_duration),visibility var(--_duration)}:host([data-styled]) .tx-tab-list__nav:hover{color:var(--tx-tabs-nav-button-hover-color)}:host([data-styled]) .tx-tab-list__description{margin-top:var(--tx-tabs-description-gap);color:var(--tx-tabs-description-color);font-size:var(--tx-tabs-description-font-size);line-height:var(--tx-tabs-description-line-height)}@media(prefers-reduced-motion:reduce){.tx-tab-list__content{scroll-behavior:auto}:host([data-styled]) .tx-tab-list__track,:host([data-styled]) .tx-tab-list__nav,:host([data-styled]) .tx-tab-list__active-bar{transition:none}}\n"],
|
|
438
|
+
dependencies: [{
|
|
439
|
+
kind: "component",
|
|
440
|
+
type: TxIcon,
|
|
441
|
+
selector: "tx-icon",
|
|
442
|
+
inputs: ["name"]
|
|
443
|
+
}],
|
|
444
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
448
|
+
minVersion: "12.0.0",
|
|
449
|
+
version: "22.2.3",
|
|
450
|
+
ngImport: i0,
|
|
451
|
+
type: TxTabList,
|
|
452
|
+
decorators: [{
|
|
453
|
+
type: Component,
|
|
454
|
+
args: [{
|
|
455
|
+
selector: "tx-tab-list",
|
|
456
|
+
imports: [TxIcon],
|
|
457
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
458
|
+
host: {
|
|
459
|
+
class: "tx-tab-list",
|
|
460
|
+
"[class]": "tabs.passThrough().list?.class",
|
|
461
|
+
"[style]": "tabs.passThrough().list?.style",
|
|
462
|
+
"[attr.data-styled]": "!tabs.isUnstyled() || null",
|
|
463
|
+
"[attr.data-variant]": "tabs.variant()",
|
|
464
|
+
"[attr.data-size]": "tabs.size()",
|
|
465
|
+
"[attr.data-orientation]": "tabs.orientation()",
|
|
466
|
+
"[class.tx-tab-list--raised]": "tabs.raised()",
|
|
467
|
+
"[class.tx-tab-list--scrollable]": "tabs.scrollable()"
|
|
468
|
+
},
|
|
469
|
+
template: "<div class=\"tx-tab-list__track\" [class]=\"tabs.passThrough().track?.class\" [style]=\"tabs.passThrough().track?.style\">\n @if (navigators()) {\n <button\n type=\"button\"\n class=\"tx-tab-list__nav tx-tab-list__nav--previous\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [class.tx-tab-list__nav--hidden]=\"!canScrollPrevious()\"\n [class]=\"tabs.passThrough().previousButton?.class\"\n [style]=\"tabs.passThrough().previousButton?.style\"\n (click)=\"scrollPrevious()\"\n >\n <tx-icon name=\"chevron-left\" />\n </button>\n }\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the tabs inside the list take focus; the list handles their arrow keys -->\n <div\n #content\n class=\"tx-tab-list__content\"\n role=\"tablist\"\n [attr.aria-orientation]=\"tabs.orientation()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [class]=\"tabs.passThrough().content?.class\"\n [style]=\"tabs.passThrough().content?.style\"\n (keydown)=\"onKeydown($event)\"\n (scroll)=\"updateNavigators()\"\n >\n <ng-content />\n @if (bar(); as bar) {\n <span\n class=\"tx-tab-list__active-bar\"\n aria-hidden=\"true\"\n [style.--_bar-start.px]=\"bar.start\"\n [style.--_bar-size.px]=\"bar.size\"\n [class]=\"tabs.passThrough().activeBar?.class\"\n [style]=\"tabs.passThrough().activeBar?.style\"\n ></span>\n }\n </div>\n @if (navigators()) {\n <button\n type=\"button\"\n class=\"tx-tab-list__nav tx-tab-list__nav--next\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [class.tx-tab-list__nav--hidden]=\"!canScrollNext()\"\n [class]=\"tabs.passThrough().nextButton?.class\"\n [style]=\"tabs.passThrough().nextButton?.style\"\n (click)=\"scrollNext()\"\n >\n <tx-icon name=\"chevron-right\" />\n </button>\n }\n</div>\n@if (tabs.activeDescription(); as description) {\n <span class=\"tx-tab-list__description\" [class]=\"tabs.passThrough().description?.class\" [style]=\"tabs.passThrough().description?.style\">{{ description }}</span>\n}\n",
|
|
470
|
+
styles: [":host{display:flex;flex-direction:column;min-width:0}:host([data-variant=pills]){align-items:flex-start}.tx-tab-list__track{position:relative;display:flex;min-width:0;max-width:100%}:host([data-variant=pills]) .tx-tab-list__track{display:inline-flex}.tx-tab-list__content{position:relative;display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-behavior:smooth;scrollbar-width:none}.tx-tab-list__content::-webkit-scrollbar{display:none}:host([data-orientation=vertical]) .tx-tab-list__content{flex-direction:column;overflow:visible}.tx-tab-list__nav{position:absolute;top:0;bottom:0;z-index:2;display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:none;font:inherit;cursor:pointer}.tx-tab-list__nav--previous{inset-inline-start:0}.tx-tab-list__nav--next{inset-inline-end:0}.tx-tab-list__nav--hidden{visibility:hidden;opacity:0;pointer-events:none}.tx-tab-list__active-bar{position:absolute;z-index:1;pointer-events:none}.tx-tab-list__description{display:block}:host([data-styled]){--_nav-background: var(--tx-tabs-segmented-background);--_duration: var(--tx-tabs-transition-duration)}:host([data-styled]) .tx-tab-list__track{overflow:hidden;transition:background-color var(--_duration),border-color var(--_duration),box-shadow var(--_duration)}:host([data-styled][data-variant=segmented]) .tx-tab-list__track{border:var(--tx-tabs-segmented-border-width) solid var(--tx-tabs-segmented-border-color);border-radius:var(--tx-tabs-segmented-border-radius);background:var(--tx-tabs-segmented-background)}:host([data-styled][data-variant=segmented]) .tx-tab-list__content{gap:var(--tx-tabs-segmented-gap);padding:var(--tx-tabs-segmented-padding)}:host([data-styled][data-variant=segmented][data-size=small]) .tx-tab-list__track{border-radius:var(--tx-tabs-segmented-sm-border-radius)}:host([data-styled][data-variant=segmented][data-size=small]) .tx-tab-list__content{gap:var(--tx-tabs-segmented-sm-gap);padding:var(--tx-tabs-segmented-sm-padding)}:host([data-styled][data-variant=pills]){--_nav-background: var(--tx-tabs-pills-background);--_duration: var(--tx-tabs-pills-transition-duration)}:host([data-styled][data-variant=pills]) .tx-tab-list__track{border-radius:var(--tx-tabs-pills-border-radius);background:var(--tx-tabs-pills-background);box-shadow:inset 0 0 0 1px var(--tx-tabs-pills-ring-color)}:host([data-styled][data-variant=pills]) .tx-tab-list__content{gap:var(--tx-tabs-pills-gap);padding:var(--tx-tabs-pills-padding)}:host([data-styled].tx-tab-list--raised){--_nav-background: var(--tx-tabs-raised-background)}:host([data-styled][data-variant=segmented].tx-tab-list--raised) .tx-tab-list__track{border-color:var(--tx-tabs-raised-ring-color);background:var(--tx-tabs-raised-background);box-shadow:var(--tx-tabs-raised-shadow)}:host([data-styled][data-variant=pills].tx-tab-list--raised) .tx-tab-list__track{background:var(--tx-tabs-raised-background);box-shadow:inset 0 0 0 1px var(--tx-tabs-raised-ring-color),var(--tx-tabs-raised-shadow)}:host([data-styled][data-variant=line]){--_nav-background: var(--tx-tabs-line-background);--_duration: var(--tx-tabs-line-transition-duration)}:host([data-styled][data-variant=line]) .tx-tab-list__track{border-style:solid;border-width:var(--tx-tabs-line-border-width);border-color:var(--tx-tabs-line-border-color);background:var(--tx-tabs-line-background)}:host([data-styled][data-variant=line]) .tx-tab-list__active-bar{bottom:var(--tx-tabs-line-active-bar-bottom);left:var(--_bar-start);width:var(--_bar-size);height:var(--tx-tabs-line-active-bar-height);background:var(--tx-tabs-line-active-bar-background);transition:width var(--tx-tabs-line-active-bar-transition),left var(--tx-tabs-line-active-bar-transition)}:host([data-styled][data-variant=line][data-orientation=vertical]) .tx-tab-list__track{border-width:0;border-inline-end-width:1px}:host([data-styled][data-variant=line][data-orientation=vertical]) .tx-tab-list__active-bar{top:var(--_bar-start);right:0;bottom:auto;left:auto;width:var(--tx-tabs-line-active-bar-height);height:var(--_bar-size);transition:height var(--tx-tabs-line-active-bar-transition),top var(--tx-tabs-line-active-bar-transition)}:host([data-styled]) .tx-tab-list__nav{width:var(--tx-tabs-nav-button-width);background:var(--_nav-background);box-shadow:var(--tx-tabs-nav-button-shadow-size) var(--tx-tabs-nav-button-shadow-color);color:var(--tx-tabs-nav-button-color);font-size:var(--tx-font-size-md);transition:color var(--_duration),opacity var(--_duration),visibility var(--_duration)}:host([data-styled]) .tx-tab-list__nav:hover{color:var(--tx-tabs-nav-button-hover-color)}:host([data-styled]) .tx-tab-list__description{margin-top:var(--tx-tabs-description-gap);color:var(--tx-tabs-description-color);font-size:var(--tx-tabs-description-font-size);line-height:var(--tx-tabs-description-line-height)}@media(prefers-reduced-motion:reduce){.tx-tab-list__content{scroll-behavior:auto}:host([data-styled]) .tx-tab-list__track,:host([data-styled]) .tx-tab-list__nav,:host([data-styled]) .tx-tab-list__active-bar{transition:none}}\n"]
|
|
471
|
+
}]
|
|
472
|
+
}],
|
|
473
|
+
ctorParameters: () => [],
|
|
474
|
+
propDecorators: {
|
|
475
|
+
items: [{
|
|
476
|
+
type: i0.ContentChildren,
|
|
477
|
+
args: [i0.forwardRef(() => TxTab), {
|
|
478
|
+
descendants: true,
|
|
479
|
+
isSignal: true
|
|
480
|
+
}]
|
|
481
|
+
}],
|
|
482
|
+
content: [{
|
|
483
|
+
type: i0.ViewChild,
|
|
484
|
+
args: ["content", { isSignal: true }]
|
|
485
|
+
}],
|
|
486
|
+
ariaLabel: [{
|
|
487
|
+
type: i0.Input,
|
|
488
|
+
args: [{
|
|
489
|
+
isSignal: true,
|
|
490
|
+
alias: "ariaLabel",
|
|
491
|
+
required: false
|
|
492
|
+
}]
|
|
493
|
+
}],
|
|
494
|
+
ariaLabelledBy: [{
|
|
495
|
+
type: i0.Input,
|
|
496
|
+
args: [{
|
|
497
|
+
isSignal: true,
|
|
498
|
+
alias: "ariaLabelledBy",
|
|
499
|
+
required: false
|
|
500
|
+
}]
|
|
501
|
+
}]
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
var TxTabs = class TxTabs {
|
|
505
|
+
baseId = uniqueId("tx-tabs");
|
|
506
|
+
tabRegistrations = signal([], ...ngDevMode ? [{ debugName: "tabRegistrations" }] : /* istanbul ignore next */ []);
|
|
507
|
+
panelValues = signal([], ...ngDevMode ? [{ debugName: "panelValues" }] : /* istanbul ignore next */ []);
|
|
508
|
+
value = model(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
509
|
+
tabs = input(void 0, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
510
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
511
|
+
ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
512
|
+
variant = input("segmented", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
513
|
+
size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
514
|
+
orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
515
|
+
raised = input(false, {
|
|
516
|
+
...ngDevMode ? { debugName: "raised" } : /* istanbul ignore next */ {},
|
|
517
|
+
transform: booleanAttribute
|
|
518
|
+
});
|
|
519
|
+
scrollable = input(false, {
|
|
520
|
+
...ngDevMode ? { debugName: "scrollable" } : /* istanbul ignore next */ {},
|
|
521
|
+
transform: booleanAttribute
|
|
522
|
+
});
|
|
523
|
+
showNavigators = input(true, {
|
|
524
|
+
...ngDevMode ? { debugName: "showNavigators" } : /* istanbul ignore next */ {},
|
|
525
|
+
transform: booleanAttribute
|
|
526
|
+
});
|
|
527
|
+
lazy = input(false, {
|
|
528
|
+
...ngDevMode ? { debugName: "lazy" } : /* istanbul ignore next */ {},
|
|
529
|
+
transform: booleanAttribute
|
|
530
|
+
});
|
|
531
|
+
selectOnFocus = input(false, {
|
|
532
|
+
...ngDevMode ? { debugName: "selectOnFocus" } : /* istanbul ignore next */ {},
|
|
533
|
+
transform: booleanAttribute
|
|
534
|
+
});
|
|
535
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
536
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
537
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
538
|
+
unstyled = input(void 0, {
|
|
539
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
540
|
+
transform: optionalBoolean
|
|
541
|
+
});
|
|
542
|
+
tabChange = output();
|
|
543
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
544
|
+
passThrough = injectPassThrough("tabs", this, this.pt, this.ptOptions);
|
|
545
|
+
hostStyle = computed(() => ({
|
|
546
|
+
...toStyleObject(this.dt(), "--tx-tabs"),
|
|
547
|
+
...this.passThrough().root?.style
|
|
548
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
549
|
+
activeDescription = computed(() => {
|
|
550
|
+
const value = this.value();
|
|
551
|
+
return this.tabRegistrations().find((tab) => tab.value() === value)?.description();
|
|
552
|
+
}, ...ngDevMode ? [{ debugName: "activeDescription" }] : /* istanbul ignore next */ []);
|
|
553
|
+
focusValue = computed(() => {
|
|
554
|
+
const tabs = this.tabRegistrations().filter((tab) => !tab.disabled());
|
|
555
|
+
const value = this.value();
|
|
556
|
+
return (tabs.find((tab) => tab.value() === value) ?? tabs[0])?.value();
|
|
557
|
+
}, ...ngDevMode ? [{ debugName: "focusValue" }] : /* istanbul ignore next */ []);
|
|
558
|
+
select(value) {
|
|
559
|
+
if (this.value() === value) return;
|
|
560
|
+
this.value.set(value);
|
|
561
|
+
this.tabChange.emit(value);
|
|
562
|
+
}
|
|
563
|
+
hasPanel(value) {
|
|
564
|
+
return this.panelValues().some((panel) => panel() === value);
|
|
565
|
+
}
|
|
566
|
+
tabId(value) {
|
|
567
|
+
return `${this.baseId}-tab-${this.idPart(value)}`;
|
|
568
|
+
}
|
|
569
|
+
panelId(value) {
|
|
570
|
+
return `${this.baseId}-panel-${this.idPart(value)}`;
|
|
571
|
+
}
|
|
572
|
+
registerTab(tab) {
|
|
573
|
+
this.tabRegistrations.update((tabs) => [...tabs, tab]);
|
|
574
|
+
return () => this.tabRegistrations.update((tabs) => tabs.filter((item) => item !== tab));
|
|
575
|
+
}
|
|
576
|
+
registerPanel(value) {
|
|
577
|
+
this.panelValues.update((panels) => [...panels, value]);
|
|
578
|
+
return () => this.panelValues.update((panels) => panels.filter((item) => item !== value));
|
|
579
|
+
}
|
|
580
|
+
idPart(value) {
|
|
581
|
+
return String(value).replace(/[^\w-]/g, "_");
|
|
582
|
+
}
|
|
583
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
584
|
+
minVersion: "12.0.0",
|
|
585
|
+
version: "22.2.3",
|
|
586
|
+
ngImport: i0,
|
|
587
|
+
type: TxTabs,
|
|
588
|
+
deps: [],
|
|
589
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
590
|
+
});
|
|
591
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
592
|
+
minVersion: "17.0.0",
|
|
593
|
+
version: "22.2.3",
|
|
594
|
+
type: TxTabs,
|
|
595
|
+
isStandalone: true,
|
|
596
|
+
selector: "tx-tabs",
|
|
597
|
+
inputs: {
|
|
598
|
+
value: {
|
|
599
|
+
classPropertyName: "value",
|
|
600
|
+
publicName: "value",
|
|
601
|
+
isSignal: true,
|
|
602
|
+
isRequired: false,
|
|
603
|
+
transformFunction: null
|
|
604
|
+
},
|
|
605
|
+
tabs: {
|
|
606
|
+
classPropertyName: "tabs",
|
|
607
|
+
publicName: "tabs",
|
|
608
|
+
isSignal: true,
|
|
609
|
+
isRequired: false,
|
|
610
|
+
transformFunction: null
|
|
611
|
+
},
|
|
612
|
+
ariaLabel: {
|
|
613
|
+
classPropertyName: "ariaLabel",
|
|
614
|
+
publicName: "ariaLabel",
|
|
615
|
+
isSignal: true,
|
|
616
|
+
isRequired: false,
|
|
617
|
+
transformFunction: null
|
|
618
|
+
},
|
|
619
|
+
ariaLabelledBy: {
|
|
620
|
+
classPropertyName: "ariaLabelledBy",
|
|
621
|
+
publicName: "ariaLabelledBy",
|
|
622
|
+
isSignal: true,
|
|
623
|
+
isRequired: false,
|
|
624
|
+
transformFunction: null
|
|
625
|
+
},
|
|
626
|
+
variant: {
|
|
627
|
+
classPropertyName: "variant",
|
|
628
|
+
publicName: "variant",
|
|
629
|
+
isSignal: true,
|
|
630
|
+
isRequired: false,
|
|
631
|
+
transformFunction: null
|
|
632
|
+
},
|
|
633
|
+
size: {
|
|
634
|
+
classPropertyName: "size",
|
|
635
|
+
publicName: "size",
|
|
636
|
+
isSignal: true,
|
|
637
|
+
isRequired: false,
|
|
638
|
+
transformFunction: null
|
|
639
|
+
},
|
|
640
|
+
orientation: {
|
|
641
|
+
classPropertyName: "orientation",
|
|
642
|
+
publicName: "orientation",
|
|
643
|
+
isSignal: true,
|
|
644
|
+
isRequired: false,
|
|
645
|
+
transformFunction: null
|
|
646
|
+
},
|
|
647
|
+
raised: {
|
|
648
|
+
classPropertyName: "raised",
|
|
649
|
+
publicName: "raised",
|
|
650
|
+
isSignal: true,
|
|
651
|
+
isRequired: false,
|
|
652
|
+
transformFunction: null
|
|
653
|
+
},
|
|
654
|
+
scrollable: {
|
|
655
|
+
classPropertyName: "scrollable",
|
|
656
|
+
publicName: "scrollable",
|
|
657
|
+
isSignal: true,
|
|
658
|
+
isRequired: false,
|
|
659
|
+
transformFunction: null
|
|
660
|
+
},
|
|
661
|
+
showNavigators: {
|
|
662
|
+
classPropertyName: "showNavigators",
|
|
663
|
+
publicName: "showNavigators",
|
|
664
|
+
isSignal: true,
|
|
665
|
+
isRequired: false,
|
|
666
|
+
transformFunction: null
|
|
667
|
+
},
|
|
668
|
+
lazy: {
|
|
669
|
+
classPropertyName: "lazy",
|
|
670
|
+
publicName: "lazy",
|
|
671
|
+
isSignal: true,
|
|
672
|
+
isRequired: false,
|
|
673
|
+
transformFunction: null
|
|
674
|
+
},
|
|
675
|
+
selectOnFocus: {
|
|
676
|
+
classPropertyName: "selectOnFocus",
|
|
677
|
+
publicName: "selectOnFocus",
|
|
678
|
+
isSignal: true,
|
|
679
|
+
isRequired: false,
|
|
680
|
+
transformFunction: null
|
|
681
|
+
},
|
|
682
|
+
dt: {
|
|
683
|
+
classPropertyName: "dt",
|
|
684
|
+
publicName: "dt",
|
|
685
|
+
isSignal: true,
|
|
686
|
+
isRequired: false,
|
|
687
|
+
transformFunction: null
|
|
688
|
+
},
|
|
689
|
+
pt: {
|
|
690
|
+
classPropertyName: "pt",
|
|
691
|
+
publicName: "pt",
|
|
692
|
+
isSignal: true,
|
|
693
|
+
isRequired: false,
|
|
694
|
+
transformFunction: null
|
|
695
|
+
},
|
|
696
|
+
ptOptions: {
|
|
697
|
+
classPropertyName: "ptOptions",
|
|
698
|
+
publicName: "ptOptions",
|
|
699
|
+
isSignal: true,
|
|
700
|
+
isRequired: false,
|
|
701
|
+
transformFunction: null
|
|
702
|
+
},
|
|
703
|
+
unstyled: {
|
|
704
|
+
classPropertyName: "unstyled",
|
|
705
|
+
publicName: "unstyled",
|
|
706
|
+
isSignal: true,
|
|
707
|
+
isRequired: false,
|
|
708
|
+
transformFunction: null
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
outputs: {
|
|
712
|
+
value: "valueChange",
|
|
713
|
+
tabChange: "tabChange"
|
|
714
|
+
},
|
|
715
|
+
host: {
|
|
716
|
+
properties: {
|
|
717
|
+
"class": "passThrough().root?.class",
|
|
718
|
+
"style": "hostStyle()",
|
|
719
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
720
|
+
"attr.data-variant": "variant()",
|
|
721
|
+
"attr.data-size": "size()",
|
|
722
|
+
"attr.data-orientation": "orientation()",
|
|
723
|
+
"class.tx-tabs--raised": "raised()"
|
|
724
|
+
},
|
|
725
|
+
classAttribute: "tx-tabs"
|
|
726
|
+
},
|
|
727
|
+
providers: [{
|
|
728
|
+
provide: TX_TABS,
|
|
729
|
+
useExisting: TxTabs
|
|
730
|
+
}],
|
|
731
|
+
ngImport: i0,
|
|
732
|
+
template: `
|
|
733
|
+
@if (tabs(); as items) {
|
|
734
|
+
<tx-tab-list [ariaLabel]="ariaLabel()" [ariaLabelledBy]="ariaLabelledBy()">
|
|
735
|
+
@for (item of items; track item.value) {
|
|
736
|
+
<tx-tab
|
|
737
|
+
[value]="item.value"
|
|
738
|
+
[icon]="item.icon"
|
|
739
|
+
[badge]="item.badge"
|
|
740
|
+
[description]="item.description"
|
|
741
|
+
[disabled]="item.disabled ?? false"
|
|
742
|
+
[txTooltip]="item.tooltip"
|
|
743
|
+
tooltipPlacement="top"
|
|
744
|
+
>{{ item.label }}</tx-tab
|
|
745
|
+
>
|
|
746
|
+
}
|
|
747
|
+
</tx-tab-list>
|
|
748
|
+
}
|
|
749
|
+
<ng-content />
|
|
750
|
+
`,
|
|
751
|
+
isInline: true,
|
|
752
|
+
styles: [":host{display:flex;flex-direction:column;min-width:0}\n"],
|
|
753
|
+
dependencies: [
|
|
754
|
+
{
|
|
755
|
+
kind: "component",
|
|
756
|
+
type: TxTabList,
|
|
757
|
+
selector: "tx-tab-list",
|
|
758
|
+
inputs: ["ariaLabel", "ariaLabelledBy"]
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
kind: "component",
|
|
762
|
+
type: TxTab,
|
|
763
|
+
selector: "tx-tab, a[txTab], button[txTab]",
|
|
764
|
+
inputs: [
|
|
765
|
+
"value",
|
|
766
|
+
"icon",
|
|
767
|
+
"badge",
|
|
768
|
+
"description",
|
|
769
|
+
"disabled"
|
|
770
|
+
]
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
kind: "directive",
|
|
774
|
+
type: TxTooltip,
|
|
775
|
+
selector: "[txTooltip]",
|
|
776
|
+
inputs: [
|
|
777
|
+
"txTooltip",
|
|
778
|
+
"tooltipPlacement",
|
|
779
|
+
"tooltipEvent",
|
|
780
|
+
"tooltipShowDelay",
|
|
781
|
+
"tooltipHideDelay",
|
|
782
|
+
"tooltipLife",
|
|
783
|
+
"tooltipOffset",
|
|
784
|
+
"tooltipArrow",
|
|
785
|
+
"tooltipInteractive",
|
|
786
|
+
"tooltipDisabled",
|
|
787
|
+
"tooltipOverflowOnly",
|
|
788
|
+
"tooltipMultiline",
|
|
789
|
+
"tooltipContext",
|
|
790
|
+
"tooltipClass",
|
|
791
|
+
"tooltipDt",
|
|
792
|
+
"tooltipPt",
|
|
793
|
+
"tooltipPtOptions",
|
|
794
|
+
"tooltipUnstyled"
|
|
795
|
+
],
|
|
796
|
+
outputs: ["tooltipShown", "tooltipHidden"],
|
|
797
|
+
exportAs: ["txTooltip"]
|
|
798
|
+
}
|
|
799
|
+
],
|
|
800
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
801
|
+
});
|
|
802
|
+
};
|
|
803
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
804
|
+
minVersion: "12.0.0",
|
|
805
|
+
version: "22.2.3",
|
|
806
|
+
ngImport: i0,
|
|
807
|
+
type: TxTabs,
|
|
808
|
+
decorators: [{
|
|
809
|
+
type: Component,
|
|
810
|
+
args: [{
|
|
811
|
+
selector: "tx-tabs",
|
|
812
|
+
imports: [
|
|
813
|
+
TxTabList,
|
|
814
|
+
TxTab,
|
|
815
|
+
TxTooltip
|
|
816
|
+
],
|
|
817
|
+
template: `
|
|
818
|
+
@if (tabs(); as items) {
|
|
819
|
+
<tx-tab-list [ariaLabel]="ariaLabel()" [ariaLabelledBy]="ariaLabelledBy()">
|
|
820
|
+
@for (item of items; track item.value) {
|
|
821
|
+
<tx-tab
|
|
822
|
+
[value]="item.value"
|
|
823
|
+
[icon]="item.icon"
|
|
824
|
+
[badge]="item.badge"
|
|
825
|
+
[description]="item.description"
|
|
826
|
+
[disabled]="item.disabled ?? false"
|
|
827
|
+
[txTooltip]="item.tooltip"
|
|
828
|
+
tooltipPlacement="top"
|
|
829
|
+
>{{ item.label }}</tx-tab
|
|
830
|
+
>
|
|
831
|
+
}
|
|
832
|
+
</tx-tab-list>
|
|
833
|
+
}
|
|
834
|
+
<ng-content />
|
|
835
|
+
`,
|
|
836
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
837
|
+
providers: [{
|
|
838
|
+
provide: TX_TABS,
|
|
839
|
+
useExisting: TxTabs
|
|
840
|
+
}],
|
|
841
|
+
host: {
|
|
842
|
+
class: "tx-tabs",
|
|
843
|
+
"[class]": "passThrough().root?.class",
|
|
844
|
+
"[style]": "hostStyle()",
|
|
845
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
846
|
+
"[attr.data-variant]": "variant()",
|
|
847
|
+
"[attr.data-size]": "size()",
|
|
848
|
+
"[attr.data-orientation]": "orientation()",
|
|
849
|
+
"[class.tx-tabs--raised]": "raised()"
|
|
850
|
+
},
|
|
851
|
+
styles: [":host{display:flex;flex-direction:column;min-width:0}\n"]
|
|
852
|
+
}]
|
|
853
|
+
}],
|
|
854
|
+
propDecorators: {
|
|
855
|
+
value: [{
|
|
856
|
+
type: i0.Input,
|
|
857
|
+
args: [{
|
|
858
|
+
isSignal: true,
|
|
859
|
+
alias: "value",
|
|
860
|
+
required: false
|
|
861
|
+
}]
|
|
862
|
+
}, {
|
|
863
|
+
type: i0.Output,
|
|
864
|
+
args: ["valueChange"]
|
|
865
|
+
}],
|
|
866
|
+
tabs: [{
|
|
867
|
+
type: i0.Input,
|
|
868
|
+
args: [{
|
|
869
|
+
isSignal: true,
|
|
870
|
+
alias: "tabs",
|
|
871
|
+
required: false
|
|
872
|
+
}]
|
|
873
|
+
}],
|
|
874
|
+
ariaLabel: [{
|
|
875
|
+
type: i0.Input,
|
|
876
|
+
args: [{
|
|
877
|
+
isSignal: true,
|
|
878
|
+
alias: "ariaLabel",
|
|
879
|
+
required: false
|
|
880
|
+
}]
|
|
881
|
+
}],
|
|
882
|
+
ariaLabelledBy: [{
|
|
883
|
+
type: i0.Input,
|
|
884
|
+
args: [{
|
|
885
|
+
isSignal: true,
|
|
886
|
+
alias: "ariaLabelledBy",
|
|
887
|
+
required: false
|
|
888
|
+
}]
|
|
889
|
+
}],
|
|
890
|
+
variant: [{
|
|
891
|
+
type: i0.Input,
|
|
892
|
+
args: [{
|
|
893
|
+
isSignal: true,
|
|
894
|
+
alias: "variant",
|
|
895
|
+
required: false
|
|
896
|
+
}]
|
|
897
|
+
}],
|
|
898
|
+
size: [{
|
|
899
|
+
type: i0.Input,
|
|
900
|
+
args: [{
|
|
901
|
+
isSignal: true,
|
|
902
|
+
alias: "size",
|
|
903
|
+
required: false
|
|
904
|
+
}]
|
|
905
|
+
}],
|
|
906
|
+
orientation: [{
|
|
907
|
+
type: i0.Input,
|
|
908
|
+
args: [{
|
|
909
|
+
isSignal: true,
|
|
910
|
+
alias: "orientation",
|
|
911
|
+
required: false
|
|
912
|
+
}]
|
|
913
|
+
}],
|
|
914
|
+
raised: [{
|
|
915
|
+
type: i0.Input,
|
|
916
|
+
args: [{
|
|
917
|
+
isSignal: true,
|
|
918
|
+
alias: "raised",
|
|
919
|
+
required: false
|
|
920
|
+
}]
|
|
921
|
+
}],
|
|
922
|
+
scrollable: [{
|
|
923
|
+
type: i0.Input,
|
|
924
|
+
args: [{
|
|
925
|
+
isSignal: true,
|
|
926
|
+
alias: "scrollable",
|
|
927
|
+
required: false
|
|
928
|
+
}]
|
|
929
|
+
}],
|
|
930
|
+
showNavigators: [{
|
|
931
|
+
type: i0.Input,
|
|
932
|
+
args: [{
|
|
933
|
+
isSignal: true,
|
|
934
|
+
alias: "showNavigators",
|
|
935
|
+
required: false
|
|
936
|
+
}]
|
|
937
|
+
}],
|
|
938
|
+
lazy: [{
|
|
939
|
+
type: i0.Input,
|
|
940
|
+
args: [{
|
|
941
|
+
isSignal: true,
|
|
942
|
+
alias: "lazy",
|
|
943
|
+
required: false
|
|
944
|
+
}]
|
|
945
|
+
}],
|
|
946
|
+
selectOnFocus: [{
|
|
947
|
+
type: i0.Input,
|
|
948
|
+
args: [{
|
|
949
|
+
isSignal: true,
|
|
950
|
+
alias: "selectOnFocus",
|
|
951
|
+
required: false
|
|
952
|
+
}]
|
|
953
|
+
}],
|
|
954
|
+
dt: [{
|
|
955
|
+
type: i0.Input,
|
|
956
|
+
args: [{
|
|
957
|
+
isSignal: true,
|
|
958
|
+
alias: "dt",
|
|
959
|
+
required: false
|
|
960
|
+
}]
|
|
961
|
+
}],
|
|
962
|
+
pt: [{
|
|
963
|
+
type: i0.Input,
|
|
964
|
+
args: [{
|
|
965
|
+
isSignal: true,
|
|
966
|
+
alias: "pt",
|
|
967
|
+
required: false
|
|
968
|
+
}]
|
|
969
|
+
}],
|
|
970
|
+
ptOptions: [{
|
|
971
|
+
type: i0.Input,
|
|
972
|
+
args: [{
|
|
973
|
+
isSignal: true,
|
|
974
|
+
alias: "ptOptions",
|
|
975
|
+
required: false
|
|
976
|
+
}]
|
|
977
|
+
}],
|
|
978
|
+
unstyled: [{
|
|
979
|
+
type: i0.Input,
|
|
980
|
+
args: [{
|
|
981
|
+
isSignal: true,
|
|
982
|
+
alias: "unstyled",
|
|
983
|
+
required: false
|
|
984
|
+
}]
|
|
985
|
+
}],
|
|
986
|
+
tabChange: [{
|
|
987
|
+
type: i0.Output,
|
|
988
|
+
args: ["tabChange"]
|
|
989
|
+
}]
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
var TxTabPanels = class TxTabPanels {
|
|
993
|
+
tabs = inject(TX_TABS);
|
|
994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
995
|
+
minVersion: "12.0.0",
|
|
996
|
+
version: "22.2.3",
|
|
997
|
+
ngImport: i0,
|
|
998
|
+
type: TxTabPanels,
|
|
999
|
+
deps: [],
|
|
1000
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1001
|
+
});
|
|
1002
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1003
|
+
minVersion: "14.0.0",
|
|
1004
|
+
version: "22.2.3",
|
|
1005
|
+
type: TxTabPanels,
|
|
1006
|
+
isStandalone: true,
|
|
1007
|
+
selector: "tx-tab-panels",
|
|
1008
|
+
host: {
|
|
1009
|
+
properties: {
|
|
1010
|
+
"class": "tabs.passThrough().panels?.class",
|
|
1011
|
+
"style": "tabs.passThrough().panels?.style",
|
|
1012
|
+
"attr.data-styled": "!tabs.isUnstyled() || null",
|
|
1013
|
+
"attr.data-variant": "tabs.variant()"
|
|
1014
|
+
},
|
|
1015
|
+
classAttribute: "tx-tab-panels"
|
|
1016
|
+
},
|
|
1017
|
+
ngImport: i0,
|
|
1018
|
+
template: "<ng-content />",
|
|
1019
|
+
isInline: true,
|
|
1020
|
+
styles: [":host{display:block;min-width:0}:host([data-styled]){padding:var(--tx-tabs-panels-padding);background:var(--tx-tabs-panels-background);color:var(--tx-tabs-panels-color)}:host([data-styled][data-variant=\"line\"]){padding:var(--tx-tabs-panels-line-padding);background:var(--tx-tabs-panels-line-background)}\n"],
|
|
1021
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1025
|
+
minVersion: "12.0.0",
|
|
1026
|
+
version: "22.2.3",
|
|
1027
|
+
ngImport: i0,
|
|
1028
|
+
type: TxTabPanels,
|
|
1029
|
+
decorators: [{
|
|
1030
|
+
type: Component,
|
|
1031
|
+
args: [{
|
|
1032
|
+
selector: "tx-tab-panels",
|
|
1033
|
+
template: "<ng-content />",
|
|
1034
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1035
|
+
host: {
|
|
1036
|
+
class: "tx-tab-panels",
|
|
1037
|
+
"[class]": "tabs.passThrough().panels?.class",
|
|
1038
|
+
"[style]": "tabs.passThrough().panels?.style",
|
|
1039
|
+
"[attr.data-styled]": "!tabs.isUnstyled() || null",
|
|
1040
|
+
"[attr.data-variant]": "tabs.variant()"
|
|
1041
|
+
},
|
|
1042
|
+
styles: [":host{display:block;min-width:0}:host([data-styled]){padding:var(--tx-tabs-panels-padding);background:var(--tx-tabs-panels-background);color:var(--tx-tabs-panels-color)}:host([data-styled][data-variant=\"line\"]){padding:var(--tx-tabs-panels-line-padding);background:var(--tx-tabs-panels-line-background)}\n"]
|
|
1043
|
+
}]
|
|
1044
|
+
}]
|
|
1045
|
+
});
|
|
1046
|
+
var TxTabPanelContent = class TxTabPanelContent {
|
|
1047
|
+
template = inject(TemplateRef);
|
|
1048
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
1049
|
+
return !!context;
|
|
1050
|
+
}
|
|
1051
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1052
|
+
minVersion: "12.0.0",
|
|
1053
|
+
version: "22.2.3",
|
|
1054
|
+
ngImport: i0,
|
|
1055
|
+
type: TxTabPanelContent,
|
|
1056
|
+
deps: [],
|
|
1057
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1058
|
+
});
|
|
1059
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1060
|
+
minVersion: "14.0.0",
|
|
1061
|
+
version: "22.2.3",
|
|
1062
|
+
type: TxTabPanelContent,
|
|
1063
|
+
isStandalone: true,
|
|
1064
|
+
selector: "ng-template[txTabPanelContent]",
|
|
1065
|
+
ngImport: i0
|
|
1066
|
+
});
|
|
1067
|
+
};
|
|
1068
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1069
|
+
minVersion: "12.0.0",
|
|
1070
|
+
version: "22.2.3",
|
|
1071
|
+
ngImport: i0,
|
|
1072
|
+
type: TxTabPanelContent,
|
|
1073
|
+
decorators: [{
|
|
1074
|
+
type: Directive,
|
|
1075
|
+
args: [{ selector: "ng-template[txTabPanelContent]" }]
|
|
1076
|
+
}]
|
|
1077
|
+
});
|
|
1078
|
+
var TxTabPanel = class TxTabPanel {
|
|
1079
|
+
tabs = inject(TX_TABS);
|
|
1080
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
1081
|
+
lazyContent = contentChild(TxTabPanelContent, ...ngDevMode ? [{ debugName: "lazyContent" }] : /* istanbul ignore next */ []);
|
|
1082
|
+
visited = signal(false, ...ngDevMode ? [{ debugName: "visited" }] : /* istanbul ignore next */ []);
|
|
1083
|
+
active = computed(() => this.tabs.value() === this.value(), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
1084
|
+
destroyRef = inject(DestroyRef);
|
|
1085
|
+
ngOnInit() {
|
|
1086
|
+
const unregister = this.tabs.registerPanel(this.value);
|
|
1087
|
+
this.destroyRef.onDestroy(unregister);
|
|
1088
|
+
}
|
|
1089
|
+
constructor() {
|
|
1090
|
+
effect(() => {
|
|
1091
|
+
if (this.active()) untracked(() => this.visited.set(true));
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1095
|
+
minVersion: "12.0.0",
|
|
1096
|
+
version: "22.2.3",
|
|
1097
|
+
ngImport: i0,
|
|
1098
|
+
type: TxTabPanel,
|
|
1099
|
+
deps: [],
|
|
1100
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1101
|
+
});
|
|
1102
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1103
|
+
minVersion: "17.0.0",
|
|
1104
|
+
version: "22.2.3",
|
|
1105
|
+
type: TxTabPanel,
|
|
1106
|
+
isStandalone: true,
|
|
1107
|
+
selector: "tx-tab-panel",
|
|
1108
|
+
inputs: { value: {
|
|
1109
|
+
classPropertyName: "value",
|
|
1110
|
+
publicName: "value",
|
|
1111
|
+
isSignal: true,
|
|
1112
|
+
isRequired: true,
|
|
1113
|
+
transformFunction: null
|
|
1114
|
+
} },
|
|
1115
|
+
host: {
|
|
1116
|
+
attributes: {
|
|
1117
|
+
"role": "tabpanel",
|
|
1118
|
+
"tabindex": "0"
|
|
1119
|
+
},
|
|
1120
|
+
properties: {
|
|
1121
|
+
"class": "tabs.passThrough().panel?.class",
|
|
1122
|
+
"style": "tabs.passThrough().panel?.style",
|
|
1123
|
+
"attr.data-styled": "!tabs.isUnstyled() || null",
|
|
1124
|
+
"id": "tabs.panelId(value())",
|
|
1125
|
+
"attr.aria-labelledby": "tabs.tabId(value())",
|
|
1126
|
+
"attr.hidden": "active() ? null : \"\"",
|
|
1127
|
+
"class.tx-tab-panel--active": "active()"
|
|
1128
|
+
},
|
|
1129
|
+
classAttribute: "tx-tab-panel"
|
|
1130
|
+
},
|
|
1131
|
+
queries: [{
|
|
1132
|
+
propertyName: "lazyContent",
|
|
1133
|
+
first: true,
|
|
1134
|
+
predicate: TxTabPanelContent,
|
|
1135
|
+
descendants: true,
|
|
1136
|
+
isSignal: true
|
|
1137
|
+
}],
|
|
1138
|
+
ngImport: i0,
|
|
1139
|
+
template: `
|
|
1140
|
+
@if (!tabs.lazy() || active()) {
|
|
1141
|
+
<ng-content />
|
|
1142
|
+
}
|
|
1143
|
+
@if (lazyContent(); as content) {
|
|
1144
|
+
@if (active() || (visited() && !tabs.lazy())) {
|
|
1145
|
+
<ng-container *ngTemplateOutlet="content.template; context: { $implicit: value(), value: value() }" />
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
`,
|
|
1149
|
+
isInline: true,
|
|
1150
|
+
styles: [":host{display:block}:host([hidden]){display:none}:host([data-styled]:focus-visible){outline:var(--tx-tabs-focus-ring-width) solid var(--tx-tabs-focus-ring-color);outline-offset:var(--tx-tabs-segmented-focus-ring-offset)}\n"],
|
|
1151
|
+
dependencies: [{
|
|
1152
|
+
kind: "directive",
|
|
1153
|
+
type: NgTemplateOutlet,
|
|
1154
|
+
selector: "[ngTemplateOutlet]",
|
|
1155
|
+
inputs: [
|
|
1156
|
+
"ngTemplateOutletContext",
|
|
1157
|
+
"ngTemplateOutlet",
|
|
1158
|
+
"ngTemplateOutletInjector"
|
|
1159
|
+
]
|
|
1160
|
+
}],
|
|
1161
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1162
|
+
});
|
|
1163
|
+
};
|
|
1164
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1165
|
+
minVersion: "12.0.0",
|
|
1166
|
+
version: "22.2.3",
|
|
1167
|
+
ngImport: i0,
|
|
1168
|
+
type: TxTabPanel,
|
|
1169
|
+
decorators: [{
|
|
1170
|
+
type: Component,
|
|
1171
|
+
args: [{
|
|
1172
|
+
selector: "tx-tab-panel",
|
|
1173
|
+
imports: [NgTemplateOutlet],
|
|
1174
|
+
template: `
|
|
1175
|
+
@if (!tabs.lazy() || active()) {
|
|
1176
|
+
<ng-content />
|
|
1177
|
+
}
|
|
1178
|
+
@if (lazyContent(); as content) {
|
|
1179
|
+
@if (active() || (visited() && !tabs.lazy())) {
|
|
1180
|
+
<ng-container *ngTemplateOutlet="content.template; context: { $implicit: value(), value: value() }" />
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
`,
|
|
1184
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1185
|
+
host: {
|
|
1186
|
+
class: "tx-tab-panel",
|
|
1187
|
+
role: "tabpanel",
|
|
1188
|
+
tabindex: "0",
|
|
1189
|
+
"[class]": "tabs.passThrough().panel?.class",
|
|
1190
|
+
"[style]": "tabs.passThrough().panel?.style",
|
|
1191
|
+
"[attr.data-styled]": "!tabs.isUnstyled() || null",
|
|
1192
|
+
"[id]": "tabs.panelId(value())",
|
|
1193
|
+
"[attr.aria-labelledby]": "tabs.tabId(value())",
|
|
1194
|
+
"[attr.hidden]": "active() ? null : \"\"",
|
|
1195
|
+
"[class.tx-tab-panel--active]": "active()"
|
|
1196
|
+
},
|
|
1197
|
+
styles: [":host{display:block}:host([hidden]){display:none}:host([data-styled]:focus-visible){outline:var(--tx-tabs-focus-ring-width) solid var(--tx-tabs-focus-ring-color);outline-offset:var(--tx-tabs-segmented-focus-ring-offset)}\n"]
|
|
1198
|
+
}]
|
|
1199
|
+
}],
|
|
1200
|
+
ctorParameters: () => [],
|
|
1201
|
+
propDecorators: {
|
|
1202
|
+
value: [{
|
|
1203
|
+
type: i0.Input,
|
|
1204
|
+
args: [{
|
|
1205
|
+
isSignal: true,
|
|
1206
|
+
alias: "value",
|
|
1207
|
+
required: true
|
|
1208
|
+
}]
|
|
1209
|
+
}],
|
|
1210
|
+
lazyContent: [{
|
|
1211
|
+
type: i0.ContentChild,
|
|
1212
|
+
args: [i0.forwardRef(() => TxTabPanelContent), { isSignal: true }]
|
|
1213
|
+
}]
|
|
1214
|
+
}
|
|
1215
|
+
});
|
|
1216
|
+
export { TxTab, TxTabList, TxTabPanel, TxTabPanelContent, TxTabPanels, TxTabs };
|
|
1217
|
+
|
|
1218
|
+
//# sourceMappingURL=tectra-ng-ui-tabs.mjs.map
|