ngwr 6.1.1 → 7.1.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 (609) hide show
  1. package/LICENSE +1 -3
  2. package/README.md +179 -32
  3. package/affix/styles/_index.scss +12 -0
  4. package/alert/styles/_index.scss +75 -32
  5. package/anchor/styles/_index.scss +59 -0
  6. package/aurora/aurora.scss +1 -0
  7. package/aurora/styles/_index.scss +30 -0
  8. package/avatar/styles/_index.scss +30 -14
  9. package/back-top/styles/_index.scss +42 -0
  10. package/badge/styles/_index.scss +80 -0
  11. package/badge/styles/_tag.scss +81 -0
  12. package/bar-chart/styles/_index.scss +56 -0
  13. package/blur-text/blur-text.scss +1 -0
  14. package/blur-text/styles/_index.scss +14 -0
  15. package/border-glow/border-glow.scss +4 -0
  16. package/border-glow/styles/_index.scss +228 -0
  17. package/breadcrumbs/breadcrumbs.scss +1 -0
  18. package/breadcrumbs/styles/_index.scss +76 -0
  19. package/burger/styles/_index.scss +101 -0
  20. package/button/styles/_index.scss +148 -125
  21. package/calendar/styles/_index.scss +252 -0
  22. package/calendar-heatmap/styles/_index.scss +69 -0
  23. package/card/card.scss +1 -0
  24. package/card/styles/_index.scss +96 -0
  25. package/carousel/styles/_index.scss +102 -0
  26. package/cascader/cascader.scss +1 -0
  27. package/cascader/styles/_index.scss +174 -0
  28. package/checkbox/styles/_index.scss +76 -60
  29. package/circular-text/circular-text.scss +1 -0
  30. package/circular-text/styles/_index.scss +45 -0
  31. package/click-spark/click-spark.scss +1 -0
  32. package/click-spark/styles/_index.scss +16 -0
  33. package/collapse/styles/_index.scss +92 -0
  34. package/color-picker/styles/_index.scss +247 -0
  35. package/command-palette/styles/_index.scss +188 -0
  36. package/compare/styles/_index.scss +100 -0
  37. package/context-menu/styles/_index.scss +112 -0
  38. package/counter/styles/_index.scss +44 -0
  39. package/date-picker/styles/_index.scss +204 -0
  40. package/decrypt-text/decrypt-text.scss +1 -0
  41. package/decrypt-text/styles/_index.scss +26 -0
  42. package/density/styles/_index.scss +37 -0
  43. package/descriptions/styles/_index.scss +104 -0
  44. package/dialog/styles/_index.scss +101 -27
  45. package/divider/styles/_index.scss +43 -24
  46. package/donut-chart/styles/_index.scss +76 -0
  47. package/drag-drop/sortable-list.scss +1 -0
  48. package/drag-drop/styles/_index.scss +99 -0
  49. package/drawer/styles/_index.scss +164 -0
  50. package/dropdown/styles/_index.scss +76 -56
  51. package/empty/styles/_index.scss +49 -0
  52. package/falling-text/falling-text.scss +1 -0
  53. package/falling-text/styles/_index.scss +30 -0
  54. package/fesm2022/ngwr-affix.mjs +102 -0
  55. package/fesm2022/ngwr-affix.mjs.map +1 -0
  56. package/fesm2022/ngwr-alert.mjs +70 -52
  57. package/fesm2022/ngwr-alert.mjs.map +1 -1
  58. package/fesm2022/ngwr-anchor.mjs +103 -0
  59. package/fesm2022/ngwr-anchor.mjs.map +1 -0
  60. package/fesm2022/ngwr-aurora.mjs +309 -0
  61. package/fesm2022/ngwr-aurora.mjs.map +1 -0
  62. package/fesm2022/ngwr-avatar.mjs +81 -71
  63. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  64. package/fesm2022/ngwr-back-top.mjs +81 -0
  65. package/fesm2022/ngwr-back-top.mjs.map +1 -0
  66. package/fesm2022/ngwr-badge.mjs +192 -0
  67. package/fesm2022/ngwr-badge.mjs.map +1 -0
  68. package/fesm2022/ngwr-bar-chart.mjs +69 -0
  69. package/fesm2022/ngwr-bar-chart.mjs.map +1 -0
  70. package/fesm2022/ngwr-blur-text.mjs +181 -0
  71. package/fesm2022/ngwr-blur-text.mjs.map +1 -0
  72. package/fesm2022/ngwr-border-glow.mjs +278 -0
  73. package/fesm2022/ngwr-border-glow.mjs.map +1 -0
  74. package/fesm2022/ngwr-breadcrumbs.mjs +101 -0
  75. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -0
  76. package/fesm2022/ngwr-burger.mjs +60 -0
  77. package/fesm2022/ngwr-burger.mjs.map +1 -0
  78. package/fesm2022/ngwr-button.mjs +179 -104
  79. package/fesm2022/ngwr-button.mjs.map +1 -1
  80. package/fesm2022/ngwr-calendar-heatmap.mjs +145 -0
  81. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -0
  82. package/fesm2022/ngwr-calendar.mjs +402 -0
  83. package/fesm2022/ngwr-calendar.mjs.map +1 -0
  84. package/fesm2022/ngwr-card.mjs +100 -0
  85. package/fesm2022/ngwr-card.mjs.map +1 -0
  86. package/fesm2022/ngwr-carousel.mjs +128 -0
  87. package/fesm2022/ngwr-carousel.mjs.map +1 -0
  88. package/fesm2022/ngwr-cascader.mjs +280 -0
  89. package/fesm2022/ngwr-cascader.mjs.map +1 -0
  90. package/fesm2022/ngwr-checkbox.mjs +214 -54
  91. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  92. package/fesm2022/ngwr-circular-text.mjs +168 -0
  93. package/fesm2022/ngwr-circular-text.mjs.map +1 -0
  94. package/fesm2022/ngwr-click-spark.mjs +163 -0
  95. package/fesm2022/ngwr-click-spark.mjs.map +1 -0
  96. package/fesm2022/ngwr-clipboard.mjs +130 -0
  97. package/fesm2022/ngwr-clipboard.mjs.map +1 -0
  98. package/fesm2022/ngwr-collapse.mjs +232 -0
  99. package/fesm2022/ngwr-collapse.mjs.map +1 -0
  100. package/fesm2022/ngwr-color-picker.mjs +646 -0
  101. package/fesm2022/ngwr-color-picker.mjs.map +1 -0
  102. package/fesm2022/ngwr-command-palette.mjs +259 -0
  103. package/fesm2022/ngwr-command-palette.mjs.map +1 -0
  104. package/fesm2022/ngwr-compare.mjs +137 -0
  105. package/fesm2022/ngwr-compare.mjs.map +1 -0
  106. package/fesm2022/ngwr-confetti.mjs +160 -0
  107. package/fesm2022/ngwr-confetti.mjs.map +1 -0
  108. package/fesm2022/ngwr-context-menu.mjs +653 -0
  109. package/fesm2022/ngwr-context-menu.mjs.map +1 -0
  110. package/fesm2022/ngwr-cookie.mjs +127 -0
  111. package/fesm2022/ngwr-cookie.mjs.map +1 -0
  112. package/fesm2022/ngwr-counter.mjs +415 -0
  113. package/fesm2022/ngwr-counter.mjs.map +1 -0
  114. package/fesm2022/ngwr-date-adapter-fns.mjs +180 -0
  115. package/fesm2022/ngwr-date-adapter-fns.mjs.map +1 -0
  116. package/fesm2022/ngwr-date-adapter-luxon.mjs +201 -0
  117. package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -0
  118. package/fesm2022/ngwr-date-adapter.mjs +419 -0
  119. package/fesm2022/ngwr-date-adapter.mjs.map +1 -0
  120. package/fesm2022/ngwr-date-picker.mjs +624 -0
  121. package/fesm2022/ngwr-date-picker.mjs.map +1 -0
  122. package/fesm2022/ngwr-decrypt-text.mjs +396 -0
  123. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -0
  124. package/fesm2022/ngwr-density.mjs +157 -0
  125. package/fesm2022/ngwr-density.mjs.map +1 -0
  126. package/fesm2022/ngwr-descriptions.mjs +83 -0
  127. package/fesm2022/ngwr-descriptions.mjs.map +1 -0
  128. package/fesm2022/ngwr-dialog.mjs +249 -377
  129. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  130. package/fesm2022/ngwr-directives.mjs +315 -0
  131. package/fesm2022/ngwr-directives.mjs.map +1 -0
  132. package/fesm2022/ngwr-divider.mjs +74 -59
  133. package/fesm2022/ngwr-divider.mjs.map +1 -1
  134. package/fesm2022/ngwr-donut-chart.mjs +131 -0
  135. package/fesm2022/ngwr-donut-chart.mjs.map +1 -0
  136. package/fesm2022/ngwr-drag-drop.mjs +117 -0
  137. package/fesm2022/ngwr-drag-drop.mjs.map +1 -0
  138. package/fesm2022/ngwr-drawer.mjs +315 -0
  139. package/fesm2022/ngwr-drawer.mjs.map +1 -0
  140. package/fesm2022/ngwr-dropdown.mjs +276 -229
  141. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  142. package/fesm2022/ngwr-empty.mjs +57 -0
  143. package/fesm2022/ngwr-empty.mjs.map +1 -0
  144. package/fesm2022/ngwr-falling-text.mjs +316 -0
  145. package/fesm2022/ngwr-falling-text.mjs.map +1 -0
  146. package/fesm2022/ngwr-file-upload.mjs +260 -0
  147. package/fesm2022/ngwr-file-upload.mjs.map +1 -0
  148. package/fesm2022/ngwr-form.mjs +133 -48
  149. package/fesm2022/ngwr-form.mjs.map +1 -1
  150. package/fesm2022/ngwr-fuzzy-text.mjs +373 -0
  151. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -0
  152. package/fesm2022/ngwr-gauge.mjs +83 -0
  153. package/fesm2022/ngwr-gauge.mjs.map +1 -0
  154. package/fesm2022/ngwr-glitch-text.mjs +67 -0
  155. package/fesm2022/ngwr-glitch-text.mjs.map +1 -0
  156. package/fesm2022/ngwr-gradient-text.mjs +109 -0
  157. package/fesm2022/ngwr-gradient-text.mjs.map +1 -0
  158. package/fesm2022/ngwr-hotkey.mjs +263 -0
  159. package/fesm2022/ngwr-hotkey.mjs.map +1 -0
  160. package/fesm2022/ngwr-i18n-en.mjs +168 -0
  161. package/fesm2022/ngwr-i18n-en.mjs.map +1 -0
  162. package/fesm2022/ngwr-i18n-ru.mjs +156 -0
  163. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -0
  164. package/fesm2022/ngwr-i18n.mjs +478 -0
  165. package/fesm2022/ngwr-i18n.mjs.map +1 -0
  166. package/fesm2022/ngwr-icon-adapters-feather.mjs +74 -0
  167. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -0
  168. package/fesm2022/ngwr-icon-adapters-lucide.mjs +88 -0
  169. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -0
  170. package/fesm2022/ngwr-icon.mjs +189 -649
  171. package/fesm2022/ngwr-icon.mjs.map +1 -1
  172. package/fesm2022/ngwr-image-cropper.mjs +299 -0
  173. package/fesm2022/ngwr-image-cropper.mjs.map +1 -0
  174. package/fesm2022/ngwr-input-number.mjs +239 -0
  175. package/fesm2022/ngwr-input-number.mjs.map +1 -0
  176. package/fesm2022/ngwr-input-otp.mjs +216 -0
  177. package/fesm2022/ngwr-input-otp.mjs.map +1 -0
  178. package/fesm2022/ngwr-input.mjs +183 -104
  179. package/fesm2022/ngwr-input.mjs.map +1 -1
  180. package/fesm2022/ngwr-keyboard.mjs +47 -0
  181. package/fesm2022/ngwr-keyboard.mjs.map +1 -0
  182. package/fesm2022/ngwr-knob.mjs +227 -0
  183. package/fesm2022/ngwr-knob.mjs.map +1 -0
  184. package/fesm2022/ngwr-layout.mjs +197 -0
  185. package/fesm2022/ngwr-layout.mjs.map +1 -0
  186. package/fesm2022/ngwr-lightbox.mjs +131 -0
  187. package/fesm2022/ngwr-lightbox.mjs.map +1 -0
  188. package/fesm2022/ngwr-line-chart.mjs +176 -0
  189. package/fesm2022/ngwr-line-chart.mjs.map +1 -0
  190. package/fesm2022/ngwr-list.mjs +132 -0
  191. package/fesm2022/ngwr-list.mjs.map +1 -0
  192. package/fesm2022/ngwr-loading-bar.mjs +160 -0
  193. package/fesm2022/ngwr-loading-bar.mjs.map +1 -0
  194. package/fesm2022/ngwr-marquee.mjs +224 -0
  195. package/fesm2022/ngwr-marquee.mjs.map +1 -0
  196. package/fesm2022/ngwr-media.mjs +132 -0
  197. package/fesm2022/ngwr-media.mjs.map +1 -0
  198. package/fesm2022/ngwr-mention.mjs +374 -0
  199. package/fesm2022/ngwr-mention.mjs.map +1 -0
  200. package/fesm2022/ngwr-meta.mjs +323 -0
  201. package/fesm2022/ngwr-meta.mjs.map +1 -0
  202. package/fesm2022/ngwr-meter-group.mjs +73 -0
  203. package/fesm2022/ngwr-meter-group.mjs.map +1 -0
  204. package/fesm2022/ngwr-overlay.mjs +145 -0
  205. package/fesm2022/ngwr-overlay.mjs.map +1 -0
  206. package/fesm2022/ngwr-page-header.mjs +53 -0
  207. package/fesm2022/ngwr-page-header.mjs.map +1 -0
  208. package/fesm2022/ngwr-pagination.mjs +152 -96
  209. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  210. package/fesm2022/ngwr-pipes.mjs +290 -11
  211. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  212. package/fesm2022/ngwr-platform.mjs +63 -0
  213. package/fesm2022/ngwr-platform.mjs.map +1 -0
  214. package/fesm2022/ngwr-popconfirm.mjs +188 -0
  215. package/fesm2022/ngwr-popconfirm.mjs.map +1 -0
  216. package/fesm2022/ngwr-popover.mjs +365 -0
  217. package/fesm2022/ngwr-popover.mjs.map +1 -0
  218. package/fesm2022/ngwr-progress.mjs +47 -39
  219. package/fesm2022/ngwr-progress.mjs.map +1 -1
  220. package/fesm2022/ngwr-qr.mjs +160 -179
  221. package/fesm2022/ngwr-qr.mjs.map +1 -1
  222. package/fesm2022/ngwr-radio.mjs +204 -0
  223. package/fesm2022/ngwr-radio.mjs.map +1 -0
  224. package/fesm2022/ngwr-rating.mjs +180 -0
  225. package/fesm2022/ngwr-rating.mjs.map +1 -0
  226. package/fesm2022/ngwr-result.mjs +119 -0
  227. package/fesm2022/ngwr-result.mjs.map +1 -0
  228. package/fesm2022/ngwr-rotating-text.mjs +256 -0
  229. package/fesm2022/ngwr-rotating-text.mjs.map +1 -0
  230. package/fesm2022/ngwr-scramble-text.mjs +165 -0
  231. package/fesm2022/ngwr-scramble-text.mjs.map +1 -0
  232. package/fesm2022/ngwr-scroll.mjs +107 -0
  233. package/fesm2022/ngwr-scroll.mjs.map +1 -0
  234. package/fesm2022/ngwr-segmented.mjs +96 -0
  235. package/fesm2022/ngwr-segmented.mjs.map +1 -0
  236. package/fesm2022/ngwr-select.mjs +844 -309
  237. package/fesm2022/ngwr-select.mjs.map +1 -1
  238. package/fesm2022/ngwr-shiny-text.mjs +127 -0
  239. package/fesm2022/ngwr-shiny-text.mjs.map +1 -0
  240. package/fesm2022/ngwr-sidebar.mjs +134 -0
  241. package/fesm2022/ngwr-sidebar.mjs.map +1 -0
  242. package/fesm2022/ngwr-skeleton.mjs +59 -34
  243. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  244. package/fesm2022/ngwr-slider.mjs +234 -0
  245. package/fesm2022/ngwr-slider.mjs.map +1 -0
  246. package/fesm2022/ngwr-sparkline.mjs +104 -0
  247. package/fesm2022/ngwr-sparkline.mjs.map +1 -0
  248. package/fesm2022/ngwr-speed-dial.mjs +79 -0
  249. package/fesm2022/ngwr-speed-dial.mjs.map +1 -0
  250. package/fesm2022/ngwr-spinner.mjs +34 -28
  251. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  252. package/fesm2022/ngwr-splash-cursor.mjs +970 -0
  253. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -0
  254. package/fesm2022/ngwr-split-text.mjs +200 -0
  255. package/fesm2022/ngwr-split-text.mjs.map +1 -0
  256. package/fesm2022/ngwr-splitter.mjs +125 -0
  257. package/fesm2022/ngwr-splitter.mjs.map +1 -0
  258. package/fesm2022/ngwr-spotlight-card.mjs +138 -0
  259. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -0
  260. package/fesm2022/ngwr-squircle.mjs +320 -0
  261. package/fesm2022/ngwr-squircle.mjs.map +1 -0
  262. package/fesm2022/ngwr-star-border.mjs +72 -0
  263. package/fesm2022/ngwr-star-border.mjs.map +1 -0
  264. package/fesm2022/ngwr-statistic.mjs +220 -0
  265. package/fesm2022/ngwr-statistic.mjs.map +1 -0
  266. package/fesm2022/ngwr-stepper.mjs +186 -0
  267. package/fesm2022/ngwr-stepper.mjs.map +1 -0
  268. package/fesm2022/ngwr-storage.mjs +317 -0
  269. package/fesm2022/ngwr-storage.mjs.map +1 -0
  270. package/fesm2022/ngwr-switch.mjs +99 -0
  271. package/fesm2022/ngwr-switch.mjs.map +1 -0
  272. package/fesm2022/ngwr-table.mjs +217 -206
  273. package/fesm2022/ngwr-table.mjs.map +1 -1
  274. package/fesm2022/ngwr-tabs.mjs +217 -0
  275. package/fesm2022/ngwr-tabs.mjs.map +1 -0
  276. package/fesm2022/ngwr-textarea.mjs +106 -120
  277. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  278. package/fesm2022/ngwr-theme.mjs +152 -0
  279. package/fesm2022/ngwr-theme.mjs.map +1 -0
  280. package/fesm2022/ngwr-tilt-card.mjs +137 -0
  281. package/fesm2022/ngwr-tilt-card.mjs.map +1 -0
  282. package/fesm2022/ngwr-timeline.mjs +73 -0
  283. package/fesm2022/ngwr-timeline.mjs.map +1 -0
  284. package/fesm2022/ngwr-toast.mjs +446 -0
  285. package/fesm2022/ngwr-toast.mjs.map +1 -0
  286. package/fesm2022/ngwr-toolbar.mjs +46 -0
  287. package/fesm2022/ngwr-toolbar.mjs.map +1 -0
  288. package/fesm2022/ngwr-tree.mjs +483 -0
  289. package/fesm2022/ngwr-tree.mjs.map +1 -0
  290. package/fesm2022/ngwr-typewriter.mjs +229 -0
  291. package/fesm2022/ngwr-typewriter.mjs.map +1 -0
  292. package/fesm2022/ngwr-typography.mjs +79 -0
  293. package/fesm2022/ngwr-typography.mjs.map +1 -0
  294. package/fesm2022/ngwr-utils.mjs +535 -0
  295. package/fesm2022/ngwr-utils.mjs.map +1 -0
  296. package/fesm2022/ngwr-validators.mjs +214 -0
  297. package/fesm2022/ngwr-validators.mjs.map +1 -0
  298. package/fesm2022/ngwr-version.mjs +51 -0
  299. package/fesm2022/ngwr-version.mjs.map +1 -0
  300. package/fesm2022/ngwr-virtual-scroll.mjs +99 -0
  301. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -0
  302. package/fesm2022/ngwr-waves.mjs +356 -0
  303. package/fesm2022/ngwr-waves.mjs.map +1 -0
  304. package/fesm2022/ngwr-window.mjs +1141 -0
  305. package/fesm2022/ngwr-window.mjs.map +1 -0
  306. package/fesm2022/ngwr.mjs +0 -3
  307. package/fesm2022/ngwr.mjs.map +1 -1
  308. package/file-upload/styles/_index.scss +152 -0
  309. package/form/styles/_index.scss +85 -42
  310. package/gauge/styles/_index.scss +37 -0
  311. package/glitch-text/glitch-text.scss +1 -0
  312. package/glitch-text/styles/_index.scss +144 -0
  313. package/gradient-text/gradient-text.scss +1 -0
  314. package/gradient-text/styles/_index.scss +113 -0
  315. package/icon/styles/_index.scss +21 -15
  316. package/image-cropper/styles/_index.scss +114 -0
  317. package/input/styles/_index.scss +133 -93
  318. package/input-number/styles/_index.scss +75 -0
  319. package/input-otp/styles/_index.scss +53 -0
  320. package/keyboard/styles/_index.scss +55 -0
  321. package/knob/styles/_index.scss +54 -0
  322. package/layout/styles/_index.scss +65 -0
  323. package/lightbox/lightbox.scss +1 -0
  324. package/lightbox/styles/_index.scss +144 -0
  325. package/line-chart/styles/_index.scss +93 -0
  326. package/list/list.scss +1 -0
  327. package/list/styles/_index.scss +101 -0
  328. package/loading-bar/loading-bar.scss +1 -0
  329. package/loading-bar/styles/_index.scss +29 -0
  330. package/marquee/marquee.scss +1 -0
  331. package/marquee/styles/_index.scss +138 -0
  332. package/mention/styles/_index.scss +47 -0
  333. package/meter-group/styles/_index.scss +61 -0
  334. package/package.json +586 -104
  335. package/page-header/styles/_index.scss +78 -0
  336. package/pagination/styles/_index.scss +89 -34
  337. package/popconfirm/styles/_index.scss +32 -0
  338. package/popover/styles/_index.scss +99 -0
  339. package/progress/styles/_index.scss +29 -14
  340. package/qr/styles/_index.scss +6 -3
  341. package/radio/styles/_index.scss +111 -0
  342. package/rating/styles/_index.scss +63 -0
  343. package/result/styles/_index.scss +69 -0
  344. package/rotating-text/rotating-text.scss +1 -0
  345. package/rotating-text/styles/_index.scss +39 -0
  346. package/schematics/collection.json +37 -0
  347. package/schematics/component-style/index.js +49 -0
  348. package/{cdk/utils/index.d.ts → schematics/component-style/schema.js} +2 -8
  349. package/schematics/component-style/schema.json +20 -0
  350. package/schematics/icon-set/index.js +96 -0
  351. package/schematics/icon-set/schema.js +8 -0
  352. package/schematics/icon-set/schema.json +39 -0
  353. package/schematics/migrations/v7/index.js +187 -0
  354. package/schematics/migrations.json +10 -0
  355. package/schematics/ng-add/index.js +180 -0
  356. package/schematics/ng-add/schema.js +8 -0
  357. package/schematics/ng-add/schema.json +80 -0
  358. package/schematics/page/index.js +63 -0
  359. package/schematics/page/schema.js +8 -0
  360. package/schematics/page/schema.json +39 -0
  361. package/schematics/page/templates.js +198 -0
  362. package/schematics/provider/index.js +126 -0
  363. package/schematics/provider/schema.js +8 -0
  364. package/schematics/provider/schema.json +52 -0
  365. package/schematics/use/index.js +143 -0
  366. package/schematics/use/schema.js +8 -0
  367. package/schematics/use/schema.json +25 -0
  368. package/schematics/use/symbol-map.json +357 -0
  369. package/scramble-text/scramble-text.scss +1 -0
  370. package/scramble-text/styles/_index.scss +8 -0
  371. package/segmented/styles/_index.scss +92 -0
  372. package/select/styles/_index.scss +245 -159
  373. package/shiny-text/shiny-text.scss +1 -0
  374. package/shiny-text/styles/_index.scss +101 -0
  375. package/sidebar/styles/_index.scss +208 -0
  376. package/skeleton/styles/_index.scss +33 -33
  377. package/slider/styles/_index.scss +77 -0
  378. package/sparkline/styles/_index.scss +9 -0
  379. package/speed-dial/styles/_index.scss +158 -0
  380. package/spinner/styles/_index.scss +38 -22
  381. package/splash-cursor/splash-cursor.scss +1 -0
  382. package/splash-cursor/styles/_index.scss +27 -0
  383. package/split-text/split-text.scss +1 -0
  384. package/split-text/styles/_index.scss +22 -0
  385. package/splitter/styles/_index.scss +85 -0
  386. package/spotlight-card/spotlight-card.scss +1 -0
  387. package/spotlight-card/styles/_index.scss +43 -0
  388. package/squircle/styles/_index.scss +34 -0
  389. package/star-border/star-border.scss +1 -0
  390. package/star-border/styles/_index.scss +118 -0
  391. package/statistic/styles/_index.scss +54 -0
  392. package/stepper/styles/_index.scss +162 -0
  393. package/styles/_animations.scss +198 -0
  394. package/styles/_breakpoints.scss +75 -0
  395. package/styles/_grid.scss +71 -0
  396. package/styles/_reset.scss +123 -0
  397. package/styles/_typography.scss +122 -0
  398. package/styles.scss +103 -13
  399. package/switch/styles/_index.scss +82 -0
  400. package/table/styles/_index.scss +255 -4
  401. package/tabs/styles/_index.scss +71 -0
  402. package/textarea/styles/_index.scss +47 -56
  403. package/theme/styles/_colors.scss +83 -0
  404. package/theme/styles/_dark.scss +85 -0
  405. package/theme/styles/_focus.scss +93 -0
  406. package/theme/styles/_index.scss +5 -0
  407. package/theme/styles/_mixins.scss +57 -0
  408. package/theme/styles/_variables.scss +118 -0
  409. package/tilt-card/styles/_index.scss +40 -0
  410. package/tilt-card/tilt-card.scss +1 -0
  411. package/timeline/styles/_index.scss +127 -0
  412. package/toast/styles/_index.scss +263 -0
  413. package/toolbar/styles/_index.scss +65 -0
  414. package/tree/styles/_index.scss +271 -0
  415. package/types/ngwr-affix.d.ts +43 -0
  416. package/types/ngwr-alert.d.ts +68 -0
  417. package/types/ngwr-anchor.d.ts +53 -0
  418. package/types/ngwr-aurora.d.ts +52 -0
  419. package/types/ngwr-avatar.d.ts +90 -0
  420. package/types/ngwr-back-top.d.ts +37 -0
  421. package/types/ngwr-badge.d.ts +158 -0
  422. package/types/ngwr-bar-chart.d.ts +47 -0
  423. package/types/ngwr-blur-text.d.ts +62 -0
  424. package/types/ngwr-border-glow.d.ts +66 -0
  425. package/types/ngwr-breadcrumbs.d.ts +61 -0
  426. package/types/ngwr-burger.d.ts +36 -0
  427. package/types/ngwr-button.d.ts +176 -0
  428. package/types/ngwr-calendar-heatmap.d.ts +58 -0
  429. package/types/ngwr-calendar.d.ts +116 -0
  430. package/types/ngwr-card.d.ts +50 -0
  431. package/types/ngwr-carousel.d.ts +57 -0
  432. package/types/ngwr-cascader.d.ts +107 -0
  433. package/types/ngwr-checkbox.d.ts +139 -0
  434. package/types/ngwr-circular-text.d.ts +49 -0
  435. package/types/ngwr-click-spark.d.ts +52 -0
  436. package/types/ngwr-clipboard.d.ts +53 -0
  437. package/types/ngwr-collapse.d.ts +139 -0
  438. package/types/ngwr-color-picker.d.ts +302 -0
  439. package/types/ngwr-command-palette.d.ts +113 -0
  440. package/types/ngwr-compare.d.ts +55 -0
  441. package/types/ngwr-confetti.d.ts +70 -0
  442. package/types/ngwr-context-menu.d.ts +207 -0
  443. package/types/ngwr-cookie.d.ts +60 -0
  444. package/types/ngwr-counter.d.ts +182 -0
  445. package/types/ngwr-date-adapter-fns.d.ts +73 -0
  446. package/types/ngwr-date-adapter-luxon.d.ts +73 -0
  447. package/types/ngwr-date-adapter.d.ts +198 -0
  448. package/types/ngwr-date-picker.d.ts +117 -0
  449. package/types/ngwr-decrypt-text.d.ts +85 -0
  450. package/types/ngwr-density.d.ts +97 -0
  451. package/types/ngwr-descriptions.d.ts +41 -0
  452. package/types/ngwr-dialog.d.ts +210 -0
  453. package/types/ngwr-directives.d.ts +125 -0
  454. package/types/ngwr-divider.d.ts +73 -0
  455. package/types/ngwr-donut-chart.d.ts +53 -0
  456. package/types/ngwr-drag-drop.d.ts +83 -0
  457. package/types/ngwr-drawer.d.ts +155 -0
  458. package/types/ngwr-dropdown.d.ts +124 -0
  459. package/types/ngwr-empty.d.ts +38 -0
  460. package/types/ngwr-falling-text.d.ts +63 -0
  461. package/types/ngwr-file-upload.d.ts +94 -0
  462. package/types/ngwr-form.d.ts +95 -0
  463. package/types/ngwr-fuzzy-text.d.ts +74 -0
  464. package/types/ngwr-gauge.d.ts +39 -0
  465. package/types/ngwr-glitch-text.d.ts +31 -0
  466. package/types/ngwr-gradient-text.d.ts +46 -0
  467. package/types/ngwr-hotkey.d.ts +142 -0
  468. package/types/ngwr-i18n-en.d.ts +18 -0
  469. package/types/ngwr-i18n-ru.d.ts +6 -0
  470. package/types/ngwr-i18n.d.ts +336 -0
  471. package/types/ngwr-icon-adapters-feather.d.ts +44 -0
  472. package/types/ngwr-icon-adapters-lucide.d.ts +54 -0
  473. package/types/ngwr-icon.d.ts +180 -0
  474. package/types/ngwr-image-cropper.d.ts +110 -0
  475. package/types/ngwr-input-number.d.ts +77 -0
  476. package/types/ngwr-input-otp.d.ts +78 -0
  477. package/types/ngwr-input.d.ts +131 -0
  478. package/types/ngwr-keyboard.d.ts +34 -0
  479. package/types/ngwr-knob.d.ts +77 -0
  480. package/types/ngwr-layout.d.ts +89 -0
  481. package/types/ngwr-lightbox.d.ts +50 -0
  482. package/types/ngwr-line-chart.d.ts +90 -0
  483. package/types/ngwr-list.d.ts +71 -0
  484. package/types/ngwr-loading-bar.d.ts +79 -0
  485. package/types/ngwr-marquee.d.ts +95 -0
  486. package/types/ngwr-media.d.ts +74 -0
  487. package/types/ngwr-mention.d.ts +110 -0
  488. package/types/ngwr-meta.d.ts +188 -0
  489. package/types/ngwr-meter-group.d.ts +57 -0
  490. package/types/ngwr-overlay.d.ts +110 -0
  491. package/types/ngwr-page-header.d.ts +35 -0
  492. package/types/ngwr-pagination.d.ts +119 -0
  493. package/types/ngwr-pipes.d.ts +177 -0
  494. package/types/ngwr-platform.d.ts +38 -0
  495. package/types/ngwr-popconfirm.d.ts +79 -0
  496. package/types/ngwr-popover.d.ts +90 -0
  497. package/types/ngwr-progress.d.ts +33 -0
  498. package/types/ngwr-qr.d.ts +56 -0
  499. package/types/ngwr-radio.d.ts +120 -0
  500. package/types/ngwr-rating.d.ts +62 -0
  501. package/types/ngwr-result.d.ts +64 -0
  502. package/types/ngwr-rotating-text.d.ts +72 -0
  503. package/types/ngwr-scramble-text.d.ts +49 -0
  504. package/types/ngwr-scroll.d.ts +65 -0
  505. package/types/ngwr-segmented.d.ts +65 -0
  506. package/types/ngwr-select.d.ts +413 -0
  507. package/types/ngwr-shiny-text.d.ts +70 -0
  508. package/types/ngwr-sidebar.d.ts +83 -0
  509. package/types/ngwr-skeleton.d.ts +41 -0
  510. package/types/ngwr-slider.d.ts +86 -0
  511. package/types/ngwr-sparkline.d.ts +48 -0
  512. package/types/ngwr-speed-dial.d.ts +51 -0
  513. package/types/ngwr-spinner.d.ts +41 -0
  514. package/types/ngwr-splash-cursor.d.ts +94 -0
  515. package/types/ngwr-split-text.d.ts +83 -0
  516. package/types/ngwr-splitter.d.ts +52 -0
  517. package/types/ngwr-spotlight-card.d.ts +71 -0
  518. package/types/ngwr-squircle.d.ts +132 -0
  519. package/types/ngwr-star-border.d.ts +40 -0
  520. package/types/ngwr-statistic.d.ts +88 -0
  521. package/types/ngwr-stepper.d.ts +99 -0
  522. package/types/ngwr-storage.d.ts +178 -0
  523. package/types/ngwr-switch.d.ts +39 -0
  524. package/types/ngwr-table.d.ts +237 -0
  525. package/types/ngwr-tabs.d.ts +125 -0
  526. package/types/ngwr-textarea.d.ts +60 -0
  527. package/types/ngwr-theme.d.ts +124 -0
  528. package/types/ngwr-tilt-card.d.ts +63 -0
  529. package/types/ngwr-timeline.d.ts +40 -0
  530. package/types/ngwr-toast.d.ts +230 -0
  531. package/types/ngwr-toolbar.d.ts +30 -0
  532. package/types/ngwr-tree.d.ts +150 -0
  533. package/types/ngwr-typewriter.d.ts +84 -0
  534. package/types/ngwr-typography.d.ts +56 -0
  535. package/types/ngwr-utils.d.ts +447 -0
  536. package/types/ngwr-validators.d.ts +70 -0
  537. package/types/ngwr-version.d.ts +44 -0
  538. package/types/ngwr-virtual-scroll.d.ts +64 -0
  539. package/types/ngwr-waves.d.ts +71 -0
  540. package/types/ngwr-window.d.ts +437 -0
  541. package/typewriter/styles/_index.scss +33 -0
  542. package/typewriter/typewriter.scss +1 -0
  543. package/typography/styles/_index.scss +211 -0
  544. package/virtual-scroll/styles/_index.scss +27 -0
  545. package/virtual-scroll/virtual-scroll.scss +1 -0
  546. package/waves/styles/_index.scss +24 -0
  547. package/waves/waves.scss +1 -0
  548. package/window/styles/_index.scss +430 -0
  549. package/alert/index.d.ts +0 -32
  550. package/alert/styles/theming.scss +0 -26
  551. package/alert/styles/vars.scss +0 -11
  552. package/avatar/index.d.ts +0 -30
  553. package/button/index.d.ts +0 -45
  554. package/button/styles/vars.scss +0 -13
  555. package/cdk/index.d.ts +0 -24
  556. package/cdk/rxjs/index.d.ts +0 -40
  557. package/cdk/types/index.d.ts +0 -27
  558. package/checkbox/index.d.ts +0 -31
  559. package/checkbox/styles/vars.scss +0 -16
  560. package/dialog/index.d.ts +0 -193
  561. package/dialog/styles/vars.scss +0 -7
  562. package/divider/index.d.ts +0 -16
  563. package/dropdown/index.d.ts +0 -68
  564. package/dropdown/styles/vars.scss +0 -18
  565. package/fesm2022/ngwr-cdk-rxjs.mjs +0 -53
  566. package/fesm2022/ngwr-cdk-rxjs.mjs.map +0 -1
  567. package/fesm2022/ngwr-cdk-types.mjs +0 -44
  568. package/fesm2022/ngwr-cdk-types.mjs.map +0 -1
  569. package/fesm2022/ngwr-cdk-utils.mjs +0 -30
  570. package/fesm2022/ngwr-cdk-utils.mjs.map +0 -1
  571. package/fesm2022/ngwr-cdk.mjs +0 -46
  572. package/fesm2022/ngwr-cdk.mjs.map +0 -1
  573. package/fesm2022/ngwr-tag.mjs +0 -87
  574. package/fesm2022/ngwr-tag.mjs.map +0 -1
  575. package/form/index.d.ts +0 -28
  576. package/icon/index.d.ts +0 -830
  577. package/icon/styles/vars.scss +0 -3
  578. package/input/index.d.ts +0 -43
  579. package/input/styles/vars.scss +0 -17
  580. package/pagination/index.d.ts +0 -34
  581. package/pagination/styles/vars.scss +0 -14
  582. package/pipes/index.d.ts +0 -17
  583. package/progress/index.d.ts +0 -13
  584. package/progress/styles/theming.scss +0 -8
  585. package/progress/styles/vars.scss +0 -6
  586. package/qr/index.d.ts +0 -127
  587. package/select/index.d.ts +0 -121
  588. package/select/styles/vars.scss +0 -32
  589. package/skeleton/index.d.ts +0 -13
  590. package/spinner/index.d.ts +0 -23
  591. package/styles/animations.scss +0 -92
  592. package/styles/cdk.scss +0 -5
  593. package/styles/colors.scss +0 -72
  594. package/styles/grid.scss +0 -99
  595. package/styles/maps.scss +0 -31
  596. package/styles/reset.scss +0 -112
  597. package/styles/variables.scss +0 -72
  598. package/table/index.d.ts +0 -101
  599. package/table/styles/table-filter.scss +0 -202
  600. package/table/styles/table-sort.scss +0 -47
  601. package/table/styles/table.scss +0 -232
  602. package/table/styles/vars.scss +0 -21
  603. package/tag/index.d.ts +0 -24
  604. package/tag/styles/_index.scss +0 -32
  605. package/tag/styles/theming.scss +0 -21
  606. package/tag/styles/vars.scss +0 -12
  607. package/textarea/index.d.ts +0 -47
  608. package/textarea/styles/vars.scss +0 -17
  609. /package/{index.d.ts → types/ngwr.d.ts} +0 -0
