@4sh/ui-kit 0.16.0 → 0.17.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 (219) hide show
  1. package/README.fr.md +10 -10
  2. package/README.md +10 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +299 -2
  143. package/mcp/data/text-search-docs.json +149 -9
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  150. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  151. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  152. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  153. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  154. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  155. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
  156. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  157. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  158. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  159. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  160. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  161. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  162. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  163. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  164. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
  165. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
  166. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
  167. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  168. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
  169. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  170. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  171. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  172. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  173. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  174. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  175. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  176. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  177. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  178. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
  179. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  180. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  181. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  182. package/types/4sh-ui-kit-forms.d.ts +275 -194
  183. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  184. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  185. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  186. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  187. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  188. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  189. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  190. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  191. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  192. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  193. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  194. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  195. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  196. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  197. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  198. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  199. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  200. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  201. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  202. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  203. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  204. package/types/4sh-ui-kit-motion.d.ts +117 -67
  205. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  206. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  207. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  208. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  209. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  210. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  211. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  212. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  213. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  214. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  215. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  216. package/types/4sh-ui-kit-theming.d.ts +27 -29
  217. package/types/4sh-ui-kit-types.d.ts +6 -5
  218. package/types/4sh-ui-kit.d.ts +4 -3
  219. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,572 +1,1150 @@
