@taiga-ui/core 4.52.0-canary.2c75afa → 4.52.0-canary.2d877cf

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 (259) hide show
  1. package/README.md +1 -1
  2. package/classes/accessors.d.ts +1 -1
  3. package/components/calendar/calendar-sheet.component.d.ts +1 -1
  4. package/components/calendar/calendar-sheet.options.d.ts +1 -3
  5. package/{pipes/calendar-sheet → components/calendar}/calendar-sheet.pipe.d.ts +2 -2
  6. package/components/calendar/calendar-spin.component.d.ts +1 -0
  7. package/components/calendar/calendar-year.component.d.ts +1 -1
  8. package/components/calendar/calendar.options.d.ts +9 -0
  9. package/components/calendar/index.d.ts +3 -0
  10. package/{pipes/order-week-days → components/calendar}/order-week-days.pipe.d.ts +1 -1
  11. package/components/data-list/data-list.component.d.ts +7 -11
  12. package/components/data-list/data-list.d.ts +3 -4
  13. package/components/data-list/data-list.tokens.d.ts +1 -23
  14. package/components/data-list/index.d.ts +3 -4
  15. package/components/data-list/opt-group.directive.d.ts +2 -2
  16. package/components/data-list/option-content.directive.d.ts +14 -0
  17. package/components/data-list/option-with-value.directive.d.ts +9 -0
  18. package/components/data-list/option.directive.d.ts +19 -0
  19. package/components/icon/icon.component.d.ts +2 -2
  20. package/components/index.d.ts +2 -3
  21. package/components/input/index.d.ts +2 -0
  22. package/components/input/input.d.ts +5 -0
  23. package/components/input/input.directive.d.ts +30 -0
  24. package/components/label/label.directive.d.ts +1 -1
  25. package/components/link/index.d.ts +0 -1
  26. package/components/link/link.directive.d.ts +8 -6
  27. package/components/loader/loader.options.d.ts +1 -3
  28. package/components/notification/index.d.ts +3 -0
  29. package/components/notification/notification.component.d.ts +14 -0
  30. package/components/notification/notification.d.ts +3 -0
  31. package/components/notification/notification.directive.d.ts +3 -3
  32. package/components/notification/notification.options.d.ts +10 -7
  33. package/components/notification/notification.service.d.ts +17 -0
  34. package/components/root/root.component.d.ts +1 -1
  35. package/components/scrollbar/scroll-ref.directive.d.ts +2 -0
  36. package/components/scrollbar/scrollbar.component.d.ts +1 -5
  37. package/components/spin-button/spin-button.component.d.ts +1 -1
  38. package/components/textfield/index.d.ts +0 -1
  39. package/components/textfield/textfield-multi/textfield-item.component.d.ts +3 -2
  40. package/components/textfield/textfield-multi/textfield-multi.component.d.ts +9 -13
  41. package/components/textfield/textfield.component.d.ts +23 -35
  42. package/components/textfield/textfield.d.ts +2 -3
  43. package/directives/group/group.directive.d.ts +7 -7
  44. package/directives/group/group.options.d.ts +1 -3
  45. package/directives/index.d.ts +0 -5
  46. package/directives/items-handlers/items-handlers.directive.d.ts +5 -9
  47. package/directives/items-handlers/items-handlers.tokens.d.ts +4 -4
  48. package/fesm2022/taiga-ui-core-classes.mjs +8 -10
  49. package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
  50. package/fesm2022/taiga-ui-core-components-button.mjs +6 -6
  51. package/fesm2022/taiga-ui-core-components-calendar.mjs +137 -32
  52. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  53. package/fesm2022/taiga-ui-core-components-cell.mjs +7 -7
  54. package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
  55. package/fesm2022/taiga-ui-core-components-data-list.mjs +109 -271
  56. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  57. package/fesm2022/taiga-ui-core-components-error.mjs +11 -10
  58. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-core-components-expand.mjs +3 -3
  60. package/fesm2022/taiga-ui-core-components-icon.mjs +8 -8
  61. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  62. package/fesm2022/taiga-ui-core-components-input.mjs +103 -0
  63. package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -0
  64. package/fesm2022/taiga-ui-core-components-label.mjs +10 -12
  65. package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
  66. package/fesm2022/taiga-ui-core-components-link.mjs +13 -28
  67. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  68. package/fesm2022/taiga-ui-core-components-loader.mjs +6 -11
  69. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-core-components-notification.mjs +95 -24
  71. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-core-components-root.mjs +7 -8
  73. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-core-components-scrollbar.mjs +42 -48
  75. package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
  76. package/fesm2022/taiga-ui-core-components-spin-button.mjs +5 -5
  77. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  78. package/fesm2022/taiga-ui-core-components-textfield.mjs +102 -257
  79. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  80. package/fesm2022/{taiga-ui-core-directives-title.mjs → taiga-ui-core-components-title.mjs} +7 -7
  81. package/fesm2022/{taiga-ui-core-directives-title.mjs.map → taiga-ui-core-components-title.mjs.map} +1 -1
  82. package/fesm2022/taiga-ui-core-components.mjs +2 -3
  83. package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
  84. package/fesm2022/taiga-ui-core-directives-appearance.mjs +15 -14
  85. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  86. package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
  87. package/fesm2022/taiga-ui-core-directives-group.mjs +22 -34
  88. package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
  89. package/fesm2022/taiga-ui-core-directives-icons.mjs +11 -10
  90. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  91. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +16 -37
  92. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  93. package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
  94. package/fesm2022/taiga-ui-core-directives.mjs +0 -5
  95. package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
  96. package/fesm2022/taiga-ui-core-pipes-format-number.mjs +5 -8
  97. package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
  98. package/fesm2022/taiga-ui-core-pipes.mjs +0 -7
  99. package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
  100. package/fesm2022/taiga-ui-core-portals-alert.mjs +73 -0
  101. package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -0
  102. package/fesm2022/{taiga-ui-core-components-dialog.mjs → taiga-ui-core-portals-dialog.mjs} +15 -15
  103. package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -0
  104. package/fesm2022/{taiga-ui-core-directives-dropdown.mjs → taiga-ui-core-portals-dropdown.mjs} +148 -240
  105. package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -0
  106. package/fesm2022/{taiga-ui-core-directives-hint.mjs → taiga-ui-core-portals-hint.mjs} +49 -50
  107. package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -0
  108. package/fesm2022/{taiga-ui-core-components-modal.mjs → taiga-ui-core-portals-modal.mjs} +10 -10
  109. package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -0
  110. package/fesm2022/{taiga-ui-core-directives-popup.mjs → taiga-ui-core-portals-popup.mjs} +11 -11
  111. package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -0
  112. package/fesm2022/taiga-ui-core-portals.mjs +11 -0
  113. package/fesm2022/taiga-ui-core-portals.mjs.map +1 -0
  114. package/fesm2022/taiga-ui-core-services.mjs +16 -55
  115. package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
  116. package/fesm2022/taiga-ui-core-tokens.mjs +8 -41
  117. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  118. package/fesm2022/taiga-ui-core-utils-format.mjs +1 -23
  119. package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
  120. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +7 -16
  121. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  122. package/fesm2022/taiga-ui-core.mjs +1 -1
  123. package/index.d.ts +1 -1
  124. package/package.json +70 -99
  125. package/pipes/format-number/format-number.pipe.d.ts +1 -1
  126. package/pipes/index.d.ts +0 -7
  127. package/{directives/notification/notification.directive.d.ts → portals/alert/alert.directive.d.ts} +3 -3
  128. package/{directives/notification/notification.service.d.ts → portals/alert/alert.service.d.ts} +3 -3
  129. package/portals/alert/index.d.ts +2 -0
  130. package/{components → portals}/dialog/dialog.service.d.ts +1 -1
  131. package/{directives → portals}/dropdown/dropdown-hover.directive.d.ts +5 -10
  132. package/{directives → portals}/dropdown/dropdown-hover.options.d.ts +1 -3
  133. package/{directives → portals}/dropdown/dropdown-manual.directive.d.ts +2 -2
  134. package/portals/dropdown/dropdown-open.directive.d.ts +30 -0
  135. package/{directives → portals}/dropdown/dropdown-position-sided.directive.d.ts +3 -3
  136. package/{directives → portals}/dropdown/dropdown-position.directive.d.ts +4 -4
  137. package/{directives → portals}/dropdown/dropdown-selection.directive.d.ts +4 -5
  138. package/{directives → portals}/dropdown/dropdown.bindings.d.ts +0 -1
  139. package/{directives → portals}/dropdown/dropdown.d.ts +1 -2
  140. package/{directives → portals}/dropdown/dropdown.directive.d.ts +5 -6
  141. package/{directives → portals}/dropdown/index.d.ts +0 -1
  142. package/{directives → portals}/hint/hint-position.directive.d.ts +1 -1
  143. package/portals/index.d.ts +6 -0
  144. package/services/index.d.ts +0 -2
  145. package/styles/components/link.less +8 -23
  146. package/styles/components/textfield.less +10 -7
  147. package/styles/mixins/appearance.less +1 -1
  148. package/styles/mixins/slider.scss +1 -2
  149. package/tokens/common-icons.d.ts +3 -3
  150. package/tokens/icons.d.ts +0 -4
  151. package/tokens/index.d.ts +0 -4
  152. package/types/index.d.ts +0 -2
  153. package/types/point.d.ts +1 -1
  154. package/types/size.d.ts +0 -11
  155. package/utils/format/index.d.ts +0 -1
  156. package/utils/miscellaneous/get-duration.d.ts +2 -0
  157. package/utils/miscellaneous/index.d.ts +1 -1
  158. package/animations/animations.d.ts +0 -109
  159. package/animations/index.d.ts +0 -1
  160. package/components/alert/alert.component.d.ts +0 -14
  161. package/components/alert/alert.directive.d.ts +0 -8
  162. package/components/alert/alert.interfaces.d.ts +0 -12
  163. package/components/alert/alert.service.d.ts +0 -11
  164. package/components/alert/alert.tokens.d.ts +0 -6
  165. package/components/alert/index.d.ts +0 -5
  166. package/components/data-list/data-list.directive.d.ts +0 -7
  167. package/components/data-list/option/option-content.d.ts +0 -16
  168. package/components/data-list/option/option-legacy.component.d.ts +0 -24
  169. package/components/data-list/option/option.directive.d.ts +0 -27
  170. package/components/link/link.options.d.ts +0 -12
  171. package/components/textfield/textfield.directive.d.ts +0 -35
  172. package/directives/dropdown/dropdown-open-legacy.directive.d.ts +0 -12
  173. package/directives/dropdown/dropdown-open.directive.d.ts +0 -33
  174. package/directives/notification/index.d.ts +0 -2
  175. package/fesm2022/taiga-ui-core-animations.mjs +0 -370
  176. package/fesm2022/taiga-ui-core-animations.mjs.map +0 -1
  177. package/fesm2022/taiga-ui-core-components-alert.mjs +0 -110
  178. package/fesm2022/taiga-ui-core-components-alert.mjs.map +0 -1
  179. package/fesm2022/taiga-ui-core-components-dialog.mjs.map +0 -1
  180. package/fesm2022/taiga-ui-core-components-modal.mjs.map +0 -1
  181. package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +0 -1
  182. package/fesm2022/taiga-ui-core-directives-hint.mjs.map +0 -1
  183. package/fesm2022/taiga-ui-core-directives-notification.mjs +0 -73
  184. package/fesm2022/taiga-ui-core-directives-notification.mjs.map +0 -1
  185. package/fesm2022/taiga-ui-core-directives-popup.mjs.map +0 -1
  186. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -24
  187. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +0 -1
  188. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -93
  189. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +0 -1
  190. package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -31
  191. package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +0 -1
  192. package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -27
  193. package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +0 -1
  194. package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -28
  195. package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +0 -1
  196. package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -29
  197. package/fesm2022/taiga-ui-core-pipes-month.mjs.map +0 -1
  198. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -35
  199. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +0 -1
  200. package/pipes/auto-color/auto-color.pipe.d.ts +0 -7
  201. package/pipes/auto-color/index.d.ts +0 -1
  202. package/pipes/calendar-sheet/index.d.ts +0 -1
  203. package/pipes/calendar-sheet/utils.d.ts +0 -20
  204. package/pipes/flag/flag.pipe.d.ts +0 -14
  205. package/pipes/flag/index.d.ts +0 -1
  206. package/pipes/format-date/format-date.pipe.d.ts +0 -9
  207. package/pipes/format-date/index.d.ts +0 -1
  208. package/pipes/initials/index.d.ts +0 -1
  209. package/pipes/initials/initials.pipe.d.ts +0 -7
  210. package/pipes/month/index.d.ts +0 -1
  211. package/pipes/month/month.pipe.d.ts +0 -10
  212. package/pipes/order-week-days/index.d.ts +0 -1
  213. package/services/dark-theme.service.d.ts +0 -10
  214. package/services/format-date.service.d.ts +0 -8
  215. package/tokens/day-type-handler.d.ts +0 -7
  216. package/tokens/first-day-of-week.d.ts +0 -5
  217. package/tokens/scroll-ref.d.ts +0 -2
  218. package/tokens/spin-icons.d.ts +0 -6
  219. package/types/range-state.d.ts +0 -4
  220. package/types/value-content-context.d.ts +0 -4
  221. package/utils/format/string-hash-to-hsl.d.ts +0 -6
  222. package/utils/miscellaneous/to-animation-options.d.ts +0 -4
  223. /package/{directives → components}/title/index.d.ts +0 -0
  224. /package/{directives → components}/title/title.directive.d.ts +0 -0
  225. /package/{components → portals}/dialog/dialog.component.d.ts +0 -0
  226. /package/{components → portals}/dialog/dialog.directive.d.ts +0 -0
  227. /package/{components → portals}/dialog/dialog.factory.d.ts +0 -0
  228. /package/{components → portals}/dialog/dialog.options.d.ts +0 -0
  229. /package/{components → portals}/dialog/dialog.providers.d.ts +0 -0
  230. /package/{components → portals}/dialog/index.d.ts +0 -0
  231. /package/{directives → portals}/dropdown/dropdown-content.directive.d.ts +0 -0
  232. /package/{directives → portals}/dropdown/dropdown-context.directive.d.ts +0 -0
  233. /package/{directives → portals}/dropdown/dropdown-limit-width.d.ts +0 -0
  234. /package/{directives → portals}/dropdown/dropdown-options.directive.d.ts +0 -0
  235. /package/{directives → portals}/dropdown/dropdown.component.d.ts +0 -0
  236. /package/{directives → portals}/dropdown/dropdown.driver.d.ts +0 -0
  237. /package/{directives → portals}/dropdown/dropdown.providers.d.ts +0 -0
  238. /package/{directives → portals}/dropdown/with-dropdown-open.directive.d.ts +0 -0
  239. /package/{directives → portals}/hint/hint-describe.directive.d.ts +0 -0
  240. /package/{directives → portals}/hint/hint-driver.directive.d.ts +0 -0
  241. /package/{directives → portals}/hint/hint-host.directive.d.ts +0 -0
  242. /package/{directives → portals}/hint/hint-hover.directive.d.ts +0 -0
  243. /package/{directives → portals}/hint/hint-manual.directive.d.ts +0 -0
  244. /package/{directives → portals}/hint/hint-options.directive.d.ts +0 -0
  245. /package/{directives → portals}/hint/hint-overflow.directive.d.ts +0 -0
  246. /package/{directives → portals}/hint/hint-pointer.directive.d.ts +0 -0
  247. /package/{directives → portals}/hint/hint-unstyled.component.d.ts +0 -0
  248. /package/{directives → portals}/hint/hint.component.d.ts +0 -0
  249. /package/{directives → portals}/hint/hint.d.ts +0 -0
  250. /package/{directives → portals}/hint/hint.directive.d.ts +0 -0
  251. /package/{directives → portals}/hint/hint.providers.d.ts +0 -0
  252. /package/{directives → portals}/hint/index.d.ts +0 -0
  253. /package/{components → portals}/modal/index.d.ts +0 -0
  254. /package/{components → portals}/modal/modal.component.d.ts +0 -0
  255. /package/{components → portals}/modal/modal.service.d.ts +0 -0
  256. /package/{directives → portals}/popup/index.d.ts +0 -0
  257. /package/{directives → portals}/popup/popup.directive.d.ts +0 -0
  258. /package/{directives → portals}/popup/popup.service.d.ts +0 -0
  259. /package/{directives → portals}/popup/popups.component.d.ts +0 -0
