@nanahoshi/mona-ui 0.27.2 → 0.28.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/docs/api/chart.md +2 -2
- package/docs/api/popup.md +1 -1
- package/docs/api/theme.md +2 -2
- package/docs/chart.md +14 -0
- package/docs/editor.md +2 -0
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +6 -2
- package/package.json +62 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +354 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,83 +1,115 @@
|
|
|
1
|
-
import { PreventableEvent } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { NgTemplateOutlet } from
|
|
5
|
-
import { firstOrDefault, select } from
|
|
6
|
-
import { twMerge } from
|
|
7
|
-
import { cva } from
|
|
8
|
-
import { takeUntilDestroyed } from
|
|
9
|
-
import { LucideChevronDown, LucideChevronLeft, LucideChevronRight, LucideChevronUp, LucideX } from
|
|
10
|
-
import { ButtonDirective } from
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { createElementControlId } from
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import { PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, contentChildren, effect, inject, input, linkedSignal, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
4
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
5
|
+
import { firstOrDefault, select } from "@mirei/ts-collections";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
9
|
+
import { LucideChevronDown, LucideChevronLeft, LucideChevronRight, LucideChevronUp, LucideX } from "@lucide/angular";
|
|
10
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
11
|
+
import { MonaI18nService, injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
|
|
12
|
+
import { EMPTY, Subject, asapScheduler, interval, switchMap, tap, timer } from "rxjs";
|
|
13
|
+
import { createElementControlId } from "@nanahoshi/mona-ui/internal";
|
|
14
|
+
var TabCloseEvent = class extends PreventableEvent {
|
|
15
|
+
#index;
|
|
16
|
+
#selected;
|
|
17
|
+
constructor(index, selected, originalEvent) {
|
|
18
|
+
super("tabClose", originalEvent);
|
|
19
|
+
this.#index = index;
|
|
20
|
+
this.#selected = selected;
|
|
21
|
+
}
|
|
22
|
+
get index() {
|
|
23
|
+
return this.#index;
|
|
24
|
+
}
|
|
25
|
+
get selected() {
|
|
26
|
+
return this.#selected;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var TabSelectEvent = class extends PreventableEvent {
|
|
30
|
+
#index;
|
|
31
|
+
constructor(index, originalEvent) {
|
|
32
|
+
super("tabSelect", originalEvent);
|
|
33
|
+
this.#index = index;
|
|
34
|
+
}
|
|
35
|
+
get index() {
|
|
36
|
+
return this.#index;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var TabContentTemplateDirective = class TabContentTemplateDirective {
|
|
40
|
+
static {
|
|
41
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "22.2.6",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: TabContentTemplateDirective,
|
|
46
|
+
deps: [],
|
|
47
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static {
|
|
51
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
52
|
+
minVersion: "14.0.0",
|
|
53
|
+
version: "22.2.6",
|
|
54
|
+
type: TabContentTemplateDirective,
|
|
55
|
+
isStandalone: true,
|
|
56
|
+
selector: "ng-template[monaTabContentTemplate]",
|
|
57
|
+
ngImport: i0
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
62
|
+
minVersion: "12.0.0",
|
|
63
|
+
version: "22.2.6",
|
|
64
|
+
ngImport: i0,
|
|
65
|
+
type: TabContentTemplateDirective,
|
|
66
|
+
decorators: [{
|
|
67
|
+
type: Directive,
|
|
68
|
+
args: [{ selector: "ng-template[monaTabContentTemplate]" }]
|
|
69
|
+
}]
|
|
70
|
+
});
|
|
71
|
+
var TabTitleTemplateDirective = class TabTitleTemplateDirective {
|
|
72
|
+
static {
|
|
73
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
74
|
+
minVersion: "12.0.0",
|
|
75
|
+
version: "22.2.6",
|
|
76
|
+
ngImport: i0,
|
|
77
|
+
type: TabTitleTemplateDirective,
|
|
78
|
+
deps: [],
|
|
79
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
static {
|
|
83
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
84
|
+
minVersion: "14.0.0",
|
|
85
|
+
version: "22.2.6",
|
|
86
|
+
type: TabTitleTemplateDirective,
|
|
87
|
+
isStandalone: true,
|
|
88
|
+
selector: "ng-template[monaTabTitleTemplate]",
|
|
89
|
+
ngImport: i0
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
94
|
+
minVersion: "12.0.0",
|
|
95
|
+
version: "22.2.6",
|
|
96
|
+
ngImport: i0,
|
|
97
|
+
type: TabTitleTemplateDirective,
|
|
98
|
+
decorators: [{
|
|
99
|
+
type: Directive,
|
|
100
|
+
args: [{ selector: "ng-template[monaTabTitleTemplate]" }]
|
|
101
|
+
}]
|
|
102
|
+
});
|
|
67
103
|
const tabListBaseThemeVariants = cva(`
|
|
68
104
|
flex max-w-full min-w-0 overflow-hidden
|
|
69
105
|
`, {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
position: "top"
|
|
80
|
-
}
|
|
106
|
+
variants: { position: {
|
|
107
|
+
top: "flex-row border-b border-border",
|
|
108
|
+
bottom: "flex-row border-t border-border",
|
|
109
|
+
left: "flex-col max-h-full min-h-0 border-e border-border",
|
|
110
|
+
right: "flex-col max-h-full min-h-0 border-s border-border"
|
|
111
|
+
} },
|
|
112
|
+
defaultVariants: { position: "top" }
|
|
81
113
|
});
|
|
82
114
|
const tabListListWrapperThemeVariants = cva(`flex-1 min-w-0 min-h-0 overflow-hidden`);
|
|
83
115
|
const tabListListThemeVariants = cva(`
|
|
@@ -85,76 +117,70 @@ const tabListListThemeVariants = cva(`
|
|
|
85
117
|
cursor-default select-none whitespace-nowrap
|
|
86
118
|
transition-colors duration-(--mona-motion-standard) ease-out
|
|
87
119
|
`, {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
defaultVariants: {
|
|
97
|
-
position: "top"
|
|
98
|
-
}
|
|
120
|
+
variants: { position: {
|
|
121
|
+
top: "flex-row max-w-full min-w-0",
|
|
122
|
+
bottom: "flex-row max-w-full min-w-0",
|
|
123
|
+
left: "flex-col max-h-full min-h-0",
|
|
124
|
+
right: "flex-col max-h-full min-h-0"
|
|
125
|
+
} },
|
|
126
|
+
defaultVariants: { position: "top" }
|
|
99
127
|
});
|
|
100
128
|
const tabListListItemThemeVariants = cva(`
|
|
101
129
|
relative flex shrink-0 cursor-pointer
|
|
102
130
|
transition-colors duration-(--mona-motion-standard) ease-out
|
|
103
131
|
`, {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
variants: {
|
|
133
|
+
active: {
|
|
134
|
+
true: `
|
|
107
135
|
text-foreground font-semibold
|
|
108
136
|
after:absolute after:content-[''] after:bg-[var(--mona-indicator-color,var(--color-primary))]
|
|
109
137
|
after:forced-color-adjust-none forced-colors:after:bg-[Highlight]
|
|
110
138
|
`,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
139
|
+
false: "text-muted-foreground hover:bg-hover hover:text-foreground"
|
|
140
|
+
},
|
|
141
|
+
disabled: {
|
|
142
|
+
true: "pointer-events-none cursor-not-allowed select-none text-disabled-foreground after:hidden",
|
|
143
|
+
false: ""
|
|
144
|
+
},
|
|
145
|
+
position: {
|
|
146
|
+
top: "items-center justify-center whitespace-nowrap after:inset-x-0 after:bottom-0 after:h-[2px]",
|
|
147
|
+
bottom: "items-center justify-center whitespace-nowrap after:inset-x-0 after:top-0 after:h-[2px]",
|
|
148
|
+
left: "w-full items-center justify-start text-start after:inset-y-0 after:end-0 after:w-[2px]",
|
|
149
|
+
right: "w-full items-center justify-start text-start after:inset-y-0 after:start-0 after:w-[2px]"
|
|
150
|
+
},
|
|
151
|
+
size: {
|
|
152
|
+
small: "h-8 text-xs",
|
|
153
|
+
medium: "h-9 text-sm",
|
|
154
|
+
large: "h-10 text-sm"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
defaultVariants: {
|
|
158
|
+
position: "top",
|
|
159
|
+
size: "medium"
|
|
160
|
+
}
|
|
133
161
|
});
|
|
134
|
-
/** Inset, because the strip clips anything outside it. */
|
|
135
162
|
const tabListTabThemeVariants = cva(`
|
|
136
163
|
flex h-full min-w-0 flex-1 items-center
|
|
137
164
|
focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-indicator
|
|
138
165
|
`, {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
166
|
+
variants: {
|
|
167
|
+
position: {
|
|
168
|
+
top: "justify-center whitespace-nowrap",
|
|
169
|
+
bottom: "justify-center whitespace-nowrap",
|
|
170
|
+
left: "justify-start text-start",
|
|
171
|
+
right: "justify-start text-start"
|
|
172
|
+
},
|
|
173
|
+
size: {
|
|
174
|
+
small: "px-2",
|
|
175
|
+
medium: "px-3",
|
|
176
|
+
large: "px-4"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
defaultVariants: {
|
|
180
|
+
position: "top",
|
|
181
|
+
size: "medium"
|
|
182
|
+
}
|
|
156
183
|
});
|
|
157
|
-
/** The icon is 16 pixels. The pseudo-element makes the target 24. */
|
|
158
184
|
const tabListCloseButtonThemeVariants = cva(`
|
|
159
185
|
relative -ms-1 me-2 h-fit w-min self-center px-0
|
|
160
186
|
before:absolute before:-inset-1 before:content-['']
|
|
@@ -173,722 +199,1248 @@ const tabContentThemeVariants = cva(`
|
|
|
173
199
|
const tabsBaseThemeVariants = cva(`
|
|
174
200
|
flex max-w-full min-w-0 min-h-0
|
|
175
201
|
`, {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
202
|
+
variants: { position: {
|
|
203
|
+
top: "flex-col",
|
|
204
|
+
bottom: "flex-col-reverse",
|
|
205
|
+
left: "flex-row",
|
|
206
|
+
right: "flex-row-reverse"
|
|
207
|
+
} },
|
|
208
|
+
defaultVariants: { position: "top" }
|
|
209
|
+
});
|
|
210
|
+
var TabListItemDirective = class TabListItemDirective {
|
|
211
|
+
constructor() {
|
|
212
|
+
this.listItemClass = computed(() => {
|
|
213
|
+
const active = this.active();
|
|
214
|
+
const disabled = this.disabled();
|
|
215
|
+
const position = this.position();
|
|
216
|
+
const size = this.size();
|
|
217
|
+
return tabListListItemThemeVariants({
|
|
218
|
+
active,
|
|
219
|
+
disabled,
|
|
220
|
+
position,
|
|
221
|
+
size
|
|
222
|
+
});
|
|
223
|
+
}, ...ngDevMode ? [{ debugName: "listItemClass" }] : /* istanbul ignore next */ []);
|
|
224
|
+
this.active = input.required(...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
225
|
+
this.disabled = input.required(...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
226
|
+
this.position = input.required(...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
|
|
227
|
+
this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
228
|
+
}
|
|
229
|
+
static {
|
|
230
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
231
|
+
minVersion: "12.0.0",
|
|
232
|
+
version: "22.2.6",
|
|
233
|
+
ngImport: i0,
|
|
234
|
+
type: TabListItemDirective,
|
|
235
|
+
deps: [],
|
|
236
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
static {
|
|
240
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
241
|
+
minVersion: "17.1.0",
|
|
242
|
+
version: "22.2.6",
|
|
243
|
+
type: TabListItemDirective,
|
|
244
|
+
isStandalone: true,
|
|
245
|
+
selector: "li[monaTabListItem]",
|
|
246
|
+
inputs: {
|
|
247
|
+
active: {
|
|
248
|
+
classPropertyName: "active",
|
|
249
|
+
publicName: "active",
|
|
250
|
+
isSignal: true,
|
|
251
|
+
isRequired: true,
|
|
252
|
+
transformFunction: null
|
|
253
|
+
},
|
|
254
|
+
disabled: {
|
|
255
|
+
classPropertyName: "disabled",
|
|
256
|
+
publicName: "disabled",
|
|
257
|
+
isSignal: true,
|
|
258
|
+
isRequired: true,
|
|
259
|
+
transformFunction: null
|
|
260
|
+
},
|
|
261
|
+
position: {
|
|
262
|
+
classPropertyName: "position",
|
|
263
|
+
publicName: "position",
|
|
264
|
+
isSignal: true,
|
|
265
|
+
isRequired: true,
|
|
266
|
+
transformFunction: null
|
|
267
|
+
},
|
|
268
|
+
size: {
|
|
269
|
+
classPropertyName: "size",
|
|
270
|
+
publicName: "size",
|
|
271
|
+
isSignal: true,
|
|
272
|
+
isRequired: true,
|
|
273
|
+
transformFunction: null
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
host: { properties: { "class": "listItemClass()" } },
|
|
277
|
+
ngImport: i0
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
282
|
+
minVersion: "12.0.0",
|
|
283
|
+
version: "22.2.6",
|
|
284
|
+
ngImport: i0,
|
|
285
|
+
type: TabListItemDirective,
|
|
286
|
+
decorators: [{
|
|
287
|
+
type: Directive,
|
|
288
|
+
args: [{
|
|
289
|
+
selector: "li[monaTabListItem]",
|
|
290
|
+
host: { "[class]": "listItemClass()" }
|
|
291
|
+
}]
|
|
292
|
+
}],
|
|
293
|
+
propDecorators: {
|
|
294
|
+
active: [{
|
|
295
|
+
type: i0.Input,
|
|
296
|
+
args: [{
|
|
297
|
+
isSignal: true,
|
|
298
|
+
alias: "active",
|
|
299
|
+
required: true
|
|
300
|
+
}]
|
|
301
|
+
}],
|
|
302
|
+
disabled: [{
|
|
303
|
+
type: i0.Input,
|
|
304
|
+
args: [{
|
|
305
|
+
isSignal: true,
|
|
306
|
+
alias: "disabled",
|
|
307
|
+
required: true
|
|
308
|
+
}]
|
|
309
|
+
}],
|
|
310
|
+
position: [{
|
|
311
|
+
type: i0.Input,
|
|
312
|
+
args: [{
|
|
313
|
+
isSignal: true,
|
|
314
|
+
alias: "position",
|
|
315
|
+
required: true
|
|
316
|
+
}]
|
|
317
|
+
}],
|
|
318
|
+
size: [{
|
|
319
|
+
type: i0.Input,
|
|
320
|
+
args: [{
|
|
321
|
+
isSignal: true,
|
|
322
|
+
alias: "size",
|
|
323
|
+
required: true
|
|
324
|
+
}]
|
|
325
|
+
}]
|
|
326
|
+
}
|
|
187
327
|
});
|
|
188
|
-
|
|
189
|
-
class TabListItemDirective {
|
|
190
|
-
constructor() {
|
|
191
|
-
this.listItemClass = computed(() => {
|
|
192
|
-
const active = this.active();
|
|
193
|
-
const disabled = this.disabled();
|
|
194
|
-
const position = this.position();
|
|
195
|
-
const size = this.size();
|
|
196
|
-
return tabListListItemThemeVariants({ active, disabled, position, size });
|
|
197
|
-
}, /* @ts-ignore */
|
|
198
|
-
...(ngDevMode ? [{ debugName: "listItemClass" }] : /* istanbul ignore next */ []));
|
|
199
|
-
this.active = input.required(/* @ts-ignore */
|
|
200
|
-
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
201
|
-
this.disabled = input.required(/* @ts-ignore */
|
|
202
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
203
|
-
this.position = input.required(/* @ts-ignore */
|
|
204
|
-
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
205
|
-
this.size = input.required(/* @ts-ignore */
|
|
206
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
207
|
-
}
|
|
208
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabListItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
209
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TabListItemDirective, isStandalone: true, selector: "li[monaTabListItem]", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "listItemClass()" } }, ngImport: i0 }); }
|
|
210
|
-
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabListItemDirective, decorators: [{
|
|
212
|
-
type: Directive,
|
|
213
|
-
args: [{
|
|
214
|
-
selector: "li[monaTabListItem]",
|
|
215
|
-
host: {
|
|
216
|
-
"[class]": "listItemClass()"
|
|
217
|
-
}
|
|
218
|
-
}]
|
|
219
|
-
}], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }] } });
|
|
220
|
-
|
|
221
|
-
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
222
|
-
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
223
328
|
const TABS_DEFAULT_MESSAGES = {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
329
|
+
closeTab: "Close tab",
|
|
330
|
+
scrollNext: "Scroll tabs next",
|
|
331
|
+
scrollPrevious: "Scroll tabs previous"
|
|
227
332
|
};
|
|
228
|
-
|
|
229
333
|
function getTabOrientation(position) {
|
|
230
|
-
|
|
231
|
-
? "vertical"
|
|
232
|
-
: "horizontal";
|
|
334
|
+
return position === "left" || position === "right" ? "vertical" : "horizontal";
|
|
233
335
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
336
|
+
var TabListComponent = class TabListComponent {
|
|
337
|
+
#destroyRef;
|
|
338
|
+
#direction;
|
|
339
|
+
#hostElement;
|
|
340
|
+
#i18n;
|
|
341
|
+
#scrollIntent$;
|
|
342
|
+
#focusedTabId;
|
|
343
|
+
#resizeObserver;
|
|
344
|
+
constructor() {
|
|
345
|
+
this.#destroyRef = inject(DestroyRef);
|
|
346
|
+
this.#direction = injectComponentDirection();
|
|
347
|
+
this.#hostElement = inject(ElementRef).nativeElement;
|
|
348
|
+
this.#i18n = inject(MonaI18nService);
|
|
349
|
+
this.#scrollIntent$ = new Subject();
|
|
350
|
+
this.#focusedTabId = null;
|
|
351
|
+
this.#resizeObserver = null;
|
|
352
|
+
this.baseClass = computed(() => {
|
|
353
|
+
return tabListBaseThemeVariants({ position: this.position() });
|
|
354
|
+
}, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
355
|
+
this.closeButtonClass = computed(() => {
|
|
356
|
+
return tabListCloseButtonThemeVariants();
|
|
357
|
+
}, ...ngDevMode ? [{ debugName: "closeButtonClass" }] : /* istanbul ignore next */ []);
|
|
358
|
+
this.hasClosableTabs = computed(() => {
|
|
359
|
+
return this.closable() || Array.from(this.tabList()).some((tab) => tab.closable);
|
|
360
|
+
}, ...ngDevMode ? [{ debugName: "hasClosableTabs" }] : /* istanbul ignore next */ []);
|
|
361
|
+
this.isRtl = computed(() => this.#direction() === "rtl", ...ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []);
|
|
362
|
+
this.listClass = computed(() => {
|
|
363
|
+
return tabListListThemeVariants({ position: this.position() });
|
|
364
|
+
}, ...ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []);
|
|
365
|
+
this.listWrapperClass = computed(() => {
|
|
366
|
+
return tabListListWrapperThemeVariants();
|
|
367
|
+
}, ...ngDevMode ? [{ debugName: "listWrapperClass" }] : /* istanbul ignore next */ []);
|
|
368
|
+
this.messages = this.#i18n.componentMessages("tabs", TABS_DEFAULT_MESSAGES);
|
|
369
|
+
this.orientation = computed(() => {
|
|
370
|
+
return getTabOrientation(this.position() ?? "top");
|
|
371
|
+
}, ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
372
|
+
this.overflowControlsVisible = signal(false, ...ngDevMode ? [{ debugName: "overflowControlsVisible" }] : /* istanbul ignore next */ []);
|
|
373
|
+
this.scrollButtonClass = computed(() => {
|
|
374
|
+
return tabListScrollButtonThemeVariants();
|
|
375
|
+
}, ...ngDevMode ? [{ debugName: "scrollButtonClass" }] : /* istanbul ignore next */ []);
|
|
376
|
+
this.tabClass = computed(() => {
|
|
377
|
+
return tabListTabThemeVariants({
|
|
378
|
+
position: this.position(),
|
|
379
|
+
size: this.size()
|
|
380
|
+
});
|
|
381
|
+
}, ...ngDevMode ? [{ debugName: "tabClass" }] : /* istanbul ignore next */ []);
|
|
382
|
+
this.tabElements = viewChildren("tabElement", ...ngDevMode ? [{ debugName: "tabElements" }] : /* istanbul ignore next */ []);
|
|
383
|
+
this.tabListElement = viewChild.required("tabListElement", ...ngDevMode ? [{ debugName: "tabListElement" }] : /* istanbul ignore next */ []);
|
|
384
|
+
this.ariaLabel = input("", {
|
|
385
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
386
|
+
alias: "aria-label"
|
|
387
|
+
});
|
|
388
|
+
this.ariaLabelledBy = input("", {
|
|
389
|
+
...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
|
|
390
|
+
alias: "aria-labelledby"
|
|
391
|
+
});
|
|
392
|
+
this.closable = input(false, ...ngDevMode ? [{ debugName: "closable" }] : /* istanbul ignore next */ []);
|
|
393
|
+
this.disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
394
|
+
this.position = input.required(...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
|
|
395
|
+
this.selectedTabId = model(null, ...ngDevMode ? [{ debugName: "selectedTabId" }] : /* istanbul ignore next */ []);
|
|
396
|
+
this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
397
|
+
this.tabClose = output();
|
|
398
|
+
this.tabList = input.required(...ngDevMode ? [{ debugName: "tabList" }] : /* istanbul ignore next */ []);
|
|
399
|
+
this.tabSelect = output();
|
|
400
|
+
afterRenderEffect({ read: () => {
|
|
401
|
+
const tabs = Array.from(this.tabList());
|
|
402
|
+
this.position();
|
|
403
|
+
untracked(() => {
|
|
404
|
+
this.updateScrollVisibility();
|
|
405
|
+
this.restoreFocus(tabs);
|
|
406
|
+
});
|
|
407
|
+
} });
|
|
408
|
+
afterRenderEffect({ read: () => {
|
|
409
|
+
const selectedId = this.selectedTabId();
|
|
410
|
+
untracked(() => this.scrollTabIntoStrip(selectedId));
|
|
411
|
+
} });
|
|
412
|
+
this.setupScrolling();
|
|
413
|
+
afterNextRender({ read: () => this.setupResizeObserver() });
|
|
414
|
+
this.#destroyRef.onDestroy(() => this.#resizeObserver?.disconnect());
|
|
415
|
+
}
|
|
416
|
+
focusSelectedTab() {
|
|
417
|
+
const selectedTab = firstOrDefault(this.tabList(), (t) => t.id === this.selectedTabId());
|
|
418
|
+
if (selectedTab) this.focusTab(selectedTab);
|
|
419
|
+
}
|
|
420
|
+
onFocusIn(event) {
|
|
421
|
+
this.#focusedTabId = event.target.closest("[data-tab-id]")?.getAttribute("data-tab-id") ?? null;
|
|
422
|
+
}
|
|
423
|
+
onFocusOut(event) {
|
|
424
|
+
const target = event.target;
|
|
425
|
+
queueMicrotask(() => {
|
|
426
|
+
const root = this.#hostElement.getRootNode();
|
|
427
|
+
if (target.isConnected && !this.#hostElement.contains(root.activeElement)) this.#focusedTabId = null;
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
onKeydown(event) {
|
|
431
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
432
|
+
const tabs = Array.from(this.tabList());
|
|
433
|
+
const currentTab = this.tabFromEvent(tabs, event);
|
|
434
|
+
if (!currentTab) return;
|
|
435
|
+
if (event.key === "Tab") {
|
|
436
|
+
if (!event.shiftKey) this.handleTabKey(tabs, event);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (!event.shiftKey) this.handleTabStripKey(tabs, currentTab, event);
|
|
440
|
+
}
|
|
441
|
+
onTabClick(tab, event) {
|
|
442
|
+
if (tab.disabled || this.disabled() || tab.id === this.selectedTabId()) return;
|
|
443
|
+
if (!this.emitTabSelect(tab, event)) this.selectTab(tab);
|
|
444
|
+
}
|
|
445
|
+
onTabClose(tab, event) {
|
|
446
|
+
event.stopPropagation();
|
|
447
|
+
this.emitTabClose(tab, event);
|
|
448
|
+
}
|
|
449
|
+
startContinuousScroll(event, element, direction) {
|
|
450
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
451
|
+
this.startScrolling(element, direction, "continuous");
|
|
452
|
+
}
|
|
453
|
+
startScrolling(element, direction, type) {
|
|
454
|
+
this.#scrollIntent$.next({
|
|
455
|
+
element,
|
|
456
|
+
direction,
|
|
457
|
+
type
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
stopScrolling() {
|
|
461
|
+
this.#scrollIntent$.next(null);
|
|
462
|
+
}
|
|
463
|
+
activateTab(tab, event) {
|
|
464
|
+
if (tab.id !== this.selectedTabId() && !this.emitTabSelect(tab, event)) this.selectTab(tab);
|
|
465
|
+
this.focusTab(tab);
|
|
466
|
+
}
|
|
467
|
+
adjacentEnabledTab(tabs, from, offset) {
|
|
468
|
+
const start = tabs.indexOf(from);
|
|
469
|
+
for (let step = 1; step <= tabs.length; step++) {
|
|
470
|
+
const candidate = tabs[(start + offset * step + tabs.length * step) % tabs.length];
|
|
471
|
+
if (this.isTabEnabled(candidate)) return candidate;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
emitTabClose(tabItem, event) {
|
|
475
|
+
this.tabClose.emit(new TabCloseEvent(tabItem.index, tabItem.id === this.selectedTabId(), event));
|
|
476
|
+
}
|
|
477
|
+
emitTabSelect(tab, event) {
|
|
478
|
+
const selectEvent = new TabSelectEvent(tab.index, event);
|
|
479
|
+
this.tabSelect.emit(selectEvent);
|
|
480
|
+
return selectEvent.isDefaultPrevented();
|
|
481
|
+
}
|
|
482
|
+
focusTab(tab) {
|
|
483
|
+
this.tabElementOf(tab.id)?.focus();
|
|
484
|
+
}
|
|
485
|
+
getNavigationDirection(event) {
|
|
486
|
+
if (this.orientation() === "vertical") {
|
|
487
|
+
if (event.key === "ArrowUp") return "previous";
|
|
488
|
+
if (event.key === "ArrowDown") return "next";
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
const isRtl = this.isRtl();
|
|
492
|
+
if (event.key === "ArrowLeft") return isRtl ? "next" : "previous";
|
|
493
|
+
if (event.key === "ArrowRight") return isRtl ? "previous" : "next";
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
handleTabKey(tabs, event) {
|
|
497
|
+
const selectedTab = tabs.find((t) => t.id === this.selectedTabId());
|
|
498
|
+
if (!selectedTab) return;
|
|
499
|
+
const panel = this.#hostElement.getRootNode().getElementById(selectedTab.id + "-panel");
|
|
500
|
+
if (panel) {
|
|
501
|
+
event.preventDefault();
|
|
502
|
+
panel.focus();
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
handleTabStripKey(tabs, currentTab, event) {
|
|
506
|
+
const enabledTabs = tabs.filter((t) => this.isTabEnabled(t));
|
|
507
|
+
if (enabledTabs.length === 0) return;
|
|
508
|
+
const navigationDirection = this.getNavigationDirection(event);
|
|
509
|
+
if (navigationDirection) {
|
|
510
|
+
event.preventDefault();
|
|
511
|
+
const target = this.adjacentEnabledTab(tabs, currentTab, navigationDirection === "next" ? 1 : -1);
|
|
512
|
+
if (target) this.activateTab(target, event);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
switch (event.key) {
|
|
516
|
+
case "Home":
|
|
517
|
+
event.preventDefault();
|
|
518
|
+
this.activateTab(enabledTabs[0], event);
|
|
519
|
+
break;
|
|
520
|
+
case "End":
|
|
521
|
+
event.preventDefault();
|
|
522
|
+
this.activateTab(enabledTabs[enabledTabs.length - 1], event);
|
|
523
|
+
break;
|
|
524
|
+
case "Delete":
|
|
525
|
+
case "Backspace": if (this.isTabEnabled(currentTab) && (currentTab.closable || this.closable())) {
|
|
526
|
+
event.preventDefault();
|
|
527
|
+
this.emitTabClose(currentTab, event);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
isTabEnabled(tab) {
|
|
532
|
+
return !tab.disabled && !this.disabled();
|
|
533
|
+
}
|
|
534
|
+
performScroll(element, direction) {
|
|
535
|
+
let offset = direction === "previous" ? -100 : 100;
|
|
536
|
+
const behavior = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
537
|
+
if (this.orientation() === "vertical") {
|
|
538
|
+
element.scrollBy({
|
|
539
|
+
top: offset,
|
|
540
|
+
behavior
|
|
541
|
+
});
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
if (this.isRtl()) offset = -offset;
|
|
545
|
+
element.scrollBy({
|
|
546
|
+
left: offset,
|
|
547
|
+
behavior
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
restoreFocus(tabs) {
|
|
551
|
+
const focusedTabId = this.#focusedTabId;
|
|
552
|
+
if (focusedTabId === null || tabs.some((tab) => tab.id === focusedTabId)) return;
|
|
553
|
+
this.#focusedTabId = null;
|
|
554
|
+
const active = this.#hostElement.getRootNode().activeElement;
|
|
555
|
+
if (!active || active === this.#hostElement.ownerDocument.body) this.focusSelectedTab();
|
|
556
|
+
}
|
|
557
|
+
scrollTabIntoStrip(tabId) {
|
|
558
|
+
const tabElement = tabId === null ? void 0 : this.tabElementOf(tabId);
|
|
559
|
+
if (!tabElement) return;
|
|
560
|
+
const list = this.tabListElement().nativeElement;
|
|
561
|
+
const listRect = list.getBoundingClientRect();
|
|
562
|
+
const tabRect = tabElement.getBoundingClientRect();
|
|
563
|
+
if (this.orientation() === "vertical") {
|
|
564
|
+
const top = Math.min(tabRect.top - listRect.top, 0) || Math.max(tabRect.bottom - listRect.bottom, 0);
|
|
565
|
+
if (top !== 0) list.scrollBy({ top });
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
const left = Math.min(tabRect.left - listRect.left, 0) || Math.max(tabRect.right - listRect.right, 0);
|
|
569
|
+
if (left !== 0) list.scrollBy({ left });
|
|
570
|
+
}
|
|
571
|
+
selectTab(tab) {
|
|
572
|
+
this.selectedTabId.set(tab.id);
|
|
573
|
+
}
|
|
574
|
+
setupResizeObserver() {
|
|
575
|
+
this.#resizeObserver = new ResizeObserver((entries) => {
|
|
576
|
+
window.requestAnimationFrame(() => {
|
|
577
|
+
if (!Array.isArray(entries) || !entries.length) return;
|
|
578
|
+
this.updateScrollVisibility();
|
|
579
|
+
});
|
|
580
|
+
});
|
|
581
|
+
this.#resizeObserver.observe(this.tabListElement().nativeElement);
|
|
582
|
+
}
|
|
583
|
+
setupScrolling() {
|
|
584
|
+
this.#scrollIntent$.pipe(takeUntilDestroyed(this.#destroyRef), switchMap((intent) => {
|
|
585
|
+
if (!intent) return EMPTY;
|
|
586
|
+
const { element, direction, type } = intent;
|
|
587
|
+
return (type === "single" ? timer : interval)(60).pipe(tap(() => this.performScroll(element, direction)));
|
|
588
|
+
})).subscribe();
|
|
589
|
+
}
|
|
590
|
+
tabElementOf(tabId) {
|
|
591
|
+
return this.tabElements().find((tab) => tab.nativeElement.id === tabId + "-tab")?.nativeElement;
|
|
592
|
+
}
|
|
593
|
+
tabFromEvent(tabs, event) {
|
|
594
|
+
const target = event.target;
|
|
595
|
+
if (!target) return tabs.find((tab) => tab.id === this.selectedTabId());
|
|
596
|
+
const tabElement = target.closest("[role='tab']");
|
|
597
|
+
return tabElement ? tabs.find((tab) => tab.id + "-tab" === tabElement.id) : void 0;
|
|
598
|
+
}
|
|
599
|
+
updateScrollVisibility() {
|
|
600
|
+
asapScheduler.schedule(() => {
|
|
601
|
+
const element = this.tabListElement().nativeElement;
|
|
602
|
+
const isVertical = this.orientation() === "vertical";
|
|
603
|
+
this.overflowControlsVisible.set(isVertical ? element.scrollHeight > element.clientHeight : element.scrollWidth > element.clientWidth);
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
static {
|
|
607
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
608
|
+
minVersion: "12.0.0",
|
|
609
|
+
version: "22.2.6",
|
|
610
|
+
ngImport: i0,
|
|
611
|
+
type: TabListComponent,
|
|
612
|
+
deps: [],
|
|
613
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
static {
|
|
617
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
618
|
+
minVersion: "17.0.0",
|
|
619
|
+
version: "22.2.6",
|
|
620
|
+
type: TabListComponent,
|
|
621
|
+
isStandalone: true,
|
|
622
|
+
selector: "mona-tab-list",
|
|
623
|
+
inputs: {
|
|
624
|
+
ariaLabel: {
|
|
625
|
+
classPropertyName: "ariaLabel",
|
|
626
|
+
publicName: "aria-label",
|
|
627
|
+
isSignal: true,
|
|
628
|
+
isRequired: false,
|
|
629
|
+
transformFunction: null
|
|
630
|
+
},
|
|
631
|
+
ariaLabelledBy: {
|
|
632
|
+
classPropertyName: "ariaLabelledBy",
|
|
633
|
+
publicName: "aria-labelledby",
|
|
634
|
+
isSignal: true,
|
|
635
|
+
isRequired: false,
|
|
636
|
+
transformFunction: null
|
|
637
|
+
},
|
|
638
|
+
closable: {
|
|
639
|
+
classPropertyName: "closable",
|
|
640
|
+
publicName: "closable",
|
|
641
|
+
isSignal: true,
|
|
642
|
+
isRequired: false,
|
|
643
|
+
transformFunction: null
|
|
644
|
+
},
|
|
645
|
+
disabled: {
|
|
646
|
+
classPropertyName: "disabled",
|
|
647
|
+
publicName: "disabled",
|
|
648
|
+
isSignal: true,
|
|
649
|
+
isRequired: false,
|
|
650
|
+
transformFunction: null
|
|
651
|
+
},
|
|
652
|
+
position: {
|
|
653
|
+
classPropertyName: "position",
|
|
654
|
+
publicName: "position",
|
|
655
|
+
isSignal: true,
|
|
656
|
+
isRequired: true,
|
|
657
|
+
transformFunction: null
|
|
658
|
+
},
|
|
659
|
+
selectedTabId: {
|
|
660
|
+
classPropertyName: "selectedTabId",
|
|
661
|
+
publicName: "selectedTabId",
|
|
662
|
+
isSignal: true,
|
|
663
|
+
isRequired: false,
|
|
664
|
+
transformFunction: null
|
|
665
|
+
},
|
|
666
|
+
size: {
|
|
667
|
+
classPropertyName: "size",
|
|
668
|
+
publicName: "size",
|
|
669
|
+
isSignal: true,
|
|
670
|
+
isRequired: true,
|
|
671
|
+
transformFunction: null
|
|
672
|
+
},
|
|
673
|
+
tabList: {
|
|
674
|
+
classPropertyName: "tabList",
|
|
675
|
+
publicName: "tabList",
|
|
676
|
+
isSignal: true,
|
|
677
|
+
isRequired: true,
|
|
678
|
+
transformFunction: null
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
outputs: {
|
|
682
|
+
selectedTabId: "selectedTabIdChange",
|
|
683
|
+
tabClose: "tabClose",
|
|
684
|
+
tabSelect: "tabSelect"
|
|
685
|
+
},
|
|
686
|
+
host: {
|
|
687
|
+
listeners: {
|
|
688
|
+
"focusin": "onFocusIn($event)",
|
|
689
|
+
"focusout": "onFocusOut($event)",
|
|
690
|
+
"keydown": "onKeydown($event)"
|
|
691
|
+
},
|
|
692
|
+
properties: {
|
|
693
|
+
"attr.aria-label": "null",
|
|
694
|
+
"attr.aria-labelledby": "null",
|
|
695
|
+
"class": "baseClass()"
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
viewQueries: [{
|
|
699
|
+
propertyName: "tabElements",
|
|
700
|
+
predicate: ["tabElement"],
|
|
701
|
+
descendants: true,
|
|
702
|
+
isSignal: true
|
|
703
|
+
}, {
|
|
704
|
+
propertyName: "tabListElement",
|
|
705
|
+
first: true,
|
|
706
|
+
predicate: ["tabListElement"],
|
|
707
|
+
descendants: true,
|
|
708
|
+
isSignal: true
|
|
709
|
+
}],
|
|
710
|
+
ngImport: i0,
|
|
711
|
+
template: "@if (overflowControlsVisible()) {\n <button\n monaButton\n type=\"button\"\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollPrevious\"\n (click)=\"startScrolling(tabListElement, 'previous', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'previous')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronUp [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronLeft [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n<div [class]=\"listWrapperClass()\">\n <ul\n [class]=\"listClass()\"\n #tabListElement\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-orientation]=\"orientation()\">\n @for (tab of tabList(); track tab.id) {\n @let selected = tab.id === selectedTabId();\n @let itemDisabled = tab.disabled || disabled();\n @let tabClosable = tab.closable || closable();\n <li\n monaTabListItem\n [active]=\"selected\"\n [disabled]=\"itemDisabled\"\n [position]=\"position()\"\n [size]=\"size()\"\n role=\"presentation\"\n [attr.data-selected]=\"selected\"\n [attr.data-tab-id]=\"tab.id\">\n <div\n #tabElement\n [class]=\"tabClass()\"\n [id]=\"tab.id + '-tab'\"\n role=\"tab\"\n [tabindex]=\"selected ? 0 : -1\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"itemDisabled\"\n [attr.aria-controls]=\"tab.id + '-panel'\"\n [attr.aria-keyshortcuts]=\"tabClosable && !itemDisabled ? 'Delete Backspace' : null\"\n (click)=\"onTabClick(tab, $event)\">\n <div>\n @if (tab.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"tab.titleTemplate\"></ng-container>\n } @else {\n <span>{{ tab.title }}</span>\n }\n </div>\n </div>\n @if (tabClosable) {\n <!-- For the pointer. A button assistive technology can see isn't allowed inside a tablist. -->\n <button\n monaButton\n type=\"button\"\n look=\"link\"\n data-tab-close\n [disabled]=\"itemDisabled\"\n [attr.aria-hidden]=\"true\"\n [attr.aria-label]=\"messages().closeTab\"\n (click)=\"onTabClose(tab, $event)\"\n [class]=\"closeButtonClass()\"\n tabindex=\"-1\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n }\n </li>\n }\n </ul>\n</div>\n@if (hasClosableTabs()) {\n <!-- The same action for assistive technology, outside the tablist. The keyboard's route is Delete. -->\n <div class=\"sr-only\">\n @for (tab of tabList(); track tab.id) {\n @if (tab.closable || closable()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n [id]=\"tab.id + '-close'\"\n [disabled]=\"tab.disabled || disabled()\"\n [attr.aria-label]=\"messages().closeTab\"\n [attr.aria-labelledby]=\"tab.id + '-close ' + tab.id + '-tab'\"\n [attr.data-tab-id]=\"tab.id\"\n (click)=\"onTabClose(tab, $event)\"></button>\n }\n }\n </div>\n}\n@if (overflowControlsVisible()) {\n <button\n monaButton\n type=\"button\"\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollNext\"\n (click)=\"startScrolling(tabListElement, 'next', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'next')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronDown [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n",
|
|
712
|
+
dependencies: [
|
|
713
|
+
{
|
|
714
|
+
kind: "directive",
|
|
715
|
+
type: ButtonDirective,
|
|
716
|
+
selector: "button[monaButton]",
|
|
717
|
+
inputs: [
|
|
718
|
+
"aria-haspopup",
|
|
719
|
+
"disabled",
|
|
720
|
+
"iconOnly",
|
|
721
|
+
"loading",
|
|
722
|
+
"look",
|
|
723
|
+
"rounded",
|
|
724
|
+
"selected",
|
|
725
|
+
"size",
|
|
726
|
+
"tabindex",
|
|
727
|
+
"toggleable",
|
|
728
|
+
"type",
|
|
729
|
+
"class",
|
|
730
|
+
"value"
|
|
731
|
+
],
|
|
732
|
+
outputs: ["lookChange", "selectedChange"]
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
kind: "directive",
|
|
736
|
+
type: NgTemplateOutlet,
|
|
737
|
+
selector: "[ngTemplateOutlet]",
|
|
738
|
+
inputs: [
|
|
739
|
+
"ngTemplateOutletContext",
|
|
740
|
+
"ngTemplateOutlet",
|
|
741
|
+
"ngTemplateOutletInjector"
|
|
742
|
+
]
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
kind: "directive",
|
|
746
|
+
type: TabListItemDirective,
|
|
747
|
+
selector: "li[monaTabListItem]",
|
|
748
|
+
inputs: [
|
|
749
|
+
"active",
|
|
750
|
+
"disabled",
|
|
751
|
+
"position",
|
|
752
|
+
"size"
|
|
753
|
+
]
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
kind: "component",
|
|
757
|
+
type: LucideChevronDown,
|
|
758
|
+
selector: "svg[lucideChevronDown]"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
kind: "component",
|
|
762
|
+
type: LucideChevronLeft,
|
|
763
|
+
selector: "svg[lucideChevronLeft]"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
kind: "component",
|
|
767
|
+
type: LucideChevronRight,
|
|
768
|
+
selector: "svg[lucideChevronRight]"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
kind: "component",
|
|
772
|
+
type: LucideChevronUp,
|
|
773
|
+
selector: "svg[lucideChevronUp]"
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
kind: "component",
|
|
777
|
+
type: LucideX,
|
|
778
|
+
selector: "svg[lucideX]"
|
|
779
|
+
}
|
|
780
|
+
]
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
785
|
+
minVersion: "12.0.0",
|
|
786
|
+
version: "22.2.6",
|
|
787
|
+
ngImport: i0,
|
|
788
|
+
type: TabListComponent,
|
|
789
|
+
decorators: [{
|
|
790
|
+
type: Component,
|
|
791
|
+
args: [{
|
|
792
|
+
selector: "mona-tab-list",
|
|
793
|
+
imports: [
|
|
794
|
+
ButtonDirective,
|
|
795
|
+
NgTemplateOutlet,
|
|
796
|
+
TabListItemDirective,
|
|
797
|
+
LucideChevronDown,
|
|
798
|
+
LucideChevronLeft,
|
|
799
|
+
LucideChevronRight,
|
|
800
|
+
LucideChevronUp,
|
|
801
|
+
LucideX
|
|
802
|
+
],
|
|
803
|
+
host: {
|
|
804
|
+
"[attr.aria-label]": "null",
|
|
805
|
+
"[attr.aria-labelledby]": "null",
|
|
806
|
+
"[class]": "baseClass()",
|
|
807
|
+
"(focusin)": "onFocusIn($event)",
|
|
808
|
+
"(focusout)": "onFocusOut($event)",
|
|
809
|
+
"(keydown)": "onKeydown($event)"
|
|
810
|
+
},
|
|
811
|
+
template: "@if (overflowControlsVisible()) {\n <button\n monaButton\n type=\"button\"\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollPrevious\"\n (click)=\"startScrolling(tabListElement, 'previous', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'previous')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronUp [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronLeft [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n<div [class]=\"listWrapperClass()\">\n <ul\n [class]=\"listClass()\"\n #tabListElement\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-orientation]=\"orientation()\">\n @for (tab of tabList(); track tab.id) {\n @let selected = tab.id === selectedTabId();\n @let itemDisabled = tab.disabled || disabled();\n @let tabClosable = tab.closable || closable();\n <li\n monaTabListItem\n [active]=\"selected\"\n [disabled]=\"itemDisabled\"\n [position]=\"position()\"\n [size]=\"size()\"\n role=\"presentation\"\n [attr.data-selected]=\"selected\"\n [attr.data-tab-id]=\"tab.id\">\n <div\n #tabElement\n [class]=\"tabClass()\"\n [id]=\"tab.id + '-tab'\"\n role=\"tab\"\n [tabindex]=\"selected ? 0 : -1\"\n [attr.aria-selected]=\"selected\"\n [attr.aria-disabled]=\"itemDisabled\"\n [attr.aria-controls]=\"tab.id + '-panel'\"\n [attr.aria-keyshortcuts]=\"tabClosable && !itemDisabled ? 'Delete Backspace' : null\"\n (click)=\"onTabClick(tab, $event)\">\n <div>\n @if (tab.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"tab.titleTemplate\"></ng-container>\n } @else {\n <span>{{ tab.title }}</span>\n }\n </div>\n </div>\n @if (tabClosable) {\n <!-- For the pointer. A button assistive technology can see isn't allowed inside a tablist. -->\n <button\n monaButton\n type=\"button\"\n look=\"link\"\n data-tab-close\n [disabled]=\"itemDisabled\"\n [attr.aria-hidden]=\"true\"\n [attr.aria-label]=\"messages().closeTab\"\n (click)=\"onTabClose(tab, $event)\"\n [class]=\"closeButtonClass()\"\n tabindex=\"-1\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n }\n </li>\n }\n </ul>\n</div>\n@if (hasClosableTabs()) {\n <!-- The same action for assistive technology, outside the tablist. The keyboard's route is Delete. -->\n <div class=\"sr-only\">\n @for (tab of tabList(); track tab.id) {\n @if (tab.closable || closable()) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n [id]=\"tab.id + '-close'\"\n [disabled]=\"tab.disabled || disabled()\"\n [attr.aria-label]=\"messages().closeTab\"\n [attr.aria-labelledby]=\"tab.id + '-close ' + tab.id + '-tab'\"\n [attr.data-tab-id]=\"tab.id\"\n (click)=\"onTabClose(tab, $event)\"></button>\n }\n }\n </div>\n}\n@if (overflowControlsVisible()) {\n <button\n monaButton\n type=\"button\"\n look=\"link\"\n size=\"small\"\n [class]=\"scrollButtonClass()\"\n [attr.aria-label]=\"messages().scrollNext\"\n (click)=\"startScrolling(tabListElement, 'next', 'single')\"\n (pointerdown)=\"startContinuousScroll($event, tabListElement, 'next')\"\n (pointerup)=\"stopScrolling()\"\n (pointercancel)=\"stopScrolling()\"\n [attr.aria-hidden]=\"true\"\n tabindex=\"-1\">\n @if (orientation() === 'vertical') {\n <svg lucideChevronDown [size]=\"16\"></svg>\n } @else {\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n }\n </button>\n}\n"
|
|
812
|
+
}]
|
|
813
|
+
}],
|
|
814
|
+
ctorParameters: () => [],
|
|
815
|
+
propDecorators: {
|
|
816
|
+
tabElements: [{
|
|
817
|
+
type: i0.ViewChildren,
|
|
818
|
+
args: ["tabElement", { isSignal: true }]
|
|
819
|
+
}],
|
|
820
|
+
tabListElement: [{
|
|
821
|
+
type: i0.ViewChild,
|
|
822
|
+
args: ["tabListElement", { isSignal: true }]
|
|
823
|
+
}],
|
|
824
|
+
ariaLabel: [{
|
|
825
|
+
type: i0.Input,
|
|
826
|
+
args: [{
|
|
827
|
+
isSignal: true,
|
|
828
|
+
alias: "aria-label",
|
|
829
|
+
required: false
|
|
830
|
+
}]
|
|
831
|
+
}],
|
|
832
|
+
ariaLabelledBy: [{
|
|
833
|
+
type: i0.Input,
|
|
834
|
+
args: [{
|
|
835
|
+
isSignal: true,
|
|
836
|
+
alias: "aria-labelledby",
|
|
837
|
+
required: false
|
|
838
|
+
}]
|
|
839
|
+
}],
|
|
840
|
+
closable: [{
|
|
841
|
+
type: i0.Input,
|
|
842
|
+
args: [{
|
|
843
|
+
isSignal: true,
|
|
844
|
+
alias: "closable",
|
|
845
|
+
required: false
|
|
846
|
+
}]
|
|
847
|
+
}],
|
|
848
|
+
disabled: [{
|
|
849
|
+
type: i0.Input,
|
|
850
|
+
args: [{
|
|
851
|
+
isSignal: true,
|
|
852
|
+
alias: "disabled",
|
|
853
|
+
required: false
|
|
854
|
+
}]
|
|
855
|
+
}],
|
|
856
|
+
position: [{
|
|
857
|
+
type: i0.Input,
|
|
858
|
+
args: [{
|
|
859
|
+
isSignal: true,
|
|
860
|
+
alias: "position",
|
|
861
|
+
required: true
|
|
862
|
+
}]
|
|
863
|
+
}],
|
|
864
|
+
selectedTabId: [{
|
|
865
|
+
type: i0.Input,
|
|
866
|
+
args: [{
|
|
867
|
+
isSignal: true,
|
|
868
|
+
alias: "selectedTabId",
|
|
869
|
+
required: false
|
|
870
|
+
}]
|
|
871
|
+
}, {
|
|
872
|
+
type: i0.Output,
|
|
873
|
+
args: ["selectedTabIdChange"]
|
|
874
|
+
}],
|
|
875
|
+
size: [{
|
|
876
|
+
type: i0.Input,
|
|
877
|
+
args: [{
|
|
878
|
+
isSignal: true,
|
|
879
|
+
alias: "size",
|
|
880
|
+
required: true
|
|
881
|
+
}]
|
|
882
|
+
}],
|
|
883
|
+
tabClose: [{
|
|
884
|
+
type: i0.Output,
|
|
885
|
+
args: ["tabClose"]
|
|
886
|
+
}],
|
|
887
|
+
tabList: [{
|
|
888
|
+
type: i0.Input,
|
|
889
|
+
args: [{
|
|
890
|
+
isSignal: true,
|
|
891
|
+
alias: "tabList",
|
|
892
|
+
required: true
|
|
893
|
+
}]
|
|
894
|
+
}],
|
|
895
|
+
tabSelect: [{
|
|
896
|
+
type: i0.Output,
|
|
897
|
+
args: ["tabSelect"]
|
|
898
|
+
}]
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
var TabComponent = class TabComponent {
|
|
902
|
+
constructor() {
|
|
903
|
+
this.#id = createElementControlId();
|
|
904
|
+
this.#tabItem = computed(() => {
|
|
905
|
+
const closable = this.closable();
|
|
906
|
+
const contentTemplate = this.contentTemplate();
|
|
907
|
+
const disabled = this.disabled();
|
|
908
|
+
const selected = this.selected();
|
|
909
|
+
const titleTemplate = this.titleTemplate();
|
|
910
|
+
const title = this.title();
|
|
911
|
+
return {
|
|
912
|
+
closable,
|
|
913
|
+
contentTemplate,
|
|
914
|
+
disabled,
|
|
915
|
+
id: this.#id,
|
|
916
|
+
index: 0,
|
|
917
|
+
selected,
|
|
918
|
+
title,
|
|
919
|
+
titleTemplate
|
|
920
|
+
};
|
|
921
|
+
}, ...ngDevMode ? [{ debugName: "#tabItem" }] : /* istanbul ignore next */ []);
|
|
922
|
+
this.contentTemplate = contentChild(TabContentTemplateDirective, {
|
|
923
|
+
...ngDevMode ? { debugName: "contentTemplate" } : /* istanbul ignore next */ {},
|
|
924
|
+
read: TemplateRef
|
|
925
|
+
});
|
|
926
|
+
this.titleTemplate = contentChild(TabTitleTemplateDirective, {
|
|
927
|
+
...ngDevMode ? { debugName: "titleTemplate" } : /* istanbul ignore next */ {},
|
|
928
|
+
read: TemplateRef
|
|
929
|
+
});
|
|
930
|
+
this.closable = input(false, {
|
|
931
|
+
...ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {},
|
|
932
|
+
transform: booleanAttribute
|
|
933
|
+
});
|
|
934
|
+
this.disabled = input(false, {
|
|
935
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
936
|
+
transform: booleanAttribute
|
|
937
|
+
});
|
|
938
|
+
this.selected = model(false, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
939
|
+
this.title = input("", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
940
|
+
}
|
|
941
|
+
#id;
|
|
942
|
+
#tabItem;
|
|
943
|
+
get tabItem() {
|
|
944
|
+
return this.#tabItem();
|
|
945
|
+
}
|
|
946
|
+
static {
|
|
947
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
948
|
+
minVersion: "12.0.0",
|
|
949
|
+
version: "22.2.6",
|
|
950
|
+
ngImport: i0,
|
|
951
|
+
type: TabComponent,
|
|
952
|
+
deps: [],
|
|
953
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
static {
|
|
957
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
958
|
+
minVersion: "17.2.0",
|
|
959
|
+
version: "22.2.6",
|
|
960
|
+
type: TabComponent,
|
|
961
|
+
isStandalone: true,
|
|
962
|
+
selector: "mona-tab",
|
|
963
|
+
inputs: {
|
|
964
|
+
closable: {
|
|
965
|
+
classPropertyName: "closable",
|
|
966
|
+
publicName: "closable",
|
|
967
|
+
isSignal: true,
|
|
968
|
+
isRequired: false,
|
|
969
|
+
transformFunction: null
|
|
970
|
+
},
|
|
971
|
+
disabled: {
|
|
972
|
+
classPropertyName: "disabled",
|
|
973
|
+
publicName: "disabled",
|
|
974
|
+
isSignal: true,
|
|
975
|
+
isRequired: false,
|
|
976
|
+
transformFunction: null
|
|
977
|
+
},
|
|
978
|
+
selected: {
|
|
979
|
+
classPropertyName: "selected",
|
|
980
|
+
publicName: "selected",
|
|
981
|
+
isSignal: true,
|
|
982
|
+
isRequired: false,
|
|
983
|
+
transformFunction: null
|
|
984
|
+
},
|
|
985
|
+
title: {
|
|
986
|
+
classPropertyName: "title",
|
|
987
|
+
publicName: "title",
|
|
988
|
+
isSignal: true,
|
|
989
|
+
isRequired: false,
|
|
990
|
+
transformFunction: null
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
outputs: { selected: "selectedChange" },
|
|
994
|
+
queries: [{
|
|
995
|
+
propertyName: "contentTemplate",
|
|
996
|
+
first: true,
|
|
997
|
+
predicate: TabContentTemplateDirective,
|
|
998
|
+
descendants: true,
|
|
999
|
+
read: TemplateRef,
|
|
1000
|
+
isSignal: true
|
|
1001
|
+
}, {
|
|
1002
|
+
propertyName: "titleTemplate",
|
|
1003
|
+
first: true,
|
|
1004
|
+
predicate: TabTitleTemplateDirective,
|
|
1005
|
+
descendants: true,
|
|
1006
|
+
read: TemplateRef,
|
|
1007
|
+
isSignal: true
|
|
1008
|
+
}],
|
|
1009
|
+
ngImport: i0,
|
|
1010
|
+
template: "",
|
|
1011
|
+
isInline: true
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1016
|
+
minVersion: "12.0.0",
|
|
1017
|
+
version: "22.2.6",
|
|
1018
|
+
ngImport: i0,
|
|
1019
|
+
type: TabComponent,
|
|
1020
|
+
decorators: [{
|
|
1021
|
+
type: Component,
|
|
1022
|
+
args: [{
|
|
1023
|
+
selector: "mona-tab",
|
|
1024
|
+
template: ""
|
|
1025
|
+
}]
|
|
1026
|
+
}],
|
|
1027
|
+
propDecorators: {
|
|
1028
|
+
contentTemplate: [{
|
|
1029
|
+
type: i0.ContentChild,
|
|
1030
|
+
args: [i0.forwardRef(() => TabContentTemplateDirective), {
|
|
1031
|
+
read: TemplateRef,
|
|
1032
|
+
isSignal: true
|
|
1033
|
+
}]
|
|
1034
|
+
}],
|
|
1035
|
+
titleTemplate: [{
|
|
1036
|
+
type: i0.ContentChild,
|
|
1037
|
+
args: [i0.forwardRef(() => TabTitleTemplateDirective), {
|
|
1038
|
+
read: TemplateRef,
|
|
1039
|
+
isSignal: true
|
|
1040
|
+
}]
|
|
1041
|
+
}],
|
|
1042
|
+
closable: [{
|
|
1043
|
+
type: i0.Input,
|
|
1044
|
+
args: [{
|
|
1045
|
+
isSignal: true,
|
|
1046
|
+
alias: "closable",
|
|
1047
|
+
required: false
|
|
1048
|
+
}]
|
|
1049
|
+
}],
|
|
1050
|
+
disabled: [{
|
|
1051
|
+
type: i0.Input,
|
|
1052
|
+
args: [{
|
|
1053
|
+
isSignal: true,
|
|
1054
|
+
alias: "disabled",
|
|
1055
|
+
required: false
|
|
1056
|
+
}]
|
|
1057
|
+
}],
|
|
1058
|
+
selected: [{
|
|
1059
|
+
type: i0.Input,
|
|
1060
|
+
args: [{
|
|
1061
|
+
isSignal: true,
|
|
1062
|
+
alias: "selected",
|
|
1063
|
+
required: false
|
|
1064
|
+
}]
|
|
1065
|
+
}, {
|
|
1066
|
+
type: i0.Output,
|
|
1067
|
+
args: ["selectedChange"]
|
|
1068
|
+
}],
|
|
1069
|
+
title: [{
|
|
1070
|
+
type: i0.Input,
|
|
1071
|
+
args: [{
|
|
1072
|
+
isSignal: true,
|
|
1073
|
+
alias: "title",
|
|
1074
|
+
required: false
|
|
1075
|
+
}]
|
|
1076
|
+
}]
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
692
1079
|
function isEnabled(tab) {
|
|
693
|
-
|
|
1080
|
+
return !tab.disabled;
|
|
694
1081
|
}
|
|
695
|
-
/** The tab to select after the selected one is gone: the one that took its place, else the nearest before it. */
|
|
696
1082
|
function neighborOf(tabs, removedIndex) {
|
|
697
|
-
|
|
698
|
-
}
|
|
699
|
-
class TabsComponent {
|
|
700
|
-
#flaggedTabId;
|
|
701
|
-
#reportedIndex;
|
|
702
|
-
/**
|
|
703
|
-
* Whether the tabs have rendered. A tab in an `@for` gets its inputs after this component first reads it, so until then
|
|
704
|
-
* a selection is only a first guess, and a tab that turns out to be disabled was never really selected.
|
|
705
|
-
*/
|
|
706
|
-
#tabsSettled;
|
|
707
|
-
constructor() {
|
|
708
|
-
this.#flaggedTabId = null;
|
|
709
|
-
this.#reportedIndex = null;
|
|
710
|
-
/**
|
|
711
|
-
* Whether the tabs have rendered. A tab in an `@for` gets its inputs after this component first reads it, so until then
|
|
712
|
-
* a selection is only a first guess, and a tab that turns out to be disabled was never really selected.
|
|
713
|
-
*/
|
|
714
|
-
this.#tabsSettled = false;
|
|
715
|
-
this.baseClass = computed(() => {
|
|
716
|
-
const variantClass = tabsBaseThemeVariants({ position: this.position() });
|
|
717
|
-
const userClass = this.userClass();
|
|
718
|
-
return twMerge(variantClass, userClass);
|
|
719
|
-
}, /* @ts-ignore */
|
|
720
|
-
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
721
|
-
this.contentClass = computed(() => {
|
|
722
|
-
return tabContentThemeVariants();
|
|
723
|
-
}, /* @ts-ignore */
|
|
724
|
-
...(ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []));
|
|
725
|
-
this.selectedTabId = linkedSignal({ ...(ngDevMode ? { debugName: "selectedTabId" } : /* istanbul ignore next */ {}), source: () => this.tabList(),
|
|
726
|
-
computation: (tabList, previous) => {
|
|
727
|
-
const tabs = tabList.toArray();
|
|
728
|
-
const previousId = previous?.value ?? null;
|
|
729
|
-
if (previousId === null || !this.#tabsSettled) {
|
|
730
|
-
const requested = tabs[untracked(this.selectedIndex)];
|
|
731
|
-
return (requested && isEnabled(requested) ? requested : tabs.find(isEnabled))?.id ?? null;
|
|
732
|
-
}
|
|
733
|
-
if (tabs.some(tab => tab.id === previousId)) {
|
|
734
|
-
return previousId;
|
|
735
|
-
}
|
|
736
|
-
const removedIndex = previous?.source.toArray().findIndex(tab => tab.id === previousId) ?? 0;
|
|
737
|
-
return neighborOf(tabs, removedIndex)?.id ?? null;
|
|
738
|
-
} });
|
|
739
|
-
this.tabList = computed(() => {
|
|
740
|
-
const tabs = this.tabs();
|
|
741
|
-
return select(tabs, t => t.tabItem)
|
|
742
|
-
.tap((t, tx) => (t.index = tx))
|
|
743
|
-
.toImmutableSet();
|
|
744
|
-
}, /* @ts-ignore */
|
|
745
|
-
...(ngDevMode ? [{ debugName: "tabList" }] : /* istanbul ignore next */ []));
|
|
746
|
-
this.tabListComponent = viewChild.required(TabListComponent, /* @ts-ignore */
|
|
747
|
-
...(ngDevMode ? [{ debugName: "tabListComponent" }] : /* istanbul ignore next */ []));
|
|
748
|
-
this.tabs = contentChildren(TabComponent, /* @ts-ignore */
|
|
749
|
-
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
750
|
-
/**
|
|
751
|
-
* @description Accessible name for the tab list.
|
|
752
|
-
* @default ""
|
|
753
|
-
*/
|
|
754
|
-
this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
755
|
-
/**
|
|
756
|
-
* @description The id of an element that names the tab list. Takes precedence over `aria-label`.
|
|
757
|
-
* @default ""
|
|
758
|
-
*/
|
|
759
|
-
this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
|
|
760
|
-
/**
|
|
761
|
-
* @description Displays a close button on each tab. A tab's own `closable` can add a button, not remove this one.
|
|
762
|
-
* @default false
|
|
763
|
-
*/
|
|
764
|
-
this.closable = input(false, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
765
|
-
/**
|
|
766
|
-
* @description Renders every tab with reduced visual emphasis and removes pointer and keyboard interaction.
|
|
767
|
-
* @default false
|
|
768
|
-
*/
|
|
769
|
-
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
770
|
-
/**
|
|
771
|
-
* @description Keeps a tab's content in the DOM after it is deselected instead of removing it.
|
|
772
|
-
* @default true
|
|
773
|
-
*/
|
|
774
|
-
this.keepTabContent = input(true, { ...(ngDevMode ? { debugName: "keepTabContent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
775
|
-
/**
|
|
776
|
-
* @description Placement of the tab list relative to the tab content.
|
|
777
|
-
* @default "top"
|
|
778
|
-
*/
|
|
779
|
-
this.position = input("top", /* @ts-ignore */
|
|
780
|
-
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
781
|
-
/**
|
|
782
|
-
* @description The zero-based index of the selected tab. Writing it selects that tab, unless it's disabled or out of
|
|
783
|
-
* range, in which case the value goes back to the selected tab's index. It also changes when the component moves the
|
|
784
|
-
* selection itself, such as when the selected tab is removed.
|
|
785
|
-
* @default 0
|
|
786
|
-
*/
|
|
787
|
-
this.selectedIndex = model(0, /* @ts-ignore */
|
|
788
|
-
...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
789
|
-
/**
|
|
790
|
-
* @description Size preset controlling the tabs' dimensions.
|
|
791
|
-
* @default "medium"
|
|
792
|
-
*/
|
|
793
|
-
this.size = input("medium", /* @ts-ignore */
|
|
794
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
795
|
-
/**
|
|
796
|
-
* @description Emitted with a {@link TabCloseEvent} when a close is requested. The component doesn't remove the tab:
|
|
797
|
-
* remove it from whatever renders the `mona-tab` elements.
|
|
798
|
-
*/
|
|
799
|
-
this.tabClose = output();
|
|
800
|
-
/**
|
|
801
|
-
* @description Emitted with a {@link TabSelectEvent} before a click or key selects a tab. This event is preventable.
|
|
802
|
-
* It doesn't fire for selections made through `selectedIndex` or `selected`, or when the selected tab is removed.
|
|
803
|
-
*/
|
|
804
|
-
this.tabSelect = output();
|
|
805
|
-
/**
|
|
806
|
-
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
807
|
-
* @default ""
|
|
808
|
-
*/
|
|
809
|
-
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
810
|
-
effect(() => {
|
|
811
|
-
const requested = this.selectedIndex();
|
|
812
|
-
untracked(() => this.applyRequestedIndex(requested));
|
|
813
|
-
});
|
|
814
|
-
effect(() => {
|
|
815
|
-
const items = this.tabList().toArray();
|
|
816
|
-
const selectedId = this.selectedTabId();
|
|
817
|
-
untracked(() => this.syncSelection(items, selectedId));
|
|
818
|
-
});
|
|
819
|
-
afterRenderEffect({
|
|
820
|
-
read: () => {
|
|
821
|
-
this.#tabsSettled = this.tabList().length > 0;
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
}
|
|
825
|
-
handlePanelKeyDown(event) {
|
|
826
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
827
|
-
if (event.target !== event.currentTarget) {
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
event.preventDefault();
|
|
831
|
-
this.tabListComponent().focusSelectedTab();
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
applyRequestedIndex(requested) {
|
|
835
|
-
if (requested === this.#reportedIndex) {
|
|
836
|
-
return;
|
|
837
|
-
}
|
|
838
|
-
const items = this.tabList().toArray();
|
|
839
|
-
if (items.length === 0) {
|
|
840
|
-
return; // Tabs may still be on their way, and the linked signal reads the index when they arrive.
|
|
841
|
-
}
|
|
842
|
-
const tab = items[requested];
|
|
843
|
-
if (tab && isEnabled(tab)) {
|
|
844
|
-
this.selectedTabId.set(tab.id);
|
|
845
|
-
}
|
|
846
|
-
this.reportIndex(items, this.selectedTabId());
|
|
847
|
-
}
|
|
848
|
-
reportIndex(items, selectedId) {
|
|
849
|
-
const index = items.findIndex(item => item.id === selectedId);
|
|
850
|
-
if (index !== -1) {
|
|
851
|
-
this.#reportedIndex = index;
|
|
852
|
-
this.selectedIndex.set(index);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
/**
|
|
856
|
-
* Brings the three views of the selection together. A tab newly flagged `selected` from outside wins, and the first
|
|
857
|
-
* one wins when there are several. Every tab's `selected` and the index are then written to match, so a flag that was
|
|
858
|
-
* already seen, or one this method wrote, can't take the selection back.
|
|
859
|
-
*/
|
|
860
|
-
syncSelection(items, selectedId) {
|
|
861
|
-
const incoming = items.find(item => item.selected && item.id !== this.#flaggedTabId && item.id !== selectedId && isEnabled(item));
|
|
862
|
-
const nextId = incoming?.id ?? selectedId;
|
|
863
|
-
if (incoming) {
|
|
864
|
-
this.selectedTabId.set(incoming.id);
|
|
865
|
-
}
|
|
866
|
-
this.#flaggedTabId = nextId;
|
|
867
|
-
for (const tab of this.tabs()) {
|
|
868
|
-
tab.selected.set(tab.tabItem.id === nextId);
|
|
869
|
-
}
|
|
870
|
-
this.reportIndex(items, nextId);
|
|
871
|
-
}
|
|
872
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
873
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TabsComponent, isStandalone: true, selector: "mona-tabs", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, keepTabContent: { classPropertyName: "keepTabContent", publicName: "keepTabContent", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", tabClose: "tabClose", tabSelect: "tabSelect" }, host: { properties: { "class": "baseClass()", "attr.aria-label": "null", "attr.aria-labelledby": "null" } }, queries: [{ propertyName: "tabs", predicate: TabComponent, isSignal: true }], viewQueries: [{ propertyName: "tabListComponent", first: true, predicate: TabListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<mona-tab-list\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledBy()\"\n [closable]=\"closable()\"\n [disabled]=\"disabled()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [tabList]=\"tabList()\"\n [selectedTabId]=\"selectedTabId()\"\n (selectedTabIdChange)=\"selectedTabId.set($event)\"\n (tabClose)=\"tabClose.emit($event)\"\n (tabSelect)=\"tabSelect.emit($event)\"></mona-tab-list>\n<div [class]=\"contentClass()\">\n @for (tab of tabList(); track tab.id) {\n @let selected = tab.id === selectedTabId();\n @let tabLoaded = keepTabContent() || selected;\n @let tabHidden = keepTabContent() && !selected;\n @if (tabLoaded) {\n <div\n class=\"w-full h-full rounded-sm focus-visible:outline-2 focus-visible:outline-focus-indicator focus-visible:-outline-offset-2\"\n [class.hidden]=\"tabHidden\"\n role=\"tabpanel\"\n [id]=\"tab.id + '-panel'\"\n tabindex=\"0\"\n (keydown)=\"handlePanelKeyDown($event)\"\n [attr.aria-hidden]=\"tabHidden\"\n [attr.aria-labelledby]=\"tab.id + '-tab'\">\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\n </div>\n }\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TabListComponent, selector: "mona-tab-list", inputs: ["aria-label", "aria-labelledby", "closable", "disabled", "position", "selectedTabId", "size", "tabList"], outputs: ["selectedTabIdChange", "tabClose", "tabSelect"] }] }); }
|
|
1083
|
+
return tabs.slice(removedIndex).find(isEnabled) ?? tabs.slice(0, removedIndex).reverse().find(isEnabled);
|
|
874
1084
|
}
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
*/
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1085
|
+
var TabsComponent = class TabsComponent {
|
|
1086
|
+
#flaggedTabId;
|
|
1087
|
+
#reportedIndex;
|
|
1088
|
+
#tabsSettled;
|
|
1089
|
+
constructor() {
|
|
1090
|
+
this.#flaggedTabId = null;
|
|
1091
|
+
this.#reportedIndex = null;
|
|
1092
|
+
this.#tabsSettled = false;
|
|
1093
|
+
this.baseClass = computed(() => {
|
|
1094
|
+
const variantClass = tabsBaseThemeVariants({ position: this.position() });
|
|
1095
|
+
const userClass = this.userClass();
|
|
1096
|
+
return twMerge(variantClass, userClass);
|
|
1097
|
+
}, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
1098
|
+
this.contentClass = computed(() => {
|
|
1099
|
+
return tabContentThemeVariants();
|
|
1100
|
+
}, ...ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []);
|
|
1101
|
+
this.selectedTabId = linkedSignal({
|
|
1102
|
+
...ngDevMode ? { debugName: "selectedTabId" } : /* istanbul ignore next */ {},
|
|
1103
|
+
source: () => this.tabList(),
|
|
1104
|
+
computation: (tabList, previous) => {
|
|
1105
|
+
const tabs = tabList.toArray();
|
|
1106
|
+
const previousId = previous?.value ?? null;
|
|
1107
|
+
if (previousId === null || !this.#tabsSettled) {
|
|
1108
|
+
const requested = tabs[untracked(this.selectedIndex)];
|
|
1109
|
+
return (requested && isEnabled(requested) ? requested : tabs.find(isEnabled))?.id ?? null;
|
|
1110
|
+
}
|
|
1111
|
+
if (tabs.some((tab) => tab.id === previousId)) return previousId;
|
|
1112
|
+
return neighborOf(tabs, previous?.source.toArray().findIndex((tab) => tab.id === previousId) ?? 0)?.id ?? null;
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
this.tabList = computed(() => {
|
|
1116
|
+
const tabs = this.tabs();
|
|
1117
|
+
return select(tabs, (t) => t.tabItem).tap((t, tx) => t.index = tx).toImmutableSet();
|
|
1118
|
+
}, ...ngDevMode ? [{ debugName: "tabList" }] : /* istanbul ignore next */ []);
|
|
1119
|
+
this.tabListComponent = viewChild.required(TabListComponent, ...ngDevMode ? [{ debugName: "tabListComponent" }] : /* istanbul ignore next */ []);
|
|
1120
|
+
this.tabs = contentChildren(TabComponent, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
1121
|
+
this.ariaLabel = input("", {
|
|
1122
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
1123
|
+
alias: "aria-label"
|
|
1124
|
+
});
|
|
1125
|
+
this.ariaLabelledBy = input("", {
|
|
1126
|
+
...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
|
|
1127
|
+
alias: "aria-labelledby"
|
|
1128
|
+
});
|
|
1129
|
+
this.closable = input(false, {
|
|
1130
|
+
...ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {},
|
|
1131
|
+
transform: booleanAttribute
|
|
1132
|
+
});
|
|
1133
|
+
this.disabled = input(false, {
|
|
1134
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
1135
|
+
transform: booleanAttribute
|
|
1136
|
+
});
|
|
1137
|
+
this.keepTabContent = input(true, {
|
|
1138
|
+
...ngDevMode ? { debugName: "keepTabContent" } : /* istanbul ignore next */ {},
|
|
1139
|
+
transform: booleanAttribute
|
|
1140
|
+
});
|
|
1141
|
+
this.position = input("top", ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
|
|
1142
|
+
this.selectedIndex = model(0, ...ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []);
|
|
1143
|
+
this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
1144
|
+
this.tabClose = output();
|
|
1145
|
+
this.tabSelect = output();
|
|
1146
|
+
this.userClass = input("", {
|
|
1147
|
+
...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
|
|
1148
|
+
alias: "class"
|
|
1149
|
+
});
|
|
1150
|
+
effect(() => {
|
|
1151
|
+
const requested = this.selectedIndex();
|
|
1152
|
+
untracked(() => this.applyRequestedIndex(requested));
|
|
1153
|
+
});
|
|
1154
|
+
effect(() => {
|
|
1155
|
+
const items = this.tabList().toArray();
|
|
1156
|
+
const selectedId = this.selectedTabId();
|
|
1157
|
+
untracked(() => this.syncSelection(items, selectedId));
|
|
1158
|
+
});
|
|
1159
|
+
afterRenderEffect({ read: () => {
|
|
1160
|
+
this.#tabsSettled = this.tabList().length > 0;
|
|
1161
|
+
} });
|
|
1162
|
+
}
|
|
1163
|
+
handlePanelKeyDown(event) {
|
|
1164
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
1165
|
+
if (event.target !== event.currentTarget) return;
|
|
1166
|
+
event.preventDefault();
|
|
1167
|
+
this.tabListComponent().focusSelectedTab();
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
applyRequestedIndex(requested) {
|
|
1171
|
+
if (requested === this.#reportedIndex) return;
|
|
1172
|
+
const items = this.tabList().toArray();
|
|
1173
|
+
if (items.length === 0) return;
|
|
1174
|
+
const tab = items[requested];
|
|
1175
|
+
if (tab && isEnabled(tab)) this.selectedTabId.set(tab.id);
|
|
1176
|
+
this.reportIndex(items, this.selectedTabId());
|
|
1177
|
+
}
|
|
1178
|
+
reportIndex(items, selectedId) {
|
|
1179
|
+
const index = items.findIndex((item) => item.id === selectedId);
|
|
1180
|
+
if (index !== -1) {
|
|
1181
|
+
this.#reportedIndex = index;
|
|
1182
|
+
this.selectedIndex.set(index);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
syncSelection(items, selectedId) {
|
|
1186
|
+
const incoming = items.find((item) => item.selected && item.id !== this.#flaggedTabId && item.id !== selectedId && isEnabled(item));
|
|
1187
|
+
const nextId = incoming?.id ?? selectedId;
|
|
1188
|
+
if (incoming) this.selectedTabId.set(incoming.id);
|
|
1189
|
+
this.#flaggedTabId = nextId;
|
|
1190
|
+
for (const tab of this.tabs()) tab.selected.set(tab.tabItem.id === nextId);
|
|
1191
|
+
this.reportIndex(items, nextId);
|
|
1192
|
+
}
|
|
1193
|
+
static {
|
|
1194
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1195
|
+
minVersion: "12.0.0",
|
|
1196
|
+
version: "22.2.6",
|
|
1197
|
+
ngImport: i0,
|
|
1198
|
+
type: TabsComponent,
|
|
1199
|
+
deps: [],
|
|
1200
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
static {
|
|
1204
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1205
|
+
minVersion: "17.0.0",
|
|
1206
|
+
version: "22.2.6",
|
|
1207
|
+
type: TabsComponent,
|
|
1208
|
+
isStandalone: true,
|
|
1209
|
+
selector: "mona-tabs",
|
|
1210
|
+
inputs: {
|
|
1211
|
+
ariaLabel: {
|
|
1212
|
+
classPropertyName: "ariaLabel",
|
|
1213
|
+
publicName: "aria-label",
|
|
1214
|
+
isSignal: true,
|
|
1215
|
+
isRequired: false,
|
|
1216
|
+
transformFunction: null
|
|
1217
|
+
},
|
|
1218
|
+
ariaLabelledBy: {
|
|
1219
|
+
classPropertyName: "ariaLabelledBy",
|
|
1220
|
+
publicName: "aria-labelledby",
|
|
1221
|
+
isSignal: true,
|
|
1222
|
+
isRequired: false,
|
|
1223
|
+
transformFunction: null
|
|
1224
|
+
},
|
|
1225
|
+
closable: {
|
|
1226
|
+
classPropertyName: "closable",
|
|
1227
|
+
publicName: "closable",
|
|
1228
|
+
isSignal: true,
|
|
1229
|
+
isRequired: false,
|
|
1230
|
+
transformFunction: null
|
|
1231
|
+
},
|
|
1232
|
+
disabled: {
|
|
1233
|
+
classPropertyName: "disabled",
|
|
1234
|
+
publicName: "disabled",
|
|
1235
|
+
isSignal: true,
|
|
1236
|
+
isRequired: false,
|
|
1237
|
+
transformFunction: null
|
|
1238
|
+
},
|
|
1239
|
+
keepTabContent: {
|
|
1240
|
+
classPropertyName: "keepTabContent",
|
|
1241
|
+
publicName: "keepTabContent",
|
|
1242
|
+
isSignal: true,
|
|
1243
|
+
isRequired: false,
|
|
1244
|
+
transformFunction: null
|
|
1245
|
+
},
|
|
1246
|
+
position: {
|
|
1247
|
+
classPropertyName: "position",
|
|
1248
|
+
publicName: "position",
|
|
1249
|
+
isSignal: true,
|
|
1250
|
+
isRequired: false,
|
|
1251
|
+
transformFunction: null
|
|
1252
|
+
},
|
|
1253
|
+
selectedIndex: {
|
|
1254
|
+
classPropertyName: "selectedIndex",
|
|
1255
|
+
publicName: "selectedIndex",
|
|
1256
|
+
isSignal: true,
|
|
1257
|
+
isRequired: false,
|
|
1258
|
+
transformFunction: null
|
|
1259
|
+
},
|
|
1260
|
+
size: {
|
|
1261
|
+
classPropertyName: "size",
|
|
1262
|
+
publicName: "size",
|
|
1263
|
+
isSignal: true,
|
|
1264
|
+
isRequired: false,
|
|
1265
|
+
transformFunction: null
|
|
1266
|
+
},
|
|
1267
|
+
userClass: {
|
|
1268
|
+
classPropertyName: "userClass",
|
|
1269
|
+
publicName: "class",
|
|
1270
|
+
isSignal: true,
|
|
1271
|
+
isRequired: false,
|
|
1272
|
+
transformFunction: null
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
outputs: {
|
|
1276
|
+
selectedIndex: "selectedIndexChange",
|
|
1277
|
+
tabClose: "tabClose",
|
|
1278
|
+
tabSelect: "tabSelect"
|
|
1279
|
+
},
|
|
1280
|
+
host: { properties: {
|
|
1281
|
+
"class": "baseClass()",
|
|
1282
|
+
"attr.aria-label": "null",
|
|
1283
|
+
"attr.aria-labelledby": "null"
|
|
1284
|
+
} },
|
|
1285
|
+
queries: [{
|
|
1286
|
+
propertyName: "tabs",
|
|
1287
|
+
predicate: TabComponent,
|
|
1288
|
+
isSignal: true
|
|
1289
|
+
}],
|
|
1290
|
+
viewQueries: [{
|
|
1291
|
+
propertyName: "tabListComponent",
|
|
1292
|
+
first: true,
|
|
1293
|
+
predicate: TabListComponent,
|
|
1294
|
+
descendants: true,
|
|
1295
|
+
isSignal: true
|
|
1296
|
+
}],
|
|
1297
|
+
ngImport: i0,
|
|
1298
|
+
template: "<mona-tab-list\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledBy()\"\n [closable]=\"closable()\"\n [disabled]=\"disabled()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [tabList]=\"tabList()\"\n [selectedTabId]=\"selectedTabId()\"\n (selectedTabIdChange)=\"selectedTabId.set($event)\"\n (tabClose)=\"tabClose.emit($event)\"\n (tabSelect)=\"tabSelect.emit($event)\"></mona-tab-list>\n<div [class]=\"contentClass()\">\n @for (tab of tabList(); track tab.id) {\n @let selected = tab.id === selectedTabId();\n @let tabLoaded = keepTabContent() || selected;\n @let tabHidden = keepTabContent() && !selected;\n @if (tabLoaded) {\n <div\n class=\"w-full h-full rounded-sm focus-visible:outline-2 focus-visible:outline-focus-indicator focus-visible:-outline-offset-2\"\n [class.hidden]=\"tabHidden\"\n role=\"tabpanel\"\n [id]=\"tab.id + '-panel'\"\n tabindex=\"0\"\n (keydown)=\"handlePanelKeyDown($event)\"\n [attr.aria-hidden]=\"tabHidden\"\n [attr.aria-labelledby]=\"tab.id + '-tab'\">\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\n </div>\n }\n }\n</div>\n",
|
|
1299
|
+
dependencies: [{
|
|
1300
|
+
kind: "directive",
|
|
1301
|
+
type: NgTemplateOutlet,
|
|
1302
|
+
selector: "[ngTemplateOutlet]",
|
|
1303
|
+
inputs: [
|
|
1304
|
+
"ngTemplateOutletContext",
|
|
1305
|
+
"ngTemplateOutlet",
|
|
1306
|
+
"ngTemplateOutletInjector"
|
|
1307
|
+
]
|
|
1308
|
+
}, {
|
|
1309
|
+
kind: "component",
|
|
1310
|
+
type: TabListComponent,
|
|
1311
|
+
selector: "mona-tab-list",
|
|
1312
|
+
inputs: [
|
|
1313
|
+
"aria-label",
|
|
1314
|
+
"aria-labelledby",
|
|
1315
|
+
"closable",
|
|
1316
|
+
"disabled",
|
|
1317
|
+
"position",
|
|
1318
|
+
"selectedTabId",
|
|
1319
|
+
"size",
|
|
1320
|
+
"tabList"
|
|
1321
|
+
],
|
|
1322
|
+
outputs: [
|
|
1323
|
+
"selectedTabIdChange",
|
|
1324
|
+
"tabClose",
|
|
1325
|
+
"tabSelect"
|
|
1326
|
+
]
|
|
1327
|
+
}]
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
};
|
|
1331
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1332
|
+
minVersion: "12.0.0",
|
|
1333
|
+
version: "22.2.6",
|
|
1334
|
+
ngImport: i0,
|
|
1335
|
+
type: TabsComponent,
|
|
1336
|
+
decorators: [{
|
|
1337
|
+
type: Component,
|
|
1338
|
+
args: [{
|
|
1339
|
+
selector: "mona-tabs",
|
|
1340
|
+
imports: [NgTemplateOutlet, TabListComponent],
|
|
1341
|
+
host: {
|
|
1342
|
+
"[class]": "baseClass()",
|
|
1343
|
+
"[attr.aria-label]": "null",
|
|
1344
|
+
"[attr.aria-labelledby]": "null"
|
|
1345
|
+
},
|
|
1346
|
+
template: "<mona-tab-list\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledBy()\"\n [closable]=\"closable()\"\n [disabled]=\"disabled()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [tabList]=\"tabList()\"\n [selectedTabId]=\"selectedTabId()\"\n (selectedTabIdChange)=\"selectedTabId.set($event)\"\n (tabClose)=\"tabClose.emit($event)\"\n (tabSelect)=\"tabSelect.emit($event)\"></mona-tab-list>\n<div [class]=\"contentClass()\">\n @for (tab of tabList(); track tab.id) {\n @let selected = tab.id === selectedTabId();\n @let tabLoaded = keepTabContent() || selected;\n @let tabHidden = keepTabContent() && !selected;\n @if (tabLoaded) {\n <div\n class=\"w-full h-full rounded-sm focus-visible:outline-2 focus-visible:outline-focus-indicator focus-visible:-outline-offset-2\"\n [class.hidden]=\"tabHidden\"\n role=\"tabpanel\"\n [id]=\"tab.id + '-panel'\"\n tabindex=\"0\"\n (keydown)=\"handlePanelKeyDown($event)\"\n [attr.aria-hidden]=\"tabHidden\"\n [attr.aria-labelledby]=\"tab.id + '-tab'\">\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\n </div>\n }\n }\n</div>\n"
|
|
1347
|
+
}]
|
|
1348
|
+
}],
|
|
1349
|
+
ctorParameters: () => [],
|
|
1350
|
+
propDecorators: {
|
|
1351
|
+
tabListComponent: [{
|
|
1352
|
+
type: i0.ViewChild,
|
|
1353
|
+
args: [i0.forwardRef(() => TabListComponent), { isSignal: true }]
|
|
1354
|
+
}],
|
|
1355
|
+
tabs: [{
|
|
1356
|
+
type: i0.ContentChildren,
|
|
1357
|
+
args: [i0.forwardRef(() => TabComponent), { isSignal: true }]
|
|
1358
|
+
}],
|
|
1359
|
+
ariaLabel: [{
|
|
1360
|
+
type: i0.Input,
|
|
1361
|
+
args: [{
|
|
1362
|
+
isSignal: true,
|
|
1363
|
+
alias: "aria-label",
|
|
1364
|
+
required: false
|
|
1365
|
+
}]
|
|
1366
|
+
}],
|
|
1367
|
+
ariaLabelledBy: [{
|
|
1368
|
+
type: i0.Input,
|
|
1369
|
+
args: [{
|
|
1370
|
+
isSignal: true,
|
|
1371
|
+
alias: "aria-labelledby",
|
|
1372
|
+
required: false
|
|
1373
|
+
}]
|
|
1374
|
+
}],
|
|
1375
|
+
closable: [{
|
|
1376
|
+
type: i0.Input,
|
|
1377
|
+
args: [{
|
|
1378
|
+
isSignal: true,
|
|
1379
|
+
alias: "closable",
|
|
1380
|
+
required: false
|
|
1381
|
+
}]
|
|
1382
|
+
}],
|
|
1383
|
+
disabled: [{
|
|
1384
|
+
type: i0.Input,
|
|
1385
|
+
args: [{
|
|
1386
|
+
isSignal: true,
|
|
1387
|
+
alias: "disabled",
|
|
1388
|
+
required: false
|
|
1389
|
+
}]
|
|
1390
|
+
}],
|
|
1391
|
+
keepTabContent: [{
|
|
1392
|
+
type: i0.Input,
|
|
1393
|
+
args: [{
|
|
1394
|
+
isSignal: true,
|
|
1395
|
+
alias: "keepTabContent",
|
|
1396
|
+
required: false
|
|
1397
|
+
}]
|
|
1398
|
+
}],
|
|
1399
|
+
position: [{
|
|
1400
|
+
type: i0.Input,
|
|
1401
|
+
args: [{
|
|
1402
|
+
isSignal: true,
|
|
1403
|
+
alias: "position",
|
|
1404
|
+
required: false
|
|
1405
|
+
}]
|
|
1406
|
+
}],
|
|
1407
|
+
selectedIndex: [{
|
|
1408
|
+
type: i0.Input,
|
|
1409
|
+
args: [{
|
|
1410
|
+
isSignal: true,
|
|
1411
|
+
alias: "selectedIndex",
|
|
1412
|
+
required: false
|
|
1413
|
+
}]
|
|
1414
|
+
}, {
|
|
1415
|
+
type: i0.Output,
|
|
1416
|
+
args: ["selectedIndexChange"]
|
|
1417
|
+
}],
|
|
1418
|
+
size: [{
|
|
1419
|
+
type: i0.Input,
|
|
1420
|
+
args: [{
|
|
1421
|
+
isSignal: true,
|
|
1422
|
+
alias: "size",
|
|
1423
|
+
required: false
|
|
1424
|
+
}]
|
|
1425
|
+
}],
|
|
1426
|
+
tabClose: [{
|
|
1427
|
+
type: i0.Output,
|
|
1428
|
+
args: ["tabClose"]
|
|
1429
|
+
}],
|
|
1430
|
+
tabSelect: [{
|
|
1431
|
+
type: i0.Output,
|
|
1432
|
+
args: ["tabSelect"]
|
|
1433
|
+
}],
|
|
1434
|
+
userClass: [{
|
|
1435
|
+
type: i0.Input,
|
|
1436
|
+
args: [{
|
|
1437
|
+
isSignal: true,
|
|
1438
|
+
alias: "class",
|
|
1439
|
+
required: false
|
|
1440
|
+
}]
|
|
1441
|
+
}]
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
893
1444
|
export { TABS_DEFAULT_MESSAGES, TabCloseEvent, TabComponent, TabContentTemplateDirective, TabSelectEvent, TabTitleTemplateDirective, TabsComponent };
|
|
894
|
-
|
|
1445
|
+
|
|
1446
|
+
//# sourceMappingURL=nanahoshi-mona-ui-tabs.mjs.map
|