@nanahoshi/mona-ui 0.27.2 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/chart.md +2 -2
- package/docs/api/locales.md +8 -0
- package/docs/api/popup.md +1 -1
- package/docs/api/theme.md +2 -2
- package/docs/chart.md +14 -0
- package/docs/editor.md +2 -0
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2071 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +599 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +61 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +7 -3
- package/locales/pl-pl/package.json +4 -0
- package/locales/pl-pl/pl-pl.messages.json +536 -0
- package/package.json +66 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +354 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +540 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +18 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,574 +1,797 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { takeUntilDestroyed } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { CdkTrapFocus } from
|
|
9
|
-
import { NgTemplateOutlet } from
|
|
10
|
-
import {
|
|
11
|
-
import { ButtonDirective } from
|
|
12
|
-
import { MonaI18nService, mergeMessages } from
|
|
13
|
-
import { cva } from
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, NgZone, Pipe, TemplateRef, ViewContainerRef, afterNextRender, computed, contentChild, effect, forwardRef, inject, input, isDevMode, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
4
|
+
import { createElementControlId, focusElement, inertOutside, positionGlobalOverlay, themeOverlaySurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
5
|
+
import { PopupCloseEvent, PopupCloseSource, PopupDataInjectionToken, PopupService } from "@nanahoshi/mona-ui/popup";
|
|
6
|
+
import { ReplaySubject, Subject, asapScheduler, fromEvent, map, merge, take, takeUntil } from "rxjs";
|
|
7
|
+
import * as i1 from "@angular/cdk/a11y";
|
|
8
|
+
import { CdkTrapFocus } from "@angular/cdk/a11y";
|
|
9
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
10
|
+
import { LucideAppWindow, LucideDynamicIcon, LucideMaximize, LucideMinimize, LucideMinus, LucideX } from "@lucide/angular";
|
|
11
|
+
import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
12
|
+
import { MonaI18nService, mergeMessages } from "@nanahoshi/mona-ui/i18n";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
var WindowActionTemplateDirective = class WindowActionTemplateDirective {
|
|
15
|
+
static {
|
|
16
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
17
|
+
minVersion: "12.0.0",
|
|
18
|
+
version: "22.2.6",
|
|
19
|
+
ngImport: i0,
|
|
20
|
+
type: WindowActionTemplateDirective,
|
|
21
|
+
deps: [],
|
|
22
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
static {
|
|
26
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
27
|
+
minVersion: "14.0.0",
|
|
28
|
+
version: "22.2.6",
|
|
29
|
+
type: WindowActionTemplateDirective,
|
|
30
|
+
isStandalone: true,
|
|
31
|
+
selector: "ng-template[monaWindowActionTemplate]",
|
|
32
|
+
ngImport: i0
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
37
|
+
minVersion: "12.0.0",
|
|
38
|
+
version: "22.2.6",
|
|
39
|
+
ngImport: i0,
|
|
40
|
+
type: WindowActionTemplateDirective,
|
|
41
|
+
decorators: [{
|
|
42
|
+
type: Directive,
|
|
43
|
+
args: [{ selector: "ng-template[monaWindowActionTemplate]" }]
|
|
44
|
+
}]
|
|
45
|
+
});
|
|
46
|
+
var WindowContentTemplateDirective = class WindowContentTemplateDirective {
|
|
47
|
+
static {
|
|
48
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
49
|
+
minVersion: "12.0.0",
|
|
50
|
+
version: "22.2.6",
|
|
51
|
+
ngImport: i0,
|
|
52
|
+
type: WindowContentTemplateDirective,
|
|
53
|
+
deps: [],
|
|
54
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
static {
|
|
58
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
59
|
+
minVersion: "14.0.0",
|
|
60
|
+
version: "22.2.6",
|
|
61
|
+
type: WindowContentTemplateDirective,
|
|
62
|
+
isStandalone: true,
|
|
63
|
+
selector: "ng-template[monaWindowContentTemplate]",
|
|
64
|
+
ngImport: i0
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "22.2.6",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: WindowContentTemplateDirective,
|
|
73
|
+
decorators: [{
|
|
74
|
+
type: Directive,
|
|
75
|
+
args: [{ selector: "ng-template[monaWindowContentTemplate]" }]
|
|
76
|
+
}]
|
|
77
|
+
});
|
|
78
|
+
var WindowFooterTemplateDirective = class WindowFooterTemplateDirective {
|
|
79
|
+
static {
|
|
80
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
81
|
+
minVersion: "12.0.0",
|
|
82
|
+
version: "22.2.6",
|
|
83
|
+
ngImport: i0,
|
|
84
|
+
type: WindowFooterTemplateDirective,
|
|
85
|
+
deps: [],
|
|
86
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
static {
|
|
90
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
91
|
+
minVersion: "14.0.0",
|
|
92
|
+
version: "22.2.6",
|
|
93
|
+
type: WindowFooterTemplateDirective,
|
|
94
|
+
isStandalone: true,
|
|
95
|
+
selector: "ng-template[monaWindowFooterTemplate]",
|
|
96
|
+
ngImport: i0
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
101
|
+
minVersion: "12.0.0",
|
|
102
|
+
version: "22.2.6",
|
|
103
|
+
ngImport: i0,
|
|
104
|
+
type: WindowFooterTemplateDirective,
|
|
105
|
+
decorators: [{
|
|
106
|
+
type: Directive,
|
|
107
|
+
args: [{ selector: "ng-template[monaWindowFooterTemplate]" }]
|
|
108
|
+
}]
|
|
109
|
+
});
|
|
110
|
+
var WindowTitleTemplateDirective = class WindowTitleTemplateDirective {
|
|
111
|
+
static {
|
|
112
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
113
|
+
minVersion: "12.0.0",
|
|
114
|
+
version: "22.2.6",
|
|
115
|
+
ngImport: i0,
|
|
116
|
+
type: WindowTitleTemplateDirective,
|
|
117
|
+
deps: [],
|
|
118
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
static {
|
|
122
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
123
|
+
minVersion: "14.0.0",
|
|
124
|
+
version: "22.2.6",
|
|
125
|
+
type: WindowTitleTemplateDirective,
|
|
126
|
+
isStandalone: true,
|
|
127
|
+
selector: "ng-template[monaWindowTitleTemplate]",
|
|
128
|
+
ngImport: i0
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
133
|
+
minVersion: "12.0.0",
|
|
134
|
+
version: "22.2.6",
|
|
135
|
+
ngImport: i0,
|
|
136
|
+
type: WindowTitleTemplateDirective,
|
|
137
|
+
decorators: [{
|
|
138
|
+
type: Directive,
|
|
139
|
+
args: [{ selector: "ng-template[monaWindowTitleTemplate]" }]
|
|
140
|
+
}]
|
|
141
|
+
});
|
|
64
142
|
const KEYBOARD_STEP = 10;
|
|
65
143
|
const KEYBOARD_STEP_FINE = 1;
|
|
66
|
-
/** How far the pointer travels before a press on the title bar becomes a drag, so a click or double-click isn't. */
|
|
67
144
|
const DRAG_THRESHOLD = 3;
|
|
68
|
-
/** Controls inside the title bar (its buttons, an action template) that take the pointer and keys themselves. */
|
|
69
145
|
const INTERACTIVE$1 = "a[href], button, input, select, textarea, [contenteditable]:not([contenteditable='false']), [tabindex]";
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
146
|
+
var WindowDragHandlerDirective = class WindowDragHandlerDirective {
|
|
147
|
+
#destroyRef;
|
|
148
|
+
#document;
|
|
149
|
+
#hostElementRef;
|
|
150
|
+
#zone;
|
|
151
|
+
#activeCleanup;
|
|
152
|
+
constructor() {
|
|
153
|
+
this.#destroyRef = inject(DestroyRef);
|
|
154
|
+
this.#document = inject(DOCUMENT);
|
|
155
|
+
this.#hostElementRef = inject(ElementRef);
|
|
156
|
+
this.#zone = inject(NgZone);
|
|
157
|
+
this.draggable = input(true, ...ngDevMode ? [{ debugName: "draggable" }] : /* istanbul ignore next */ []);
|
|
158
|
+
this.maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
159
|
+
this.maxWidth = input(...ngDevMode ? [void 0, { debugName: "maxWidth" }] : /* istanbul ignore next */ []);
|
|
160
|
+
this.minHeight = input(...ngDevMode ? [void 0, { debugName: "minHeight" }] : /* istanbul ignore next */ []);
|
|
161
|
+
this.minWidth = input(...ngDevMode ? [void 0, { debugName: "minWidth" }] : /* istanbul ignore next */ []);
|
|
162
|
+
this.resizable = input(false, ...ngDevMode ? [{ debugName: "resizable" }] : /* istanbul ignore next */ []);
|
|
163
|
+
this.windowRef = input.required(...ngDevMode ? [{ debugName: "windowRef" }] : /* istanbul ignore next */ []);
|
|
164
|
+
afterNextRender({ write: () => this.#setEvents() });
|
|
165
|
+
this.#destroyRef.onDestroy(() => this.#activeCleanup?.());
|
|
166
|
+
}
|
|
167
|
+
onKeydown(event) {
|
|
168
|
+
if (event.target !== this.#hostElementRef.nativeElement || event.altKey) return;
|
|
169
|
+
const delta = {
|
|
170
|
+
ArrowDown: [0, 1],
|
|
171
|
+
ArrowLeft: [-1, 0],
|
|
172
|
+
ArrowRight: [1, 0],
|
|
173
|
+
ArrowUp: [0, -1]
|
|
174
|
+
}[event.key];
|
|
175
|
+
if (!delta) return;
|
|
176
|
+
const step = event.shiftKey ? KEYBOARD_STEP_FINE : KEYBOARD_STEP;
|
|
177
|
+
const [deltaX, deltaY] = [delta[0] * step, delta[1] * step];
|
|
178
|
+
if (event.ctrlKey || event.metaKey ? this.#resizeBy(deltaX, deltaY) : this.#moveBy(deltaX, deltaY)) event.preventDefault();
|
|
179
|
+
}
|
|
180
|
+
#moveBy(deltaX, deltaY) {
|
|
181
|
+
if (!this.draggable()) return false;
|
|
182
|
+
const windowRef = this.windowRef();
|
|
183
|
+
const rect = windowRef.element.getBoundingClientRect();
|
|
184
|
+
const { innerHeight, innerWidth } = this.#viewport();
|
|
185
|
+
const left = Math.round(Math.min(Math.max(0, rect.left + deltaX), Math.max(0, innerWidth - rect.width)));
|
|
186
|
+
const top = Math.round(Math.min(Math.max(0, rect.top + deltaY), Math.max(0, innerHeight - rect.height)));
|
|
187
|
+
windowRef.moveStart$$.next();
|
|
188
|
+
windowRef.move({
|
|
189
|
+
left,
|
|
190
|
+
top
|
|
191
|
+
});
|
|
192
|
+
windowRef.move$$.next({
|
|
193
|
+
left,
|
|
194
|
+
top
|
|
195
|
+
});
|
|
196
|
+
windowRef.moveEnd$$.next();
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
#onPointerDown(event) {
|
|
200
|
+
if (!this.draggable() || event.button !== 0 || !event.isPrimary) return;
|
|
201
|
+
const host = this.#hostElementRef.nativeElement;
|
|
202
|
+
const target = event.target instanceof Element ? event.target.closest(INTERACTIVE$1) : null;
|
|
203
|
+
if (target && target !== host && host.contains(target)) return;
|
|
204
|
+
const windowRef = this.windowRef();
|
|
205
|
+
const rect = windowRef.element.getBoundingClientRect();
|
|
206
|
+
const { innerHeight, innerWidth } = this.#viewport();
|
|
207
|
+
const pointerId = event.pointerId;
|
|
208
|
+
const initialX = event.clientX;
|
|
209
|
+
const initialY = event.clientY;
|
|
210
|
+
let dragging = false;
|
|
211
|
+
const onPointerMove = (moveEvent) => {
|
|
212
|
+
if (moveEvent.pointerId !== pointerId) return;
|
|
213
|
+
const deltaX = moveEvent.clientX - initialX;
|
|
214
|
+
const deltaY = moveEvent.clientY - initialY;
|
|
215
|
+
if (!dragging) {
|
|
216
|
+
if (Math.hypot(deltaX, deltaY) < DRAG_THRESHOLD) return;
|
|
217
|
+
dragging = true;
|
|
218
|
+
windowRef.moveStart$$.next();
|
|
219
|
+
}
|
|
220
|
+
if (moveEvent.clientX < 0 || moveEvent.clientX > innerWidth || moveEvent.clientY < 0 || moveEvent.clientY > innerHeight) return;
|
|
221
|
+
const top = Math.max(0, Math.round(rect.top + deltaY));
|
|
222
|
+
const left = Math.round(rect.left + deltaX);
|
|
223
|
+
windowRef.move({
|
|
224
|
+
left,
|
|
225
|
+
top
|
|
226
|
+
});
|
|
227
|
+
windowRef.move$$.next({
|
|
228
|
+
left,
|
|
229
|
+
top
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
const cleanup = () => {
|
|
233
|
+
this.#document.removeEventListener("pointermove", onPointerMove);
|
|
234
|
+
this.#document.removeEventListener("pointerup", onPointerEnd);
|
|
235
|
+
this.#document.removeEventListener("pointercancel", onPointerEnd);
|
|
236
|
+
if (host.hasPointerCapture?.(pointerId)) host.releasePointerCapture(pointerId);
|
|
237
|
+
this.#activeCleanup = void 0;
|
|
238
|
+
};
|
|
239
|
+
const onPointerEnd = (endEvent) => {
|
|
240
|
+
if (endEvent.pointerId !== pointerId) return;
|
|
241
|
+
cleanup();
|
|
242
|
+
if (dragging) {
|
|
243
|
+
dragging = false;
|
|
244
|
+
windowRef.moveEnd$$.next();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
this.#activeCleanup?.();
|
|
248
|
+
this.#activeCleanup = cleanup;
|
|
249
|
+
try {
|
|
250
|
+
host.setPointerCapture?.(pointerId);
|
|
251
|
+
} catch {}
|
|
252
|
+
this.#document.addEventListener("pointermove", onPointerMove);
|
|
253
|
+
this.#document.addEventListener("pointerup", onPointerEnd);
|
|
254
|
+
this.#document.addEventListener("pointercancel", onPointerEnd);
|
|
255
|
+
}
|
|
256
|
+
#resizeBy(deltaX, deltaY) {
|
|
257
|
+
if (!this.resizable()) return false;
|
|
258
|
+
const windowRef = this.windowRef();
|
|
259
|
+
const rect = windowRef.element.getBoundingClientRect();
|
|
260
|
+
const { innerHeight, innerWidth } = this.#viewport();
|
|
261
|
+
const clamp = (value, min, max) => Math.round(Math.max(min, Math.min(value, max)));
|
|
262
|
+
const minWidth = this.minWidth() ?? 50;
|
|
263
|
+
const minHeight = this.minHeight() ?? 50;
|
|
264
|
+
const maxWidth = Math.max(minWidth, Math.min(this.maxWidth() ?? innerWidth, innerWidth - rect.left));
|
|
265
|
+
const maxHeight = Math.max(minHeight, Math.min(this.maxHeight() ?? innerHeight, innerHeight - rect.top));
|
|
266
|
+
const width = deltaX === 0 ? Math.round(rect.width) : clamp(rect.width + deltaX, minWidth, maxWidth);
|
|
267
|
+
const height = deltaY === 0 ? Math.round(rect.height) : clamp(rect.height + deltaY, minHeight, maxHeight);
|
|
268
|
+
const left = Math.round(rect.left);
|
|
269
|
+
const top = Math.round(rect.top);
|
|
270
|
+
windowRef.move({
|
|
271
|
+
left,
|
|
272
|
+
top
|
|
273
|
+
});
|
|
274
|
+
windowRef.resize({
|
|
275
|
+
height,
|
|
276
|
+
width
|
|
277
|
+
});
|
|
278
|
+
windowRef.resize$$.next({
|
|
279
|
+
height,
|
|
280
|
+
left,
|
|
281
|
+
top,
|
|
282
|
+
width
|
|
283
|
+
});
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
#setEvents() {
|
|
287
|
+
this.#zone.runOutsideAngular(() => {
|
|
288
|
+
fromEvent(this.#hostElementRef.nativeElement, "pointerdown").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.#onPointerDown(event));
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
#viewport() {
|
|
292
|
+
const view = this.#document.defaultView;
|
|
293
|
+
return {
|
|
294
|
+
innerHeight: view?.innerHeight || 800,
|
|
295
|
+
innerWidth: view?.innerWidth || 1200
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
static {
|
|
299
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
300
|
+
minVersion: "12.0.0",
|
|
301
|
+
version: "22.2.6",
|
|
302
|
+
ngImport: i0,
|
|
303
|
+
type: WindowDragHandlerDirective,
|
|
304
|
+
deps: [],
|
|
305
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
static {
|
|
309
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
310
|
+
minVersion: "17.1.0",
|
|
311
|
+
version: "22.2.6",
|
|
312
|
+
type: WindowDragHandlerDirective,
|
|
313
|
+
isStandalone: true,
|
|
314
|
+
selector: "div[monaWindowDragHandler]",
|
|
315
|
+
inputs: {
|
|
316
|
+
draggable: {
|
|
317
|
+
classPropertyName: "draggable",
|
|
318
|
+
publicName: "draggable",
|
|
319
|
+
isSignal: true,
|
|
320
|
+
isRequired: false,
|
|
321
|
+
transformFunction: null
|
|
322
|
+
},
|
|
323
|
+
maxHeight: {
|
|
324
|
+
classPropertyName: "maxHeight",
|
|
325
|
+
publicName: "maxHeight",
|
|
326
|
+
isSignal: true,
|
|
327
|
+
isRequired: false,
|
|
328
|
+
transformFunction: null
|
|
329
|
+
},
|
|
330
|
+
maxWidth: {
|
|
331
|
+
classPropertyName: "maxWidth",
|
|
332
|
+
publicName: "maxWidth",
|
|
333
|
+
isSignal: true,
|
|
334
|
+
isRequired: false,
|
|
335
|
+
transformFunction: null
|
|
336
|
+
},
|
|
337
|
+
minHeight: {
|
|
338
|
+
classPropertyName: "minHeight",
|
|
339
|
+
publicName: "minHeight",
|
|
340
|
+
isSignal: true,
|
|
341
|
+
isRequired: false,
|
|
342
|
+
transformFunction: null
|
|
343
|
+
},
|
|
344
|
+
minWidth: {
|
|
345
|
+
classPropertyName: "minWidth",
|
|
346
|
+
publicName: "minWidth",
|
|
347
|
+
isSignal: true,
|
|
348
|
+
isRequired: false,
|
|
349
|
+
transformFunction: null
|
|
350
|
+
},
|
|
351
|
+
resizable: {
|
|
352
|
+
classPropertyName: "resizable",
|
|
353
|
+
publicName: "resizable",
|
|
354
|
+
isSignal: true,
|
|
355
|
+
isRequired: false,
|
|
356
|
+
transformFunction: null
|
|
357
|
+
},
|
|
358
|
+
windowRef: {
|
|
359
|
+
classPropertyName: "windowRef",
|
|
360
|
+
publicName: "windowRef",
|
|
361
|
+
isSignal: true,
|
|
362
|
+
isRequired: true,
|
|
363
|
+
transformFunction: null
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
host: { listeners: { "keydown": "onKeydown($event)" } },
|
|
367
|
+
ngImport: i0
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
372
|
+
minVersion: "12.0.0",
|
|
373
|
+
version: "22.2.6",
|
|
374
|
+
ngImport: i0,
|
|
375
|
+
type: WindowDragHandlerDirective,
|
|
376
|
+
decorators: [{
|
|
377
|
+
type: Directive,
|
|
378
|
+
args: [{
|
|
379
|
+
selector: "div[monaWindowDragHandler]",
|
|
380
|
+
host: { "(keydown)": "onKeydown($event)" }
|
|
381
|
+
}]
|
|
382
|
+
}],
|
|
383
|
+
ctorParameters: () => [],
|
|
384
|
+
propDecorators: {
|
|
385
|
+
draggable: [{
|
|
386
|
+
type: i0.Input,
|
|
387
|
+
args: [{
|
|
388
|
+
isSignal: true,
|
|
389
|
+
alias: "draggable",
|
|
390
|
+
required: false
|
|
391
|
+
}]
|
|
392
|
+
}],
|
|
393
|
+
maxHeight: [{
|
|
394
|
+
type: i0.Input,
|
|
395
|
+
args: [{
|
|
396
|
+
isSignal: true,
|
|
397
|
+
alias: "maxHeight",
|
|
398
|
+
required: false
|
|
399
|
+
}]
|
|
400
|
+
}],
|
|
401
|
+
maxWidth: [{
|
|
402
|
+
type: i0.Input,
|
|
403
|
+
args: [{
|
|
404
|
+
isSignal: true,
|
|
405
|
+
alias: "maxWidth",
|
|
406
|
+
required: false
|
|
407
|
+
}]
|
|
408
|
+
}],
|
|
409
|
+
minHeight: [{
|
|
410
|
+
type: i0.Input,
|
|
411
|
+
args: [{
|
|
412
|
+
isSignal: true,
|
|
413
|
+
alias: "minHeight",
|
|
414
|
+
required: false
|
|
415
|
+
}]
|
|
416
|
+
}],
|
|
417
|
+
minWidth: [{
|
|
418
|
+
type: i0.Input,
|
|
419
|
+
args: [{
|
|
420
|
+
isSignal: true,
|
|
421
|
+
alias: "minWidth",
|
|
422
|
+
required: false
|
|
423
|
+
}]
|
|
424
|
+
}],
|
|
425
|
+
resizable: [{
|
|
426
|
+
type: i0.Input,
|
|
427
|
+
args: [{
|
|
428
|
+
isSignal: true,
|
|
429
|
+
alias: "resizable",
|
|
430
|
+
required: false
|
|
431
|
+
}]
|
|
432
|
+
}],
|
|
433
|
+
windowRef: [{
|
|
434
|
+
type: i0.Input,
|
|
435
|
+
args: [{
|
|
436
|
+
isSignal: true,
|
|
437
|
+
alias: "windowRef",
|
|
438
|
+
required: true
|
|
439
|
+
}]
|
|
440
|
+
}]
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
var WindowResizeHandlerDirective = class WindowResizeHandlerDirective {
|
|
444
|
+
#destroyRef;
|
|
445
|
+
#document;
|
|
446
|
+
#hostElementRef;
|
|
447
|
+
#zone;
|
|
448
|
+
#activeCleanup;
|
|
449
|
+
constructor() {
|
|
450
|
+
this.#destroyRef = inject(DestroyRef);
|
|
451
|
+
this.#document = inject(DOCUMENT);
|
|
452
|
+
this.#hostElementRef = inject(ElementRef);
|
|
453
|
+
this.#zone = inject(NgZone);
|
|
454
|
+
this.direction = input.required(...ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []);
|
|
455
|
+
this.maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
456
|
+
this.maxWidth = input(...ngDevMode ? [void 0, { debugName: "maxWidth" }] : /* istanbul ignore next */ []);
|
|
457
|
+
this.minHeight = input(...ngDevMode ? [void 0, { debugName: "minHeight" }] : /* istanbul ignore next */ []);
|
|
458
|
+
this.minWidth = input(...ngDevMode ? [void 0, { debugName: "minWidth" }] : /* istanbul ignore next */ []);
|
|
459
|
+
this.windowRef = input.required(...ngDevMode ? [{ debugName: "windowRef" }] : /* istanbul ignore next */ []);
|
|
460
|
+
afterNextRender({ write: () => this.#setEvents() });
|
|
461
|
+
this.#destroyRef.onDestroy(() => this.#activeCleanup?.());
|
|
462
|
+
}
|
|
463
|
+
#applyResize(result, initial) {
|
|
464
|
+
const windowRef = this.windowRef();
|
|
465
|
+
windowRef.move({
|
|
466
|
+
left: result.left ?? initial.left,
|
|
467
|
+
top: result.top ?? initial.top
|
|
468
|
+
});
|
|
469
|
+
windowRef.resize({
|
|
470
|
+
height: result.height,
|
|
471
|
+
width: result.width
|
|
472
|
+
});
|
|
473
|
+
windowRef.resize$$.next({
|
|
474
|
+
width: result.width ?? initial.width,
|
|
475
|
+
height: result.height ?? initial.height,
|
|
476
|
+
left: result.left ?? initial.left,
|
|
477
|
+
top: result.top ?? initial.top
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
#bounds() {
|
|
481
|
+
const innerWidth = this.#document.defaultView?.innerWidth || 1200;
|
|
482
|
+
const innerHeight = this.#document.defaultView?.innerHeight || 800;
|
|
483
|
+
return {
|
|
484
|
+
innerWidth,
|
|
485
|
+
innerHeight,
|
|
486
|
+
minWidth: this.minWidth() || 50,
|
|
487
|
+
minHeight: this.minHeight() || 50,
|
|
488
|
+
maxWidth: this.maxWidth() ?? innerWidth,
|
|
489
|
+
maxHeight: this.maxHeight() ?? innerHeight
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
#computeResize(direction, deltaX, deltaY, initial, bounds) {
|
|
493
|
+
const { minWidth, minHeight, maxWidth, maxHeight, innerWidth, innerHeight } = bounds;
|
|
494
|
+
let height;
|
|
495
|
+
let left;
|
|
496
|
+
let width;
|
|
497
|
+
let top;
|
|
498
|
+
switch (direction) {
|
|
499
|
+
case "northwest":
|
|
500
|
+
if (initial.top + deltaY <= 0 || initial.height - deltaY < minHeight) return null;
|
|
501
|
+
if (initial.height - deltaY > maxHeight || initial.width - deltaX > maxWidth) return null;
|
|
502
|
+
height = initial.height - deltaY;
|
|
503
|
+
top = initial.top + deltaY;
|
|
504
|
+
if (initial.left + deltaX < 0 || initial.width - deltaX < minWidth) return null;
|
|
505
|
+
width = initial.width - deltaX;
|
|
506
|
+
left = initial.left + deltaX;
|
|
507
|
+
break;
|
|
508
|
+
case "north":
|
|
509
|
+
if (initial.top + deltaY <= 0 || initial.height - deltaY < minHeight) return null;
|
|
510
|
+
if (initial.height - deltaY > maxHeight) return null;
|
|
511
|
+
height = initial.height - deltaY;
|
|
512
|
+
top = initial.top + deltaY;
|
|
513
|
+
break;
|
|
514
|
+
case "northeast":
|
|
515
|
+
if (initial.top + deltaY <= 0 || initial.height - deltaY < minHeight) return null;
|
|
516
|
+
if (initial.height - deltaY > maxHeight || initial.width + deltaX > maxWidth) return null;
|
|
517
|
+
height = initial.height - deltaY;
|
|
518
|
+
top = initial.top + deltaY;
|
|
519
|
+
if (initial.width + deltaX < minWidth || initial.left + initial.width + deltaX > innerWidth) return null;
|
|
520
|
+
width = initial.width + deltaX;
|
|
521
|
+
break;
|
|
522
|
+
case "east":
|
|
523
|
+
if (initial.width + deltaX < minWidth || initial.left + initial.width + deltaX > innerWidth) return null;
|
|
524
|
+
if (initial.width + deltaX > maxWidth) return null;
|
|
525
|
+
width = initial.width + deltaX;
|
|
526
|
+
break;
|
|
527
|
+
case "southeast":
|
|
528
|
+
if (initial.height + deltaY < minHeight || initial.top + initial.height + deltaY > innerHeight) return null;
|
|
529
|
+
if (initial.height + deltaY > maxHeight || initial.width + deltaX > maxWidth) return null;
|
|
530
|
+
height = initial.height + deltaY;
|
|
531
|
+
if (initial.width + deltaX < minWidth || initial.left + initial.width + deltaX > innerWidth) return null;
|
|
532
|
+
width = initial.width + deltaX;
|
|
533
|
+
break;
|
|
534
|
+
case "south":
|
|
535
|
+
if (initial.height + deltaY < minHeight || initial.top + initial.height + deltaY > innerHeight) return null;
|
|
536
|
+
if (initial.height + deltaY > maxHeight) return null;
|
|
537
|
+
height = initial.height + deltaY;
|
|
538
|
+
break;
|
|
539
|
+
case "southwest":
|
|
540
|
+
if (initial.height + deltaY < minHeight || initial.top + initial.height + deltaY > innerHeight) return null;
|
|
541
|
+
if (initial.height + deltaY > maxHeight || initial.width - deltaX > maxWidth) return null;
|
|
542
|
+
height = initial.height + deltaY;
|
|
543
|
+
if (initial.left + deltaX < 0 || initial.width - deltaX < minWidth) return null;
|
|
544
|
+
width = initial.width - deltaX;
|
|
545
|
+
left = initial.left + deltaX;
|
|
546
|
+
break;
|
|
547
|
+
case "west":
|
|
548
|
+
if (initial.left + deltaX < 0 || initial.width - deltaX < minWidth) return null;
|
|
549
|
+
if (initial.width - deltaX > maxWidth) return null;
|
|
550
|
+
width = initial.width - deltaX;
|
|
551
|
+
left = initial.left + deltaX;
|
|
552
|
+
}
|
|
553
|
+
return {
|
|
554
|
+
width,
|
|
555
|
+
height,
|
|
556
|
+
left,
|
|
557
|
+
top
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
#onPointerDown(event) {
|
|
561
|
+
if (event.button !== 0 || !event.isPrimary) return;
|
|
562
|
+
event.preventDefault();
|
|
563
|
+
const handle = this.#hostElementRef.nativeElement;
|
|
564
|
+
const pointerId = event.pointerId;
|
|
565
|
+
const rect = this.windowRef().element.getBoundingClientRect();
|
|
566
|
+
const initial = {
|
|
567
|
+
width: rect.width,
|
|
568
|
+
height: rect.height,
|
|
569
|
+
top: rect.top,
|
|
570
|
+
left: rect.left
|
|
571
|
+
};
|
|
572
|
+
const initialX = event.clientX;
|
|
573
|
+
const initialY = event.clientY;
|
|
574
|
+
const oldSelectStart = this.#document.onselectstart;
|
|
575
|
+
const oldDragStart = this.#document.ondragstart;
|
|
576
|
+
this.#document.onselectstart = () => false;
|
|
577
|
+
this.#document.ondragstart = () => false;
|
|
578
|
+
const bounds = this.#bounds();
|
|
579
|
+
const onPointerMove = (moveEvent) => {
|
|
580
|
+
if (moveEvent.pointerId !== pointerId) return;
|
|
581
|
+
const deltaX = moveEvent.clientX - initialX;
|
|
582
|
+
const deltaY = moveEvent.clientY - initialY;
|
|
583
|
+
const result = this.#computeResize(this.direction(), deltaX, deltaY, initial, bounds);
|
|
584
|
+
if (!result) return;
|
|
585
|
+
this.#applyResize(result, initial);
|
|
586
|
+
};
|
|
587
|
+
const cleanup = () => {
|
|
588
|
+
this.#document.removeEventListener("pointermove", onPointerMove);
|
|
589
|
+
this.#document.removeEventListener("pointerup", onPointerEnd);
|
|
590
|
+
this.#document.removeEventListener("pointercancel", onPointerEnd);
|
|
591
|
+
this.#document.onselectstart = oldSelectStart;
|
|
592
|
+
this.#document.ondragstart = oldDragStart;
|
|
593
|
+
if (handle.hasPointerCapture?.(pointerId)) handle.releasePointerCapture(pointerId);
|
|
594
|
+
this.#activeCleanup = void 0;
|
|
595
|
+
};
|
|
596
|
+
const onPointerEnd = (endEvent) => {
|
|
597
|
+
if (endEvent.pointerId === pointerId) cleanup();
|
|
598
|
+
};
|
|
599
|
+
this.#activeCleanup?.();
|
|
600
|
+
this.#activeCleanup = cleanup;
|
|
601
|
+
try {
|
|
602
|
+
handle.setPointerCapture?.(pointerId);
|
|
603
|
+
} catch {}
|
|
604
|
+
this.#document.addEventListener("pointermove", onPointerMove);
|
|
605
|
+
this.#document.addEventListener("pointerup", onPointerEnd);
|
|
606
|
+
this.#document.addEventListener("pointercancel", onPointerEnd);
|
|
607
|
+
}
|
|
608
|
+
#setEvents() {
|
|
609
|
+
this.#zone.runOutsideAngular(() => {
|
|
610
|
+
fromEvent(this.#hostElementRef.nativeElement, "pointerdown").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.#onPointerDown(event));
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
static {
|
|
614
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
615
|
+
minVersion: "12.0.0",
|
|
616
|
+
version: "22.2.6",
|
|
617
|
+
ngImport: i0,
|
|
618
|
+
type: WindowResizeHandlerDirective,
|
|
619
|
+
deps: [],
|
|
620
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
static {
|
|
624
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
625
|
+
minVersion: "17.1.0",
|
|
626
|
+
version: "22.2.6",
|
|
627
|
+
type: WindowResizeHandlerDirective,
|
|
628
|
+
isStandalone: true,
|
|
629
|
+
selector: "div[monaWindowResizeHandler]",
|
|
630
|
+
inputs: {
|
|
631
|
+
direction: {
|
|
632
|
+
classPropertyName: "direction",
|
|
633
|
+
publicName: "direction",
|
|
634
|
+
isSignal: true,
|
|
635
|
+
isRequired: true,
|
|
636
|
+
transformFunction: null
|
|
637
|
+
},
|
|
638
|
+
maxHeight: {
|
|
639
|
+
classPropertyName: "maxHeight",
|
|
640
|
+
publicName: "maxHeight",
|
|
641
|
+
isSignal: true,
|
|
642
|
+
isRequired: false,
|
|
643
|
+
transformFunction: null
|
|
644
|
+
},
|
|
645
|
+
maxWidth: {
|
|
646
|
+
classPropertyName: "maxWidth",
|
|
647
|
+
publicName: "maxWidth",
|
|
648
|
+
isSignal: true,
|
|
649
|
+
isRequired: false,
|
|
650
|
+
transformFunction: null
|
|
651
|
+
},
|
|
652
|
+
minHeight: {
|
|
653
|
+
classPropertyName: "minHeight",
|
|
654
|
+
publicName: "minHeight",
|
|
655
|
+
isSignal: true,
|
|
656
|
+
isRequired: false,
|
|
657
|
+
transformFunction: null
|
|
658
|
+
},
|
|
659
|
+
minWidth: {
|
|
660
|
+
classPropertyName: "minWidth",
|
|
661
|
+
publicName: "minWidth",
|
|
662
|
+
isSignal: true,
|
|
663
|
+
isRequired: false,
|
|
664
|
+
transformFunction: null
|
|
665
|
+
},
|
|
666
|
+
windowRef: {
|
|
667
|
+
classPropertyName: "windowRef",
|
|
668
|
+
publicName: "windowRef",
|
|
669
|
+
isSignal: true,
|
|
670
|
+
isRequired: true,
|
|
671
|
+
transformFunction: null
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
ngImport: i0
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
679
|
+
minVersion: "12.0.0",
|
|
680
|
+
version: "22.2.6",
|
|
681
|
+
ngImport: i0,
|
|
682
|
+
type: WindowResizeHandlerDirective,
|
|
683
|
+
decorators: [{
|
|
684
|
+
type: Directive,
|
|
685
|
+
args: [{ selector: "div[monaWindowResizeHandler]" }]
|
|
686
|
+
}],
|
|
687
|
+
ctorParameters: () => [],
|
|
688
|
+
propDecorators: {
|
|
689
|
+
direction: [{
|
|
690
|
+
type: i0.Input,
|
|
691
|
+
args: [{
|
|
692
|
+
isSignal: true,
|
|
693
|
+
alias: "direction",
|
|
694
|
+
required: true
|
|
695
|
+
}]
|
|
696
|
+
}],
|
|
697
|
+
maxHeight: [{
|
|
698
|
+
type: i0.Input,
|
|
699
|
+
args: [{
|
|
700
|
+
isSignal: true,
|
|
701
|
+
alias: "maxHeight",
|
|
702
|
+
required: false
|
|
703
|
+
}]
|
|
704
|
+
}],
|
|
705
|
+
maxWidth: [{
|
|
706
|
+
type: i0.Input,
|
|
707
|
+
args: [{
|
|
708
|
+
isSignal: true,
|
|
709
|
+
alias: "maxWidth",
|
|
710
|
+
required: false
|
|
711
|
+
}]
|
|
712
|
+
}],
|
|
713
|
+
minHeight: [{
|
|
714
|
+
type: i0.Input,
|
|
715
|
+
args: [{
|
|
716
|
+
isSignal: true,
|
|
717
|
+
alias: "minHeight",
|
|
718
|
+
required: false
|
|
719
|
+
}]
|
|
720
|
+
}],
|
|
721
|
+
minWidth: [{
|
|
722
|
+
type: i0.Input,
|
|
723
|
+
args: [{
|
|
724
|
+
isSignal: true,
|
|
725
|
+
alias: "minWidth",
|
|
726
|
+
required: false
|
|
727
|
+
}]
|
|
728
|
+
}],
|
|
729
|
+
windowRef: [{
|
|
730
|
+
type: i0.Input,
|
|
731
|
+
args: [{
|
|
732
|
+
isSignal: true,
|
|
733
|
+
alias: "windowRef",
|
|
734
|
+
required: true
|
|
735
|
+
}]
|
|
736
|
+
}]
|
|
737
|
+
}
|
|
738
|
+
});
|
|
503
739
|
const WINDOW_DEFAULT_MESSAGES = {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
740
|
+
close: "Close",
|
|
741
|
+
closeWindow: "Close window",
|
|
742
|
+
maximize: "Maximize",
|
|
743
|
+
minimize: "Minimize",
|
|
744
|
+
moveOrResizeWindow: "Move or resize window. Use arrow keys to move, or Control and arrow keys to resize.",
|
|
745
|
+
moveWindow: "Move window. Use arrow keys to move.",
|
|
746
|
+
resizeBottom: "Resize window from the bottom. Use arrow keys to resize.",
|
|
747
|
+
resizeBottomLeft: "Resize window from the bottom-left corner. Use arrow keys to resize.",
|
|
748
|
+
resizeBottomRight: "Resize window from the bottom-right corner. Use arrow keys to resize.",
|
|
749
|
+
resizeLeft: "Resize window from the left. Use arrow keys to resize.",
|
|
750
|
+
resizeRight: "Resize window from the right. Use arrow keys to resize.",
|
|
751
|
+
resizeTop: "Resize window from the top. Use arrow keys to resize.",
|
|
752
|
+
resizeTopLeft: "Resize window from the top-left corner. Use arrow keys to resize.",
|
|
753
|
+
resizeTopRight: "Resize window from the top-right corner. Use arrow keys to resize.",
|
|
754
|
+
resizeWindow: "Resize window. Use Control and arrow keys to resize.",
|
|
755
|
+
restore: "Restore"
|
|
520
756
|
};
|
|
521
|
-
|
|
522
757
|
const windowBaseThemeVariants = cva(`
|
|
523
758
|
flex h-full w-full flex-col
|
|
524
759
|
${themeOverlaySurfaceClasses} text-foreground
|
|
525
760
|
`, {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
},
|
|
534
|
-
defaultVariants: {
|
|
535
|
-
rounded: "medium"
|
|
536
|
-
}
|
|
761
|
+
variants: { rounded: {
|
|
762
|
+
none: "rounded-none",
|
|
763
|
+
small: "rounded-sm",
|
|
764
|
+
medium: "rounded-md",
|
|
765
|
+
large: "rounded-lg"
|
|
766
|
+
} },
|
|
767
|
+
defaultVariants: { rounded: "medium" }
|
|
537
768
|
});
|
|
538
769
|
const windowContentContainerThemeVariants = cva(`
|
|
539
770
|
relative flex h-full w-full flex-col
|
|
540
771
|
border border-border
|
|
541
772
|
shadow-(--shadow-overlay)
|
|
542
|
-
`, {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
large: "rounded-lg"
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
});
|
|
773
|
+
`, { variants: { rounded: {
|
|
774
|
+
none: "rounded-none",
|
|
775
|
+
small: "rounded-sm",
|
|
776
|
+
medium: "rounded-md",
|
|
777
|
+
large: "rounded-lg"
|
|
778
|
+
} } });
|
|
552
779
|
const windowContentThemeVariants = cva(`
|
|
553
780
|
flex-1 overflow-auto
|
|
554
781
|
[scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
|
|
555
782
|
`);
|
|
556
783
|
const windowResizerThemeVariants = cva(`
|
|
557
784
|
absolute flex touch-none
|
|
558
|
-
`, {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
southwest: "-bottom-0.5 -start-0.5 w-2 h-2 cursor-nesw-resize rtl:-end-0.5 rtl:start-auto"
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
});
|
|
785
|
+
`, { variants: { position: {
|
|
786
|
+
east: "inset-y-0 -end-0.5 w-2 cursor-ew-resize rtl:-start-0.5 rtl:end-auto",
|
|
787
|
+
north: "inset-x-0 -top-0.5 h-2 cursor-ns-resize",
|
|
788
|
+
south: "inset-x-0 -bottom-0.5 h-2 cursor-ns-resize",
|
|
789
|
+
west: "inset-y-0 -start-0.5 w-2 cursor-ew-resize rtl:-end-0.5 rtl:start-auto",
|
|
790
|
+
northeast: "-top-0.5 -end-0.5 w-2 h-2 cursor-nesw-resize rtl:-start-0.5 rtl:end-auto",
|
|
791
|
+
northwest: "-top-0.5 -start-0.5 w-2 h-2 cursor-nwse-resize rtl:-end-0.5 rtl:start-auto",
|
|
792
|
+
southeast: "-bottom-0.5 -end-0.5 w-2 h-2 cursor-nwse-resize rtl:-start-0.5 rtl:end-auto",
|
|
793
|
+
southwest: "-bottom-0.5 -start-0.5 w-2 h-2 cursor-nesw-resize rtl:-end-0.5 rtl:start-auto"
|
|
794
|
+
} } });
|
|
572
795
|
const windowTitleBarActionThemeVariants = cva(`
|
|
573
796
|
flex items-center justify-evenly
|
|
574
797
|
`);
|
|
@@ -576,997 +799,1388 @@ const windowTitleBarThemeVariants = cva(`
|
|
|
576
799
|
flex items-center justify-start
|
|
577
800
|
overflow-hidden px-2 py-1 text-sm
|
|
578
801
|
border-b border-border-subtle
|
|
579
|
-
`, {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}
|
|
592
|
-
});
|
|
802
|
+
`, { variants: {
|
|
803
|
+
look: {
|
|
804
|
+
default: "bg-surface-muted text-foreground",
|
|
805
|
+
primary: "bg-primary text-primary-foreground"
|
|
806
|
+
},
|
|
807
|
+
rounded: {
|
|
808
|
+
none: "rounded-ss-none rounded-se-none",
|
|
809
|
+
small: "rounded-ss-sm rounded-se-sm",
|
|
810
|
+
medium: "rounded-ss-md rounded-se-md",
|
|
811
|
+
large: "rounded-ss-lg rounded-se-lg"
|
|
812
|
+
}
|
|
813
|
+
} });
|
|
593
814
|
const windowTitleContainerThemeVariants = cva(`
|
|
594
815
|
flex h-full flex-1 items-center overflow-hidden
|
|
595
816
|
cursor-default select-none text-ellipsis
|
|
596
817
|
`);
|
|
597
818
|
const windowTitleThemeVariants = cva(`
|
|
598
819
|
overflow-hidden text-ellipsis whitespace-nowrap font-semibold
|
|
599
|
-
`, {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
820
|
+
`, { variants: { look: {
|
|
821
|
+
default: "text-foreground",
|
|
822
|
+
primary: "text-primary-foreground"
|
|
823
|
+
} } });
|
|
824
|
+
var ResizePositionPipe = class ResizePositionPipe {
|
|
825
|
+
transform(position) {
|
|
826
|
+
if (!position) return null;
|
|
827
|
+
return windowResizerThemeVariants({ position });
|
|
828
|
+
}
|
|
829
|
+
static {
|
|
830
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
831
|
+
minVersion: "12.0.0",
|
|
832
|
+
version: "22.2.6",
|
|
833
|
+
ngImport: i0,
|
|
834
|
+
type: ResizePositionPipe,
|
|
835
|
+
deps: [],
|
|
836
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
static {
|
|
840
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
841
|
+
minVersion: "14.0.0",
|
|
842
|
+
version: "22.2.6",
|
|
843
|
+
ngImport: i0,
|
|
844
|
+
type: ResizePositionPipe,
|
|
845
|
+
isStandalone: true,
|
|
846
|
+
name: "monaResizePosition"
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
851
|
+
minVersion: "12.0.0",
|
|
852
|
+
version: "22.2.6",
|
|
853
|
+
ngImport: i0,
|
|
854
|
+
type: ResizePositionPipe,
|
|
855
|
+
decorators: [{
|
|
856
|
+
type: Pipe,
|
|
857
|
+
args: [{ name: "monaResizePosition" }]
|
|
858
|
+
}]
|
|
606
859
|
});
|
|
607
|
-
|
|
608
|
-
class ResizePositionPipe {
|
|
609
|
-
transform(position) {
|
|
610
|
-
if (!position) {
|
|
611
|
-
return null;
|
|
612
|
-
}
|
|
613
|
-
return windowResizerThemeVariants({ position });
|
|
614
|
-
}
|
|
615
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ResizePositionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
616
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: ResizePositionPipe, isStandalone: true, name: "monaResizePosition" }); }
|
|
617
|
-
}
|
|
618
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ResizePositionPipe, decorators: [{
|
|
619
|
-
type: Pipe,
|
|
620
|
-
args: [{
|
|
621
|
-
name: "monaResizePosition"
|
|
622
|
-
}]
|
|
623
|
-
}] });
|
|
624
|
-
|
|
625
|
-
/** Targets inside the title bar whose double-click is their own. */
|
|
626
860
|
const INTERACTIVE = "a[href], button, input, select, textarea, [contenteditable]:not([contenteditable='false'])";
|
|
627
|
-
class WindowContentComponent {
|
|
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
|
-
|
|
861
|
+
var WindowContentComponent = class WindowContentComponent {
|
|
862
|
+
#destroyRef;
|
|
863
|
+
#hostElementRef;
|
|
864
|
+
#i18n;
|
|
865
|
+
#injector;
|
|
866
|
+
#localeMessages;
|
|
867
|
+
#trapFocus;
|
|
868
|
+
#beforeMaximize;
|
|
869
|
+
#beforeMinimize;
|
|
870
|
+
#componentRef;
|
|
871
|
+
constructor() {
|
|
872
|
+
this.#destroyRef = inject(DestroyRef);
|
|
873
|
+
this.#hostElementRef = inject(ElementRef);
|
|
874
|
+
this.#i18n = inject(MonaI18nService);
|
|
875
|
+
this.#injector = inject(Injector);
|
|
876
|
+
this.#localeMessages = this.#i18n.componentMessages("window", WINDOW_DEFAULT_MESSAGES);
|
|
877
|
+
this.#trapFocus = inject(CdkTrapFocus);
|
|
878
|
+
this.#beforeMaximize = null;
|
|
879
|
+
this.#beforeMinimize = null;
|
|
880
|
+
this.#componentRef = null;
|
|
881
|
+
this.componentHost = viewChild("componentHost", {
|
|
882
|
+
...ngDevMode ? { debugName: "componentHost" } : /* istanbul ignore next */ {},
|
|
883
|
+
read: ViewContainerRef
|
|
884
|
+
});
|
|
885
|
+
this.baseClass = computed(() => {
|
|
886
|
+
const rounded = this.windowData.rounded;
|
|
887
|
+
return windowBaseThemeVariants({ rounded });
|
|
888
|
+
}, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
|
|
889
|
+
this.contentClass = computed(() => {
|
|
890
|
+
return windowContentThemeVariants();
|
|
891
|
+
}, ...ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []);
|
|
892
|
+
this.contentContainerClass = computed(() => {
|
|
893
|
+
const rounded = this.windowData.rounded;
|
|
894
|
+
return windowContentContainerThemeVariants({ rounded });
|
|
895
|
+
}, ...ngDevMode ? [{ debugName: "contentContainerClass" }] : /* istanbul ignore next */ []);
|
|
896
|
+
this.headerId = createElementControlId();
|
|
897
|
+
this.maximizeIcon = computed(() => {
|
|
898
|
+
return this.maximized() ? LucideMinimize : LucideMaximize;
|
|
899
|
+
}, ...ngDevMode ? [{ debugName: "maximizeIcon" }] : /* istanbul ignore next */ []);
|
|
900
|
+
this.maximized = signal(false, ...ngDevMode ? [{ debugName: "maximized" }] : /* istanbul ignore next */ []);
|
|
901
|
+
this.messages = computed(() => {
|
|
902
|
+
return mergeMessages(this.#localeMessages(), this.windowData.messages);
|
|
903
|
+
}, ...ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []);
|
|
904
|
+
this.minimizeIcon = computed(() => {
|
|
905
|
+
return this.minimized() ? LucideAppWindow : LucideMinus;
|
|
906
|
+
}, ...ngDevMode ? [{ debugName: "minimizeIcon" }] : /* istanbul ignore next */ []);
|
|
907
|
+
this.minimized = signal(false, ...ngDevMode ? [{ debugName: "minimized" }] : /* istanbul ignore next */ []);
|
|
908
|
+
this.resizeDirections = [
|
|
909
|
+
"north",
|
|
910
|
+
"south",
|
|
911
|
+
"east",
|
|
912
|
+
"west",
|
|
913
|
+
"northeast",
|
|
914
|
+
"northwest",
|
|
915
|
+
"southeast",
|
|
916
|
+
"southwest"
|
|
917
|
+
];
|
|
918
|
+
this.titleBarActionClass = computed(() => {
|
|
919
|
+
return windowTitleBarActionThemeVariants();
|
|
920
|
+
}, ...ngDevMode ? [{ debugName: "titleBarActionClass" }] : /* istanbul ignore next */ []);
|
|
921
|
+
this.titleBarClass = computed(() => {
|
|
922
|
+
const look = this.windowData.look;
|
|
923
|
+
const rounded = this.windowData.rounded;
|
|
924
|
+
return windowTitleBarThemeVariants({
|
|
925
|
+
look,
|
|
926
|
+
rounded
|
|
927
|
+
});
|
|
928
|
+
}, ...ngDevMode ? [{ debugName: "titleBarClass" }] : /* istanbul ignore next */ []);
|
|
929
|
+
this.titleBarLabel = computed(() => {
|
|
930
|
+
const { draggable, resizable } = this.windowData;
|
|
931
|
+
const messages = this.messages();
|
|
932
|
+
if (draggable && resizable) return messages.moveOrResizeWindow;
|
|
933
|
+
if (draggable) return messages.moveWindow;
|
|
934
|
+
return resizable ? messages.resizeWindow : null;
|
|
935
|
+
}, ...ngDevMode ? [{ debugName: "titleBarLabel" }] : /* istanbul ignore next */ []);
|
|
936
|
+
this.titleClass = computed(() => {
|
|
937
|
+
const look = this.windowData.look;
|
|
938
|
+
return windowTitleThemeVariants({ look });
|
|
939
|
+
}, ...ngDevMode ? [{ debugName: "titleClass" }] : /* istanbul ignore next */ []);
|
|
940
|
+
this.titleContainerClass = computed(() => {
|
|
941
|
+
return windowTitleContainerThemeVariants();
|
|
942
|
+
}, ...ngDevMode ? [{ debugName: "titleContainerClass" }] : /* istanbul ignore next */ []);
|
|
943
|
+
this.windowData = inject(PopupDataInjectionToken);
|
|
944
|
+
this.windowRef = this.windowData.windowReference.windowRef;
|
|
945
|
+
const content = this.windowData.content;
|
|
946
|
+
this.contentTemplate = content instanceof TemplateRef ? content : null;
|
|
947
|
+
this.contentComponent = content && !(content instanceof TemplateRef) ? content : null;
|
|
948
|
+
this.hasTitle = !!this.windowData.title || !!this.windowData.titleTemplate;
|
|
949
|
+
this.#trapFocus.autoCapture = true;
|
|
950
|
+
this.#trapFocus.enabled = this.windowData.modal ?? false;
|
|
951
|
+
effect(() => {
|
|
952
|
+
const host = this.componentHost();
|
|
953
|
+
untracked(() => this.#renderComponent(host));
|
|
954
|
+
});
|
|
955
|
+
const raise = () => this.windowData.windowReference.bringToFront();
|
|
956
|
+
const host = this.#hostElementRef.nativeElement;
|
|
957
|
+
host.addEventListener("pointerdown", raise, { capture: true });
|
|
958
|
+
this.#destroyRef.onDestroy(() => {
|
|
959
|
+
host.removeEventListener("pointerdown", raise, { capture: true });
|
|
960
|
+
this.#componentRef?.destroy();
|
|
961
|
+
this.windowData.windowReference.setComponentRef(void 0);
|
|
962
|
+
});
|
|
963
|
+
afterNextRender({ write: () => {
|
|
964
|
+
this.focusElement();
|
|
965
|
+
if (isDevMode()) this.#warnIfUnnamed();
|
|
966
|
+
} });
|
|
967
|
+
}
|
|
968
|
+
onCloseClick(event) {
|
|
969
|
+
this.closeWindow(event);
|
|
970
|
+
}
|
|
971
|
+
onFocusIn(event) {
|
|
972
|
+
const from = event.relatedTarget;
|
|
973
|
+
if (from instanceof Node && this.#hostElementRef.nativeElement.contains(from)) return;
|
|
974
|
+
this.windowData.windowReference.bringToFront();
|
|
975
|
+
}
|
|
976
|
+
onMaximizeClick() {
|
|
977
|
+
if (this.minimized()) this.#restoreFromMinimize();
|
|
978
|
+
if (this.maximized()) this.#restoreFromMaximize();
|
|
979
|
+
else this.#maximize();
|
|
980
|
+
}
|
|
981
|
+
onMinimizeClick() {
|
|
982
|
+
if (this.minimized()) this.#restoreFromMinimize();
|
|
983
|
+
else this.#minimize();
|
|
984
|
+
}
|
|
985
|
+
onTitleBarDoubleClick(event) {
|
|
986
|
+
if (!this.windowData.maximizable) return;
|
|
987
|
+
if (event.target instanceof Element ? event.target.closest(INTERACTIVE) : null) return;
|
|
988
|
+
this.onMaximizeClick();
|
|
989
|
+
}
|
|
990
|
+
#maximize() {
|
|
991
|
+
const reference = this.windowData.windowReference;
|
|
992
|
+
const { height, width } = reference.size;
|
|
993
|
+
this.#beforeMaximize = {
|
|
994
|
+
placement: reference.placement,
|
|
995
|
+
size: {
|
|
996
|
+
height,
|
|
997
|
+
width
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
this.maximized.set(true);
|
|
1001
|
+
reference.setSize({
|
|
1002
|
+
height: "100dvh",
|
|
1003
|
+
width: "100dvw"
|
|
1004
|
+
});
|
|
1005
|
+
reference.center();
|
|
1006
|
+
}
|
|
1007
|
+
#minimize() {
|
|
1008
|
+
const reference = this.windowData.windowReference;
|
|
1009
|
+
const { height, minHeight, width } = reference.size;
|
|
1010
|
+
this.#beforeMinimize = {
|
|
1011
|
+
height,
|
|
1012
|
+
minHeight,
|
|
1013
|
+
width
|
|
1014
|
+
};
|
|
1015
|
+
this.minimized.set(true);
|
|
1016
|
+
reference.setSize({
|
|
1017
|
+
height: "fit-content",
|
|
1018
|
+
minHeight: 0,
|
|
1019
|
+
width: width ?? reference.width
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
#renderComponent(host) {
|
|
1023
|
+
const type = this.contentComponent;
|
|
1024
|
+
if (!host || !type || this.#componentRef) return;
|
|
1025
|
+
host.clear();
|
|
1026
|
+
this.#componentRef = host.createComponent(type, { injector: this.#injector });
|
|
1027
|
+
this.windowData.windowReference.setComponentRef(this.#componentRef);
|
|
1028
|
+
}
|
|
1029
|
+
#restoreFromMaximize() {
|
|
1030
|
+
const saved = this.#beforeMaximize;
|
|
1031
|
+
this.#beforeMaximize = null;
|
|
1032
|
+
this.maximized.set(false);
|
|
1033
|
+
if (saved) {
|
|
1034
|
+
this.windowData.windowReference.setSize(saved.size);
|
|
1035
|
+
this.windowData.windowReference.place(saved.placement);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
#restoreFromMinimize() {
|
|
1039
|
+
const saved = this.#beforeMinimize;
|
|
1040
|
+
this.#beforeMinimize = null;
|
|
1041
|
+
this.minimized.set(false);
|
|
1042
|
+
if (saved) this.windowData.windowReference.setSize(saved);
|
|
1043
|
+
}
|
|
1044
|
+
#warnIfUnnamed() {
|
|
1045
|
+
if (this.hasTitle || this.windowData.ariaLabel) return;
|
|
1046
|
+
console.warn("[Mona Window] A window needs an accessible name. Set a title, a title template or aria-label (ariaLabel in the service settings).", this.#hostElementRef.nativeElement);
|
|
1047
|
+
}
|
|
1048
|
+
closeWindow(event) {
|
|
1049
|
+
const closeEvent = new PopupCloseEvent({
|
|
1050
|
+
event,
|
|
1051
|
+
via: PopupCloseSource.CloseButton,
|
|
1052
|
+
originalEvent: event
|
|
1053
|
+
});
|
|
1054
|
+
this.windowData.windowReference.close(closeEvent);
|
|
1055
|
+
}
|
|
1056
|
+
focusElement() {
|
|
1057
|
+
const element = this.windowData.focusedElement;
|
|
1058
|
+
if (!element) return;
|
|
1059
|
+
const windowElement = this.#hostElementRef.nativeElement;
|
|
1060
|
+
focusElement(windowElement, element)?.setAttribute("cdkFocusInitial", "");
|
|
1061
|
+
}
|
|
1062
|
+
static {
|
|
1063
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1064
|
+
minVersion: "12.0.0",
|
|
1065
|
+
version: "22.2.6",
|
|
1066
|
+
ngImport: i0,
|
|
1067
|
+
type: WindowContentComponent,
|
|
1068
|
+
deps: [],
|
|
1069
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
static {
|
|
1073
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1074
|
+
minVersion: "17.0.0",
|
|
1075
|
+
version: "22.2.6",
|
|
1076
|
+
type: WindowContentComponent,
|
|
1077
|
+
isStandalone: true,
|
|
1078
|
+
selector: "mona-window-content",
|
|
1079
|
+
host: {
|
|
1080
|
+
attributes: { "role": "dialog" },
|
|
1081
|
+
listeners: { "focusin": "onFocusIn($event)" },
|
|
1082
|
+
properties: {
|
|
1083
|
+
"class": "baseClass()",
|
|
1084
|
+
"attr.aria-label": "hasTitle ? null : windowData.ariaLabel || null",
|
|
1085
|
+
"attr.aria-labelledby": "hasTitle ? headerId : null",
|
|
1086
|
+
"attr.aria-modal": "windowData.modal ? 'true' : 'false'"
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
viewQueries: [{
|
|
1090
|
+
propertyName: "componentHost",
|
|
1091
|
+
first: true,
|
|
1092
|
+
predicate: ["componentHost"],
|
|
1093
|
+
descendants: true,
|
|
1094
|
+
read: ViewContainerRef,
|
|
1095
|
+
isSignal: true
|
|
1096
|
+
}],
|
|
1097
|
+
hostDirectives: [{ directive: i1.CdkTrapFocus }],
|
|
1098
|
+
ngImport: i0,
|
|
1099
|
+
template: "<div [class]=\"contentContainerClass()\">\n <div\n [class]=\"titleBarClass()\"\n [class.touch-none]=\"windowData.draggable\"\n monaWindowDragHandler\n (dblclick)=\"onTitleBarDoubleClick($event)\"\n [draggable]=\"windowData.draggable && !maximized()\"\n [resizable]=\"windowData.resizable && !maximized() && !minimized()\"\n [minWidth]=\"windowData.minWidth\"\n [minHeight]=\"windowData.minHeight\"\n [maxWidth]=\"windowData.maxWidth\"\n [maxHeight]=\"windowData.maxHeight\"\n [windowRef]=\"windowData.windowReference\"\n [attr.tabindex]=\"titleBarLabel() ? 0 : null\"\n [attr.role]=\"titleBarLabel() ? 'group' : null\"\n [attr.aria-label]=\"titleBarLabel()\">\n <div [id]=\"headerId\" [class]=\"titleContainerClass()\">\n @if (windowData.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"windowData.titleTemplate\"></ng-container>\n } @else {\n <span [class]=\"titleClass()\">{{ windowData.title ?? \"\" }}</span>\n }\n </div>\n <div [class]=\"titleBarActionClass()\">\n @if (windowData.actionTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"windowData.actionTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: windowRef }\">\n </ng-container>\n }\n @if (windowData.minimizable) {\n @let minimizeTitle = minimized() ? messages().restore : messages().minimize;\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n type=\"button\"\n [iconOnly]=\"true\"\n [rounded]=\"windowData.rounded\"\n [title]=\"minimizeTitle\"\n [attr.aria-label]=\"minimizeTitle\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"onMinimizeClick()\">\n <svg [lucideIcon]=\"minimizeIcon()\" [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n }\n @if (windowData.maximizable) {\n @let maximizeTitle = maximized() ? messages().restore : messages().maximize;\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n type=\"button\"\n [iconOnly]=\"true\"\n [rounded]=\"windowData.rounded\"\n [title]=\"maximizeTitle\"\n [attr.aria-label]=\"maximizeTitle\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"onMaximizeClick()\">\n <svg [lucideIcon]=\"maximizeIcon()\" [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n }\n @if (windowData.closable) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n type=\"button\"\n [iconOnly]=\"true\"\n [rounded]=\"windowData.rounded\"\n [title]=\"messages().close\"\n [attr.aria-label]=\"messages().closeWindow\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"onCloseClick($event)\">\n <svg lucideX [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n }\n </div>\n </div>\n <!-- Minimizing hides the content instead of destroying it, so its state survives a restore. -->\n <div [class]=\"contentClass()\" [hidden]=\"minimized()\" [attr.inert]=\"minimized() ? '' : null\">\n @if (contentTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: windowData.data, windowRef: windowRef }\"></ng-container>\n } @else if (contentComponent) {\n <ng-container #componentHost></ng-container>\n }\n </div>\n @if (windowData.footerTemplate) {\n <div [hidden]=\"minimized()\" [attr.inert]=\"minimized() ? '' : null\">\n <ng-container [ngTemplateOutlet]=\"windowData.footerTemplate\"></ng-container>\n </div>\n }\n @if (windowData.resizable && !maximized() && !minimized()) {\n @for (direction of resizeDirections; track direction) {\n <div\n monaWindowResizeHandler\n aria-hidden=\"true\"\n [attr.data-direction]=\"direction\"\n [direction]=\"direction\"\n [minWidth]=\"windowData.minWidth\"\n [minHeight]=\"windowData.minHeight\"\n [maxWidth]=\"windowData.maxWidth\"\n [maxHeight]=\"windowData.maxHeight\"\n [windowRef]=\"windowData.windowReference\"\n [class]=\"direction | monaResizePosition\"></div>\n }\n }\n</div>\n",
|
|
1100
|
+
dependencies: [
|
|
1101
|
+
{
|
|
1102
|
+
kind: "directive",
|
|
1103
|
+
type: WindowDragHandlerDirective,
|
|
1104
|
+
selector: "div[monaWindowDragHandler]",
|
|
1105
|
+
inputs: [
|
|
1106
|
+
"draggable",
|
|
1107
|
+
"maxHeight",
|
|
1108
|
+
"maxWidth",
|
|
1109
|
+
"minHeight",
|
|
1110
|
+
"minWidth",
|
|
1111
|
+
"resizable",
|
|
1112
|
+
"windowRef"
|
|
1113
|
+
]
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
kind: "directive",
|
|
1117
|
+
type: NgTemplateOutlet,
|
|
1118
|
+
selector: "[ngTemplateOutlet]",
|
|
1119
|
+
inputs: [
|
|
1120
|
+
"ngTemplateOutletContext",
|
|
1121
|
+
"ngTemplateOutlet",
|
|
1122
|
+
"ngTemplateOutletInjector"
|
|
1123
|
+
]
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
kind: "directive",
|
|
1127
|
+
type: ButtonDirective,
|
|
1128
|
+
selector: "button[monaButton]",
|
|
1129
|
+
inputs: [
|
|
1130
|
+
"aria-haspopup",
|
|
1131
|
+
"disabled",
|
|
1132
|
+
"iconOnly",
|
|
1133
|
+
"loading",
|
|
1134
|
+
"look",
|
|
1135
|
+
"rounded",
|
|
1136
|
+
"selected",
|
|
1137
|
+
"size",
|
|
1138
|
+
"tabindex",
|
|
1139
|
+
"toggleable",
|
|
1140
|
+
"type",
|
|
1141
|
+
"class",
|
|
1142
|
+
"value"
|
|
1143
|
+
],
|
|
1144
|
+
outputs: ["lookChange", "selectedChange"]
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
kind: "directive",
|
|
1148
|
+
type: WindowResizeHandlerDirective,
|
|
1149
|
+
selector: "div[monaWindowResizeHandler]",
|
|
1150
|
+
inputs: [
|
|
1151
|
+
"direction",
|
|
1152
|
+
"maxHeight",
|
|
1153
|
+
"maxWidth",
|
|
1154
|
+
"minHeight",
|
|
1155
|
+
"minWidth",
|
|
1156
|
+
"windowRef"
|
|
1157
|
+
]
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
kind: "component",
|
|
1161
|
+
type: LucideDynamicIcon,
|
|
1162
|
+
selector: "svg[lucideIcon]",
|
|
1163
|
+
inputs: ["lucideIcon"]
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
kind: "component",
|
|
1167
|
+
type: LucideX,
|
|
1168
|
+
selector: "svg[lucideX]"
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
kind: "pipe",
|
|
1172
|
+
type: ResizePositionPipe,
|
|
1173
|
+
name: "monaResizePosition"
|
|
1174
|
+
}
|
|
1175
|
+
]
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1180
|
+
minVersion: "12.0.0",
|
|
1181
|
+
version: "22.2.6",
|
|
1182
|
+
ngImport: i0,
|
|
1183
|
+
type: WindowContentComponent,
|
|
1184
|
+
decorators: [{
|
|
1185
|
+
type: Component,
|
|
1186
|
+
args: [{
|
|
1187
|
+
selector: "mona-window-content",
|
|
1188
|
+
imports: [
|
|
1189
|
+
WindowDragHandlerDirective,
|
|
1190
|
+
NgTemplateOutlet,
|
|
1191
|
+
ButtonDirective,
|
|
1192
|
+
WindowResizeHandlerDirective,
|
|
1193
|
+
ResizePositionPipe,
|
|
1194
|
+
LucideDynamicIcon,
|
|
1195
|
+
LucideX
|
|
1196
|
+
],
|
|
1197
|
+
host: {
|
|
1198
|
+
"[class]": "baseClass()",
|
|
1199
|
+
"[attr.aria-label]": "hasTitle ? null : windowData.ariaLabel || null",
|
|
1200
|
+
"[attr.aria-labelledby]": "hasTitle ? headerId : null",
|
|
1201
|
+
"[attr.aria-modal]": "windowData.modal ? 'true' : 'false'",
|
|
1202
|
+
"(focusin)": "onFocusIn($event)",
|
|
1203
|
+
role: "dialog"
|
|
1204
|
+
},
|
|
1205
|
+
hostDirectives: [CdkTrapFocus],
|
|
1206
|
+
template: "<div [class]=\"contentContainerClass()\">\n <div\n [class]=\"titleBarClass()\"\n [class.touch-none]=\"windowData.draggable\"\n monaWindowDragHandler\n (dblclick)=\"onTitleBarDoubleClick($event)\"\n [draggable]=\"windowData.draggable && !maximized()\"\n [resizable]=\"windowData.resizable && !maximized() && !minimized()\"\n [minWidth]=\"windowData.minWidth\"\n [minHeight]=\"windowData.minHeight\"\n [maxWidth]=\"windowData.maxWidth\"\n [maxHeight]=\"windowData.maxHeight\"\n [windowRef]=\"windowData.windowReference\"\n [attr.tabindex]=\"titleBarLabel() ? 0 : null\"\n [attr.role]=\"titleBarLabel() ? 'group' : null\"\n [attr.aria-label]=\"titleBarLabel()\">\n <div [id]=\"headerId\" [class]=\"titleContainerClass()\">\n @if (windowData.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"windowData.titleTemplate\"></ng-container>\n } @else {\n <span [class]=\"titleClass()\">{{ windowData.title ?? \"\" }}</span>\n }\n </div>\n <div [class]=\"titleBarActionClass()\">\n @if (windowData.actionTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"windowData.actionTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: windowRef }\">\n </ng-container>\n }\n @if (windowData.minimizable) {\n @let minimizeTitle = minimized() ? messages().restore : messages().minimize;\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n type=\"button\"\n [iconOnly]=\"true\"\n [rounded]=\"windowData.rounded\"\n [title]=\"minimizeTitle\"\n [attr.aria-label]=\"minimizeTitle\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"onMinimizeClick()\">\n <svg [lucideIcon]=\"minimizeIcon()\" [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n }\n @if (windowData.maximizable) {\n @let maximizeTitle = maximized() ? messages().restore : messages().maximize;\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n type=\"button\"\n [iconOnly]=\"true\"\n [rounded]=\"windowData.rounded\"\n [title]=\"maximizeTitle\"\n [attr.aria-label]=\"maximizeTitle\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"onMaximizeClick()\">\n <svg [lucideIcon]=\"maximizeIcon()\" [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n }\n @if (windowData.closable) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n type=\"button\"\n [iconOnly]=\"true\"\n [rounded]=\"windowData.rounded\"\n [title]=\"messages().close\"\n [attr.aria-label]=\"messages().closeWindow\"\n (dblclick)=\"$event.stopPropagation()\"\n (click)=\"onCloseClick($event)\">\n <svg lucideX [size]=\"16\" aria-hidden=\"true\"></svg>\n </button>\n }\n </div>\n </div>\n <!-- Minimizing hides the content instead of destroying it, so its state survives a restore. -->\n <div [class]=\"contentClass()\" [hidden]=\"minimized()\" [attr.inert]=\"minimized() ? '' : null\">\n @if (contentTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: windowData.data, windowRef: windowRef }\"></ng-container>\n } @else if (contentComponent) {\n <ng-container #componentHost></ng-container>\n }\n </div>\n @if (windowData.footerTemplate) {\n <div [hidden]=\"minimized()\" [attr.inert]=\"minimized() ? '' : null\">\n <ng-container [ngTemplateOutlet]=\"windowData.footerTemplate\"></ng-container>\n </div>\n }\n @if (windowData.resizable && !maximized() && !minimized()) {\n @for (direction of resizeDirections; track direction) {\n <div\n monaWindowResizeHandler\n aria-hidden=\"true\"\n [attr.data-direction]=\"direction\"\n [direction]=\"direction\"\n [minWidth]=\"windowData.minWidth\"\n [minHeight]=\"windowData.minHeight\"\n [maxWidth]=\"windowData.maxWidth\"\n [maxHeight]=\"windowData.maxHeight\"\n [windowRef]=\"windowData.windowReference\"\n [class]=\"direction | monaResizePosition\"></div>\n }\n }\n</div>\n"
|
|
1207
|
+
}]
|
|
1208
|
+
}],
|
|
1209
|
+
ctorParameters: () => [],
|
|
1210
|
+
propDecorators: { componentHost: [{
|
|
1211
|
+
type: i0.ViewChild,
|
|
1212
|
+
args: ["componentHost", {
|
|
1213
|
+
read: ViewContainerRef,
|
|
1214
|
+
isSignal: true
|
|
1215
|
+
}]
|
|
1216
|
+
}] }
|
|
1217
|
+
});
|
|
886
1218
|
const WINDOW_DATA = new InjectionToken("WINDOW_DATA");
|
|
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
|
-
get component() {
|
|
942
|
-
return this.#options.component;
|
|
943
|
-
}
|
|
944
|
-
/** Emits while the window is dragged. Completes when it closes. */
|
|
945
|
-
get drag$() {
|
|
946
|
-
return this.#options.drag$;
|
|
947
|
-
}
|
|
948
|
-
/** Emits when a drag ends. Completes when the window closes. */
|
|
949
|
-
get dragEnd$() {
|
|
950
|
-
return this.#options.dragEnd$;
|
|
951
|
-
}
|
|
952
|
-
/** Emits when a drag starts. Completes when the window closes. */
|
|
953
|
-
get dragStart$() {
|
|
954
|
-
return this.#options.dragStart$;
|
|
955
|
-
}
|
|
956
|
-
/** The window's overlay element. */
|
|
957
|
-
get element() {
|
|
958
|
-
return this.#options.element;
|
|
959
|
-
}
|
|
960
|
-
/** The window's current rendered height, in pixels. */
|
|
961
|
-
get height() {
|
|
962
|
-
return this.#options.height;
|
|
963
|
-
}
|
|
964
|
-
/** The underlying `PopupRef`, for advanced overlay access. */
|
|
965
|
-
get popupRef() {
|
|
966
|
-
return this.#options.popupRef;
|
|
967
|
-
}
|
|
968
|
-
/** Emits while the window is resized by the user. Completes when it closes. */
|
|
969
|
-
get resize$() {
|
|
970
|
-
return this.#options.resize$;
|
|
971
|
-
}
|
|
972
|
-
/** The window's current rendered width, in pixels. */
|
|
973
|
-
get width() {
|
|
974
|
-
return this.#options.width;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
/** Marks the overlay hosts that hold a window, so a window can be raised above the other windows. */
|
|
1219
|
+
var WindowRef = class {
|
|
1220
|
+
#options;
|
|
1221
|
+
constructor(options) {
|
|
1222
|
+
this.#options = options;
|
|
1223
|
+
}
|
|
1224
|
+
center() {
|
|
1225
|
+
this.#options.center();
|
|
1226
|
+
}
|
|
1227
|
+
close(result) {
|
|
1228
|
+
this.#options.close(result);
|
|
1229
|
+
}
|
|
1230
|
+
closeWithDelay(delay, result) {
|
|
1231
|
+
this.#options.closeWithDelay(delay, result);
|
|
1232
|
+
}
|
|
1233
|
+
move(params) {
|
|
1234
|
+
this.#options.move(params);
|
|
1235
|
+
}
|
|
1236
|
+
resize(params) {
|
|
1237
|
+
this.#options.resize(params);
|
|
1238
|
+
}
|
|
1239
|
+
get close$() {
|
|
1240
|
+
return this.#options.close$;
|
|
1241
|
+
}
|
|
1242
|
+
get closed$() {
|
|
1243
|
+
return this.#options.closed$;
|
|
1244
|
+
}
|
|
1245
|
+
get component() {
|
|
1246
|
+
return this.#options.component;
|
|
1247
|
+
}
|
|
1248
|
+
get drag$() {
|
|
1249
|
+
return this.#options.drag$;
|
|
1250
|
+
}
|
|
1251
|
+
get dragEnd$() {
|
|
1252
|
+
return this.#options.dragEnd$;
|
|
1253
|
+
}
|
|
1254
|
+
get dragStart$() {
|
|
1255
|
+
return this.#options.dragStart$;
|
|
1256
|
+
}
|
|
1257
|
+
get element() {
|
|
1258
|
+
return this.#options.element;
|
|
1259
|
+
}
|
|
1260
|
+
get height() {
|
|
1261
|
+
return this.#options.height;
|
|
1262
|
+
}
|
|
1263
|
+
get popupRef() {
|
|
1264
|
+
return this.#options.popupRef;
|
|
1265
|
+
}
|
|
1266
|
+
get resize$() {
|
|
1267
|
+
return this.#options.resize$;
|
|
1268
|
+
}
|
|
1269
|
+
get width() {
|
|
1270
|
+
return this.#options.width;
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
979
1273
|
const WINDOW_HOST_CLASS = "mona-window-host";
|
|
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
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
get height() {
|
|
1132
|
-
return this.element.offsetHeight;
|
|
1133
|
-
}
|
|
1134
|
-
/** Where the window was last placed; `null` on an axis it is centered on. */
|
|
1135
|
-
get placement() {
|
|
1136
|
-
return { left: this.#left, top: this.#top };
|
|
1137
|
-
}
|
|
1138
|
-
get popupRef() {
|
|
1139
|
-
return this.#popupRefOrThrow;
|
|
1140
|
-
}
|
|
1141
|
-
get resize$() {
|
|
1142
|
-
return this.resize$$.asObservable();
|
|
1143
|
-
}
|
|
1144
|
-
/** The sizes the overlay was last given, as set (pixels or CSS lengths). */
|
|
1145
|
-
get size() {
|
|
1146
|
-
const { height, maxHeight, maxWidth, minHeight, minWidth, width } = this.#popupRefOrThrow.overlayRef.getConfig();
|
|
1147
|
-
return { height, maxHeight, maxWidth, minHeight, minWidth, width };
|
|
1148
|
-
}
|
|
1149
|
-
get width() {
|
|
1150
|
-
return this.element.offsetWidth;
|
|
1151
|
-
}
|
|
1152
|
-
get windowRef() {
|
|
1153
|
-
return this.#windowRef;
|
|
1154
|
-
}
|
|
1155
|
-
get #popupRefOrThrow() {
|
|
1156
|
-
if (!this.#options.popupRef) {
|
|
1157
|
-
throw new Error("WindowReference: popupRef has not been initialized.");
|
|
1158
|
-
}
|
|
1159
|
-
return this.#options.popupRef;
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1274
|
+
var WindowReference = class {
|
|
1275
|
+
#closed$;
|
|
1276
|
+
#document;
|
|
1277
|
+
#options;
|
|
1278
|
+
#windowRef;
|
|
1279
|
+
#left;
|
|
1280
|
+
#top;
|
|
1281
|
+
constructor(options, document) {
|
|
1282
|
+
this.#closed$ = new ReplaySubject(1);
|
|
1283
|
+
this.#left = null;
|
|
1284
|
+
this.#top = null;
|
|
1285
|
+
this.move$$ = new Subject();
|
|
1286
|
+
this.moveEnd$$ = new Subject();
|
|
1287
|
+
this.moveStart$$ = new Subject();
|
|
1288
|
+
this.resize$$ = new Subject();
|
|
1289
|
+
this.#options = options;
|
|
1290
|
+
this.#document = document;
|
|
1291
|
+
this.#windowRef = new WindowRef(this);
|
|
1292
|
+
}
|
|
1293
|
+
bringToFront() {
|
|
1294
|
+
const host = this.#popupRefOrThrow.overlayRef.hostElement;
|
|
1295
|
+
const container = host.parentElement;
|
|
1296
|
+
if (!container) return;
|
|
1297
|
+
const topmost = Array.from(container.children).filter((child) => child.classList.contains(WINDOW_HOST_CLASS)).at(-1);
|
|
1298
|
+
if (!topmost || topmost === host) return;
|
|
1299
|
+
const active = this.#document.activeElement;
|
|
1300
|
+
const focused = active instanceof HTMLElement && host.contains(active) ? active : null;
|
|
1301
|
+
topmost.after(host);
|
|
1302
|
+
if (focused && this.#document.activeElement !== focused) focused.focus({ preventScroll: true });
|
|
1303
|
+
}
|
|
1304
|
+
center() {
|
|
1305
|
+
this.#left = null;
|
|
1306
|
+
this.#top = null;
|
|
1307
|
+
this.#place();
|
|
1308
|
+
}
|
|
1309
|
+
close(result) {
|
|
1310
|
+
const event = result instanceof PopupCloseEvent ? result : new PopupCloseEvent({
|
|
1311
|
+
result,
|
|
1312
|
+
via: PopupCloseSource.Programmatic
|
|
1313
|
+
});
|
|
1314
|
+
this.#popupRefOrThrow.close(event);
|
|
1315
|
+
}
|
|
1316
|
+
closeWithDelay(delay, result) {
|
|
1317
|
+
asapScheduler.schedule(() => this.close(result), delay);
|
|
1318
|
+
}
|
|
1319
|
+
initializePopupRef(popupRef, placement = {}) {
|
|
1320
|
+
this.#options.popupRef = popupRef;
|
|
1321
|
+
this.#left = placement.left ?? null;
|
|
1322
|
+
this.#top = placement.top ?? null;
|
|
1323
|
+
popupRef.overlayRef.hostElement.classList.add(WINDOW_HOST_CLASS);
|
|
1324
|
+
this.#place();
|
|
1325
|
+
popupRef.closed.pipe(take(1)).subscribe((event) => {
|
|
1326
|
+
this.move$$.complete();
|
|
1327
|
+
this.moveEnd$$.complete();
|
|
1328
|
+
this.moveStart$$.complete();
|
|
1329
|
+
this.resize$$.complete();
|
|
1330
|
+
this.#closed$.next({
|
|
1331
|
+
value: event.result,
|
|
1332
|
+
via: event.via ?? PopupCloseSource.Programmatic
|
|
1333
|
+
});
|
|
1334
|
+
this.#closed$.complete();
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
move(params) {
|
|
1338
|
+
if (params.left != null) this.#left = params.left;
|
|
1339
|
+
if (params.top != null) this.#top = params.top;
|
|
1340
|
+
this.#place();
|
|
1341
|
+
}
|
|
1342
|
+
place(placement) {
|
|
1343
|
+
this.#left = placement.left;
|
|
1344
|
+
this.#top = placement.top;
|
|
1345
|
+
this.#place();
|
|
1346
|
+
}
|
|
1347
|
+
resize(params) {
|
|
1348
|
+
const size = {};
|
|
1349
|
+
if (params.width != null) size.width = params.width;
|
|
1350
|
+
if (params.height != null) size.height = params.height;
|
|
1351
|
+
if (size.width != null || size.height != null) this.setSize(size);
|
|
1352
|
+
if (params.center) this.center();
|
|
1353
|
+
}
|
|
1354
|
+
setComponentRef(componentRef) {
|
|
1355
|
+
this.#options.componentRef = componentRef;
|
|
1356
|
+
}
|
|
1357
|
+
setSize(size) {
|
|
1358
|
+
this.#popupRefOrThrow.overlayRef.updateSize(size);
|
|
1359
|
+
}
|
|
1360
|
+
#place() {
|
|
1361
|
+
positionGlobalOverlay(this.#popupRefOrThrow.overlayRef, {
|
|
1362
|
+
left: this.#left,
|
|
1363
|
+
top: this.#top
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
get close$() {
|
|
1367
|
+
const popupRef = this.#popupRefOrThrow;
|
|
1368
|
+
return popupRef.beforeClose.pipe(takeUntil(merge(popupRef.closed, this.#closed$).pipe(take(1))), map((event) => event));
|
|
1369
|
+
}
|
|
1370
|
+
get closed$() {
|
|
1371
|
+
return this.#closed$.asObservable();
|
|
1372
|
+
}
|
|
1373
|
+
get component() {
|
|
1374
|
+
return this.#options.componentRef ?? null;
|
|
1375
|
+
}
|
|
1376
|
+
get drag$() {
|
|
1377
|
+
return this.move$$.asObservable();
|
|
1378
|
+
}
|
|
1379
|
+
get dragEnd$() {
|
|
1380
|
+
return this.moveEnd$$.asObservable();
|
|
1381
|
+
}
|
|
1382
|
+
get dragStart$() {
|
|
1383
|
+
return this.moveStart$$.asObservable();
|
|
1384
|
+
}
|
|
1385
|
+
get element() {
|
|
1386
|
+
return this.#popupRefOrThrow.overlayRef.overlayElement;
|
|
1387
|
+
}
|
|
1388
|
+
get height() {
|
|
1389
|
+
return this.element.offsetHeight;
|
|
1390
|
+
}
|
|
1391
|
+
get placement() {
|
|
1392
|
+
return {
|
|
1393
|
+
left: this.#left,
|
|
1394
|
+
top: this.#top
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
get popupRef() {
|
|
1398
|
+
return this.#popupRefOrThrow;
|
|
1399
|
+
}
|
|
1400
|
+
get resize$() {
|
|
1401
|
+
return this.resize$$.asObservable();
|
|
1402
|
+
}
|
|
1403
|
+
get size() {
|
|
1404
|
+
const { height, maxHeight, maxWidth, minHeight, minWidth, width } = this.#popupRefOrThrow.overlayRef.getConfig();
|
|
1405
|
+
return {
|
|
1406
|
+
height,
|
|
1407
|
+
maxHeight,
|
|
1408
|
+
maxWidth,
|
|
1409
|
+
minHeight,
|
|
1410
|
+
minWidth,
|
|
1411
|
+
width
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
get width() {
|
|
1415
|
+
return this.element.offsetWidth;
|
|
1416
|
+
}
|
|
1417
|
+
get windowRef() {
|
|
1418
|
+
return this.#windowRef;
|
|
1419
|
+
}
|
|
1420
|
+
get #popupRefOrThrow() {
|
|
1421
|
+
if (!this.#options.popupRef) throw new Error("WindowReference: popupRef has not been initialized.");
|
|
1422
|
+
return this.#options.popupRef;
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1163
1425
|
const createWindowInjectorData = (settings) => {
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1426
|
+
return {
|
|
1427
|
+
actionTemplate: settings.actionTemplate,
|
|
1428
|
+
ariaLabel: settings.ariaLabel,
|
|
1429
|
+
closable: settings.closable ?? true,
|
|
1430
|
+
closeOnEscape: settings.closeOnEscape ?? true,
|
|
1431
|
+
content: settings.content,
|
|
1432
|
+
data: settings.data,
|
|
1433
|
+
draggable: settings.draggable ?? false,
|
|
1434
|
+
focusedElement: settings.focusedElement,
|
|
1435
|
+
footerTemplate: settings.footerTemplate,
|
|
1436
|
+
height: settings.height,
|
|
1437
|
+
left: settings.left,
|
|
1438
|
+
look: settings.look ?? "default",
|
|
1439
|
+
maxHeight: settings.maxHeight,
|
|
1440
|
+
maxWidth: settings.maxWidth,
|
|
1441
|
+
maximizable: settings.maximizable ?? true,
|
|
1442
|
+
messages: settings.messages,
|
|
1443
|
+
minHeight: settings.minHeight ?? 50,
|
|
1444
|
+
minWidth: settings.minWidth ?? 50,
|
|
1445
|
+
minimizable: settings.minimizable ?? true,
|
|
1446
|
+
modal: settings.modal,
|
|
1447
|
+
resizable: settings.resizable ?? false,
|
|
1448
|
+
rounded: settings.rounded ?? "medium",
|
|
1449
|
+
title: typeof settings.title === "string" ? settings.title : void 0,
|
|
1450
|
+
titleTemplate: typeof settings.title === "string" ? void 0 : settings.title,
|
|
1451
|
+
top: settings.top,
|
|
1452
|
+
width: settings.width
|
|
1453
|
+
};
|
|
1192
1454
|
};
|
|
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
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1455
|
+
var WindowService = class WindowService {
|
|
1456
|
+
#document = inject(DOCUMENT);
|
|
1457
|
+
#injector = inject(Injector);
|
|
1458
|
+
#popupService = inject(PopupService);
|
|
1459
|
+
open(settings) {
|
|
1460
|
+
const modal = settings.modal ?? false;
|
|
1461
|
+
const windowReference = new WindowReference({}, this.#document);
|
|
1462
|
+
const injectorData = {
|
|
1463
|
+
...createWindowInjectorData(settings),
|
|
1464
|
+
windowReference
|
|
1465
|
+
};
|
|
1466
|
+
const windowClass = typeof settings.windowClass === "string" ? [settings.windowClass] : settings.windowClass;
|
|
1467
|
+
const popupRef = this.#popupService.create({
|
|
1468
|
+
anchor: this.#document.body,
|
|
1469
|
+
backdropClass: modal ? [
|
|
1470
|
+
"fixed",
|
|
1471
|
+
"inset-0",
|
|
1472
|
+
"bg-background/50",
|
|
1473
|
+
"transition-opacity",
|
|
1474
|
+
"z-40",
|
|
1475
|
+
"backdrop-blur-xs"
|
|
1476
|
+
] : "transparent",
|
|
1477
|
+
blockScroll: modal,
|
|
1478
|
+
closeOnBackdropClick: false,
|
|
1479
|
+
closeOnEscape: settings.closeOnEscape ?? true,
|
|
1480
|
+
closeOnOutsideClick: false,
|
|
1481
|
+
content: WindowContentComponent,
|
|
1482
|
+
data: injectorData,
|
|
1483
|
+
hasBackdrop: modal,
|
|
1484
|
+
height: settings.height ?? "fit-content",
|
|
1485
|
+
injector: settings.injector,
|
|
1486
|
+
maxHeight: settings.maxHeight ?? "100dvh",
|
|
1487
|
+
maxWidth: settings.maxWidth ?? "100dvw",
|
|
1488
|
+
minHeight: settings.minHeight,
|
|
1489
|
+
minWidth: settings.minWidth,
|
|
1490
|
+
popupClass: ["shrink-0", ...(windowClass ?? []).flatMap((name) => name.split(/\s+/)).filter((name) => name !== "")],
|
|
1491
|
+
popupWrapperClass: "mona-popup-constrain-height",
|
|
1492
|
+
positionStrategy: "global",
|
|
1493
|
+
preventClose: settings.preventClose,
|
|
1494
|
+
providers: [{
|
|
1495
|
+
provide: WindowRef,
|
|
1496
|
+
useFactory: forwardRef(() => windowReference.windowRef)
|
|
1497
|
+
}, {
|
|
1498
|
+
provide: WINDOW_DATA,
|
|
1499
|
+
useValue: settings.data
|
|
1500
|
+
}],
|
|
1501
|
+
width: settings.width
|
|
1502
|
+
});
|
|
1503
|
+
windowReference.initializePopupRef(popupRef, {
|
|
1504
|
+
left: settings.left,
|
|
1505
|
+
top: settings.top
|
|
1506
|
+
});
|
|
1507
|
+
if (modal) {
|
|
1508
|
+
const release = inertOutside(popupRef.overlayRef.hostElement);
|
|
1509
|
+
merge(popupRef.closeStart, popupRef.closed).pipe(take(1)).subscribe(() => release());
|
|
1510
|
+
}
|
|
1511
|
+
afterNextRender({ write: () => popupRef.overlayRef.updatePosition() }, { injector: this.#injector });
|
|
1512
|
+
return windowReference.windowRef;
|
|
1513
|
+
}
|
|
1514
|
+
static {
|
|
1515
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1516
|
+
minVersion: "12.0.0",
|
|
1517
|
+
version: "22.2.6",
|
|
1518
|
+
ngImport: i0,
|
|
1519
|
+
type: WindowService,
|
|
1520
|
+
deps: [],
|
|
1521
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
static {
|
|
1525
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1526
|
+
minVersion: "12.0.0",
|
|
1527
|
+
version: "22.2.6",
|
|
1528
|
+
ngImport: i0,
|
|
1529
|
+
type: WindowService,
|
|
1530
|
+
providedIn: "root"
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1535
|
+
minVersion: "12.0.0",
|
|
1536
|
+
version: "22.2.6",
|
|
1537
|
+
ngImport: i0,
|
|
1538
|
+
type: WindowService,
|
|
1539
|
+
decorators: [{
|
|
1540
|
+
type: Injectable,
|
|
1541
|
+
args: [{ providedIn: "root" }]
|
|
1542
|
+
}]
|
|
1543
|
+
});
|
|
1544
|
+
var WindowComponent = class WindowComponent {
|
|
1545
|
+
#destroyRef;
|
|
1546
|
+
#windowService;
|
|
1547
|
+
#destroyed;
|
|
1548
|
+
#windowRef;
|
|
1549
|
+
constructor() {
|
|
1550
|
+
this.#destroyRef = inject(DestroyRef);
|
|
1551
|
+
this.#windowService = inject(WindowService);
|
|
1552
|
+
this.#destroyed = false;
|
|
1553
|
+
this.actionTemplate = contentChild(WindowActionTemplateDirective, {
|
|
1554
|
+
...ngDevMode ? { debugName: "actionTemplate" } : /* istanbul ignore next */ {},
|
|
1555
|
+
read: TemplateRef
|
|
1556
|
+
});
|
|
1557
|
+
this.contentTemplate = contentChild(WindowContentTemplateDirective, {
|
|
1558
|
+
...ngDevMode ? { debugName: "contentTemplate" } : /* istanbul ignore next */ {},
|
|
1559
|
+
read: TemplateRef
|
|
1560
|
+
});
|
|
1561
|
+
this.footerTemplate = contentChild(WindowFooterTemplateDirective, {
|
|
1562
|
+
...ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {},
|
|
1563
|
+
read: TemplateRef
|
|
1564
|
+
});
|
|
1565
|
+
this.projectedContent = viewChild.required("projectedContent", {
|
|
1566
|
+
...ngDevMode ? { debugName: "projectedContent" } : /* istanbul ignore next */ {},
|
|
1567
|
+
read: TemplateRef
|
|
1568
|
+
});
|
|
1569
|
+
this.titleTemplate = contentChild(WindowTitleTemplateDirective, {
|
|
1570
|
+
...ngDevMode ? { debugName: "titleTemplate" } : /* istanbul ignore next */ {},
|
|
1571
|
+
read: TemplateRef
|
|
1572
|
+
});
|
|
1573
|
+
this.ariaLabel = input(void 0, {
|
|
1574
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
1575
|
+
alias: "aria-label"
|
|
1576
|
+
});
|
|
1577
|
+
this.closable = input(true, ...ngDevMode ? [{ debugName: "closable" }] : /* istanbul ignore next */ []);
|
|
1578
|
+
this.close = output();
|
|
1579
|
+
this.closeOnEscape = input(true, ...ngDevMode ? [{ debugName: "closeOnEscape" }] : /* istanbul ignore next */ []);
|
|
1580
|
+
this.closed = output();
|
|
1581
|
+
this.dragEnd = output();
|
|
1582
|
+
this.dragStart = output();
|
|
1583
|
+
this.draggable = input(true, ...ngDevMode ? [{ debugName: "draggable" }] : /* istanbul ignore next */ []);
|
|
1584
|
+
this.focusedElement = input(...ngDevMode ? [void 0, { debugName: "focusedElement" }] : /* istanbul ignore next */ []);
|
|
1585
|
+
this.height = model(...ngDevMode ? [void 0, { debugName: "height" }] : /* istanbul ignore next */ []);
|
|
1586
|
+
this.left = model(...ngDevMode ? [void 0, { debugName: "left" }] : /* istanbul ignore next */ []);
|
|
1587
|
+
this.look = input("default", ...ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []);
|
|
1588
|
+
this.maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
1589
|
+
this.maxWidth = input(...ngDevMode ? [void 0, { debugName: "maxWidth" }] : /* istanbul ignore next */ []);
|
|
1590
|
+
this.maximizable = input(...ngDevMode ? [void 0, { debugName: "maximizable" }] : /* istanbul ignore next */ []);
|
|
1591
|
+
this.messages = input(...ngDevMode ? [void 0, { debugName: "messages" }] : /* istanbul ignore next */ []);
|
|
1592
|
+
this.minHeight = input(...ngDevMode ? [void 0, { debugName: "minHeight" }] : /* istanbul ignore next */ []);
|
|
1593
|
+
this.minWidth = input(...ngDevMode ? [void 0, { debugName: "minWidth" }] : /* istanbul ignore next */ []);
|
|
1594
|
+
this.minimizable = input(...ngDevMode ? [void 0, { debugName: "minimizable" }] : /* istanbul ignore next */ []);
|
|
1595
|
+
this.modal = input(...ngDevMode ? [void 0, { debugName: "modal" }] : /* istanbul ignore next */ []);
|
|
1596
|
+
this.resizable = input(...ngDevMode ? [void 0, { debugName: "resizable" }] : /* istanbul ignore next */ []);
|
|
1597
|
+
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
1598
|
+
this.title = input(...ngDevMode ? [void 0, { debugName: "title" }] : /* istanbul ignore next */ []);
|
|
1599
|
+
this.top = model(...ngDevMode ? [void 0, { debugName: "top" }] : /* istanbul ignore next */ []);
|
|
1600
|
+
this.width = model(...ngDevMode ? [void 0, { debugName: "width" }] : /* istanbul ignore next */ []);
|
|
1601
|
+
effect(() => {
|
|
1602
|
+
const top = this.top();
|
|
1603
|
+
const left = this.left();
|
|
1604
|
+
this.#windowRef?.move({
|
|
1605
|
+
top,
|
|
1606
|
+
left
|
|
1607
|
+
});
|
|
1608
|
+
});
|
|
1609
|
+
effect(() => {
|
|
1610
|
+
const height = this.height();
|
|
1611
|
+
const width = this.width();
|
|
1612
|
+
const center = untracked(() => this.top() == null && this.left() == null);
|
|
1613
|
+
this.#windowRef?.resize({
|
|
1614
|
+
height,
|
|
1615
|
+
width,
|
|
1616
|
+
center
|
|
1617
|
+
});
|
|
1618
|
+
});
|
|
1619
|
+
afterNextRender({ write: () => this.#openWindow() });
|
|
1620
|
+
this.#destroyRef.onDestroy(() => {
|
|
1621
|
+
this.#destroyed = true;
|
|
1622
|
+
this.#windowRef?.close();
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
closeWindow() {
|
|
1626
|
+
this.#windowRef?.close();
|
|
1627
|
+
}
|
|
1628
|
+
move(position) {
|
|
1629
|
+
this.#windowRef?.move(position);
|
|
1630
|
+
}
|
|
1631
|
+
openWindow() {
|
|
1632
|
+
this.#openWindow();
|
|
1633
|
+
}
|
|
1634
|
+
resize(dimensions) {
|
|
1635
|
+
this.#windowRef?.resize(dimensions);
|
|
1636
|
+
}
|
|
1637
|
+
#openWindow() {
|
|
1638
|
+
if (this.#windowRef || this.#destroyed) return;
|
|
1639
|
+
this.#windowRef = this.#windowService.open({
|
|
1640
|
+
actionTemplate: this.actionTemplate(),
|
|
1641
|
+
ariaLabel: this.ariaLabel(),
|
|
1642
|
+
closable: this.closable(),
|
|
1643
|
+
closeOnEscape: this.closeOnEscape(),
|
|
1644
|
+
content: this.contentTemplate() ?? this.projectedContent(),
|
|
1645
|
+
draggable: this.draggable(),
|
|
1646
|
+
focusedElement: this.focusedElement(),
|
|
1647
|
+
footerTemplate: this.footerTemplate(),
|
|
1648
|
+
height: this.height(),
|
|
1649
|
+
left: this.left(),
|
|
1650
|
+
look: this.look(),
|
|
1651
|
+
maxHeight: this.maxHeight(),
|
|
1652
|
+
maxWidth: this.maxWidth(),
|
|
1653
|
+
maximizable: this.maximizable(),
|
|
1654
|
+
messages: this.messages(),
|
|
1655
|
+
minHeight: this.minHeight(),
|
|
1656
|
+
minWidth: this.minWidth(),
|
|
1657
|
+
minimizable: this.minimizable(),
|
|
1658
|
+
modal: this.modal(),
|
|
1659
|
+
resizable: this.resizable(),
|
|
1660
|
+
rounded: this.rounded(),
|
|
1661
|
+
title: this.titleTemplate() ?? this.title(),
|
|
1662
|
+
top: this.top(),
|
|
1663
|
+
width: this.width()
|
|
1664
|
+
});
|
|
1665
|
+
this.#setSubscriptions();
|
|
1666
|
+
}
|
|
1667
|
+
#setCloseSubscription() {
|
|
1668
|
+
const windowRef = this.#windowRef;
|
|
1669
|
+
if (!windowRef) return;
|
|
1670
|
+
windowRef.close$.subscribe((event) => {
|
|
1671
|
+
if (!this.#destroyed) this.close.emit(event);
|
|
1672
|
+
});
|
|
1673
|
+
windowRef.closed$.subscribe(() => {
|
|
1674
|
+
if (this.#windowRef === windowRef) this.#windowRef = void 0;
|
|
1675
|
+
if (!this.#destroyed) this.closed.emit();
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
#setDragSubscription() {
|
|
1679
|
+
if (!this.#windowRef) return;
|
|
1680
|
+
this.#windowRef.drag$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
1681
|
+
if (event.left != null) this.left.set(event.left);
|
|
1682
|
+
if (event.top != null) this.top.set(event.top);
|
|
1683
|
+
});
|
|
1684
|
+
this.#windowRef.dragEnd$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1685
|
+
this.dragEnd.emit();
|
|
1686
|
+
});
|
|
1687
|
+
this.#windowRef.dragStart$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1688
|
+
this.dragStart.emit();
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
#setResizeSubscription() {
|
|
1692
|
+
if (!this.#windowRef) return;
|
|
1693
|
+
this.#windowRef.resize$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
|
|
1694
|
+
if (event.width != null) this.width.set(event.width);
|
|
1695
|
+
if (event.height != null) this.height.set(event.height);
|
|
1696
|
+
if (event.left != null) this.left.set(event.left);
|
|
1697
|
+
if (event.top != null) this.top.set(event.top);
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
#setSubscriptions() {
|
|
1701
|
+
this.#setCloseSubscription();
|
|
1702
|
+
this.#setDragSubscription();
|
|
1703
|
+
this.#setResizeSubscription();
|
|
1704
|
+
}
|
|
1705
|
+
static {
|
|
1706
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1707
|
+
minVersion: "12.0.0",
|
|
1708
|
+
version: "22.2.6",
|
|
1709
|
+
ngImport: i0,
|
|
1710
|
+
type: WindowComponent,
|
|
1711
|
+
deps: [],
|
|
1712
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
static {
|
|
1716
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1717
|
+
minVersion: "17.2.0",
|
|
1718
|
+
version: "22.2.6",
|
|
1719
|
+
type: WindowComponent,
|
|
1720
|
+
isStandalone: true,
|
|
1721
|
+
selector: "mona-window",
|
|
1722
|
+
inputs: {
|
|
1723
|
+
ariaLabel: {
|
|
1724
|
+
classPropertyName: "ariaLabel",
|
|
1725
|
+
publicName: "aria-label",
|
|
1726
|
+
isSignal: true,
|
|
1727
|
+
isRequired: false,
|
|
1728
|
+
transformFunction: null
|
|
1729
|
+
},
|
|
1730
|
+
closable: {
|
|
1731
|
+
classPropertyName: "closable",
|
|
1732
|
+
publicName: "closable",
|
|
1733
|
+
isSignal: true,
|
|
1734
|
+
isRequired: false,
|
|
1735
|
+
transformFunction: null
|
|
1736
|
+
},
|
|
1737
|
+
closeOnEscape: {
|
|
1738
|
+
classPropertyName: "closeOnEscape",
|
|
1739
|
+
publicName: "closeOnEscape",
|
|
1740
|
+
isSignal: true,
|
|
1741
|
+
isRequired: false,
|
|
1742
|
+
transformFunction: null
|
|
1743
|
+
},
|
|
1744
|
+
draggable: {
|
|
1745
|
+
classPropertyName: "draggable",
|
|
1746
|
+
publicName: "draggable",
|
|
1747
|
+
isSignal: true,
|
|
1748
|
+
isRequired: false,
|
|
1749
|
+
transformFunction: null
|
|
1750
|
+
},
|
|
1751
|
+
focusedElement: {
|
|
1752
|
+
classPropertyName: "focusedElement",
|
|
1753
|
+
publicName: "focusedElement",
|
|
1754
|
+
isSignal: true,
|
|
1755
|
+
isRequired: false,
|
|
1756
|
+
transformFunction: null
|
|
1757
|
+
},
|
|
1758
|
+
height: {
|
|
1759
|
+
classPropertyName: "height",
|
|
1760
|
+
publicName: "height",
|
|
1761
|
+
isSignal: true,
|
|
1762
|
+
isRequired: false,
|
|
1763
|
+
transformFunction: null
|
|
1764
|
+
},
|
|
1765
|
+
left: {
|
|
1766
|
+
classPropertyName: "left",
|
|
1767
|
+
publicName: "left",
|
|
1768
|
+
isSignal: true,
|
|
1769
|
+
isRequired: false,
|
|
1770
|
+
transformFunction: null
|
|
1771
|
+
},
|
|
1772
|
+
look: {
|
|
1773
|
+
classPropertyName: "look",
|
|
1774
|
+
publicName: "look",
|
|
1775
|
+
isSignal: true,
|
|
1776
|
+
isRequired: false,
|
|
1777
|
+
transformFunction: null
|
|
1778
|
+
},
|
|
1779
|
+
maxHeight: {
|
|
1780
|
+
classPropertyName: "maxHeight",
|
|
1781
|
+
publicName: "maxHeight",
|
|
1782
|
+
isSignal: true,
|
|
1783
|
+
isRequired: false,
|
|
1784
|
+
transformFunction: null
|
|
1785
|
+
},
|
|
1786
|
+
maxWidth: {
|
|
1787
|
+
classPropertyName: "maxWidth",
|
|
1788
|
+
publicName: "maxWidth",
|
|
1789
|
+
isSignal: true,
|
|
1790
|
+
isRequired: false,
|
|
1791
|
+
transformFunction: null
|
|
1792
|
+
},
|
|
1793
|
+
maximizable: {
|
|
1794
|
+
classPropertyName: "maximizable",
|
|
1795
|
+
publicName: "maximizable",
|
|
1796
|
+
isSignal: true,
|
|
1797
|
+
isRequired: false,
|
|
1798
|
+
transformFunction: null
|
|
1799
|
+
},
|
|
1800
|
+
messages: {
|
|
1801
|
+
classPropertyName: "messages",
|
|
1802
|
+
publicName: "messages",
|
|
1803
|
+
isSignal: true,
|
|
1804
|
+
isRequired: false,
|
|
1805
|
+
transformFunction: null
|
|
1806
|
+
},
|
|
1807
|
+
minHeight: {
|
|
1808
|
+
classPropertyName: "minHeight",
|
|
1809
|
+
publicName: "minHeight",
|
|
1810
|
+
isSignal: true,
|
|
1811
|
+
isRequired: false,
|
|
1812
|
+
transformFunction: null
|
|
1813
|
+
},
|
|
1814
|
+
minWidth: {
|
|
1815
|
+
classPropertyName: "minWidth",
|
|
1816
|
+
publicName: "minWidth",
|
|
1817
|
+
isSignal: true,
|
|
1818
|
+
isRequired: false,
|
|
1819
|
+
transformFunction: null
|
|
1820
|
+
},
|
|
1821
|
+
minimizable: {
|
|
1822
|
+
classPropertyName: "minimizable",
|
|
1823
|
+
publicName: "minimizable",
|
|
1824
|
+
isSignal: true,
|
|
1825
|
+
isRequired: false,
|
|
1826
|
+
transformFunction: null
|
|
1827
|
+
},
|
|
1828
|
+
modal: {
|
|
1829
|
+
classPropertyName: "modal",
|
|
1830
|
+
publicName: "modal",
|
|
1831
|
+
isSignal: true,
|
|
1832
|
+
isRequired: false,
|
|
1833
|
+
transformFunction: null
|
|
1834
|
+
},
|
|
1835
|
+
resizable: {
|
|
1836
|
+
classPropertyName: "resizable",
|
|
1837
|
+
publicName: "resizable",
|
|
1838
|
+
isSignal: true,
|
|
1839
|
+
isRequired: false,
|
|
1840
|
+
transformFunction: null
|
|
1841
|
+
},
|
|
1842
|
+
rounded: {
|
|
1843
|
+
classPropertyName: "rounded",
|
|
1844
|
+
publicName: "rounded",
|
|
1845
|
+
isSignal: true,
|
|
1846
|
+
isRequired: false,
|
|
1847
|
+
transformFunction: null
|
|
1848
|
+
},
|
|
1849
|
+
title: {
|
|
1850
|
+
classPropertyName: "title",
|
|
1851
|
+
publicName: "title",
|
|
1852
|
+
isSignal: true,
|
|
1853
|
+
isRequired: false,
|
|
1854
|
+
transformFunction: null
|
|
1855
|
+
},
|
|
1856
|
+
top: {
|
|
1857
|
+
classPropertyName: "top",
|
|
1858
|
+
publicName: "top",
|
|
1859
|
+
isSignal: true,
|
|
1860
|
+
isRequired: false,
|
|
1861
|
+
transformFunction: null
|
|
1862
|
+
},
|
|
1863
|
+
width: {
|
|
1864
|
+
classPropertyName: "width",
|
|
1865
|
+
publicName: "width",
|
|
1866
|
+
isSignal: true,
|
|
1867
|
+
isRequired: false,
|
|
1868
|
+
transformFunction: null
|
|
1869
|
+
}
|
|
1870
|
+
},
|
|
1871
|
+
outputs: {
|
|
1872
|
+
close: "close",
|
|
1873
|
+
closed: "closed",
|
|
1874
|
+
dragEnd: "dragEnd",
|
|
1875
|
+
dragStart: "dragStart",
|
|
1876
|
+
height: "heightChange",
|
|
1877
|
+
left: "leftChange",
|
|
1878
|
+
top: "topChange",
|
|
1879
|
+
width: "widthChange"
|
|
1880
|
+
},
|
|
1881
|
+
host: {
|
|
1882
|
+
properties: { "attr.aria-label": "null" },
|
|
1883
|
+
classAttribute: "hidden"
|
|
1884
|
+
},
|
|
1885
|
+
queries: [
|
|
1886
|
+
{
|
|
1887
|
+
propertyName: "actionTemplate",
|
|
1888
|
+
first: true,
|
|
1889
|
+
predicate: WindowActionTemplateDirective,
|
|
1890
|
+
descendants: true,
|
|
1891
|
+
read: TemplateRef,
|
|
1892
|
+
isSignal: true
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
propertyName: "contentTemplate",
|
|
1896
|
+
first: true,
|
|
1897
|
+
predicate: WindowContentTemplateDirective,
|
|
1898
|
+
descendants: true,
|
|
1899
|
+
read: TemplateRef,
|
|
1900
|
+
isSignal: true
|
|
1901
|
+
},
|
|
1902
|
+
{
|
|
1903
|
+
propertyName: "footerTemplate",
|
|
1904
|
+
first: true,
|
|
1905
|
+
predicate: WindowFooterTemplateDirective,
|
|
1906
|
+
descendants: true,
|
|
1907
|
+
read: TemplateRef,
|
|
1908
|
+
isSignal: true
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
propertyName: "titleTemplate",
|
|
1912
|
+
first: true,
|
|
1913
|
+
predicate: WindowTitleTemplateDirective,
|
|
1914
|
+
descendants: true,
|
|
1915
|
+
read: TemplateRef,
|
|
1916
|
+
isSignal: true
|
|
1917
|
+
}
|
|
1918
|
+
],
|
|
1919
|
+
viewQueries: [{
|
|
1920
|
+
propertyName: "projectedContent",
|
|
1921
|
+
first: true,
|
|
1922
|
+
predicate: ["projectedContent"],
|
|
1923
|
+
descendants: true,
|
|
1924
|
+
read: TemplateRef,
|
|
1925
|
+
isSignal: true
|
|
1926
|
+
}],
|
|
1927
|
+
ngImport: i0,
|
|
1928
|
+
template: `<ng-template #projectedContent><ng-content /></ng-template>`,
|
|
1929
|
+
isInline: true
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
};
|
|
1933
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1934
|
+
minVersion: "12.0.0",
|
|
1935
|
+
version: "22.2.6",
|
|
1936
|
+
ngImport: i0,
|
|
1937
|
+
type: WindowComponent,
|
|
1938
|
+
decorators: [{
|
|
1939
|
+
type: Component,
|
|
1940
|
+
args: [{
|
|
1941
|
+
selector: "mona-window",
|
|
1942
|
+
template: `<ng-template #projectedContent><ng-content /></ng-template>`,
|
|
1943
|
+
host: {
|
|
1944
|
+
"[attr.aria-label]": "null",
|
|
1945
|
+
class: "hidden"
|
|
1946
|
+
}
|
|
1947
|
+
}]
|
|
1948
|
+
}],
|
|
1949
|
+
ctorParameters: () => [],
|
|
1950
|
+
propDecorators: {
|
|
1951
|
+
actionTemplate: [{
|
|
1952
|
+
type: i0.ContentChild,
|
|
1953
|
+
args: [i0.forwardRef(() => WindowActionTemplateDirective), {
|
|
1954
|
+
read: TemplateRef,
|
|
1955
|
+
isSignal: true
|
|
1956
|
+
}]
|
|
1957
|
+
}],
|
|
1958
|
+
contentTemplate: [{
|
|
1959
|
+
type: i0.ContentChild,
|
|
1960
|
+
args: [i0.forwardRef(() => WindowContentTemplateDirective), {
|
|
1961
|
+
read: TemplateRef,
|
|
1962
|
+
isSignal: true
|
|
1963
|
+
}]
|
|
1964
|
+
}],
|
|
1965
|
+
footerTemplate: [{
|
|
1966
|
+
type: i0.ContentChild,
|
|
1967
|
+
args: [i0.forwardRef(() => WindowFooterTemplateDirective), {
|
|
1968
|
+
read: TemplateRef,
|
|
1969
|
+
isSignal: true
|
|
1970
|
+
}]
|
|
1971
|
+
}],
|
|
1972
|
+
projectedContent: [{
|
|
1973
|
+
type: i0.ViewChild,
|
|
1974
|
+
args: ["projectedContent", {
|
|
1975
|
+
read: TemplateRef,
|
|
1976
|
+
isSignal: true
|
|
1977
|
+
}]
|
|
1978
|
+
}],
|
|
1979
|
+
titleTemplate: [{
|
|
1980
|
+
type: i0.ContentChild,
|
|
1981
|
+
args: [i0.forwardRef(() => WindowTitleTemplateDirective), {
|
|
1982
|
+
read: TemplateRef,
|
|
1983
|
+
isSignal: true
|
|
1984
|
+
}]
|
|
1985
|
+
}],
|
|
1986
|
+
ariaLabel: [{
|
|
1987
|
+
type: i0.Input,
|
|
1988
|
+
args: [{
|
|
1989
|
+
isSignal: true,
|
|
1990
|
+
alias: "aria-label",
|
|
1991
|
+
required: false
|
|
1992
|
+
}]
|
|
1993
|
+
}],
|
|
1994
|
+
closable: [{
|
|
1995
|
+
type: i0.Input,
|
|
1996
|
+
args: [{
|
|
1997
|
+
isSignal: true,
|
|
1998
|
+
alias: "closable",
|
|
1999
|
+
required: false
|
|
2000
|
+
}]
|
|
2001
|
+
}],
|
|
2002
|
+
close: [{
|
|
2003
|
+
type: i0.Output,
|
|
2004
|
+
args: ["close"]
|
|
2005
|
+
}],
|
|
2006
|
+
closeOnEscape: [{
|
|
2007
|
+
type: i0.Input,
|
|
2008
|
+
args: [{
|
|
2009
|
+
isSignal: true,
|
|
2010
|
+
alias: "closeOnEscape",
|
|
2011
|
+
required: false
|
|
2012
|
+
}]
|
|
2013
|
+
}],
|
|
2014
|
+
closed: [{
|
|
2015
|
+
type: i0.Output,
|
|
2016
|
+
args: ["closed"]
|
|
2017
|
+
}],
|
|
2018
|
+
dragEnd: [{
|
|
2019
|
+
type: i0.Output,
|
|
2020
|
+
args: ["dragEnd"]
|
|
2021
|
+
}],
|
|
2022
|
+
dragStart: [{
|
|
2023
|
+
type: i0.Output,
|
|
2024
|
+
args: ["dragStart"]
|
|
2025
|
+
}],
|
|
2026
|
+
draggable: [{
|
|
2027
|
+
type: i0.Input,
|
|
2028
|
+
args: [{
|
|
2029
|
+
isSignal: true,
|
|
2030
|
+
alias: "draggable",
|
|
2031
|
+
required: false
|
|
2032
|
+
}]
|
|
2033
|
+
}],
|
|
2034
|
+
focusedElement: [{
|
|
2035
|
+
type: i0.Input,
|
|
2036
|
+
args: [{
|
|
2037
|
+
isSignal: true,
|
|
2038
|
+
alias: "focusedElement",
|
|
2039
|
+
required: false
|
|
2040
|
+
}]
|
|
2041
|
+
}],
|
|
2042
|
+
height: [{
|
|
2043
|
+
type: i0.Input,
|
|
2044
|
+
args: [{
|
|
2045
|
+
isSignal: true,
|
|
2046
|
+
alias: "height",
|
|
2047
|
+
required: false
|
|
2048
|
+
}]
|
|
2049
|
+
}, {
|
|
2050
|
+
type: i0.Output,
|
|
2051
|
+
args: ["heightChange"]
|
|
2052
|
+
}],
|
|
2053
|
+
left: [{
|
|
2054
|
+
type: i0.Input,
|
|
2055
|
+
args: [{
|
|
2056
|
+
isSignal: true,
|
|
2057
|
+
alias: "left",
|
|
2058
|
+
required: false
|
|
2059
|
+
}]
|
|
2060
|
+
}, {
|
|
2061
|
+
type: i0.Output,
|
|
2062
|
+
args: ["leftChange"]
|
|
2063
|
+
}],
|
|
2064
|
+
look: [{
|
|
2065
|
+
type: i0.Input,
|
|
2066
|
+
args: [{
|
|
2067
|
+
isSignal: true,
|
|
2068
|
+
alias: "look",
|
|
2069
|
+
required: false
|
|
2070
|
+
}]
|
|
2071
|
+
}],
|
|
2072
|
+
maxHeight: [{
|
|
2073
|
+
type: i0.Input,
|
|
2074
|
+
args: [{
|
|
2075
|
+
isSignal: true,
|
|
2076
|
+
alias: "maxHeight",
|
|
2077
|
+
required: false
|
|
2078
|
+
}]
|
|
2079
|
+
}],
|
|
2080
|
+
maxWidth: [{
|
|
2081
|
+
type: i0.Input,
|
|
2082
|
+
args: [{
|
|
2083
|
+
isSignal: true,
|
|
2084
|
+
alias: "maxWidth",
|
|
2085
|
+
required: false
|
|
2086
|
+
}]
|
|
2087
|
+
}],
|
|
2088
|
+
maximizable: [{
|
|
2089
|
+
type: i0.Input,
|
|
2090
|
+
args: [{
|
|
2091
|
+
isSignal: true,
|
|
2092
|
+
alias: "maximizable",
|
|
2093
|
+
required: false
|
|
2094
|
+
}]
|
|
2095
|
+
}],
|
|
2096
|
+
messages: [{
|
|
2097
|
+
type: i0.Input,
|
|
2098
|
+
args: [{
|
|
2099
|
+
isSignal: true,
|
|
2100
|
+
alias: "messages",
|
|
2101
|
+
required: false
|
|
2102
|
+
}]
|
|
2103
|
+
}],
|
|
2104
|
+
minHeight: [{
|
|
2105
|
+
type: i0.Input,
|
|
2106
|
+
args: [{
|
|
2107
|
+
isSignal: true,
|
|
2108
|
+
alias: "minHeight",
|
|
2109
|
+
required: false
|
|
2110
|
+
}]
|
|
2111
|
+
}],
|
|
2112
|
+
minWidth: [{
|
|
2113
|
+
type: i0.Input,
|
|
2114
|
+
args: [{
|
|
2115
|
+
isSignal: true,
|
|
2116
|
+
alias: "minWidth",
|
|
2117
|
+
required: false
|
|
2118
|
+
}]
|
|
2119
|
+
}],
|
|
2120
|
+
minimizable: [{
|
|
2121
|
+
type: i0.Input,
|
|
2122
|
+
args: [{
|
|
2123
|
+
isSignal: true,
|
|
2124
|
+
alias: "minimizable",
|
|
2125
|
+
required: false
|
|
2126
|
+
}]
|
|
2127
|
+
}],
|
|
2128
|
+
modal: [{
|
|
2129
|
+
type: i0.Input,
|
|
2130
|
+
args: [{
|
|
2131
|
+
isSignal: true,
|
|
2132
|
+
alias: "modal",
|
|
2133
|
+
required: false
|
|
2134
|
+
}]
|
|
2135
|
+
}],
|
|
2136
|
+
resizable: [{
|
|
2137
|
+
type: i0.Input,
|
|
2138
|
+
args: [{
|
|
2139
|
+
isSignal: true,
|
|
2140
|
+
alias: "resizable",
|
|
2141
|
+
required: false
|
|
2142
|
+
}]
|
|
2143
|
+
}],
|
|
2144
|
+
rounded: [{
|
|
2145
|
+
type: i0.Input,
|
|
2146
|
+
args: [{
|
|
2147
|
+
isSignal: true,
|
|
2148
|
+
alias: "rounded",
|
|
2149
|
+
required: false
|
|
2150
|
+
}]
|
|
2151
|
+
}],
|
|
2152
|
+
title: [{
|
|
2153
|
+
type: i0.Input,
|
|
2154
|
+
args: [{
|
|
2155
|
+
isSignal: true,
|
|
2156
|
+
alias: "title",
|
|
2157
|
+
required: false
|
|
2158
|
+
}]
|
|
2159
|
+
}],
|
|
2160
|
+
top: [{
|
|
2161
|
+
type: i0.Input,
|
|
2162
|
+
args: [{
|
|
2163
|
+
isSignal: true,
|
|
2164
|
+
alias: "top",
|
|
2165
|
+
required: false
|
|
2166
|
+
}]
|
|
2167
|
+
}, {
|
|
2168
|
+
type: i0.Output,
|
|
2169
|
+
args: ["topChange"]
|
|
2170
|
+
}],
|
|
2171
|
+
width: [{
|
|
2172
|
+
type: i0.Input,
|
|
2173
|
+
args: [{
|
|
2174
|
+
isSignal: true,
|
|
2175
|
+
alias: "width",
|
|
2176
|
+
required: false
|
|
2177
|
+
}]
|
|
2178
|
+
}, {
|
|
2179
|
+
type: i0.Output,
|
|
2180
|
+
args: ["widthChange"]
|
|
2181
|
+
}]
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
1571
2184
|
export { WINDOW_DATA, WINDOW_DEFAULT_MESSAGES, WindowActionTemplateDirective, WindowComponent, WindowContentTemplateDirective, WindowFooterTemplateDirective, WindowRef, WindowService, WindowTitleTemplateDirective };
|
|
1572
|
-
|
|
2185
|
+
|
|
2186
|
+
//# sourceMappingURL=nanahoshi-mona-ui-window.mjs.map
|