@nanahoshi/mona-ui 0.27.2 → 0.29.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/locales.md +8 -0
- 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 +2071 -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-pl-pl.mjs +599 -0
- 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 +61 -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 +7 -3
- package/locales/pl-pl/package.json +4 -0
- package/locales/pl-pl/pl-pl.messages.json +536 -0
- package/package.json +66 -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-pl-pl.d.ts +540 -0
- 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 +18 -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,396 +1,449 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { createElementControlId } from
|
|
4
|
-
|
|
5
|
-
/** @hidden Exported for Mona UI's other entry points; applications don't need it. */
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, Directive, ElementRef, InjectionToken, afterNextRender, booleanAttribute, computed, effect, forwardRef, inject, input, model, signal, untracked } from "@angular/core";
|
|
3
|
+
import { createElementControlId } from "@nanahoshi/mona-ui/internal";
|
|
6
4
|
const COLLAPSIBLE_CONFIG = new InjectionToken("COLLAPSIBLE_CONFIG");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
5
|
+
var CollapsibleDirective = class CollapsibleDirective {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.#contentIdFromContent = signal(null, ...ngDevMode ? [{ debugName: "#contentIdFromContent" }] : /* istanbul ignore next */ []);
|
|
8
|
+
this.#generatedContentId = createElementControlId();
|
|
9
|
+
this.state = computed(() => this.expanded() ? "open" : "closed", ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
10
|
+
this.animate = input(true, {
|
|
11
|
+
...ngDevMode ? { debugName: "animate" } : /* istanbul ignore next */ {},
|
|
12
|
+
transform: booleanAttribute
|
|
13
|
+
});
|
|
14
|
+
this.disabled = input(false, {
|
|
15
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
16
|
+
transform: booleanAttribute
|
|
17
|
+
});
|
|
18
|
+
this.expanded = model(false, ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
19
|
+
}
|
|
20
|
+
#contentIdFromContent;
|
|
21
|
+
#generatedContentId;
|
|
22
|
+
get contentId() {
|
|
23
|
+
return this.#contentIdFromContent() ?? this.#generatedContentId;
|
|
24
|
+
}
|
|
25
|
+
collapse() {
|
|
26
|
+
this.expanded.set(false);
|
|
27
|
+
}
|
|
28
|
+
expand() {
|
|
29
|
+
this.expanded.set(true);
|
|
30
|
+
}
|
|
31
|
+
setContentId(id) {
|
|
32
|
+
this.#contentIdFromContent.set(id);
|
|
33
|
+
}
|
|
34
|
+
toggle() {
|
|
35
|
+
if (this.disabled()) return;
|
|
36
|
+
this.expanded.update((expanded) => !expanded);
|
|
37
|
+
}
|
|
38
|
+
static {
|
|
39
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "22.2.6",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: CollapsibleDirective,
|
|
44
|
+
deps: [],
|
|
45
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
static {
|
|
49
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
50
|
+
minVersion: "17.1.0",
|
|
51
|
+
version: "22.2.6",
|
|
52
|
+
type: CollapsibleDirective,
|
|
53
|
+
isStandalone: true,
|
|
54
|
+
selector: "[monaCollapsible]",
|
|
55
|
+
inputs: {
|
|
56
|
+
animate: {
|
|
57
|
+
classPropertyName: "animate",
|
|
58
|
+
publicName: "animate",
|
|
59
|
+
isSignal: true,
|
|
60
|
+
isRequired: false,
|
|
61
|
+
transformFunction: null
|
|
62
|
+
},
|
|
63
|
+
disabled: {
|
|
64
|
+
classPropertyName: "disabled",
|
|
65
|
+
publicName: "disabled",
|
|
66
|
+
isSignal: true,
|
|
67
|
+
isRequired: false,
|
|
68
|
+
transformFunction: null
|
|
69
|
+
},
|
|
70
|
+
expanded: {
|
|
71
|
+
classPropertyName: "expanded",
|
|
72
|
+
publicName: "expanded",
|
|
73
|
+
isSignal: true,
|
|
74
|
+
isRequired: false,
|
|
75
|
+
transformFunction: null
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
outputs: { expanded: "expandedChange" },
|
|
79
|
+
host: { properties: { "attr.data-state": "state()" } },
|
|
80
|
+
providers: [{
|
|
81
|
+
provide: COLLAPSIBLE_CONFIG,
|
|
82
|
+
useExisting: forwardRef(() => CollapsibleDirective)
|
|
83
|
+
}],
|
|
84
|
+
exportAs: ["monaCollapsible"],
|
|
85
|
+
ngImport: i0
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
90
|
+
minVersion: "12.0.0",
|
|
91
|
+
version: "22.2.6",
|
|
92
|
+
ngImport: i0,
|
|
93
|
+
type: CollapsibleDirective,
|
|
94
|
+
decorators: [{
|
|
95
|
+
type: Directive,
|
|
96
|
+
args: [{
|
|
97
|
+
selector: "[monaCollapsible]",
|
|
98
|
+
exportAs: "monaCollapsible",
|
|
99
|
+
host: { "[attr.data-state]": "state()" },
|
|
100
|
+
providers: [{
|
|
101
|
+
provide: COLLAPSIBLE_CONFIG,
|
|
102
|
+
useExisting: forwardRef(() => CollapsibleDirective)
|
|
103
|
+
}]
|
|
104
|
+
}]
|
|
105
|
+
}],
|
|
106
|
+
propDecorators: {
|
|
107
|
+
animate: [{
|
|
108
|
+
type: i0.Input,
|
|
109
|
+
args: [{
|
|
110
|
+
isSignal: true,
|
|
111
|
+
alias: "animate",
|
|
112
|
+
required: false
|
|
113
|
+
}]
|
|
114
|
+
}],
|
|
115
|
+
disabled: [{
|
|
116
|
+
type: i0.Input,
|
|
117
|
+
args: [{
|
|
118
|
+
isSignal: true,
|
|
119
|
+
alias: "disabled",
|
|
120
|
+
required: false
|
|
121
|
+
}]
|
|
122
|
+
}],
|
|
123
|
+
expanded: [{
|
|
124
|
+
type: i0.Input,
|
|
125
|
+
args: [{
|
|
126
|
+
isSignal: true,
|
|
127
|
+
alias: "expanded",
|
|
128
|
+
required: false
|
|
129
|
+
}]
|
|
130
|
+
}, {
|
|
131
|
+
type: i0.Output,
|
|
132
|
+
args: ["expandedChange"]
|
|
133
|
+
}]
|
|
134
|
+
}
|
|
135
|
+
});
|
|
83
136
|
const CONTENT_HEIGHT_VARIABLE = "--mona-collapsible-content-height";
|
|
84
|
-
/** A box can't get below its padding and border, so a height of 0 needs these at 0 as well. */
|
|
85
137
|
const BOX_PROPERTIES = [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
138
|
+
"padding-block-start",
|
|
139
|
+
"padding-block-end",
|
|
140
|
+
"border-block-start-width",
|
|
141
|
+
"border-block-end-width"
|
|
90
142
|
];
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
selector: "[monaCollapsibleContent]",
|
|
286
|
-
host: {
|
|
287
|
-
"[attr.data-state]": "state()",
|
|
288
|
-
"[attr.id]": "collapsible.contentId",
|
|
289
|
-
"[attr.inert]": "inert()"
|
|
290
|
-
}
|
|
291
|
-
}]
|
|
292
|
-
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
293
|
-
|
|
294
|
-
/** What inside a trigger keeps its own clicks and keys. */
|
|
143
|
+
var CollapsibleContentDirective = class CollapsibleContentDirective {
|
|
144
|
+
#element;
|
|
145
|
+
#initialized;
|
|
146
|
+
#reducedMotion;
|
|
147
|
+
#fallbackId;
|
|
148
|
+
constructor() {
|
|
149
|
+
this.#element = inject(ElementRef).nativeElement;
|
|
150
|
+
this.#initialized = signal(false, ...ngDevMode ? [{ debugName: "#initialized" }] : /* istanbul ignore next */ []);
|
|
151
|
+
this.#reducedMotion = signal(false, ...ngDevMode ? [{ debugName: "#reducedMotion" }] : /* istanbul ignore next */ []);
|
|
152
|
+
this.#fallbackId = null;
|
|
153
|
+
this.collapsible = inject(COLLAPSIBLE_CONFIG);
|
|
154
|
+
this.inert = computed(() => this.collapsible.expanded() ? null : true, ...ngDevMode ? [{ debugName: "inert" }] : /* istanbul ignore next */ []);
|
|
155
|
+
this.state = computed(() => this.collapsible.expanded() ? "open" : "closed", ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
156
|
+
this.id = input(null, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
157
|
+
const destroyRef = inject(DestroyRef);
|
|
158
|
+
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
|
159
|
+
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
160
|
+
const onPreferenceChange = (event) => this.#reducedMotion.set(event.matches);
|
|
161
|
+
this.#reducedMotion.set(query.matches);
|
|
162
|
+
query.addEventListener("change", onPreferenceChange);
|
|
163
|
+
destroyRef.onDestroy(() => query.removeEventListener("change", onPreferenceChange));
|
|
164
|
+
}
|
|
165
|
+
const onTransitionEnd = (event) => {
|
|
166
|
+
if (event.propertyName !== "height" || event.target !== this.#element) return;
|
|
167
|
+
this.#settle();
|
|
168
|
+
};
|
|
169
|
+
this.#element.addEventListener("transitionend", onTransitionEnd);
|
|
170
|
+
destroyRef.onDestroy(() => {
|
|
171
|
+
this.#element.removeEventListener("transitionend", onTransitionEnd);
|
|
172
|
+
this.#clearFallback();
|
|
173
|
+
});
|
|
174
|
+
afterNextRender(() => {
|
|
175
|
+
this.#settle();
|
|
176
|
+
this.#initialized.set(true);
|
|
177
|
+
});
|
|
178
|
+
effect(() => {
|
|
179
|
+
const expanded = this.collapsible.expanded();
|
|
180
|
+
untracked(() => {
|
|
181
|
+
if (!this.#initialized()) {
|
|
182
|
+
this.#settle();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.#animateTo(expanded);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
effect(() => {
|
|
189
|
+
const id = this.id();
|
|
190
|
+
untracked(() => this.collapsible.setContentId?.(id));
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
#animateTo(expanded) {
|
|
194
|
+
this.#clearFallback();
|
|
195
|
+
if (!this.collapsible.animate() || this.#reducedMotion()) {
|
|
196
|
+
this.#settle();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const element = this.#element;
|
|
200
|
+
const computed = getComputedStyle(element);
|
|
201
|
+
const startHeight = element.offsetHeight;
|
|
202
|
+
const startBox = BOX_PROPERTIES.map((property) => computed.getPropertyValue(property));
|
|
203
|
+
this.#setTransitionEnabled(false);
|
|
204
|
+
const contentHeight = this.#measure();
|
|
205
|
+
element.style.setProperty(CONTENT_HEIGHT_VARIABLE, `${contentHeight}px`);
|
|
206
|
+
this.#clip();
|
|
207
|
+
element.style.height = `${startHeight}px`;
|
|
208
|
+
BOX_PROPERTIES.forEach((property, index) => element.style.setProperty(property, startBox[index]));
|
|
209
|
+
element.offsetHeight;
|
|
210
|
+
this.#setTransitionEnabled(true);
|
|
211
|
+
this.#rest(expanded);
|
|
212
|
+
if (expanded) element.style.height = `${contentHeight}px`;
|
|
213
|
+
this.#scheduleFallback();
|
|
214
|
+
}
|
|
215
|
+
#clearFallback() {
|
|
216
|
+
if (this.#fallbackId !== null) {
|
|
217
|
+
clearTimeout(this.#fallbackId);
|
|
218
|
+
this.#fallbackId = null;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
#clip() {
|
|
222
|
+
this.#element.style.overflow = "hidden";
|
|
223
|
+
this.#element.style.minHeight = "0px";
|
|
224
|
+
}
|
|
225
|
+
#getTransitionDuration() {
|
|
226
|
+
const durations = getComputedStyle(this.#element).transitionDuration.split(",").map((part) => {
|
|
227
|
+
const match = /^([\d.]+)(ms|s)$/.exec(part.trim());
|
|
228
|
+
if (!match) return 0;
|
|
229
|
+
return match[2] === "ms" ? Number(match[1]) : Number(match[1]) * 1e3;
|
|
230
|
+
});
|
|
231
|
+
return Math.max(0, ...durations);
|
|
232
|
+
}
|
|
233
|
+
#measure() {
|
|
234
|
+
for (const property of BOX_PROPERTIES) this.#element.style.removeProperty(property);
|
|
235
|
+
if (typeof getComputedStyle !== "function") return 0;
|
|
236
|
+
const computed = getComputedStyle(this.#element);
|
|
237
|
+
const border = BOX_PROPERTIES.slice(2).map((property) => parseFloat(computed.getPropertyValue(property)) || 0);
|
|
238
|
+
return this.#element.scrollHeight + border[0] + border[1] || 0;
|
|
239
|
+
}
|
|
240
|
+
#rest(expanded) {
|
|
241
|
+
const { style } = this.#element;
|
|
242
|
+
style.height = expanded ? "" : "0px";
|
|
243
|
+
for (const property of BOX_PROPERTIES) if (expanded) style.removeProperty(property);
|
|
244
|
+
else style.setProperty(property, "0px");
|
|
245
|
+
}
|
|
246
|
+
#scheduleFallback() {
|
|
247
|
+
this.#fallbackId = setTimeout(() => this.#settle(), this.#getTransitionDuration() + 50);
|
|
248
|
+
}
|
|
249
|
+
#setTransitionEnabled(enabled) {
|
|
250
|
+
const style = this.#element.style;
|
|
251
|
+
if (!enabled) {
|
|
252
|
+
style.transitionProperty = "none";
|
|
253
|
+
this.#element.offsetHeight;
|
|
254
|
+
style.transitionProperty = "";
|
|
255
|
+
style.transitionDuration = "";
|
|
256
|
+
style.transitionTimingFunction = "";
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
style.transitionProperty = ["height", ...BOX_PROPERTIES].join(", ");
|
|
260
|
+
style.transitionDuration = `var(--mona-motion-standard, 300ms)`;
|
|
261
|
+
style.transitionTimingFunction = "ease-out";
|
|
262
|
+
}
|
|
263
|
+
#settle() {
|
|
264
|
+
this.#clearFallback();
|
|
265
|
+
this.#setTransitionEnabled(false);
|
|
266
|
+
const element = this.#element;
|
|
267
|
+
const contentHeight = this.#measure();
|
|
268
|
+
if (this.collapsible.expanded()) {
|
|
269
|
+
this.#rest(true);
|
|
270
|
+
element.style.overflow = "";
|
|
271
|
+
element.style.minHeight = "";
|
|
272
|
+
} else {
|
|
273
|
+
this.#rest(false);
|
|
274
|
+
this.#clip();
|
|
275
|
+
}
|
|
276
|
+
element.style.setProperty(CONTENT_HEIGHT_VARIABLE, `${contentHeight}px`);
|
|
277
|
+
}
|
|
278
|
+
static {
|
|
279
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
280
|
+
minVersion: "12.0.0",
|
|
281
|
+
version: "22.2.6",
|
|
282
|
+
ngImport: i0,
|
|
283
|
+
type: CollapsibleContentDirective,
|
|
284
|
+
deps: [],
|
|
285
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
static {
|
|
289
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
290
|
+
minVersion: "17.1.0",
|
|
291
|
+
version: "22.2.6",
|
|
292
|
+
type: CollapsibleContentDirective,
|
|
293
|
+
isStandalone: true,
|
|
294
|
+
selector: "[monaCollapsibleContent]",
|
|
295
|
+
inputs: { id: {
|
|
296
|
+
classPropertyName: "id",
|
|
297
|
+
publicName: "id",
|
|
298
|
+
isSignal: true,
|
|
299
|
+
isRequired: false,
|
|
300
|
+
transformFunction: null
|
|
301
|
+
} },
|
|
302
|
+
host: { properties: {
|
|
303
|
+
"attr.data-state": "state()",
|
|
304
|
+
"attr.id": "collapsible.contentId",
|
|
305
|
+
"attr.inert": "inert()"
|
|
306
|
+
} },
|
|
307
|
+
ngImport: i0
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
312
|
+
minVersion: "12.0.0",
|
|
313
|
+
version: "22.2.6",
|
|
314
|
+
ngImport: i0,
|
|
315
|
+
type: CollapsibleContentDirective,
|
|
316
|
+
decorators: [{
|
|
317
|
+
type: Directive,
|
|
318
|
+
args: [{
|
|
319
|
+
selector: "[monaCollapsibleContent]",
|
|
320
|
+
host: {
|
|
321
|
+
"[attr.data-state]": "state()",
|
|
322
|
+
"[attr.id]": "collapsible.contentId",
|
|
323
|
+
"[attr.inert]": "inert()"
|
|
324
|
+
}
|
|
325
|
+
}]
|
|
326
|
+
}],
|
|
327
|
+
ctorParameters: () => [],
|
|
328
|
+
propDecorators: { id: [{
|
|
329
|
+
type: i0.Input,
|
|
330
|
+
args: [{
|
|
331
|
+
isSignal: true,
|
|
332
|
+
alias: "id",
|
|
333
|
+
required: false
|
|
334
|
+
}]
|
|
335
|
+
}] }
|
|
336
|
+
});
|
|
295
337
|
const NESTED_CONTROL_SELECTOR = "a[href], button, input, select, summary, textarea, [contenteditable], [tabindex]";
|
|
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
|
-
|
|
338
|
+
var CollapsibleTriggerDirective = class CollapsibleTriggerDirective {
|
|
339
|
+
constructor() {
|
|
340
|
+
this.#element = inject(ElementRef).nativeElement;
|
|
341
|
+
this.#nativeAnchor = this.#element.tagName === "A";
|
|
342
|
+
this.#nativeButton = this.#element.tagName === "BUTTON" || this.#element.tagName === "INPUT" || this.#element.tagName === "SUMMARY";
|
|
343
|
+
this.#nativeDisableable = this.#element.tagName === "BUTTON" || this.#element.tagName === "INPUT";
|
|
344
|
+
this.#nativeSummary = this.#element.tagName === "SUMMARY";
|
|
345
|
+
this.ariaDisabled = computed(() => this.collapsible.disabled() ? "true" : null, ...ngDevMode ? [{ debugName: "ariaDisabled" }] : /* istanbul ignore next */ []);
|
|
346
|
+
this.collapsible = inject(COLLAPSIBLE_CONFIG);
|
|
347
|
+
this.nativeDisabled = computed(() => this.#nativeDisableable && this.collapsible.disabled() ? "" : null, ...ngDevMode ? [{ debugName: "nativeDisabled" }] : /* istanbul ignore next */ []);
|
|
348
|
+
this.role = this.#nativeButton || this.#nativeAnchor ? null : "button";
|
|
349
|
+
this.state = computed(() => this.collapsible.expanded() ? "open" : "closed", ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
350
|
+
this.tabIndex = computed(() => {
|
|
351
|
+
if (this.#nativeButton) return null;
|
|
352
|
+
if (this.collapsible.disabled()) return -1;
|
|
353
|
+
return this.#nativeAnchor ? null : 0;
|
|
354
|
+
}, ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
355
|
+
this.type = this.#element.tagName === "BUTTON" ? "button" : null;
|
|
356
|
+
}
|
|
357
|
+
#element;
|
|
358
|
+
#nativeAnchor;
|
|
359
|
+
#nativeButton;
|
|
360
|
+
#nativeDisableable;
|
|
361
|
+
#nativeSummary;
|
|
362
|
+
onClick(event) {
|
|
363
|
+
if (this.#isFromNestedControl(event)) return;
|
|
364
|
+
if ((this.#nativeAnchor || this.#nativeSummary) && this.collapsible.disabled()) {
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
this.collapsible.toggle();
|
|
369
|
+
}
|
|
370
|
+
onEnterKeydown(event) {
|
|
371
|
+
if (this.#nativeButton || this.#nativeAnchor || this.#isFromNestedControl(event)) return;
|
|
372
|
+
event.preventDefault();
|
|
373
|
+
this.collapsible.toggle();
|
|
374
|
+
}
|
|
375
|
+
onSpaceKeydown(event) {
|
|
376
|
+
if (this.#nativeButton || this.#isFromNestedControl(event)) return;
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
this.collapsible.toggle();
|
|
379
|
+
}
|
|
380
|
+
#isFromNestedControl(event) {
|
|
381
|
+
const control = event.target.closest(NESTED_CONTROL_SELECTOR);
|
|
382
|
+
return control !== null && control !== this.#element && this.#element.contains(control);
|
|
383
|
+
}
|
|
384
|
+
static {
|
|
385
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
386
|
+
minVersion: "12.0.0",
|
|
387
|
+
version: "22.2.6",
|
|
388
|
+
ngImport: i0,
|
|
389
|
+
type: CollapsibleTriggerDirective,
|
|
390
|
+
deps: [],
|
|
391
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
static {
|
|
395
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
396
|
+
minVersion: "14.0.0",
|
|
397
|
+
version: "22.2.6",
|
|
398
|
+
type: CollapsibleTriggerDirective,
|
|
399
|
+
isStandalone: true,
|
|
400
|
+
selector: "[monaCollapsibleTrigger]",
|
|
401
|
+
host: {
|
|
402
|
+
listeners: {
|
|
403
|
+
"click": "onClick($event)",
|
|
404
|
+
"keydown.enter": "onEnterKeydown($event)",
|
|
405
|
+
"keydown.space": "onSpaceKeydown($event)"
|
|
406
|
+
},
|
|
407
|
+
properties: {
|
|
408
|
+
"attr.aria-controls": "collapsible.contentId",
|
|
409
|
+
"attr.aria-disabled": "ariaDisabled()",
|
|
410
|
+
"attr.aria-expanded": "collapsible.expanded()",
|
|
411
|
+
"attr.data-state": "state()",
|
|
412
|
+
"attr.disabled": "nativeDisabled()",
|
|
413
|
+
"attr.role": "role",
|
|
414
|
+
"attr.tabindex": "tabIndex()",
|
|
415
|
+
"attr.type": "type"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
ngImport: i0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
423
|
+
minVersion: "12.0.0",
|
|
424
|
+
version: "22.2.6",
|
|
425
|
+
ngImport: i0,
|
|
426
|
+
type: CollapsibleTriggerDirective,
|
|
427
|
+
decorators: [{
|
|
428
|
+
type: Directive,
|
|
429
|
+
args: [{
|
|
430
|
+
selector: "[monaCollapsibleTrigger]",
|
|
431
|
+
host: {
|
|
432
|
+
"[attr.aria-controls]": "collapsible.contentId",
|
|
433
|
+
"[attr.aria-disabled]": "ariaDisabled()",
|
|
434
|
+
"[attr.aria-expanded]": "collapsible.expanded()",
|
|
435
|
+
"[attr.data-state]": "state()",
|
|
436
|
+
"[attr.disabled]": "nativeDisabled()",
|
|
437
|
+
"[attr.role]": "role",
|
|
438
|
+
"[attr.tabindex]": "tabIndex()",
|
|
439
|
+
"[attr.type]": "type",
|
|
440
|
+
"(click)": "onClick($event)",
|
|
441
|
+
"(keydown.enter)": "onEnterKeydown($event)",
|
|
442
|
+
"(keydown.space)": "onSpaceKeydown($event)"
|
|
443
|
+
}
|
|
444
|
+
}]
|
|
445
|
+
}]
|
|
446
|
+
});
|
|
395
447
|
export { COLLAPSIBLE_CONFIG, CollapsibleContentDirective, CollapsibleDirective, CollapsibleTriggerDirective };
|
|
396
|
-
|
|
448
|
+
|
|
449
|
+
//# sourceMappingURL=nanahoshi-mona-ui-collapsible.mjs.map
|