ng-primitives 0.89.0 → 0.90.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 (382) hide show
  1. package/a11y/index.d.ts +106 -3
  2. package/accordion/index.d.ts +213 -7
  3. package/ai/index.d.ts +238 -16
  4. package/autofill/index.d.ts +22 -1
  5. package/avatar/index.d.ts +120 -5
  6. package/breadcrumbs/index.d.ts +60 -7
  7. package/button/index.d.ts +44 -3
  8. package/checkbox/index.d.ts +58 -2
  9. package/combobox/index.d.ts +414 -8
  10. package/common/index.d.ts +31 -4
  11. package/date-picker/index.d.ts +713 -18
  12. package/date-time/index.d.ts +289 -3
  13. package/date-time-luxon/index.d.ts +31 -1
  14. package/dialog/index.d.ts +253 -9
  15. package/fesm2022/ng-primitives-a11y.mjs +9 -9
  16. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  17. package/fesm2022/ng-primitives-accordion.mjs +51 -48
  18. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-ai.mjs +57 -54
  20. package/fesm2022/ng-primitives-ai.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-autofill.mjs +5 -5
  22. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  23. package/fesm2022/ng-primitives-avatar.mjs +18 -17
  24. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  25. package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
  26. package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
  27. package/fesm2022/ng-primitives-button.mjs +7 -7
  28. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  29. package/fesm2022/ng-primitives-checkbox.mjs +25 -21
  30. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  31. package/fesm2022/ng-primitives-combobox.mjs +76 -72
  32. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  33. package/fesm2022/ng-primitives-common.mjs +5 -5
  34. package/fesm2022/ng-primitives-common.mjs.map +1 -1
  35. package/fesm2022/ng-primitives-date-picker.mjs +114 -108
  36. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  37. package/fesm2022/ng-primitives-dialog.mjs +48 -47
  38. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  39. package/fesm2022/ng-primitives-file-upload.mjs +56 -48
  40. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  41. package/fesm2022/ng-primitives-focus-trap.mjs +9 -8
  42. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  43. package/fesm2022/ng-primitives-form-field.mjs +49 -48
  44. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  45. package/fesm2022/ng-primitives-input-otp.mjs +44 -43
  46. package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
  47. package/fesm2022/ng-primitives-input.mjs +8 -8
  48. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  49. package/fesm2022/ng-primitives-interactions.mjs +55 -50
  50. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  51. package/fesm2022/ng-primitives-internal.mjs +14 -14
  52. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  53. package/fesm2022/ng-primitives-listbox.mjs +52 -50
  54. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  55. package/fesm2022/ng-primitives-menu.mjs +75 -68
  56. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  57. package/fesm2022/ng-primitives-meter.mjs +38 -35
  58. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  59. package/fesm2022/ng-primitives-pagination.mjs +77 -68
  60. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  61. package/fesm2022/ng-primitives-popover.mjs +67 -60
  62. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  63. package/fesm2022/ng-primitives-portal.mjs +11 -12
  64. package/fesm2022/ng-primitives-portal.mjs.map +1 -1
  65. package/fesm2022/ng-primitives-progress.mjs +42 -39
  66. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  67. package/fesm2022/ng-primitives-radio.mjs +32 -30
  68. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  69. package/fesm2022/ng-primitives-resize.mjs +4 -4
  70. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  71. package/fesm2022/ng-primitives-roving-focus.mjs +34 -30
  72. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  73. package/fesm2022/ng-primitives-search.mjs +9 -9
  74. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  75. package/fesm2022/ng-primitives-select.mjs +66 -62
  76. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  77. package/fesm2022/ng-primitives-separator.mjs +7 -7
  78. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  79. package/fesm2022/ng-primitives-slider.mjs +99 -88
  80. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  81. package/fesm2022/ng-primitives-state.mjs +1 -1
  82. package/fesm2022/ng-primitives-state.mjs.map +1 -1
  83. package/fesm2022/ng-primitives-switch.mjs +18 -16
  84. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  85. package/fesm2022/ng-primitives-tabs.mjs +44 -42
  86. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  87. package/fesm2022/ng-primitives-textarea.mjs +8 -8
  88. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  89. package/fesm2022/ng-primitives-toast.mjs +19 -19
  90. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  91. package/fesm2022/ng-primitives-toggle-group.mjs +32 -29
  92. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  93. package/fesm2022/ng-primitives-toggle.mjs +14 -12
  94. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  95. package/fesm2022/ng-primitives-toolbar.mjs +7 -7
  96. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  97. package/fesm2022/ng-primitives-tooltip.mjs +68 -60
  98. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  99. package/fesm2022/ng-primitives-utils.mjs +2 -2
  100. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  101. package/file-upload/index.d.ts +148 -4
  102. package/focus-trap/index.d.ts +98 -2
  103. package/form-field/index.d.ts +262 -7
  104. package/index.d.ts +2 -2
  105. package/input/index.d.ts +47 -2
  106. package/input-otp/index.d.ts +247 -4
  107. package/interactions/index.d.ts +295 -16
  108. package/internal/index.d.ts +201 -10
  109. package/listbox/index.d.ts +209 -6
  110. package/menu/index.d.ts +296 -8
  111. package/meter/index.d.ts +67 -6
  112. package/package.json +28 -28
  113. package/pagination/index.d.ts +211 -7
  114. package/popover/index.d.ts +224 -5
  115. package/portal/index.d.ts +389 -6
  116. package/progress/index.d.ts +124 -6
  117. package/radio/index.d.ts +140 -5
  118. package/resize/index.d.ts +29 -1
  119. package/roving-focus/index.d.ts +178 -4
  120. package/schematics/ng-generate/__snapshots__/index.spec.ts.snap +1 -1
  121. package/search/index.d.ts +66 -3
  122. package/select/index.d.ts +341 -8
  123. package/separator/index.d.ts +30 -2
  124. package/slider/index.d.ts +332 -10
  125. package/state/index.d.ts +14 -11
  126. package/switch/index.d.ts +76 -3
  127. package/tabs/index.d.ts +222 -7
  128. package/textarea/index.d.ts +32 -2
  129. package/toast/index.d.ts +219 -4
  130. package/toggle/index.d.ts +57 -2
  131. package/toggle-group/index.d.ts +143 -5
  132. package/toolbar/index.d.ts +33 -2
  133. package/tooltip/index.d.ts +214 -5
  134. package/utils/index.d.ts +169 -9
  135. package/a11y/active-descendant/active-descendant.d.ts +0 -42
  136. package/a11y/visually-hidden/visually-hidden-state.d.ts +0 -17
  137. package/a11y/visually-hidden/visually-hidden.d.ts +0 -50
  138. package/accordion/accordion/accordion-state.d.ts +0 -17
  139. package/accordion/accordion/accordion.d.ts +0 -50
  140. package/accordion/accordion-content/accordion-content.d.ts +0 -40
  141. package/accordion/accordion-item/accordion-item-state.d.ts +0 -17
  142. package/accordion/accordion-item/accordion-item.d.ts +0 -50
  143. package/accordion/accordion-trigger/accordion-trigger.d.ts +0 -31
  144. package/accordion/config/accordion-config.d.ts +0 -32
  145. package/ai/prompt-composer/prompt-composer-state.d.ts +0 -17
  146. package/ai/prompt-composer/prompt-composer.d.ts +0 -23
  147. package/ai/prompt-composer-dictation/prompt-composer-dictation-state.d.ts +0 -17
  148. package/ai/prompt-composer-dictation/prompt-composer-dictation.d.ts +0 -29
  149. package/ai/prompt-composer-input/prompt-composer-input-state.d.ts +0 -17
  150. package/ai/prompt-composer-input/prompt-composer-input.d.ts +0 -16
  151. package/ai/prompt-composer-submit/prompt-composer-submit-state.d.ts +0 -17
  152. package/ai/prompt-composer-submit/prompt-composer-submit.d.ts +0 -15
  153. package/ai/thread/thread-state.d.ts +0 -17
  154. package/ai/thread/thread.d.ts +0 -23
  155. package/ai/thread-message/thread-message-state.d.ts +0 -17
  156. package/ai/thread-message/thread-message.d.ts +0 -11
  157. package/ai/thread-suggestion/thread-suggestion-state.d.ts +0 -17
  158. package/ai/thread-suggestion/thread-suggestion.d.ts +0 -14
  159. package/ai/thread-viewport/thread-viewport-state.d.ts +0 -17
  160. package/ai/thread-viewport/thread-viewport.d.ts +0 -34
  161. package/autofill/autofill/autofill.d.ts +0 -19
  162. package/avatar/avatar/avatar-state.d.ts +0 -17
  163. package/avatar/avatar/avatar.d.ts +0 -29
  164. package/avatar/avatar-fallback/avatar-fallback.d.ts +0 -37
  165. package/avatar/avatar-image/avatar-image.d.ts +0 -27
  166. package/avatar/config/avatar-config.d.ts +0 -21
  167. package/breadcrumbs/breadcrumb-ellipsis/breadcrumb-ellipsis.d.ts +0 -8
  168. package/breadcrumbs/breadcrumb-item/breadcrumb-item.d.ts +0 -8
  169. package/breadcrumbs/breadcrumb-link/breadcrumb-link.d.ts +0 -9
  170. package/breadcrumbs/breadcrumb-list/breadcrumb-list.d.ts +0 -8
  171. package/breadcrumbs/breadcrumb-page/breadcrumb-page.d.ts +0 -8
  172. package/breadcrumbs/breadcrumb-separator/breadcrumb-separator.d.ts +0 -8
  173. package/breadcrumbs/breadcrumbs/breadcrumbs.d.ts +0 -8
  174. package/button/button/button-state.d.ts +0 -17
  175. package/button/button/button.d.ts +0 -15
  176. package/button/button/setup-button.d.ts +0 -15
  177. package/checkbox/checkbox/checkbox-state.d.ts +0 -17
  178. package/checkbox/checkbox/checkbox.d.ts +0 -45
  179. package/combobox/combobox/combobox-state.d.ts +0 -17
  180. package/combobox/combobox/combobox.d.ts +0 -222
  181. package/combobox/combobox-button/combobox-button.d.ts +0 -18
  182. package/combobox/combobox-dropdown/combobox-dropdown.d.ts +0 -21
  183. package/combobox/combobox-input/combobox-input.d.ts +0 -36
  184. package/combobox/combobox-option/combobox-option.d.ts +0 -51
  185. package/combobox/combobox-portal/combobox-portal.d.ts +0 -37
  186. package/combobox/config/combobox-config.d.ts +0 -28
  187. package/combobox/utils.d.ts +0 -9
  188. package/common/header/header-token.d.ts +0 -10
  189. package/common/header/header.d.ts +0 -13
  190. package/common/types/orientation.d.ts +0 -1
  191. package/common/types/selection.d.ts +0 -1
  192. package/date-picker/config/date-picker-config.d.ts +0 -22
  193. package/date-picker/date-picker/date-picker-first-day-of-week.d.ts +0 -29
  194. package/date-picker/date-picker/date-picker-state.d.ts +0 -9
  195. package/date-picker/date-picker/date-picker.d.ts +0 -129
  196. package/date-picker/date-picker-cell/date-picker-cell.d.ts +0 -20
  197. package/date-picker/date-picker-cell-render/date-picker-cell-render-token.d.ts +0 -12
  198. package/date-picker/date-picker-cell-render/date-picker-cell-render.d.ts +0 -39
  199. package/date-picker/date-picker-date-button/date-picker-date-button-token.d.ts +0 -7
  200. package/date-picker/date-picker-date-button/date-picker-date-button.d.ts +0 -114
  201. package/date-picker/date-picker-grid/date-picker-grid.d.ts +0 -16
  202. package/date-picker/date-picker-label/date-picker-label-token.d.ts +0 -7
  203. package/date-picker/date-picker-label/date-picker-label.d.ts +0 -20
  204. package/date-picker/date-picker-next-month/date-picker-next-month.d.ts +0 -34
  205. package/date-picker/date-picker-previous-month/date-picker-previous-month.d.ts +0 -34
  206. package/date-picker/date-picker-row-render/date-picker-row-render-token.d.ts +0 -12
  207. package/date-picker/date-picker-row-render/date-picker-row-render.d.ts +0 -65
  208. package/date-picker/date-range-picker/date-range-picker-state.d.ts +0 -19
  209. package/date-picker/date-range-picker/date-range-picker.d.ts +0 -149
  210. package/date-time/date-adapter/date-adapter-token.d.ts +0 -11
  211. package/date-time/date-adapter/date-adapter.d.ts +0 -169
  212. package/date-time/native-date-adapter/native-date-adapter.d.ts +0 -106
  213. package/date-time-luxon/luxon-date-adapter/luxon-date-adapter.d.ts +0 -28
  214. package/dialog/config/dialog-config.d.ts +0 -41
  215. package/dialog/dialog/dialog-ref.d.ts +0 -45
  216. package/dialog/dialog/dialog-state.d.ts +0 -17
  217. package/dialog/dialog/dialog.d.ts +0 -37
  218. package/dialog/dialog/dialog.service.d.ts +0 -69
  219. package/dialog/dialog-description/dialog-description.d.ts +0 -12
  220. package/dialog/dialog-overlay/dialog-overlay.d.ts +0 -16
  221. package/dialog/dialog-title/dialog-title.d.ts +0 -12
  222. package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -26
  223. package/file-upload/file-dropzone/file-drop-filter.d.ts +0 -2
  224. package/file-upload/file-dropzone/file-dropzone-state.d.ts +0 -17
  225. package/file-upload/file-dropzone/file-dropzone.d.ts +0 -55
  226. package/file-upload/file-upload/file-upload-state.d.ts +0 -17
  227. package/file-upload/file-upload/file-upload.d.ts +0 -72
  228. package/focus-trap/focus-trap/focus-trap-state.d.ts +0 -17
  229. package/focus-trap/focus-trap/focus-trap.d.ts +0 -85
  230. package/form-field/description/description.d.ts +0 -17
  231. package/form-field/error/error.d.ts +0 -32
  232. package/form-field/form-control/form-control-state.d.ts +0 -17
  233. package/form-field/form-control/form-control.d.ts +0 -44
  234. package/form-field/form-field/form-field-state.d.ts +0 -17
  235. package/form-field/form-field/form-field.d.ts +0 -119
  236. package/form-field/label/label.d.ts +0 -30
  237. package/input/input/input-state.d.ts +0 -17
  238. package/input/input/input.d.ts +0 -34
  239. package/input-otp/input-otp/input-otp-state.d.ts +0 -17
  240. package/input-otp/input-otp/input-otp.d.ts +0 -133
  241. package/input-otp/input-otp-input/input-otp-input.d.ts +0 -57
  242. package/input-otp/input-otp-slot/input-otp-slot.d.ts +0 -45
  243. package/interactions/config/interactions-config.d.ts +0 -30
  244. package/interactions/focus/focus-interaction.d.ts +0 -14
  245. package/interactions/focus/focus.d.ts +0 -19
  246. package/interactions/focus-visible/focus-visible-interaction.d.ts +0 -12
  247. package/interactions/focus-visible/focus-visible.d.ts +0 -19
  248. package/interactions/hover/hover-interaction.d.ts +0 -17
  249. package/interactions/hover/hover.d.ts +0 -31
  250. package/interactions/interactions/interactions.d.ts +0 -20
  251. package/interactions/move/move.d.ts +0 -114
  252. package/interactions/press/press-interaction.d.ts +0 -14
  253. package/interactions/press/press.d.ts +0 -26
  254. package/internal/exit-animation/exit-animation-manager.d.ts +0 -17
  255. package/internal/exit-animation/exit-animation.d.ts +0 -26
  256. package/internal/signals/explicit-effect.d.ts +0 -19
  257. package/internal/style-injector/style-injector.d.ts +0 -44
  258. package/internal/utilities/dom-removal.d.ts +0 -6
  259. package/internal/utilities/element-ref.d.ts +0 -6
  260. package/internal/utilities/mutation-observer.d.ts +0 -39
  261. package/internal/utilities/overflow.d.ts +0 -13
  262. package/internal/utilities/resize.d.ts +0 -31
  263. package/internal/utilities/scrolling.d.ts +0 -1
  264. package/listbox/listbox/listbox-state.d.ts +0 -17
  265. package/listbox/listbox/listbox.d.ts +0 -101
  266. package/listbox/listbox-header/listbox-header.d.ts +0 -9
  267. package/listbox/listbox-option/listbox-option.d.ts +0 -68
  268. package/listbox/listbox-section/listbox-section.d.ts +0 -9
  269. package/listbox/listbox-trigger/listbox-trigger.d.ts +0 -13
  270. package/menu/config/menu-config.d.ts +0 -44
  271. package/menu/menu/menu-token.d.ts +0 -11
  272. package/menu/menu/menu.d.ts +0 -22
  273. package/menu/menu-item/menu-item.d.ts +0 -30
  274. package/menu/menu-trigger/menu-trigger-state.d.ts +0 -17
  275. package/menu/menu-trigger/menu-trigger.d.ts +0 -98
  276. package/menu/submenu-trigger/submenu-trigger-state.d.ts +0 -17
  277. package/menu/submenu-trigger/submenu-trigger.d.ts +0 -88
  278. package/meter/meter/meter-state.d.ts +0 -17
  279. package/meter/meter/meter.d.ts +0 -27
  280. package/meter/meter-indicator/meter-indicator.d.ts +0 -7
  281. package/meter/meter-label/meter-label.d.ts +0 -10
  282. package/meter/meter-track/meter-track.d.ts +0 -5
  283. package/meter/meter-value/meter-value.d.ts +0 -5
  284. package/pagination/pagination/pagination-state.d.ts +0 -17
  285. package/pagination/pagination/pagination.d.ts +0 -45
  286. package/pagination/pagination-button/pagination-button.d.ts +0 -39
  287. package/pagination/pagination-first/pagination-first.d.ts +0 -28
  288. package/pagination/pagination-last/pagination-last.d.ts +0 -28
  289. package/pagination/pagination-next/pagination-next.d.ts +0 -31
  290. package/pagination/pagination-previous/pagination-previous.d.ts +0 -31
  291. package/popover/config/popover-config.d.ts +0 -64
  292. package/popover/popover/popover.d.ts +0 -18
  293. package/popover/popover-arrow/popover-arrow.d.ts +0 -6
  294. package/popover/popover-trigger/popover-trigger-state.d.ts +0 -19
  295. package/popover/popover-trigger/popover-trigger.d.ts +0 -128
  296. package/portal/offset.d.ts +0 -39
  297. package/portal/overlay-arrow.d.ts +0 -1
  298. package/portal/overlay-token.d.ts +0 -12
  299. package/portal/overlay.d.ts +0 -214
  300. package/portal/portal.d.ts +0 -94
  301. package/portal/scroll-strategy.d.ts +0 -23
  302. package/progress/progress/progress-state.d.ts +0 -17
  303. package/progress/progress/progress.d.ts +0 -61
  304. package/progress/progress-indicator/progress-indicator.d.ts +0 -17
  305. package/progress/progress-label/progress-label.d.ts +0 -14
  306. package/progress/progress-track/progress-track.d.ts +0 -9
  307. package/progress/progress-value/progress-value.d.ts +0 -9
  308. package/radio/radio-group/radio-group-state.d.ts +0 -18
  309. package/radio/radio-group/radio-group.d.ts +0 -54
  310. package/radio/radio-indicator/radio-indicator.d.ts +0 -21
  311. package/radio/radio-item/radio-item-state.d.ts +0 -18
  312. package/radio/radio-item/radio-item.d.ts +0 -45
  313. package/resize/resize/resize.d.ts +0 -26
  314. package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +0 -17
  315. package/roving-focus/roving-focus-group/roving-focus-group-token.d.ts +0 -21
  316. package/roving-focus/roving-focus-group/roving-focus-group.d.ts +0 -94
  317. package/roving-focus/roving-focus-item/roving-focus-item.d.ts +0 -53
  318. package/search/search/search-state.d.ts +0 -17
  319. package/search/search/search.d.ts +0 -36
  320. package/search/search-clear/search-clear.d.ts +0 -16
  321. package/select/config/select-config.d.ts +0 -28
  322. package/select/native-select/native-select-state.d.ts +0 -17
  323. package/select/native-select/native-select.d.ts +0 -22
  324. package/select/select/select-state.d.ts +0 -17
  325. package/select/select/select.d.ts +0 -172
  326. package/select/select-dropdown/select-dropdown.d.ts +0 -17
  327. package/select/select-option/select-option.d.ts +0 -51
  328. package/select/select-portal/select-portal.d.ts +0 -37
  329. package/separator/config/separator-config.d.ts +0 -22
  330. package/separator/separator/separator.d.ts +0 -11
  331. package/slider/range-slider/range-slider/range-slider-state.d.ts +0 -17
  332. package/slider/range-slider/range-slider/range-slider.d.ts +0 -115
  333. package/slider/range-slider/range-slider-range/range-slider-range.d.ts +0 -12
  334. package/slider/range-slider/range-slider-thumb/range-slider-thumb.d.ts +0 -44
  335. package/slider/range-slider/range-slider-track/range-slider-track.d.ts +0 -22
  336. package/slider/slider/slider-state.d.ts +0 -17
  337. package/slider/slider/slider.d.ts +0 -58
  338. package/slider/slider-range/slider-range.d.ts +0 -12
  339. package/slider/slider-thumb/slider-thumb.d.ts +0 -29
  340. package/slider/slider-track/slider-track.d.ts +0 -22
  341. package/switch/switch/switch-state.d.ts +0 -17
  342. package/switch/switch/switch.d.ts +0 -49
  343. package/switch/switch-thumb/switch-thumb.d.ts +0 -13
  344. package/tabs/config/tabs-config.d.ts +0 -32
  345. package/tabs/tab-button/tab-button.d.ts +0 -59
  346. package/tabs/tab-list/tab-list.d.ts +0 -12
  347. package/tabs/tab-panel/tab-panel-token.d.ts +0 -8
  348. package/tabs/tab-panel/tab-panel.d.ts +0 -38
  349. package/tabs/tabset/tabset-state.d.ts +0 -17
  350. package/tabs/tabset/tabset.d.ts +0 -71
  351. package/textarea/textarea/textarea-state.d.ts +0 -17
  352. package/textarea/textarea/textarea.d.ts +0 -19
  353. package/toast/config/toast-config.d.ts +0 -70
  354. package/toast/toast/toast-context.d.ts +0 -3
  355. package/toast/toast/toast-manager.d.ts +0 -49
  356. package/toast/toast/toast-options.d.ts +0 -34
  357. package/toast/toast/toast-timer.d.ts +0 -14
  358. package/toast/toast/toast.d.ts +0 -72
  359. package/toggle/toggle/toggle-state.d.ts +0 -17
  360. package/toggle/toggle/toggle.d.ts +0 -44
  361. package/toggle-group/config/toggle-group-config.d.ts +0 -32
  362. package/toggle-group/toggle-group/toggle-group-state.d.ts +0 -17
  363. package/toggle-group/toggle-group/toggle-group.d.ts +0 -64
  364. package/toggle-group/toggle-group-item/toggle-group-item-state.d.ts +0 -17
  365. package/toggle-group/toggle-group-item/toggle-group-item.d.ts +0 -34
  366. package/toolbar/toolbar/toolbar-state.d.ts +0 -17
  367. package/toolbar/toolbar/toolbar.d.ts +0 -20
  368. package/tooltip/config/tooltip-config.d.ts +0 -59
  369. package/tooltip/tooltip/tooltip.d.ts +0 -17
  370. package/tooltip/tooltip-arrow/tooltip-arrow.d.ts +0 -6
  371. package/tooltip/tooltip-text-content/tooltip-text-content.component.d.ts +0 -14
  372. package/tooltip/tooltip-trigger/tooltip-trigger-state.d.ts +0 -17
  373. package/tooltip/tooltip-trigger/tooltip-trigger.d.ts +0 -126
  374. package/utils/forms/providers.d.ts +0 -6
  375. package/utils/forms/status.d.ts +0 -16
  376. package/utils/forms/types.d.ts +0 -8
  377. package/utils/helpers/attributes.d.ts +0 -2
  378. package/utils/helpers/disposables.d.ts +0 -40
  379. package/utils/helpers/unique-id.d.ts +0 -6
  380. package/utils/helpers/validators.d.ts +0 -51
  381. package/utils/observables/take-until-destroyed.d.ts +0 -10
  382. package/utils/signals/index.d.ts +0 -22
