@ngbase/adk 0.1.10 → 0.1.12

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 (380) hide show
  1. package/a11y/index.d.ts +151 -5
  2. package/accordion/index.d.ts +44 -5
  3. package/autocomplete/index.d.ts +54 -5
  4. package/avatar/index.d.ts +25 -5
  5. package/bidi/index.d.ts +17 -5
  6. package/breadcrumb/index.d.ts +36 -5
  7. package/cache/index.d.ts +46 -5
  8. package/carousel/index.d.ts +79 -5
  9. package/checkbox/index.d.ts +33 -5
  10. package/chip/index.d.ts +28 -5
  11. package/clipboard/index.d.ts +11 -5
  12. package/collections/index.d.ts +23 -5
  13. package/color-picker/index.d.ts +119 -5
  14. package/cookies/index.d.ts +35 -5
  15. package/datepicker/index.d.ts +317 -5
  16. package/dialog/index.d.ts +63 -5
  17. package/drag/index.d.ts +107 -5
  18. package/fesm2022/ngbase-adk-a11y.mjs +100 -74
  19. package/fesm2022/ngbase-adk-a11y.mjs.map +1 -1
  20. package/fesm2022/ngbase-adk-accordion.mjs +31 -19
  21. package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
  22. package/fesm2022/ngbase-adk-autocomplete.mjs +17 -17
  23. package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
  24. package/fesm2022/ngbase-adk-avatar.mjs +16 -16
  25. package/fesm2022/ngbase-adk-avatar.mjs.map +1 -1
  26. package/fesm2022/ngbase-adk-bidi.mjs +6 -7
  27. package/fesm2022/ngbase-adk-bidi.mjs.map +1 -1
  28. package/fesm2022/ngbase-adk-breadcrumb.mjs +15 -15
  29. package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
  30. package/fesm2022/ngbase-adk-cache.mjs +3 -3
  31. package/fesm2022/ngbase-adk-carousel.mjs +24 -24
  32. package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
  33. package/fesm2022/ngbase-adk-checkbox.mjs +10 -10
  34. package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -1
  35. package/fesm2022/ngbase-adk-chip.mjs +13 -13
  36. package/fesm2022/ngbase-adk-chip.mjs.map +1 -1
  37. package/fesm2022/ngbase-adk-clipboard.mjs +27 -12
  38. package/fesm2022/ngbase-adk-clipboard.mjs.map +1 -1
  39. package/fesm2022/ngbase-adk-collections.mjs +5 -5
  40. package/fesm2022/ngbase-adk-collections.mjs.map +1 -1
  41. package/fesm2022/ngbase-adk-color-picker.mjs +39 -39
  42. package/fesm2022/ngbase-adk-color-picker.mjs.map +1 -1
  43. package/fesm2022/ngbase-adk-cookies.mjs +3 -3
  44. package/fesm2022/ngbase-adk-datepicker.mjs +107 -107
  45. package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
  46. package/fesm2022/ngbase-adk-dialog.mjs +39 -109
  47. package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
  48. package/fesm2022/ngbase-adk-drag.mjs +21 -22
  49. package/fesm2022/ngbase-adk-drag.mjs.map +1 -1
  50. package/fesm2022/ngbase-adk-form-field.mjs +206 -31
  51. package/fesm2022/ngbase-adk-form-field.mjs.map +1 -1
  52. package/fesm2022/ngbase-adk-hover-card.mjs +6 -6
  53. package/fesm2022/ngbase-adk-hover-card.mjs.map +1 -1
  54. package/fesm2022/ngbase-adk-icon.mjs +10 -10
  55. package/fesm2022/ngbase-adk-icon.mjs.map +1 -1
  56. package/fesm2022/ngbase-adk-inline-edit.mjs +29 -27
  57. package/fesm2022/ngbase-adk-inline-edit.mjs.map +1 -1
  58. package/fesm2022/ngbase-adk-jwt.mjs +6 -6
  59. package/fesm2022/ngbase-adk-keys.mjs +7 -8
  60. package/fesm2022/ngbase-adk-keys.mjs.map +1 -1
  61. package/fesm2022/ngbase-adk-layout.mjs +1 -1
  62. package/fesm2022/ngbase-adk-layout.mjs.map +1 -1
  63. package/fesm2022/ngbase-adk-list.mjs +10 -10
  64. package/fesm2022/ngbase-adk-list.mjs.map +1 -1
  65. package/fesm2022/ngbase-adk-mask.mjs +8 -8
  66. package/fesm2022/ngbase-adk-mask.mjs.map +1 -1
  67. package/fesm2022/ngbase-adk-menu.mjs +41 -41
  68. package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
  69. package/fesm2022/ngbase-adk-network.mjs +4 -4
  70. package/fesm2022/ngbase-adk-network.mjs.map +1 -1
  71. package/fesm2022/ngbase-adk-otp.mjs +19 -19
  72. package/fesm2022/ngbase-adk-otp.mjs.map +1 -1
  73. package/fesm2022/ngbase-adk-pagination.mjs +20 -20
  74. package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
  75. package/fesm2022/ngbase-adk-popover.mjs +28 -28
  76. package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
  77. package/fesm2022/ngbase-adk-portal.mjs +14 -15
  78. package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
  79. package/fesm2022/ngbase-adk-progress.mjs +8 -8
  80. package/fesm2022/ngbase-adk-progress.mjs.map +1 -1
  81. package/fesm2022/ngbase-adk-radio.mjs +15 -15
  82. package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
  83. package/fesm2022/ngbase-adk-resizable.mjs +19 -20
  84. package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
  85. package/fesm2022/ngbase-adk-scroll-area.mjs +31 -31
  86. package/fesm2022/ngbase-adk-scroll-area.mjs.map +1 -1
  87. package/fesm2022/ngbase-adk-select.mjs +73 -75
  88. package/fesm2022/ngbase-adk-select.mjs.map +1 -1
  89. package/fesm2022/ngbase-adk-selectable.mjs +9 -9
  90. package/fesm2022/ngbase-adk-selectable.mjs.map +1 -1
  91. package/fesm2022/ngbase-adk-sheet.mjs +9 -7
  92. package/fesm2022/ngbase-adk-sheet.mjs.map +1 -1
  93. package/fesm2022/ngbase-adk-sidenav.mjs +37 -37
  94. package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -1
  95. package/fesm2022/ngbase-adk-slider.mjs +26 -26
  96. package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
  97. package/fesm2022/ngbase-adk-sonner.mjs +11 -11
  98. package/fesm2022/ngbase-adk-sonner.mjs.map +1 -1
  99. package/fesm2022/ngbase-adk-stepper.mjs +28 -28
  100. package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
  101. package/fesm2022/ngbase-adk-switch.mjs +16 -16
  102. package/fesm2022/ngbase-adk-switch.mjs.map +1 -1
  103. package/fesm2022/ngbase-adk-table.mjs +98 -78
  104. package/fesm2022/ngbase-adk-table.mjs.map +1 -1
  105. package/fesm2022/ngbase-adk-tabs.mjs +44 -44
  106. package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
  107. package/fesm2022/ngbase-adk-toggle-group.mjs +15 -15
  108. package/fesm2022/ngbase-adk-toggle-group.mjs.map +1 -1
  109. package/fesm2022/ngbase-adk-toggle.mjs +4 -4
  110. package/fesm2022/ngbase-adk-toggle.mjs.map +1 -1
  111. package/fesm2022/ngbase-adk-tooltip.mjs +15 -15
  112. package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -1
  113. package/fesm2022/ngbase-adk-tour.mjs +28 -28
  114. package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
  115. package/fesm2022/ngbase-adk-translate.mjs +13 -13
  116. package/fesm2022/ngbase-adk-translate.mjs.map +1 -1
  117. package/fesm2022/ngbase-adk-tree.mjs +27 -27
  118. package/fesm2022/ngbase-adk-tree.mjs.map +1 -1
  119. package/fesm2022/ngbase-adk-utils.mjs +43 -20
  120. package/fesm2022/ngbase-adk-utils.mjs.map +1 -1
  121. package/fesm2022/ngbase-adk-virtualizer.mjs +20 -20
  122. package/fesm2022/ngbase-adk-virtualizer.mjs.map +1 -1
  123. package/form-field/index.d.ts +95 -5
  124. package/hover-card/index.d.ts +21 -5
  125. package/icon/index.d.ts +28 -5
  126. package/index.d.ts +2 -5
  127. package/inline-edit/index.d.ts +53 -5
  128. package/jwt/index.d.ts +20 -5
  129. package/keys/index.d.ts +54 -5
  130. package/layout/index.d.ts +20 -5
  131. package/list/index.d.ts +34 -5
  132. package/mask/index.d.ts +33 -5
  133. package/menu/index.d.ts +145 -5
  134. package/network/index.d.ts +29 -5
  135. package/otp/index.d.ts +51 -5
  136. package/package.json +44 -44
  137. package/pagination/index.d.ts +35 -5
  138. package/popover/index.d.ts +212 -5
  139. package/portal/index.d.ts +113 -5
  140. package/progress/index.d.ts +17 -5
  141. package/radio/index.d.ts +45 -5
  142. package/resizable/index.d.ts +73 -5
  143. package/schematics/components/files/accordion/accordion.ts.template +2 -2
  144. package/schematics/components/files/autocomplete/autocomplete.ts.template +1 -0
  145. package/schematics/components/files/avatar/avatar.ts.template +12 -4
  146. package/schematics/components/files/button/button.ts.template +32 -13
  147. package/schematics/components/files/command/command.ts.template +10 -9
  148. package/schematics/components/files/datepicker/datepicker-llm.md.template +15 -2
  149. package/schematics/components/files/dialog/dialog.ts.template +9 -2
  150. package/schematics/components/files/drawer/drawer.ts.template +1 -1
  151. package/schematics/components/files/form-field/form-field.ts.template +10 -1
  152. package/schematics/components/files/form-field/input-style.directive.ts.template +1 -1
  153. package/schematics/components/files/icon/icon-llm.md.template +0 -1
  154. package/schematics/components/files/inline-edit/inline-edit.ts.template +2 -2
  155. package/schematics/components/files/otp/otp.ts.template +1 -1
  156. package/schematics/components/files/picasa/picasa-base.component.ts.template +1 -2
  157. package/schematics/components/files/picasa/picasa.component.ts.template +4 -4
  158. package/schematics/components/files/select/select.ts.template +5 -18
  159. package/schematics/components/files/sheet/sheet.ts.template +1 -1
  160. package/schematics/components/files/sidenav/sidenav-llm.md.template +0 -1
  161. package/schematics/components/files/spinner/spinner.ts.template +1 -29
  162. package/schematics/components/files/table/table-llm.md.template +41 -1
  163. package/schematics/components/files/table/table.ts.template +40 -5
  164. package/scroll-area/index.d.ts +60 -5
  165. package/select/index.d.ts +177 -5
  166. package/selectable/index.d.ts +32 -5
  167. package/sheet/index.d.ts +44 -5
  168. package/sidenav/index.d.ts +74 -5
  169. package/slider/index.d.ts +79 -5
  170. package/sonner/index.d.ts +50 -5
  171. package/stepper/index.d.ts +54 -5
  172. package/switch/index.d.ts +47 -5
  173. package/table/index.d.ts +143 -5
  174. package/tabs/index.d.ts +85 -5
  175. package/test/index.d.ts +81 -5
  176. package/toggle/index.d.ts +16 -5
  177. package/toggle-group/index.d.ts +39 -5
  178. package/tooltip/index.d.ts +60 -5
  179. package/tour/index.d.ts +70 -5
  180. package/translate/index.d.ts +58 -5
  181. package/tree/index.d.ts +95 -5
  182. package/utils/index.d.ts +82 -5
  183. package/virtualizer/index.d.ts +45 -5
  184. package/a11y/accessibility-group.d.ts +0 -46
  185. package/a11y/accessibility-item.d.ts +0 -49
  186. package/a11y/accessibility.service.d.ts +0 -17
  187. package/a11y/autofocus.d.ts +0 -18
  188. package/a11y/focus-trap.d.ts +0 -15
  189. package/a11y/public-api.d.ts +0 -4
  190. package/accordion/accordion-content.d.ts +0 -8
  191. package/accordion/accordion-group.d.ts +0 -10
  192. package/accordion/accordion-header.d.ts +0 -7
  193. package/accordion/accordion-item.d.ts +0 -16
  194. package/accordion/public-api.d.ts +0 -4
  195. package/autocomplete/autocomplete-input.d.ts +0 -19
  196. package/autocomplete/autocomplete.d.ts +0 -34
  197. package/autocomplete/public-api.d.ts +0 -2
  198. package/avatar/avatar.d.ts +0 -22
  199. package/avatar/public-api.d.ts +0 -1
  200. package/bidi/direction.service.d.ts +0 -14
  201. package/bidi/public-api.d.ts +0 -1
  202. package/breadcrumb/breadcrumb-link.d.ts +0 -7
  203. package/breadcrumb/breadcrumb-separator.d.ts +0 -6
  204. package/breadcrumb/breadcrumb.d.ts +0 -12
  205. package/breadcrumb/breadcrumbs.d.ts +0 -9
  206. package/breadcrumb/public-api.d.ts +0 -4
  207. package/cache/cache-config.d.ts +0 -22
  208. package/cache/cache.d.ts +0 -17
  209. package/cache/cache.interecptor.d.ts +0 -2
  210. package/cache/public-api.d.ts +0 -3
  211. package/carousel/carousel-item.d.ts +0 -7
  212. package/carousel/carousel-next.d.ts +0 -8
  213. package/carousel/carousel.d.ts +0 -61
  214. package/carousel/public-api.d.ts +0 -3
  215. package/checkbox/checkbox.d.ts +0 -30
  216. package/checkbox/public-api.d.ts +0 -1
  217. package/chip/chip-group.d.ts +0 -7
  218. package/chip/chip.d.ts +0 -19
  219. package/chip/public-api.d.ts +0 -2
  220. package/clipboard/clipboard.d.ts +0 -7
  221. package/clipboard/public-api.d.ts +0 -1
  222. package/collections/SelectionModel.d.ts +0 -19
  223. package/collections/public-api.d.ts +0 -1
  224. package/color-picker/color-input.d.ts +0 -16
  225. package/color-picker/color-picker-trigger.d.ts +0 -30
  226. package/color-picker/color-picker.d.ts +0 -72
  227. package/color-picker/public-api.d.ts +0 -3
  228. package/color-picker/utils.d.ts +0 -21
  229. package/cookies/cookie.service.d.ts +0 -32
  230. package/cookies/public-api.d.ts +0 -1
  231. package/datepicker/calendar.d.ts +0 -121
  232. package/datepicker/datepicker-trigger.d.ts +0 -66
  233. package/datepicker/datepicker.d.ts +0 -55
  234. package/datepicker/native-date-adapter.d.ts +0 -33
  235. package/datepicker/public-api.d.ts +0 -5
  236. package/datepicker/time.d.ts +0 -42
  237. package/dialog/dialog.animation.d.ts +0 -3
  238. package/dialog/dialog.d.ts +0 -49
  239. package/dialog/dialog.service.d.ts +0 -7
  240. package/dialog/public-api.d.ts +0 -3
  241. package/drag/drag-drop.d.ts +0 -37
  242. package/drag/drag-move.d.ts +0 -17
  243. package/drag/drag.d.ts +0 -52
  244. package/drag/public-api.d.ts +0 -3
  245. package/form-field/auto-height.d.ts +0 -9
  246. package/form-field/error.d.ts +0 -18
  247. package/form-field/form-field.d.ts +0 -14
  248. package/form-field/input.d.ts +0 -16
  249. package/form-field/label.d.ts +0 -7
  250. package/form-field/public-api.d.ts +0 -5
  251. package/hover-card/hover-card.d.ts +0 -18
  252. package/hover-card/public-api.d.ts +0 -1
  253. package/icon/icon.d.ts +0 -12
  254. package/icon/icon.service.d.ts +0 -12
  255. package/icon/public-api.d.ts +0 -2
  256. package/inline-edit/inline-edit.d.ts +0 -47
  257. package/inline-edit/public-api.d.ts +0 -1
  258. package/jwt/jwt.service.d.ts +0 -27
  259. package/jwt/public-api.d.ts +0 -1
  260. package/keys/keys.service.d.ts +0 -13
  261. package/keys/public-api.d.ts +0 -2
  262. package/keys/shortcuts.service.d.ts +0 -38
  263. package/layout/layout.d.ts +0 -16
  264. package/layout/public-api.d.ts +0 -1
  265. package/list/list.d.ts +0 -20
  266. package/list/list.directive.d.ts +0 -12
  267. package/list/public-api.d.ts +0 -2
  268. package/mask/mask-pipe.d.ts +0 -7
  269. package/mask/mask.d.ts +0 -24
  270. package/mask/public-api.d.ts +0 -2
  271. package/menu/context-menu.d.ts +0 -21
  272. package/menu/mention.d.ts +0 -18
  273. package/menu/menu-trigger.d.ts +0 -34
  274. package/menu/menu.d.ts +0 -58
  275. package/menu/navigation-menu.d.ts +0 -19
  276. package/menu/public-api.d.ts +0 -5
  277. package/network/network.interceptor.d.ts +0 -6
  278. package/network/network.service.d.ts +0 -18
  279. package/network/public-api.d.ts +0 -2
  280. package/otp/otp.d.ts +0 -48
  281. package/otp/public-api.d.ts +0 -1
  282. package/pagination/pagination.d.ts +0 -32
  283. package/pagination/public-api.d.ts +0 -1
  284. package/popover/base-popover.service.d.ts +0 -16
  285. package/popover/popover-arrow.ng.d.ts +0 -34
  286. package/popover/popover-trigger.d.ts +0 -21
  287. package/popover/popover.d.ts +0 -60
  288. package/popover/popover.service.d.ts +0 -43
  289. package/popover/public-api.d.ts +0 -6
  290. package/popover/utils.d.ts +0 -69
  291. package/portal/dialog-ref.d.ts +0 -70
  292. package/portal/portal-base.service.d.ts +0 -19
  293. package/portal/portal-close.directive.d.ts +0 -9
  294. package/portal/portal.component.d.ts +0 -7
  295. package/portal/portal.service.d.ts +0 -16
  296. package/portal/public-api.d.ts +0 -5
  297. package/progress/progress.d.ts +0 -13
  298. package/progress/public-api.d.ts +0 -1
  299. package/public-api.d.ts +0 -2
  300. package/radio/public-api.d.ts +0 -2
  301. package/radio/radio-group.d.ts +0 -19
  302. package/radio/radio.d.ts +0 -26
  303. package/resizable/public-api.d.ts +0 -2
  304. package/resizable/resizable-group.d.ts +0 -22
  305. package/resizable/resizable.d.ts +0 -50
  306. package/scroll-area/public-api.d.ts +0 -1
  307. package/scroll-area/scroll-area.d.ts +0 -56
  308. package/select/list-selection.d.ts +0 -7
  309. package/select/option-group.d.ts +0 -7
  310. package/select/option.d.ts +0 -25
  311. package/select/public-api.d.ts +0 -6
  312. package/select/select-base.d.ts +0 -66
  313. package/select/select-input.d.ts +0 -23
  314. package/select/select.d.ts +0 -53
  315. package/selectable/public-api.d.ts +0 -2
  316. package/selectable/selectable-item.d.ts +0 -12
  317. package/selectable/selectable.d.ts +0 -19
  318. package/sheet/public-api.d.ts +0 -2
  319. package/sheet/sheet.d.ts +0 -26
  320. package/sheet/sheet.service.d.ts +0 -13
  321. package/sidenav/public-api.d.ts +0 -3
  322. package/sidenav/sidenav-header.d.ts +0 -31
  323. package/sidenav/sidenav.d.ts +0 -23
  324. package/sidenav/sidenav.service.d.ts +0 -18
  325. package/slider/public-api.d.ts +0 -1
  326. package/slider/slider.d.ts +0 -76
  327. package/sonner/public-api.d.ts +0 -2
  328. package/sonner/sonner.d.ts +0 -25
  329. package/sonner/sonner.service.d.ts +0 -21
  330. package/stepper/animation.d.ts +0 -1
  331. package/stepper/public-api.d.ts +0 -3
  332. package/stepper/step.d.ts +0 -24
  333. package/stepper/stepper.d.ts +0 -26
  334. package/switch/public-api.d.ts +0 -1
  335. package/switch/switch.d.ts +0 -44
  336. package/table/body-cell.d.ts +0 -11
  337. package/table/body-row.d.ts +0 -25
  338. package/table/column.d.ts +0 -10
  339. package/table/head-cell.d.ts +0 -12
  340. package/table/head-row.d.ts +0 -24
  341. package/table/public-api.d.ts +0 -8
  342. package/table/sort.d.ts +0 -40
  343. package/table/table.d.ts +0 -38
  344. package/tabs/public-api.d.ts +0 -2
  345. package/tabs/tab-group.d.ts +0 -52
  346. package/tabs/tab.d.ts +0 -31
  347. package/test/public-api.d.ts +0 -1
  348. package/test/utils.d.ts +0 -78
  349. package/toggle/public-api.d.ts +0 -1
  350. package/toggle/toggle.d.ts +0 -13
  351. package/toggle-group/public-api.d.ts +0 -2
  352. package/toggle-group/toggle-group.d.ts +0 -25
  353. package/toggle-group/toggle-item.d.ts +0 -14
  354. package/tooltip/public-api.d.ts +0 -2
  355. package/tooltip/tooltip.d.ts +0 -24
  356. package/tooltip/tooltip.directive.d.ts +0 -34
  357. package/tooltip/tooltip.service.d.ts +0 -28
  358. package/tour/animation.d.ts +0 -2
  359. package/tour/public-api.d.ts +0 -5
  360. package/tour/tour-base.d.ts +0 -21
  361. package/tour/tour-step.d.ts +0 -11
  362. package/tour/tour.d.ts +0 -9
  363. package/tour/tour.service.d.ts +0 -29
  364. package/translate/config.d.ts +0 -16
  365. package/translate/public-api.d.ts +0 -3
  366. package/translate/translate.d.ts +0 -11
  367. package/translate/translate.service.d.ts +0 -31
  368. package/tree/public-api.d.ts +0 -3
  369. package/tree/tree-node.d.ts +0 -28
  370. package/tree/tree-toggle.d.ts +0 -16
  371. package/tree/tree.d.ts +0 -55
  372. package/utils/animation.d.ts +0 -3
  373. package/utils/disposals.d.ts +0 -7
  374. package/utils/number-only.d.ts +0 -22
  375. package/utils/public-api.d.ts +0 -6
  376. package/utils/range.pipe.d.ts +0 -7
  377. package/utils/ssr.d.ts +0 -2
  378. package/utils/utils.d.ts +0 -28
  379. package/virtualizer/public-api.d.ts +0 -1
  380. package/virtualizer/virtualizer.d.ts +0 -42
