@taiga-ui/addon-mobile 4.66.0 → 5.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +2 -2
  2. package/components/bottom-sheet/bottom-sheet.component.d.ts +3 -3
  3. package/components/index.d.ts +0 -1
  4. package/components/mobile-calendar/calendar-date-stream.d.ts +6 -0
  5. package/components/mobile-calendar/index.d.ts +1 -0
  6. package/components/mobile-calendar/mobile-calendar.component.d.ts +20 -22
  7. package/components/mobile-calendar/mobile-calendar.strategy.d.ts +3 -7
  8. package/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.d.ts +10 -12
  9. package/components/mobile-calendar-dropdown/mobile-calendar-dropdown.directive.d.ts +6 -6
  10. package/components/pull-to-refresh/pull-to-refresh.component.d.ts +8 -7
  11. package/components/sheet-dialog/sheet-dialog.component.d.ts +2 -2
  12. package/components/sheet-dialog/sheet-dialog.directive.d.ts +4 -3
  13. package/components/sheet-dialog/sheet-dialog.options.d.ts +4 -10
  14. package/components/sheet-dialog/sheet-dialog.service.d.ts +9 -4
  15. package/components/swipe-action/swipe-actions-auto-close.directive.d.ts +2 -2
  16. package/components/tab-bar/tab-bar-item.component.d.ts +3 -3
  17. package/components/tab-bar/tab-bar.component.d.ts +4 -7
  18. package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +10 -14
  19. package/directives/dropdown-mobile/dropdown-mobile.directive.d.ts +1 -2
  20. package/directives/dropdown-sheet/dropdown-sheet.component.d.ts +14 -0
  21. package/directives/dropdown-sheet/dropdown-sheet.directive.d.ts +6 -0
  22. package/directives/dropdown-sheet/index.d.ts +2 -0
  23. package/directives/elastic-sticky/elastic-sticky.directive.d.ts +1 -2
  24. package/directives/index.d.ts +1 -1
  25. package/directives/responsive-dialog/responsive-dialog.directive.d.ts +5 -4
  26. package/directives/responsive-dialog/responsive-dialog.service.d.ts +4 -7
  27. package/directives/ripple/ripple.directive.d.ts +3 -3
  28. package/directives/touchable/touchable.directive.d.ts +5 -5
  29. package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs +14 -23
  30. package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs.map +1 -1
  31. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs +35 -57
  32. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs.map +1 -1
  33. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs +10 -14
  34. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs.map +1 -1
  35. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs +130 -165
  36. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs.map +1 -1
  37. package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +49 -60
  38. package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs.map +1 -1
  39. package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs +62 -61
  40. package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
  41. package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs +12 -20
  42. package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs.map +1 -1
  43. package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs +32 -53
  44. package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs.map +1 -1
  45. package/fesm2022/taiga-ui-addon-mobile-components.mjs +0 -1
  46. package/fesm2022/taiga-ui-addon-mobile-components.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +67 -90
  48. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
  49. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-sheet.mjs +83 -0
  50. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-sheet.mjs.map +1 -0
  51. package/fesm2022/taiga-ui-addon-mobile-directives-elastic-sticky.mjs +12 -16
  52. package/fesm2022/taiga-ui-addon-mobile-directives-elastic-sticky.mjs.map +1 -1
  53. package/fesm2022/taiga-ui-addon-mobile-directives-responsive-dialog.mjs +46 -29
  54. package/fesm2022/taiga-ui-addon-mobile-directives-responsive-dialog.mjs.map +1 -1
  55. package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs +21 -44
  56. package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs.map +1 -1
  57. package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs +20 -27
  58. package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-addon-mobile-directives.mjs +1 -1
  60. package/fesm2022/taiga-ui-addon-mobile-services.mjs +36 -7
  61. package/fesm2022/taiga-ui-addon-mobile-services.mjs.map +1 -1
  62. package/package.json +43 -81
  63. package/services/index.d.ts +1 -0
  64. package/services/theme-color.service.d.ts +18 -0
  65. package/styles/android/app-bar.less +1 -1
  66. package/styles/android/checkbox.less +2 -3
  67. package/styles/common/badge-notification.less +1 -1
  68. package/styles/common/badge.less +2 -3
  69. package/styles/common/block-status.less +1 -1
  70. package/styles/common/button.less +1 -1
  71. package/styles/common/card-large.less +1 -1
  72. package/styles/common/chip.less +3 -9
  73. package/styles/common/header.less +1 -1
  74. package/styles/common/message.less +1 -1
  75. package/styles/common/segmented.less +1 -1
  76. package/styles/common/title.less +0 -1
  77. package/styles/common/toast.less +3 -4
  78. package/styles/ios/checkbox.less +2 -4
  79. package/styles/ios/switch.less +51 -2
  80. package/components/mobile-dialog/index.d.ts +0 -3
  81. package/components/mobile-dialog/mobile-dialog.component.d.ts +0 -10
  82. package/components/mobile-dialog/mobile-dialog.options.d.ts +0 -12
  83. package/components/mobile-dialog/mobile-dialog.service.d.ts +0 -10
  84. package/directives/sidebar/index.d.ts +0 -3
  85. package/directives/sidebar/sidebar.component.d.ts +0 -21
  86. package/directives/sidebar/sidebar.d.ts +0 -6
  87. package/directives/sidebar/sidebar.directive.d.ts +0 -22
  88. package/esm2022/components/bottom-sheet/bottom-sheet.component.mjs +0 -50
  89. package/esm2022/components/bottom-sheet/index.mjs +0 -2
  90. package/esm2022/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.mjs +0 -5
  91. package/esm2022/components/index.mjs +0 -10
  92. package/esm2022/components/mobile-calendar/index.mjs +0 -5
  93. package/esm2022/components/mobile-calendar/mobile-calendar.component.mjs +0 -308
  94. package/esm2022/components/mobile-calendar/mobile-calendar.const.mjs +0 -35
  95. package/esm2022/components/mobile-calendar/mobile-calendar.providers.mjs +0 -27
  96. package/esm2022/components/mobile-calendar/mobile-calendar.strategy.mjs +0 -126
  97. package/esm2022/components/mobile-calendar/taiga-ui-addon-mobile-components-mobile-calendar.mjs +0 -5
  98. package/esm2022/components/mobile-calendar-dropdown/index.mjs +0 -3
  99. package/esm2022/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.mjs +0 -113
  100. package/esm2022/components/mobile-calendar-dropdown/mobile-calendar-dropdown.directive.mjs +0 -53
  101. package/esm2022/components/mobile-calendar-dropdown/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs +0 -5
  102. package/esm2022/components/mobile-calendar-sheet/index.mjs +0 -2
  103. package/esm2022/components/mobile-calendar-sheet/mobile-calendar-sheet.component.mjs +0 -25
  104. package/esm2022/components/mobile-calendar-sheet/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs +0 -5
  105. package/esm2022/components/mobile-dialog/index.mjs +0 -4
  106. package/esm2022/components/mobile-dialog/mobile-dialog.component.mjs +0 -26
  107. package/esm2022/components/mobile-dialog/mobile-dialog.options.mjs +0 -17
  108. package/esm2022/components/mobile-dialog/mobile-dialog.service.mjs +0 -22
  109. package/esm2022/components/mobile-dialog/taiga-ui-addon-mobile-components-mobile-dialog.mjs +0 -5
  110. package/esm2022/components/pull-to-refresh/index.mjs +0 -6
  111. package/esm2022/components/pull-to-refresh/loader-android/loader-android.component.mjs +0 -46
  112. package/esm2022/components/pull-to-refresh/loader-ios/loader-ios.component.mjs +0 -39
  113. package/esm2022/components/pull-to-refresh/pull-to-refresh.component.mjs +0 -51
  114. package/esm2022/components/pull-to-refresh/pull-to-refresh.providers.mjs +0 -24
  115. package/esm2022/components/pull-to-refresh/pull-to-refresh.service.mjs +0 -37
  116. package/esm2022/components/pull-to-refresh/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +0 -5
  117. package/esm2022/components/sheet-dialog/index.mjs +0 -5
  118. package/esm2022/components/sheet-dialog/sheet-dialog.component.mjs +0 -81
  119. package/esm2022/components/sheet-dialog/sheet-dialog.directive.mjs +0 -21
  120. package/esm2022/components/sheet-dialog/sheet-dialog.options.mjs +0 -24
  121. package/esm2022/components/sheet-dialog/sheet-dialog.service.mjs +0 -38
  122. package/esm2022/components/sheet-dialog/taiga-ui-addon-mobile-components-sheet-dialog.mjs +0 -5
  123. package/esm2022/components/swipe-action/index.mjs +0 -3
  124. package/esm2022/components/swipe-action/swipe-actions-auto-close.directive.mjs +0 -34
  125. package/esm2022/components/swipe-action/swipe-actions.component.mjs +0 -23
  126. package/esm2022/components/swipe-action/taiga-ui-addon-mobile-components-swipe-action.mjs +0 -5
  127. package/esm2022/components/tab-bar/index.mjs +0 -5
  128. package/esm2022/components/tab-bar/tab-bar-item.component.mjs +0 -26
  129. package/esm2022/components/tab-bar/tab-bar-item.directive.mjs +0 -27
  130. package/esm2022/components/tab-bar/tab-bar.component.mjs +0 -46
  131. package/esm2022/components/tab-bar/tab-bar.mjs +0 -9
  132. package/esm2022/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.mjs +0 -5
  133. package/esm2022/components/taiga-ui-addon-mobile-components.mjs +0 -5
  134. package/esm2022/directives/dropdown-mobile/dropdown-mobile.component.mjs +0 -98
  135. package/esm2022/directives/dropdown-mobile/dropdown-mobile.directive.mjs +0 -54
  136. package/esm2022/directives/dropdown-mobile/index.mjs +0 -3
  137. package/esm2022/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +0 -5
  138. package/esm2022/directives/elastic-sticky/elastic-sticky.directive.mjs +0 -23
  139. package/esm2022/directives/elastic-sticky/elastic-sticky.service.mjs +0 -53
  140. package/esm2022/directives/elastic-sticky/index.mjs +0 -3
  141. package/esm2022/directives/elastic-sticky/taiga-ui-addon-mobile-directives-elastic-sticky.mjs +0 -5
  142. package/esm2022/directives/index.mjs +0 -7
  143. package/esm2022/directives/responsive-dialog/index.mjs +0 -3
  144. package/esm2022/directives/responsive-dialog/responsive-dialog.directive.mjs +0 -21
  145. package/esm2022/directives/responsive-dialog/responsive-dialog.service.mjs +0 -34
  146. package/esm2022/directives/responsive-dialog/taiga-ui-addon-mobile-directives-responsive-dialog.mjs +0 -5
  147. package/esm2022/directives/ripple/index.mjs +0 -2
  148. package/esm2022/directives/ripple/ripple.directive.mjs +0 -98
  149. package/esm2022/directives/ripple/taiga-ui-addon-mobile-directives-ripple.mjs +0 -5
  150. package/esm2022/directives/sidebar/index.mjs +0 -4
  151. package/esm2022/directives/sidebar/sidebar.component.mjs +0 -45
  152. package/esm2022/directives/sidebar/sidebar.directive.mjs +0 -64
  153. package/esm2022/directives/sidebar/sidebar.mjs +0 -7
  154. package/esm2022/directives/sidebar/taiga-ui-addon-mobile-directives-sidebar.mjs +0 -5
  155. package/esm2022/directives/taiga-ui-addon-mobile-directives.mjs +0 -5
  156. package/esm2022/directives/touchable/index.mjs +0 -2
  157. package/esm2022/directives/touchable/taiga-ui-addon-mobile-directives-touchable.mjs +0 -5
  158. package/esm2022/directives/touchable/touchable.directive.mjs +0 -71
  159. package/esm2022/index.mjs +0 -4
  160. package/esm2022/services/index.mjs +0 -2
  161. package/esm2022/services/keyboard.service.mjs +0 -53
  162. package/esm2022/services/taiga-ui-addon-mobile-services.mjs +0 -5
  163. package/esm2022/taiga-ui-addon-mobile.mjs +0 -5
  164. package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs +0 -65
  165. package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs.map +0 -1
  166. package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs +0 -114
  167. package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs.map +0 -1