@@ -37,11 +37,11 @@ class NgpRadioGroup {
37
37
  /**
38
38
  * The id of the radio group. If not provided, a unique id will be generated.
39
39
  */
40
- this.id = input(uniqueId('ngp-radio-group'));
40
+ this.id = input(uniqueId('ngp-radio-group'), ...(ngDevMode ? [{ debugName: "id" }] : []));
41
41
  /**
42
42
  * The value of the radio group.
43
43
  */
44
- this.value = input(null, { alias: 'ngpRadioGroupValue' });
44
+ this.value = input(null, ...(ngDevMode ? [{ debugName: "value", alias: 'ngpRadioGroupValue' }] : [{ alias: 'ngpRadioGroupValue' }]));
45
45
  /**
46
46
  * Event emitted when the radio group value changes.
47
47
  */
@@ -51,24 +51,25 @@ class NgpRadioGroup {
51
51
  /**
52
52
  * Whether the radio group is disabled.
53
53
  */
54
- this.disabled = input(false, {
55
- alias: 'ngpRadioGroupDisabled',
56
- transform: booleanAttribute,
57
- });
54
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpRadioGroupDisabled',
55
+ transform: booleanAttribute }] : [{
56
+ alias: 'ngpRadioGroupDisabled',
57
+ transform: booleanAttribute,
58
+ }]));
58
59
  /**
59
60
  * The orientation of the radio group.
60
61
  * @default 'horizontal'
61
62
  */