package/drag/index.d.ts CHANGED
@@ -1,5 +1,107 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@ngbase/adk/drag" />
5
- export * from './public-api';
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef } from '@angular/core';
3
+ import { Subject } from 'rxjs';
4
+
5
+ declare class DragData {
6
+ x: number;
7
+ y: number;
8
+ dx: number;
9
+ dy: number;
10
+ type: 'start' | 'move' | 'end';
11
+ event?: PointerEvent | undefined;
12
+ clientX?: number | undefined;
13
+ clientY?: number | undefined;
14
+ direction?: "left" | "right" | undefined;
15
+ velocity: number;
16
+ time: number;
17
+ constructor(x?: number, y?: number, dx?: number, dy?: number, type?: 'start' | 'move' | 'end', event?: PointerEvent | undefined, clientX?: number | undefined, clientY?: number | undefined, direction?: "left" | "right" | undefined, velocity?: number, // pixels per millisecond
18
+ time?: number);
19
+ }
20
+ declare class DragHandle {
21
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragHandle, never>;
22
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DragHandle, "[ngbDragHandle]", ["ngbDragHandle"], {}, {}, never, never, true, never>;
23
+ }
24
+ declare class Drag {
25
+ readonly el: ElementRef<any>;
26
+ readonly document: Document;
27
+ readonly handle: _angular_core.Signal<ElementRef<any> | undefined>;
28
+ readonly events: Subject<DragData>;
29
+ readonly ngbDrag: _angular_core.OutputRef<DragData>;
30
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
31
+ readonly lockAxis: _angular_core.InputSignal<"x" | "y" | undefined>;
32
+ readonly dragBoundary: _angular_core.InputSignal<string | undefined>;
33
+ _lockAxis: _angular_core.WritableSignal<"x" | "y" | undefined>;
34
+ _dragBoundary: _angular_core.WritableSignal<string | undefined>;
35
+ _disabled: _angular_core.WritableSignal<boolean>;
36
+ private readonly dragBoundaryElement;
37
+ private boundaryRect;
38
+ startEvent: PointerEvent;
39
+ lastValue: DragData;
40
+ isDragging: boolean;
41
+ constructor();
42
+ private onPointerDown;
43
+ private onPointerMove;
44
+ private onPointerUp;
45
+ private startDrag;
46
+ private moveDrag;
47
+ private endDrag;
48
+ private toggleUserSelect;
49
+ private getDirection;
50
+ private getDragEvent;
51
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Drag, never>;
52
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Drag, "[ngbDrag]", ["ngbDrag"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "lockAxis": { "alias": "lockAxis"; "required": false; "isSignal": true; }; "dragBoundary": { "alias": "dragBoundary"; "required": false; "isSignal": true; }; }, { "ngbDrag": "ngbDrag"; }, ["handle"], never, true, never>;
53
+ }
54
+
55
+ declare class DragMove {
56
+ private drag;
57
+ private el;
58
+ readonly target: _angular_core.InputSignal<HTMLElement | undefined>;
59
+ private scale;
60
+ private x;
61
+ private y;
62
+ private lastX;
63
+ private lastY;
64
+ constructor();
65
+ private get element();
66
+ private updateTransform;
67
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragMove, never>;
68
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DragMove, "[ngbDragMove]", never, { "target": { "alias": "target"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof Drag; inputs: { "dragBoundary": "dragBoundary"; }; outputs: {}; }]>;
69
+ }
70
+
71
+ interface DropEvent<T> {
72
+ previousIndex: number;
73
+ currentIndex: number;
74
+ container: {
75
+ data: T;
76
+ };
77
+ previousContainer: {
78
+ data: T;
79
+ };
80
+ }
81
+ declare class DragDrop<T> {
82
+ readonly el: ElementRef<any>;
83
+ readonly dragItems: _angular_core.Signal<readonly Drag[]>;
84
+ readonly data: _angular_core.InputSignal<T | undefined>;
85
+ readonly orderChanged: _angular_core.OutputEmitterRef<DropEvent<T>>;
86
+ private sortableElements;
87
+ private previousIndex;
88
+ private currentIndex;
89
+ private height;
90
+ constructor();
91
+ private onDrag;
92
+ fromThis(dragData: DragData): boolean;
93
+ private onDragStart;
94
+ private onDragMove;
95
+ private onDragEnd;
96
+ private rearrangeItems;
97
+ private updateItemPositions;
98
+ private resetPositions;
99
+ private emitNewOrder;
100
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragDrop<any>, never>;
101
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DragDrop<any>, "[ngbDrop]", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; }, { "orderChanged": "orderChanged"; }, ["dragItems"], never, true, never>;
102
+ }
103
+ declare function moveItemInArray<T>(array: T[], fromIndex: number, toIndex: number): void;
104
+ declare function transferArrayItem<T>(fromArray: T[], toArray: T[], fromIndex: number, toIndex: number): void;
105
+
106
+ export { Drag, DragData, DragDrop, DragHandle, DragMove, moveItemInArray, transferArrayItem };
107
+ export type { DropEvent };
@@ -1,13 +1,12 @@
1
- import { DOCUMENT } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { signal, Injectable, inject, ElementRef, model, input, booleanAttribute, linkedSignal, computed, effect, untracked, Directive, output, ApplicationRef } from '@angular/core';
2
+ import { signal, Injectable, inject, ElementRef, DOCUMENT, model, input, booleanAttribute, linkedSignal, computed, effect, untracked, Directive, output, InjectionToken, afterRenderEffect, ApplicationRef, afterEveryRender } from '@angular/core';
4
3
  import { Directionality } from '@ngbase/adk/bidi';