@@ -1,29 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ContentChild, Directive, ViewContainerRef, forwardRef, createComponent, INJECTOR, EnvironmentInjector, Input, signal, ChangeDetectionStrategy, Component, NgZone, DestroyRef, ChangeDetectorRef, isSignal, ContentChildren, ViewEncapsulation } from '@angular/core';
3
- import { toSignal } from '@angular/core/rxjs-interop';
4
- import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
5
- import { tuiQueryListChanges, tuiZonefree, tuiTakeUntilDestroyed } from '@taiga-ui/cdk/observables';
2
+ import { InjectionToken, inject, ContentChild, Directive, input, NgZone, DestroyRef, ChangeDetectorRef, contentChildren, forwardRef, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewContainerRef, createComponent, INJECTOR, EnvironmentInjector } from '@angular/core';
3
+ import { tuiZonefree, tuiTakeUntilDestroyed } from '@taiga-ui/cdk/observables';
6
4
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
7
- import { tuiIsFocused, tuiMoveFocus, tuiIsFocusedIn } from '@taiga-ui/cdk/utils/focus';
8
- import { tuiProvide, tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
9
- import { tuiAsAuxiliary, TUI_NOTHING_FOUND_MESSAGE } from '@taiga-ui/core/tokens';
5
+ import { tuiMoveFocus, tuiIsFocusedIn, tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
6
+ import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
7
+ import * as i2 from '@taiga-ui/core/components/cell';
8
+ import { TuiCell, tuiCellOptionsProvider } from '@taiga-ui/core/components/cell';
9
+ import { TUI_NOTHING_FOUND_MESSAGE, tuiAsAuxiliary } from '@taiga-ui/core/tokens';
10
10
  import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
11
- import { ReplaySubject, switchMap, combineLatest, map, startWith, timer } from 'rxjs';
11
+ import { timer } from 'rxjs';
12
+ import { tuiProvide } from '@taiga-ui/cdk/utils/di';
12
13
  import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
13
- import { TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
14
14
  import * as i1 from '@taiga-ui/core/directives/icons';
15
15
  import { TuiWithIcons } from '@taiga-ui/core/directives/icons';
16
+ import { TuiDropdownDirective } from '@taiga-ui/core/portals/dropdown';
16
17
 
17
- /**
18
- * Accessor for data-list options
19
- */
20
- const TUI_DATA_LIST_ACCESSOR = new InjectionToken(ngDevMode ? 'TUI_DATA_LIST_ACCESSOR' : '');
21
- function tuiAsDataListAccessor(accessor) {
22
- return [tuiProvide(TUI_DATA_LIST_ACCESSOR, accessor), tuiAsAuxiliary(accessor)];
23
- }
24
- /**
25
- * DataList controller
26
- */
27
18
  const TUI_DATA_LIST_HOST = new InjectionToken(ngDevMode ? 'TUI_DATA_LIST_HOST' : '');
28
19
  function tuiAsDataListHost(host) {
29
20
  return tuiProvide(TUI_DATA_LIST_HOST, host);
@@ -34,200 +25,47 @@ function tuiAsDataListHost(host) {
34
25
  */
35
26
  const TUI_OPTION_CONTENT = new InjectionToken(ngDevMode ? 'TUI_OPTION_CONTENT' : '');
36
27
  function tuiAsOptionContent(useValue) {
37
- return {
38
- provide: TUI_OPTION_CONTENT,
39
- useValue,
40
- };
28
+ return { provide: TUI_OPTION_CONTENT, useValue };
41
29
  }
42
30
  class TuiWithOptionContent {
43
31
  constructor() {
44
- this.localContent = null;
45
- this.globalContent = inject(TUI_OPTION_CONTENT, {
46
- optional: true,
47
- });
32
+ this.local = null;
33
+ this.global = inject(TUI_OPTION_CONTENT, { optional: true });
48
34
  }
49
35
  get content() {
50
- return this.globalContent ?? this.localContent;
36
+ return this.global ?? this.local;
51
37
  }
52
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiWithOptionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
53
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiWithOptionContent, isStandalone: true, queries: [{ propertyName: "localContent", first: true, predicate: TUI_OPTION_CONTENT, descendants: true }], ngImport: i0 }); }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithOptionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
39
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiWithOptionContent, isStandalone: true, queries: [{ propertyName: "local", first: true, predicate: TUI_OPTION_CONTENT, descendants: true }], ngImport: i0 }); }
54
40
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiWithOptionContent, decorators: [{
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithOptionContent, decorators: [{
56
42
  type: Directive
57
- }], propDecorators: { localContent: [{
43
+ }], propDecorators: { local: [{
58
44
  type: ContentChild,
59
45
  args: [TUI_OPTION_CONTENT, { descendants: true }]
60
46
  }] } });
61
47
 
62
- // TODO(v5): rename `TuiOptionNew` => `TuiOption` & remove [new] from selector
63
- // TODO: Consider all use cases for aria roles
64
- class TuiOptionNew {
65
- constructor() {
66
- this.vcr = inject(ViewContainerRef);
67
- this.isMobile = inject(TUI_IS_MOBILE);
68
- this.el = tuiInjectElement();
69
- this.dataList = inject(forwardRef(() => TuiDataListComponent), { optional: true });
70
- this.content = inject(TUI_OPTION_CONTENT, {
71
- optional: true,
72
- });
73
- this.ref = this.content &&
74
- createComponent(this.content, {
75
- environmentInjector: inject(EnvironmentInjector),
76
- elementInjector: inject(INJECTOR),
77
- hostElement: tuiInjectElement(),
78
- });
79
- this.dropdown = inject(TuiDropdownDirective, {
80
- self: true,
81
- optional: true,
82
- })?.ref;
83
- this.disabled = false;
84
- if (this.ref) {
85
- this.vcr.insert(this.ref.hostView);
86
- this.ref.changeDetectorRef.detectChanges();
87
- }
88
- }
89
- // Preventing focus loss upon focused option removal
90
- ngOnDestroy() {
91
- this.dataList?.handleFocusLossIfNecessary(this.el);
92
- }
93
- onMouseMove() {
94
- if (!this.isMobile &&
95
- !tuiIsFocused(this.el) &&
96
- this.dataList &&
97
- this.el.closest('[tuiDataListDropdownManager]')) {
98
- this.el.focus({ preventScroll: true });
99
- }
100
- }
101
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptionNew, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
102
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiOptionNew, isStandalone: true, selector: "button[tuiOption][new], a[tuiOption][new], label[tuiOption][new]", inputs: { disabled: "disabled" }, host: { attributes: { "type": "button", "role": "option" }, listeners: { "mousemove.zoneless": "onMouseMove()" }, properties: { "attr.disabled": "disabled || null", "class._with-dropdown": "dropdown?.()" } }, hostDirectives: [{ directive: i1.TuiWithIcons }], ngImport: i0 }); }
103
- }
104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptionNew, decorators: [{
105
- type: Directive,
106
- args: [{
107
- selector: 'button[tuiOption][new], a[tuiOption][new], label[tuiOption][new]',
108
- hostDirectives: [TuiWithIcons],
109
- host: {
110
- type: 'button',
111
- role: 'option',
112
- '[attr.disabled]': 'disabled || null',
113
- '[class._with-dropdown]': 'dropdown?.()',
114
- '(mousemove.zoneless)': 'onMouseMove()',
115
- },
116
- }]
117
- }], ctorParameters: () => [], propDecorators: { disabled: [{
118
- type: Input
119
- }] } });
120
- // TODO(v5): remove [new] from selector
121
48
  class TuiOptionWithValue {
122
49
  constructor() {
123
- this.host = inject(TUI_DATA_LIST_HOST, {
124
- optional: true,
125
- });
126
- this.disabled = false;
127
- this.value = signal(undefined);
128
- }
129
- // TODO(v5): use `input.required<T>()` to remove `undefined` from `this.value()`
130
- set valueSetter(x) {
131
- this.value.set(x);
50
+ this.host = inject(TUI_DATA_LIST_HOST, { optional: true });
51
+ this.disabled = input(false);
52
+ this.value = input();
132
53
  }
133
54
  onClick(value = this.value()) {
134
- if (this.host?.handleOption && value !== undefined) {
135
- this.host.handleOption(value);
55
+ if (value !== undefined) {
56
+ this.host?.handleOption?.(value);
136
57
  }
137
58
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptionWithValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
139
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiOptionWithValue, isStandalone: true, selector: "button[tuiOption][value][new], a[tuiOption][value][new], label[tuiOption][value][new]", inputs: { disabled: "disabled", valueSetter: ["value", "valueSetter"] }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptionWithValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiOptionWithValue, isStandalone: true, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
140
61
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptionWithValue, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptionWithValue, decorators: [{
142
63
  type: Directive,
143
64
  args: [{
144
- selector: 'button[tuiOption][value][new], a[tuiOption][value][new], label[tuiOption][value][new]',
145
- host: {
146
- '(click)': 'onClick()',
147
- },
65
+ selector: 'button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]',
66
+ host: { '(click)': 'onClick()' },
148
67
  }]
149
- }], propDecorators: { disabled: [{
150
- type: Input
151
- }], valueSetter: [{
152
- type: Input,
153
- args: [{ alias: 'value', required: true }]
154
- }] } });
155
-
156
- /**
157
- * TODO(v5): delete
158
- * @deprecated use `<button tuiOption new />` / `<a tuiOption new /> / `<label tuiOption new /> instead
159
- */
160
- class TuiOption {
161
- constructor() {
162
- this.isMobile = inject(TUI_IS_MOBILE);
163
- this.el = tuiInjectElement();
164
- this.dataList = inject(forwardRef(() => TuiDataListComponent), { optional: true });
165
- this.host = inject(TUI_DATA_LIST_HOST, {
166
- optional: true,
167
- });
168
- this.content = inject(TUI_OPTION_CONTENT, { optional: true });
169
- this.dropdown = inject(TuiDropdownDirective, {
170
- self: true,
171
- optional: true,
172
- })?.ref;
173
- this.disabled = false;
174
- }
175
- // Preventing focus loss upon focused option removal
176
- ngOnDestroy() {
177
- this.dataList?.handleFocusLossIfNecessary(this.el);
178
- }
179
- onClick() {
180
- if (this.host?.handleOption && this.value !== undefined) {
181
- this.host.handleOption(this.value);
182
- }
183
- }
184
- onMouseMove() {
185
- if (!this.isMobile &&
186
- !tuiIsFocused(this.el) &&
187
- this.dataList &&
188
- this.el.closest('[tuiDataListDropdownManager]')) {
189
- this.el.focus({ preventScroll: true });
190
- }
191
- }
192
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
193
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiOption, isStandalone: true, selector: "button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])", inputs: { disabled: "disabled", value: "value" }, host: { attributes: { "type": "button", "role": "option" }, listeners: { "click": "onClick()", "mousemove.zoneless": "onMouseMove()" }, properties: { "attr.disabled": "disabled || null", "class._with-dropdown": "dropdown?.()" } }, hostDirectives: [{ directive: i1.TuiWithIcons }], ngImport: i0, template: `
194
- <ng-container *polymorpheusOutlet="content || t as text; context: {$implicit: t}">
195
- {{ text }}
196
- </ng-container>
197
- <ng-template #t>
198
- <ng-content />
199
- </ng-template>
200
- `, isInline: true, dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
201
- }
202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOption, decorators: [{
203
- type: Component,
204
- args: [{
205
- selector: 'button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])',
206
- imports: [PolymorpheusOutlet],
207
- template: `
208
- <ng-container *polymorpheusOutlet="content || t as text; context: {$implicit: t}">
209
- {{ text }}
210
- </ng-container>
211
- <ng-template #t>
212
- <ng-content />
213
- </ng-template>
214
- `,
215
- changeDetection: ChangeDetectionStrategy.OnPush,
216
- hostDirectives: [TuiWithIcons],
217
- host: {
218
- type: 'button',
219
- role: 'option',
220
- '[attr.disabled]': 'disabled || null',
221
- '[class._with-dropdown]': 'dropdown?.()',
222
- '(click)': 'onClick()',
223
- '(mousemove.zoneless)': 'onMouseMove()',
224
- },
225
- }]
226
- }], propDecorators: { disabled: [{
227
- type: Input
228
- }], value: [{
229
- type: Input
230
- }] } });
68
+ }] });
231
69
 