1
- import * as i0 from '@angular/core';
2
- import { model, input, booleanAttribute, numberAttribute, contentChild, output, viewChild, signal, inject, PLATFORM_ID, computed, DestroyRef, effect, untracked, isDevMode, Component } from '@angular/core';
3
- import { DOCUMENT, isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
4
- import * as i1 from '@angular/cdk/a11y';
5
- import { A11yModule } from '@angular/cdk/a11y';
6
- import { UiMotion } from '@4sh/ui-kit/motion';
7
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
8
- import { lockBodyScroll, unlockBodyScroll } from '@4sh/ui-kit/overlay';
9
-
10
- /** Base stacking level — mirrors `$modal-z-index` in the SCSS. */
1
+ import * as i0 from "@angular/core";
2
+ import { Component, DestroyRef, PLATFORM_ID, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, model, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
3
+ import { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
4
+ import * as i1 from "@angular/cdk/a11y";
5
+ import { A11yModule } from "@angular/cdk/a11y";
6
+ import { UiMotion } from "@4sh/ui-kit/motion";
7
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
8
+ import { lockBodyScroll, unlockBodyScroll } from "@4sh/ui-kit/overlay";
11
9
  const MODAL_BASE_Z_INDEX = 1100;
12
- /** Process-wide sequence so `autoZIndex` layers a later dialog above earlier ones. */
13
10
  let zIndexSeq = 0;
14
- /** Process-wide unique id source (aria wiring + responsive style scoping). */
15
11
  let nextUid = 0;
16
- /**
17
- * ui-modal — headless dialog / modal window.
18
- *
19
- * A token-styled floating surface rendered over a viewport mask, driven by the
20
- * two-way `visible` model. Enter/leave run through the shared motion system
21
- * (mask fade + dialog `zoom` by default). Built for accessibility: focus trap
22
- * with focus restore (`@angular/cdk/a11y`), `aria-modal`, background scroll
23
- * lock, `Escape` to close, and an optional click-outside dismiss.
24
- *
25
- * Composes header / content / footer regions: a plain `header` string (or the
26
- * `#header` template), the default `<ng-content>` for the body, and a `#footer`
27
- * template for actions. Supports `draggable`, `maximizable`, nine `position`s,
28
- * modal / non-modal, and per-breakpoint widths (`breakpoints`).
29
- *
30
- * @example
31
- * ```html
32
- * <ui-button label="Ouvrir" (buttonClick)="open.set(true)" />
33
- * <ui-modal [(visible)]="open" header="Titre" [dialogStyle]="{ width: '32rem' }">
34
- * <p>Contenu…</p>
35
- * <ng-template #footer>
36
- * <ui-button label="Fermer" level="low" (buttonClick)="open.set(false)" />
37
- * </ng-template>
38
- * </ui-modal>
39
- * ```
40
- */
41
- class UiModal {
42
- constructor() {
43
- /** Open state (two-way). Toggling it drives the enter/leave animation. */
44
- this.visible = model(false, /* @ts-ignore */
45
- ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
46
- /** Simple header text (ignored when a `#header` template is projected). */
47
- this.header = input(/* @ts-ignore */
48
- ...(ngDevMode ? [undefined, { debugName: "header" }] : /* istanbul ignore next */ []));
49
- /** ARIA role of the dialog surface. */
50
- this.role = input('dialog', /* @ts-ignore */
51
- ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
52
- /** Accessible name when there is no visible header to reference. */
53
- this.ariaLabel = input(/* @ts-ignore */
54
- ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
55
- /** Id of an external element naming the dialog (overrides the header title). */
56
- this.ariaLabelledBy = input(/* @ts-ignore */
57
- ...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
58
- /** Show the mask (dim + capture) and block background scroll. */
59
- this.modal = input(true, { ...(ngDevMode ? { debugName: "modal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
60
- /** Close when the mask (outside the dialog) is clicked — modal only. */
61
- this.dismissableMask = input(false, { ...(ngDevMode ? { debugName: "dismissableMask" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
62
- /** Show the close (×) button and allow `Escape` to close. */
63
- this.closable = input(true, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
64
- /** Close the dialog when `Escape` is pressed. */
65
- this.closeOnEscape = input(true, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
66
- /** Block background scroll even for a non-modal dialog. */
67
- this.blockScroll = input(false, { ...(ngDevMode ? { debugName: "blockScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
68
- /** Render the header region (title + actions). */
69
- this.showHeader = input(true, { ...(ngDevMode ? { debugName: "showHeader" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
70
- /** Allow dragging the dialog by its header. */
71
- this.draggable = input(false, { ...(ngDevMode ? { debugName: "draggable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
72
- /** Keep the dialog fully inside the viewport while dragging. */
73
- this.keepInViewport = input(true, { ...(ngDevMode ? { debugName: "keepInViewport" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
74
- /** Minimum left offset kept while dragging (px). */
75
- this.minX = input(0, { ...(ngDevMode ? { debugName: "minX" } : /* istanbul ignore next */ {}), transform: numberAttribute });
76
- /** Minimum top offset kept while dragging (px). */
77
- this.minY = input(0, { ...(ngDevMode ? { debugName: "minY" } : /* istanbul ignore next */ {}), transform: numberAttribute });
78
- /** Show the maximize / restore toggle in the header. */
79
- this.maximizable = input(false, { ...(ngDevMode ? { debugName: "maximizable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
80
- /** Allow resizing the dialog from its bottom-right corner (pointer only). */
81
- this.resizable = input(false, { ...(ngDevMode ? { debugName: "resizable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
82
- /** Minimum dialog width while resizing (px). */
83
- this.minWidth = input(150, { ...(ngDevMode ? { debugName: "minWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
84
- /** Minimum dialog height while resizing (px). */
85
- this.minHeight = input(100, { ...(ngDevMode ? { debugName: "minHeight" } : /* istanbul ignore next */ {}), transform: numberAttribute });
86
- /** Anchor position inside the viewport mask. */
87
- this.position = input('center', /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
89
- /**
90
- * Scope the dialog to the nearest positioned ancestor (`position: absolute`)
91
- * instead of the viewport (`position: fixed`), and skip the body scroll lock.
92
- * Useful to embed a dialog inside a bounded container (docs previews, panels).
93
- */
94
- this.contained = input(false, { ...(ngDevMode ? { debugName: "contained" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
95
- /** Move focus into the dialog when it opens (auto-captured, restored on close). */
96
- this.focusOnShow = input(true, { ...(ngDevMode ? { debugName: "focusOnShow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
97
- /** Trap Tab focus inside the dialog while open. */
98
- this.focusTrap = input(true, { ...(ngDevMode ? { debugName: "focusTrap" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
99
- /** FontAwesome name of the close button icon. */
100
- this.closeIcon = input('xmark', /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "closeIcon" }] : /* istanbul ignore next */ []));
102
- /** FontAwesome name of the maximize icon. */
103
- this.maximizeIcon = input('expand', /* @ts-ignore */
104
- ...(ngDevMode ? [{ debugName: "maximizeIcon" }] : /* istanbul ignore next */ []));
105
- /** FontAwesome name of the restore (minimize) icon. */
106
- this.minimizeIcon = input('compress', /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "minimizeIcon" }] : /* istanbul ignore next */ []));
108
- /** Accessible name of the close button. */
109
- this.closeAriaLabel = input('Fermer', /* @ts-ignore */
110
- ...(ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []));
111
- /** Accessible name of the maximize / restore button. */
112
- this.maximizeAriaLabel = input('Agrandir', /* @ts-ignore */
113
- ...(ngDevMode ? [{ debugName: "maximizeAriaLabel" }] : /* istanbul ignore next */ []));
114
- /** Extra class(es) merged onto the dialog surface. */
115
- this.styleClass = input(/* @ts-ignore */
116
- ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
117
- /** Extra class(es) merged onto the mask. */
118
- this.maskStyleClass = input(/* @ts-ignore */
119
- ...(ngDevMode ? [undefined, { debugName: "maskStyleClass" }] : /* istanbul ignore next */ []));
120
- /** Inline styles applied to the dialog (e.g. `{ width: '32rem' }`). */
121
- this.dialogStyle = input(/* @ts-ignore */
122
- ...(ngDevMode ? [undefined, { debugName: "dialogStyle" }] : /* istanbul ignore next */ []));
123
- /** Per-breakpoint widths, keyed by a `max-width` (e.g. `{ '960px': '75vw' }`). */
124
- this.breakpoints = input(/* @ts-ignore */
125
- ...(ngDevMode ? [undefined, { debugName: "breakpoints" }] : /* istanbul ignore next */ []));
126
- /** Layer this dialog above earlier overlays automatically. */
127
- this.autoZIndex = input(true, { ...(ngDevMode ? { debugName: "autoZIndex" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
128
- /** Floor z-index (added to the auto value, or used as-is when `autoZIndex=false`). */
129
- this.baseZIndex = input(0, { ...(ngDevMode ? { debugName: "baseZIndex" } : /* istanbul ignore next */ {}), transform: numberAttribute });
130
- /** Enter/leave preset for the dialog surface (mask always fades). */
131
- this.motion = input('zoom', /* @ts-ignore */
132
- ...(ngDevMode ? [{ debugName: "motion" }] : /* istanbul ignore next */ []));
133
- /** Disable the open/close animation for this dialog. */
134
- this.motionDisabled = input(false, { ...(ngDevMode ? { debugName: "motionDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
135
- /** Custom header template (replaces the `header` string). */
136
- this.headerTemplate = contentChild('header', /* @ts-ignore */
137
- ...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
138
- /** Footer template (actions row). */
139
- this.footerTemplate = contentChild('footer', /* @ts-ignore */
140
- ...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
141
- /** Custom close-icon template (replaces `closeIcon`). */
142
- this.closeIconTemplate = contentChild('closeicon', /* @ts-ignore */
143
- ...(ngDevMode ? [{ debugName: "closeIconTemplate" }] : /* istanbul ignore next */ []));
144
- /** Emitted after the dialog becomes visible. */
145
- this.shown = output();
146
- /** Emitted after the dialog is hidden. */
147
- this.hidden = output();
148
- /** Emitted when the maximize state is toggled. */
149
- this.maximizedChange = output();
150
- /** Emitted when a drag gesture ends. */
151
- this.dragEnd = output();
152
- /** Emitted when a resize gesture ends. */
153
- this.resizeEnd = output();
154
- /** @ignore Scrollable body region (see `contentNeedsFocus`). */
155
- this.contentRef = viewChild('contentEl', /* @ts-ignore */
156
- ...(ngDevMode ? [{ debugName: "contentRef" }] : /* istanbul ignore next */ []));
157
- /** @ignore The body overflows and holds no focusable element of its own — it then needs to be
158
- * focusable itself so the scroll is keyboard-reachable (axe `scrollable-region-focusable`). */
159
- this.contentNeedsFocus = signal(false, /* @ts-ignore */
160
- ...(ngDevMode ? [{ debugName: "contentNeedsFocus" }] : /* istanbul ignore next */ []));
161
- /** @ignore */
162
- this.dialogRef = viewChild('dialog', /* @ts-ignore */
163
- ...(ngDevMode ? [{ debugName: "dialogRef" }] : /* istanbul ignore next */ []));
164
- /** @ignore Scrim host (for imperative `maskStyleClass` — a bound `[class]` would
165
- * fight the motion classes and break the leave animation). */
166
- this.scrimRef = viewChild('scrim', /* @ts-ignore */
167
- ...(ngDevMode ? [{ debugName: "scrimRef" }] : /* istanbul ignore next */ []));
168
- /** @ignore Classes currently applied to the scrim by `maskStyleClass`. */
169
- this.appliedMaskClasses = [];
170
- /** @ignore */
171
- this.document = inject(DOCUMENT);
172
- /** @ignore */
173
- this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
174
- /** @ignore Per-instance layering rank for `autoZIndex`. */
175
- this.zSeq = ++zIndexSeq;
176
- /** @ignore */
177
- this.uid = `ui-modal-${nextUid++}`;
178
- /** @ignore */
179
- this.titleId = `${this.uid}-title`;
180
- /** @ignore Maximized (fills the viewport). */
181
- this.maximized = signal(false, /* @ts-ignore */
182
- ...(ngDevMode ? [{ debugName: "maximized" }] : /* istanbul ignore next */ []));
183
- /** @ignore Cumulative drag offset applied via the independent `translate` property
184
- * (does not clash with the `zoom` animation, which drives `transform`). */
185
- this.dragOffset = signal(null, /* @ts-ignore */
186
- ...(ngDevMode ? [{ debugName: "dragOffset" }] : /* istanbul ignore next */ []));
187
- /** @ignore Explicit dialog size while resizing (overrides `dialogStyle` width/height). */
188
- this.resizeSize = signal(null, /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "resizeSize" }] : /* istanbul ignore next */ []));
190
- /** @ignore This instance currently holds a body scroll lock. */
191
- this.locked = false;
192
- /** @ignore Runtime `<style>` element backing `breakpoints`. */
193
- this.styleEl = null;
194
- /** @ignore Effective stacking level. */
195
- this.zIndex = computed(() => {
196
- const base = this.baseZIndex();
197
- if (this.autoZIndex())
198
- return MODAL_BASE_Z_INDEX + base + this.zSeq;
199
- return base > 0 ? base : MODAL_BASE_Z_INDEX;
200
- }, /* @ts-ignore */
201
- ...(ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []));
202
- // NOTE: the scrim and frame carry `animate.enter`/`animate.leave`. They MUST use a
203
- // static `class` + per-class `[class.x]` toggles (like ui-toast) — a whole-string
204
- // `[class]="expr()"` binding fights the motion classes Angular adds and restarts the
205
- // animation every frame (leave never ends → node never removed). Position is applied
206
- // via `[style]` for the same reason.
207
- /** @ignore Cross-axis alignment of the dialog inside the frame. */
208
- this.alignItems = computed(() => {
209
- const p = this.position();
210
- if (p.startsWith('top'))
211
- return 'flex-start';
212
- if (p.startsWith('bottom'))
213
- return 'flex-end';
214
- return 'center';
215
- }, /* @ts-ignore */
216
- ...(ngDevMode ? [{ debugName: "alignItems" }] : /* istanbul ignore next */ []));
217
- /** @ignore Main-axis alignment of the dialog inside the frame. */
218
- this.justifyContent = computed(() => {
219
- const p = this.position();
220
- if (p.endsWith('left'))
221
- return 'flex-start';
222
- if (p.endsWith('right'))
223
- return 'flex-end';
224
- return 'center';
225
- }, /* @ts-ignore */
226
- ...(ngDevMode ? [{ debugName: "justifyContent" }] : /* istanbul ignore next */ []));
227
- /** @ignore */
228
- this.dialogClasses = computed(() => {
229
- const c = ['ui-modal'];
230
- if (this.maximized())
231
- c.push('_maximized');
232
- if (this.contained())
233
- c.push('_contained');
234
- const extra = this.styleClass();
235
- if (extra)
236
- c.push(extra);
237
- return c.join(' ');
238
- }, /* @ts-ignore */
239
- ...(ngDevMode ? [{ debugName: "dialogClasses" }] : /* istanbul ignore next */ []));
240
- /** @ignore Header is draggable when enabled and not maximized. */
241
- this.headerDraggable = computed(() => this.draggable() && !this.maximized(), /* @ts-ignore */
242
- ...(ngDevMode ? [{ debugName: "headerDraggable" }] : /* istanbul ignore next */ []));
243
- /** @ignore Drag offset serialised for the `translate` CSS property. */
244
- this.dragTranslate = computed(() => {
245
- if (this.maximized())
246
- return null;
247
- const o = this.dragOffset();
248
- return o ? `${o.x}px ${o.y}px` : null;
249
- }, /* @ts-ignore */
250
- ...(ngDevMode ? [{ debugName: "dragTranslate" }] : /* istanbul ignore next */ []));
251
- /** @ignore Inline styles for the dialog: `dialogStyle` plus the resize size
252
- * (which wins), dropped entirely while maximized. */
253
- this.resolvedDialogStyle = computed(() => {
254
- if (this.maximized())
255
- return null;
256
- const base = { ...(this.dialogStyle() ?? {}) };
257
- const size = this.resizeSize();
258
- if (size) {
259
- base['width'] = `${size.w}px`;
260
- base['height'] = `${size.h}px`;
261
- }
262
- return Object.keys(base).length ? base : null;
263
- }, /* @ts-ignore */
264
- ...(ngDevMode ? [{ debugName: "resolvedDialogStyle" }] : /* istanbul ignore next */ []));
265
- /** @ignore The resize grip shows when resizable and not maximized. */
266
- this.showResizeHandle = computed(() => this.resizable() && !this.maximized(), /* @ts-ignore */
267
- ...(ngDevMode ? [{ debugName: "showResizeHandle" }] : /* istanbul ignore next */ []));
268
- /** @ignore Id of the element naming the dialog (header title, or an external id). */
269
- this.labelledBy = computed(() => this.ariaLabelledBy() ?? (this.showHeader() && this.header() ? this.titleId : null), /* @ts-ignore */
270
- ...(ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []));
271
- /** @ignore Fallback accessible name when nothing is referenced. */
272
- this.resolvedAriaLabel = computed(() => this.labelledBy() ? null : this.ariaLabel(), /* @ts-ignore */
273
- ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
274
- // --- Drag (header handle) -------------------------------------------
275
- /** @ignore */
276
- this.dragging = false;
277
- /** @ignore */
278
- this.lastX = 0;
279
- /** @ignore */
280
- this.lastY = 0;
281
- /** @ignore */
282
- this.moveHandler = (e) => this.onDrag(e);
283
- /** @ignore */
284
- this.upHandler = (e) => this.endDrag(e);
285
- // --- Resize (bottom-right grip) -------------------------------------
286
- /** @ignore */
287
- this.resizing = false;
288
- /** @ignore Pointer + size captured when the resize gesture starts. */
289
- this.resizeStart = { x: 0, y: 0, w: 0, h: 0 };
290
- /** @ignore */
291
- this.resizeMoveHandler = (e) => this.onResize(e);
292
- /** @ignore */
293
- this.resizeUpHandler = (e) => this.endResize(e);
294
- const destroyRef = inject(DestroyRef);
295
- let wasVisible = false;
296
- // Open/close side effects: scroll lock, lifecycle events, state reset.
297
- effect(() => {
298
- const v = this.visible();
299
- untracked(() => {
300
- if (v && !wasVisible) {
301
- wasVisible = true;
302
- // A contained dialog is embedded, not a real overlay → never lock the body.
303
- if (this.isBrowser && !this.contained() && (this.modal() || this.blockScroll())) {
304
- lockBodyScroll(this.document);
305
- this.locked = true;
306
- }
307
- this.shown.emit();
308
- }
309
- else if (!v && wasVisible) {
310
- wasVisible = false;
311
- this.releaseLock();
312
- this.maximized.set(false);
313
- this.dragOffset.set(null);
314
- this.resizeSize.set(null);
315
- this.hidden.emit();
316
- }
317
- });
318
- });
319
- // Watch the body region: it only earns a tab stop once it actually overflows and holds no
320
- // focusable element of its own. Measured rather than derived: the content is projected, so
321
- // neither its height nor what it contains is known from the inputs.
322
- if (this.isBrowser && typeof ResizeObserver !== 'undefined') {
323
- let observed = null;
324
- const ro = new ResizeObserver(() => this.measureContentFocusability());
325
- effect(() => {
326
- const el = this.contentRef()?.nativeElement ?? null;
327
- if (el === observed)
328
- return;
329
- if (observed)
330
- ro.unobserve(observed);
331
- observed = el;
332
- if (el) {
333
- ro.observe(el);
334
- this.measureContentFocusability();
335
- }
336
- else {
337
- this.contentNeedsFocus.set(false);
338
- }
339
- });
340
- destroyRef.onDestroy(() => ro.disconnect());
341
- }
342
- // Rebuild the responsive width stylesheet when `breakpoints` changes.
343
- effect(() => {
344
- const bps = this.breakpoints();
345
- untracked(() => this.applyBreakpoints(bps));
346
- });
347
- // Apply `maskStyleClass` imperatively (see scrimRef note).
348
- effect(() => {
349
- const el = this.scrimRef()?.nativeElement;
350
- const raw = this.maskStyleClass();
351
- untracked(() => {
352
- for (const c of this.appliedMaskClasses)
353
- el?.classList.remove(c);
354
- this.appliedMaskClasses = el && raw ? raw.split(/\s+/).filter(Boolean) : [];
355
- for (const c of this.appliedMaskClasses)
356
- el.classList.add(c);
357
- });
358
- });
359
- // A11y safeguard: a dialog must have an accessible name.
360
- if (isDevMode()) {
361
- effect(() => {
362
- if (this.visible() && !this.labelledBy() && !this.resolvedAriaLabel()) {
363
- console.warn('[ui-modal] Dialog has no accessible name: provide `header`, `ariaLabel` or `ariaLabelledBy`.');
364
- }
365
- });
366
- }
367
- destroyRef.onDestroy(() => {
368
- this.releaseLock();
369
- this.removeStyleElement();
370
- this.removeDragListeners();
371
- this.removeResizeListeners();
372
- });
373
- }
374
- /** Close the dialog. */
375
- close() {
376
- this.visible.set(false);
377
- }
378
- /** Move focus onto the dialog surface. */
379
- focus() {
380
- this.dialogRef()?.nativeElement.focus();
381
- }
382
- /** @ignore Toggle maximized; lock scroll for a non-modal dialog that now fills the screen. */
383
- toggleMaximize() {
384
- const next = !this.maximized();
385
- this.maximized.set(next);
386
- if (next) {
387
- this.dragOffset.set(null);
388
- this.resizeSize.set(null);
389
- }
390
- if (this.isBrowser && !this.contained() && !this.modal() && !this.blockScroll()) {
391
- if (next) {
392
- lockBodyScroll(this.document);
393
- this.locked = true;
394
- }
395
- else {
396
- this.releaseLock();
397
- }
398
- }
399
- this.maximizedChange.emit({ maximized: next });
400
- }
401
- /** @ignore Escape-to-close (bubbles from any focused control inside the dialog). */
402
- onKeydown(event) {
403
- if (event.key === 'Escape' && this.closeOnEscape() && this.closable()) {
404
- event.stopPropagation();
405
- this.close();
406
- }
407
- }
408
- /** @ignore Click-outside dismiss (mask target only, modal + dismissable). */
409
- onMaskPointerdown(event) {
410
- if (!this.modal() || !this.dismissableMask() || !this.closable())
411
- return;
412
- if (event.target === event.currentTarget)
413
- this.close();
414
- }
415
- /** @ignore */
416
- onHeaderPointerdown(event) {
417
- if (!this.headerDraggable() || event.button !== 0)
418
- return;
419
- // Never start a drag from the header action buttons.
420
- if (event.target.closest('button'))
421
- return;
422
- this.dragging = true;
423
- this.lastX = event.clientX;
424
- this.lastY = event.clientY;
425
- this.document.addEventListener('pointermove', this.moveHandler);
426
- this.document.addEventListener('pointerup', this.upHandler);
427
- this.document.body.style.userSelect = 'none';
428
- }
429
- /** @ignore */
430
- onDrag(event) {
431
- if (!this.dragging)
432
- return;
433
- const dx = event.clientX - this.lastX;
434
- const dy = event.clientY - this.lastY;
435
- const cur = this.dragOffset() ?? { x: 0, y: 0 };
436
- let nx = cur.x + dx;
437
- let ny = cur.y + dy;
438
- const el = this.dialogRef()?.nativeElement;
439
- if (this.keepInViewport() && el) {
440
- const rect = el.getBoundingClientRect();
441
- const view = this.document.defaultView;
442
- const vw = view?.innerWidth ?? rect.right;
443
- const vh = view?.innerHeight ?? rect.bottom;
444
- // Reject a delta that would push the dialog past a viewport edge.
445
- if (rect.left + dx < this.minX() || rect.right + dx > vw)
446
- nx = cur.x;
447
- if (rect.top + dy < this.minY() || rect.bottom + dy > vh)
448
- ny = cur.y;
449
- }
450
- this.lastX = event.clientX;
451
- this.lastY = event.clientY;
452
- this.dragOffset.set({ x: nx, y: ny });
453
- }
454
- /** @ignore */
455
- endDrag(_event) {
456
- if (!this.dragging)
457
- return;
458
- this.dragging = false;
459
- this.removeDragListeners();
460
- this.document.body.style.userSelect = '';
461
- this.dragEnd.emit();
462
- }
463
- /** @ignore */
464
- removeDragListeners() {
465
- this.document.removeEventListener('pointermove', this.moveHandler);
466
- this.document.removeEventListener('pointerup', this.upHandler);
467
- }
468
- /** @ignore Start a corner resize (seeds from the current rendered size). */
469
- onResizeStart(event) {
470
- if (!this.showResizeHandle() || event.button !== 0)
471
- return;
472
- // Keep the grip from bubbling to the frame (dismiss) / starting a drag.
473
- event.preventDefault();
474
- event.stopPropagation();
475
- const el = this.dialogRef()?.nativeElement;
476
- if (!el)
477
- return;
478
- const rect = el.getBoundingClientRect();
479
- this.resizing = true;
480
- this.resizeStart = { x: event.clientX, y: event.clientY, w: rect.width, h: rect.height };
481
- this.document.addEventListener('pointermove', this.resizeMoveHandler);
482
- this.document.addEventListener('pointerup', this.resizeUpHandler);
483
- this.document.body.style.userSelect = 'none';
484
- }
485
- /** @ignore */
486
- onResize(event) {
487
- if (!this.resizing)
488
- return;
489
- const view = this.document.defaultView;
490
- // `|| MAX` (not `??`) so a degenerate 0 viewport never clamps the dialog to nothing.
491
- const maxW = view?.innerWidth || Number.MAX_SAFE_INTEGER;
492
- const maxH = view?.innerHeight || Number.MAX_SAFE_INTEGER;
493
- const w = Math.min(maxW, Math.max(this.minWidth(), this.resizeStart.w + (event.clientX - this.resizeStart.x)));
494
- const h = Math.min(maxH, Math.max(this.minHeight(), this.resizeStart.h + (event.clientY - this.resizeStart.y)));
495
- this.resizeSize.set({ w, h });
496
- }
497
- /** @ignore */
498
- endResize(_event) {
499
- if (!this.resizing)
500
- return;
501
- this.resizing = false;
502
- this.removeResizeListeners();
503
- this.document.body.style.userSelect = '';
504
- const size = this.resizeSize();
505
- if (size)
506
- this.resizeEnd.emit({ width: size.w, height: size.h });
507
- }
508
- /** @ignore */
509
- removeResizeListeners() {
510
- this.document.removeEventListener('pointermove', this.resizeMoveHandler);
511
- this.document.removeEventListener('pointerup', this.resizeUpHandler);
512
- }
513
- // --- Internals -------------------------------------------------------
514
- /** @ignore Recomputes `contentNeedsFocus` from the rendered body. */
515
- measureContentFocusability() {
516
- const el = this.contentRef()?.nativeElement;
517
- if (!el) {
518
- this.contentNeedsFocus.set(false);
519
- return;
520
- }
521
- const overflows = el.scrollHeight > el.clientHeight + 1;
522
- const hasFocusable = !!el.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');
523
- this.contentNeedsFocus.set(overflows && !hasFocusable);
524
- }
525
- /** @ignore Release this instance's scroll lock, if held. */
526
- releaseLock() {
527
- if (this.locked) {
528
- unlockBodyScroll(this.document);
529
- this.locked = false;
530
- }
531
- }
532
- /** @ignore Build the responsive width rules (`max-width` media queries). */
533
- applyBreakpoints(bps) {
534
- if (!this.isBrowser)
535
- return;
536
- this.removeStyleElement();
537
- if (!bps || Object.keys(bps).length === 0)
538
- return;
539
- const el = this.document.createElement('style');
540
- let css = '';
541
- for (const bp of Object.keys(bps)) {
542
- css +=
543
- `@media screen and (max-width: ${bp}) {` +
544
- ` [data-modal-uid="${this.uid}"]:not(._maximized) { width: ${bps[bp]} !important; } }\n`;
545
- }
546
- el.textContent = css;
547
- this.document.head.appendChild(el);
548
- this.styleEl = el;
549
- }
550
- /** @ignore */
551
- removeStyleElement() {
552
- this.styleEl?.remove();
553
- this.styleEl = null;
554
- }
555
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiModal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
556
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiModal, isStandalone: true, selector: "ui-modal", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, blockScroll: { classPropertyName: "blockScroll", publicName: "blockScroll", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, keepInViewport: { classPropertyName: "keepInViewport", publicName: "keepInViewport", isSignal: true, isRequired: false, transformFunction: null }, minX: { classPropertyName: "minX", publicName: "minX", isSignal: true, isRequired: false, transformFunction: null }, minY: { classPropertyName: "minY", publicName: "minY", isSignal: true, isRequired: false, transformFunction: null }, maximizable: { classPropertyName: "maximizable", publicName: "maximizable", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, contained: { classPropertyName: "contained", publicName: "contained", isSignal: true, isRequired: false, transformFunction: null }, focusOnShow: { classPropertyName: "focusOnShow", publicName: "focusOnShow", isSignal: true, isRequired: false, transformFunction: null }, focusTrap: { classPropertyName: "focusTrap", publicName: "focusTrap", isSignal: true, isRequired: false, transformFunction: null }, closeIcon: { classPropertyName: "closeIcon", publicName: "closeIcon", isSignal: true, isRequired: false, transformFunction: null }, maximizeIcon: { classPropertyName: "maximizeIcon", publicName: "maximizeIcon", isSignal: true, isRequired: false, transformFunction: null }, minimizeIcon: { classPropertyName: "minimizeIcon", publicName: "minimizeIcon", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, maximizeAriaLabel: { classPropertyName: "maximizeAriaLabel", publicName: "maximizeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, maskStyleClass: { classPropertyName: "maskStyleClass", publicName: "maskStyleClass", isSignal: true, isRequired: false, transformFunction: null }, dialogStyle: { classPropertyName: "dialogStyle", publicName: "dialogStyle", isSignal: true, isRequired: false, transformFunction: null }, breakpoints: { classPropertyName: "breakpoints", publicName: "breakpoints", isSignal: true, isRequired: false, transformFunction: null }, autoZIndex: { classPropertyName: "autoZIndex", publicName: "autoZIndex", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, motionDisabled: { classPropertyName: "motionDisabled", publicName: "motionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", shown: "shown", hidden: "hidden", maximizedChange: "maximizedChange", dragEnd: "dragEnd", resizeEnd: "resizeEnd" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "closeIconTemplate", first: true, predicate: ["closeicon"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["contentEl"], descendants: true, isSignal: true }, { propertyName: "dialogRef", first: true, predicate: ["dialog"], descendants: true, isSignal: true }, { propertyName: "scrimRef", first: true, predicate: ["scrim"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (visible()) {\n <!-- Scrim + frame are SIBLINGS (both direct @if children) so each animates its own\n leave independently \u2014 a nested animated element would deadlock the removal.\n The frame carries the dialog's zoom; the dialog itself has no leave binding. -->\n @if (modal()) {\n <div\n #scrim\n class=\"ui-modal-scrim\"\n [class._contained]=\"contained()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"motionDisabled()\"\n #scrimMotion=\"uiMotion\"\n [animate.enter]=\"scrimMotion.enter()\"\n [animate.leave]=\"scrimMotion.leave()\"\n ></div>\n }\n\n <!-- Dialog: Escape/Tab handled on the container, focus lives in the\n content (CDK focus-trap). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-modal-frame\"\n [class._modal]=\"modal()\"\n [class._contained]=\"contained()\"\n [style.align-items]=\"alignItems()\"\n [style.justify-content]=\"justifyContent()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"motion()\"\n [motionDisabled]=\"motionDisabled()\"\n #frameMotion=\"uiMotion\"\n [animate.enter]=\"frameMotion.enter()\"\n [animate.leave]=\"frameMotion.leave()\"\n (pointerdown)=\"onMaskPointerdown($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div\n #dialog\n [class]=\"dialogClasses()\"\n [attr.data-modal-uid]=\"uid\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"modal() ? 'true' : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n tabindex=\"-1\"\n [style]=\"resolvedDialogStyle()\"\n [style.translate]=\"dragTranslate()\"\n [cdkTrapFocus]=\"focusTrap()\"\n [cdkTrapFocusAutoCapture]=\"focusOnShow()\"\n >\n @if (showHeader()) {\n <div\n class=\"ui-modal-header\"\n [class._draggable]=\"headerDraggable()\"\n (pointerdown)=\"onHeaderPointerdown($event)\"\n >\n <div [attr.id]=\"titleId\" class=\"ui-modal-title\">\n @if (headerTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ header() }}\n }\n </div>\n\n <div class=\"ui-modal-header-actions\">\n @if (maximizable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"maximizeAriaLabel()\"\n [attr.aria-pressed]=\"maximized()\"\n (click)=\"toggleMaximize()\"\n >\n <ui-icon [name]=\"maximized() ? minimizeIcon() : maximizeIcon()\" size=\"sm\" />\n </button>\n }\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n @if (closeIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n }\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Body: long content scrolls inside this region. It becomes focusable ONLY once it\n actually overflows AND holds nothing focusable of its own: a keyboard user must be able\n to reach the scrollbar (the footer buttons sit outside this region), but an unconditional\n tab stop would insert itself into the focus order of every dialog. -->\n <div #contentEl class=\"ui-modal-content\" [attr.tabindex]=\"contentNeedsFocus() ? 0 : null\">\n <ng-content />\n </div>\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-modal-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (showResizeHandle()) {\n <!-- Corner resize grip (pointer only, like a native textarea corner). -->\n <span\n class=\"ui-modal-resize-handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onResizeStart($event)\"\n ></span>\n }\n </div>\n </div>\n}\n", styles: [".ui-modal-scrim{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);pointer-events:none;background-color:var(--ui-modal-mask-background, var(--primitives-black-50))}.ui-modal-scrim._contained{position:absolute}.ui-modal-frame{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);display:flex;padding:var(--ui-modal-mask-padding, var(--units-lg));pointer-events:none}.ui-modal-frame._modal{pointer-events:auto}.ui-modal-frame._contained{position:absolute}.ui-modal{pointer-events:auto;position:relative;box-sizing:border-box;display:flex;flex-direction:column;max-width:min(90vw,35rem);max-height:90vh;border:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-stroke, var(--global-border-subtle));border-radius:var(--ui-modal-dialog-radius, var(--radius-md));background-color:var(--ui-modal-surface, var(--global-background-default));color:var(--ui-modal-color, var(--global-text-default));box-shadow:var(--shadow-default-lg);font-family:var(--ui-modal-font-family, var(--fontfamily-base));outline:none}.ui-modal._contained{max-width:100%;max-height:100%}.ui-modal._maximized{width:100vw;height:100vh;max-width:100vw;max-height:100vh;border-radius:0}.ui-modal._maximized._contained{width:100%;height:100%;max-width:100%;max-height:100%}.ui-modal-header{flex:0 0 auto;display:flex;align-items:var(--ui-modal-header-align, flex-start);gap:var(--ui-modal-header-gap, var(--units-sm));padding:var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg)) var(--units-sm)}.ui-modal-header._draggable{cursor:move;-webkit-user-select:none;user-select:none}.ui-modal-title{flex:1 1 auto;min-width:0;font-family:var(--ui-modal-title-font-family, var(--fontfamily-title));font-size:var(--size-typography-title-default);font-weight:var(--ui-modal-weight, var(--weight-bold));line-height:1.3;overflow-wrap:break-word}.ui-modal-header-actions{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-modal-header-actions-align, auto);gap:var(--units-2xs)}.ui-modal-action{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-modal-action-size, 2rem);height:var(--ui-modal-action-size, 2rem);padding:0;border:none;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-modal-action:hover{background-color:var(--ui-modal-close-surface-hover, var(--global-background-muted-hover));color:var(--ui-modal-close-color-hover, var(--global-text-muted-hover))}.ui-modal-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-modal-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-modal-close-focus-ring-color, var(--global-border-focus))}@media(prefers-reduced-motion:reduce){.ui-modal-action{transition-duration:.01ms}}:root[data-motion=off] .ui-modal-action{transition-duration:.01ms}.ui-modal-content{flex:1 1 auto;min-height:0;overflow-y:auto;padding:var(--ui-modal-dialog-padding, var(--units-lg));font-size:var(--size-typography-text-md);line-height:1.5}.ui-modal-header+.ui-modal-content{padding-top:0}.ui-modal-footer{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--units-sm);padding:var(--units-md) var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg));border-top:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-footer-stroke, var(--global-border-subtle))}.ui-modal-resize-handle{position:absolute;right:0;bottom:0;width:var(--ui-modal-resize-handle-size, 16px);height:var(--ui-modal-resize-handle-size, 16px);cursor:nwse-resize;touch-action:none;color:var(--ui-modal-resize-handle-color, var(--global-text-muted));background-image:repeating-linear-gradient(-45deg,currentColor 0 1px,transparent 1px 3px);-webkit-mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);opacity:.5}.ui-modal-resize-handle:hover{opacity:.8}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
557
- }
558
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiModal, decorators: [{
559
- type: Component,
560
- args: [{ selector: 'ui-modal', imports: [NgTemplateOutlet, A11yModule, UiMotion, UiIcon], template: "@if (visible()) {\n <!-- Scrim + frame are SIBLINGS (both direct @if children) so each animates its own\n leave independently \u2014 a nested animated element would deadlock the removal.\n The frame carries the dialog's zoom; the dialog itself has no leave binding. -->\n @if (modal()) {\n <div\n #scrim\n class=\"ui-modal-scrim\"\n [class._contained]=\"contained()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"motionDisabled()\"\n #scrimMotion=\"uiMotion\"\n [animate.enter]=\"scrimMotion.enter()\"\n [animate.leave]=\"scrimMotion.leave()\"\n ></div>\n }\n\n <!-- Dialog: Escape/Tab handled on the container, focus lives in the\n content (CDK focus-trap). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-modal-frame\"\n [class._modal]=\"modal()\"\n [class._contained]=\"contained()\"\n [style.align-items]=\"alignItems()\"\n [style.justify-content]=\"justifyContent()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"motion()\"\n [motionDisabled]=\"motionDisabled()\"\n #frameMotion=\"uiMotion\"\n [animate.enter]=\"frameMotion.enter()\"\n [animate.leave]=\"frameMotion.leave()\"\n (pointerdown)=\"onMaskPointerdown($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div\n #dialog\n [class]=\"dialogClasses()\"\n [attr.data-modal-uid]=\"uid\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"modal() ? 'true' : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n tabindex=\"-1\"\n [style]=\"resolvedDialogStyle()\"\n [style.translate]=\"dragTranslate()\"\n [cdkTrapFocus]=\"focusTrap()\"\n [cdkTrapFocusAutoCapture]=\"focusOnShow()\"\n >\n @if (showHeader()) {\n <div\n class=\"ui-modal-header\"\n [class._draggable]=\"headerDraggable()\"\n (pointerdown)=\"onHeaderPointerdown($event)\"\n >\n <div [attr.id]=\"titleId\" class=\"ui-modal-title\">\n @if (headerTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ header() }}\n }\n </div>\n\n <div class=\"ui-modal-header-actions\">\n @if (maximizable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"maximizeAriaLabel()\"\n [attr.aria-pressed]=\"maximized()\"\n (click)=\"toggleMaximize()\"\n >\n <ui-icon [name]=\"maximized() ? minimizeIcon() : maximizeIcon()\" size=\"sm\" />\n </button>\n }\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n @if (closeIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n }\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Body: long content scrolls inside this region. It becomes focusable ONLY once it\n actually overflows AND holds nothing focusable of its own: a keyboard user must be able\n to reach the scrollbar (the footer buttons sit outside this region), but an unconditional\n tab stop would insert itself into the focus order of every dialog. -->\n <div #contentEl class=\"ui-modal-content\" [attr.tabindex]=\"contentNeedsFocus() ? 0 : null\">\n <ng-content />\n </div>\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-modal-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (showResizeHandle()) {\n <!-- Corner resize grip (pointer only, like a native textarea corner). -->\n <span\n class=\"ui-modal-resize-handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onResizeStart($event)\"\n ></span>\n }\n </div>\n </div>\n}\n", styles: [".ui-modal-scrim{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);pointer-events:none;background-color:var(--ui-modal-mask-background, var(--primitives-black-50))}.ui-modal-scrim._contained{position:absolute}.ui-modal-frame{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);display:flex;padding:var(--ui-modal-mask-padding, var(--units-lg));pointer-events:none}.ui-modal-frame._modal{pointer-events:auto}.ui-modal-frame._contained{position:absolute}.ui-modal{pointer-events:auto;position:relative;box-sizing:border-box;display:flex;flex-direction:column;max-width:min(90vw,35rem);max-height:90vh;border:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-stroke, var(--global-border-subtle));border-radius:var(--ui-modal-dialog-radius, var(--radius-md));background-color:var(--ui-modal-surface, var(--global-background-default));color:var(--ui-modal-color, var(--global-text-default));box-shadow:var(--shadow-default-lg);font-family:var(--ui-modal-font-family, var(--fontfamily-base));outline:none}.ui-modal._contained{max-width:100%;max-height:100%}.ui-modal._maximized{width:100vw;height:100vh;max-width:100vw;max-height:100vh;border-radius:0}.ui-modal._maximized._contained{width:100%;height:100%;max-width:100%;max-height:100%}.ui-modal-header{flex:0 0 auto;display:flex;align-items:var(--ui-modal-header-align, flex-start);gap:var(--ui-modal-header-gap, var(--units-sm));padding:var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg)) var(--units-sm)}.ui-modal-header._draggable{cursor:move;-webkit-user-select:none;user-select:none}.ui-modal-title{flex:1 1 auto;min-width:0;font-family:var(--ui-modal-title-font-family, var(--fontfamily-title));font-size:var(--size-typography-title-default);font-weight:var(--ui-modal-weight, var(--weight-bold));line-height:1.3;overflow-wrap:break-word}.ui-modal-header-actions{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-modal-header-actions-align, auto);gap:var(--units-2xs)}.ui-modal-action{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-modal-action-size, 2rem);height:var(--ui-modal-action-size, 2rem);padding:0;border:none;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-modal-action:hover{background-color:var(--ui-modal-close-surface-hover, var(--global-background-muted-hover));color:var(--ui-modal-close-color-hover, var(--global-text-muted-hover))}.ui-modal-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-modal-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-modal-close-focus-ring-color, var(--global-border-focus))}@media(prefers-reduced-motion:reduce){.ui-modal-action{transition-duration:.01ms}}:root[data-motion=off] .ui-modal-action{transition-duration:.01ms}.ui-modal-content{flex:1 1 auto;min-height:0;overflow-y:auto;padding:var(--ui-modal-dialog-padding, var(--units-lg));font-size:var(--size-typography-text-md);line-height:1.5}.ui-modal-header+.ui-modal-content{padding-top:0}.ui-modal-footer{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--units-sm);padding:var(--units-md) var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg));border-top:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-footer-stroke, var(--global-border-subtle))}.ui-modal-resize-handle{position:absolute;right:0;bottom:0;width:var(--ui-modal-resize-handle-size, 16px);height:var(--ui-modal-resize-handle-size, 16px);cursor:nwse-resize;touch-action:none;color:var(--ui-modal-resize-handle-color, var(--global-text-muted));background-image:repeating-linear-gradient(-45deg,currentColor 0 1px,transparent 1px 3px);-webkit-mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);opacity:.5}.ui-modal-resize-handle:hover{opacity:.8}\n"] }]
561
- }], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], dismissableMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissableMask", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], blockScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockScroll", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], keepInViewport: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepInViewport", required: false }] }], minX: [{ type: i0.Input, args: [{ isSignal: true, alias: "minX", required: false }] }], minY: [{ type: i0.Input, args: [{ isSignal: true, alias: "minY", required: false }] }], maximizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximizable", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], contained: [{ type: i0.Input, args: [{ isSignal: true, alias: "contained", required: false }] }], focusOnShow: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusOnShow", required: false }] }], focusTrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusTrap", required: false }] }], closeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeIcon", required: false }] }], maximizeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximizeIcon", required: false }] }], minimizeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "minimizeIcon", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], maximizeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximizeAriaLabel", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], maskStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "maskStyleClass", required: false }] }], dialogStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogStyle", required: false }] }], breakpoints: [{ type: i0.Input, args: [{ isSignal: true, alias: "breakpoints", required: false }] }], autoZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoZIndex", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], motionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionDisabled", required: false }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { isSignal: true }] }], closeIconTemplate: [{ type: i0.ContentChild, args: ['closeicon', { isSignal: true }] }], shown: [{ type: i0.Output, args: ["shown"] }], hidden: [{ type: i0.Output, args: ["hidden"] }], maximizedChange: [{ type: i0.Output, args: ["maximizedChange"] }], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }], resizeEnd: [{ type: i0.Output, args: ["resizeEnd"] }], contentRef: [{ type: i0.ViewChild, args: ['contentEl', { isSignal: true }] }], dialogRef: [{ type: i0.ViewChild, args: ['dialog', { isSignal: true }] }], scrimRef: [{ type: i0.ViewChild, args: ['scrim', { isSignal: true }] }] } });
562
-
563
- /*
564
- * Public API Surface of ui-kit/ui-modal
565
- */
566
-
567
- /**
568
- * Generated bundle index. Do not edit.
569
- */
570
-
12
+ var UiModal = class UiModal {
13
+ constructor() {
14
+ this.visible = model(false, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
15
+ this.header = input(...ngDevMode ? [void 0, { debugName: "header" }] : /* istanbul ignore next */ []);
16
+ this.role = input("dialog", ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
17
+ this.ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
18
+ this.ariaLabelledBy = input(...ngDevMode ? [void 0, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
19
+ this.modal = input(true, {
20
+ ...ngDevMode ? { debugName: "modal" } : /* istanbul ignore next */ {},
21
+ transform: booleanAttribute
22
+ });
23
+ this.dismissableMask = input(false, {
24
+ ...ngDevMode ? { debugName: "dismissableMask" } : /* istanbul ignore next */ {},
25
+ transform: booleanAttribute
26
+ });
27
+ this.closable = input(true, {
28
+ ...ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {},
29
+ transform: booleanAttribute
30
+ });
31
+ this.closeOnEscape = input(true, {
32
+ ...ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {},
33
+ transform: booleanAttribute
34
+ });
35
+ this.blockScroll = input(false, {
36
+ ...ngDevMode ? { debugName: "blockScroll" } : /* istanbul ignore next */ {},
37
+ transform: booleanAttribute
38
+ });
39
+ this.showHeader = input(true, {
40
+ ...ngDevMode ? { debugName: "showHeader" } : /* istanbul ignore next */ {},
41
+ transform: booleanAttribute
42
+ });
43
+ this.draggable = input(false, {
44
+ ...ngDevMode ? { debugName: "draggable" } : /* istanbul ignore next */ {},
45
+ transform: booleanAttribute
46
+ });
47
+ this.keepInViewport = input(true, {
48
+ ...ngDevMode ? { debugName: "keepInViewport" } : /* istanbul ignore next */ {},
49
+ transform: booleanAttribute
50
+ });
51
+ this.minX = input(0, {
52
+ ...ngDevMode ? { debugName: "minX" } : /* istanbul ignore next */ {},
53
+ transform: numberAttribute
54
+ });
55
+ this.minY = input(0, {
56
+ ...ngDevMode ? { debugName: "minY" } : /* istanbul ignore next */ {},
57
+ transform: numberAttribute
58
+ });
59
+ this.maximizable = input(false, {
60
+ ...ngDevMode ? { debugName: "maximizable" } : /* istanbul ignore next */ {},
61
+ transform: booleanAttribute
62
+ });
63
+ this.resizable = input(false, {
64
+ ...ngDevMode ? { debugName: "resizable" } : /* istanbul ignore next */ {},
65
+ transform: booleanAttribute
66
+ });
67
+ this.minWidth = input(150, {
68
+ ...ngDevMode ? { debugName: "minWidth" } : /* istanbul ignore next */ {},
69
+ transform: numberAttribute
70
+ });
71
+ this.minHeight = input(100, {
72
+ ...ngDevMode ? { debugName: "minHeight" } : /* istanbul ignore next */ {},
73
+ transform: numberAttribute
74
+ });
75
+ this.position = input("center", ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
76
+ this.contained = input(false, {
77
+ ...ngDevMode ? { debugName: "contained" } : /* istanbul ignore next */ {},
78
+ transform: booleanAttribute
79
+ });
80
+ this.focusOnShow = input(true, {
81
+ ...ngDevMode ? { debugName: "focusOnShow" } : /* istanbul ignore next */ {},
82
+ transform: booleanAttribute
83
+ });
84
+ this.focusTrap = input(true, {
85
+ ...ngDevMode ? { debugName: "focusTrap" } : /* istanbul ignore next */ {},
86
+ transform: booleanAttribute
87
+ });
88
+ this.closeIcon = input("xmark", ...ngDevMode ? [{ debugName: "closeIcon" }] : /* istanbul ignore next */ []);
89
+ this.maximizeIcon = input("expand", ...ngDevMode ? [{ debugName: "maximizeIcon" }] : /* istanbul ignore next */ []);
90
+ this.minimizeIcon = input("compress", ...ngDevMode ? [{ debugName: "minimizeIcon" }] : /* istanbul ignore next */ []);
91
+ this.closeAriaLabel = input("Fermer", ...ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []);
92
+ this.maximizeAriaLabel = input("Agrandir", ...ngDevMode ? [{ debugName: "maximizeAriaLabel" }] : /* istanbul ignore next */ []);
93
+ this.styleClass = input(...ngDevMode ? [void 0, { debugName: "styleClass" }] : /* istanbul ignore next */ []);
94
+ this.maskStyleClass = input(...ngDevMode ? [void 0, { debugName: "maskStyleClass" }] : /* istanbul ignore next */ []);
95
+ this.dialogStyle = input(...ngDevMode ? [void 0, { debugName: "dialogStyle" }] : /* istanbul ignore next */ []);
96
+ this.breakpoints = input(...ngDevMode ? [void 0, { debugName: "breakpoints" }] : /* istanbul ignore next */ []);
97
+ this.autoZIndex = input(true, {
98
+ ...ngDevMode ? { debugName: "autoZIndex" } : /* istanbul ignore next */ {},
99
+ transform: booleanAttribute
100
+ });
101
+ this.baseZIndex = input(0, {
102
+ ...ngDevMode ? { debugName: "baseZIndex" } : /* istanbul ignore next */ {},
103
+ transform: numberAttribute
104
+ });
105
+ this.motion = input("zoom", ...ngDevMode ? [{ debugName: "motion" }] : /* istanbul ignore next */ []);
106
+ this.motionDisabled = input(false, {
107
+ ...ngDevMode ? { debugName: "motionDisabled" } : /* istanbul ignore next */ {},
108
+ transform: booleanAttribute
109
+ });
110
+ this.headerTemplate = contentChild("header", ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
111
+ this.footerTemplate = contentChild("footer", ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
112
+ this.closeIconTemplate = contentChild("closeicon", ...ngDevMode ? [{ debugName: "closeIconTemplate" }] : /* istanbul ignore next */ []);
113
+ this.shown = output();
114
+ this.hidden = output();
115
+ this.maximizedChange = output();
116
+ this.dragEnd = output();
117
+ this.resizeEnd = output();
118
+ this.contentRef = viewChild("contentEl", ...ngDevMode ? [{ debugName: "contentRef" }] : /* istanbul ignore next */ []);
119
+ this.contentNeedsFocus = signal(false, ...ngDevMode ? [{ debugName: "contentNeedsFocus" }] : /* istanbul ignore next */ []);
120
+ this.dialogRef = viewChild("dialog", ...ngDevMode ? [{ debugName: "dialogRef" }] : /* istanbul ignore next */ []);
121
+ this.scrimRef = viewChild("scrim", ...ngDevMode ? [{ debugName: "scrimRef" }] : /* istanbul ignore next */ []);
122
+ this.appliedMaskClasses = [];
123
+ this.document = inject(DOCUMENT);
124
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
125
+ this.zSeq = ++zIndexSeq;
126
+ this.uid = `ui-modal-${nextUid++}`;
127
+ this.titleId = `${this.uid}-title`;
128
+ this.maximized = signal(false, ...ngDevMode ? [{ debugName: "maximized" }] : /* istanbul ignore next */ []);
129
+ this.dragOffset = signal(null, ...ngDevMode ? [{ debugName: "dragOffset" }] : /* istanbul ignore next */ []);
130
+ this.resizeSize = signal(null, ...ngDevMode ? [{ debugName: "resizeSize" }] : /* istanbul ignore next */ []);
131
+ this.locked = false;
132
+ this.styleEl = null;
133
+ this.zIndex = computed(() => {
134
+ const base = this.baseZIndex();
135
+ if (this.autoZIndex()) return MODAL_BASE_Z_INDEX + base + this.zSeq;
136
+ return base > 0 ? base : MODAL_BASE_Z_INDEX;
137
+ }, ...ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []);
138
+ this.alignItems = computed(() => {
139
+ const p = this.position();
140
+ if (p.startsWith("top")) return "flex-start";
141
+ if (p.startsWith("bottom")) return "flex-end";
142
+ return "center";
143
+ }, ...ngDevMode ? [{ debugName: "alignItems" }] : /* istanbul ignore next */ []);
144
+ this.justifyContent = computed(() => {
145
+ const p = this.position();
146
+ if (p.endsWith("left")) return "flex-start";
147
+ if (p.endsWith("right")) return "flex-end";
148
+ return "center";
149
+ }, ...ngDevMode ? [{ debugName: "justifyContent" }] : /* istanbul ignore next */ []);
150
+ this.dialogClasses = computed(() => {
151
+ const c = ["ui-modal"];
152
+ if (this.maximized()) c.push("_maximized");
153
+ if (this.contained()) c.push("_contained");
154
+ const extra = this.styleClass();
155
+ if (extra) c.push(extra);
156
+ return c.join(" ");
157
+ }, ...ngDevMode ? [{ debugName: "dialogClasses" }] : /* istanbul ignore next */ []);
158
+ this.headerDraggable = computed(() => this.draggable() && !this.maximized(), ...ngDevMode ? [{ debugName: "headerDraggable" }] : /* istanbul ignore next */ []);
159
+ this.dragTranslate = computed(() => {
160
+ if (this.maximized()) return null;
161
+ const o = this.dragOffset();
162
+ return o ? `${o.x}px ${o.y}px` : null;
163
+ }, ...ngDevMode ? [{ debugName: "dragTranslate" }] : /* istanbul ignore next */ []);
164
+ this.resolvedDialogStyle = computed(() => {
165
+ if (this.maximized()) return null;
166
+ const base = { ...this.dialogStyle() ?? {} };
167
+ const size = this.resizeSize();
168
+ if (size) {
169
+ base["width"] = `${size.w}px`;
170
+ base["height"] = `${size.h}px`;
171
+ }
172
+ return Object.keys(base).length ? base : null;
173
+ }, ...ngDevMode ? [{ debugName: "resolvedDialogStyle" }] : /* istanbul ignore next */ []);
174
+ this.showResizeHandle = computed(() => this.resizable() && !this.maximized(), ...ngDevMode ? [{ debugName: "showResizeHandle" }] : /* istanbul ignore next */ []);
175
+ this.labelledBy = computed(() => this.ariaLabelledBy() ?? (this.showHeader() && this.header() ? this.titleId : null), ...ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []);
176
+ this.resolvedAriaLabel = computed(() => this.labelledBy() ? null : this.ariaLabel(), ...ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []);
177
+ this.dragging = false;
178
+ this.lastX = 0;
179
+ this.lastY = 0;
180
+ this.moveHandler = (e) => this.onDrag(e);
181
+ this.upHandler = (e) => this.endDrag(e);
182
+ this.resizing = false;
183
+ this.resizeStart = {
184
+ x: 0,
185
+ y: 0,
186
+ w: 0,
187
+ h: 0
188
+ };
189
+ this.resizeMoveHandler = (e) => this.onResize(e);
190
+ this.resizeUpHandler = (e) => this.endResize(e);
191
+ const destroyRef = inject(DestroyRef);
192
+ let wasVisible = false;
193
+ effect(() => {
194
+ const v = this.visible();
195
+ untracked(() => {
196
+ if (v && !wasVisible) {
197
+ wasVisible = true;
198
+ if (this.isBrowser && !this.contained() && (this.modal() || this.blockScroll())) {
199
+ lockBodyScroll(this.document);
200
+ this.locked = true;
201
+ }
202
+ this.shown.emit();
203
+ } else if (!v && wasVisible) {
204
+ wasVisible = false;
205
+ this.releaseLock();
206
+ this.maximized.set(false);
207
+ this.dragOffset.set(null);
208
+ this.resizeSize.set(null);
209
+ this.hidden.emit();
210
+ }
211
+ });
212
+ });
213
+ if (this.isBrowser && typeof ResizeObserver !== "undefined") {
214
+ let observed = null;
215
+ const ro = new ResizeObserver(() => this.measureContentFocusability());
216
+ effect(() => {
217
+ const el = this.contentRef()?.nativeElement ?? null;
218
+ if (el === observed) return;
219
+ if (observed) ro.unobserve(observed);
220
+ observed = el;
221
+ if (el) {
222
+ ro.observe(el);
223
+ this.measureContentFocusability();
224
+ } else this.contentNeedsFocus.set(false);
225
+ });
226
+ destroyRef.onDestroy(() => ro.disconnect());
227
+ }
228
+ effect(() => {
229
+ const bps = this.breakpoints();
230
+ untracked(() => this.applyBreakpoints(bps));
231
+ });
232
+ effect(() => {
233
+ const el = this.scrimRef()?.nativeElement;
234
+ const raw = this.maskStyleClass();
235
+ untracked(() => {
236
+ for (const c of this.appliedMaskClasses) el?.classList.remove(c);
237
+ this.appliedMaskClasses = el && raw ? raw.split(/\s+/).filter(Boolean) : [];
238
+ for (const c of this.appliedMaskClasses) el.classList.add(c);
239
+ });
240
+ });
241
+ if (isDevMode()) effect(() => {
242
+ if (this.visible() && !this.labelledBy() && !this.resolvedAriaLabel()) console.warn("[ui-modal] Dialog has no accessible name: provide `header`, `ariaLabel` or `ariaLabelledBy`.");
243
+ });
244
+ destroyRef.onDestroy(() => {
245
+ this.releaseLock();
246
+ this.removeStyleElement();
247
+ this.removeDragListeners();
248
+ this.removeResizeListeners();
249
+ });
250
+ }
251
+ close() {
252
+ this.visible.set(false);
253
+ }
254
+ focus() {
255
+ this.dialogRef()?.nativeElement.focus();
256
+ }
257
+ toggleMaximize() {
258
+ const next = !this.maximized();
259
+ this.maximized.set(next);
260
+ if (next) {
261
+ this.dragOffset.set(null);
262
+ this.resizeSize.set(null);
263
+ }
264
+ if (this.isBrowser && !this.contained() && !this.modal() && !this.blockScroll()) {
265
+ if (next) {
266
+ lockBodyScroll(this.document);
267
+ this.locked = true;
268
+ } else this.releaseLock();
269
+ }
270
+ this.maximizedChange.emit({ maximized: next });
271
+ }
272
+ onKeydown(event) {
273
+ if (event.key === "Escape" && this.closeOnEscape() && this.closable()) {
274
+ event.stopPropagation();
275
+ this.close();
276
+ }
277
+ }
278
+ onMaskPointerdown(event) {
279
+ if (!this.modal() || !this.dismissableMask() || !this.closable()) return;
280
+ if (event.target === event.currentTarget) this.close();
281
+ }
282
+ onHeaderPointerdown(event) {
283
+ if (!this.headerDraggable() || event.button !== 0) return;
284
+ if (event.target.closest("button")) return;
285
+ this.dragging = true;
286
+ this.lastX = event.clientX;
287
+ this.lastY = event.clientY;
288
+ this.document.addEventListener("pointermove", this.moveHandler);
289
+ this.document.addEventListener("pointerup", this.upHandler);
290
+ this.document.body.style.userSelect = "none";
291
+ }
292
+ onDrag(event) {
293
+ if (!this.dragging) return;
294
+ const dx = event.clientX - this.lastX;
295
+ const dy = event.clientY - this.lastY;
296
+ const cur = this.dragOffset() ?? {
297
+ x: 0,
298
+ y: 0
299
+ };
300
+ let nx = cur.x + dx;
301
+ let ny = cur.y + dy;
302
+ const el = this.dialogRef()?.nativeElement;
303
+ if (this.keepInViewport() && el) {
304
+ const rect = el.getBoundingClientRect();
305
+ const view = this.document.defaultView;
306
+ const vw = view?.innerWidth ?? rect.right;
307
+ const vh = view?.innerHeight ?? rect.bottom;
308
+ if (rect.left + dx < this.minX() || rect.right + dx > vw) nx = cur.x;
309
+ if (rect.top + dy < this.minY() || rect.bottom + dy > vh) ny = cur.y;
310
+ }
311
+ this.lastX = event.clientX;
312
+ this.lastY = event.clientY;
313
+ this.dragOffset.set({
314
+ x: nx,
315
+ y: ny
316
+ });
317
+ }
318
+ endDrag(_event) {
319
+ if (!this.dragging) return;
320
+ this.dragging = false;
321
+ this.removeDragListeners();
322
+ this.document.body.style.userSelect = "";
323
+ this.dragEnd.emit();
324
+ }
325
+ removeDragListeners() {
326
+ this.document.removeEventListener("pointermove", this.moveHandler);
327
+ this.document.removeEventListener("pointerup", this.upHandler);
328
+ }
329
+ onResizeStart(event) {
330
+ if (!this.showResizeHandle() || event.button !== 0) return;
331
+ event.preventDefault();
332
+ event.stopPropagation();
333
+ const el = this.dialogRef()?.nativeElement;
334
+ if (!el) return;
335
+ const rect = el.getBoundingClientRect();
336
+ this.resizing = true;
337
+ this.resizeStart = {
338
+ x: event.clientX,
339
+ y: event.clientY,
340
+ w: rect.width,
341
+ h: rect.height
342
+ };
343
+ this.document.addEventListener("pointermove", this.resizeMoveHandler);
344
+ this.document.addEventListener("pointerup", this.resizeUpHandler);
345
+ this.document.body.style.userSelect = "none";
346
+ }
347
+ onResize(event) {
348
+ if (!this.resizing) return;
349
+ const view = this.document.defaultView;
350
+ const maxW = view?.innerWidth || Number.MAX_SAFE_INTEGER;
351
+ const maxH = view?.innerHeight || Number.MAX_SAFE_INTEGER;
352
+ const w = Math.min(maxW, Math.max(this.minWidth(), this.resizeStart.w + (event.clientX - this.resizeStart.x)));
353
+ const h = Math.min(maxH, Math.max(this.minHeight(), this.resizeStart.h + (event.clientY - this.resizeStart.y)));
354
+ this.resizeSize.set({
355
+ w,
356
+ h
357
+ });
358
+ }
359
+ endResize(_event) {
360
+ if (!this.resizing) return;
361
+ this.resizing = false;
362
+ this.removeResizeListeners();
363
+ this.document.body.style.userSelect = "";
364
+ const size = this.resizeSize();
365
+ if (size) this.resizeEnd.emit({
366
+ width: size.w,
367
+ height: size.h
368
+ });
369
+ }
370
+ removeResizeListeners() {
371
+ this.document.removeEventListener("pointermove", this.resizeMoveHandler);
372
+ this.document.removeEventListener("pointerup", this.resizeUpHandler);
373
+ }
374
+ measureContentFocusability() {
375
+ const el = this.contentRef()?.nativeElement;
376
+ if (!el) {
377
+ this.contentNeedsFocus.set(false);
378
+ return;
379
+ }
380
+ const overflows = el.scrollHeight > el.clientHeight + 1;
381
+ const hasFocusable = !!el.querySelector("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])");
382
+ this.contentNeedsFocus.set(overflows && !hasFocusable);
383
+ }
384
+ releaseLock() {
385
+ if (this.locked) {
386
+ unlockBodyScroll(this.document);
387
+ this.locked = false;
388
+ }
389
+ }
390
+ applyBreakpoints(bps) {
391
+ if (!this.isBrowser) return;
392
+ this.removeStyleElement();
393
+ if (!bps || Object.keys(bps).length === 0) return;
394
+ const el = this.document.createElement("style");
395
+ let css = "";
396
+ for (const bp of Object.keys(bps)) css += `@media screen and (max-width: ${bp}) { [data-modal-uid="${this.uid}"]:not(._maximized) { width: ${bps[bp]} !important; } }\n`;
397
+ el.textContent = css;
398
+ this.document.head.appendChild(el);
399
+ this.styleEl = el;
400
+ }
401
+ removeStyleElement() {
402
+ this.styleEl?.remove();
403
+ this.styleEl = null;
404
+ }
405
+ static {
406
+ this.ɵfac = i0.ɵɵngDeclareFactory({
407
+ minVersion: "12.0.0",
408
+ version: "22.3.0",
409
+ ngImport: i0,
410
+ type: UiModal,
411
+ deps: [],
412
+ target: i0.ɵɵFactoryTarget.Component
413
+ });
414
+ }
415
+ static {
416
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
417
+ minVersion: "17.0.0",
418
+ version: "22.3.0",
419
+ type: UiModal,
420
+ isStandalone: true,
421
+ selector: "ui-modal",
422
+ inputs: {
423
+ visible: {
424
+ classPropertyName: "visible",
425
+ publicName: "visible",
426
+ isSignal: true,
427
+ isRequired: false,
428
+ transformFunction: null
429
+ },
430
+ header: {
431
+ classPropertyName: "header",
432
+ publicName: "header",
433
+ isSignal: true,
434
+ isRequired: false,
435
+ transformFunction: null
436
+ },
437
+ role: {
438
+ classPropertyName: "role",
439
+ publicName: "role",
440
+ isSignal: true,
441
+ isRequired: false,
442
+ transformFunction: null
443
+ },
444
+ ariaLabel: {
445
+ classPropertyName: "ariaLabel",
446
+ publicName: "ariaLabel",
447
+ isSignal: true,
448
+ isRequired: false,
449
+ transformFunction: null
450
+ },
451
+ ariaLabelledBy: {
452
+ classPropertyName: "ariaLabelledBy",
453
+ publicName: "ariaLabelledBy",
454
+ isSignal: true,
455
+ isRequired: false,
456
+ transformFunction: null
457
+ },
458
+ modal: {
459
+ classPropertyName: "modal",
460
+ publicName: "modal",
461
+ isSignal: true,
462
+ isRequired: false,
463
+ transformFunction: null
464
+ },
465
+ dismissableMask: {
466
+ classPropertyName: "dismissableMask",
467
+ publicName: "dismissableMask",
468
+ isSignal: true,
469
+ isRequired: false,
470
+ transformFunction: null
471
+ },
472
+ closable: {
473
+ classPropertyName: "closable",
474
+ publicName: "closable",
475
+ isSignal: true,
476
+ isRequired: false,
477
+ transformFunction: null
478
+ },
479
+ closeOnEscape: {
480
+ classPropertyName: "closeOnEscape",
481
+ publicName: "closeOnEscape",
482
+ isSignal: true,
483
+ isRequired: false,
484
+ transformFunction: null
485
+ },
486
+ blockScroll: {
487
+ classPropertyName: "blockScroll",
488
+ publicName: "blockScroll",
489
+ isSignal: true,
490
+ isRequired: false,
491
+ transformFunction: null
492
+ },
493
+ showHeader: {
494
+ classPropertyName: "showHeader",
495
+ publicName: "showHeader",
496
+ isSignal: true,
497
+ isRequired: false,
498
+ transformFunction: null
499
+ },
500
+ draggable: {
501
+ classPropertyName: "draggable",
502
+ publicName: "draggable",
503
+ isSignal: true,
504
+ isRequired: false,
505
+ transformFunction: null
506
+ },
507
+ keepInViewport: {
508
+ classPropertyName: "keepInViewport",
509
+ publicName: "keepInViewport",
510
+ isSignal: true,
511
+ isRequired: false,
512
+ transformFunction: null
513
+ },
514
+ minX: {
515
+ classPropertyName: "minX",
516
+ publicName: "minX",
517
+ isSignal: true,
518
+ isRequired: false,
519
+ transformFunction: null
520
+ },
521
+ minY: {
522
+ classPropertyName: "minY",
523
+ publicName: "minY",
524
+ isSignal: true,
525
+ isRequired: false,
526
+ transformFunction: null
527
+ },
528
+ maximizable: {
529
+ classPropertyName: "maximizable",
530
+ publicName: "maximizable",
531
+ isSignal: true,
532
+ isRequired: false,
533
+ transformFunction: null
534
+ },
535
+ resizable: {
536
+ classPropertyName: "resizable",
537
+ publicName: "resizable",
538
+ isSignal: true,
539
+ isRequired: false,
540
+ transformFunction: null
541
+ },
542
+ minWidth: {
543
+ classPropertyName: "minWidth",
544
+ publicName: "minWidth",
545
+ isSignal: true,
546
+ isRequired: false,
547
+ transformFunction: null
548
+ },
549
+ minHeight: {
550
+ classPropertyName: "minHeight",
551
+ publicName: "minHeight",
552
+ isSignal: true,
553
+ isRequired: false,
554
+ transformFunction: null
555
+ },
556
+ position: {
557
+ classPropertyName: "position",
558
+ publicName: "position",
559
+ isSignal: true,
560
+ isRequired: false,
561
+ transformFunction: null
562
+ },
563
+ contained: {
564
+ classPropertyName: "contained",
565
+ publicName: "contained",
566
+ isSignal: true,
567
+ isRequired: false,
568
+ transformFunction: null
569
+ },
570
+ focusOnShow: {
571
+ classPropertyName: "focusOnShow",
572
+ publicName: "focusOnShow",
573
+ isSignal: true,
574
+ isRequired: false,
575
+ transformFunction: null
576
+ },
577
+ focusTrap: {
578
+ classPropertyName: "focusTrap",
579
+ publicName: "focusTrap",
580
+ isSignal: true,
581
+ isRequired: false,
582
+ transformFunction: null
583
+ },
584
+ closeIcon: {
585
+ classPropertyName: "closeIcon",
586
+ publicName: "closeIcon",
587
+ isSignal: true,
588
+ isRequired: false,
589
+ transformFunction: null
590
+ },
591
+ maximizeIcon: {
592
+ classPropertyName: "maximizeIcon",
593
+ publicName: "maximizeIcon",
594
+ isSignal: true,
595
+ isRequired: false,
596
+ transformFunction: null
597
+ },
598
+ minimizeIcon: {
599
+ classPropertyName: "minimizeIcon",
600
+ publicName: "minimizeIcon",
601
+ isSignal: true,
602
+ isRequired: false,
603
+ transformFunction: null
604
+ },
605
+ closeAriaLabel: {
606
+ classPropertyName: "closeAriaLabel",
607
+ publicName: "closeAriaLabel",
608
+ isSignal: true,
609
+ isRequired: false,
610
+ transformFunction: null
611
+ },
612
+ maximizeAriaLabel: {
613
+ classPropertyName: "maximizeAriaLabel",
614
+ publicName: "maximizeAriaLabel",
615
+ isSignal: true,
616
+ isRequired: false,
617
+ transformFunction: null
618
+ },
619
+ styleClass: {
620
+ classPropertyName: "styleClass",
621
+ publicName: "styleClass",
622
+ isSignal: true,
623
+ isRequired: false,
624
+ transformFunction: null
625
+ },
626
+ maskStyleClass: {
627
+ classPropertyName: "maskStyleClass",
628
+ publicName: "maskStyleClass",
629
+ isSignal: true,
630
+ isRequired: false,
631
+ transformFunction: null
632
+ },
633
+ dialogStyle: {
634
+ classPropertyName: "dialogStyle",
635
+ publicName: "dialogStyle",
636
+ isSignal: true,
637
+ isRequired: false,
638
+ transformFunction: null
639
+ },
640
+ breakpoints: {
641
+ classPropertyName: "breakpoints",
642
+ publicName: "breakpoints",
643
+ isSignal: true,
644
+ isRequired: false,
645
+ transformFunction: null
646
+ },
647
+ autoZIndex: {
648
+ classPropertyName: "autoZIndex",
649
+ publicName: "autoZIndex",
650
+ isSignal: true,
651
+ isRequired: false,
652
+ transformFunction: null
653
+ },
654
+ baseZIndex: {
655
+ classPropertyName: "baseZIndex",
656
+ publicName: "baseZIndex",
657
+ isSignal: true,
658
+ isRequired: false,
659
+ transformFunction: null
660
+ },
661
+ motion: {
662
+ classPropertyName: "motion",
663
+ publicName: "motion",
664
+ isSignal: true,
665
+ isRequired: false,
666
+ transformFunction: null
667
+ },
668
+ motionDisabled: {
669
+ classPropertyName: "motionDisabled",
670
+ publicName: "motionDisabled",
671
+ isSignal: true,
672
+ isRequired: false,
673
+ transformFunction: null
674
+ }
675
+ },
676
+ outputs: {
677
+ visible: "visibleChange",
678
+ shown: "shown",
679
+ hidden: "hidden",
680
+ maximizedChange: "maximizedChange",
681
+ dragEnd: "dragEnd",
682
+ resizeEnd: "resizeEnd"
683
+ },
684
+ queries: [
685
+ {
686
+ propertyName: "headerTemplate",
687
+ first: true,
688
+ predicate: ["header"],
689
+ descendants: true,
690
+ isSignal: true
691
+ },
692
+ {
693
+ propertyName: "footerTemplate",
694
+ first: true,
695
+ predicate: ["footer"],
696
+ descendants: true,
697
+ isSignal: true
698
+ },
699
+ {
700
+ propertyName: "closeIconTemplate",
701
+ first: true,
702
+ predicate: ["closeicon"],
703
+ descendants: true,
704
+ isSignal: true
705
+ }
706
+ ],
707
+ viewQueries: [
708
+ {
709
+ propertyName: "contentRef",
710
+ first: true,
711
+ predicate: ["contentEl"],
712
+ descendants: true,
713
+ isSignal: true
714
+ },
715
+ {
716
+ propertyName: "dialogRef",
717
+ first: true,
718
+ predicate: ["dialog"],
719
+ descendants: true,
720
+ isSignal: true
721
+ },
722
+ {
723
+ propertyName: "scrimRef",
724
+ first: true,
725
+ predicate: ["scrim"],
726
+ descendants: true,
727
+ isSignal: true
728
+ }
729
+ ],
730
+ ngImport: i0,
731
+ template: "@if (visible()) {\n <!-- Scrim + frame are SIBLINGS (both direct @if children) so each animates its own\n leave independently — a nested animated element would deadlock the removal.\n The frame carries the dialog's zoom; the dialog itself has no leave binding. -->\n @if (modal()) {\n <div\n #scrim\n class=\"ui-modal-scrim\"\n [class._contained]=\"contained()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"motionDisabled()\"\n #scrimMotion=\"uiMotion\"\n [animate.enter]=\"scrimMotion.enter()\"\n [animate.leave]=\"scrimMotion.leave()\"\n ></div>\n }\n\n <!-- Dialog: Escape/Tab handled on the container, focus lives in the\n content (CDK focus-trap). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-modal-frame\"\n [class._modal]=\"modal()\"\n [class._contained]=\"contained()\"\n [style.align-items]=\"alignItems()\"\n [style.justify-content]=\"justifyContent()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"motion()\"\n [motionDisabled]=\"motionDisabled()\"\n #frameMotion=\"uiMotion\"\n [animate.enter]=\"frameMotion.enter()\"\n [animate.leave]=\"frameMotion.leave()\"\n (pointerdown)=\"onMaskPointerdown($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div\n #dialog\n [class]=\"dialogClasses()\"\n [attr.data-modal-uid]=\"uid\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"modal() ? 'true' : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n tabindex=\"-1\"\n [style]=\"resolvedDialogStyle()\"\n [style.translate]=\"dragTranslate()\"\n [cdkTrapFocus]=\"focusTrap()\"\n [cdkTrapFocusAutoCapture]=\"focusOnShow()\"\n >\n @if (showHeader()) {\n <div\n class=\"ui-modal-header\"\n [class._draggable]=\"headerDraggable()\"\n (pointerdown)=\"onHeaderPointerdown($event)\"\n >\n <div [attr.id]=\"titleId\" class=\"ui-modal-title\">\n @if (headerTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ header() }}\n }\n </div>\n\n <div class=\"ui-modal-header-actions\">\n @if (maximizable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"maximizeAriaLabel()\"\n [attr.aria-pressed]=\"maximized()\"\n (click)=\"toggleMaximize()\"\n >\n <ui-icon [name]=\"maximized() ? minimizeIcon() : maximizeIcon()\" size=\"sm\" />\n </button>\n }\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n @if (closeIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n }\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Body: long content scrolls inside this region. It becomes focusable ONLY once it\n actually overflows AND holds nothing focusable of its own: a keyboard user must be able\n to reach the scrollbar (the footer buttons sit outside this region), but an unconditional\n tab stop would insert itself into the focus order of every dialog. -->\n <div #contentEl class=\"ui-modal-content\" [attr.tabindex]=\"contentNeedsFocus() ? 0 : null\">\n <ng-content />\n </div>\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-modal-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (showResizeHandle()) {\n <!-- Corner resize grip (pointer only, like a native textarea corner). -->\n <span\n class=\"ui-modal-resize-handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onResizeStart($event)\"\n ></span>\n }\n </div>\n </div>\n}\n",
732
+ styles: [".ui-modal-scrim{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);pointer-events:none;background-color:var(--ui-modal-mask-background, var(--primitives-black-50))}.ui-modal-scrim._contained{position:absolute}.ui-modal-frame{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);display:flex;padding:var(--ui-modal-mask-padding, var(--units-lg));pointer-events:none}.ui-modal-frame._modal{pointer-events:auto}.ui-modal-frame._contained{position:absolute}.ui-modal{pointer-events:auto;position:relative;box-sizing:border-box;display:flex;flex-direction:column;max-width:min(90vw,35rem);max-height:90vh;border:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-stroke, var(--global-border-subtle));border-radius:var(--ui-modal-dialog-radius, var(--radius-md));background-color:var(--ui-modal-surface, var(--global-background-default));color:var(--ui-modal-color, var(--global-text-default));box-shadow:var(--shadow-default-lg);font-family:var(--ui-modal-font-family, var(--fontfamily-base));outline:none}.ui-modal._contained{max-width:100%;max-height:100%}.ui-modal._maximized{width:100vw;height:100vh;max-width:100vw;max-height:100vh;border-radius:0}.ui-modal._maximized._contained{width:100%;height:100%;max-width:100%;max-height:100%}.ui-modal-header{flex:0 0 auto;display:flex;align-items:var(--ui-modal-header-align, flex-start);gap:var(--ui-modal-header-gap, var(--units-sm));padding:var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg)) var(--units-sm)}.ui-modal-header._draggable{cursor:move;-webkit-user-select:none;user-select:none}.ui-modal-title{flex:1 1 auto;min-width:0;font-family:var(--ui-modal-title-font-family, var(--fontfamily-title));font-size:var(--size-typography-title-default);font-weight:var(--ui-modal-weight, var(--weight-bold));line-height:1.3;overflow-wrap:break-word}.ui-modal-header-actions{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-modal-header-actions-align, auto);gap:var(--units-2xs)}.ui-modal-action{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-modal-action-size, 2rem);height:var(--ui-modal-action-size, 2rem);padding:0;border:none;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-modal-action:hover{background-color:var(--ui-modal-close-surface-hover, var(--global-background-muted-hover));color:var(--ui-modal-close-color-hover, var(--global-text-muted-hover))}.ui-modal-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-modal-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-modal-close-focus-ring-color, var(--global-border-focus))}@media(prefers-reduced-motion:reduce){.ui-modal-action{transition-duration:.01ms}}:root[data-motion=off] .ui-modal-action{transition-duration:.01ms}.ui-modal-content{flex:1 1 auto;min-height:0;overflow-y:auto;padding:var(--ui-modal-dialog-padding, var(--units-lg));font-size:var(--size-typography-text-md);line-height:1.5}.ui-modal-header+.ui-modal-content{padding-top:0}.ui-modal-footer{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--units-sm);padding:var(--units-md) var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg));border-top:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-footer-stroke, var(--global-border-subtle))}.ui-modal-resize-handle{position:absolute;right:0;bottom:0;width:var(--ui-modal-resize-handle-size, 16px);height:var(--ui-modal-resize-handle-size, 16px);cursor:nwse-resize;touch-action:none;color:var(--ui-modal-resize-handle-color, var(--global-text-muted));background-image:repeating-linear-gradient(-45deg,currentColor 0 1px,transparent 1px 3px);-webkit-mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);opacity:.5}.ui-modal-resize-handle:hover{opacity:.8}\n"],
733
+ dependencies: [
734
+ {
735
+ kind: "directive",
736
+ type: NgTemplateOutlet,
737
+ selector: "[ngTemplateOutlet]",
738
+ inputs: [
739
+ "ngTemplateOutletContext",
740
+ "ngTemplateOutlet",
741
+ "ngTemplateOutletInjector"
742
+ ]
743
+ },
744
+ {
745
+ kind: "ngmodule",
746
+ type: A11yModule
747
+ },
748
+ {
749
+ kind: "directive",
750
+ type: i1.CdkTrapFocus,
751
+ selector: "[cdkTrapFocus]",
752
+ inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
753
+ exportAs: ["cdkTrapFocus"]
754
+ },
755
+ {
756
+ kind: "directive",
757
+ type: UiMotion,
758
+ selector: "[uiMotion]",
759
+ inputs: [
760
+ "uiMotion",
761
+ "motionDuration",
762
+ "motionDelay",
763
+ "motionEasing",
764
+ "motionEnterEasing",
765
+ "motionLeaveEasing",
766
+ "motionDistance",
767
+ "motionScale",
768
+ "motionDisabled",
769
+ "motionOnInsert"
770
+ ],
771
+ exportAs: ["uiMotion"]
772
+ },
773
+ {
774
+ kind: "component",
775
+ type: UiIcon,
776
+ selector: "ui-icon",
777
+ inputs: [
778
+ "name",
779
+ "size",
780
+ "type",
781
+ "family",
782
+ "decorative",
783
+ "ariaLabel"
784
+ ]
785
+ }
786
+ ]
787
+ });
788
+ }
789
+ };
790
+ i0.ɵɵngDeclareClassMetadata({
791
+ minVersion: "12.0.0",
792
+ version: "22.3.0",
793
+ ngImport: i0,
794
+ type: UiModal,
795
+ decorators: [{
796
+ type: Component,
797
+ args: [{
798
+ selector: "ui-modal",
799
+ imports: [
800
+ NgTemplateOutlet,
801
+ A11yModule,
802
+ UiMotion,
803
+ UiIcon
804
+ ],
805
+ template: "@if (visible()) {\n <!-- Scrim + frame are SIBLINGS (both direct @if children) so each animates its own\n leave independently — a nested animated element would deadlock the removal.\n The frame carries the dialog's zoom; the dialog itself has no leave binding. -->\n @if (modal()) {\n <div\n #scrim\n class=\"ui-modal-scrim\"\n [class._contained]=\"contained()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"'fade'\"\n [motionDisabled]=\"motionDisabled()\"\n #scrimMotion=\"uiMotion\"\n [animate.enter]=\"scrimMotion.enter()\"\n [animate.leave]=\"scrimMotion.leave()\"\n ></div>\n }\n\n <!-- Dialog: Escape/Tab handled on the container, focus lives in the\n content (CDK focus-trap). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-modal-frame\"\n [class._modal]=\"modal()\"\n [class._contained]=\"contained()\"\n [style.align-items]=\"alignItems()\"\n [style.justify-content]=\"justifyContent()\"\n [style.z-index]=\"zIndex()\"\n [uiMotion]=\"motion()\"\n [motionDisabled]=\"motionDisabled()\"\n #frameMotion=\"uiMotion\"\n [animate.enter]=\"frameMotion.enter()\"\n [animate.leave]=\"frameMotion.leave()\"\n (pointerdown)=\"onMaskPointerdown($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div\n #dialog\n [class]=\"dialogClasses()\"\n [attr.data-modal-uid]=\"uid\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"modal() ? 'true' : null\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n tabindex=\"-1\"\n [style]=\"resolvedDialogStyle()\"\n [style.translate]=\"dragTranslate()\"\n [cdkTrapFocus]=\"focusTrap()\"\n [cdkTrapFocusAutoCapture]=\"focusOnShow()\"\n >\n @if (showHeader()) {\n <div\n class=\"ui-modal-header\"\n [class._draggable]=\"headerDraggable()\"\n (pointerdown)=\"onHeaderPointerdown($event)\"\n >\n <div [attr.id]=\"titleId\" class=\"ui-modal-title\">\n @if (headerTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ header() }}\n }\n </div>\n\n <div class=\"ui-modal-header-actions\">\n @if (maximizable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"maximizeAriaLabel()\"\n [attr.aria-pressed]=\"maximized()\"\n (click)=\"toggleMaximize()\"\n >\n <ui-icon [name]=\"maximized() ? minimizeIcon() : maximizeIcon()\" size=\"sm\" />\n </button>\n }\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-modal-action\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"close()\"\n >\n @if (closeIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n }\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Body: long content scrolls inside this region. It becomes focusable ONLY once it\n actually overflows AND holds nothing focusable of its own: a keyboard user must be able\n to reach the scrollbar (the footer buttons sit outside this region), but an unconditional\n tab stop would insert itself into the focus order of every dialog. -->\n <div #contentEl class=\"ui-modal-content\" [attr.tabindex]=\"contentNeedsFocus() ? 0 : null\">\n <ng-content />\n </div>\n\n @if (footerTemplate(); as tpl) {\n <div class=\"ui-modal-footer\">\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n </div>\n }\n\n @if (showResizeHandle()) {\n <!-- Corner resize grip (pointer only, like a native textarea corner). -->\n <span\n class=\"ui-modal-resize-handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onResizeStart($event)\"\n ></span>\n }\n </div>\n </div>\n}\n",
806
+ styles: [".ui-modal-scrim{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);pointer-events:none;background-color:var(--ui-modal-mask-background, var(--primitives-black-50))}.ui-modal-scrim._contained{position:absolute}.ui-modal-frame{position:fixed;inset:0;z-index:var(--ui-modal-z-index, 1100);display:flex;padding:var(--ui-modal-mask-padding, var(--units-lg));pointer-events:none}.ui-modal-frame._modal{pointer-events:auto}.ui-modal-frame._contained{position:absolute}.ui-modal{pointer-events:auto;position:relative;box-sizing:border-box;display:flex;flex-direction:column;max-width:min(90vw,35rem);max-height:90vh;border:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-stroke, var(--global-border-subtle));border-radius:var(--ui-modal-dialog-radius, var(--radius-md));background-color:var(--ui-modal-surface, var(--global-background-default));color:var(--ui-modal-color, var(--global-text-default));box-shadow:var(--shadow-default-lg);font-family:var(--ui-modal-font-family, var(--fontfamily-base));outline:none}.ui-modal._contained{max-width:100%;max-height:100%}.ui-modal._maximized{width:100vw;height:100vh;max-width:100vw;max-height:100vh;border-radius:0}.ui-modal._maximized._contained{width:100%;height:100%;max-width:100%;max-height:100%}.ui-modal-header{flex:0 0 auto;display:flex;align-items:var(--ui-modal-header-align, flex-start);gap:var(--ui-modal-header-gap, var(--units-sm));padding:var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg)) var(--units-sm)}.ui-modal-header._draggable{cursor:move;-webkit-user-select:none;user-select:none}.ui-modal-title{flex:1 1 auto;min-width:0;font-family:var(--ui-modal-title-font-family, var(--fontfamily-title));font-size:var(--size-typography-title-default);font-weight:var(--ui-modal-weight, var(--weight-bold));line-height:1.3;overflow-wrap:break-word}.ui-modal-header-actions{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-modal-header-actions-align, auto);gap:var(--units-2xs)}.ui-modal-action{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-modal-action-size, 2rem);height:var(--ui-modal-action-size, 2rem);padding:0;border:none;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-modal-action:hover{background-color:var(--ui-modal-close-surface-hover, var(--global-background-muted-hover));color:var(--ui-modal-close-color-hover, var(--global-text-muted-hover))}.ui-modal-action:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-modal-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-modal-close-focus-ring-color, var(--global-border-focus))}@media(prefers-reduced-motion:reduce){.ui-modal-action{transition-duration:.01ms}}:root[data-motion=off] .ui-modal-action{transition-duration:.01ms}.ui-modal-content{flex:1 1 auto;min-height:0;overflow-y:auto;padding:var(--ui-modal-dialog-padding, var(--units-lg));font-size:var(--size-typography-text-md);line-height:1.5}.ui-modal-header+.ui-modal-content{padding-top:0}.ui-modal-footer{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--units-sm);padding:var(--units-md) var(--ui-modal-dialog-padding, var(--units-lg)) var(--ui-modal-dialog-padding, var(--units-lg));border-top:var(--ui-modal-stroke-width, var(--stroke-sm)) solid var(--ui-modal-footer-stroke, var(--global-border-subtle))}.ui-modal-resize-handle{position:absolute;right:0;bottom:0;width:var(--ui-modal-resize-handle-size, 16px);height:var(--ui-modal-resize-handle-size, 16px);cursor:nwse-resize;touch-action:none;color:var(--ui-modal-resize-handle-color, var(--global-text-muted));background-image:repeating-linear-gradient(-45deg,currentColor 0 1px,transparent 1px 3px);-webkit-mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);mask-image:linear-gradient(-45deg,transparent 0 45%,#000 55%);opacity:.5}.ui-modal-resize-handle:hover{opacity:.8}\n"]
807
+ }]
808
+ }],
809
+ ctorParameters: () => [],
810
+ propDecorators: {
811
+ visible: [{
812
+ type: i0.Input,
813
+ args: [{
814
+ isSignal: true,
815
+ alias: "visible",
816
+ required: false
817
+ }]
818
+ }, {
819
+ type: i0.Output,
820
+ args: ["visibleChange"]
821
+ }],
822
+ header: [{
823
+ type: i0.Input,
824
+ args: [{
825
+ isSignal: true,
826
+ alias: "header",
827
+ required: false
828
+ }]
829
+ }],
830
+ role: [{
831
+ type: i0.Input,
832
+ args: [{
833
+ isSignal: true,
834
+ alias: "role",
835
+ required: false
836
+ }]
837
+ }],
838
+ ariaLabel: [{
839
+ type: i0.Input,
840
+ args: [{
841
+ isSignal: true,
842
+ alias: "ariaLabel",
843
+ required: false
844
+ }]
845
+ }],
846
+ ariaLabelledBy: [{
847
+ type: i0.Input,
848
+ args: [{
849
+ isSignal: true,
850
+ alias: "ariaLabelledBy",
851
+ required: false
852
+ }]
853
+ }],
854
+ modal: [{
855
+ type: i0.Input,
856
+ args: [{
857
+ isSignal: true,
858
+ alias: "modal",
859
+ required: false
860
+ }]
861
+ }],
862
+ dismissableMask: [{
863
+ type: i0.Input,
864
+ args: [{
865
+ isSignal: true,
866
+ alias: "dismissableMask",
867
+ required: false
868
+ }]
869
+ }],
870
+ closable: [{
871
+ type: i0.Input,
872
+ args: [{
873
+ isSignal: true,
874
+ alias: "closable",
875
+ required: false
876
+ }]
877
+ }],
878
+ closeOnEscape: [{
879
+ type: i0.Input,
880
+ args: [{
881
+ isSignal: true,
882
+ alias: "closeOnEscape",
883
+ required: false
884
+ }]
885
+ }],
886
+ blockScroll: [{
887
+ type: i0.Input,
888
+ args: [{
889
+ isSignal: true,
890
+ alias: "blockScroll",
891
+ required: false
892
+ }]
893
+ }],
894
+ showHeader: [{
895
+ type: i0.Input,
896
+ args: [{
897
+ isSignal: true,
898
+ alias: "showHeader",
899
+ required: false
900
+ }]
901
+ }],
902
+ draggable: [{
903
+ type: i0.Input,
904
+ args: [{
905
+ isSignal: true,
906
+ alias: "draggable",
907
+ required: false
908
+ }]
909
+ }],
910
+ keepInViewport: [{
911
+ type: i0.Input,
912
+ args: [{
913
+ isSignal: true,
914
+ alias: "keepInViewport",
915
+ required: false
916
+ }]
917
+ }],
918
+ minX: [{
919
+ type: i0.Input,
920
+ args: [{
921
+ isSignal: true,
922
+ alias: "minX",
923
+ required: false
924
+ }]
925
+ }],
926
+ minY: [{
927
+ type: i0.Input,
928
+ args: [{
929
+ isSignal: true,
930
+ alias: "minY",
931
+ required: false
932
+ }]
933
+ }],
934
+ maximizable: [{
935
+ type: i0.Input,
936
+ args: [{
937
+ isSignal: true,
938
+ alias: "maximizable",
939
+ required: false
940
+ }]
941
+ }],
942
+ resizable: [{
943
+ type: i0.Input,
944
+ args: [{
945
+ isSignal: true,
946
+ alias: "resizable",
947
+ required: false
948
+ }]
949
+ }],
950
+ minWidth: [{
951
+ type: i0.Input,
952
+ args: [{
953
+ isSignal: true,
954
+ alias: "minWidth",
955
+ required: false
956
+ }]
957
+ }],
958
+ minHeight: [{
959
+ type: i0.Input,
960
+ args: [{
961
+ isSignal: true,
962
+ alias: "minHeight",
963
+ required: false
964
+ }]
965
+ }],
966
+ position: [{
967
+ type: i0.Input,
968
+ args: [{
969
+ isSignal: true,
970
+ alias: "position",
971
+ required: false
972
+ }]
973
+ }],
974
+ contained: [{
975
+ type: i0.Input,
976
+ args: [{
977
+ isSignal: true,
978
+ alias: "contained",
979
+ required: false
980
+ }]
981
+ }],
982
+ focusOnShow: [{
983
+ type: i0.Input,
984
+ args: [{
985
+ isSignal: true,
986
+ alias: "focusOnShow",
987
+ required: false
988
+ }]
989
+ }],
990
+ focusTrap: [{
991
+ type: i0.Input,
992
+ args: [{
993
+ isSignal: true,
994
+ alias: "focusTrap",
995
+ required: false
996
+ }]
997
+ }],
998
+ closeIcon: [{
999
+ type: i0.Input,
1000
+ args: [{
1001
+ isSignal: true,
1002
+ alias: "closeIcon",
1003
+ required: false
1004
+ }]
1005
+ }],
1006
+ maximizeIcon: [{
1007
+ type: i0.Input,
1008
+ args: [{
1009
+ isSignal: true,
1010
+ alias: "maximizeIcon",
1011
+ required: false
1012
+ }]
1013
+ }],
1014
+ minimizeIcon: [{
1015
+ type: i0.Input,
1016
+ args: [{
1017
+ isSignal: true,
1018
+ alias: "minimizeIcon",
1019
+ required: false
1020
+ }]
1021
+ }],
1022
+ closeAriaLabel: [{
1023
+ type: i0.Input,
1024
+ args: [{
1025
+ isSignal: true,
1026
+ alias: "closeAriaLabel",
1027
+ required: false
1028
+ }]
1029
+ }],
1030
+ maximizeAriaLabel: [{
1031
+ type: i0.Input,
1032
+ args: [{
1033
+ isSignal: true,
1034
+ alias: "maximizeAriaLabel",
1035
+ required: false
1036
+ }]
1037
+ }],
1038
+ styleClass: [{
1039
+ type: i0.Input,
1040
+ args: [{
1041
+ isSignal: true,
1042
+ alias: "styleClass",
1043
+ required: false
1044
+ }]
1045
+ }],
1046
+ maskStyleClass: [{
1047
+ type: i0.Input,
1048
+ args: [{
1049
+ isSignal: true,
1050
+ alias: "maskStyleClass",
1051
+ required: false
1052
+ }]
1053
+ }],
1054
+ dialogStyle: [{
1055
+ type: i0.Input,
1056
+ args: [{
1057
+ isSignal: true,
1058
+ alias: "dialogStyle",
1059
+ required: false
1060
+ }]
1061
+ }],
1062
+ breakpoints: [{
1063
+ type: i0.Input,
1064
+ args: [{
1065
+ isSignal: true,
1066
+ alias: "breakpoints",
1067
+ required: false
1068
+ }]
1069
+ }],
1070
+ autoZIndex: [{
1071
+ type: i0.Input,
1072
+ args: [{
1073
+ isSignal: true,
1074
+ alias: "autoZIndex",
1075
+ required: false
1076
+ }]
1077
+ }],
1078
+ baseZIndex: [{
1079
+ type: i0.Input,
1080
+ args: [{
1081
+ isSignal: true,
1082
+ alias: "baseZIndex",
1083
+ required: false
1084
+ }]
1085
+ }],
1086
+ motion: [{
1087
+ type: i0.Input,
1088
+ args: [{
1089
+ isSignal: true,
1090
+ alias: "motion",
1091
+ required: false
1092
+ }]
1093
+ }],
1094
+ motionDisabled: [{
1095
+ type: i0.Input,
1096
+ args: [{
1097
+ isSignal: true,
1098
+ alias: "motionDisabled",
1099
+ required: false
1100
+ }]
1101
+ }],
1102
+ headerTemplate: [{
1103
+ type: i0.ContentChild,
1104
+ args: ["header", { isSignal: true }]
1105
+ }],
1106
+ footerTemplate: [{
1107
+ type: i0.ContentChild,
1108
+ args: ["footer", { isSignal: true }]
1109
+ }],
1110
+ closeIconTemplate: [{
1111
+ type: i0.ContentChild,
1112
+ args: ["closeicon", { isSignal: true }]
1113
+ }],
1114
+ shown: [{
1115
+ type: i0.Output,
1116
+ args: ["shown"]
1117
+ }],
1118
+ hidden: [{
1119
+ type: i0.Output,
1120
+ args: ["hidden"]
1121
+ }],
1122
+ maximizedChange: [{
1123
+ type: i0.Output,
1124
+ args: ["maximizedChange"]
1125
+ }],
1126
+ dragEnd: [{
1127
+ type: i0.Output,
1128
+ args: ["dragEnd"]
1129
+ }],
1130
+ resizeEnd: [{
1131
+ type: i0.Output,
1132
+ args: ["resizeEnd"]
1133
+ }],
1134
+ contentRef: [{
1135
+ type: i0.ViewChild,
1136
+ args: ["contentEl", { isSignal: true }]
1137
+ }],
1138
+ dialogRef: [{
1139
+ type: i0.ViewChild,
1140
+ args: ["dialog", { isSignal: true }]
1141
+ }],
1142
+ scrimRef: [{
1143
+ type: i0.ViewChild,
1144
+ args: ["scrim", { isSignal: true }]
1145
+ }]
1146
+ }
1147
+ });
571
1148
  export { UiModal };
572
- //# sourceMappingURL=4sh-ui-kit-layout-ui-modal.mjs.map
1149
+
1150
+ //# sourceMappingURL=4sh-ui-kit-layout-ui-modal.mjs.map