@cute-widgets/base 20.0.4 → 21.0.0
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/CHANGELOG.md +18 -6
- package/fesm2022/cute-widgets-base-abstract.mjs +19 -29
- package/fesm2022/cute-widgets-base-abstract.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-alert.mjs +10 -10
- package/fesm2022/cute-widgets-base-alert.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-autocomplete.mjs +14 -14
- package/fesm2022/cute-widgets-base-autocomplete.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-badge.mjs +46 -14
- package/fesm2022/cute-widgets-base-badge.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-bottom-sheet.mjs +11 -11
- package/fesm2022/cute-widgets-base-bottom-sheet.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-button-toggle.mjs +61 -37
- package/fesm2022/cute-widgets-base-button-toggle.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-button.mjs +176 -112
- package/fesm2022/cute-widgets-base-button.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-card.mjs +40 -40
- package/fesm2022/cute-widgets-base-card.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-checkbox.mjs +28 -28
- package/fesm2022/cute-widgets-base-checkbox.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-chips.mjs +49 -61
- package/fesm2022/cute-widgets-base-chips.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-collapse.mjs +120 -132
- package/fesm2022/cute-widgets-base-collapse.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-datetime.mjs +11 -11
- package/fesm2022/cute-widgets-base-core-datetime.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-directives.mjs +21 -21
- package/fesm2022/cute-widgets-base-core-directives.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-error.mjs +6 -6
- package/fesm2022/cute-widgets-base-core-error.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-layout.mjs +13 -1
- package/fesm2022/cute-widgets-base-core-layout.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-line.mjs +7 -7
- package/fesm2022/cute-widgets-base-core-line.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-nav.mjs +30 -28
- package/fesm2022/cute-widgets-base-core-nav.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-observers.mjs +16 -16
- package/fesm2022/cute-widgets-base-core-observers.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-option.mjs +10 -10
- package/fesm2022/cute-widgets-base-core-option.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-pipes.mjs +6 -6
- package/fesm2022/cute-widgets-base-core-pipes.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-ripple.mjs +3 -3
- package/fesm2022/cute-widgets-base-core-ripple.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-theming.mjs +7 -7
- package/fesm2022/cute-widgets-base-core-theming.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core-utils.mjs +3 -3
- package/fesm2022/cute-widgets-base-core-utils.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core.mjs +50 -38
- package/fesm2022/cute-widgets-base-core.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-datepicker.mjs +100 -99
- package/fesm2022/cute-widgets-base-datepicker.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-dialog.mjs +170 -135
- package/fesm2022/cute-widgets-base-dialog.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-divider.mjs +7 -7
- package/fesm2022/cute-widgets-base-divider.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-expansion.mjs +27 -27
- package/fesm2022/cute-widgets-base-expansion.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-form-field.mjs +28 -28
- package/fesm2022/cute-widgets-base-form-field.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-grid-list.mjs +22 -22
- package/fesm2022/cute-widgets-base-grid-list.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-icon.mjs +10 -10
- package/fesm2022/cute-widgets-base-icon.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-input.mjs +7 -7
- package/fesm2022/cute-widgets-base-input.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-layout-container.mjs +10 -10
- package/fesm2022/cute-widgets-base-layout-container.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-layout-stack.mjs +13 -13
- package/fesm2022/cute-widgets-base-layout-stack.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-layout.mjs +23 -23
- package/fesm2022/cute-widgets-base-layout.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-list.mjs +56 -56
- package/fesm2022/cute-widgets-base-list.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-menu.mjs +581 -388
- package/fesm2022/cute-widgets-base-menu.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-navbar.mjs +101 -61
- package/fesm2022/cute-widgets-base-navbar.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-paginator.mjs +13 -13
- package/fesm2022/cute-widgets-base-paginator.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-progress.mjs +10 -10
- package/fesm2022/cute-widgets-base-progress.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-radio.mjs +11 -11
- package/fesm2022/cute-widgets-base-radio.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-select.mjs +11 -11
- package/fesm2022/cute-widgets-base-select.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-sidenav.mjs +26 -26
- package/fesm2022/cute-widgets-base-sidenav.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-slider.mjs +10 -10
- package/fesm2022/cute-widgets-base-slider.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-snack-bar.mjs +28 -28
- package/fesm2022/cute-widgets-base-snack-bar.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-sort.mjs +13 -13
- package/fesm2022/cute-widgets-base-sort.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-spinner.mjs +8 -8
- package/fesm2022/cute-widgets-base-spinner.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-stepper.mjs +40 -40
- package/fesm2022/cute-widgets-base-stepper.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-table.mjs +58 -66
- package/fesm2022/cute-widgets-base-table.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-tabs.mjs +100 -75
- package/fesm2022/cute-widgets-base-tabs.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-timepicker.mjs +34 -63
- package/fesm2022/cute-widgets-base-timepicker.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-toolbar.mjs +13 -13
- package/fesm2022/cute-widgets-base-toolbar.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-tooltip.mjs +10 -10
- package/fesm2022/cute-widgets-base-tooltip.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-tree.mjs +25 -25
- package/fesm2022/cute-widgets-base-tree.mjs.map +1 -1
- package/fesm2022/cute-widgets-base.mjs +4 -4
- package/package.json +121 -121
- package/{abstract/index.d.ts → types/cute-widgets-base-abstract.d.ts} +9 -3
- package/{autocomplete/index.d.ts → types/cute-widgets-base-autocomplete.d.ts} +2 -2
- package/{badge/index.d.ts → types/cute-widgets-base-badge.d.ts} +6 -5
- package/{bottom-sheet/index.d.ts → types/cute-widgets-base-bottom-sheet.d.ts} +1 -1
- package/{button-toggle/index.d.ts → types/cute-widgets-base-button-toggle.d.ts} +15 -5
- package/{button/index.d.ts → types/cute-widgets-base-button.d.ts} +44 -22
- package/{checkbox/index.d.ts → types/cute-widgets-base-checkbox.d.ts} +1 -1
- package/{chips/index.d.ts → types/cute-widgets-base-chips.d.ts} +1 -1
- package/types/cute-widgets-base-collapse.d.ts +98 -0
- package/{core/layout/index.d.ts → types/cute-widgets-base-core-layout.d.ts} +7 -1
- package/{core/nav/index.d.ts → types/cute-widgets-base-core-nav.d.ts} +2 -1
- package/{core/observers/index.d.ts → types/cute-widgets-base-core-observers.d.ts} +1 -1
- package/{core/option/index.d.ts → types/cute-widgets-base-core-option.d.ts} +1 -1
- package/{core/index.d.ts → types/cute-widgets-base-core.d.ts} +7 -1
- package/{datepicker/index.d.ts → types/cute-widgets-base-datepicker.d.ts} +2 -2
- package/{dialog/index.d.ts → types/cute-widgets-base-dialog.d.ts} +81 -57
- package/{expansion/index.d.ts → types/cute-widgets-base-expansion.d.ts} +4 -14
- package/{form-field/index.d.ts → types/cute-widgets-base-form-field.d.ts} +1 -1
- package/{icon/index.d.ts → types/cute-widgets-base-icon.d.ts} +1 -1
- package/{input/index.d.ts → types/cute-widgets-base-input.d.ts} +1 -1
- package/{menu/index.d.ts → types/cute-widgets-base-menu.d.ts} +202 -121
- package/{navbar/index.d.ts → types/cute-widgets-base-navbar.d.ts} +24 -9
- package/{paginator/index.d.ts → types/cute-widgets-base-paginator.d.ts} +2 -2
- package/{progress/index.d.ts → types/cute-widgets-base-progress.d.ts} +1 -1
- package/{radio/index.d.ts → types/cute-widgets-base-radio.d.ts} +2 -2
- package/{sidenav/index.d.ts → types/cute-widgets-base-sidenav.d.ts} +1 -1
- package/{snack-bar/index.d.ts → types/cute-widgets-base-snack-bar.d.ts} +1 -1
- package/{sort/index.d.ts → types/cute-widgets-base-sort.d.ts} +1 -1
- package/{table/index.d.ts → types/cute-widgets-base-table.d.ts} +1 -1
- package/{tabs/index.d.ts → types/cute-widgets-base-tabs.d.ts} +35 -14
- package/{tree/index.d.ts → types/cute-widgets-base-tree.d.ts} +2 -2
- package/collapse/index.d.ts +0 -97
- /package/{alert/index.d.ts → types/cute-widgets-base-alert.d.ts} +0 -0
- /package/{card/index.d.ts → types/cute-widgets-base-card.d.ts} +0 -0
- /package/{core/animation/index.d.ts → types/cute-widgets-base-core-animation.d.ts} +0 -0
- /package/{core/datetime/index.d.ts → types/cute-widgets-base-core-datetime.d.ts} +0 -0
- /package/{core/directives/index.d.ts → types/cute-widgets-base-core-directives.d.ts} +0 -0
- /package/{core/error/index.d.ts → types/cute-widgets-base-core-error.d.ts} +0 -0
- /package/{core/interfaces/index.d.ts → types/cute-widgets-base-core-interfaces.d.ts} +0 -0
- /package/{core/line/index.d.ts → types/cute-widgets-base-core-line.d.ts} +0 -0
- /package/{core/pipes/index.d.ts → types/cute-widgets-base-core-pipes.d.ts} +0 -0
- /package/{core/ripple/index.d.ts → types/cute-widgets-base-core-ripple.d.ts} +0 -0
- /package/{core/testing/index.d.ts → types/cute-widgets-base-core-testing.d.ts} +0 -0
- /package/{core/theming/index.d.ts → types/cute-widgets-base-core-theming.d.ts} +0 -0
- /package/{core/types/index.d.ts → types/cute-widgets-base-core-types.d.ts} +0 -0
- /package/{core/utils/index.d.ts → types/cute-widgets-base-core-utils.d.ts} +0 -0
- /package/{divider/index.d.ts → types/cute-widgets-base-divider.d.ts} +0 -0
- /package/{grid-list/index.d.ts → types/cute-widgets-base-grid-list.d.ts} +0 -0
- /package/{layout/container/index.d.ts → types/cute-widgets-base-layout-container.d.ts} +0 -0
- /package/{layout/stack/index.d.ts → types/cute-widgets-base-layout-stack.d.ts} +0 -0
- /package/{layout/index.d.ts → types/cute-widgets-base-layout.d.ts} +0 -0
- /package/{list/index.d.ts → types/cute-widgets-base-list.d.ts} +0 -0
- /package/{select/index.d.ts → types/cute-widgets-base-select.d.ts} +0 -0
- /package/{slider/index.d.ts → types/cute-widgets-base-slider.d.ts} +0 -0
- /package/{spinner/index.d.ts → types/cute-widgets-base-spinner.d.ts} +0 -0
- /package/{stepper/index.d.ts → types/cute-widgets-base-stepper.d.ts} +0 -0
- /package/{timepicker/index.d.ts → types/cute-widgets-base-timepicker.d.ts} +0 -0
- /package/{toolbar/index.d.ts → types/cute-widgets-base-toolbar.d.ts} +0 -0
- /package/{tooltip/index.d.ts → types/cute-widgets-base-tooltip.d.ts} +0 -0
- /package/{index.d.ts → types/cute-widgets-base.d.ts} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Directive, TemplateRef, DestroyRef, EventEmitter, ViewContainerRef,
|
|
3
|
-
import { animation, state, animate, style, trigger, transition } from '@angular/animations';
|
|
2
|
+
import { InjectionToken, inject, Directive, TemplateRef, DestroyRef, EventEmitter, ViewContainerRef, booleanAttribute, numberAttribute, Output, Input, ViewChild, ViewChildren, ContentChildren, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, ContentChild, NgModule } from '@angular/core';
|
|
4
3
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
5
4
|
import { CuteLayoutControl, CuteFocusableControl } from '@cute-widgets/base/abstract';
|
|
6
5
|
import { fromEvent, debounceTime, Subject } from 'rxjs';
|
|
@@ -8,7 +7,9 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
8
7
|
import { moveItemInArray, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
|
9
8
|
import * as i1 from '@cute-widgets/base/core/nav';
|
|
10
9
|
import { CuteNavModule, CuteNavLink } from '@cute-widgets/base/core/nav';
|
|
11
|
-
import {
|
|
10
|
+
import { Scheduler, _animationsDisabled } from '@cute-widgets/base/core';
|
|
11
|
+
import * as i2 from '@cute-widgets/base/button';
|
|
12
|
+
import { CuteButtonModule } from '@cute-widgets/base/button';
|
|
12
13
|
import { CuteObserveVisibility } from '@cute-widgets/base/core/observers';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -33,10 +34,10 @@ class CuteTabLabel {
|
|
|
33
34
|
constructor() {
|
|
34
35
|
this._closestTab = inject(CUTE_TAB, { optional: true });
|
|
35
36
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
37
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
38
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: CuteTabLabel, isStandalone: true, selector: "ng-template[cute-tab-label], ng-template[cuteTabLabel]", providers: [{ provide: CUTE_TAB_LABEL, useExisting: CuteTabLabel }], exportAs: ["cuteTabLabel"], ngImport: i0 }); }
|
|
38
39
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabLabel, decorators: [{
|
|
40
41
|
type: Directive,
|
|
41
42
|
args: [{
|
|
42
43
|
selector: 'ng-template[cute-tab-label], ng-template[cuteTabLabel]',
|
|
@@ -67,10 +68,10 @@ class CuteTabContent {
|
|
|
67
68
|
constructor() {
|
|
68
69
|
this.template = inject(TemplateRef);
|
|
69
70
|
}
|
|
70
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
71
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
72
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: CuteTabContent, isStandalone: true, selector: "ng-template[cute-tab-content], ng-template[cuteTabContent]", providers: [{ provide: CUTE_TAB_CONTENT, useExisting: CuteTabContent }], ngImport: i0 }); }
|
|
72
73
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabContent, decorators: [{
|
|
74
75
|
type: Directive,
|
|
75
76
|
args: [{
|
|
76
77
|
selector: 'ng-template[cute-tab-content], ng-template[cuteTabContent]',
|
|
@@ -89,10 +90,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
89
90
|
* This code is a modification of the `@angular/material` original
|
|
90
91
|
* code licensed under MIT-style License (https://angular.dev/license).
|
|
91
92
|
*/
|
|
92
|
-
const transitionAnimation = animation([
|
|
93
|
-
state('void', style({ transform: 'translateX({{offset}})', opacity: 0 })),
|
|
94
|
-
animate('300ms ease-out', style({ transform: 'translateX(0)', opacity: 1 })),
|
|
95
|
-
], { params: { offset: '30px' } });
|
|
96
93
|
let nextId$1 = 0;
|
|
97
94
|
/**
|
|
98
95
|
* Used to provide a tab group to a tab without causing a circular dependency.
|
|
@@ -170,6 +167,24 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
170
167
|
this._stretchTabs = "none";
|
|
171
168
|
}
|
|
172
169
|
}
|
|
170
|
+
/** Duration for the tab animation. Will be normalized to milliseconds if no units are set. */
|
|
171
|
+
get animationDuration() { return this._animationDuration; }
|
|
172
|
+
set animationDuration(value) {
|
|
173
|
+
const stringValue = value + '';
|
|
174
|
+
this._animationDuration = /^\d+$/.test(stringValue) ? value + 'ms' : stringValue;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Possible position for the tab header.
|
|
178
|
+
* @default top
|
|
179
|
+
*/
|
|
180
|
+
get headerPosition() { return this._headerPosition; }
|
|
181
|
+
set headerPosition(newPosition) {
|
|
182
|
+
if (newPosition !== this._headerPosition) {
|
|
183
|
+
this._headerPosition = newPosition;
|
|
184
|
+
Promise.resolve().then(() => this.scrollToTab());
|
|
185
|
+
this.headerPositionChange.emit(newPosition);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
173
188
|
constructor() {
|
|
174
189
|
super();
|
|
175
190
|
this._indexToChange = null;
|
|
@@ -186,13 +201,10 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
186
201
|
*/
|
|
187
202
|
this.alignTabs = "start";
|
|
188
203
|
this._stretchTabs = "none";
|
|
204
|
+
this._animationDuration = "";
|
|
189
205
|
/** Whether the tab group will change its height to the height of the currently active tab. */
|
|
190
206
|
this.dynamicHeight = false;
|
|
191
|
-
|
|
192
|
-
* Possible positions for the tab header.
|
|
193
|
-
* @default top
|
|
194
|
-
*/
|
|
195
|
-
this.headerPosition = 'top';
|
|
207
|
+
this._headerPosition = 'top';
|
|
196
208
|
/** Use `underline` style for horizontal tabs. */
|
|
197
209
|
this.underlineTabs = false;
|
|
198
210
|
/**
|
|
@@ -209,10 +221,12 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
209
221
|
this.selectedIndexChange = new EventEmitter();
|
|
210
222
|
/** Event emitted when the active tab selection is about to change. */
|
|
211
223
|
this.selectedTabChanging = new EventEmitter();
|
|
212
|
-
/** Event emitted when the tab selection has changed. */
|
|
224
|
+
/** Event emitted when the tab selection has been changed. */
|
|
213
225
|
this.selectedTabChange = new EventEmitter();
|
|
214
226
|
/** Event emitted when focus has changed within a tab group. */
|
|
215
227
|
this.focusChange = new EventEmitter();
|
|
228
|
+
/** Event emitted when the position of tabs header has been changed. */
|
|
229
|
+
this.headerPositionChange = new EventEmitter();
|
|
216
230
|
/** Event emitted after the new tab was added. */
|
|
217
231
|
this.tabAdded = new EventEmitter();
|
|
218
232
|
/** Event emitted after the closable tab was removed. */
|
|
@@ -272,32 +286,37 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
272
286
|
}, 300);
|
|
273
287
|
}
|
|
274
288
|
/**
|
|
275
|
-
* Activates tab with specified index.
|
|
289
|
+
* Activates tab with the specified index.
|
|
276
290
|
* @param index Tab index
|
|
277
291
|
* @param origin (optional) Focus origin
|
|
292
|
+
* @returns A promise of a "logical" result, where _true_ means a successful change of the active tab, and _false_ otherwise.
|
|
293
|
+
* @async
|
|
278
294
|
*/
|
|
279
|
-
selectTab(index, origin = "program") {
|
|
295
|
+
async selectTab(index, origin = "program") {
|
|
280
296
|
if (!this.tabs)
|
|
281
|
-
return;
|
|
297
|
+
return false;
|
|
282
298
|
if (index < 0 || index >= this.tabs.length)
|
|
283
|
-
return;
|
|
299
|
+
return false;
|
|
284
300
|
if (index === this.selectedIndex)
|
|
285
|
-
return;
|
|
301
|
+
return true;
|
|
286
302
|
const tabsArray = this.tabs.toArray();
|
|
287
303
|
if (tabsArray[index].disabled)
|
|
288
|
-
return;
|
|
304
|
+
return false;
|
|
289
305
|
this._indexToChange = null;
|
|
290
306
|
this._selectedIndex = index;
|
|
291
307
|
this.tabs.forEach((tab, i) => {
|
|
292
|
-
tab.active = (i === index);
|
|
308
|
+
//tab.active = (i === index);
|
|
309
|
+
tab.active = false;
|
|
293
310
|
});
|
|
294
|
-
|
|
311
|
+
tabsArray[index].active = true;
|
|
312
|
+
await Scheduler.postTask(() => {
|
|
295
313
|
if (tabsArray[index].scrollNeeded) {
|
|
296
314
|
this.scrollToTab(index);
|
|
297
315
|
}
|
|
298
|
-
}, 100);
|
|
316
|
+
}, { delay: 100 });
|
|
299
317
|
this.selectedIndexChange.emit(index);
|
|
300
318
|
this.markForCheck();
|
|
319
|
+
return true;
|
|
301
320
|
}
|
|
302
321
|
_createChangeEvent(event) {
|
|
303
322
|
const tabsArray = this.tabs?.toArray() ?? [];
|
|
@@ -328,6 +347,7 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
328
347
|
return this.tabs?.toArray().indexOf(tab);
|
|
329
348
|
}
|
|
330
349
|
scrollToTab(index) {
|
|
350
|
+
index = index ?? this.selectedIndex;
|
|
331
351
|
if (index != null) {
|
|
332
352
|
const tabElement = this.tabLinks?.toArray()[index]?.element.nativeElement;
|
|
333
353
|
if (tabElement) {
|
|
@@ -381,7 +401,7 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
381
401
|
newTab.contentTemplate = content;
|
|
382
402
|
newTab.contentContext = context;
|
|
383
403
|
newTab.active = true; // !this.tabs || this.tabs.length === 0;
|
|
384
|
-
newTab.
|
|
404
|
+
newTab._isDynamic = true;
|
|
385
405
|
//componentRef.setInput("closable", true);
|
|
386
406
|
newTab.closable = closable ?? true;
|
|
387
407
|
componentRef.changeDetectorRef.detectChanges();
|
|
@@ -389,10 +409,13 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
389
409
|
const tabsArray = this.tabs?.toArray() || [];
|
|
390
410
|
tabsArray.push(newTab);
|
|
391
411
|
this.tabs?.reset(tabsArray);
|
|
392
|
-
this.tabAdded.emit();
|
|
393
412
|
if (newTab.active) {
|
|
394
|
-
|
|
413
|
+
const newIndex = tabsArray.length - 1;
|
|
414
|
+
if (await this.selectTab(newIndex)) {
|
|
415
|
+
this.scrollToTab(newIndex);
|
|
416
|
+
}
|
|
395
417
|
}
|
|
418
|
+
this.tabAdded.emit();
|
|
396
419
|
return componentRef;
|
|
397
420
|
}
|
|
398
421
|
/**
|
|
@@ -424,6 +447,7 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
424
447
|
this.selectedIndex = newIndex;
|
|
425
448
|
this.tabs.get(newIndex)?.link?.focus();
|
|
426
449
|
}
|
|
450
|
+
this.checkScrollButtons();
|
|
427
451
|
//this.markForCheck();
|
|
428
452
|
}
|
|
429
453
|
ngAfterViewInit() {
|
|
@@ -444,12 +468,12 @@ class CuteTabGroup extends CuteLayoutControl {
|
|
|
444
468
|
super.ngOnDestroy();
|
|
445
469
|
this._resizeObserver?.disconnect();
|
|
446
470
|
}
|
|
447
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
448
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
449
|
-
{ provide: CUTE_TAB_GROUP, useExisting:
|
|
450
|
-
], queries: [{ propertyName: "tabs", predicate: CuteTab }], viewQueries: [{ propertyName: "dynamicTabsContainer", first: true, predicate: ["dynamicTabs"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "headerContainer", first: true, predicate: ["headerContainer"], descendants: true, static: true }, { propertyName: "headerScroll", first: true, predicate: ["headerScroll"], descendants: true, static: true }, { propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, read: CuteNavLink }], exportAs: ["cuteTabGroup"], usesInheritance: true, ngImport: i0, template: "<div class=\"tab-header-wrapper\" #headerContainer>\r\n <div class=\"tab-header-scroll\" #headerScroll\r\n cdkDropList\r\n [cdkDropListOrientation]=\"isHorizontal ? 'horizontal' : 'vertical'\"\r\n (cdkDropListDropped)=\"onDrop($event)\">\r\n <nav [cuteNav]=\"isHorizontal ? (underlineTabs ? 'underline' : 'tabs') : 'pills'\"\r\n [selectedIndex]=\"selectedIndex\"\r\n [alignment]=\"alignTabs\"\r\n [stretchItems]=\"stretchTabs\"\r\n [preserveTabContent]=\"preserveContent\"\r\n [color]=\"color\"\r\n [class.flex-column]=\"!isHorizontal\"\r\n (selectedIndexChange)=\"selectTab($event)\"\r\n (selectedLinkChanging)=\"onNavLinkChanging($event)\"\r\n (selectedLinkChange)=\"onNavLinkChange($event)\"\r\n (focusChange)=\"onNavFocusChange($event)\">\r\n @for (tab of tabs; track tab.id; let i = $index) {\r\n <li cute-nav-item\r\n cdkDrag\r\n [cdkDragDisabled]=\"!dragEnabled || tabCount <= 1\"\r\n [cdkDragData]=\"tab\">\r\n <a href=\"#\" cute-nav-link\r\n [cuteObserveVisibility]=\"1\"\r\n [cuteObserveVisibilityRoot]=\"headerScroll\"\r\n (cuteObserveVisibility)=\"tab._visibilityChanged($event)\"\r\n [active]=\"tab.active\"\r\n [disabled]=\"tab.disabled\"\r\n [id]=\"tab.ariaLabelledby || undefined\"\r\n [attr.aria-disabled]=\"tab.disabled\"\r\n [attr.aria-controls]=\"tab.id\"\r\n [attr.tabindex]=\"tab.active && !tab.disabled ? 0 : -1\"\r\n role=\"tab\"\r\n #tabLink>\r\n\r\n @if (tab._templateLabel) {\r\n <ng-container\r\n *ngTemplateOutlet=\"tab._templateLabel; context: getLabelContext(tab, i)\">\r\n </ng-container>\r\n } @else {\r\n <!-- <ng-container>-->\r\n <!-- @if (dragEnabled && tabCount > 1) {-->\r\n <!-- <span cdkDragHandle>\u2630</span>-->\r\n <!-- }-->\r\n {{ tab.textLabel || 'Tab '+i }}\r\n <!-- </ng-container>-->\r\n }\r\n\r\n @if (tab.closable && tab.isDynamic) {\r\n <button cuteButton=\"close-button\"\r\n magnitude=\"smallest\"\r\n tabIndex=\"-1\"\r\n (click)=\"removeTab(i); $event.preventDefault();\"\r\n aria-label=\"Close tab\">\r\n </button>\r\n }\r\n\r\n </a>\r\n </li>\r\n }\r\n </nav>\r\n\r\n </div>\r\n\r\n @if (showScrollButtons) {\r\n <button cuteButton class=\"scroll-button left\"\r\n tabindex=\"-1\"\r\n magnitude=\"smallest\"\r\n visuallyHiddenLabel=\"Prev\"\r\n aria-hidden=\"true\"\r\n (click)=\"scrollHeader(-1)\"\r\n [disabled]=\"!canScrollLeft\">\r\n <!--\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" class=\"bi bi-chevron-left\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\"/>\r\n </svg>\r\n -->\r\n </button>\r\n <button cuteButton class=\"scroll-button right\"\r\n tabindex=\"-1\"\r\n magnitude=\"smallest\"\r\n visuallyHiddenLabel=\"Next\"\r\n aria-hidden=\"true\"\r\n (click)=\"scrollHeader(1)\"\r\n [disabled]=\"!canScrollRight\">\r\n <!--\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" class=\"bi bi-chevron-right\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\"/>\r\n </svg>\r\n -->\r\n </button>\r\n <!--\r\n <div class=\"scroll-indicator\"\r\n [class.active]=\"showScrollButtons\"\r\n [class.left-visible]=\"canScrollLeft\"\r\n [class.right-visible]=\"canScrollRight\">\r\n </div>\r\n -->\r\n }\r\n\r\n</div>\r\n\r\n<div class=\"tab-content-wrapper\">\r\n<!-- <div class=\"tab-content\">-->\r\n <ng-content></ng-content>\r\n <ng-container #dynamicTabs></ng-container>\r\n<!-- </div>-->\r\n</div>\r\n", styles: [".cute-tab-group{display:flex;flex-flow:column nowrap;width:100%}.cute-tab-group.tabs-top{flex-direction:column}.cute-tab-group.tabs-top .tab-header-wrapper{margin-bottom:.75rem}.cute-tab-group.tabs-bottom{flex-direction:column-reverse;justify-content:space-between}.cute-tab-group.tabs-bottom .tab-header-wrapper{margin-top:1rem}.cute-tab-group.tabs-bottom .nav-tabs{border:0;border-top:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.cute-tab-group.tabs-bottom .nav-tabs .nav-link{margin-top:calc(-2 * var(--bs-nav-tabs-border-width));margin-bottom:0;border-radius:0 0 var(--bs-nav-tabs-border-radius) var(--bs-nav-tabs-border-radius)}.cute-tab-group.tabs-bottom .nav-tabs .nav-link.active,.cute-tab-group.tabs-bottom .nav-tabs .nav-link:focus{border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.cute-tab-group.tabs-left,.cute-tab-group.tabs-start,[dir=rtl] .cute-tab-group.tabs-end{flex-direction:row}.cute-tab-group.tabs-left .tab-header-wrapper,.cute-tab-group.tabs-start .tab-header-wrapper,[dir=rtl] .cute-tab-group.tabs-end .tab-header-wrapper{flex-direction:row-reverse;margin-right:1rem}.cute-tab-group.tabs-right,.cute-tab-group.tabs-end,[dir=rtl] .cute-tab-group.tabs-start{flex-direction:row-reverse}.cute-tab-group.tabs-right .tab-header-wrapper,.cute-tab-group.tabs-end .tab-header-wrapper,[dir=rtl] .cute-tab-group.tabs-start .tab-header-wrapper{margin-left:1rem}.cute-tab-group .tab-header-wrapper{position:relative;overflow:hidden}.cute-tab-group .tab-header-scroll{display:flex;width:100%}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll{white-space:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll::-webkit-scrollbar,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll::-webkit-scrollbar{display:none}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll .cute-nav,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll .cute-nav{flex-wrap:nowrap;white-space:nowrap;flex-basis:100%}.cute-tab-group.tabs-left .tab-header-wrapper,.cute-tab-group.tabs-right .tab-header-wrapper,.cute-tab-group.tabs-start .tab-header-wrapper,.cute-tab-group.tabs-end .tab-header-wrapper{min-width:100px;height:100%;overflow-x:hidden;overflow-y:auto}.cute-tab-group.tabs-left .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-right .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-start .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-end .tab-header-wrapper .cute-nav{flex-wrap:nowrap;padding:.25rem;gap:.25rem;text-align:center;height:100%}.cute-tab-group.tabs-left .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-right .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-start .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-end .tab-header-wrapper .btn-add-tab{position:sticky;top:0}.cute-tab-group .tab-content-wrapper{overflow:auto;height:100%;flex:1;transform:none}.cute-tab-group .cute-nav-link{display:flex;align-items:center;justify-content:center;width:100%;gap:.25rem}[dir=rtl] .cute-tab-group .cute-nav-link{flex-direction:row-reverse}.cdk-drag-preview{display:flex;opacity:.8;box-sizing:border-box;border:none;border-radius:var(--bs-nav-tabs-border-radius);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;list-style:none;overflow:hidden;align-items:center;justify-content:center}.cdk-drag-placeholder{opacity:.2}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.scroll-button{position:absolute;top:0;bottom:0;width:1rem;font-weight:700;background:rgba(var(--bs-body-bg-rgb),.9);border:none;cursor:pointer;z-index:1;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.scroll-button:hover{opacity:1!important}.scroll-button[disabled]{opacity:0!important;cursor:default;pointer-events:none}.scroll-button.left{left:0;background:linear-gradient(to right,var(--bs-body-color) 0%,rgba(var(--bs-body-bg-rgb),0) 100%)}.scroll-button.right{right:0;background:linear-gradient(to left,var(--bs-body-color) 0%,rgba(var(--bs-body-bg-rgb),0) 100%)}.tab-header-wrapper:hover .scroll-button{opacity:.7}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--bs-body-color)}.scroll-indicator:before,.scroll-indicator:after{content:\"\";position:absolute;bottom:0;width:30%;height:1px;background:var(--bs-primary);transform:scaleX(0);transition:transform .3s}.scroll-indicator.left-visible:before{transform:scaleX(1);left:0}.scroll-indicator.right-visible:after{transform:scaleX(1);right:0}\n"], dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CuteNavModule }, { kind: "directive", type: i1.CuteNav, selector: "[cute-nav], [cuteNav]", inputs: ["cuteNav", "orientation", "alignment", "stretchItems", "preserveTabContent", "animation", "autoSelect", "selectedIndex"], outputs: ["selectedIndexChange", "selectedLinkChange", "selectedLinkChanging", "focusChange"], exportAs: ["cuteNav"] }, { kind: "component", type: i1.CuteNavItem, selector: "cute-nav-item, [cute-nav-item], [cuteNavItem]", inputs: ["preserveTabContent"], exportAs: ["cuteNavItem"] }, { kind: "directive", type: i1.CuteNavLink, selector: "a[cute-nav-link], a[cuteNavLink], button[cute-nav-link], button[cuteNavLink] ", inputs: ["active", "aria-controls"], exportAs: ["cuteNavLink"] }, { kind: "component", type: CuteButton, selector: "button[cuteButton], button[cute-button], a[cuteButton], a[cute-button], ", exportAs: ["cuteButton"] }, { kind: "directive", type: CuteObserveVisibility, selector: "[cuteObserveVisibility], [cute-observe-visibility]", inputs: ["cuteObserveVisibilityDisabled", "cuteObserveVisibilityDebounce", "cuteObserveVisibility", "cuteObserveVisibilityRootMargin", "cuteObserveVisibilityRoot"], outputs: ["cuteObserveVisibility"], exportAs: ["cuteObserveVisibility"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
472
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CuteTabGroup, isStandalone: true, selector: "cute-tab-group", inputs: { selectedIndex: ["selectedIndex", "selectedIndex", numberAttribute], alignTabs: ["cute-align-tabs", "alignTabs"], stretchTabs: ["cute-stretch-tabs", "stretchTabs"], animationDuration: "animationDuration", preserveContent: ["preserveContent", "preserveContent", booleanAttribute], dynamicHeight: ["dynamicHeight", "dynamicHeight", booleanAttribute], headerPosition: "headerPosition", underlineTabs: ["underlineTabs", "underlineTabs", booleanAttribute], dragEnabled: ["dragEnabled", "dragEnabled", booleanAttribute], tabScrollingAlignment: "tabScrollingAlignment" }, outputs: { selectedIndexChange: "selectedIndexChange", selectedTabChanging: "selectedTabChanging", selectedTabChange: "selectedTabChange", focusChange: "focusChange", headerPositionChange: "headerPositionChange", tabAdded: "tabAdded", tabRemoved: "tabRemoved" }, host: { properties: { "class.tabs-top": "headerPosition === 'top'", "class.tabs-bottom": "headerPosition === 'bottom'", "class.tabs-left": "headerPosition === 'left'", "class.tabs-right": "headerPosition === 'right'", "class.tabs-end": "headerPosition === 'end'", "class.tabs-start": "headerPosition === 'start'", "attr.cute-align-tabs": "alignTabs", "style.--cute-tab-animation-duration": "animationDuration" }, classAttribute: "cute-tab-group" }, providers: [
|
|
473
|
+
{ provide: CUTE_TAB_GROUP, useExisting: CuteTabGroup },
|
|
474
|
+
], queries: [{ propertyName: "tabs", predicate: CuteTab }], viewQueries: [{ propertyName: "dynamicTabsContainer", first: true, predicate: ["dynamicTabs"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "headerContainer", first: true, predicate: ["headerContainer"], descendants: true, static: true }, { propertyName: "headerScroll", first: true, predicate: ["headerScroll"], descendants: true, static: true }, { propertyName: "tabLinks", predicate: ["tabLink"], descendants: true, read: CuteNavLink }], exportAs: ["cuteTabGroup"], usesInheritance: true, ngImport: i0, template: "<div class=\"tab-header-wrapper\" #headerContainer>\r\n <div class=\"tab-header-scroll\" #headerScroll\r\n cdkDropList\r\n [cdkDropListOrientation]=\"isHorizontal ? 'horizontal' : 'vertical'\"\r\n (cdkDropListDropped)=\"onDrop($event)\">\r\n <nav [cuteNav]=\"isHorizontal ? (underlineTabs ? 'underline' : 'tabs') : 'pills'\"\r\n [selectedIndex]=\"selectedIndex\"\r\n [alignment]=\"alignTabs\"\r\n [stretchItems]=\"stretchTabs\"\r\n [preserveTabContent]=\"preserveContent\"\r\n [color]=\"color\"\r\n [class.flex-column]=\"!isHorizontal\"\r\n (selectedIndexChange)=\"selectTab($event)\"\r\n (selectedLinkChanging)=\"onNavLinkChanging($event)\"\r\n (selectedLinkChange)=\"onNavLinkChange($event)\"\r\n (focusChange)=\"onNavFocusChange($event)\">\r\n @for (tab of tabs; track tab.id; let i = $index) {\r\n <li cute-nav-item\r\n cdkDrag\r\n [cdkDragDisabled]=\"!dragEnabled || tabCount <= 1\"\r\n [cdkDragData]=\"tab\">\r\n <a href=\"#\" cute-nav-link\r\n [cuteObserveVisibility]=\"1\"\r\n [cuteObserveVisibilityRoot]=\"headerScroll\"\r\n (cuteObserveVisibility)=\"tab._visibilityChanged($event)\"\r\n [active]=\"tab.active\"\r\n [disabled]=\"tab.disabled\"\r\n [id]=\"tab.ariaLabelledby || undefined\"\r\n [attr.aria-disabled]=\"tab.disabled\"\r\n [attr.aria-controls]=\"tab.id\"\r\n [attr.tabindex]=\"tab.active && !tab.disabled ? 0 : -1\"\r\n role=\"tab\"\r\n #tabLink>\r\n\r\n @if (tab._templateLabel) {\r\n <ng-container\r\n *ngTemplateOutlet=\"tab._templateLabel; context: getLabelContext(tab, i)\">\r\n </ng-container>\r\n } @else {\r\n <!-- <ng-container>-->\r\n <!-- @if (dragEnabled && tabCount > 1) {-->\r\n <!-- <span cdkDragHandle>\u2630</span>-->\r\n <!-- }-->\r\n {{ tab.textLabel || 'Tab '+i }}\r\n <!-- </ng-container>-->\r\n }\r\n\r\n @if (tab.closable && tab._isDynamic) {\r\n <button cuteButton=\"close-button\"\r\n magnitude=\"smallest\"\r\n tabIndex=\"-1\"\r\n (click)=\"removeTab(i); $event.preventDefault();\"\r\n aria-label=\"Close tab\">\r\n </button>\r\n }\r\n\r\n </a>\r\n </li>\r\n }\r\n </nav>\r\n\r\n </div>\r\n\r\n @if (showScrollButtons) {\r\n <button cuteButton class=\"scroll-button left\"\r\n tabindex=\"-1\"\r\n magnitude=\"smallest\"\r\n visuallyHiddenLabel=\"Prev\"\r\n aria-hidden=\"true\"\r\n (click)=\"scrollHeader(-1)\"\r\n [disabled]=\"!canScrollLeft\">\r\n <!--\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" class=\"bi bi-chevron-left\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\"/>\r\n </svg>\r\n -->\r\n </button>\r\n <button cuteButton class=\"scroll-button right\"\r\n tabindex=\"-1\"\r\n magnitude=\"smallest\"\r\n visuallyHiddenLabel=\"Next\"\r\n aria-hidden=\"true\"\r\n (click)=\"scrollHeader(1)\"\r\n [disabled]=\"!canScrollRight\">\r\n <!--\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" class=\"bi bi-chevron-right\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\"/>\r\n </svg>\r\n -->\r\n </button>\r\n <!--\r\n <div class=\"scroll-indicator\"\r\n [class.active]=\"showScrollButtons\"\r\n [class.left-visible]=\"canScrollLeft\"\r\n [class.right-visible]=\"canScrollRight\">\r\n </div>\r\n -->\r\n }\r\n\r\n</div>\r\n\r\n<div class=\"tab-content-wrapper\">\r\n<!-- <div class=\"tab-content\">-->\r\n <ng-content></ng-content>\r\n <ng-container #dynamicTabs></ng-container>\r\n<!-- </div>-->\r\n</div>\r\n", styles: [".cute-tab-group{display:flex;flex-flow:column nowrap;width:100%}.cute-tab-group.tabs-top{flex-direction:column}.cute-tab-group.tabs-top .tab-header-wrapper{margin-bottom:.75rem}.cute-tab-group.tabs-bottom{flex-direction:column-reverse;justify-content:space-between}.cute-tab-group.tabs-bottom .tab-header-wrapper{margin-top:1rem}.cute-tab-group.tabs-bottom .nav-tabs{border:0;border-top:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.cute-tab-group.tabs-bottom .nav-tabs .nav-link{margin-top:calc(-2 * var(--bs-nav-tabs-border-width));margin-bottom:0;border-top:0;border-radius:0 0 var(--bs-nav-tabs-border-radius) var(--bs-nav-tabs-border-radius)}.cute-tab-group.tabs-bottom .nav-tabs .nav-link.active,.cute-tab-group.tabs-bottom .nav-tabs .nav-link:focus{border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.cute-tab-group.tabs-left,.cute-tab-group.tabs-start,[dir=rtl] .cute-tab-group.tabs-end{flex-direction:row}.cute-tab-group.tabs-left .tab-header-wrapper,.cute-tab-group.tabs-start .tab-header-wrapper,[dir=rtl] .cute-tab-group.tabs-end .tab-header-wrapper{flex-direction:row-reverse;margin-right:1rem}.cute-tab-group.tabs-right,.cute-tab-group.tabs-end,[dir=rtl] .cute-tab-group.tabs-start{flex-direction:row-reverse}.cute-tab-group.tabs-right .tab-header-wrapper,.cute-tab-group.tabs-end .tab-header-wrapper,[dir=rtl] .cute-tab-group.tabs-start .tab-header-wrapper{margin-left:1rem}.cute-tab-group .tab-header-wrapper{position:relative;overflow:hidden}.cute-tab-group .tab-header-scroll{display:flex;width:100%}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll{white-space:nowrap;overflow-x:auto;overflow-y:hidden;padding-top:.25rem;padding-bottom:.25rem;scrollbar-width:none}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll::-webkit-scrollbar,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll::-webkit-scrollbar{display:none}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll .cute-nav,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll .cute-nav{flex-wrap:nowrap;white-space:nowrap;flex-basis:100%}.cute-tab-group.tabs-left .tab-header-wrapper,.cute-tab-group.tabs-right .tab-header-wrapper,.cute-tab-group.tabs-start .tab-header-wrapper,.cute-tab-group.tabs-end .tab-header-wrapper{min-width:100px;height:100%;overflow-x:hidden;overflow-y:auto}.cute-tab-group.tabs-left .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-right .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-start .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-end .tab-header-wrapper .cute-nav{flex-wrap:nowrap;padding:.25rem;gap:.25rem;text-align:center;height:100%}.cute-tab-group.tabs-left .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-right .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-start .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-end .tab-header-wrapper .btn-add-tab{position:sticky;top:0}.cute-tab-group .tab-content-wrapper{overflow:auto;height:100%;flex:1;transform:none}.cute-tab-group .cute-nav-link{display:flex;align-items:center;justify-content:center;width:100%;gap:.5rem}[dir=rtl] .cute-tab-group .cute-nav-link{flex-direction:row-reverse}.cdk-drag-preview{display:flex;opacity:.8;box-sizing:border-box;border:none;border-radius:var(--bs-nav-tabs-border-radius);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;list-style:none;overflow:hidden;align-items:center;justify-content:center}.cdk-drag-placeholder{opacity:.2}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.scroll-button{position:absolute;top:0;bottom:0;width:1rem;font-weight:700;background:rgba(var(--bs-body-bg-rgb),.9);border:none;cursor:pointer;z-index:1;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.scroll-button:hover{opacity:1!important}.scroll-button[disabled]{opacity:0!important;cursor:default;pointer-events:none}.scroll-button.left{left:0;background:linear-gradient(to right,var(--bs-body-color) 0%,rgba(var(--bs-body-bg-rgb),0) 100%)}.scroll-button.right{right:0;background:linear-gradient(to left,var(--bs-body-color) 0%,rgba(var(--bs-body-bg-rgb),0) 100%)}.tab-header-wrapper:hover .scroll-button{opacity:.7}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--bs-body-color)}.scroll-indicator:before,.scroll-indicator:after{content:\"\";position:absolute;bottom:0;width:30%;height:1px;background:var(--bs-primary);transform:scaleX(0);transition:transform .3s}.scroll-indicator.left-visible:before{transform:scaleX(1);left:0}.scroll-indicator.right-visible:after{transform:scaleX(1);right:0}\n"], dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CuteNavModule }, { kind: "directive", type: i1.CuteNav, selector: "[cute-nav], [cuteNav]", inputs: ["cuteNav", "orientation", "alignment", "stretchItems", "preserveTabContent", "animation", "autoSelect", "selectedIndex"], outputs: ["selectedIndexChange", "selectedLinkChange", "selectedLinkChanging", "focusChange"], exportAs: ["cuteNav"] }, { kind: "component", type: i1.CuteNavItem, selector: "cute-nav-item, [cute-nav-item], [cuteNavItem]", inputs: ["preserveTabContent"], exportAs: ["cuteNavItem"] }, { kind: "directive", type: i1.CuteNavLink, selector: "a[cute-nav-link], a[cuteNavLink], button[cute-nav-link], button[cuteNavLink] ", inputs: ["active", "aria-controls"], exportAs: ["cuteNavLink"] }, { kind: "ngmodule", type: CuteButtonModule }, { kind: "component", type: i2.CuteButton, selector: "button[cuteButton], button[cute-button], a[cuteButton], a[cute-button], ", exportAs: ["cuteButton"] }, { kind: "directive", type: CuteObserveVisibility, selector: "[cuteObserveVisibility], [cute-observe-visibility]", inputs: ["cuteObserveVisibilityDisabled", "cuteObserveVisibilityDebounce", "cuteObserveVisibility", "cuteObserveVisibilityRootMargin", "cuteObserveVisibilityRoot"], outputs: ["cuteObserveVisibility"], exportAs: ["cuteObserveVisibility"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
451
475
|
}
|
|
452
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabGroup, decorators: [{
|
|
453
477
|
type: Component,
|
|
454
478
|
args: [{ selector: 'cute-tab-group', exportAs: "cuteTabGroup", host: {
|
|
455
479
|
"class": "cute-tab-group",
|
|
@@ -459,16 +483,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
459
483
|
"[class.tabs-right]": "headerPosition === 'right'",
|
|
460
484
|
"[class.tabs-end]": "headerPosition === 'end'",
|
|
461
485
|
"[class.tabs-start]": "headerPosition === 'start'",
|
|
486
|
+
"[attr.cute-align-tabs]": "alignTabs",
|
|
487
|
+
"[style.--cute-tab-animation-duration]": "animationDuration",
|
|
462
488
|
}, imports: [
|
|
463
489
|
CdkDropList,
|
|
464
490
|
CdkDrag,
|
|
465
491
|
NgTemplateOutlet,
|
|
466
492
|
CuteNavModule,
|
|
467
|
-
|
|
493
|
+
CuteButtonModule,
|
|
468
494
|
CuteObserveVisibility,
|
|
469
495
|
], providers: [
|
|
470
|
-
{ provide: CUTE_TAB_GROUP, useExisting:
|
|
471
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"tab-header-wrapper\" #headerContainer>\r\n <div class=\"tab-header-scroll\" #headerScroll\r\n cdkDropList\r\n [cdkDropListOrientation]=\"isHorizontal ? 'horizontal' : 'vertical'\"\r\n (cdkDropListDropped)=\"onDrop($event)\">\r\n <nav [cuteNav]=\"isHorizontal ? (underlineTabs ? 'underline' : 'tabs') : 'pills'\"\r\n [selectedIndex]=\"selectedIndex\"\r\n [alignment]=\"alignTabs\"\r\n [stretchItems]=\"stretchTabs\"\r\n [preserveTabContent]=\"preserveContent\"\r\n [color]=\"color\"\r\n [class.flex-column]=\"!isHorizontal\"\r\n (selectedIndexChange)=\"selectTab($event)\"\r\n (selectedLinkChanging)=\"onNavLinkChanging($event)\"\r\n (selectedLinkChange)=\"onNavLinkChange($event)\"\r\n (focusChange)=\"onNavFocusChange($event)\">\r\n @for (tab of tabs; track tab.id; let i = $index) {\r\n <li cute-nav-item\r\n cdkDrag\r\n [cdkDragDisabled]=\"!dragEnabled || tabCount <= 1\"\r\n [cdkDragData]=\"tab\">\r\n <a href=\"#\" cute-nav-link\r\n [cuteObserveVisibility]=\"1\"\r\n [cuteObserveVisibilityRoot]=\"headerScroll\"\r\n (cuteObserveVisibility)=\"tab._visibilityChanged($event)\"\r\n [active]=\"tab.active\"\r\n [disabled]=\"tab.disabled\"\r\n [id]=\"tab.ariaLabelledby || undefined\"\r\n [attr.aria-disabled]=\"tab.disabled\"\r\n [attr.aria-controls]=\"tab.id\"\r\n [attr.tabindex]=\"tab.active && !tab.disabled ? 0 : -1\"\r\n role=\"tab\"\r\n #tabLink>\r\n\r\n @if (tab._templateLabel) {\r\n <ng-container\r\n *ngTemplateOutlet=\"tab._templateLabel; context: getLabelContext(tab, i)\">\r\n </ng-container>\r\n } @else {\r\n <!-- <ng-container>-->\r\n <!-- @if (dragEnabled && tabCount > 1) {-->\r\n <!-- <span cdkDragHandle>\u2630</span>-->\r\n <!-- }-->\r\n {{ tab.textLabel || 'Tab '+i }}\r\n <!-- </ng-container>-->\r\n }\r\n\r\n @if (tab.closable && tab.
|
|
496
|
+
{ provide: CUTE_TAB_GROUP, useExisting: CuteTabGroup },
|
|
497
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"tab-header-wrapper\" #headerContainer>\r\n <div class=\"tab-header-scroll\" #headerScroll\r\n cdkDropList\r\n [cdkDropListOrientation]=\"isHorizontal ? 'horizontal' : 'vertical'\"\r\n (cdkDropListDropped)=\"onDrop($event)\">\r\n <nav [cuteNav]=\"isHorizontal ? (underlineTabs ? 'underline' : 'tabs') : 'pills'\"\r\n [selectedIndex]=\"selectedIndex\"\r\n [alignment]=\"alignTabs\"\r\n [stretchItems]=\"stretchTabs\"\r\n [preserveTabContent]=\"preserveContent\"\r\n [color]=\"color\"\r\n [class.flex-column]=\"!isHorizontal\"\r\n (selectedIndexChange)=\"selectTab($event)\"\r\n (selectedLinkChanging)=\"onNavLinkChanging($event)\"\r\n (selectedLinkChange)=\"onNavLinkChange($event)\"\r\n (focusChange)=\"onNavFocusChange($event)\">\r\n @for (tab of tabs; track tab.id; let i = $index) {\r\n <li cute-nav-item\r\n cdkDrag\r\n [cdkDragDisabled]=\"!dragEnabled || tabCount <= 1\"\r\n [cdkDragData]=\"tab\">\r\n <a href=\"#\" cute-nav-link\r\n [cuteObserveVisibility]=\"1\"\r\n [cuteObserveVisibilityRoot]=\"headerScroll\"\r\n (cuteObserveVisibility)=\"tab._visibilityChanged($event)\"\r\n [active]=\"tab.active\"\r\n [disabled]=\"tab.disabled\"\r\n [id]=\"tab.ariaLabelledby || undefined\"\r\n [attr.aria-disabled]=\"tab.disabled\"\r\n [attr.aria-controls]=\"tab.id\"\r\n [attr.tabindex]=\"tab.active && !tab.disabled ? 0 : -1\"\r\n role=\"tab\"\r\n #tabLink>\r\n\r\n @if (tab._templateLabel) {\r\n <ng-container\r\n *ngTemplateOutlet=\"tab._templateLabel; context: getLabelContext(tab, i)\">\r\n </ng-container>\r\n } @else {\r\n <!-- <ng-container>-->\r\n <!-- @if (dragEnabled && tabCount > 1) {-->\r\n <!-- <span cdkDragHandle>\u2630</span>-->\r\n <!-- }-->\r\n {{ tab.textLabel || 'Tab '+i }}\r\n <!-- </ng-container>-->\r\n }\r\n\r\n @if (tab.closable && tab._isDynamic) {\r\n <button cuteButton=\"close-button\"\r\n magnitude=\"smallest\"\r\n tabIndex=\"-1\"\r\n (click)=\"removeTab(i); $event.preventDefault();\"\r\n aria-label=\"Close tab\">\r\n </button>\r\n }\r\n\r\n </a>\r\n </li>\r\n }\r\n </nav>\r\n\r\n </div>\r\n\r\n @if (showScrollButtons) {\r\n <button cuteButton class=\"scroll-button left\"\r\n tabindex=\"-1\"\r\n magnitude=\"smallest\"\r\n visuallyHiddenLabel=\"Prev\"\r\n aria-hidden=\"true\"\r\n (click)=\"scrollHeader(-1)\"\r\n [disabled]=\"!canScrollLeft\">\r\n <!--\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" class=\"bi bi-chevron-left\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\"/>\r\n </svg>\r\n -->\r\n </button>\r\n <button cuteButton class=\"scroll-button right\"\r\n tabindex=\"-1\"\r\n magnitude=\"smallest\"\r\n visuallyHiddenLabel=\"Next\"\r\n aria-hidden=\"true\"\r\n (click)=\"scrollHeader(1)\"\r\n [disabled]=\"!canScrollRight\">\r\n <!--\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" class=\"bi bi-chevron-right\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\"/>\r\n </svg>\r\n -->\r\n </button>\r\n <!--\r\n <div class=\"scroll-indicator\"\r\n [class.active]=\"showScrollButtons\"\r\n [class.left-visible]=\"canScrollLeft\"\r\n [class.right-visible]=\"canScrollRight\">\r\n </div>\r\n -->\r\n }\r\n\r\n</div>\r\n\r\n<div class=\"tab-content-wrapper\">\r\n<!-- <div class=\"tab-content\">-->\r\n <ng-content></ng-content>\r\n <ng-container #dynamicTabs></ng-container>\r\n<!-- </div>-->\r\n</div>\r\n", styles: [".cute-tab-group{display:flex;flex-flow:column nowrap;width:100%}.cute-tab-group.tabs-top{flex-direction:column}.cute-tab-group.tabs-top .tab-header-wrapper{margin-bottom:.75rem}.cute-tab-group.tabs-bottom{flex-direction:column-reverse;justify-content:space-between}.cute-tab-group.tabs-bottom .tab-header-wrapper{margin-top:1rem}.cute-tab-group.tabs-bottom .nav-tabs{border:0;border-top:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.cute-tab-group.tabs-bottom .nav-tabs .nav-link{margin-top:calc(-2 * var(--bs-nav-tabs-border-width));margin-bottom:0;border-top:0;border-radius:0 0 var(--bs-nav-tabs-border-radius) var(--bs-nav-tabs-border-radius)}.cute-tab-group.tabs-bottom .nav-tabs .nav-link.active,.cute-tab-group.tabs-bottom .nav-tabs .nav-link:focus{border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.cute-tab-group.tabs-left,.cute-tab-group.tabs-start,[dir=rtl] .cute-tab-group.tabs-end{flex-direction:row}.cute-tab-group.tabs-left .tab-header-wrapper,.cute-tab-group.tabs-start .tab-header-wrapper,[dir=rtl] .cute-tab-group.tabs-end .tab-header-wrapper{flex-direction:row-reverse;margin-right:1rem}.cute-tab-group.tabs-right,.cute-tab-group.tabs-end,[dir=rtl] .cute-tab-group.tabs-start{flex-direction:row-reverse}.cute-tab-group.tabs-right .tab-header-wrapper,.cute-tab-group.tabs-end .tab-header-wrapper,[dir=rtl] .cute-tab-group.tabs-start .tab-header-wrapper{margin-left:1rem}.cute-tab-group .tab-header-wrapper{position:relative;overflow:hidden}.cute-tab-group .tab-header-scroll{display:flex;width:100%}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll{white-space:nowrap;overflow-x:auto;overflow-y:hidden;padding-top:.25rem;padding-bottom:.25rem;scrollbar-width:none}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll::-webkit-scrollbar,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll::-webkit-scrollbar{display:none}.cute-tab-group.tabs-top .tab-header-wrapper .tab-header-scroll .cute-nav,.cute-tab-group.tabs-bottom .tab-header-wrapper .tab-header-scroll .cute-nav{flex-wrap:nowrap;white-space:nowrap;flex-basis:100%}.cute-tab-group.tabs-left .tab-header-wrapper,.cute-tab-group.tabs-right .tab-header-wrapper,.cute-tab-group.tabs-start .tab-header-wrapper,.cute-tab-group.tabs-end .tab-header-wrapper{min-width:100px;height:100%;overflow-x:hidden;overflow-y:auto}.cute-tab-group.tabs-left .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-right .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-start .tab-header-wrapper .cute-nav,.cute-tab-group.tabs-end .tab-header-wrapper .cute-nav{flex-wrap:nowrap;padding:.25rem;gap:.25rem;text-align:center;height:100%}.cute-tab-group.tabs-left .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-right .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-start .tab-header-wrapper .btn-add-tab,.cute-tab-group.tabs-end .tab-header-wrapper .btn-add-tab{position:sticky;top:0}.cute-tab-group .tab-content-wrapper{overflow:auto;height:100%;flex:1;transform:none}.cute-tab-group .cute-nav-link{display:flex;align-items:center;justify-content:center;width:100%;gap:.5rem}[dir=rtl] .cute-tab-group .cute-nav-link{flex-direction:row-reverse}.cdk-drag-preview{display:flex;opacity:.8;box-sizing:border-box;border:none;border-radius:var(--bs-nav-tabs-border-radius);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;list-style:none;overflow:hidden;align-items:center;justify-content:center}.cdk-drag-placeholder{opacity:.2}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.scroll-button{position:absolute;top:0;bottom:0;width:1rem;font-weight:700;background:rgba(var(--bs-body-bg-rgb),.9);border:none;cursor:pointer;z-index:1;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .3s}.scroll-button:hover{opacity:1!important}.scroll-button[disabled]{opacity:0!important;cursor:default;pointer-events:none}.scroll-button.left{left:0;background:linear-gradient(to right,var(--bs-body-color) 0%,rgba(var(--bs-body-bg-rgb),0) 100%)}.scroll-button.right{right:0;background:linear-gradient(to left,var(--bs-body-color) 0%,rgba(var(--bs-body-bg-rgb),0) 100%)}.tab-header-wrapper:hover .scroll-button{opacity:.7}.scroll-indicator{position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--bs-body-color)}.scroll-indicator:before,.scroll-indicator:after{content:\"\";position:absolute;bottom:0;width:30%;height:1px;background:var(--bs-primary);transform:scaleX(0);transition:transform .3s}.scroll-indicator.left-visible:before{transform:scaleX(1);left:0}.scroll-indicator.right-visible:after{transform:scaleX(1);right:0}\n"] }]
|
|
472
498
|
}], ctorParameters: () => [], propDecorators: { tabs: [{
|
|
473
499
|
type: ContentChildren,
|
|
474
500
|
args: [CuteTab]
|
|
@@ -493,6 +519,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
493
519
|
}], stretchTabs: [{
|
|
494
520
|
type: Input,
|
|
495
521
|
args: [{ alias: 'cute-stretch-tabs' }]
|
|
522
|
+
}], animationDuration: [{
|
|
523
|
+
type: Input
|
|
496
524
|
}], preserveContent: [{
|
|
497
525
|
type: Input,
|
|
498
526
|
args: [{ transform: booleanAttribute }]
|
|
@@ -517,6 +545,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
517
545
|
type: Output
|
|
518
546
|
}], focusChange: [{
|
|
519
547
|
type: Output
|
|
548
|
+
}], headerPositionChange: [{
|
|
549
|
+
type: Output
|
|
520
550
|
}], tabAdded: [{
|
|
521
551
|
type: Output
|
|
522
552
|
}], tabRemoved: [{
|
|
@@ -546,6 +576,12 @@ class CuteTab extends CuteFocusableControl {
|
|
|
546
576
|
set active(value) {
|
|
547
577
|
if (value !== this._active) {
|
|
548
578
|
this._active = value;
|
|
579
|
+
if (this._animationEnabled) {
|
|
580
|
+
setTimeout(() => this.toggleClass("show", value), 150);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
this.toggleClass("show", value);
|
|
584
|
+
}
|
|
549
585
|
this._stateChanges.next();
|
|
550
586
|
}
|
|
551
587
|
}
|
|
@@ -554,7 +590,7 @@ class CuteTab extends CuteFocusableControl {
|
|
|
554
590
|
return this._intersectionRatio < 1;
|
|
555
591
|
}
|
|
556
592
|
isPreserveContent() {
|
|
557
|
-
return this.preserveContent ?? this.
|
|
593
|
+
return this.preserveContent ?? this._closestTabGroup?.preserveContent ?? false;
|
|
558
594
|
}
|
|
559
595
|
/** Tab content defined by <ng-template cute-tab-content> or directly referenced where the latter has more priority. */
|
|
560
596
|
get explicitContent() {
|
|
@@ -564,19 +600,20 @@ class CuteTab extends CuteFocusableControl {
|
|
|
564
600
|
// @ViewChild(TemplateRef, {static: true}) _implicitContent: TemplateRef<any> | undefined;
|
|
565
601
|
constructor() {
|
|
566
602
|
super();
|
|
567
|
-
this._tabGroup = inject(CUTE_TAB_GROUP, { optional: true });
|
|
568
603
|
this._intersectionRatio = NaN;
|
|
604
|
+
this._closestTabGroup = inject(CUTE_TAB_GROUP, { optional: true });
|
|
605
|
+
this._animationEnabled = !_animationsDisabled();
|
|
569
606
|
/** Plain text label for the tab, used when there is no template label. */
|
|
570
607
|
this.textLabel = "";
|
|
571
|
-
/** Lazy loading label's outlet context */
|
|
608
|
+
/** Lazy loading label's outlet context. */
|
|
572
609
|
this.labelContext = {};
|
|
573
|
-
/** Lazy loading content's outlet context */
|
|
610
|
+
/** Lazy loading content's outlet context. */
|
|
574
611
|
this.contentContext = {};
|
|
575
612
|
/** Whether the tab is closable. */
|
|
576
613
|
this.closable = false;
|
|
577
614
|
this._active = false;
|
|
578
615
|
/** Whether the tab was added dynamically */
|
|
579
|
-
this.
|
|
616
|
+
this._isDynamic = false;
|
|
580
617
|
/** Emits whenever the internal state of the tab changes. */
|
|
581
618
|
this._stateChanges = new Subject();
|
|
582
619
|
/** Whether the tab content was loaded */
|
|
@@ -592,7 +629,7 @@ class CuteTab extends CuteFocusableControl {
|
|
|
592
629
|
getContentContext() {
|
|
593
630
|
return { ...this.contentContext,
|
|
594
631
|
$implicit: this,
|
|
595
|
-
index: this.
|
|
632
|
+
index: this._closestTabGroup?.getTabIndex(this),
|
|
596
633
|
active: this.active,
|
|
597
634
|
tab: this
|
|
598
635
|
};
|
|
@@ -601,17 +638,18 @@ class CuteTab extends CuteFocusableControl {
|
|
|
601
638
|
* Removes this tab from the tab group.
|
|
602
639
|
*/
|
|
603
640
|
async remove() {
|
|
604
|
-
if (this.
|
|
605
|
-
const index = this.
|
|
641
|
+
if (this._closestTabGroup) {
|
|
642
|
+
const index = this._closestTabGroup.getTabIndex(this);
|
|
606
643
|
if (index != null) {
|
|
607
|
-
return this.
|
|
644
|
+
return this._closestTabGroup.removeTab(index);
|
|
608
645
|
}
|
|
609
646
|
}
|
|
610
647
|
return;
|
|
611
648
|
}
|
|
612
649
|
_visibilityChanged(entries) {
|
|
613
650
|
if (entries.length) {
|
|
614
|
-
this._intersectionRatio = entries[0].intersectionRatio;
|
|
651
|
+
//this._intersectionRatio = entries[0].intersectionRatio;
|
|
652
|
+
this._intersectionRatio = entries.at(-1).intersectionRatio;
|
|
615
653
|
}
|
|
616
654
|
}
|
|
617
655
|
ngOnInit() {
|
|
@@ -631,36 +669,23 @@ class CuteTab extends CuteFocusableControl {
|
|
|
631
669
|
super.ngOnDestroy();
|
|
632
670
|
this._stateChanges.complete();
|
|
633
671
|
}
|
|
634
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
635
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
636
|
-
trigger('contentFade', [
|
|
637
|
-
state('in', style({ opacity: 1, height: '*' })),
|
|
638
|
-
state('out', style({ opacity: 0, height: '0px' })),
|
|
639
|
-
transition('in <=> out', animate('150ms linear'))
|
|
640
|
-
])
|
|
641
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
672
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTab, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
673
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CuteTab, isStandalone: true, selector: "cute-tab", inputs: { textLabel: ["label", "textLabel"], contentTemplate: "contentTemplate", labelContext: "labelContext", contentContext: "contentContext", closable: ["closable", "closable", booleanAttribute], preserveContent: ["preserveContent", "preserveContent", booleanAttribute] }, host: { attributes: { "role": "tabpanel" }, properties: { "class.fade": "_animationEnabled", "class.active": "active", "attr.tabindex": "active && !disabled ? 0 : -1", "attr.aria-labelledby": "ariaLabelledby || null", "attr.id": "id || null" }, classAttribute: "cute-tab tab-pane" }, providers: [{ provide: CUTE_TAB, useExisting: CuteTab }], queries: [{ propertyName: "_templateLabel", first: true, predicate: CuteTabLabel, descendants: true, read: TemplateRef, static: true }, { propertyName: "_explicitContent", first: true, predicate: CuteTabContent, descendants: true, read: TemplateRef, static: true }, { propertyName: "link", first: true, predicate: CuteNavLink, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if (active || isPreserveContent()) {\r\n\r\n <ng-content></ng-content>\r\n\r\n @if (explicitContent) {\r\n <ng-container [ngTemplateOutlet]=\"explicitContent\"\r\n [ngTemplateOutletContext]=\"getContentContext()\">\r\n </ng-container>\r\n }\r\n}\r\n", styles: [".cute-tab{display:block;width:100%;padding:.25rem;opacity:1}.cute-tab:not(.show){display:none}.cute-tab.ng-animating{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
642
674
|
}
|
|
643
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTab, decorators: [{
|
|
644
676
|
type: Component,
|
|
645
|
-
args: [{ selector: 'cute-tab',
|
|
646
|
-
trigger('contentFade', [
|
|
647
|
-
state('in', style({ opacity: 1, height: '*' })),
|
|
648
|
-
state('out', style({ opacity: 0, height: '0px' })),
|
|
649
|
-
transition('in <=> out', animate('150ms linear'))
|
|
650
|
-
])
|
|
651
|
-
], host: {
|
|
677
|
+
args: [{ selector: 'cute-tab', host: {
|
|
652
678
|
"class": "cute-tab tab-pane",
|
|
653
|
-
"[class.
|
|
679
|
+
"[class.fade]": "_animationEnabled",
|
|
680
|
+
// "[class.show]": "active",
|
|
654
681
|
"[class.active]": "active",
|
|
655
|
-
// "[class.d-none]": "!active",
|
|
656
682
|
'[attr.tabindex]': 'active && !disabled ? 0 : -1',
|
|
657
683
|
'[attr.aria-labelledby]': 'ariaLabelledby || null',
|
|
658
684
|
'[attr.id]': 'id || null',
|
|
659
685
|
"role": "tabpanel",
|
|
660
|
-
|
|
661
|
-
}, imports: [
|
|
686
|
+
}, providers: [{ provide: CUTE_TAB, useExisting: CuteTab }], imports: [
|
|
662
687
|
NgTemplateOutlet,
|
|
663
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (active || isPreserveContent()) {\r\n\r\n <ng-content></ng-content>\r\n\r\n @if (explicitContent) {\r\n <ng-container [ngTemplateOutlet]=\"explicitContent\"\r\n [ngTemplateOutletContext]=\"getContentContext()\">\r\n </ng-container>\r\n }\r\n}\r\n", styles: [".cute-tab{display:block;width:100%;padding:.25rem}.cute-tab:not(.show){display:none}.cute-tab.ng-animating{overflow:hidden}\n"] }]
|
|
688
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (active || isPreserveContent()) {\r\n\r\n <ng-content></ng-content>\r\n\r\n @if (explicitContent) {\r\n <ng-container [ngTemplateOutlet]=\"explicitContent\"\r\n [ngTemplateOutletContext]=\"getContentContext()\">\r\n </ng-container>\r\n }\r\n}\r\n", styles: [".cute-tab{display:block;width:100%;padding:.25rem;opacity:1}.cute-tab:not(.show){display:none}.cute-tab.ng-animating{overflow:hidden}\n"] }]
|
|
664
689
|
}], ctorParameters: () => [], propDecorators: { textLabel: [{
|
|
665
690
|
type: Input,
|
|
666
691
|
args: ["label"]
|
|
@@ -702,17 +727,17 @@ const TYPES = [
|
|
|
702
727
|
CuteTabContent,
|
|
703
728
|
];
|
|
704
729
|
class CuteTabsModule {
|
|
705
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
706
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
730
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
731
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: CuteTabsModule, imports: [CommonModule, CuteTab,
|
|
707
732
|
CuteTabGroup,
|
|
708
733
|
CuteTabLabel,
|
|
709
734
|
CuteTabContent], exports: [CuteTab,
|
|
710
735
|
CuteTabGroup,
|
|
711
736
|
CuteTabLabel,
|
|
712
737
|
CuteTabContent] }); }
|
|
713
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
738
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabsModule, imports: [CommonModule, CuteTabGroup] }); }
|
|
714
739
|
}
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CuteTabsModule, decorators: [{
|
|
716
741
|
type: NgModule,
|
|
717
742
|
args: [{
|
|
718
743
|
imports: [CommonModule, ...TYPES],
|
|
@@ -725,5 +750,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
725
750
|
* Generated bundle index. Do not edit.
|
|
726
751
|
*/
|
|
727
752
|
|
|
728
|
-
export { CUTE_TAB, CUTE_TAB_CONTENT, CUTE_TAB_GROUP, CUTE_TAB_LABEL, CuteTab, CuteTabChangeEvent, CuteTabChangingEvent, CuteTabContent, CuteTabGroup, CuteTabLabel, CuteTabsModule
|
|
753
|
+
export { CUTE_TAB, CUTE_TAB_CONTENT, CUTE_TAB_GROUP, CUTE_TAB_LABEL, CuteTab, CuteTabChangeEvent, CuteTabChangingEvent, CuteTabContent, CuteTabGroup, CuteTabLabel, CuteTabsModule };
|
|
729
754
|
//# sourceMappingURL=cute-widgets-base-tabs.mjs.map
|