232
70
  function tuiInjectDataListSize() {
233
71
  const sizes = ['s', 'm', 'l'];
@@ -237,25 +75,18 @@ function tuiInjectDataListSize() {
237
75
  // TODO: Consider aria-activedescendant for proper accessibility implementation
238
76
  class TuiDataListComponent {
239
77
  constructor() {
240
- // TODO(v5): delete
241
- this.legacyOptionsQuery = EMPTY_QUERY;
242
- this.optionsQuery = EMPTY_QUERY;
243
78
  this.ngZone = inject(NgZone);
244
79
  this.destroyRef = inject(DestroyRef);
245
80
  this.el = tuiInjectElement();
246
81
  this.cdr = inject(ChangeDetectorRef);
247
- this.contentReady$ = new ReplaySubject(1);
82
+ this.optionsQuery = contentChildren(forwardRef(() => TuiOptionWithValue), { descendants: true });
248
83
  this.fallback = inject(TUI_NOTHING_FOUND_MESSAGE);
249
84
  this.empty = signal(false);
250
- this.size = tuiInjectDataListSize();
251
- // TODO(v5): use signal `contentChildren`
252
- this.options = toSignal(this.contentReady$.pipe(switchMap(() => combineLatest([
253
- tuiQueryListChanges(this.legacyOptionsQuery),
254
- tuiQueryListChanges(this.optionsQuery),
255
- ])), map(([legacyOptions, options]) => [
256
- ...legacyOptions.map(({ value }) => value),
257
- ...options.map(({ value }) => value()),
258
- ].filter(tuiIsPresent)), startWith([])), { requireSync: true });
85
+ this.emptyContent = input();
86
+ this.size = input(tuiInjectDataListSize());
87
+ this.options = computed(() => this.optionsQuery()
88
+ .map(({ value }) => value())
89
+ .filter(tuiIsPresent));
259
90
  }
260
91
  onKeyDownArrow(current, step) {
261
92
  const { elements } = this;
@@ -266,9 +97,6 @@ class TuiDataListComponent {
266
97
  this.origin?.focus({ preventScroll: true });
267
98
  }
268
99
  }
269
- ngAfterContentInit() {
270
- this.contentReady$.next(true);
271
- }
272
100
  // TODO: Refactor to :has after Safari support bumped to 15
273
101
  ngAfterContentChecked() {
274
102
  timer(0)
@@ -278,58 +106,38 @@ class TuiDataListComponent {
278
106
  this.cdr.detectChanges();
279
107
  });
280
108
  }
281
- // TODO(v5): delete
282
- getOptions(includeDisabled = false) {
283
- return [
284
- ...this.legacyOptionsQuery, // TODO(v5): delete
285
- ...this.optionsQuery,
286
- ]
287
- .filter(({ disabled }) => includeDisabled || !disabled)
288
- .map(({ value }) => (isSignal(value) ? value() : value))
289
- .filter(tuiIsPresent);
290
- }
291
109
  onFocusIn(relatedTarget, currentTarget) {
292
110
  if (!currentTarget.contains(relatedTarget) && !this.origin) {
293
111
  this.origin = relatedTarget;
294
112
  }
295
113
  }
296
114
  get elements() {
297
- return Array.from(this.el.querySelectorAll('[tuiOption]'));
115
+ return Array.from(this.el.querySelectorAll('[tuiOption]:not(.t-empty)'));
298
116
  }
299
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDataListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
300
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiDataListComponent, isStandalone: true, selector: "tui-data-list", inputs: { emptyContent: "emptyContent", size: "size" }, host: { attributes: { "role": "listbox" }, listeners: { "focusin": "onFocusIn($event.relatedTarget, $event.currentTarget)", "mousedown.prevent": "(0)", "wheel.zoneless.passive": "handleFocusLossIfNecessary()", "mouseleave": "handleFocusLossIfNecessary($event.target)", "keydown.tab": "handleFocusLossIfNecessary()", "keydown.shift.tab": "handleFocusLossIfNecessary()", "keydown.arrowDown.prevent": "onKeyDownArrow($event.target, 1)", "keydown.arrowUp.prevent": "onKeyDownArrow($event.target, -1)" }, properties: { "attr.data-size": "size" } }, providers: [
301
- tuiAsDataListAccessor(TuiDataListComponent),
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDataListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
118
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiDataListComponent, isStandalone: true, selector: "tui-data-list", inputs: { emptyContent: { classPropertyName: "emptyContent", publicName: "emptyContent", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "listbox" }, listeners: { "focusin": "onFocusIn($event.relatedTarget, $event.currentTarget)", "mousedown.prevent": "(0)", "wheel.zoneless.passive": "handleFocusLossIfNecessary()", "mouseleave": "handleFocusLossIfNecessary($event.target)", "keydown.tab": "handleFocusLossIfNecessary()", "keydown.shift.tab": "handleFocusLossIfNecessary()", "keydown.arrowDown.prevent": "onKeyDownArrow($event.target, 1)", "keydown.arrowUp.prevent": "onKeyDownArrow($event.target, -1)" }, properties: { "attr.data-size": "size()" } }, providers: [
119
+ tuiCellOptionsProvider(() => ({ size: inject(TuiDataListComponent).size() })),
120
+ tuiAsAuxiliary(TuiDataListComponent),
302
121
  {
303
122
  provide: TUI_OPTION_CONTENT,
304
123
  useFactory: () => inject(TuiWithOptionContent, { optional: true })?.content ??
305
- // TODO(v5): remove when all legacy controls are deleted
306
- inject(TUI_OPTION_CONTENT, {
307
- host: true,
308
- skipSelf: true,
309
- optional: true,
310
- }) ??
311
124
  inject(TUI_OPTION_CONTENT, { skipSelf: true, optional: true }),
312
125
  },
313
- ], queries: [{ propertyName: "legacyOptionsQuery", predicate: i0.forwardRef(() => TuiOption), descendants: true }, { propertyName: "optionsQuery", predicate: i0.forwardRef(() => TuiOptionWithValue), descendants: true }], ngImport: i0, template: "<ng-content />\n@if (empty()) {\n <div class=\"t-empty\">\n <ng-container *polymorpheusOutlet=\"emptyContent || fallback() as text\">\n {{ text }}\n </ng-container>\n </div>\n}\n", styles: ["tui-data-list{--tui-data-list-padding: .25rem;--tui-data-list-margin: .0625rem;display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding);color:var(--tui-text-tertiary)}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[data-size=s]{--tui-data-list-margin: 0rem}tui-data-list[data-size=s] [tuiOption][new]:not([tuiCell]){gap:.5rem}tui-data-list[data-size=s]>.t-empty,tui-data-list[data-size=s] [tuiOption]{--t-option-padding-inline: .375rem;font:var(--tui-font-text-s);min-block-size:2rem;padding-block-start:.3125rem;padding-block-end:.3125rem}tui-data-list[data-size=s]>.t-empty:before,tui-data-list[data-size=s] [tuiOption]:before{font-size:1rem}tui-data-list[data-size=m] [tuiOption][new]:not([tuiCell]){gap:.75rem}tui-data-list[data-size=m]>.t-empty,tui-data-list[data-size=m] [tuiOption]{--t-option-padding-inline: .5rem;font:var(--tui-font-text-s);min-block-size:2.5rem;padding-block-start:.375rem;padding-block-end:.375rem}tui-data-list[data-size=l]{--tui-data-list-padding: .375rem;--tui-data-list-margin: .125rem}tui-data-list[data-size=l] [tuiOption][new]:not([tuiCell]){gap:1rem}tui-data-list[data-size=l]>.t-empty,tui-data-list[data-size=l] [tuiOption]{--t-option-padding-inline: .625rem;font:var(--tui-font-text-m);min-block-size:2.75rem;padding-block-start:.375rem;padding-block-end:.375rem}tui-data-list>.t-empty{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0}tui-data-list [tuiOption]:not([new]){justify-content:space-between}tui-data-list [tuiOption]{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;text-align:start;color:var(--tui-text-primary);border-radius:var(--tui-radius-s);outline:none;cursor:pointer;word-break:break-word;background-clip:padding-box}tui-data-list [tuiOption]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}@media (hover: hover) and (pointer: fine){tui-data-list [tuiOption]:hover:not(:disabled){background-color:var(--tui-background-neutral-1)}}tui-data-list [tuiOption]:active:not(:disabled),tui-data-list [tuiOption]:focus-within,tui-data-list [tuiOption]._with-dropdown{background-color:var(--tui-background-neutral-1)}tui-data-list [tuiOption]:not([new]):before{margin-inline-end:.5rem}tui-data-list [tuiOption]:after{font-size:1rem;margin:0 -.625rem 0 auto;border-inline-start:.5rem solid;border-inline-end:.5rem solid}tui-data-list>.t-empty,tui-data-list [tuiOption]{padding-inline-start:var(--t-option-padding-inline);padding-inline-end:var(--t-option-padding-inline)}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);font-weight:700;color:var(--tui-text-primary);flex-direction:column;line-height:1rem}tui-data-list[data-size=l] tui-opt-group{font:var(--tui-font-text-m);font-weight:700;line-height:1.25rem}tui-data-list[data-size=l] tui-opt-group:before{padding-inline-start:.625rem;padding-inline-end:.625rem}tui-data-list[data-size=l] tui-opt-group:after{left:.625rem;right:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem var(--tui-data-list-padding);margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-sheet-dialog tui-opt-group:before{font:var(--tui-font-heading-6);padding:.5rem 0!important;margin:0}tui-opt-group:after{position:absolute;left:.5rem;right:.5rem;top:var(--tui-data-list-padding);block-size:1px;background:var(--tui-border-normal)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-block-start:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before,tui-opt-group:not(:empty)~tui-opt-group:not([data-label]):before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before,tui-opt-group:not([data-label]):before{content:\"\";padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
126
+ ], queries: [{ propertyName: "optionsQuery", predicate: i0.forwardRef(() => TuiOptionWithValue), descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content />\n@if (empty()) {\n <!-- tuiOption selector purely for cosmetics, do not import -->\n <span\n tuiCell\n tuiOption\n class=\"t-empty\"\n >\n <ng-container *polymorpheusOutlet=\"emptyContent() || fallback() as text\">\n {{ text }}\n </ng-container>\n </span>\n}\n", styles: ["tui-data-list{display:flex;flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding)}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background:transparent}tui-data-list[data-size=s]{--tui-data-list-margin: 0rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=s] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2rem;padding:.3125rem .375rem}tui-data-list[data-size=s] [tuiOption]:before{font-size:1rem}tui-data-list[data-size=m]{--tui-data-list-margin: .0625rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=m] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2.5rem;padding:.375rem .5rem}tui-data-list[data-size=l]{--tui-data-list-margin: .125rem;--tui-data-list-padding: .375rem}tui-data-list[data-size=l] [tuiOption]{font:var(--tui-font-text-m);min-block-size:2.75rem;padding:.375rem .625rem}tui-data-list [tuiOption]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;border-radius:var(--tui-radius-s);outline:none!important;cursor:pointer;word-break:break-word}tui-data-list [tuiOption]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}@media (hover: hover) and (pointer: fine){tui-data-list [tuiOption]:hover:not(:disabled){background:var(--tui-background-neutral-1)}}tui-data-list [tuiOption]:active:not(:disabled),tui-data-list [tuiOption]:focus-within,tui-data-list [tuiOption]._with-dropdown{background:var(--tui-background-neutral-1)}tui-data-list [tuiOption]:after{font-size:1rem;margin-inline:auto -.625rem;border-inline:.5rem solid}tui-data-list>.t-empty{pointer-events:none;color:var(--tui-text-tertiary)}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);font-weight:700;color:var(--tui-text-primary);flex-direction:column;line-height:1rem}tui-data-list[data-size=s] tui-opt-group:before{padding-inline:.375rem}tui-data-list[data-size=l] tui-opt-group{font:var(--tui-font-text-m);font-weight:700;line-height:1.25rem}tui-data-list[data-size=l] tui-opt-group:before{padding-inline:.625rem}tui-data-list[data-size=l] tui-opt-group:after{inset-inline:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem;margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-sheet-dialog tui-opt-group:before{font:var(--tui-font-heading-6);padding:.5rem 0!important;margin:0}tui-opt-group:after{position:absolute;top:var(--tui-data-list-padding);inset-inline:.5rem;block-size:1px;background:var(--tui-border-normal)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-block-start:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before{content:\"\";padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiCell, selector: "[tuiCell]:not(ng-template)", inputs: ["tuiCell", "tuiCellHeight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
314
127
  }
315
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDataListComponent, decorators: [{
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDataListComponent, decorators: [{
316
129
  type: Component,
317
- args: [{ selector: 'tui-data-list', imports: [PolymorpheusOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
318
- tuiAsDataListAccessor(TuiDataListComponent),
130
+ args: [{ selector: 'tui-data-list', imports: [PolymorpheusOutlet, TuiCell], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
131
+ tuiCellOptionsProvider(() => ({ size: inject(TuiDataListComponent).size() })),
132
+ tuiAsAuxiliary(TuiDataListComponent),
319
133
  {
320
134
  provide: TUI_OPTION_CONTENT,
321
135
  useFactory: () => inject(TuiWithOptionContent, { optional: true })?.content ??
322
- // TODO(v5): remove when all legacy controls are deleted
323
- inject(TUI_OPTION_CONTENT, {
324
- host: true,
325
- skipSelf: true,
326
- optional: true,
327
- }) ??
328
136
  inject(TUI_OPTION_CONTENT, { skipSelf: true, optional: true }),
329
137
  },
330
138
  ], host: {
331
139
  role: 'listbox',
332
- '[attr.data-size]': 'size',
140
+ '[attr.data-size]': 'size()',
333
141
  '(focusin)': 'onFocusIn($event.relatedTarget, $event.currentTarget)',
334
142
  '(mousedown.prevent)': '(0)',
335
143
  '(wheel.zoneless.passive)': 'handleFocusLossIfNecessary()',
@@ -338,55 +146,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
338
146
  '(keydown.shift.tab)': 'handleFocusLossIfNecessary()',
339
147
  '(keydown.arrowDown.prevent)': 'onKeyDownArrow($event.target, 1)',
340
148
  '(keydown.arrowUp.prevent)': 'onKeyDownArrow($event.target, -1)',
341
- }, template: "<ng-content />\n@if (empty()) {\n <div class=\"t-empty\">\n <ng-container *polymorpheusOutlet=\"emptyContent || fallback() as text\">\n {{ text }}\n </ng-container>\n </div>\n}\n", styles: ["tui-data-list{--tui-data-list-padding: .25rem;--tui-data-list-margin: .0625rem;display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding);color:var(--tui-text-tertiary)}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[data-size=s]{--tui-data-list-margin: 0rem}tui-data-list[data-size=s] [tuiOption][new]:not([tuiCell]){gap:.5rem}tui-data-list[data-size=s]>.t-empty,tui-data-list[data-size=s] [tuiOption]{--t-option-padding-inline: .375rem;font:var(--tui-font-text-s);min-block-size:2rem;padding-block-start:.3125rem;padding-block-end:.3125rem}tui-data-list[data-size=s]>.t-empty:before,tui-data-list[data-size=s] [tuiOption]:before{font-size:1rem}tui-data-list[data-size=m] [tuiOption][new]:not([tuiCell]){gap:.75rem}tui-data-list[data-size=m]>.t-empty,tui-data-list[data-size=m] [tuiOption]{--t-option-padding-inline: .5rem;font:var(--tui-font-text-s);min-block-size:2.5rem;padding-block-start:.375rem;padding-block-end:.375rem}tui-data-list[data-size=l]{--tui-data-list-padding: .375rem;--tui-data-list-margin: .125rem}tui-data-list[data-size=l] [tuiOption][new]:not([tuiCell]){gap:1rem}tui-data-list[data-size=l]>.t-empty,tui-data-list[data-size=l] [tuiOption]{--t-option-padding-inline: .625rem;font:var(--tui-font-text-m);min-block-size:2.75rem;padding-block-start:.375rem;padding-block-end:.375rem}tui-data-list>.t-empty{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0}tui-data-list [tuiOption]:not([new]){justify-content:space-between}tui-data-list [tuiOption]{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;text-align:start;color:var(--tui-text-primary);border-radius:var(--tui-radius-s);outline:none;cursor:pointer;word-break:break-word;background-clip:padding-box}tui-data-list [tuiOption]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}@media (hover: hover) and (pointer: fine){tui-data-list [tuiOption]:hover:not(:disabled){background-color:var(--tui-background-neutral-1)}}tui-data-list [tuiOption]:active:not(:disabled),tui-data-list [tuiOption]:focus-within,tui-data-list [tuiOption]._with-dropdown{background-color:var(--tui-background-neutral-1)}tui-data-list [tuiOption]:not([new]):before{margin-inline-end:.5rem}tui-data-list [tuiOption]:after{font-size:1rem;margin:0 -.625rem 0 auto;border-inline-start:.5rem solid;border-inline-end:.5rem solid}tui-data-list>.t-empty,tui-data-list [tuiOption]{padding-inline-start:var(--t-option-padding-inline);padding-inline-end:var(--t-option-padding-inline)}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);font-weight:700;color:var(--tui-text-primary);flex-direction:column;line-height:1rem}tui-data-list[data-size=l] tui-opt-group{font:var(--tui-font-text-m);font-weight:700;line-height:1.25rem}tui-data-list[data-size=l] tui-opt-group:before{padding-inline-start:.625rem;padding-inline-end:.625rem}tui-data-list[data-size=l] tui-opt-group:after{left:.625rem;right:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem var(--tui-data-list-padding);margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-sheet-dialog tui-opt-group:before{font:var(--tui-font-heading-6);padding:.5rem 0!important;margin:0}tui-opt-group:after{position:absolute;left:.5rem;right:.5rem;top:var(--tui-data-list-padding);block-size:1px;background:var(--tui-border-normal)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-block-start:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before,tui-opt-group:not(:empty)~tui-opt-group:not([data-label]):before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before,tui-opt-group:not([data-label]):before{content:\"\";padding:0;margin:0}\n"] }]
342
- }], propDecorators: { legacyOptionsQuery: [{
343
- type: ContentChildren,
344
- args: [forwardRef(() => TuiOption), { descendants: true }]
345
- }], optionsQuery: [{
346
- type: ContentChildren,
347
- args: [forwardRef(() => TuiOptionWithValue), { descendants: true }]
348
- }], emptyContent: [{
349
- type: Input
350
- }], size: [{
351
- type: Input
352
- }] } });
149
+ }, template: "<ng-content />\n@if (empty()) {\n <!-- tuiOption selector purely for cosmetics, do not import -->\n <span\n tuiCell\n tuiOption\n class=\"t-empty\"\n >\n <ng-container *polymorpheusOutlet=\"emptyContent() || fallback() as text\">\n {{ text }}\n </ng-container>\n </span>\n}\n", styles: ["tui-data-list{display:flex;flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding)}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background:transparent}tui-data-list[data-size=s]{--tui-data-list-margin: 0rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=s] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2rem;padding:.3125rem .375rem}tui-data-list[data-size=s] [tuiOption]:before{font-size:1rem}tui-data-list[data-size=m]{--tui-data-list-margin: .0625rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=m] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2.5rem;padding:.375rem .5rem}tui-data-list[data-size=l]{--tui-data-list-margin: .125rem;--tui-data-list-padding: .375rem}tui-data-list[data-size=l] [tuiOption]{font:var(--tui-font-text-m);min-block-size:2.75rem;padding:.375rem .625rem}tui-data-list [tuiOption]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;border-radius:var(--tui-radius-s);outline:none!important;cursor:pointer;word-break:break-word}tui-data-list [tuiOption]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}@media (hover: hover) and (pointer: fine){tui-data-list [tuiOption]:hover:not(:disabled){background:var(--tui-background-neutral-1)}}tui-data-list [tuiOption]:active:not(:disabled),tui-data-list [tuiOption]:focus-within,tui-data-list [tuiOption]._with-dropdown{background:var(--tui-background-neutral-1)}tui-data-list [tuiOption]:after{font-size:1rem;margin-inline:auto -.625rem;border-inline:.5rem solid}tui-data-list>.t-empty{pointer-events:none;color:var(--tui-text-tertiary)}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);font-weight:700;color:var(--tui-text-primary);flex-direction:column;line-height:1rem}tui-data-list[data-size=s] tui-opt-group:before{padding-inline:.375rem}tui-data-list[data-size=l] tui-opt-group{font:var(--tui-font-text-m);font-weight:700;line-height:1.25rem}tui-data-list[data-size=l] tui-opt-group:before{padding-inline:.625rem}tui-data-list[data-size=l] tui-opt-group:after{inset-inline:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem;margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-sheet-dialog tui-opt-group:before{font:var(--tui-font-heading-6);padding:.5rem 0!important;margin:0}tui-opt-group:after{position:absolute;top:var(--tui-data-list-padding);inset-inline:.5rem;block-size:1px;background:var(--tui-border-normal)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-block-start:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before{content:\"\";padding:0;margin:0}\n"] }]
150
+ }] });
353
151
 
354
- class TuiDataListDirective {
355
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDataListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
356
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiDataListDirective, isStandalone: true, selector: "ng-template[tuiDataList]", ngImport: i0 }); }
152
+ class TuiOptGroup {
153
+ constructor() {
154
+ this.label = input();
155
+ }
156
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
157
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiOptGroup, isStandalone: true, selector: "tui-opt-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.data-label": "label() || \"\"" } }, ngImport: i0 }); }
357
158
  }
