@nanahoshi/mona-ui 0.25.1 → 0.26.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.
Files changed (222) hide show
  1. package/README.md +2 -0
  2. package/command/package.json +4 -0
  3. package/docs/auto-complete.md +733 -0
  4. package/docs/avatar.md +220 -0
  5. package/docs/breadcrumb.md +320 -0
  6. package/docs/button-group.md +392 -0
  7. package/docs/button.md +256 -0
  8. package/docs/calendar.md +515 -0
  9. package/docs/card.md +292 -0
  10. package/docs/chart.md +4058 -0
  11. package/docs/checkbox.md +374 -0
  12. package/docs/chip.md +339 -0
  13. package/docs/circular-progress-bar.md +287 -0
  14. package/docs/collapsible.md +308 -0
  15. package/docs/color-gradient.md +336 -0
  16. package/docs/color-palette.md +317 -0
  17. package/docs/color-picker.md +387 -0
  18. package/docs/combo-box.md +764 -0
  19. package/docs/command.md +582 -0
  20. package/docs/contextmenu.md +530 -0
  21. package/docs/date-picker.md +251 -0
  22. package/docs/datetime-picker.md +284 -0
  23. package/docs/decimal-textbox.md +260 -0
  24. package/docs/dialog.md +822 -0
  25. package/docs/dropdown-button.md +507 -0
  26. package/docs/dropdown-list.md +779 -0
  27. package/docs/editor.md +374 -0
  28. package/docs/expansion-panel.md +348 -0
  29. package/docs/fieldset.md +217 -0
  30. package/docs/forms.md +162 -0
  31. package/docs/grid.md +2053 -0
  32. package/docs/input.md +197 -0
  33. package/docs/installation.md +54 -0
  34. package/docs/introduction.md +46 -0
  35. package/docs/label.md +340 -0
  36. package/docs/list-box.md +637 -0
  37. package/docs/list-view.md +584 -0
  38. package/docs/menubar.md +559 -0
  39. package/docs/multi-select.md +765 -0
  40. package/docs/notification.md +460 -0
  41. package/docs/numeric-textbox.md +301 -0
  42. package/docs/otp-input.md +539 -0
  43. package/docs/pager.md +513 -0
  44. package/docs/placeholder.md +176 -0
  45. package/docs/popover.md +423 -0
  46. package/docs/popup-menu.md +658 -0
  47. package/docs/popup.md +617 -0
  48. package/docs/progress-bar.md +368 -0
  49. package/docs/radio-button.md +451 -0
  50. package/docs/range-slider.md +367 -0
  51. package/docs/rating.md +518 -0
  52. package/docs/scroll-view.md +375 -0
  53. package/docs/segmented.md +434 -0
  54. package/docs/sheet.md +348 -0
  55. package/docs/sidebar.md +1126 -0
  56. package/docs/skeleton.md +181 -0
  57. package/docs/slider.md +423 -0
  58. package/docs/spinner.md +370 -0
  59. package/docs/split-button.md +522 -0
  60. package/docs/splitter.md +342 -0
  61. package/docs/stepper.md +539 -0
  62. package/docs/switch.md +340 -0
  63. package/docs/tabs.md +542 -0
  64. package/docs/textarea.md +196 -0
  65. package/docs/textbox.md +332 -0
  66. package/docs/theming.md +403 -0
  67. package/docs/time-picker.md +254 -0
  68. package/docs/tooltip-directive.md +340 -0
  69. package/docs/tooltip.md +321 -0
  70. package/docs/tree-view.md +1018 -0
  71. package/docs/window.md +663 -0
  72. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
  73. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +8 -0
  74. package/fesm2022/nanahoshi-mona-ui-button.mjs +12 -0
  75. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +5 -2
  76. package/fesm2022/nanahoshi-mona-ui-chart.mjs +86 -0
  77. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +4 -0
  78. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +4 -0
  79. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +16 -2
  80. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
  81. package/fesm2022/nanahoshi-mona-ui-command.mjs +924 -0
  82. package/fesm2022/nanahoshi-mona-ui-common.mjs +4 -0
  83. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +10 -6
  84. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -1
  85. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -1
  86. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +9 -5
  87. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +9 -5
  88. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +55 -1
  89. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -2
  90. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +13 -0
  91. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +5 -0
  92. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs} +2 -2
  93. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs → nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs} +5 -5
  94. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs → nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs} +18 -35
  95. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs} +5 -5
  96. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs} +4653 -4529
  97. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  98. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
  99. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -0
  100. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +168 -0
  101. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +19 -1
  102. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +14 -0
  103. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +32 -0
  104. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +10 -0
  105. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +10 -0
  106. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +10 -0
  107. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +10 -0
  108. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +10 -0
  109. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +10 -0
  110. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +10 -0
  111. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +10 -0
  112. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +10 -0
  113. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +10 -0
  114. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +10 -0
  115. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +10 -0
  116. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +10 -0
  117. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +15 -8
  118. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +8 -5
  119. package/fesm2022/nanahoshi-mona-ui-notification.mjs +9 -0
  120. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1 -1
  121. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +5 -0
  122. package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -1
  123. package/fesm2022/nanahoshi-mona-ui-popover.mjs +14 -6
  124. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +48 -183
  125. package/fesm2022/nanahoshi-mona-ui-popup.mjs +16 -0
  126. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +4 -0
  127. package/fesm2022/nanahoshi-mona-ui-rating.mjs +2 -0
  128. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -0
  129. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +5 -5
  130. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +1 -1
  131. package/fesm2022/nanahoshi-mona-ui-slider.mjs +7 -2
  132. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +9 -6
  133. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +18 -21
  134. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +11 -8
  135. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +9 -1
  136. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -1
  137. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +16 -5
  138. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +13 -11
  139. package/fesm2022/nanahoshi-mona-ui-window.mjs +12 -5
  140. package/i18n/catalogs/en-US.messages.json +10 -0
  141. package/internal/popup-menu/package.json +4 -0
  142. package/llms.txt +123 -0
  143. package/locales/ar-sa/ar-sa.messages.json +10 -0
  144. package/locales/de-de/de-de.messages.json +10 -0
  145. package/locales/es-es/es-es.messages.json +10 -0
  146. package/locales/fr-fr/fr-fr.messages.json +10 -0
  147. package/locales/id-id/id-id.messages.json +10 -0
  148. package/locales/it-it/it-it.messages.json +10 -0
  149. package/locales/ja-jp/ja-jp.messages.json +10 -0
  150. package/locales/ko-kr/ko-kr.messages.json +10 -0
  151. package/locales/pt-br/pt-br.messages.json +10 -0
  152. package/locales/ru-ru/ru-ru.messages.json +10 -0
  153. package/locales/tr-tr/tr-tr.messages.json +10 -0
  154. package/locales/zh-cn/zh-cn.messages.json +10 -0
  155. package/locales/zh-tw/zh-tw.messages.json +10 -0
  156. package/package.json +9 -1
  157. package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -1
  158. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +8 -0
  159. package/types/nanahoshi-mona-ui-button.d.ts +12 -0
  160. package/types/nanahoshi-mona-ui-calendar.d.ts +3 -0
  161. package/types/nanahoshi-mona-ui-chart.d.ts +200 -0
  162. package/types/nanahoshi-mona-ui-check-box.d.ts +4 -0
  163. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +4 -0
  164. package/types/nanahoshi-mona-ui-collapsible.d.ts +10 -0
  165. package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -1
  166. package/types/nanahoshi-mona-ui-command.d.ts +253 -0
  167. package/types/nanahoshi-mona-ui-common.d.ts +17 -1
  168. package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -2
  169. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -1
  170. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -1
  171. package/types/nanahoshi-mona-ui-dialog.d.ts +58 -1
  172. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +7 -3
  173. package/types/nanahoshi-mona-ui-dropdowns.d.ts +55 -1
  174. package/types/nanahoshi-mona-ui-editor.d.ts +31 -0
  175. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +13 -0
  176. package/types/nanahoshi-mona-ui-fieldset.d.ts +5 -0
  177. package/types/nanahoshi-mona-ui-grid.d.ts +162 -35
  178. package/types/nanahoshi-mona-ui-i18n.d.ts +144 -1
  179. package/types/nanahoshi-mona-ui-internal-list.d.ts +16 -1
  180. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +165 -0
  181. package/types/nanahoshi-mona-ui-internal-tree.d.ts +21 -2
  182. package/types/nanahoshi-mona-ui-internal.d.ts +4 -5
  183. package/types/nanahoshi-mona-ui-label.d.ts +1 -0
  184. package/types/nanahoshi-mona-ui-list-box.d.ts +27 -4
  185. package/types/nanahoshi-mona-ui-list-view.d.ts +34 -1
  186. package/types/nanahoshi-mona-ui-list.d.ts +1 -1
  187. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +10 -0
  188. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +10 -0
  189. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +10 -0
  190. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +10 -0
  191. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +10 -0
  192. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +10 -0
  193. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +10 -0
  194. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +10 -0
  195. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +10 -0
  196. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +10 -0
  197. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +10 -0
  198. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +10 -0
  199. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +10 -0
  200. package/types/nanahoshi-mona-ui-menubar.d.ts +10 -3
  201. package/types/nanahoshi-mona-ui-multi-select.d.ts +3 -3
  202. package/types/nanahoshi-mona-ui-notification.d.ts +9 -0
  203. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -1
  204. package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
  205. package/types/nanahoshi-mona-ui-pager.d.ts +5 -1
  206. package/types/nanahoshi-mona-ui-popover.d.ts +9 -1
  207. package/types/nanahoshi-mona-ui-popup-menu.d.ts +48 -161
  208. package/types/nanahoshi-mona-ui-popup.d.ts +16 -0
  209. package/types/nanahoshi-mona-ui-progress-bar.d.ts +4 -0
  210. package/types/nanahoshi-mona-ui-rating.d.ts +2 -0
  211. package/types/nanahoshi-mona-ui-segmented.d.ts +1 -0
  212. package/types/nanahoshi-mona-ui-sheet.d.ts +1 -1
  213. package/types/nanahoshi-mona-ui-slider.d.ts +2 -0
  214. package/types/nanahoshi-mona-ui-spinner.d.ts +7 -0
  215. package/types/nanahoshi-mona-ui-split-button.d.ts +7 -4
  216. package/types/nanahoshi-mona-ui-stepper.d.ts +11 -2
  217. package/types/nanahoshi-mona-ui-tabs.d.ts +4 -1
  218. package/types/nanahoshi-mona-ui-text-box.d.ts +9 -1
  219. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -1
  220. package/types/nanahoshi-mona-ui-tooltip.d.ts +10 -2
  221. package/types/nanahoshi-mona-ui-tree-view.d.ts +6 -5
  222. package/types/nanahoshi-mona-ui-window.d.ts +66 -1