62
- this.orientation = input('horizontal', {
63
- alias: 'ngpRadioGroupOrientation',
64
- });
63
+ this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation", alias: 'ngpRadioGroupOrientation' }] : [{
64
+ alias: 'ngpRadioGroupOrientation',
65
+ }]));
65
66
  /**
66
67
  * The comparator function for the radio group. This is useful if values are objects and you want to compare them by value, not by reference.
67
68
  * @default (a, b) => a === b
68
69
  */
69
- this.compareWith = input((a, b) => a === b, {
70
- alias: 'ngpRadioGroupCompareWith',
71
- });
70
+ this.compareWith = input((a, b) => a === b, ...(ngDevMode ? [{ debugName: "compareWith", alias: 'ngpRadioGroupCompareWith' }] : [{
71
+ alias: 'ngpRadioGroupCompareWith',
72
+ }]));
72
73
  /**
73
74
  * The state of the radio group.
74
75
  * @internal
@@ -92,10 +93,10 @@ class NgpRadioGroup {
92
93
  this.state.value.set(value);
93
94
  this.valueChange.emit(value);
94
95
  }
95
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
96
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpRadioGroup, isStandalone: true, selector: "[ngpRadioGroup]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpRadioGroupValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRadioGroupDisabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpRadioGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpRadioGroupCompareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpRadioGroupValueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "id": "id()", "attr.aria-orientation": "state.orientation()", "attr.data-orientation": "state.orientation()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideRadioGroupState()], hostDirectives: [{ directive: i1.NgpRovingFocusGroup, inputs: ["ngpRovingFocusGroupOrientation", "ngpRadioGroupOrientation", "ngpRovingFocusGroupDisabled", "ngpRadioGroupDisabled"] }], ngImport: i0 }); }
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
97
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpRadioGroup, isStandalone: true, selector: "[ngpRadioGroup]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpRadioGroupValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRadioGroupDisabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "ngpRadioGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpRadioGroupCompareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpRadioGroupValueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "id": "id()", "attr.aria-orientation": "state.orientation()", "attr.data-orientation": "state.orientation()", "attr.data-disabled": "state.disabled() ? \"\" : null" } }, providers: [provideRadioGroupState()], hostDirectives: [{ directive: i1.NgpRovingFocusGroup, inputs: ["ngpRovingFocusGroupOrientation", "ngpRadioGroupOrientation", "ngpRovingFocusGroupDisabled", "ngpRadioGroupDisabled"] }], ngImport: i0 }); }
97
98
  }
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioGroup, decorators: [{
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRadioGroup, decorators: [{
99
100
  type: Directive,
100
101
  args: [{
101
102
  selector: '[ngpRadioGroup]',
@@ -117,7 +118,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
117
118
  '[attr.data-disabled]': 'state.disabled() ? "" : null',
118
119
  },
119
120
  }]
120
- }], ctorParameters: () => [] });
121
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRadioGroupValue", required: false }] }], valueChange: [{ type: i0.Output, args: ["ngpRadioGroupValueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRadioGroupDisabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRadioGroupOrientation", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRadioGroupCompareWith", required: false }] }] } });
121
122
 
122
123
  /**
123
124
  * The state token for the RadioItem primitive.
@@ -152,12 +153,12 @@ class NgpRadioIndicator {
152
153
  /**
153
154
  * Determine if the radio indicator is checked.
154
155
  */
155
- this.checked = computed(() => this.radioGroupState().value() === this.radioItemState().value());
156
+ this.checked = computed(() => this.radioGroupState().value() === this.radioItemState().value(), ...(ngDevMode ? [{ debugName: "checked" }] : []));
156
157
  }
157
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
158
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpRadioIndicator, isStandalone: true, selector: "[ngpRadioIndicator]", host: { properties: { "attr.data-checked": "checked() ? \"\" : null", "attr.data-disabled": "radioItemState().disabled() ? \"\" : null" } }, hostDirectives: [{ directive: i2.NgpHover }, { directive: i2.NgpPress }], ngImport: i0 }); }
158
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRadioIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
159
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: NgpRadioIndicator, isStandalone: true, selector: "[ngpRadioIndicator]", host: { properties: { "attr.data-checked": "checked() ? \"\" : null", "attr.data-disabled": "radioItemState().disabled() ? \"\" : null" } }, hostDirectives: [{ directive: i2.NgpHover }, { directive: i2.NgpPress }], ngImport: i0 }); }
159
160
  }
160
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioIndicator, decorators: [{
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRadioIndicator, decorators: [{
161
162
  type: Directive,
162
163
  args: [{
163
164
  selector: '[ngpRadioIndicator]',
@@ -182,19 +183,20 @@ class NgpRadioItem {
182
183
  * The value of the radio item.
183
184
  * @required
184
185
  */
185
- this.value = input(undefined, { alias: 'ngpRadioItemValue' });
186
+ this.value = input(undefined, ...(ngDevMode ? [{ debugName: "value", alias: 'ngpRadioItemValue' }] : [{ alias: 'ngpRadioItemValue' }]));
186
187
  /**
187
188
  * Whether the radio item is disabled.
188
189
  * @default false
189
190
  */
190
- this.disabled = input(false, {
191
- alias: 'ngpRadioItemDisabled',
192
- transform: booleanAttribute,
193
- });
191
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpRadioItemDisabled',
192
+ transform: booleanAttribute }] : [{
193
+ alias: 'ngpRadioItemDisabled',
194
+ transform: booleanAttribute,
195
+ }]));
194
196
  /**
195
197
  * Whether the radio item is checked.
196
198
  */
197
- this.checked = computed(() => this.radioGroupState().compareWith()(this.radioGroupState().value(), this.state.value()));
199
+ this.checked = computed(() => this.radioGroupState().compareWith()(this.radioGroupState().value(), this.state.value()), ...(ngDevMode ? [{ debugName: "checked" }] : []));
198
200
  /**
199
201
  * The state of the radio item.
200
202
  */
@@ -219,10 +221,10 @@ class NgpRadioItem {
219
221
  onClick() {
220
222
  this.radioGroupState().select(this.state.value());
221
223
  }
222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
223
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpRadioItem, isStandalone: true, selector: "[ngpRadioItem]", inputs: { value: { classPropertyName: "value", publicName: "ngpRadioItemValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRadioItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "radio" }, listeners: { "focus": "onFocus()", "click": "onClick()" }, properties: { "attr.aria-checked": "checked() ? \"true\" : \"false\"", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.data-checked": "checked() ? \"\" : null" } }, providers: [provideRadioItemState()], hostDirectives: [{ directive: i1.NgpRovingFocusItem }, { directive: i2.NgpHover }, { directive: i2.NgpFocusVisible }, { directive: i2.NgpPress }], ngImport: i0 }); }
224
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRadioItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
225
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpRadioItem, isStandalone: true, selector: "[ngpRadioItem]", inputs: { value: { classPropertyName: "value", publicName: "ngpRadioItemValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRadioItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "radio" }, listeners: { "focus": "onFocus()", "click": "onClick()" }, properties: { "attr.aria-checked": "checked() ? \"true\" : \"false\"", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.data-checked": "checked() ? \"\" : null" } }, providers: [provideRadioItemState()], hostDirectives: [{ directive: i1.NgpRovingFocusItem }, { directive: i2.NgpHover }, { directive: i2.NgpFocusVisible }, { directive: i2.NgpPress }], ngImport: i0 }); }
224
226
  }