5
4
  import { documentListener, isClient } from '@ngbase/adk/utils';
6
5
  import { Subject } from 'rxjs';
7
6
 
8
7
  class AccessibilityService {
9
8
  constructor() {
10
- this.groups = signal(new Map());
9
+ this.groups = signal(new Map(), ...(ngDevMode ? [{ debugName: "groups" }] : []));
11
10
  this.activeGroupOrder = [];
12
11
  this.usingMouse = false;
13
12
  documentListener('keydown', () => (this.usingMouse = false), { capture: true });
@@ -48,10 +47,10 @@ class AccessibilityService {
48
47
  });
49
48
  this.removeActiveGroup(key);
50
49
  }
51
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
52
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibilityService, providedIn: 'root' }); }
50
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibilityService, providedIn: 'root' }); }
53
52
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibilityService, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibilityService, decorators: [{
55
54
  type: Injectable,
56
55
  args: [{ providedIn: 'root' }]
57
56
  }], ctorParameters: () => [] });
@@ -63,15 +62,15 @@ class AccessibleGroup {
63
62
  this.el = inject(ElementRef);
64
63
  this.document = inject(DOCUMENT);
65
64
  this.dir = inject(Directionality);
66
- this.ayId = model('');
67
- this.columns = input();
68
- this.ariaLabel = input('');
69
- this.ariaLabelledby = input('');
70
- this.isPopup = input(false);
71
- this.loop = input(true);
72
- this.disabled = input(false, { transform: booleanAttribute });
73
- this.clickable = model(false);
74
- this.initialFocus = input(true);
65
+ this.ayId = model('', ...(ngDevMode ? [{ debugName: "ayId" }] : []));
66
+ this.columns = input(...(ngDevMode ? [undefined, { debugName: "columns" }] : []));
67
+ this.ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
68
+ this.ariaLabelledby = input('', ...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : []));
69
+ this.isPopup = input(false, ...(ngDevMode ? [{ debugName: "isPopup" }] : []));
70
+ this.loop = input(true, ...(ngDevMode ? [{ debugName: "loop" }] : []));
71
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
72
+ this.clickable = model(false, ...(ngDevMode ? [{ debugName: "clickable" }] : []));
73
+ this.initialFocus = input(true, ...(ngDevMode ? [{ debugName: "initialFocus" }] : []));
75
74
  // Hacky way to make sure the signals are updated
