ngwr 16.5.0 → 16.6.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 (287) hide show
  1. package/back-top/styles/_index.scss +6 -0
  2. package/breadcrumbs/styles/_rules.scss +34 -0
  3. package/cascader/styles/_rules.scss +7 -0
  4. package/charts/chart-legend/styles/_index.scss +1 -9
  5. package/counter/styles/_index.scss +1 -8
  6. package/date-picker/styles/_index.scss +15 -9
  7. package/dialog/styles/_index.scss +37 -0
  8. package/editor/styles/_index.scss +1 -8
  9. package/event-calendar/styles/_index.scss +2 -6
  10. package/fesm2022/ngwr-affix.mjs +1 -1
  11. package/fesm2022/ngwr-affix.mjs.map +1 -1
  12. package/fesm2022/ngwr-anchor.mjs +9 -2
  13. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  14. package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
  15. package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
  16. package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
  17. package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
  18. package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
  19. package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
  20. package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
  21. package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
  22. package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
  23. package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
  24. package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
  25. package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
  26. package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
  27. package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
  28. package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
  29. package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
  30. package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
  31. package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
  32. package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
  33. package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
  34. package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
  35. package/fesm2022/ngwr-animations-tilt.mjs +20 -13
  36. package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
  37. package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
  38. package/fesm2022/ngwr-breadcrumbs.mjs +40 -7
  39. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  40. package/fesm2022/ngwr-button.mjs +12 -3
  41. package/fesm2022/ngwr-button.mjs.map +1 -1
  42. package/fesm2022/ngwr-carousel.mjs +8 -2
  43. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  44. package/fesm2022/ngwr-cascader.mjs +24 -4
  45. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  46. package/fesm2022/ngwr-charts-core.mjs +12 -5
  47. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  48. package/fesm2022/ngwr-charts-meter-group.mjs +4 -2
  49. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  50. package/fesm2022/ngwr-checkbox.mjs +3 -2
  51. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  52. package/fesm2022/ngwr-color-picker.mjs +21 -1
  53. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  54. package/fesm2022/ngwr-context-menu.mjs +4 -5
  55. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  56. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  57. package/fesm2022/ngwr-date-picker.mjs +49 -1
  58. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog.mjs +16 -6
  60. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  61. package/fesm2022/ngwr-directives.mjs +9 -6
  62. package/fesm2022/ngwr-directives.mjs.map +1 -1
  63. package/fesm2022/ngwr-event-calendar.mjs +20 -9
  64. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  65. package/fesm2022/ngwr-form.mjs +170 -3
  66. package/fesm2022/ngwr-form.mjs.map +1 -1
  67. package/fesm2022/ngwr-i18n-ar.mjs +15 -0
  68. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  69. package/fesm2022/ngwr-i18n-cs.mjs +15 -0
  70. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  71. package/fesm2022/ngwr-i18n-de.mjs +15 -0
  72. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  73. package/fesm2022/ngwr-i18n-en.mjs +15 -0
  74. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n-es.mjs +15 -0
  76. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  77. package/fesm2022/ngwr-i18n-fr.mjs +15 -0
  78. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  79. package/fesm2022/ngwr-i18n-he.mjs +15 -0
  80. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-hi.mjs +15 -0
  82. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-id.mjs +15 -0
  84. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-it.mjs +15 -0
  86. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-ja.mjs +15 -0
  88. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-ko.mjs +15 -0
  90. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-nl.mjs +15 -0
  92. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-pl.mjs +15 -0
  94. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-pt.mjs +15 -0
  96. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-ru.mjs +15 -0
  98. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-sv.mjs +15 -0
  100. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-tr.mjs +15 -0
  102. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-uk.mjs +15 -0
  104. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-vi.mjs +15 -0
  106. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-zh-tw.mjs +15 -0
  108. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-zh.mjs +15 -0
  110. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n.mjs +82 -11
  112. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  113. package/fesm2022/ngwr-input-number.mjs +24 -1
  114. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  115. package/fesm2022/ngwr-input-otp.mjs +2 -2
  116. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  117. package/fesm2022/ngwr-input.mjs +10 -2
  118. package/fesm2022/ngwr-input.mjs.map +1 -1
  119. package/fesm2022/ngwr-layout.mjs.map +1 -1
  120. package/fesm2022/ngwr-list.mjs +1 -1
  121. package/fesm2022/ngwr-list.mjs.map +1 -1
  122. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  123. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  124. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  125. package/fesm2022/ngwr-mention.mjs +8 -0
  126. package/fesm2022/ngwr-mention.mjs.map +1 -1
  127. package/fesm2022/ngwr-meta.mjs +9 -6
  128. package/fesm2022/ngwr-meta.mjs.map +1 -1
  129. package/fesm2022/ngwr-page-header.mjs +21 -0
  130. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  131. package/fesm2022/ngwr-pagination.mjs +2 -0
  132. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  133. package/fesm2022/ngwr-pipes.mjs +8 -1
  134. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  135. package/fesm2022/ngwr-popconfirm.mjs +2 -1
  136. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  137. package/fesm2022/ngwr-popover.mjs +47 -3
  138. package/fesm2022/ngwr-popover.mjs.map +1 -1
  139. package/fesm2022/ngwr-qr.mjs +6 -2
  140. package/fesm2022/ngwr-qr.mjs.map +1 -1
  141. package/fesm2022/ngwr-radio.mjs +71 -5
  142. package/fesm2022/ngwr-radio.mjs.map +1 -1
  143. package/fesm2022/ngwr-schema-form.mjs +10 -1
  144. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  145. package/fesm2022/ngwr-scroll.mjs +1 -3
  146. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  147. package/fesm2022/ngwr-segmented.mjs +20 -0
  148. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  149. package/fesm2022/ngwr-select.mjs +80 -9
  150. package/fesm2022/ngwr-select.mjs.map +1 -1
  151. package/fesm2022/ngwr-sortable-list.mjs +16 -4
  152. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  153. package/fesm2022/ngwr-storage.mjs +1 -1
  154. package/fesm2022/ngwr-storage.mjs.map +1 -1
  155. package/fesm2022/ngwr-switch.mjs +2 -2
  156. package/fesm2022/ngwr-switch.mjs.map +1 -1
  157. package/fesm2022/ngwr-table.mjs +41 -7
  158. package/fesm2022/ngwr-table.mjs.map +1 -1
  159. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  160. package/fesm2022/ngwr-textarea.mjs +2 -2
  161. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  162. package/fesm2022/ngwr-toast.mjs +28 -0
  163. package/fesm2022/ngwr-toast.mjs.map +1 -1
  164. package/fesm2022/ngwr-tour.mjs +2 -2
  165. package/fesm2022/ngwr-tour.mjs.map +1 -1
  166. package/fesm2022/ngwr-typography.mjs +20 -0
  167. package/fesm2022/ngwr-typography.mjs.map +1 -1
  168. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  169. package/fesm2022/ngwr-utils.mjs +46 -4
  170. package/fesm2022/ngwr-utils.mjs.map +1 -1
  171. package/fesm2022/ngwr-validators.mjs +33 -1
  172. package/fesm2022/ngwr-validators.mjs.map +1 -1
  173. package/fesm2022/ngwr-version.mjs +1 -1
  174. package/fesm2022/ngwr-version.mjs.map +1 -1
  175. package/form/styles/_index.scss +37 -0
  176. package/graph/styles/_index.scss +1 -9
  177. package/i18n/ar.json +15 -0
  178. package/i18n/cs.json +15 -0
  179. package/i18n/de.json +15 -0
  180. package/i18n/en.json +15 -0
  181. package/i18n/es.json +15 -0
  182. package/i18n/fr.json +15 -0
  183. package/i18n/he.json +15 -0
  184. package/i18n/hi.json +15 -0
  185. package/i18n/id.json +15 -0
  186. package/i18n/it.json +15 -0
  187. package/i18n/ja.json +15 -0
  188. package/i18n/ko.json +15 -0
  189. package/i18n/nl.json +15 -0
  190. package/i18n/pl.json +15 -0
  191. package/i18n/pt.json +15 -0
  192. package/i18n/ru.json +15 -0
  193. package/i18n/sv.json +15 -0
  194. package/i18n/tr.json +15 -0
  195. package/i18n/uk.json +15 -0
  196. package/i18n/vi.json +15 -0
  197. package/i18n/zh-TW.json +15 -0
  198. package/i18n/zh.json +15 -0
  199. package/image-cropper/styles/_index.scss +1 -9
  200. package/input-number/styles/_index.scss +7 -0
  201. package/layout/styles/_index.scss +13 -1
  202. package/llms-full.txt +10 -10
  203. package/loading-bar/styles/_rules.scss +6 -0
  204. package/package.json +2 -2
  205. package/page-header/styles/_index.scss +18 -0
  206. package/popover/styles/_index.scss +7 -0
  207. package/schematics/use/symbol-map.json +2 -0
  208. package/segmented/styles/_index.scss +7 -0
  209. package/select/styles/_index.scss +7 -0
  210. package/sidebar/styles/_index.scss +6 -0
  211. package/skills/ngwr/references/catalog.md +1 -1
  212. package/sortable-list/styles/_rules.scss +1 -9
  213. package/speed-dial/styles/_index.scss +6 -0
  214. package/stepper/styles/_index.scss +1 -9
  215. package/table/styles/_index.scss +49 -0
  216. package/theme/_index.scss +12 -1
  217. package/theme/styles/_colors.scss +11 -0
  218. package/theme/styles/_contrast.scss +6 -0
  219. package/theme/styles/_index.scss +1 -0
  220. package/theme/styles/_mixins.scss +45 -0
  221. package/theme/styles/_print.scss +17 -0
  222. package/toast/styles/_index.scss +7 -0
  223. package/tour/styles/_index.scss +8 -0
  224. package/tree/styles/_index.scss +1 -9
  225. package/types/ngwr-anchor.d.ts +3 -0
  226. package/types/ngwr-animations-aurora.d.ts +6 -0
  227. package/types/ngwr-animations-blur-reveal.d.ts +6 -0
  228. package/types/ngwr-animations-click-sparks.d.ts +6 -0
  229. package/types/ngwr-animations-confetti.d.ts +6 -0
  230. package/types/ngwr-animations-decode.d.ts +6 -0
  231. package/types/ngwr-animations-destruct.d.ts +6 -0
  232. package/types/ngwr-animations-dot-grid.d.ts +6 -0
  233. package/types/ngwr-animations-falling-letters.d.ts +6 -0
  234. package/types/ngwr-animations-flow-lines.d.ts +6 -0
  235. package/types/ngwr-animations-fluid-cursor.d.ts +6 -0
  236. package/types/ngwr-animations-glitch.d.ts +6 -0
  237. package/types/ngwr-animations-glow-border.d.ts +6 -0
  238. package/types/ngwr-animations-gradient-flow.d.ts +6 -0
  239. package/types/ngwr-animations-marquee.d.ts +6 -0
  240. package/types/ngwr-animations-orbit.d.ts +6 -0
  241. package/types/ngwr-animations-reveal.d.ts +6 -0
  242. package/types/ngwr-animations-ripple-grid.d.ts +6 -0
  243. package/types/ngwr-animations-rotate-reveal.d.ts +6 -0
  244. package/types/ngwr-animations-shimmer.d.ts +6 -0
  245. package/types/ngwr-animations-spotlight.d.ts +6 -0
  246. package/types/ngwr-animations-thread-lines.d.ts +6 -0
  247. package/types/ngwr-animations-tilt.d.ts +10 -0
  248. package/types/ngwr-animations-typewriter.d.ts +6 -0
  249. package/types/ngwr-breadcrumbs.d.ts +25 -0
  250. package/types/ngwr-button.d.ts +23 -3
  251. package/types/ngwr-carousel.d.ts +2 -0
  252. package/types/ngwr-cascader.d.ts +7 -0
  253. package/types/ngwr-charts-core.d.ts +16 -0
  254. package/types/ngwr-charts-meter-group.d.ts +2 -0
  255. package/types/ngwr-checkbox.d.ts +1 -0
  256. package/types/ngwr-color-picker.d.ts +1 -0
  257. package/types/ngwr-context-menu.d.ts +1 -1
  258. package/types/ngwr-date-picker.d.ts +19 -0
  259. package/types/ngwr-dialog.d.ts +39 -8
  260. package/types/ngwr-directives.d.ts +12 -4
  261. package/types/ngwr-drawer.d.ts +1 -1
  262. package/types/ngwr-dropdown.d.ts +1 -1
  263. package/types/ngwr-event-calendar.d.ts +4 -0
  264. package/types/ngwr-form.d.ts +85 -1
  265. package/types/ngwr-i18n.d.ts +65 -5
  266. package/types/ngwr-input-number.d.ts +8 -0
  267. package/types/ngwr-input.d.ts +7 -0
  268. package/types/ngwr-layout.d.ts +1 -1
  269. package/types/ngwr-loading-bar-router.d.ts +6 -0
  270. package/types/ngwr-page-header.d.ts +23 -1
  271. package/types/ngwr-popconfirm.d.ts +1 -1
  272. package/types/ngwr-popover.d.ts +28 -4
  273. package/types/ngwr-radio.d.ts +47 -5
  274. package/types/ngwr-segmented.d.ts +7 -0
  275. package/types/ngwr-select.d.ts +57 -13
  276. package/types/ngwr-sortable-list.d.ts +20 -7
  277. package/types/ngwr-table.d.ts +58 -5
  278. package/types/ngwr-tabs-router.d.ts +6 -0
  279. package/types/ngwr-toast.d.ts +11 -0
  280. package/types/ngwr-tour.d.ts +0 -1
  281. package/types/ngwr-typography.d.ts +7 -0
  282. package/types/ngwr-utils-router.d.ts +6 -0
  283. package/types/ngwr-utils.d.ts +56 -2
  284. package/types/ngwr-validators.d.ts +49 -1
  285. package/types/ngwr-version.d.ts +1 -1
  286. package/typography/styles/_index.scss +4 -0
  287. package/window/styles/_index.scss +1 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-pagination.mjs","names":[],"sources":["../../../projects/lib/pagination/pagination.ts","../../../projects/lib/pagination/pagination.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, LOCALE_ID, ViewEncapsulation, computed, effect, inject, input, model } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrPaginationAlign, WrPaginationShape, WrPaginationSize } from './types';\n\nconst ELLIPSIS = '…' as const;\ntype PageEntry = number | typeof ELLIPSIS;\n\n/**\n * Numbered page navigator with optional total / page-size controls.\n *\n * Two-way binds `page` and `pageSize` via signal `model()` inputs.\n *\n * @example\n * ```html\n * <wr-pagination\n * [total]=\"120\"\n * [(page)]=\"page\"\n * [(pageSize)]=\"size\"\n * showTotal\n * showSizeChanger\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/pagination\n */\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-pagination', '[class]': 'classes()', role: 'navigation', '[attr.aria-label]': 'navLabel()' },\n imports: [WrButton, WrSelect, WrOption],\n})\nexport class WrPagination {\n /**\n * Currently displayed page (1-based). Two-way bindable.\n *\n * `page` rather than `currentPage` since v14, so this and `<wr-table>` — which\n * renders one of these in its own footer — spell the two concepts they share\n * one way each. It also names the output: a `model()` called `X` forces\n * `(XChange)`, so the old name produced `(currentPageChange)` against the\n * table's `(pageChange)`.\n */\n readonly page = model<number>(1);\n\n /** Items per page. Two-way bindable. */\n readonly pageSize = model<number>(10);\n\n /** Total item count across all pages. */\n readonly total = input(0, { transform: wrNumAttr(0) });\n\n /** Options shown in the page-size dropdown. */\n readonly pageSizeOptions = input<readonly number[]>([10, 20, 50, 100]);\n\n /** Render the page-size dropdown. @default false */\n readonly showSizeChanger = input(false, { transform: coerceBooleanProperty });\n\n /** Render the \"X–Y of Z\" total label. @default false */\n readonly showTotal = input(false, { transform: coerceBooleanProperty });\n\n /** Horizontal alignment. @default 'start' */\n readonly align = input<WrPaginationAlign>('start');\n\n /** Size variant — cascades to every internal button. @default 'sm' */\n readonly size = input<WrPaginationSize>('sm');\n\n /** Cell corner treatment. @default 'rounded' */\n readonly shape = input<WrPaginationShape>('rounded');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Collapse to a compact `‹ page / total ›` pager when the control's own box\n * is too narrow for the full numbered strip (a container query on its own\n * width, not the viewport). @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Previous-page button aria-label. Falls back to `pagination.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Next-page button aria-label. Falls back to `pagination.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** \"Items per page\" label. Falls back to `pagination.itemsPerPage`. */\n readonly itemsPerPageLabel = input<string | null>(null);\n\n /** Accessible name for the `role=\"navigation\"` host. Falls back to `pagination.label`. */\n readonly label = input<string | null>(null);\n\n /** Resolved labels. */\n protected readonly resolvedPrev = useI18nText(this.prevLabel, 'pagination.prev', 'Previous page');\n protected readonly resolvedNext = useI18nText(this.nextLabel, 'pagination.next', 'Next page');\n protected readonly resolvedItemsPerPage = useI18nText(\n this.itemsPerPageLabel,\n 'pagination.itemsPerPage',\n 'Items per page'\n );\n\n /**\n * Page-size option text — interpolates `{{size}}`. Was the template literal\n * `{{ option }} / page`, which no catalog could reach, so a Russian UI read\n * \"25 / page\".\n */\n protected readonly perPage = useI18nFormatter('pagination.perPage', '{{size}} / page');\n\n /** Per-page-button aria-label — interpolates `{{page}}`. */\n protected readonly goToPage = useI18nFormatter('pagination.goToPage', 'Go to page {{page}}');\n\n /** The nav landmark's own accessible name — was a hardcoded English literal. */\n protected readonly navLabel = useI18nText(this.label, 'pagination.label', 'Pagination');\n\n /** Internal: total page count. */\n /**\n * A page size that is not a positive number yields ONE page, not `Infinity`.\n *\n * `pageSize` is a `model()`, so Angular offers no `transform` to coerce it and\n * whatever the host writes arrives raw. At 0 the division is `Infinity`,\n * `Math.max(1, …)` keeps it, and the item list below pushes `total` as the\n * last page — so the strip rendered a clickable cell reading \"Infinity\", and\n * clicking it locked the tab. `NaN` (a `pageSize` bound to an emptied number\n * field) came through untouched for the same reason.\n *\n * One page is the honest answer: a size of zero describes no paging at all.\n * Note this is about `pageSize` and does NOT touch the recorded contract\n * about `total` — pagination still refuses to pull the page DOWN while\n * `total` is at or below zero, because 0 is ambiguous with \"still loading\".\n */\n private readonly usablePageSize = computed(() => {\n const size = this.pageSize();\n if (Number.isFinite(size) && size >= 1) return size;\n // Everything on one page. Deliberately not `Infinity`, which gives the\n // right page COUNT by accident and then puts `Infinity` in the range label\n // the moment `page` is above 1.\n return Math.max(1, this.total());\n });\n\n protected readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.usablePageSize())));\n\n /**\n * Internal: where the previous arrow goes. Clamped to the end of the valid\n * range rather than being a plain `page() - 1`, because the page can\n * legitimately sit past that end while `total` is 0 (see the guard effect).\n * From page 5 of one page, `goTo(4)` is refused as out of range, so the arrow\n * was enabled and did nothing — and under `responsive` on a narrow box the\n * numbered cells are hidden by a container query, which left no way back at\n * all. `Math.min` only ever moves the target INWARD, so `goTo`'s own\n * past-the-end refusal keeps working as the backstop it is.\n */\n protected readonly prevPage = computed(() => Math.min(this.page() - 1, this.totalPages()));\n\n /**\n * Internal: the \"1–10 of 235\" line, as ONE catalog template.\n *\n * It used to be `` `${start}-${end} ${of} ${total}` ``, which localised the\n * word in the middle and nothing else: the ASCII hyphen between the bounds and\n * the operand order were both frozen in TypeScript, so ja-JP and ar-SA got\n * English word order and no language could change the range separator. The\n * three numbers go through `Intl.NumberFormat` for the same reason the total\n * beside them does — a five-figure total needs the locale's grouping, and\n * ar-SA needs its own digits.\n *\n * The `ofLabel` input is gone with it: an input for the middle word is the\n * concatenation, re-offered as API.\n */\n protected readonly rangeLabel = computed(() => {\n // The same guarded size, or the range label reads \"1 – NaN of 100\".\n const size = this.usablePageSize();\n const start = this.total() === 0 ? 0 : (this.page() - 1) * size + 1;\n const end = Math.min(this.page() * size, this.total());\n return this.rangeText({\n from: this.number(start),\n to: this.number(end),\n total: this.number(this.total()),\n });\n });\n\n /** Internal: the compact pager's `1 / 24`, likewise a catalog template. */\n protected readonly compactLabel = computed(() =>\n this.compactText({ current: this.number(this.page()), total: this.number(this.totalPages()) })\n );\n\n private readonly rangeText = useI18nFormatter('pagination.range', '{{from}}–{{to}} of {{total}}');\n private readonly compactText = useI18nFormatter('pagination.compact', '{{current}} / {{total}}');\n\n private readonly locale = inject(LOCALE_ID);\n\n /**\n * Grouped per `LOCALE_ID`. Only the range and the compact pager go through\n * this — a page NUMBER on a button is an identifier, and `1,024` on a button\n * reads as two things.\n */\n private number(value: number): string {\n return new Intl.NumberFormat(this.locale).format(value);\n }\n\n /**\n * Internal: page list with ellipses. Window of 7 visible page slots.\n *\n * 1 … 5 6 [7] 8 9 … 20\n */\n protected readonly pages = computed<readonly PageEntry[]>(() => {\n const total = this.totalPages();\n const current = this.page();\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const items: PageEntry[] = [1];\n if (current > 4) items.push(ELLIPSIS);\n\n let start: number;\n let end: number;\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 3) items.push(ELLIPSIS);\n if (end !== total) items.push(total);\n\n return items;\n });\n\n protected readonly ellipsis = ELLIPSIS;\n\n protected readonly classes = computed(() => {\n const parts = [`wr-pagination--${this.align()}`, `wr-pagination--${this.size()}`, `wr-pagination--${this.shape()}`];\n if (this.disabled()) parts.push('wr-pagination--disabled');\n if (this.responsive()) parts.push('wr-pagination--responsive');\n return parts.join(' ');\n });\n\n protected isCurrent(page: number): boolean {\n return this.page() === page;\n }\n\n protected goTo(page: number | typeof ELLIPSIS): void {\n if (typeof page !== 'number') return;\n if (this.disabled() || page < 1 || page > this.totalPages() || page === this.page()) return;\n this.page.set(page);\n }\n\n /**\n * `wr-select` carries an `unknown` value by design, so the size arrives\n * untyped and is narrowed here. It used to arrive as `any` through\n * `[ngModel]`, which hid the coercion rather than removing the need for it.\n */\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('pagination');\n // `page` is a plain `model` — a `model()` takes no transform — so a\n // shrinking `total` and a host `[(page)]` write both land in it\n // unchecked. The guard used to read and write the page inside `untracked()`\n // and pull DOWNWARDS only, so it fired when `total` / `pageSize` moved and\n // never when the host wrote: past the end no cell carries `aria-current`,\n // the arrow at that end stays enabled and inert (`goTo` refuses the step\n // rather than correcting the stored page), and below 1 `rangeLabel()` counts\n // backwards (\"-9-0 of 120\"). Two-sided and tracked, the same shape\n // `wr-stepper` and `wr-carousel` use for their own host-owned `model()`.\n //\n // Only the UPPER bound is conditional. A `total` at or below 0 is the one\n // value where pulling the page down is destructive rather than cosmetic:\n // there is no `loading` input, so 0 is genuinely ambiguous between \"the\n // list is empty\" and \"the page is still in flight\", and the second is the\n // ordinary state of a server-paged host — Angular's `resource` drops its\n // value whenever the params change, and a params function returning an\n // object literal is never reference-equal, so `total` reads 0 between the\n // click and the response. `totalPages()` is 1 there, so the guard pulled\n // every page above the first back to 1 and emitted a `pageChange`\n // the host could not tell from a click: the pager could not leave page 1,\n // and each click cost two events. A negative `total` is folded into the\n // same branch because it is as meaningless as a zero one.\n //\n // The LOWER bound is unconditional, and gating it on `total` was a mistake\n // in the first cut of this fix: no value of `total` makes page 0 correct,\n // and while it was skipped a host write of -3 survived — `rangeLabel()`\n // guards `start` for an empty total and not `end`, so it read \"0--30 of 0\",\n // and the compact pager read \"-3 / 1\". It is written as one expression\n // rather than an early return so the effect depends on `page()` and\n // `total()` on every run, whichever branch decides the result.\n //\n // What IS still given up while `total` is 0 and the held page is past the\n // first: no cell carries `aria-current`, because `pages` renders the single\n // page and that is not the page the host holds. `rangeLabel()` is not in\n // that list — it already special-cases an empty total and reads \"0-0 of 0\".\n // Nor are the arrows: they compare against the RANGE rather than its ends\n // (see the template), so past the end next renders disabled and prev stays\n // enabled and steps back INTO range via `prevPage`. That is a change from\n // the \"enabled and inert\" behaviour described above, which this component\n // used to accept at both ends.\n effect(() => {\n const page = this.page();\n const floored = Math.max(1, page);\n const clamped = this.total() <= 0 ? floored : Math.min(floored, this.totalPages());\n if (clamped !== page) this.page.set(clamped);\n });\n }\n\n protected onSizeChange(size: unknown): void {\n const next = Number(size);\n if (this.disabled() || !Number.isFinite(next) || next <= 0 || next === this.pageSize()) return;\n // The size and nothing else. This used to clamp the page against the new\n // size too, and it read a value that was already superseded: `pageSize.set`\n // emits `pageSizeChange` synchronously, so by the following statement the\n // host has run its own policy — most tables reset to the first page — and\n // that write has not reached the model yet, it arrives on the next binding\n // pass. So the clamp computed a cap from the PRE-change page and wrote the\n // result over the host's decision: from page 6 at size 10, choosing 25\n // emitted `pageChange(5)` on top of the host's reset to 1, which the\n // host cannot tell from a navigation, and a second request went out. The\n // guard effect in the constructor takes it over and runs once the bindings\n // have settled, so it clamps the page the host actually wants.\n //\n // For a SETTLED `total` that is the whole story. For the server-paged host\n // this fix exists for it is not: the size change invalidates the payload\n // too, so `total` reads 0 and the guard returns early. Measured, from page\n // 6 at size 10 choosing 25 with a host that does not reset — in flight:\n // `navigations []`, page 6, total 0; after settle: `navigations [5]`, page\n // 5. So a non-resetting host issues one doomed request for a page that no\n // longer exists and is corrected only when the answer lands. That is an\n // accepted cost of refusing to write back from transient state, not\n // something the guard covers.\n this.pageSize.set(next);\n }\n}\n","<div class=\"wr-pagination__inner\">\n @if (showTotal()) {\n <span class=\"wr-pagination__total\">{{ rangeLabel() }}</span>\n }\n\n <div class=\"wr-pagination__nav\">\n <!--\n `wr-pagination__nav-btn` exists so the stylesheet can mirror the arrow\n glyph under `dir=\"rtl\"`. A class rather than `:first-child` /\n `:last-child` on the row: those two positions do hold today — which is why\n the `--square` end caps use them — but only while the prev button, the\n compact label and the next button all stay unconditional and in this\n order. A mirror keyed to position would follow a reorder, or land on a\n page cell, without a word.\n\n The two `[disabled]` bindings compare against the RANGE (`<= 1`,\n `>= totalPages()`) rather than for equality with its ends. While `total`\n is 0 the guard effect stops enforcing the upper bound, so the page can\n legitimately sit past `totalPages()` — and `=== totalPages()` reported\n next as enabled there while `goTo` refused the step. Prev is still\n enabled in that state, correctly: `prevPage()` walks it back into range.\n -->\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedPrev()\"\n [disabled]=\"disabled() || page() <= 1\"\n (click)=\"goTo(prevPage())\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n </wr-btn>\n\n <!-- Tracked by page, not by slot: the window slides on every move, and the\n focused button has to stay the page it was. The two ellipses are\n different items, and the leading one is always the second entry. -->\n @for (page of pages(); track page === ellipsis ? ($index === 1 ? 'before' : 'after') : page) {\n @if (page === ellipsis) {\n <span class=\"wr-pagination__ellipsis\">{{ ellipsis }}</span>\n } @else {\n <wr-btn\n class=\"wr-pagination__page\"\n [size]=\"size()\"\n [outlined]=\"!isCurrent(page)\"\n [color]=\"isCurrent(page) ? 'primary' : null\"\n [attr.aria-current]=\"isCurrent(page) ? 'page' : null\"\n [attr.aria-label]=\"goToPage({ page })\"\n [disabled]=\"disabled()\"\n (click)=\"goTo(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <!-- Compact pager — shown only in responsive mode on a narrow box (CSS). Not\n `aria-hidden`: `display: none` already keeps whichever of the two is\n hidden out of the accessibility tree, and on a narrow box this label is\n the only position on screen. -->\n <span class=\"wr-pagination__current\">{{ compactLabel() }}</span>\n\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedNext()\"\n [disabled]=\"disabled() || page() >= totalPages()\"\n (click)=\"goTo(page() + 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <!--\n `ariaLabel`, not `[attr.aria-label]`: `<wr-select>`'s host carries no role,\n so an attribute there names nothing and never reaches the `role=\"combobox\"`\n button inside — the size changer announced itself as the catalog's generic\n \"Select\".\n -->\n <wr-select\n class=\"wr-pagination__size\"\n [ariaLabel]=\"resolvedItemsPerPage()\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [value]=\"pageSize()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\">{{ perPage({ size: option }) }}</wr-option>\n }\n </wr-select>\n }\n</div>\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,WAAW;AA4BjB,IAAa,eAAb,MAAa,aAAY;CAUd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pagination/pagination.ts","../../../projects/lib/pagination/pagination.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, LOCALE_ID, ViewEncapsulation, computed, effect, inject, input, model } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrPaginationAlign, WrPaginationShape, WrPaginationSize } from './types';\n\nconst ELLIPSIS = '…' as const;\ntype PageEntry = number | typeof ELLIPSIS;\n\n/**\n * Numbered page navigator with optional total / page-size controls.\n *\n * Two-way binds `page` and `pageSize` via signal `model()` inputs.\n *\n * @example\n * ```html\n * <wr-pagination\n * [total]=\"120\"\n * [(page)]=\"page\"\n * [(pageSize)]=\"size\"\n * showTotal\n * showSizeChanger\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/pagination\n */\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-pagination', '[class]': 'classes()', role: 'navigation', '[attr.aria-label]': 'navLabel()' },\n imports: [WrButton, WrSelect, WrOption],\n})\nexport class WrPagination {\n /**\n * Currently displayed page (1-based). Two-way bindable.\n *\n * `page` rather than `currentPage` since v14, so this and `<wr-table>` — which\n * renders one of these in its own footer — spell the two concepts they share\n * one way each. It also names the output: a `model()` called `X` forces\n * `(XChange)`, so the old name produced `(currentPageChange)` against the\n * table's `(pageChange)`.\n */\n readonly page = model<number>(1);\n\n /** Items per page. Two-way bindable. */\n readonly pageSize = model<number>(10);\n\n /** Total item count across all pages. */\n readonly total = input(0, { transform: wrNumAttr(0) });\n\n /** Options shown in the page-size dropdown. */\n readonly pageSizeOptions = input<readonly number[]>([10, 20, 50, 100]);\n\n /** Render the page-size dropdown. @default false */\n readonly showSizeChanger = input(false, { transform: coerceBooleanProperty });\n\n /** Render the \"X–Y of Z\" total label. @default false */\n readonly showTotal = input(false, { transform: coerceBooleanProperty });\n\n /** Horizontal alignment. @default 'start' */\n readonly align = input<WrPaginationAlign>('start');\n\n /** Size variant — cascades to every internal button. @default 'sm' */\n readonly size = input<WrPaginationSize>('sm');\n\n /** Cell corner treatment. @default 'rounded' */\n readonly shape = input<WrPaginationShape>('rounded');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Collapse to a compact `‹ page / total ›` pager when the control's own box\n * is too narrow for the full numbered strip (a container query on its own\n * width, not the viewport). @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Previous-page button aria-label. Falls back to `pagination.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Next-page button aria-label. Falls back to `pagination.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** \"Items per page\" label. Falls back to `pagination.itemsPerPage`. */\n readonly itemsPerPageLabel = input<string | null>(null);\n\n /** Accessible name for the `role=\"navigation\"` host. Falls back to `pagination.label`. */\n readonly label = input<string | null>(null);\n\n /** Resolved labels. */\n protected readonly resolvedPrev = useI18nText(this.prevLabel, 'pagination.prev', 'Previous page');\n protected readonly resolvedNext = useI18nText(this.nextLabel, 'pagination.next', 'Next page');\n protected readonly resolvedItemsPerPage = useI18nText(\n this.itemsPerPageLabel,\n 'pagination.itemsPerPage',\n 'Items per page'\n );\n\n /**\n * Page-size option text — interpolates `{{size}}`. Was the template literal\n * `{{ option }} / page`, which no catalog could reach, so a Russian UI read\n * \"25 / page\".\n */\n protected readonly perPage = useI18nFormatter('pagination.perPage', '{{size}} / page');\n\n /** Per-page-button aria-label — interpolates `{{page}}`. */\n protected readonly goToPage = useI18nFormatter('pagination.goToPage', 'Go to page {{page}}');\n\n /** The nav landmark's own accessible name — was a hardcoded English literal. */\n protected readonly navLabel = useI18nText(this.label, 'pagination.label', 'Pagination');\n\n /** Internal: total page count. */\n /**\n * A page size that is not a positive number yields ONE page, not `Infinity`.\n *\n * `pageSize` is a `model()`, so Angular offers no `transform` to coerce it and\n * whatever the host writes arrives raw. At 0 the division is `Infinity`,\n * `Math.max(1, …)` keeps it, and the item list below pushes `total` as the\n * last page — so the strip rendered a clickable cell reading \"Infinity\", and\n * clicking it locked the tab. `NaN` (a `pageSize` bound to an emptied number\n * field) came through untouched for the same reason.\n *\n * One page is the honest answer: a size of zero describes no paging at all.\n * Note this is about `pageSize` and does NOT touch the recorded contract\n * about `total` — pagination still refuses to pull the page DOWN while\n * `total` is at or below zero, because 0 is ambiguous with \"still loading\".\n */\n private readonly usablePageSize = computed(() => {\n const size = this.pageSize();\n if (Number.isFinite(size) && size >= 1) return size;\n // Everything on one page. Deliberately not `Infinity`, which gives the\n // right page COUNT by accident and then puts `Infinity` in the range label\n // the moment `page` is above 1.\n return Math.max(1, this.total());\n });\n\n protected readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.usablePageSize())));\n\n /**\n * Internal: where the previous arrow goes. Clamped to the end of the valid\n * range rather than being a plain `page() - 1`, because the page can\n * legitimately sit past that end while `total` is 0 (see the guard effect).\n * From page 5 of one page, `goTo(4)` is refused as out of range, so the arrow\n * was enabled and did nothing — and under `responsive` on a narrow box the\n * numbered cells are hidden by a container query, which left no way back at\n * all. `Math.min` only ever moves the target INWARD, so `goTo`'s own\n * past-the-end refusal keeps working as the backstop it is.\n */\n protected readonly prevPage = computed(() => Math.min(this.page() - 1, this.totalPages()));\n\n /**\n * Internal: the \"1–10 of 235\" line, as ONE catalog template.\n *\n * It used to be `` `${start}-${end} ${of} ${total}` ``, which localised the\n * word in the middle and nothing else: the ASCII hyphen between the bounds and\n * the operand order were both frozen in TypeScript, so ja-JP and ar-SA got\n * English word order and no language could change the range separator. The\n * three numbers go through `Intl.NumberFormat` for the same reason the total\n * beside them does — a five-figure total needs the locale's grouping, and\n * ar-SA needs its own digits.\n *\n * The `ofLabel` input is gone with it: an input for the middle word is the\n * concatenation, re-offered as API.\n */\n protected readonly rangeLabel = computed(() => {\n // The same guarded size, or the range label reads \"1 – NaN of 100\".\n const size = this.usablePageSize();\n const start = this.total() === 0 ? 0 : (this.page() - 1) * size + 1;\n const end = Math.min(this.page() * size, this.total());\n return this.rangeText({\n from: this.number(start),\n to: this.number(end),\n total: this.number(this.total()),\n });\n });\n\n /** Internal: the compact pager's `1 / 24`, likewise a catalog template. */\n protected readonly compactLabel = computed(() =>\n this.compactText({ current: this.number(this.page()), total: this.number(this.totalPages()) })\n );\n\n private readonly rangeText = useI18nFormatter('pagination.range', '{{from}}–{{to}} of {{total}}');\n private readonly compactText = useI18nFormatter('pagination.compact', '{{current}} / {{total}}');\n\n private readonly locale = inject(LOCALE_ID);\n\n /**\n * Grouped per `LOCALE_ID`. Only the range and the compact pager go through\n * this — a page NUMBER on a button is an identifier, and `1,024` on a button\n * reads as two things.\n */\n private number(value: number): string {\n return new Intl.NumberFormat(this.locale).format(value);\n }\n\n /**\n * Internal: page list with ellipses. Window of 7 visible page slots.\n *\n * 1 … 5 6 [7] 8 9 … 20\n */\n protected readonly pages = computed<readonly PageEntry[]>(() => {\n const total = this.totalPages();\n const current = this.page();\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const items: PageEntry[] = [1];\n if (current > 4) items.push(ELLIPSIS);\n\n let start: number;\n let end: number;\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 3) items.push(ELLIPSIS);\n if (end !== total) items.push(total);\n\n return items;\n });\n\n protected readonly ellipsis = ELLIPSIS;\n\n protected readonly classes = computed(() => {\n const parts = [`wr-pagination--${this.align()}`, `wr-pagination--${this.size()}`, `wr-pagination--${this.shape()}`];\n if (this.disabled()) parts.push('wr-pagination--disabled');\n if (this.responsive()) parts.push('wr-pagination--responsive');\n return parts.join(' ');\n });\n\n protected isCurrent(page: number): boolean {\n return this.page() === page;\n }\n\n protected goTo(page: number | typeof ELLIPSIS): void {\n if (typeof page !== 'number') return;\n if (this.disabled() || page < 1 || page > this.totalPages() || page === this.page()) return;\n this.page.set(page);\n }\n\n /**\n * `wr-select` carries an `unknown` value by design, so the size arrives\n * untyped and is narrowed here. It used to arrive as `any` through\n * `[ngModel]`, which hid the coercion rather than removing the need for it.\n */\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('pagination');\n // `page` is a plain `model` — a `model()` takes no transform — so a\n // shrinking `total` and a host `[(page)]` write both land in it\n // unchecked. The guard used to read and write the page inside `untracked()`\n // and pull DOWNWARDS only, so it fired when `total` / `pageSize` moved and\n // never when the host wrote: past the end no cell carries `aria-current`,\n // the arrow at that end stays enabled and inert (`goTo` refuses the step\n // rather than correcting the stored page), and below 1 `rangeLabel()` counts\n // backwards (\"-9-0 of 120\"). Two-sided and tracked, the same shape\n // `wr-stepper` and `wr-carousel` use for their own host-owned `model()`.\n //\n // Only the UPPER bound is conditional. A `total` at or below 0 is the one\n // value where pulling the page down is destructive rather than cosmetic:\n // there is no `loading` input, so 0 is genuinely ambiguous between \"the\n // list is empty\" and \"the page is still in flight\", and the second is the\n // ordinary state of a server-paged host — Angular's `resource` drops its\n // value whenever the params change, and a params function returning an\n // object literal is never reference-equal, so `total` reads 0 between the\n // click and the response. `totalPages()` is 1 there, so the guard pulled\n // every page above the first back to 1 and emitted a `pageChange`\n // the host could not tell from a click: the pager could not leave page 1,\n // and each click cost two events. A negative `total` is folded into the\n // same branch because it is as meaningless as a zero one.\n //\n // The LOWER bound is unconditional, and gating it on `total` was a mistake\n // in the first cut of this fix: no value of `total` makes page 0 correct,\n // and while it was skipped a host write of -3 survived — `rangeLabel()`\n // guards `start` for an empty total and not `end`, so it read \"0--30 of 0\",\n // and the compact pager read \"-3 / 1\". It is written as one expression\n // rather than an early return so the effect depends on `page()` and\n // `total()` on every run, whichever branch decides the result.\n //\n // What IS still given up while `total` is 0 and the held page is past the\n // first: no cell carries `aria-current`, because `pages` renders the single\n // page and that is not the page the host holds. `rangeLabel()` is not in\n // that list — it already special-cases an empty total and reads \"0-0 of 0\".\n // Nor are the arrows: they compare against the RANGE rather than its ends\n // (see the template), so past the end next renders disabled and prev stays\n // enabled and steps back INTO range via `prevPage`. That is a change from\n // the \"enabled and inert\" behaviour described above, which this component\n // used to accept at both ends.\n effect(() => {\n const page = this.page();\n const floored = Math.max(1, page);\n const clamped = this.total() <= 0 ? floored : Math.min(floored, this.totalPages());\n if (clamped !== page) this.page.set(clamped);\n });\n }\n\n protected onSizeChange(size: unknown): void {\n const next = Number(size);\n if (this.disabled() || !Number.isFinite(next) || next <= 0 || next === this.pageSize()) return;\n // The size and nothing else. This used to clamp the page against the new\n // size too, and it read a value that was already superseded: `pageSize.set`\n // emits `pageSizeChange` synchronously, so by the following statement the\n // host has run its own policy — most tables reset to the first page — and\n // that write has not reached the model yet, it arrives on the next binding\n // pass. So the clamp computed a cap from the PRE-change page and wrote the\n // result over the host's decision: from page 6 at size 10, choosing 25\n // emitted `pageChange(5)` on top of the host's reset to 1, which the\n // host cannot tell from a navigation, and a second request went out. The\n // guard effect in the constructor takes it over and runs once the bindings\n // have settled, so it clamps the page the host actually wants.\n //\n // For a SETTLED `total` that is the whole story. For the server-paged host\n // this fix exists for it is not: the size change invalidates the payload\n // too, so `total` reads 0 and the guard returns early. Measured, from page\n // 6 at size 10 choosing 25 with a host that does not reset — in flight:\n // `navigations []`, page 6, total 0; after settle: `navigations [5]`, page\n // 5. So a non-resetting host issues one doomed request for a page that no\n // longer exists and is corrected only when the answer lands. That is an\n // accepted cost of refusing to write back from transient state, not\n // something the guard covers.\n this.pageSize.set(next);\n }\n}\n","<div class=\"wr-pagination__inner\">\n @if (showTotal()) {\n <span class=\"wr-pagination__total\">{{ rangeLabel() }}</span>\n }\n\n <div class=\"wr-pagination__nav\">\n <!--\n `wr-pagination__nav-btn` exists so the stylesheet can mirror the arrow\n glyph under `dir=\"rtl\"`. A class rather than `:first-child` /\n `:last-child` on the row: those two positions do hold today — which is why\n the `--square` end caps use them — but only while the prev button, the\n compact label and the next button all stay unconditional and in this\n order. A mirror keyed to position would follow a reorder, or land on a\n page cell, without a word.\n\n The two `[disabled]` bindings compare against the RANGE (`<= 1`,\n `>= totalPages()`) rather than for equality with its ends. While `total`\n is 0 the guard effect stops enforcing the upper bound, so the page can\n legitimately sit past `totalPages()` — and `=== totalPages()` reported\n next as enabled there while `goTo` refused the step. Prev is still\n enabled in that state, correctly: `prevPage()` walks it back into range.\n -->\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedPrev()\"\n [disabled]=\"disabled() || page() <= 1\"\n (click)=\"goTo(prevPage())\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n </wr-btn>\n\n <!-- Tracked by page, not by slot: the window slides on every move, and the\n focused button has to stay the page it was. The two ellipses are\n different items, and the leading one is always the second entry. -->\n @for (page of pages(); track page === ellipsis ? ($index === 1 ? 'before' : 'after') : page) {\n @if (page === ellipsis) {\n <span class=\"wr-pagination__ellipsis\">{{ ellipsis }}</span>\n } @else {\n <wr-btn\n class=\"wr-pagination__page\"\n [size]=\"size()\"\n [outlined]=\"!isCurrent(page)\"\n [color]=\"isCurrent(page) ? 'primary' : null\"\n [attr.aria-current]=\"isCurrent(page) ? 'page' : null\"\n [attr.aria-label]=\"goToPage({ page })\"\n [disabled]=\"disabled()\"\n (click)=\"goTo(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <!-- Compact pager — shown only in responsive mode on a narrow box (CSS). Not\n `aria-hidden`: `display: none` already keeps whichever of the two is\n hidden out of the accessibility tree, and on a narrow box this label is\n the only position on screen. -->\n <span class=\"wr-pagination__current\">{{ compactLabel() }}</span>\n\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedNext()\"\n [disabled]=\"disabled() || page() >= totalPages()\"\n (click)=\"goTo(page() + 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <!--\n `ariaLabel`, not `[attr.aria-label]`: `<wr-select>`'s host carries no role,\n so an attribute there names nothing and never reaches the `role=\"combobox\"`\n button inside — the size changer announced itself as the catalog's generic\n \"Select\".\n -->\n <wr-select\n class=\"wr-pagination__size\"\n [ariaLabel]=\"resolvedItemsPerPage()\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [value]=\"pageSize()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\">{{ perPage({ size: option }) }}</wr-option>\n }\n </wr-select>\n }\n</div>\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,WAAW;AA4BjB,IAAa,eAAb,MAAa,aAAY;CAUd,OAAO,MAAc,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGvB,WAAW,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAG5B,QAAQ,MAAM,GAAC;EAAA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A;IAAA,mBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UC7CzB;EAwHA,cAAA;GAAA;IAAA,MAAA;IAAA,MD7EY;IAAQ,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAQ,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAQ,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAE3B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAPxB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,eAEV,kBAAkB;GAAI,MAC/B;IAAE,OAAO;IAAiB,WAAW;IAAa,MAAM;IAAc,qBAAqB;GAAY;GAAE,SACtG;IAAC;IAAU;IAAU;GAAQ;GAAC,UAAA;EAAA,CAAA"}
@@ -70,7 +70,14 @@ function wrFormatBytes(value, locale, decimals = 1) {
70
70
  const n = Number(value);
71
71
  if (!Number.isFinite(n) || n <= 0) return format(locale, 0, 0, 0);
72
72
  const i = Math.min(Math.max(0, Math.floor(Math.log(n) / Math.log(1024))), UNITS.length - 1);
73
- return format(locale, n / 1024 ** i, i, i === 0 ? 0 : Math.max(0, decimals));
73
+ const digits = (unit) => unit === 0 ? 0 : Math.max(0, decimals);
74
+ let unit = i;
75
+ let scaled = n / 1024 ** unit;
76
+ while (unit < UNITS.length - 1 && Number(scaled.toFixed(Math.min(digits(unit), 100))) >= 1024) {
77
+ unit++;
78
+ scaled = n / 1024 ** unit;
79
+ }
80
+ return format(locale, scaled, unit, digits(unit));
74
81
  }
75
82
  /**
76
83
  * @license
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-pipes.mjs","names":[],"sources":["../../../projects/lib/pipes/bytes.ts","../../../projects/lib/pipes/date.ts","../../../projects/lib/pipes/duration.ts","../../../projects/lib/pipes/initials.ts","../../../projects/lib/pipes/mark.ts","../../../projects/lib/pipes/number.ts","../../../projects/lib/pipes/plural.ts","../../../projects/lib/pipes/range.ts","../../../projects/lib/pipes/truncate.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\n/**\n * Binary magnitudes, as the `Intl` unit that labels each one. The COUNTING is\n * 1024-based and these names are decimal — which is the same thing the old\n * hand-written `['B', 'KB', 'MB', …]` table did, and what almost every file\n * manager does. Strictly, 1024 bytes is a kibibyte; `Intl` has no unit for it.\n */\nconst UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte'] as const;\n\n/**\n * `Intl`'s NARROW unit, with one space put back between it and the number.\n *\n * Neither display mode is right on its own. `short` spells the smallest unit\n * as a word — \"512 byte\", \"0 byte\" in English, \"0 Byte\" in German — which is\n * both worse copy than the `B` this pipe has always rendered and a bigger\n * change than the fix is worth. `narrow` gives `B` / `Б` / `o` correctly and\n * then closes the gap: \"1.2kB\".\n *\n * So the parts are reassembled rather than the string. Going through\n * `formatToParts` is what keeps the ORDER the locale's own — Hebrew puts the\n * unit first, and hand-joining `${n} ${unit}` would silently straighten every\n * such locale into English order.\n */\nfunction format(locale: string, value: number, unit: number, fractionDigits: number): string {\n const parts = new Intl.NumberFormat(locale, {\n style: 'unit',\n unit: UNITS[unit],\n unitDisplay: 'narrow',\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n }).formatToParts(value);\n\n const at = parts.findIndex(part => part.type === 'unit');\n if (at === -1) return parts.map(part => part.value).join('');\n\n const out = parts.map(part => part.value);\n // The slot on the number's side of the unit: already a separator in some\n // locales, absent in others.\n const gap = at === 0 ? 1 : at - 1;\n if (parts[gap]?.type === 'literal') out[gap] = ' ';\n else out.splice(at === 0 ? 1 : at, 0, ' ');\n return out.join('');\n}\n\n/**\n * Humanise a byte count using binary (1024-based) units, in the reader's locale.\n *\n * @example\n * ```html\n * {{ 1234 | wrBytes }} <!-- en: \"1.2 kB\" de: \"1,2 kB\" ru: \"1,2 кБ\" -->\n * {{ 1234567 | wrBytes: 0 }} <!-- en: \"1 MB\" fr: \"1 Mo\" -->\n * {{ 0 | wrBytes }} <!-- en: \"0 B\" ru: \"0 Б\" -->\n * ```\n *\n * **Both halves come from `Intl`, and the unit table is not the catalog's.** The\n * number always did need `LOCALE_ID` — it went through `toFixed`, which writes a\n * full stop in every language, so a German page read `1.2 KB` beside its own\n * `1,2` everywhere else — and the three formatting pipes beside this one\n * (`wrDate`, `wrNumber`, `wrPlural`) had injected it since they shipped.\n *\n * The unit could not follow them into `ngwr/i18n`, and the reason is the pipe\n * rather than the strings: a PURE pipe is re-invoked only when its argument\n * changes, so a catalog that lands after the first render — which is every\n * `provideWrI18nHttpLoader` app — would never reach it, and the pipe would be\n * correct under the static loader and silently English under the other one.\n * `LOCALE_ID` is a constant, so `Intl` has no such failure mode, and it knows\n * every locale ICU ships rather than the twenty-two this package translates.\n *\n * One visible change in English and it is the only one: `KB` became `kB`, which\n * is what CLDR calls that unit. `B`, the space before it and every other\n * magnitude read exactly as they did — see `format` for the part of that which\n * is not free.\n *\n * The other consequence, kept here so nobody rediscovers it as a bug:\n * `<wr-file-upload>` prints its own sizes from `fileUpload.unitKb` and friends,\n * which are public catalog keys a consumer may have overridden, so it renders\n * `KB` where this pipe renders `kB`. Retiring those keys would silently break\n * every override that had been translating them, which is a major-version move.\n *\n * {@link wrFormatBytes} is the same output as a function.\n */\n@Pipe({ name: 'wrBytes' })\nexport class WrBytes implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: number | string | null | undefined, decimals = 1): string {\n return wrFormatBytes(value, this.locale, decimals);\n }\n}\n\n/**\n * A byte count in binary (1024-based) units, in the given locale: the same\n * output as the `wrBytes` pipe, for a string built in TypeScript. `null`,\n * `undefined` and an empty string give an empty string; zero, a negative\n * number and a value that is not a number give `0 B`.\n *\n * @example\n * ```ts\n * wrFormatBytes(1234, 'en-US'); // \"1.2 kB\"\n * wrFormatBytes(1234567, 'fr-FR', 0); // \"1 Mo\"\n * ```\n */\nexport function wrFormatBytes(value: number | string | null | undefined, locale: string, decimals = 1): string {\n if (value === null || value === undefined || value === '') return '';\n const n = Number(value);\n if (!Number.isFinite(n) || n <= 0) return format(locale, 0, 0, 0);\n\n // Floored as well as capped: for `0 < n < 1` the log is negative, so an\n // unclamped index reads `UNITS[-1]` (`undefined`) and divides by `1024 ** -1`,\n // which rendered `0.5` as \"512.0 undefined\".\n const i = Math.min(Math.max(0, Math.floor(Math.log(n) / Math.log(1024))), UNITS.length - 1);\n // Whole bytes never show a fractional part.\n return format(locale, n / 1024 ** i, i, i === 0 ? 0 : Math.max(0, decimals));\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport { type WrDateFormat, type WrParseDateOptions, WrDateAdapter, wrIsDateOnly, wrParseDate } from 'ngwr/date';\n\n/**\n * A date through a `WrDateAdapter`: the same output as the `wrDate` pipe, for a\n * string built in TypeScript. A date-only string (`'2026-01-01'`) is that day in\n * the local zone, as `DatePipe` reads it, and `'2026-01-01 14:30:00'` is read\n * as its `T` form: the value goes through `wrParseDate`. `null`, `undefined`,\n * an empty string and a date the engine refuses give an empty string.\n *\n * An instant is printed on the wall clock of `withDates({ timeZone })`, through\n * the adapter's `zoned()`. A date-only string is a calendar day and is not\n * moved: `'2026-01-01'` prints as 1 January in every zone.\n *\n * The value is read as `withDates()` says: `epochUnit` for a number and\n * `zonelessIn` for a date-time string with no offset. The last argument\n * overrides either for one call, for a field whose unit differs from the app's;\n * a key left `undefined` keeps the app's value.\n *\n * The adapter stands where `wrFormatNumber` takes a locale, because the output\n * is the adapter's: the native one formats in `WR_DATE_LOCALE`, and an app's own\n * adapter formats however it formats. Neither can be rebuilt from a locale\n * string, so the caller passes `inject(WrDateAdapter)` once.\n *\n * @example\n * ```ts\n * private readonly dates = inject(WrDateAdapter);\n *\n * wrFormatDate(row.createdAt, this.dates); // shortDate\n * wrFormatDate(row.createdAt, this.dates, 'mediumDateTime'); // named key\n * wrFormatDate(row.createdAt, this.dates, 'dd.MM.yyyy'); // raw token string\n * wrFormatDate(row.sentAt, this.dates, 'time', { epochUnit: 'us' }); // microseconds\n * ```\n */\nexport function wrFormatDate(\n value: Date | string | number | null | undefined,\n adapter: WrDateAdapter<Date>,\n format: WrDateFormat | (string & {}) = 'shortDate',\n options?: WrParseDateOptions\n): string {\n const app = adapter.parseOptions();\n // Not a spread: a key set to `undefined` would erase the app's value.\n const date = wrParseDate(value, {\n epochUnit: options?.epochUnit ?? app.epochUnit,\n zonelessIn: options?.zonelessIn ?? app.zonelessIn,\n timeZone: options?.timeZone === undefined ? app.timeZone : options.timeZone,\n });\n if (date === null) return '';\n return (wrIsDateOnly(value) ? adapter : adapter.zoned()).format(date, format);\n}\n\n/**\n * Locale-aware date formatting. Delegates to `WrDateAdapter` — the native one\n * unless the app provides its own — so both the named format keys\n * (`'shortDate'`, `'longDate'`, …) and raw token strings work with nothing to\n * set up. A date-only string (`'2026-01-01'`) is that day in the local zone,\n * as `DatePipe` reads it, not UTC midnight, and a backend's\n * `'2026-01-01 14:30:00'` is read as its `T` form. {@link wrFormatDate} is the\n * same output as a function.\n *\n * An instant is printed in the time zone of `withDates({ timeZone })`, and the\n * output follows that zone and the adapter's locale when they change at\n * runtime. A pure pipe cannot: Angular calls it again only when an argument\n * changes. So the pipe is impure and keeps its last result, and a\n * change-detection pass with nothing new costs three comparisons, not a\n * format.\n *\n * @example\n * ```html\n * {{ now | wrDate }} <!-- shortDate -->\n * {{ now | wrDate: 'mediumDateTime' }} <!-- named key -->\n * {{ now | wrDate: 'dd.MM.yyyy' }} <!-- raw token string -->\n * {{ sentAt | wrDate: 'time' : { epochUnit: 'us' } }} <!-- microseconds -->\n * ```\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure -- a pure pipe cannot follow the zone or the locale; see above\n@Pipe({ name: 'wrDate', pure: false })\nexport class WrDate implements PipeTransform {\n private readonly adapter = inject<WrDateAdapter<Date>>(WrDateAdapter);\n\n private value: unknown;\n private format = '';\n private key: string | null = null;\n private text = '';\n\n transform(\n value: Date | string | number | null | undefined,\n format: WrDateFormat | (string & {}) = 'shortDate',\n options?: WrParseDateOptions\n ): string {\n // A signal read on the native adapter, which is what makes the template run\n // again when the zone or the locale moves.\n const display = this.adapter.zoned().displayKey();\n const key = options ? `${display}|${options.epochUnit}|${options.zonelessIn}|${options.timeZone}` : display;\n if (key !== this.key || format !== this.format || !Object.is(value, this.value)) {\n this.text = wrFormatDate(value, this.adapter, format, options);\n this.value = value;\n this.format = format;\n this.key = key;\n }\n return this.text;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport type { WrDurationStyle, WrDurationUnit } from './types';\n\n/** Each unit's length in milliseconds, largest first. */\nconst UNIT_MS: readonly (readonly [WrDurationUnit, number])[] = [\n ['day', 86_400_000],\n ['hour', 3_600_000],\n ['minute', 60_000],\n ['second', 1000],\n ['millisecond', 1],\n];\n\nconst CLOCK_UNITS: ReadonlySet<WrDurationUnit> = new Set(['hour', 'minute', 'second']);\nconst LIST_UNITS: ReadonlySet<WrDurationUnit> = new Set(['day', 'hour', 'minute', 'second']);\n\nfunction formatClock(ms: number, locale: string): string {\n const { hour = 0, minute = 0, second = 0 } = wrSplitDuration(ms, CLOCK_UNITS);\n const digits = (n: number, width: number): string =>\n new Intl.NumberFormat(locale, { useGrouping: false, minimumIntegerDigits: width }).format(n);\n const tail = `${digits(minute, hour > 0 ? 2 : 1)}:${digits(second, 2)}`;\n return hour > 0 ? `${digits(hour, 1)}:${tail}` : tail;\n}\n\nfunction formatTimer(ms: number, locale: string): string {\n const { day = 0, hour = 0, minute = 0, second = 0 } = wrSplitDuration(ms, LIST_UNITS);\n const two = new Intl.NumberFormat(locale, { useGrouping: false, minimumIntegerDigits: 2 });\n const clock = [hour, minute, second].map(n => two.format(n)).join(':');\n if (day === 0) return clock;\n const days = new Intl.NumberFormat(locale, { style: 'unit', unit: 'day', unitDisplay: 'narrow' }).format(day);\n return `${days} ${clock}`;\n}\n\nfunction formatUnits(ms: number, locale: string): string {\n const parts = wrSplitDuration(ms, LIST_UNITS);\n const unit = (name: WrDurationUnit, n: number): string =>\n new Intl.NumberFormat(locale, { style: 'unit', unit: name, unitDisplay: 'short' }).format(n);\n\n const words = (Object.entries(parts) as [WrDurationUnit, number][])\n .filter(([, n]) => n > 0)\n .map(([name, n]) => unit(name, n));\n if (words.length === 0) return unit('second', 0);\n return new Intl.ListFormat(locale, { style: 'narrow', type: 'unit' }).format(words);\n}\n\n/**\n * Split a span of milliseconds into the units asked for. A unit left out is\n * carried into the next larger one that is kept, so `['hour', 'minute',\n * 'second']` over three days and an hour reads 73 hours; the smallest unit kept\n * floors whatever remains. Shared with `wr-statistic-countdown`, whose format\n * tokens pick the units.\n *\n * @internal\n */\nexport function wrSplitDuration(\n ms: number,\n units: ReadonlySet<WrDurationUnit>\n): Readonly<Partial<Record<WrDurationUnit, number>>> {\n const out: Partial<Record<WrDurationUnit, number>> = {};\n let rest = ms;\n for (const [unit, size] of UNIT_MS) {\n if (!units.has(unit)) continue;\n const n = Math.floor(rest / size);\n out[unit] = n;\n rest -= n * size;\n }\n return out;\n}\n\n/**\n * A span of milliseconds as text, in the given locale.\n *\n * Three styles. `'clock'` is digits and colons: `1:30:00`, and `5:07` under an\n * hour; days are carried into the hours, since a clock has no day digit, so two\n * days read `48:00:00`. `'units'` is every non-zero unit as a word the locale\n * writes, `1 hr 30 min` in English and `1 h 30 min` in French, through\n * `Intl.NumberFormat`'s unit style and `Intl.ListFormat` — `Intl.DurationFormat`\n * is above the browser floor. `'timer'` is what an elapsed-time counter shows:\n * always `HH:mm:ss`, each field two digits, `01:02:03` and `00:05:07`; from a\n * day on, the days stand in front as the locale's narrow unit, `1d 02:03:04`.\n * The digits are the locale's own in every style.\n *\n * A span is not an instant: no style reads a time zone, so the output is the\n * same wherever it runs. Formatting an elapsed time as a date would add the\n * display zone's offset to it.\n *\n * Whole seconds: a fraction of a second is floored in every style. Zero reads\n * `0:00`, `0 sec` and `00:00:00`. A negative span is its absolute value with\n * the locale's minus sign in front, `-5:07` and `-00:05:07`. `null`, `undefined`, an empty string and a value\n * that is not a finite number give an empty string, as `wrFormatNumber` does.\n *\n * The same output as the `wrDuration` pipe, for a string built in TypeScript.\n *\n * @example\n * ```ts\n * wrFormatDuration(5_400_000, 'en-US'); // \"1:30:00\"\n * wrFormatDuration(5_400_000, 'en-US', 'units'); // \"1 hr 30 min\"\n * wrFormatDuration(307_000, 'fr-FR', 'units'); // \"5 min 7 s\"\n * wrFormatDuration(3_723_000, 'en-US', 'timer'); // \"01:02:03\"\n * wrFormatDuration(93_784_000, 'en-US', 'timer'); // \"1d 02:03:04\"\n * ```\n */\nexport function wrFormatDuration(\n value: number | string | null | undefined,\n locale: string,\n style: WrDurationStyle = 'clock'\n): string {\n if (value === null || value === undefined || value === '') return '';\n const ms = Number(typeof value === 'string' ? value.trim() : value);\n if (!Number.isFinite(ms)) return '';\n\n const span = Math.abs(ms);\n const body =\n style === 'units'\n ? formatUnits(span, locale)\n : style === 'timer'\n ? formatTimer(span, locale)\n : formatClock(span, locale);\n // A span that floors to zero carries no sign: `-0:00` states nothing.\n if (ms >= 0 || span < 1000) return body;\n\n const minus = new Intl.NumberFormat(locale).formatToParts(-1).find(part => part.type === 'minusSign');\n return `${minus?.value ?? '-'}${body}`;\n}\n\n/**\n * A span of milliseconds as clock digits, as units or as a timer, in Angular's\n * `LOCALE_ID`. See {@link wrFormatDuration} for the three styles and the edge\n * cases.\n *\n * @example\n * ```html\n * {{ 5400000 | wrDuration }} <!-- \"1:30:00\" -->\n * {{ 5400000 | wrDuration: 'units' }} <!-- \"1 hr 30 min\" -->\n * {{ 307000 | wrDuration }} <!-- \"5:07\" -->\n * {{ 3723000 | wrDuration: 'timer' }} <!-- \"01:02:03\" -->\n * ```\n */\n@Pipe({ name: 'wrDuration' })\nexport class WrDuration implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: number | string | null | undefined, style: WrDurationStyle = 'clock'): string {\n return wrFormatDuration(value, this.locale, style);\n }\n}\n\nexport type { WrDurationStyle, WrDurationUnit } from './types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport { wrInitials } from 'ngwr/utils';\n\n/**\n * Up to two initials of a name: `wrInitials()` from `ngwr/utils`, upper-cased\n * in `LOCALE_ID`.\n *\n * @example\n * ```html\n * {{ 'Roman Khegay' | wrInitials }} <!-- \"RK\" -->\n * {{ 'madonna' | wrInitials }} <!-- \"M\" -->\n * {{ '王小明' | wrInitials }} <!-- \"王\" -->\n * ```\n *\n * @see https://ngwr.dev/reference/pipes/wr-initials\n */\n@Pipe({ name: 'wrInitials' })\nexport class WrInitials implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: string | null | undefined): string {\n return wrInitials(value, this.locale);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, type PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, type SafeHtml } from '@angular/platform-browser';\n\n/** Escapes RegExp metacharacters so user input is safe to inline. @internal */\nconst RE_META = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** HTML-entities for the four chars that matter inside our `<mark>` wrap. @internal */\nfunction escapeHtml(s: string): string {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n}\n\n/**\n * Wrap every occurrence of `query` in `<mark>` tags. Useful for highlighting\n * search-term matches in autocomplete results, lists, and table cells.\n *\n * The output is `SafeHtml` — bind with `[innerHTML]`. Input is escaped first\n * so user-supplied values can't inject markup.\n *\n * @example\n * ```html\n * <span [innerHTML]=\"row.name | wrMark: query()\"></span>\n *\n * <!-- Case-sensitive: -->\n * <span [innerHTML]=\"row.name | wrMark: query() : true\"></span>\n * ```\n */\n@Pipe({ name: 'wrMark' })\nexport class WrMark implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n /**\n * @param value Source text.\n * @param query Search term to highlight. Empty/null skips the wrap.\n * @param caseSensitive Match exactly. @default false\n */\n transform(value: string | null | undefined, query: string | null | undefined, caseSensitive = false): SafeHtml {\n if (value === null || value === undefined) return '';\n const text = String(value);\n // Escaped on this path too. The output is bound with `[innerHTML]`, so\n // handing back the raw string let markup in `value` render as elements the\n // moment the search box was cleared — the same value drawn as text while a\n // query was typed, as an `<img>` when it was not.\n if (!query) return escapeHtml(text);\n\n // Match the RAW text and escape the pieces afterwards, never the other way\n // round. Escaping first rewrites `&` as `&amp;`, and a query of `m` then lands\n // INSIDE that entity: the `<mark>` splits it and the browser paints the\n // entity's own letters, so `Tom & Jerry` renders as `Tom &amp; Jerry`. The\n // mirror failure is a match that can never happen — `<`, `>` and `\"` no longer\n // exist in escaped text. The pipe's promise is untouched: every piece that came\n // from `value` still goes through `escapeHtml`, matched or not, so the only\n // tags in the output are the `<mark>`s built here.\n const pattern = new RegExp(`(${query.replace(RE_META, '\\\\$&')})`, caseSensitive ? 'g' : 'gi');\n const html = text\n .split(pattern)\n .map((part, index) => (index % 2 ? `<mark>${escapeHtml(part)}</mark>` : escapeHtml(part)))\n .join('');\n\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport type { WrNumberStyle } from './types';\n\n/** Digits with one optional point and a sign: the form `Intl` reads exactly. */\nconst PLAIN_DECIMAL = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)$/;\n\nfunction toOptions(style: WrNumberStyle, currency: string): Intl.NumberFormatOptions {\n switch (style) {\n case 'percent':\n return { style: 'percent', maximumFractionDigits: 2 };\n case 'currency':\n return { style: 'currency', currency };\n case 'decimal':\n default:\n return { style: 'decimal' };\n }\n}\n\n/**\n * A number through `Intl.NumberFormat`, in the given locale: the same output as\n * the `wrNumber` pipe, for a string built in TypeScript. Takes a style shortcut\n * (with an optional currency code) or a full `Intl.NumberFormatOptions` object.\n * `null`, `undefined`, an empty string and a value that is not a finite number\n * give an empty string.\n *\n * @example\n * ```ts\n * wrFormatNumber(1234.5, 'en-US'); // \"1,234.5\"\n * wrFormatNumber(0.875, 'en-US', 'percent'); // \"87.5%\"\n * wrFormatNumber(19.99, 'de-DE', 'currency', 'EUR'); // \"19,99 €\"\n * wrFormatNumber(19.99, 'en-US', { minimumFractionDigits: 2 });\n * ```\n */\nexport function wrFormatNumber(\n value: number | string | null | undefined,\n locale: string,\n styleOrOptions: WrNumberStyle | Intl.NumberFormatOptions = 'decimal',\n currency = 'USD'\n): string {\n if (value === null || value === undefined || value === '') return '';\n const text = typeof value === 'string' ? value.trim() : null;\n const n = Number(text ?? value);\n if (!Number.isFinite(n)) return '';\n\n const options: Intl.NumberFormatOptions =\n typeof styleOrOptions === 'string' ? toOptions(styleOrOptions, currency) : styleOrOptions;\n\n // A plain decimal string goes to `Intl` as it is: through `Number()`,\n // `'12345678901234567.89'` printed as `12,345,678,901,234,568`. Any other\n // form keeps the number, since ICU throws on an exponent of a billion or more.\n // `format()` has read a string since ES2023 (Chrome 106, Firefox 116, Safari\n // 15.4); the ES2022 lib this builds against types it as a number only.\n const exact = text !== null && PLAIN_DECIMAL.test(text) ? (text as unknown as number) : n;\n return new Intl.NumberFormat(locale, options).format(exact);\n}\n\n/**\n * Locale-aware number formatting via `Intl.NumberFormat`. Uses Angular's\n * `LOCALE_ID` as the default locale.\n *\n * Accepts either a style shortcut (with optional currency code) or a full\n * `Intl.NumberFormatOptions` object for fine-grained control.\n * {@link wrFormatNumber} is the same output as a function.\n *\n * @example\n * ```html\n * {{ 1234.5 | wrNumber }} <!-- \"1,234.5\" -->\n * {{ 0.875 | wrNumber: 'percent' }} <!-- \"87.5%\" -->\n * {{ 19.99 | wrNumber: 'currency': 'USD' }} <!-- \"$19.99\" -->\n * {{ 19.99 | wrNumber: { minimumFractionDigits: 2 } }}\n * ```\n */\n@Pipe({ name: 'wrNumber' })\nexport class WrNumber implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(\n value: number | string | null | undefined,\n styleOrOptions: WrNumberStyle | Intl.NumberFormatOptions = 'decimal',\n currency = 'USD'\n ): string {\n return wrFormatNumber(value, this.locale, styleOrOptions, currency);\n }\n}\n\nexport type { WrNumberStyle } from './types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport type { WrPluralForms, WrPluralOptions } from './types';\n\n/**\n * A count and its word form through `Intl.PluralRules`, in the given locale:\n * the same output as the `wrPlural` pipe, for a string built in TypeScript.\n * `options.locale` still wins over `locale`, as it wins over `LOCALE_ID` in the\n * pipe. `null`, `undefined` and a value that is not a finite number give an\n * empty string.\n *\n * @example\n * ```ts\n * wrFormatPlural(1, 'en', { one: 'comment', other: 'comments' }); // \"1 comment\"\n * wrFormatPlural(5, 'ru', { one: 'файл', few: 'файла', other: 'файлов' }); // \"5 файлов\"\n * wrFormatPlural(5, 'en', forms, { includeValue: false }); // \"comments\"\n * ```\n */\nexport function wrFormatPlural(\n value: number | null | undefined,\n locale: string,\n forms: WrPluralForms,\n options: WrPluralOptions = {}\n): string {\n if (value === null || value === undefined || !Number.isFinite(value)) return '';\n const tag = options.locale ?? locale;\n const category = new Intl.PluralRules(tag).select(value);\n const word = forms[category] ?? forms.other;\n if (options.includeValue === false) return word;\n return `${new Intl.NumberFormat(tag).format(value)} ${word}`;\n}\n\n/**\n * Locale-aware pluralization via `Intl.PluralRules`. Picks the right word\n * form for the count — including languages with more than two forms\n * (Russian, Polish, Arabic, …) — without hand-rolled `n % 10` rules.\n *\n * Categories follow CLDR: `zero` / `one` / `two` / `few` / `many` /\n * `other`. Missing categories fall back to `other`. {@link wrFormatPlural} is\n * the same output as a function.\n *\n * @example\n * ```html\n * {{ 1 | wrPlural: { one: 'comment', other: 'comments' } }}\n * <!-- \"1 comment\" -->\n *\n * {{ 5 | wrPlural: { one: 'файл', few: 'файла', other: 'файлов' } }}\n * <!-- \"5 файлов\" (with LOCALE_ID = ru) -->\n *\n * {{ count() | wrPlural: forms : { includeValue: false } }}\n * <!-- word only -->\n * ```\n */\n@Pipe({ name: 'wrPlural' })\nexport class WrPlural implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: number | null | undefined, forms: WrPluralForms, options: WrPluralOptions = {}): string {\n return wrFormatPlural(value, this.locale, forms, options);\n }\n}\n\nexport type { WrPluralForms, WrPluralOptions } from './types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\n/**\n * Creates an array of sequential indices `[0, 1, 2, ..., n-1]`.\n *\n * Useful for repeating template blocks a fixed number of times.\n *\n * @example\n * ```html\n * @for (i of (5 | wrRange); track i) {\n * <div>Item {{ i }}</div>\n * }\n * ```\n */\n@Pipe({ name: 'wrRange' })\nexport class WrRange implements PipeTransform {\n transform(length: number): number[] {\n return Array.from({ length }, (_, i) => i);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nlet segmenter: Intl.Segmenter | undefined;\n\n/**\n * Clamp a string to `length` characters, appending `ellipsis` when truncated.\n * A character is what a reader sees as one — a grapheme cluster — so an emoji,\n * a flag or a letter with a combining accent is kept whole or dropped whole,\n * never cut into half a surrogate pair that renders as a replacement box.\n *\n * @example\n * ```html\n * {{ 'Hello, world' | wrTruncate: 5 }} <!-- \"Hello…\" -->\n * {{ 'Hello, world' | wrTruncate: 8: '...' }} <!-- \"Hello, w...\" -->\n * ```\n */\n@Pipe({ name: 'wrTruncate' })\nexport class WrTruncate implements PipeTransform {\n transform(value: string | null | undefined, length = 80, ellipsis = '…'): string {\n if (value === null || value === undefined) return '';\n const s = String(value);\n // No more graphemes than UTF-16 units, so a string this short is never cut.\n if (s.length <= length) return s;\n // `slice`'s own coercion of the count, which is what this pipe did before it\n // counted graphemes: a fraction truncates, and NaN or a negative keeps nothing.\n const limit = Math.max(0, Math.trunc(length) || 0);\n segmenter ??= new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const { index } of segmenter.segment(s)) {\n if (count === limit) return s.slice(0, index) + ellipsis;\n count++;\n }\n return s;\n }\n}\n"],"mappings":";;;;;;;;;;;AAgBA,MAAM,QAAQ;CAAC;CAAQ;CAAY;CAAY;CAAY;CAAY;AAAU;AAgBjF,SAAS,OAAO,QAAgB,OAAe,MAAc,gBAAsB;CACjF,MAAM,QAAQ,IAAI,KAAK,aAAa,QAAQ;EAC1C,OAAO;EACP,MAAM,MAAM;EACZ,aAAa;EACb,uBAAuB;EACvB,uBAAuB;CACxB,CAAA,CAAC,CAAC,cAAc,KAAK;CAEtB,MAAM,KAAK,MAAM,WAAU,SAAQ,KAAK,SAAS,MAAM;CACvD,IAAI,OAAO,IAAI,OAAO,MAAM,KAAI,SAAQ,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE;CAE3D,MAAM,MAAM,MAAM,KAAI,SAAQ,KAAK,KAAK;CAGxC,MAAM,MAAM,OAAO,IAAI,IAAI,KAAK;CAChC,IAAI,MAAM,IAAI,EAAE,SAAS,WAAW,IAAI,OAAO;MAC1C,IAAI,OAAO,OAAO,IAAI,IAAI,IAAI,GAAG,GAAG;CACzC,OAAO,IAAI,KAAK,EAAE;AACpB;AAwCA,IAAa,UAAb,MAAa,QAAO;CACD,SAAS,OAAO,SAAS;CAE1C,UAAU,OAA2C,WAAW,GAAC;EAC/D,OAAO,cAAc,OAAO,KAAK,QAAQ,QAAQ;CACnD;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAO,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAP,OAAA,QAAA,GAAA,gBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAO,cAAA;EAAA,MAAA;CAAA,CAAA;;A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A;CAAV,OAAA,QAAA,GAAA,gBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAU,cAAA;EAAA,MAAA;CAAA,CAAA;;AAAV,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EADtB,MAAA;EAAK,MAAA,CAAA,EAAE,MAAM,aAAY,CAAE"}
1
+ {"version":3,"file":"ngwr-pipes.mjs","names":[],"sources":["../../../projects/lib/pipes/bytes.ts","../../../projects/lib/pipes/date.ts","../../../projects/lib/pipes/duration.ts","../../../projects/lib/pipes/initials.ts","../../../projects/lib/pipes/mark.ts","../../../projects/lib/pipes/number.ts","../../../projects/lib/pipes/plural.ts","../../../projects/lib/pipes/range.ts","../../../projects/lib/pipes/truncate.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\n/**\n * Binary magnitudes, as the `Intl` unit that labels each one. The COUNTING is\n * 1024-based and these names are decimal — which is the same thing the old\n * hand-written `['B', 'KB', 'MB', …]` table did, and what almost every file\n * manager does. Strictly, 1024 bytes is a kibibyte; `Intl` has no unit for it.\n */\nconst UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte'] as const;\n\n/**\n * `Intl`'s NARROW unit, with one space put back between it and the number.\n *\n * Neither display mode is right on its own. `short` spells the smallest unit\n * as a word — \"512 byte\", \"0 byte\" in English, \"0 Byte\" in German — which is\n * both worse copy than the `B` this pipe has always rendered and a bigger\n * change than the fix is worth. `narrow` gives `B` / `Б` / `o` correctly and\n * then closes the gap: \"1.2kB\".\n *\n * So the parts are reassembled rather than the string. Going through\n * `formatToParts` is what keeps the ORDER the locale's own — Hebrew puts the\n * unit first, and hand-joining `${n} ${unit}` would silently straighten every\n * such locale into English order.\n */\nfunction format(locale: string, value: number, unit: number, fractionDigits: number): string {\n const parts = new Intl.NumberFormat(locale, {\n style: 'unit',\n unit: UNITS[unit],\n unitDisplay: 'narrow',\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n }).formatToParts(value);\n\n const at = parts.findIndex(part => part.type === 'unit');\n if (at === -1) return parts.map(part => part.value).join('');\n\n const out = parts.map(part => part.value);\n // The slot on the number's side of the unit: already a separator in some\n // locales, absent in others.\n const gap = at === 0 ? 1 : at - 1;\n if (parts[gap]?.type === 'literal') out[gap] = ' ';\n else out.splice(at === 0 ? 1 : at, 0, ' ');\n return out.join('');\n}\n\n/**\n * Humanise a byte count using binary (1024-based) units, in the reader's locale.\n *\n * @example\n * ```html\n * {{ 1234 | wrBytes }} <!-- en: \"1.2 kB\" de: \"1,2 kB\" ru: \"1,2 кБ\" -->\n * {{ 1234567 | wrBytes: 0 }} <!-- en: \"1 MB\" fr: \"1 Mo\" -->\n * {{ 0 | wrBytes }} <!-- en: \"0 B\" ru: \"0 Б\" -->\n * ```\n *\n * **Both halves come from `Intl`, and the unit table is not the catalog's.** The\n * number always did need `LOCALE_ID` — it went through `toFixed`, which writes a\n * full stop in every language, so a German page read `1.2 KB` beside its own\n * `1,2` everywhere else — and the three formatting pipes beside this one\n * (`wrDate`, `wrNumber`, `wrPlural`) had injected it since they shipped.\n *\n * The unit could not follow them into `ngwr/i18n`, and the reason is the pipe\n * rather than the strings: a PURE pipe is re-invoked only when its argument\n * changes, so a catalog that lands after the first render — which is every\n * `provideWrI18nHttpLoader` app — would never reach it, and the pipe would be\n * correct under the static loader and silently English under the other one.\n * `LOCALE_ID` is a constant, so `Intl` has no such failure mode, and it knows\n * every locale ICU ships rather than the twenty-two this package translates.\n *\n * One visible change in English and it is the only one: `KB` became `kB`, which\n * is what CLDR calls that unit. `B`, the space before it and every other\n * magnitude read exactly as they did — see `format` for the part of that which\n * is not free.\n *\n * The other consequence, kept here so nobody rediscovers it as a bug:\n * `<wr-file-upload>` prints its own sizes from `fileUpload.unitKb` and friends,\n * which are public catalog keys a consumer may have overridden, so it renders\n * `KB` where this pipe renders `kB`. Retiring those keys would silently break\n * every override that had been translating them, which is a major-version move.\n *\n * {@link wrFormatBytes} is the same output as a function.\n */\n@Pipe({ name: 'wrBytes' })\nexport class WrBytes implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: number | string | null | undefined, decimals = 1): string {\n return wrFormatBytes(value, this.locale, decimals);\n }\n}\n\n/**\n * A byte count in binary (1024-based) units, in the given locale: the same\n * output as the `wrBytes` pipe, for a string built in TypeScript. `null`,\n * `undefined` and an empty string give an empty string; zero, a negative\n * number and a value that is not a number give `0 B`.\n *\n * @example\n * ```ts\n * wrFormatBytes(1234, 'en-US'); // \"1.2 kB\"\n * wrFormatBytes(1234567, 'fr-FR', 0); // \"1 Mo\"\n * ```\n */\nexport function wrFormatBytes(value: number | string | null | undefined, locale: string, decimals = 1): string {\n if (value === null || value === undefined || value === '') return '';\n const n = Number(value);\n if (!Number.isFinite(n) || n <= 0) return format(locale, 0, 0, 0);\n\n // Floored as well as capped: for `0 < n < 1` the log is negative, so an\n // unclamped index reads `UNITS[-1]` (`undefined`) and divides by `1024 ** -1`,\n // which rendered `0.5` as \"512.0 undefined\".\n const i = Math.min(Math.max(0, Math.floor(Math.log(n) / Math.log(1024))), UNITS.length - 1);\n // Whole bytes never show a fractional part.\n const digits = (unit: number): number => (unit === 0 ? 0 : Math.max(0, decimals));\n let unit = i;\n let scaled = n / 1024 ** unit;\n // A value that rounds up to 1024 belongs to the next unit: \"1,024.0 kB\" is \"1.0 MB\".\n while (unit < UNITS.length - 1 && Number(scaled.toFixed(Math.min(digits(unit), 100))) >= 1024) {\n unit++;\n scaled = n / 1024 ** unit;\n }\n return format(locale, scaled, unit, digits(unit));\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport { type WrDateFormat, type WrParseDateOptions, WrDateAdapter, wrIsDateOnly, wrParseDate } from 'ngwr/date';\n\n/**\n * A date through a `WrDateAdapter`: the same output as the `wrDate` pipe, for a\n * string built in TypeScript. A date-only string (`'2026-01-01'`) is that day in\n * the local zone, as `DatePipe` reads it, and `'2026-01-01 14:30:00'` is read\n * as its `T` form: the value goes through `wrParseDate`. `null`, `undefined`,\n * an empty string and a date the engine refuses give an empty string.\n *\n * An instant is printed on the wall clock of `withDates({ timeZone })`, through\n * the adapter's `zoned()`. A date-only string is a calendar day and is not\n * moved: `'2026-01-01'` prints as 1 January in every zone.\n *\n * The value is read as `withDates()` says: `epochUnit` for a number and\n * `zonelessIn` for a date-time string with no offset. The last argument\n * overrides either for one call, for a field whose unit differs from the app's;\n * a key left `undefined` keeps the app's value.\n *\n * The adapter stands where `wrFormatNumber` takes a locale, because the output\n * is the adapter's: the native one formats in `WR_DATE_LOCALE`, and an app's own\n * adapter formats however it formats. Neither can be rebuilt from a locale\n * string, so the caller passes `inject(WrDateAdapter)` once.\n *\n * @example\n * ```ts\n * private readonly dates = inject(WrDateAdapter);\n *\n * wrFormatDate(row.createdAt, this.dates); // shortDate\n * wrFormatDate(row.createdAt, this.dates, 'mediumDateTime'); // named key\n * wrFormatDate(row.createdAt, this.dates, 'dd.MM.yyyy'); // raw token string\n * wrFormatDate(row.sentAt, this.dates, 'time', { epochUnit: 'us' }); // microseconds\n * ```\n */\nexport function wrFormatDate(\n value: Date | string | number | null | undefined,\n adapter: WrDateAdapter<Date>,\n format: WrDateFormat | (string & {}) = 'shortDate',\n options?: WrParseDateOptions\n): string {\n const app = adapter.parseOptions();\n // Not a spread: a key set to `undefined` would erase the app's value.\n const date = wrParseDate(value, {\n epochUnit: options?.epochUnit ?? app.epochUnit,\n zonelessIn: options?.zonelessIn ?? app.zonelessIn,\n timeZone: options?.timeZone === undefined ? app.timeZone : options.timeZone,\n });\n if (date === null) return '';\n return (wrIsDateOnly(value) ? adapter : adapter.zoned()).format(date, format);\n}\n\n/**\n * Locale-aware date formatting. Delegates to `WrDateAdapter` — the native one\n * unless the app provides its own — so both the named format keys\n * (`'shortDate'`, `'longDate'`, …) and raw token strings work with nothing to\n * set up. A date-only string (`'2026-01-01'`) is that day in the local zone,\n * as `DatePipe` reads it, not UTC midnight, and a backend's\n * `'2026-01-01 14:30:00'` is read as its `T` form. {@link wrFormatDate} is the\n * same output as a function.\n *\n * An instant is printed in the time zone of `withDates({ timeZone })`, and the\n * output follows that zone and the adapter's locale when they change at\n * runtime. A pure pipe cannot: Angular calls it again only when an argument\n * changes. So the pipe is impure and keeps its last result, and a\n * change-detection pass with nothing new costs three comparisons, not a\n * format.\n *\n * @example\n * ```html\n * {{ now | wrDate }} <!-- shortDate -->\n * {{ now | wrDate: 'mediumDateTime' }} <!-- named key -->\n * {{ now | wrDate: 'dd.MM.yyyy' }} <!-- raw token string -->\n * {{ sentAt | wrDate: 'time' : { epochUnit: 'us' } }} <!-- microseconds -->\n * ```\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure -- a pure pipe cannot follow the zone or the locale; see above\n@Pipe({ name: 'wrDate', pure: false })\nexport class WrDate implements PipeTransform {\n private readonly adapter = inject<WrDateAdapter<Date>>(WrDateAdapter);\n\n private value: unknown;\n private format = '';\n private key: string | null = null;\n private text = '';\n\n transform(\n value: Date | string | number | null | undefined,\n format: WrDateFormat | (string & {}) = 'shortDate',\n options?: WrParseDateOptions\n ): string {\n // A signal read on the native adapter, which is what makes the template run\n // again when the zone or the locale moves.\n const display = this.adapter.zoned().displayKey();\n const key = options ? `${display}|${options.epochUnit}|${options.zonelessIn}|${options.timeZone}` : display;\n if (key !== this.key || format !== this.format || !Object.is(value, this.value)) {\n this.text = wrFormatDate(value, this.adapter, format, options);\n this.value = value;\n this.format = format;\n this.key = key;\n }\n return this.text;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport type { WrDurationStyle, WrDurationUnit } from './types';\n\n/** Each unit's length in milliseconds, largest first. */\nconst UNIT_MS: readonly (readonly [WrDurationUnit, number])[] = [\n ['day', 86_400_000],\n ['hour', 3_600_000],\n ['minute', 60_000],\n ['second', 1000],\n ['millisecond', 1],\n];\n\nconst CLOCK_UNITS: ReadonlySet<WrDurationUnit> = new Set(['hour', 'minute', 'second']);\nconst LIST_UNITS: ReadonlySet<WrDurationUnit> = new Set(['day', 'hour', 'minute', 'second']);\n\nfunction formatClock(ms: number, locale: string): string {\n const { hour = 0, minute = 0, second = 0 } = wrSplitDuration(ms, CLOCK_UNITS);\n const digits = (n: number, width: number): string =>\n new Intl.NumberFormat(locale, { useGrouping: false, minimumIntegerDigits: width }).format(n);\n const tail = `${digits(minute, hour > 0 ? 2 : 1)}:${digits(second, 2)}`;\n return hour > 0 ? `${digits(hour, 1)}:${tail}` : tail;\n}\n\nfunction formatTimer(ms: number, locale: string): string {\n const { day = 0, hour = 0, minute = 0, second = 0 } = wrSplitDuration(ms, LIST_UNITS);\n const two = new Intl.NumberFormat(locale, { useGrouping: false, minimumIntegerDigits: 2 });\n const clock = [hour, minute, second].map(n => two.format(n)).join(':');\n if (day === 0) return clock;\n const days = new Intl.NumberFormat(locale, { style: 'unit', unit: 'day', unitDisplay: 'narrow' }).format(day);\n return `${days} ${clock}`;\n}\n\nfunction formatUnits(ms: number, locale: string): string {\n const parts = wrSplitDuration(ms, LIST_UNITS);\n const unit = (name: WrDurationUnit, n: number): string =>\n new Intl.NumberFormat(locale, { style: 'unit', unit: name, unitDisplay: 'short' }).format(n);\n\n const words = (Object.entries(parts) as [WrDurationUnit, number][])\n .filter(([, n]) => n > 0)\n .map(([name, n]) => unit(name, n));\n if (words.length === 0) return unit('second', 0);\n return new Intl.ListFormat(locale, { style: 'narrow', type: 'unit' }).format(words);\n}\n\n/**\n * Split a span of milliseconds into the units asked for. A unit left out is\n * carried into the next larger one that is kept, so `['hour', 'minute',\n * 'second']` over three days and an hour reads 73 hours; the smallest unit kept\n * floors whatever remains. Shared with `wr-statistic-countdown`, whose format\n * tokens pick the units.\n *\n * @internal\n */\nexport function wrSplitDuration(\n ms: number,\n units: ReadonlySet<WrDurationUnit>\n): Readonly<Partial<Record<WrDurationUnit, number>>> {\n const out: Partial<Record<WrDurationUnit, number>> = {};\n let rest = ms;\n for (const [unit, size] of UNIT_MS) {\n if (!units.has(unit)) continue;\n const n = Math.floor(rest / size);\n out[unit] = n;\n rest -= n * size;\n }\n return out;\n}\n\n/**\n * A span of milliseconds as text, in the given locale.\n *\n * Three styles. `'clock'` is digits and colons: `1:30:00`, and `5:07` under an\n * hour; days are carried into the hours, since a clock has no day digit, so two\n * days read `48:00:00`. `'units'` is every non-zero unit as a word the locale\n * writes, `1 hr 30 min` in English and `1 h 30 min` in French, through\n * `Intl.NumberFormat`'s unit style and `Intl.ListFormat` — `Intl.DurationFormat`\n * is above the browser floor. `'timer'` is what an elapsed-time counter shows:\n * always `HH:mm:ss`, each field two digits, `01:02:03` and `00:05:07`; from a\n * day on, the days stand in front as the locale's narrow unit, `1d 02:03:04`.\n * The digits are the locale's own in every style.\n *\n * A span is not an instant: no style reads a time zone, so the output is the\n * same wherever it runs. Formatting an elapsed time as a date would add the\n * display zone's offset to it.\n *\n * Whole seconds: a fraction of a second is floored in every style. Zero reads\n * `0:00`, `0 sec` and `00:00:00`. A negative span is its absolute value with\n * the locale's minus sign in front, `-5:07` and `-00:05:07`. `null`, `undefined`, an empty string and a value\n * that is not a finite number give an empty string, as `wrFormatNumber` does.\n *\n * The same output as the `wrDuration` pipe, for a string built in TypeScript.\n *\n * @example\n * ```ts\n * wrFormatDuration(5_400_000, 'en-US'); // \"1:30:00\"\n * wrFormatDuration(5_400_000, 'en-US', 'units'); // \"1 hr 30 min\"\n * wrFormatDuration(307_000, 'fr-FR', 'units'); // \"5 min 7 s\"\n * wrFormatDuration(3_723_000, 'en-US', 'timer'); // \"01:02:03\"\n * wrFormatDuration(93_784_000, 'en-US', 'timer'); // \"1d 02:03:04\"\n * ```\n */\nexport function wrFormatDuration(\n value: number | string | null | undefined,\n locale: string,\n style: WrDurationStyle = 'clock'\n): string {\n if (value === null || value === undefined || value === '') return '';\n const ms = Number(typeof value === 'string' ? value.trim() : value);\n if (!Number.isFinite(ms)) return '';\n\n const span = Math.abs(ms);\n const body =\n style === 'units'\n ? formatUnits(span, locale)\n : style === 'timer'\n ? formatTimer(span, locale)\n : formatClock(span, locale);\n // A span that floors to zero carries no sign: `-0:00` states nothing.\n if (ms >= 0 || span < 1000) return body;\n\n const minus = new Intl.NumberFormat(locale).formatToParts(-1).find(part => part.type === 'minusSign');\n return `${minus?.value ?? '-'}${body}`;\n}\n\n/**\n * A span of milliseconds as clock digits, as units or as a timer, in Angular's\n * `LOCALE_ID`. See {@link wrFormatDuration} for the three styles and the edge\n * cases.\n *\n * @example\n * ```html\n * {{ 5400000 | wrDuration }} <!-- \"1:30:00\" -->\n * {{ 5400000 | wrDuration: 'units' }} <!-- \"1 hr 30 min\" -->\n * {{ 307000 | wrDuration }} <!-- \"5:07\" -->\n * {{ 3723000 | wrDuration: 'timer' }} <!-- \"01:02:03\" -->\n * ```\n */\n@Pipe({ name: 'wrDuration' })\nexport class WrDuration implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: number | string | null | undefined, style: WrDurationStyle = 'clock'): string {\n return wrFormatDuration(value, this.locale, style);\n }\n}\n\nexport type { WrDurationStyle, WrDurationUnit } from './types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport { wrInitials } from 'ngwr/utils';\n\n/**\n * Up to two initials of a name: `wrInitials()` from `ngwr/utils`, upper-cased\n * in `LOCALE_ID`.\n *\n * @example\n * ```html\n * {{ 'Roman Khegay' | wrInitials }} <!-- \"RK\" -->\n * {{ 'madonna' | wrInitials }} <!-- \"M\" -->\n * {{ '王小明' | wrInitials }} <!-- \"王\" -->\n * ```\n *\n * @see https://ngwr.dev/reference/pipes/wr-initials\n */\n@Pipe({ name: 'wrInitials' })\nexport class WrInitials implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: string | null | undefined): string {\n return wrInitials(value, this.locale);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, type PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, type SafeHtml } from '@angular/platform-browser';\n\n/** Escapes RegExp metacharacters so user input is safe to inline. @internal */\nconst RE_META = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** HTML-entities for the four chars that matter inside our `<mark>` wrap. @internal */\nfunction escapeHtml(s: string): string {\n return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n}\n\n/**\n * Wrap every occurrence of `query` in `<mark>` tags. Useful for highlighting\n * search-term matches in autocomplete results, lists, and table cells.\n *\n * The output is `SafeHtml` — bind with `[innerHTML]`. Input is escaped first\n * so user-supplied values can't inject markup.\n *\n * @example\n * ```html\n * <span [innerHTML]=\"row.name | wrMark: query()\"></span>\n *\n * <!-- Case-sensitive: -->\n * <span [innerHTML]=\"row.name | wrMark: query() : true\"></span>\n * ```\n */\n@Pipe({ name: 'wrMark' })\nexport class WrMark implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n /**\n * @param value Source text.\n * @param query Search term to highlight. Empty/null skips the wrap.\n * @param caseSensitive Match exactly. @default false\n */\n transform(value: string | null | undefined, query: string | null | undefined, caseSensitive = false): SafeHtml {\n if (value === null || value === undefined) return '';\n const text = String(value);\n // Escaped on this path too. The output is bound with `[innerHTML]`, so\n // handing back the raw string let markup in `value` render as elements the\n // moment the search box was cleared — the same value drawn as text while a\n // query was typed, as an `<img>` when it was not.\n if (!query) return escapeHtml(text);\n\n // Match the RAW text and escape the pieces afterwards, never the other way\n // round. Escaping first rewrites `&` as `&amp;`, and a query of `m` then lands\n // INSIDE that entity: the `<mark>` splits it and the browser paints the\n // entity's own letters, so `Tom & Jerry` renders as `Tom &amp; Jerry`. The\n // mirror failure is a match that can never happen — `<`, `>` and `\"` no longer\n // exist in escaped text. The pipe's promise is untouched: every piece that came\n // from `value` still goes through `escapeHtml`, matched or not, so the only\n // tags in the output are the `<mark>`s built here.\n const pattern = new RegExp(`(${query.replace(RE_META, '\\\\$&')})`, caseSensitive ? 'g' : 'gi');\n const html = text\n .split(pattern)\n .map((part, index) => (index % 2 ? `<mark>${escapeHtml(part)}</mark>` : escapeHtml(part)))\n .join('');\n\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport type { WrNumberStyle } from './types';\n\n/** Digits with one optional point and a sign: the form `Intl` reads exactly. */\nconst PLAIN_DECIMAL = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)$/;\n\nfunction toOptions(style: WrNumberStyle, currency: string): Intl.NumberFormatOptions {\n switch (style) {\n case 'percent':\n return { style: 'percent', maximumFractionDigits: 2 };\n case 'currency':\n return { style: 'currency', currency };\n case 'decimal':\n default:\n return { style: 'decimal' };\n }\n}\n\n/**\n * A number through `Intl.NumberFormat`, in the given locale: the same output as\n * the `wrNumber` pipe, for a string built in TypeScript. Takes a style shortcut\n * (with an optional currency code) or a full `Intl.NumberFormatOptions` object.\n * `null`, `undefined`, an empty string and a value that is not a finite number\n * give an empty string.\n *\n * @example\n * ```ts\n * wrFormatNumber(1234.5, 'en-US'); // \"1,234.5\"\n * wrFormatNumber(0.875, 'en-US', 'percent'); // \"87.5%\"\n * wrFormatNumber(19.99, 'de-DE', 'currency', 'EUR'); // \"19,99 €\"\n * wrFormatNumber(19.99, 'en-US', { minimumFractionDigits: 2 });\n * ```\n */\nexport function wrFormatNumber(\n value: number | string | null | undefined,\n locale: string,\n styleOrOptions: WrNumberStyle | Intl.NumberFormatOptions = 'decimal',\n currency = 'USD'\n): string {\n if (value === null || value === undefined || value === '') return '';\n const text = typeof value === 'string' ? value.trim() : null;\n const n = Number(text ?? value);\n if (!Number.isFinite(n)) return '';\n\n const options: Intl.NumberFormatOptions =\n typeof styleOrOptions === 'string' ? toOptions(styleOrOptions, currency) : styleOrOptions;\n\n // A plain decimal string goes to `Intl` as it is: through `Number()`,\n // `'12345678901234567.89'` printed as `12,345,678,901,234,568`. Any other\n // form keeps the number, since ICU throws on an exponent of a billion or more.\n // `format()` has read a string since ES2023 (Chrome 106, Firefox 116, Safari\n // 15.4); the ES2022 lib this builds against types it as a number only.\n const exact = text !== null && PLAIN_DECIMAL.test(text) ? (text as unknown as number) : n;\n return new Intl.NumberFormat(locale, options).format(exact);\n}\n\n/**\n * Locale-aware number formatting via `Intl.NumberFormat`. Uses Angular's\n * `LOCALE_ID` as the default locale.\n *\n * Accepts either a style shortcut (with optional currency code) or a full\n * `Intl.NumberFormatOptions` object for fine-grained control.\n * {@link wrFormatNumber} is the same output as a function.\n *\n * @example\n * ```html\n * {{ 1234.5 | wrNumber }} <!-- \"1,234.5\" -->\n * {{ 0.875 | wrNumber: 'percent' }} <!-- \"87.5%\" -->\n * {{ 19.99 | wrNumber: 'currency': 'USD' }} <!-- \"$19.99\" -->\n * {{ 19.99 | wrNumber: { minimumFractionDigits: 2 } }}\n * ```\n */\n@Pipe({ name: 'wrNumber' })\nexport class WrNumber implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(\n value: number | string | null | undefined,\n styleOrOptions: WrNumberStyle | Intl.NumberFormatOptions = 'decimal',\n currency = 'USD'\n ): string {\n return wrFormatNumber(value, this.locale, styleOrOptions, currency);\n }\n}\n\nexport type { WrNumberStyle } from './types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { LOCALE_ID, Pipe, inject } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nimport type { WrPluralForms, WrPluralOptions } from './types';\n\n/**\n * A count and its word form through `Intl.PluralRules`, in the given locale:\n * the same output as the `wrPlural` pipe, for a string built in TypeScript.\n * `options.locale` still wins over `locale`, as it wins over `LOCALE_ID` in the\n * pipe. `null`, `undefined` and a value that is not a finite number give an\n * empty string.\n *\n * @example\n * ```ts\n * wrFormatPlural(1, 'en', { one: 'comment', other: 'comments' }); // \"1 comment\"\n * wrFormatPlural(5, 'ru', { one: 'файл', few: 'файла', other: 'файлов' }); // \"5 файлов\"\n * wrFormatPlural(5, 'en', forms, { includeValue: false }); // \"comments\"\n * ```\n */\nexport function wrFormatPlural(\n value: number | null | undefined,\n locale: string,\n forms: WrPluralForms,\n options: WrPluralOptions = {}\n): string {\n if (value === null || value === undefined || !Number.isFinite(value)) return '';\n const tag = options.locale ?? locale;\n const category = new Intl.PluralRules(tag).select(value);\n const word = forms[category] ?? forms.other;\n if (options.includeValue === false) return word;\n return `${new Intl.NumberFormat(tag).format(value)} ${word}`;\n}\n\n/**\n * Locale-aware pluralization via `Intl.PluralRules`. Picks the right word\n * form for the count — including languages with more than two forms\n * (Russian, Polish, Arabic, …) — without hand-rolled `n % 10` rules.\n *\n * Categories follow CLDR: `zero` / `one` / `two` / `few` / `many` /\n * `other`. Missing categories fall back to `other`. {@link wrFormatPlural} is\n * the same output as a function.\n *\n * @example\n * ```html\n * {{ 1 | wrPlural: { one: 'comment', other: 'comments' } }}\n * <!-- \"1 comment\" -->\n *\n * {{ 5 | wrPlural: { one: 'файл', few: 'файла', other: 'файлов' } }}\n * <!-- \"5 файлов\" (with LOCALE_ID = ru) -->\n *\n * {{ count() | wrPlural: forms : { includeValue: false } }}\n * <!-- word only -->\n * ```\n */\n@Pipe({ name: 'wrPlural' })\nexport class WrPlural implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(value: number | null | undefined, forms: WrPluralForms, options: WrPluralOptions = {}): string {\n return wrFormatPlural(value, this.locale, forms, options);\n }\n}\n\nexport type { WrPluralForms, WrPluralOptions } from './types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\n/**\n * Creates an array of sequential indices `[0, 1, 2, ..., n-1]`.\n *\n * Useful for repeating template blocks a fixed number of times.\n *\n * @example\n * ```html\n * @for (i of (5 | wrRange); track i) {\n * <div>Item {{ i }}</div>\n * }\n * ```\n */\n@Pipe({ name: 'wrRange' })\nexport class WrRange implements PipeTransform {\n transform(length: number): number[] {\n return Array.from({ length }, (_, i) => i);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe } from '@angular/core';\nimport type { PipeTransform } from '@angular/core';\n\nlet segmenter: Intl.Segmenter | undefined;\n\n/**\n * Clamp a string to `length` characters, appending `ellipsis` when truncated.\n * A character is what a reader sees as one — a grapheme cluster — so an emoji,\n * a flag or a letter with a combining accent is kept whole or dropped whole,\n * never cut into half a surrogate pair that renders as a replacement box.\n *\n * @example\n * ```html\n * {{ 'Hello, world' | wrTruncate: 5 }} <!-- \"Hello…\" -->\n * {{ 'Hello, world' | wrTruncate: 8: '...' }} <!-- \"Hello, w...\" -->\n * ```\n */\n@Pipe({ name: 'wrTruncate' })\nexport class WrTruncate implements PipeTransform {\n transform(value: string | null | undefined, length = 80, ellipsis = '…'): string {\n if (value === null || value === undefined) return '';\n const s = String(value);\n // No more graphemes than UTF-16 units, so a string this short is never cut.\n if (s.length <= length) return s;\n // `slice`'s own coercion of the count, which is what this pipe did before it\n // counted graphemes: a fraction truncates, and NaN or a negative keeps nothing.\n const limit = Math.max(0, Math.trunc(length) || 0);\n segmenter ??= new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n let count = 0;\n for (const { index } of segmenter.segment(s)) {\n if (count === limit) return s.slice(0, index) + ellipsis;\n count++;\n }\n return s;\n }\n}\n"],"mappings":";;;;;;;;;;;AAgBA,MAAM,QAAQ;CAAC;CAAQ;CAAY;CAAY;CAAY;CAAY;AAAU;AAgBjF,SAAS,OAAO,QAAgB,OAAe,MAAc,gBAAsB;CACjF,MAAM,QAAQ,IAAI,KAAK,aAAa,QAAQ;EAC1C,OAAO;EACP,MAAM,MAAM;EACZ,aAAa;EACb,uBAAuB;EACvB,uBAAuB;CACxB,CAAA,CAAC,CAAC,cAAc,KAAK;CAEtB,MAAM,KAAK,MAAM,WAAU,SAAQ,KAAK,SAAS,MAAM;CACvD,IAAI,OAAO,IAAI,OAAO,MAAM,KAAI,SAAQ,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE;CAE3D,MAAM,MAAM,MAAM,KAAI,SAAQ,KAAK,KAAK;CAGxC,MAAM,MAAM,OAAO,IAAI,IAAI,KAAK;CAChC,IAAI,MAAM,IAAI,EAAE,SAAS,WAAW,IAAI,OAAO;MAC1C,IAAI,OAAO,OAAO,IAAI,IAAI,IAAI,GAAG,GAAG;CACzC,OAAO,IAAI,KAAK,EAAE;AACpB;AAwCA,IAAa,UAAb,MAAa,QAAO;CACD,SAAS,OAAO,SAAS;CAE1C,UAAU,OAA2C,WAAW,GAAC;EAC/D,OAAO,cAAc,OAAO,KAAK,QAAQ,QAAQ;CACnD;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;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AQ,OAAO;EAG/B,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,KAAK,CAAC;EACjD,cAAc,IAAI,KAAK,UAAU,QAAW,EAAE,aAAa,WAAU,CAAE;EACvE,IAAI,QAAQ;EACZ,KAAK,MAAM,EAAE,WAAW,UAAU,QAAQ,CAAC,GAAG;GAC5C,IAAI,UAAU,OAAO,OAAO,EAAE,MAAM,GAAG,KAAK,IAAI;GAChD;EACF;EACA,OAAO;CACT;CAhBW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAU,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAV,OAAA,QAAA,GAAA,gBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAU,cAAA;EAAA,MAAA;CAAA,CAAA;;AAAV,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EADtB,MAAA;EAAK,MAAA,CAAA,EAAE,MAAM,aAAY,CAAE"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { Component, DestroyRef, Directive, ElementRef, Injector, ViewContainerRef, ViewEncapsulation, effect, inject, input, output, signal } from "@angular/core";
3
3
  import { coerceBooleanProperty } from "@angular/cdk/coercion";
4
- import { wrCheckStyles, wrRestoreFocus, wrToClassList } from "ngwr/utils";
4
+ import { wrCheckStyles, wrNoteFocusReturn, wrRestoreFocus, wrToClassList } from "ngwr/utils";
5
5
  import { useI18nText } from "ngwr/i18n";
6
6
  import { Directionality } from "@angular/cdk/bidi";
7
7
  import { WrButton } from "ngwr/button";
@@ -313,6 +313,7 @@ var WrPopconfirm = class WrPopconfirm {
313
313
  this.overlayRef = null;
314
314
  this.openState.set(false);
315
315
  if (returnFocus) wrRestoreFocus(this.host.nativeElement, this.focusMonitor);
316
+ else wrNoteFocusReturn(this.host.nativeElement);
316
317
  }
317
318
  onPaneKeydown = (event) => {
318
319
  const pane = this.overlayRef?.overlayElement;
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-popconfirm.mjs","names":[],"sources":["../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/types/popconfirm-position.ts","../../../projects/lib/popconfirm/popconfirm.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Confirmation panel rendered inside the popconfirm overlay. Not part\n * of the public template API — use `[wrPopconfirm]` instead.\n *\n * @internal\n */\n@Component({\n selector: 'wr-popconfirm',\n templateUrl: './popconfirm-panel.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-popconfirm' },\n imports: [WrButton],\n})\nexport class WrPopconfirmPanel {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n }\n\n readonly message = input.required<string>();\n\n /** Id the anchoring directive points `aria-describedby` at. */\n readonly messageId = input<string | null>(null);\n readonly confirmText = input<string>('Confirm');\n readonly cancelText = input<string>('Cancel');\n readonly confirmColor = input<WrColor>('primary');\n\n readonly confirmed = output<void>();\n readonly cancelled = output<void>();\n}\n","<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\n\nimport { type WrAnchoredPosition, wrAnchoredPositions } from 'ngwr/overlay';\n\n/** Where the popconfirm panel sits relative to its trigger. */\nexport type WrPopconfirmPosition = WrAnchoredPosition;\n\n/**\n * The list `withPositions()` wants: the shared fallback chain `wr-popover`\n * walks, with its 8px gap, every link tagged with the pane class of the\n * placement it puts the panel on, so the arrow\n * (`.wr-popconfirm-overlay--<placement>`) follows a flip. The CDK applies a\n * position's own `panelClass` when it lands on it and clears it on the next one;\n * the gap is an offset rather than padding, so taking the class off before it\n * measures changes nothing.\n *\n * @internal\n */\nexport function wrPopconfirmPositions(position: WrPopconfirmPosition): ConnectedPosition[] {\n return wrAnchoredPositions(position, { gap: 8, paneClass: 'wr-popconfirm-overlay' });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type FocusTrap, FocusMonitor, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport {\n WR_OVERLAY,\n WrOutsideClick,\n type WrOverlayAutoFocus,\n wrFocusOverlay,\n wrFollowDirection,\n wrMirrorOffsets,\n} from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrPopconfirmPanel } from './popconfirm-panel';\nimport { type WrPopconfirmPosition, wrPopconfirmPositions } from './types';\n\n/**\n * How close, in px, `withPush` may park the panel to the viewport edge — the\n * `--wr-space-sm` step, and the value `wr-popover` uses.\n */\nconst VIEWPORT_MARGIN = 8;\n\n/**\n * Small \"Are you sure?\" panel anchored to its trigger. Fires `confirmed`\n * or `cancelled` and closes automatically. Built on CDK Overlay.\n *\n * @example\n * ```html\n * <wr-btn\n * color=\"danger\"\n * [wrPopconfirm]=\"'Delete this item?'\"\n * confirmColor=\"danger\"\n * confirmText=\"Delete\"\n * (confirmed)=\"remove()\"\n * >Delete</wr-btn>\n * ```\n *\n * @see https://ngwr.dev/reference/components/popconfirm\n */\nlet popconfirmUid = 0;\n\n@Directive({\n selector: '[wrPopconfirm]',\n exportAs: 'wrPopconfirm',\n host: {\n // Marks the trigger the way `[wrPopover]` and `[wrDropdown]` mark theirs. The\n // question is normally BOUND (`[wrPopconfirm]=\"question\"`), which leaves no\n // attribute in the DOM at all, so without this there is nothing to find a\n // trigger by once the panel is shut.\n class: 'wr-popconfirm-trigger',\n '[class.wr-popconfirm-trigger--disabled]': 'disabled()',\n '(click)': 'toggle($event)',\n '(keydown)': 'onTriggerKeydown($event)',\n '[attr.aria-haspopup]': 'disabled() ? null : \"dialog\"',\n '[attr.aria-expanded]': 'disabled() ? null : isOpen()',\n // Names the dialog this trigger opened, as every other overlay trigger in the\n // catalog does. `aria-haspopup=\"dialog\"` promises a dialog and `aria-expanded`\n // says it is showing; without the id, which one is left to guess.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n },\n})\nexport class WrPopconfirm {\n /** Confirmation message. */\n readonly message = input.required<string>({ alias: 'wrPopconfirm' });\n\n /**\n * Anchor side and alignment, the twelve placements `wr-popover` takes; the\n * panel flips to another side when this one has no room.\n * @default 'top'\n */\n readonly position = input<WrPopconfirmPosition>('top');\n\n /** Label for the confirm button. @default 'Confirm' */\n /** Confirm button text. Falls back to `popconfirm.confirm`. */\n readonly confirmText = input<string | null>(null);\n\n /** Label for the cancel button. @default 'Cancel' */\n /** Cancel button text. Falls back to `popconfirm.cancel`. */\n readonly cancelText = input<string | null>(null);\n\n /**\n * Accessible name of the confirmation dialog. `role=\"dialog\"` with no name\n * announces as a bare \"dialog\". Falls back to `popconfirm.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The catalog has carried these translated for as long as the component has\n // existed; the labels were hard-coded English defaults, so a localized app got\n // English buttons with the right strings sitting one file away.\n private readonly resolvedConfirm = useI18nText(this.confirmText, 'popconfirm.confirm', 'Confirm');\n private readonly resolvedCancel = useI18nText(this.cancelText, 'popconfirm.cancel', 'Cancel');\n private readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'popconfirm.label', 'Confirm action');\n\n /** Color of the confirm button. @default 'primary' */\n readonly confirmColor = input<WrColor>('primary');\n\n /**\n * Extra CSS classes for the confirmation bubble's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Where focus goes when the panel opens. `'dialog'` puts it on the panel\n * itself, with no ring, so Tab reaches Cancel and no button is lit;\n * `'first-tabbable'` puts it on Cancel; `false` leaves it on the trigger,\n * and Tab from there walks into the panel. Closing hands focus back to the\n * trigger in every mode.\n *\n * Prefixed because the directive sits on your own element, where an\n * `autoFocus` attribute would also be the native `autofocus`.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrOverlayAutoFocus>('dialog', { alias: 'wrPopconfirmAutoFocus' });\n\n /**\n * Turns the question off: a click on the host opens nothing and is left to\n * propagate, `open()` does nothing, and an open panel closes without\n * `cancelled`. The host publishes no popup ARIA meanwhile and carries\n * `wr-popconfirm-trigger--disabled`.\n *\n * The host's own `disabled` stays yours: the directive never sets it, so the\n * button still takes its own `(click)` — the way to skip the question when\n * there is nothing to confirm.\n *\n * @default false\n */\n readonly disabled = input(false, { alias: 'wrPopconfirmDisabled', transform: coerceBooleanProperty });\n\n /** Fires when the user clicks confirm. */\n readonly confirmed = output<void>();\n\n /** Fires when the user clicks cancel or dismisses the overlay. */\n readonly cancelled = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly focusTraps = inject(FocusTrapFactory);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly openState = signal(false);\n\n /** Whether the popconfirm is open. Read-only: `open()` and `close()` change it. */\n readonly isOpen = this.openState.asReadonly();\n\n private overlayRef: OverlayRef | null = null;\n private finder: FocusTrap | null = null;\n\n private readonly uid = ++popconfirmUid;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-popconfirm-${this.uid}`;\n\n private readonly messageId = `wr-popconfirm-message-${this.uid}`;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n this.destroyRef.onDestroy(() => this.dispose());\n effect(() => {\n if (this.disabled()) this.close();\n });\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n if (this.disabled()) return;\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the panel. Does nothing while the trigger is disabled. */\n open(): void {\n if (this.disabled() || this.overlayRef) return;\n\n // Read ONCE, here, and mirror this list rather than the input: the side is\n // chosen at open and a later `position` write moves nothing, so a follower\n // that re-read the signal would let a direction flip quietly adopt a\n // position the panel never opened with.\n //\n // The list is a fallback CHAIN, each link tagged with its own\n // `wr-popconfirm-overlay--<side>` class, so the panel flips when the side\n // asked for has no room and the arrow names the side it landed on. The\n // viewport margin is `wr-popover`'s, for the same reason: without it a pushed\n // panel parks its border on the glass.\n const positions = wrPopconfirmPositions(this.position());\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(positions, this.isRtl()))\n .withPush(true)\n .withViewportMargin(VIEWPORT_MARGIN);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: wrToClassList('wr-popconfirm-overlay', this.panelClass()),\n });\n\n // `isRtl()` above answered once, at `create()`, and so did the CDK's own\n // capture of the direction — neither is revisited if the app flips while the\n // question is still on screen. Both halves have to move: the `dir` on the\n // host, so `start` / `end` resolve to the other edge, and the mirrored list,\n // because `offsetX` is added to the final PHYSICAL x. Leave the list behind\n // and the 8px gap on `left` / `right` becomes an 8px overlap over the very\n // control the panel is asking about.\n wrFollowDirection(this.overlayRef, this.dir, this.injector, direction =>\n positionStrategy.withPositions(wrMirrorOffsets(positions, direction === 'rtl'))\n );\n\n // Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,\n // so trapping focus would only make it harder to leave. It still needs a role, a\n // name and the question read out as its description.\n const pane = this.overlayRef.overlayElement;\n pane.id = this.panelId;\n pane.setAttribute('role', 'dialog');\n pane.setAttribute('aria-modal', 'false');\n pane.setAttribute('aria-label', this.resolvedAriaLabel());\n pane.setAttribute('aria-describedby', this.messageId);\n pane.tabIndex = -1;\n\n const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);\n const ref = this.overlayRef.attach(portal);\n ref.setInput('message', this.message());\n ref.setInput('messageId', this.messageId);\n ref.setInput('confirmText', this.resolvedConfirm());\n ref.setInput('cancelText', this.resolvedCancel());\n ref.setInput('confirmColor', this.confirmColor());\n ref.changeDetectorRef.detectChanges();\n // Focus has to be able to enter the panel: the overlay container sits at the\n // end of `<body>`, so Tab from the trigger went to the next thing on the PAGE\n // and the only way to confirm was unreachable. It enters on open as\n // `wrPopconfirmAutoFocus` says, and never onto a button unasked: the panel itself by\n // default, Cancel under `'first-tabbable'` (the action being confirmed is\n // usually the destructive one). Under `false` Tab on the trigger walks in,\n // see `onTriggerKeydown`.\n //\n // `deferAnchors`: the trap is only the finder `wrFocusOverlay` asks for. No\n // anchors go into the page and nothing is trapped.\n this.finder = this.focusTraps.create(pane, true);\n wrFocusOverlay(pane, this.finder, this.autoFocus(), this.injector);\n // And it has to LEAVE with the panel: Tab past Confirm went on to the end of\n // `<body>` and Shift+Tab before Cancel to the foot of the page, each with the\n // question still on screen and `aria-expanded` still true. See `onPaneKeydown`.\n pane.addEventListener('keydown', this.onPaneKeydown);\n pane.addEventListener('focusout', this.onPaneFocusOut);\n this.openState.set(true);\n\n ref.instance.confirmed.subscribe(() => {\n this.confirmed.emit();\n this.close();\n });\n ref.instance.cancelled.subscribe(() => this.dismiss());\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.dismiss();\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n close(): void {\n this.dispose();\n }\n\n private dismiss(): void {\n if (!this.overlayRef) return;\n this.cancelled.emit();\n this.dispose();\n }\n\n private dispose(): void {\n if (!this.overlayRef) return;\n // Focus lives inside the panel while it is open, and removing the panel would\n // drop it to `<body>` — hand it back to the trigger instead, as `wr-dropdown`\n // does on Escape. Only when focus is still IN there: if the user has already\n // clicked elsewhere, taking it back would be stealing.\n const pane = this.overlayRef.overlayElement;\n const returnFocus = pane.contains(document.activeElement);\n // Before the dispose: Chromium fires `focusout` for a focused node as it is\n // removed, and the pane is about to be.\n pane.removeEventListener('keydown', this.onPaneKeydown);\n pane.removeEventListener('focusout', this.onPaneFocusOut);\n this.finder?.destroy();\n this.finder = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.openState.set(false);\n if (returnFocus) wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n }\n\n /**\n * Tab off either end of the panel dismisses it and takes focus back to the\n * trigger — `wr-popover`'s disclosure behaviour, for a non-modal panel whose\n * DOM sits nowhere near its trigger. Leaving is a dismissal, so `cancelled`\n * fires, as it does for Escape and an outside click.\n *\n * Forward, the trigger is focused WITHOUT `preventDefault`, so the browser's\n * own Tab runs on from there and lands on whatever follows the trigger, where a\n * panel rendered in place would have let it go. Backward, the trigger itself is\n * the destination, so the default is stopped. The panel holds two stops, Cancel\n * and Confirm, in that order.\n */\n private readonly onPaneKeydown = (event: KeyboardEvent): void => {\n const pane = this.overlayRef?.overlayElement;\n if (!pane || event.key !== 'Tab' || event.defaultPrevented) return;\n const stops = [...pane.querySelectorAll<HTMLElement>('.wr-popconfirm__action')];\n const active = document.activeElement;\n if (event.shiftKey) {\n if (active !== pane && active !== stops[0]) return;\n event.preventDefault();\n } else if (active !== stops.at(-1)) {\n return;\n }\n wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n this.dismiss();\n };\n\n /**\n * Tab on the trigger while the panel is open walks into it, as it would into a\n * panel rendered beside the trigger. The way in when focus did not move on\n * open (`wrPopconfirmAutoFocus` is `false`).\n *\n * @internal\n */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n const pane = this.overlayRef?.overlayElement;\n if (!pane || event.key !== 'Tab' || event.shiftKey || event.defaultPrevented) return;\n if (event.target !== this.host.nativeElement) return;\n event.preventDefault();\n (pane.querySelector<HTMLElement>('.wr-popconfirm__action') ?? pane).focus();\n }\n\n /**\n * Focus that leaves the panel by any other road (a click on something\n * focusable elsewhere) dismisses it too, and is left where it went. A `null`\n * destination is the window losing focus or a focused node being removed,\n * neither of which is leaving.\n */\n private readonly onPaneFocusOut = (event: FocusEvent): void => {\n const next = event.relatedTarget as Node | null;\n if (!next || this.holdsFocus(next)) return;\n this.dismiss();\n };\n\n /**\n * Whether focus on `node` still belongs to this panel: inside the pane, on the\n * trigger (a press there is about to toggle it), or in an overlay opened AFTER\n * this one — the stacking `wr-popover` and `WrOutsideClick` honour, so a\n * second panel raised by `open()` does not dismiss the first by taking focus.\n */\n private holdsFocus(node: Node): boolean {\n const ref = this.overlayRef;\n if (!ref) return false;\n if (ref.overlayElement.contains(node) || this.host.nativeElement.contains(node)) return true;\n const box = ref.hostElement;\n return (\n (box.parentElement?.contains(node) ?? false) &&\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n (box.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0\n );\n }\n\n /**\n * Whether the app reads right-to-left.\n *\n * Optional inject: `Directionality` is root-provided, so this is never null in\n * an app — but a bare `TestBed` that provides nothing should still get a\n * component that works, and defaulting to LTR is the honest fallback.\n */\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,IAAa,oBAAb,MAAa,kBAAiB;CAC5B,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,YAAY;CAC/E;CAES,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAGlC,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACtC,cAAc,MAAc,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACtC,aAAa,MAAc,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,eAAe,MAAe,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAExC,YAAY,OAAM;CAClB,YAAY,OAAM;CAdhB,OAAA,OAAA,GAAA,mBAAA;EAAA,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YAAA;IAAA,mBAAA;GAAA;GAAA,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,WAAA;GAAA,WAAA;EAAA;EAAA,MAAA;GAAA,WAAA;IAAA,SAAA;IAAA,WAAA;GAAA;GAAA,YAAA;IAAA,yCAAA;IAAA,sBAAA;IAAA,sBAAA;IAAA,sBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,cAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EApBxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IAKJ,OAAO;IACP,2CAA2C;IAC3C,WAAW;IACX,aAAa;IACb,wBAAwB;IACxB,wBAAwB;IAIxB,wBAAwB;GACzB;EACF,CAAA"}
1
+ {"version":3,"file":"ngwr-popconfirm.mjs","names":[],"sources":["../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/types/popconfirm-position.ts","../../../projects/lib/popconfirm/popconfirm.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Confirmation panel rendered inside the popconfirm overlay. Not part\n * of the public template API — use `[wrPopconfirm]` instead.\n *\n * @internal\n */\n@Component({\n selector: 'wr-popconfirm',\n templateUrl: './popconfirm-panel.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-popconfirm' },\n imports: [WrButton],\n})\nexport class WrPopconfirmPanel {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n }\n\n readonly message = input.required<string>();\n\n /** Id the anchoring directive points `aria-describedby` at. */\n readonly messageId = input<string | null>(null);\n readonly confirmText = input<string>('Confirm');\n readonly cancelText = input<string>('Cancel');\n readonly confirmColor = input<WrColor>('primary');\n\n readonly confirmed = output<void>();\n readonly cancelled = output<void>();\n}\n","<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\n\nimport { type WrAnchoredPosition, wrAnchoredPositions } from 'ngwr/overlay';\n\n/** Where the popconfirm panel sits relative to its trigger. */\nexport type WrPopconfirmPosition = WrAnchoredPosition;\n\n/**\n * The list `withPositions()` wants: the shared fallback chain `wr-popover`\n * walks, with its 8px gap, every link tagged with the pane class of the\n * placement it puts the panel on, so the arrow\n * (`.wr-popconfirm-overlay--<placement>`) follows a flip. The CDK applies a\n * position's own `panelClass` when it lands on it and clears it on the next one;\n * the gap is an offset rather than padding, so taking the class off before it\n * measures changes nothing.\n *\n * @internal\n */\nexport function wrPopconfirmPositions(position: WrPopconfirmPosition): ConnectedPosition[] {\n return wrAnchoredPositions(position, { gap: 8, paneClass: 'wr-popconfirm-overlay' });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type FocusTrap, FocusMonitor, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport {\n WR_OVERLAY,\n WrOutsideClick,\n type WrOverlayAutoFocus,\n wrFocusOverlay,\n wrFollowDirection,\n wrMirrorOffsets,\n} from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrNoteFocusReturn, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrPopconfirmPanel } from './popconfirm-panel';\nimport { type WrPopconfirmPosition, wrPopconfirmPositions } from './types';\n\n/**\n * How close, in px, `withPush` may park the panel to the viewport edge — the\n * `--wr-space-sm` step, and the value `wr-popover` uses.\n */\nconst VIEWPORT_MARGIN = 8;\n\n/**\n * Small \"Are you sure?\" panel anchored to its trigger. Fires `confirmed`\n * or `cancelled` and closes automatically. Built on CDK Overlay.\n *\n * @example\n * ```html\n * <wr-btn\n * color=\"danger\"\n * [wrPopconfirm]=\"'Delete this item?'\"\n * confirmColor=\"danger\"\n * confirmText=\"Delete\"\n * (confirmed)=\"remove()\"\n * >Delete</wr-btn>\n * ```\n *\n * @see https://ngwr.dev/reference/components/popconfirm\n */\nlet popconfirmUid = 0;\n\n@Directive({\n selector: '[wrPopconfirm]',\n exportAs: 'wrPopconfirm',\n host: {\n // Marks the trigger the way `[wrPopover]` and `[wrDropdown]` mark theirs. The\n // question is normally BOUND (`[wrPopconfirm]=\"question\"`), which leaves no\n // attribute in the DOM at all, so without this there is nothing to find a\n // trigger by once the panel is shut.\n class: 'wr-popconfirm-trigger',\n '[class.wr-popconfirm-trigger--disabled]': 'disabled()',\n '(click)': 'toggle($event)',\n '(keydown)': 'onTriggerKeydown($event)',\n '[attr.aria-haspopup]': 'disabled() ? null : \"dialog\"',\n '[attr.aria-expanded]': 'disabled() ? null : isOpen()',\n // Names the dialog this trigger opened, as every other overlay trigger in the\n // catalog does. `aria-haspopup=\"dialog\"` promises a dialog and `aria-expanded`\n // says it is showing; without the id, which one is left to guess.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n },\n})\nexport class WrPopconfirm {\n /** Confirmation message. */\n readonly message = input.required<string>({ alias: 'wrPopconfirm' });\n\n /**\n * Anchor side and alignment, the twelve placements `wr-popover` takes; the\n * panel flips to another side when this one has no room.\n * @default 'top'\n */\n readonly position = input<WrPopconfirmPosition>('top');\n\n /** Label for the confirm button. @default 'Confirm' */\n /** Confirm button text. Falls back to `popconfirm.confirm`. */\n readonly confirmText = input<string | null>(null);\n\n /** Label for the cancel button. @default 'Cancel' */\n /** Cancel button text. Falls back to `popconfirm.cancel`. */\n readonly cancelText = input<string | null>(null);\n\n /**\n * Accessible name of the confirmation dialog. `role=\"dialog\"` with no name\n * announces as a bare \"dialog\". Falls back to `popconfirm.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The catalog has carried these translated for as long as the component has\n // existed; the labels were hard-coded English defaults, so a localized app got\n // English buttons with the right strings sitting one file away.\n private readonly resolvedConfirm = useI18nText(this.confirmText, 'popconfirm.confirm', 'Confirm');\n private readonly resolvedCancel = useI18nText(this.cancelText, 'popconfirm.cancel', 'Cancel');\n private readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'popconfirm.label', 'Confirm action');\n\n /** Color of the confirm button. @default 'primary' */\n readonly confirmColor = input<WrColor>('primary');\n\n /**\n * Extra CSS classes for the confirmation bubble's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Where focus goes when the panel opens. `'dialog'` puts it on the panel\n * itself, with no ring, so Tab reaches Cancel and no button is lit;\n * `'first-tabbable'` puts it on Cancel; `false` leaves it on the trigger,\n * and Tab from there walks into the panel. Closing hands focus back to the\n * trigger in every mode.\n *\n * Prefixed because the directive sits on your own element, where an\n * `autoFocus` attribute would also be the native `autofocus`.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrOverlayAutoFocus>('dialog', { alias: 'wrPopconfirmAutoFocus' });\n\n /**\n * Turns the question off: a click on the host opens nothing and is left to\n * propagate, `open()` does nothing, and an open panel closes without\n * `cancelled`. The host publishes no popup ARIA meanwhile and carries\n * `wr-popconfirm-trigger--disabled`.\n *\n * The host's own `disabled` stays yours: the directive never sets it, so the\n * button still takes its own `(click)` — the way to skip the question when\n * there is nothing to confirm.\n *\n * @default false\n */\n readonly disabled = input(false, { alias: 'wrPopconfirmDisabled', transform: coerceBooleanProperty });\n\n /** Fires when the user clicks confirm. */\n readonly confirmed = output<void>();\n\n /** Fires when the user clicks cancel or dismisses the overlay. */\n readonly cancelled = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly focusTraps = inject(FocusTrapFactory);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly openState = signal(false);\n\n /** Whether the popconfirm is open. Read-only: `open()` and `close()` change it. */\n readonly isOpen = this.openState.asReadonly();\n\n private overlayRef: OverlayRef | null = null;\n private finder: FocusTrap | null = null;\n\n private readonly uid = ++popconfirmUid;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-popconfirm-${this.uid}`;\n\n private readonly messageId = `wr-popconfirm-message-${this.uid}`;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n this.destroyRef.onDestroy(() => this.dispose());\n effect(() => {\n if (this.disabled()) this.close();\n });\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n if (this.disabled()) return;\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the panel. Does nothing while the trigger is disabled. */\n open(): void {\n if (this.disabled() || this.overlayRef) return;\n\n // Read ONCE, here, and mirror this list rather than the input: the side is\n // chosen at open and a later `position` write moves nothing, so a follower\n // that re-read the signal would let a direction flip quietly adopt a\n // position the panel never opened with.\n //\n // The list is a fallback CHAIN, each link tagged with its own\n // `wr-popconfirm-overlay--<side>` class, so the panel flips when the side\n // asked for has no room and the arrow names the side it landed on. The\n // viewport margin is `wr-popover`'s, for the same reason: without it a pushed\n // panel parks its border on the glass.\n const positions = wrPopconfirmPositions(this.position());\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(positions, this.isRtl()))\n .withPush(true)\n .withViewportMargin(VIEWPORT_MARGIN);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: wrToClassList('wr-popconfirm-overlay', this.panelClass()),\n });\n\n // `isRtl()` above answered once, at `create()`, and so did the CDK's own\n // capture of the direction — neither is revisited if the app flips while the\n // question is still on screen. Both halves have to move: the `dir` on the\n // host, so `start` / `end` resolve to the other edge, and the mirrored list,\n // because `offsetX` is added to the final PHYSICAL x. Leave the list behind\n // and the 8px gap on `left` / `right` becomes an 8px overlap over the very\n // control the panel is asking about.\n wrFollowDirection(this.overlayRef, this.dir, this.injector, direction =>\n positionStrategy.withPositions(wrMirrorOffsets(positions, direction === 'rtl'))\n );\n\n // Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,\n // so trapping focus would only make it harder to leave. It still needs a role, a\n // name and the question read out as its description.\n const pane = this.overlayRef.overlayElement;\n pane.id = this.panelId;\n pane.setAttribute('role', 'dialog');\n pane.setAttribute('aria-modal', 'false');\n pane.setAttribute('aria-label', this.resolvedAriaLabel());\n pane.setAttribute('aria-describedby', this.messageId);\n pane.tabIndex = -1;\n\n const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);\n const ref = this.overlayRef.attach(portal);\n ref.setInput('message', this.message());\n ref.setInput('messageId', this.messageId);\n ref.setInput('confirmText', this.resolvedConfirm());\n ref.setInput('cancelText', this.resolvedCancel());\n ref.setInput('confirmColor', this.confirmColor());\n ref.changeDetectorRef.detectChanges();\n // Focus has to be able to enter the panel: the overlay container sits at the\n // end of `<body>`, so Tab from the trigger went to the next thing on the PAGE\n // and the only way to confirm was unreachable. It enters on open as\n // `wrPopconfirmAutoFocus` says, and never onto a button unasked: the panel itself by\n // default, Cancel under `'first-tabbable'` (the action being confirmed is\n // usually the destructive one). Under `false` Tab on the trigger walks in,\n // see `onTriggerKeydown`.\n //\n // `deferAnchors`: the trap is only the finder `wrFocusOverlay` asks for. No\n // anchors go into the page and nothing is trapped.\n this.finder = this.focusTraps.create(pane, true);\n wrFocusOverlay(pane, this.finder, this.autoFocus(), this.injector);\n // And it has to LEAVE with the panel: Tab past Confirm went on to the end of\n // `<body>` and Shift+Tab before Cancel to the foot of the page, each with the\n // question still on screen and `aria-expanded` still true. See `onPaneKeydown`.\n pane.addEventListener('keydown', this.onPaneKeydown);\n pane.addEventListener('focusout', this.onPaneFocusOut);\n this.openState.set(true);\n\n ref.instance.confirmed.subscribe(() => {\n this.confirmed.emit();\n this.close();\n });\n ref.instance.cancelled.subscribe(() => this.dismiss());\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.dismiss();\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n close(): void {\n this.dispose();\n }\n\n private dismiss(): void {\n if (!this.overlayRef) return;\n this.cancelled.emit();\n this.dispose();\n }\n\n private dispose(): void {\n if (!this.overlayRef) return;\n // Focus lives inside the panel while it is open, and removing the panel would\n // drop it to `<body>` — hand it back to the trigger instead, as `wr-dropdown`\n // does on Escape. Only when focus is still IN there: if the user has already\n // clicked elsewhere, taking it back would be stealing.\n const pane = this.overlayRef.overlayElement;\n const returnFocus = pane.contains(document.activeElement);\n // Before the dispose: Chromium fires `focusout` for a focused node as it is\n // removed, and the pane is about to be.\n pane.removeEventListener('keydown', this.onPaneKeydown);\n pane.removeEventListener('focusout', this.onPaneFocusOut);\n this.finder?.destroy();\n this.finder = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.openState.set(false);\n if (returnFocus) wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n else wrNoteFocusReturn(this.host.nativeElement);\n }\n\n /**\n * Tab off either end of the panel dismisses it and takes focus back to the\n * trigger — `wr-popover`'s disclosure behaviour, for a non-modal panel whose\n * DOM sits nowhere near its trigger. Leaving is a dismissal, so `cancelled`\n * fires, as it does for Escape and an outside click.\n *\n * Forward, the trigger is focused WITHOUT `preventDefault`, so the browser's\n * own Tab runs on from there and lands on whatever follows the trigger, where a\n * panel rendered in place would have let it go. Backward, the trigger itself is\n * the destination, so the default is stopped. The panel holds two stops, Cancel\n * and Confirm, in that order.\n */\n private readonly onPaneKeydown = (event: KeyboardEvent): void => {\n const pane = this.overlayRef?.overlayElement;\n if (!pane || event.key !== 'Tab' || event.defaultPrevented) return;\n const stops = [...pane.querySelectorAll<HTMLElement>('.wr-popconfirm__action')];\n const active = document.activeElement;\n if (event.shiftKey) {\n if (active !== pane && active !== stops[0]) return;\n event.preventDefault();\n } else if (active !== stops.at(-1)) {\n return;\n }\n wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n this.dismiss();\n };\n\n /**\n * Tab on the trigger while the panel is open walks into it, as it would into a\n * panel rendered beside the trigger. The way in when focus did not move on\n * open (`wrPopconfirmAutoFocus` is `false`).\n *\n * @internal\n */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n const pane = this.overlayRef?.overlayElement;\n if (!pane || event.key !== 'Tab' || event.shiftKey || event.defaultPrevented) return;\n if (event.target !== this.host.nativeElement) return;\n event.preventDefault();\n (pane.querySelector<HTMLElement>('.wr-popconfirm__action') ?? pane).focus();\n }\n\n /**\n * Focus that leaves the panel by any other road (a click on something\n * focusable elsewhere) dismisses it too, and is left where it went. A `null`\n * destination is the window losing focus or a focused node being removed,\n * neither of which is leaving.\n */\n private readonly onPaneFocusOut = (event: FocusEvent): void => {\n const next = event.relatedTarget as Node | null;\n if (!next || this.holdsFocus(next)) return;\n this.dismiss();\n };\n\n /**\n * Whether focus on `node` still belongs to this panel: inside the pane, on the\n * trigger (a press there is about to toggle it), or in an overlay opened AFTER\n * this one — the stacking `wr-popover` and `WrOutsideClick` honour, so a\n * second panel raised by `open()` does not dismiss the first by taking focus.\n */\n private holdsFocus(node: Node): boolean {\n const ref = this.overlayRef;\n if (!ref) return false;\n if (ref.overlayElement.contains(node) || this.host.nativeElement.contains(node)) return true;\n const box = ref.hostElement;\n return (\n (box.parentElement?.contains(node) ?? false) &&\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n (box.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0\n );\n }\n\n /**\n * Whether the app reads right-to-left.\n *\n * Optional inject: `Directionality` is root-provided, so this is never null in\n * an app — but a bare `TestBed` that provides nothing should still get a\n * component that works, and defaulting to LTR is the honest fallback.\n */\n private isRtl(): boolean {\n return this.dir?.value ===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