225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRadioItem, decorators: [{
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRadioItem, decorators: [{
226
228
  type: Directive,
227
229
  args: [{
228
230
  selector: '[ngpRadioItem]',
@@ -235,7 +237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
235
237
  '[attr.data-checked]': 'checked() ? "" : null',
236
238
  },
237
239
  }]
238
- }], propDecorators: { onFocus: [{
240
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRadioItemValue", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRadioItemDisabled", required: false }] }], onFocus: [{
239
241
  type: HostListener,
240
242
  args: ['focus']
241
243
  }], onClick: [{
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-radio.mjs","sources":["../../../../packages/ng-primitives/radio/src/radio-group/radio-group-state.ts","../../../../packages/ng-primitives/radio/src/radio-group/radio-group.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item-state.ts","../../../../packages/ng-primitives/radio/src/radio-indicator/radio-indicator.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item.ts","../../../../packages/ng-primitives/radio/src/ng-primitives-radio.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioGroup } from './radio-group';\n\n/**\n * The state token for the RadioGroup primitive.\n */\nexport const NgpRadioGroupStateToken = createStateToken<NgpRadioGroup<unknown>>('RadioGroup');\n\n/**\n * Provides the RadioGroup state.\n */\nexport const provideRadioGroupState = createStateProvider(NgpRadioGroupStateToken);\n\n/**\n * Injects the RadioGroup state.\n */\nexport const injectRadioGroupState = createStateInjector<NgpRadioGroup<unknown>>(\n NgpRadioGroupStateToken,\n) as <T>() => InjectedState<NgpRadioGroup<T>>;\n\n/**\n * The RadioGroup state registration function.\n */\nexport const radioGroupState = createState(NgpRadioGroupStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, OnInit, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideRadioGroupState, radioGroupState } from './radio-group-state';\n\n/**\n * Apply the `ngpRadioGroup` directive to an element that represents the group of radio items.\n */\n@Directive({\n selector: '[ngpRadioGroup]',\n providers: [provideRadioGroupState()],\n hostDirectives: [\n {\n directive: NgpRovingFocusGroup,\n inputs: [\n 'ngpRovingFocusGroupOrientation:ngpRadioGroupOrientation',\n 'ngpRovingFocusGroupDisabled:ngpRadioGroupDisabled',\n ],\n },\n ],\n host: {\n role: 'radiogroup',\n '[id]': 'id()',\n '[attr.aria-orientation]': 'state.orientation()',\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpRadioGroup<T> implements OnInit {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * The id of the radio group. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-radio-group'));\n\n /**\n * The value of the radio group.\n */\n readonly value = input<T | null>(null, { alias: 'ngpRadioGroupValue' });\n\n /**\n * Event emitted when the radio group value changes.\n */\n readonly valueChange = output<T | null>({\n alias: 'ngpRadioGroupValueChange',\n });\n\n /**\n * Whether the radio group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The orientation of the radio group.\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>('horizontal', {\n alias: 'ngpRadioGroupOrientation',\n });\n\n /**\n * The comparator function for the radio group. This is useful if values are objects and you want to compare them by value, not by reference.\n * @default (a, b) => a === b\n */\n readonly compareWith = input<(a: T | null, b: T | null) => boolean>((a, b) => a === b, {\n alias: 'ngpRadioGroupCompareWith',\n });\n\n /**\n * The state of the radio group.\n * @internal\n */\n protected readonly state = radioGroupState<NgpRadioGroup<T>>(this);\n\n constructor() {\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n\n ngOnInit(): void {\n // the roving focus group defaults to vertical orientation whereas we want to default to vertical\n this.rovingFocusGroupState().orientation.set(this.state.orientation());\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: T): void {\n // if the value is already selected, do nothing\n if (this.state.compareWith()(this.state.value(), value)) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioItem } from './radio-item';\n\n/**\n * The state token for the RadioItem primitive.\n */\nexport const NgpRadioItemStateToken = createStateToken<NgpRadioItem<unknown>>('RadioItem');\n\n/**\n * Provides the RadioItem state.\n */\nexport const provideRadioItemState = createStateProvider(NgpRadioItemStateToken);\n\n/**\n * Injects the RadioItem state.\n */\nexport const injectRadioItemState = createStateInjector<NgpRadioItem<unknown>>(\n NgpRadioItemStateToken,\n) as <T>() => InjectedState<NgpRadioItem<T>>;\n\n/**\n * The RadioItem state registration function.\n */\nexport const radioItemState = createState(NgpRadioItemStateToken);\n","import { Directive, computed } from '@angular/core';\nimport { NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { injectRadioItemState } from '../radio-item/radio-item-state';\n\n/**\n * Apply the `ngpRadioIndicator` directive to an element that represents the radio indicator (i.e. the dot).\n */\n@Directive({\n selector: '[ngpRadioIndicator]',\n host: {\n '[attr.data-checked]': 'checked() ? \"\" : null',\n '[attr.data-disabled]': 'radioItemState().disabled() ? \"\" : null',\n },\n hostDirectives: [NgpHover, NgpPress],\n})\nexport class NgpRadioIndicator<T> {\n /**\n * Access the radio group state.\n */\n protected readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * Access the radio group item state\n */\n protected readonly radioItemState = injectRadioItemState<T>();\n\n /**\n * Determine if the radio indicator is checked.\n */\n protected readonly checked = computed(\n () => this.radioGroupState().value() === this.radioItemState().value(),\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, OnInit, booleanAttribute, computed, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { provideRadioItemState, radioItemState } from './radio-item-state';\n\n/**\n * Apply the `ngpRadioItem` directive to an element that represents a radio item. This would typically be a `button` element.\n */\n@Directive({\n selector: '[ngpRadioItem]',\n hostDirectives: [NgpRovingFocusItem, NgpHover, NgpFocusVisible, NgpPress],\n providers: [provideRadioItemState()],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked() ? \"true\" : \"false\"',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.data-checked]': 'checked() ? \"\" : null',\n },\n})\nexport class NgpRadioItem<T> implements OnInit {\n /**\n * Access the radio group state.\n */\n private readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * The value of the radio item.\n * @required\n */\n readonly value = input<T>(undefined, { alias: 'ngpRadioItemValue' });\n\n /**\n * Whether the radio item is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the radio item is checked.\n */\n readonly checked = computed(() =>\n this.radioGroupState().compareWith()(this.radioGroupState().value(), this.state.value()!),\n );\n\n /**\n * The state of the radio item.\n */\n protected readonly state = radioItemState<NgpRadioItem<T>>(this);\n\n ngOnInit(): void {\n if (this.state.value() === undefined) {\n throw new Error('The `ngpRadioItem` directive requires a `value` input.');\n }\n }\n\n /**\n * When the item receives focus, select it.\n * @internal\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.radioGroupState().select(this.state.value()!);\n }\n\n /**\n * When the item receives a click, select it.\n * @internal\n */\n @HostListener('click')\n protected onClick(): void {\n this.radioGroupState().select(this.state.value()!);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AASA;;AAEG;AACI,MAAM,uBAAuB,GAAG,gBAAgB,CAAyB,YAAY,CAAC;AAE7F;;AAEG;MACU,sBAAsB,GAAG,mBAAmB,CAAC,uBAAuB;AAEjF;;AAEG;MACU,qBAAqB,GAAG,mBAAmB,CACtD,uBAAuB;AAGzB;;AAEG;AACI,MAAM,eAAe,GAAG,WAAW,CAAC,uBAAuB,CAAC;;ACrBnE;;AAEG;MAqBU,aAAa,CAAA;AAqDxB,IAAA,WAAA,GAAA;AApDA;;AAEG;QACc,IAAA,CAAA,qBAAqB,GAAG,2BAA2B,EAAE;AAEtE;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAExD;;AAEG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAW,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;AAEvE;;AAEG;QACM,IAAA,CAAA,WAAW,GAAG,MAAM,CAAW;AACtC,YAAA,KAAK,EAAE,0BAA0B;AAClC,SAAA,CAAC;AAEF;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,uBAAuB;AAC9B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;;AAGG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAiB,YAAY,EAAE;AACzD,YAAA,KAAK,EAAE,0BAA0B;AAClC,SAAA,CAAC;AAEF;;;AAGG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAwC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KA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AAC,qBAAqB,EAAE,CAAC,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,QAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAQzB,YAAY,EAAA,UAAA,EAAA,CAAA;kBAXxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,cAAc,EAAE,CAAC,kBAAkB,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,CAAC;AACzE,oBAAA,SAAS,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACpC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,qBAAqB,EAAE,8BAA8B;AACrD,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,qBAAqB,EAAE,uBAAuB;AAC/C,qBAAA;AACF,iBAAA;8BA6CW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO;gBAUX,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO;;;ACzEvB;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-radio.mjs","sources":["../../../../packages/ng-primitives/radio/src/radio-group/radio-group-state.ts","../../../../packages/ng-primitives/radio/src/radio-group/radio-group.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item-state.ts","../../../../packages/ng-primitives/radio/src/radio-indicator/radio-indicator.ts","../../../../packages/ng-primitives/radio/src/radio-item/radio-item.ts","../../../../packages/ng-primitives/radio/src/ng-primitives-radio.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioGroup } from './radio-group';\n\n/**\n * The state token for the RadioGroup primitive.\n */\nexport const NgpRadioGroupStateToken = createStateToken<NgpRadioGroup<unknown>>('RadioGroup');\n\n/**\n * Provides the RadioGroup state.\n */\nexport const provideRadioGroupState = createStateProvider(NgpRadioGroupStateToken);\n\n/**\n * Injects the RadioGroup state.\n */\nexport const injectRadioGroupState = createStateInjector<NgpRadioGroup<unknown>>(\n NgpRadioGroupStateToken,\n) as <T>() => InjectedState<NgpRadioGroup<T>>;\n\n/**\n * The RadioGroup state registration function.\n */\nexport const radioGroupState = createState(NgpRadioGroupStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, OnInit, output } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { injectRovingFocusGroupState, NgpRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideRadioGroupState, radioGroupState } from './radio-group-state';\n\n/**\n * Apply the `ngpRadioGroup` directive to an element that represents the group of radio items.\n */\n@Directive({\n selector: '[ngpRadioGroup]',\n providers: [provideRadioGroupState()],\n hostDirectives: [\n {\n directive: NgpRovingFocusGroup,\n inputs: [\n 'ngpRovingFocusGroupOrientation:ngpRadioGroupOrientation',\n 'ngpRovingFocusGroupDisabled:ngpRadioGroupDisabled',\n ],\n },\n ],\n host: {\n role: 'radiogroup',\n '[id]': 'id()',\n '[attr.aria-orientation]': 'state.orientation()',\n '[attr.data-orientation]': 'state.orientation()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n },\n})\nexport class NgpRadioGroup<T> implements OnInit {\n /**\n * Access the roving focus group state.\n */\n private readonly rovingFocusGroupState = injectRovingFocusGroupState();\n\n /**\n * The id of the radio group. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-radio-group'));\n\n /**\n * The value of the radio group.\n */\n readonly value = input<T | null>(null, { alias: 'ngpRadioGroupValue' });\n\n /**\n * Event emitted when the radio group value changes.\n */\n readonly valueChange = output<T | null>({\n alias: 'ngpRadioGroupValueChange',\n });\n\n /**\n * Whether the radio group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The orientation of the radio group.\n * @default 'horizontal'\n */\n readonly orientation = input<NgpOrientation>('horizontal', {\n alias: 'ngpRadioGroupOrientation',\n });\n\n /**\n * The comparator function for the radio group. This is useful if values are objects and you want to compare them by value, not by reference.\n * @default (a, b) => a === b\n */\n readonly compareWith = input<(a: T | null, b: T | null) => boolean>((a, b) => a === b, {\n alias: 'ngpRadioGroupCompareWith',\n });\n\n /**\n * The state of the radio group.\n * @internal\n */\n protected readonly state = radioGroupState<NgpRadioGroup<T>>(this);\n\n constructor() {\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n\n ngOnInit(): void {\n // the roving focus group defaults to vertical orientation whereas we want to default to vertical\n this.rovingFocusGroupState().orientation.set(this.state.orientation());\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: T): void {\n // if the value is already selected, do nothing\n if (this.state.compareWith()(this.state.value(), value)) {\n return;\n }\n\n this.state.value.set(value);\n this.valueChange.emit(value);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n InjectedState,\n} from 'ng-primitives/state';\nimport type { NgpRadioItem } from './radio-item';\n\n/**\n * The state token for the RadioItem primitive.\n */\nexport const NgpRadioItemStateToken = createStateToken<NgpRadioItem<unknown>>('RadioItem');\n\n/**\n * Provides the RadioItem state.\n */\nexport const provideRadioItemState = createStateProvider(NgpRadioItemStateToken);\n\n/**\n * Injects the RadioItem state.\n */\nexport const injectRadioItemState = createStateInjector<NgpRadioItem<unknown>>(\n NgpRadioItemStateToken,\n) as <T>() => InjectedState<NgpRadioItem<T>>;\n\n/**\n * The RadioItem state registration function.\n */\nexport const radioItemState = createState(NgpRadioItemStateToken);\n","import { Directive, computed } from '@angular/core';\nimport { NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { injectRadioItemState } from '../radio-item/radio-item-state';\n\n/**\n * Apply the `ngpRadioIndicator` directive to an element that represents the radio indicator (i.e. the dot).\n */\n@Directive({\n selector: '[ngpRadioIndicator]',\n host: {\n '[attr.data-checked]': 'checked() ? \"\" : null',\n '[attr.data-disabled]': 'radioItemState().disabled() ? \"\" : null',\n },\n hostDirectives: [NgpHover, NgpPress],\n})\nexport class NgpRadioIndicator<T> {\n /**\n * Access the radio group state.\n */\n protected readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * Access the radio group item state\n */\n protected readonly radioItemState = injectRadioItemState<T>();\n\n /**\n * Determine if the radio indicator is checked.\n */\n protected readonly checked = computed(\n () => this.radioGroupState().value() === this.radioItemState().value(),\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, OnInit, booleanAttribute, computed, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectRadioGroupState } from '../radio-group/radio-group-state';\nimport { provideRadioItemState, radioItemState } from './radio-item-state';\n\n/**\n * Apply the `ngpRadioItem` directive to an element that represents a radio item. This would typically be a `button` element.\n */\n@Directive({\n selector: '[ngpRadioItem]',\n hostDirectives: [NgpRovingFocusItem, NgpHover, NgpFocusVisible, NgpPress],\n providers: [provideRadioItemState()],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked() ? \"true\" : \"false\"',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.data-checked]': 'checked() ? \"\" : null',\n },\n})\nexport class NgpRadioItem<T> implements OnInit {\n /**\n * Access the radio group state.\n */\n private readonly radioGroupState = injectRadioGroupState<T>();\n\n /**\n * The value of the radio item.\n * @required\n */\n readonly value = input<T>(undefined, { alias: 'ngpRadioItemValue' });\n\n /**\n * Whether the radio item is disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRadioItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the radio item is checked.\n */\n readonly checked = computed(() =>\n this.radioGroupState().compareWith()(this.radioGroupState().value(), this.state.value()!),\n );\n\n /**\n * The state of the radio item.\n */\n protected readonly state = radioItemState<NgpRadioItem<T>>(this);\n\n ngOnInit(): void {\n if (this.state.value() === undefined) {\n throw new Error('The `ngpRadioItem` directive requires a `value` input.');\n }\n }\n\n /**\n * When the item receives focus, select it.\n * @internal\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.radioGroupState().select(this.state.value()!);\n }\n\n /**\n * When the item receives a click, select it.\n * @internal\n */\n @HostListener('click')\n protected onClick(): void {\n this.radioGroupState().select(this.state.value()!);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;AASA;;AAEG;AACI,MAAM,uBAAuB,GAAG,gBAAgB,CAAyB,YAAY,CAAC;AAE7F;;AAEG;MACU,sBAAsB,GAAG,mBAAmB,CAAC,uBAAuB;AAEjF;;AAEG;MACU,qBAAqB,GAAG,mBAAmB,CACtD,uBAAuB;AAGzB;;AAEG;AACI,MAAM,eAAe,GAAG,WAAW,CAAC,uBAAuB,CAAC;;ACrBnE;;AAEG;MAqBU,aAAa,CAAA;AAqDxB,IAAA,WAAA,GAAA;AApDA;;AAEG;QACc,IAAA,CAAA,qBAAqB,GAAG,2BAA2B,EAAE;AAEtE;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,iBAAiB,CAAC,8CAAC;AAExD;;AAEG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAW,IAAI,yCAAI,KAAK,EAAE,oBAAoB,EAAA,CAAA,GAAA,CAA7B,EAAE,KAAK,EAAE,oBAAoB,EAAE,GAAC;AAEv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AAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAQzB,YAAY,EAAA,UAAA,EAAA,CAAA;kBAXxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,cAAc,EAAE,CAAC,kBAAkB,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,CAAC;AACzE,oBAAA,SAAS,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACpC,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,qBAAqB,EAAE,8BAA8B;AACrD,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,qBAAqB,EAAE,uBAAuB;AAC/C,qBAAA;AACF,iBAAA;;sBA4CE,YAAY;uBAAC,OAAO;;sBASpB,YAAY;uBAAC,OAAO;;;ACzEvB;;AAEG;;;;"}
@@ -31,15 +31,15 @@ class NgpResize {
31
31
  .pipe(safeTakeUntilDestroyed(this.destroyRef))
32
32
  .subscribe(event => this.ngZone.run(() => this.didResize.emit(event)));
33
33
  }
34
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpResize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
35
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpResize, isStandalone: true, selector: "[ngpResize]", outputs: { didResize: "ngpResize" }, ngImport: i0 }); }
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpResize, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
35
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: NgpResize, isStandalone: true, selector: "[ngpResize]", outputs: { didResize: "ngpResize" }, ngImport: i0 }); }
36
36
  }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpResize, decorators: [{
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpResize, decorators: [{
38
38
  type: Directive,
39
39
  args: [{
40
40
  selector: '[ngpResize]',
41
41
  }]
42
- }], ctorParameters: () => [] });
42
+ }], ctorParameters: () => [], propDecorators: { didResize: [{ type: i0.Output, args: ["ngpResize"] }] } });
43
43
 