358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDataListDirective, decorators: [{
159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptGroup, decorators: [{
359
160
  type: Directive,
360
161
  args: [{
361
- selector: 'ng-template[tuiDataList]',
162
+ selector: 'tui-opt-group',
163
+ host: {
164
+ role: 'group',
165
+ '[attr.data-label]': 'label() || ""',
166
+ },
362
167
  }]
363
168
  }] });
364
- function tuiAsDataList(list) {
365
- return tuiProvide(TuiDataListDirective, list);
366
- }
367
169
 
368
- class TuiOptGroup {
369
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
370
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiOptGroup, isStandalone: true, selector: "tui-opt-group", inputs: { label: "label" }, host: { attributes: { "role": "group" }, properties: { "attr.data-label": "label" } }, ngImport: i0 }); }
170
+ class TuiOption {
171
+ constructor() {
172
+ this.vcr = inject(ViewContainerRef);
173
+ this.isMobile = inject(TUI_IS_MOBILE);
174
+ this.el = tuiInjectElement();
175
+ this.datalist = inject(forwardRef(() => TuiDataListComponent), { optional: true });
176
+ this.content = inject(TUI_OPTION_CONTENT, {
177
+ optional: true,
178
+ });
179
+ this.ref = this.content &&
180
+ createComponent(this.content, {
181
+ environmentInjector: inject(EnvironmentInjector),
182
+ elementInjector: inject(INJECTOR),
183
+ hostElement: tuiInjectElement(),
184
+ });
185
+ this.dropdown = inject(TuiDropdownDirective, {
186
+ self: true,
187
+ optional: true,
188
+ })?.ref;
189
+ this.disabled = input(false);
190
+ if (this.ref) {
191
+ this.vcr.insert(this.ref.hostView);
192
+ this.ref.changeDetectorRef.detectChanges();
193
+ }
194
+ }
195
+ // Preventing focus loss upon focused option removal
196
+ ngOnDestroy() {
197
+ this.datalist?.handleFocusLossIfNecessary(this.el);
198
+ }
199
+ onMouseMove() {
200
+ if (!this.isMobile &&
201
+ !tuiIsFocused(this.el) &&
202
+ this.datalist &&
203
+ this.el.closest('[tuiDataListDropdownManager]')) {
204
+ this.el.focus({ preventScroll: true });
205
+ }
206
+ }
207
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
208
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiOption, isStandalone: true, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "option" }, listeners: { "mousemove.zoneless": "onMouseMove()" }, properties: { "attr.disabled": "disabled() || null", "class._with-dropdown": "dropdown?.()" } }, hostDirectives: [{ directive: i1.TuiWithIcons }, { directive: i2.TuiCell }], ngImport: i0 }); }
371
209
  }