@@ -1,92 +1,71 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, EventEmitter, ElementRef, ContentChildren, forwardRef, Output, inject, Directive } from '@angular/core';
3
- import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
4
- import { TuiRepeatTimes } from '@taiga-ui/cdk/directives/repeat-times';
5
- import { tuiIsElement, tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
6
- import { NgIf } from '@angular/common';
2
+ import { input, ChangeDetectionStrategy, Component, contentChildren, ElementRef, model, inject, DestroyRef, Directive } from '@angular/core';
7
3
  import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
8
4
  import { TuiIcon } from '@taiga-ui/core/components/icon';
9
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
5
  import { RouterLinkActive } from '@angular/router';
11
- import { tuiWatch } from '@taiga-ui/cdk/observables';
12
- import { EMPTY, filter } from 'rxjs';
6
+ import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
7
+ import { EMPTY } from 'rxjs';
13
8
 
14
9
  class TuiTabBarItem {
15
10
  constructor() {
16
- this.icon = '';
17
- this.badge = null;
11
+ this.icon = input('');
12
+ this.badge = input();
18
13
  }
19
14
  format(value) {
20
15
  return value > 999 ? '999+' : String(value);
21
16
  }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
23
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTabBarItem, isStandalone: true, selector: "button[tuiTabBarItem], a[tuiTabBarItem]", inputs: { icon: "icon", badge: "badge" }, ngImport: i0, template: "<tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n/>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n", styles: [":host{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1 0;font:inherit;flex-direction:column;align-items:center;overflow:hidden}:host:nth-child(1){color:var(--tui-tab-1, inherit)}:host:nth-child(2){color:var(--tui-tab-2, inherit)}:host:nth-child(3){color:var(--tui-tab-3, inherit)}:host:nth-child(4){color:var(--tui-tab-4, inherit)}:host:nth-child(5){color:var(--tui-tab-5, inherit)}:host:nth-child(6){color:var(--tui-tab-6, inherit)}:host:nth-child(7){color:var(--tui-tab-7, inherit)}:host:nth-child(8){color:var(--tui-tab-8, inherit)}:host:nth-child(9){color:var(--tui-tab-9, inherit)}:host:nth-child(10){color:var(--tui-tab-10, inherit)}.t-icon{inline-size:1.75rem;block-size:1.75rem;margin:.375rem 0 .125rem;pointer-events:none;border:.125rem solid transparent}.t-wrapper{position:absolute;top:.125rem;left:1rem;display:flex;inline-size:100%;justify-content:center;pointer-events:none}.t-badge{display:flex;block-size:1.125rem;min-inline-size:1.125rem;align-items:center;justify-content:center;padding:0 .25rem;border-radius:1rem;font-size:.8125rem;box-sizing:border-box;color:var(--tui-background-base);background:var(--tui-status-negative)}.t-badge .tui-enter,.t-badge .tui-leave{animation-name:tuiScale}.t-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-inline-size:100%;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiAnimated, selector: "[tuiAnimated]" }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
17
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabBarItem, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
18
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTabBarItem, isStandalone: true, selector: "button[tuiTabBarItem], a[tuiTabBarItem]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<tui-icon\n class=\"t-icon\"\n [icon]=\"icon()\"\n/>\n<span class=\"t-wrapper\">\n @if (badge(); as value) {\n <span\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n }\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n", styles: [":host{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1 0;font:inherit;flex-direction:column;align-items:center;overflow:hidden}:host:nth-child(1){color:var(--tui-tab-1, inherit)}:host:nth-child(2){color:var(--tui-tab-2, inherit)}:host:nth-child(3){color:var(--tui-tab-3, inherit)}:host:nth-child(4){color:var(--tui-tab-4, inherit)}:host:nth-child(5){color:var(--tui-tab-5, inherit)}:host:nth-child(6){color:var(--tui-tab-6, inherit)}:host:nth-child(7){color:var(--tui-tab-7, inherit)}:host:nth-child(8){color:var(--tui-tab-8, inherit)}:host:nth-child(9){color:var(--tui-tab-9, inherit)}:host:nth-child(10){color:var(--tui-tab-10, inherit)}.t-icon{inline-size:1.75rem;block-size:1.75rem;margin:.375rem 0 .125rem;pointer-events:none;border:.125rem solid transparent}.t-wrapper{position:absolute;top:.125rem;left:1rem;display:flex;inline-size:100%;justify-content:center;pointer-events:none}.t-badge{display:flex;block-size:1.125rem;min-inline-size:1.125rem;align-items:center;justify-content:center;padding:0 .25rem;border-radius:1rem;font-size:.8125rem;box-sizing:border-box;color:var(--tui-background-base);background:var(--tui-status-negative)}.t-badge .tui-enter,.t-badge .tui-leave{animation-name:tuiScale}.t-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-inline-size:100%;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: TuiAnimated, selector: "[tuiAnimated]" }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
24
19
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarItem, decorators: [{
20
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabBarItem, decorators: [{
26
21
  type: Component,
27
- args: [{ standalone: true, selector: 'button[tuiTabBarItem], a[tuiTabBarItem]', imports: [NgIf, TuiAnimated, TuiIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n/>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n", styles: [":host{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1 0;font:inherit;flex-direction:column;align-items:center;overflow:hidden}:host:nth-child(1){color:var(--tui-tab-1, inherit)}:host:nth-child(2){color:var(--tui-tab-2, inherit)}:host:nth-child(3){color:var(--tui-tab-3, inherit)}:host:nth-child(4){color:var(--tui-tab-4, inherit)}:host:nth-child(5){color:var(--tui-tab-5, inherit)}:host:nth-child(6){color:var(--tui-tab-6, inherit)}:host:nth-child(7){color:var(--tui-tab-7, inherit)}:host:nth-child(8){color:var(--tui-tab-8, inherit)}:host:nth-child(9){color:var(--tui-tab-9, inherit)}:host:nth-child(10){color:var(--tui-tab-10, inherit)}.t-icon{inline-size:1.75rem;block-size:1.75rem;margin:.375rem 0 .125rem;pointer-events:none;border:.125rem solid transparent}.t-wrapper{position:absolute;top:.125rem;left:1rem;display:flex;inline-size:100%;justify-content:center;pointer-events:none}.t-badge{display:flex;block-size:1.125rem;min-inline-size:1.125rem;align-items:center;justify-content:center;padding:0 .25rem;border-radius:1rem;font-size:.8125rem;box-sizing:border-box;color:var(--tui-background-base);background:var(--tui-status-negative)}.t-badge .tui-enter,.t-badge .tui-leave{animation-name:tuiScale}.t-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-inline-size:100%;pointer-events:none}\n"] }]
28
- }], propDecorators: { icon: [{
29
- type: Input
30
- }], badge: [{
31
- type: Input
32
- }] } });
22
+ args: [{ selector: 'button[tuiTabBarItem], a[tuiTabBarItem]', imports: [TuiAnimated, TuiIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-icon\n class=\"t-icon\"\n [icon]=\"icon()\"\n/>\n<span class=\"t-wrapper\">\n @if (badge(); as value) {\n <span\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n }\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n", styles: [":host{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1 0;font:inherit;flex-direction:column;align-items:center;overflow:hidden}:host:nth-child(1){color:var(--tui-tab-1, inherit)}:host:nth-child(2){color:var(--tui-tab-2, inherit)}:host:nth-child(3){color:var(--tui-tab-3, inherit)}:host:nth-child(4){color:var(--tui-tab-4, inherit)}:host:nth-child(5){color:var(--tui-tab-5, inherit)}:host:nth-child(6){color:var(--tui-tab-6, inherit)}:host:nth-child(7){color:var(--tui-tab-7, inherit)}:host:nth-child(8){color:var(--tui-tab-8, inherit)}:host:nth-child(9){color:var(--tui-tab-9, inherit)}:host:nth-child(10){color:var(--tui-tab-10, inherit)}.t-icon{inline-size:1.75rem;block-size:1.75rem;margin:.375rem 0 .125rem;pointer-events:none;border:.125rem solid transparent}.t-wrapper{position:absolute;top:.125rem;left:1rem;display:flex;inline-size:100%;justify-content:center;pointer-events:none}.t-badge{display:flex;block-size:1.125rem;min-inline-size:1.125rem;align-items:center;justify-content:center;padding:0 .25rem;border-radius:1rem;font-size:.8125rem;box-sizing:border-box;color:var(--tui-background-base);background:var(--tui-status-negative)}.t-badge .tui-enter,.t-badge .tui-leave{animation-name:tuiScale}.t-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-inline-size:100%;pointer-events:none}\n"] }]
23
+ }] });
33
24
 
34
25
  class TuiTabBarComponent {
35
26
  constructor() {
36
- this.tabs = EMPTY_QUERY;
37
- this.quantity = 4;
38
- this.activeItemIndex = NaN;
39
- this.activeItemIndexChange = new EventEmitter();
27
+ this.tabs = contentChildren(TuiTabBarItem, { read: ElementRef });
28
+ this.quantity = input(4);
29
+ this.activeItemIndex = model(NaN);
40
30
  }
41
31
  setActive(tab) {
42
- if (tuiIsElement(tab)) {
43
- this.updateIndex(this.tabs.toArray().findIndex(({ nativeElement }) => nativeElement === tab));
44
- }
45
- }
46
- get style() {
47
- return `--tui-tab-${this.activeItemIndex + 1}: var(--tui-active-color)`;
32
+ this.updateIndex(this.tabs().findIndex((el) => el.nativeElement === tab));
48
33
  }
49
34
  updateIndex(index) {
50
- this.activeItemIndex = index;
51
- this.activeItemIndexChange.emit(index);
35
+ this.activeItemIndex.set(index);
52
36
  }
53
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
54
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTabBarComponent, isStandalone: true, selector: "nav[tuiTabBar]", inputs: { quantity: "quantity", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { listeners: { "click": "setActive($event.target)" }, properties: { "style": "style" } }, queries: [{ propertyName: "tabs", predicate: i0.forwardRef(function () { return TuiTabBarItem; }), read: ElementRef }], ngImport: i0, template: "<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n", styles: [":host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,Segoe UI,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:tuiSkeletonVibe ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-block-end:.5rem;border-radius:100%;background:var(--tui-background-neutral-2)}.t-skeleton:after{content:\"\";inline-size:2.5rem;block-size:.375rem;border-radius:1rem;background:var(--tui-background-neutral-2)}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
37
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
38
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTabBarComponent, isStandalone: true, selector: "nav[tuiTabBar]", inputs: { quantity: { classPropertyName: "quantity", publicName: "quantity", isSignal: true, isRequired: false, transformFunction: null }, activeItemIndex: { classPropertyName: "activeItemIndex", publicName: "activeItemIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItemIndex: "activeItemIndexChange" }, host: { listeners: { "click": "setActive($event.target)" }, properties: { "style": "`--tui-tab-${this.activeItemIndex() + 1}: var(--tui-active-color)`" } }, queries: [{ propertyName: "tabs", predicate: TuiTabBarItem, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-content />\n<div class=\"t-skeletons\">\n @for (_ of '-'.repeat(quantity()); track $index) {\n <div class=\"t-skeleton\"></div>\n }\n</div>\n", styles: ["@keyframes shimmer{to{opacity:.5}}:host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem system-ui,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:shimmer ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-block-end:.5rem;border-radius:100%;background:var(--tui-background-neutral-2)}.t-skeleton:after{content:\"\";inline-size:2.5rem;block-size:.375rem;border-radius:1rem;background:var(--tui-background-neutral-2)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
55
39
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarComponent, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabBarComponent, decorators: [{
57
41
  type: Component,
58
- args: [{ standalone: true, selector: 'nav[tuiTabBar]', imports: [TuiRepeatTimes], changeDetection: ChangeDetectionStrategy.OnPush, host: {
59
- '[style]': 'style',
42
+ args: [{ selector: 'nav[tuiTabBar]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
43
+ '[style]': '`--tui-tab-${this.activeItemIndex() + 1}: var(--tui-active-color)`',
60
44
  '(click)': 'setActive($event.target)',
61
- }, template: "<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n", styles: [":host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,Segoe UI,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:tuiSkeletonVibe ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-block-end:.5rem;border-radius:100%;background:var(--tui-background-neutral-2)}.t-skeleton:after{content:\"\";inline-size:2.5rem;block-size:.375rem;border-radius:1rem;background:var(--tui-background-neutral-2)}\n"] }]
62
- }], propDecorators: { tabs: [{
63
- type: ContentChildren,
64
- args: [forwardRef(() => TuiTabBarItem), { read: ElementRef }]
65
- }], quantity: [{
66
- type: Input
67
- }], activeItemIndex: [{
68
- type: Input
69
- }], activeItemIndexChange: [{
70
- type: Output
71
- }] } });
45
+ }, template: "<ng-content />\n<div class=\"t-skeletons\">\n @for (_ of '-'.repeat(quantity()); track $index) {\n <div class=\"t-skeleton\"></div>\n }\n</div>\n", styles: ["@keyframes shimmer{to{opacity:.5}}:host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem system-ui,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:shimmer ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-block-end:.5rem;border-radius:100%;background:var(--tui-background-neutral-2)}.t-skeleton:after{content:\"\";inline-size:2.5rem;block-size:.375rem;border-radius:1rem;background:var(--tui-background-neutral-2)}\n"] }]
46
+ }] });
72
47
 
73
48
  class TuiTabBarItemDirective {
74
49
  constructor() {
75
50
  const tabs = inject(TuiTabBarComponent);
76
51
  const el = tuiInjectElement();
77
52
  const link = inject(RouterLinkActive, { optional: true })?.isActiveChange || EMPTY;
78
- link.pipe(filter(Boolean), tuiWatch(), takeUntilDestroyed()).subscribe(() => tabs.setActive(el));
53
+ const sub = link.subscribe((value) => {
54
+ if (value) {
55
+ tabs.setActive(el);
56
+ }
57
+ });
58
+ inject(DestroyRef).onDestroy(() => sub.unsubscribe());
79
59
  }
80
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
81
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiTabBarItemDirective, isStandalone: true, selector: "[tuiTabBarItem][routerLinkActive]", ngImport: i0 }); }
60
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabBarItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
61
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiTabBarItemDirective, isStandalone: true, selector: "[tuiTabBarItem][routerLinkActive]", ngImport: i0 }); }
82
62
  }