44
44
  /**
45
45
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-resize.mjs","sources":["../../../../packages/ng-primitives/resize/src/resize/resize.ts","../../../../packages/ng-primitives/resize/src/ng-primitives-resize.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\nimport { Dimensions, fromResizeEvent } from 'ng-primitives/internal';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\n/**\n * Apply the `ngpResize` directive to an element to listen for resize events.\n */\n@Directive({\n selector: '[ngpResize]',\n})\nexport class NgpResize {\n /**\n * Access the element.\n */\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access zone.js\n */\n private readonly ngZone = inject(NgZone);\n\n /**\n * Access the destroy ref\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Emits when the element is resized.\n */\n readonly didResize = output<Dimensions>({\n alias: 'ngpResize',\n });\n\n constructor() {\n // observe the element for resize events\n fromResizeEvent(this.element.nativeElement)\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(event => this.ngZone.run(() => this.didResize.emit(event)));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;AAEG;MAIU,SAAS,CAAA;AAuBpB,IAAA,WAAA,GAAA;AAtBA;;AAEG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEtE;;AAEG;AACc,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAExC;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD;;AAEG;QACM,IAAA,CAAA,SAAS,GAAG,MAAM,CAAa;AACtC,YAAA,KAAK,EAAE,WAAW;AACnB,SAAA,CAAC;;AAIA,QAAA,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;AACvC,aAAA,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC;aAC5C,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E;+GA5BW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAHrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACxB,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-resize.mjs","sources":["../../../../packages/ng-primitives/resize/src/resize/resize.ts","../../../../packages/ng-primitives/resize/src/ng-primitives-resize.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\nimport { Dimensions, fromResizeEvent } from 'ng-primitives/internal';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\n/**\n * Apply the `ngpResize` directive to an element to listen for resize events.\n */\n@Directive({\n selector: '[ngpResize]',\n})\nexport class NgpResize {\n /**\n * Access the element.\n */\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access zone.js\n */\n private readonly ngZone = inject(NgZone);\n\n /**\n * Access the destroy ref\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Emits when the element is resized.\n */\n readonly didResize = output<Dimensions>({\n alias: 'ngpResize',\n });\n\n constructor() {\n // observe the element for resize events\n fromResizeEvent(this.element.nativeElement)\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(event => this.ngZone.run(() => this.didResize.emit(event)));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;AAEG;MAIU,SAAS,CAAA;AAuBpB,IAAA,WAAA,GAAA;AAtBA;;AAEG;AACc,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEtE;;AAEG;AACc,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAExC;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD;;AAEG;QACM,IAAA,CAAA,SAAS,GAAG,MAAM,CAAa;AACtC,YAAA,KAAK,EAAE,WAAW;AACnB,SAAA,CAAC;;AAIA,QAAA,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;AACvC,aAAA,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC;aAC5C,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E;8GA5BW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAHrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACxB,iBAAA;;;ACTD;;AAEG;;;;"}
@@ -63,39 +63,42 @@ class NgpRovingFocusGroup {
63
63
  * Determine the orientation of the roving focus group.
64
64
  * @default 'vertical'
65
65
  */
66
- this.orientation = input('vertical', {
67
- alias: 'ngpRovingFocusGroupOrientation',
68
- });
66
+ this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation", alias: 'ngpRovingFocusGroupOrientation' }] : [{
67
+ alias: 'ngpRovingFocusGroupOrientation',
68
+ }]));
69
69
  /**
70
70
  * Determine if focus should wrap when the end or beginning is reached.
71
71
  */
72
- this.wrap = input(true, {
73
- alias: 'ngpRovingFocusGroupWrap',
74
- transform: booleanAttribute,
75
- });
72
+ this.wrap = input(true, ...(ngDevMode ? [{ debugName: "wrap", alias: 'ngpRovingFocusGroupWrap',
73
+ transform: booleanAttribute }] : [{
74
+ alias: 'ngpRovingFocusGroupWrap',
75
+ transform: booleanAttribute,
76
+ }]));
76
77
  /**
77
78
  * Determine if the home and end keys should navigate to the first and last items.
78
79
  */
79
- this.homeEnd = input(true, {
80
- alias: 'ngpRovingFocusGroupHomeEnd',
81
- transform: booleanAttribute,
82
- });
80
+ this.homeEnd = input(true, ...(ngDevMode ? [{ debugName: "homeEnd", alias: 'ngpRovingFocusGroupHomeEnd',
81
+ transform: booleanAttribute }] : [{
82
+ alias: 'ngpRovingFocusGroupHomeEnd',
83
+ transform: booleanAttribute,
84
+ }]));
83
85
  /**
84
86
  * Determine if the roving focus group is disabled.
85
87
  */
86
- this.disabled = input(false, {
87
- alias: 'ngpRovingFocusGroupDisabled',
88
- transform: booleanAttribute,
89
- });
88
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpRovingFocusGroupDisabled',
89
+ transform: booleanAttribute }] : [{
90
+ alias: 'ngpRovingFocusGroupDisabled',
91
+ transform: booleanAttribute,
92
+ }]));
90
93
  /**
91
94
  * Store the items in the roving focus group.
92
95
  */
93
- this.items = signal([]);
96
+ this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
94
97
  /**
95
98
  * Store the active item in the roving focus group.
96
99
  * @internal
97
100
  */
98
- this.activeItem = signal(null);
101
+ this.activeItem = signal(null, ...(ngDevMode ? [{ debugName: "activeItem" }] : []));
99
102
  /**
100
103
  * The state of the roving focus group.
101
104
  */
@@ -282,17 +285,17 @@ class NgpRovingFocusGroup {
282
285
  break;
283
286
  }
284
287
  }
285
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRovingFocusGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
286
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpRovingFocusGroup, isStandalone: true, selector: "[ngpRovingFocusGroup]", inputs: { orientation: { classPropertyName: "orientation", publicName: "ngpRovingFocusGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "ngpRovingFocusGroupWrap", isSignal: true, isRequired: false, transformFunction: null }, homeEnd: { classPropertyName: "homeEnd", publicName: "ngpRovingFocusGroupHomeEnd", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRovingFocusGroupDisabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideRovingFocusGroup(NgpRovingFocusGroup), provideRovingFocusGroupState()], exportAs: ["ngpRovingFocusGroup"], ngImport: i0 }); }
288
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRovingFocusGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
289
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpRovingFocusGroup, isStandalone: true, selector: "[ngpRovingFocusGroup]", inputs: { orientation: { classPropertyName: "orientation", publicName: "ngpRovingFocusGroupOrientation", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "ngpRovingFocusGroupWrap", isSignal: true, isRequired: false, transformFunction: null }, homeEnd: { classPropertyName: "homeEnd", publicName: "ngpRovingFocusGroupHomeEnd", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpRovingFocusGroupDisabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideRovingFocusGroup(NgpRovingFocusGroup), provideRovingFocusGroupState()], exportAs: ["ngpRovingFocusGroup"], ngImport: i0 }); }
287
290
  }
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRovingFocusGroup, decorators: [{
291
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRovingFocusGroup, decorators: [{
289
292
  type: Directive,
290
293
  args: [{
291
294
  selector: '[ngpRovingFocusGroup]',
292
295
  exportAs: 'ngpRovingFocusGroup',
293
296
  providers: [provideRovingFocusGroup(NgpRovingFocusGroup), provideRovingFocusGroupState()],
294
297
  }]
295
- }] });
298
+ }], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRovingFocusGroupOrientation", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRovingFocusGroupWrap", required: false }] }], homeEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRovingFocusGroupHomeEnd", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRovingFocusGroupDisabled", required: false }] }] } });
296
299
 
