@taiga-ui/core 2.46.0 → 2.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/bundles/taiga-ui-core-abstract.umd.js +50 -20
  2. package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
  3. package/bundles/taiga-ui-core-abstract.umd.min.js +1 -15
  4. package/bundles/taiga-ui-core-abstract.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-core-components-alert.umd.js +50 -20
  6. package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
  7. package/bundles/taiga-ui-core-components-alert.umd.min.js +1 -15
  8. package/bundles/taiga-ui-core-components-alert.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-core-components-button.umd.js +50 -20
  10. package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
  11. package/bundles/taiga-ui-core-components-button.umd.min.js +1 -15
  12. package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-core-components-calendar.umd.js +50 -20
  14. package/bundles/taiga-ui-core-components-calendar.umd.js.map +1 -1
  15. package/bundles/taiga-ui-core-components-calendar.umd.min.js +1 -15
  16. package/bundles/taiga-ui-core-components-calendar.umd.min.js.map +1 -1
  17. package/bundles/taiga-ui-core-components-data-list.umd.js +54 -24
  18. package/bundles/taiga-ui-core-components-data-list.umd.js.map +1 -1
  19. package/bundles/taiga-ui-core-components-data-list.umd.min.js +1 -15
  20. package/bundles/taiga-ui-core-components-data-list.umd.min.js.map +1 -1
  21. package/bundles/taiga-ui-core-components-dialog.umd.js +50 -20
  22. package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
  23. package/bundles/taiga-ui-core-components-dialog.umd.min.js +1 -15
  24. package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
  25. package/bundles/taiga-ui-core-components-dropdown-box.umd.js +74 -27
  26. package/bundles/taiga-ui-core-components-dropdown-box.umd.js.map +1 -1
  27. package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js +1 -15
  28. package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
  29. package/bundles/taiga-ui-core-components-error.umd.js +50 -20
  30. package/bundles/taiga-ui-core-components-error.umd.js.map +1 -1
  31. package/bundles/taiga-ui-core-components-error.umd.min.js +1 -15
  32. package/bundles/taiga-ui-core-components-error.umd.min.js.map +1 -1
  33. package/bundles/taiga-ui-core-components-expand.umd.js +50 -20
  34. package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
  35. package/bundles/taiga-ui-core-components-expand.umd.min.js +1 -15
  36. package/bundles/taiga-ui-core-components-expand.umd.min.js.map +1 -1
  37. package/bundles/taiga-ui-core-components-group.umd.js +50 -20
  38. package/bundles/taiga-ui-core-components-group.umd.js.map +1 -1
  39. package/bundles/taiga-ui-core-components-group.umd.min.js +1 -15
  40. package/bundles/taiga-ui-core-components-group.umd.min.js.map +1 -1
  41. package/bundles/taiga-ui-core-components-hints-host.umd.js +50 -20
  42. package/bundles/taiga-ui-core-components-hints-host.umd.js.map +1 -1
  43. package/bundles/taiga-ui-core-components-hints-host.umd.min.js +1 -15
  44. package/bundles/taiga-ui-core-components-hints-host.umd.min.js.map +1 -1
  45. package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +50 -20
  46. package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
  47. package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js +1 -15
  48. package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js.map +1 -1
  49. package/bundles/taiga-ui-core-components-label.umd.js +50 -20
  50. package/bundles/taiga-ui-core-components-label.umd.js.map +1 -1
  51. package/bundles/taiga-ui-core-components-label.umd.min.js +1 -15
  52. package/bundles/taiga-ui-core-components-label.umd.min.js.map +1 -1
  53. package/bundles/taiga-ui-core-components-link.umd.js +50 -20
  54. package/bundles/taiga-ui-core-components-link.umd.js.map +1 -1
  55. package/bundles/taiga-ui-core-components-link.umd.min.js +1 -15
  56. package/bundles/taiga-ui-core-components-link.umd.min.js.map +1 -1
  57. package/bundles/taiga-ui-core-components-loader.umd.js +50 -20
  58. package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
  59. package/bundles/taiga-ui-core-components-loader.umd.min.js +1 -15
  60. package/bundles/taiga-ui-core-components-loader.umd.min.js.map +1 -1
  61. package/bundles/taiga-ui-core-components-notification.umd.js +50 -20
  62. package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
  63. package/bundles/taiga-ui-core-components-notification.umd.min.js +1 -15
  64. package/bundles/taiga-ui-core-components-notification.umd.min.js.map +1 -1
  65. package/bundles/taiga-ui-core-components-primitive-calendar.umd.js +50 -20
  66. package/bundles/taiga-ui-core-components-primitive-calendar.umd.js.map +1 -1
  67. package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js +1 -15
  68. package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js.map +1 -1
  69. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +50 -20
  70. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
  71. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js +1 -15
  72. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js.map +1 -1
  73. package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js +50 -20
  74. package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js.map +1 -1
  75. package/bundles/taiga-ui-core-components-primitive-spin-button.umd.min.js +1 -15
  76. package/bundles/taiga-ui-core-components-primitive-spin-button.umd.min.js.map +1 -1
  77. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +50 -20
  78. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  79. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +1 -15
  80. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
  81. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js +50 -20
  82. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js.map +1 -1
  83. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.min.js +1 -15
  84. package/bundles/taiga-ui-core-components-primitive-year-picker.umd.min.js.map +1 -1
  85. package/bundles/taiga-ui-core-components-root.umd.js +50 -20
  86. package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
  87. package/bundles/taiga-ui-core-components-root.umd.min.js +1 -15
  88. package/bundles/taiga-ui-core-components-root.umd.min.js.map +1 -1
  89. package/bundles/taiga-ui-core-components-scroll-controls.umd.js +50 -20
  90. package/bundles/taiga-ui-core-components-scroll-controls.umd.js.map +1 -1
  91. package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js +1 -15
  92. package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js.map +1 -1
  93. package/bundles/taiga-ui-core-components-scrollbar.umd.js +50 -20
  94. package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
  95. package/bundles/taiga-ui-core-components-scrollbar.umd.min.js +1 -15
  96. package/bundles/taiga-ui-core-components-scrollbar.umd.min.js.map +1 -1
  97. package/bundles/taiga-ui-core-components-svg.umd.js +50 -20
  98. package/bundles/taiga-ui-core-components-svg.umd.js.map +1 -1
  99. package/bundles/taiga-ui-core-components-svg.umd.min.js +1 -15
  100. package/bundles/taiga-ui-core-components-svg.umd.min.js.map +1 -1
  101. package/bundles/taiga-ui-core-components-theme-night.umd.js +50 -20
  102. package/bundles/taiga-ui-core-components-theme-night.umd.js.map +1 -1
  103. package/bundles/taiga-ui-core-components-theme-night.umd.min.js +1 -15
  104. package/bundles/taiga-ui-core-components-theme-night.umd.min.js.map +1 -1
  105. package/bundles/taiga-ui-core-components-tooltip.umd.js +50 -20
  106. package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
  107. package/bundles/taiga-ui-core-components-tooltip.umd.min.js +1 -15
  108. package/bundles/taiga-ui-core-components-tooltip.umd.min.js.map +1 -1
  109. package/bundles/taiga-ui-core-constants.umd.js +1 -1
  110. package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
  111. package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
  112. package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
  113. package/bundles/taiga-ui-core-directives-color.umd.js +50 -20
  114. package/bundles/taiga-ui-core-directives-color.umd.js.map +1 -1
  115. package/bundles/taiga-ui-core-directives-color.umd.min.js +1 -15
  116. package/bundles/taiga-ui-core-directives-color.umd.min.js.map +1 -1
  117. package/bundles/taiga-ui-core-directives-described-by.umd.js +50 -20
  118. package/bundles/taiga-ui-core-directives-described-by.umd.js.map +1 -1
  119. package/bundles/taiga-ui-core-directives-described-by.umd.min.js +1 -15
  120. package/bundles/taiga-ui-core-directives-described-by.umd.min.js.map +1 -1
  121. package/bundles/taiga-ui-core-directives-dropdown-controller.umd.js +50 -20
  122. package/bundles/taiga-ui-core-directives-dropdown-controller.umd.js.map +1 -1
  123. package/bundles/taiga-ui-core-directives-dropdown-controller.umd.min.js +1 -15
  124. package/bundles/taiga-ui-core-directives-dropdown-controller.umd.min.js.map +1 -1
  125. package/bundles/taiga-ui-core-directives-dropdown.umd.js +50 -20
  126. package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
  127. package/bundles/taiga-ui-core-directives-dropdown.umd.min.js +1 -15
  128. package/bundles/taiga-ui-core-directives-dropdown.umd.min.js.map +1 -1
  129. package/bundles/taiga-ui-core-directives-hint-controller.umd.js +50 -20
  130. package/bundles/taiga-ui-core-directives-hint-controller.umd.js.map +1 -1
  131. package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js +1 -15
  132. package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js.map +1 -1
  133. package/bundles/taiga-ui-core-directives-hint.umd.js +50 -20
  134. package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
  135. package/bundles/taiga-ui-core-directives-hint.umd.min.js +1 -15
  136. package/bundles/taiga-ui-core-directives-hint.umd.min.js.map +1 -1
  137. package/bundles/taiga-ui-core-directives-manual-hint.umd.js +50 -20
  138. package/bundles/taiga-ui-core-directives-manual-hint.umd.js.map +1 -1
  139. package/bundles/taiga-ui-core-directives-manual-hint.umd.min.js +1 -15
  140. package/bundles/taiga-ui-core-directives-manual-hint.umd.min.js.map +1 -1
  141. package/bundles/taiga-ui-core-directives-mask-accessor.umd.js +50 -20
  142. package/bundles/taiga-ui-core-directives-mask-accessor.umd.js.map +1 -1
  143. package/bundles/taiga-ui-core-directives-mask-accessor.umd.min.js +1 -15
  144. package/bundles/taiga-ui-core-directives-mask-accessor.umd.min.js.map +1 -1
  145. package/bundles/taiga-ui-core-directives-mode.umd.js +50 -20
  146. package/bundles/taiga-ui-core-directives-mode.umd.js.map +1 -1
  147. package/bundles/taiga-ui-core-directives-mode.umd.min.js +1 -15
  148. package/bundles/taiga-ui-core-directives-mode.umd.min.js.map +1 -1
  149. package/bundles/taiga-ui-core-directives-pointer-hint.umd.js +50 -20
  150. package/bundles/taiga-ui-core-directives-pointer-hint.umd.js.map +1 -1
  151. package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js +1 -15
  152. package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js.map +1 -1
  153. package/bundles/taiga-ui-core-directives-scroll-into-view.umd.js +50 -20
  154. package/bundles/taiga-ui-core-directives-scroll-into-view.umd.js.map +1 -1
  155. package/bundles/taiga-ui-core-directives-scroll-into-view.umd.min.js +1 -15
  156. package/bundles/taiga-ui-core-directives-scroll-into-view.umd.min.js.map +1 -1
  157. package/bundles/taiga-ui-core-directives-table-mode.umd.js +50 -20
  158. package/bundles/taiga-ui-core-directives-table-mode.umd.js.map +1 -1
  159. package/bundles/taiga-ui-core-directives-table-mode.umd.min.js +1 -15
  160. package/bundles/taiga-ui-core-directives-table-mode.umd.min.js.map +1 -1
  161. package/bundles/taiga-ui-core-directives-textfield-controller.umd.js +50 -20
  162. package/bundles/taiga-ui-core-directives-textfield-controller.umd.js.map +1 -1
  163. package/bundles/taiga-ui-core-directives-textfield-controller.umd.min.js +1 -15
  164. package/bundles/taiga-ui-core-directives-textfield-controller.umd.min.js.map +1 -1
  165. package/bundles/taiga-ui-core-directives-wrapper.umd.js +50 -20
  166. package/bundles/taiga-ui-core-directives-wrapper.umd.js.map +1 -1
  167. package/bundles/taiga-ui-core-directives-wrapper.umd.min.js +1 -15
  168. package/bundles/taiga-ui-core-directives-wrapper.umd.min.js.map +1 -1
  169. package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js +50 -20
  170. package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js.map +1 -1
  171. package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.min.js +1 -15
  172. package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.min.js.map +1 -1
  173. package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js +50 -20
  174. package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js.map +1 -1
  175. package/bundles/taiga-ui-core-internal-svg-defs-host.umd.min.js +1 -15
  176. package/bundles/taiga-ui-core-internal-svg-defs-host.umd.min.js.map +1 -1
  177. package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.js +50 -20
  178. package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.js.map +1 -1
  179. package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.min.js +1 -15
  180. package/bundles/taiga-ui-core-pipes-calendar-sheet.umd.min.js.map +1 -1
  181. package/bundles/taiga-ui-core-pipes-format-number.umd.js +50 -20
  182. package/bundles/taiga-ui-core-pipes-format-number.umd.js.map +1 -1
  183. package/bundles/taiga-ui-core-pipes-format-number.umd.min.js +1 -15
  184. package/bundles/taiga-ui-core-pipes-format-number.umd.min.js.map +1 -1
  185. package/bundles/taiga-ui-core-pipes-format-phone.umd.js +50 -20
  186. package/bundles/taiga-ui-core-pipes-format-phone.umd.js.map +1 -1
  187. package/bundles/taiga-ui-core-pipes-format-phone.umd.min.js +1 -15
  188. package/bundles/taiga-ui-core-pipes-format-phone.umd.min.js.map +1 -1
  189. package/bundles/taiga-ui-core-pipes-month.umd.js +50 -20
  190. package/bundles/taiga-ui-core-pipes-month.umd.js.map +1 -1
  191. package/bundles/taiga-ui-core-pipes-month.umd.min.js +1 -15
  192. package/bundles/taiga-ui-core-pipes-month.umd.min.js.map +1 -1
  193. package/bundles/taiga-ui-core-pipes-pluralize.umd.js +50 -20
  194. package/bundles/taiga-ui-core-pipes-pluralize.umd.js.map +1 -1
  195. package/bundles/taiga-ui-core-pipes-pluralize.umd.min.js +1 -15
  196. package/bundles/taiga-ui-core-pipes-pluralize.umd.min.js.map +1 -1
  197. package/bundles/taiga-ui-core-services.umd.js +50 -20
  198. package/bundles/taiga-ui-core-services.umd.js.map +1 -1
  199. package/bundles/taiga-ui-core-services.umd.min.js +1 -15
  200. package/bundles/taiga-ui-core-services.umd.min.js.map +1 -1
  201. package/bundles/taiga-ui-core-tokens.umd.js +51 -21
  202. package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
  203. package/bundles/taiga-ui-core-tokens.umd.min.js +1 -15
  204. package/bundles/taiga-ui-core-tokens.umd.min.js.map +1 -1
  205. package/bundles/taiga-ui-core-utils-format.umd.js +50 -20
  206. package/bundles/taiga-ui-core-utils-format.umd.js.map +1 -1
  207. package/bundles/taiga-ui-core-utils-format.umd.min.js +1 -15
  208. package/bundles/taiga-ui-core-utils-format.umd.min.js.map +1 -1
  209. package/bundles/taiga-ui-core-utils-mask.umd.js +50 -20
  210. package/bundles/taiga-ui-core-utils-mask.umd.js.map +1 -1
  211. package/bundles/taiga-ui-core-utils-mask.umd.min.js +1 -15
  212. package/bundles/taiga-ui-core-utils-mask.umd.min.js.map +1 -1
  213. package/components/data-list/taiga-ui-core-components-data-list.metadata.json +1 -1
  214. package/components/dropdown-box/dropdown-box.component.d.ts +1 -0
  215. package/components/dropdown-box/taiga-ui-core-components-dropdown-box.metadata.json +1 -1
  216. package/constants/taiga-ui-core-constants.metadata.json +1 -1
  217. package/constants/version.d.ts +1 -1
  218. package/esm2015/components/data-list/data-list.component.js +3 -3
  219. package/esm2015/components/data-list/option/option.component.js +3 -3
  220. package/esm2015/components/dropdown-box/dropdown-box.component.js +22 -9
  221. package/esm2015/constants/version.js +2 -2
  222. package/esm2015/tokens/is-mobile-resolution.js +2 -2
  223. package/esm5/components/data-list/data-list.component.js +3 -3
  224. package/esm5/components/data-list/option/option.component.js +3 -3
  225. package/esm5/components/dropdown-box/dropdown-box.component.js +26 -9
  226. package/esm5/constants/version.js +2 -2
  227. package/esm5/tokens/is-mobile-resolution.js +2 -2
  228. package/fesm2015/taiga-ui-core-components-data-list.js +4 -4
  229. package/fesm2015/taiga-ui-core-components-data-list.js.map +1 -1
  230. package/fesm2015/taiga-ui-core-components-dropdown-box.js +21 -8
  231. package/fesm2015/taiga-ui-core-components-dropdown-box.js.map +1 -1
  232. package/fesm2015/taiga-ui-core-constants.js +1 -1
  233. package/fesm2015/taiga-ui-core-constants.js.map +1 -1
  234. package/fesm2015/taiga-ui-core-tokens.js +2 -2
  235. package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
  236. package/fesm5/taiga-ui-core-components-data-list.js +4 -4
  237. package/fesm5/taiga-ui-core-components-data-list.js.map +1 -1
  238. package/fesm5/taiga-ui-core-components-dropdown-box.js +25 -8
  239. package/fesm5/taiga-ui-core-components-dropdown-box.js.map +1 -1
  240. package/fesm5/taiga-ui-core-constants.js +1 -1
  241. package/fesm5/taiga-ui-core-constants.js.map +1 -1
  242. package/fesm5/taiga-ui-core-tokens.js +2 -2
  243. package/fesm5/taiga-ui-core-tokens.js.map +1 -1
  244. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __param } from 'tslib';