372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptGroup, decorators: [{
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOption, decorators: [{
373
211
  type: Directive,
374
212
  args: [{
375
- selector: 'tui-opt-group',
213
+ selector: 'button[tuiOption], a[tuiOption], label[tuiOption]',
214
+ hostDirectives: [TuiWithIcons, TuiCell],
376
215
  host: {
377
- role: 'group',
378
- '[attr.data-label]': 'label',
216
+ type: 'button',
217
+ role: 'option',
218
+ '[attr.disabled]': 'disabled() || null',
219
+ '[class._with-dropdown]': 'dropdown?.()',
220
+ '(mousemove.zoneless)': 'onMouseMove()',
379
221
  },
380
222
  }]
381
- }], propDecorators: { label: [{
382
- type: Input
383
- }] } });
223
+ }], ctorParameters: () => [] });
384
224
 
385
225
  const TuiDataList = [
386
226
  TuiDataListComponent,
387
- TuiDataListDirective,
388
227
  TuiOption,
389
- TuiOptionNew,
390
228
  TuiOptionWithValue,
391
229
  TuiOptGroup,
392
230
  ];
@@ -395,5 +233,5 @@ const TuiDataList = [
395
233
  * Generated bundle index. Do not edit.
396
234
  */
397
235
 
398
- export { TUI_DATA_LIST_ACCESSOR, TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT, TuiDataList, TuiDataListComponent, TuiDataListDirective, TuiOptGroup, TuiOption, TuiOptionNew, TuiOptionWithValue, TuiWithOptionContent, tuiAsDataList, tuiAsDataListAccessor, tuiAsDataListHost, tuiAsOptionContent, tuiInjectDataListSize };
236
+ export { TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT, TuiDataList, TuiDataListComponent, TuiOptGroup, TuiOption, TuiOptionWithValue, TuiWithOptionContent, tuiAsDataListHost, tuiAsOptionContent, tuiInjectDataListSize };
399
237
  //# sourceMappingURL=taiga-ui-core-components-data-list.mjs.map