package/docs/window.md ADDED
@@ -0,0 +1,663 @@
1
+ # Window
2
+
3
+ > A draggable, resizable floating window that can be minimized and maximized.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/window`
6
+
7
+ **Selector:** `mona-window`
8
+
9
+ `WindowComponent` and `WindowService` display a draggable, resizable, minimizable/maximizable floating window with projected content.
10
+
11
+ ## Overview
12
+
13
+ Window displays a floating panel that the user can drag by its title bar, resize from its edges and corners, and minimize or maximize, with projected content and an optional footer/title/action bar. It is built on `PopupService` internally, like every other Mona UI overlay.
14
+
15
+ There are two ways to use it:
16
+
17
+ - **`WindowComponent`** (`<mona-window>`) is declarative. Place it behind an `@if` in your template; the window opens after the first render and closes when the host element is destroyed or when the consumer closes it.
18
+ - **`WindowService`** is imperative. Call `open()` with a `WindowSettings` object to open a window from code — useful from a service, an event handler, or anywhere without a fixed `@if` in a template.
19
+
20
+ **Use `Window` when:**
21
+
22
+ - The user needs to drag, resize, minimize, or maximize the overlay
23
+ - The content is closer to a floating panel or mini-application than a short message
24
+
25
+ **Use `Dialog` instead when:**
26
+
27
+ - You need a modal confirmation, message, or short form with built-in title/description/action-row structure, and dragging/resizing is not needed
28
+
29
+ **Use `Popup` directly when:**
30
+
31
+ - You need a custom anchored overlay with no title bar or window chrome at all
32
+
33
+ ## Import & Quick Start
34
+
35
+ ```typescript
36
+ import { WindowComponent } from "@nanahoshi/mona-ui/window";
37
+ ```
38
+
39
+ ```html
40
+ @if (windowVisible()) {
41
+ <mona-window title="Details" [resizable]="true" (closed)="windowVisible.set(false)">
42
+ <p>Window content goes here.</p>
43
+ </mona-window>
44
+ }
45
+ ```
46
+
47
+ `WindowComponent` opens automatically once its host renders, and whatever is placed inside it is the window's content. There is no explicit `open()` call for declarative usage — see [Reopening with `openWindow()`](#reopening-with-openwindow).
48
+
49
+ Imperative usage returns a `WindowRef` synchronously:
50
+
51
+ ```typescript
52
+ import { inject, TemplateRef, viewChild } from "@angular/core";
53
+ import { WindowService } from "@nanahoshi/mona-ui/window";
54
+
55
+ protected readonly content = viewChild<TemplateRef<unknown>>("content");
56
+ protected readonly windowService = inject(WindowService);
57
+
58
+ open(): void {
59
+ const windowRef = this.windowService.open({
60
+ title: "Details",
61
+ content: this.content(),
62
+ draggable: true,
63
+ resizable: true
64
+ });
65
+ }
66
+ ```
67
+
68
+ ## Anatomy
69
+
70
+ Window has four structural template directives, each an `ng-template` placed as projected content inside `<mona-window>...</mona-window>`.
71
+
72
+ | Directive | Selector | Template context | Replaces |
73
+ | -------------------------------- | ---------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
74
+ | `WindowTitleTemplateDirective` | `ng-template[monaWindowTitleTemplate]` | None | The `title` input |
75
+ | `WindowContentTemplateDirective` | `ng-template[monaWindowContentTemplate]` | None | Content placed directly inside `<mona-window>` |
76
+ | `WindowFooterTemplateDirective` | `ng-template[monaWindowFooterTemplate]` | None | No default — the footer area is empty unless provided |
77
+ | `WindowActionTemplateDirective` | `ng-template[monaWindowActionTemplate]` | `WindowActionTemplateContext` (`{ $implicit: WindowRef }`) | No default — renders next to the minimize/maximize/close buttons |
78
+
79
+ ```html
80
+ <mona-window [maximizable]="true">
81
+ <ng-template monaWindowTitleTemplate>
82
+ <span class="font-semibold">Details</span>
83
+ </ng-template>
84
+ <ng-template monaWindowActionTemplate let-windowRef>
85
+ <button monaButton look="ghost" size="small" (click)="windowRef.center()">Center</button>
86
+ </ng-template>
87
+ <ng-template monaWindowFooterTemplate>
88
+ <div class="flex justify-end gap-2 p-2 border-t border-border">
89
+ <button monaButton (click)="windowVisible.set(false)">Close</button>
90
+ </div>
91
+ </ng-template>
92
+ </mona-window>
93
+ ```
94
+
95
+ Content placed directly inside `<mona-window>`, outside these templates, is the window's content. A `monaWindowContentTemplate` takes its place when given; use it when the content should only be created once the window opens. `WindowService.open()` instead takes `content` as a `TemplateRef` or a component type directly on `WindowSettings`.
96
+
97
+ ## Examples
98
+
99
+ ### Draggable and resizable
100
+
101
+ `basic-example.component.ts`
102
+
103
+ ```typescript
104
+ import { Component, signal } from "@angular/core";
105
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
106
+ import { WindowComponent, WindowFooterTemplateDirective } from "@nanahoshi/mona-ui/window";
107
+
108
+ @Component({
109
+ selector: "app-window-basic-example",
110
+ imports: [ButtonDirective, WindowComponent, WindowFooterTemplateDirective],
111
+ templateUrl: "./basic-example.component.html"
112
+ })
113
+ export class WindowBasicExampleComponent {
114
+ protected readonly open = signal(false);
115
+ }
116
+ ```
117
+
118
+ `basic-example.component.html`
119
+
120
+ ```html
121
+ <button monaButton look="primary" type="button" (click)="open.set(true)">Open notes</button>
122
+
123
+ @if (open()) {
124
+ <mona-window title="Notes" [height]="240" [resizable]="true" [width]="360" (closed)="open.set(false)">
125
+ <p class="p-3 text-sm">Drag the title bar to move the window, and an edge or corner to resize it.</p>
126
+ <ng-template monaWindowFooterTemplate>
127
+ <div class="flex justify-end border-t border-border p-2">
128
+ <button monaButton size="small" type="button" (click)="open.set(false)">Close</button>
129
+ </div>
130
+ </ng-template>
131
+ </mona-window>
132
+ }
133
+ ```
134
+
135
+ On `<mona-window>`, `draggable` defaults to `true` and `resizable` to `false`. Through `WindowService.open()`, both default to `false`. The pointer drags the window by its title bar and resizes it from eight edge and corner handles. A drag starts once the pointer has moved a few pixels with the primary button pressed, and never from the title bar's buttons or the controls of an action template. A dragged window keeps its size past the viewport's edges, and its title bar stays below the top edge. The keyboard does both from the title bar — see [Keyboard](#keyboard).
136
+
137
+ ### Minimize and maximize
138
+
139
+ ```html
140
+ <mona-window title="Details" [minimizable]="true" [maximizable]="true"> </mona-window>
141
+ ```
142
+
143
+ Both default to `true` — set either to `false` to hide that button.
144
+
145
+ - **Minimize** collapses the window to its title bar and keeps its width. The content is hidden, not destroyed: form values, scroll positions and component state are all there after a restore. The minimize button becomes **Restore** while the window is minimized.
146
+ - **Maximize** fills the viewport, within `maxWidth` and `maxHeight`, and follows the viewport as it resizes. Double-clicking the title bar does the same when `maximizable` is `true`. **Restore** returns the window to the size and place it had. A maximized window can't be dragged or resized.
147
+
148
+ ### Two-way position and size binding
149
+
150
+ `position-example.component.ts`
151
+
152
+ ```typescript
153
+ import { Component, signal } from "@angular/core";
154
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
155
+ import { WindowComponent } from "@nanahoshi/mona-ui/window";
156
+
157
+ @Component({
158
+ selector: "app-window-position-example",
159
+ imports: [ButtonDirective, WindowComponent],
160
+ templateUrl: "./position-example.component.html"
161
+ })
162
+ export class WindowPositionExampleComponent {
163
+ protected readonly height = signal<number | undefined>(200);
164
+ protected readonly left = signal<number | undefined>(undefined);
165
+ protected readonly open = signal(false);
166
+ protected readonly top = signal<number | undefined>(undefined);
167
+ protected readonly width = signal<number | undefined>(320);
168
+ }
169
+ ```
170
+
171
+ `position-example.component.html`
172
+
173
+ ```html
174
+ <div class="flex flex-wrap items-center gap-2">
175
+ <button monaButton type="button" (click)="open.set(true)">Open</button>
176
+ <button monaButton type="button" (click)="top.set(16); left.set(16)">Move to the corner</button>
177
+ <span class="text-sm">Top: {{ top() ?? "centered" }}, left: {{ left() ?? "centered" }}</span>
178
+ </div>
179
+
180
+ @if (open()) {
181
+ <mona-window
182
+ title="Inspector"
183
+ [draggable]="true"
184
+ [resizable]="true"
185
+ [(height)]="height"
186
+ [(left)]="left"
187
+ [(top)]="top"
188
+ [(width)]="width"
189
+ (closed)="open.set(false)">
190
+ <p class="p-3 text-sm">Size: {{ width() }} × {{ height() }}</p>
191
+ </mona-window>
192
+ }
193
+ ```
194
+
195
+ `top`, `left`, `width`, and `height` are two-way models: dragging or resizing updates them, and setting them programmatically moves or resizes the open window — see [Live vs. one-shot inputs](#live-vs-one-shot-inputs).
196
+
197
+ ### Modal window
198
+
199
+ ```html
200
+ <mona-window title="Settings" [modal]="true"> </mona-window>
201
+ ```
202
+
203
+ `modal` (default `false`) adds a backdrop behind the window, traps focus inside it, locks page scroll, and makes the rest of the page `inert` while it is open, so the pointer, Tab and screen readers can't reach it. Popups opened from inside the window stay usable. Non-modal windows (the default) do not trap focus — the user can Tab out to the rest of the page.
204
+
205
+ ### Content from a component, with data
206
+
207
+ ```typescript
208
+ @Component({
209
+ template: `<p>{{ data.name }}</p>`
210
+ })
211
+ class UserWindowComponent {
212
+ protected readonly data = inject<{ name: string }>(WINDOW_DATA);
213
+ protected readonly windowRef = inject(WindowRef);
214
+ }
215
+
216
+ readonly #injector = inject(Injector);
217
+
218
+ open(): void {
219
+ this.windowService.open({
220
+ content: UserWindowComponent,
221
+ data: { name: "Mona" },
222
+ injector: this.#injector,
223
+ title: "User"
224
+ });
225
+ }
226
+ ```
227
+
228
+ `data` reaches a component through the `WINDOW_DATA` token, and a template as its implicit context (`<ng-template #content let-data>`, with `let-windowRef="windowRef"` for its `WindowRef`). `injector` is the content's parent injector: pass the opener's so the component can inject what the opener provides. Without it, the content resolves from the root injector. `WindowRef.component` returns the hosted component.
229
+
230
+ ### Preventing a close
231
+
232
+ Change the name and try to close the window: `preventDefault()` in the `close` handler keeps it open until the change is saved or undone.
233
+
234
+ `prevent-close-example.component.ts`
235
+
236
+ ```typescript
237
+ import { Component, signal } from "@angular/core";
238
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
239
+ import { LabelComponent } from "@nanahoshi/mona-ui/label";
240
+ import type { PopupCloseEvent } from "@nanahoshi/mona-ui/popup";
241
+ import { TextBoxComponent } from "@nanahoshi/mona-ui/text-box";
242
+ import { WindowComponent, WindowFooterTemplateDirective } from "@nanahoshi/mona-ui/window";
243
+
244
+ @Component({
245
+ selector: "app-window-prevent-close-example",
246
+ imports: [ButtonDirective, LabelComponent, TextBoxComponent, WindowComponent, WindowFooterTemplateDirective],
247
+ templateUrl: "./prevent-close-example.component.html"
248
+ })
249
+ export class WindowPreventCloseExampleComponent {
250
+ protected readonly message = signal("");
251
+ protected readonly name = signal("Ada");
252
+ protected readonly open = signal(false);
253
+ protected readonly saved = signal("Ada");
254
+
255
+ /** Keeps the window open while there are unsaved changes. */
256
+ protected confirmClose(event: PopupCloseEvent): void {
257
+ if (this.name() !== this.saved()) {
258
+ event.preventDefault();
259
+ this.message.set("Save or undo your changes before closing.");
260
+ }
261
+ }
262
+
263
+ protected save(): void {
264
+ this.saved.set(this.name());
265
+ this.message.set("Saved.");
266
+ }
267
+ }
268
+ ```
269
+
270
+ `prevent-close-example.component.html`
271
+
272
+ ```html
273
+ <button monaButton type="button" (click)="open.set(true)">Edit profile</button>
274
+
275
+ @if (open()) {
276
+ <mona-window title="Edit profile" [width]="340" (close)="confirmClose($event)" (closed)="open.set(false)">
277
+ <div class="flex flex-col gap-2 p-3">
278
+ <mona-label for="window-profile-name">Display name</mona-label>
279
+ <mona-text-box inputId="window-profile-name" [(value)]="name" />
280
+ <p aria-live="polite" class="text-sm">{{ message() }}</p>
281
+ </div>
282
+ <ng-template monaWindowFooterTemplate>
283
+ <div class="flex justify-end gap-2 border-t border-border p-2">
284
+ <button monaButton size="small" type="button" (click)="name.set(saved())">Undo</button>
285
+ <button monaButton look="primary" size="small" type="button" (click)="save()">Save</button>
286
+ </div>
287
+ </ng-template>
288
+ </mona-window>
289
+ }
290
+ ```
291
+
292
+ This works for both declarative and imperative usage (`WindowRef.close$`). `WindowSettings.preventClose` is an alternative available only through `WindowService.open()` — see [`preventClose` is service-only](#preventclose-is-service-only).
293
+
294
+ ### Reading how a window closed
295
+
296
+ This window is opened with `WindowService`, and its content calls `windowRef.close(value)`.
297
+
298
+ `service-example.component.ts`
299
+
300
+ ```typescript
301
+ import type { TemplateRef } from "@angular/core";
302
+ import { Component, inject, signal, viewChild } from "@angular/core";
303
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
304
+ import { LabelComponent } from "@nanahoshi/mona-ui/label";
305
+ import { TextBoxComponent } from "@nanahoshi/mona-ui/text-box";
306
+ import { WindowService } from "@nanahoshi/mona-ui/window";
307
+
308
+ @Component({
309
+ selector: "app-window-service-example",
310
+ imports: [ButtonDirective, LabelComponent, TextBoxComponent],
311
+ templateUrl: "./service-example.component.html"
312
+ })
313
+ export class WindowServiceExampleComponent {
314
+ readonly #windowService = inject(WindowService);
315
+ protected readonly draft = signal("");
316
+ protected readonly fileName = signal("report.pdf");
317
+ protected readonly renameTemplate = viewChild.required<TemplateRef<unknown>>("rename");
318
+
319
+ protected openRename(): void {
320
+ this.draft.set(this.fileName());
321
+ const windowRef = this.#windowService.open<string>({
322
+ content: this.renameTemplate(),
323
+ title: "Rename file",
324
+ width: 320
325
+ });
326
+ // closed$ completes once the window has closed, so there's nothing to unsubscribe.
327
+ windowRef.closed$.subscribe(({ value }) => {
328
+ if (value) {
329
+ this.fileName.set(value);
330
+ }
331
+ });
332
+ }
333
+ }
334
+ ```
335
+
336
+ `service-example.component.html`
337
+
338
+ ```html
339
+ <div class="flex items-center gap-3">
340
+ <button monaButton type="button" (click)="openRename()">Rename</button>
341
+ <span aria-live="polite" class="text-sm">File: {{ fileName() }}</span>
342
+ </div>
343
+
344
+ <ng-template #rename let-windowRef="windowRef">
345
+ <div class="flex flex-col gap-2 p-3">
346
+ <mona-label for="window-rename-input">New name</mona-label>
347
+ <mona-text-box inputId="window-rename-input" [(value)]="draft" />
348
+ <div class="flex justify-end gap-2">
349
+ <button monaButton size="small" type="button" (click)="windowRef.close()">Cancel</button>
350
+ <button monaButton look="primary" size="small" type="button" (click)="windowRef.close(draft())">
351
+ Rename
352
+ </button>
353
+ </div>
354
+ </div>
355
+ </ng-template>
356
+ ```
357
+
358
+ `closed$` emits a `WindowResult` once the window has closed: `value` is what was passed to `close(value)`, and `via` says what closed it.
359
+
360
+ ## Behavior
361
+
362
+ ### Live vs. one-shot inputs
363
+
364
+ `top`, `left`, `width`, and `height` are `model()` signals kept reactive for the lifetime of the window: setting any of them after the window opens moves or resizes it immediately, and dragging or resizing updates them back.
365
+
366
+ Every other input (`aria-label`, `closable`, `closeOnEscape`, `draggable`, `focusedElement`, `look`, `maxHeight`, `maxWidth`, `maximizable`, `minHeight`, `minWidth`, `minimizable`, `modal`, `resizable`, `rounded`, `title`, the content, and every `*Template` projected via content) is read once when the window opens. Changing them afterward has no effect on the already-open window.
367
+
368
+ ### Reopening with `openWindow()`
369
+
370
+ `WindowComponent` exposes a public `openWindow()` method, called automatically once after the component's first render. While the window is open, calling it does nothing. Once the window has closed (from its close button, Escape or `closeWindow()`) without the `<mona-window>` being removed, `openWindow()` opens it again.
371
+
372
+ ### `preventClose` is service-only
373
+
374
+ `WindowSettings.preventClose` has no equivalent input on `<mona-window>`. It is only available through `WindowService.open()`, and it is asked once per close, whatever starts it. To conditionally block a close when using the declarative element, cancel it from a `(close)` handler instead — see [Preventing a close](#preventing-a-close).
375
+
376
+ ### Positioning
377
+
378
+ `top` and `left` are pixels from the viewport's top-left corner, in left-to-right and right-to-left pages alike. Each axis is independent: an axis without a value is centered, and stays centered as the window's size changes. Dragging, resizing or moving the window with the keyboard fixes both axes where it is; `move()` fixes the axes it is given. `center()` centers both again. The window keeps its place when the text direction changes or the viewport resizes.
379
+
380
+ A window is capped to the viewport (`100dvw` by `100dvh`) unless `maxWidth` or `maxHeight` is set, and its body scrolls when the content is taller than the window.
381
+
382
+ ### Stacking
383
+
384
+ Pressing or focusing a window raises it above the other open windows. Focus stays where it was inside it. A new window opens on top.
385
+
386
+ ### The close contract
387
+
388
+ `close` (and `WindowRef.close$`) emits before any close — the close (X) button, the Escape key, a programmatic close, or the `<mona-window>` being destroyed. Call `event.preventDefault()` synchronously in a `close` handler to cancel it, the same way `PopupRef.beforeClose` works (see the Popup documentation's [Preventing a close](popup.md#preventing-a-close) section, since Window is built on the same mechanism). A close caused by destroying the `<mona-window>` can't be kept, and its outputs don't emit.
389
+
390
+ `closed` (and `WindowRef.closed$`) emits once the leave animation has finished. `closed$` carries a `WindowResult` and replays it to late subscribers. When the window closes, `close$`, `closed$`, `drag$`, `dragStart$`, `dragEnd$` and `resize$` all complete.
391
+
392
+ ## Forms Integration
393
+
394
+ Window is a container, not a form control, so it has no form integration.
395
+
396
+ ## Accessibility
397
+
398
+ ### Keyboard
399
+
400
+ | Key | Where | Action |
401
+ | ---------------------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------- |
402
+ | `Escape` | Anywhere in the window | Closes it, when `closeOnEscape` is `true` (the default) |
403
+ | `ArrowUp` / `ArrowDown` / `ArrowLeft` / `ArrowRight` | The title bar, when `draggable` | Moves the window 10px, keeping all of it in the viewport |
404
+ | `Control` (or `Command`) + an arrow key | The title bar, when `resizable` | Resizes the window 10px from its bottom and right edges, within its minimum and maximum sizes and the viewport |
405
+ | `Shift` with either of the above | The title bar | Moves or resizes 1px instead |
406
+
407
+ The title bar is one Tab stop when the window can be dragged or resized. Arrow keys pressed on its buttons, or on controls in an action template, are left to them. The resize handles are for the pointer and are not in the Tab order.
408
+
409
+ ### Focus
410
+
411
+ Window only traps focus while `modal` is `true`. When it opens, focus moves automatically to the first focusable element, unless `focusedElement` is provided, in which case focus moves there instead. This auto-focus-in happens regardless of `modal`.
412
+
413
+ ### ARIA
414
+
415
+ | Attribute | When present | Value |
416
+ | ----------------- | ------------------------------------------------- | ------------------------------------------------ |
417
+ | `role` | Always | `"dialog"` |
418
+ | `aria-labelledby` | When the window has a `title` or a title template | ID of the title element |
419
+ | `aria-label` | When the window has no title | The `aria-label` input, or the `ariaLabel` setting |
420
+ | `aria-modal` | Always | `"true"` for a modal window, otherwise `"false"` |
421
+
422
+ Each generated header button (`Minimize`/`Restore`, `Maximize`/`Restore`, `Close window`) has its own `aria-label`. When the window can be dragged or resized, the title bar is a `group` named after the keys it takes (`moveWindow`, `resizeWindow` or `moveOrResizeWindow`, e.g. `"Move window. Use arrow keys to move."`). The resize handles are `aria-hidden`.
423
+
424
+ A window without a `title`, a title template or an `aria-label` (`ariaLabel` in the service settings) has no accessible name. In development mode, such a window logs a warning.
425
+
426
+ ## API
427
+
428
+ Everything below is imported from `@nanahoshi/mona-ui/window`.
429
+
430
+ ### `WindowComponent`
431
+
432
+ **Selector:** `mona-window`
433
+
434
+ #### Inputs
435
+
436
+ | Name | Type | Default | Description |
437
+ | --- | --- | --- | --- |
438
+ | `aria-label` | `string \| undefined` | `undefined` | Accessible name for the window when it has no `title` or title template. |
439
+ | `closable` | `boolean` | `true` | Sets the visibility of the close button in the window header. |
440
+ | `closeOnEscape` | `boolean` | `true` | Sets whether the window should close when the escape key is pressed. |
441
+ | `draggable` | `boolean` | `true` | Sets whether the window can be dragged by the user. |
442
+ | `focusedElement` | `HTMLElement \| ElementRef<HTMLElement> \| string \| null` | — | Sets the element that should receive focus when the window is opened. Accepts an element reference or a query selector string. |
443
+ | `height` (two-way) | `number` | — | Sets the height of the window. |
444
+ | `left` (two-way) | `number` | — | Sets the left position of the window. |
445
+ | `look` | `"default" \| "primary"` | `"default"` | Sets the look of the window. |
446
+ | `maxHeight` | `number` | — | Sets the maximum height of the window. |
447
+ | `maximizable` | `boolean` | `true` | Sets whether the user can maximize the window. |
448
+ | `maxWidth` | `number` | — | Sets the maximum width of the window. |
449
+ | `messages` | `Partial<WindowMessages>` | — | Internationalization message overrides for accessible labels. |
450
+ | `minHeight` | `number` | — | Sets the minimum height of the window. |
451
+ | `minimizable` | `boolean` | `true` | Sets whether the user can minimize the window. |
452
+ | `minWidth` | `number` | — | Sets the minimum width of the window. |
453
+ | `modal` | `boolean` | `false` | Sets whether the window should have an overlay behind it. |
454
+ | `resizable` | `boolean` | `false` | Sets whether the user can resize the window. |
455
+ | `rounded` | `"large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the window. |
456
+ | `title` | `string` | — | Sets the title of the window. |
457
+ | `top` (two-way) | `number` | — | Sets the top position of the window. |
458
+ | `width` (two-way) | `number` | — | Sets the width of the window. |
459
+
460
+ #### Outputs
461
+
462
+ | Name | Type | Description |
463
+ | --- | --- | --- |
464
+ | `close` | `PopupCloseEvent<unknown>` | Emits before the window closes, whatever closes it: the close button, Escape, a programmatic close, or the component being destroyed. Call `preventDefault()` to keep it open (a close caused by destruction can't be kept). |
465
+ | `closed` | `void` | Emitted after the window has fully closed (post-animation). Preventing this event has no effect. |
466
+ | `dragEnd` | `void` | Emits when the window dragging ends. |
467
+ | `dragStart` | `void` | Emits when the window dragging starts. |
468
+ | `heightChange` | `number` | Emitted when `height` changes. |
469
+ | `leftChange` | `number` | Emitted when `left` changes. |
470
+ | `topChange` | `number` | Emitted when `top` changes. |
471
+ | `widthChange` | `number` | Emitted when `width` changes. |
472
+
473
+ #### Methods
474
+
475
+ | Signature | Description |
476
+ | --- | --- |
477
+ | `closeWindow(): void` | Closes the window. |
478
+ | `move(position: { top?: number; left?: number }): void` | Moves the window, in pixels. An axis that isn't given keeps its place. |
479
+ | `openWindow(): void` | Opens the window. Called once after the first render; call it again to reopen a window that was closed. Does nothing while the window is open. |
480
+ | `resize(dimensions: { width?: number; height?: number }): void` | Resizes the window, in pixels. A dimension that isn't given keeps its size. |
481
+
482
+ ### `WindowActionTemplateDirective`
483
+
484
+ **Selector:** `ng-template[monaWindowActionTemplate]`
485
+
486
+ ### `WindowContentTemplateDirective`
487
+
488
+ **Selector:** `ng-template[monaWindowContentTemplate]`
489
+
490
+ ### `WindowFooterTemplateDirective`
491
+
492
+ **Selector:** `ng-template[monaWindowFooterTemplate]`
493
+
494
+ ### `WindowTitleTemplateDirective`
495
+
496
+ **Selector:** `ng-template[monaWindowTitleTemplate]`
497
+
498
+ ### `WindowService`
499
+
500
+ #### Methods
501
+
502
+ | Signature | Description |
503
+ | --- | --- |
504
+ | `open<R = unknown, D = unknown>(settings: WindowSettings<D>): WindowRef<R>` | Opens a window. |
505
+
506
+ ### `WindowRef`
507
+
508
+ A handle on an open window.
509
+
510
+ **Type parameters:** `R = unknown`
511
+
512
+ #### Properties
513
+
514
+ | Name | Type | Description |
515
+ | --- | --- | --- |
516
+ | `close$` (read-only) | `Observable<PopupCloseEvent<R>>` | Emits before the window closes, whatever closes it. Call `preventDefault()` to keep it open. Completes once the window has closed. |
517
+ | `closed$` (read-only) | `Observable<WindowResult<R>>` | Emits how the window closed, once it has closed, then completes. Replays to late subscribers. |
518
+ | `component` (read-only) | `ComponentRef<unknown> \| null` | The hosted component, when `content` is a component rather than a `TemplateRef`. |
519
+ | `drag$` (read-only) | `Observable<MoveEvent>` | Emits while the window is dragged. Completes when it closes. |
520
+ | `dragEnd$` (read-only) | `Observable<void>` | Emits when a drag ends. Completes when the window closes. |
521
+ | `dragStart$` (read-only) | `Observable<void>` | Emits when a drag starts. Completes when the window closes. |
522
+ | `element` (read-only) | `HTMLElement` | The window's overlay element. |
523
+ | `height` (read-only) | `number` | The window's current rendered height, in pixels. |
524
+ | `popupRef` (read-only) | `PopupRef` | The underlying `PopupRef`, for advanced overlay access. |
525
+ | `resize$` (read-only) | `Observable<ResizeEvent>` | Emits while the window is resized by the user. Completes when it closes. |
526
+ | `width` (read-only) | `number` | The window's current rendered width, in pixels. |
527
+
528
+ #### Methods
529
+
530
+ | Signature | Description |
531
+ | --- | --- |
532
+ | `center(): void` | Centers the window in the viewport. It stays centered as its size changes, until it is moved. |
533
+ | `close(result?: R): void` | Closes the window. `close$` can still prevent it. |
534
+ | `closeWithDelay(delay: number, result?: R): void` | Closes the window after the given delay, in milliseconds. |
535
+ | `move(params: { top?: number; left?: number }): void` | Moves the window, in pixels from the viewport's top-left corner. An axis that isn't given keeps its place. |
536
+ | `resize(params: { width?: number; height?: number; center?: boolean }): void` | Resizes the window, in pixels. A dimension that isn't given keeps its size; `center` centers the window afterward. |
537
+
538
+ ### Types
539
+
540
+ #### `WINDOW_DATA`
541
+
542
+ The `data` a window was opened with, for a component given as its `content`.
543
+
544
+ ```typescript
545
+ const WINDOW_DATA: InjectionToken<unknown>;
546
+ ```
547
+
548
+ #### `WINDOW_DEFAULT_MESSAGES`
549
+
550
+ ```typescript
551
+ const WINDOW_DEFAULT_MESSAGES: MonaWindowMessages;
552
+ ```
553
+
554
+ #### `MoveEvent`
555
+
556
+ | Name | Type |
557
+ | --- | --- |
558
+ | `left` | `number` |
559
+ | `top` | `number` |
560
+
561
+ #### `ResizeEvent`
562
+
563
+ | Name | Type |
564
+ | --- | --- |
565
+ | `height` | `number` |
566
+ | `left` | `number` |
567
+ | `top` | `number` |
568
+ | `width` | `number` |
569
+
570
+ #### `WindowActionTemplateContext`
571
+
572
+ | Name | Type | Description |
573
+ | --- | --- | --- |
574
+ | `$implicit` | `WindowRef` | The window's own `WindowRef`, exposed to a `monaWindowActionTemplate` via `let-windowRef`. |
575
+
576
+ #### `WindowResult`
577
+
578
+ How a window closed, emitted once by `WindowRef.closed$`.
579
+
580
+ **Type parameters:** `R = unknown`
581
+
582
+ | Name | Type | Description |
583
+ | --- | --- | --- |
584
+ | `value` (read-only) | `R \| undefined` | The value passed to `close(value)`; `undefined` for the close button, Escape and the host being destroyed. |
585
+ | `via` (read-only) | `PopupCloseSource` | What closed the window: the close button, Escape, or a programmatic close. |
586
+
587
+ #### `WindowSettings`
588
+
589
+ **Type parameters:** `D = unknown`
590
+
591
+ | Name | Type | Description |
592
+ | --- | --- | --- |
593
+ | `actionTemplate?` | `TemplateRef<WindowActionTemplateContext>` | Template rendered next to the minimize/maximize/close buttons. |
594
+ | `ariaLabel?` | `string` | Accessible name for a window without a `title`. |
595
+ | `closable?` | `boolean` | Whether the title bar shows a close button. |
596
+ | `closeOnEscape?` | `boolean` | Whether pressing Escape closes the window. |
597
+ | `content?` | `TemplateRef<unknown> \| Type<unknown>` | The window's content — a template reference or a component class. |
598
+ | `data?` | `D` | Data for the content: a component injects it with `WINDOW_DATA`, a template gets it as its implicit context (`let-data`). |
599
+ | `draggable?` | `boolean` | Whether the user can move the window by its title bar. Unlike the `WindowComponent` input, this defaults to `false`. |
600
+ | `focusedElement?` | `HTMLElement \| ElementRef<HTMLElement> \| string \| null` | The element that receives focus when the window opens: an element, an element reference, or a CSS selector matched inside the window. |
601
+ | `footerTemplate?` | `TemplateRef<unknown>` | Template rendered in the window's footer area. |
602
+ | `height?` | `number` | Height in pixels. When omitted, the window fits its content. |
603
+ | `injector?` | `Injector` | Parent injector for the window's content. Pass the opener's injector so a component given as `content` can inject what the opener provides. Default: the root injector. |
604
+ | `left?` | `number` | Distance from the viewport's left edge in pixels. When omitted, the window is centered horizontally. |
605
+ | `look?` | `"default" \| "primary"` | The title bar's color scheme. |
606
+ | `maxHeight?` | `number` | Maximum height in pixels, also the limit for resizing. When omitted, the viewport's height is the limit. |
607
+ | `maximizable?` | `boolean` | Whether the title bar shows a maximize button. |
608
+ | `maxWidth?` | `number` | Maximum width in pixels, also the limit for resizing. When omitted, the viewport's width is the limit. |
609
+ | `messages?` | `Partial<WindowMessages>` | Overrides for the window's messages, such as the title bar button labels. |
610
+ | `minHeight?` | `number` | Minimum height in pixels. Resizing stops at it, or at 50 pixels when omitted. |
611
+ | `minimizable?` | `boolean` | Whether the title bar shows a minimize button. |
612
+ | `minWidth?` | `number` | Minimum width in pixels. Resizing stops at it, or at 50 pixels when omitted. |
613
+ | `modal?` | `boolean` | Whether the window is modal: a backdrop, `aria-modal="true"`, focus kept inside, page scroll locked, and the rest of the page inert. |
614
+ | `preventClose?` | `Action<PopupCloseEvent, boolean>` | Return `true` to cancel a close. See `preventClose` is service-only. |
615
+ | `resizable?` | `boolean` | Whether the user can resize the window by its edges and corners, or from the title bar with the keyboard. |
616
+ | `rounded?` | `"large" \| "medium" \| "none" \| "small"` | Border-radius preset for the window. |
617
+ | `title?` | `string \| TemplateRef<unknown>` | The window's title — a plain string or a template reference. |
618
+ | `top?` | `number` | Distance from the viewport's top edge in pixels. When omitted, the window is centered vertically. |
619
+ | `width?` | `number` | Width in pixels. When omitted, the window fits its content. |
620
+ | `windowClass?` | `string \| string[]` | Class(es) applied to the window's overlay element. |
621
+
622
+ #### `Action`
623
+
624
+ From `@nanahoshi/mona-ui/common`.
625
+
626
+ A function taking a `P` and returning an `R`.
627
+
628
+ ```typescript
629
+ type Action<P = void, R = void> = (arg: P) => R;
630
+ ```
631
+
632
+ #### `MonaWindowMessages`
633
+
634
+ From `@nanahoshi/mona-ui/i18n`.
635
+
636
+ | Name | Type | Description |
637
+ | --- | --- | --- |
638
+ | `close` (read-only) | `string` | The close button's tooltip. |
639
+ | `closeWindow` (read-only) | `string` | The close button's accessible name. |
640
+ | `maximize` (read-only) | `string` | The maximize button's tooltip and accessible name while the window isn't maximized. |
641
+ | `minimize` (read-only) | `string` | The minimize button's tooltip and accessible name while the window isn't minimized. |
642
+ | `moveOrResizeWindow` (read-only) | `string` | The title bar's name when the window can be both dragged and resized; it says which keys do each. |
643
+ | `moveWindow` (read-only) | `string` | The title bar's name when the window can be dragged but not resized. |
644
+ | `resizeBottom` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
645
+ | `resizeBottomLeft` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
646
+ | `resizeBottomRight` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
647
+ | `resizeLeft` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
648
+ | `resizeRight` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
649
+ | `resizeTop` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
650
+ | `resizeTopLeft` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
651
+ | `resizeTopRight` (read-only) | `string` | **Deprecated.** No longer rendered; resize handles are for the pointer, and the title bar resizes with the keyboard. |
652
+ | `resizeWindow` (read-only) | `string` | The title bar's name when the window can be resized but not dragged. |
653
+ | `restore` (read-only) | `string` | The tooltip and accessible name of the minimize or maximize button while it would restore the window. |
654
+
655
+ #### `WindowMessages`
656
+
657
+ From `@nanahoshi/mona-ui/i18n`.
658
+
659
+ ```typescript
660
+ type WindowMessages = MonaWindowMessages;
661
+ ```
662
+
663
+ **Documented elsewhere:** [`PopupCloseEvent`](popup.md), [`PopupCloseSource`](popup.md), [`PopupRef`](popup.md)
@@ -193,7 +193,7 @@ class AutoCompleteComponent {
193
193
  this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
194
194
  /**
195
195
  * @description Accessible name for the input. Describe what the autocomplete represents. Prefer a visible label,
196
- * linked through {@link inputId} or {@link ariaLabelledBy}; without any of them, browsers fall back to the
196
+ * linked through {@link inputId} or `aria-labelledby`; without any of them, browsers fall back to the
197
197
  * {@link placeholder}.
198
198
  * @default ""
199
199
  */