83
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarItemDirective, decorators: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabBarItemDirective, decorators: [{
84
64
  type: Directive,
85
65
  args: [{
86
- standalone: true,
87
66
  selector: '[tuiTabBarItem][routerLinkActive]',
88
67
  }]
89
- }], ctorParameters: function () { return []; } });
68
+ }], ctorParameters: () => [] });
90
69
 
91
70
  const TuiTabBar = [
92
71
  TuiTabBarComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-components-tab-bar.mjs","sources":["../../../projects/addon-mobile/components/tab-bar/tab-bar-item.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.directive.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.ts","../../../projects/addon-mobile/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.ts"],"sourcesContent":["import {NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\n\n@Component({\n standalone: true,\n selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',\n imports: [NgIf, TuiAnimated, TuiIcon],\n templateUrl: './tab-bar-item.template.html',\n styleUrls: ['./tab-bar-item.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiTabBarItem {\n @Input()\n public icon = '';\n\n @Input()\n public badge?: number | null = null;\n\n protected format(value: number): string {\n return value > 999 ? '999+' : String(value);\n }\n}\n","<tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n/>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n type QueryList,\n} from '@angular/core';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiIsElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {TuiTabBarItem} from './tab-bar-item.component';\n\n@Component({\n standalone: true,\n selector: 'nav[tuiTabBar]',\n imports: [TuiRepeatTimes],\n templateUrl: './tab-bar.template.html',\n styleUrls: ['./tab-bar.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style]': 'style',\n '(click)': 'setActive($event.target)',\n },\n})\nexport class TuiTabBarComponent {\n @ContentChildren(forwardRef(() => TuiTabBarItem), {read: ElementRef})\n private readonly tabs: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n @Input()\n public quantity = 4;\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n public setActive(tab: EventTarget): void {\n if (tuiIsElement(tab)) {\n this.updateIndex(\n this.tabs.toArray().findIndex(({nativeElement}) => nativeElement === tab),\n );\n }\n }\n\n protected get style(): string {\n return `--tui-tab-${this.activeItemIndex + 1}: var(--tui-active-color)`;\n }\n\n private updateIndex(index: number): void {\n this.activeItemIndex = index;\n this.activeItemIndexChange.emit(index);\n }\n}\n","<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n","import {Directive, inject} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {EMPTY, filter, type Observable} from 'rxjs';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiTabBarItem][routerLinkActive]',\n})\nexport class TuiTabBarItemDirective {\n constructor() {\n const tabs = inject(TuiTabBarComponent);\n const el = tuiInjectElement();\n const link: Observable<boolean> =\n inject(RouterLinkActive, {optional: true})?.isActiveChange || EMPTY;\n\n link.pipe(filter(Boolean), tuiWatch(), takeUntilDestroyed()).subscribe(() =>\n tabs.setActive(el),\n );\n }\n}\n","import {TuiTabBarComponent} from './tab-bar.component';\nimport {TuiTabBarItem} from './tab-bar-item.component';\nimport {TuiTabBarItemDirective} from './tab-bar-item.directive';\n\nexport const TuiTabBar = [\n TuiTabBarComponent,\n TuiTabBarItem,\n TuiTabBarItemDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,MAQa,aAAa,CAAA;AAR1B,IAAA,WAAA,GAAA;QAUW,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;QAGV,IAAK,CAAA,KAAA,GAAmB,IAAI,CAAC;AAKvC,KAAA;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AsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mCAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,mCAAmC;AAChD,iBAAA,CAAA;;;ACRY,MAAA,SAAS,GAAG;IACrB,kBAAkB;IAClB,aAAa;IACb,sBAAsB;;;ACP1B;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components-tab-bar.mjs","sources":["../../../projects/addon-mobile/components/tab-bar/tab-bar-item.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.directive.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.ts","../../../projects/addon-mobile/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, input} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\n\n@Component({\n selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',\n imports: [TuiAnimated, TuiIcon],\n templateUrl: './tab-bar-item.template.html',\n styleUrl: './tab-bar-item.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiTabBarItem {\n public readonly icon = input('');\n public readonly badge = input<number>();\n\n protected format(value: number): string {\n return value > 999 ? '999+' : String(value);\n }\n}\n","<tui-icon\n class=\"t-icon\"\n [icon]=\"icon()\"\n/>\n<span class=\"t-wrapper\">\n @if (badge(); as value) {\n <span\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n }\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n","import {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n ElementRef,\n input,\n model,\n} from '@angular/core';\n\nimport {TuiTabBarItem} from './tab-bar-item.component';\n\n@Component({\n selector: 'nav[tuiTabBar]',\n templateUrl: './tab-bar.template.html',\n styleUrl: './tab-bar.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style]': '`--tui-tab-${this.activeItemIndex() + 1}: var(--tui-active-color)`',\n '(click)': 'setActive($event.target)',\n },\n})\nexport class TuiTabBarComponent {\n private readonly tabs = contentChildren(TuiTabBarItem, {read: ElementRef});\n\n public readonly quantity = input(4);\n public readonly activeItemIndex = model(NaN);\n\n public setActive(tab: Element): void {\n this.updateIndex(this.tabs().findIndex((el) => el.nativeElement === tab));\n }\n\n private updateIndex(index: number): void {\n this.activeItemIndex.set(index);\n }\n}\n","<ng-content />\n<div class=\"t-skeletons\">\n @for (_ of '-'.repeat(quantity()); track $index) {\n <div class=\"t-skeleton\"></div>\n }\n</div>\n","import {DestroyRef, Directive, inject} from '@angular/core';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {EMPTY} from 'rxjs';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\n\n@Directive({\n selector: '[tuiTabBarItem][routerLinkActive]',\n})\nexport class TuiTabBarItemDirective {\n constructor() {\n const tabs = inject(TuiTabBarComponent);\n const el = tuiInjectElement();\n const link = inject(RouterLinkActive, {optional: true})?.isActiveChange || EMPTY;\n const sub = link.subscribe((value) => {\n if (value) {\n tabs.setActive(el);\n }\n });\n\n inject(DestroyRef).onDestroy(() => sub.unsubscribe());\n }\n}\n","import {TuiTabBarComponent} from './tab-bar.component';\nimport {TuiTabBarItem} from './tab-bar-item.component';\nimport {TuiTabBarItemDirective} from './tab-bar-item.directive';\n\nexport const TuiTabBar = [\n TuiTabBarComponent,\n TuiTabBarItem,\n TuiTabBarItemDirective,\n] as const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C,IAAI,KAAK,EAAE;AACP,gBAAA,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;;AAE1B,SAAC,CAAC;AAEF,QAAA,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;;+GAXhD,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mCAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,mCAAmC;AAChD,iBAAA;;;ACLY,MAAA,SAAS,GAAG;IACrB,kBAAkB;IAClB,aAAa;IACb,sBAAsB;;;ACP1B;;AAEG;;;;"}
@@ -2,7 +2,6 @@ export * from '@taiga-ui/addon-mobile/components/bottom-sheet';
2
2
  export * from '@taiga-ui/addon-mobile/components/mobile-calendar';
3
3
  export * from '@taiga-ui/addon-mobile/components/mobile-calendar-dropdown';
4
4
  export * from '@taiga-ui/addon-mobile/components/mobile-calendar-sheet';
5
- export * from '@taiga-ui/addon-mobile/components/mobile-dialog';
6
5
  export * from '@taiga-ui/addon-mobile/components/pull-to-refresh';
7
6
  export * from '@taiga-ui/addon-mobile/components/sheet-dialog';
8
7
  export * from '@taiga-ui/addon-mobile/components/swipe-action';
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-components.mjs","sources":["../../../projects/addon-mobile/components/taiga-ui-addon-mobile-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;AAEG"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components.mjs","sources":["../../../projects/addon-mobile/components/taiga-ui-addon-mobile-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;AAEG"}
@@ -1,67 +1,17 @@
1
- import { DOCUMENT, NgIf } from '@angular/common';
1
+ import { DOCUMENT } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, Directive, Input, Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
4
- import * as i3 from '@ng-web-apis/intersection-observer';
5
- import { WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
3
+ import { inject, ChangeDetectionStrategy, ViewEncapsulation, Component, Directive } from '@angular/core';
6
4
  import { TuiKeyboardService } from '@taiga-ui/addon-mobile/services';
7
- import * as i1 from '@taiga-ui/cdk/directives/active-zone';
5
+ import * as i2 from '@taiga-ui/cdk/directives/active-zone';
8
6
  import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
9
- import * as i2 from '@taiga-ui/cdk/directives/animated';
7
+ import * as i1 from '@taiga-ui/cdk/directives/animated';
10
8
  import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
11
- import { TuiSwipe } from '@taiga-ui/cdk/directives/swipe';
12
- import { tuiIsHTMLElement, tuiInjectElement, tuiIsElement } from '@taiga-ui/cdk/utils/dom';
13
- import { tuiGetNativeFocused } from '@taiga-ui/cdk/utils/focus';
9
+ import { tuiInjectElement, tuiIsElement, tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
10
+ import { tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
14
11
  import { tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
15
- import { TUI_DROPDOWN_COMPONENT, TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
12
+ import { TuiDropdownDirective, TUI_DROPDOWN_COMPONENT } from '@taiga-ui/core/portals/dropdown';
16
13
  import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
17
- import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
18
-
19
- class TuiDropdownMobile {
20
- constructor() {
21
- this.isMobile = inject(TUI_IS_MOBILE);
22
- this.tuiDropdownMobile = '';
23
- }
24
- onMouseDown(event) {
25
- if (!this.isMobile ||
26
- !tuiIsHTMLElement(event.target) ||
27
- !event.target.matches('input,textarea') ||
28
- this.tuiDropdownMobile) {
29
- return;
30
- }
31
- event.preventDefault();
32
- event.target.focus({ preventScroll: true });
33
- }
34
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobile, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
35
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiDropdownMobile, isStandalone: true, selector: "[tuiDropdownMobile]", inputs: { tuiDropdownMobile: "tuiDropdownMobile" }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "style.visibility": "\"visible\"" } }, providers: [
36
- {
37
- provide: TUI_DROPDOWN_COMPONENT,
38
- useFactory: () => inject(TUI_IS_MOBILE)
39
- ? TuiDropdownMobileComponent
40
- : inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
41
- },
42
- ], ngImport: i0 }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobile, decorators: [{
45
- type: Directive,
46
- args: [{
47
- standalone: true,
48
- selector: '[tuiDropdownMobile]',
49
- providers: [
50
- {
51
- provide: TUI_DROPDOWN_COMPONENT,
52
- useFactory: () => inject(TUI_IS_MOBILE)
53
- ? TuiDropdownMobileComponent
54
- : inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
55
- },
56
- ],
57
- host: {
58
- '[style.visibility]': '"visible"',
59
- '(mousedown)': 'onMouseDown($event)',
60
- },
61
- }]
62
- }], propDecorators: { tuiDropdownMobile: [{
63
- type: Input
64
- }] } });
14
+ import { WA_IS_MOBILE } from '@ng-web-apis/platform';
65
15
 
66
16
  const GAP = 16;
67
17
  class TuiDropdownMobileComponent {
@@ -70,17 +20,12 @@ class TuiDropdownMobileComponent {
70
20
  this.keyboard = inject(TuiKeyboardService);
71
21
  this.doc = inject(DOCUMENT);
72
22
  this.scrollTop = this.doc.documentElement.scrollTop;
73
- this.observer = new ResizeObserver(() => this.doc.defaultView?.visualViewport &&
74
- this.refresh(this.doc.defaultView.visualViewport));
75
- this.directive = inject(TuiDropdownMobile);
23
+ this.observer = new ResizeObserver(() => this.refresh());
76
24
  this.dropdown = inject(TuiDropdownDirective);
77
- this.close = () => this.dropdown.toggle(false);
25
+ this.context = { $implicit: () => this.dropdown.toggle(false) };
78
26
  this.observer.observe(this.dropdown.el);
79
27
  this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');
80
28
  }
81
- ngAfterViewInit() {
82
- this.el.scrollTop = this.directive.tuiDropdownMobile ? this.el.clientHeight : 0;
83
- }
84
29
  ngOnDestroy() {
85
30
  this.observer.disconnect();
86
31
  this.doc.body.classList.remove('t-dropdown-mobile');
@@ -99,21 +44,10 @@ class TuiDropdownMobileComponent {
99
44
  event.stopPropagation();
100
45
  }
101
46
  }
102
- onSwipe({ direction }, el) {
103
- if (direction === 'bottom' &&
104
- el.getBoundingClientRect().bottom > Number(this.doc.defaultView?.innerHeight)) {
105
- this.close();
106
- }
107
- }
108
- onIntersection({ isIntersecting }) {
109
- if (isIntersecting) {
110
- this.close();
111
- }
112
- }
113
- refresh({ offsetTop, height }) {
47
+ refresh() {
48
+ const { offsetTop = 0, height = 0 } = this.doc.defaultView?.visualViewport || {};
114
49
  this.doc.body.style.removeProperty('--t-root-top');
115
50
  if (!this.focused ||
116
- this.directive.tuiDropdownMobile ||
117
51
  !this.doc.documentElement.style.getPropertyValue('scroll-behavior')) {
118
52
  return;
119
53
  }
@@ -121,27 +55,70 @@ class TuiDropdownMobileComponent {
121
55
  const rect = this.dropdown.el.getBoundingClientRect();
122
56
  const topMargin = `max(var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)}), env(safe-area-inset-top))`;
123
57
  const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;
58
+ const top = `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`;
124
59
  this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);
125
60
  this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);
126
61
  this.doc.body.classList.add('t-dropdown-mobile');
127
- this.doc.body.style.setProperty('--t-root-top', `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`);
62
+ this.doc.body.style.setProperty('--t-root-top', top);
128
63
  }
129
64
  get focused() {
130
- return this.dropdown.el.contains(tuiGetNativeFocused(this.doc));
65
+ return this.dropdown.el.contains(tuiGetFocused(this.doc));
131
66
  }
132
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
133
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiDropdownMobileComponent, isStandalone: true, selector: "tui-dropdown-mobile", host: { listeners: { "document:click.zoneless.capture": "onClick($event)", "window>scroll.zoneless.capture": "refresh($event.currentTarget.visualViewport)", "visualViewport>resize.zoneless": "refresh($event.target)", "visualViewport>scroll.zoneless": "refresh($event.target)" }, properties: { "class._sheet": "directive.tuiDropdownMobile" } }, hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n", styles: ["tui-dropdown-mobile:not(._sheet){scrollbar-width:none;-ms-overflow-style:none;position:fixed;top:0;left:0;inline-size:100%;block-size:100%;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;visibility:visible!important;transform:translateZ(0);background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base);box-sizing:border-box;padding-block-end:env(safe-area-inset-bottom)}tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet).tui-enter,tui-dropdown-mobile:not(._sheet).tui-leave{animation-name:tuiFade,tuiSlide}tui-dropdown-mobile:not(._sheet):after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile:not(._sheet)>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet) [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));display:inline-flex}tui-dropdown-mobile._sheet{position:fixed;top:0;left:0;bottom:0;right:0;scrollbar-width:none;-ms-overflow-style:none;overflow:auto;background:var(--tui-service-backdrop);box-shadow:0 -80vh 0 5rem var(--tui-service-backdrop);overflow-y:scroll;scroll-snap-type:y mandatory;overscroll-behavior:none}tui-dropdown-mobile._sheet::-webkit-scrollbar,tui-dropdown-mobile._sheet::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet.tui-enter,tui-dropdown-mobile._sheet.tui-leave{animation-name:tuiFade,tuiSlide}tui-root:has(tui-dialogs>:nth-child(2)) tui-dropdown-mobile._sheet{background:transparent;box-shadow:none}tui-dropdown-mobile._sheet>.t-filler{block-size:100%;scroll-snap-stop:always;scroll-snap-align:start}tui-dropdown-mobile._sheet>.t-container{display:flex;max-block-size:calc(100% - max(env(safe-area-inset-top),1rem));flex-direction:column;border-top-left-radius:1rem;border-top-right-radius:1rem;padding:0 .5rem env(safe-area-inset-bottom);box-sizing:border-box;scroll-snap-stop:always;scroll-snap-align:start;background:var(--tui-background-elevation-1)}tui-dropdown-mobile._sheet>.t-container>.t-heading{position:relative;margin:0;padding:2rem .5rem .75rem;font:var(--tui-font-heading-6)}tui-dropdown-mobile._sheet>.t-container>.t-heading:before{content:\"\";position:absolute;left:50%;top:.75rem;inline-size:2rem;block-size:.25rem;border-radius:1rem;background:var(--tui-background-neutral-2);transform:translate(-50%,-50%)}tui-dropdown-mobile._sheet>.t-container>.t-content{scrollbar-width:none;-ms-overflow-style:none;overflow-y:auto;overflow-x:hidden}tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar,tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet tui-data-list [tuiOption]{margin-inline-start:calc(-1 * var(--t-option-padding-inline));margin-inline-end:calc(-1 * var(--t-option-padding-inline))}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiSwipe, selector: "[tuiSwipe]", outputs: ["tuiSwipe"] }, { kind: "directive", type: i3.WaIntersectionObserverDirective, selector: "[waIntersectionObserver]", inputs: ["waIntersectionRootMargin", "waIntersectionThreshold"], exportAs: ["IntersectionObserver"] }, { kind: "directive", type: i3.WaIntersectionObservee, selector: "[waIntersectionObservee]", outputs: ["waIntersectionObservee"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownMobileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
68
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownMobileComponent, isStandalone: true, selector: "tui-dropdown-mobile", host: { listeners: { "pointerdown.prevent": "0", "document:click.zoneless.capture": "onClick($event)", "window>scroll.zoneless.capture": "refresh()", "visualViewport>resize.zoneless": "refresh()", "visualViewport>scroll.zoneless": "refresh()" } }, hostDirectives: [{ directive: i1.TuiAnimated }, { directive: i2.TuiActiveZone }], ngImport: i0, template: "<div class=\"t-container\">\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown.content() as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n", styles: ["tui-dropdown-mobile{scrollbar-width:none;-ms-overflow-style:none;position:absolute;top:0;left:0;inline-size:100%;block-size:100%;visibility:visible!important;background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base);box-sizing:border-box;padding-block-end:env(safe-area-inset-bottom);pointer-events:auto}tui-dropdown-mobile::-webkit-scrollbar,tui-dropdown-mobile::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile.tui-enter,tui-dropdown-mobile.tui-leave{animation-name:tuiFade,tuiSlide}tui-dropdown-mobile:after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile>.t-container::-webkit-scrollbar,tui-dropdown-mobile>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));display:inline-flex}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
134
69
  }
135
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobileComponent, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownMobileComponent, decorators: [{
136
71
  type: Component,
137
- args: [{ standalone: true, selector: 'tui-dropdown-mobile', imports: [NgIf, PolymorpheusOutlet, TuiSwipe, WaIntersectionObserver], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiActiveZone, TuiAnimated], host: {
138
- '[class._sheet]': 'directive.tuiDropdownMobile',
72
+ args: [{ selector: 'tui-dropdown-mobile', imports: [PolymorpheusOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiAnimated, TuiActiveZone], host: {
73
+ '(pointerdown.prevent)': '0',
139
74
  '(document:click.zoneless.capture)': 'onClick($event)',
140
- '(window>scroll.zoneless.capture)': 'refresh($event.currentTarget.visualViewport)',
141
- '(visualViewport>resize.zoneless)': 'refresh($event.target)',
142
- '(visualViewport>scroll.zoneless)': 'refresh($event.target)',
143
- }, template: "<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n", styles: ["tui-dropdown-mobile:not(._sheet){scrollbar-width:none;-ms-overflow-style:none;position:fixed;top:0;left:0;inline-size:100%;block-size:100%;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;visibility:visible!important;transform:translateZ(0);background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base);box-sizing:border-box;padding-block-end:env(safe-area-inset-bottom)}tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet).tui-enter,tui-dropdown-mobile:not(._sheet).tui-leave{animation-name:tuiFade,tuiSlide}tui-dropdown-mobile:not(._sheet):after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile:not(._sheet)>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet) [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));display:inline-flex}tui-dropdown-mobile._sheet{position:fixed;top:0;left:0;bottom:0;right:0;scrollbar-width:none;-ms-overflow-style:none;overflow:auto;background:var(--tui-service-backdrop);box-shadow:0 -80vh 0 5rem var(--tui-service-backdrop);overflow-y:scroll;scroll-snap-type:y mandatory;overscroll-behavior:none}tui-dropdown-mobile._sheet::-webkit-scrollbar,tui-dropdown-mobile._sheet::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet.tui-enter,tui-dropdown-mobile._sheet.tui-leave{animation-name:tuiFade,tuiSlide}tui-root:has(tui-dialogs>:nth-child(2)) tui-dropdown-mobile._sheet{background:transparent;box-shadow:none}tui-dropdown-mobile._sheet>.t-filler{block-size:100%;scroll-snap-stop:always;scroll-snap-align:start}tui-dropdown-mobile._sheet>.t-container{display:flex;max-block-size:calc(100% - max(env(safe-area-inset-top),1rem));flex-direction:column;border-top-left-radius:1rem;border-top-right-radius:1rem;padding:0 .5rem env(safe-area-inset-bottom);box-sizing:border-box;scroll-snap-stop:always;scroll-snap-align:start;background:var(--tui-background-elevation-1)}tui-dropdown-mobile._sheet>.t-container>.t-heading{position:relative;margin:0;padding:2rem .5rem .75rem;font:var(--tui-font-heading-6)}tui-dropdown-mobile._sheet>.t-container>.t-heading:before{content:\"\";position:absolute;left:50%;top:.75rem;inline-size:2rem;block-size:.25rem;border-radius:1rem;background:var(--tui-background-neutral-2);transform:translate(-50%,-50%)}tui-dropdown-mobile._sheet>.t-container>.t-content{scrollbar-width:none;-ms-overflow-style:none;overflow-y:auto;overflow-x:hidden}tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar,tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet tui-data-list [tuiOption]{margin-inline-start:calc(-1 * var(--t-option-padding-inline));margin-inline-end:calc(-1 * var(--t-option-padding-inline))}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"] }]
144
- }], ctorParameters: function () { return []; } });
75
+ '(window>scroll.zoneless.capture)': 'refresh()',
76
+ '(visualViewport>resize.zoneless)': 'refresh()',
77
+ '(visualViewport>scroll.zoneless)': 'refresh()',
78
+ }, template: "<div class=\"t-container\">\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown.content() as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n", styles: ["tui-dropdown-mobile{scrollbar-width:none;-ms-overflow-style:none;position:absolute;top:0;left:0;inline-size:100%;block-size:100%;visibility:visible!important;background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base);box-sizing:border-box;padding-block-end:env(safe-area-inset-bottom);pointer-events:auto}tui-dropdown-mobile::-webkit-scrollbar,tui-dropdown-mobile::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile.tui-enter,tui-dropdown-mobile.tui-leave{animation-name:tuiFade,tuiSlide}tui-dropdown-mobile:after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile>.t-container::-webkit-scrollbar,tui-dropdown-mobile>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));display:inline-flex}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"] }]
79
+ }], ctorParameters: () => [] });
80
+
81
+ class TuiDropdownMobile {
82
+ constructor() {
83
+ this.isMobile = inject(WA_IS_MOBILE);
84
+ }
85
+ onMouseDown(event) {
86
+ if (!this.isMobile ||
87
+ !tuiIsHTMLElement(event.target) ||
88
+ !event.target.matches('input,textarea')) {
89
+ return;
90
+ }
91
+ event.preventDefault();
92
+ event.target.focus({ preventScroll: true });
93
+ }
94
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownMobile, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
95
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownMobile, isStandalone: true, selector: "[tuiDropdownMobile]", host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "style.visibility": "\"visible\"" } }, providers: [
96
+ {
97
+ provide: TUI_DROPDOWN_COMPONENT,
98
+ useFactory: () => inject(WA_IS_MOBILE)
99
+ ? TuiDropdownMobileComponent
100
+ : inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
101
+ },
102
+ ], ngImport: i0 }); }
103
+ }
104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownMobile, decorators: [{
105
+ type: Directive,
106
+ args: [{
107
+ selector: '[tuiDropdownMobile]',
108
+ providers: [
109
+ {
110
+ provide: TUI_DROPDOWN_COMPONENT,
111
+ useFactory: () => inject(WA_IS_MOBILE)
112
+ ? TuiDropdownMobileComponent
113
+ : inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
114
+ },
115
+ ],
116
+ host: {
117
+ '[style.visibility]': '"visible"',
118
+ '(mousedown)': 'onMouseDown($event)',
119
+ },
120
+ }]
121
+ }] });
145
122
 
