@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,1481 +1,1683 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { takeUntilDestroyed } from
|
|
4
|
-
import {
|
|
5
|
-
import { PreventableEvent } from
|
|
6
|
-
import { Directionality } from
|
|
7
|
-
import { Overlay, OverlayConfig } from
|
|
8
|
-
import { ComponentPortal } from
|
|
9
|
-
import { ScrollDispatcher } from
|
|
10
|
-
import { MonaI18nService,
|
|
11
|
-
import { focusCanReturn } from
|
|
12
|
-
import { NgTemplateOutlet } from
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return this.#options?.via;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DOCUMENT, DestroyRef, ElementRef, Injectable, InjectionToken, Injector, TemplateRef, ViewContainerRef, booleanAttribute, computed, effect, inject, input, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
4
|
+
import { ReplaySubject, Subject, Subscription, asapScheduler, asyncScheduler, fromEvent, merge, take, takeUntil } from "rxjs";
|
|
5
|
+
import { PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
6
|
+
import { Directionality } from "@angular/cdk/bidi";
|
|
7
|
+
import { Overlay, OverlayConfig } from "@angular/cdk/overlay";
|
|
8
|
+
import { ComponentPortal } from "@angular/cdk/portal";
|
|
9
|
+
import { ScrollDispatcher } from "@angular/cdk/scrolling";
|
|
10
|
+
import { MonaI18nService, observeComponentDirection, resolveComponentDirection } from "@nanahoshi/mona-ui/i18n";
|
|
11
|
+
import { createPageScrollBlockStrategy, focusCanReturn } from "@nanahoshi/mona-ui/internal";
|
|
12
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
13
|
+
var PopupCloseEvent = class extends PreventableEvent {
|
|
14
|
+
#options;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
super(options?.type ?? "popupClose", options?.originalEvent);
|
|
17
|
+
this.#options = options;
|
|
18
|
+
}
|
|
19
|
+
get result() {
|
|
20
|
+
return this.#options?.result;
|
|
21
|
+
}
|
|
22
|
+
get via() {
|
|
23
|
+
return this.#options?.via;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
29
26
|
var PopupCloseSource;
|
|
30
|
-
(function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/** The pointer leaving the anchor, when `closeOnMouseLeave` is set. */
|
|
40
|
-
PopupCloseSource["MouseLeave"] = "mouseLeave";
|
|
41
|
-
/** A `close()` call from code, with no user interaction behind it. */
|
|
42
|
-
PopupCloseSource["Programmatic"] = "programmatic";
|
|
43
|
-
/** A pointer press outside the popup and its anchor. */
|
|
44
|
-
PopupCloseSource["OutsideClick"] = "outsideClick";
|
|
45
|
-
/** The anchor scrolling away, when `closeOnScroll` is set. */
|
|
46
|
-
PopupCloseSource["Scroll"] = "scroll";
|
|
27
|
+
(function(PopupCloseSource) {
|
|
28
|
+
PopupCloseSource["Action"] = "action";
|
|
29
|
+
PopupCloseSource["BackdropClick"] = "backdropClick";
|
|
30
|
+
PopupCloseSource["CloseButton"] = "closeButton";
|
|
31
|
+
PopupCloseSource["Escape"] = "escape";
|
|
32
|
+
PopupCloseSource["MouseLeave"] = "mouseLeave";
|
|
33
|
+
PopupCloseSource["Programmatic"] = "programmatic";
|
|
34
|
+
PopupCloseSource["OutsideClick"] = "outsideClick";
|
|
35
|
+
PopupCloseSource["Scroll"] = "scroll";
|
|
47
36
|
})(PopupCloseSource || (PopupCloseSource = {}));
|
|
48
|
-
|
|
49
37
|
const defaultPopupAnimation = {
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
enter: "mona-popup-enter",
|
|
39
|
+
leave: "mona-popup-leave"
|
|
52
40
|
};
|
|
53
41
|
const dropdownPopupAnimation = {
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
enter: "mona-dropdown-popup-enter",
|
|
43
|
+
leave: "mona-dropdown-popup-leave"
|
|
56
44
|
};
|
|
57
45
|
const fadePopupAnimation = {
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
enter: "mona-popup-fade-enter",
|
|
47
|
+
leave: "mona-popup-fade-leave"
|
|
60
48
|
};
|
|
61
49
|
const slideFromRightPopupAnimation = {
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
enter: "mona-popup-slide-from-right-enter",
|
|
51
|
+
leave: "mona-popup-slide-to-right-leave"
|
|
64
52
|
};
|
|
65
53
|
const slideFromLeftPopupAnimation = {
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
enter: "mona-popup-slide-from-left-enter",
|
|
55
|
+
leave: "mona-popup-slide-to-left-leave"
|
|
68
56
|
};
|
|
69
57
|
const slideFromTopPopupAnimation = {
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
enter: "mona-popup-slide-from-top-enter",
|
|
59
|
+
leave: "mona-popup-slide-to-top-leave"
|
|
72
60
|
};
|
|
73
61
|
const slideFromBottomPopupAnimation = {
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
enter: "mona-popup-slide-from-bottom-enter",
|
|
63
|
+
leave: "mona-popup-slide-to-bottom-leave"
|
|
76
64
|
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The `data` passed in `PopupSettings`, available to the popup content.
|
|
80
|
-
*/
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- public API name, kept for compatibility.
|
|
82
65
|
const PopupDataInjectionToken = new InjectionToken("PopupDataInjectionToken");
|
|
83
66
|
const POPUP_SETTINGS = new InjectionToken("POPUP_SETTINGS");
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @internal - used by the popup service. Do not use directly or export.
|
|
87
|
-
*/
|
|
88
67
|
const POPUP_REFERENCE = new InjectionToken("POPUP_REFERENCE");
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
else if (this.wrapperComponentRef == null) {
|
|
382
|
-
this.completeClose(beforeCloseEvent);
|
|
383
|
-
}
|
|
384
|
-
return true;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Finishes a close that bypassed {@link close}: the overlay was detached or disposed directly. Nothing can
|
|
388
|
-
* prevent it any more, so `beforeClose` is skipped; `closeStart` and `closed` still fire, in that order.
|
|
389
|
-
*/
|
|
390
|
-
closeDetached() {
|
|
391
|
-
if (this.#closed) {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const event = new PopupCloseEvent({ via: PopupCloseSource.Programmatic });
|
|
395
|
-
if (!this.#closing) {
|
|
396
|
-
this.#closing = true;
|
|
397
|
-
this.closeStart$.next(event);
|
|
398
|
-
}
|
|
399
|
-
this.completeClose(event);
|
|
400
|
-
}
|
|
401
|
-
completeClose(event) {
|
|
402
|
-
if (this.#closed) {
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
this.#closed = true;
|
|
406
|
-
this.closed$.next(event);
|
|
407
|
-
this.closed$.complete();
|
|
408
|
-
this.positionChanges$.complete();
|
|
409
|
-
this.overlayRef.dispose();
|
|
410
|
-
}
|
|
411
|
-
notifyOpen() {
|
|
412
|
-
this.opened$.next();
|
|
413
|
-
}
|
|
414
|
-
get beforeClose$() {
|
|
415
|
-
return this.beforeClosed$.asObservable();
|
|
416
|
-
}
|
|
417
|
-
get closeStart() {
|
|
418
|
-
return this.closeStart$.asObservable();
|
|
419
|
-
}
|
|
420
|
-
get closed() {
|
|
421
|
-
return this.closed$.asObservable();
|
|
422
|
-
}
|
|
423
|
-
get component() {
|
|
424
|
-
return this.componentRef ?? null;
|
|
425
|
-
}
|
|
426
|
-
get opened() {
|
|
427
|
-
return this.opened$;
|
|
428
|
-
}
|
|
429
|
-
get overlayRef() {
|
|
430
|
-
return this.overlayReference;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
68
|
+
var PopupWrapperComponent = class PopupWrapperComponent {
|
|
69
|
+
#destroyRef;
|
|
70
|
+
#document;
|
|
71
|
+
#popupReference;
|
|
72
|
+
#popupSettings;
|
|
73
|
+
#closeEvent;
|
|
74
|
+
#fallbackTimer;
|
|
75
|
+
#leaveCompleted;
|
|
76
|
+
constructor() {
|
|
77
|
+
this.#destroyRef = inject(DestroyRef);
|
|
78
|
+
this.#document = inject(DOCUMENT);
|
|
79
|
+
this.#popupReference = inject(POPUP_REFERENCE);
|
|
80
|
+
this.#popupSettings = inject(POPUP_SETTINGS);
|
|
81
|
+
this.#closeEvent = null;
|
|
82
|
+
this.#fallbackTimer = null;
|
|
83
|
+
this.#leaveCompleted = false;
|
|
84
|
+
this.animationElement = viewChild.required("animationElement", ...ngDevMode ? [{ debugName: "animationElement" }] : /* istanbul ignore next */ []);
|
|
85
|
+
this.componentOutlet = viewChild.required("componentOutlet", {
|
|
86
|
+
...ngDevMode ? { debugName: "componentOutlet" } : /* istanbul ignore next */ {},
|
|
87
|
+
read: ViewContainerRef
|
|
88
|
+
});
|
|
89
|
+
this.enterAnimationClasses = computed(() => this.#getAnimationConfig()?.enter ?? "", ...ngDevMode ? [{ debugName: "enterAnimationClasses" }] : /* istanbul ignore next */ []);
|
|
90
|
+
this.hostClasses = computed(() => {
|
|
91
|
+
return [
|
|
92
|
+
"mona-popup-wrapper",
|
|
93
|
+
"w-full",
|
|
94
|
+
"h-full",
|
|
95
|
+
this.wrapperClass()
|
|
96
|
+
].filter(Boolean).join(" ");
|
|
97
|
+
}, ...ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []);
|
|
98
|
+
this.leaveAnimationClasses = computed(() => this.#getAnimationConfig()?.leave ?? "", ...ngDevMode ? [{ debugName: "leaveAnimationClasses" }] : /* istanbul ignore next */ []);
|
|
99
|
+
this.templateRef = signal(null, ...ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []);
|
|
100
|
+
this.visible = signal(true, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
101
|
+
this.wrapperClass = signal(this.#popupSettings.popupWrapperClass instanceof Array ? this.#popupSettings.popupWrapperClass.join(" ") : this.#popupSettings.popupWrapperClass ?? "", ...ngDevMode ? [{ debugName: "wrapperClass" }] : /* istanbul ignore next */ []);
|
|
102
|
+
this.#popupReference.closeStart$.pipe(take(1), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
103
|
+
this.#closeEvent = event;
|
|
104
|
+
const animationElement = this.animationElement().nativeElement;
|
|
105
|
+
this.visible.set(false);
|
|
106
|
+
if (!this.leaveAnimationClasses()) {
|
|
107
|
+
this.#completeClose();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
this.#document.defaultView?.setTimeout(() => this.#startFallbackTimer(animationElement));
|
|
111
|
+
});
|
|
112
|
+
this.#destroyRef.onDestroy(() => this.#clearFallbackTimer());
|
|
113
|
+
}
|
|
114
|
+
attachContent(content, injector) {
|
|
115
|
+
if (content instanceof TemplateRef) {
|
|
116
|
+
this.templateRef.set(content);
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return this.componentOutlet().createComponent(content, { injector });
|
|
120
|
+
}
|
|
121
|
+
onNativeLeaveComplete(event) {
|
|
122
|
+
if (event.target !== event.currentTarget) return;
|
|
123
|
+
this.#completeClose();
|
|
124
|
+
}
|
|
125
|
+
#getAnimationConfig() {
|
|
126
|
+
const config = this.#popupSettings.animation;
|
|
127
|
+
if (config === false) return null;
|
|
128
|
+
if (config == null || config === true) return defaultPopupAnimation;
|
|
129
|
+
return {
|
|
130
|
+
enter: config.enter ?? defaultPopupAnimation.enter,
|
|
131
|
+
leave: config.leave ?? defaultPopupAnimation.leave
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
#clearFallbackTimer() {
|
|
135
|
+
if (this.#fallbackTimer == null) return;
|
|
136
|
+
this.#document.defaultView?.clearTimeout(this.#fallbackTimer);
|
|
137
|
+
this.#fallbackTimer = null;
|
|
138
|
+
}
|
|
139
|
+
#completeClose() {
|
|
140
|
+
if (this.#leaveCompleted || this.#closeEvent == null) return;
|
|
141
|
+
this.#leaveCompleted = true;
|
|
142
|
+
this.#clearFallbackTimer();
|
|
143
|
+
this.#popupReference.completeClose(this.#closeEvent);
|
|
144
|
+
}
|
|
145
|
+
#getLongestCssTime(style) {
|
|
146
|
+
return Math.max(this.#getLongestCssTimeFromProperties(style.animationDuration, style.animationDelay), this.#getLongestCssTimeFromProperties(style.transitionDuration, style.transitionDelay));
|
|
147
|
+
}
|
|
148
|
+
#getLongestCssTimeFromProperties(durations, delays) {
|
|
149
|
+
const durationValues = durations.split(",").map((duration) => this.#parseCssTime(duration));
|
|
150
|
+
const delayValues = delays.split(",").map((delay) => this.#parseCssTime(delay));
|
|
151
|
+
const valueCount = Math.max(durationValues.length, delayValues.length);
|
|
152
|
+
if (valueCount === 0) return 0;
|
|
153
|
+
return Math.max(...Array.from({ length: valueCount }, (_, index) => {
|
|
154
|
+
return (durationValues[index % durationValues.length] ?? 0) + (delayValues[index % delayValues.length] ?? 0);
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
#parseCssTime(value) {
|
|
158
|
+
const trimmedValue = value.trim();
|
|
159
|
+
if (!trimmedValue) return 0;
|
|
160
|
+
if (trimmedValue.endsWith("ms")) return Number.parseFloat(trimmedValue);
|
|
161
|
+
if (trimmedValue.endsWith("s")) return Number.parseFloat(trimmedValue) * 1e3;
|
|
162
|
+
return 0;
|
|
163
|
+
}
|
|
164
|
+
#startFallbackTimer(animationElement) {
|
|
165
|
+
if (this.#leaveCompleted) return;
|
|
166
|
+
const win = this.#document.defaultView;
|
|
167
|
+
if (!win) {
|
|
168
|
+
this.#completeClose();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const duration = this.#getLongestCssTime(win.getComputedStyle(animationElement));
|
|
172
|
+
if (duration <= 0) {
|
|
173
|
+
this.#completeClose();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.#fallbackTimer = win.setTimeout(() => this.#completeClose(), duration + 50);
|
|
177
|
+
}
|
|
178
|
+
static {
|
|
179
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
180
|
+
minVersion: "12.0.0",
|
|
181
|
+
version: "22.2.6",
|
|
182
|
+
ngImport: i0,
|
|
183
|
+
type: PopupWrapperComponent,
|
|
184
|
+
deps: [],
|
|
185
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
static {
|
|
189
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
190
|
+
minVersion: "17.0.0",
|
|
191
|
+
version: "22.2.6",
|
|
192
|
+
type: PopupWrapperComponent,
|
|
193
|
+
isStandalone: true,
|
|
194
|
+
selector: "mona-popup-wrapper",
|
|
195
|
+
host: { properties: { "class": "hostClasses()" } },
|
|
196
|
+
viewQueries: [{
|
|
197
|
+
propertyName: "animationElement",
|
|
198
|
+
first: true,
|
|
199
|
+
predicate: ["animationElement"],
|
|
200
|
+
descendants: true,
|
|
201
|
+
isSignal: true
|
|
202
|
+
}, {
|
|
203
|
+
propertyName: "componentOutlet",
|
|
204
|
+
first: true,
|
|
205
|
+
predicate: ["componentOutlet"],
|
|
206
|
+
descendants: true,
|
|
207
|
+
read: ViewContainerRef,
|
|
208
|
+
isSignal: true
|
|
209
|
+
}],
|
|
210
|
+
ngImport: i0,
|
|
211
|
+
template: "@if (visible()) {\n <div\n #animationElement\n class=\"w-full h-full origin-center\"\n [animate.enter]=\"enterAnimationClasses()\"\n [animate.leave]=\"leaveAnimationClasses()\"\n (animationend)=\"onNativeLeaveComplete($event)\"\n (transitionend)=\"onNativeLeaveComplete($event)\">\n @if (templateRef()) {\n <ng-container [ngTemplateOutlet]=\"templateRef()\"></ng-container>\n }\n <ng-container #componentOutlet></ng-container>\n </div>\n}\n",
|
|
212
|
+
styles: [":host{display:block}:host(.mona-popup-constrain-height){min-height:0;max-height:inherit;overflow:clip}:host(.mona-popup-constrain-height)>div{display:flex;min-height:0;max-height:inherit;overflow:clip}.mona-popup-enter{animation:mona-popup-scale-in .15s cubic-bezier(.4,0,.2,1)}.mona-popup-leave{animation:mona-popup-scale-out .15s cubic-bezier(.4,0,.2,1)}.mona-dropdown-popup-enter{animation:mona-dropdown-popup-scale-in .15s cubic-bezier(.4,0,.2,1);transform-origin:top center}.mona-dropdown-popup-leave{animation:mona-dropdown-popup-scale-out .15s cubic-bezier(.4,0,.2,1);transform-origin:top center}.mona-popup-fade-enter{animation:mona-popup-fade-in 50ms ease-in}.mona-popup-fade-leave{animation:mona-popup-fade-out .15s ease-out}.mona-popup-slide-from-right-enter,.mona-popup-slide-from-left-enter,.mona-popup-slide-from-top-enter,.mona-popup-slide-from-bottom-enter,.mona-popup-slide-to-right-leave,.mona-popup-slide-to-left-leave,.mona-popup-slide-to-top-leave,.mona-popup-slide-to-bottom-leave{animation-fill-mode:both;backface-visibility:hidden;will-change:transform}.mona-popup-slide-from-right-enter,.mona-popup-slide-from-left-enter,.mona-popup-slide-from-top-enter,.mona-popup-slide-from-bottom-enter{animation-duration:.32s;animation-timing-function:cubic-bezier(.25,.46,.45,.94)}.mona-popup-slide-to-right-leave,.mona-popup-slide-to-left-leave,.mona-popup-slide-to-top-leave,.mona-popup-slide-to-bottom-leave{animation-duration:.24s;animation-timing-function:cubic-bezier(.4,0,1,1)}.mona-popup-slide-from-right-enter{animation-name:mona-popup-slide-from-right}.mona-popup-slide-to-right-leave{animation-name:mona-popup-slide-to-right}.mona-popup-slide-from-left-enter{animation-name:mona-popup-slide-from-left}.mona-popup-slide-to-left-leave{animation-name:mona-popup-slide-to-left}.mona-popup-slide-from-top-enter{animation-name:mona-popup-slide-from-top}.mona-popup-slide-to-top-leave{animation-name:mona-popup-slide-to-top}.mona-popup-slide-from-bottom-enter{animation-name:mona-popup-slide-from-bottom}.mona-popup-slide-to-bottom-leave{animation-name:mona-popup-slide-to-bottom}@keyframes mona-popup-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes mona-popup-scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes mona-dropdown-popup-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes mona-dropdown-popup-scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes mona-popup-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-popup-fade-out{0%{opacity:1}to{opacity:0}}@keyframes mona-popup-slide-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes mona-popup-slide-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes mona-popup-slide-from-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes mona-popup-slide-to-left{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes mona-popup-slide-from-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes mona-popup-slide-to-top{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes mona-popup-slide-from-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes mona-popup-slide-to-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@media(prefers-reduced-motion:reduce){.mona-popup-enter,.mona-popup-leave,.mona-dropdown-popup-enter,.mona-dropdown-popup-leave,.mona-popup-fade-enter,.mona-popup-fade-leave,.mona-popup-slide-from-right-enter,.mona-popup-slide-to-right-leave,.mona-popup-slide-from-left-enter,.mona-popup-slide-to-left-leave,.mona-popup-slide-from-top-enter,.mona-popup-slide-to-top-leave,.mona-popup-slide-from-bottom-enter,.mona-popup-slide-to-bottom-leave{animation-duration:1ms}}\n"],
|
|
213
|
+
dependencies: [{
|
|
214
|
+
kind: "directive",
|
|
215
|
+
type: NgTemplateOutlet,
|
|
216
|
+
selector: "[ngTemplateOutlet]",
|
|
217
|
+
inputs: [
|
|
218
|
+
"ngTemplateOutletContext",
|
|
219
|
+
"ngTemplateOutlet",
|
|
220
|
+
"ngTemplateOutletInjector"
|
|
221
|
+
]
|
|
222
|
+
}]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
227
|
+
minVersion: "12.0.0",
|
|
228
|
+
version: "22.2.6",
|
|
229
|
+
ngImport: i0,
|
|
230
|
+
type: PopupWrapperComponent,
|
|
231
|
+
decorators: [{
|
|
232
|
+
type: Component,
|
|
233
|
+
args: [{
|
|
234
|
+
selector: "mona-popup-wrapper",
|
|
235
|
+
imports: [NgTemplateOutlet],
|
|
236
|
+
host: { "[class]": "hostClasses()" },
|
|
237
|
+
template: "@if (visible()) {\n <div\n #animationElement\n class=\"w-full h-full origin-center\"\n [animate.enter]=\"enterAnimationClasses()\"\n [animate.leave]=\"leaveAnimationClasses()\"\n (animationend)=\"onNativeLeaveComplete($event)\"\n (transitionend)=\"onNativeLeaveComplete($event)\">\n @if (templateRef()) {\n <ng-container [ngTemplateOutlet]=\"templateRef()\"></ng-container>\n }\n <ng-container #componentOutlet></ng-container>\n </div>\n}\n",
|
|
238
|
+
styles: [":host{display:block}:host(.mona-popup-constrain-height){min-height:0;max-height:inherit;overflow:clip}:host(.mona-popup-constrain-height)>div{display:flex;min-height:0;max-height:inherit;overflow:clip}.mona-popup-enter{animation:mona-popup-scale-in .15s cubic-bezier(.4,0,.2,1)}.mona-popup-leave{animation:mona-popup-scale-out .15s cubic-bezier(.4,0,.2,1)}.mona-dropdown-popup-enter{animation:mona-dropdown-popup-scale-in .15s cubic-bezier(.4,0,.2,1);transform-origin:top center}.mona-dropdown-popup-leave{animation:mona-dropdown-popup-scale-out .15s cubic-bezier(.4,0,.2,1);transform-origin:top center}.mona-popup-fade-enter{animation:mona-popup-fade-in 50ms ease-in}.mona-popup-fade-leave{animation:mona-popup-fade-out .15s ease-out}.mona-popup-slide-from-right-enter,.mona-popup-slide-from-left-enter,.mona-popup-slide-from-top-enter,.mona-popup-slide-from-bottom-enter,.mona-popup-slide-to-right-leave,.mona-popup-slide-to-left-leave,.mona-popup-slide-to-top-leave,.mona-popup-slide-to-bottom-leave{animation-fill-mode:both;backface-visibility:hidden;will-change:transform}.mona-popup-slide-from-right-enter,.mona-popup-slide-from-left-enter,.mona-popup-slide-from-top-enter,.mona-popup-slide-from-bottom-enter{animation-duration:.32s;animation-timing-function:cubic-bezier(.25,.46,.45,.94)}.mona-popup-slide-to-right-leave,.mona-popup-slide-to-left-leave,.mona-popup-slide-to-top-leave,.mona-popup-slide-to-bottom-leave{animation-duration:.24s;animation-timing-function:cubic-bezier(.4,0,1,1)}.mona-popup-slide-from-right-enter{animation-name:mona-popup-slide-from-right}.mona-popup-slide-to-right-leave{animation-name:mona-popup-slide-to-right}.mona-popup-slide-from-left-enter{animation-name:mona-popup-slide-from-left}.mona-popup-slide-to-left-leave{animation-name:mona-popup-slide-to-left}.mona-popup-slide-from-top-enter{animation-name:mona-popup-slide-from-top}.mona-popup-slide-to-top-leave{animation-name:mona-popup-slide-to-top}.mona-popup-slide-from-bottom-enter{animation-name:mona-popup-slide-from-bottom}.mona-popup-slide-to-bottom-leave{animation-name:mona-popup-slide-to-bottom}@keyframes mona-popup-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes mona-popup-scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes mona-dropdown-popup-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes mona-dropdown-popup-scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes mona-popup-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-popup-fade-out{0%{opacity:1}to{opacity:0}}@keyframes mona-popup-slide-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes mona-popup-slide-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes mona-popup-slide-from-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes mona-popup-slide-to-left{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes mona-popup-slide-from-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes mona-popup-slide-to-top{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes mona-popup-slide-from-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes mona-popup-slide-to-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@media(prefers-reduced-motion:reduce){.mona-popup-enter,.mona-popup-leave,.mona-dropdown-popup-enter,.mona-dropdown-popup-leave,.mona-popup-fade-enter,.mona-popup-fade-leave,.mona-popup-slide-from-right-enter,.mona-popup-slide-to-right-leave,.mona-popup-slide-from-left-enter,.mona-popup-slide-to-left-leave,.mona-popup-slide-from-top-enter,.mona-popup-slide-to-top-leave,.mona-popup-slide-from-bottom-enter,.mona-popup-slide-to-bottom-leave{animation-duration:1ms}}\n"]
|
|
239
|
+
}]
|
|
240
|
+
}],
|
|
241
|
+
ctorParameters: () => [],
|
|
242
|
+
propDecorators: {
|
|
243
|
+
animationElement: [{
|
|
244
|
+
type: i0.ViewChild,
|
|
245
|
+
args: ["animationElement", { isSignal: true }]
|
|
246
|
+
}],
|
|
247
|
+
componentOutlet: [{
|
|
248
|
+
type: i0.ViewChild,
|
|
249
|
+
args: ["componentOutlet", {
|
|
250
|
+
read: ViewContainerRef,
|
|
251
|
+
isSignal: true
|
|
252
|
+
}]
|
|
253
|
+
}]
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
var PopupRef = class {
|
|
257
|
+
#options;
|
|
258
|
+
constructor(options) {
|
|
259
|
+
this.#options = options;
|
|
260
|
+
}
|
|
261
|
+
close(result, delay) {
|
|
262
|
+
return this.#options.close(result, delay);
|
|
263
|
+
}
|
|
264
|
+
closeWithDelay(delay = 100, result) {
|
|
265
|
+
asapScheduler.schedule(() => this.close(result), delay);
|
|
266
|
+
}
|
|
267
|
+
get beforeClose() {
|
|
268
|
+
return this.#options.beforeClose$;
|
|
269
|
+
}
|
|
270
|
+
get closeStart() {
|
|
271
|
+
return this.#options.closeStart$;
|
|
272
|
+
}
|
|
273
|
+
get closed() {
|
|
274
|
+
return this.#options.closed$;
|
|
275
|
+
}
|
|
276
|
+
get component() {
|
|
277
|
+
return this.#options.component;
|
|
278
|
+
}
|
|
279
|
+
get opened() {
|
|
280
|
+
return this.#options.opened$;
|
|
281
|
+
}
|
|
282
|
+
get overlayRef() {
|
|
283
|
+
return this.#options.overlayRef;
|
|
284
|
+
}
|
|
285
|
+
get positionChanges() {
|
|
286
|
+
return this.#options.positionChanges$;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
var PopupReference = class {
|
|
290
|
+
#closed;
|
|
291
|
+
#closing;
|
|
292
|
+
constructor(overlayReference, preventClose) {
|
|
293
|
+
this.overlayReference = overlayReference;
|
|
294
|
+
this.preventClose = preventClose;
|
|
295
|
+
this.#closed = false;
|
|
296
|
+
this.#closing = false;
|
|
297
|
+
this.beforeClosed$ = new Subject();
|
|
298
|
+
this.closeStart$ = new Subject();
|
|
299
|
+
this.closed$ = new Subject();
|
|
300
|
+
this.opened$ = new ReplaySubject(1);
|
|
301
|
+
this.positionChanges$ = new Subject();
|
|
302
|
+
this.popupRef = new PopupRef(this);
|
|
303
|
+
}
|
|
304
|
+
close(result, delay) {
|
|
305
|
+
if (this.#closing) return false;
|
|
306
|
+
const beforeCloseEvent = result instanceof PopupCloseEvent ? result : new PopupCloseEvent({
|
|
307
|
+
result,
|
|
308
|
+
via: PopupCloseSource.Programmatic
|
|
309
|
+
});
|
|
310
|
+
this.beforeClosed$.next(beforeCloseEvent);
|
|
311
|
+
if (this.preventClose ? this.preventClose(beforeCloseEvent) || beforeCloseEvent.isDefaultPrevented() : beforeCloseEvent.isDefaultPrevented()) return false;
|
|
312
|
+
this.#closing = true;
|
|
313
|
+
this.closeStart$.next(beforeCloseEvent);
|
|
314
|
+
if (delay != null) {
|
|
315
|
+
if (delay > 0) asyncScheduler.schedule(() => this.completeClose(beforeCloseEvent), delay);
|
|
316
|
+
else this.completeClose(beforeCloseEvent);
|
|
317
|
+
} else if (this.wrapperComponentRef == null) this.completeClose(beforeCloseEvent);
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
closeDetached() {
|
|
321
|
+
if (this.#closed) return;
|
|
322
|
+
const event = new PopupCloseEvent({ via: PopupCloseSource.Programmatic });
|
|
323
|
+
if (!this.#closing) {
|
|
324
|
+
this.#closing = true;
|
|
325
|
+
this.closeStart$.next(event);
|
|
326
|
+
}
|
|
327
|
+
this.completeClose(event);
|
|
328
|
+
}
|
|
329
|
+
completeClose(event) {
|
|
330
|
+
if (this.#closed) return;
|
|
331
|
+
this.#closed = true;
|
|
332
|
+
this.closed$.next(event);
|
|
333
|
+
this.closed$.complete();
|
|
334
|
+
this.positionChanges$.complete();
|
|
335
|
+
this.overlayRef.dispose();
|
|
336
|
+
}
|
|
337
|
+
notifyOpen() {
|
|
338
|
+
this.opened$.next();
|
|
339
|
+
}
|
|
340
|
+
get beforeClose$() {
|
|
341
|
+
return this.beforeClosed$.asObservable();
|
|
342
|
+
}
|
|
343
|
+
get closeStart() {
|
|
344
|
+
return this.closeStart$.asObservable();
|
|
345
|
+
}
|
|
346
|
+
get closed() {
|
|
347
|
+
return this.closed$.asObservable();
|
|
348
|
+
}
|
|
349
|
+
get component() {
|
|
350
|
+
return this.componentRef ?? null;
|
|
351
|
+
}
|
|
352
|
+
get opened() {
|
|
353
|
+
return this.opened$;
|
|
354
|
+
}
|
|
355
|
+
get overlayRef() {
|
|
356
|
+
return this.overlayReference;
|
|
357
|
+
}
|
|
358
|
+
};
|
|
434
359
|
const connectionPosition = (anchorConnectionPoint, popupConnectionPoint) => {
|
|
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
|
-
|
|
360
|
+
const originMap = {
|
|
361
|
+
topleft: {
|
|
362
|
+
originX: "start",
|
|
363
|
+
originY: "top"
|
|
364
|
+
},
|
|
365
|
+
topcenter: {
|
|
366
|
+
originX: "center",
|
|
367
|
+
originY: "top"
|
|
368
|
+
},
|
|
369
|
+
topright: {
|
|
370
|
+
originX: "end",
|
|
371
|
+
originY: "top"
|
|
372
|
+
},
|
|
373
|
+
centerleft: {
|
|
374
|
+
originX: "start",
|
|
375
|
+
originY: "center"
|
|
376
|
+
},
|
|
377
|
+
center: {
|
|
378
|
+
originX: "center",
|
|
379
|
+
originY: "center"
|
|
380
|
+
},
|
|
381
|
+
centerright: {
|
|
382
|
+
originX: "end",
|
|
383
|
+
originY: "center"
|
|
384
|
+
},
|
|
385
|
+
bottomleft: {
|
|
386
|
+
originX: "start",
|
|
387
|
+
originY: "bottom"
|
|
388
|
+
},
|
|
389
|
+
bottomcenter: {
|
|
390
|
+
originX: "center",
|
|
391
|
+
originY: "bottom"
|
|
392
|
+
},
|
|
393
|
+
bottomright: {
|
|
394
|
+
originX: "end",
|
|
395
|
+
originY: "bottom"
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
const overlayMap = {
|
|
399
|
+
topleft: {
|
|
400
|
+
overlayX: "start",
|
|
401
|
+
overlayY: "top"
|
|
402
|
+
},
|
|
403
|
+
topcenter: {
|
|
404
|
+
overlayX: "center",
|
|
405
|
+
overlayY: "top"
|
|
406
|
+
},
|
|
407
|
+
topright: {
|
|
408
|
+
overlayX: "end",
|
|
409
|
+
overlayY: "top"
|
|
410
|
+
},
|
|
411
|
+
centerleft: {
|
|
412
|
+
overlayX: "start",
|
|
413
|
+
overlayY: "center"
|
|
414
|
+
},
|
|
415
|
+
center: {
|
|
416
|
+
overlayX: "center",
|
|
417
|
+
overlayY: "center"
|
|
418
|
+
},
|
|
419
|
+
centerright: {
|
|
420
|
+
overlayX: "end",
|
|
421
|
+
overlayY: "center"
|
|
422
|
+
},
|
|
423
|
+
bottomleft: {
|
|
424
|
+
overlayX: "start",
|
|
425
|
+
overlayY: "bottom"
|
|
426
|
+
},
|
|
427
|
+
bottomcenter: {
|
|
428
|
+
overlayX: "center",
|
|
429
|
+
overlayY: "bottom"
|
|
430
|
+
},
|
|
431
|
+
bottomright: {
|
|
432
|
+
overlayX: "end",
|
|
433
|
+
overlayY: "bottom"
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
const primaryPosition = {
|
|
437
|
+
...originMap[anchorConnectionPoint],
|
|
438
|
+
...overlayMap[popupConnectionPoint]
|
|
439
|
+
};
|
|
440
|
+
return [primaryPosition, ...generateFallbackPositions(primaryPosition)];
|
|
463
441
|
};
|
|
464
|
-
/**
|
|
465
|
-
* Generate fallback positions for the given primary position.
|
|
466
|
-
* This function is mostly AI-generated.
|
|
467
|
-
* @param primaryPosition The primary position to generate fallbacks for.
|
|
468
|
-
*/
|
|
469
442
|
const generateFallbackPositions = (primaryPosition) => {
|
|
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
|
-
|
|
443
|
+
const { originX, originY, overlayX, overlayY } = primaryPosition;
|
|
444
|
+
const fallbacks = [];
|
|
445
|
+
if (originY !== "bottom" && overlayY !== "bottom") {
|
|
446
|
+
if (originY === "top") fallbacks.push({
|
|
447
|
+
originX,
|
|
448
|
+
originY: "bottom",
|
|
449
|
+
overlayX,
|
|
450
|
+
overlayY: "bottom"
|
|
451
|
+
});
|
|
452
|
+
else if (overlayY === "top") fallbacks.push({
|
|
453
|
+
originX,
|
|
454
|
+
originY: "center",
|
|
455
|
+
overlayX,
|
|
456
|
+
overlayY: "bottom"
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
if (originX !== "end" && overlayX !== "end") {
|
|
460
|
+
if (originX === "start") fallbacks.push({
|
|
461
|
+
originX: "end",
|
|
462
|
+
originY,
|
|
463
|
+
overlayX: "end",
|
|
464
|
+
overlayY
|
|
465
|
+
});
|
|
466
|
+
else if (overlayX === "start") fallbacks.push({
|
|
467
|
+
originX: "center",
|
|
468
|
+
originY,
|
|
469
|
+
overlayX: "end",
|
|
470
|
+
overlayY
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
if (!fallbacks.find((f) => f.originX === originX && f.overlayX === overlayX)) {
|
|
474
|
+
if (originY === "top" && overlayY === "top") fallbacks.push({
|
|
475
|
+
originX,
|
|
476
|
+
originY: "bottom",
|
|
477
|
+
overlayX,
|
|
478
|
+
overlayY: "bottom"
|
|
479
|
+
});
|
|
480
|
+
else if (originY === "bottom" && overlayY === "bottom") fallbacks.push({
|
|
481
|
+
originX,
|
|
482
|
+
originY: "top",
|
|
483
|
+
overlayX,
|
|
484
|
+
overlayY: "top"
|
|
485
|
+
});
|
|
486
|
+
else if (originY === "top" && overlayY === "bottom") fallbacks.push({
|
|
487
|
+
originX,
|
|
488
|
+
originY: "bottom",
|
|
489
|
+
overlayX,
|
|
490
|
+
overlayY: "top"
|
|
491
|
+
});
|
|
492
|
+
else if (originY === "bottom" && overlayY === "top") fallbacks.push({
|
|
493
|
+
originX,
|
|
494
|
+
originY: "top",
|
|
495
|
+
overlayX,
|
|
496
|
+
overlayY: "bottom"
|
|
497
|
+
});
|
|
498
|
+
else if (overlayY === "top") fallbacks.push({
|
|
499
|
+
originX,
|
|
500
|
+
originY: "center",
|
|
501
|
+
overlayX,
|
|
502
|
+
overlayY: "bottom"
|
|
503
|
+
});
|
|
504
|
+
else if (overlayY === "bottom") fallbacks.push({
|
|
505
|
+
originX,
|
|
506
|
+
originY: "center",
|
|
507
|
+
overlayX,
|
|
508
|
+
overlayY: "top"
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
if (!fallbacks.find((f) => f.originY === originY && f.overlayY === overlayY)) {
|
|
512
|
+
if (originX === "start" && overlayX === "start") fallbacks.push({
|
|
513
|
+
originX: "end",
|
|
514
|
+
originY,
|
|
515
|
+
overlayX: "end",
|
|
516
|
+
overlayY
|
|
517
|
+
});
|
|
518
|
+
else if (originX === "end" && overlayX === "end") fallbacks.push({
|
|
519
|
+
originX: "start",
|
|
520
|
+
originY,
|
|
521
|
+
overlayX: "start",
|
|
522
|
+
overlayY
|
|
523
|
+
});
|
|
524
|
+
else if (originX === "start" && overlayX === "end") fallbacks.push({
|
|
525
|
+
originX: "end",
|
|
526
|
+
originY,
|
|
527
|
+
overlayX: "start",
|
|
528
|
+
overlayY
|
|
529
|
+
});
|
|
530
|
+
else if (originX === "end" && overlayX === "start") fallbacks.push({
|
|
531
|
+
originX: "start",
|
|
532
|
+
originY,
|
|
533
|
+
overlayX: "end",
|
|
534
|
+
overlayY
|
|
535
|
+
});
|
|
536
|
+
else if (overlayX === "start") fallbacks.push({
|
|
537
|
+
originX: "center",
|
|
538
|
+
originY,
|
|
539
|
+
overlayX: "end",
|
|
540
|
+
overlayY
|
|
541
|
+
});
|
|
542
|
+
else if (overlayX === "end") fallbacks.push({
|
|
543
|
+
originX: "center",
|
|
544
|
+
originY,
|
|
545
|
+
overlayX: "start",
|
|
546
|
+
overlayY
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
if (originX === "start" && originY === "top" && overlayX === "end" && overlayY === "bottom") fallbacks.push({
|
|
550
|
+
originX: "end",
|
|
551
|
+
originY: "bottom",
|
|
552
|
+
overlayX: "start",
|
|
553
|
+
overlayY: "top"
|
|
554
|
+
});
|
|
555
|
+
else if (originX === "end" && originY === "bottom" && overlayX === "start" && overlayY === "top") fallbacks.push({
|
|
556
|
+
originX: "start",
|
|
557
|
+
originY: "top",
|
|
558
|
+
overlayX: "end",
|
|
559
|
+
overlayY: "bottom"
|
|
560
|
+
});
|
|
561
|
+
else if (originX === "start" && originY === "bottom" && overlayX === "end" && overlayY === "top") fallbacks.push({
|
|
562
|
+
originX: "end",
|
|
563
|
+
originY: "top",
|
|
564
|
+
overlayX: "start",
|
|
565
|
+
overlayY: "bottom"
|
|
566
|
+
});
|
|
567
|
+
else if (originX === "end" && originY === "top" && overlayX === "start" && overlayY === "bottom") fallbacks.push({
|
|
568
|
+
originX: "start",
|
|
569
|
+
originY: "bottom",
|
|
570
|
+
overlayX: "end",
|
|
571
|
+
overlayY: "top"
|
|
572
|
+
});
|
|
573
|
+
const mirrored = {
|
|
574
|
+
originX: flipX(originX),
|
|
575
|
+
originY: flipY(originY),
|
|
576
|
+
overlayX: flipX(overlayX),
|
|
577
|
+
overlayY: flipY(overlayY)
|
|
578
|
+
};
|
|
579
|
+
const isPrimary = mirrored.originX === originX && mirrored.originY === originY && mirrored.overlayX === overlayX && mirrored.overlayY === overlayY;
|
|
580
|
+
const isListed = fallbacks.some((f) => f.originX === mirrored.originX && f.originY === mirrored.originY && f.overlayX === mirrored.overlayX && f.overlayY === mirrored.overlayY);
|
|
581
|
+
if (!isPrimary && !isListed) fallbacks.push(mirrored);
|
|
582
|
+
return fallbacks;
|
|
577
583
|
};
|
|
578
|
-
const flipX = (value) =>
|
|
579
|
-
const flipY = (value) =>
|
|
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
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
}
|
|
1018
|
-
return fromEvent(anchorElement, "pointerleave")
|
|
1019
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1020
|
-
.subscribe(event => {
|
|
1021
|
-
const closeEvent = new PopupCloseEvent({
|
|
1022
|
-
event,
|
|
1023
|
-
originalEvent: event,
|
|
1024
|
-
via: PopupCloseSource.MouseLeave
|
|
1025
|
-
});
|
|
1026
|
-
popupReference.close(closeEvent);
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
setupOutsideClickSubscription(settings, popupReference, overlayRef) {
|
|
1030
|
-
return overlayRef
|
|
1031
|
-
.outsidePointerEvents()
|
|
1032
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1033
|
-
.subscribe(event => {
|
|
1034
|
-
if (this.shouldIgnoreOutsideClick(settings, event, overlayRef)) {
|
|
1035
|
-
return;
|
|
1036
|
-
}
|
|
1037
|
-
const closeEvent = new PopupCloseEvent({
|
|
1038
|
-
event,
|
|
1039
|
-
originalEvent: event,
|
|
1040
|
-
via: PopupCloseSource.OutsideClick
|
|
1041
|
-
});
|
|
1042
|
-
popupReference.close(closeEvent);
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
setupPositionChangeTracking(settings, overlayRef, popupReference) {
|
|
1046
|
-
if (settings.positionStrategy === "global") {
|
|
1047
|
-
return;
|
|
1048
|
-
}
|
|
1049
|
-
const positionStrategy = overlayRef.getConfig().positionStrategy;
|
|
1050
|
-
if (positionStrategy && positionStrategy.positionChanges) {
|
|
1051
|
-
positionStrategy.positionChanges
|
|
1052
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1053
|
-
.subscribe(change => popupReference.positionChanges$.next(change.connectionPair));
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
setupScrollClosing(settings, popupReference, overlayRef) {
|
|
1057
|
-
if (!settings.closeOnScroll) {
|
|
1058
|
-
return;
|
|
1059
|
-
}
|
|
1060
|
-
const scrollableContainers = this.getScrollableContainers(this.resolveAnchor(settings.anchor));
|
|
1061
|
-
const subscriptions = [];
|
|
1062
|
-
const handleScrollClose = (originalEvent) => {
|
|
1063
|
-
if (!overlayRef.hasAttached()) {
|
|
1064
|
-
return;
|
|
1065
|
-
}
|
|
1066
|
-
const closeEvent = new PopupCloseEvent({
|
|
1067
|
-
event: originalEvent ?? new Event("scroll"),
|
|
1068
|
-
originalEvent: originalEvent ?? new Event("scroll"),
|
|
1069
|
-
via: PopupCloseSource.Scroll
|
|
1070
|
-
});
|
|
1071
|
-
popupReference.close(closeEvent, 0);
|
|
1072
|
-
};
|
|
1073
|
-
// The page scrolls the anchor away whether or not it also sits in a scrollable container.
|
|
1074
|
-
const win = this.#document.defaultView;
|
|
1075
|
-
const pageEvents = [
|
|
1076
|
-
fromEvent(win, "scroll", { passive: true }),
|
|
1077
|
-
fromEvent(this.#document, "scroll", { passive: true })
|
|
1078
|
-
];
|
|
1079
|
-
if (scrollableContainers.length === 0) {
|
|
1080
|
-
pageEvents.push(fromEvent(win, "resize", { passive: true }));
|
|
1081
|
-
}
|
|
1082
|
-
const pageScrollSubscription = merge(...pageEvents)
|
|
1083
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1084
|
-
.subscribe(event => handleScrollClose(event));
|
|
1085
|
-
subscriptions.push(pageScrollSubscription);
|
|
1086
|
-
scrollableContainers.forEach(scrollable => {
|
|
1087
|
-
const containerScrollSubscription = scrollable
|
|
1088
|
-
.elementScrolled()
|
|
1089
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1090
|
-
.subscribe(() => handleScrollClose());
|
|
1091
|
-
subscriptions.push(containerScrollSubscription);
|
|
1092
|
-
});
|
|
1093
|
-
popupReference.closed.pipe(take(1)).subscribe(() => {
|
|
1094
|
-
subscriptions.forEach(sub => sub.unsubscribe());
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
setupScrollTracking(settings, overlayRef, popupReference) {
|
|
1098
|
-
if (!(settings.withScrollTracking ?? true) || settings.positionStrategy === "global") {
|
|
1099
|
-
return;
|
|
1100
|
-
}
|
|
1101
|
-
if (typeof settings.anchor === "string") {
|
|
1102
|
-
return;
|
|
1103
|
-
}
|
|
1104
|
-
const subscriptions = [];
|
|
1105
|
-
const updatePosition = () => {
|
|
1106
|
-
if (overlayRef.hasAttached()) {
|
|
1107
|
-
overlayRef.updatePosition();
|
|
1108
|
-
}
|
|
1109
|
-
};
|
|
1110
|
-
const win = this.#document.defaultView;
|
|
1111
|
-
const windowScrollSubscription = fromEvent(win, "scroll", { passive: true })
|
|
1112
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1113
|
-
.subscribe(updatePosition);
|
|
1114
|
-
subscriptions.push(windowScrollSubscription);
|
|
1115
|
-
const resizeSubscription = fromEvent(win, "resize", { passive: true })
|
|
1116
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1117
|
-
.subscribe(updatePosition);
|
|
1118
|
-
subscriptions.push(resizeSubscription);
|
|
1119
|
-
this.getScrollableContainers(this.resolveAnchor(settings.anchor)).forEach(scrollable => {
|
|
1120
|
-
const containerScrollSubscription = scrollable
|
|
1121
|
-
.elementScrolled()
|
|
1122
|
-
.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef))
|
|
1123
|
-
.subscribe(updatePosition);
|
|
1124
|
-
subscriptions.push(containerScrollSubscription);
|
|
1125
|
-
});
|
|
1126
|
-
popupReference.closed.pipe(take(1)).subscribe(() => {
|
|
1127
|
-
subscriptions.forEach(sub => sub.unsubscribe());
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
shouldIgnoreOutsideClick(settings, event, overlayRef) {
|
|
1131
|
-
const eventTarget = event.target;
|
|
1132
|
-
// The backdrop lies outside the pane, so its clicks also arrive here. They belong to the backdrop
|
|
1133
|
-
// handler, which honours closeOnBackdropClick and reports them as BackdropClick.
|
|
1134
|
-
if (overlayRef.backdropElement?.contains(eventTarget)) {
|
|
1135
|
-
return true;
|
|
1136
|
-
}
|
|
1137
|
-
if (typeof settings.anchor === "string") {
|
|
1138
|
-
return !this.#outsideEventsToClose.includes(event.type);
|
|
1139
|
-
}
|
|
1140
|
-
const resolvedAnchor = this.resolveAnchor(settings.anchor);
|
|
1141
|
-
const anchorElement = this.getAnchorElement(resolvedAnchor);
|
|
1142
|
-
const isAnchorClick = anchorElement && anchorElement.contains(eventTarget);
|
|
1143
|
-
const isRelevantEventType = this.#outsideEventsToClose.includes(event.type);
|
|
1144
|
-
return isAnchorClick || !isRelevantEventType;
|
|
1145
|
-
}
|
|
1146
|
-
unregisterOpenPopup(popup) {
|
|
1147
|
-
const index = this.#openPopups.indexOf(popup);
|
|
1148
|
-
if (index !== -1) {
|
|
1149
|
-
this.#openPopups.splice(index, 1);
|
|
1150
|
-
}
|
|
1151
|
-
if (this.#openPopups.length === 0) {
|
|
1152
|
-
this.#escapeSubscription?.unsubscribe();
|
|
1153
|
-
this.#escapeSubscription = null;
|
|
1154
|
-
this.#escapeTarget = null;
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1158
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopupService, providedIn: "root" }); }
|
|
1159
|
-
}
|
|
1160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PopupService, decorators: [{
|
|
1161
|
-
type: Injectable,
|
|
1162
|
-
args: [{
|
|
1163
|
-
providedIn: "root"
|
|
1164
|
-
}]
|
|
1165
|
-
}] });
|
|
1166
|
-
/**
|
|
1167
|
-
* Language of the popup content. The overlay container sits outside the app root, so a `lang` set on the root
|
|
1168
|
-
* (or near the anchor) would not reach the popup and screen readers could read it with the wrong voice
|
|
1169
|
-
* (WCAG 3.1.2). The nearest `lang` above the anchor wins; without one, the active Mona locale is used.
|
|
1170
|
-
*/
|
|
584
|
+
const flipX = (value) => value === "start" ? "end" : value === "end" ? "start" : value;
|
|
585
|
+
const flipY = (value) => value === "top" ? "bottom" : value === "bottom" ? "top" : value;
|
|
586
|
+
var PopupService = class PopupService {
|
|
587
|
+
#destroyRef = inject(DestroyRef);
|
|
588
|
+
#directionality = inject(Directionality, { optional: true });
|
|
589
|
+
#document = inject(DOCUMENT);
|
|
590
|
+
#i18n = inject(MonaI18nService, { optional: true });
|
|
591
|
+
#injector = inject(Injector);
|
|
592
|
+
#openPopups = [];
|
|
593
|
+
#outsideEventsToClose = [
|
|
594
|
+
"click",
|
|
595
|
+
"mousedown",
|
|
596
|
+
"dblclick",
|
|
597
|
+
"contextmenu",
|
|
598
|
+
"auxclick"
|
|
599
|
+
];
|
|
600
|
+
#overlay = inject(Overlay);
|
|
601
|
+
#scrollDispatcher = inject(ScrollDispatcher);
|
|
602
|
+
#escapeSubscription = null;
|
|
603
|
+
#escapeTarget = null;
|
|
604
|
+
create(settings) {
|
|
605
|
+
if (typeof settings.anchor === "string") return this.createMultiElementPopup(settings);
|
|
606
|
+
return this.createSingleElementPopup(settings);
|
|
607
|
+
}
|
|
608
|
+
attachContent(settings, popupReference, overlayRef, injector) {
|
|
609
|
+
const portal = new ComponentPortal(PopupWrapperComponent, null, injector);
|
|
610
|
+
const wrapperComponentRef = overlayRef.attach(portal);
|
|
611
|
+
popupReference.wrapperComponentRef = wrapperComponentRef;
|
|
612
|
+
wrapperComponentRef.changeDetectorRef.detectChanges();
|
|
613
|
+
popupReference.componentRef = wrapperComponentRef.instance.attachContent(settings.content, injector) ?? void 0;
|
|
614
|
+
wrapperComponentRef.changeDetectorRef.detectChanges();
|
|
615
|
+
return wrapperComponentRef.location.nativeElement;
|
|
616
|
+
}
|
|
617
|
+
buildPanelClass(popupClass) {
|
|
618
|
+
if (!popupClass) return "mona-popup-content";
|
|
619
|
+
return ["mona-popup-content"].concat(popupClass);
|
|
620
|
+
}
|
|
621
|
+
captureOriginalFocus(settings) {
|
|
622
|
+
const restoreFocus = settings.restoreFocus ?? "auto";
|
|
623
|
+
if (typeof settings.anchor === "string" || restoreFocus === false) return null;
|
|
624
|
+
const activeElement = this.#document.activeElement;
|
|
625
|
+
if (!(activeElement instanceof HTMLElement)) return null;
|
|
626
|
+
if (restoreFocus === "auto") return this.getAnchorElement(settings.anchor)?.contains(activeElement) ? activeElement : null;
|
|
627
|
+
return this.getAnchorElement(settings.anchor);
|
|
628
|
+
}
|
|
629
|
+
createInjector(settings, popupReference) {
|
|
630
|
+
return Injector.create({
|
|
631
|
+
parent: settings.injector ?? this.#injector,
|
|
632
|
+
providers: [
|
|
633
|
+
{
|
|
634
|
+
provide: PopupRef,
|
|
635
|
+
useFactory: () => popupReference.popupRef
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
provide: PopupDataInjectionToken,
|
|
639
|
+
useValue: settings.data
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
provide: POPUP_REFERENCE,
|
|
643
|
+
useValue: popupReference
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
provide: POPUP_SETTINGS,
|
|
647
|
+
useValue: settings
|
|
648
|
+
},
|
|
649
|
+
...settings.providers ?? []
|
|
650
|
+
]
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
createMultiElementPopup(settings) {
|
|
654
|
+
const selector = settings.anchor;
|
|
655
|
+
const virtualPopupReference = new PopupReference(this.#overlay.create({ hasBackdrop: false }));
|
|
656
|
+
const delegation = this.setupInternalEventDelegation(selector, settings);
|
|
657
|
+
virtualPopupReference.popupRef.closed.pipe(take(1)).subscribe(() => delegation.unsubscribe());
|
|
658
|
+
return virtualPopupReference.popupRef;
|
|
659
|
+
}
|
|
660
|
+
createOverlay(settings) {
|
|
661
|
+
const positionStrategy = this.createPositionStrategy(settings);
|
|
662
|
+
const panelClass = this.buildPanelClass(settings.popupClass);
|
|
663
|
+
const anchorElement = settings.anchor instanceof ElementRef ? settings.anchor.nativeElement : settings.anchor instanceof HTMLElement ? settings.anchor : null;
|
|
664
|
+
const direction = resolveComponentDirection(anchorElement, this.#directionality);
|
|
665
|
+
const overlayRef = this.#overlay.create(new OverlayConfig({
|
|
666
|
+
positionStrategy,
|
|
667
|
+
hasBackdrop: settings.hasBackdrop ?? false,
|
|
668
|
+
height: settings.height,
|
|
669
|
+
maxHeight: settings.maxHeight,
|
|
670
|
+
maxWidth: settings.maxWidth,
|
|
671
|
+
minHeight: settings.minHeight,
|
|
672
|
+
minWidth: settings.minWidth,
|
|
673
|
+
width: settings.width,
|
|
674
|
+
panelClass,
|
|
675
|
+
backdropClass: settings.backdropClass ?? "transparent",
|
|
676
|
+
direction,
|
|
677
|
+
scrollStrategy: settings.blockScroll ? createPageScrollBlockStrategy(this.#document, this.#overlay.scrollStrategies.block()) : void 0
|
|
678
|
+
}));
|
|
679
|
+
const lang = resolvePopupLanguage(anchorElement, this.#i18n?.localeId());
|
|
680
|
+
if (lang) overlayRef.overlayElement.setAttribute("lang", lang);
|
|
681
|
+
return overlayRef;
|
|
682
|
+
}
|
|
683
|
+
createPositionStrategy(settings) {
|
|
684
|
+
if (settings.positionStrategy === "global") return this.#overlay.position().global();
|
|
685
|
+
const resolvedAnchor = this.resolveAnchor(settings.anchor);
|
|
686
|
+
const position = settings.positions?.length ? settings.positions : this.getPosition(settings.anchorConnectionPoint, settings.popupConnectionPoint);
|
|
687
|
+
const strategy = this.#overlay.position().flexibleConnectedTo(resolvedAnchor).withPositions(position).withDefaultOffsetX(settings.offset?.horizontal ?? 0).withDefaultOffsetY(settings.offset?.vertical ?? 0).withPush(settings.withPush ?? true);
|
|
688
|
+
if (settings.withScrollTracking ?? true) {
|
|
689
|
+
const scrollableContainers = this.getScrollableContainers(resolvedAnchor);
|
|
690
|
+
strategy.withScrollableContainers(scrollableContainers);
|
|
691
|
+
}
|
|
692
|
+
return strategy;
|
|
693
|
+
}
|
|
694
|
+
createScrollDispatcherTarget(element) {
|
|
695
|
+
const elementRef = new ElementRef(element);
|
|
696
|
+
return {
|
|
697
|
+
elementScrolled: () => fromEvent(element, "scroll", { passive: true }),
|
|
698
|
+
getElementRef: () => elementRef
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
createSingleElementPopup(settings) {
|
|
702
|
+
const overlayRef = this.createOverlay(settings);
|
|
703
|
+
const popupReference = new PopupReference(overlayRef, settings.preventClose);
|
|
704
|
+
const originallyFocusedElement = this.captureOriginalFocus(settings);
|
|
705
|
+
const injector = this.createInjector(settings, popupReference);
|
|
706
|
+
popupReference.notifyOpen();
|
|
707
|
+
this.attachContent(settings, popupReference, overlayRef, injector);
|
|
708
|
+
const subscription = this.setupCloseSubscriptions(settings, popupReference, overlayRef);
|
|
709
|
+
this.setupCleanupSubscription(popupReference, subscription, settings, originallyFocusedElement);
|
|
710
|
+
this.setupBackdropFadeOut(settings, popupReference, overlayRef);
|
|
711
|
+
if (settings.closeOnScroll) this.setupScrollClosing(settings, popupReference, overlayRef);
|
|
712
|
+
this.setupScrollTracking(settings, overlayRef, popupReference);
|
|
713
|
+
this.registerOpenPopup(settings, popupReference);
|
|
714
|
+
this.setupDetachTracking(overlayRef, popupReference);
|
|
715
|
+
this.setupPositionChangeTracking(settings, overlayRef, popupReference);
|
|
716
|
+
this.setupDirectionTracking(settings, overlayRef, popupReference);
|
|
717
|
+
return popupReference.popupRef;
|
|
718
|
+
}
|
|
719
|
+
getAnchorElement(anchor) {
|
|
720
|
+
if (anchor instanceof HTMLElement) return anchor;
|
|
721
|
+
if (typeof anchor === "object" && "nativeElement" in anchor && anchor.nativeElement instanceof HTMLElement) return anchor.nativeElement;
|
|
722
|
+
return null;
|
|
723
|
+
}
|
|
724
|
+
getPosition(anchorConnectionPoint, popupConnectionPoint) {
|
|
725
|
+
return connectionPosition(anchorConnectionPoint ?? "bottomleft", popupConnectionPoint ?? "topleft");
|
|
726
|
+
}
|
|
727
|
+
getScrollableAncestorElements(anchorElement) {
|
|
728
|
+
const scrollables = [];
|
|
729
|
+
let element = anchorElement.parentElement;
|
|
730
|
+
while (element) {
|
|
731
|
+
if (this.isScrollableElement(element)) scrollables.push(element);
|
|
732
|
+
element = element.parentElement;
|
|
733
|
+
}
|
|
734
|
+
return scrollables;
|
|
735
|
+
}
|
|
736
|
+
getScrollableContainers(anchor) {
|
|
737
|
+
const anchorElement = this.getAnchorElement(anchor);
|
|
738
|
+
if (!anchorElement) return [];
|
|
739
|
+
const scrollablesByElement = /* @__PURE__ */ new Map();
|
|
740
|
+
const addScrollable = (scrollable) => {
|
|
741
|
+
scrollablesByElement.set(scrollable.getElementRef().nativeElement, scrollable);
|
|
742
|
+
};
|
|
743
|
+
this.#scrollDispatcher.getAncestorScrollContainers(anchorElement).forEach((scrollable) => addScrollable(scrollable));
|
|
744
|
+
this.getScrollableAncestorElements(anchorElement).map((element) => this.createScrollDispatcherTarget(element)).forEach((scrollable) => addScrollable(scrollable));
|
|
745
|
+
return Array.from(scrollablesByElement.values());
|
|
746
|
+
}
|
|
747
|
+
getTopmostOpenPopup() {
|
|
748
|
+
for (let index = this.#openPopups.length - 1; index >= 0; index--) {
|
|
749
|
+
const popup = this.#openPopups[index];
|
|
750
|
+
if (popup.reference.overlayRef.hasAttached()) return popup;
|
|
751
|
+
}
|
|
752
|
+
return null;
|
|
753
|
+
}
|
|
754
|
+
handleEscapeKey(event) {
|
|
755
|
+
const escapeTarget = this.#escapeTarget;
|
|
756
|
+
this.#escapeTarget = null;
|
|
757
|
+
if (event.key !== "Escape" || event.isComposing) return;
|
|
758
|
+
const popup = escapeTarget?.event === event ? escapeTarget.popup : this.getTopmostOpenPopup();
|
|
759
|
+
if (!popup?.closeOnEscape) return;
|
|
760
|
+
popup.reference.popupRef.close(new PopupCloseEvent({
|
|
761
|
+
event,
|
|
762
|
+
originalEvent: event,
|
|
763
|
+
via: PopupCloseSource.Escape
|
|
764
|
+
}));
|
|
765
|
+
}
|
|
766
|
+
handleFocusRestoration(settings, overlayRef, originallyFocusedElement) {
|
|
767
|
+
const restoreFocus = settings.restoreFocus ?? "auto";
|
|
768
|
+
if (restoreFocus === false) return;
|
|
769
|
+
const target = restoreFocus === "auto" ? originallyFocusedElement : this.getAnchorElement(settings.anchor);
|
|
770
|
+
if (target && focusCanReturn(this.#document, target, overlayRef.overlayElement)) target.focus();
|
|
771
|
+
}
|
|
772
|
+
isScrollableElement(element) {
|
|
773
|
+
const defaultView = this.#document.defaultView;
|
|
774
|
+
if (!defaultView) return false;
|
|
775
|
+
const style = defaultView.getComputedStyle(element);
|
|
776
|
+
const canScrollVertically = (this.isScrollableOverflow(style.overflowY) || this.isScrollableOverflow(style.overflow)) && element.scrollHeight > element.clientHeight;
|
|
777
|
+
const canScrollHorizontally = (this.isScrollableOverflow(style.overflowX) || this.isScrollableOverflow(style.overflow)) && element.scrollWidth > element.clientWidth;
|
|
778
|
+
return canScrollVertically || canScrollHorizontally;
|
|
779
|
+
}
|
|
780
|
+
isScrollableOverflow(value) {
|
|
781
|
+
return value === "auto" || value === "scroll" || value === "overlay";
|
|
782
|
+
}
|
|
783
|
+
listenForEscape() {
|
|
784
|
+
if (this.#escapeSubscription) return;
|
|
785
|
+
const subscription = new Subscription();
|
|
786
|
+
subscription.add(fromEvent(this.#document, "keydown", { capture: true }).subscribe((event) => {
|
|
787
|
+
this.#escapeTarget = event.key === "Escape" ? {
|
|
788
|
+
event,
|
|
789
|
+
popup: this.getTopmostOpenPopup()
|
|
790
|
+
} : null;
|
|
791
|
+
}));
|
|
792
|
+
subscription.add(fromEvent(this.#document, "keydown").subscribe((event) => this.handleEscapeKey(event)));
|
|
793
|
+
this.#escapeSubscription = subscription;
|
|
794
|
+
}
|
|
795
|
+
registerOpenPopup(settings, popupReference) {
|
|
796
|
+
const popup = {
|
|
797
|
+
closeOnEscape: settings.closeOnEscape ?? true,
|
|
798
|
+
reference: popupReference
|
|
799
|
+
};
|
|
800
|
+
this.#openPopups.push(popup);
|
|
801
|
+
this.listenForEscape();
|
|
802
|
+
merge(popupReference.closeStart, popupReference.closed).pipe(take(1)).subscribe(() => this.unregisterOpenPopup(popup));
|
|
803
|
+
}
|
|
804
|
+
resolveAnchor(anchor) {
|
|
805
|
+
if (typeof anchor === "string") throw new Error(`CSS selector "${anchor}" should not reach resolveAnchor(). CSS selectors should be handled by createMultiElementPopup().`);
|
|
806
|
+
return anchor;
|
|
807
|
+
}
|
|
808
|
+
setupBackdropCloseSubscription(settings, popupReference, overlayRef) {
|
|
809
|
+
if (!(settings.closeOnBackdropClick ?? true)) return null;
|
|
810
|
+
const backdropSubject = new Subject();
|
|
811
|
+
return overlayRef.backdropClick().pipe(takeUntil(backdropSubject)).subscribe((e) => {
|
|
812
|
+
const event = new PopupCloseEvent({
|
|
813
|
+
event: e,
|
|
814
|
+
originalEvent: e,
|
|
815
|
+
via: PopupCloseSource.BackdropClick
|
|
816
|
+
});
|
|
817
|
+
if (!popupReference.close(event)) return;
|
|
818
|
+
backdropSubject.next();
|
|
819
|
+
backdropSubject.complete();
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
setupBackdropFadeOut(settings, popupReference, overlayRef) {
|
|
823
|
+
if (!settings.hasBackdrop) return;
|
|
824
|
+
popupReference.closeStart.pipe(take(1)).subscribe(() => overlayRef.detachBackdrop());
|
|
825
|
+
}
|
|
826
|
+
setupCleanupSubscription(popupReference, subscription, settings, originallyFocusedElement) {
|
|
827
|
+
popupReference.closed.pipe(take(1)).subscribe(() => {
|
|
828
|
+
subscription?.unsubscribe();
|
|
829
|
+
this.handleFocusRestoration(settings, popupReference.overlayRef, originallyFocusedElement);
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
setupCloseSubscriptions(settings, popupReference, overlayRef) {
|
|
833
|
+
const subscriptions = [];
|
|
834
|
+
if (settings.hasBackdrop) {
|
|
835
|
+
const backdropSub = this.setupBackdropCloseSubscription(settings, popupReference, overlayRef);
|
|
836
|
+
if (backdropSub) subscriptions.push(backdropSub);
|
|
837
|
+
}
|
|
838
|
+
if (settings.closeOnOutsideClick ?? true) {
|
|
839
|
+
const outsideClickSub = this.setupOutsideClickSubscription(settings, popupReference, overlayRef);
|
|
840
|
+
if (outsideClickSub) subscriptions.push(outsideClickSub);
|
|
841
|
+
}
|
|
842
|
+
if (settings.closeOnMouseLeave) {
|
|
843
|
+
const mouseLeaveSubscription = this.setupMouseLeaveSubscription(settings, popupReference);
|
|
844
|
+
if (mouseLeaveSubscription) subscriptions.push(mouseLeaveSubscription);
|
|
845
|
+
}
|
|
846
|
+
if (subscriptions.length === 0) return null;
|
|
847
|
+
const combinedSubscription = new Subscription();
|
|
848
|
+
subscriptions.forEach((sub) => combinedSubscription.add(sub));
|
|
849
|
+
return combinedSubscription;
|
|
850
|
+
}
|
|
851
|
+
setupDetachTracking(overlayRef, popupReference) {
|
|
852
|
+
overlayRef.detachments().pipe(take(1), takeUntil(popupReference.closed)).subscribe(() => popupReference.closeDetached());
|
|
853
|
+
}
|
|
854
|
+
setupDirectionTracking(settings, overlayRef, popupReference) {
|
|
855
|
+
const resolvedAnchor = this.resolveAnchor(settings.anchor);
|
|
856
|
+
const anchorElement = this.getAnchorElement(resolvedAnchor);
|
|
857
|
+
const cleanup = observeComponentDirection(anchorElement, this.#directionality, (nextDir) => {
|
|
858
|
+
overlayRef.setDirection(nextDir);
|
|
859
|
+
overlayRef.updatePosition();
|
|
860
|
+
popupReference.componentRef?.changeDetectorRef.markForCheck();
|
|
861
|
+
});
|
|
862
|
+
popupReference.closed.pipe(take(1)).subscribe(() => {
|
|
863
|
+
cleanup();
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
setupInternalEventDelegation(selector, settings) {
|
|
867
|
+
let current = null;
|
|
868
|
+
const closeCurrent = () => {
|
|
869
|
+
const popup = current;
|
|
870
|
+
current = null;
|
|
871
|
+
popup?.popupRef.close();
|
|
872
|
+
};
|
|
873
|
+
const subscription = new Subscription(closeCurrent);
|
|
874
|
+
subscription.add(fromEvent(this.#document, "pointerover").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
875
|
+
const element = (event.target instanceof Element ? event.target : null)?.closest(selector);
|
|
876
|
+
if (!(element instanceof HTMLElement) || element === current?.element) return;
|
|
877
|
+
closeCurrent();
|
|
878
|
+
const popupRef = this.createSingleElementPopup({
|
|
879
|
+
...settings,
|
|
880
|
+
anchor: element
|
|
881
|
+
});
|
|
882
|
+
current = {
|
|
883
|
+
element,
|
|
884
|
+
popupRef
|
|
885
|
+
};
|
|
886
|
+
popupRef.closed.pipe(take(1)).subscribe(() => {
|
|
887
|
+
if (current?.popupRef === popupRef) current = null;
|
|
888
|
+
});
|
|
889
|
+
}));
|
|
890
|
+
subscription.add(fromEvent(this.#document, "pointerout").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
891
|
+
const element = current?.element;
|
|
892
|
+
const target = event.target instanceof Node ? event.target : null;
|
|
893
|
+
const next = event.relatedTarget instanceof Node ? event.relatedTarget : null;
|
|
894
|
+
if (element && target && element.contains(target) && !(next && element.contains(next))) closeCurrent();
|
|
895
|
+
}));
|
|
896
|
+
return subscription;
|
|
897
|
+
}
|
|
898
|
+
setupMouseLeaveSubscription(settings, popupReference) {
|
|
899
|
+
if (typeof settings.anchor === "string") return null;
|
|
900
|
+
const resolvedAnchor = this.resolveAnchor(settings.anchor);
|
|
901
|
+
const anchorElement = this.getAnchorElement(resolvedAnchor);
|
|
902
|
+
if (!anchorElement) return null;
|
|
903
|
+
return fromEvent(anchorElement, "pointerleave").pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
904
|
+
const closeEvent = new PopupCloseEvent({
|
|
905
|
+
event,
|
|
906
|
+
originalEvent: event,
|
|
907
|
+
via: PopupCloseSource.MouseLeave
|
|
908
|
+
});
|
|
909
|
+
popupReference.close(closeEvent);
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
setupOutsideClickSubscription(settings, popupReference, overlayRef) {
|
|
913
|
+
return overlayRef.outsidePointerEvents().pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
914
|
+
if (this.shouldIgnoreOutsideClick(settings, event, overlayRef)) return;
|
|
915
|
+
const closeEvent = new PopupCloseEvent({
|
|
916
|
+
event,
|
|
917
|
+
originalEvent: event,
|
|
918
|
+
via: PopupCloseSource.OutsideClick
|
|
919
|
+
});
|
|
920
|
+
popupReference.close(closeEvent);
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
setupPositionChangeTracking(settings, overlayRef, popupReference) {
|
|
924
|
+
if (settings.positionStrategy === "global") return;
|
|
925
|
+
const positionStrategy = overlayRef.getConfig().positionStrategy;
|
|
926
|
+
if (positionStrategy && positionStrategy.positionChanges) positionStrategy.positionChanges.pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe((change) => popupReference.positionChanges$.next(change.connectionPair));
|
|
927
|
+
}
|
|
928
|
+
setupScrollClosing(settings, popupReference, overlayRef) {
|
|
929
|
+
if (!settings.closeOnScroll) return;
|
|
930
|
+
const scrollableContainers = this.getScrollableContainers(this.resolveAnchor(settings.anchor));
|
|
931
|
+
const subscriptions = [];
|
|
932
|
+
const handleScrollClose = (originalEvent) => {
|
|
933
|
+
if (!overlayRef.hasAttached()) return;
|
|
934
|
+
const closeEvent = new PopupCloseEvent({
|
|
935
|
+
event: originalEvent ?? new Event("scroll"),
|
|
936
|
+
originalEvent: originalEvent ?? new Event("scroll"),
|
|
937
|
+
via: PopupCloseSource.Scroll
|
|
938
|
+
});
|
|
939
|
+
popupReference.close(closeEvent, 0);
|
|
940
|
+
};
|
|
941
|
+
const win = this.#document.defaultView;
|
|
942
|
+
const pageEvents = [fromEvent(win, "scroll", { passive: true }), fromEvent(this.#document, "scroll", { passive: true })];
|
|
943
|
+
if (scrollableContainers.length === 0) pageEvents.push(fromEvent(win, "resize", { passive: true }));
|
|
944
|
+
const pageScrollSubscription = merge(...pageEvents).pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => handleScrollClose(event));
|
|
945
|
+
subscriptions.push(pageScrollSubscription);
|
|
946
|
+
scrollableContainers.forEach((scrollable) => {
|
|
947
|
+
const containerScrollSubscription = scrollable.elementScrolled().pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe(() => handleScrollClose());
|
|
948
|
+
subscriptions.push(containerScrollSubscription);
|
|
949
|
+
});
|
|
950
|
+
popupReference.closed.pipe(take(1)).subscribe(() => {
|
|
951
|
+
subscriptions.forEach((sub) => sub.unsubscribe());
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
setupScrollTracking(settings, overlayRef, popupReference) {
|
|
955
|
+
if (!(settings.withScrollTracking ?? true) || settings.positionStrategy === "global") return;
|
|
956
|
+
if (typeof settings.anchor === "string") return;
|
|
957
|
+
const subscriptions = [];
|
|
958
|
+
const updatePosition = () => {
|
|
959
|
+
if (overlayRef.hasAttached()) overlayRef.updatePosition();
|
|
960
|
+
};
|
|
961
|
+
const win = this.#document.defaultView;
|
|
962
|
+
const windowScrollSubscription = fromEvent(win, "scroll", { passive: true }).pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe(updatePosition);
|
|
963
|
+
subscriptions.push(windowScrollSubscription);
|
|
964
|
+
const resizeSubscription = fromEvent(win, "resize", { passive: true }).pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe(updatePosition);
|
|
965
|
+
subscriptions.push(resizeSubscription);
|
|
966
|
+
this.getScrollableContainers(this.resolveAnchor(settings.anchor)).forEach((scrollable) => {
|
|
967
|
+
const containerScrollSubscription = scrollable.elementScrolled().pipe(takeUntil(popupReference.closed), takeUntilDestroyed(this.#destroyRef)).subscribe(updatePosition);
|
|
968
|
+
subscriptions.push(containerScrollSubscription);
|
|
969
|
+
});
|
|
970
|
+
popupReference.closed.pipe(take(1)).subscribe(() => {
|
|
971
|
+
subscriptions.forEach((sub) => sub.unsubscribe());
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
shouldIgnoreOutsideClick(settings, event, overlayRef) {
|
|
975
|
+
const eventTarget = event.target;
|
|
976
|
+
if (overlayRef.backdropElement?.contains(eventTarget)) return true;
|
|
977
|
+
if (typeof settings.anchor === "string") return !this.#outsideEventsToClose.includes(event.type);
|
|
978
|
+
const resolvedAnchor = this.resolveAnchor(settings.anchor);
|
|
979
|
+
const anchorElement = this.getAnchorElement(resolvedAnchor);
|
|
980
|
+
const isAnchorClick = anchorElement && anchorElement.contains(eventTarget);
|
|
981
|
+
const isRelevantEventType = this.#outsideEventsToClose.includes(event.type);
|
|
982
|
+
return isAnchorClick || !isRelevantEventType;
|
|
983
|
+
}
|
|
984
|
+
unregisterOpenPopup(popup) {
|
|
985
|
+
const index = this.#openPopups.indexOf(popup);
|
|
986
|
+
if (index !== -1) this.#openPopups.splice(index, 1);
|
|
987
|
+
if (this.#openPopups.length === 0) {
|
|
988
|
+
this.#escapeSubscription?.unsubscribe();
|
|
989
|
+
this.#escapeSubscription = null;
|
|
990
|
+
this.#escapeTarget = null;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
static {
|
|
994
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
995
|
+
minVersion: "12.0.0",
|
|
996
|
+
version: "22.2.6",
|
|
997
|
+
ngImport: i0,
|
|
998
|
+
type: PopupService,
|
|
999
|
+
deps: [],
|
|
1000
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
static {
|
|
1004
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1005
|
+
minVersion: "12.0.0",
|
|
1006
|
+
version: "22.2.6",
|
|
1007
|
+
ngImport: i0,
|
|
1008
|
+
type: PopupService,
|
|
1009
|
+
providedIn: "root"
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1014
|
+
minVersion: "12.0.0",
|
|
1015
|
+
version: "22.2.6",
|
|
1016
|
+
ngImport: i0,
|
|
1017
|
+
type: PopupService,
|
|
1018
|
+
decorators: [{
|
|
1019
|
+
type: Injectable,
|
|
1020
|
+
args: [{ providedIn: "root" }]
|
|
1021
|
+
}]
|
|
1022
|
+
});
|
|
1171
1023
|
function resolvePopupLanguage(anchorElement, localeId) {
|
|
1172
|
-
|
|
1173
|
-
return inherited || localeId || null;
|
|
1024
|
+
return anchorElement?.closest("[lang]")?.getAttribute("lang")?.trim() || localeId || null;
|
|
1174
1025
|
}
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1026
|
+
var PopupComponent = class PopupComponent {
|
|
1027
|
+
#destroyRef;
|
|
1028
|
+
#document;
|
|
1029
|
+
#popupService;
|
|
1030
|
+
#eventListenerCleanup$;
|
|
1031
|
+
#popupOpened;
|
|
1032
|
+
constructor() {
|
|
1033
|
+
this.#destroyRef = inject(DestroyRef);
|
|
1034
|
+
this.#document = inject(DOCUMENT);
|
|
1035
|
+
this.#popupService = inject(PopupService);
|
|
1036
|
+
this.#eventListenerCleanup$ = new Subject();
|
|
1037
|
+
this.#popupOpened = false;
|
|
1038
|
+
this.contentTemplate = viewChild.required(TemplateRef, ...ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []);
|
|
1039
|
+
this.popupRef = null;
|
|
1040
|
+
this.anchor = input.required(...ngDevMode ? [{ debugName: "anchor" }] : /* istanbul ignore next */ []);
|
|
1041
|
+
this.anchorConnectionPoint = input("bottomcenter", ...ngDevMode ? [{ debugName: "anchorConnectionPoint" }] : /* istanbul ignore next */ []);
|
|
1042
|
+
this.animation = input(true, ...ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []);
|
|
1043
|
+
this.backdropClass = input([], ...ngDevMode ? [{ debugName: "backdropClass" }] : /* istanbul ignore next */ []);
|
|
1044
|
+
this.close = output();
|
|
1045
|
+
this.closeOnBackdropClick = input(true, {
|
|
1046
|
+
...ngDevMode ? { debugName: "closeOnBackdropClick" } : /* istanbul ignore next */ {},
|
|
1047
|
+
transform: booleanAttribute
|
|
1048
|
+
});
|
|
1049
|
+
this.closeOnEscape = input(true, {
|
|
1050
|
+
...ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {},
|
|
1051
|
+
transform: booleanAttribute
|
|
1052
|
+
});
|
|
1053
|
+
this.closeOnMouseLeave = input(false, {
|
|
1054
|
+
...ngDevMode ? { debugName: "closeOnMouseLeave" } : /* istanbul ignore next */ {},
|
|
1055
|
+
transform: booleanAttribute
|
|
1056
|
+
});
|
|
1057
|
+
this.closeOnOutsideClick = input(true, {
|
|
1058
|
+
...ngDevMode ? { debugName: "closeOnOutsideClick" } : /* istanbul ignore next */ {},
|
|
1059
|
+
transform: booleanAttribute
|
|
1060
|
+
});
|
|
1061
|
+
this.closeOnScroll = input(false, {
|
|
1062
|
+
...ngDevMode ? { debugName: "closeOnScroll" } : /* istanbul ignore next */ {},
|
|
1063
|
+
transform: booleanAttribute
|
|
1064
|
+
});
|
|
1065
|
+
this.data = input(...ngDevMode ? [void 0, { debugName: "data" }] : /* istanbul ignore next */ []);
|
|
1066
|
+
this.hasBackdrop = input(false, {
|
|
1067
|
+
...ngDevMode ? { debugName: "hasBackdrop" } : /* istanbul ignore next */ {},
|
|
1068
|
+
transform: booleanAttribute
|
|
1069
|
+
});
|
|
1070
|
+
this.height = input(...ngDevMode ? [void 0, { debugName: "height" }] : /* istanbul ignore next */ []);
|
|
1071
|
+
this.maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
1072
|
+
this.maxWidth = input(...ngDevMode ? [void 0, { debugName: "maxWidth" }] : /* istanbul ignore next */ []);
|
|
1073
|
+
this.minHeight = input(...ngDevMode ? [void 0, { debugName: "minHeight" }] : /* istanbul ignore next */ []);
|
|
1074
|
+
this.minWidth = input(...ngDevMode ? [void 0, { debugName: "minWidth" }] : /* istanbul ignore next */ []);
|
|
1075
|
+
this.offset = input(...ngDevMode ? [void 0, { debugName: "offset" }] : /* istanbul ignore next */ []);
|
|
1076
|
+
this.open = output();
|
|
1077
|
+
this.popupClass = input([], ...ngDevMode ? [{ debugName: "popupClass" }] : /* istanbul ignore next */ []);
|
|
1078
|
+
this.popupConnectionPoint = input("topcenter", ...ngDevMode ? [{ debugName: "popupConnectionPoint" }] : /* istanbul ignore next */ []);
|
|
1079
|
+
this.popupWrapperClass = input([], ...ngDevMode ? [{ debugName: "popupWrapperClass" }] : /* istanbul ignore next */ []);
|
|
1080
|
+
this.positionStrategy = input("connected", ...ngDevMode ? [{ debugName: "positionStrategy" }] : /* istanbul ignore next */ []);
|
|
1081
|
+
this.positions = input(...ngDevMode ? [void 0, { debugName: "positions" }] : /* istanbul ignore next */ []);
|
|
1082
|
+
this.preventClose = input(...ngDevMode ? [void 0, { debugName: "preventClose" }] : /* istanbul ignore next */ []);
|
|
1083
|
+
this.providers = input([], ...ngDevMode ? [{ debugName: "providers" }] : /* istanbul ignore next */ []);
|
|
1084
|
+
this.restoreFocus = input("auto", {
|
|
1085
|
+
...ngDevMode ? { debugName: "restoreFocus" } : /* istanbul ignore next */ {},
|
|
1086
|
+
transform: (value) => value === "auto" ? "auto" : booleanAttribute(value)
|
|
1087
|
+
});
|
|
1088
|
+
this.trigger = input("click", ...ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []);
|
|
1089
|
+
this.width = input(void 0, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
1090
|
+
this.withPush = input(true, {
|
|
1091
|
+
...ngDevMode ? { debugName: "withPush" } : /* istanbul ignore next */ {},
|
|
1092
|
+
transform: booleanAttribute
|
|
1093
|
+
});
|
|
1094
|
+
this.withScrollTracking = input(true, {
|
|
1095
|
+
...ngDevMode ? { debugName: "withScrollTracking" } : /* istanbul ignore next */ {},
|
|
1096
|
+
transform: booleanAttribute
|
|
1097
|
+
});
|
|
1098
|
+
effect(() => this.setupEventListeners());
|
|
1099
|
+
}
|
|
1100
|
+
closePopup() {
|
|
1101
|
+
this.popupRef?.close();
|
|
1102
|
+
}
|
|
1103
|
+
ngOnDestroy() {
|
|
1104
|
+
this.popupRef?.close();
|
|
1105
|
+
this.#eventListenerCleanup$.next();
|
|
1106
|
+
this.#eventListenerCleanup$.complete();
|
|
1107
|
+
}
|
|
1108
|
+
getPopupWidth() {
|
|
1109
|
+
const width = this.width();
|
|
1110
|
+
if (width != null) return width;
|
|
1111
|
+
const anchor = this.anchor();
|
|
1112
|
+
if (anchor instanceof HTMLElement) return anchor.getBoundingClientRect().width;
|
|
1113
|
+
if (anchor instanceof ElementRef) return anchor.nativeElement.getBoundingClientRect().width;
|
|
1114
|
+
}
|
|
1115
|
+
setupEventListeners() {
|
|
1116
|
+
this.#eventListenerCleanup$.next();
|
|
1117
|
+
const trigger = this.trigger();
|
|
1118
|
+
const anchor = this.anchor();
|
|
1119
|
+
if (!trigger || !anchor) return;
|
|
1120
|
+
let pointAnchor = false;
|
|
1121
|
+
let target;
|
|
1122
|
+
if (anchor instanceof ElementRef) target = anchor.nativeElement;
|
|
1123
|
+
else if (anchor instanceof HTMLElement) target = anchor;
|
|
1124
|
+
else {
|
|
1125
|
+
target = this.#document.body;
|
|
1126
|
+
pointAnchor = true;
|
|
1127
|
+
}
|
|
1128
|
+
fromEvent(target, trigger).pipe(takeUntil(this.#eventListenerCleanup$), takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
1129
|
+
event.preventDefault();
|
|
1130
|
+
if (this.#popupOpened) {
|
|
1131
|
+
this.#popupOpened = false;
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
if (this.popupRef !== null) {
|
|
1135
|
+
this.popupRef.close();
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
const popupSettings = {
|
|
1139
|
+
anchor,
|
|
1140
|
+
anchorConnectionPoint: this.anchorConnectionPoint(),
|
|
1141
|
+
animation: this.animation(),
|
|
1142
|
+
backdropClass: this.backdropClass(),
|
|
1143
|
+
closeOnBackdropClick: this.closeOnBackdropClick(),
|
|
1144
|
+
closeOnEscape: this.closeOnEscape(),
|
|
1145
|
+
closeOnMouseLeave: this.closeOnMouseLeave(),
|
|
1146
|
+
closeOnOutsideClick: this.closeOnOutsideClick(),
|
|
1147
|
+
closeOnScroll: this.closeOnScroll(),
|
|
1148
|
+
content: this.contentTemplate(),
|
|
1149
|
+
data: this.data(),
|
|
1150
|
+
hasBackdrop: this.hasBackdrop(),
|
|
1151
|
+
height: this.height(),
|
|
1152
|
+
maxHeight: this.maxHeight(),
|
|
1153
|
+
maxWidth: this.maxWidth(),
|
|
1154
|
+
minHeight: this.minHeight(),
|
|
1155
|
+
minWidth: this.minWidth(),
|
|
1156
|
+
offset: this.offset(),
|
|
1157
|
+
popupClass: this.popupClass(),
|
|
1158
|
+
popupConnectionPoint: this.popupConnectionPoint(),
|
|
1159
|
+
popupWrapperClass: this.popupWrapperClass(),
|
|
1160
|
+
positionStrategy: this.positionStrategy(),
|
|
1161
|
+
positions: this.positions(),
|
|
1162
|
+
preventClose: this.preventClose(),
|
|
1163
|
+
providers: this.providers(),
|
|
1164
|
+
restoreFocus: this.restoreFocus(),
|
|
1165
|
+
width: this.getPopupWidth(),
|
|
1166
|
+
withPush: this.withPush(),
|
|
1167
|
+
withScrollTracking: this.withScrollTracking()
|
|
1168
|
+
};
|
|
1169
|
+
this.popupRef = this.#popupService.create(popupSettings);
|
|
1170
|
+
this.popupRef.closed.pipe(take(1)).subscribe((result) => {
|
|
1171
|
+
this.popupRef = null;
|
|
1172
|
+
this.close.emit();
|
|
1173
|
+
if (result instanceof PopupCloseEvent) {
|
|
1174
|
+
if (!result.originalEvent) this.#popupOpened = false;
|
|
1175
|
+
else if (result.originalEvent instanceof PointerEvent && result.originalEvent.type === trigger) this.#popupOpened = target instanceof HTMLElement && target.contains(result.originalEvent.target);
|
|
1176
|
+
else if (result.originalEvent instanceof PointerEvent && pointAnchor && result.originalEvent.type !== trigger) this.#popupOpened = false;
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
if (pointAnchor) this.#popupOpened = true;
|
|
1180
|
+
this.open.emit(this.popupRef);
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
static {
|
|
1184
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1185
|
+
minVersion: "12.0.0",
|
|
1186
|
+
version: "22.2.6",
|
|
1187
|
+
ngImport: i0,
|
|
1188
|
+
type: PopupComponent,
|
|
1189
|
+
deps: [],
|
|
1190
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
static {
|
|
1194
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1195
|
+
minVersion: "17.2.0",
|
|
1196
|
+
version: "22.2.6",
|
|
1197
|
+
type: PopupComponent,
|
|
1198
|
+
isStandalone: true,
|
|
1199
|
+
selector: "mona-popup",
|
|
1200
|
+
inputs: {
|
|
1201
|
+
anchor: {
|
|
1202
|
+
classPropertyName: "anchor",
|
|
1203
|
+
publicName: "anchor",
|
|
1204
|
+
isSignal: true,
|
|
1205
|
+
isRequired: true,
|
|
1206
|
+
transformFunction: null
|
|
1207
|
+
},
|
|
1208
|
+
anchorConnectionPoint: {
|
|
1209
|
+
classPropertyName: "anchorConnectionPoint",
|
|
1210
|
+
publicName: "anchorConnectionPoint",
|
|
1211
|
+
isSignal: true,
|
|
1212
|
+
isRequired: false,
|
|
1213
|
+
transformFunction: null
|
|
1214
|
+
},
|
|
1215
|
+
animation: {
|
|
1216
|
+
classPropertyName: "animation",
|
|
1217
|
+
publicName: "animation",
|
|
1218
|
+
isSignal: true,
|
|
1219
|
+
isRequired: false,
|
|
1220
|
+
transformFunction: null
|
|
1221
|
+
},
|
|
1222
|
+
backdropClass: {
|
|
1223
|
+
classPropertyName: "backdropClass",
|
|
1224
|
+
publicName: "backdropClass",
|
|
1225
|
+
isSignal: true,
|
|
1226
|
+
isRequired: false,
|
|
1227
|
+
transformFunction: null
|
|
1228
|
+
},
|
|
1229
|
+
closeOnBackdropClick: {
|
|
1230
|
+
classPropertyName: "closeOnBackdropClick",
|
|
1231
|
+
publicName: "closeOnBackdropClick",
|
|
1232
|
+
isSignal: true,
|
|
1233
|
+
isRequired: false,
|
|
1234
|
+
transformFunction: null
|
|
1235
|
+
},
|
|
1236
|
+
closeOnEscape: {
|
|
1237
|
+
classPropertyName: "closeOnEscape",
|
|
1238
|
+
publicName: "closeOnEscape",
|
|
1239
|
+
isSignal: true,
|
|
1240
|
+
isRequired: false,
|
|
1241
|
+
transformFunction: null
|
|
1242
|
+
},
|
|
1243
|
+
closeOnMouseLeave: {
|
|
1244
|
+
classPropertyName: "closeOnMouseLeave",
|
|
1245
|
+
publicName: "closeOnMouseLeave",
|
|
1246
|
+
isSignal: true,
|
|
1247
|
+
isRequired: false,
|
|
1248
|
+
transformFunction: null
|
|
1249
|
+
},
|
|
1250
|
+
closeOnOutsideClick: {
|
|
1251
|
+
classPropertyName: "closeOnOutsideClick",
|
|
1252
|
+
publicName: "closeOnOutsideClick",
|
|
1253
|
+
isSignal: true,
|
|
1254
|
+
isRequired: false,
|
|
1255
|
+
transformFunction: null
|
|
1256
|
+
},
|
|
1257
|
+
closeOnScroll: {
|
|
1258
|
+
classPropertyName: "closeOnScroll",
|
|
1259
|
+
publicName: "closeOnScroll",
|
|
1260
|
+
isSignal: true,
|
|
1261
|
+
isRequired: false,
|
|
1262
|
+
transformFunction: null
|
|
1263
|
+
},
|
|
1264
|
+
data: {
|
|
1265
|
+
classPropertyName: "data",
|
|
1266
|
+
publicName: "data",
|
|
1267
|
+
isSignal: true,
|
|
1268
|
+
isRequired: false,
|
|
1269
|
+
transformFunction: null
|
|
1270
|
+
},
|
|
1271
|
+
hasBackdrop: {
|
|
1272
|
+
classPropertyName: "hasBackdrop",
|
|
1273
|
+
publicName: "hasBackdrop",
|
|
1274
|
+
isSignal: true,
|
|
1275
|
+
isRequired: false,
|
|
1276
|
+
transformFunction: null
|
|
1277
|
+
},
|
|
1278
|
+
height: {
|
|
1279
|
+
classPropertyName: "height",
|
|
1280
|
+
publicName: "height",
|
|
1281
|
+
isSignal: true,
|
|
1282
|
+
isRequired: false,
|
|
1283
|
+
transformFunction: null
|
|
1284
|
+
},
|
|
1285
|
+
maxHeight: {
|
|
1286
|
+
classPropertyName: "maxHeight",
|
|
1287
|
+
publicName: "maxHeight",
|
|
1288
|
+
isSignal: true,
|
|
1289
|
+
isRequired: false,
|
|
1290
|
+
transformFunction: null
|
|
1291
|
+
},
|
|
1292
|
+
maxWidth: {
|
|
1293
|
+
classPropertyName: "maxWidth",
|
|
1294
|
+
publicName: "maxWidth",
|
|
1295
|
+
isSignal: true,
|
|
1296
|
+
isRequired: false,
|
|
1297
|
+
transformFunction: null
|
|
1298
|
+
},
|
|
1299
|
+
minHeight: {
|
|
1300
|
+
classPropertyName: "minHeight",
|
|
1301
|
+
publicName: "minHeight",
|
|
1302
|
+
isSignal: true,
|
|
1303
|
+
isRequired: false,
|
|
1304
|
+
transformFunction: null
|
|
1305
|
+
},
|
|
1306
|
+
minWidth: {
|
|
1307
|
+
classPropertyName: "minWidth",
|
|
1308
|
+
publicName: "minWidth",
|
|
1309
|
+
isSignal: true,
|
|
1310
|
+
isRequired: false,
|
|
1311
|
+
transformFunction: null
|
|
1312
|
+
},
|
|
1313
|
+
offset: {
|
|
1314
|
+
classPropertyName: "offset",
|
|
1315
|
+
publicName: "offset",
|
|
1316
|
+
isSignal: true,
|
|
1317
|
+
isRequired: false,
|
|
1318
|
+
transformFunction: null
|
|
1319
|
+
},
|
|
1320
|
+
popupClass: {
|
|
1321
|
+
classPropertyName: "popupClass",
|
|
1322
|
+
publicName: "popupClass",
|
|
1323
|
+
isSignal: true,
|
|
1324
|
+
isRequired: false,
|
|
1325
|
+
transformFunction: null
|
|
1326
|
+
},
|
|
1327
|
+
popupConnectionPoint: {
|
|
1328
|
+
classPropertyName: "popupConnectionPoint",
|
|
1329
|
+
publicName: "popupConnectionPoint",
|
|
1330
|
+
isSignal: true,
|
|
1331
|
+
isRequired: false,
|
|
1332
|
+
transformFunction: null
|
|
1333
|
+
},
|
|
1334
|
+
popupWrapperClass: {
|
|
1335
|
+
classPropertyName: "popupWrapperClass",
|
|
1336
|
+
publicName: "popupWrapperClass",
|
|
1337
|
+
isSignal: true,
|
|
1338
|
+
isRequired: false,
|
|
1339
|
+
transformFunction: null
|
|
1340
|
+
},
|
|
1341
|
+
positionStrategy: {
|
|
1342
|
+
classPropertyName: "positionStrategy",
|
|
1343
|
+
publicName: "positionStrategy",
|
|
1344
|
+
isSignal: true,
|
|
1345
|
+
isRequired: false,
|
|
1346
|
+
transformFunction: null
|
|
1347
|
+
},
|
|
1348
|
+
positions: {
|
|
1349
|
+
classPropertyName: "positions",
|
|
1350
|
+
publicName: "positions",
|
|
1351
|
+
isSignal: true,
|
|
1352
|
+
isRequired: false,
|
|
1353
|
+
transformFunction: null
|
|
1354
|
+
},
|
|
1355
|
+
preventClose: {
|
|
1356
|
+
classPropertyName: "preventClose",
|
|
1357
|
+
publicName: "preventClose",
|
|
1358
|
+
isSignal: true,
|
|
1359
|
+
isRequired: false,
|
|
1360
|
+
transformFunction: null
|
|
1361
|
+
},
|
|
1362
|
+
providers: {
|
|
1363
|
+
classPropertyName: "providers",
|
|
1364
|
+
publicName: "providers",
|
|
1365
|
+
isSignal: true,
|
|
1366
|
+
isRequired: false,
|
|
1367
|
+
transformFunction: null
|
|
1368
|
+
},
|
|
1369
|
+
restoreFocus: {
|
|
1370
|
+
classPropertyName: "restoreFocus",
|
|
1371
|
+
publicName: "restoreFocus",
|
|
1372
|
+
isSignal: true,
|
|
1373
|
+
isRequired: false,
|
|
1374
|
+
transformFunction: null
|
|
1375
|
+
},
|
|
1376
|
+
trigger: {
|
|
1377
|
+
classPropertyName: "trigger",
|
|
1378
|
+
publicName: "trigger",
|
|
1379
|
+
isSignal: true,
|
|
1380
|
+
isRequired: false,
|
|
1381
|
+
transformFunction: null
|
|
1382
|
+
},
|
|
1383
|
+
width: {
|
|
1384
|
+
classPropertyName: "width",
|
|
1385
|
+
publicName: "width",
|
|
1386
|
+
isSignal: true,
|
|
1387
|
+
isRequired: false,
|
|
1388
|
+
transformFunction: null
|
|
1389
|
+
},
|
|
1390
|
+
withPush: {
|
|
1391
|
+
classPropertyName: "withPush",
|
|
1392
|
+
publicName: "withPush",
|
|
1393
|
+
isSignal: true,
|
|
1394
|
+
isRequired: false,
|
|
1395
|
+
transformFunction: null
|
|
1396
|
+
},
|
|
1397
|
+
withScrollTracking: {
|
|
1398
|
+
classPropertyName: "withScrollTracking",
|
|
1399
|
+
publicName: "withScrollTracking",
|
|
1400
|
+
isSignal: true,
|
|
1401
|
+
isRequired: false,
|
|
1402
|
+
transformFunction: null
|
|
1403
|
+
}
|
|
1404
|
+
},
|
|
1405
|
+
outputs: {
|
|
1406
|
+
close: "close",
|
|
1407
|
+
open: "open"
|
|
1408
|
+
},
|
|
1409
|
+
viewQueries: [{
|
|
1410
|
+
propertyName: "contentTemplate",
|
|
1411
|
+
first: true,
|
|
1412
|
+
predicate: TemplateRef,
|
|
1413
|
+
descendants: true,
|
|
1414
|
+
isSignal: true
|
|
1415
|
+
}],
|
|
1416
|
+
ngImport: i0,
|
|
1417
|
+
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n"
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1421
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1422
|
+
minVersion: "12.0.0",
|
|
1423
|
+
version: "22.2.6",
|
|
1424
|
+
ngImport: i0,
|
|
1425
|
+
type: PopupComponent,
|
|
1426
|
+
decorators: [{
|
|
1427
|
+
type: Component,
|
|
1428
|
+
args: [{
|
|
1429
|
+
selector: "mona-popup",
|
|
1430
|
+
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n"
|
|
1431
|
+
}]
|
|
1432
|
+
}],
|
|
1433
|
+
ctorParameters: () => [],
|
|
1434
|
+
propDecorators: {
|
|
1435
|
+
contentTemplate: [{
|
|
1436
|
+
type: i0.ViewChild,
|
|
1437
|
+
args: [i0.forwardRef(() => TemplateRef), { isSignal: true }]
|
|
1438
|
+
}],
|
|
1439
|
+
anchor: [{
|
|
1440
|
+
type: i0.Input,
|
|
1441
|
+
args: [{
|
|
1442
|
+
isSignal: true,
|
|
1443
|
+
alias: "anchor",
|
|
1444
|
+
required: true
|
|
1445
|
+
}]
|
|
1446
|
+
}],
|
|
1447
|
+
anchorConnectionPoint: [{
|
|
1448
|
+
type: i0.Input,
|
|
1449
|
+
args: [{
|
|
1450
|
+
isSignal: true,
|
|
1451
|
+
alias: "anchorConnectionPoint",
|
|
1452
|
+
required: false
|
|
1453
|
+
}]
|
|
1454
|
+
}],
|
|
1455
|
+
animation: [{
|
|
1456
|
+
type: i0.Input,
|
|
1457
|
+
args: [{
|
|
1458
|
+
isSignal: true,
|
|
1459
|
+
alias: "animation",
|
|
1460
|
+
required: false
|
|
1461
|
+
}]
|
|
1462
|
+
}],
|
|
1463
|
+
backdropClass: [{
|
|
1464
|
+
type: i0.Input,
|
|
1465
|
+
args: [{
|
|
1466
|
+
isSignal: true,
|
|
1467
|
+
alias: "backdropClass",
|
|
1468
|
+
required: false
|
|
1469
|
+
}]
|
|
1470
|
+
}],
|
|
1471
|
+
close: [{
|
|
1472
|
+
type: i0.Output,
|
|
1473
|
+
args: ["close"]
|
|
1474
|
+
}],
|
|
1475
|
+
closeOnBackdropClick: [{
|
|
1476
|
+
type: i0.Input,
|
|
1477
|
+
args: [{
|
|
1478
|
+
isSignal: true,
|
|
1479
|
+
alias: "closeOnBackdropClick",
|
|
1480
|
+
required: false
|
|
1481
|
+
}]
|
|
1482
|
+
}],
|
|
1483
|
+
closeOnEscape: [{
|
|
1484
|
+
type: i0.Input,
|
|
1485
|
+
args: [{
|
|
1486
|
+
isSignal: true,
|
|
1487
|
+
alias: "closeOnEscape",
|
|
1488
|
+
required: false
|
|
1489
|
+
}]
|
|
1490
|
+
}],
|
|
1491
|
+
closeOnMouseLeave: [{
|
|
1492
|
+
type: i0.Input,
|
|
1493
|
+
args: [{
|
|
1494
|
+
isSignal: true,
|
|
1495
|
+
alias: "closeOnMouseLeave",
|
|
1496
|
+
required: false
|
|
1497
|
+
}]
|
|
1498
|
+
}],
|
|
1499
|
+
closeOnOutsideClick: [{
|
|
1500
|
+
type: i0.Input,
|
|
1501
|
+
args: [{
|
|
1502
|
+
isSignal: true,
|
|
1503
|
+
alias: "closeOnOutsideClick",
|
|
1504
|
+
required: false
|
|
1505
|
+
}]
|
|
1506
|
+
}],
|
|
1507
|
+
closeOnScroll: [{
|
|
1508
|
+
type: i0.Input,
|
|
1509
|
+
args: [{
|
|
1510
|
+
isSignal: true,
|
|
1511
|
+
alias: "closeOnScroll",
|
|
1512
|
+
required: false
|
|
1513
|
+
}]
|
|
1514
|
+
}],
|
|
1515
|
+
data: [{
|
|
1516
|
+
type: i0.Input,
|
|
1517
|
+
args: [{
|
|
1518
|
+
isSignal: true,
|
|
1519
|
+
alias: "data",
|
|
1520
|
+
required: false
|
|
1521
|
+
}]
|
|
1522
|
+
}],
|
|
1523
|
+
hasBackdrop: [{
|
|
1524
|
+
type: i0.Input,
|
|
1525
|
+
args: [{
|
|
1526
|
+
isSignal: true,
|
|
1527
|
+
alias: "hasBackdrop",
|
|
1528
|
+
required: false
|
|
1529
|
+
}]
|
|
1530
|
+
}],
|
|
1531
|
+
height: [{
|
|
1532
|
+
type: i0.Input,
|
|
1533
|
+
args: [{
|
|
1534
|
+
isSignal: true,
|
|
1535
|
+
alias: "height",
|
|
1536
|
+
required: false
|
|
1537
|
+
}]
|
|
1538
|
+
}],
|
|
1539
|
+
maxHeight: [{
|
|
1540
|
+
type: i0.Input,
|
|
1541
|
+
args: [{
|
|
1542
|
+
isSignal: true,
|
|
1543
|
+
alias: "maxHeight",
|
|
1544
|
+
required: false
|
|
1545
|
+
}]
|
|
1546
|
+
}],
|
|
1547
|
+
maxWidth: [{
|
|
1548
|
+
type: i0.Input,
|
|
1549
|
+
args: [{
|
|
1550
|
+
isSignal: true,
|
|
1551
|
+
alias: "maxWidth",
|
|
1552
|
+
required: false
|
|
1553
|
+
}]
|
|
1554
|
+
}],
|
|
1555
|
+
minHeight: [{
|
|
1556
|
+
type: i0.Input,
|
|
1557
|
+
args: [{
|
|
1558
|
+
isSignal: true,
|
|
1559
|
+
alias: "minHeight",
|
|
1560
|
+
required: false
|
|
1561
|
+
}]
|
|
1562
|
+
}],
|
|
1563
|
+
minWidth: [{
|
|
1564
|
+
type: i0.Input,
|
|
1565
|
+
args: [{
|
|
1566
|
+
isSignal: true,
|
|
1567
|
+
alias: "minWidth",
|
|
1568
|
+
required: false
|
|
1569
|
+
}]
|
|
1570
|
+
}],
|
|
1571
|
+
offset: [{
|
|
1572
|
+
type: i0.Input,
|
|
1573
|
+
args: [{
|
|
1574
|
+
isSignal: true,
|
|
1575
|
+
alias: "offset",
|
|
1576
|
+
required: false
|
|
1577
|
+
}]
|
|
1578
|
+
}],
|
|
1579
|
+
open: [{
|
|
1580
|
+
type: i0.Output,
|
|
1581
|
+
args: ["open"]
|
|
1582
|
+
}],
|
|
1583
|
+
popupClass: [{
|
|
1584
|
+
type: i0.Input,
|
|
1585
|
+
args: [{
|
|
1586
|
+
isSignal: true,
|
|
1587
|
+
alias: "popupClass",
|
|
1588
|
+
required: false
|
|
1589
|
+
}]
|
|
1590
|
+
}],
|
|
1591
|
+
popupConnectionPoint: [{
|
|
1592
|
+
type: i0.Input,
|
|
1593
|
+
args: [{
|
|
1594
|
+
isSignal: true,
|
|
1595
|
+
alias: "popupConnectionPoint",
|
|
1596
|
+
required: false
|
|
1597
|
+
}]
|
|
1598
|
+
}],
|
|
1599
|
+
popupWrapperClass: [{
|
|
1600
|
+
type: i0.Input,
|
|
1601
|
+
args: [{
|
|
1602
|
+
isSignal: true,
|
|
1603
|
+
alias: "popupWrapperClass",
|
|
1604
|
+
required: false
|
|
1605
|
+
}]
|
|
1606
|
+
}],
|
|
1607
|
+
positionStrategy: [{
|
|
1608
|
+
type: i0.Input,
|
|
1609
|
+
args: [{
|
|
1610
|
+
isSignal: true,
|
|
1611
|
+
alias: "positionStrategy",
|
|
1612
|
+
required: false
|
|
1613
|
+
}]
|
|
1614
|
+
}],
|
|
1615
|
+
positions: [{
|
|
1616
|
+
type: i0.Input,
|
|
1617
|
+
args: [{
|
|
1618
|
+
isSignal: true,
|
|
1619
|
+
alias: "positions",
|
|
1620
|
+
required: false
|
|
1621
|
+
}]
|
|
1622
|
+
}],
|
|
1623
|
+
preventClose: [{
|
|
1624
|
+
type: i0.Input,
|
|
1625
|
+
args: [{
|
|
1626
|
+
isSignal: true,
|
|
1627
|
+
alias: "preventClose",
|
|
1628
|
+
required: false
|
|
1629
|
+
}]
|
|
1630
|
+
}],
|
|
1631
|
+
providers: [{
|
|
1632
|
+
type: i0.Input,
|
|
1633
|
+
args: [{
|
|
1634
|
+
isSignal: true,
|
|
1635
|
+
alias: "providers",
|
|
1636
|
+
required: false
|
|
1637
|
+
}]
|
|
1638
|
+
}],
|
|
1639
|
+
restoreFocus: [{
|
|
1640
|
+
type: i0.Input,
|
|
1641
|
+
args: [{
|
|
1642
|
+
isSignal: true,
|
|
1643
|
+
alias: "restoreFocus",
|
|
1644
|
+
required: false
|
|
1645
|
+
}]
|
|
1646
|
+
}],
|
|
1647
|
+
trigger: [{
|
|
1648
|
+
type: i0.Input,
|
|
1649
|
+
args: [{
|
|
1650
|
+
isSignal: true,
|
|
1651
|
+
alias: "trigger",
|
|
1652
|
+
required: false
|
|
1653
|
+
}]
|
|
1654
|
+
}],
|
|
1655
|
+
width: [{
|
|
1656
|
+
type: i0.Input,
|
|
1657
|
+
args: [{
|
|
1658
|
+
isSignal: true,
|
|
1659
|
+
alias: "width",
|
|
1660
|
+
required: false
|
|
1661
|
+
}]
|
|
1662
|
+
}],
|
|
1663
|
+
withPush: [{
|
|
1664
|
+
type: i0.Input,
|
|
1665
|
+
args: [{
|
|
1666
|
+
isSignal: true,
|
|
1667
|
+
alias: "withPush",
|
|
1668
|
+
required: false
|
|
1669
|
+
}]
|
|
1670
|
+
}],
|
|
1671
|
+
withScrollTracking: [{
|
|
1672
|
+
type: i0.Input,
|
|
1673
|
+
args: [{
|
|
1674
|
+
isSignal: true,
|
|
1675
|
+
alias: "withScrollTracking",
|
|
1676
|
+
required: false
|
|
1677
|
+
}]
|
|
1678
|
+
}]
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1480
1681
|
export { PopupCloseEvent, PopupCloseSource, PopupComponent, PopupDataInjectionToken, PopupRef, PopupService, defaultPopupAnimation, dropdownPopupAnimation, fadePopupAnimation, slideFromBottomPopupAnimation, slideFromLeftPopupAnimation, slideFromRightPopupAnimation, slideFromTopPopupAnimation };
|
|
1481
|
-
|
|
1682
|
+
|
|
1683
|
+
//# sourceMappingURL=nanahoshi-mona-ui-popup.mjs.map
|