@taiga-ui/core 4.52.0-canary.e10b718 → 4.52.0-canary.e53e79e

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 (321) hide show
  1. package/README.md +1 -1
  2. package/classes/accessors.d.ts +2 -2
  3. package/components/button/button.directive.d.ts +2 -2
  4. package/components/calendar/calendar-sheet.component.d.ts +1 -1
  5. package/components/calendar/calendar-sheet.options.d.ts +1 -3
  6. package/{pipes/calendar-sheet → components/calendar}/calendar-sheet.pipe.d.ts +2 -2
  7. package/components/calendar/calendar-spin.component.d.ts +1 -0
  8. package/components/calendar/calendar-year.component.d.ts +1 -1
  9. package/components/calendar/calendar.options.d.ts +9 -0
  10. package/components/calendar/index.d.ts +3 -0
  11. package/{pipes/order-week-days → components/calendar}/order-week-days.pipe.d.ts +1 -1
  12. package/components/cell/cell.directive.d.ts +9 -0
  13. package/components/cell/cell.options.d.ts +6 -0
  14. package/components/cell/index.d.ts +2 -0
  15. package/components/data-list/data-list.component.d.ts +8 -12
  16. package/components/data-list/data-list.d.ts +3 -4
  17. package/components/data-list/data-list.tokens.d.ts +1 -23
  18. package/components/data-list/index.d.ts +3 -4
  19. package/components/data-list/opt-group.directive.d.ts +2 -2
  20. package/components/data-list/option-content.directive.d.ts +14 -0
  21. package/components/data-list/option-with-value.directive.d.ts +9 -0
  22. package/components/data-list/option.directive.d.ts +19 -0
  23. package/components/error/error.component.d.ts +6 -8
  24. package/components/error/error.d.ts +4 -0
  25. package/components/error/error.directive.d.ts +19 -0
  26. package/components/error/error.pipe.d.ts +10 -0
  27. package/components/error/index.d.ts +3 -0
  28. package/components/expand/expand.component.d.ts +9 -28
  29. package/components/expand/index.d.ts +0 -2
  30. package/components/icon/icon.component.d.ts +2 -2
  31. package/components/index.d.ts +3 -3
  32. package/components/input/index.d.ts +2 -0
  33. package/components/input/input.d.ts +5 -0
  34. package/components/input/input.directive.d.ts +30 -0
  35. package/components/label/label.directive.d.ts +1 -1
  36. package/components/link/index.d.ts +0 -1
  37. package/components/link/link.directive.d.ts +8 -6
  38. package/components/loader/loader.component.d.ts +7 -7
  39. package/components/loader/loader.options.d.ts +1 -3
  40. package/components/notification/index.d.ts +3 -0
  41. package/components/notification/notification.component.d.ts +14 -0
  42. package/components/notification/notification.d.ts +3 -0
  43. package/components/notification/notification.directive.d.ts +7 -12
  44. package/components/notification/notification.options.d.ts +10 -7
  45. package/components/notification/notification.service.d.ts +17 -0
  46. package/components/root/root.component.d.ts +2 -3
  47. package/components/scrollbar/scroll-into-view.directive.d.ts +3 -2
  48. package/components/scrollbar/scroll-ref.directive.d.ts +2 -0
  49. package/components/scrollbar/scrollbar.component.d.ts +1 -5
  50. package/components/scrollbar/scrollbar.directive.d.ts +2 -2
  51. package/components/spin-button/spin-button.component.d.ts +9 -10
  52. package/components/textfield/index.d.ts +1 -4
  53. package/components/textfield/textfield-multi/textfield-item.component.d.ts +3 -2
  54. package/components/textfield/textfield-multi/textfield-multi.component.d.ts +10 -15
  55. package/components/textfield/textfield.component.d.ts +23 -37
  56. package/components/textfield/textfield.d.ts +2 -4
  57. package/components/textfield/textfield.options.d.ts +8 -11
  58. package/{directives → components}/title/title.directive.d.ts +2 -3
  59. package/directives/appearance/appearance.directive.d.ts +1 -1
  60. package/directives/appearance/appearance.options.d.ts +1 -1
  61. package/directives/date-format/date-format.directive.d.ts +3 -7
  62. package/directives/group/group.directive.d.ts +7 -7
  63. package/directives/group/group.options.d.ts +1 -3
  64. package/directives/index.d.ts +0 -5
  65. package/directives/items-handlers/items-handlers.directive.d.ts +5 -9
  66. package/directives/items-handlers/items-handlers.tokens.d.ts +4 -4
  67. package/directives/number-format/number-format.directive.d.ts +3 -7
  68. package/fesm2022/taiga-ui-core-classes.mjs +9 -11
  69. package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-core-components-button.mjs +13 -20
  71. package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-core-components-calendar.mjs +140 -36
  73. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-core-components-cell.mjs +45 -0
  75. package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -0
  76. package/fesm2022/taiga-ui-core-components-data-list.mjs +112 -281
  77. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  78. package/fesm2022/taiga-ui-core-components-error.mjs +109 -24
  79. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  80. package/fesm2022/taiga-ui-core-components-expand.mjs +33 -131
  81. package/fesm2022/taiga-ui-core-components-expand.mjs.map +1 -1
  82. package/fesm2022/taiga-ui-core-components-icon.mjs +9 -10
  83. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  84. package/fesm2022/taiga-ui-core-components-input.mjs +103 -0
  85. package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -0
  86. package/fesm2022/taiga-ui-core-components-label.mjs +13 -18
  87. package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
  88. package/fesm2022/taiga-ui-core-components-link.mjs +16 -36
  89. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  90. package/fesm2022/taiga-ui-core-components-loader.mjs +16 -34
  91. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  92. package/fesm2022/taiga-ui-core-components-notification.mjs +108 -68
  93. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  94. package/fesm2022/taiga-ui-core-components-root.mjs +8 -22
  95. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  96. package/fesm2022/taiga-ui-core-components-scrollbar.mjs +68 -82
  97. package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
  98. package/fesm2022/taiga-ui-core-components-spin-button.mjs +18 -31
  99. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  100. package/fesm2022/taiga-ui-core-components-textfield.mjs +122 -421
  101. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  102. package/fesm2022/taiga-ui-core-components-title.mjs +37 -0
  103. package/fesm2022/taiga-ui-core-components-title.mjs.map +1 -0
  104. package/fesm2022/taiga-ui-core-components.mjs +3 -3
  105. package/fesm2022/taiga-ui-core-directives-appearance.mjs +18 -21
  106. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  107. package/fesm2022/taiga-ui-core-directives-date-format.mjs +26 -20
  108. package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
  109. package/fesm2022/taiga-ui-core-directives-group.mjs +25 -40
  110. package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
  111. package/fesm2022/taiga-ui-core-directives-icons.mjs +14 -17
  112. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  113. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +18 -42
  114. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  115. package/fesm2022/taiga-ui-core-directives-number-format.mjs +32 -20
  116. package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
  117. package/fesm2022/taiga-ui-core-directives.mjs +0 -5
  118. package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
  119. package/fesm2022/taiga-ui-core-pipes-format-number.mjs +21 -15
  120. package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
  121. package/fesm2022/taiga-ui-core-pipes.mjs +0 -7
  122. package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
  123. package/fesm2022/taiga-ui-core-portals-alert.mjs +73 -0
  124. package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -0
  125. package/fesm2022/taiga-ui-core-portals-dialog.mjs +158 -0
  126. package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -0
  127. package/fesm2022/{taiga-ui-core-directives-dropdown.mjs → taiga-ui-core-portals-dropdown.mjs} +180 -332
  128. package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -0
  129. package/fesm2022/taiga-ui-core-portals-hint.mjs +607 -0
  130. package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -0
  131. package/fesm2022/taiga-ui-core-portals-modal.mjs +89 -0
  132. package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -0
  133. package/fesm2022/taiga-ui-core-portals-popup.mjs +56 -0
  134. package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -0
  135. package/fesm2022/taiga-ui-core-portals.mjs +11 -0
  136. package/fesm2022/taiga-ui-core-portals.mjs.map +1 -0
  137. package/fesm2022/taiga-ui-core-services.mjs +16 -55
  138. package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
  139. package/fesm2022/taiga-ui-core-tokens.mjs +29 -51
  140. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  141. package/fesm2022/taiga-ui-core-utils-format.mjs +1 -22
  142. package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
  143. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +8 -18
  144. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  145. package/fesm2022/taiga-ui-core.mjs +1 -1
  146. package/index.d.ts +1 -1
  147. package/package.json +58 -80
  148. package/pipes/format-number/format-number.pipe.d.ts +6 -4
  149. package/pipes/index.d.ts +0 -7
  150. package/portals/alert/alert.directive.d.ts +11 -0
  151. package/portals/alert/alert.service.d.ts +12 -0
  152. package/portals/alert/index.d.ts +2 -0
  153. package/portals/dialog/dialog.component.d.ts +14 -0
  154. package/portals/dialog/dialog.directive.d.ts +8 -0
  155. package/{components → portals}/dialog/dialog.factory.d.ts +1 -1
  156. package/portals/dialog/dialog.options.d.ts +25 -0
  157. package/{components/dialog/dialog-close.service.d.ts → portals/dialog/dialog.providers.d.ts} +2 -0
  158. package/portals/dialog/dialog.service.d.ts +10 -0
  159. package/portals/dialog/index.d.ts +6 -0
  160. package/portals/dropdown/dropdown-content.directive.d.ts +9 -0
  161. package/{directives → portals}/dropdown/dropdown-hover.directive.d.ts +5 -10
  162. package/{directives → portals}/dropdown/dropdown-hover.options.d.ts +1 -3
  163. package/{directives → portals}/dropdown/dropdown-manual.directive.d.ts +2 -2
  164. package/portals/dropdown/dropdown-open.directive.d.ts +30 -0
  165. package/{directives → portals}/dropdown/dropdown-position-sided.directive.d.ts +3 -3
  166. package/{directives → portals}/dropdown/dropdown-position.directive.d.ts +5 -5
  167. package/{directives → portals}/dropdown/dropdown-selection.directive.d.ts +4 -5
  168. package/{directives → portals}/dropdown/dropdown.bindings.d.ts +0 -1
  169. package/{directives → portals}/dropdown/dropdown.d.ts +2 -3
  170. package/{directives → portals}/dropdown/dropdown.directive.d.ts +6 -8
  171. package/{directives → portals}/dropdown/index.d.ts +1 -4
  172. package/{directives → portals}/hint/hint-describe.directive.d.ts +4 -6
  173. package/{directives → portals}/hint/hint-host.directive.d.ts +2 -2
  174. package/{directives → portals}/hint/hint-hover.directive.d.ts +3 -4
  175. package/{directives → portals}/hint/hint-manual.directive.d.ts +2 -2
  176. package/{directives → portals}/hint/hint-options.directive.d.ts +3 -3
  177. package/{directives → portals}/hint/hint-overflow.directive.d.ts +2 -2
  178. package/{directives → portals}/hint/hint-position.directive.d.ts +5 -6
  179. package/{directives → portals}/hint/hint-unstyled.component.d.ts +2 -7
  180. package/portals/hint/hint.component.d.ts +29 -0
  181. package/portals/hint/hint.directive.d.ts +24 -0
  182. package/{directives → portals}/hint/index.d.ts +0 -2
  183. package/portals/index.d.ts +6 -0
  184. package/portals/modal/index.d.ts +2 -0
  185. package/portals/modal/modal.component.d.ts +17 -0
  186. package/portals/modal/modal.service.d.ts +13 -0
  187. package/portals/popup/popup.directive.d.ts +12 -0
  188. package/{directives → portals}/popup/popup.service.d.ts +1 -1
  189. package/{directives → portals}/popup/popups.component.d.ts +2 -2
  190. package/services/index.d.ts +0 -2
  191. package/styles/components/link.less +9 -23
  192. package/styles/components/textfield.less +10 -7
  193. package/styles/mixins/appearance.less +2 -2
  194. package/styles/mixins/mixins.less +0 -5
  195. package/styles/mixins/mixins.scss +0 -5
  196. package/styles/mixins/slider.less +21 -16
  197. package/styles/mixins/slider.scss +1 -2
  198. package/styles/theme/variables.less +2 -4
  199. package/tokens/common-icons.d.ts +3 -3
  200. package/tokens/date-format.d.ts +2 -3
  201. package/tokens/i18n.d.ts +7 -7
  202. package/tokens/icon-resolver.d.ts +0 -4
  203. package/tokens/icons.d.ts +0 -4
  204. package/tokens/index.d.ts +1 -4
  205. package/tokens/number-format.d.ts +2 -3
  206. package/tokens/validation-errors.d.ts +4 -0
  207. package/types/index.d.ts +0 -3
  208. package/types/point.d.ts +1 -1
  209. package/types/size.d.ts +0 -11
  210. package/utils/format/index.d.ts +0 -1
  211. package/utils/miscellaneous/get-duration.d.ts +2 -0
  212. package/utils/miscellaneous/index.d.ts +1 -1
  213. package/animations/animations.d.ts +0 -109
  214. package/animations/index.d.ts +0 -1
  215. package/components/alert/alert.component.d.ts +0 -15
  216. package/components/alert/alert.directive.d.ts +0 -7
  217. package/components/alert/alert.interfaces.d.ts +0 -12
  218. package/components/alert/alert.service.d.ts +0 -7
  219. package/components/alert/alert.tokens.d.ts +0 -12
  220. package/components/alert/alerts.component.d.ts +0 -12
  221. package/components/alert/index.d.ts +0 -6
  222. package/components/data-list/data-list.directive.d.ts +0 -7
  223. package/components/data-list/option/option-content.d.ts +0 -16
  224. package/components/data-list/option/option-legacy.component.d.ts +0 -24
  225. package/components/data-list/option/option.directive.d.ts +0 -27
  226. package/components/dialog/active-zone-adapter.directive.d.ts +0 -11
  227. package/components/dialog/dialog.component.d.ts +0 -20
  228. package/components/dialog/dialog.directive.d.ts +0 -7
  229. package/components/dialog/dialog.interfaces.d.ts +0 -34
  230. package/components/dialog/dialog.service.d.ts +0 -7
  231. package/components/dialog/dialog.tokens.d.ts +0 -15
  232. package/components/dialog/dialogs.component.d.ts +0 -8
  233. package/components/dialog/index.d.ts +0 -8
  234. package/components/expand/expand-content.directive.d.ts +0 -8
  235. package/components/expand/expand.d.ts +0 -6
  236. package/components/fullscreen/fullscreen.component.d.ts +0 -14
  237. package/components/fullscreen/index.d.ts +0 -1
  238. package/components/link/link.options.d.ts +0 -12
  239. package/components/textfield/select.directive.d.ts +0 -19
  240. package/components/textfield/textfield-dropdown.directive.d.ts +0 -16
  241. package/components/textfield/textfield.directive.d.ts +0 -38
  242. package/directives/dropdown/dropdown-open-legacy.directive.d.ts +0 -12
  243. package/directives/dropdown/dropdown-open.directive.d.ts +0 -33
  244. package/directives/dropdown/dropdown-portal.directive.d.ts +0 -14
  245. package/directives/dropdown/dropdown.service.d.ts +0 -6
  246. package/directives/dropdown/dropdowns.component.d.ts +0 -9
  247. package/directives/hint/hint.component.d.ts +0 -30
  248. package/directives/hint/hint.directive.d.ts +0 -26
  249. package/directives/hint/hint.service.d.ts +0 -13
  250. package/directives/hint/hints.component.d.ts +0 -12
  251. package/directives/popup/popup.directive.d.ts +0 -11
  252. package/directives/surface/index.d.ts +0 -1
  253. package/directives/surface/surface.directive.d.ts +0 -8
  254. package/fesm2022/taiga-ui-core-animations.mjs +0 -370
  255. package/fesm2022/taiga-ui-core-animations.mjs.map +0 -1
  256. package/fesm2022/taiga-ui-core-components-alert.mjs +0 -149
  257. package/fesm2022/taiga-ui-core-components-alert.mjs.map +0 -1
  258. package/fesm2022/taiga-ui-core-components-dialog.mjs +0 -229
  259. package/fesm2022/taiga-ui-core-components-dialog.mjs.map +0 -1
  260. package/fesm2022/taiga-ui-core-components-fullscreen.mjs +0 -77
  261. package/fesm2022/taiga-ui-core-components-fullscreen.mjs.map +0 -1
  262. package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +0 -1
  263. package/fesm2022/taiga-ui-core-directives-hint.mjs +0 -709
  264. package/fesm2022/taiga-ui-core-directives-hint.mjs.map +0 -1
  265. package/fesm2022/taiga-ui-core-directives-popup.mjs +0 -63
  266. package/fesm2022/taiga-ui-core-directives-popup.mjs.map +0 -1
  267. package/fesm2022/taiga-ui-core-directives-surface.mjs +0 -50
  268. package/fesm2022/taiga-ui-core-directives-surface.mjs.map +0 -1
  269. package/fesm2022/taiga-ui-core-directives-title.mjs +0 -43
  270. package/fesm2022/taiga-ui-core-directives-title.mjs.map +0 -1
  271. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -25
  272. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +0 -1
  273. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -94
  274. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +0 -1
  275. package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -32
  276. package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +0 -1
  277. package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -28
  278. package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +0 -1
  279. package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -29
  280. package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +0 -1
  281. package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -29
  282. package/fesm2022/taiga-ui-core-pipes-month.mjs.map +0 -1
  283. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -36
  284. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +0 -1
  285. package/pipes/auto-color/auto-color.pipe.d.ts +0 -7
  286. package/pipes/auto-color/index.d.ts +0 -1
  287. package/pipes/calendar-sheet/index.d.ts +0 -1
  288. package/pipes/calendar-sheet/utils.d.ts +0 -20
  289. package/pipes/flag/flag.pipe.d.ts +0 -14
  290. package/pipes/flag/index.d.ts +0 -1
  291. package/pipes/format-date/format-date.pipe.d.ts +0 -9
  292. package/pipes/format-date/index.d.ts +0 -1
  293. package/pipes/initials/index.d.ts +0 -1
  294. package/pipes/initials/initials.pipe.d.ts +0 -7
  295. package/pipes/month/index.d.ts +0 -1
  296. package/pipes/month/month.pipe.d.ts +0 -10
  297. package/pipes/order-week-days/index.d.ts +0 -1
  298. package/services/dark-theme.service.d.ts +0 -10
  299. package/services/format-date.service.d.ts +0 -8
  300. package/tokens/day-type-handler.d.ts +0 -7
  301. package/tokens/first-day-of-week.d.ts +0 -5
  302. package/tokens/scroll-ref.d.ts +0 -2
  303. package/tokens/spin-icons.d.ts +0 -6
  304. package/types/portal-item.d.ts +0 -9
  305. package/types/range-state.d.ts +0 -4
  306. package/types/value-content-context.d.ts +0 -4
  307. package/utils/format/string-hash-to-hsl.d.ts +0 -6
  308. package/utils/miscellaneous/to-animation-options.d.ts +0 -4
  309. /package/{directives → components}/title/index.d.ts +0 -0
  310. /package/{directives → portals}/dropdown/dropdown-context.directive.d.ts +0 -0
  311. /package/{directives → portals}/dropdown/dropdown-limit-width.d.ts +0 -0
  312. /package/{directives → portals}/dropdown/dropdown-options.directive.d.ts +0 -0
  313. /package/{directives → portals}/dropdown/dropdown.component.d.ts +0 -0
  314. /package/{directives → portals}/dropdown/dropdown.driver.d.ts +0 -0
  315. /package/{directives → portals}/dropdown/dropdown.providers.d.ts +0 -0
  316. /package/{directives → portals}/dropdown/with-dropdown-open.directive.d.ts +0 -0
  317. /package/{directives → portals}/hint/hint-driver.directive.d.ts +0 -0
  318. /package/{directives → portals}/hint/hint-pointer.directive.d.ts +0 -0
  319. /package/{directives → portals}/hint/hint.d.ts +0 -0
  320. /package/{directives → portals}/hint/hint.providers.d.ts +0 -0
  321. /package/{directives → portals}/popup/index.d.ts +0 -0