2
2
  import { Inject, NgZone, ElementRef, HostBinding, ViewChild, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import { WINDOW, ANIMATION_FRAME } from '@ng-web-apis/common';
4
- import { POLLING_TIME, tuiZonefree, getClosestElement, inRange, px, tuiAssertIsHTMLElement, getClosestFocusable, setNativeFocused, TuiDestroyService, TuiDropdownHostComponent, AbstractTuiPortalHostComponent, tuiPure, TuiActiveZoneModule, TuiOverscrollModule } from '@taiga-ui/cdk';
4
+ import { POLLING_TIME, tuiZonefree, inRange, px, tuiAssertIsHTMLElement, getClosestFocusable, TuiDestroyService, TuiDropdownHostComponent, AbstractTuiPortalHostComponent, tuiPure, TuiActiveZoneModule, TuiOverscrollModule } from '@taiga-ui/cdk';
5
5
  import { tuiDropdownAnimation } from '@taiga-ui/core/animations';
6
6
  import { DEFAULT_MARGIN, DEFAULT_MAX_WIDTH } from '@taiga-ui/core/constants';
7
7
  import { TUI_DROPDOWN_DIRECTIVE, TUI_ANIMATION_OPTIONS } from '@taiga-ui/core/tokens';
@@ -54,7 +54,11 @@ let TuiDropdownBoxComponent = class TuiDropdownBoxComponent {
54
54
  }
55
55
  get inModal() {
56
56
  // @awful TODO: get rid of component tag name dependency
57
- return !!getClosestElement(this.directive.host, 'tui-dialog-host');
57
+ return !!this.directive.host.closest('tui-dialog-host');
58
+ }
59
+ get inOption() {
60
+ // @awful TODO: get rid of component tag name dependency
61
+ return !!this.directive.host.closest('[tuiOption]');
58
62
  }
59
63
  calculatePositionAndSize() {
60
64
  const { clientRect } = this.directive;
@@ -151,17 +155,26 @@ let TuiDropdownBoxComponent = class TuiDropdownBoxComponent {
151
155
  const topAvailableHeight = directiveRect.top - offset;
152
156
  const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;
153
157
  const finalDirection = this.getFinalDirection(directiveRect);
158
+ const optionOffset = this.inOption ? DEFAULT_MARGIN * 2 : 0;
154
159
  this.prevDirectionIsTop = finalDirection === 'top';
155
160
  if (finalDirection === 'top') {
156
161
  this.dropdownAnimation = this.animationBottom;
157
162
  style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));
158
163
  style.top = 'auto';
159
- style.bottom = px(hostRect.bottom - directiveRect.top - DEFAULT_MARGIN + offset);
164
+ style.bottom = px(hostRect.bottom -
165
+ directiveRect.top -
166
+ DEFAULT_MARGIN +
167
+ offset -
168
+ optionOffset);
160
169
  }
161
170
  else {
162
171
  this.dropdownAnimation = this.animationTop;
163
172
  style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));
164
- style.top = px(directiveRect.bottom - hostRect.top - DEFAULT_MARGIN + offset);
173
+ style.top = px(directiveRect.bottom -
174
+ hostRect.top -
175
+ DEFAULT_MARGIN +
176
+ offset -
177
+ optionOffset);
165
178
  style.bottom = 'auto';
166
179
  }
167
180
  }
@@ -239,10 +252,7 @@ let TuiDropdownBoxComponent = class TuiDropdownBoxComponent {
239
252
  while (focusable !== null && host.contains(focusable)) {
240
253
  focusable = getClosestFocusable(focusable, previous, root);
241
254
  }
242
- if (focusable === null) {
243
- return;
244
- }
245
- setNativeFocused(focusable);
255
+ focusable === null || focusable === void 0 ? void 0 : focusable.focus();
246
256
  }
247
257
  };