146
123
  /**
147
124
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-mobile.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.directive.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.ts"],"sourcesContent":["import {Directive, inject, Input} from '@angular/core';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/directives/dropdown';\n\nimport {TuiDropdownMobileComponent} from './dropdown-mobile.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiDropdownMobile]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(TUI_IS_MOBILE)\n ? TuiDropdownMobileComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n ],\n host: {\n '[style.visibility]': '\"visible\"',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiDropdownMobile {\n private readonly isMobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public tuiDropdownMobile = '';\n\n protected onMouseDown(event: MouseEvent): void {\n if (\n !this.isMobile ||\n !tuiIsHTMLElement(event.target) ||\n !event.target.matches('input,textarea') ||\n this.tuiDropdownMobile\n ) {\n return;\n }\n\n event.preventDefault();\n event.target.focus({preventScroll: true});\n }\n}\n","import {DOCUMENT, NgIf} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n inject,\n type OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {WaIntersectionObserver} from '@ng-web-apis/intersection-observer';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiSwipe, type TuiSwipeEvent} from '@taiga-ui/cdk/directives/swipe';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownMobile} from './dropdown-mobile.directive';\n\nconst GAP = 16;\n\n@Component({\n standalone: true,\n selector: 'tui-dropdown-mobile',\n imports: [NgIf, PolymorpheusOutlet, TuiSwipe, WaIntersectionObserver],\n templateUrl: './dropdown-mobile.template.html',\n styleUrls: ['./dropdown-mobile.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiActiveZone, TuiAnimated],\n host: {\n '[class._sheet]': 'directive.tuiDropdownMobile',\n '(document:click.zoneless.capture)': 'onClick($event)',\n '(window>scroll.zoneless.capture)':\n 'refresh($event.currentTarget.visualViewport)',\n '(visualViewport>resize.zoneless)': 'refresh($event.target)',\n '(visualViewport>scroll.zoneless)': 'refresh($event.target)',\n },\n})\nexport class TuiDropdownMobileComponent implements OnDestroy, AfterViewInit {\n private readonly el = tuiInjectElement();\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly doc = inject(DOCUMENT);\n private readonly scrollTop = this.doc.documentElement.scrollTop;\n private readonly observer = new ResizeObserver(\n () =>\n this.doc.defaultView?.visualViewport &&\n this.refresh(this.doc.defaultView.visualViewport),\n );\n\n protected readonly directive = inject(TuiDropdownMobile);\n protected readonly dropdown = inject(TuiDropdownDirective);\n\n constructor() {\n this.observer.observe(this.dropdown.el);\n this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');\n }\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.directive.tuiDropdownMobile ? this.el.clientHeight : 0;\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n this.doc.body.classList.remove('t-dropdown-mobile');\n this.doc.body.style.removeProperty('--t-root-top');\n this.doc.documentElement.scrollTop = this.scrollTop;\n this.doc.documentElement.style.removeProperty('scroll-behavior');\n\n if (this.focused) {\n this.keyboard.hide();\n }\n }\n\n protected readonly close = (): void => this.dropdown.toggle(false);\n\n protected onClick(event: MouseEvent): void {\n if (\n tuiIsElement(event.target) &&\n !this.el.contains(event.target) &&\n (!this.dropdown.el.contains(event.target) ||\n event.target.matches('input,textarea'))\n ) {\n event.stopPropagation();\n }\n }\n\n protected onSwipe({direction}: TuiSwipeEvent, el: HTMLElement): void {\n if (\n direction === 'bottom' &&\n el.getBoundingClientRect().bottom > Number(this.doc.defaultView?.innerHeight)\n ) {\n this.close();\n }\n }\n\n protected onIntersection({isIntersecting}: IntersectionObserverEntry): void {\n if (isIntersecting) {\n this.close();\n }\n }\n\n protected refresh({offsetTop, height}: VisualViewport): void {\n this.doc.body.style.removeProperty('--t-root-top');\n\n if (\n !this.focused ||\n this.directive.tuiDropdownMobile ||\n !this.doc.documentElement.style.getPropertyValue('scroll-behavior')\n ) {\n return;\n }\n\n this.doc.documentElement.scrollTop = 0;\n\n const rect = this.dropdown.el.getBoundingClientRect();\n const topMargin = `max(var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)}), env(safe-area-inset-top))`;\n const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;\n\n this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);\n this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);\n\n this.doc.body.classList.add('t-dropdown-mobile');\n this.doc.body.style.setProperty(\n '--t-root-top',\n `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`,\n );\n }\n\n private get focused(): boolean {\n return this.dropdown.el.contains(tuiGetNativeFocused(this.doc));\n }\n}\n","<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAOA,MAiBa,iBAAiB,CAAA;AAjB9B,IAAA,WAAA,GAAA;AAkBqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAG3C,IAAiB,CAAA,iBAAA,GAAG,EAAE,CAAC;AAejC,KAAA;AAba,IAAA,WAAW,CAAC,KAAiB,EAAA;QACnC,IACI,CAAC,IAAI,CAAC,QAAQ;AACd,YAAA,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;AAC/B,YAAA,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACvC,IAAI,CAAC,iBAAiB,EACxB;YACE,OAAO;AACV,SAAA;QAED,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC,CAAC;KAC7C;+GAlBQ,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAjB,IAAA,SAAA,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AA;;4FAenC,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAlBtC,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,qBAAqB,EAAA,OAAA,EACtB,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,EAAA,aAAA,EAGtD,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAC/B,cAAA,EAAA,CAAC,aAAa,EAAE,WAAW,CAAC,EACtC,IAAA,EAAA;AACF,wBAAA,gBAAgB,EAAE,6BAA6B;AAC/C,wBAAA,mCAAmC,EAAE,iBAAiB;AACtD,wBAAA,kCAAkC,EAC9B,8CAA8C;AAClD,wBAAA,kCAAkC,EAAE,wBAAwB;AAC5D,wBAAA,kCAAkC,EAAE,wBAAwB;AAC/D,qBAAA,EAAA,QAAA,EAAA,osBAAA,EAAA,MAAA,EAAA,CAAA,6hHAAA,CAAA,EAAA,CAAA;;;AExCL;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-mobile.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.directive.ts","../../../projects/addon-mobile/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n type OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/portals/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nconst GAP = 16;\n\n@Component({\n selector: 'tui-dropdown-mobile',\n imports: [PolymorpheusOutlet],\n templateUrl: './dropdown-mobile.template.html',\n styleUrl: './dropdown-mobile.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiAnimated, TuiActiveZone],\n host: {\n '(pointerdown.prevent)': '0',\n '(document:click.zoneless.capture)': 'onClick($event)',\n '(window>scroll.zoneless.capture)': 'refresh()',\n '(visualViewport>resize.zoneless)': 'refresh()',\n '(visualViewport>scroll.zoneless)': 'refresh()',\n },\n})\nexport class TuiDropdownMobileComponent implements OnDestroy {\n private readonly el = tuiInjectElement();\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly doc = inject(DOCUMENT);\n private readonly scrollTop = this.doc.documentElement.scrollTop;\n private readonly observer = new ResizeObserver(() => this.refresh());\n\n protected readonly dropdown = inject(TuiDropdownDirective);\n protected readonly context = {$implicit: (): void => this.dropdown.toggle(false)};\n\n constructor() {\n this.observer.observe(this.dropdown.el);\n this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n this.doc.body.classList.remove('t-dropdown-mobile');\n this.doc.body.style.removeProperty('--t-root-top');\n this.doc.documentElement.scrollTop = this.scrollTop;\n this.doc.documentElement.style.removeProperty('scroll-behavior');\n\n if (this.focused) {\n this.keyboard.hide();\n }\n }\n\n protected onClick(event: MouseEvent): void {\n if (\n tuiIsElement(event.target) &&\n !this.el.contains(event.target) &&\n (!this.dropdown.el.contains(event.target) ||\n event.target.matches('input,textarea'))\n ) {\n event.stopPropagation();\n }\n }\n\n protected refresh(): void {\n const {offsetTop = 0, height = 0} = this.doc.defaultView?.visualViewport || {};\n\n this.doc.body.style.removeProperty('--t-root-top');\n\n if (\n !this.focused ||\n !this.doc.documentElement.style.getPropertyValue('scroll-behavior')\n ) {\n return;\n }\n\n this.doc.documentElement.scrollTop = 0;\n\n const rect = this.dropdown.el.getBoundingClientRect();\n const topMargin = `max(var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)}), env(safe-area-inset-top))`;\n const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;\n const top = `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`;\n\n this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);\n this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);\n this.doc.body.classList.add('t-dropdown-mobile');\n this.doc.body.style.setProperty('--t-root-top', top);\n }\n\n private get focused(): boolean {\n return this.dropdown.el.contains(tuiGetFocused(this.doc));\n }\n}\n","<div class=\"t-container\">\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown.content() as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","import {Directive, inject} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/portals/dropdown';\n\nimport {TuiDropdownMobileComponent} from './dropdown-mobile.component';\n\n@Directive({\n selector: '[tuiDropdownMobile]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(WA_IS_MOBILE)\n ? TuiDropdownMobileComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n ],\n host: {\n '[style.visibility]': '\"visible\"',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiDropdownMobile {\n private readonly isMobile = inject(WA_IS_MOBILE);\n\n protected onMouseDown(event: MouseEvent): void {\n if (\n !this.isMobile ||\n !tuiIsHTMLElement(event.target) ||\n !event.target.matches('input,textarea')\n ) {\n return;\n }\n\n event.preventDefault();\n event.target.focus({preventScroll: true});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