@@ -1,709 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { InjectionToken, Injectable, Directive, Optional, Self, SkipSelf, inject, Input, EventEmitter, Output, signal, INJECTOR, ChangeDetectionStrategy, Component, TemplateRef, NgZone, DestroyRef, ChangeDetectorRef } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { EMPTY_CLIENT_RECT } from '@taiga-ui/cdk/constants';
6
- import * as i1 from '@taiga-ui/cdk/directives/animated';
7
- import { TuiAnimated, TuiAnimatedParent } from '@taiga-ui/cdk/directives/animated';
8
- import { TuiHoveredService } from '@taiga-ui/cdk/directives/hovered';
9
- import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
10
- import { tuiInjectElement, tuiPointToClientRect } from '@taiga-ui/cdk/utils/dom';
11
- import { tuiClamp } from '@taiga-ui/cdk/utils/math';
12
- import { tuiProvide, tuiPure, tuiPx, tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
13
- import { TuiDriverDirective, TuiDriver, tuiAsDriver, TuiPositionAccessor, tuiFallbackAccessor, TuiRectAccessor, tuiAsRectAccessor, tuiAsVehicle, tuiPositionAccessorFor, tuiRectAccessorFor } from '@taiga-ui/core/classes';
14
- import { TuiPositionService, TuiVisualViewportService } from '@taiga-ui/core/services';
15
- import { TUI_VIEWPORT } from '@taiga-ui/core/tokens';
16
- import { tuiOverrideOptions, tuiIsObscured } from '@taiga-ui/core/utils';
17
- import { PolymorpheusComponent, injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
18
- import { BehaviorSubject, Subject, merge, switchMap, of, delay, takeUntil, repeat, filter, map, tap, takeWhile, distinctUntilChanged, fromEvent, debounce, timer, startWith, skip } from 'rxjs';
19
- import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
20
- import { DOCUMENT } from '@angular/common';
21
- import { tuiIfMap, tuiTypedFromEvent, tuiZonefreeScheduler, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
22
- import { tuiIsNativeFocused } from '@taiga-ui/cdk/utils/focus';
23
-
24
- /**
25
- * A component to display a hint
26
- */
27
- const TUI_HINT_COMPONENT = new InjectionToken(ngDevMode ? 'TUI_HINT_COMPONENT' : '', {
28
- factory: () => TuiHintComponent,
29
- });
30
-
31
- /**
32
- * Service for displaying hints/tooltips
33
- */
34
- class TuiHintService extends BehaviorSubject {
35
- constructor() {
36
- super([]);
37
- }
38
- add(directive) {
39
- this.next(this.value.concat(directive));
40
- }
41
- remove(directive) {
42
- if (this.value.includes(directive)) {
43
- this.next(this.value.filter((hint) => hint !== directive));
44
- }
45
- }
46
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
47
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintService, providedIn: 'root' }); }
48
- }
49
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintService, decorators: [{
50
- type: Injectable,
51
- args: [{
52
- providedIn: 'root',
53
- }]
54
- }], ctorParameters: () => [] });
55
-
56
- class TuiHintDriver extends TuiDriverDirective {
57
- constructor() {
58
- super(...arguments);
59
- this.type = 'hint';
60
- }
61
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintDriver, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
62
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintDriver, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
63
- }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintDriver, decorators: [{
65
- type: Directive,
66
- args: [{
67
- standalone: true,
68
- }]
69
- }] });
70
-
71
- const TUI_HINT_DIRECTIONS = [
72
- 'bottom-left',
73
- 'bottom',
74
- 'bottom-right',
75
- 'top-left',
76
- 'top',
77
- 'top-right',
78
- 'left-top',
79
- 'left',
80
- 'left-bottom',
81
- 'right-top',
82
- 'right',
83
- 'right-bottom',
84
- ];
85
- /** Default values for hint options */
86
- const TUI_HINT_DEFAULT_OPTIONS = {
87
- direction: 'bottom-left',
88
- showDelay: 500,
89
- hideDelay: 200,
90
- appearance: '',
91
- /** TODO @deprecated use {@link TUI_TOOLTIP_OPTIONS} instead **/
92
- icon: '@tui.circle-help',
93
- };
94
- /**
95
- * Default parameters for hint directive
96
- */
97
- const TUI_HINT_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_HINT_OPTIONS' : '', {
98
- factory: () => TUI_HINT_DEFAULT_OPTIONS,
99
- });
100
- const tuiHintOptionsProvider = (override) => ({
101
- provide: TUI_HINT_OPTIONS,
102
- deps: [
103
- [new Optional(), new Self(), TuiHintOptionsDirective],
104
- [new Optional(), new SkipSelf(), TUI_HINT_OPTIONS],
105
- ],
106
- useFactory: tuiOverrideOptions(override, TUI_HINT_DEFAULT_OPTIONS),
107
- });
108
- /**
109
- * @deprecated: drop in 5.0
110
- */
111
- class TuiHintOptionsDirective {
112
- constructor() {
113
- this.options = inject(TUI_HINT_OPTIONS, { skipSelf: true });
114
- this.direction = this.options.direction;
115
- this.appearance = this.options.appearance;
116
- this.showDelay = this.options.showDelay;
117
- this.hideDelay = this.options.hideDelay;
118
- this.icon = this.options.icon;
119
- this.change$ = new Subject();
120
- }
121
- ngOnChanges() {
122
- this.change$.next();
123
- }
124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
125
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintOptionsDirective, isStandalone: true, selector: "[tuiHintContent]", inputs: { content: ["tuiHintContent", "content"], direction: ["tuiHintDirection", "direction"], appearance: ["tuiHintAppearance", "appearance"], showDelay: ["tuiHintShowDelay", "showDelay"], hideDelay: ["tuiHintHideDelay", "hideDelay"] }, providers: [tuiProvide(TUI_HINT_OPTIONS, TuiHintOptionsDirective)], usesOnChanges: true, ngImport: i0 }); }
126
- }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintOptionsDirective, decorators: [{
128
- type: Directive,
129
- args: [{
130
- standalone: true,
131
- selector: '[tuiHintContent]',
132
- providers: [tuiProvide(TUI_HINT_OPTIONS, TuiHintOptionsDirective)],
133
- }]
134
- }], propDecorators: { content: [{
135
- type: Input,
136
- args: ['tuiHintContent']
137
- }], direction: [{
138
- type: Input,
139
- args: ['tuiHintDirection']
140
- }], appearance: [{
141
- type: Input,
142
- args: ['tuiHintAppearance']
143
- }], showDelay: [{
144
- type: Input,
145
- args: ['tuiHintShowDelay']
146
- }], hideDelay: [{
147
- type: Input,
148
- args: ['tuiHintHideDelay']
149
- }] } });
150
-
151
- class TuiHintHover extends TuiDriver {
152
- constructor() {
153
- super((subscriber) => this.stream$.subscribe(subscriber));
154
- this.isMobile = inject(TUI_IS_MOBILE);
155
- this.el = tuiInjectElement();
156
- this.hovered$ = inject(TuiHoveredService);
157
- this.options = inject(TUI_HINT_OPTIONS);
158
- this.visible = false;
159
- this.toggle$ = new Subject();
160
- this.stream$ = merge(this.toggle$.pipe(switchMap((visible) => this.isMobile
161
- ? of(visible)
162
- : of(visible).pipe(delay(visible ? 0 : this.tuiHintHideDelay))), takeUntil(this.hovered$), repeat()), this.hovered$.pipe(switchMap((visible) => this.isMobile
163
- ? of(visible)
164
- : of(visible).pipe(delay(visible ? this.tuiHintShowDelay : this.tuiHintHideDelay))), takeUntil(this.toggle$), repeat())).pipe(filter(() => this.enabled), map((value) => value &&
165
- (this.el.hasAttribute('tuiHintPointer') || !tuiIsObscured(this.el))), tap((visible) => {
166
- this.visible = visible;
167
- }));
168
- this.parent = inject(TuiHintHover, {
169
- optional: true,
170
- skipSelf: true,
171
- });
172
- this.tuiHintShowDelay = this.options.showDelay;
173
- this.tuiHintHideDelay = this.options.hideDelay;
174
- this.type = 'hint';
175
- this.enabled = true;
176
- }
177
- toggle(visible = !this.visible) {
178
- this.toggle$.next(visible);
179
- this.parent?.toggle(visible);
180
- }
181
- close() {
182
- this.toggle$.next(false);
183
- }
184
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintHover, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
185
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintHover, isStandalone: true, inputs: { tuiHintShowDelay: "tuiHintShowDelay", tuiHintHideDelay: "tuiHintHideDelay" }, providers: [tuiAsDriver(TuiHintHover), TuiHoveredService], exportAs: ["tuiHintHover"], usesInheritance: true, ngImport: i0 }); }
186
- }
187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintHover, decorators: [{
188
- type: Directive,
189
- args: [{
190
- standalone: true,
191
- providers: [tuiAsDriver(TuiHintHover), TuiHoveredService],
192
- exportAs: 'tuiHintHover',
193
- }]
194
- }], ctorParameters: () => [], propDecorators: { tuiHintShowDelay: [{
195
- type: Input
196
- }], tuiHintHideDelay: [{
197
- type: Input
198
- }] } });
199
-
200
- const GAP$1 = 8;
201
- const ARROW_OFFSET = 24;
202
- const TOP = 0;
203
- const LEFT = 1;
204
- class TuiHintPosition extends TuiPositionAccessor {
205
- constructor() {
206
- super(...arguments);
207
- this.el = tuiInjectElement();
208
- this.offset = inject(TUI_IS_MOBILE) ? 16 : 8;
209
- this.viewport = inject(TUI_VIEWPORT);
210
- this.accessor = tuiFallbackAccessor('hint')(inject(TuiRectAccessor), inject(TuiHintDirective));
211
- this.points = TUI_HINT_DIRECTIONS.reduce((acc, direction) => ({ ...acc, [direction]: [0, 0] }), {});
212
- this.direction = inject(TUI_HINT_OPTIONS).direction;
213
- this.directionChange = new EventEmitter();
214
- this.type = 'hint';
215
- }
216
- emitDirection(direction) {
217
- this.directionChange.emit(direction);
218
- }
219
- getPosition(rect, el) {
220
- const width = el?.clientWidth ?? rect.width;
221
- const height = el?.clientHeight ?? rect.height;
222
- const hostRect = this.accessor.getClientRect() ?? EMPTY_CLIENT_RECT;
223
- const leftCenter = hostRect.left + hostRect.width / 2;
224
- const topCenter = hostRect.top + hostRect.height / 2;
225
- const rtl = this.el.matches('[dir="rtl"] :scope');
226
- this.points['top-left'][TOP] = hostRect.top - height - this.offset;
227
- this.points['top-left'][LEFT] = leftCenter - width + ARROW_OFFSET;
228
- this.points.top[TOP] = this.points['top-left'][TOP];
229
- this.points.top[LEFT] = leftCenter - width / 2;
230
- this.points['top-right'][TOP] = this.points['top-left'][TOP];
231
- this.points['top-right'][LEFT] = leftCenter - ARROW_OFFSET;
232
- this.points['bottom-left'][TOP] = hostRect.bottom + this.offset;
233
- this.points['bottom-left'][LEFT] = this.points['top-left'][LEFT];
234
- this.points.bottom[TOP] = this.points['bottom-left'][TOP];
235
- this.points.bottom[LEFT] = this.points.top[LEFT];
236
- this.points['bottom-right'][TOP] = this.points['bottom-left'][TOP];
237
- this.points['bottom-right'][LEFT] = this.points['top-right'][LEFT];
238
- this.points['left-top'][TOP] = topCenter - height + ARROW_OFFSET;
239
- this.points['left-top'][LEFT] = hostRect.left - width - this.offset;
240
- this.points.left[TOP] = topCenter - height / 2;
241
- this.points.left[LEFT] = this.points['left-top'][LEFT];
242
- this.points['left-bottom'][TOP] = topCenter - ARROW_OFFSET;
243
- this.points['left-bottom'][LEFT] = this.points['left-top'][LEFT];
244
- this.points['right-top'][TOP] = this.points['left-top'][TOP];
245
- this.points['right-top'][LEFT] = hostRect.right + this.offset;
246
- this.points.right[TOP] = this.points.left[TOP];
247
- this.points.right[LEFT] = this.points['right-top'][LEFT];
248
- this.points['right-bottom'][TOP] = this.points['left-bottom'][TOP];
249
- this.points['right-bottom'][LEFT] = this.points['right-top'][LEFT];
250
- const array = Array.isArray(this.direction) ? this.direction : [this.direction];
251
- const priority = array.map((direction) => adjust(direction, rtl));
252
- const direction = priority
253
- .concat(TUI_HINT_DIRECTIONS)
254
- .find((dir) => this.checkPosition(this.points[dir], width, height)) ||
255
- this.fallback;
256
- this.emitDirection(adjust(direction, rtl));
257
- return this.points[direction];
258
- }
259
- get fallback() {
260
- return this.points.top[TOP] >
261
- this.viewport.getClientRect().bottom - this.points.bottom[TOP]
262
- ? 'top'
263
- : 'bottom';
264
- }
265
- checkPosition([top, left], width, height) {
266
- const viewport = this.viewport.getClientRect();
267
- return (top > viewport.top + GAP$1 &&
268
- left > viewport.left + GAP$1 &&
269
- top + height < viewport.bottom - GAP$1 &&
270
- left + width < viewport.right - GAP$1);
271
- }
272
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintPosition, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
273
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintPosition, isStandalone: true, inputs: { direction: ["tuiHintDirection", "direction"] }, outputs: { directionChange: "tuiHintDirectionChange" }, usesInheritance: true, ngImport: i0 }); }
274
- }
275
- __decorate([
276
- tuiPure
277
- ], TuiHintPosition.prototype, "emitDirection", null);
278
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintPosition, decorators: [{
279
- type: Directive,
280
- args: [{
281
- standalone: true,
282
- }]
283
- }], propDecorators: { direction: [{
284
- type: Input,
285
- args: ['tuiHintDirection']
286
- }], directionChange: [{
287
- type: Output,
288
- args: ['tuiHintDirectionChange']
289
- }], emitDirection: [] } });
290
- function adjust(direction, rtl) {
291
- if (rtl && direction.includes('left')) {
292
- return direction.replace('left', 'right');
293
- }
294
- if (rtl && direction.includes('right')) {
295
- return direction.replace('right', 'left');
296
- }
297
- return direction;
298
- }
299
-
300
- class TuiHintDirective {
301
- constructor() {
302
- this.service = inject(TuiHintService);
303
- this.appearance = inject(TUI_HINT_OPTIONS).appearance;
304
- this.visible = new EventEmitter();
305
- this.content = signal(null);
306
- this.component = inject((PolymorpheusComponent));
307
- this.el = tuiInjectElement();
308
- this.activeZone = inject(TuiActiveZone, { optional: true });
309
- this.type = 'hint';
310
- }
311
- set tuiHint(content) {
312
- this.content.set(content);
313
- if (!content) {
314
- this.toggle(false);
315
- }
316
- }
317
- ngOnDestroy() {
318
- this.toggle(false);
319
- }
320
- getClientRect() {
321
- return this.el.getBoundingClientRect();
322
- }
323
- toggle(show) {
324
- if (show && this.content()) {
325
- this.service.add(this);
326
- }
327
- else {
328
- this.service.remove(this);
329
- }
330
- this.visible.emit(show);
331
- }
332
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
333
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintDirective, isStandalone: true, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: { context: ["tuiHintContext", "context"], appearance: ["tuiHintAppearance", "appearance"], tuiHint: "tuiHint" }, outputs: { visible: "tuiHintVisible" }, providers: [
334
- tuiAsRectAccessor(TuiHintDirective),
335
- tuiAsVehicle(TuiHintDirective),
336
- {
337
- provide: PolymorpheusComponent,
338
- deps: [TUI_HINT_COMPONENT, INJECTOR],
339
- useClass: PolymorpheusComponent,
340
- },
341
- ], hostDirectives: [{ directive: TuiHintDriver }, { directive: TuiHintHover, inputs: ["tuiHintHideDelay", "tuiHintHideDelay", "tuiHintShowDelay", "tuiHintShowDelay"] }, { directive: TuiHintPosition, inputs: ["tuiHintDirection", "tuiHintDirection"], outputs: ["tuiHintDirectionChange", "tuiHintDirectionChange"] }], ngImport: i0 }); }
342
- }
343
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintDirective, decorators: [{
344
- type: Directive,
345
- args: [{
346
- standalone: true,
347
- selector: '[tuiHint]:not(ng-container):not(ng-template)',
348
- providers: [
349
- tuiAsRectAccessor(TuiHintDirective),
350
- tuiAsVehicle(TuiHintDirective),
351
- {
352
- provide: PolymorpheusComponent,
353
- deps: [TUI_HINT_COMPONENT, INJECTOR],
354
- useClass: PolymorpheusComponent,
355
- },
356
- ],
357
- hostDirectives: [
358
- TuiHintDriver,
359
- {
360
- directive: TuiHintHover,
361
- inputs: ['tuiHintHideDelay', 'tuiHintShowDelay'],
362
- },
363
- {
364
- directive: TuiHintPosition,
365
- inputs: ['tuiHintDirection'],
366
- outputs: ['tuiHintDirectionChange'],
367
- },
368
- ],
369
- }]
370
- }], propDecorators: { context: [{
371
- type: Input,
372
- args: ['tuiHintContext']
373
- }], appearance: [{
374
- type: Input,
375
- args: ['tuiHintAppearance']
376
- }], visible: [{
377
- type: Output,
378
- args: ['tuiHintVisible']
379
- }], tuiHint: [{
380
- type: Input
381
- }] } });
382
-
383
- class TuiHintPointer extends TuiHintHover {
384
- constructor() {
385
- super(...arguments);
386
- this.currentRect = EMPTY_CLIENT_RECT;
387
- }
388
- getClientRect() {
389
- return this.currentRect;
390
- }
391
- onMove({ clientX, clientY }) {
392
- this.currentRect = tuiPointToClientRect(clientX, clientY);
393
- }
394
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintPointer, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
395
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintPointer, isStandalone: true, selector: "[tuiHint][tuiHintPointer]", host: { listeners: { "mousemove.zoneless": "onMove($event)" } }, providers: [tuiAsRectAccessor(TuiHintPointer), tuiAsDriver(TuiHintPointer)], usesInheritance: true, ngImport: i0 }); }
396
- }
397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintPointer, decorators: [{
398
- type: Directive,
399
- args: [{
400
- standalone: true,
401
- selector: '[tuiHint][tuiHintPointer]',
402
- providers: [tuiAsRectAccessor(TuiHintPointer), tuiAsDriver(TuiHintPointer)],
403
- host: {
404
- '(mousemove.zoneless)': 'onMove($event)',
405
- },
406
- }]
407
- }] });
408
-
409
- class TuiHintUnstyledComponent {
410
- constructor() {
411
- this.context = injectContext();
412
- }
413
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintUnstyledComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
414
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintUnstyledComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '<ng-container *polymorpheusOutlet="context.$implicit.content()" />', isInline: true, dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
415
- }
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintUnstyledComponent, decorators: [{
417
- type: Component,
418
- args: [{
419
- imports: [PolymorpheusOutlet],
420
- template: '<ng-container *polymorpheusOutlet="context.$implicit.content()" />',
421
- changeDetection: ChangeDetectionStrategy.OnPush,
422
- }]
423
- }] });
424
- class TuiHintUnstyled {
425
- constructor() {
426
- const hint = inject((TuiHintDirective));
427
- hint.component = new PolymorpheusComponent(TuiHintUnstyledComponent);
428
- hint.content.set(inject((TemplateRef)));
429
- }
430
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintUnstyled, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
431
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintUnstyled, isStandalone: true, selector: "ng-template[tuiHint]", ngImport: i0 }); }
432
- }
433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintUnstyled, decorators: [{
434
- type: Directive,
435
- args: [{
436
- standalone: true,
437
- selector: 'ng-template[tuiHint]',
438
- }]
439
- }], ctorParameters: () => [] });
440
-
441
- const TUI_HINT_PROVIDERS = [
442
- TuiPositionService,
443
- TuiHoveredService,
444
- tuiPositionAccessorFor('hint', TuiHintPosition),
445
- tuiRectAccessorFor('hint', TuiHintDirective),
446
- ];
447
- const GAP = 8;
448
- // TODO(v5): remove base component after angular update
449
- class TuiHintBaseComponent {
450
- constructor() {
451
- this.el = tuiInjectElement();
452
- this.hover = inject(TuiHintHover);
453
- this.vvs = inject(TuiVisualViewportService);
454
- this.viewport = inject(TUI_VIEWPORT);
455
- this.pointer = inject(TuiHintPointer, { optional: true });
456
- this.accessor = inject(TuiRectAccessor);
457
- this.hint = injectContext().$implicit;
458
- this.isMobile = inject(TUI_IS_MOBILE);
459
- this.content = this.hint.component.component === TuiHintUnstyledComponent
460
- ? signal('')
461
- : this.hint.content;
462
- this.appearance = this.hint.appearance ||
463
- this.hint.el.closest('[tuiTheme]')?.getAttribute('tuiTheme');
464
- inject(TuiPositionService)
465
- .pipe(takeWhile(() => this.hint.el.isConnected), map((point) => this.vvs.correct(point)), takeUntilDestroyed())
466
- .subscribe({
467
- next: ([top, left]) => this.update(top, left),
468
- complete: () => this.hover.close(),
469
- });
470
- inject(TuiHoveredService)
471
- .pipe(takeUntilDestroyed())
472
- .subscribe((hover) => this.hover.toggle(hover));
473
- }
474
- onClick(target) {
475
- if ((!target.closest(this.el.tagName) && !this.hint.el.contains(target)) ||
476
- tuiIsObscured(this.hint.el)) {
477
- this.hover.toggle(false);
478
- }
479
- }
480
- apply(top, left, beakTop, beakLeft) {
481
- this.el.style.top = top;
482
- this.el.style.left = left;
483
- this.el.style.setProperty('--t-top', `${beakTop}%`);
484
- this.el.style.setProperty('--t-left', `${beakLeft}%`);
485
- this.el.style.setProperty('--t-rotate', !beakLeft || Math.ceil(beakLeft) === 100 ? '90deg' : '0deg');
486
- }
487
- update(top, left) {
488
- const { clientHeight, clientWidth } = this.el;
489
- const rect = this.accessor.getClientRect();
490
- if (rect === EMPTY_CLIENT_RECT || !clientHeight || !clientWidth) {
491
- return;
492
- }
493
- const viewport = this.viewport.getClientRect();
494
- const safeLeft = tuiClamp(Math.max(GAP, left), viewport.left + GAP, Math.max(GAP, viewport.width + viewport.left - clientWidth - GAP));
495
- const [beakTop, beakLeft] = this.vvs.correct([
496
- rect.top + rect.height / 2 - top,
497
- rect.left + rect.width / 2 - safeLeft,
498
- ]);
499
- this.apply(tuiPx(Math.round(top)), tuiPx(Math.round(safeLeft)), Math.round((tuiClamp(beakTop, 0, clientHeight) / clientHeight) * 100), Math.round((tuiClamp(beakLeft, 0, clientWidth) / clientWidth) * 100));
500
- }
501
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
502
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintBaseComponent, isStandalone: true, selector: "ng-component", host: { listeners: { "document:click": "onClick($event.target)" }, properties: { "class._untouchable": "pointer", "class._mobile": "isMobile", "attr.data-appearance": "appearance", "attr.tuiTheme": "appearance === \"dark\" ? \"light\" : null" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
503
- }
504
- __decorate([
505
- tuiPure
506
- ], TuiHintBaseComponent.prototype, "apply", null);
507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintBaseComponent, decorators: [{
508
- type: Component,
509
- args: [{
510
- standalone: true,
511
- template: '',
512
- changeDetection: ChangeDetectionStrategy.OnPush,
513
- host: {
514
- '[class._untouchable]': 'pointer',
515
- '[class._mobile]': 'isMobile',
516
- '[attr.data-appearance]': 'appearance',
517
- '[attr.tuiTheme]': 'appearance === "dark" ? "light" : null',
518
- '(document:click)': 'onClick($event.target)',
519
- },
520
- }]
521
- }], ctorParameters: () => [], propDecorators: { apply: [] } });
522
- class TuiHintComponent extends TuiHintBaseComponent {
523
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
524
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintComponent, isStandalone: true, selector: "tui-hint", providers: TUI_HINT_PROVIDERS, usesInheritance: true, hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: `
525
- <ng-content />
526
- <span
527
- *polymorpheusOutlet="content() as text; context: hint.context"
528
- [innerHTML]="text"
529
- ></span>
530
- `, isInline: true, styles: [":host{position:absolute;max-inline-size:min(18rem,calc(100% - 1rem));padding:.75rem 1rem;background:var(--tui-background-accent-1);border-radius:var(--tui-radius-l);color:var(--tui-text-primary-on-accent-1);box-sizing:border-box;font:var(--tui-font-text-s);white-space:pre-line;overflow-wrap:break-word;transform-origin:var(--t-left) var(--t-top);--tui-background-elevation-2: var(--tui-background-elevation-3)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade}:host :host-context(tui-root._mobile).tui-enter{animation:tuiFade var(--tui-duration) ease-in-out,tuiScale var(--tui-duration) cubic-bezier(.34,1.56,.64,1)}:host :host-context(tui-root._mobile).tui-leave{animation:tuiFade var(--tui-duration) ease-in-out reverse,tuiScale var(--tui-duration) ease-in-out reverse}:host:before{content:\"\";position:absolute;top:var(--t-top);left:var(--t-left);inline-size:.75rem;block-size:.5rem;background:inherit;-webkit-mask-image:url('data:image/svg+xml,<svg viewBox=\"0 0 12 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.61336 1.69607L2.44882 2.96493C1.84795 3.61964 0.949361 3.99951 0.00053941 4C0.000359608 4 0.000179805 4 0 4C0.000179863 4 0.000359764 4 0.000539623 4C0.949362 4.00049 1.84795 4.38036 2.44882 5.03506L3.61336 6.30394C4.55981 7.33517 5.03303 7.85079 5.63254 7.96535C5.87433 8.01155 6.12436 8.01155 6.36616 7.96535C6.96567 7.85079 7.43889 7.33517 8.38534 6.30393L9.54988 5.03507C10.1511 4.37994 11.0505 4 12 4C11.0505 4 10.1511 3.62006 9.54988 2.96493L8.38534 1.69606C7.43889 0.664826 6.96567 0.149207 6.36616 0.0346517C6.12436 -0.0115506 5.87433 -0.0115506 5.63254 0.0346517C5.03303 0.149207 4.55981 0.664827 3.61336 1.69607Z\" /></svg>');mask-image:url('data:image/svg+xml,<svg viewBox=\"0 0 12 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.61336 1.69607L2.44882 2.96493C1.84795 3.61964 0.949361 3.99951 0.00053941 4C0.000359608 4 0.000179805 4 0 4C0.000179863 4 0.000359764 4 0.000539623 4C0.949362 4.00049 1.84795 4.38036 2.44882 5.03506L3.61336 6.30394C4.55981 7.33517 5.03303 7.85079 5.63254 7.96535C5.87433 8.01155 6.12436 8.01155 6.36616 7.96535C6.96567 7.85079 7.43889 7.33517 8.38534 6.30393L9.54988 5.03507C10.1511 4.37994 11.0505 4 12 4C11.0505 4 10.1511 3.62006 9.54988 2.96493L8.38534 1.69606C7.43889 0.664826 6.96567 0.149207 6.36616 0.0346517C6.12436 -0.0115506 5.87433 -0.0115506 5.63254 0.0346517C5.03303 0.149207 4.55981 0.664827 3.61336 1.69607Z\" /></svg>');transform:translate(-50%,-50%) rotate(var(--t-rotate))}:host._mobile{font:var(--tui-font-text-m)}:host._mobile:before{inline-size:1.5rem;block-size:1.125rem;-webkit-mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 18\"><path d=\"M7.22854 3.81615L4.89971 6.6711C3.69732 8.14514 1.8988 9 0 9C1.8988 9 3.69732 9.85486 4.89971 11.3289L7.22854 14.1839L7.22854 14.1839C9.12123 16.5041 10.0676 17.6643 11.2665 17.922C11.75 18.026 12.25 18.026 12.7335 17.922C13.9324 17.6643 14.8788 16.5041 16.7715 14.1839L19.1003 11.3289C20.3027 9.85486 22.1012 9 24 9C22.1012 9 20.3027 8.14514 19.1003 6.6711L16.7715 3.81614C14.8788 1.49586 13.9324 0.335716 12.7335 0.0779663C12.25 -0.0259888 11.75 -0.0259888 11.2665 0.0779663C10.0676 0.335716 9.12123 1.49586 7.22854 3.81614L7.22854 3.81615Z\" /></svg>');mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 18\"><path d=\"M7.22854 3.81615L4.89971 6.6711C3.69732 8.14514 1.8988 9 0 9C1.8988 9 3.69732 9.85486 4.89971 11.3289L7.22854 14.1839L7.22854 14.1839C9.12123 16.5041 10.0676 17.6643 11.2665 17.922C11.75 18.026 12.25 18.026 12.7335 17.922C13.9324 17.6643 14.8788 16.5041 16.7715 14.1839L19.1003 11.3289C20.3027 9.85486 22.1012 9 24 9C22.1012 9 20.3027 8.14514 19.1003 6.6711L16.7715 3.81614C14.8788 1.49586 13.9324 0.335716 12.7335 0.0779663C12.25 -0.0259888 11.75 -0.0259888 11.2665 0.0779663C10.0676 0.335716 9.12123 1.49586 7.22854 3.81614L7.22854 3.81615Z\" /></svg>')}:host[data-appearance=error]{background:var(--tui-status-negative)}:host[data-appearance=dark]{background:var(--tui-background-elevation-1);color:var(--tui-text-primary);filter:drop-shadow(0 0 .125rem rgba(0,0,0,.16)) drop-shadow(0 1.5rem 1rem rgba(0,0,0,.03)) drop-shadow(0 .75rem .75rem rgba(0,0,0,.04)) drop-shadow(0 .25rem .375rem rgba(0,0,0,.05))}:host:not([style*=top]){visibility:hidden}:host._untouchable{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
531
- }
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintComponent, decorators: [{
533
- type: Component,
534
- args: [{ selector: 'tui-hint', imports: [PolymorpheusOutlet], template: `
535
- <ng-content />
536
- <span
537
- *polymorpheusOutlet="content() as text; context: hint.context"
538
- [innerHTML]="text"
539
- ></span>
540
- `, changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_HINT_PROVIDERS, hostDirectives: [TuiAnimated], styles: [":host{position:absolute;max-inline-size:min(18rem,calc(100% - 1rem));padding:.75rem 1rem;background:var(--tui-background-accent-1);border-radius:var(--tui-radius-l);color:var(--tui-text-primary-on-accent-1);box-sizing:border-box;font:var(--tui-font-text-s);white-space:pre-line;overflow-wrap:break-word;transform-origin:var(--t-left) var(--t-top);--tui-background-elevation-2: var(--tui-background-elevation-3)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade}:host :host-context(tui-root._mobile).tui-enter{animation:tuiFade var(--tui-duration) ease-in-out,tuiScale var(--tui-duration) cubic-bezier(.34,1.56,.64,1)}:host :host-context(tui-root._mobile).tui-leave{animation:tuiFade var(--tui-duration) ease-in-out reverse,tuiScale var(--tui-duration) ease-in-out reverse}:host:before{content:\"\";position:absolute;top:var(--t-top);left:var(--t-left);inline-size:.75rem;block-size:.5rem;background:inherit;-webkit-mask-image:url('data:image/svg+xml,<svg viewBox=\"0 0 12 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.61336 1.69607L2.44882 2.96493C1.84795 3.61964 0.949361 3.99951 0.00053941 4C0.000359608 4 0.000179805 4 0 4C0.000179863 4 0.000359764 4 0.000539623 4C0.949362 4.00049 1.84795 4.38036 2.44882 5.03506L3.61336 6.30394C4.55981 7.33517 5.03303 7.85079 5.63254 7.96535C5.87433 8.01155 6.12436 8.01155 6.36616 7.96535C6.96567 7.85079 7.43889 7.33517 8.38534 6.30393L9.54988 5.03507C10.1511 4.37994 11.0505 4 12 4C11.0505 4 10.1511 3.62006 9.54988 2.96493L8.38534 1.69606C7.43889 0.664826 6.96567 0.149207 6.36616 0.0346517C6.12436 -0.0115506 5.87433 -0.0115506 5.63254 0.0346517C5.03303 0.149207 4.55981 0.664827 3.61336 1.69607Z\" /></svg>');mask-image:url('data:image/svg+xml,<svg viewBox=\"0 0 12 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.61336 1.69607L2.44882 2.96493C1.84795 3.61964 0.949361 3.99951 0.00053941 4C0.000359608 4 0.000179805 4 0 4C0.000179863 4 0.000359764 4 0.000539623 4C0.949362 4.00049 1.84795 4.38036 2.44882 5.03506L3.61336 6.30394C4.55981 7.33517 5.03303 7.85079 5.63254 7.96535C5.87433 8.01155 6.12436 8.01155 6.36616 7.96535C6.96567 7.85079 7.43889 7.33517 8.38534 6.30393L9.54988 5.03507C10.1511 4.37994 11.0505 4 12 4C11.0505 4 10.1511 3.62006 9.54988 2.96493L8.38534 1.69606C7.43889 0.664826 6.96567 0.149207 6.36616 0.0346517C6.12436 -0.0115506 5.87433 -0.0115506 5.63254 0.0346517C5.03303 0.149207 4.55981 0.664827 3.61336 1.69607Z\" /></svg>');transform:translate(-50%,-50%) rotate(var(--t-rotate))}:host._mobile{font:var(--tui-font-text-m)}:host._mobile:before{inline-size:1.5rem;block-size:1.125rem;-webkit-mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 18\"><path d=\"M7.22854 3.81615L4.89971 6.6711C3.69732 8.14514 1.8988 9 0 9C1.8988 9 3.69732 9.85486 4.89971 11.3289L7.22854 14.1839L7.22854 14.1839C9.12123 16.5041 10.0676 17.6643 11.2665 17.922C11.75 18.026 12.25 18.026 12.7335 17.922C13.9324 17.6643 14.8788 16.5041 16.7715 14.1839L19.1003 11.3289C20.3027 9.85486 22.1012 9 24 9C22.1012 9 20.3027 8.14514 19.1003 6.6711L16.7715 3.81614C14.8788 1.49586 13.9324 0.335716 12.7335 0.0779663C12.25 -0.0259888 11.75 -0.0259888 11.2665 0.0779663C10.0676 0.335716 9.12123 1.49586 7.22854 3.81614L7.22854 3.81615Z\" /></svg>');mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 18\"><path d=\"M7.22854 3.81615L4.89971 6.6711C3.69732 8.14514 1.8988 9 0 9C1.8988 9 3.69732 9.85486 4.89971 11.3289L7.22854 14.1839L7.22854 14.1839C9.12123 16.5041 10.0676 17.6643 11.2665 17.922C11.75 18.026 12.25 18.026 12.7335 17.922C13.9324 17.6643 14.8788 16.5041 16.7715 14.1839L19.1003 11.3289C20.3027 9.85486 22.1012 9 24 9C22.1012 9 20.3027 8.14514 19.1003 6.6711L16.7715 3.81614C14.8788 1.49586 13.9324 0.335716 12.7335 0.0779663C12.25 -0.0259888 11.75 -0.0259888 11.2665 0.0779663C10.0676 0.335716 9.12123 1.49586 7.22854 3.81614L7.22854 3.81615Z\" /></svg>')}:host[data-appearance=error]{background:var(--tui-status-negative)}:host[data-appearance=dark]{background:var(--tui-background-elevation-1);color:var(--tui-text-primary);filter:drop-shadow(0 0 .125rem rgba(0,0,0,.16)) drop-shadow(0 1.5rem 1rem rgba(0,0,0,.03)) drop-shadow(0 .75rem .75rem rgba(0,0,0,.04)) drop-shadow(0 .25rem .375rem rgba(0,0,0,.05))}:host:not([style*=top]){visibility:hidden}:host._untouchable{pointer-events:none}\n"] }]
541
- }] });
542
-
543
- class TuiHintDescribe extends TuiDriver {
544
- constructor() {
545
- super((subscriber) => this.stream$.subscribe(subscriber));
546
- this.doc = inject(DOCUMENT);
547
- this.el = tuiInjectElement();
548
- this.zone = inject(NgZone);
549
- this.id$ = new BehaviorSubject('');
550
- this.stream$ = this.id$.pipe(distinctUntilChanged(), tuiIfMap(() => fromEvent(this.doc, 'keydown', { capture: true }), tuiIsPresent), switchMap(() => this.focused
551
- ? of(false)
552
- : merge(tuiTypedFromEvent(this.doc, 'keyup'), tuiTypedFromEvent(this.element, 'blur')).pipe(map(() => this.focused))), debounce((visible) => visible ? timer(1000, tuiZonefreeScheduler(this.zone)) : of(null)), startWith(false), distinctUntilChanged(), skip(1), tuiZoneOptimized());
553
- this.type = 'hint';
554
- }
555
- set tuiHintDescribe(id) {
556
- this.id$.next(id || '');
557
- }
558
- get element() {
559
- const id = this.id$.value;
560
- return id ? this.doc.querySelector(`#${id}`) || this.el : this.el;
561
- }
562
- get focused() {
563
- return tuiIsNativeFocused(this.element);
564
- }
565
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintDescribe, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
566
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintDescribe, isStandalone: true, selector: "[tuiHintDescribe]", inputs: { tuiHintDescribe: "tuiHintDescribe" }, providers: [tuiAsDriver(TuiHintDescribe)], usesInheritance: true, ngImport: i0 }); }
567
- }
568
- __decorate([
569
- tuiPure
570
- ], TuiHintDescribe.prototype, "element", null);
571
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintDescribe, decorators: [{
572
- type: Directive,
573
- args: [{
574
- standalone: true,
575
- selector: '[tuiHintDescribe]',
576
- providers: [tuiAsDriver(TuiHintDescribe)],
577
- }]
578
- }], ctorParameters: () => [], propDecorators: { tuiHintDescribe: [{
579
- type: Input
580
- }], element: [] } });
581
-
582
- class TuiHintHost extends TuiRectAccessor {
583
- constructor() {
584
- super(...arguments);
585
- this.type = 'hint';
586
- }
587
- getClientRect() {
588
- return this.tuiHintHost?.getBoundingClientRect() || EMPTY_CLIENT_RECT;
589
- }
590
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintHost, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
591
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintHost, isStandalone: true, selector: "[tuiHint][tuiHintHost]", inputs: { tuiHintHost: "tuiHintHost" }, providers: [tuiAsRectAccessor(TuiHintHost)], usesInheritance: true, ngImport: i0 }); }
592
- }
593
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintHost, decorators: [{
594
- type: Directive,
595
- args: [{
596
- standalone: true,
597
- selector: '[tuiHint][tuiHintHost]',
598
- providers: [tuiAsRectAccessor(TuiHintHost)],
599
- }]
600
- }], propDecorators: { tuiHintHost: [{
601
- type: Input
602
- }] } });
603
-
604
- class TuiHintManual extends TuiDriver {
605
- constructor() {
606
- super((subscriber) => this.stream$.subscribe(subscriber));
607
- this.hover = inject(TuiHintHover);
608
- this.stream$ = new BehaviorSubject(false);
609
- this.tuiHintManual = false;
610
- this.type = 'hint';
611
- this.hover.enabled = false;
612
- }
613
- ngOnChanges() {
614
- this.stream$.next(!!this.tuiHintManual);
615
- this.hover.enabled = this.tuiHintManual === null;
616
- }
617
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintManual, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
618
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintManual, isStandalone: true, selector: "[tuiHint][tuiHintManual]", inputs: { tuiHintManual: "tuiHintManual" }, providers: [tuiAsDriver(TuiHintManual)], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
619
- }
620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintManual, decorators: [{
621
- type: Directive,
622
- args: [{
623
- standalone: true,
624
- selector: '[tuiHint][tuiHintManual]',
625
- providers: [tuiAsDriver(TuiHintManual)],
626
- }]
627
- }], ctorParameters: () => [], propDecorators: { tuiHintManual: [{
628
- type: Input
629
- }] } });
630
-
631
- class TuiHintOverflow {
632
- constructor() {
633
- this.hint = inject(TuiHintDirective);
634
- this.tuiHintOverflow = '';
635
- }
636
- onMouseEnter({ scrollWidth, clientWidth, textContent }) {
637
- this.hint.tuiHint =
638
- scrollWidth > clientWidth && this.tuiHintOverflow !== null
639
- ? this.tuiHintOverflow || textContent
640
- : '';
641
- }
642
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintOverflow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
643
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiHintOverflow, isStandalone: true, selector: "[tuiHintOverflow]", inputs: { tuiHintOverflow: "tuiHintOverflow" }, host: { listeners: { "mouseenter": "onMouseEnter($event.currentTarget)" } }, hostDirectives: [{ directive: TuiHintDirective, inputs: ["tuiHintAppearance", "tuiHintAppearance"] }], ngImport: i0 }); }
644
- }
645
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHintOverflow, decorators: [{
646
- type: Directive,
647
- args: [{
648
- standalone: true,
649
- selector: '[tuiHintOverflow]',
650
- hostDirectives: [
651
- {
652
- directive: TuiHintDirective,
653
- inputs: ['tuiHintAppearance'],
654
- },
655
- ],
656
- host: {
657
- '(mouseenter)': 'onMouseEnter($event.currentTarget)',
658
- },
659
- }]
660
- }], propDecorators: { tuiHintOverflow: [{
661
- type: Input
662
- }] } });
663
-
664
- const TuiHint = [
665
- TuiHintComponent,
666
- TuiHintDirective,
667
- TuiHintOptionsDirective,
668
- TuiHintUnstyled,
669
- TuiHintDriver,
670
- TuiHintPosition,
671
- TuiHintHover,
672
- TuiHintOverflow,
673
- TuiHintDescribe,
674
- TuiHintHost,
675
- TuiHintManual,
676
- TuiHintPointer,
677
- ];
678
-
679
- class TuiHints {
680
- constructor() {
681
- this.hints$ = inject(TuiHintService);
682
- this.destroyRef = inject(DestroyRef);
683
- this.cdr = inject(ChangeDetectorRef);
684
- this.hints = [];
685
- }
686
- ngOnInit() {
687
- // Due to this view being parallel to app content, `markForCheck` from `async` pipe
688
- // can happen after view was checked, so calling `detectChanges` instead
689
- this.hints$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((hints) => {
690
- this.hints = hints;
691
- this.cdr.detectChanges();
692
- });
693
- }
694
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHints, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
695
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiHints, isStandalone: true, selector: "tui-hints", host: { attributes: { "aria-live": "polite" } }, ngImport: i0, template: "@for (hint of hints; track hint) {\n <div\n role=\"tooltip\"\n tuiAnimatedParent\n [tuiActiveZoneParent]=\"hint.activeZone || null\"\n >\n <ng-container *polymorpheusOutlet=\"hint.component; context: {$implicit: hint}\" />\n </div>\n}\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;block-size:0}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiActiveZone, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { kind: "directive", type: TuiAnimatedParent, selector: "[tuiAnimatedParent]" }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
696
- }
697
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHints, decorators: [{
698
- type: Component,
699
- args: [{ selector: 'tui-hints', imports: [PolymorpheusOutlet, TuiActiveZone, TuiAnimatedParent], changeDetection: ChangeDetectionStrategy.Default, host: {
700
- 'aria-live': 'polite',
701
- }, template: "@for (hint of hints; track hint) {\n <div\n role=\"tooltip\"\n tuiAnimatedParent\n [tuiActiveZoneParent]=\"hint.activeZone || null\"\n >\n <ng-container *polymorpheusOutlet=\"hint.component; context: {$implicit: hint}\" />\n </div>\n}\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;block-size:0}\n"] }]
702
- }] });
703
-
704
- /**
705
- * Generated bundle index. Do not edit.
706
- */
707
-
708
- export { TUI_HINT_COMPONENT, TUI_HINT_DEFAULT_OPTIONS, TUI_HINT_DIRECTIONS, TUI_HINT_OPTIONS, TUI_HINT_PROVIDERS, TuiHint, TuiHintBaseComponent, TuiHintComponent, TuiHintDescribe, TuiHintDirective, TuiHintDriver, TuiHintHost, TuiHintHover, TuiHintManual, TuiHintOptionsDirective, TuiHintOverflow, TuiHintPointer, TuiHintPosition, TuiHintService, TuiHintUnstyled, TuiHintUnstyledComponent, TuiHints, tuiHintOptionsProvider };
709
- //# sourceMappingURL=taiga-ui-core-directives-hint.mjs.map