248
258
  TuiDropdownBoxComponent.ctorParameters = () => [
@@ -267,6 +277,9 @@ __decorate([
267
277
  __decorate([
268
278
  tuiPure
269
279
  ], TuiDropdownBoxComponent.prototype, "inModal", null);
280
+ __decorate([
281
+ tuiPure
282
+ ], TuiDropdownBoxComponent.prototype, "inOption", null);
270
283
  TuiDropdownBoxComponent = __decorate([
271
284
  Component({
272
285
  selector: 'tui-dropdown-box',
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-dropdown-box.js","sources":["ng://@taiga-ui/core/components/dropdown-box/dropdown-box.component.ts","ng://@taiga-ui/core/components/dropdown-box/dropdown-box.module.ts","ng://@taiga-ui/core/components/dropdown-box/taiga-ui-core-components-dropdown-box.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n AbstractTuiPortalHostComponent,\n getClosestElement,\n getClosestFocusable,\n inRange,\n POLLING_TIME,\n px,\n setNativeFocused,\n TuiActiveZoneDirective,\n tuiAssertIsHTMLElement,\n TuiDestroyService,\n TuiDropdownHostComponent,\n TuiOverscrollModeT,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {tuiDropdownAnimation} from '@taiga-ui/core/animations';\nimport {DEFAULT_MARGIN, DEFAULT_MAX_WIDTH} from '@taiga-ui/core/constants';\nimport {TuiDropdownAnimation} from '@taiga-ui/core/enums';\nimport {TuiAnimationOptions, TuiDropdown} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_DROPDOWN_DIRECTIVE} from '@taiga-ui/core/tokens';\nimport {TuiHorizontalDirection, TuiVerticalDirection} from '@taiga-ui/core/types';\nimport {getScreenWidth} from '@taiga-ui/core/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {takeUntil, throttleTime} from 'rxjs/operators';\n\n/**\n * This component is used to show template in a portal using default style of white rounded box with a shadow\n */\n// @bad TODO: OnPush\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: 'tui-dropdown-box',\n templateUrl: './dropdown-box.template.html',\n styleUrls: ['./dropdown-box.style.less'],\n changeDetection: ChangeDetectionStrategy.Default,\n providers: [TuiDestroyService],\n animations: [tuiDropdownAnimation],\n})\nexport class TuiDropdownBoxComponent implements AfterViewChecked {\n private readonly animationTop = {\n value: TuiDropdownAnimation.FadeInTop,\n ...this.options,\n };\n\n private readonly animationBottom = {\n value: TuiDropdownAnimation.FadeInBottom,\n ...this.options,\n };\n\n /**\n * Is previous position on top (to prevent jumping up and down on scroll)\n */\n private prevDirectionIsTop = false;\n\n @HostBinding('@tuiDropdownAnimation')\n dropdownAnimation!: TuiAnimationOptions;\n\n @ViewChild('content', {read: ElementRef})\n readonly contentElementRef?: ElementRef<HTMLElement>;\n\n constructor(\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_DROPDOWN_DIRECTIVE) readonly directive: TuiDropdown,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(AbstractTuiPortalHostComponent)\n private readonly portalHost: TuiDropdownHostComponent,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n merge(\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n this.directive.refresh$,\n fromEvent(this.windowRef, 'resize'),\n )\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => {\n this.calculatePositionAndSize();\n });\n }\n\n get overscroll(): TuiOverscrollModeT {\n return this.inModal ? 'all' : 'scroll';\n }\n\n @tuiPure\n getContext<T extends object>(\n context?: T,\n activeZone?: TuiActiveZoneDirective,\n ):\n | (T & {activeZone?: TuiActiveZoneDirective})\n | {activeZone?: TuiActiveZoneDirective} {\n return {...context, activeZone};\n }\n\n ngAfterViewChecked(): void {\n this.calculatePositionAndSize();\n }\n\n onTopFocus(): void {\n this.moveFocusOutside(true);\n }\n\n onBottomFocus(): void {\n this.moveFocusOutside(false);\n }\n\n @tuiPure\n private get inModal(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!getClosestElement(this.directive.host, 'tui-dialog-host');\n }\n\n private calculatePositionAndSize(): void {\n const {clientRect} = this.directive;\n const {style} = this.elementRef.nativeElement;\n const hostRect = this.directive.fixed\n ? this.portalHost.fixedPositionOffset()\n : this.portalHost.clientRect;\n\n style.position = this.directive.fixed ? 'fixed' : 'absolute';\n\n this.calculateVerticalPosition(style, clientRect, hostRect);\n this.calculateHorizontalPosition(style, clientRect, hostRect);\n this.calculateWidth(style, clientRect);\n }\n\n private getFinalAlign(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n ): TuiHorizontalDirection {\n const dropdownRect = this.elementRef.nativeElement.getBoundingClientRect();\n const dropdownWidth = this.elementRef.nativeElement.offsetWidth;\n const screenWidth = getScreenWidth(this.windowRef.document);\n const isDropdownSizeHypotheticallyFitsViewport =\n directiveRect.left + dropdownWidth < screenWidth ||\n directiveRect.right - dropdownWidth > 0;\n const isDropdownSizeActuallyFitsViewport =\n dropdownRect.right <= screenWidth && dropdownRect.left >= 0;\n let finalAlign: TuiHorizontalDirection = this.directive.align;\n\n switch (this.directive.align) {\n case 'left':\n if (\n isDropdownSizeHypotheticallyFitsViewport &&\n dropdownRect.right > screenWidth\n ) {\n finalAlign = 'right';\n }\n\n break;\n case 'right':\n if (isDropdownSizeHypotheticallyFitsViewport && dropdownRect.left < 0) {\n finalAlign = 'left';\n }\n\n break;\n }\n\n if (style.right === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'left';\n }\n\n if (style.left === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'right';\n }\n\n return finalAlign;\n }\n\n /**\n * Calculates horizontal position\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateHorizontalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const offset = this.directive.sided\n ? this.elementRef.nativeElement.getBoundingClientRect().width + DEFAULT_MARGIN\n : 0;\n const left = Math.ceil(directiveRect.left - hostRect.left - offset);\n const right = Math.floor(hostRect.right - directiveRect.right - offset);\n\n switch (this.getFinalAlign(style, directiveRect)) {\n case 'left':\n if (\n right + DEFAULT_MARGIN > this.windowRef.innerWidth ||\n inRange(left + DEFAULT_MARGIN, 0, this.windowRef.innerWidth)\n ) {\n style.left = px(left);\n style.right = 'auto';\n } else {\n style.left = 'auto';\n style.right = px(right);\n }\n\n break;\n case 'right':\n if (\n inRange(right + DEFAULT_MARGIN, 0, this.windowRef.innerWidth) ||\n left + DEFAULT_MARGIN > this.windowRef.innerWidth\n ) {\n style.left = 'auto';\n style.right = px(right);\n } else {\n style.left = px(left);\n style.right = 'auto';\n }\n\n break;\n }\n }\n\n /**\n * Calculates vertical position and height\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateVerticalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const windowHeight = this.windowRef.innerHeight;\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n const finalDirection = this.getFinalDirection(directiveRect);\n\n this.prevDirectionIsTop = finalDirection === 'top';\n\n if (finalDirection === 'top') {\n this.dropdownAnimation = this.animationBottom;\n\n style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));\n style.top = 'auto';\n style.bottom = px(\n hostRect.bottom - directiveRect.top - DEFAULT_MARGIN + offset,\n );\n } else {\n this.dropdownAnimation = this.animationTop;\n\n style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));\n style.top = px(directiveRect.bottom - hostRect.top - DEFAULT_MARGIN + offset);\n style.bottom = 'auto';\n }\n }\n\n private getFinalDirection(directiveRect: ClientRect): TuiVerticalDirection | null {\n const windowHeight = this.windowRef.innerHeight;\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n\n // Maximum space available on top and on the bottom in the viewport\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n\n let finalDirection: TuiVerticalDirection | null = null;\n\n // Given direction is applied if we can fit the box in the limits that way\n switch (this.directive.direction) {\n case 'top':\n if (topAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'top';\n }\n\n break;\n case 'bottom':\n if (bottomAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'bottom';\n }\n\n break;\n }\n\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n\n // Choose direction if given direction did not fit\n if (finalDirection === null && this.contentElementRef) {\n // Box height if it fits without scroll\n const visualHeight = Math.min(\n this.contentElementRef.nativeElement.getBoundingClientRect().height +\n (this.elementRef.nativeElement.offsetHeight -\n this.elementRef.nativeElement.clientHeight),\n boxHeightLimit,\n );\n\n // If there is enough space to fit below without scroll,\n // choose 'bottom', unless it was previously on the top\n if (this.prevDirectionIsTop && topAvailableHeight >= visualHeight) {\n finalDirection = 'top';\n } else if (bottomAvailableHeight >= visualHeight) {\n finalDirection = 'bottom';\n } else {\n // Corner case — select direction with more space\n finalDirection =\n bottomAvailableHeight >= topAvailableHeight ? 'bottom' : 'top';\n }\n }\n\n return finalDirection;\n }\n\n /**\n * Calculates width\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n */\n private calculateWidth(style: CSSStyleDeclaration, directiveRect: ClientRect): void {\n style.width =\n this.directive.limitMinWidth === 'fixed' && !this.directive.sided\n ? px(directiveRect.width)\n : '';\n\n if (this.directive.limitMinWidth === 'min' && !this.directive.sided) {\n style.minWidth = px(directiveRect.width);\n style.maxWidth = px(DEFAULT_MAX_WIDTH);\n\n return;\n }\n\n style.minWidth = '';\n style.maxWidth = '';\n }\n\n private moveFocusOutside(previous: boolean): void {\n const {host} = this.directive;\n const {ownerDocument} = host;\n const root = ownerDocument ? ownerDocument.body : host;\n\n tuiAssertIsHTMLElement(host);\n\n let focusable = getClosestFocusable(host, previous, root);\n\n while (focusable !== null && host.contains(focusable)) {\n focusable = getClosestFocusable(focusable, previous, root);\n }\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiOverscrollModule} from '@taiga-ui/cdk';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiModeModule} from '@taiga-ui/core/directives/mode';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDropdownBoxComponent} from './dropdown-box.component';\n\n@NgModule({\n imports: [\n TuiActiveZoneModule,\n PolymorpheusModule,\n TuiOverscrollModule,\n TuiScrollbarModule,\n TuiModeModule,\n ],\n entryComponents: [TuiDropdownBoxComponent],\n declarations: [TuiDropdownBoxComponent],\n exports: [TuiDropdownBoxComponent],\n})\nexport class TuiDropdownBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsCA;;;AAGA;AACA;AACA;IASa,uBAAuB,GAApC,MAAa,uBAAuB;IAsBhC,YAEI,QAA2B,EACX,MAAc,EACW,SAAsB,EAC9B,SAAiB,EACb,UAAmC,EAEvD,UAAoC,EACL,OAAyB,EAChD,eAAmC;QANnB,cAAS,GAAT,SAAS,CAAa;QAC9B,cAAS,GAAT,SAAS,CAAQ;QACb,eAAU,GAAV,UAAU,CAAyB;QAEvD,eAAU,GAAV,UAAU,CAA0B;QACL,YAAO,GAAP,OAAO,CAAkB;QA9B5D,iBAAY,mBACzB,KAAK,iCACF,IAAI,CAAC,OAAO,EACjB;QAEe,oBAAe,mBAC5B,KAAK,uCACF,IAAI,CAAC,OAAO,EACjB;;;;QAKM,uBAAkB,GAAG,KAAK,CAAC;QAoB/B,KAAK,CACD,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,EAChD,IAAI,CAAC,SAAS,CAAC,QAAQ,EACvB,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtC;aACI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;aAC9C,SAAS,CAAC;YACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACnC,CA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oB;EAAG;AAAvB,oBAAoB;IAZhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,aAAa;SAChB;QACD,eAAe,EAAE,CAAC,uBAAuB,CAAC;QAC1C,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACpBpC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-dropdown-box.js","sources":["ng://@taiga-ui/core/components/dropdown-box/dropdown-box.component.ts","ng://@taiga-ui/core/components/dropdown-box/dropdown-box.module.ts","ng://@taiga-ui/core/components/dropdown-box/taiga-ui-core-components-dropdown-box.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n AbstractTuiPortalHostComponent,\n getClosestFocusable,\n inRange,\n POLLING_TIME,\n px,\n TuiActiveZoneDirective,\n tuiAssertIsHTMLElement,\n TuiDestroyService,\n TuiDropdownHostComponent,\n TuiOverscrollModeT,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {tuiDropdownAnimation} from '@taiga-ui/core/animations';\nimport {DEFAULT_MARGIN, DEFAULT_MAX_WIDTH} from '@taiga-ui/core/constants';\nimport {TuiDropdownAnimation} from '@taiga-ui/core/enums';\nimport {TuiAnimationOptions, TuiDropdown} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_DROPDOWN_DIRECTIVE} from '@taiga-ui/core/tokens';\nimport {TuiHorizontalDirection, TuiVerticalDirection} from '@taiga-ui/core/types';\nimport {getScreenWidth} from '@taiga-ui/core/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {takeUntil, throttleTime} from 'rxjs/operators';\n\n/**\n * This component is used to show template in a portal using default style of white rounded box with a shadow\n */\n// @bad TODO: OnPush\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: 'tui-dropdown-box',\n templateUrl: './dropdown-box.template.html',\n styleUrls: ['./dropdown-box.style.less'],\n changeDetection: ChangeDetectionStrategy.Default,\n providers: [TuiDestroyService],\n animations: [tuiDropdownAnimation],\n})\nexport class TuiDropdownBoxComponent implements AfterViewChecked {\n private readonly animationTop = {\n value: TuiDropdownAnimation.FadeInTop,\n ...this.options,\n };\n\n private readonly animationBottom = {\n value: TuiDropdownAnimation.FadeInBottom,\n ...this.options,\n };\n\n /**\n * Is previous position on top (to prevent jumping up and down on scroll)\n */\n private prevDirectionIsTop = false;\n\n @HostBinding('@tuiDropdownAnimation')\n dropdownAnimation!: TuiAnimationOptions;\n\n @ViewChild('content', {read: ElementRef})\n readonly contentElementRef?: ElementRef<HTMLElement>;\n\n constructor(\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_DROPDOWN_DIRECTIVE) readonly directive: TuiDropdown,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(AbstractTuiPortalHostComponent)\n private readonly portalHost: TuiDropdownHostComponent,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n merge(\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n this.directive.refresh$,\n fromEvent(this.windowRef, 'resize'),\n )\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => {\n this.calculatePositionAndSize();\n });\n }\n\n get overscroll(): TuiOverscrollModeT {\n return this.inModal ? 'all' : 'scroll';\n }\n\n @tuiPure\n getContext<T extends object>(\n context?: T,\n activeZone?: TuiActiveZoneDirective,\n ):\n | (T & {activeZone?: TuiActiveZoneDirective})\n | {activeZone?: TuiActiveZoneDirective} {\n return {...context, activeZone};\n }\n\n ngAfterViewChecked(): void {\n this.calculatePositionAndSize();\n }\n\n onTopFocus(): void {\n this.moveFocusOutside(true);\n }\n\n onBottomFocus(): void {\n this.moveFocusOutside(false);\n }\n\n @tuiPure\n private get inModal(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!this.directive.host.closest('tui-dialog-host');\n }\n\n @tuiPure\n private get inOption(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!this.directive.host.closest('[tuiOption]');\n }\n\n private calculatePositionAndSize(): void {\n const {clientRect} = this.directive;\n const {style} = this.elementRef.nativeElement;\n const hostRect = this.directive.fixed\n ? this.portalHost.fixedPositionOffset()\n : this.portalHost.clientRect;\n\n style.position = this.directive.fixed ? 'fixed' : 'absolute';\n\n this.calculateVerticalPosition(style, clientRect, hostRect);\n this.calculateHorizontalPosition(style, clientRect, hostRect);\n this.calculateWidth(style, clientRect);\n }\n\n private getFinalAlign(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n ): TuiHorizontalDirection {\n const dropdownRect = this.elementRef.nativeElement.getBoundingClientRect();\n const dropdownWidth = this.elementRef.nativeElement.offsetWidth;\n const screenWidth = getScreenWidth(this.windowRef.document);\n const isDropdownSizeHypotheticallyFitsViewport =\n directiveRect.left + dropdownWidth < screenWidth ||\n directiveRect.right - dropdownWidth > 0;\n const isDropdownSizeActuallyFitsViewport =\n dropdownRect.right <= screenWidth && dropdownRect.left >= 0;\n let finalAlign: TuiHorizontalDirection = this.directive.align;\n\n switch (this.directive.align) {\n case 'left':\n if (\n isDropdownSizeHypotheticallyFitsViewport &&\n dropdownRect.right > screenWidth\n ) {\n finalAlign = 'right';\n }\n\n break;\n case 'right':\n if (isDropdownSizeHypotheticallyFitsViewport && dropdownRect.left < 0) {\n finalAlign = 'left';\n }\n\n break;\n }\n\n if (style.right === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'left';\n }\n\n if (style.left === 'auto' && isDropdownSizeActuallyFitsViewport) {\n finalAlign = 'right';\n }\n\n return finalAlign;\n }\n\n /**\n * Calculates horizontal position\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateHorizontalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const offset = this.directive.sided\n ? this.elementRef.nativeElement.getBoundingClientRect().width + DEFAULT_MARGIN\n : 0;\n const left = Math.ceil(directiveRect.left - hostRect.left - offset);\n const right = Math.floor(hostRect.right - directiveRect.right - offset);\n\n switch (this.getFinalAlign(style, directiveRect)) {\n case 'left':\n if (\n right + DEFAULT_MARGIN > this.windowRef.innerWidth ||\n inRange(left + DEFAULT_MARGIN, 0, this.windowRef.innerWidth)\n ) {\n style.left = px(left);\n style.right = 'auto';\n } else {\n style.left = 'auto';\n style.right = px(right);\n }\n\n break;\n case 'right':\n if (\n inRange(right + DEFAULT_MARGIN, 0, this.windowRef.innerWidth) ||\n left + DEFAULT_MARGIN > this.windowRef.innerWidth\n ) {\n style.left = 'auto';\n style.right = px(right);\n } else {\n style.left = px(left);\n style.right = 'auto';\n }\n\n break;\n }\n }\n\n /**\n * Calculates vertical position and height\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateVerticalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const windowHeight = this.windowRef.innerHeight;\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n const finalDirection = this.getFinalDirection(directiveRect);\n const optionOffset = this.inOption ? DEFAULT_MARGIN * 2 : 0;\n\n this.prevDirectionIsTop = finalDirection === 'top';\n\n if (finalDirection === 'top') {\n this.dropdownAnimation = this.animationBottom;\n\n style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));\n style.top = 'auto';\n style.bottom = px(\n hostRect.bottom -\n directiveRect.top -\n DEFAULT_MARGIN +\n offset -\n optionOffset,\n );\n } else {\n this.dropdownAnimation = this.animationTop;\n\n style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));\n style.top = px(\n directiveRect.bottom -\n hostRect.top -\n DEFAULT_MARGIN +\n offset -\n optionOffset,\n );\n style.bottom = 'auto';\n }\n }\n\n private getFinalDirection(directiveRect: ClientRect): TuiVerticalDirection | null {\n const windowHeight = this.windowRef.innerHeight;\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n\n // Maximum space available on top and on the bottom in the viewport\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n\n let finalDirection: TuiVerticalDirection | null = null;\n\n // Given direction is applied if we can fit the box in the limits that way\n switch (this.directive.direction) {\n case 'top':\n if (topAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'top';\n }\n\n break;\n case 'bottom':\n if (bottomAvailableHeight >= this.directive.minHeight) {\n finalDirection = 'bottom';\n }\n\n break;\n }\n\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n\n // Choose direction if given direction did not fit\n if (finalDirection === null && this.contentElementRef) {\n // Box height if it fits without scroll\n const visualHeight = Math.min(\n this.contentElementRef.nativeElement.getBoundingClientRect().height +\n (this.elementRef.nativeElement.offsetHeight -\n this.elementRef.nativeElement.clientHeight),\n boxHeightLimit,\n );\n\n // If there is enough space to fit below without scroll,\n // choose 'bottom', unless it was previously on the top\n if (this.prevDirectionIsTop && topAvailableHeight >= visualHeight) {\n finalDirection = 'top';\n } else if (bottomAvailableHeight >= visualHeight) {\n finalDirection = 'bottom';\n } else {\n // Corner case — select direction with more space\n finalDirection =\n bottomAvailableHeight >= topAvailableHeight ? 'bottom' : 'top';\n }\n }\n\n return finalDirection;\n }\n\n /**\n * Calculates width\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n */\n private calculateWidth(style: CSSStyleDeclaration, directiveRect: ClientRect): void {\n style.width =\n this.directive.limitMinWidth === 'fixed' && !this.directive.sided\n ? px(directiveRect.width)\n : '';\n\n if (this.directive.limitMinWidth === 'min' && !this.directive.sided) {\n style.minWidth = px(directiveRect.width);\n style.maxWidth = px(DEFAULT_MAX_WIDTH);\n\n return;\n }\n\n style.minWidth = '';\n style.maxWidth = '';\n }\n\n private moveFocusOutside(previous: boolean): void {\n const {host} = this.directive;\n const {ownerDocument} = host;\n const root = ownerDocument ? ownerDocument.body : host;\n\n tuiAssertIsHTMLElement(host);\n\n let focusable = getClosestFocusable(host, previous, root);\n\n while (focusable !== null && host.contains(focusable)) {\n focusable = getClosestFocusable(focusable, previous, root);\n }\n\n focusable?.focus();\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiOverscrollModule} from '@taiga-ui/cdk';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiModeModule} from '@taiga-ui/core/directives/mode';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDropdownBoxComponent} from './dropdown-box.component';\n\n@NgModule({\n imports: [\n TuiActiveZoneModule,\n PolymorpheusModule,\n TuiOverscrollModule,\n TuiScrollbarModule,\n TuiModeModule,\n ],\n entryComponents: [TuiDropdownBoxComponent],\n declarations: [TuiDropdownBoxComponent],\n exports: [TuiDropdownBoxComponent],\n})\nexport class TuiDropdownBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"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CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACpBpC;;;;;;"}
@@ -64,7 +64,7 @@ const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]$/;
64
64
  const TUI_LATIN_REGEXP = /[A-z]/;
65
65
  const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;
66
66
 
67
- const VERSION = '2.46.0';
67
+ const VERSION = '2.47.0';
68
68
 
69
69
  /**
70
70
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-constants.js","sources":["ng://@taiga-ui/core/constants/absolute-box-sizes.ts","ng://@taiga-ui/core/constants/decimal-symbols.ts","ng://@taiga-ui/core/constants/default-icons-path.ts","ng://@taiga-ui/core/constants/default-marker-handler.ts","ng://@taiga-ui/core/constants/editing-keys.ts","ng://@taiga-ui/core/constants/events.ts","ng://@taiga-ui/core/constants/mask-caret-trap.ts","ng://@taiga-ui/core/constants/media.ts","ng://@taiga-ui/core/constants/regexp.ts","ng://@taiga-ui/core/constants/version.ts","ng://@taiga-ui/core/constants/taiga-ui-core-constants.ts"],"sourcesContent":["export const DEFAULT_MARGIN = 4;\nexport const DEFAULT_MIN_HEIGHT = 80;\nexport const DEFAULT_MAX_HEIGHT = 400;\nexport const DEFAULT_MAX_WIDTH = 600;\n","export const TUI_DECIMAL_SYMBOLS: readonly string[] = [',', '.'];\n","import {TuiStringHandler} from '@taiga-ui/cdk';\n\nexport const DEFAULT_ICONS_PATH: TuiStringHandler<string> = name =>\n name.includes('.svg#') ? name : `#${name}`;\n","import {EMPTY_ARRAY} from '@taiga-ui/cdk';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\nexport const TUI_DEFAULT_MARKER_HANDLER: TuiMarkerHandler = () => EMPTY_ARRAY;\n","export const tuiEditingKeys: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n","/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * An event for scrolling an element into view within {@link TuiScrollbarComponent}.\n */\nexport const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';\n\n/**\n * An event to notify {@link TuiScrollbarComponent} that\n * it should control a nested element.\n */\nexport const TUI_SCROLLABLE = 'tui-scrollable';\n\n/**\n * An event indicating and error during icon loading in {@link TuiSvgComponent}.\n */\nexport const TUI_ICON_ERROR = 'tui-icon-error';\n","export const MASK_CARET_TRAP = '[]';\n","/**\n * Media constants are exact the same as css media breakpoints\n * @deprecated use TUI_MEDIA token\n */\nexport const MEDIA = {\n mobile: 320,\n tablet: 600,\n desktopSmall: 1024,\n desktopLarge: 1280,\n};\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\nexport const TUI_LEADING_ZEROES_REGEXP = /^0+/;\nexport const TUI_MASK_SYMBOLS_REGEXP = /[ \\-_()]/g;\nexport const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\\\/#!$%\\\\^&\\\\*;:{}=\\\\-_`~()]$/;\nexport const TUI_LATIN_REGEXP = /[A-z]/;\nexport const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;\n","export const VERSION = '2.46.0';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAAa,cAAc,GAAG,EAAE;MACnB,kBAAkB,GAAG,GAAG;MACxB,kBAAkB,GAAG,IAAI;MACzB,iBAAiB,GAAG;;MCHpB,mBAAmB,GAAsB,CAAC,GAAG,EAAE,GAAG;;MCElD,kBAAkB,GAA6B,IAAI,IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI;;MCA/B,0BAA0B,GAAqB,MAAM;;MCHrD,cAAc,GAAsB;IAC7C,UAAU;IACV,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;ACTV;;;;MAIa,iBAAiB,GAAG,oBAAoB;AAErD;;;MAGa,oBAAoB,GAAG,uBAAuB;AAE3D;;;;MAIa,cAAc,GAAG,iBAAiB;AAE/C;;;MAGa,cAAc,GAAG;;MCpBjB,eAAe,GAAG;;ACA/B;;;;MAIa,KAAK,GAAG;IACjB,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;;;MCRT,gBAAgB,GAAG,KAAK;MACxB,oBAAoB,GAAG,KAAK;MAC5B,qBAAqB,GAAG,OAAO;MAC/B,yBAAyB,GAAG,MAAM;MAClC,uBAAuB,GAAG,YAAY;MACtC,gCAAgC,GAAG,mCAAmC;MACtE,gBAAgB,GAAG,QAAQ;MAC3B,4BAA4B,GAAG;;MCP/B,OAAO,GAAG;;ACAvB;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-constants.js","sources":["ng://@taiga-ui/core/constants/absolute-box-sizes.ts","ng://@taiga-ui/core/constants/decimal-symbols.ts","ng://@taiga-ui/core/constants/default-icons-path.ts","ng://@taiga-ui/core/constants/default-marker-handler.ts","ng://@taiga-ui/core/constants/editing-keys.ts","ng://@taiga-ui/core/constants/events.ts","ng://@taiga-ui/core/constants/mask-caret-trap.ts","ng://@taiga-ui/core/constants/media.ts","ng://@taiga-ui/core/constants/regexp.ts","ng://@taiga-ui/core/constants/version.ts","ng://@taiga-ui/core/constants/taiga-ui-core-constants.ts"],"sourcesContent":["export const DEFAULT_MARGIN = 4;\nexport const DEFAULT_MIN_HEIGHT = 80;\nexport const DEFAULT_MAX_HEIGHT = 400;\nexport const DEFAULT_MAX_WIDTH = 600;\n","export const TUI_DECIMAL_SYMBOLS: readonly string[] = [',', '.'];\n","import {TuiStringHandler} from '@taiga-ui/cdk';\n\nexport const DEFAULT_ICONS_PATH: TuiStringHandler<string> = name =>\n name.includes('.svg#') ? name : `#${name}`;\n","import {EMPTY_ARRAY} from '@taiga-ui/cdk';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\nexport const TUI_DEFAULT_MARKER_HANDLER: TuiMarkerHandler = () => EMPTY_ARRAY;\n","export const tuiEditingKeys: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n","/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * An event for scrolling an element into view within {@link TuiScrollbarComponent}.\n */\nexport const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';\n\n/**\n * An event to notify {@link TuiScrollbarComponent} that\n * it should control a nested element.\n */\nexport const TUI_SCROLLABLE = 'tui-scrollable';\n\n/**\n * An event indicating and error during icon loading in {@link TuiSvgComponent}.\n */\nexport const TUI_ICON_ERROR = 'tui-icon-error';\n","export const MASK_CARET_TRAP = '[]';\n","/**\n * Media constants are exact the same as css media breakpoints\n * @deprecated use TUI_MEDIA token\n */\nexport const MEDIA = {\n mobile: 320,\n tablet: 600,\n desktopSmall: 1024,\n desktopLarge: 1280,\n};\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\nexport const TUI_LEADING_ZEROES_REGEXP = /^0+/;\nexport const TUI_MASK_SYMBOLS_REGEXP = /[ \\-_()]/g;\nexport const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\\\/#!$%\\\\^&\\\\*;:{}=\\\\-_`~()]$/;\nexport const TUI_LATIN_REGEXP = /[A-z]/;\nexport const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;\n","export const VERSION = '2.47.0';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAAa,cAAc,GAAG,EAAE;MACnB,kBAAkB,GAAG,GAAG;MACxB,kBAAkB,GAAG,IAAI;MACzB,iBAAiB,GAAG;;MCHpB,mBAAmB,GAAsB,CAAC,GAAG,EAAE,GAAG;;MCElD,kBAAkB,GAA6B,IAAI,IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI;;MCA/B,0BAA0B,GAAqB,MAAM;;MCHrD,cAAc,GAAsB;IAC7C,UAAU;IACV,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;ACTV;;;;MAIa,iBAAiB,GAAG,oBAAoB;AAErD;;;MAGa,oBAAoB,GAAG,uBAAuB;AAE3D;;;;MAIa,cAAc,GAAG,iBAAiB;AAE/C;;;MAGa,cAAc,GAAG;;MCpBjB,eAAe,GAAG;;ACA/B;;;;MAIa,KAAK,GAAG;IACjB,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;;;MCRT,gBAAgB,GAAG,KAAK;MACxB,oBAAoB,GAAG,KAAK;MAC5B,qBAAqB,GAAG,OAAO;MAC/B,yBAAyB,GAAG,MAAM;MAClC,uBAAuB,GAAG,YAAY;MACtC,gCAAgC,GAAG,mCAAmC;MACtE,gBAAgB,GAAG,QAAQ;MAC3B,4BAA4B,GAAG;;MCP/B,OAAO,GAAG;;ACAvB;;;;;;"}
@@ -3,7 +3,7 @@ import { extractI18n } from '@taiga-ui/i18n';
3
3
  import { iconsPathFactory } from '@taiga-ui/core/utils';
4
4
  import { WINDOW } from '@ng-web-apis/common';
5
5
  import { typedFromEvent, tuiZoneOptimized, CHAR_NO_BREAK_SPACE, TUI_SANITIZER as TUI_SANITIZER$1 } from '@taiga-ui/cdk';
6
- import { startWith, map, distinctUntilChanged, share } from 'rxjs/operators';
6
+ import { share, startWith, map, distinctUntilChanged } from 'rxjs/operators';
7
7
  import { svgLinearGradientProcessor } from '@taiga-ui/cdk/utils/svg';
8
8
  import { identity } from 'rxjs';
9
9
 
@@ -78,7 +78,7 @@ const TUI_IS_MOBILE_RES = new InjectionToken('Mobile resolution stream for priva
78
78
  factory: () => {
79
79
  const windowRef = inject(WINDOW);
80
80
  const { mobile } = inject(TUI_MEDIA);
81
- return typedFromEvent(windowRef, 'resize').pipe(startWith(null), map(() => windowRef.innerWidth < mobile), distinctUntilChanged(), tuiZoneOptimized(inject(NgZone)), share());
81
+ return typedFromEvent(windowRef, 'resize').pipe(share(), startWith(null), map(() => windowRef.innerWidth < mobile), distinctUntilChanged(), tuiZoneOptimized(inject(NgZone)));
82
82
  },
83
83
  });
84
84
 
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-tokens.js","sources":["ng://@taiga-ui/core/tokens/animations-duration.ts","ng://@taiga-ui/core/tokens/animation-options.ts","ng://@taiga-ui/core/tokens/assert-enabled.ts","ng://@taiga-ui/core/tokens/data-list-accessor.ts","ng://@taiga-ui/core/tokens/data-list-host.ts","ng://@taiga-ui/core/tokens/document-or-shadow-root.ts","ng://@taiga-ui/core/tokens/dropdown-directive.ts","ng://@taiga-ui/core/tokens/element-ref.ts","ng://@taiga-ui/core/tokens/first-day-of-week.ts","ng://@taiga-ui/core/tokens/i18n.ts","ng://@taiga-ui/core/tokens/icon-place.ts","ng://@taiga-ui/core/tokens/icons.ts","ng://@taiga-ui/core/tokens/icons-path.ts","ng://@taiga-ui/core/tokens/media.ts","ng://@taiga-ui/core/tokens/is-mobile-resolution.ts","ng://@taiga-ui/core/tokens/mode.ts","ng://@taiga-ui/core/tokens/notification-options.ts","ng://@taiga-ui/core/tokens/number-format.ts","ng://@taiga-ui/core/tokens/option-content.ts","ng://@taiga-ui/core/tokens/ordered-short-week-days.ts","ng://@taiga-ui/core/tokens/sanitizer.ts","ng://@taiga-ui/core/tokens/scroll-ref.ts","ng://@taiga-ui/core/tokens/svg-content-processor.ts","ng://@taiga-ui/core/tokens/svg-src-processor.ts","ng://@taiga-ui/core/tokens/textfield-appearance.ts","ng://@taiga-ui/core/tokens/textfield-host.ts","ng://@taiga-ui/core/tokens/theme.ts","ng://@taiga-ui/core/tokens/value-accessor.ts","ng://@taiga-ui/core/tokens/taiga-ui-core-tokens.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const TUI_ANIMATIONS_DURATION = new InjectionToken<number>(\n 'Duration of all Taiga UI animations in ms',\n {\n factory: () => 300,\n },\n);\n","import {AnimationOptions} from '@angular/animations';\nimport {inject, InjectionToken} from '@angular/core';\n\nimport {TUI_ANIMATIONS_DURATION} from './animations-duration';\n\nexport const TUI_ANIMATION_OPTIONS = new InjectionToken<AnimationOptions>(\n 'Options for Taiga UI animations',\n {\n factory: () => ({\n params: {\n duration: inject(TUI_ANIMATIONS_DURATION),\n },\n }),\n },\n);\n","import {InjectionToken, isDevMode} from '@angular/core';\n\nexport const TUI_ASSERT_ENABLED = new InjectionToken(\n 'Flag to enable assertions across Taiga UI',\n {\n factory: () => isDevMode(),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_ACCESSOR = new InjectionToken<TuiDataListAccessor>(\n 'Accessor for options',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_HOST = new InjectionToken<TuiDataListHost<any>>(\n 'DataList controller',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_DOCUMENT_OR_SHADOW_ROOT = new InjectionToken<DocumentOrShadowRoot>(\n 'Document or ShadowRoot',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDropdown} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DROPDOWN_DIRECTIVE = new InjectionToken<TuiDropdown>(\n 'Directive controlling TuiDropdownBoxComponent',\n);\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_ELEMENT_REF = new InjectionToken<ElementRef>(\n 'ElementRef when you cannot use @Input for single time injection',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDayOfWeek} from '@taiga-ui/cdk';\n\nexport const TUI_FIRST_DAY_OF_WEEK = new InjectionToken<TuiDayOfWeek>(\n 'The first day of the week index',\n {\n factory: () => TuiDayOfWeek.Monday,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {extractI18n} from '@taiga-ui/i18n';\n\nexport const TUI_MONTHS = new InjectionToken('Localized months names', {\n factory: extractI18n('months'),\n});\n\nexport const TUI_CLOSE_WORD = new InjectionToken(`i18n 'close' word`, {\n factory: extractI18n('close'),\n});\n\nexport const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(\n `i18n 'Nothing found' message`,\n {\n factory: extractI18n('nothingFoundMessage'),\n },\n);\n\nexport const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(`i18n of error message`, {\n factory: extractI18n('defaultErrorMessage'),\n});\n\nexport const TUI_SPIN_TEXTS = new InjectionToken('spin i18n texts', {\n factory: extractI18n('spinTexts'),\n});\n\nexport const TUI_SHORT_WEEK_DAYS = new InjectionToken('calendars i18n texts', {\n factory: extractI18n('shortWeekDays'),\n});\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICONS_PLACE: InjectionToken<string> = new InjectionToken<string>(\n 'Recommended paths to icons from documentation guide',\n {\n factory: () => 'assets/taiga-ui/icons',\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICONS = new InjectionToken<Record<string, string>>(\n 'A key/value dictionary of icon names and src to be defined with TuiSvgService',\n {\n factory: () => ({}),\n },\n);\n","import {inject, InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {iconsPathFactory} from '@taiga-ui/core/utils';\n\nimport {TUI_ICONS_PLACE} from './icon-place';\n\nexport const TUI_ICONS_PATH: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>(\n 'A handler to retrieve USE id for icon by name',\n {factory: () => iconsPathFactory(inject(TUI_ICONS_PLACE))},\n );\n","import {InjectionToken} from '@angular/core';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\n\nexport const TUI_MEDIA = new InjectionToken<TuiMedia>('Token for media constant', {\n factory: () => ({\n mobile: 768,\n desktopSmall: 1024,\n desktopLarge: 1280,\n }),\n});\n","import {inject, InjectionToken, NgZone} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {tuiZoneOptimized, typedFromEvent} from '@taiga-ui/cdk';\nimport {Observable} from 'rxjs';\nimport {distinctUntilChanged, map, share, startWith} from 'rxjs/operators';\n\nimport {TUI_MEDIA} from './media';\n\nexport const TUI_IS_MOBILE_RES = new InjectionToken<Observable<boolean>>(\n 'Mobile resolution stream for private providers',\n {\n factory: () => {\n const windowRef = inject(WINDOW);\n const {mobile} = inject(TUI_MEDIA);\n\n return typedFromEvent(windowRef, 'resize').pipe(\n startWith(null),\n map(() => windowRef.innerWidth < mobile),\n distinctUntilChanged(),\n tuiZoneOptimized(inject(NgZone)),\n share(),\n );\n },\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\nexport const TUI_MODE: InjectionToken<Observable<TuiBrightness | null>> =\n new InjectionToken<Observable<TuiBrightness | null>>(\n 'Mode stream for private providers',\n );\n","import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiAlertOptions} from '@taiga-ui/core/interfaces';\n\nexport interface TuiNotificationDefaultOptions\n extends Omit<TuiAlertOptions<unknown>, 'data'> {\n readonly defaultAutoCloseTime: number;\n}\n\n/**\n * @deprecated: remove in v3.0, use TuiNotificationDefaultOptions\n */\nexport type NotificationTokenOptions = TuiNotificationDefaultOptions;\n\n/** Default values for the notification options. */\nexport const TUI_NOTIFICATION_DEFAULT_OPTIONS: TuiNotificationDefaultOptions = {\n autoClose: true,\n label: '',\n status: TuiNotification.Info,\n hasIcon: true,\n hasCloseButton: true,\n defaultAutoCloseTime: 3000,\n};\n\nexport const TUI_NOTIFICATION_OPTIONS = new InjectionToken<TuiNotificationDefaultOptions>(\n 'Default parameters for notification alert component',\n {\n factory: () => TUI_NOTIFICATION_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiNotificationOptionsProvider(\n options: Partial<TuiNotificationDefaultOptions>,\n): ValueProvider {\n return {\n provide: TUI_NOTIFICATION_OPTIONS,\n useValue: {...TUI_NOTIFICATION_DEFAULT_OPTIONS, ...options},\n };\n}\n","import {InjectionToken} from '@angular/core';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\nimport {NumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport const TUI_NUMBER_FORMAT = new InjectionToken<NumberFormatSettings>(\n 'Formatting configuration for displayed numbers',\n {\n factory: () => ({\n decimalSeparator: ',',\n thousandSeparator: CHAR_NO_BREAK_SPACE,\n zeroPadding: true,\n }),\n },\n);\n","import {InjectionToken, TemplateRef} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport const TUI_OPTION_CONTENT = new InjectionToken<\n PolymorpheusContent<TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>>\n>('Content for tuiOption component');\n","import {inject, InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TUI_FIRST_DAY_OF_WEEK, TUI_SHORT_WEEK_DAYS} from './index';\n\nexport type WEEK_DAYS_NAMES = [string, string, string, string, string, string, string];\n\n// TODO: 3.0 Remove export in ivy compilation\nexport const convertToSundayFirstWeekFormat = (\n weekDaysNames: WEEK_DAYS_NAMES,\n): WEEK_DAYS_NAMES => {\n const sundayIndex = weekDaysNames.length - 1;\n\n return [\n weekDaysNames[sundayIndex],\n ...weekDaysNames.slice(0, sundayIndex),\n ] as WEEK_DAYS_NAMES;\n};\n\nexport const TUI_ORDERED_SHORT_WEEK_DAYS = new InjectionToken<\n Observable<WEEK_DAYS_NAMES>\n>('Ordered calendars i18n texts', {\n factory: () => {\n const firstDayOfWeekIndex = inject(TUI_FIRST_DAY_OF_WEEK);\n\n return inject(TUI_SHORT_WEEK_DAYS).pipe(\n map(convertToSundayFirstWeekFormat),\n map(\n weekDays =>\n [\n ...weekDays.slice(firstDayOfWeekIndex),\n ...weekDays.slice(0, firstDayOfWeekIndex),\n ] as WEEK_DAYS_NAMES,\n ),\n );\n },\n});\n","import {TUI_SANITIZER as TOKEN} from '@taiga-ui/cdk';\n\nexport const TUI_SANITIZER = TOKEN;\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_SCROLL_REF = new InjectionToken<ElementRef<HTMLElement>>(\n 'Scrollable container',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {svgLinearGradientProcessor} from '@taiga-ui/cdk/utils/svg';\n\nexport const TUI_SVG_CONTENT_PROCESSOR: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>(\n 'Transform function the contents of the loaded svg file',\n {factory: () => svgLinearGradientProcessor},\n );\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {identity} from 'rxjs';\n\nexport const TUI_SVG_SRC_PROCESSOR: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>('Source path processor for svg', {\n factory: () => identity,\n });\n","import {InjectionToken} from '@angular/core';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\n\nexport const TUI_TEXTFIELD_APPEARANCE = new InjectionToken<string>(\n 'Appearance for inputs',\n {\n factory: () => TuiAppearance.Textfield,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiTextfieldHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_TEXTFIELD_HOST = new InjectionToken<TuiTextfieldHost>(\n 'An interface to communicate with textfield based controls',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_THEME = new InjectionToken<string>('Theme name', {\n factory: () => 'Taiga',\n});\n","import {InjectionToken} from '@angular/core';\nimport {ControlValueAccessor} from '@angular/forms';\n\nexport const TUI_VALUE_ACCESSOR = new InjectionToken<ControlValueAccessor>(\n 'Buffer token to pass NG_VALUE_ACCESSOR to a different Injector',\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TOKEN"],"mappings":";;;;;;;;;MAEa,uBAAuB,GAAG,IAAI,cAAc,CACrD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,GAAG;CACrB;;MCDQ,qBAAqB,GAAG,IAAI,cAAc,CACnD,iCAAiC,EACjC;IACI,OAAO,EAAE,OAAO;QACZ,MAAM,EAAE;YACJ,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;SAC5C;KACJ,CAAC;CACL;;MCXQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,SAAS,EAAE;CAC7B;;MCHQ,sBAAsB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;MCDb,kBAAkB,GAAG,IAAI,cAAc,CAChD,qBAAqB;;MCFZ,2BAA2B,GAAG,IAAI,cAAc,CACzD,wBAAwB;;MCAf,sBAAsB,GAAG,IAAI,cAAc,CACpD,+CAA+C;;MCFtC,eAAe,GAAG,IAAI,cAAc,CAC7C,iEAAiE;;MCAxD,qBAAqB,GAAG,IAAI,cAAc,CACnD,iCAAiC,EACjC;IACI,OAAO,EAAE;CACZ;;MCJQ,UAAU,GAAG,IAAI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AAG,IAAI,cAAc,CAE3D,8BAA8B,EAAE;IAC9B,OAAO,EAAE;QACL,MAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAE1D,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,CACnC,GAAG,CAAC,8BAA8B,CAAC,EACnC,GAAG,CACC,QAAQ,IACJ;YACI,GAAG,QAAQ,CAAC,KAAK,CAAC,mBAAmB,CAAC;YACtC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC;SACzB,CAC3B,CACJ,CAAC;KACL;CACJ;;MCnCY,aAAa,GAAGA;;MCAhB,cAAc,GAAG,IAAI,cAAc,CAC5C,sBAAsB;;MCCb,yBAAyB,GAClC,IAAI,cAAc,CACd,wDAAwD,EACxD,EAAC,OAAO,EAAE,MAAM,0BAA0B,EAAC;;MCHtC,qBAAqB,GAC9B,IAAI,cAAc,CAA2B,+BAA+B,EAAE;IAC1E,OAAO,EAAE,MAAM,QAAQ;CAC1B;;MCJQ,wBAAwB,GAAG,IAAI,cAAc,CACtD,uBAAuB,EACvB;IACI,OAAO,EAAE;CACZ;;MCJQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2DAA2D;;MCFlD,SAAS,GAAG,IAAI,cAAc,CAAS,YAAY,EAAE;IAC9D,OAAO,EAAE,MAAM,OAAO;CACzB;;MCDY,kBAAkB,GAAG,IAAI,cAAc,CAChD,gEAAgE;;ACJpE;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-tokens.js","sources":["ng://@taiga-ui/core/tokens/animations-duration.ts","ng://@taiga-ui/core/tokens/animation-options.ts","ng://@taiga-ui/core/tokens/assert-enabled.ts","ng://@taiga-ui/core/tokens/data-list-accessor.ts","ng://@taiga-ui/core/tokens/data-list-host.ts","ng://@taiga-ui/core/tokens/document-or-shadow-root.ts","ng://@taiga-ui/core/tokens/dropdown-directive.ts","ng://@taiga-ui/core/tokens/element-ref.ts","ng://@taiga-ui/core/tokens/first-day-of-week.ts","ng://@taiga-ui/core/tokens/i18n.ts","ng://@taiga-ui/core/tokens/icon-place.ts","ng://@taiga-ui/core/tokens/icons.ts","ng://@taiga-ui/core/tokens/icons-path.ts","ng://@taiga-ui/core/tokens/media.ts","ng://@taiga-ui/core/tokens/is-mobile-resolution.ts","ng://@taiga-ui/core/tokens/mode.ts","ng://@taiga-ui/core/tokens/notification-options.ts","ng://@taiga-ui/core/tokens/number-format.ts","ng://@taiga-ui/core/tokens/option-content.ts","ng://@taiga-ui/core/tokens/ordered-short-week-days.ts","ng://@taiga-ui/core/tokens/sanitizer.ts","ng://@taiga-ui/core/tokens/scroll-ref.ts","ng://@taiga-ui/core/tokens/svg-content-processor.ts","ng://@taiga-ui/core/tokens/svg-src-processor.ts","ng://@taiga-ui/core/tokens/textfield-appearance.ts","ng://@taiga-ui/core/tokens/textfield-host.ts","ng://@taiga-ui/core/tokens/theme.ts","ng://@taiga-ui/core/tokens/value-accessor.ts","ng://@taiga-ui/core/tokens/taiga-ui-core-tokens.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const TUI_ANIMATIONS_DURATION = new InjectionToken<number>(\n 'Duration of all Taiga UI animations in ms',\n {\n factory: () => 300,\n },\n);\n","import {AnimationOptions} from '@angular/animations';\nimport {inject, InjectionToken} from '@angular/core';\n\nimport {TUI_ANIMATIONS_DURATION} from './animations-duration';\n\nexport const TUI_ANIMATION_OPTIONS = new InjectionToken<AnimationOptions>(\n 'Options for Taiga UI animations',\n {\n factory: () => ({\n params: {\n duration: inject(TUI_ANIMATIONS_DURATION),\n },\n }),\n },\n);\n","import {InjectionToken, isDevMode} from '@angular/core';\n\nexport const TUI_ASSERT_ENABLED = new InjectionToken(\n 'Flag to enable assertions across Taiga UI',\n {\n factory: () => isDevMode(),\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_ACCESSOR = new InjectionToken<TuiDataListAccessor>(\n 'Accessor for options',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DATA_LIST_HOST = new InjectionToken<TuiDataListHost<any>>(\n 'DataList controller',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_DOCUMENT_OR_SHADOW_ROOT = new InjectionToken<DocumentOrShadowRoot>(\n 'Document or ShadowRoot',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDropdown} from '@taiga-ui/core/interfaces';\n\nexport const TUI_DROPDOWN_DIRECTIVE = new InjectionToken<TuiDropdown>(\n 'Directive controlling TuiDropdownBoxComponent',\n);\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_ELEMENT_REF = new InjectionToken<ElementRef>(\n 'ElementRef when you cannot use @Input for single time injection',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiDayOfWeek} from '@taiga-ui/cdk';\n\nexport const TUI_FIRST_DAY_OF_WEEK = new InjectionToken<TuiDayOfWeek>(\n 'The first day of the week index',\n {\n factory: () => TuiDayOfWeek.Monday,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {extractI18n} from '@taiga-ui/i18n';\n\nexport const TUI_MONTHS = new InjectionToken('Localized months names', {\n factory: extractI18n('months'),\n});\n\nexport const TUI_CLOSE_WORD = new InjectionToken(`i18n 'close' word`, {\n factory: extractI18n('close'),\n});\n\nexport const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(\n `i18n 'Nothing found' message`,\n {\n factory: extractI18n('nothingFoundMessage'),\n },\n);\n\nexport const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(`i18n of error message`, {\n factory: extractI18n('defaultErrorMessage'),\n});\n\nexport const TUI_SPIN_TEXTS = new InjectionToken('spin i18n texts', {\n factory: extractI18n('spinTexts'),\n});\n\nexport const TUI_SHORT_WEEK_DAYS = new InjectionToken('calendars i18n texts', {\n factory: extractI18n('shortWeekDays'),\n});\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICONS_PLACE: InjectionToken<string> = new InjectionToken<string>(\n 'Recommended paths to icons from documentation guide',\n {\n factory: () => 'assets/taiga-ui/icons',\n },\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_ICONS = new InjectionToken<Record<string, string>>(\n 'A key/value dictionary of icon names and src to be defined with TuiSvgService',\n {\n factory: () => ({}),\n },\n);\n","import {inject, InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {iconsPathFactory} from '@taiga-ui/core/utils';\n\nimport {TUI_ICONS_PLACE} from './icon-place';\n\nexport const TUI_ICONS_PATH: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>(\n 'A handler to retrieve USE id for icon by name',\n {factory: () => iconsPathFactory(inject(TUI_ICONS_PLACE))},\n );\n","import {InjectionToken} from '@angular/core';\nimport {TuiMedia} from '@taiga-ui/core/interfaces';\n\nexport const TUI_MEDIA = new InjectionToken<TuiMedia>('Token for media constant', {\n factory: () => ({\n mobile: 768,\n desktopSmall: 1024,\n desktopLarge: 1280,\n }),\n});\n","import {inject, InjectionToken, NgZone} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {tuiZoneOptimized, typedFromEvent} from '@taiga-ui/cdk';\nimport {Observable} from 'rxjs';\nimport {distinctUntilChanged, map, share, startWith} from 'rxjs/operators';\n\nimport {TUI_MEDIA} from './media';\n\nexport const TUI_IS_MOBILE_RES = new InjectionToken<Observable<boolean>>(\n 'Mobile resolution stream for private providers',\n {\n factory: () => {\n const windowRef = inject(WINDOW);\n const {mobile} = inject(TUI_MEDIA);\n\n return typedFromEvent(windowRef, 'resize').pipe(\n share(),\n startWith(null),\n map(() => windowRef.innerWidth < mobile),\n distinctUntilChanged(),\n tuiZoneOptimized(inject(NgZone)),\n );\n },\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\nexport const TUI_MODE: InjectionToken<Observable<TuiBrightness | null>> =\n new InjectionToken<Observable<TuiBrightness | null>>(\n 'Mode stream for private providers',\n );\n","import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiAlertOptions} from '@taiga-ui/core/interfaces';\n\nexport interface TuiNotificationDefaultOptions\n extends Omit<TuiAlertOptions<unknown>, 'data'> {\n readonly defaultAutoCloseTime: number;\n}\n\n/**\n * @deprecated: remove in v3.0, use TuiNotificationDefaultOptions\n */\nexport type NotificationTokenOptions = TuiNotificationDefaultOptions;\n\n/** Default values for the notification options. */\nexport const TUI_NOTIFICATION_DEFAULT_OPTIONS: TuiNotificationDefaultOptions = {\n autoClose: true,\n label: '',\n status: TuiNotification.Info,\n hasIcon: true,\n hasCloseButton: true,\n defaultAutoCloseTime: 3000,\n};\n\nexport const TUI_NOTIFICATION_OPTIONS = new InjectionToken<TuiNotificationDefaultOptions>(\n 'Default parameters for notification alert component',\n {\n factory: () => TUI_NOTIFICATION_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiNotificationOptionsProvider(\n options: Partial<TuiNotificationDefaultOptions>,\n): ValueProvider {\n return {\n provide: TUI_NOTIFICATION_OPTIONS,\n useValue: {...TUI_NOTIFICATION_DEFAULT_OPTIONS, ...options},\n };\n}\n","import {InjectionToken} from '@angular/core';\nimport {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\nimport {NumberFormatSettings} from '@taiga-ui/core/interfaces';\n\nexport const TUI_NUMBER_FORMAT = new InjectionToken<NumberFormatSettings>(\n 'Formatting configuration for displayed numbers',\n {\n factory: () => ({\n decimalSeparator: ',',\n thousandSeparator: CHAR_NO_BREAK_SPACE,\n zeroPadding: true,\n }),\n },\n);\n","import {InjectionToken, TemplateRef} from '@angular/core';\nimport {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport const TUI_OPTION_CONTENT = new InjectionToken<\n PolymorpheusContent<TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>>\n>('Content for tuiOption component');\n","import {inject, InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TUI_FIRST_DAY_OF_WEEK, TUI_SHORT_WEEK_DAYS} from './index';\n\nexport type WEEK_DAYS_NAMES = [string, string, string, string, string, string, string];\n\n// TODO: 3.0 Remove export in ivy compilation\nexport const convertToSundayFirstWeekFormat = (\n weekDaysNames: WEEK_DAYS_NAMES,\n): WEEK_DAYS_NAMES => {\n const sundayIndex = weekDaysNames.length - 1;\n\n return [\n weekDaysNames[sundayIndex],\n ...weekDaysNames.slice(0, sundayIndex),\n ] as WEEK_DAYS_NAMES;\n};\n\nexport const TUI_ORDERED_SHORT_WEEK_DAYS = new InjectionToken<\n Observable<WEEK_DAYS_NAMES>\n>('Ordered calendars i18n texts', {\n factory: () => {\n const firstDayOfWeekIndex = inject(TUI_FIRST_DAY_OF_WEEK);\n\n return inject(TUI_SHORT_WEEK_DAYS).pipe(\n map(convertToSundayFirstWeekFormat),\n map(\n weekDays =>\n [\n ...weekDays.slice(firstDayOfWeekIndex),\n ...weekDays.slice(0, firstDayOfWeekIndex),\n ] as WEEK_DAYS_NAMES,\n ),\n );\n },\n});\n","import {TUI_SANITIZER as TOKEN} from '@taiga-ui/cdk';\n\nexport const TUI_SANITIZER = TOKEN;\n","import {ElementRef, InjectionToken} from '@angular/core';\n\nexport const TUI_SCROLL_REF = new InjectionToken<ElementRef<HTMLElement>>(\n 'Scrollable container',\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {svgLinearGradientProcessor} from '@taiga-ui/cdk/utils/svg';\n\nexport const TUI_SVG_CONTENT_PROCESSOR: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>(\n 'Transform function the contents of the loaded svg file',\n {factory: () => svgLinearGradientProcessor},\n );\n","import {InjectionToken} from '@angular/core';\nimport {TuiStringHandler} from '@taiga-ui/cdk';\nimport {identity} from 'rxjs';\n\nexport const TUI_SVG_SRC_PROCESSOR: InjectionToken<TuiStringHandler<string>> =\n new InjectionToken<TuiStringHandler<string>>('Source path processor for svg', {\n factory: () => identity,\n });\n","import {InjectionToken} from '@angular/core';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\n\nexport const TUI_TEXTFIELD_APPEARANCE = new InjectionToken<string>(\n 'Appearance for inputs',\n {\n factory: () => TuiAppearance.Textfield,\n },\n);\n","import {InjectionToken} from '@angular/core';\nimport {TuiTextfieldHost} from '@taiga-ui/core/interfaces';\n\nexport const TUI_TEXTFIELD_HOST = new InjectionToken<TuiTextfieldHost>(\n 'An interface to communicate with textfield based controls',\n);\n","import {InjectionToken} from '@angular/core';\n\nexport const TUI_THEME = new InjectionToken<string>('Theme name', {\n factory: () => 'Taiga',\n});\n","import {InjectionToken} from '@angular/core';\nimport {ControlValueAccessor} from '@angular/forms';\n\nexport const TUI_VALUE_ACCESSOR = new InjectionToken<ControlValueAccessor>(\n 'Buffer token to pass NG_VALUE_ACCESSOR to a different Injector',\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TOKEN"],"mappings":";;;;;;;;;MAEa,uBAAuB,GAAG,IAAI,cAAc,CACrD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,GAAG;CACrB;;MCDQ,qBAAqB,GAAG,IAAI,cAAc,CACnD,iCAAiC,EACjC;IACI,OAAO,EAAE,OAAO;QACZ,MAAM,EAAE;YACJ,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;SAC5C;KACJ,CAAC;CACL;;MCXQ,kBAAkB,GAAG,IAAI,cAAc,CAChD,2CAA2C,EAC3C;IACI,OAAO,EAAE,MAAM,SAAS,EAAE;CAC7B;;MCHQ,sBAAsB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;MCDb,kBAAkB,GAAG,IAAI,cAAc,CAChD,q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OptionComponent = __decorate([
87
87
  Component({
88
88
  selector: "button[tuiOption], a[tuiOption]",
89
- template: "<span\n *ngIf=\"content; else base\"\n polymorpheus-outlet\n class=\"content\"\n [content]=\"content\"\n [context]=\"{$implicit: base}\"\n></span>\n<ng-template #base>\n <ng-content></ng-content>\n <tui-svg\n *ngIf=\"dropdown\"\n src=\"tuiIconChevronRight\"\n class=\"arrow\"\n ></tui-svg>\n</ng-template>\n",
89
+ template: "<span\n *ngIf=\"content; else base\"\n polymorpheus-outlet\n class=\"t-content\"\n [content]=\"content\"\n [context]=\"{$implicit: base}\"\n></span>\n<ng-template #base>\n <ng-content></ng-content>\n <tui-svg\n *ngIf=\"dropdown\"\n src=\"tuiIconChevronRight\"\n class=\"t-arrow\"\n ></tui-svg>\n</ng-template>\n",
90
90
  changeDetection: ChangeDetectionStrategy.OnPush,
91
91
  host: {
92
92
  tabIndex: '-1',
93
93
  type: 'button',
94
94
  '[attr.disabled]': 'disabled || null',
95
95
  },
96
- styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0 1rem;border:0;background:padding-box;font-size:inherit;line-height:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;font:var(--tui-font-text-m);width:100%;align-items:center;justify-content:space-between;text-align:left;box-sizing:border-box;color:var(--tui-text-01);outline:0;text-decoration:none;cursor:pointer;border-top:.5rem solid transparent;border-bottom:.5rem solid transparent;margin:-.5rem 0}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host._with-dropdown,:host:focus{background-color:var(--tui-base-02)}:host[data-size=xs]{font:var(--tui-font-text-s);min-height:3rem}:host[data-size='s']{min-height:3rem}:host[data-size='m']{min-height:3.75rem}:host[data-size='l']{min-height:4.5rem}.content{display:flex;flex:1;max-width:100%}.arrow{margin:0 -.5rem 0 .75rem}"]
96
+ styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:padding-box;font-size:inherit;line-height:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;font:var(--tui-font-text-m);width:100%;align-items:center;justify-content:space-between;text-align:left;box-sizing:border-box;color:var(--tui-text-01);outline:0;text-decoration:none;cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:default}:host._with-dropdown,:host:focus{background-color:var(--tui-base-02)}:host[data-size=xs]{font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .75rem}:host[data-size='s']{min-height:2rem;padding:.3125rem .75rem}:host[data-size='m']{min-height:2.75rem;padding:.375rem 1rem}:host[data-size='l']{min-height:3.5rem;padding:.75rem 1rem}.t-content{display:flex;flex:1;max-width:100%}.t-arrow{margin:0 -.5rem 0 .75rem}"]
97
97
  }),
98
98
  __param(0, Optional()),
99
99
  __param(0, Inject(TUI_OPTION_CONTENT)),
@@ -210,7 +210,7 @@ var TuiDataListComponent = /** @class */ (function () {
210
210
  TuiDataListComponent = TuiDataListComponent_1 = __decorate([
211
211
  Component({
212
212
  selector: 'tui-data-list',
213
- template: "<div\n tabindex=\"0\"\n class=\"trap\"\n (focusin)=\"onFocus($event, true)\"\n></div>\n<ng-content></ng-content>\n<div\n *ngIf=\"empty$ | async\"\n polymorpheus-outlet\n class=\"empty\"\n [content]=\"emptyContent || (defaultEmptyContent$ | async)\"\n></div>\n<div\n tabindex=\"0\"\n class=\"trap\"\n (focusin)=\"onFocus($event, false)\"\n></div>\n",
213
+ template: "<div\n tabindex=\"0\"\n class=\"t-trap\"\n (focusin)=\"onFocus($event, true)\"\n></div>\n<ng-content></ng-content>\n<div\n *ngIf=\"empty$ | async\"\n polymorpheus-outlet\n class=\"t-empty\"\n [content]=\"emptyContent || (defaultEmptyContent$ | async)\"\n></div>\n<div\n tabindex=\"0\"\n class=\"t-trap\"\n (focusin)=\"onFocus($event, false)\"\n></div>\n",
214
214
  changeDetection: ChangeDetectionStrategy.OnPush,
215
215
  encapsulation: ViewEncapsulation.None,
216
216
  providers: [
@@ -219,7 +219,7 @@ var TuiDataListComponent = /** @class */ (function () {
219
219
  useExisting: forwardRef(function () { return TuiDataListComponent_1; }),
220
220
  },
221
221
  ],
222
- styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem;padding:.5rem 0;margin:-.5rem 0}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-top:1rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.4375rem;height:1px;background:var(--tui-base-03)}"]
222
+ styles: ["tui-data-list{display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:.5rem 0;color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list>.t-empty{margin:.75rem 1rem}tui-opt-group{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;display:flex;font:var(--tui-font-text-xs);flex-direction:column;line-height:2rem}tui-opt-group:empty:after,tui-opt-group:empty:before{display:none}tui-opt-group:before{content:attr(data-label);padding:0 1rem;color:var(--tui-text-02)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-top:1rem}tui-opt-group:not(:empty)~tui-opt-group:after{content:'';position:absolute;left:0;right:0;top:.5rem;height:1px;background:var(--tui-base-03)}"]
223
223
  }),
224
224
  __param(0, Inject(ElementRef)),
225
225
  __param(1, Inject(TUI_NOTHING_FOUND_MESSAGE))
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-data-list.js","sources":["ng://@taiga-ui/core/components/data-list/option/option.component.ts","ng://@taiga-ui/core/components/data-list/data-list.component.ts","ng://@taiga-ui/core/components/data-list/data-list.directive.ts","ng://@taiga-ui/core/components/data-list/data-list-dropdown-manager.directive.ts","ng://@taiga-ui/core/components/data-list/opt-group.directive.ts","ng://@taiga-ui/core/components/data-list/data-list.module.ts","ng://@taiga-ui/core/components/data-list/taiga-ui-core-components-data-list.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Self,\n TemplateRef,\n} from '@angular/core';\nimport {\n isNativeFocused,\n setNativeFocused,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiEventWith,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT} from '@taiga-ui/core/tokens';\nimport {TuiOptionRole, TuiSizeL, TuiSizeXS} from '@taiga-ui/core/types';\nimport {shouldCall} from '@tinkoff/ng-event-plugins';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from '../data-list.component';\n\nexport function shouldFocus({\n currentTarget,\n}: TuiEventWith<MouseEvent, HTMLElement>): boolean {\n return !isNativeFocused(currentTarget);\n}\n\n// TODO: Consider all use cases for aria roles\n@Component({\n selector: `button[tuiOption], a[tuiOption]`,\n templateUrl: './option.template.html',\n styleUrls: ['./option.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n tabIndex: '-1',\n type: 'button',\n '[attr.disabled]': 'disabled || null',\n },\n})\nexport class TuiOptionComponent<T = unknown> implements OnDestroy {\n @Input()\n @HostBinding('attr.data-size')\n @tuiDefaultProp()\n size: TuiSizeXS | TuiSizeL = 'm';\n\n @Input()\n @HostBinding('attr.role')\n @tuiDefaultProp()\n role: TuiOptionRole = 'option';\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n value?: T;\n\n // TODO: 3.0 Fix dataList type when updated to Ivy and compilation drops metadata\n constructor(\n @Optional()\n @Inject(TUI_OPTION_CONTENT)\n readonly content: PolymorpheusContent<\n TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>\n > | null,\n @Inject(forwardRef(() => TuiDataListComponent))\n private readonly dataList: any,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Optional()\n @Inject(TUI_DATA_LIST_HOST)\n private readonly host: TuiDataListHost<T> | null,\n @Optional()\n @Self()\n @Inject(TuiDropdownDirective)\n readonly dropdown: TuiDropdownDirective | null,\n ) {}\n\n @HostBinding('class._with-dropdown')\n get active(): boolean {\n return !!this.dropdown && !!this.dropdown.dropdownBoxRef;\n }\n\n @HostListener('click')\n onClick(): void {\n if (this.host && this.value !== undefined) {\n this.host.handleOption(this.value);\n }\n }\n\n // @bad TODO: Consider aria-activedescendant for proper accessibility implementation\n @shouldCall(shouldFocus)\n @HostListener('mousemove.init', ['$event'])\n @HostListener('mousemove.silent', ['$event'])\n onMouseMove({currentTarget}: TuiEventWith<MouseEvent, HTMLElement>): void {\n setNativeFocused(currentTarget, true, true);\n }\n\n // Preventing focus loss upon focused option removal\n ngOnDestroy(): void {\n this.dataList.handleFocusLossIfNecessary(this.elementRef.nativeElement);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n isNativeFocusedIn,\n isPresent,\n itemsQueryListObservable,\n moveFocus,\n setNativeMouseFocused,\n tuiAssertIsHTMLElement,\n tuiDefaultProp,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_ACCESSOR, TUI_NOTHING_FOUND_MESSAGE} from '@taiga-ui/core/tokens';\nimport {TuiDataListRole} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TuiOptionComponent} from './option/option.component';\n\n// TODO: Consider aria-activedescendant for proper accessibility implementation\n// @dynamic\n@Component({\n selector: 'tui-data-list',\n templateUrl: './data-list.template.html',\n styleUrls: ['./data-list.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: TUI_DATA_LIST_ACCESSOR,\n useExisting: forwardRef(() => TuiDataListComponent),\n },\n ],\n})\nexport class TuiDataListComponent<T> implements TuiDataListAccessor<T> {\n @ContentChildren(forwardRef(() => TuiOptionComponent), {descendants: true})\n private readonly options: QueryList<TuiOptionComponent<T>> = EMPTY_QUERY;\n\n private origin?: HTMLElement;\n\n @Input()\n @HostBinding('attr.role')\n @tuiDefaultProp()\n role: TuiDataListRole = 'listbox';\n\n @Input()\n @tuiDefaultProp()\n emptyContent: PolymorpheusContent = '';\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_NOTHING_FOUND_MESSAGE)\n readonly defaultEmptyContent$: Observable<string>,\n ) {}\n\n @tuiPure\n get empty$(): Observable<boolean> {\n return itemsQueryListObservable(this.options).pipe(map(({length}) => !length));\n }\n\n @HostListener('focusin', ['$event.relatedTarget', '$event.currentTarget'])\n onFocusIn(relatedTarget: HTMLElement, currentTarget: HTMLElement): void {\n if (!currentTarget.contains(relatedTarget) && !this.origin) {\n this.origin = relatedTarget;\n }\n }\n\n @HostListener('mousedown.prevent')\n noop(): void {}\n\n @HostListener('keydown.arrowDown.prevent', ['$event.target', '1'])\n @HostListener('keydown.arrowUp.prevent', ['$event.target', '-1'])\n onKeyDownArrow(current: HTMLElement, step: number): void {\n const {elements} = this;\n\n moveFocus(elements.indexOf(current), elements, step);\n }\n\n // TODO: Consider aria-activedescendant for proper accessibility implementation\n @HostListener('wheel.silent.passive', ['$event.currentTarget'])\n @HostListener('mouseleave', ['$event.target'])\n handleFocusLossIfNecessary(element: HTMLElement): void {\n if (this.origin && isNativeFocusedIn(element)) {\n setNativeMouseFocused(this.origin, true, true);\n }\n }\n\n getOptions(includeDisabled: boolean = false): readonly T[] {\n return this.options\n .toArray()\n .filter(({disabled}) => includeDisabled || !disabled)\n .map(({value}) => value)\n .filter(isPresent);\n }\n\n onFocus({target}: Event, top: boolean): void {\n tuiAssertIsHTMLElement(target);\n\n const {elements} = this;\n\n moveFocus(top ? -1 : elements.length, elements, top ? 1 : -1);\n this.handleFocusLossIfNecessary(target);\n }\n\n private get elements(): readonly HTMLElement[] {\n return Array.from(this.elementRef.nativeElement.querySelectorAll('[tuiOption]'));\n }\n}\n","import {Directive} from '@angular/core';\n\n@Directive({\n selector: 'ng-template[tuiDataList]',\n})\nexport class TuiDataListDirective {}\n","import {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n QueryList,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n getClosestKeyboardFocusable,\n itemsQueryListObservable,\n preventDefault,\n setNativeFocused,\n tuiPure,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n mapTo,\n shareReplay,\n switchMap,\n take,\n tap,\n} from 'rxjs/operators';\n\n// TODO: 3.0 Move into separate module\n@Directive({\n selector: 'tui-data-list[tuiDataListDropdownManager]',\n})\nexport class TuiDataListDropdownManagerDirective implements AfterViewInit {\n @ContentChildren(TuiDropdownDirective, {descendants: true})\n private readonly dropdowns: QueryList<TuiDropdownDirective> = EMPTY_QUERY;\n\n @ContentChildren(TuiDropdownDirective, {read: ElementRef, descendants: true})\n private readonly elements: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n ngAfterViewInit(): void {\n this.right$.subscribe(index => {\n this.tryToFocus(index);\n });\n\n merge(this.immediate$, this.debounce$)\n .pipe(\n switchMap(active => {\n this.dropdowns.forEach((dropdown, index) => {\n dropdown.open = index === active;\n });\n\n const element = this.elements.toArray()[active];\n const dropdown = this.dropdowns.toArray()[active];\n\n if (!element || !dropdown || !dropdown.dropdownBoxRef) {\n return EMPTY;\n }\n\n const {nativeElement} = dropdown.dropdownBoxRef.location;\n const mouseEnter$ = typedFromEvent(nativeElement, 'mouseenter').pipe(\n take(1),\n );\n const esc$ = merge(\n typedFromEvent(element.nativeElement, 'keydown'),\n typedFromEvent(nativeElement, 'keydown'),\n ).pipe(filter(({keyCode}) => keyCode === 27));\n\n return merge(mouseEnter$, esc$).pipe(\n tap(event => {\n if (dropdown.dropdownBoxRef) {\n event.stopPropagation();\n }\n\n setNativeFocused(element.nativeElement);\n // TODO: iframe warning\n dropdown.open = event instanceof MouseEvent;\n }),\n );\n }),\n )\n .subscribe();\n }\n\n @tuiPure\n private get elements$(): Observable<readonly HTMLElement[]> {\n return itemsQueryListObservable(this.elements).pipe(\n map(array => array.map(({nativeElement}) => nativeElement)),\n shareReplay({bufferSize: 1, refCount: true}),\n );\n }\n\n @tuiPure\n private get right$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, 'keydown').pipe(\n filter(({keyCode}) => keyCode === 39),\n preventDefault(),\n mapTo(index),\n ),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get immediate$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, 'click').pipe(mapTo(index)),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get debounce$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n merge(\n typedFromEvent(element, 'focus'),\n typedFromEvent(element, 'blur'),\n ).pipe(\n filter(({relatedTarget}) =>\n this.notInDropdown(relatedTarget, index),\n ),\n map(({type}) => (type === 'focus' ? index : NaN)),\n ),\n ),\n ),\n ),\n debounceTime(300),\n );\n }\n\n private notInDropdown(element: EventTarget | null, index: number): boolean {\n const dropdown = this.dropdowns.toArray()[index];\n\n return (\n !dropdown ||\n !dropdown.dropdownBoxRef ||\n !dropdown.dropdownBoxRef.location.nativeElement.contains(element)\n );\n }\n\n private tryToFocus(index: number): void {\n const dropdown = this.dropdowns.toArray()[index];\n const content =\n dropdown &&\n dropdown.dropdownBoxRef &&\n dropdown.dropdownBoxRef.instance.contentElementRef;\n\n if (!content) {\n return;\n }\n\n const item = getClosestKeyboardFocusable(\n content.nativeElement,\n false,\n content.nativeElement,\n );\n\n if (item) {\n setNativeFocused(item);\n }\n }\n}\n","import {Directive, HostBinding, Input} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\n\n@Directive({\n selector: 'tui-opt-group',\n host: {\n role: 'group',\n },\n})\nexport class TuiOptGroupDirective {\n @Input()\n @HostBinding('attr.data-label')\n @tuiDefaultProp()\n label = '';\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from './data-list.component';\nimport {TuiDataListDirective} from './data-list.directive';\nimport {TuiDataListDropdownManagerDirective} from './data-list-dropdown-manager.directive';\nimport {TuiOptGroupDirective} from './opt-group.directive';\nimport {TuiOptionComponent} from './option/option.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, PolymorpheusModule],\n declarations: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n exports: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n})\nexport class TuiDataListModule {}\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BP;IA7GQ,mCAAmC;QAH/C,SAAS,CAAC;YACP,QAAQ,EAAE,2CAA2C;SACxD,CAAC;OACW,mCAAmC,CA8I/C;IAAD,0CAAC;CA9ID;;;ICxBA;QAII,UAAK,GAAG,EAAE,CAAC;KACd;IADG;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,iBAAiB,CAAC;QAC9B,cAAc,EAAE;uDACN;IAJF,oBAAoB;QANhC,SAAS,CAAC;YACP,QAAQ,EAAE,eAAe;YACzB,IAAI,EAAE;gBACF,IAAI,EAAE,OAAO;aAChB;SACJ,CAAC;OACW,oBAAoB,CAKhC;IAAD,2BAAC;CALD;;;ICmBA;KAAiC;IAApB,iBAAiB;QAjB7B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,kBAAkB,CAAC;YACzD,YAAY,EAAE;gBACV,oBAAoB;gBACpB,kBAAkB;gBAClB,oBAAoB;gBACpB,oBAAoB;gBACpB,mCAAmC;aACtC;YACD,OAAO,EAAE;gBACL,oBAAoB;gBACpB,kBAAkB;gBAClB,oBAAoB;gBACpB,oBAAoB;gBACpB,mCAAmC;aACtC;SACJ,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAjC;;AC5BA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-data-list.js","sources":["ng://@taiga-ui/core/components/data-list/option/option.component.ts","ng://@taiga-ui/core/components/data-list/data-list.component.ts","ng://@taiga-ui/core/components/data-list/data-list.directive.ts","ng://@taiga-ui/core/components/data-list/data-list-dropdown-manager.directive.ts","ng://@taiga-ui/core/components/data-list/opt-group.directive.ts","ng://@taiga-ui/core/components/data-list/data-list.module.ts","ng://@taiga-ui/core/components/data-list/taiga-ui-core-components-data-list.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Self,\n TemplateRef,\n} from '@angular/core';\nimport {\n isNativeFocused,\n setNativeFocused,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiEventWith,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {TuiDataListHost} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT} from '@taiga-ui/core/tokens';\nimport {TuiOptionRole, TuiSizeL, TuiSizeXS} from '@taiga-ui/core/types';\nimport {shouldCall} from '@tinkoff/ng-event-plugins';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from '../data-list.component';\n\nexport function shouldFocus({\n currentTarget,\n}: TuiEventWith<MouseEvent, HTMLElement>): boolean {\n return !isNativeFocused(currentTarget);\n}\n\n// TODO: Consider all use cases for aria roles\n@Component({\n selector: `button[tuiOption], a[tuiOption]`,\n templateUrl: './option.template.html',\n styleUrls: ['./option.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n tabIndex: '-1',\n type: 'button',\n '[attr.disabled]': 'disabled || null',\n },\n})\nexport class TuiOptionComponent<T = unknown> implements OnDestroy {\n @Input()\n @HostBinding('attr.data-size')\n @tuiDefaultProp()\n size: TuiSizeXS | TuiSizeL = 'm';\n\n @Input()\n @HostBinding('attr.role')\n @tuiDefaultProp()\n role: TuiOptionRole = 'option';\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n value?: T;\n\n // TODO: 3.0 Fix dataList type when updated to Ivy and compilation drops metadata\n constructor(\n @Optional()\n @Inject(TUI_OPTION_CONTENT)\n readonly content: PolymorpheusContent<\n TuiContextWithImplicit<TemplateRef<Record<string, unknown>>>\n > | null,\n @Inject(forwardRef(() => TuiDataListComponent))\n private readonly dataList: any,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Optional()\n @Inject(TUI_DATA_LIST_HOST)\n private readonly host: TuiDataListHost<T> | null,\n @Optional()\n @Self()\n @Inject(TuiDropdownDirective)\n readonly dropdown: TuiDropdownDirective | null,\n ) {}\n\n @HostBinding('class._with-dropdown')\n get active(): boolean {\n return !!this.dropdown && !!this.dropdown.dropdownBoxRef;\n }\n\n @HostListener('click')\n onClick(): void {\n if (this.host && this.value !== undefined) {\n this.host.handleOption(this.value);\n }\n }\n\n // @bad TODO: Consider aria-activedescendant for proper accessibility implementation\n @shouldCall(shouldFocus)\n @HostListener('mousemove.init', ['$event'])\n @HostListener('mousemove.silent', ['$event'])\n onMouseMove({currentTarget}: TuiEventWith<MouseEvent, HTMLElement>): void {\n setNativeFocused(currentTarget, true, true);\n }\n\n // Preventing focus loss upon focused option removal\n ngOnDestroy(): void {\n this.dataList.handleFocusLossIfNecessary(this.elementRef.nativeElement);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n isNativeFocusedIn,\n isPresent,\n itemsQueryListObservable,\n moveFocus,\n setNativeMouseFocused,\n tuiAssertIsHTMLElement,\n tuiDefaultProp,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {TuiDataListAccessor} from '@taiga-ui/core/interfaces';\nimport {TUI_DATA_LIST_ACCESSOR, TUI_NOTHING_FOUND_MESSAGE} from '@taiga-ui/core/tokens';\nimport {TuiDataListRole} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TuiOptionComponent} from './option/option.component';\n\n// TODO: Consider aria-activedescendant for proper accessibility implementation\n// @dynamic\n@Component({\n selector: 'tui-data-list',\n templateUrl: './data-list.template.html',\n styleUrls: ['./data-list.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: TUI_DATA_LIST_ACCESSOR,\n useExisting: forwardRef(() => TuiDataListComponent),\n },\n ],\n})\nexport class TuiDataListComponent<T> implements TuiDataListAccessor<T> {\n @ContentChildren(forwardRef(() => TuiOptionComponent), {descendants: true})\n private readonly options: QueryList<TuiOptionComponent<T>> = EMPTY_QUERY;\n\n private origin?: HTMLElement;\n\n @Input()\n @HostBinding('attr.role')\n @tuiDefaultProp()\n role: TuiDataListRole = 'listbox';\n\n @Input()\n @tuiDefaultProp()\n emptyContent: PolymorpheusContent = '';\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TUI_NOTHING_FOUND_MESSAGE)\n readonly defaultEmptyContent$: Observable<string>,\n ) {}\n\n @tuiPure\n get empty$(): Observable<boolean> {\n return itemsQueryListObservable(this.options).pipe(map(({length}) => !length));\n }\n\n @HostListener('focusin', ['$event.relatedTarget', '$event.currentTarget'])\n onFocusIn(relatedTarget: HTMLElement, currentTarget: HTMLElement): void {\n if (!currentTarget.contains(relatedTarget) && !this.origin) {\n this.origin = relatedTarget;\n }\n }\n\n @HostListener('mousedown.prevent')\n noop(): void {}\n\n @HostListener('keydown.arrowDown.prevent', ['$event.target', '1'])\n @HostListener('keydown.arrowUp.prevent', ['$event.target', '-1'])\n onKeyDownArrow(current: HTMLElement, step: number): void {\n const {elements} = this;\n\n moveFocus(elements.indexOf(current), elements, step);\n }\n\n // TODO: Consider aria-activedescendant for proper accessibility implementation\n @HostListener('wheel.silent.passive', ['$event.currentTarget'])\n @HostListener('mouseleave', ['$event.target'])\n handleFocusLossIfNecessary(element: HTMLElement): void {\n if (this.origin && isNativeFocusedIn(element)) {\n setNativeMouseFocused(this.origin, true, true);\n }\n }\n\n getOptions(includeDisabled: boolean = false): readonly T[] {\n return this.options\n .toArray()\n .filter(({disabled}) => includeDisabled || !disabled)\n .map(({value}) => value)\n .filter(isPresent);\n }\n\n onFocus({target}: Event, top: boolean): void {\n tuiAssertIsHTMLElement(target);\n\n const {elements} = this;\n\n moveFocus(top ? -1 : elements.length, elements, top ? 1 : -1);\n this.handleFocusLossIfNecessary(target);\n }\n\n private get elements(): readonly HTMLElement[] {\n return Array.from(this.elementRef.nativeElement.querySelectorAll('[tuiOption]'));\n }\n}\n","import {Directive} from '@angular/core';\n\n@Directive({\n selector: 'ng-template[tuiDataList]',\n})\nexport class TuiDataListDirective {}\n","import {\n AfterViewInit,\n ContentChildren,\n Directive,\n ElementRef,\n QueryList,\n} from '@angular/core';\nimport {\n EMPTY_QUERY,\n getClosestKeyboardFocusable,\n itemsQueryListObservable,\n preventDefault,\n setNativeFocused,\n tuiPure,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {\n debounceTime,\n filter,\n map,\n mapTo,\n shareReplay,\n switchMap,\n take,\n tap,\n} from 'rxjs/operators';\n\n// TODO: 3.0 Move into separate module\n@Directive({\n selector: 'tui-data-list[tuiDataListDropdownManager]',\n})\nexport class TuiDataListDropdownManagerDirective implements AfterViewInit {\n @ContentChildren(TuiDropdownDirective, {descendants: true})\n private readonly dropdowns: QueryList<TuiDropdownDirective> = EMPTY_QUERY;\n\n @ContentChildren(TuiDropdownDirective, {read: ElementRef, descendants: true})\n private readonly elements: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n ngAfterViewInit(): void {\n this.right$.subscribe(index => {\n this.tryToFocus(index);\n });\n\n merge(this.immediate$, this.debounce$)\n .pipe(\n switchMap(active => {\n this.dropdowns.forEach((dropdown, index) => {\n dropdown.open = index === active;\n });\n\n const element = this.elements.toArray()[active];\n const dropdown = this.dropdowns.toArray()[active];\n\n if (!element || !dropdown || !dropdown.dropdownBoxRef) {\n return EMPTY;\n }\n\n const {nativeElement} = dropdown.dropdownBoxRef.location;\n const mouseEnter$ = typedFromEvent(nativeElement, 'mouseenter').pipe(\n take(1),\n );\n const esc$ = merge(\n typedFromEvent(element.nativeElement, 'keydown'),\n typedFromEvent(nativeElement, 'keydown'),\n ).pipe(filter(({keyCode}) => keyCode === 27));\n\n return merge(mouseEnter$, esc$).pipe(\n tap(event => {\n if (dropdown.dropdownBoxRef) {\n event.stopPropagation();\n }\n\n setNativeFocused(element.nativeElement);\n // TODO: iframe warning\n dropdown.open = event instanceof MouseEvent;\n }),\n );\n }),\n )\n .subscribe();\n }\n\n @tuiPure\n private get elements$(): Observable<readonly HTMLElement[]> {\n return itemsQueryListObservable(this.elements).pipe(\n map(array => array.map(({nativeElement}) => nativeElement)),\n shareReplay({bufferSize: 1, refCount: true}),\n );\n }\n\n @tuiPure\n private get right$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, 'keydown').pipe(\n filter(({keyCode}) => keyCode === 39),\n preventDefault(),\n mapTo(index),\n ),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get immediate$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n typedFromEvent(element, 'click').pipe(mapTo(index)),\n ),\n ),\n ),\n );\n }\n\n @tuiPure\n private get debounce$(): Observable<number> {\n return this.elements$.pipe(\n switchMap(elements =>\n merge(\n ...elements.map((element, index) =>\n merge(\n typedFromEvent(element, 'focus'),\n typedFromEvent(element, 'blur'),\n ).pipe(\n filter(({relatedTarget}) =>\n this.notInDropdown(relatedTarget, index),\n ),\n map(({type}) => (type === 'focus' ? index : NaN)),\n ),\n ),\n ),\n ),\n debounceTime(300),\n );\n }\n\n private notInDropdown(element: EventTarget | null, index: number): boolean {\n const dropdown = this.dropdowns.toArray()[index];\n\n return (\n !dropdown ||\n !dropdown.dropdownBoxRef ||\n !dropdown.dropdownBoxRef.location.nativeElement.contains(element)\n );\n }\n\n private tryToFocus(index: number): void {\n const dropdown = this.dropdowns.toArray()[index];\n const content =\n dropdown &&\n dropdown.dropdownBoxRef &&\n dropdown.dropdownBoxRef.instance.contentElementRef;\n\n if (!content) {\n return;\n }\n\n const item = getClosestKeyboardFocusable(\n content.nativeElement,\n false,\n content.nativeElement,\n );\n\n if (item) {\n setNativeFocused(item);\n }\n }\n}\n","import {Directive, HostBinding, Input} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\n\n@Directive({\n selector: 'tui-opt-group',\n host: {\n role: 'group',\n },\n})\nexport class TuiOptGroupDirective {\n @Input()\n @HostBinding('attr.data-label')\n @tuiDefaultProp()\n label = '';\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDataListComponent} from './data-list.component';\nimport {TuiDataListDirective} from './data-list.directive';\nimport {TuiDataListDropdownManagerDirective} from './data-list-dropdown-manager.directive';\nimport {TuiOptGroupDirective} from './opt-group.directive';\nimport {TuiOptionComponent} from './option/option.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, PolymorpheusModule],\n declarations: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n exports: [\n TuiDataListComponent,\n TuiOptionComponent,\n TuiOptGroupDirective,\n TuiDataListDirective,\n TuiDataListDropdownManagerDirective,\n ],\n})\nexport class TuiDataListModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;SA8BgB,WAAW,CAAC,EAEY;QADpC,gCAAa;IAEb,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC;AAED;;;IA+BI,4BAGa,OAED,EAES,QAAa,EACO,UAAmC,EAGvD,IAA+B,EAIvC,QAAqC;QAZrC,YAAO,GAAP,OAAO,CAER;QAES,aAAQ,GAAR,QAAQ,CAAK;QACO,eAAU,GAAV,UAAU,CAAyB;QAGvD,SAAI,GAAJ,IAAI,CAA2B;QAIvC,aAAQ,GAAR,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;;ICmBA;KAAiC;IAApB,iBAAiB;QAjB7B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,kBAAkB,CAAC;YACzD,YAAY,EAAE;gBACV,oBAAoB;gBACpB,kBAAkB;gBAClB,oBAAoB;gBACpB,oBAAoB;gBACpB,mCAAmC;aACtC;YACD,OAAO,EAAE;gBACL,oBAAoB;gBACpB,kBAAkB;gBAClB,oBAAoB;gBACpB,oBAAoB;gBACpB,mCAAmC;aACtC;SACJ,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAjC;;AC5BA;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { __assign, __decorate, __param } from 'tslib';
2
2
  import { Inject, NgZone, ElementRef, HostBinding, ViewChild, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import { WINDOW, ANIMATION_FRAME } from '@ng-web-apis/common';
4
- import { POLLING_TIME, tuiZonefree, getClosestElement, inRange, px, tuiAssertIsHTMLElement, getClosestFocusable, setNativeFocused, TuiDestroyService, TuiDropdownHostComponent, AbstractTuiPortalHostComponent, tuiPure, TuiActiveZoneModule, TuiOverscrollModule } from '@taiga-ui/cdk';
4
+ import { POLLING_TIME, tuiZonefree, inRange, px, tuiAssertIsHTMLElement, getClosestFocusable, TuiDestroyService, TuiDropdownHostComponent, AbstractTuiPortalHostComponent, tuiPure, TuiActiveZoneModule, TuiOverscrollModule } from '@taiga-ui/cdk';
5
5
  import { tuiDropdownAnimation } from '@taiga-ui/core/animations';
6
6
  import { DEFAULT_MARGIN, DEFAULT_MAX_WIDTH } from '@taiga-ui/core/constants';
7
7
  import { TUI_DROPDOWN_DIRECTIVE, TUI_ANIMATION_OPTIONS } from '@taiga-ui/core/tokens';
@@ -60,7 +60,15 @@ var TuiDropdownBoxComponent = /** @class */ (function () {
60
60
  Object.defineProperty(TuiDropdownBoxComponent.prototype, "inModal", {
61
61
  get: function () {
62
62
  // @awful TODO: get rid of component tag name dependency
63
- return !!getClosestElement(this.directive.host, 'tui-dialog-host');
63
+ return !!this.directive.host.closest('tui-dialog-host');
64
+ },
65
+ enumerable: true,
66
+ configurable: true
67
+ });
68
+ Object.defineProperty(TuiDropdownBoxComponent.prototype, "inOption", {
69
+ get: function () {
70
+ // @awful TODO: get rid of component tag name dependency
71
+ return !!this.directive.host.closest('[tuiOption]');
64
72
  },
65
73
  enumerable: true,
66
74
  configurable: true
@@ -160,17 +168,26 @@ var TuiDropdownBoxComponent = /** @class */ (function () {
160
168
  var topAvailableHeight = directiveRect.top - offset;
161
169
  var bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;
162
170
  var finalDirection = this.getFinalDirection(directiveRect);
171
+ var optionOffset = this.inOption ? DEFAULT_MARGIN * 2 : 0;
163
172
  this.prevDirectionIsTop = finalDirection === 'top';
164
173
  if (finalDirection === 'top') {
165
174
  this.dropdownAnimation = this.animationBottom;
166
175
  style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));
167
176
  style.top = 'auto';
168
- style.bottom = px(hostRect.bottom - directiveRect.top - DEFAULT_MARGIN + offset);
177
+ style.bottom = px(hostRect.bottom -
178
+ directiveRect.top -
179
+ DEFAULT_MARGIN +
180
+ offset -
181
+ optionOffset);
169
182
  }
170
183
  else {
171
184
  this.dropdownAnimation = this.animationTop;
172
185
  style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));
173
- style.top = px(directiveRect.bottom - hostRect.top - DEFAULT_MARGIN + offset);
186
+ style.top = px(directiveRect.bottom -
187
+ hostRect.top -
188
+ DEFAULT_MARGIN +
189
+ offset -
190
+ optionOffset);
174
191
  style.bottom = 'auto';
175
192
  }
176
193
  };
@@ -248,10 +265,7 @@ var TuiDropdownBoxComponent = /** @class */ (function () {
248
265
  while (focusable !== null && host.contains(focusable)) {
249
266
  focusable = getClosestFocusable(focusable, previous, root);
250
267
  }
251
- if (focusable === null) {
252
- return;
253
- }
254
- setNativeFocused(focusable);
268
+ focusable === null || focusable === void 0 ? void 0 : focusable.focus();
255
269
  };
256
270
  TuiDropdownBoxComponent.ctorParameters = function () { return [
257
271
  { type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
@@ -275,6 +289,9 @@ var TuiDropdownBoxComponent = /** @class */ (function () {
275
289
  __decorate([
276
290
  tuiPure
277
291
  ], TuiDropdownBoxComponent.prototype, "inModal", null);
292
+ __decorate([
293
+ tuiPure
294
+ ], TuiDropdownBoxComponent.prototype, "inOption", null);
278
295
  TuiDropdownBoxComponent = __decorate([
279
296
  Component({
280
297
  selector: 'tui-dropdown-box',