76
75
  this._ayId = linkedSignal(this.ayId);
77
76
  this._disabled = linkedSignal(this.disabled);
@@ -82,7 +81,7 @@ class AccessibleGroup {
82
81
  this._columns = linkedSignal(this.columns);
83
82
  this._initialFocus = linkedSignal(this.initialFocus);
84
83
  this.isOn = false;
85
- this.elements = signal([]);
84
+ this.elements = signal([], ...(ngDevMode ? [{ debugName: "elements" }] : []));
86
85
  this.items = computed(() => {
87
86
  const _ = this._ayId() || '';
88
87
  const items = this.elements();
@@ -95,7 +94,7 @@ class AccessibleGroup {
95
94
  : 1;
96
95
  });
97
96
  return items;
98
- });
97
+ }, ...(ngDevMode ? [{ debugName: "items" }] : []));
99
98
  this.handleFocusIn = (_) => {
100
99
  if (!this.isOn) {
101
100
  // console.log(`focus in ${this._ayId()}`);
@@ -386,10 +385,10 @@ class AccessibleGroup {
386
385
  unregister(item) {
387
386
  this.elements.update(x => x.filter(y => y !== item));
388
387
  }
389
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibleGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
390
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: AccessibleGroup, isStandalone: true, selector: "[ngbAccessibleGroup]", inputs: { ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, isPopup: { classPropertyName: "isPopup", publicName: "isPopup", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, initialFocus: { classPropertyName: "initialFocus", publicName: "initialFocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ayId: "ayIdChange", clickable: "clickableChange" }, host: { attributes: { "role": "group", "tabindex": "0" }, properties: { "attr.aria-label": "_ariaLabel()", "attr.aria-labelledby": "_ariaLabelledby()", "attr.aria-disabled": "_disabled()" } }, ngImport: i0 }); }
388
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibleGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
389
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0", type: AccessibleGroup, isStandalone: true, selector: "[ngbAccessibleGroup]", inputs: { ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, isPopup: { classPropertyName: "isPopup", publicName: "isPopup", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, initialFocus: { classPropertyName: "initialFocus", publicName: "initialFocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ayId: "ayIdChange", clickable: "clickableChange" }, host: { attributes: { "role": "group", "tabindex": "0" }, properties: { "attr.aria-label": "_ariaLabel()", "attr.aria-labelledby": "_ariaLabelledby()", "attr.aria-disabled": "_disabled()" } }, ngImport: i0 }); }
391
390
  }
392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibleGroup, decorators: [{
391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibleGroup, decorators: [{
393
392
  type: Directive,
394
393
  args: [{
395
394
  selector: '[ngbAccessibleGroup]',
@@ -407,16 +406,16 @@ class AccessibleItem {
407
406
  constructor() {
408
407
  this.allyService = inject(AccessibilityService);
409
408
  this.host = inject(ElementRef);
410
- this.id = input('');
411
- this.ayId = input('');
412
- this.role = input('button');
413
- this.disabled = input(false, { transform: booleanAttribute });
414
- this.selected = input(false, { transform: booleanAttribute });
415
- this.data = input();
416
- this.skip = input(false, { transform: booleanAttribute });
417
- this.level = model(0);
418
- this.expandable = model(false);
419
- this.expanded = model(false);
409
+ this.id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
410
+ this.ayId = input('', ...(ngDevMode ? [{ debugName: "ayId" }] : []));
411
+ this.role = input('button', ...(ngDevMode ? [{ debugName: "role" }] : []));
412
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
413
+ this.selected = input(false, ...(ngDevMode ? [{ debugName: "selected", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
414
+ this.data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : []));
415
+ this.skip = input(false, ...(ngDevMode ? [{ debugName: "skip", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
416
+ this.level = model(0, ...(ngDevMode ? [{ debugName: "level" }] : []));
417
+ this.expandable = model(false, ...(ngDevMode ? [{ debugName: "expandable" }] : []));
418
+ this.expanded = model(false, ...(ngDevMode ? [{ debugName: "expanded" }] : []));
420
419
  this.selectedChange = output();
421
420
  // inputs writable for hacky reasons
422
421
  this._disabled = linkedSignal(this.disabled);
@@ -427,9 +426,9 @@ class AccessibleItem {
427
426
  this._skip = linkedSignal(this.skip);
428
427
  this._expandable = linkedSignal(this.expandable);
429
428
  this._expanded = linkedSignal(this.expanded);
430
- this.group = computed(() => this.allyService.getGroup(this._ayId() || ''));
431
- this.pressed = signal(false);
432
- this.hasPopup = computed(() => this.el.getAttribute('aria-haspopup') === 'true');
429
+ this.group = computed(() => this.allyService.getGroup(this._ayId() || ''), ...(ngDevMode ? [{ debugName: "group" }] : []));
430
+ this.pressed = signal(false, ...(ngDevMode ? [{ debugName: "pressed" }] : []));
431
+ this.hasPopup = computed(() => this.el.getAttribute('aria-haspopup') === 'true', ...(ngDevMode ? [{ debugName: "hasPopup" }] : []));
433
432
  this.events = new Subject();
434
433
  this.count = 1;
435
434
  /**
@@ -488,10 +487,10 @@ class AccessibleItem {
488
487
  ngOnDestroy() {
489
488
  this.isDestroyed = true;
490
489
  }
491
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibleItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
492
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: AccessibleItem, isStandalone: true, selector: "[ngbAccessibleItem]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, skip: { classPropertyName: "skip", publicName: "skip", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { level: "levelChange", expandable: "expandableChange", expanded: "expandedChange", selectedChange: "selectedChange" }, host: { listeners: { "click": "onFocus()" }, properties: { "attr.aria-pressed": "pressed()", "attr.aria-disabled": "_disabled() || null", "attr.aria-selected": "_selected()", "tabindex": "_disabled() ? -1 : 0" } }, ngImport: i0 }); }
490
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibleItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
491
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0", type: AccessibleItem, isStandalone: true, selector: "[ngbAccessibleItem]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, skip: { classPropertyName: "skip", publicName: "skip", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { level: "levelChange", expandable: "expandableChange", expanded: "expandedChange", selectedChange: "selectedChange" }, host: { listeners: { "click": "onFocus()" }, properties: { "attr.aria-pressed": "pressed()", "attr.aria-disabled": "_disabled() || null", "attr.aria-selected": "_selected()", "tabindex": "_disabled() ? -1 : 0" } }, ngImport: i0 }); }
493
492
  }
494
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AccessibleItem, decorators: [{
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AccessibleItem, decorators: [{
495
494
  type: Directive,
496
495
  args: [{
497
496
  selector: '[ngbAccessibleItem]',
@@ -505,45 +504,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
505
504
  }]
506
505
  }], ctorParameters: () => [] });
507
506
 
507
+ const FOCUS_TRAP_OPTIONS = new InjectionToken('focusTrapOptions', {
508
+ factory: () => ({ initial: true }),
509
+ });
510
+ function provideFocusTrapOptions(optionsFn) {
511
+ return { provide: FOCUS_TRAP_OPTIONS, useFactory: optionsFn };
512
+ }
508
513
  class FocusTrap {
509
514
  constructor() {
510
515
  this.el = inject(ElementRef);
511
- this.ngbFocusTrap = input(true, { transform: booleanAttribute });
512
- this.focusInitial = input(true, { transform: booleanAttribute });
516
+ this.options = inject(FOCUS_TRAP_OPTIONS, { optional: true });
517
+ this.ngbFocusTrap = input(true, ...(ngDevMode ? [{ debugName: "ngbFocusTrap", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
518
+ this.focusInitial = input(true, ...(ngDevMode ? [{ debugName: "focusInitial", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
513
519
  // hacky way
514
520
  this._focusTrap = linkedSignal(this.ngbFocusTrap);
515
- this._focusInitial = linkedSignal(this.focusInitial);
516
- this.firstFocusableElement = null;
517
- this.lastFocusableElement = null;
521
+ this._focusInitial = linkedSignal(() => this.focusInitial() || this.options?.initial || false);
522
+ this.cachedFocusableElements = null;
518
523
  this.onKeydown = (event) => {
519
524
  if (event.key === 'Tab') {
525
+ const focusableElements = this.getFocusableElements();
526
+ if (focusableElements.length === 0)
527
+ return;
528
+ const firstFocusable = focusableElements[0];
529
+ const lastFocusable = focusableElements[focusableElements.length - 1];
520
530
  if (event.shiftKey) {
521
531
  // Shift + Tab
522
- if (document.activeElement === this.firstFocusableElement) {
532
+ if (document.activeElement === firstFocusable) {
523
533
  event.preventDefault();
524
- this.lastFocusableElement?.focus();
534
+ lastFocusable.focus();
525
535
  }
526
536
  }
527
537
  else {
528
538
  // Tab
529
- if (document.activeElement === this.lastFocusableElement) {
539
+ if (document.activeElement === lastFocusable) {
530
540
  event.preventDefault();
531
- this.firstFocusableElement?.focus();
541
+ firstFocusable.focus();
532
542
  }
533
543
  }
534
544
  }
535
545
  };
536
546
  let initialFocus = false;
537
- effect(cleanup => {
547
+ afterRenderEffect(cleanup => {
538
548
  if (this._focusTrap()) {
539
- const observer = new MutationObserver(() => this.setFocusableElements());
540
- observer.observe(this.el.nativeElement, { childList: true, subtree: true });
541
- // we have call this manually because mutation observer not trigger on initial render
542
- this.setFocusableElements();
549
+ const observer = new MutationObserver(() => {
550
+ this.invalidateCache();
551
+ });
552
+ observer.observe(this.el.nativeElement, {
553
+ childList: true,
554
+ subtree: true,
555
+ attributes: true,
556
+ attributeFilter: ['disabled', 'tabindex', 'aria-hidden', 'hidden'],
557
+ });
543
558
  if (!initialFocus && this._focusInitial()) {
544
559
  initialFocus = true;
545
- // console.log('focusInitial', this.el.nativeElement);
546
- this.firstFocusableElement?.focus();
560
+ const focusableElements = this.getFocusableElements();
561
+ if (focusableElements.length > 0) {
562
+ focusableElements[0].focus();
563
+ }
547
564
  }
548
565
  // listen to the keydown event
549
566
  this.el.nativeElement.addEventListener('keydown', this.onKeydown);
@@ -554,15 +571,28 @@ class FocusTrap {
554
571
  }
555
572
  });
556
573
  }
557
- setFocusableElements() {
558
- const focusableElements = this.el.nativeElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
559
- this.firstFocusableElement = focusableElements[0];
560
- this.lastFocusableElement = focusableElements[focusableElements.length - 1];
574
+ isElementFocusable(element) {
575
+ return (!element.hasAttribute('disabled') && !element.hasAttribute('aria-hidden') && !element.hidden);
561
576
  }
562
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: FocusTrap, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
563
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: FocusTrap, isStandalone: true, selector: "[ngbFocusTrap]", inputs: { ngbFocusTrap: { classPropertyName: "ngbFocusTrap", publicName: "ngbFocusTrap", isSignal: true, isRequired: false, transformFunction: null }, focusInitial: { classPropertyName: "focusInitial", publicName: "focusInitial", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
577
+ getFocusableElements() {
578
+ if (this.cachedFocusableElements === null) {
579
+ const allFocusableElements = this.el.nativeElement.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
580
+ this.cachedFocusableElements = [];
581
+ for (let i = 0; i < allFocusableElements.length; i++) {
582
+ if (this.isElementFocusable(allFocusableElements[i])) {
583
+ this.cachedFocusableElements.push(allFocusableElements[i]);
584
+ }
585
+ }
586
+ }
587
+ return this.cachedFocusableElements;
588
+ }
589
+ invalidateCache() {
590
+ this.cachedFocusableElements = null;
591
+ }
592
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FocusTrap, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
593
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0", type: FocusTrap, isStandalone: true, selector: "[ngbFocusTrap]", inputs: { ngbFocusTrap: { classPropertyName: "ngbFocusTrap", publicName: "ngbFocusTrap", isSignal: true, isRequired: false, transformFunction: null }, focusInitial: { classPropertyName: "focusInitial", publicName: "focusInitial", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
564
594
  }
565
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: FocusTrap, decorators: [{
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FocusTrap, decorators: [{
566
596
  type: Directive,
567
597
  args: [{
568
598
  selector: '[ngbFocusTrap]',
@@ -574,11 +604,13 @@ class Autofocus {
574
604
  this.el = inject(ElementRef);
575
605
  this.applicationRef = inject(ApplicationRef);
576
606
  this.document = inject(DOCUMENT);
577
- this.focusDelay = input(300);
607
+ this.focusDelay = input(300, ...(ngDevMode ? [{ debugName: "focusDelay" }] : []));
578
608
  this.isFocused = false;
579
609
  this.client = isClient();
580
610
  if (this.client) {
581
- this.elWatcher();
611
+ afterEveryRender(() => {
612
+ this.elWatcher();
613
+ });
582
614
  }
583
615
  }
584
616
  elWatcher() {
@@ -612,23 +644,17 @@ class Autofocus {
612
644
  // }, this.focusDelay());
613
645
  // }
614
646
  // }
615
- focusElement() {
616
- this.subscription?.unsubscribe();
617
- this.subscription = this.applicationRef.isStable.subscribe(res => {
618
- if (res) {
619
- this.subscription?.unsubscribe();
620
- this.subscription = undefined;
621
- this.el.nativeElement.focus();
622
- }
623
- });
647
+ async focusElement() {
648
+ await this.applicationRef.whenStable();
649
+ this.el.nativeElement.focus();
624
650
  }
625
651
  ngOnDestroy() {
626
652
  this.intersectionObserver?.disconnect();
627
653
  }
628
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Autofocus, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
629
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: Autofocus, isStandalone: true, selector: "[ngbAutofocus]", inputs: { focusDelay: { classPropertyName: "focusDelay", publicName: "focusDelay", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
654
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: Autofocus, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
655
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0", type: Autofocus, isStandalone: true, selector: "[ngbAutofocus]", inputs: { focusDelay: { classPropertyName: "focusDelay", publicName: "focusDelay", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
630
656
  }
631
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: Autofocus, decorators: [{
657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: Autofocus, decorators: [{
632
658
  type: Directive,
633
659
  args: [{
634
660
  selector: '[ngbAutofocus]',
@@ -639,5 +665,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
639
665
  * Generated bundle index. Do not edit.
640
666
  */
641
667
 
642
- export { AccessibleGroup, AccessibleItem, Autofocus, FocusTrap };
668
+ export { AccessibleGroup, AccessibleItem, Autofocus, FocusTrap, provideFocusTrapOptions };
643
669
  //# sourceMappingURL=ngbase-adk-a11y.mjs.map