297
300
  /**
298
301
  * Apply the `ngpRovingFocusItem` directive to an element within a roving focus group to automatically manage focus.
@@ -314,14 +317,15 @@ class NgpRovingFocusItem {
314
317
  /**
315
318
  * Define if the item is disabled.
316
319
  */
317
- this.disabled = input(false, {
318
- alias: 'ngpRovingFocusItemDisabled',
319
- transform: booleanAttribute,
320
- });
320
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpRovingFocusItemDisabled',
321
+ transform: booleanAttribute }] : [{
322
+ alias: 'ngpRovingFocusItemDisabled',
323
+ transform: booleanAttribute,
324
+ }]));
321
325
  /**
322
326
  * Derive the tabindex of the roving focus item.
323
327
  */
324
- this.tabindex = computed(() => !this.group.disabled() && this.group.activeItem() === this ? 0 : -1);
328
+ this.tabindex = computed(() => !this.group.disabled() && this.group.activeItem() === this ? 0 : -1, ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
325
329
  }
326
330
  /**
327
331
  * Initialize the roving focus item.
@@ -361,10 +365,10 @@ class NgpRovingFocusItem {
361
365
  focus(origin) {
362
366
  this.focusMonitor.focusVia(this.elementRef, origin);
363
367
  }
364
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRovingFocusItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
365
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpRovingFocusItem, isStandalone: true, selector: "[ngpRovingFocusItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "ngpRovingFocusItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)", "click": "activate()" }, properties: { "attr.tabindex": "tabindex()" } }, exportAs: ["ngpRovingFocusItem"], ngImport: i0 }); }
368
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRovingFocusItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
369
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpRovingFocusItem, isStandalone: true, selector: "[ngpRovingFocusItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "ngpRovingFocusItemDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)", "click": "activate()" }, properties: { "attr.tabindex": "tabindex()" } }, exportAs: ["ngpRovingFocusItem"], ngImport: i0 }); }
366
370
  }
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpRovingFocusItem, decorators: [{
371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpRovingFocusItem, decorators: [{
368
372
  type: Directive,
369
373
  args: [{
370
374
  selector: '[ngpRovingFocusItem]',
@@ -373,7 +377,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
373
377
  '[attr.tabindex]': 'tabindex()',
374
378
  },
375
379
  }]
376
- }], propDecorators: { onKeydown: [{
380
+ }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngpRovingFocusItemDisabled", required: false }] }], onKeydown: [{
377
381
  type: HostListener,
378
382
  args: ['keydown', ['$event']]
379
383
  }], activate: [{
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-roving-focus.mjs","sources":["../../../../packages/ng-primitives/roving-focus/src/roving-focus-group/roving-focus-group-state.ts","../../../../packages/ng-primitives/roving-focus/src/roving-focus-group/roving-focus-group-token.ts","../../../../packages/ng-primitives/roving-focus/src/roving-focus-group/roving-focus-group.ts","../../../../packages/ng-primitives/roving-focus/src/roving-focus-item/roving-focus-item.ts","../../../../packages/ng-primitives/roving-focus/src/ng-primitives-roving-focus.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpRovingFocusGroup } from './roving-focus-group';\n\n/**\n * The state token for the RovingFocusGroup primitive.\n */\nexport const NgpRovingFocusGroupStateToken =\n createStateToken<NgpRovingFocusGroup>('RovingFocusGroup');\n\n/**\n * Provides the RovingFocusGroup state.\n */\nexport const provideRovingFocusGroupState = createStateProvider(NgpRovingFocusGroupStateToken);\n\n/**\n * Injects the RovingFocusGroup state.\n */\nexport const injectRovingFocusGroupState = createStateInjector<NgpRovingFocusGroup>(\n NgpRovingFocusGroupStateToken,\n);\n\n/**\n * The RovingFocusGroup state registration function.\n */\nexport const rovingFocusGroupState = createState(NgpRovingFocusGroupStateToken);\n","import { FactoryProvider, InjectionToken, Type, inject } from '@angular/core';\nimport { NgpRovingFocusGroup } from './roving-focus-group';\n\nexport const NgpRovingFocusGroupToken = new InjectionToken<NgpRovingFocusGroup>(\n 'NgpRovingFocusGroupToken',\n);\n\n/**\n * Inject the RovingFocusGroup directive instance\n * @returns The RovingFocusGroup directive instance\n */\nexport function injectRovingFocusGroup(): NgpRovingFocusGroup {\n return inject(NgpRovingFocusGroupToken);\n}\n\nexport interface NgpRovingFocusGroupOptions {\n /**\n * Whether we should inherit the focus group from the parent\n * @default true\n */\n inherit?: boolean;\n}\n\n/**\n * Provide the RovingFocusGroup directive instance\n * @param type The RovingFocusGroup directive type\n * @returns The RovingFocusGroup token\n */\nexport function provideRovingFocusGroup(\n type: Type<NgpRovingFocusGroup>,\n { inherit = true }: NgpRovingFocusGroupOptions = {},\n): FactoryProvider {\n return {\n provide: NgpRovingFocusGroupToken,\n // Roving focus groups may be nested, in this case, the parent group should be used\n useFactory: () => {\n if (!inherit) {\n return inject(type, { self: true });\n }\n\n // If the parent group is not found, return the current group\n // This is useful for nested groups\n return (\n inject(NgpRovingFocusGroupToken, { skipSelf: true, optional: true }) ??\n inject(type, { self: true })\n );\n },\n };\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, inject, input, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { NgpRovingFocusItem } from '../roving-focus-item/roving-focus-item';\nimport { provideRovingFocusGroupState, rovingFocusGroupState } from './roving-focus-group-state';\nimport { provideRovingFocusGroup } from './roving-focus-group-token';\n\n/**\n * Apply the `ngpRovingFocusGroup` directive to an element to manage focus for a group of child elements.\n */\n@Directive({\n selector: '[ngpRovingFocusGroup]',\n exportAs: 'ngpRovingFocusGroup',\n providers: [provideRovingFocusGroup(NgpRovingFocusGroup), provideRovingFocusGroupState()],\n})\nexport class NgpRovingFocusGroup {\n /**\n * Access the directionality service.\n */\n private readonly directionality = inject(Directionality);\n\n /**\n * Determine the orientation of the roving focus group.\n * @default 'vertical'\n */\n readonly orientation = input<NgpOrientation>('vertical', {\n alias: 'ngpRovingFocusGroupOrientation',\n });\n\n /**\n * Determine if focus should wrap when the end or beginning is reached.\n */\n readonly wrap = input<boolean, BooleanInput>(true, {\n alias: 'ngpRovingFocusGroupWrap',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if the home and end keys should navigate to the first and last items.\n */\n readonly homeEnd = input<boolean, BooleanInput>(true, {\n alias: 'ngpRovingFocusGroupHomeEnd',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if the roving focus group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRovingFocusGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Store the items in the roving focus group.\n */\n private readonly items = signal<NgpRovingFocusItem[]>([]);\n\n /**\n * Get the items in the roving focus group sorted by order.\n */\n private get sortedItems() {\n return this.items().sort((a, b) => {\n // sort the items by their position in the document\n return a.elementRef.nativeElement.compareDocumentPosition(b.elementRef.nativeElement) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1;\n });\n }\n\n /**\n * Store the active item in the roving focus group.\n * @internal\n */\n readonly activeItem = signal<NgpRovingFocusItem | null>(null);\n\n /**\n * The state of the roving focus group.\n */\n readonly state = rovingFocusGroupState<NgpRovingFocusGroup>(this);\n\n /**\n * Register an item with the roving focus group.\n * @param item The item to register\n * @internal\n */\n register(item: NgpRovingFocusItem): void {\n this.items.update(items => [...items, item]);\n\n // if there is no active item, make the first item the tabbable item\n if (!this.activeItem()) {\n this.activeItem.set(item);\n }\n }\n\n /**\n * Unregister an item with the roving focus group.\n * @param item The item to unregister\n * @internal\n */\n unregister(item: NgpRovingFocusItem): void {\n this.items.update(items => items.filter(i => i !== item));\n\n // check if the unregistered item is the active item\n if (this.activeItem() === item) {\n // if the active item is unregistered, activate the first item\n this.activeItem.set(this.items()[0] ?? null);\n }\n }\n\n /**\n * Activate an item in the roving focus group.\n * @param item The item to activate\n * @param origin The origin of the focus change\n */\n setActiveItem(item: NgpRovingFocusItem | null, origin: FocusOrigin = 'program'): void {\n this.activeItem.set(item);\n item?.focus(origin);\n }\n\n /**\n * Activate the first item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activateFirstItem(origin: FocusOrigin): void {\n // find the first item that is not disabled\n const item = this.sortedItems.find(i => !i.disabled()) ?? null;\n\n // set the first item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Activate the last item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activateLastItem(origin: FocusOrigin): void {\n // find the last item that is not disabled\n const item = [...this.sortedItems].reverse().find(i => !i.disabled()) ?? null;\n\n // set the last item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Activate the next item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activateNextItem(origin: FocusOrigin): void {\n const activeItem = this.activeItem();\n\n // if there is no active item, activate the first item\n if (!activeItem) {\n this.activateFirstItem(origin);\n return;\n }\n\n // find the index of the active item\n const index = this.sortedItems.indexOf(activeItem);\n\n // find the next item that is not disabled\n const item = this.sortedItems.slice(index + 1).find(i => !i.disabled()) ?? null;\n\n // if we are at the end of the list, wrap to the beginning\n if (!item && this.state.wrap()) {\n this.activateFirstItem(origin);\n return;\n }\n\n // if there is no next item, do nothing\n if (!item) {\n return;\n }\n\n // set the next item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Activate the previous item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activatePreviousItem(origin: FocusOrigin): void {\n const activeItem = this.activeItem();\n\n // if there is no active item, activate the last item\n if (!activeItem) {\n this.activateLastItem(origin);\n return;\n }\n\n // find the index of the active item\n const index = this.sortedItems.indexOf(activeItem);\n\n // find the previous item that is not disabled\n const item =\n this.sortedItems\n .slice(0, index)\n .reverse()\n .find(i => !i.disabled()) ?? null;\n\n // if we are at the beginning of the list, wrap to the end\n if (!item && this.state.wrap()) {\n this.activateLastItem(origin);\n return;\n }\n\n // if there is no previous item, do nothing\n if (!item) {\n return;\n }\n\n // set the previous item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Handle keyboard navigation for the roving focus group.\n * @param event The keyboard event\n * @internal\n */\n onKeydown(event: KeyboardEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n switch (event.key) {\n case 'ArrowUp':\n if (this.state.orientation() === 'vertical') {\n event.preventDefault();\n this.activatePreviousItem('keyboard');\n }\n break;\n case 'ArrowDown':\n if (this.state.orientation() === 'vertical') {\n event.preventDefault();\n this.activateNextItem('keyboard');\n }\n break;\n case 'ArrowLeft':\n if (this.state.orientation() === 'horizontal') {\n event.preventDefault();\n\n if (this.directionality.value === 'ltr') {\n this.activatePreviousItem('keyboard');\n } else {\n this.activateNextItem('keyboard');\n }\n }\n break;\n case 'ArrowRight':\n if (this.state.orientation() === 'horizontal') {\n event.preventDefault();\n\n if (this.directionality.value === 'ltr') {\n this.activateNextItem('keyboard');\n } else {\n this.activatePreviousItem('keyboard');\n }\n }\n break;\n case 'Home':\n if (this.state.homeEnd()) {\n event.preventDefault();\n this.activateFirstItem('keyboard');\n }\n break;\n case 'End':\n if (this.state.homeEnd()) {\n event.preventDefault();\n this.activateLastItem('keyboard');\n }\n break;\n }\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n OnDestroy,\n OnInit,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { injectRovingFocusGroup } from '../roving-focus-group/roving-focus-group-token';\n\n/**\n * Apply the `ngpRovingFocusItem` directive to an element within a roving focus group to automatically manage focus.\n */\n@Directive({\n selector: '[ngpRovingFocusItem]',\n exportAs: 'ngpRovingFocusItem',\n host: {\n '[attr.tabindex]': 'tabindex()',\n },\n})\nexport class NgpRovingFocusItem implements OnInit, OnDestroy {\n /**\n * Access the group the roving focus item belongs to.\n */\n private readonly group = injectRovingFocusGroup();\n\n /**\n * Access the focus monitor service.\n */\n private readonly focusMonitor = inject(FocusMonitor);\n\n /**\n * Access the element the roving focus item is attached to.\n */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Define if the item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRovingFocusItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Derive the tabindex of the roving focus item.\n */\n readonly tabindex = computed(() =>\n !this.group.disabled() && this.group.activeItem() === this ? 0 : -1,\n );\n\n /**\n * Initialize the roving focus item.\n */\n ngOnInit(): void {\n this.group.register(this);\n }\n\n /**\n * Clean up the roving focus item.\n */\n ngOnDestroy(): void {\n this.group.unregister(this);\n }\n\n /**\n * Forward the keydown event to the roving focus group.\n * @param event The keyboard event\n */\n @HostListener('keydown', ['$event'])\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) {\n return;\n }\n\n this.group.onKeydown(event);\n }\n\n /**\n * Activate the roving focus item on click.\n */\n @HostListener('click')\n protected activate(): void {\n if (this.disabled()) {\n return;\n }\n\n this.group.setActiveItem(this, 'mouse');\n }\n\n /**\n * Focus the roving focus item.\n * @param origin The origin of the focus\n */\n focus(origin: FocusOrigin): void {\n this.focusMonitor.focusVia(this.elementRef, origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n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;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;gBAazB,QAAQ,EAAA,CAAA;sBADjB,YAAY;uBAAC,OAAO;;;ACtFvB;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-roving-focus.mjs","sources":["../../../../packages/ng-primitives/roving-focus/src/roving-focus-group/roving-focus-group-state.ts","../../../../packages/ng-primitives/roving-focus/src/roving-focus-group/roving-focus-group-token.ts","../../../../packages/ng-primitives/roving-focus/src/roving-focus-group/roving-focus-group.ts","../../../../packages/ng-primitives/roving-focus/src/roving-focus-item/roving-focus-item.ts","../../../../packages/ng-primitives/roving-focus/src/ng-primitives-roving-focus.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpRovingFocusGroup } from './roving-focus-group';\n\n/**\n * The state token for the RovingFocusGroup primitive.\n */\nexport const NgpRovingFocusGroupStateToken =\n createStateToken<NgpRovingFocusGroup>('RovingFocusGroup');\n\n/**\n * Provides the RovingFocusGroup state.\n */\nexport const provideRovingFocusGroupState = createStateProvider(NgpRovingFocusGroupStateToken);\n\n/**\n * Injects the RovingFocusGroup state.\n */\nexport const injectRovingFocusGroupState = createStateInjector<NgpRovingFocusGroup>(\n NgpRovingFocusGroupStateToken,\n);\n\n/**\n * The RovingFocusGroup state registration function.\n */\nexport const rovingFocusGroupState = createState(NgpRovingFocusGroupStateToken);\n","import { FactoryProvider, InjectionToken, Type, inject } from '@angular/core';\nimport { NgpRovingFocusGroup } from './roving-focus-group';\n\nexport const NgpRovingFocusGroupToken = new InjectionToken<NgpRovingFocusGroup>(\n 'NgpRovingFocusGroupToken',\n);\n\n/**\n * Inject the RovingFocusGroup directive instance\n * @returns The RovingFocusGroup directive instance\n */\nexport function injectRovingFocusGroup(): NgpRovingFocusGroup {\n return inject(NgpRovingFocusGroupToken);\n}\n\nexport interface NgpRovingFocusGroupOptions {\n /**\n * Whether we should inherit the focus group from the parent\n * @default true\n */\n inherit?: boolean;\n}\n\n/**\n * Provide the RovingFocusGroup directive instance\n * @param type The RovingFocusGroup directive type\n * @returns The RovingFocusGroup token\n */\nexport function provideRovingFocusGroup(\n type: Type<NgpRovingFocusGroup>,\n { inherit = true }: NgpRovingFocusGroupOptions = {},\n): FactoryProvider {\n return {\n provide: NgpRovingFocusGroupToken,\n // Roving focus groups may be nested, in this case, the parent group should be used\n useFactory: () => {\n if (!inherit) {\n return inject(type, { self: true });\n }\n\n // If the parent group is not found, return the current group\n // This is useful for nested groups\n return (\n inject(NgpRovingFocusGroupToken, { skipSelf: true, optional: true }) ??\n inject(type, { self: true })\n );\n },\n };\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, inject, input, signal } from '@angular/core';\nimport { NgpOrientation } from 'ng-primitives/common';\nimport { NgpRovingFocusItem } from '../roving-focus-item/roving-focus-item';\nimport { provideRovingFocusGroupState, rovingFocusGroupState } from './roving-focus-group-state';\nimport { provideRovingFocusGroup } from './roving-focus-group-token';\n\n/**\n * Apply the `ngpRovingFocusGroup` directive to an element to manage focus for a group of child elements.\n */\n@Directive({\n selector: '[ngpRovingFocusGroup]',\n exportAs: 'ngpRovingFocusGroup',\n providers: [provideRovingFocusGroup(NgpRovingFocusGroup), provideRovingFocusGroupState()],\n})\nexport class NgpRovingFocusGroup {\n /**\n * Access the directionality service.\n */\n private readonly directionality = inject(Directionality);\n\n /**\n * Determine the orientation of the roving focus group.\n * @default 'vertical'\n */\n readonly orientation = input<NgpOrientation>('vertical', {\n alias: 'ngpRovingFocusGroupOrientation',\n });\n\n /**\n * Determine if focus should wrap when the end or beginning is reached.\n */\n readonly wrap = input<boolean, BooleanInput>(true, {\n alias: 'ngpRovingFocusGroupWrap',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if the home and end keys should navigate to the first and last items.\n */\n readonly homeEnd = input<boolean, BooleanInput>(true, {\n alias: 'ngpRovingFocusGroupHomeEnd',\n transform: booleanAttribute,\n });\n\n /**\n * Determine if the roving focus group is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRovingFocusGroupDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Store the items in the roving focus group.\n */\n private readonly items = signal<NgpRovingFocusItem[]>([]);\n\n /**\n * Get the items in the roving focus group sorted by order.\n */\n private get sortedItems() {\n return this.items().sort((a, b) => {\n // sort the items by their position in the document\n return a.elementRef.nativeElement.compareDocumentPosition(b.elementRef.nativeElement) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1;\n });\n }\n\n /**\n * Store the active item in the roving focus group.\n * @internal\n */\n readonly activeItem = signal<NgpRovingFocusItem | null>(null);\n\n /**\n * The state of the roving focus group.\n */\n readonly state = rovingFocusGroupState<NgpRovingFocusGroup>(this);\n\n /**\n * Register an item with the roving focus group.\n * @param item The item to register\n * @internal\n */\n register(item: NgpRovingFocusItem): void {\n this.items.update(items => [...items, item]);\n\n // if there is no active item, make the first item the tabbable item\n if (!this.activeItem()) {\n this.activeItem.set(item);\n }\n }\n\n /**\n * Unregister an item with the roving focus group.\n * @param item The item to unregister\n * @internal\n */\n unregister(item: NgpRovingFocusItem): void {\n this.items.update(items => items.filter(i => i !== item));\n\n // check if the unregistered item is the active item\n if (this.activeItem() === item) {\n // if the active item is unregistered, activate the first item\n this.activeItem.set(this.items()[0] ?? null);\n }\n }\n\n /**\n * Activate an item in the roving focus group.\n * @param item The item to activate\n * @param origin The origin of the focus change\n */\n setActiveItem(item: NgpRovingFocusItem | null, origin: FocusOrigin = 'program'): void {\n this.activeItem.set(item);\n item?.focus(origin);\n }\n\n /**\n * Activate the first item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activateFirstItem(origin: FocusOrigin): void {\n // find the first item that is not disabled\n const item = this.sortedItems.find(i => !i.disabled()) ?? null;\n\n // set the first item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Activate the last item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activateLastItem(origin: FocusOrigin): void {\n // find the last item that is not disabled\n const item = [...this.sortedItems].reverse().find(i => !i.disabled()) ?? null;\n\n // set the last item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Activate the next item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activateNextItem(origin: FocusOrigin): void {\n const activeItem = this.activeItem();\n\n // if there is no active item, activate the first item\n if (!activeItem) {\n this.activateFirstItem(origin);\n return;\n }\n\n // find the index of the active item\n const index = this.sortedItems.indexOf(activeItem);\n\n // find the next item that is not disabled\n const item = this.sortedItems.slice(index + 1).find(i => !i.disabled()) ?? null;\n\n // if we are at the end of the list, wrap to the beginning\n if (!item && this.state.wrap()) {\n this.activateFirstItem(origin);\n return;\n }\n\n // if there is no next item, do nothing\n if (!item) {\n return;\n }\n\n // set the next item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Activate the previous item in the roving focus group.\n * @param origin The origin of the focus change\n */\n private activatePreviousItem(origin: FocusOrigin): void {\n const activeItem = this.activeItem();\n\n // if there is no active item, activate the last item\n if (!activeItem) {\n this.activateLastItem(origin);\n return;\n }\n\n // find the index of the active item\n const index = this.sortedItems.indexOf(activeItem);\n\n // find the previous item that is not disabled\n const item =\n this.sortedItems\n .slice(0, index)\n .reverse()\n .find(i => !i.disabled()) ?? null;\n\n // if we are at the beginning of the list, wrap to the end\n if (!item && this.state.wrap()) {\n this.activateLastItem(origin);\n return;\n }\n\n // if there is no previous item, do nothing\n if (!item) {\n return;\n }\n\n // set the previous item as the active item\n this.setActiveItem(item, origin);\n }\n\n /**\n * Handle keyboard navigation for the roving focus group.\n * @param event The keyboard event\n * @internal\n */\n onKeydown(event: KeyboardEvent): void {\n if (this.state.disabled()) {\n return;\n }\n\n switch (event.key) {\n case 'ArrowUp':\n if (this.state.orientation() === 'vertical') {\n event.preventDefault();\n this.activatePreviousItem('keyboard');\n }\n break;\n case 'ArrowDown':\n if (this.state.orientation() === 'vertical') {\n event.preventDefault();\n this.activateNextItem('keyboard');\n }\n break;\n case 'ArrowLeft':\n if (this.state.orientation() === 'horizontal') {\n event.preventDefault();\n\n if (this.directionality.value === 'ltr') {\n this.activatePreviousItem('keyboard');\n } else {\n this.activateNextItem('keyboard');\n }\n }\n break;\n case 'ArrowRight':\n if (this.state.orientation() === 'horizontal') {\n event.preventDefault();\n\n if (this.directionality.value === 'ltr') {\n this.activateNextItem('keyboard');\n } else {\n this.activatePreviousItem('keyboard');\n }\n }\n break;\n case 'Home':\n if (this.state.homeEnd()) {\n event.preventDefault();\n this.activateFirstItem('keyboard');\n }\n break;\n case 'End':\n if (this.state.homeEnd()) {\n event.preventDefault();\n this.activateLastItem('keyboard');\n }\n break;\n }\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n OnDestroy,\n OnInit,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { injectRovingFocusGroup } from '../roving-focus-group/roving-focus-group-token';\n\n/**\n * Apply the `ngpRovingFocusItem` directive to an element within a roving focus group to automatically manage focus.\n */\n@Directive({\n selector: '[ngpRovingFocusItem]',\n exportAs: 'ngpRovingFocusItem',\n host: {\n '[attr.tabindex]': 'tabindex()',\n },\n})\nexport class NgpRovingFocusItem implements OnInit, OnDestroy {\n /**\n * Access the group the roving focus item belongs to.\n */\n private readonly group = injectRovingFocusGroup();\n\n /**\n * Access the focus monitor service.\n */\n private readonly focusMonitor = inject(FocusMonitor);\n\n /**\n * Access the element the roving focus item is attached to.\n */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Define if the item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpRovingFocusItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Derive the tabindex of the roving focus item.\n */\n readonly tabindex = computed(() =>\n !this.group.disabled() && this.group.activeItem() === this ? 0 : -1,\n );\n\n /**\n * Initialize the roving focus item.\n */\n ngOnInit(): void {\n this.group.register(this);\n }\n\n /**\n * Clean up the roving focus item.\n */\n ngOnDestroy(): void {\n this.group.unregister(this);\n }\n\n /**\n * Forward the keydown event to the roving focus group.\n * @param event The keyboard event\n */\n @HostListener('keydown', ['$event'])\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) {\n return;\n }\n\n this.group.onKeydown(event);\n }\n\n /**\n * Activate the roving focus item on click.\n */\n @HostListener('click')\n protected activate(): void {\n if (this.disabled()) {\n return;\n }\n\n this.group.setActiveItem(this, 'mouse');\n }\n\n /**\n * Focus the roving focus item.\n * @param origin The origin of the focus\n */\n focus(origin: FocusOrigin): void {\n this.focusMonitor.focusVia(this.elementRef, origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,6BAA6B,GACxC,gBAAgB,CAAsB,kBAAkB,CAAC;AAE3D;;AAEG;MACU,4BAA4B,GAAG,mBAAmB,CAAC,6BAA6B;AAE7F;;AAEG;MACU,2BAA2B,GAAG,mBAAmB,CAC5D,6BAA6B;AAG/B;;AAEG;AACI,MAAM,qBAAqB,GAAG,WAAW,CAAC,6BAA6B,CAAC;;MC1BlE,wBAAwB,GAAG,IAAI,cAAc,CACxD,0BAA0B;AAG5B;;;AAGG;SACa,sBAAsB,GAAA;AACpC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;AACzC;AAUA;;;;AAIG;AACG,SAAU,uBAAuB,CACrC,IAA+B,EAC/B,EAAE,OAAO,GAAG,IAAI,EAAA,GAAiC,EAAE,EAAA;IAEnD,OAAO;AACL,QAAA,OAAO,EAAE,wBAAwB;;QAEjC,UAAU,EAAE,MAAK;YACf,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAA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-37,10 +37,10 @@ class NgpSearchClear {
37
37
  clear() {
38
38
  this.search().clear();
39
39
  }
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpSearchClear, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpSearchClear, isStandalone: true, selector: "[ngpSearchClear]", host: { listeners: { "click": "clear()" }, properties: { "tabindex": "-1", "attr.data-empty": "search().empty() ? \"\" : null" } }, exportAs: ["ngpSearchClear"], ngImport: i0 }); }
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpSearchClear, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: NgpSearchClear, isStandalone: true, selector: "[ngpSearchClear]", host: { listeners: { "click": "clear()" }, properties: { "tabindex": "-1", "attr.data-empty": "search().empty() ? \"\" : null" } }, exportAs: ["ngpSearchClear"], ngImport: i0 }); }
42
42
  }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpSearchClear, decorators: [{
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpSearchClear, decorators: [{
44
44
  type: Directive,
45
45
  args: [{
46
46
  selector: '[ngpSearchClear]',
@@ -67,16 +67,16 @@ class NgpSearch {
67
67
  /**
68
68
  * The input field.
69
69
  */
70
- this.input = signal(null);
70
+ this.input = signal(null, ...(ngDevMode ? [{ debugName: "input" }] : []));
71
71
  /**
72
72
  * The value of the input.
73
73
  */
74
- this.value = signal('');
74
+ this.value = signal('', ...(ngDevMode ? [{ debugName: "value" }] : []));
75
75
  /**
76
76
  * Whether the input field is empty.
77
77
  * @internal
78
78
  */
79
- this.empty = computed(() => this.value() === '');
79
+ this.empty = computed(() => this.value() === '', ...(ngDevMode ? [{ debugName: "empty" }] : []));
80
80
  /**
81
81
  * The search field state.
82
82
  */
@@ -102,10 +102,10 @@ class NgpSearch {
102
102
  .pipe(safeTakeUntilDestroyed(this.destroyRef))
103
103
  .subscribe(() => this.value.set(input.value));
104
104
  }
105
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpSearch, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
106
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpSearch, isStandalone: true, selector: "[ngpSearch]", host: { listeners: { "keydown.escape": "clear()" }, properties: { "attr.data-empty": "empty() ? \"\" : null" } }, providers: [provideSearchState()], exportAs: ["ngpSearch"], ngImport: i0 }); }
105
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpSearch, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
106
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: NgpSearch, isStandalone: true, selector: "[ngpSearch]", host: { listeners: { "keydown.escape": "clear()" }, properties: { "attr.data-empty": "empty() ? \"\" : null" } }, providers: [provideSearchState()], exportAs: ["ngpSearch"], ngImport: i0 }); }
107
107
  }
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpSearch, decorators: [{
108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpSearch, decorators: [{
109
109
  type: Directive,
110
110
  args: [{
111
111
  selector: '[ngpSearch]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-search.mjs","sources":["../../../../packages/ng-primitives/search/src/search/search-state.ts","../../../../packages/ng-primitives/search/src/search-clear/search-clear.ts","../../../../packages/ng-primitives/search/src/search/search.ts","../../../../packages/ng-primitives/search/src/ng-primitives-search.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSearch } from './search';\n\n/**\n * The state token for the Search primitive.\n */\nexport const NgpSearchStateToken = createStateToken<NgpSearch>('Search');\n\n/**\n * Provides the Search state.\n */\nexport const provideSearchState = createStateProvider(NgpSearchStateToken);\n\n/**\n * Injects the Search state.\n */\nexport const injectSearchState = createStateInjector<NgpSearch>(NgpSearchStateToken);\n\n/**\n * The Search state registration function.\n */\nexport const searchState = createState(NgpSearchStateToken);\n","import { Directive, HostListener } from '@angular/core';\nimport { injectSearchState } from '../search/search-state';\n\n/**\n * The `NgpSearchClear` directive is can be added to a button to clear the search field on click.\n */\n@Directive({\n selector: '[ngpSearchClear]',\n exportAs: 'ngpSearchClear',\n host: {\n '[tabindex]': '-1',\n '[attr.data-empty]': 'search().empty() ? \"\" : null',\n },\n})\nexport class NgpSearchClear {\n /**\n * Access the Search instance.\n */\n protected readonly search = injectSearchState();\n\n /**\n * Clear the input field.\n */\n @HostListener('click')\n protected clear(): void {\n this.search().clear();\n }\n}\n","import { computed, DestroyRef, Directive, HostListener, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { fromEvent } from 'rxjs';\nimport { provideSearchState, searchState } from './search-state';\n\n/**\n * The `NgpSearch` directive is a container for the search field components.\n */\n@Directive({\n selector: '[ngpSearch]',\n exportAs: 'ngpSearch',\n providers: [provideSearchState()],\n host: {\n '[attr.data-empty]': 'empty() ? \"\" : null',\n },\n})\nexport class NgpSearch {\n /**\n * The destroy reference.\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The input field.\n */\n private readonly input = signal<HTMLInputElement | null>(null);\n\n /**\n * The value of the input.\n */\n private readonly value = signal<string>('');\n\n /**\n * Whether the input field is empty.\n * @internal\n */\n protected readonly empty = computed(() => this.value() === '');\n\n /**\n * The search field state.\n */\n protected readonly state = searchState<NgpSearch>(this);\n\n @HostListener('keydown.escape')\n clear(): void {\n const input = this.input();\n\n if (!input) {\n return;\n }\n\n input.value = '';\n input.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n /**\n * Register the input field.\n * @param input The input field.\n * @internal\n */\n registerInput(input: HTMLInputElement): void {\n this.input.set(input);\n this.value.set(input.value);\n\n fromEvent(input, 'input')\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.value.set(input.value));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAY,QAAQ,CAAC;AAExE;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAY,mBAAmB;AAEnF;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACvB3D;;AAEG;MASU,cAAc,CAAA;AAR3B,IAAA,WAAA,GAAA;AASE;;AAEG;QACgB,IAAA,CAAA,MAAM,GAAG,iBAAiB,EAAE;AAShD,IAAA;AAPC;;AAEG;IAEO,KAAK,GAAA;AACb,QAAA,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACvB;+GAZW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,gCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA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-primitives/search/src/search-clear/search-clear.ts","../../../../packages/ng-primitives/search/src/search/search.ts","../../../../packages/ng-primitives/search/src/ng-primitives-search.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSearch } from './search';\n\n/**\n * The state token for the Search primitive.\n */\nexport const NgpSearchStateToken = createStateToken<NgpSearch>('Search');\n\n/**\n * Provides the Search state.\n */\nexport const provideSearchState = createStateProvider(NgpSearchStateToken);\n\n/**\n * Injects the Search state.\n */\nexport const injectSearchState = createStateInjector<NgpSearch>(NgpSearchStateToken);\n\n/**\n * The Search state registration function.\n */\nexport const searchState = createState(NgpSearchStateToken);\n","import { Directive, HostListener } from '@angular/core';\nimport { injectSearchState } from '../search/search-state';\n\n/**\n * The `NgpSearchClear` directive is can be added to a button to clear the search field on click.\n */\n@Directive({\n selector: '[ngpSearchClear]',\n exportAs: 'ngpSearchClear',\n host: {\n '[tabindex]': '-1',\n '[attr.data-empty]': 'search().empty() ? \"\" : null',\n },\n})\nexport class NgpSearchClear {\n /**\n * Access the Search instance.\n */\n protected readonly search = injectSearchState();\n\n /**\n * Clear the input field.\n */\n @HostListener('click')\n protected clear(): void {\n this.search().clear();\n }\n}\n","import { computed, DestroyRef, Directive, HostListener, inject, signal } from '@angular/core';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { fromEvent } from 'rxjs';\nimport { provideSearchState, searchState } from './search-state';\n\n/**\n * The `NgpSearch` directive is a container for the search field components.\n */\n@Directive({\n selector: '[ngpSearch]',\n exportAs: 'ngpSearch',\n providers: [provideSearchState()],\n host: {\n '[attr.data-empty]': 'empty() ? \"\" : null',\n },\n})\nexport class NgpSearch {\n /**\n * The destroy reference.\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The input field.\n */\n private readonly input = signal<HTMLInputElement | null>(null);\n\n /**\n * The value of the input.\n */\n private readonly value = signal<string>('');\n\n /**\n * Whether the input field is empty.\n * @internal\n */\n protected readonly empty = computed(() => this.value() === '');\n\n /**\n * The search field state.\n */\n protected readonly state = searchState<NgpSearch>(this);\n\n @HostListener('keydown.escape')\n clear(): void {\n const input = this.input();\n\n if (!input) {\n return;\n }\n\n input.value = '';\n input.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n /**\n * Register the input field.\n * @param input The input field.\n * @internal\n */\n registerInput(input: HTMLInputElement): void {\n this.input.set(input);\n this.value.set(input.value);\n\n fromEvent(input, 'input')\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.value.set(input.value));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAY,QAAQ,CAAC;AAExE;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAY,mBAAmB;AAEnF;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACvB3D;;AAEG;MASU,cAAc,CAAA;AAR3B,IAAA,WAAA,GAAA;AASE;;AAEG;QACgB,IAAA,CAAA,MAAM,GAAG,iBAAiB,EAAE;AAShD,IAAA;AAPC;;AAEG;IAEO,KAAK,GAAA;AACb,QAAA,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACvB;8GAZW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,gCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBA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