@molecule/app-ui-angular 1.0.6 → 1.1.2

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 (312) hide show
  1. package/README.md +11710 -1117
  2. package/dist/components/accordion.component.d.ts +114 -0
  3. package/dist/components/accordion.component.d.ts.map +1 -0
  4. package/dist/components/accordion.component.js +286 -0
  5. package/dist/components/accordion.component.js.map +1 -0
  6. package/dist/components/alert.component.d.ts +81 -37
  7. package/dist/components/alert.component.d.ts.map +1 -1
  8. package/dist/components/alert.component.js +232 -146
  9. package/dist/components/alert.component.js.map +1 -1
  10. package/dist/components/auth-guard.component.d.ts +94 -0
  11. package/dist/components/auth-guard.component.d.ts.map +1 -0
  12. package/dist/components/auth-guard.component.js +212 -0
  13. package/dist/components/auth-guard.component.js.map +1 -0
  14. package/dist/components/avatar.component.d.ts +97 -0
  15. package/dist/components/avatar.component.d.ts.map +1 -0
  16. package/dist/components/avatar.component.js +216 -0
  17. package/dist/components/avatar.component.js.map +1 -0
  18. package/dist/components/badge.component.d.ts +27 -12
  19. package/dist/components/badge.component.d.ts.map +1 -1
  20. package/dist/components/badge.component.js +47 -47
  21. package/dist/components/badge.component.js.map +1 -1
  22. package/dist/components/button.component.d.ts +96 -14
  23. package/dist/components/button.component.d.ts.map +1 -1
  24. package/dist/components/button.component.js +232 -87
  25. package/dist/components/button.component.js.map +1 -1
  26. package/dist/components/card.component.d.ts +135 -0
  27. package/dist/components/card.component.d.ts.map +1 -0
  28. package/dist/components/card.component.js +291 -0
  29. package/dist/components/card.component.js.map +1 -0
  30. package/dist/components/checkbox.component.d.ts +97 -29
  31. package/dist/components/checkbox.component.d.ts.map +1 -1
  32. package/dist/components/checkbox.component.js +222 -117
  33. package/dist/components/checkbox.component.js.map +1 -1
  34. package/dist/components/confirm-button.component.d.ts +130 -0
  35. package/dist/components/confirm-button.component.d.ts.map +1 -0
  36. package/dist/components/confirm-button.component.js +322 -0
  37. package/dist/components/confirm-button.component.js.map +1 -0
  38. package/dist/components/confirm-dialog.component.d.ts +60 -0
  39. package/dist/components/confirm-dialog.component.d.ts.map +1 -0
  40. package/dist/components/confirm-dialog.component.js +152 -0
  41. package/dist/components/confirm-dialog.component.js.map +1 -0
  42. package/dist/components/controlled-checked.directive.d.ts +45 -0
  43. package/dist/components/controlled-checked.directive.d.ts.map +1 -0
  44. package/dist/components/controlled-checked.directive.js +74 -0
  45. package/dist/components/controlled-checked.directive.js.map +1 -0
  46. package/dist/components/dropdown.component.d.ts +313 -0
  47. package/dist/components/dropdown.component.d.ts.map +1 -0
  48. package/dist/components/dropdown.component.js +919 -0
  49. package/dist/components/dropdown.component.js.map +1 -0
  50. package/dist/components/empty-state.component.d.ts +73 -0
  51. package/dist/components/empty-state.component.d.ts.map +1 -0
  52. package/dist/components/empty-state.component.js +180 -0
  53. package/dist/components/empty-state.component.js.map +1 -0
  54. package/dist/components/floating-input.component.d.ts +86 -0
  55. package/dist/components/floating-input.component.d.ts.map +1 -0
  56. package/dist/components/floating-input.component.js +167 -0
  57. package/dist/components/floating-input.component.js.map +1 -0
  58. package/dist/components/form-field.component.d.ts +111 -0
  59. package/dist/components/form-field.component.d.ts.map +1 -0
  60. package/dist/components/form-field.component.js +300 -0
  61. package/dist/components/form-field.component.js.map +1 -0
  62. package/dist/components/form.component.d.ts +77 -0
  63. package/dist/components/form.component.d.ts.map +1 -0
  64. package/dist/components/form.component.js +222 -0
  65. package/dist/components/form.component.js.map +1 -0
  66. package/dist/components/icon.component.d.ts +85 -0
  67. package/dist/components/icon.component.d.ts.map +1 -0
  68. package/dist/components/icon.component.js +187 -0
  69. package/dist/components/icon.component.js.map +1 -0
  70. package/dist/components/index.d.ts +49 -0
  71. package/dist/components/index.d.ts.map +1 -1
  72. package/dist/components/index.js +49 -0
  73. package/dist/components/index.js.map +1 -1
  74. package/dist/components/input.component.d.ts +157 -54
  75. package/dist/components/input.component.d.ts.map +1 -1
  76. package/dist/components/input.component.js +437 -222
  77. package/dist/components/input.component.js.map +1 -1
  78. package/dist/components/label.component.d.ts +29 -0
  79. package/dist/components/label.component.d.ts.map +1 -0
  80. package/dist/components/label.component.js +60 -0
  81. package/dist/components/label.component.js.map +1 -0
  82. package/dist/components/language-picker.component.d.ts +124 -0
  83. package/dist/components/language-picker.component.d.ts.map +1 -0
  84. package/dist/components/language-picker.component.js +305 -0
  85. package/dist/components/language-picker.component.js.map +1 -0
  86. package/dist/components/layout.component.d.ts +167 -0
  87. package/dist/components/layout.component.d.ts.map +1 -0
  88. package/dist/components/layout.component.js +364 -0
  89. package/dist/components/layout.component.js.map +1 -0
  90. package/dist/components/load-error-banner.component.d.ts +103 -0
  91. package/dist/components/load-error-banner.component.d.ts.map +1 -0
  92. package/dist/components/load-error-banner.component.js +263 -0
  93. package/dist/components/load-error-banner.component.js.map +1 -0
  94. package/dist/components/modal.component.d.ts +125 -95
  95. package/dist/components/modal.component.d.ts.map +1 -1
  96. package/dist/components/modal.component.js +458 -271
  97. package/dist/components/modal.component.js.map +1 -1
  98. package/dist/components/molecule/alert.component.d.ts +77 -0
  99. package/dist/components/molecule/alert.component.d.ts.map +1 -0
  100. package/dist/components/molecule/alert.component.js +229 -0
  101. package/dist/components/molecule/alert.component.js.map +1 -0
  102. package/dist/components/molecule/badge.component.d.ts +27 -0
  103. package/dist/components/molecule/badge.component.d.ts.map +1 -0
  104. package/dist/components/molecule/badge.component.js +79 -0
  105. package/dist/components/molecule/badge.component.js.map +1 -0
  106. package/dist/components/molecule/button.component.d.ts +38 -0
  107. package/dist/components/molecule/button.component.d.ts.map +1 -0
  108. package/dist/components/molecule/button.component.js +137 -0
  109. package/dist/components/molecule/button.component.js.map +1 -0
  110. package/dist/components/molecule/checkbox.component.d.ts +53 -0
  111. package/dist/components/molecule/checkbox.component.d.ts.map +1 -0
  112. package/dist/components/molecule/checkbox.component.js +166 -0
  113. package/dist/components/molecule/checkbox.component.js.map +1 -0
  114. package/dist/components/molecule/index.d.ts +18 -0
  115. package/dist/components/molecule/index.d.ts.map +1 -0
  116. package/dist/components/molecule/index.js +18 -0
  117. package/dist/components/molecule/index.js.map +1 -0
  118. package/dist/components/molecule/input.component.d.ts +93 -0
  119. package/dist/components/molecule/input.component.d.ts.map +1 -0
  120. package/dist/components/molecule/input.component.js +314 -0
  121. package/dist/components/molecule/input.component.js.map +1 -0
  122. package/dist/components/molecule/modal.component.d.ts +148 -0
  123. package/dist/components/molecule/modal.component.d.ts.map +1 -0
  124. package/dist/components/molecule/modal.component.js +382 -0
  125. package/dist/components/molecule/modal.component.js.map +1 -0
  126. package/dist/components/molecule/radio-group.component.d.ts +63 -0
  127. package/dist/components/molecule/radio-group.component.d.ts.map +1 -0
  128. package/dist/components/molecule/radio-group.component.js +208 -0
  129. package/dist/components/molecule/radio-group.component.js.map +1 -0
  130. package/dist/components/molecule/select.component.d.ts +72 -0
  131. package/dist/components/molecule/select.component.d.ts.map +1 -0
  132. package/dist/components/molecule/select.component.js +274 -0
  133. package/dist/components/molecule/select.component.js.map +1 -0
  134. package/dist/components/molecule/spinner.component.d.ts +42 -0
  135. package/dist/components/molecule/spinner.component.d.ts.map +1 -0
  136. package/dist/components/molecule/spinner.component.js +122 -0
  137. package/dist/components/molecule/spinner.component.js.map +1 -0
  138. package/dist/components/molecule/switch.component.d.ts +54 -0
  139. package/dist/components/molecule/switch.component.d.ts.map +1 -0
  140. package/dist/components/molecule/switch.component.js +148 -0
  141. package/dist/components/molecule/switch.component.js.map +1 -0
  142. package/dist/components/molecule/toast.component.d.ts +98 -0
  143. package/dist/components/molecule/toast.component.d.ts.map +1 -0
  144. package/dist/components/molecule/toast.component.js +305 -0
  145. package/dist/components/molecule/toast.component.js.map +1 -0
  146. package/dist/components/molecule/tooltip.component.d.ts +77 -0
  147. package/dist/components/molecule/tooltip.component.d.ts.map +1 -0
  148. package/dist/components/molecule/tooltip.component.js +316 -0
  149. package/dist/components/molecule/tooltip.component.js.map +1 -0
  150. package/dist/components/optimistic-toggle-button.component.d.ts +125 -0
  151. package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -0
  152. package/dist/components/optimistic-toggle-button.component.js +296 -0
  153. package/dist/components/optimistic-toggle-button.component.js.map +1 -0
  154. package/dist/components/page-header.component.d.ts +77 -0
  155. package/dist/components/page-header.component.d.ts.map +1 -0
  156. package/dist/components/page-header.component.js +225 -0
  157. package/dist/components/page-header.component.js.map +1 -0
  158. package/dist/components/page-shell.component.d.ts +101 -0
  159. package/dist/components/page-shell.component.d.ts.map +1 -0
  160. package/dist/components/page-shell.component.js +221 -0
  161. package/dist/components/page-shell.component.js.map +1 -0
  162. package/dist/components/pagination.component.d.ts +137 -0
  163. package/dist/components/pagination.component.d.ts.map +1 -0
  164. package/dist/components/pagination.component.js +419 -0
  165. package/dist/components/pagination.component.js.map +1 -0
  166. package/dist/components/panel-close.component.d.ts +43 -0
  167. package/dist/components/panel-close.component.d.ts.map +1 -0
  168. package/dist/components/panel-close.component.js +75 -0
  169. package/dist/components/panel-close.component.js.map +1 -0
  170. package/dist/components/progress.component.d.ts +84 -0
  171. package/dist/components/progress.component.d.ts.map +1 -0
  172. package/dist/components/progress.component.js +219 -0
  173. package/dist/components/progress.component.js.map +1 -0
  174. package/dist/components/prompt-dialog.component.d.ts +121 -0
  175. package/dist/components/prompt-dialog.component.d.ts.map +1 -0
  176. package/dist/components/prompt-dialog.component.js +332 -0
  177. package/dist/components/prompt-dialog.component.js.map +1 -0
  178. package/dist/components/radio-group.component.d.ts +66 -34
  179. package/dist/components/radio-group.component.d.ts.map +1 -1
  180. package/dist/components/radio-group.component.js +157 -134
  181. package/dist/components/radio-group.component.js.map +1 -1
  182. package/dist/components/responsive-app-shell.component.d.ts +408 -0
  183. package/dist/components/responsive-app-shell.component.d.ts.map +1 -0
  184. package/dist/components/responsive-app-shell.component.js +1144 -0
  185. package/dist/components/responsive-app-shell.component.js.map +1 -0
  186. package/dist/components/select.component.d.ts +135 -38
  187. package/dist/components/select.component.d.ts.map +1 -1
  188. package/dist/components/select.component.js +373 -181
  189. package/dist/components/select.component.js.map +1 -1
  190. package/dist/components/separator.component.d.ts +39 -0
  191. package/dist/components/separator.component.d.ts.map +1 -0
  192. package/dist/components/separator.component.js +73 -0
  193. package/dist/components/separator.component.js.map +1 -0
  194. package/dist/components/sidebar-user-card.component.d.ts +106 -0
  195. package/dist/components/sidebar-user-card.component.d.ts.map +1 -0
  196. package/dist/components/sidebar-user-card.component.js +277 -0
  197. package/dist/components/sidebar-user-card.component.js.map +1 -0
  198. package/dist/components/skeleton.component.d.ts +100 -0
  199. package/dist/components/skeleton.component.d.ts.map +1 -0
  200. package/dist/components/skeleton.component.js +214 -0
  201. package/dist/components/skeleton.component.js.map +1 -0
  202. package/dist/components/spinner.component.d.ts +36 -19
  203. package/dist/components/spinner.component.d.ts.map +1 -1
  204. package/dist/components/spinner.component.js +69 -71
  205. package/dist/components/spinner.component.js.map +1 -1
  206. package/dist/components/switch.component.d.ts +72 -29
  207. package/dist/components/switch.component.d.ts.map +1 -1
  208. package/dist/components/switch.component.js +168 -95
  209. package/dist/components/switch.component.js.map +1 -1
  210. package/dist/components/table.component.d.ts +193 -0
  211. package/dist/components/table.component.d.ts.map +1 -0
  212. package/dist/components/table.component.js +550 -0
  213. package/dist/components/table.component.js.map +1 -0
  214. package/dist/components/tabs.component.d.ts +140 -0
  215. package/dist/components/tabs.component.d.ts.map +1 -0
  216. package/dist/components/tabs.component.js +390 -0
  217. package/dist/components/tabs.component.js.map +1 -0
  218. package/dist/components/template-outlet.directive.d.ts +50 -0
  219. package/dist/components/template-outlet.directive.d.ts.map +1 -0
  220. package/dist/components/template-outlet.directive.js +81 -0
  221. package/dist/components/template-outlet.directive.js.map +1 -0
  222. package/dist/components/textarea.component.d.ts +151 -0
  223. package/dist/components/textarea.component.d.ts.map +1 -0
  224. package/dist/components/textarea.component.js +340 -0
  225. package/dist/components/textarea.component.js.map +1 -0
  226. package/dist/components/theme-toggle.component.d.ts +58 -0
  227. package/dist/components/theme-toggle.component.d.ts.map +1 -0
  228. package/dist/components/theme-toggle.component.js +124 -0
  229. package/dist/components/theme-toggle.component.js.map +1 -0
  230. package/dist/components/toast.component.d.ts +237 -49
  231. package/dist/components/toast.component.d.ts.map +1 -1
  232. package/dist/components/toast.component.js +636 -201
  233. package/dist/components/toast.component.js.map +1 -1
  234. package/dist/components/tooltip.component.d.ts +95 -45
  235. package/dist/components/tooltip.component.d.ts.map +1 -1
  236. package/dist/components/tooltip.component.js +372 -221
  237. package/dist/components/tooltip.component.js.map +1 -1
  238. package/dist/components/user-menu-popover.component.d.ts +283 -0
  239. package/dist/components/user-menu-popover.component.d.ts.map +1 -0
  240. package/dist/components/user-menu-popover.component.js +646 -0
  241. package/dist/components/user-menu-popover.component.js.map +1 -0
  242. package/dist/components/user-menu.component.d.ts +95 -0
  243. package/dist/components/user-menu.component.d.ts.map +1 -0
  244. package/dist/components/user-menu.component.js +218 -0
  245. package/dist/components/user-menu.component.js.map +1 -0
  246. package/dist/hooks/index.d.ts +7 -0
  247. package/dist/hooks/index.d.ts.map +1 -0
  248. package/dist/hooks/index.js +7 -0
  249. package/dist/hooks/index.js.map +1 -0
  250. package/dist/hooks/use-is-desktop.d.ts +22 -0
  251. package/dist/hooks/use-is-desktop.d.ts.map +1 -0
  252. package/dist/hooks/use-is-desktop.js +37 -0
  253. package/dist/hooks/use-is-desktop.js.map +1 -0
  254. package/dist/index.d.ts +32 -17
  255. package/dist/index.d.ts.map +1 -1
  256. package/dist/index.js +32 -17
  257. package/dist/index.js.map +1 -1
  258. package/dist/types.d.ts +1 -1
  259. package/dist/types.d.ts.map +1 -1
  260. package/dist/utilities/dom-context.d.ts +42 -0
  261. package/dist/utilities/dom-context.d.ts.map +1 -0
  262. package/dist/utilities/dom-context.js +66 -0
  263. package/dist/utilities/dom-context.js.map +1 -0
  264. package/dist/utilities/focus.d.ts +32 -0
  265. package/dist/utilities/focus.d.ts.map +1 -0
  266. package/dist/utilities/focus.js +47 -0
  267. package/dist/utilities/focus.js.map +1 -0
  268. package/dist/utilities/form-field-context.d.ts +34 -0
  269. package/dist/utilities/form-field-context.d.ts.map +1 -0
  270. package/dist/utilities/form-field-context.js +28 -0
  271. package/dist/utilities/form-field-context.js.map +1 -0
  272. package/dist/utilities/form-submit-error.d.ts +17 -0
  273. package/dist/utilities/form-submit-error.d.ts.map +1 -0
  274. package/dist/utilities/form-submit-error.js +42 -0
  275. package/dist/utilities/form-submit-error.js.map +1 -0
  276. package/dist/utilities/icon-markup.d.ts +17 -0
  277. package/dist/utilities/icon-markup.d.ts.map +1 -0
  278. package/dist/utilities/icon-markup.js +46 -0
  279. package/dist/utilities/icon-markup.js.map +1 -0
  280. package/dist/utilities/ids.d.ts +15 -0
  281. package/dist/utilities/ids.d.ts.map +1 -0
  282. package/dist/utilities/ids.js +19 -0
  283. package/dist/utilities/ids.js.map +1 -0
  284. package/dist/utilities/index.d.ts +11 -0
  285. package/dist/utilities/index.d.ts.map +1 -1
  286. package/dist/utilities/index.js +11 -0
  287. package/dist/utilities/index.js.map +1 -1
  288. package/dist/utilities/initials.d.ts +13 -0
  289. package/dist/utilities/initials.d.ts.map +1 -0
  290. package/dist/utilities/initials.js +23 -0
  291. package/dist/utilities/initials.js.map +1 -0
  292. package/dist/utilities/node-value.d.ts +31 -0
  293. package/dist/utilities/node-value.d.ts.map +1 -0
  294. package/dist/utilities/node-value.js +37 -0
  295. package/dist/utilities/node-value.js.map +1 -0
  296. package/dist/utilities/optimistic-value.d.ts +81 -0
  297. package/dist/utilities/optimistic-value.d.ts.map +1 -0
  298. package/dist/utilities/optimistic-value.js +154 -0
  299. package/dist/utilities/optimistic-value.js.map +1 -0
  300. package/dist/utilities/render-icon.d.ts +77 -7
  301. package/dist/utilities/render-icon.d.ts.map +1 -1
  302. package/dist/utilities/render-icon.js +123 -33
  303. package/dist/utilities/render-icon.js.map +1 -1
  304. package/dist/utilities/rest-attrs.d.ts +21 -0
  305. package/dist/utilities/rest-attrs.d.ts.map +1 -0
  306. package/dist/utilities/rest-attrs.js +37 -0
  307. package/dist/utilities/rest-attrs.js.map +1 -0
  308. package/dist/utilities/style.d.ts +23 -0
  309. package/dist/utilities/style.d.ts.map +1 -0
  310. package/dist/utilities/style.js +86 -0
  311. package/dist/utilities/style.js.map +1 -0
  312. package/package.json +6 -4