@@ -0,0 +1,220 @@
1
+ import { coerceNumberProperty } from '@angular/cdk/coercion';
2
+ import * as i0 from '@angular/core';
3
+ import { input, computed, ViewEncapsulation, Component, output, inject, DestroyRef, PLATFORM_ID, signal, effect, afterNextRender } from '@angular/core';
4
+ import { isPlatformBrowser } from '@angular/common';
5
+
6
+ /**
7
+ * @license
8
+ *
9
+ * Use of this source code is governed by an MIT-style license that can be
10
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
11
+ */
12
+ /**
13
+ * KPI card — label + big number + optional prefix/suffix + delta. Pair
14
+ * with a layout grid for dashboards.
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <wr-statistic label="Active users" [value]="12345" suffix="users" />
19
+ * <wr-statistic label="Revenue" [value]="9512" prefix="$" [delta]="12.4" />
20
+ * ```
21
+ *
22
+ * @see https://ngwr.dev/components/statistic
23
+ */
24
+ class WrStatistic {
25
+ label = input('', /* @ts-ignore */
26
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
27
+ /** The number (or string) to display in the main slot. */
28
+ value = input(null, /* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
30
+ /** Prefix glyph / symbol (e.g. `'$'`). */
31
+ prefix = input('', /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "prefix" }] : /* istanbul ignore next */ []));
33
+ /** Suffix glyph / unit (e.g. `'%'`, `'kg'`). */
34
+ suffix = input('', /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "suffix" }] : /* istanbul ignore next */ []));
36
+ /**
37
+ * Optional delta vs previous period — shown as `+x.x%` (or `-x.x%`).
38
+ * Use `deltaSuffix` to change the trailing unit.
39
+ */
40
+ delta = input(null, { ...(ngDevMode ? { debugName: "delta" } : /* istanbul ignore next */ {}), transform: (v) => {
41
+ if (v === null || v === undefined || v === '')
42
+ return null;
43
+ const n = coerceNumberProperty(v, Number.NaN);
44
+ return Number.isFinite(n) ? n : null;
45
+ } });
46
+ /** Unit appended to the delta value. @default '%' */
47
+ deltaSuffix = input('%', /* @ts-ignore */
48
+ ...(ngDevMode ? [{ debugName: "deltaSuffix" }] : /* istanbul ignore next */ []));
49
+ hasDelta = computed(() => this.delta() !== null, /* @ts-ignore */
50
+ ...(ngDevMode ? [{ debugName: "hasDelta" }] : /* istanbul ignore next */ []));
51
+ deltaDirection = computed(() => {
52
+ const d = this.delta();
53
+ if (d === null || d === 0)
54
+ return 'flat';
55
+ return d > 0 ? 'up' : 'down';
56
+ }, /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "deltaDirection" }] : /* istanbul ignore next */ []));
58
+ deltaText = computed(() => {
59
+ const d = this.delta();
60
+ if (d === null)
61
+ return '';
62
+ const sign = d > 0 ? '+' : '';
63
+ return `${sign}${d}${this.deltaSuffix()}`;
64
+ }, /* @ts-ignore */
65
+ ...(ngDevMode ? [{ debugName: "deltaText" }] : /* istanbul ignore next */ []));
66
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStatistic, deps: [], target: i0.ɵɵFactoryTarget.Component });
67
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: WrStatistic, isStandalone: true, selector: "wr-statistic", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, delta: { classPropertyName: "delta", publicName: "delta", isSignal: true, isRequired: false, transformFunction: null }, deltaSuffix: { classPropertyName: "deltaSuffix", publicName: "deltaSuffix", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-statistic" }, ngImport: i0, template: "@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n @if (prefix()) {\n <span class=\"wr-statistic__prefix\">{{ prefix() }}</span>\n }\n <span class=\"wr-statistic__number\">{{ value() ?? '\u2014' }}</span>\n @if (suffix()) {\n <span class=\"wr-statistic__suffix\">{{ suffix() }}</span>\n }\n</div>\n@if (hasDelta()) {\n <div [class]=\"`wr-statistic__delta wr-statistic__delta--${deltaDirection()}`\">\n @if (deltaDirection() === 'up') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 1 L9 8 L1 8 Z\" fill=\"currentColor\" />\n </svg>\n } @else if (deltaDirection() === 'down') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 9 L9 2 L1 2 Z\" fill=\"currentColor\" />\n </svg>\n }\n <span>{{ deltaText() }}</span>\n </div>\n}\n", encapsulation: i0.ViewEncapsulation.None });
68
+ }
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStatistic, decorators: [{
70
+ type: Component,
71
+ args: [{ selector: 'wr-statistic', encapsulation: ViewEncapsulation.None, host: { class: 'wr-statistic' }, template: "@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n @if (prefix()) {\n <span class=\"wr-statistic__prefix\">{{ prefix() }}</span>\n }\n <span class=\"wr-statistic__number\">{{ value() ?? '\u2014' }}</span>\n @if (suffix()) {\n <span class=\"wr-statistic__suffix\">{{ suffix() }}</span>\n }\n</div>\n@if (hasDelta()) {\n <div [class]=\"`wr-statistic__delta wr-statistic__delta--${deltaDirection()}`\">\n @if (deltaDirection() === 'up') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 1 L9 8 L1 8 Z\" fill=\"currentColor\" />\n </svg>\n } @else if (deltaDirection() === 'down') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 9 L9 2 L1 2 Z\" fill=\"currentColor\" />\n </svg>\n }\n <span>{{ deltaText() }}</span>\n </div>\n}\n" }]
72
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], delta: [{ type: i0.Input, args: [{ isSignal: true, alias: "delta", required: false }] }], deltaSuffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "deltaSuffix", required: false }] }] } });
73
+
74
+ /**
75
+ * @license
76
+ *
77
+ * Use of this source code is governed by an MIT-style license that can be
78
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
79
+ */
80
+ // Helpers
81
+ function toMs(value) {
82
+ if (value instanceof Date)
83
+ return value.getTime();
84
+ if (typeof value === 'number')
85
+ return value;
86
+ return new Date(value).getTime();
87
+ }
88
+ function pad(n, width) {
89
+ return String(n).padStart(width, '0');
90
+ }
91
+ function formatRemaining(ms, fmt) {
92
+ const days = Math.floor(ms / 86_400_000);
93
+ const hours = Math.floor((ms % 86_400_000) / 3_600_000);
94
+ const minutes = Math.floor((ms % 3_600_000) / 60_000);
95
+ const seconds = Math.floor((ms % 60_000) / 1000);
96
+ const millis = ms % 1000;
97
+ // Single-pass tokenizer so we never re-scan output for tokens. The
98
+ // previous sequential `.replace()` chain leaked: e.g. `D days HH:mm:ss`
99
+ // → `1 day42 11:59:42` because the `/s/g` step at the end re-matched
100
+ // the literal `s` inside `days`. Longest-token-first ordering inside
101
+ // the alternation handles `DD`>`D`, `HH`>`H`, `mm`>`m`, `SSS`>`ss`>`s`.
102
+ return fmt.replace(/(?<![A-Za-z])(?:SSS|DD|HH|mm|ss|D|H|m|s)(?![A-Za-z])/g, token => {
103
+ switch (token) {
104
+ case 'DD':
105
+ return pad(days, 2);
106
+ case 'D':
107
+ return String(days);
108
+ case 'HH':
109
+ return pad(hours, 2);
110
+ case 'H':
111
+ return String(hours);
112
+ case 'mm':
113
+ return pad(minutes, 2);
114
+ case 'm':
115
+ return String(minutes);
116
+ case 'ss':
117
+ return pad(seconds, 2);
118
+ case 's':
119
+ return String(seconds);
120
+ case 'SSS':
121
+ return pad(millis, 3);
122
+ default:
123
+ return token;
124
+ }
125
+ });
126
+ }
127
+ /**
128
+ * Live-counting variant of `<wr-statistic>` that targets a future date
129
+ * and ticks down to zero. The format string uses Day/Hour/Minute/Second
130
+ * tokens (`D`, `H`, `m`, `s`, double for zero-padded, plus `SSS` for
131
+ * milliseconds).
132
+ *
133
+ * @example
134
+ * ```html
135
+ * <wr-statistic-countdown
136
+ * label="Launch in"
137
+ * [target]="launchDate"
138
+ * format="D days HH:mm:ss"
139
+ * (countdownEnd)="onLive()"
140
+ * />
141
+ * ```
142
+ *
143
+ * @see https://ngwr.dev/components/statistic
144
+ */
145
+ class WrStatisticCountdown {
146
+ /** Target date / timestamp the countdown is running down to. */
147
+ target = input.required(/* @ts-ignore */
148
+ ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
149
+ /** Label rendered above the value. */
150
+ label = input('', /* @ts-ignore */
151
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
152
+ /**
153
+ * Format string. Tokens: `D`/`DD` (days), `H`/`HH` (hours),
154
+ * `m`/`mm` (minutes), `s`/`ss` (seconds), `SSS` (milliseconds).
155
+ * Double-letter forms zero-pad to width 2. @default 'HH:mm:ss'
156
+ */
157
+ format = input('HH:mm:ss', /* @ts-ignore */
158
+ ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
159
+ /** Optional text shown once the countdown reaches zero. */
160
+ endText = input(null, /* @ts-ignore */
161
+ ...(ngDevMode ? [{ debugName: "endText" }] : /* istanbul ignore next */ []));
162
+ /**
163
+ * Tick interval in ms. Drop to ~16 for `SSS` (millisecond display).
164
+ * @default 1000
165
+ */
166
+ tickMs = input(1000, /* @ts-ignore */
167
+ ...(ngDevMode ? [{ debugName: "tickMs" }] : /* istanbul ignore next */ []));
168
+ /** Fires once when the countdown crosses zero. */
169
+ countdownEnd = output();
170
+ destroyRef = inject(DestroyRef);
171
+ isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
172
+ targetMs = computed(() => toMs(this.target()), /* @ts-ignore */
173
+ ...(ngDevMode ? [{ debugName: "targetMs" }] : /* istanbul ignore next */ []));
174
+ /** Remaining milliseconds (live signal). */
175
+ remaining = signal(0, /* @ts-ignore */
176
+ ...(ngDevMode ? [{ debugName: "remaining" }] : /* istanbul ignore next */ []));
177
+ finished = signal(false, /* @ts-ignore */
178
+ ...(ngDevMode ? [{ debugName: "finished" }] : /* istanbul ignore next */ []));
179
+ display = computed(() => {
180
+ if (this.finished() && this.endText() != null)
181
+ return this.endText();
182
+ return formatRemaining(this.remaining(), this.format());
183
+ }, /* @ts-ignore */
184
+ ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
185
+ constructor() {
186
+ // Seed once synchronously so SSR / first paint shows a sane value.
187
+ effect(() => {
188
+ const ms = Math.max(0, this.targetMs() - Date.now());
189
+ this.remaining.set(ms);
190
+ this.finished.set(ms === 0);
191
+ });
192
+ if (!this.isBrowser)
193
+ return;
194
+ afterNextRender(() => {
195
+ const handle = setInterval(() => this.tick(), this.tickMs());
196
+ this.destroyRef.onDestroy(() => clearInterval(handle));
197
+ });
198
+ }
199
+ tick() {
200
+ const ms = Math.max(0, this.targetMs() - Date.now());
201
+ this.remaining.set(ms);
202
+ if (ms === 0 && !this.finished()) {
203
+ this.finished.set(true);
204
+ this.countdownEnd.emit();
205
+ }
206
+ }
207
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStatisticCountdown, deps: [], target: i0.ɵɵFactoryTarget.Component });
208
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: WrStatisticCountdown, isStandalone: true, selector: "wr-statistic-countdown", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, endText: { classPropertyName: "endText", publicName: "endText", isSignal: true, isRequired: false, transformFunction: null }, tickMs: { classPropertyName: "tickMs", publicName: "tickMs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { countdownEnd: "countdownEnd" }, host: { classAttribute: "wr-statistic" }, ngImport: i0, template: "@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n <span class=\"wr-statistic__number\">{{ display() }}</span>\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
209
+ }
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStatisticCountdown, decorators: [{
211
+ type: Component,
212
+ args: [{ selector: 'wr-statistic-countdown', encapsulation: ViewEncapsulation.None, host: { class: 'wr-statistic' }, template: "@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n <span class=\"wr-statistic__number\">{{ display() }}</span>\n</div>\n" }]
213
+ }], ctorParameters: () => [], propDecorators: { target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], endText: [{ type: i0.Input, args: [{ isSignal: true, alias: "endText", required: false }] }], tickMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickMs", required: false }] }], countdownEnd: [{ type: i0.Output, args: ["countdownEnd"] }] } });
214
+
215
+ /**
216
+ * Generated bundle index. Do not edit.
217
+ */
218
+
219
+ export { WrStatistic, WrStatisticCountdown };
220
+ //# sourceMappingURL=ngwr-statistic.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-statistic.mjs","sources":["../../../projects/lib/statistic/statistic.ts","../../../projects/lib/statistic/statistic.html","../../../projects/lib/statistic/statistic-countdown.ts","../../../projects/lib/statistic/statistic-countdown.html","../../../projects/lib/statistic/ngwr-statistic.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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\n/**\n * KPI card — label + big number + optional prefix/suffix + delta. Pair\n * with a layout grid for dashboards.\n *\n * @example\n * ```html\n * <wr-statistic label=\"Active users\" [value]=\"12345\" suffix=\"users\" />\n * <wr-statistic label=\"Revenue\" [value]=\"9512\" prefix=\"$\" [delta]=\"12.4\" />\n * ```\n *\n * @see https://ngwr.dev/components/statistic\n */\n@Component({\n selector: 'wr-statistic',\n templateUrl: './statistic.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-statistic' },\n})\nexport class WrStatistic {\n readonly label = input<string>('');\n\n /** The number (or string) to display in the main slot. */\n readonly value = input<number | string | null>(null);\n\n /** Prefix glyph / symbol (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Suffix glyph / unit (e.g. `'%'`, `'kg'`). */\n readonly suffix = input<string>('');\n\n /**\n * Optional delta vs previous period — shown as `+x.x%` (or `-x.x%`).\n * Use `deltaSuffix` to change the trailing unit.\n */\n readonly delta = input<number | null>(null, {\n transform: (v: unknown): number | null => {\n if (v === null || v === undefined || v === '') return null;\n const n = coerceNumberProperty(v, Number.NaN);\n return Number.isFinite(n) ? n : null;\n },\n });\n\n /** Unit appended to the delta value. @default '%' */\n readonly deltaSuffix = input<string>('%');\n\n protected readonly hasDelta = computed(() => this.delta() !== null);\n\n protected readonly deltaDirection = computed<'up' | 'down' | 'flat'>(() => {\n const d = this.delta();\n if (d === null || d === 0) return 'flat';\n return d > 0 ? 'up' : 'down';\n });\n\n protected readonly deltaText = computed(() => {\n const d = this.delta();\n if (d === null) return '';\n const sign = d > 0 ? '+' : '';\n return `${sign}${d}${this.deltaSuffix()}`;\n });\n}\n","@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n @if (prefix()) {\n <span class=\"wr-statistic__prefix\">{{ prefix() }}</span>\n }\n <span class=\"wr-statistic__number\">{{ value() ?? '—' }}</span>\n @if (suffix()) {\n <span class=\"wr-statistic__suffix\">{{ suffix() }}</span>\n }\n</div>\n@if (hasDelta()) {\n <div [class]=\"`wr-statistic__delta wr-statistic__delta--${deltaDirection()}`\">\n @if (deltaDirection() === 'up') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 1 L9 8 L1 8 Z\" fill=\"currentColor\" />\n </svg>\n } @else if (deltaDirection() === 'down') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 9 L9 2 L1 2 Z\" fill=\"currentColor\" />\n </svg>\n }\n <span>{{ deltaText() }}</span>\n </div>\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 { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\n// Helpers\n\nfunction toMs(value: Date | string | number): number {\n if (value instanceof Date) return value.getTime();\n if (typeof value === 'number') return value;\n return new Date(value).getTime();\n}\n\nfunction pad(n: number, width: number): string {\n return String(n).padStart(width, '0');\n}\n\nfunction formatRemaining(ms: number, fmt: string): string {\n const days = Math.floor(ms / 86_400_000);\n const hours = Math.floor((ms % 86_400_000) / 3_600_000);\n const minutes = Math.floor((ms % 3_600_000) / 60_000);\n const seconds = Math.floor((ms % 60_000) / 1000);\n const millis = ms % 1000;\n // Single-pass tokenizer so we never re-scan output for tokens. The\n // previous sequential `.replace()` chain leaked: e.g. `D days HH:mm:ss`\n // → `1 day42 11:59:42` because the `/s/g` step at the end re-matched\n // the literal `s` inside `days`. Longest-token-first ordering inside\n // the alternation handles `DD`>`D`, `HH`>`H`, `mm`>`m`, `SSS`>`ss`>`s`.\n return fmt.replace(/(?<![A-Za-z])(?:SSS|DD|HH|mm|ss|D|H|m|s)(?![A-Za-z])/g, token => {\n switch (token) {\n case 'DD':\n return pad(days, 2);\n case 'D':\n return String(days);\n case 'HH':\n return pad(hours, 2);\n case 'H':\n return String(hours);\n case 'mm':\n return pad(minutes, 2);\n case 'm':\n return String(minutes);\n case 'ss':\n return pad(seconds, 2);\n case 's':\n return String(seconds);\n case 'SSS':\n return pad(millis, 3);\n default:\n return token;\n }\n });\n}\n\n/**\n * Live-counting variant of `<wr-statistic>` that targets a future date\n * and ticks down to zero. The format string uses Day/Hour/Minute/Second\n * tokens (`D`, `H`, `m`, `s`, double for zero-padded, plus `SSS` for\n * milliseconds).\n *\n * @example\n * ```html\n * <wr-statistic-countdown\n * label=\"Launch in\"\n * [target]=\"launchDate\"\n * format=\"D days HH:mm:ss\"\n * (countdownEnd)=\"onLive()\"\n * />\n * ```\n *\n * @see https://ngwr.dev/components/statistic\n */\n@Component({\n selector: 'wr-statistic-countdown',\n templateUrl: './statistic-countdown.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-statistic' },\n})\nexport class WrStatisticCountdown {\n /** Target date / timestamp the countdown is running down to. */\n readonly target = input.required<Date | string | number>();\n\n /** Label rendered above the value. */\n readonly label = input<string>('');\n\n /**\n * Format string. Tokens: `D`/`DD` (days), `H`/`HH` (hours),\n * `m`/`mm` (minutes), `s`/`ss` (seconds), `SSS` (milliseconds).\n * Double-letter forms zero-pad to width 2. @default 'HH:mm:ss'\n */\n readonly format = input<string>('HH:mm:ss');\n\n /** Optional text shown once the countdown reaches zero. */\n readonly endText = input<string | null>(null);\n\n /**\n * Tick interval in ms. Drop to ~16 for `SSS` (millisecond display).\n * @default 1000\n */\n readonly tickMs = input(1000);\n\n /** Fires once when the countdown crosses zero. */\n readonly countdownEnd = output<void>();\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private readonly targetMs = computed(() => toMs(this.target()));\n\n /** Remaining milliseconds (live signal). */\n protected readonly remaining = signal(0);\n protected readonly finished = signal(false);\n\n protected readonly display = computed(() => {\n if (this.finished() && this.endText() != null) return this.endText()!;\n return formatRemaining(this.remaining(), this.format());\n });\n\n constructor() {\n // Seed once synchronously so SSR / first paint shows a sane value.\n effect(() => {\n const ms = Math.max(0, this.targetMs() - Date.now());\n this.remaining.set(ms);\n this.finished.set(ms === 0);\n });\n\n if (!this.isBrowser) return;\n\n afterNextRender(() => {\n const handle = setInterval(() => this.tick(), this.tickMs());\n this.destroyRef.onDestroy(() => clearInterval(handle));\n });\n }\n\n private tick(): void {\n const ms = Math.max(0, this.targetMs() - Date.now());\n this.remaining.set(ms);\n if (ms === 0 && !this.finished()) {\n this.finished.set(true);\n this.countdownEnd.emit();\n }\n }\n}\n","@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n <span class=\"wr-statistic__number\">{{ display() }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;;;AAWG;MAOU,WAAW,CAAA;IACb,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAGzB,KAAK,GAAG,KAAK,CAAyB,IAAI;8E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AACxD,QAAA,CAAC,CAAC;IACJ;IAEQ,IAAI,GAAA;AACV,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACpD,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;AAChC,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACvB,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;QAC1B;IACF;uGA/DW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,yxBC/FjC,4LAMA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDyFa,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;+BACE,wBAAwB,EAAA,aAAA,EAEnB,iBAAiB,CAAC,IAAI,QAC/B,EAAE,KAAK,EAAE,cAAc,EAAE,EAAA,QAAA,EAAA,4LAAA,EAAA;;;AE7FjC;;AAEG;;;;"}
@@ -0,0 +1,186 @@
1
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, input, signal, inject, computed, ViewEncapsulation, Component, model, contentChildren, effect, forwardRef } from '@angular/core';
4
+
5
+ /**
6
+ * @license
7
+ *
8
+ * Use of this source code is governed by an MIT-style license that can be
9
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
10
+ */
11
+ const WR_STEPPER = new InjectionToken('WR_STEPPER');
12
+
13
+ /**
14
+ * @license
15
+ *
16
+ * Use of this source code is governed by an MIT-style license that can be
17
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
18
+ */
19
+ /**
20
+ * One step in a {@link WrStepper}. Project as a child:
21
+ *
22
+ * ```html
23
+ * <wr-stepper>
24
+ * <wr-step label="Account"> … </wr-step>
25
+ * <wr-step label="Profile" description="Optional"> … </wr-step>
26
+ * </wr-stepper>
27
+ * ```
28
+ *
29
+ * The stepper hides every step except the active one via a host class —
30
+ * each step still mounts once, so component state survives navigation.
31
+ *
32
+ * @see https://ngwr.dev/components/stepper
33
+ */
34
+ class WrStep {
35
+ /** Header label. */
36
+ label = input('', /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
38
+ /** Secondary text shown under the label. */
39
+ description = input('', /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
41
+ /** Marks the step as optional in the header. */
42
+ optional = input(false, { ...(ngDevMode ? { debugName: "optional" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
43
+ /**
44
+ * Override completion state. When unset, the stepper auto-derives it
45
+ * from the active index (any step before `active` is completed).
46
+ */
47
+ completed = input(null, /* @ts-ignore */
48
+ ...(ngDevMode ? [{ debugName: "completed" }] : /* istanbul ignore next */ []));
49
+ /** Disables the header — also blocks header clicks. */
50
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
51
+ /** Stepper-assigned index. Set by the parent when contentChildren updates. */
52
+ _index = signal(-1, /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "_index" }] : /* istanbul ignore next */ []));
54
+ stepper = inject(WR_STEPPER);
55
+ isActive = computed(() => this._index() === this.stepper.active(), /* @ts-ignore */
56
+ ...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStep, deps: [], target: i0.ɵɵFactoryTarget.Component });
58
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: WrStep, isStandalone: true, selector: "wr-step", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, completed: { classPropertyName: "completed", publicName: "completed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-step--active": "isActive()" }, classAttribute: "wr-step" }, ngImport: i0, template: '<ng-content />', isInline: true, encapsulation: i0.ViewEncapsulation.None });
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStep, decorators: [{
61
+ type: Component,
62
+ args: [{
63
+ selector: 'wr-step',
64
+ template: '<ng-content />',
65
+ encapsulation: ViewEncapsulation.None,
66
+ host: {
67
+ class: 'wr-step',
68
+ '[class.wr-step--active]': 'isActive()',
69
+ },
70
+ }]
71
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], completed: [{ type: i0.Input, args: [{ isSignal: true, alias: "completed", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
72
+
73
+ /**
74
+ * @license
75
+ *
76
+ * Use of this source code is governed by an MIT-style license that can be
77
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
78
+ */
79
+ /**
80
+ * Multi-step wizard container. Children are `<wr-step>` components — the
81
+ * stepper renders one numbered header per step (with connectors) and the
82
+ * body of the currently active one.
83
+ *
84
+ * Two-way bind `[(active)]` to the active step index. Set `linear="true"`
85
+ * to forbid jumping past incomplete steps.
86
+ *
87
+ * @example
88
+ * ```html
89
+ * <wr-stepper [(active)]="step" linear>
90
+ * <wr-step label="Account">…</wr-step>
91
+ * <wr-step label="Profile">…</wr-step>
92
+ * <wr-step label="Confirm">…</wr-step>
93
+ * </wr-stepper>
94
+ * ```
95
+ *
96
+ * @see https://ngwr.dev/components/stepper
97
+ */
98
+ class WrStepper {
99
+ /** Index of the currently visible step. */
100
+ active = model(0, /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
102
+ /** Layout direction. @default 'horizontal' */
103
+ orientation = input('horizontal', /* @ts-ignore */
104
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
105
+ /** Lock steps after the latest completed one. @default false */
106
+ linear = input(false, { ...(ngDevMode ? { debugName: "linear" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
107
+ steps = contentChildren(WrStep, /* @ts-ignore */
108
+ ...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
109
+ classes = computed(() => {
110
+ const parts = ['wr-stepper', `wr-stepper--${this.orientation()}`];
111
+ if (this.linear())
112
+ parts.push('wr-stepper--linear');
113
+ return parts.join(' ');
114
+ }, /* @ts-ignore */
115
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
116
+ constructor() {
117
+ // Push each step's index down so it can compute its own active state.
118
+ effect(() => {
119
+ this.steps().forEach((step, i) => step._index.set(i));
120
+ });
121
+ }
122
+ /** Is the step at `index` considered completed? */
123
+ isCompleted(index) {
124
+ const override = this.steps()[index]?.completed();
125
+ if (override !== null && override !== undefined)
126
+ return override;
127
+ return index < this.active();
128
+ }
129
+ /** Is the step at `index` reachable for direct header clicks? */
130
+ isReachable(index) {
131
+ if (this.steps()[index]?.disabled())
132
+ return false;
133
+ if (!this.linear())
134
+ return true;
135
+ if (index <= this.active())
136
+ return true;
137
+ for (let i = 0; i < index; i++) {
138
+ if (!this.isCompleted(i))
139
+ return false;
140
+ }
141
+ return true;
142
+ }
143
+ onHeaderClick(index) {
144
+ if (this.isReachable(index))
145
+ this.goTo(index);
146
+ }
147
+ // Imperative API
148
+ goTo(index) {
149
+ const last = this.steps().length - 1;
150
+ if (last < 0)
151
+ return;
152
+ const clamped = Math.min(Math.max(0, index), last);
153
+ this.active.set(clamped);
154
+ }
155
+ next() {
156
+ this.goTo(this.active() + 1);
157
+ }
158
+ prev() {
159
+ this.goTo(this.active() - 1);
160
+ }
161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStepper, deps: [], target: i0.ɵɵFactoryTarget.Component });
162
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: WrStepper, isStandalone: true, selector: "wr-stepper", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange" }, host: { properties: { "class": "classes()" } }, providers: [
163
+ {
164
+ provide: WR_STEPPER,
165
+ // eslint-disable-next-line @angular-eslint/no-forward-ref
166
+ useExisting: forwardRef(() => WrStepper),
167
+ },
168
+ ], queries: [{ propertyName: "steps", predicate: WrStep, isSignal: true }], ngImport: i0, template: "<ol class=\"wr-stepper__headers\" role=\"list\">\n @for (step of steps(); track $index) {\n <li\n class=\"wr-stepper__header\"\n [class.wr-stepper__header--active]=\"$index === active()\"\n [class.wr-stepper__header--completed]=\"isCompleted($index)\"\n [class.wr-stepper__header--reachable]=\"isReachable($index)\"\n [class.wr-stepper__header--disabled]=\"step.disabled()\"\n >\n <button\n type=\"button\"\n class=\"wr-stepper__header-button\"\n [disabled]=\"!isReachable($index) || step.disabled()\"\n [attr.aria-current]=\"$index === active() ? 'step' : null\"\n (click)=\"onHeaderClick($index)\"\n >\n <span class=\"wr-stepper__indicator\" aria-hidden=\"true\">\n @if (isCompleted($index)) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <path\n d=\"M3 7.5 L6 10.5 L11 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n } @else {\n {{ $index + 1 }}\n }\n </span>\n <span class=\"wr-stepper__label\">\n {{ step.label() }}\n @if (step.optional()) {\n <small class=\"wr-stepper__optional\">optional</small>\n }\n @if (step.description()) {\n <small class=\"wr-stepper__description\">{{ step.description() }}</small>\n }\n </span>\n </button>\n @if (!$last) {\n <span class=\"wr-stepper__connector\" aria-hidden=\"true\"></span>\n }\n </li>\n }\n</ol>\n\n<div class=\"wr-stepper__body\">\n <ng-content />\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrStepper, decorators: [{
171
+ type: Component,
172
+ args: [{ selector: 'wr-stepper', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()' }, providers: [
173
+ {
174
+ provide: WR_STEPPER,
175
+ // eslint-disable-next-line @angular-eslint/no-forward-ref
176
+ useExisting: forwardRef(() => WrStepper),
177
+ },
178
+ ], template: "<ol class=\"wr-stepper__headers\" role=\"list\">\n @for (step of steps(); track $index) {\n <li\n class=\"wr-stepper__header\"\n [class.wr-stepper__header--active]=\"$index === active()\"\n [class.wr-stepper__header--completed]=\"isCompleted($index)\"\n [class.wr-stepper__header--reachable]=\"isReachable($index)\"\n [class.wr-stepper__header--disabled]=\"step.disabled()\"\n >\n <button\n type=\"button\"\n class=\"wr-stepper__header-button\"\n [disabled]=\"!isReachable($index) || step.disabled()\"\n [attr.aria-current]=\"$index === active() ? 'step' : null\"\n (click)=\"onHeaderClick($index)\"\n >\n <span class=\"wr-stepper__indicator\" aria-hidden=\"true\">\n @if (isCompleted($index)) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <path\n d=\"M3 7.5 L6 10.5 L11 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n } @else {\n {{ $index + 1 }}\n }\n </span>\n <span class=\"wr-stepper__label\">\n {{ step.label() }}\n @if (step.optional()) {\n <small class=\"wr-stepper__optional\">optional</small>\n }\n @if (step.description()) {\n <small class=\"wr-stepper__description\">{{ step.description() }}</small>\n }\n </span>\n </button>\n @if (!$last) {\n <span class=\"wr-stepper__connector\" aria-hidden=\"true\"></span>\n }\n </li>\n }\n</ol>\n\n<div class=\"wr-stepper__body\">\n <ng-content />\n</div>\n" }]
179
+ }], ctorParameters: () => [], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }, { type: i0.Output, args: ["activeChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], linear: [{ type: i0.Input, args: [{ isSignal: true, alias: "linear", required: false }] }], steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WrStep), { isSignal: true }] }] } });
180
+
181
+ /**
182
+ * Generated bundle index. Do not edit.
183
+ */
184
+
185
+ export { WR_STEPPER, WrStep, WrStepper };
186
+ //# sourceMappingURL=ngwr-stepper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-stepper.mjs","sources":["../../../projects/lib/stepper/tokens.ts","../../../projects/lib/stepper/step.ts","../../../projects/lib/stepper/stepper.ts","../../../projects/lib/stepper/stepper.html","../../../projects/lib/stepper/ngwr-stepper.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 { InjectionToken, type Signal } from '@angular/core';\n\n/** Surface a {@link WrStepper} provides for its child `<wr-step>`s. */\nexport interface WrStepperContext {\n /** Index of the currently visible step. */\n readonly active: Signal<number>;\n /** Linear mode — steps after the latest completed one are locked. */\n readonly linear: Signal<boolean>;\n}\n\nexport const WR_STEPPER = new InjectionToken<WrStepperContext>('WR_STEPPER');\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, inject, input, signal } from '@angular/core';\n\nimport { WR_STEPPER } from './tokens';\n\n/**\n * One step in a {@link WrStepper}. Project as a child:\n *\n * ```html\n * <wr-stepper>\n * <wr-step label=\"Account\"> … </wr-step>\n * <wr-step label=\"Profile\" description=\"Optional\"> … </wr-step>\n * </wr-stepper>\n * ```\n *\n * The stepper hides every step except the active one via a host class —\n * each step still mounts once, so component state survives navigation.\n *\n * @see https://ngwr.dev/components/stepper\n */\n@Component({\n selector: 'wr-step',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-step',\n '[class.wr-step--active]': 'isActive()',\n },\n})\nexport class WrStep {\n /** Header label. */\n readonly label = input<string>('');\n\n /** Secondary text shown under the label. */\n readonly description = input<string>('');\n\n /** Marks the step as optional in the header. */\n readonly optional = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Override completion state. When unset, the stepper auto-derives it\n * from the active index (any step before `active` is completed).\n */\n readonly completed = input<boolean | null>(null);\n\n /** Disables the header — also blocks header clicks. */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Stepper-assigned index. Set by the parent when contentChildren updates. */\n readonly _index = signal(-1);\n\n private readonly stepper = inject(WR_STEPPER);\n\n protected readonly isActive = computed(() => this._index() === this.stepper.active());\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ViewEncapsulation,\n computed,\n contentChildren,\n effect,\n forwardRef,\n input,\n model,\n} from '@angular/core';\n\nimport { WrStep } from './step';\nimport { WR_STEPPER, type WrStepperContext } from './tokens';\n\n/**\n * Multi-step wizard container. Children are `<wr-step>` components — the\n * stepper renders one numbered header per step (with connectors) and the\n * body of the currently active one.\n *\n * Two-way bind `[(active)]` to the active step index. Set `linear=\"true\"`\n * to forbid jumping past incomplete steps.\n *\n * @example\n * ```html\n * <wr-stepper [(active)]=\"step\" linear>\n * <wr-step label=\"Account\">…</wr-step>\n * <wr-step label=\"Profile\">…</wr-step>\n * <wr-step label=\"Confirm\">…</wr-step>\n * </wr-stepper>\n * ```\n *\n * @see https://ngwr.dev/components/stepper\n */\n@Component({\n selector: 'wr-stepper',\n templateUrl: './stepper.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n providers: [\n {\n provide: WR_STEPPER,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrStepper),\n },\n ],\n})\nexport class WrStepper implements WrStepperContext {\n /** Index of the currently visible step. */\n readonly active = model(0);\n\n /** Layout direction. @default 'horizontal' */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /** Lock steps after the latest completed one. @default false */\n readonly linear = input(false, { transform: coerceBooleanProperty });\n\n protected readonly steps = contentChildren(WrStep);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-stepper', `wr-stepper--${this.orientation()}`];\n if (this.linear()) parts.push('wr-stepper--linear');\n return parts.join(' ');\n });\n\n constructor() {\n // Push each step's index down so it can compute its own active state.\n effect(() => {\n this.steps().forEach((step, i) => step._index.set(i));\n });\n }\n\n /** Is the step at `index` considered completed? */\n protected isCompleted(index: number): boolean {\n const override = this.steps()[index]?.completed();\n if (override !== null && override !== undefined) return override;\n return index < this.active();\n }\n\n /** Is the step at `index` reachable for direct header clicks? */\n protected isReachable(index: number): boolean {\n if (this.steps()[index]?.disabled()) return false;\n if (!this.linear()) return true;\n if (index <= this.active()) return true;\n for (let i = 0; i < index; i++) {\n if (!this.isCompleted(i)) return false;\n }\n return true;\n }\n\n protected onHeaderClick(index: number): void {\n if (this.isReachable(index)) this.goTo(index);\n }\n\n // Imperative API\n\n goTo(index: number): void {\n const last = this.steps().length - 1;\n if (last < 0) return;\n const clamped = Math.min(Math.max(0, index), last);\n this.active.set(clamped);\n }\n\n next(): void {\n this.goTo(this.active() + 1);\n }\n\n prev(): void {\n this.goTo(this.active() - 1);\n }\n}\n","<ol class=\"wr-stepper__headers\" role=\"list\">\n @for (step of steps(); track $index) {\n <li\n class=\"wr-stepper__header\"\n [class.wr-stepper__header--active]=\"$index === active()\"\n [class.wr-stepper__header--completed]=\"isCompleted($index)\"\n [class.wr-stepper__header--reachable]=\"isReachable($index)\"\n [class.wr-stepper__header--disabled]=\"step.disabled()\"\n >\n <button\n type=\"button\"\n class=\"wr-stepper__header-button\"\n [disabled]=\"!isReachable($index) || step.disabled()\"\n [attr.aria-current]=\"$index === active() ? 'step' : null\"\n (click)=\"onHeaderClick($index)\"\n >\n <span class=\"wr-stepper__indicator\" aria-hidden=\"true\">\n @if (isCompleted($index)) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <path\n d=\"M3 7.5 L6 10.5 L11 4.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n } @else {\n {{ $index + 1 }}\n }\n </span>\n <span class=\"wr-stepper__label\">\n {{ step.label() }}\n @if (step.optional()) {\n <small class=\"wr-stepper__optional\">optional</small>\n }\n @if (step.description()) {\n <small class=\"wr-stepper__description\">{{ step.description() }}</small>\n }\n </span>\n </button>\n @if (!$last) {\n <span class=\"wr-stepper__connector\" aria-hidden=\"true\"></span>\n }\n </li>\n }\n</ol>\n\n<div class=\"wr-stepper__body\">\n <ng-content />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;MAYU,UAAU,GAAG,IAAI,cAAc,CAAmB,YAAY;;ACjB3E;;;;;AAKG;AAOH;;;;;;;;;;;;;;AAcG;MAUU,MAAM,CAAA;;IAER,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAGzB,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;;IAG/B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEtE;;;AAGG;IACM,SAAS,GAAG,KAAK,CAAiB,IAAI;kFAAC;;IAGvC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;AAG7D,IAAA,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;+EAAC;AAEX,IAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAE1B,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;iFAAC;uGAxB1E,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAN,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAM,mzBAPP,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAOf,MAAM,EAAA,UAAA,EAAA,CAAA;kBATlB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AAC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