ng-primitives 0.2.0 → 0.2.1

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 (284) hide show
  1. package/a11y/index.d.ts +1 -1
  2. package/a11y/visually-hidden/visually-hidden.token.d.ts +1 -1
  3. package/accordion/accordion/accordion.directive.d.ts +2 -2
  4. package/accordion/accordion/accordion.token.d.ts +1 -1
  5. package/accordion/accordion-content/accordion-content.token.d.ts +1 -1
  6. package/accordion/accordion-item/accordion-item.directive.d.ts +1 -1
  7. package/accordion/accordion-item/accordion-item.token.d.ts +1 -1
  8. package/accordion/accordion-trigger/accordion-trigger.token.d.ts +1 -1
  9. package/accordion/config/accordion.config.d.ts +1 -1
  10. package/accordion/index.d.ts +1 -1
  11. package/autofill/autofill/autofill.token.d.ts +1 -1
  12. package/autofill/index.d.ts +1 -1
  13. package/avatar/avatar/avatar.token.d.ts +1 -1
  14. package/avatar/avatar-fallback/avatar-fallback.directive.d.ts +1 -1
  15. package/avatar/avatar-image/avatar-image.directive.d.ts +1 -1
  16. package/avatar/config/avatar.config.d.ts +1 -1
  17. package/avatar/index.d.ts +1 -1
  18. package/button/button/button.directive.d.ts +1 -1
  19. package/button/button/button.token.d.ts +1 -1
  20. package/button/index.d.ts +1 -1
  21. package/checkbox/checkbox/checkbox.directive.d.ts +1 -1
  22. package/checkbox/checkbox/checkbox.token.d.ts +1 -1
  23. package/checkbox/index.d.ts +1 -1
  24. package/esm2022/a11y/index.mjs +2 -2
  25. package/esm2022/a11y/visually-hidden/visually-hidden.directive.mjs +2 -2
  26. package/esm2022/a11y/visually-hidden/visually-hidden.token.mjs +2 -2
  27. package/esm2022/accordion/accordion/accordion.directive.mjs +1 -1
  28. package/esm2022/accordion/accordion/accordion.token.mjs +2 -2
  29. package/esm2022/accordion/accordion-content/accordion-content.directive.mjs +2 -2
  30. package/esm2022/accordion/accordion-content/accordion-content.token.mjs +2 -2
  31. package/esm2022/accordion/accordion-item/accordion-item.directive.mjs +1 -1
  32. package/esm2022/accordion/accordion-item/accordion-item.token.mjs +2 -2
  33. package/esm2022/accordion/accordion-trigger/accordion-trigger.directive.mjs +2 -2
  34. package/esm2022/accordion/accordion-trigger/accordion-trigger.token.mjs +2 -2
  35. package/esm2022/accordion/config/accordion.config.mjs +2 -2
  36. package/esm2022/accordion/index.mjs +2 -2
  37. package/esm2022/autofill/autofill/autofill.directive.mjs +2 -2
  38. package/esm2022/autofill/autofill/autofill.token.mjs +2 -2
  39. package/esm2022/autofill/index.mjs +2 -2
  40. package/esm2022/avatar/avatar/avatar.directive.mjs +2 -2
  41. package/esm2022/avatar/avatar/avatar.token.mjs +2 -2
  42. package/esm2022/avatar/avatar-fallback/avatar-fallback.directive.mjs +1 -1
  43. package/esm2022/avatar/avatar-image/avatar-image.directive.mjs +2 -2
  44. package/esm2022/avatar/config/avatar.config.mjs +2 -2
  45. package/esm2022/avatar/index.mjs +2 -2
  46. package/esm2022/button/button/button.directive.mjs +1 -1
  47. package/esm2022/button/button/button.token.mjs +2 -2
  48. package/esm2022/button/index.mjs +2 -2
  49. package/esm2022/checkbox/checkbox/checkbox.directive.mjs +1 -1
  50. package/esm2022/checkbox/checkbox/checkbox.token.mjs +2 -2
  51. package/esm2022/checkbox/index.mjs +2 -2
  52. package/esm2022/file-upload/file-upload/file-upload.directive.mjs +2 -2
  53. package/esm2022/file-upload/file-upload/file-upload.token.mjs +2 -2
  54. package/esm2022/file-upload/index.mjs +2 -2
  55. package/esm2022/focus-trap/focus-trap/focus-trap.directive.mjs +2 -2
  56. package/esm2022/focus-trap/focus-trap/focus-trap.token.mjs +2 -2
  57. package/esm2022/focus-trap/index.mjs +2 -2
  58. package/esm2022/form-field/description/description.directive.mjs +2 -2
  59. package/esm2022/form-field/description/description.token.mjs +2 -2
  60. package/esm2022/form-field/error/error.directive.mjs +2 -2
  61. package/esm2022/form-field/error/error.token.mjs +2 -2
  62. package/esm2022/form-field/form-control/form-control.directive.mjs +2 -2
  63. package/esm2022/form-field/form-control/form-control.token.mjs +2 -2
  64. package/esm2022/form-field/form-field/form-field.directive.mjs +2 -2
  65. package/esm2022/form-field/form-field/form-field.token.mjs +2 -2
  66. package/esm2022/form-field/index.mjs +2 -2
  67. package/esm2022/form-field/label/label.directive.mjs +2 -2
  68. package/esm2022/form-field/label/label.token.mjs +2 -2
  69. package/esm2022/index.mjs +2 -2
  70. package/esm2022/input/index.mjs +2 -2
  71. package/esm2022/input/input/input.directive.mjs +1 -1
  72. package/esm2022/input/input/input.token.mjs +2 -2
  73. package/esm2022/interactions/focus/focus.directive.mjs +1 -1
  74. package/esm2022/interactions/focus/focus.token.mjs +2 -2
  75. package/esm2022/interactions/focus-visible/focus-visible.directive.mjs +2 -2
  76. package/esm2022/interactions/focus-visible/focus-visible.token.mjs +2 -2
  77. package/esm2022/interactions/hover/hover.directive.mjs +1 -1
  78. package/esm2022/interactions/hover/hover.token.mjs +2 -2
  79. package/esm2022/interactions/index.mjs +2 -2
  80. package/esm2022/interactions/move/move.directive.mjs +1 -1
  81. package/esm2022/interactions/move/move.token.mjs +2 -2
  82. package/esm2022/interactions/press/press.directive.mjs +1 -1
  83. package/esm2022/interactions/press/press.token.mjs +2 -2
  84. package/esm2022/internal/disabled/disabled.mjs +2 -2
  85. package/esm2022/internal/index.mjs +2 -2
  86. package/esm2022/internal/orientation/orientation.mjs +2 -2
  87. package/esm2022/internal/style-injector/style-injector.mjs +2 -2
  88. package/esm2022/progress/index.mjs +2 -2
  89. package/esm2022/progress/progress/progress.directive.mjs +1 -1
  90. package/esm2022/progress/progress/progress.token.mjs +2 -2
  91. package/esm2022/progress/progress-indicator/progress-indicator.directive.mjs +2 -2
  92. package/esm2022/radio/index.mjs +2 -2
  93. package/esm2022/radio/radio-group/radio-group.directive.mjs +1 -1
  94. package/esm2022/radio/radio-group/radio-group.token.mjs +2 -2
  95. package/esm2022/radio/radio-indicator/radio-indicator.directive.mjs +2 -2
  96. package/esm2022/radio/radio-item/radio-item.directive.mjs +1 -1
  97. package/esm2022/radio/radio-item/radio-item.token.mjs +2 -2
  98. package/esm2022/resize/index.mjs +2 -2
  99. package/esm2022/resize/resize/resize.directive.mjs +2 -2
  100. package/esm2022/resize/utils/resize.mjs +2 -2
  101. package/esm2022/roving-focus/index.mjs +2 -2
  102. package/esm2022/roving-focus/roving-focus-group/roving-focus-group.directive.mjs +1 -1
  103. package/esm2022/roving-focus/roving-focus-group/roving-focus-group.token.mjs +2 -2
  104. package/esm2022/roving-focus/roving-focus-item/roving-focus-item.directive.mjs +2 -2
  105. package/esm2022/roving-focus/roving-focus-item/roving-focus-item.token.mjs +2 -2
  106. package/esm2022/search/index.mjs +2 -2
  107. package/esm2022/search/search-field/search-field.directive.mjs +2 -2
  108. package/esm2022/search/search-field/search-field.token.mjs +2 -2
  109. package/esm2022/select/index.mjs +2 -2
  110. package/esm2022/select/select/select.directive.mjs +1 -1
  111. package/esm2022/select/select/select.token.mjs +2 -2
  112. package/esm2022/slider/index.mjs +2 -2
  113. package/esm2022/slider/slider/slider.directive.mjs +1 -1
  114. package/esm2022/slider/slider/slider.token.mjs +2 -2
  115. package/esm2022/slider/slider-range/slider-range.directive.mjs +2 -2
  116. package/esm2022/slider/slider-range/slider-range.token.mjs +2 -2
  117. package/esm2022/slider/slider-thumb/slider-thumb.directive.mjs +2 -2
  118. package/esm2022/slider/slider-thumb/slider-thumb.token.mjs +2 -2
  119. package/esm2022/slider/slider-track/slider-track.directive.mjs +2 -2
  120. package/esm2022/slider/slider-track/slider-track.token.mjs +2 -2
  121. package/esm2022/switch/index.mjs +2 -2
  122. package/esm2022/switch/switch/switch.directive.mjs +1 -1
  123. package/esm2022/switch/switch/switch.token.mjs +2 -2
  124. package/esm2022/switch/switch-thumb/switch-thumb.directive.mjs +2 -2
  125. package/esm2022/tabs/config/tabs.config.mjs +2 -2
  126. package/esm2022/tabs/index.mjs +2 -2
  127. package/esm2022/tabs/tab-button/tab-button.directive.mjs +1 -1
  128. package/esm2022/tabs/tab-list/tab-list.directive.mjs +2 -2
  129. package/esm2022/tabs/tab-panel/tab-panel.directive.mjs +2 -2
  130. package/esm2022/tabs/tab-panel/tab-panel.token.mjs +2 -2
  131. package/esm2022/tabs/tabset/tabset.directive.mjs +1 -1
  132. package/esm2022/tabs/tabset/tabset.token.mjs +2 -2
  133. package/esm2022/textarea/index.mjs +2 -2
  134. package/esm2022/textarea/textarea/textarea.directive.mjs +1 -1
  135. package/esm2022/textarea/textarea/textarea.token.mjs +2 -2
  136. package/esm2022/toggle/index.mjs +2 -2
  137. package/esm2022/toggle/toggle/toggle.directive.mjs +1 -1
  138. package/esm2022/tooltip/config/tooltip.config.mjs +2 -2
  139. package/esm2022/tooltip/index.mjs +2 -2
  140. package/esm2022/tooltip/tooltip/tooltip.directive.mjs +2 -2
  141. package/esm2022/tooltip/tooltip/tooltip.token.mjs +2 -2
  142. package/esm2022/tooltip/tooltip-trigger/tooltip-trigger.directive.mjs +1 -1
  143. package/esm2022/tooltip/tooltip-trigger/tooltip-trigger.token.mjs +2 -2
  144. package/esm2022/utils/helpers/disposables.mjs +2 -2
  145. package/esm2022/utils/helpers/focus-manager.mjs +1 -1
  146. package/esm2022/utils/helpers/unique-id.mjs +2 -2
  147. package/esm2022/utils/index.mjs +2 -2
  148. package/esm2022/utils/signals/async.mjs +2 -2
  149. package/esm2022/utils/ui/dimensions.mjs +2 -2
  150. package/fesm2022/ng-primitives-a11y.mjs +3 -3
  151. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  152. package/fesm2022/ng-primitives-accordion.mjs +8 -8
  153. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  154. package/fesm2022/ng-primitives-autofill.mjs +3 -3
  155. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  156. package/fesm2022/ng-primitives-avatar.mjs +5 -5
  157. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  158. package/fesm2022/ng-primitives-button.mjs +2 -2
  159. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  160. package/fesm2022/ng-primitives-checkbox.mjs +2 -2
  161. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  162. package/fesm2022/ng-primitives-file-upload.mjs +3 -3
  163. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  164. package/fesm2022/ng-primitives-focus-trap.mjs +3 -3
  165. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  166. package/fesm2022/ng-primitives-form-field.mjs +11 -11
  167. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  168. package/fesm2022/ng-primitives-input.mjs +2 -2
  169. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  170. package/fesm2022/ng-primitives-interactions.mjs +7 -7
  171. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  172. package/fesm2022/ng-primitives-internal.mjs +4 -4
  173. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  174. package/fesm2022/ng-primitives-progress.mjs +3 -3
  175. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  176. package/fesm2022/ng-primitives-radio.mjs +4 -4
  177. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  178. package/fesm2022/ng-primitives-resize.mjs +3 -3
  179. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  180. package/fesm2022/ng-primitives-roving-focus.mjs +4 -4
  181. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  182. package/fesm2022/ng-primitives-search.mjs +3 -3
  183. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  184. package/fesm2022/ng-primitives-select.mjs +2 -2
  185. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  186. package/fesm2022/ng-primitives-slider.mjs +8 -8
  187. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  188. package/fesm2022/ng-primitives-switch.mjs +3 -3
  189. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  190. package/fesm2022/ng-primitives-tabs.mjs +6 -6
  191. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  192. package/fesm2022/ng-primitives-textarea.mjs +2 -2
  193. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  194. package/fesm2022/ng-primitives-toggle.mjs +1 -1
  195. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  196. package/fesm2022/ng-primitives-tooltip.mjs +5 -5
  197. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  198. package/fesm2022/ng-primitives-utils.mjs +5 -5
  199. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  200. package/fesm2022/ng-primitives.mjs +1 -1
  201. package/fesm2022/ng-primitives.mjs.map +1 -1
  202. package/file-upload/file-upload/file-upload.directive.d.ts +1 -1
  203. package/file-upload/file-upload/file-upload.token.d.ts +1 -1
  204. package/file-upload/index.d.ts +1 -1
  205. package/focus-trap/focus-trap/focus-trap.token.d.ts +1 -1
  206. package/focus-trap/index.d.ts +1 -1
  207. package/form-field/description/description.token.d.ts +1 -1
  208. package/form-field/error/error.directive.d.ts +1 -1
  209. package/form-field/error/error.token.d.ts +1 -1
  210. package/form-field/form-control/form-control.token.d.ts +1 -1
  211. package/form-field/form-field/form-field.directive.d.ts +1 -1
  212. package/form-field/form-field/form-field.token.d.ts +1 -1
  213. package/form-field/index.d.ts +1 -1
  214. package/form-field/label/label.token.d.ts +1 -1
  215. package/index.d.ts +1 -1
  216. package/input/index.d.ts +1 -1
  217. package/input/input/input.directive.d.ts +1 -1
  218. package/input/input/input.token.d.ts +1 -1
  219. package/interactions/focus/focus.directive.d.ts +1 -1
  220. package/interactions/focus/focus.token.d.ts +1 -1
  221. package/interactions/focus-visible/focus-visible.token.d.ts +1 -1
  222. package/interactions/hover/hover.directive.d.ts +1 -1
  223. package/interactions/hover/hover.token.d.ts +1 -1
  224. package/interactions/index.d.ts +1 -1
  225. package/interactions/move/move.directive.d.ts +1 -1
  226. package/interactions/move/move.token.d.ts +1 -1
  227. package/interactions/press/press.directive.d.ts +1 -1
  228. package/interactions/press/press.token.d.ts +1 -1
  229. package/internal/disabled/disabled.d.ts +1 -1
  230. package/internal/index.d.ts +1 -1
  231. package/internal/orientation/orientation.d.ts +1 -1
  232. package/package.json +19 -19
  233. package/progress/index.d.ts +1 -1
  234. package/progress/progress/progress.directive.d.ts +1 -1
  235. package/progress/progress/progress.token.d.ts +1 -1
  236. package/radio/index.d.ts +1 -1
  237. package/radio/radio-group/radio-group.directive.d.ts +1 -1
  238. package/radio/radio-group/radio-group.token.d.ts +1 -1
  239. package/radio/radio-item/radio-item.directive.d.ts +1 -1
  240. package/radio/radio-item/radio-item.token.d.ts +1 -1
  241. package/resize/index.d.ts +1 -1
  242. package/resize/resize/resize.directive.d.ts +1 -1
  243. package/resize/utils/resize.d.ts +1 -1
  244. package/roving-focus/index.d.ts +1 -1
  245. package/roving-focus/roving-focus-group/roving-focus-group.directive.d.ts +1 -1
  246. package/roving-focus/roving-focus-group/roving-focus-group.token.d.ts +1 -1
  247. package/roving-focus/roving-focus-item/roving-focus-item.directive.d.ts +1 -1
  248. package/roving-focus/roving-focus-item/roving-focus-item.token.d.ts +1 -1
  249. package/search/index.d.ts +1 -1
  250. package/search/search-field/search-field.token.d.ts +1 -1
  251. package/select/index.d.ts +1 -1
  252. package/select/select/select.directive.d.ts +1 -1
  253. package/select/select/select.token.d.ts +1 -1
  254. package/slider/index.d.ts +1 -1
  255. package/slider/slider/slider.directive.d.ts +1 -1
  256. package/slider/slider/slider.token.d.ts +1 -1
  257. package/slider/slider-range/slider-range.token.d.ts +1 -1
  258. package/slider/slider-thumb/slider-thumb.token.d.ts +1 -1
  259. package/slider/slider-track/slider-track.directive.d.ts +1 -1
  260. package/slider/slider-track/slider-track.token.d.ts +1 -1
  261. package/switch/index.d.ts +1 -1
  262. package/switch/switch/switch.directive.d.ts +1 -1
  263. package/switch/switch/switch.token.d.ts +1 -1
  264. package/tabs/config/tabs.config.d.ts +1 -1
  265. package/tabs/index.d.ts +1 -1
  266. package/tabs/tab-button/tab-button.directive.d.ts +1 -1
  267. package/tabs/tab-panel/tab-panel.token.d.ts +1 -1
  268. package/tabs/tabset/tabset.directive.d.ts +1 -1
  269. package/tabs/tabset/tabset.token.d.ts +1 -1
  270. package/textarea/index.d.ts +1 -1
  271. package/textarea/textarea/textarea.directive.d.ts +1 -1
  272. package/textarea/textarea/textarea.token.d.ts +1 -1
  273. package/toggle/index.d.ts +1 -1
  274. package/toggle/toggle/toggle.directive.d.ts +1 -1
  275. package/tooltip/config/tooltip.config.d.ts +1 -1
  276. package/tooltip/index.d.ts +1 -1
  277. package/tooltip/tooltip/tooltip.directive.d.ts +1 -1
  278. package/tooltip/tooltip/tooltip.token.d.ts +1 -1
  279. package/tooltip/tooltip-trigger/tooltip-trigger.directive.d.ts +1 -1
  280. package/tooltip/tooltip-trigger/tooltip-trigger.token.d.ts +1 -1
  281. package/utils/helpers/focus-manager.d.ts +1 -1
  282. package/utils/helpers/unique-id.d.ts +1 -1
  283. package/utils/index.d.ts +1 -1
  284. package/utils/signals/async.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-accordion.mjs","sources":["../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.token.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.token.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.token.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.directive.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.token.ts","../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.directive.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.directive.ts","../../../../packages/ng-primitives/accordion/src/config/accordion.config.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.directive.ts","../../../../packages/ng-primitives/accordion/src/index.ts","../../../../packages/ng-primitives/accordion/src/ng-primitives-accordion.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordionItem } from './accordion-item.directive';\n\nexport const NgpAccordionItemToken = new InjectionToken<NgpAccordionItem<unknown>>(\n 'NgpAccordionItemToken',\n);\n\n/**\n * Inject the AccordionItem directive instance\n * @returns The AccordionItem directive instance\n */\nexport function injectAccordionItem<T>(): NgpAccordionItem<T> {\n return inject(NgpAccordionItemToken) as NgpAccordionItem<T>;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordion } from './accordion.directive';\n\nexport const NgpAccordionToken = new InjectionToken<NgpAccordion<unknown>>('NgpAccordionToken');\n\n/**\n * Inject the Accordion directive instance\n * @returns The Accordion directive instance\n */\nexport function injectAccordion<T>(): NgpAccordion<T> {\n return inject(NgpAccordionToken) as NgpAccordion<T>;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordionContent } from './accordion-content.directive';\n\nexport const NgpAccordionContentToken = new InjectionToken<NgpAccordionContent>(\n 'NgpAccordionContentToken',\n);\n\n/**\n * Inject the AccordionContent directive instance\n * @returns The AccordionContent directive instance\n */\nexport function injectAccordionContent(): NgpAccordionContent {\n return inject(NgpAccordionContentToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, input } from '@angular/core';\nimport { injectDimensions, uniqueId } from 'ng-primitives/utils';\nimport { injectAccordionItem } from '../accordion-item/accordion-item.token';\nimport { injectAccordion } from '../accordion/accordion.token';\nimport { NgpAccordionContentToken } from './accordion-content.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordionContent]',\n exportAs: 'ngpAccordionContent',\n providers: [{ provide: NgpAccordionContentToken, useExisting: NgpAccordionContent }],\n host: {\n role: 'region',\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion.orientation()',\n '[attr.data-open]': 'dimensions().mounted ? accordionItem.open() : null',\n '[attr.aria-labelledby]': 'accordionItem.triggerId()',\n '[style.--ngp-accordion-content-width.px]': 'dimensions().width',\n '[style.--ngp-accordion-content-height.px]': 'dimensions().height',\n },\n})\nexport class NgpAccordionContent {\n /**\n * Access the accordion\n */\n protected readonly accordion = injectAccordion();\n\n /**\n * Access the accordion item\n */\n protected readonly accordionItem = injectAccordionItem();\n\n /**\n * The id of the content region\n */\n readonly id = input<string>(uniqueId('ngp-accordion-content'));\n\n /**\n * The size of the content region\n */\n protected readonly dimensions = injectDimensions();\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordionTrigger } from './accordion-trigger.directive';\n\nexport const NgpAccordionTriggerToken = new InjectionToken<NgpAccordionTrigger>(\n 'NgpAccordionTriggerToken',\n);\n\n/**\n * Inject the AccordionTrigger directive instance\n * @returns The AccordionTrigger directive instance\n */\nexport function injectAccordionTrigger(): NgpAccordionTrigger {\n return inject(NgpAccordionTriggerToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, computed, contentChild, input } from '@angular/core';\nimport { NgpAccordionContentToken } from '../accordion-content/accordion-content.token';\nimport { NgpAccordionTriggerToken } from '../accordion-trigger/accordion-trigger.token';\nimport { injectAccordion } from '../accordion/accordion.token';\nimport { NgpAccordionItemToken } from './accordion-item.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordionItem]',\n exportAs: 'ngpAccordionItem',\n providers: [{ provide: NgpAccordionItemToken, useExisting: NgpAccordionItem }],\n host: {\n '[attr.data-orientation]': 'accordion.orientation()',\n '[attr.data-open]': 'open()',\n '[attr.data-disabled]': 'disabled() || accordion.disabled()',\n },\n})\nexport class NgpAccordionItem<T> {\n /**\n * Access the accordion.\n */\n protected readonly accordion = injectAccordion();\n\n /**\n * The value of the accordion item.\n */\n readonly value = input.required<T>({\n alias: 'ngpAccordionItemValue',\n });\n\n /**\n * Whether the accordion item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Access the accordion trigger\n */\n private readonly trigger = contentChild(NgpAccordionTriggerToken);\n\n /**\n * Access the accordion content\n */\n private readonly content = contentChild(NgpAccordionContentToken);\n\n /**\n * Whether the accordion item is expanded.\n */\n readonly open = computed<boolean>(() => this.accordion.isOpen(this.value()));\n\n /**\n * The trigger id.\n */\n readonly triggerId = computed(() => this.trigger()?.id());\n\n /**\n * The content id.\n */\n readonly contentId = computed(() => this.content()?.id());\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, HostListener, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectAccordionItem } from '../accordion-item/accordion-item.token';\nimport { injectAccordion } from '../accordion/accordion.token';\nimport { NgpAccordionTriggerToken } from './accordion-trigger.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordionTrigger]',\n exportAs: 'ngpAccordionTrigger',\n providers: [{ provide: NgpAccordionTriggerToken, useExisting: NgpAccordionTrigger }],\n hostDirectives: [NgpHover, NgpPress, NgpFocusVisible],\n host: {\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion.orientation()',\n '[attr.data-open]': 'item.open()',\n '[attr.data-disabled]': 'item.disabled() || accordion.disabled()',\n '[attr.aria-controls]': 'item.contentId()',\n '[attr.aria-expanded]': 'item.open()',\n },\n})\nexport class NgpAccordionTrigger {\n /**\n * Access the parent accordion.\n */\n protected readonly accordion = injectAccordion();\n\n /**\n * The item instance.\n */\n protected readonly item = injectAccordionItem();\n\n /**\n * The id of the trigger.\n */\n readonly id = input<string>(uniqueId('ngp-accordion-trigger'));\n\n /**\n * Toggle the accordion item.\n */\n @HostListener('click')\n toggle(): void {\n if (this.item.disabled() || this.accordion.disabled()) {\n return;\n }\n\n this.accordion.toggle(this.item.value());\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpAccordionType } from '../accordion/accordion.directive';\n\nexport interface NgpAccordionConfig {\n /**\n * The default type of the accordion\n * @default 'single'\n */\n type: NgpAccordionType;\n /**\n * Whether the accordion is collapsible\n * @default false\n */\n collapsible: boolean;\n /**\n * The default orientation of the accordion\n * @default 'vertical'\n */\n orientation: 'vertical' | 'horizontal';\n}\n\nexport const defaultAccordionConfig: NgpAccordionConfig = {\n type: 'single',\n collapsible: false,\n orientation: 'vertical',\n};\n\nexport const NgpAccordionConfigToken = new InjectionToken<NgpAccordionConfig>(\n 'NgpAccordionConfigToken',\n);\n\n/**\n * Provide the default Accordion configuration\n * @param config The Accordion configuration\n * @returns The provider\n */\nexport function provideAccordionConfig(config: Partial<NgpAccordionConfig>): Provider[] {\n return [\n {\n provide: NgpAccordionConfigToken,\n useValue: { ...defaultAccordionConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Accordion configuration\n * @returns The global Accordion configuration\n */\nexport function injectAccordionConfig(): NgpAccordionConfig {\n return inject(NgpAccordionConfigToken, { optional: true }) ?? defaultAccordionConfig;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, model } from '@angular/core';\nimport { injectAccordionConfig } from '../config/accordion.config';\nimport { NgpAccordionToken } from './accordion.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordion]',\n exportAs: 'ngpAccordion',\n providers: [{ provide: NgpAccordionToken, useExisting: NgpAccordion }],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled()',\n },\n})\nexport class NgpAccordion<T> {\n /**\n * Access the global accordion configuration.\n */\n private readonly config = injectAccordionConfig();\n\n /**\n * The type of the accordion.\n */\n readonly type = input<NgpAccordionType>(this.config.type, {\n alias: 'ngpAccordionType',\n });\n\n /**\n * Whether the accordion is collapsible.\n */\n readonly collapsible = input<boolean, BooleanInput>(this.config.collapsible, {\n alias: 'ngpAccordionCollapsible',\n transform: booleanAttribute,\n });\n\n /**\n * The value of the accordion.\n */\n readonly value = model<T | T[] | null>(null, {\n alias: 'ngpAccordionValue',\n });\n\n /**\n * Whether the accordion is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The accordion orientation.\n */\n readonly orientation = input<'horizontal' | 'vertical'>(this.config.orientation, {\n alias: 'ngpAccordionOrientation',\n });\n\n /**\n * @param value The value to check.\n * @returns Whether the value is open.\n * @internal\n */\n isOpen(value: T): boolean {\n if (this.type() === 'multiple') {\n return (this.value() as T[] | null)?.includes(value) ?? false;\n }\n\n return this.value() === value;\n }\n\n toggle(value: T): void {\n const isOpen = this.isOpen(value);\n\n // if we are in single mode and the value is already open and the accordion is not collapsible, do nothing\n if (this.type() === 'single' && isOpen && !this.collapsible()) {\n return;\n }\n\n // if we are in single mode then toggle the value\n if (this.type() === 'single') {\n this.value.set(isOpen ? null : value);\n return;\n }\n\n // if we are in multiple mode then toggle the value\n const values = (this.value() as T[]) ?? [];\n\n if (isOpen) {\n this.value.set(values.filter(v => v !== value));\n } else {\n this.value.set([...values, value]);\n }\n }\n}\n\nexport type NgpAccordionType = 'single' | 'multiple';\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpAccordionContent } from './accordion-content/accordion-content.directive';\nexport { NgpAccordionContentToken } from './accordion-content/accordion-content.token';\nexport { NgpAccordionItem } from './accordion-item/accordion-item.directive';\nexport { NgpAccordionItemToken } from './accordion-item/accordion-item.token';\nexport { NgpAccordionTrigger } from './accordion-trigger/accordion-trigger.directive';\nexport { NgpAccordionTriggerToken } from './accordion-trigger/accordion-trigger.token';\nexport { NgpAccordion } from './accordion/accordion.directive';\nexport { NgpAccordionToken } from './accordion/accordion.token';\nexport { NgpAccordionConfig, provideAccordionConfig } from './config/accordion.config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB,EACvB;AAEF;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,qBAAqB,CAAwB,CAAC;AAC9D;;ACpBA;;;;;;AAMG;MAIU,iBAAiB,GAAG,IAAI,cAAc,CAAwB,mBAAmB,EAAE;AAEhG;;;AAGG;SACa,eAAe,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAoB,CAAC;AACtD;;AClBA;;;;;;AAMG;MAIU,wBAAwB,GAAG,IAAI,cAAc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,EAAA,UAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,yBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,EAAA,EAAA,SAAA,EANZ,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAM3D,YAAY,EAAA,UAAA,EAAA,CAAA;kBAVxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;oBACxB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAc,YAAA,EAAE,CAAC;AACtE,oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,eAAe;AAC1C,wBAAA,sBAAsB,EAAE,YAAY;AACrC,qBAAA;AACF,iBAAA,CAAA;;;ACrBD;;;;;;AAMG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-accordion.mjs","sources":["../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.token.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.token.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.token.ts","../../../../packages/ng-primitives/accordion/src/accordion-content/accordion-content.directive.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.token.ts","../../../../packages/ng-primitives/accordion/src/accordion-item/accordion-item.directive.ts","../../../../packages/ng-primitives/accordion/src/accordion-trigger/accordion-trigger.directive.ts","../../../../packages/ng-primitives/accordion/src/config/accordion.config.ts","../../../../packages/ng-primitives/accordion/src/accordion/accordion.directive.ts","../../../../packages/ng-primitives/accordion/src/index.ts","../../../../packages/ng-primitives/accordion/src/ng-primitives-accordion.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordionItem } from './accordion-item.directive';\n\nexport const NgpAccordionItemToken = new InjectionToken<NgpAccordionItem<unknown>>(\n 'NgpAccordionItemToken',\n);\n\n/**\n * Inject the AccordionItem directive instance\n * @returns The AccordionItem directive instance\n */\nexport function injectAccordionItem<T>(): NgpAccordionItem<T> {\n return inject(NgpAccordionItemToken) as NgpAccordionItem<T>;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordion } from './accordion.directive';\n\nexport const NgpAccordionToken = new InjectionToken<NgpAccordion<unknown>>('NgpAccordionToken');\n\n/**\n * Inject the Accordion directive instance\n * @returns The Accordion directive instance\n */\nexport function injectAccordion<T>(): NgpAccordion<T> {\n return inject(NgpAccordionToken) as NgpAccordion<T>;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordionContent } from './accordion-content.directive';\n\nexport const NgpAccordionContentToken = new InjectionToken<NgpAccordionContent>(\n 'NgpAccordionContentToken',\n);\n\n/**\n * Inject the AccordionContent directive instance\n * @returns The AccordionContent directive instance\n */\nexport function injectAccordionContent(): NgpAccordionContent {\n return inject(NgpAccordionContentToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, input } from '@angular/core';\nimport { injectDimensions, uniqueId } from 'ng-primitives/utils';\nimport { injectAccordionItem } from '../accordion-item/accordion-item.token';\nimport { injectAccordion } from '../accordion/accordion.token';\nimport { NgpAccordionContentToken } from './accordion-content.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordionContent]',\n exportAs: 'ngpAccordionContent',\n providers: [{ provide: NgpAccordionContentToken, useExisting: NgpAccordionContent }],\n host: {\n role: 'region',\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion.orientation()',\n '[attr.data-open]': 'dimensions().mounted ? accordionItem.open() : null',\n '[attr.aria-labelledby]': 'accordionItem.triggerId()',\n '[style.--ngp-accordion-content-width.px]': 'dimensions().width',\n '[style.--ngp-accordion-content-height.px]': 'dimensions().height',\n },\n})\nexport class NgpAccordionContent {\n /**\n * Access the accordion\n */\n protected readonly accordion = injectAccordion();\n\n /**\n * Access the accordion item\n */\n protected readonly accordionItem = injectAccordionItem();\n\n /**\n * The id of the content region\n */\n readonly id = input<string>(uniqueId('ngp-accordion-content'));\n\n /**\n * The size of the content region\n */\n protected readonly dimensions = injectDimensions();\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAccordionTrigger } from './accordion-trigger.directive';\n\nexport const NgpAccordionTriggerToken = new InjectionToken<NgpAccordionTrigger>(\n 'NgpAccordionTriggerToken',\n);\n\n/**\n * Inject the AccordionTrigger directive instance\n * @returns The AccordionTrigger directive instance\n */\nexport function injectAccordionTrigger(): NgpAccordionTrigger {\n return inject(NgpAccordionTriggerToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, computed, contentChild, input } from '@angular/core';\nimport { NgpAccordionContentToken } from '../accordion-content/accordion-content.token';\nimport { NgpAccordionTriggerToken } from '../accordion-trigger/accordion-trigger.token';\nimport { injectAccordion } from '../accordion/accordion.token';\nimport { NgpAccordionItemToken } from './accordion-item.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordionItem]',\n exportAs: 'ngpAccordionItem',\n providers: [{ provide: NgpAccordionItemToken, useExisting: NgpAccordionItem }],\n host: {\n '[attr.data-orientation]': 'accordion.orientation()',\n '[attr.data-open]': 'open()',\n '[attr.data-disabled]': 'disabled() || accordion.disabled()',\n },\n})\nexport class NgpAccordionItem<T> {\n /**\n * Access the accordion.\n */\n protected readonly accordion = injectAccordion();\n\n /**\n * The value of the accordion item.\n */\n readonly value = input.required<T>({\n alias: 'ngpAccordionItemValue',\n });\n\n /**\n * Whether the accordion item is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionItemDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Access the accordion trigger\n */\n private readonly trigger = contentChild(NgpAccordionTriggerToken);\n\n /**\n * Access the accordion content\n */\n private readonly content = contentChild(NgpAccordionContentToken);\n\n /**\n * Whether the accordion item is expanded.\n */\n readonly open = computed<boolean>(() => this.accordion.isOpen(this.value()));\n\n /**\n * The trigger id.\n */\n readonly triggerId = computed(() => this.trigger()?.id());\n\n /**\n * The content id.\n */\n readonly contentId = computed(() => this.content()?.id());\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, HostListener, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectAccordionItem } from '../accordion-item/accordion-item.token';\nimport { injectAccordion } from '../accordion/accordion.token';\nimport { NgpAccordionTriggerToken } from './accordion-trigger.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordionTrigger]',\n exportAs: 'ngpAccordionTrigger',\n providers: [{ provide: NgpAccordionTriggerToken, useExisting: NgpAccordionTrigger }],\n hostDirectives: [NgpHover, NgpPress, NgpFocusVisible],\n host: {\n '[id]': 'id()',\n '[attr.data-orientation]': 'accordion.orientation()',\n '[attr.data-open]': 'item.open()',\n '[attr.data-disabled]': 'item.disabled() || accordion.disabled()',\n '[attr.aria-controls]': 'item.contentId()',\n '[attr.aria-expanded]': 'item.open()',\n },\n})\nexport class NgpAccordionTrigger {\n /**\n * Access the parent accordion.\n */\n protected readonly accordion = injectAccordion();\n\n /**\n * The item instance.\n */\n protected readonly item = injectAccordionItem();\n\n /**\n * The id of the trigger.\n */\n readonly id = input<string>(uniqueId('ngp-accordion-trigger'));\n\n /**\n * Toggle the accordion item.\n */\n @HostListener('click')\n toggle(): void {\n if (this.item.disabled() || this.accordion.disabled()) {\n return;\n }\n\n this.accordion.toggle(this.item.value());\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpAccordionType } from '../accordion/accordion.directive';\n\nexport interface NgpAccordionConfig {\n /**\n * The default type of the accordion\n * @default 'single'\n */\n type: NgpAccordionType;\n /**\n * Whether the accordion is collapsible\n * @default false\n */\n collapsible: boolean;\n /**\n * The default orientation of the accordion\n * @default 'vertical'\n */\n orientation: 'vertical' | 'horizontal';\n}\n\nexport const defaultAccordionConfig: NgpAccordionConfig = {\n type: 'single',\n collapsible: false,\n orientation: 'vertical',\n};\n\nexport const NgpAccordionConfigToken = new InjectionToken<NgpAccordionConfig>(\n 'NgpAccordionConfigToken',\n);\n\n/**\n * Provide the default Accordion configuration\n * @param config The Accordion configuration\n * @returns The provider\n */\nexport function provideAccordionConfig(config: Partial<NgpAccordionConfig>): Provider[] {\n return [\n {\n provide: NgpAccordionConfigToken,\n useValue: { ...defaultAccordionConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Accordion configuration\n * @returns The global Accordion configuration\n */\nexport function injectAccordionConfig(): NgpAccordionConfig {\n return inject(NgpAccordionConfigToken, { optional: true }) ?? defaultAccordionConfig;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, model } from '@angular/core';\nimport { injectAccordionConfig } from '../config/accordion.config';\nimport { NgpAccordionToken } from './accordion.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAccordion]',\n exportAs: 'ngpAccordion',\n providers: [{ provide: NgpAccordionToken, useExisting: NgpAccordion }],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled()',\n },\n})\nexport class NgpAccordion<T> {\n /**\n * Access the global accordion configuration.\n */\n private readonly config = injectAccordionConfig();\n\n /**\n * The type of the accordion.\n */\n readonly type = input<NgpAccordionType>(this.config.type, {\n alias: 'ngpAccordionType',\n });\n\n /**\n * Whether the accordion is collapsible.\n */\n readonly collapsible = input<boolean, BooleanInput>(this.config.collapsible, {\n alias: 'ngpAccordionCollapsible',\n transform: booleanAttribute,\n });\n\n /**\n * The value of the accordion.\n */\n readonly value = model<T | T[] | null>(null, {\n alias: 'ngpAccordionValue',\n });\n\n /**\n * Whether the accordion is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpAccordionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The accordion orientation.\n */\n readonly orientation = input<'horizontal' | 'vertical'>(this.config.orientation, {\n alias: 'ngpAccordionOrientation',\n });\n\n /**\n * @param value The value to check.\n * @returns Whether the value is open.\n * @internal\n */\n isOpen(value: T): boolean {\n if (this.type() === 'multiple') {\n return (this.value() as T[] | null)?.includes(value) ?? false;\n }\n\n return this.value() === value;\n }\n\n toggle(value: T): void {\n const isOpen = this.isOpen(value);\n\n // if we are in single mode and the value is already open and the accordion is not collapsible, do nothing\n if (this.type() === 'single' && isOpen && !this.collapsible()) {\n return;\n }\n\n // if we are in single mode then toggle the value\n if (this.type() === 'single') {\n this.value.set(isOpen ? null : value);\n return;\n }\n\n // if we are in multiple mode then toggle the value\n const values = (this.value() as T[]) ?? [];\n\n if (isOpen) {\n this.value.set(values.filter(v => v !== value));\n } else {\n this.value.set([...values, value]);\n }\n }\n}\n\nexport type NgpAccordionType = 'single' | 'multiple';\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpAccordionContent } from './accordion-content/accordion-content.directive';\nexport { NgpAccordionContentToken } from './accordion-content/accordion-content.token';\nexport { NgpAccordionItem } from './accordion-item/accordion-item.directive';\nexport { NgpAccordionItemToken } from './accordion-item/accordion-item.token';\nexport { NgpAccordionTrigger } from './accordion-trigger/accordion-trigger.directive';\nexport { NgpAccordionTriggerToken } from './accordion-trigger/accordion-trigger.token';\nexport { NgpAccordion } from './accordion/accordion.directive';\nexport { NgpAccordionToken } from './accordion/accordion.token';\nexport { NgpAccordionConfig, provideAccordionConfig } from './config/accordion.config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;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AAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,eAAe;AAC1C,wBAAA,sBAAsB,EAAE,YAAY;AACrC,qBAAA;AACF,iBAAA,CAAA;;;ACrBD;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -6,7 +6,7 @@ import { injectStyleInjector } from 'ng-primitives/internal';
6
6
  * Copyright © 2024 Angular Primitives.
7
7
  * https://github.com/ng-primitives/ng-primitives
8
8
  *
9
- * This source code is licensed under the CC BY-ND 4.0 license found in the
9
+ * This source code is licensed under the Apache 2.0 license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  const NgpAutofillToken = new InjectionToken('NgpAutofillToken');
@@ -21,7 +21,7 @@ function injectAutofill() {
21
21
  * Copyright © 2024 Angular Primitives.
22
22
  * https://github.com/ng-primitives/ng-primitives
23
23
  *
24
- * This source code is licensed under the CC BY-ND 4.0 license found in the
24
+ * This source code is licensed under the Apache 2.0 license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
26
  */
27
27
  class NgpAutofill {
@@ -88,7 +88,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
88
88
  * Copyright © 2024 Angular Primitives.
89
89
  * https://github.com/ng-primitives/ng-primitives
90
90
  *
91
- * This source code is licensed under the CC BY-ND 4.0 license found in the
91
+ * This source code is licensed under the Apache 2.0 license found in the
92
92
  * LICENSE file in the root directory of this source tree.
93
93
  */
94
94
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-autofill.mjs","sources":["../../../../packages/ng-primitives/autofill/src/autofill/autofill.token.ts","../../../../packages/ng-primitives/autofill/src/autofill/autofill.directive.ts","../../../../packages/ng-primitives/autofill/src/index.ts","../../../../packages/ng-primitives/autofill/src/ng-primitives-autofill.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAutofill } from './autofill.directive';\n\nexport const NgpAutofillToken = new InjectionToken<NgpAutofill>('NgpAutofillToken');\n\n/**\n * Inject the Autofill directive instance\n */\nexport function injectAutofill(): NgpAutofill {\n return inject(NgpAutofillToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, HostListener, output, signal } from '@angular/core';\nimport { injectStyleInjector } from 'ng-primitives/internal';\nimport { NgpAutofillToken } from './autofill.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAutofill]',\n exportAs: 'ngpAutofill',\n providers: [{ provide: NgpAutofillToken, useExisting: NgpAutofill }],\n host: {\n '[attr.data-autofill]': 'autofilled()',\n },\n})\nexport class NgpAutofill {\n /**\n * Access the style injector.\n */\n private readonly styleInjector = injectStyleInjector();\n\n /**\n * Store the autofill state.\n */\n protected readonly autofilled = signal(false);\n\n /**\n * Emit when the autofill state changes.\n */\n readonly autofillChange = output<boolean>({\n alias: 'ngpAutofill',\n });\n\n constructor() {\n // This technique is based on that used by the Angular CDK\n // https://github.com/angular/components/blob/main/src/cdk/text-field/_index.scss\n this.styleInjector.add(\n 'ngp-autofill',\n `\n @keyframes ngp-autofill-start { }\n @keyframes ngp-autofill-end {}\n\n [data-autofill]:-webkit-autofill {\n animation: ngp-autofill-start 0s 1ms;\n }\n\n [data-autofill]:not(:-webkit-autofill) {\n animation: ngp-autofill-end 0s 1ms;\n }\n `,\n );\n }\n\n @HostListener('animationstart', ['$event'])\n protected onAnimationStart(event: AnimationEvent): void {\n if (event.animationName === 'ngp-autofill-start') {\n this.autofilled.set(true);\n this.autofillChange.emit(true);\n }\n\n if (event.animationName === 'ngp-autofill-end') {\n this.autofilled.set(false);\n this.autofillChange.emit(false);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpAutofill } from './autofill/autofill.directive';\nexport { NgpAutofillToken } from './autofill/autofill.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;;;;AAMG;MAIU,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAEpF;;AAEG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAClC;;ACjBA;;;;;;AAMG;MAcU,WAAW,CAAA;AAkBtB,IAAA,WAAA,GAAA;AAjBA;;AAEG;QACc,IAAa,CAAA,aAAA,GAAG,mBAAmB,EAAE,CAAC;AAEvD;;AAEG;AACgB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAE9C;;AAEG;QACM,IAAc,CAAA,cAAA,GAAG,MAAM,CAAU;AACxC,YAAA,KAAK,EAAE,aAAa;AACrB,SAAA,CAAC,CAAC;;;AAKD,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CACpB,cAAc,EACd,CAAA;;;;;;;;;;;AAWC,MAAA,CAAA,CACF,CAAC;KACH;AAGS,IAAA,gBAAgB,CAAC,KAAqB,EAAA;AAC9C,QAAA,IAAI,KAAK,CAAC,aAAa,KAAK,oBAAoB,EAAE;AAChD,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC1B,YAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;AAED,QAAA,IAAI,KAAK,CAAC,aAAa,KAAK,kBAAkB,EAAE;AAC9C,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3B,YAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACjC;KACF;8GAjDU,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,OAAA,EAAA,EAAA,cAAA,EAAA,aAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,gBAAA,EAAA,0BAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,cAAA,EAAA,EAAA,EAAA,SAAA,EALX,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAKzD,WAAW,EAAA,UAAA,EAAA,CAAA;kBATvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;oBACvB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAa,WAAA,EAAE,CAAC;AACpE,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,cAAc;AACvC,qBAAA;AACF,iBAAA,CAAA;wDAwCW,gBAAgB,EAAA,CAAA;sBADzB,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,CAAA;;;AC1D5C;;;;;;AAMG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-autofill.mjs","sources":["../../../../packages/ng-primitives/autofill/src/autofill/autofill.token.ts","../../../../packages/ng-primitives/autofill/src/autofill/autofill.directive.ts","../../../../packages/ng-primitives/autofill/src/index.ts","../../../../packages/ng-primitives/autofill/src/ng-primitives-autofill.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAutofill } from './autofill.directive';\n\nexport const NgpAutofillToken = new InjectionToken<NgpAutofill>('NgpAutofillToken');\n\n/**\n * Inject the Autofill directive instance\n */\nexport function injectAutofill(): NgpAutofill {\n return inject(NgpAutofillToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, HostListener, output, signal } from '@angular/core';\nimport { injectStyleInjector } from 'ng-primitives/internal';\nimport { NgpAutofillToken } from './autofill.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpAutofill]',\n exportAs: 'ngpAutofill',\n providers: [{ provide: NgpAutofillToken, useExisting: NgpAutofill }],\n host: {\n '[attr.data-autofill]': 'autofilled()',\n },\n})\nexport class NgpAutofill {\n /**\n * Access the style injector.\n */\n private readonly styleInjector = injectStyleInjector();\n\n /**\n * Store the autofill state.\n */\n protected readonly autofilled = signal(false);\n\n /**\n * Emit when the autofill state changes.\n */\n readonly autofillChange = output<boolean>({\n alias: 'ngpAutofill',\n });\n\n constructor() {\n // This technique is based on that used by the Angular CDK\n // https://github.com/angular/components/blob/main/src/cdk/text-field/_index.scss\n this.styleInjector.add(\n 'ngp-autofill',\n `\n @keyframes ngp-autofill-start { }\n @keyframes ngp-autofill-end {}\n\n [data-autofill]:-webkit-autofill {\n animation: ngp-autofill-start 0s 1ms;\n }\n\n [data-autofill]:not(:-webkit-autofill) {\n animation: ngp-autofill-end 0s 1ms;\n }\n `,\n );\n }\n\n @HostListener('animationstart', ['$event'])\n protected onAnimationStart(event: AnimationEvent): void {\n if (event.animationName === 'ngp-autofill-start') {\n this.autofilled.set(true);\n this.autofillChange.emit(true);\n }\n\n if (event.animationName === 'ngp-autofill-end') {\n this.autofilled.set(false);\n this.autofillChange.emit(false);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpAutofill } from './autofill/autofill.directive';\nexport { NgpAutofillToken } from './autofill/autofill.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;;;;AAMG;MAIU,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAEpF;;AAEG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAClC;;ACjBA;;;;;;AAMG;MAcU,WAAW,CAAA;AAkBtB,IAAA,WAAA,GAAA;AAjBA;;AAEG;QACc,IAAa,CAAA,aAAA,GAAG,mBAAmB,EAAE,CAAC;AAEvD;;AAEG;AACgB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAE9C;;AAEG;QACM,IAAc,CAAA,cAAA,GAAG,MAAM,CAAU;AACxC,YAAA,KAAK,EAAE,aAAa;AACrB,SAAA,CAAC,CAAC;;;AAKD,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CACpB,cAAc,EACd,CAAA;;;;;;;;;;;AAWC,MAAA,CAAA,CACF,CAAC;KACH;AAGS,IAAA,gBAAgB,CAAC,KAAqB,EAAA;AAC9C,QAAA,IAAI,KAAK,CAAC,aAAa,KAAK,oBAAoB,EAAE;AAChD,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC1B,YAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;AAED,QAAA,IAAI,KAAK,CAAC,aAAa,KAAK,kBAAkB,EAAE;AAC9C,YAAA,IAAI,CAAC,UAAU,CAAC,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ng-primitives
12
12
  *
13
- * This source code is licensed under the CC BY-ND 4.0 license found in the
13
+ * This source code is licensed under the Apache 2.0 license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
16
  const NgpAvatarToken = new InjectionToken('NgpAvatarToken');
@@ -26,7 +26,7 @@ function injectAvatar() {
26
26
  * Copyright © 2024 Angular Primitives.
27
27
  * https://github.com/ng-primitives/ng-primitives
28
28
  *
29
- * This source code is licensed under the CC BY-ND 4.0 license found in the
29
+ * This source code is licensed under the Apache 2.0 license found in the
30
30
  * LICENSE file in the root directory of this source tree.
31
31
  */
32
32
  class NgpAvatar {
@@ -72,7 +72,7 @@ var NgpAvatarState;
72
72
  * Copyright © 2024 Angular Primitives.
73
73
  * https://github.com/ng-primitives/ng-primitives
74
74
  *
75
- * This source code is licensed under the CC BY-ND 4.0 license found in the
75
+ * This source code is licensed under the Apache 2.0 license found in the
76
76
  * LICENSE file in the root directory of this source tree.
77
77
  */
78
78
  const defaultAvatarConfig = {
@@ -155,7 +155,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
155
155
  * Copyright © 2024 Angular Primitives.
156
156
  * https://github.com/ng-primitives/ng-primitives
157
157
  *
158
- * This source code is licensed under the CC BY-ND 4.0 license found in the
158
+ * This source code is licensed under the Apache 2.0 license found in the
159
159
  * LICENSE file in the root directory of this source tree.
160
160
  */
161
161
  class NgpAvatarImage {
@@ -218,7 +218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
218
218
  * Copyright © 2024 Angular Primitives.
219
219
  * https://github.com/ng-primitives/ng-primitives
220
220
  *
221
- * This source code is licensed under the CC BY-ND 4.0 license found in the
221
+ * This source code is licensed under the Apache 2.0 license found in the
222
222
  * LICENSE file in the root directory of this source tree.
223
223
  */
224
224
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-avatar.mjs","sources":["../../../../packages/ng-primitives/avatar/src/avatar/avatar.token.ts","../../../../packages/ng-primitives/avatar/src/avatar/avatar.directive.ts","../../../../packages/ng-primitives/avatar/src/config/avatar.config.ts","../../../../packages/ng-primitives/avatar/src/avatar-fallback/avatar-fallback.directive.ts","../../../../packages/ng-primitives/avatar/src/avatar-image/avatar-image.directive.ts","../../../../packages/ng-primitives/avatar/src/index.ts","../../../../packages/ng-primitives/avatar/src/ng-primitives-avatar.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAvatar } from './avatar.directive';\n\nexport const NgpAvatarToken = new InjectionToken<NgpAvatar>('NgpAvatarToken');\n\n/**\n * Provide the avatar\n * @returns The provider\n */\nexport function injectAvatar(): NgpAvatar {\n return inject(NgpAvatarToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, signal } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpAvatarToken } from './avatar.token';\n\n@Directive({\n selector: '[ngpAvatar]',\n standalone: true,\n providers: [{ provide: NgpAvatarToken, useExisting: NgpAvatar }],\n host: {\n '[attr.data-state]': 'state()',\n },\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n})\nexport class NgpAvatar {\n /**\n * Store the current state of the avatar.\n * @internal\n */\n readonly state = signal(NgpAvatarState.Idle);\n\n /**\n * Set the avatar state.\n * @param state The state to set.\n * @internal\n */\n setState(state: NgpAvatarState): void {\n this.state.set(state);\n }\n}\n\nexport enum NgpAvatarState {\n Idle = 'idle',\n Loading = 'loading',\n Loaded = 'loaded',\n Error = 'error',\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, Provider, inject } from '@angular/core';\n\nexport interface NgpAvatarConfig {\n /**\n * Define a delay before the fallback is shown. This is useful to only show the fallback for those with slower connections.\n * @default 0\n */\n delay: number;\n}\n\nexport const defaultAvatarConfig: NgpAvatarConfig = {\n delay: 0,\n};\n\nexport const NgpAvatarConfigToken = new InjectionToken<NgpAvatarConfig>('NgpAvatarConfigToken');\n\n/**\n * Provide the avatar config\n * @param config The avatar config\n * @returns The provider\n */\nexport function provideAvatarConfig(config: Partial<NgpAvatarConfig>): Provider[] {\n return [\n {\n provide: NgpAvatarConfigToken,\n useValue: { ...defaultAvatarConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the avatar config\n * @returns The global avatar config\n */\nexport function injectAvatarConfig(): NgpAvatarConfig {\n return inject(NgpAvatarConfigToken, { optional: true }) ?? defaultAvatarConfig;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, OnInit, computed, input, numberAttribute, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { NgpAvatarState } from '../avatar/avatar.directive';\nimport { injectAvatar } from '../avatar/avatar.token';\nimport { injectAvatarConfig } from '../config/avatar.config';\n\n@Directive({\n selector: '[ngpAvatarFallback]',\n standalone: true,\n host: {\n '[style.display]': 'visible() ? null : \"none\"',\n },\n})\nexport class NgpAvatarFallback implements OnInit {\n /**\n * Access the avatar\n */\n private readonly avatar = injectAvatar();\n\n /**\n * Access the global configuration.\n */\n private readonly config = injectAvatarConfig();\n\n /**\n * Access the disposable utilities.\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Define a delay before the fallback is shown. This is useful to only show the fallback for those with slower connections.\n * @default 0\n */\n readonly delay = input<number, NumberInput>(this.config.delay, {\n alias: 'ngpAvatarFallbackDelay',\n transform: numberAttribute,\n });\n\n /**\n * Determine if this element should be hidden.\n * @returns True if the element should be visible\n */\n protected readonly visible = computed(\n () =>\n // we need to check if the element can render and if the avatar is not in a loaded state\n this.delayElapsed() && this.avatar.state() !== NgpAvatarState.Loaded,\n );\n\n /**\n * Determine the delay has elapsed, and we can show the fallback.\n */\n private delayElapsed = signal(false);\n\n ngOnInit(): void {\n this.disposables.setTimeout(() => this.delayElapsed.set(true), this.delay());\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, ElementRef, HostListener, OnInit, inject } from '@angular/core';\nimport { NgpVisuallyHidden, injectVisuallyHidden } from 'ng-primitives/a11y';\nimport { NgpAvatarState } from '../avatar/avatar.directive';\nimport { injectAvatar } from '../avatar/avatar.token';\n\n@Directive({\n selector: 'img[ngpAvatarImage]',\n standalone: true,\n hostDirectives: [NgpVisuallyHidden],\n})\nexport class NgpAvatarImage implements OnInit {\n /**\n * Control the visibility of the image.\n */\n protected readonly visuallyHidden = injectVisuallyHidden();\n\n /**\n * Access the avatar\n */\n private readonly avatar = injectAvatar();\n\n /**\n * Access the image element ref.\n */\n private readonly elementRef = inject<ElementRef<HTMLImageElement>>(ElementRef);\n\n ngOnInit(): void {\n // mark the avatar as loading\n this.setState(NgpAvatarState.Loading);\n\n // if there is no src, we can report this as an error\n if (!this.elementRef.nativeElement.src) {\n this.setState(NgpAvatarState.Error);\n }\n\n // if the image has already loaded, we can report this to the avatar\n if (this.elementRef.nativeElement.complete) {\n this.setState(NgpAvatarState.Loaded);\n }\n }\n\n @HostListener('load')\n protected onLoad(): void {\n this.setState(NgpAvatarState.Loaded);\n }\n\n @HostListener('error')\n protected onError(): void {\n this.setState(NgpAvatarState.Error);\n }\n\n private setState(state: NgpAvatarState) {\n this.avatar.setState(state);\n\n // if the state is loaded then we should make the image visible\n this.visuallyHidden.setVisibility(state === NgpAvatarState.Loaded);\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpAvatarFallback } from './avatar-fallback/avatar-fallback.directive';\nexport { NgpAvatarImage } from './avatar-image/avatar-image.directive';\nexport { NgpAvatar, NgpAvatarState } from './avatar/avatar.directive';\nexport { NgpAvatarToken } from './avatar/avatar.token';\nexport { NgpAvatarConfig, provideAvatarConfig } from './config/avatar.config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAAA;;;;;;AAMG;MAIU,cAAc,GAAG,IAAI,cAAc,CAAY,gBAAgB,EAAE;AAE9E;;;AAGG;SACa,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAChC;;AClBA;;;;;;AAMG;MAcU,SAAS,CAAA;AATtB,IAAA,WAAA,GAAA;AAUE;;;AAGG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAU9C,KAAA;AARC;;;;AAIG;AACH,IAAA,QAAQ,CAAC,KAAqB,EAAA;AAC5B,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACvB;8GAdU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,EAAA,EAAA,SAAA,EANT,CAAC,EAAE,OAAO,EAAE,cA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","../../../../packages/ng-primitives/avatar/src/avatar/avatar.directive.ts","../../../../packages/ng-primitives/avatar/src/config/avatar.config.ts","../../../../packages/ng-primitives/avatar/src/avatar-fallback/avatar-fallback.directive.ts","../../../../packages/ng-primitives/avatar/src/avatar-image/avatar-image.directive.ts","../../../../packages/ng-primitives/avatar/src/index.ts","../../../../packages/ng-primitives/avatar/src/ng-primitives-avatar.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpAvatar } from './avatar.directive';\n\nexport const NgpAvatarToken = new InjectionToken<NgpAvatar>('NgpAvatarToken');\n\n/**\n * Provide the avatar\n * @returns The provider\n */\nexport function injectAvatar(): NgpAvatar {\n return inject(NgpAvatarToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, signal } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpAvatarToken } from './avatar.token';\n\n@Directive({\n selector: '[ngpAvatar]',\n standalone: true,\n providers: [{ provide: NgpAvatarToken, useExisting: NgpAvatar }],\n host: {\n '[attr.data-state]': 'state()',\n },\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n})\nexport class NgpAvatar {\n /**\n * Store the current state of the avatar.\n * @internal\n */\n readonly state = signal(NgpAvatarState.Idle);\n\n /**\n * Set the avatar state.\n * @param state The state to set.\n * @internal\n */\n setState(state: NgpAvatarState): void {\n this.state.set(state);\n }\n}\n\nexport enum NgpAvatarState {\n Idle = 'idle',\n Loading = 'loading',\n Loaded = 'loaded',\n Error = 'error',\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, Provider, inject } from '@angular/core';\n\nexport interface NgpAvatarConfig {\n /**\n * Define a delay before the fallback is shown. This is useful to only show the fallback for those with slower connections.\n * @default 0\n */\n delay: number;\n}\n\nexport const defaultAvatarConfig: NgpAvatarConfig = {\n delay: 0,\n};\n\nexport const NgpAvatarConfigToken = new InjectionToken<NgpAvatarConfig>('NgpAvatarConfigToken');\n\n/**\n * Provide the avatar config\n * @param config The avatar config\n * @returns The provider\n */\nexport function provideAvatarConfig(config: Partial<NgpAvatarConfig>): Provider[] {\n return [\n {\n provide: NgpAvatarConfigToken,\n useValue: { ...defaultAvatarConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the avatar config\n * @returns The global avatar config\n */\nexport function injectAvatarConfig(): NgpAvatarConfig {\n return inject(NgpAvatarConfigToken, { optional: true }) ?? defaultAvatarConfig;\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { NumberInput } from '@angular/cdk/coercion';\nimport { Directive, OnInit, computed, input, numberAttribute, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\nimport { NgpAvatarState } from '../avatar/avatar.directive';\nimport { injectAvatar } from '../avatar/avatar.token';\nimport { injectAvatarConfig } from '../config/avatar.config';\n\n@Directive({\n selector: '[ngpAvatarFallback]',\n standalone: true,\n host: {\n '[style.display]': 'visible() ? null : \"none\"',\n },\n})\nexport class NgpAvatarFallback implements OnInit {\n /**\n * Access the avatar\n */\n private readonly avatar = injectAvatar();\n\n /**\n * Access the global configuration.\n */\n private readonly config = injectAvatarConfig();\n\n /**\n * Access the disposable utilities.\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Define a delay before the fallback is shown. This is useful to only show the fallback for those with slower connections.\n * @default 0\n */\n readonly delay = input<number, NumberInput>(this.config.delay, {\n alias: 'ngpAvatarFallbackDelay',\n transform: numberAttribute,\n });\n\n /**\n * Determine if this element should be hidden.\n * @returns True if the element should be visible\n */\n protected readonly visible = computed(\n () =>\n // we need to check if the element can render and if the avatar is not in a loaded state\n this.delayElapsed() && this.avatar.state() !== NgpAvatarState.Loaded,\n );\n\n /**\n * Determine the delay has elapsed, and we can show the fallback.\n */\n private delayElapsed = signal(false);\n\n ngOnInit(): void {\n this.disposables.setTimeout(() => this.delayElapsed.set(true), this.delay());\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, ElementRef, HostListener, OnInit, inject } from '@angular/core';\nimport { NgpVisuallyHidden, injectVisuallyHidden } from 'ng-primitives/a11y';\nimport { NgpAvatarState } from '../avatar/avatar.directive';\nimport { injectAvatar } from '../avatar/avatar.token';\n\n@Directive({\n selector: 'img[ngpAvatarImage]',\n standalone: true,\n hostDirectives: [NgpVisuallyHidden],\n})\nexport class NgpAvatarImage implements OnInit {\n /**\n * Control the visibility of the image.\n */\n protected readonly visuallyHidden = injectVisuallyHidden();\n\n /**\n * Access the avatar\n */\n private readonly avatar = injectAvatar();\n\n /**\n * Access the image element ref.\n */\n private readonly elementRef = inject<ElementRef<HTMLImageElement>>(ElementRef);\n\n ngOnInit(): void {\n // mark the avatar as loading\n this.setState(NgpAvatarState.Loading);\n\n // if there is no src, we can report this as an error\n if (!this.elementRef.nativeElement.src) {\n this.setState(NgpAvatarState.Error);\n }\n\n // if the image has already loaded, we can report this to the avatar\n if (this.elementRef.nativeElement.complete) {\n this.setState(NgpAvatarState.Loaded);\n }\n }\n\n @HostListener('load')\n protected onLoad(): void {\n this.setState(NgpAvatarState.Loaded);\n }\n\n @HostListener('error')\n protected onError(): void {\n this.setState(NgpAvatarState.Error);\n }\n\n private setState(state: NgpAvatarState) {\n this.avatar.setState(state);\n\n // if the state is loaded then we should make the image visible\n this.visuallyHidden.setVisibility(state === NgpAvatarState.Loaded);\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpAvatarFallback } from './avatar-fallback/avatar-fallback.directive';\nexport { NgpAvatarImage } from './avatar-image/avatar-image.directive';\nexport { NgpAvatar, NgpAvatarState } from './avatar/avatar.directive';\nexport { NgpAvatarToken } from './avatar/avatar.token';\nexport { NgpAvatarConfig, provideAvatarConfig } from './config/avatar.config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAAA;;;;;;AAMG;MAIU,cAAc,GAAG,IAAI,cAAc,CAAY,gBAAgB,EAAE;AAE9E;;;AAGG;SACa,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAChC;;AClBA;;;;;;AAMG;MAcU,SAAS,CAAA;AATtB,IAAA,WAAA,GAAA;AAUE;;;AAGG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAU9C,KAAA;AARC;;;;AAIG;AACH,IAAA,QAAQ,CAAC,KAAqB,EAAA;AAC5B,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACvB;8GAdU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,EAAA,EAAA,SAAA,EANT,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,CA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
  *
11
- * This source code is licensed under the CC BY-ND 4.0 license found in the
11
+ * This source code is licensed under the Apache 2.0 license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
  const NgpButtonToken = new InjectionToken('NgpButtonToken');
@@ -64,7 +64,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
64
64
  * Copyright © 2024 Angular Primitives.
65
65
  * https://github.com/ng-primitives/ng-primitives
66
66
  *
67
- * This source code is licensed under the CC BY-ND 4.0 license found in the
67
+ * This source code is licensed under the Apache 2.0 license found in the
68
68
  * LICENSE file in the root directory of this source tree.
69
69
  */
70
70
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-button.mjs","sources":["../../../../packages/ng-primitives/button/src/button/button.token.ts","../../../../packages/ng-primitives/button/src/button/button.directive.ts","../../../../packages/ng-primitives/button/src/index.ts","../../../../packages/ng-primitives/button/src/ng-primitives-button.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpButton } from './button.directive';\n\nexport const NgpButtonToken = new InjectionToken<NgpButton>('NgpButtonToken');\n\n/**\n * Inject the Button directive instance\n */\nexport function injectButton(): NgpButton {\n return inject(NgpButtonToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, booleanAttribute, inject, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpCanDisable, NgpDisabledToken } from 'ng-primitives/internal';\nimport { NgpButtonToken } from './button.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpButton]',\n exportAs: 'ngpButton',\n providers: [\n { provide: NgpButtonToken, useExisting: NgpButton },\n { provide: NgpDisabledToken, useExisting: NgpButton },\n ],\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.disabled]': 'isButton && disabled() ? true : null',\n },\n})\nexport class NgpButton implements NgpCanDisable {\n /**\n * Get the native element of the button.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * Detect if this is an HTML button element.\n */\n protected readonly isButton = this.elementRef.nativeElement.tagName.toLowerCase() === 'button';\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpButton } from './button/button.directive';\nexport { NgpButtonToken } from './button/button.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,cAAc,GAAG,IAAI,cAAc,CAAY,gBAAgB,EAAE;AAE9E;;AAEG;SACa,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAChC;;MCUa,SAAS,CAAA;AAdtB,IAAA,WAAA,GAAA;AAeE;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAE1E;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACgB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,Q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AO,EAAE,cAAc,EAAE,WAAW,WAAW,EAAE;AACnD,wBAAA,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,WAAW,EAAE;AACtD,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,CAAC;AACrD,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,iBAAiB,EAAE,sCAAsC;AAC1D,qBAAA;AACF,iBAAA,CAAA;;;AC1BD;;;;;;AAMG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-button.mjs","sources":["../../../../packages/ng-primitives/button/src/button/button.token.ts","../../../../packages/ng-primitives/button/src/button/button.directive.ts","../../../../packages/ng-primitives/button/src/index.ts","../../../../packages/ng-primitives/button/src/ng-primitives-button.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpButton } from './button.directive';\n\nexport const NgpButtonToken = new InjectionToken<NgpButton>('NgpButtonToken');\n\n/**\n * Inject the Button directive instance\n */\nexport function injectButton(): NgpButton {\n return inject(NgpButtonToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, booleanAttribute, inject, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpCanDisable, NgpDisabledToken } from 'ng-primitives/internal';\nimport { NgpButtonToken } from './button.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpButton]',\n exportAs: 'ngpButton',\n providers: [\n { provide: NgpButtonToken, useExisting: NgpButton },\n { provide: NgpDisabledToken, useExisting: NgpButton },\n ],\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.disabled]': 'isButton && disabled() ? true : null',\n },\n})\nexport class NgpButton implements NgpCanDisable {\n /**\n * Get the native element of the button.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * Detect if this is an HTML button element.\n */\n protected readonly isButton = this.elementRef.nativeElement.tagName.toLowerCase() === 'button';\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpButton } from './button/button.directive';\nexport { NgpButtonToken } from './button/button.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,cAAc,GAAG,IAAI,cAAc,CAAY,gBAAgB,EAAE;AAE9E;;AAEG;SACa,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAChC;;MCUa,SAAS,CAAA;AAdtB,IAAA,WAAA,GAAA;AAeE;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAE1E;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACgB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;AAChG,KAAA;8GAjBY,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,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AAE,WAAW,WAAW,EAAE;AACtD,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,CAAC;AACrD,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,iBAAiB,EAAE,sCAAsC;AAC1D,qBAAA;AACF,iBAAA,CAAA;;;AC1BD;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -11,7 +11,7 @@ import { uniqueId } from 'ng-primitives/utils';
11
11
  * Copyright © 2024 Angular Primitives.
12
12
  * https://github.com/ng-primitives/ng-primitives
13
13
  *
14
- * This source code is licensed under the CC BY-ND 4.0 license found in the
14
+ * This source code is licensed under the Apache 2.0 license found in the
15
15
  * LICENSE file in the root directory of this source tree.
16
16
  */
17
17
  const NgpCheckboxToken = new InjectionToken('NgpCheckboxToken');
@@ -112,7 +112,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
112
112
  * Copyright © 2024 Angular Primitives.
113
113
  * https://github.com/ng-primitives/ng-primitives
114
114
  *
115
- * This source code is licensed under the CC BY-ND 4.0 license found in the
115
+ * This source code is licensed under the Apache 2.0 license found in the
116
116
  * LICENSE file in the root directory of this source tree.
117
117
  */
118
118
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-checkbox.mjs","sources":["../../../../packages/ng-primitives/checkbox/src/checkbox/checkbox.token.ts","../../../../packages/ng-primitives/checkbox/src/checkbox/checkbox.directive.ts","../../../../packages/ng-primitives/checkbox/src/index.ts","../../../../packages/ng-primitives/checkbox/src/ng-primitives-checkbox.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpCheckbox } from './checkbox.directive';\n\nexport const NgpCheckboxToken = new InjectionToken<NgpCheckbox>('NgpCheckboxToken');\n\n/**\n * Inject the Checkbox directive instance\n * @returns The Checkbox directive instance\n */\nexport function injectCheckbox(): NgpCheckbox {\n return inject(NgpCheckboxToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, booleanAttribute, input, model } from '@angular/core';\nimport { NgpFormControl } from 'ng-primitives/form-field';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpCanDisable, NgpDisabledToken } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpCheckboxToken } from './checkbox.token';\n\n@Directive({\n selector: '[ngpCheckbox]',\n standalone: true,\n providers: [\n { provide: NgpCheckboxToken, useExisting: NgpCheckbox },\n { provide: NgpDisabledToken, useExisting: NgpCheckbox },\n ],\n hostDirectives: [NgpFormControl, NgpHover, NgpFocusVisible, NgpPress],\n host: {\n role: 'checkbox',\n '[attr.aria-checked]': 'indeterminate() ? \"mixed\" : checked()',\n '[attr.data-checked]': 'checked()',\n '[attr.data-indeterminate]': 'indeterminate()',\n '[tabindex]': 'disabled() ? -1 : 0',\n },\n})\nexport class NgpCheckbox implements NgpCanDisable {\n /**\n * The id of the checkbox.\n * @internal\n */\n readonly id = input(uniqueId('ngp-checkbox'));\n\n /**\n * Defines whether the checkbox is checked.\n */\n readonly checked = model<boolean>(false, {\n alias: 'ngpCheckboxChecked',\n });\n\n /**\n * Defines whether the checkbox is indeterminate.\n */\n readonly indeterminate = model<boolean>(false, {\n alias: 'ngpCheckboxIndeterminate',\n });\n\n /**\n * Whether the checkbox is required.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxRequired',\n transform: booleanAttribute,\n });\n\n /**\n * Defines whether the checkbox is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxDisabled',\n transform: booleanAttribute,\n });\n\n @HostListener('keydown.enter', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n event.preventDefault();\n }\n\n @HostListener('click', ['$event'])\n @HostListener('keydown.space', ['$event'])\n toggle(event?: Event): void {\n if (this.disabled()) {\n return;\n }\n\n // prevent this firing twice in cases where the label is clicked and the checkbox is clicked by the one event\n event?.preventDefault();\n\n this.checked.set(this.indeterminate() ? true : !this.checked());\n\n // if the checkbox was indeterminate, it isn't anymore\n if (this.indeterminate()) {\n this.indeterminate.set(false);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpCheckbox } from './checkbox/checkbox.directive';\nexport { NgpCheckboxToken } from './checkbox/checkbox.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;AAMG;MAIU,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAEpF;;;AAGG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAClC;;MCaa,WAAW,CAAA;AAhBxB,IAAA,WAAA,GAAA;AAiBE;;;AAGG;QACM,IAAE,CAAA,EAAA,GAAG,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AAE9C;;AAEG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,KAAK,EAAE;AACvC,YAAA,KAAK,EAAE,oBAAoB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAU,KAAK,EAAE;AAC7C,YAAA,KAAK,EAAE,0BAA0B;AACl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ives/checkbox/src/checkbox/checkbox.directive.ts","../../../../packages/ng-primitives/checkbox/src/index.ts","../../../../packages/ng-primitives/checkbox/src/ng-primitives-checkbox.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpCheckbox } from './checkbox.directive';\n\nexport const NgpCheckboxToken = new InjectionToken<NgpCheckbox>('NgpCheckboxToken');\n\n/**\n * Inject the Checkbox directive instance\n * @returns The Checkbox directive instance\n */\nexport function injectCheckbox(): NgpCheckbox {\n return inject(NgpCheckboxToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, booleanAttribute, input, model } from '@angular/core';\nimport { NgpFormControl } from 'ng-primitives/form-field';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpCanDisable, NgpDisabledToken } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpCheckboxToken } from './checkbox.token';\n\n@Directive({\n selector: '[ngpCheckbox]',\n standalone: true,\n providers: [\n { provide: NgpCheckboxToken, useExisting: NgpCheckbox },\n { provide: NgpDisabledToken, useExisting: NgpCheckbox },\n ],\n hostDirectives: [NgpFormControl, NgpHover, NgpFocusVisible, NgpPress],\n host: {\n role: 'checkbox',\n '[attr.aria-checked]': 'indeterminate() ? \"mixed\" : checked()',\n '[attr.data-checked]': 'checked()',\n '[attr.data-indeterminate]': 'indeterminate()',\n '[tabindex]': 'disabled() ? -1 : 0',\n },\n})\nexport class NgpCheckbox implements NgpCanDisable {\n /**\n * The id of the checkbox.\n * @internal\n */\n readonly id = input(uniqueId('ngp-checkbox'));\n\n /**\n * Defines whether the checkbox is checked.\n */\n readonly checked = model<boolean>(false, {\n alias: 'ngpCheckboxChecked',\n });\n\n /**\n * Defines whether the checkbox is indeterminate.\n */\n readonly indeterminate = model<boolean>(false, {\n alias: 'ngpCheckboxIndeterminate',\n });\n\n /**\n * Whether the checkbox is required.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxRequired',\n transform: booleanAttribute,\n });\n\n /**\n * Defines whether the checkbox is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxDisabled',\n transform: booleanAttribute,\n });\n\n @HostListener('keydown.enter', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n event.preventDefault();\n }\n\n @HostListener('click', ['$event'])\n @HostListener('keydown.space', ['$event'])\n toggle(event?: Event): void {\n if (this.disabled()) {\n return;\n }\n\n // prevent this firing twice in cases where the label is clicked and the checkbox is clicked by the one event\n event?.preventDefault();\n\n this.checked.set(this.indeterminate() ? true : !this.checked());\n\n // if the checkbox was indeterminate, it isn't anymore\n if (this.indeterminate()) {\n this.indeterminate.set(false);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpCheckbox } from './checkbox/checkbox.directive';\nexport { NgpCheckboxToken } from './checkbox/checkbox.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;AAMG;MAIU,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAEpF;;;AAGG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAClC;;MCaa,WAAW,CAAA;AAhBxB,IAAA,WAAA,GAAA;AAiBE;;;AAGG;QACM,IAAE,C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,QAAQ,CAAC,CAAA;gBAQzC,MAAM,EAAA,CAAA;sBAFL,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAA;;sBAChC,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAA;;;AC3E3C;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -8,7 +8,7 @@ import { NgpHover, NgpFocusVisible, NgpPress } from 'ng-primitives/interactions'
8
8
  * Copyright © 2024 Angular Primitives.
9
9
  * https://github.com/ng-primitives/ng-primitives
10
10
  *
11
- * This source code is licensed under the CC BY-ND 4.0 license found in the
11
+ * This source code is licensed under the Apache 2.0 license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
  const NgpFileUploadToken = new InjectionToken('NgpFileUploadToken');
@@ -23,7 +23,7 @@ function injectFileUpload() {
23
23
  * Copyright © 2024 Angular Primitives.
24
24
  * https://github.com/ng-primitives/ng-primitives
25
25
  *
26
- * This source code is licensed under the CC BY-ND 4.0 license found in the
26
+ * This source code is licensed under the Apache 2.0 license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
28
  */
29
29
  class NgpFileUpload {
@@ -180,7 +180,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
180
180
  * Copyright © 2024 Angular Primitives.
181
181
  * https://github.com/ng-primitives/ng-primitives
182
182
  *
183
- * This source code is licensed under the CC BY-ND 4.0 license found in the
183
+ * This source code is licensed under the Apache 2.0 license found in the
184
184
  * LICENSE file in the root directory of this source tree.
185
185
  */
186
186
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.token.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.directive.ts","../../../../packages/ng-primitives/file-upload/src/index.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpFileUpload } from './file-upload.directive';\n\nexport const NgpFileUploadToken = new InjectionToken<NgpFileUpload>('NgpFileUploadToken');\n\n/**\n * Inject the FileUpload directive instance\n */\nexport function injectFileUpload(): NgpFileUpload {\n return inject(NgpFileUploadToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpFileUploadToken } from './file-upload.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [{ provide: NgpFileUploadToken, useExisting: NgpFileUpload }],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.data-dragover]': 'isDragOver()',\n },\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n})\nexport class NgpFileUpload {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types.\n */\n readonly fileTypes = input<string[] | undefined, string>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: coerceStringArray,\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether drag-and-drop is enabled.\n */\n readonly dragAndDrop = input<boolean, BooleanInput>(true, {\n alias: 'ngpFileUploadDragDrop',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileUploadSelected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileUploadDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n private readonly isDragOver = signal<boolean>(false);\n\n /**\n * Store the file input element.\n */\n private input: HTMLInputElement = document.createElement('input');\n\n constructor() {\n this.input.type = 'file';\n this.input.addEventListener('change', () => this.selected.emit(this.input.files));\n }\n\n @HostListener('click')\n protected showFileDialog(): void {\n if (this.disabled()) {\n return;\n }\n\n const fileTypes = this.fileTypes()?.join(',');\n\n if (fileTypes) {\n this.input.accept = fileTypes;\n }\n\n this.input.multiple = this.multiple();\n this.input.webkitdirectory = this.directory();\n this.input.click();\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport { NgpFileUpload } from './file-upload/file-upload.directive';\nexport { NgpFileUploadToken, injectFileUpload } from './file-upload/file-upload.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,EAAE;AAE1F;;AAEG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACpC;;ACjBA;;;;;;AAMG;MA0BU,aAAa,CAAA;AAsExB,IAAA,WAAA,GAAA;AArEA;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAE1E;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA+B,SAAS,EAAE;AAClE,YAAA,KAAK,EAAE,wBAAwB;AAC/B,YAAA,SAAS,EAAE,iBAAiB;AAC7B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,uBAAuB;AAC9B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAwB,KAAK,EAAE;AACvD,YAAA,KAAK,EAAE,wBAAwB;AAC/B,YAAA,SA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AA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,sBAAsB,EAAE,cAAc;AACvC,qBAAA;AACD,oBAAA,cAAc,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,CAAC;AACtD,iBAAA,CAAA;wDA6EW,cAAc,EAAA,CAAA;sBADvB,YAAY;uBAAC,OAAO,CAAA;gBAkBX,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAa3B,UAAU,EAAA,CAAA;sBADnB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAY1B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAkB3B,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAA;;;ACpKlC;;;;;;AAMG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.token.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.directive.ts","../../../../packages/ng-primitives/file-upload/src/index.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpFileUpload } from './file-upload.directive';\n\nexport const NgpFileUploadToken = new InjectionToken<NgpFileUpload>('NgpFileUploadToken');\n\n/**\n * Inject the FileUpload directive instance\n */\nexport function injectFileUpload(): NgpFileUpload {\n return inject(NgpFileUploadToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpFileUploadToken } from './file-upload.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [{ provide: NgpFileUploadToken, useExisting: NgpFileUpload }],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.data-dragover]': 'isDragOver()',\n },\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n})\nexport class NgpFileUpload {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types.\n */\n readonly fileTypes = input<string[] | undefined, string>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: coerceStringArray,\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether drag-and-drop is enabled.\n */\n readonly dragAndDrop = input<boolean, BooleanInput>(true, {\n alias: 'ngpFileUploadDragDrop',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileUploadSelected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileUploadDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n private readonly isDragOver = signal<boolean>(false);\n\n /**\n * Store the file input element.\n */\n private input: HTMLInputElement = document.createElement('input');\n\n constructor() {\n this.input.type = 'file';\n this.input.addEventListener('change', () => this.selected.emit(this.input.files));\n }\n\n @HostListener('click')\n protected showFileDialog(): void {\n if (this.disabled()) {\n return;\n }\n\n const fileTypes = this.fileTypes()?.join(',');\n\n if (fileTypes) {\n this.input.accept = fileTypes;\n }\n\n this.input.multiple = this.multiple();\n this.input.webkitdirectory = this.directory();\n this.input.click();\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the Apache 2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport { NgpFileUpload } from './file-upload/file-upload.directive';\nexport { NgpFileUploadToken, injectFileUpload } from './file-upload/file-upload.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,EAAE;AAE1F;;AAEG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACpC;;ACjBA;;;;;;AAMG;MA0BU,aAAa,CAAA;AAsExB,IAAA,WAAA,GAAA;AArEA;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAE1E;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA+B,SAAS,EAAE;AAClE,YAAA,KAAK,EAAE,wBAAwB;AAC/B,YAAA,SAAS,EAAE,iBAAiB;AAC7B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,uBAAuB;AAC9B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAwB,KAAK,EAAE;AACvD,YAAA,KAAK,EAAE,wBAAwB;AAC/B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAwB,IAAI,EAAE;AACxD,YAAA,KAAK,EAAE,uBAAuB;AAC9B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,uBAAuB;AAC9B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;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AAE,CAAC,QAAQ,CAAC,CAAA;gBAY1B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAkB3B,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAA;;;ACpKlC;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -6,7 +6,7 @@ import { InjectionToken, inject, ElementRef, NgZone, input, booleanAttribute, Di
6
6
  * Copyright © 2024 Angular Primitives.
7
7
  * https://github.com/ng-primitives/ng-primitives
8
8
  *
9
- * This source code is licensed under the CC BY-ND 4.0 license found in the
9
+ * This source code is licensed under the Apache 2.0 license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  const NgpFocusTrapToken = new InjectionToken('NgpFocusTrapToken');
@@ -21,7 +21,7 @@ function injectFocusTrap() {
21
21
  * Copyright © 2024 Angular Primitives.
22
22
  * https://github.com/ng-primitives/ng-primitives
23
23
  *
24
- * This source code is licensed under the CC BY-ND 4.0 license found in the
24
+ * This source code is licensed under the Apache 2.0 license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
26
  */
27
27
  /**
@@ -279,7 +279,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
279
279
  * Copyright © 2024 Angular Primitives.
280
280
  * https://github.com/ng-primitives/ng-primitives
281
281
  *
282
- * This source code is licensed under the CC BY-ND 4.0 license found in the
282
+ * This source code is licensed under the Apache 2.0 license found in the
283
283
  * LICENSE file in the root directory of this source tree.
284
284
  */
285
285