@@ -0,0 +1,419 @@
1
+ /**
2
+ * Pagination component (React parity).
3
+ *
4
+ * @module
5
+ */
6
+ import { Component, EventEmitter, Output } from '@angular/core';
7
+ import { useTranslation } from '@molecule/app-angular';
8
+ import { getClassMap } from '@molecule/app-ui';
9
+ import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
10
+ import { styleText } from '../utilities/style.js';
11
+ import * as i0 from "@angular/core";
12
+ function Pagination_Conditional_1_Template(rf, ctx) { if (rf & 1) {
13
+ const _r1 = i0.ɵɵgetCurrentView();
14
+ i0.ɵɵelementStart(0, "li")(1, "button", 0);
15
+ i0.ɵɵlistener("click", function Pagination_Conditional_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handlePageChange(1)); });
16
+ i0.ɵɵnamespaceSVG();
17
+ i0.ɵɵelement(2, "svg", 1);
18
+ i0.ɵɵelementEnd()();
19
+ } if (rf & 2) {
20
+ const ctx_r1 = i0.ɵɵnextContext();
21
+ i0.ɵɵadvance();
22
+ i0.ɵɵclassMap(ctx_r1.buttonClasses(false));
23
+ i0.ɵɵproperty("disabled", ctx_r1.page === 1 || !!ctx_r1.disabled);
24
+ i0.ɵɵattribute("aria-label", ctx_r1.firstLabel());
25
+ i0.ɵɵadvance();
26
+ i0.ɵɵproperty("data", ctx_r1.icon("chevrons-left"));
27
+ } }
28
+ function Pagination_Conditional_2_Template(rf, ctx) { if (rf & 1) {
29
+ const _r3 = i0.ɵɵgetCurrentView();
30
+ i0.ɵɵelementStart(0, "li")(1, "button", 0);
31
+ i0.ɵɵlistener("click", function Pagination_Conditional_2_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handlePageChange(ctx_r1.page - 1)); });
32
+ i0.ɵɵnamespaceSVG();
33
+ i0.ɵɵelement(2, "svg", 1);
34
+ i0.ɵɵelementEnd()();
35
+ } if (rf & 2) {
36
+ const ctx_r1 = i0.ɵɵnextContext();
37
+ i0.ɵɵadvance();
38
+ i0.ɵɵclassMap(ctx_r1.buttonClasses(false));
39
+ i0.ɵɵproperty("disabled", ctx_r1.page === 1 || !!ctx_r1.disabled);
40
+ i0.ɵɵattribute("aria-label", ctx_r1.previousLabel());
41
+ i0.ɵɵadvance();
42
+ i0.ɵɵproperty("data", ctx_r1.icon("chevron-left"));
43
+ } }
44
+ function Pagination_For_4_Conditional_0_Template(rf, ctx) { if (rf & 1) {
45
+ i0.ɵɵelementStart(0, "li")(1, "span", 2);
46
+ i0.ɵɵnamespaceSVG();
47
+ i0.ɵɵelement(2, "svg", 1);
48
+ i0.ɵɵelementEnd()();
49
+ } if (rf & 2) {
50
+ const ctx_r1 = i0.ɵɵnextContext(2);
51
+ i0.ɵɵadvance();
52
+ i0.ɵɵclassMap(ctx_r1.cm().paginationEllipsis);
53
+ i0.ɵɵadvance();
54
+ i0.ɵɵproperty("data", ctx_r1.icon("ellipsis-horizontal"));
55
+ } }
56
+ function Pagination_For_4_Conditional_1_Template(rf, ctx) { if (rf & 1) {
57
+ const _r4 = i0.ɵɵgetCurrentView();
58
+ i0.ɵɵelementStart(0, "li")(1, "button", 0);
59
+ i0.ɵɵlistener("click", function Pagination_For_4_Conditional_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const item_r5 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handlePageChange(item_r5)); });
60
+ i0.ɵɵtext(2);
61
+ i0.ɵɵelementEnd()();
62
+ } if (rf & 2) {
63
+ const item_r5 = i0.ɵɵnextContext().$implicit;
64
+ const ctx_r1 = i0.ɵɵnextContext();
65
+ i0.ɵɵadvance();
66
+ i0.ɵɵclassMap(ctx_r1.buttonClasses(item_r5 === ctx_r1.page));
67
+ i0.ɵɵproperty("disabled", !!ctx_r1.disabled);
68
+ i0.ɵɵattribute("aria-label", ctx_r1.pageLabel(item_r5))("aria-current", item_r5 === ctx_r1.page ? "page" : null);
69
+ i0.ɵɵadvance();
70
+ i0.ɵɵtextInterpolate1(" ", item_r5, " ");
71
+ } }
72
+ function Pagination_For_4_Template(rf, ctx) { if (rf & 1) {
73
+ i0.ɵɵconditionalCreate(0, Pagination_For_4_Conditional_0_Template, 3, 3, "li")(1, Pagination_For_4_Conditional_1_Template, 3, 6, "li");
74
+ } if (rf & 2) {
75
+ const item_r5 = ctx.$implicit;
76
+ i0.ɵɵconditional(item_r5 === "ellipsis" ? 0 : 1);
77
+ } }
78
+ function Pagination_Conditional_5_Template(rf, ctx) { if (rf & 1) {
79
+ const _r6 = i0.ɵɵgetCurrentView();
80
+ i0.ɵɵelementStart(0, "li")(1, "button", 0);
81
+ i0.ɵɵlistener("click", function Pagination_Conditional_5_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handlePageChange(ctx_r1.page + 1)); });
82
+ i0.ɵɵnamespaceSVG();
83
+ i0.ɵɵelement(2, "svg", 1);
84
+ i0.ɵɵelementEnd()();
85
+ } if (rf & 2) {
86
+ const ctx_r1 = i0.ɵɵnextContext();
87
+ i0.ɵɵadvance();
88
+ i0.ɵɵclassMap(ctx_r1.buttonClasses(false));
89
+ i0.ɵɵproperty("disabled", ctx_r1.page === ctx_r1.totalPages || !!ctx_r1.disabled);
90
+ i0.ɵɵattribute("aria-label", ctx_r1.nextLabel());
91
+ i0.ɵɵadvance();
92
+ i0.ɵɵproperty("data", ctx_r1.icon("chevron-right"));
93
+ } }
94
+ function Pagination_Conditional_6_Template(rf, ctx) { if (rf & 1) {
95
+ const _r7 = i0.ɵɵgetCurrentView();
96
+ i0.ɵɵelementStart(0, "li")(1, "button", 0);
97
+ i0.ɵɵlistener("click", function Pagination_Conditional_6_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handlePageChange(ctx_r1.totalPages)); });
98
+ i0.ɵɵnamespaceSVG();
99
+ i0.ɵɵelement(2, "svg", 1);
100
+ i0.ɵɵelementEnd()();
101
+ } if (rf & 2) {
102
+ const ctx_r1 = i0.ɵɵnextContext();
103
+ i0.ɵɵadvance();
104
+ i0.ɵɵclassMap(ctx_r1.buttonClasses(false));
105
+ i0.ɵɵproperty("disabled", ctx_r1.page === ctx_r1.totalPages || !!ctx_r1.disabled);
106
+ i0.ɵɵattribute("aria-label", ctx_r1.lastLabel());
107
+ i0.ɵɵadvance();
108
+ i0.ɵɵproperty("data", ctx_r1.icon("chevrons-right"));
109
+ } }
110
+ /**
111
+ * Generates the pagination range with ellipsis markers (React's
112
+ * `generatePaginationRange`).
113
+ *
114
+ * @param currentPage - The active page.
115
+ * @param totalPages - The total number of pages.
116
+ * @param siblings - Sibling pages around the active page.
117
+ * @param boundaries - Boundary pages at the start and end.
118
+ * @returns Page numbers and `'ellipsis'` markers.
119
+ */
120
+ function generatePaginationRange(currentPage, totalPages, siblings, boundaries) {
121
+ const range = [];
122
+ for (let i = 1; i <= Math.min(boundaries, totalPages); i++)
123
+ range.push(i);
124
+ const siblingStart = Math.max(boundaries + 1, currentPage - siblings);
125
+ const siblingEnd = Math.min(totalPages - boundaries, currentPage + siblings);
126
+ if (siblingStart > boundaries + 1)
127
+ range.push('ellipsis');
128
+ for (let i = siblingStart; i <= siblingEnd; i++)
129
+ if (!range.includes(i))
130
+ range.push(i);
131
+ if (siblingEnd < totalPages - boundaries)
132
+ range.push('ellipsis');
133
+ for (let i = Math.max(totalPages - boundaries + 1, boundaries + 1); i <= totalPages; i++) {
134
+ if (!range.includes(i))
135
+ range.push(i);
136
+ }
137
+ return range;
138
+ }
139
+ /**
140
+ * Pagination component.
141
+ *
142
+ * The host is the `<nav>` (`nav[mol-pagination]`), exactly React's root.
143
+ */
144
+ export class Pagination {
145
+ /** The active page. */
146
+ page = 1;
147
+ /** The total number of pages. */
148
+ totalPages = 1;
149
+ /** Sibling pages around the active page (default 1). */
150
+ siblings = 1;
151
+ /** Boundary pages at the start and end (default 1). */
152
+ boundaries = 1;
153
+ /** Button size. */
154
+ size = 'md';
155
+ /** Whether the first/last buttons render. */
156
+ showFirstLast = false;
157
+ /** Whether the previous/next buttons render (default true). */
158
+ showPrevNext = true;
159
+ /** Accessible labels. */
160
+ labels;
161
+ /** Extra classes for the nav. */
162
+ className;
163
+ /** Inline style object (React camelCase). */
164
+ style;
165
+ /** `data-testid`. */
166
+ testId;
167
+ /** Disables every button. */
168
+ disabled;
169
+ /** Fires with the requested page (React's `onChange`). */
170
+ change = new EventEmitter();
171
+ /**
172
+ * Reactive translation, read in the injection context. Its `t` reads the
173
+ * locale, so the view re-renders the text on a locale switch (the static `t`
174
+ * does not).
175
+ */
176
+ i18n = useTranslation();
177
+ /**
178
+ * The current class map.
179
+ * @returns The UIClassMap.
180
+ */
181
+ cm() {
182
+ return getClassMap();
183
+ }
184
+ /**
185
+ * The root class list.
186
+ * @returns The class string.
187
+ */
188
+ classes() {
189
+ return this.cm().cn(this.cm().paginationRoot, this.className);
190
+ }
191
+ /**
192
+ * Serializes the root's inline style.
193
+ * @returns The style attribute text.
194
+ */
195
+ hostStyle() {
196
+ return styleText(this.style);
197
+ }
198
+ /**
199
+ * The generated page range.
200
+ * @returns The range.
201
+ */
202
+ range() {
203
+ return generatePaginationRange(this.page, this.totalPages, this.siblings, this.boundaries);
204
+ }
205
+ /**
206
+ * A pagination button's class list.
207
+ * @param isActive - Whether it is the active page.
208
+ * @returns The class string.
209
+ */
210
+ buttonClasses(isActive) {
211
+ return this.cm().cn(this.cm().pagination({ active: isActive, size: this.size }), this.cm().paginationInteractive);
212
+ }
213
+ /**
214
+ * A button glyph.
215
+ * @param name - The icon name.
216
+ * @returns The resolved icon.
217
+ */
218
+ icon(name) {
219
+ return resolveIcon(name, this.cm().iconSm);
220
+ }
221
+ /**
222
+ * The nav's accessible label.
223
+ * @returns The label.
224
+ */
225
+ navLabel() {
226
+ return (this.labels?.nav ??
227
+ this.i18n.t('ui.pagination.nav', undefined, { defaultValue: 'Pagination' }));
228
+ }
229
+ /**
230
+ * The first-page button's accessible label.
231
+ * @returns The label.
232
+ */
233
+ firstLabel() {
234
+ return (this.labels?.first ??
235
+ this.i18n.t('ui.pagination.first', undefined, { defaultValue: 'Go to first page' }));
236
+ }
237
+ /**
238
+ * The previous-page button's accessible label.
239
+ * @returns The label.
240
+ */
241
+ previousLabel() {
242
+ return (this.labels?.previous ??
243
+ this.i18n.t('ui.pagination.previous', undefined, { defaultValue: 'Go to previous page' }));
244
+ }
245
+ /**
246
+ * The next-page button's accessible label.
247
+ * @returns The label.
248
+ */
249
+ nextLabel() {
250
+ return (this.labels?.next ??
251
+ this.i18n.t('ui.pagination.next', undefined, { defaultValue: 'Go to next page' }));
252
+ }
253
+ /**
254
+ * The last-page button's accessible label.
255
+ * @returns The label.
256
+ */
257
+ lastLabel() {
258
+ return (this.labels?.last ??
259
+ this.i18n.t('ui.pagination.last', undefined, { defaultValue: 'Go to last page' }));
260
+ }
261
+ /**
262
+ * A numbered page button's accessible label (a custom `labels.goToPage`
263
+ * wins, then the localized default).
264
+ *
265
+ * @param item - The page number.
266
+ * @returns The label.
267
+ */
268
+ pageLabel(item) {
269
+ const custom = this.labels?.goToPage?.(item);
270
+ if (custom !== undefined && custom !== null)
271
+ return custom;
272
+ return this.i18n.t('ui.pagination.goToPage', { page: item }, { defaultValue: 'Go to page {{page}}' });
273
+ }
274
+ /**
275
+ * Requests a page change (React's `handlePageChange`).
276
+ * @param newPage - The requested page.
277
+ */
278
+ handlePageChange(newPage) {
279
+ if (newPage >= 1 && newPage <= this.totalPages && newPage !== this.page && !this.disabled) {
280
+ this.change.emit(newPage);
281
+ }
282
+ }
283
+ static ɵfac = function Pagination_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Pagination)(); };
284
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Pagination, selectors: [["nav", "mol-pagination", ""]], hostAttrs: ["role", "navigation"], hostVars: 6, hostBindings: function Pagination_HostBindings(rf, ctx) { if (rf & 2) {
285
+ i0.ɵɵattribute("aria-label", ctx.navLabel())("data-testid", ctx.testId);
286
+ i0.ɵɵstyleMap(ctx.hostStyle());
287
+ i0.ɵɵclassMap(ctx.classes());
288
+ } }, inputs: { page: "page", totalPages: "totalPages", siblings: "siblings", boundaries: "boundaries", size: "size", showFirstLast: "showFirstLast", showPrevNext: "showPrevNext", labels: "labels", className: "className", style: "style", testId: "testId", disabled: "disabled" }, outputs: { change: "change" }, decls: 7, vars: 6, consts: [["type", "button", 3, "click", "disabled"], ["mol-icon", "", 3, "data"], ["aria-hidden", "true"]], template: function Pagination_Template(rf, ctx) { if (rf & 1) {
289
+ i0.ɵɵelementStart(0, "ul");
290
+ i0.ɵɵconditionalCreate(1, Pagination_Conditional_1_Template, 3, 5, "li");
291
+ i0.ɵɵconditionalCreate(2, Pagination_Conditional_2_Template, 3, 5, "li");
292
+ i0.ɵɵrepeaterCreate(3, Pagination_For_4_Template, 2, 1, null, null, i0.ɵɵrepeaterTrackByIndex);
293
+ i0.ɵɵconditionalCreate(5, Pagination_Conditional_5_Template, 3, 5, "li");
294
+ i0.ɵɵconditionalCreate(6, Pagination_Conditional_6_Template, 3, 5, "li");
295
+ i0.ɵɵelementEnd();
296
+ } if (rf & 2) {
297
+ i0.ɵɵclassMap(ctx.cm().paginationContent);
298
+ i0.ɵɵadvance();
299
+ i0.ɵɵconditional(ctx.showFirstLast ? 1 : -1);
300
+ i0.ɵɵadvance();
301
+ i0.ɵɵconditional(ctx.showPrevNext ? 2 : -1);
302
+ i0.ɵɵadvance();
303
+ i0.ɵɵrepeater(ctx.range());
304
+ i0.ɵɵadvance(2);
305
+ i0.ɵɵconditional(ctx.showPrevNext ? 5 : -1);
306
+ i0.ɵɵadvance();
307
+ i0.ɵɵconditional(ctx.showFirstLast ? 6 : -1);
308
+ } }, dependencies: [MolIconSvg], encapsulation: 2 });
309
+ }
310
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Pagination, [{
311
+ type: Component,
312
+ args: [{
313
+ selector: 'nav[mol-pagination]',
314
+ standalone: true,
315
+ imports: [MolIconSvg],
316
+ inputs: [
317
+ 'page',
318
+ 'totalPages',
319
+ 'siblings',
320
+ 'boundaries',
321
+ 'size',
322
+ 'showFirstLast',
323
+ 'showPrevNext',
324
+ 'labels',
325
+ 'className',
326
+ 'style',
327
+ 'testId',
328
+ 'disabled',
329
+ ],
330
+ outputs: ['change'],
331
+ host: {
332
+ role: 'navigation',
333
+ '[attr.aria-label]': 'navLabel()',
334
+ '[class]': 'classes()',
335
+ '[style]': 'hostStyle()',
336
+ '[attr.data-testid]': 'testId',
337
+ },
338
+ template: `<ul [class]="cm().paginationContent">
339
+ @if (showFirstLast) {
340
+ <li>
341
+ <button
342
+ type="button"
343
+ [class]="buttonClasses(false)"
344
+ (click)="handlePageChange(1)"
345
+ [disabled]="page === 1 || !!disabled"
346
+ [attr.aria-label]="firstLabel()"
347
+ >
348
+ <svg mol-icon [data]="icon('chevrons-left')" />
349
+ </button>
350
+ </li>
351
+ }
352
+ @if (showPrevNext) {
353
+ <li>
354
+ <button
355
+ type="button"
356
+ [class]="buttonClasses(false)"
357
+ (click)="handlePageChange(page - 1)"
358
+ [disabled]="page === 1 || !!disabled"
359
+ [attr.aria-label]="previousLabel()"
360
+ >
361
+ <svg mol-icon [data]="icon('chevron-left')" />
362
+ </button>
363
+ </li>
364
+ }
365
+ @for (item of range(); track $index) {
366
+ @if (item === 'ellipsis') {
367
+ <li>
368
+ <span [class]="cm().paginationEllipsis" aria-hidden="true"
369
+ ><svg mol-icon [data]="icon('ellipsis-horizontal')"
370
+ /></span>
371
+ </li>
372
+ } @else {
373
+ <li>
374
+ <button
375
+ type="button"
376
+ [class]="buttonClasses(item === page)"
377
+ (click)="handlePageChange(item)"
378
+ [disabled]="!!disabled"
379
+ [attr.aria-label]="pageLabel(item)"
380
+ [attr.aria-current]="item === page ? 'page' : null"
381
+ >
382
+ {{ item }}
383
+ </button>
384
+ </li>
385
+ }
386
+ }
387
+ @if (showPrevNext) {
388
+ <li>
389
+ <button
390
+ type="button"
391
+ [class]="buttonClasses(false)"
392
+ (click)="handlePageChange(page + 1)"
393
+ [disabled]="page === totalPages || !!disabled"
394
+ [attr.aria-label]="nextLabel()"
395
+ >
396
+ <svg mol-icon [data]="icon('chevron-right')" />
397
+ </button>
398
+ </li>
399
+ }
400
+ @if (showFirstLast) {
401
+ <li>
402
+ <button
403
+ type="button"
404
+ [class]="buttonClasses(false)"
405
+ (click)="handlePageChange(totalPages)"
406
+ [disabled]="page === totalPages || !!disabled"
407
+ [attr.aria-label]="lastLabel()"
408
+ >
409
+ <svg mol-icon [data]="icon('chevrons-right')" />
410
+ </button>
411
+ </li>
412
+ }
413
+ </ul>`,
414
+ }]
415
+ }], null, { change: [{
416
+ type: Output
417
+ }] }); })();
418
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Pagination, { className: "Pagination", filePath: "components/pagination.component.ts", lineNumber: 170 }); })();
419
+ //# sourceMappingURL=pagination.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.component.js","sourceRoot":"","sources":["../../src/components/pagination.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,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EAAE,CAAC,QAAQ,CAAC;gBACnB,IAAI,EAAE;oBACJ,IAAI,EAAE,YAAY;oBAClB,mBAAmB,EAAE,YAAY;oBACjC,SAAS,EAAE,WAAW;oBACtB,SAAS,EAAE,aAAa;oBACxB,oBAAoB,EAAE,QAAQ;iBAC/B;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2EJ;aACP;;kBA4BE,MAAM;;kFA3BI,UAAU"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * PanelCloseProvider and `usePanelClose` (React parity).
3
+ *
4
+ * React provides the close callback through a React context, which follows
5
+ * the rendered tree — including projected children. Angular DI does not reach
6
+ * projected content, so the value is registered on the provider's host
7
+ * element and looked up through the DOM ancestors
8
+ * (`utilities/dom-context.ts`), the same way React's context resolves.
9
+ *
10
+ * @module
11
+ */
12
+ import { type OnDestroy } from '@angular/core';
13
+ import * as i0 from "@angular/core";
14
+ /**
15
+ * Provides the drawer-close callback to descendants.
16
+ *
17
+ * Rendered internally by `UserMenu` and `SidebarUserCard` around their panel
18
+ * content; apps do not normally render it directly. The host is unwrapped
19
+ * (`data-parity-unwrap`, React's context provider renders no DOM) and the
20
+ * projected children render directly inside it.
21
+ */
22
+ export declare class PanelCloseProvider implements OnDestroy {
23
+ /** Callback that dismisses the enclosing drawer/modal. */
24
+ close?: () => void;
25
+ private readonly host;
26
+ /** Registers the context value on the host (before any projected child resolves it). */
27
+ constructor();
28
+ /** Removes the context registration (unmount). */
29
+ ngOnDestroy(): void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<PanelCloseProvider, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<PanelCloseProvider, "mol-panel-close-provider", never, { "close": { "alias": "close"; "required": false; }; }, {}, never, ["*"], true, never>;
32
+ }
33
+ /**
34
+ * Returns the callback that dismisses the drawer the current panel is
35
+ * mounted in. Safe to call anywhere — a no-op outside a provider.
36
+ *
37
+ * Must be called in an injection context (a component field initializer or
38
+ * constructor).
39
+ *
40
+ * @returns A function that closes the enclosing drawer, or a no-op.
41
+ */
42
+ export declare function usePanelClose(): () => void;
43
+ //# sourceMappingURL=panel-close.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel-close.component.d.ts","sourceRoot":"","sources":["../../src/components/panel-close.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;;AAI7E;;;;;;;GAOG;AACH,qBAUa,kBAAmB,YAAW,SAAS;IAClD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAElB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8C;IACnE,wFAAwF;;IAKxF,kDAAkD;IAClD,WAAW,IAAI,IAAI;yCAXR,kBAAkB;2CAAlB,kBAAkB;CAc9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,MAAM,IAAI,CAS1C"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * PanelCloseProvider and `usePanelClose` (React parity).
3
+ *
4
+ * React provides the close callback through a React context, which follows
5
+ * the rendered tree — including projected children. Angular DI does not reach
6
+ * projected content, so the value is registered on the provider's host
7
+ * element and looked up through the DOM ancestors
8
+ * (`utilities/dom-context.ts`), the same way React's context resolves.
9
+ *
10
+ * @module
11
+ */
12
+ import { Component, ElementRef, inject } from '@angular/core';
13
+ import { findDomContext, provideDomContext, removeDomContext } from '../utilities/dom-context.js';
14
+ import * as i0 from "@angular/core";
15
+ const _c0 = ["*"];
16
+ /**
17
+ * Provides the drawer-close callback to descendants.
18
+ *
19
+ * Rendered internally by `UserMenu` and `SidebarUserCard` around their panel
20
+ * content; apps do not normally render it directly. The host is unwrapped
21
+ * (`data-parity-unwrap`, React's context provider renders no DOM) and the
22
+ * projected children render directly inside it.
23
+ */
24
+ export class PanelCloseProvider {
25
+ /** Callback that dismisses the enclosing drawer/modal. */
26
+ close;
27
+ host = inject(ElementRef);
28
+ /** Registers the context value on the host (before any projected child resolves it). */
29
+ constructor() {
30
+ provideDomContext(this.host.nativeElement, { close: () => this.close?.() });
31
+ }
32
+ /** Removes the context registration (unmount). */
33
+ ngOnDestroy() {
34
+ removeDomContext(this.host.nativeElement);
35
+ }
36
+ static ɵfac = function PanelCloseProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PanelCloseProvider)(); };
37
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PanelCloseProvider, selectors: [["mol-panel-close-provider"]], hostAttrs: ["data-parity-unwrap", "", 2, "display", "contents"], inputs: { close: "close" }, ngContentSelectors: _c0, decls: 1, vars: 0, template: function PanelCloseProvider_Template(rf, ctx) { if (rf & 1) {
38
+ i0.ɵɵprojectionDef();
39
+ i0.ɵɵprojection(0);
40
+ } }, encapsulation: 2 });
41
+ }
42
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PanelCloseProvider, [{
43
+ type: Component,
44
+ args: [{
45
+ selector: 'mol-panel-close-provider',
46
+ standalone: true,
47
+ inputs: ['close'],
48
+ host: {
49
+ 'data-parity-unwrap': '',
50
+ style: 'display: contents',
51
+ },
52
+ template: `<ng-content></ng-content>`,
53
+ }]
54
+ }], () => [], null); })();
55
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PanelCloseProvider, { className: "PanelCloseProvider", filePath: "components/panel-close.component.ts", lineNumber: 35 }); })();
56
+ /**
57
+ * Returns the callback that dismisses the drawer the current panel is
58
+ * mounted in. Safe to call anywhere — a no-op outside a provider.
59
+ *
60
+ * Must be called in an injection context (a component field initializer or
61
+ * constructor).
62
+ *
63
+ * @returns A function that closes the enclosing drawer, or a no-op.
64
+ */
65
+ export function usePanelClose() {
66
+ const el = inject(ElementRef, { optional: true });
67
+ // Resolved at CALL time: a probe (or panel) component resolves its context in
68
+ // its constructor, before Angular has inserted its host into the DOM, so the
69
+ // provider is only reachable from the ancestor walk once the tree is built.
70
+ return () => {
71
+ const found = findDomContext(el?.nativeElement ?? null);
72
+ found?.close();
73
+ };
74
+ }
75
+ //# sourceMappingURL=panel-close.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel-close.component.js","sourceRoot":"","sources":["../../src/components/panel-close.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAA;AAE7E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;;;AAEjG;;;;;;;GAOG;AAWH,MAAM,OAAO,kBAAkB;IAC7B,0DAA0D;IAC1D,KAAK,CAAa;IAED,IAAI,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAA;IACnE,wFAAwF;IACxF;QACE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAA;IAC7E,CAAC;IAED,kDAAkD;IAClD,WAAW;QACT,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAC3C,CAAC;4GAbU,kBAAkB;6DAAlB,kBAAkB;;YAFlB,kBAAyB;;;iFAEzB,kBAAkB;cAV9B,SAAS;eAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,IAAI,EAAE;oBACJ,oBAAoB,EAAE,EAAE;oBACxB,KAAK,EAAE,mBAAmB;iBAC3B;gBACD,QAAQ,EAAE,2BAA2B;aACtC;;kFACY,kBAAkB;AAgB/B;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAmC,CAAA;IACnF,8EAA8E;IAC9E,6EAA6E;IAC7E,4EAA4E;IAC5E,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,cAAc,CAAwB,EAAE,EAAE,aAAa,IAAI,IAAI,CAAC,CAAA;QAC9E,KAAK,EAAE,KAAK,EAAE,CAAA;IAChB,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { ColorVariant, Size, UIClassMap } from '@molecule/app-ui';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Progress component.
5
+ *
6
+ * The host is the wrapper div React renders; `aria-valuenow` is clamped into
7
+ * `[0, max]` to match the clamped visual bar.
8
+ */
9
+ export declare class Progress {
10
+ /** Progress value (0–max). */
11
+ value: number;
12
+ /** Maximum value. */
13
+ max: number;
14
+ /** Progress size. */
15
+ size?: Size;
16
+ /** Progress color. */
17
+ color?: ColorVariant;
18
+ /** Whether the numeric value label renders. */
19
+ showValue?: boolean;
20
+ /** Accessible label. */
21
+ label?: string;
22
+ /** Whether the progress is indeterminate. */
23
+ indeterminate?: boolean;
24
+ /** Extra classes joined onto the wrapper classes. */
25
+ className?: string;
26
+ /** Inline style object (React camelCase). */
27
+ style?: Record<string, unknown>;
28
+ /** `data-testid`. */
29
+ testId?: string;
30
+ /**
31
+ * Reactive translation, read in the injection context. Its `t` reads the
32
+ * locale, so the view re-renders the text on a locale switch (the static `t`
33
+ * does not).
34
+ */
35
+ private readonly i18n;
36
+ /**
37
+ * The current class map.
38
+ * @returns The UIClassMap.
39
+ */
40
+ cm(): UIClassMap;
41
+ /**
42
+ * The percentage, clamped to [0, 100].
43
+ * @returns The percentage.
44
+ */
45
+ get percent(): number;
46
+ /**
47
+ * The rounded percentage shown in the value label.
48
+ * @returns The whole percentage.
49
+ */
50
+ get rounded(): number;
51
+ /**
52
+ * The clamped aria-valuenow.
53
+ * @returns The clamped value.
54
+ */
55
+ get clamped(): number;
56
+ /**
57
+ * The accessible label with the localized default.
58
+ * @returns The label text.
59
+ */
60
+ progressLabel(): string;
61
+ /**
62
+ * Computes the wrapper class list.
63
+ * @returns The class string.
64
+ */
65
+ classes(): string;
66
+ /**
67
+ * Computes the bar class list.
68
+ * @returns The class string.
69
+ */
70
+ barClasses(): string;
71
+ /**
72
+ * Serializes the bar's inline style (the translateX fill, unless indeterminate).
73
+ * @returns The style attribute text.
74
+ */
75
+ barStyle(): string | null;
76
+ /**
77
+ * Serializes the inline style.
78
+ * @returns The style attribute text.
79
+ */
80
+ hostStyle(): string | null;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<Progress, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<Progress, "div[mol-progress]", never, { "value": { "alias": "value"; "required": false; }; "max": { "alias": "max"; "required": false; }; "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; "showValue": { "alias": "showValue"; "required": false; }; "label": { "alias": "label"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, never, true, never>;
83
+ }
84
+ //# sourceMappingURL=progress.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.component.d.ts","sourceRoot":"","sources":["../../src/components/progress.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAKtE;;;;;GAKG;AACH,qBA4Ca,QAAQ;IACnB,8BAA8B;IAC9B,KAAK,SAAI;IACT,qBAAqB;IACrB,GAAG,SAAM;IACT,qBAAqB;IACrB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,sBAAsB;IACtB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6CAA6C;IAC7C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAGpB;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAGpB;IAED;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAQpB;;;OAGG;IACH,QAAQ,IAAI,MAAM,GAAG,IAAI;IAKzB;;;OAGG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;yCAxGf,QAAQ;2CAAR,QAAQ;CA2GpB"}