@taiga-ui/addon-mobile 4.65.0 → 5.0.0-canary.8b64ec1

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 +27 -65
  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,42 +1,43 @@
1
- import { NgForOf, NgIf } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, ElementRef, Component, ChangeDetectionStrategy, ViewChildren, InjectionToken, Injectable, Directive } from '@angular/core';
2
+ import { viewChildren, ElementRef, inject, ChangeDetectionStrategy, Component, Injectable, input, Directive } from '@angular/core';
4
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { EMPTY_QUERY, TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
4
+ import { TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
6
5
  import * as i1 from '@taiga-ui/cdk/directives/animated';
7
6
  import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
8
7
  import { tuiCloseWatcher, tuiZonefull } from '@taiga-ui/cdk/observables';
8
+ import { tuiProvide, tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
9
9
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
10
- import { tuiProvide, tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
11
- import { TUI_DIALOGS_CLOSE, TUI_DIALOGS } from '@taiga-ui/core/components/dialog';
12
- import { TUI_SCROLL_REF } from '@taiga-ui/core/tokens';
10
+ import { TUI_SCROLL_REF } from '@taiga-ui/core/components/scrollbar';
11
+ import { TUI_DIALOGS_CLOSE } from '@taiga-ui/core/portals/dialog';
13
12
  import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
14
- import { Subject, merge, map, exhaustMap, isObservable, take, of, filter, startWith, pairwise } from 'rxjs';
15
- import { TuiPopoverDirective } from '@taiga-ui/cdk/directives/popover';
16
- import { TuiPopoverService, TuiThemeColorService, tuiAsPopover } from '@taiga-ui/cdk/services';
13
+ import { Subject, merge, map, exhaustMap, isObservable, take, of, filter } from 'rxjs';
14
+ import * as i1$1 from '@taiga-ui/cdk/portals';
15
+ import { tuiAsPortal, TuiPortalDirective } from '@taiga-ui/cdk/portals';
16
+ import { TuiThemeColorService } from '@taiga-ui/addon-mobile/services';
17
+ import { TuiModalService } from '@taiga-ui/core/portals/modal';
17
18
 
18
19
  const REQUIRED_ERROR = new Error(ngDevMode ? 'Required dialog was dismissed' : '');
19
20
  class TuiSheetDialogComponent {
20
21
  constructor() {
21
- this.stops = EMPTY_QUERY;
22
+ this.stops = viewChildren('stops', { read: ElementRef });
22
23
  this.el = tuiInjectElement();
23
24
  this.pointers = 0;
24
25
  this.context = injectContext();
25
26
  this.close$ = new Subject();
26
27
  this.$ = merge(this.close$, tuiCloseWatcher(), inject(TUI_DIALOGS_CLOSE).pipe(map(TUI_TRUE_HANDLER)))
27
28
  .pipe(tuiZonefull(), exhaustMap(() => {
28
- if (isObservable(this.context.closeable)) {
29
+ if (isObservable(this.context.closable)) {
29
30
  if (this.el.scrollTop <= 0) {
30
31
  this.el.scrollTo({ top: this.initial, behavior: 'smooth' });
31
32
  }
32
- return this.context.closeable.pipe(take(1));
33
+ return this.context.closable.pipe(take(1));
33
34
  }
34
- return of(this.context.closeable);
35
+ return of(this.context.closable);
35
36
  }), filter(Boolean), takeUntilDestroyed())
36
37
  .subscribe(() => this.close());
37
38
  }
38
39
  ngAfterViewInit() {
39
- this.el.scrollTop = this.initial;
40
+ this.el.scrollTop = this.initial || 0;
40
41
  }
41
42
  onPointerChange(delta) {
42
43
  this.pointers = Math.max(this.pointers + delta, 0);
@@ -45,12 +46,11 @@ class TuiSheetDialogComponent {
45
46
  }
46
47
  }
47
48
  get initial() {
48
- if (!this.context.closeable) {
49
- return 0;
50
- }
51
- return (this.stops
52
- .map((e) => e.nativeElement.offsetTop - this.context.offset)
53
- .concat(this.el.clientHeight ?? Infinity)[this.context.initial] ?? 0);
49
+ return this.context.closable
50
+ ? this.stops()
51
+ .map((e) => e.nativeElement.offsetTop - this.context.offset)
52
+ .concat(this.el.clientHeight ?? Infinity)[this.context.initial]
53
+ : 0;
54
54
  }
55
55
  close() {
56
56
  if (this.context.required) {
@@ -60,26 +60,23 @@ class TuiSheetDialogComponent {
60
60
  this.context.$implicit.complete();
61
61
  }
62
62
  }
63
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
64
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiSheetDialogComponent, isStandalone: true, selector: "tui-sheet-dialog", host: { listeners: { "document:touchstart.passive.zoneless": "onPointerChange(1)", "document:touchend.zoneless": "onPointerChange(-1)", "document:touchcancel.zoneless": "onPointerChange(-1)", "scroll.zoneless": "onPointerChange(0)", "click.self": "close$.next()" }, properties: { "attr.data-appearance": "context.appearance", "style.--tui-offset.px": "context.offset", "class._closeable": "context.closeable", "class._fullscreen": "context.fullscreen === true" } }, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], viewQueries: [{ propertyName: "stops", predicate: ["stops"], descendants: true }], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<div class=\"t-stops\">\n <div\n *ngFor=\"let stop of context.stops\"\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n</div>\n<div class=\"t-sheet\">\n <div\n *ngIf=\"context.bar && !context.appearance.includes('fullscreen')\"\n class=\"t-top\"\n ></div>\n <h2\n *ngIf=\"context.label\"\n class=\"t-heading\"\n [id]=\"context.id\"\n >\n <ng-container *polymorpheusOutlet=\"context.label as label; context: context\">\n {{ label }}\n </ng-container>\n </h2>\n <div class=\"t-content\">\n <div\n *polymorpheusOutlet=\"context.content as text; context: context\"\n [innerHTML]=\"text\"\n ></div>\n </div>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;display:flex;inline-size:100%;max-inline-size:40rem;block-size:calc(100% - max(var(--tui-offset),env(safe-area-inset-top)));flex-direction:column;font:var(--tui-font-text-m);overflow-y:scroll;scroll-snap-type:y mandatory;margin:max(var(--tui-offset),env(safe-area-inset-top)) auto 0;border-radius:.75rem .75rem 0 0}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host:before{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";z-index:-1}:host._closeable{display:block}:host._closeable .t-stops{display:flex}:host._fullscreen,:host[data-appearance~=fullscreen]{display:block}:host._fullscreen .t-sheet,:host[data-appearance~=fullscreen] .t-sheet{display:flex;flex-direction:column;min-block-size:100%}:host._fullscreen .t-content,:host[data-appearance~=fullscreen] .t-content{display:flex;flex-direction:column;flex-grow:1}:host._fullscreen .t-content ::ng-deep>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>header,:host._fullscreen .t-content ::ng-deep>[tuiSlides]>*>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>[tuiSlides]>*>header,:host._fullscreen .t-content ::ng-deep>ng-component>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>header,:host._fullscreen .t-content ::ng-deep>ng-component>[tuiSlides]>*>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>[tuiSlides]>*>header{margin-block-end:1.5rem;font:var(--tui-font-heading-3)}:host._fullscreen .t-content ::ng-deep>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>header+p,:host._fullscreen .t-content ::ng-deep>[tuiSlides]>*>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>[tuiSlides]>*>header+p,:host._fullscreen .t-content ::ng-deep>ng-component>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>header+p,:host._fullscreen .t-content ::ng-deep>ng-component>[tuiSlides]>*>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>[tuiSlides]>*>header+p{margin:-.5rem 0 1.5rem}:host._fullscreen .t-content ::ng-deep>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>header:empty,:host._fullscreen .t-content ::ng-deep>[tuiSlides]>*>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>[tuiSlides]>*>header:empty,:host._fullscreen .t-content ::ng-deep>ng-component>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>header:empty,:host._fullscreen .t-content ::ng-deep>ng-component>[tuiSlides]>*>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>[tuiSlides]>*>header:empty{display:none}.t-stops{display:none;block-size:100%;scroll-snap-stop:always;scroll-snap-align:start;pointer-events:none}.t-stop{position:relative;top:env(safe-area-inset-bottom);scroll-snap-stop:normal;scroll-snap-align:start;block-size:1rem;inline-size:1rem}.t-sheet{scrollbar-width:none;-ms-overflow-style:none;inline-size:100%;box-shadow:var(--tui-shadow-small);border-radius:inherit;padding:0 1rem;margin-block-start:auto;background:var(--tui-background-elevation-1);box-sizing:border-box;scroll-snap-stop:always;scroll-snap-align:start}.t-sheet::-webkit-scrollbar,.t-sheet::-webkit-scrollbar-thumb{display:none}.t-top{position:sticky;top:0;z-index:1;block-size:1.5rem;margin:0 -1rem;border-radius:inherit;background:var(--tui-background-elevation-1)}.t-top:after{content:\"\";position:absolute;top:.5rem;left:50%;inline-size:2rem;block-size:.25rem;transform:translate(-50%);background:var(--tui-border-normal);border-radius:1rem}.t-heading{position:sticky;top:1.5rem;z-index:1;margin:0 -1rem;padding:.75rem 1rem;font:var(--tui-font-heading-6);background:var(--tui-background-elevation-1)}.t-heading:first-child{top:0;border-radius:inherit}.t-heading:last-child{padding-block-end:1.5rem}.t-content{position:relative;isolation:isolate;padding-block-end:max(1.5rem,env(safe-area-inset-bottom));border-radius:inherit}.t-content:after{content:\"\";position:relative;top:max(1.5rem,env(safe-area-inset-bottom));z-index:-1;display:block;scroll-snap-stop:always;scroll-snap-align:end;border-image:conic-gradient(var(--tui-background-elevation-1) 0 0) fill 0/0/0 100vh 100vh}\n"], dependencies: [{ kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
63
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
64
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiSheetDialogComponent, isStandalone: true, selector: "tui-sheet-dialog", host: { listeners: { "document:touchstart.passive.zoneless": "onPointerChange(1)", "document:touchend.zoneless": "onPointerChange(-1)", "document:touchcancel.zoneless": "onPointerChange(-1)", "scroll.zoneless": "onPointerChange(0)", "click.self": "close$.next()" }, properties: { "attr.data-appearance": "context.appearance", "style.--tui-offset.px": "context.offset", "class._bar": "context.bar", "class._closeable": "context.closable" } }, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], viewQueries: [{ propertyName: "stops", predicate: ["stops"], descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<div class=\"t-stops\">\n @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-block-start]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n <div class=\"t-bar\"></div>\n <div class=\"t-content\">\n @if (context.label) {\n <header\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></header>\n }\n <div\n *polymorpheusOutlet=\"context.content as text; context: context\"\n [innerHTML]=\"text\"\n ></div>\n </div>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;position:sticky;display:flex;inset-inline-start:0;inline-size:100%;max-inline-size:40rem;block-size:calc(100% - max(var(--tui-offset),env(safe-area-inset-top)));flex-direction:column;font:var(--tui-font-body-m);overflow-y:scroll;scroll-snap-type:y mandatory;margin:max(var(--tui-offset),env(safe-area-inset-top)) auto 0;border-radius:.75rem .75rem 0 0;--t-top: 0}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host:before{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";z-index:-1}:host._bar{--t-top: 1.5rem}:host._bar .t-bar{display:block}:host._closeable{display:block}:host._closeable .t-stops{display:flex}:host[data-appearance~=fullscreen]{display:block}:host[data-appearance~=fullscreen] .t-sheet{min-block-size:100%}:host ::ng-deep tui-data-list{margin-inline-start:calc(-1 * var(--tui-data-list-padding));margin-inline-end:calc(-1 * var(--tui-data-list-padding))}:host ::ng-deep tui-data-list [tuiOption][data-size]{margin-inline:-.5rem;padding-inline:.5rem}.t-stops{display:none;block-size:100%;scroll-snap-stop:always;scroll-snap-align:start;pointer-events:none}.t-stop{position:relative;top:env(safe-area-inset-bottom);scroll-snap-stop:normal;scroll-snap-align:start;block-size:1rem;inline-size:1rem}.t-sheet{display:flex;inline-size:100%;flex-direction:column;box-shadow:var(--tui-shadow-small);border-radius:inherit;padding:0 1rem;margin-block-start:auto;background:var(--tui-background-elevation-1);box-sizing:border-box;scroll-snap-stop:always;scroll-snap-align:start}.t-bar{position:sticky;top:0;z-index:1;display:none;block-size:1.5rem;margin:0 -1rem;border-radius:inherit;background:var(--tui-background-elevation-1)}.t-bar:after{content:\"\";position:absolute;top:.5rem;left:50%;inline-size:2rem;block-size:.25rem;transform:translate(-50%);background:var(--tui-border-normal);border-radius:1rem}.t-content{position:relative;display:flex;flex-direction:column;flex-grow:1;border-radius:inherit;isolation:isolate;padding-block-end:max(1.5rem,env(safe-area-inset-bottom))}.t-content:after{content:\"\";position:relative;top:max(1.5rem,env(safe-area-inset-bottom));z-index:-1;display:block;scroll-snap-stop:always;scroll-snap-align:end;border-image:conic-gradient(var(--tui-background-elevation-1) 0 0) fill 0/0/0 100vh 100vh}* ::ng-deep>header,* ::ng-deep>[tuiSlides]>*>header,* ::ng-deep>ng-component>header,* ::ng-deep>ng-component>[tuiSlides]>*>header{position:sticky;top:var(--t-top);z-index:1;margin:0 -1rem;padding:.75rem 1rem;border-radius:inherit;background:var(--tui-background-elevation-1);font:var(--tui-font-heading-h6)}* ::ng-deep>footer:not([tuiFloatingContainer]),* ::ng-deep>[tuiSlides]>*>footer:not([tuiFloatingContainer]),* ::ng-deep>ng-component>footer:not([tuiFloatingContainer]),* ::ng-deep>ng-component>[tuiSlides]>*>footer:not([tuiFloatingContainer]){display:flex;flex-direction:column-reverse;gap:.5rem;margin-block-start:1rem}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
65
65
  }
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialogComponent, decorators: [{
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialogComponent, decorators: [{
67
67
  type: Component,
68
- args: [{ standalone: true, selector: 'tui-sheet-dialog', imports: [NgForOf, NgIf, PolymorpheusOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], hostDirectives: [TuiAnimated], host: {
68
+ args: [{ selector: 'tui-sheet-dialog', imports: [PolymorpheusOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], hostDirectives: [TuiAnimated], host: {
69
69
  '[attr.data-appearance]': 'context.appearance',
70
70
  '[style.--tui-offset.px]': 'context.offset',
71
- '[class._closeable]': 'context.closeable',
72
- '[class._fullscreen]': 'context.fullscreen === true',
71
+ '[class._bar]': 'context.bar',
72
+ '[class._closeable]': 'context.closable',
73
73
  '(document:touchstart.passive.zoneless)': 'onPointerChange(1)',
74
74
  '(document:touchend.zoneless)': 'onPointerChange(-1)',
75
75
  '(document:touchcancel.zoneless)': 'onPointerChange(-1)',
76
76
  '(scroll.zoneless)': 'onPointerChange(0)',
77
77
  '(click.self)': 'close$.next()',
78
- }, template: "<div class=\"t-stops\">\n <div\n *ngFor=\"let stop of context.stops\"\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n</div>\n<div class=\"t-sheet\">\n <div\n *ngIf=\"context.bar && !context.appearance.includes('fullscreen')\"\n class=\"t-top\"\n ></div>\n <h2\n *ngIf=\"context.label\"\n class=\"t-heading\"\n [id]=\"context.id\"\n >\n <ng-container *polymorpheusOutlet=\"context.label as label; context: context\">\n {{ label }}\n </ng-container>\n </h2>\n <div class=\"t-content\">\n <div\n *polymorpheusOutlet=\"context.content as text; context: context\"\n [innerHTML]=\"text\"\n ></div>\n </div>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;display:flex;inline-size:100%;max-inline-size:40rem;block-size:calc(100% - max(var(--tui-offset),env(safe-area-inset-top)));flex-direction:column;font:var(--tui-font-text-m);overflow-y:scroll;scroll-snap-type:y mandatory;margin:max(var(--tui-offset),env(safe-area-inset-top)) auto 0;border-radius:.75rem .75rem 0 0}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host:before{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";z-index:-1}:host._closeable{display:block}:host._closeable .t-stops{display:flex}:host._fullscreen,:host[data-appearance~=fullscreen]{display:block}:host._fullscreen .t-sheet,:host[data-appearance~=fullscreen] .t-sheet{display:flex;flex-direction:column;min-block-size:100%}:host._fullscreen .t-content,:host[data-appearance~=fullscreen] .t-content{display:flex;flex-direction:column;flex-grow:1}:host._fullscreen .t-content ::ng-deep>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>header,:host._fullscreen .t-content ::ng-deep>[tuiSlides]>*>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>[tuiSlides]>*>header,:host._fullscreen .t-content ::ng-deep>ng-component>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>header,:host._fullscreen .t-content ::ng-deep>ng-component>[tuiSlides]>*>header,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>[tuiSlides]>*>header{margin-block-end:1.5rem;font:var(--tui-font-heading-3)}:host._fullscreen .t-content ::ng-deep>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>header+p,:host._fullscreen .t-content ::ng-deep>[tuiSlides]>*>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>[tuiSlides]>*>header+p,:host._fullscreen .t-content ::ng-deep>ng-component>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>header+p,:host._fullscreen .t-content ::ng-deep>ng-component>[tuiSlides]>*>header+p,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>[tuiSlides]>*>header+p{margin:-.5rem 0 1.5rem}:host._fullscreen .t-content ::ng-deep>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>header:empty,:host._fullscreen .t-content ::ng-deep>[tuiSlides]>*>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>[tuiSlides]>*>header:empty,:host._fullscreen .t-content ::ng-deep>ng-component>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>header:empty,:host._fullscreen .t-content ::ng-deep>ng-component>[tuiSlides]>*>header:empty,:host[data-appearance~=fullscreen] .t-content ::ng-deep>ng-component>[tuiSlides]>*>header:empty{display:none}.t-stops{display:none;block-size:100%;scroll-snap-stop:always;scroll-snap-align:start;pointer-events:none}.t-stop{position:relative;top:env(safe-area-inset-bottom);scroll-snap-stop:normal;scroll-snap-align:start;block-size:1rem;inline-size:1rem}.t-sheet{scrollbar-width:none;-ms-overflow-style:none;inline-size:100%;box-shadow:var(--tui-shadow-small);border-radius:inherit;padding:0 1rem;margin-block-start:auto;background:var(--tui-background-elevation-1);box-sizing:border-box;scroll-snap-stop:always;scroll-snap-align:start}.t-sheet::-webkit-scrollbar,.t-sheet::-webkit-scrollbar-thumb{display:none}.t-top{position:sticky;top:0;z-index:1;block-size:1.5rem;margin:0 -1rem;border-radius:inherit;background:var(--tui-background-elevation-1)}.t-top:after{content:\"\";position:absolute;top:.5rem;left:50%;inline-size:2rem;block-size:.25rem;transform:translate(-50%);background:var(--tui-border-normal);border-radius:1rem}.t-heading{position:sticky;top:1.5rem;z-index:1;margin:0 -1rem;padding:.75rem 1rem;font:var(--tui-font-heading-6);background:var(--tui-background-elevation-1)}.t-heading:first-child{top:0;border-radius:inherit}.t-heading:last-child{padding-block-end:1.5rem}.t-content{position:relative;isolation:isolate;padding-block-end:max(1.5rem,env(safe-area-inset-bottom));border-radius:inherit}.t-content:after{content:\"\";position:relative;top:max(1.5rem,env(safe-area-inset-bottom));z-index:-1;display:block;scroll-snap-stop:always;scroll-snap-align:end;border-image:conic-gradient(var(--tui-background-elevation-1) 0 0) fill 0/0/0 100vh 100vh}\n"] }]
79
- }], propDecorators: { stops: [{
80
- type: ViewChildren,
81
- args: ['stops']
82
- }] } });
78
+ }, template: "<div class=\"t-stops\">\n @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-block-start]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n <div class=\"t-bar\"></div>\n <div class=\"t-content\">\n @if (context.label) {\n <header\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></header>\n }\n <div\n *polymorpheusOutlet=\"context.content as text; context: context\"\n [innerHTML]=\"text\"\n ></div>\n </div>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;position:sticky;display:flex;inset-inline-start:0;inline-size:100%;max-inline-size:40rem;block-size:calc(100% - max(var(--tui-offset),env(safe-area-inset-top)));flex-direction:column;font:var(--tui-font-body-m);overflow-y:scroll;scroll-snap-type:y mandatory;margin:max(var(--tui-offset),env(safe-area-inset-top)) auto 0;border-radius:.75rem .75rem 0 0;--t-top: 0}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host:before{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";z-index:-1}:host._bar{--t-top: 1.5rem}:host._bar .t-bar{display:block}:host._closeable{display:block}:host._closeable .t-stops{display:flex}:host[data-appearance~=fullscreen]{display:block}:host[data-appearance~=fullscreen] .t-sheet{min-block-size:100%}:host ::ng-deep tui-data-list{margin-inline-start:calc(-1 * var(--tui-data-list-padding));margin-inline-end:calc(-1 * var(--tui-data-list-padding))}:host ::ng-deep tui-data-list [tuiOption][data-size]{margin-inline:-.5rem;padding-inline:.5rem}.t-stops{display:none;block-size:100%;scroll-snap-stop:always;scroll-snap-align:start;pointer-events:none}.t-stop{position:relative;top:env(safe-area-inset-bottom);scroll-snap-stop:normal;scroll-snap-align:start;block-size:1rem;inline-size:1rem}.t-sheet{display:flex;inline-size:100%;flex-direction:column;box-shadow:var(--tui-shadow-small);border-radius:inherit;padding:0 1rem;margin-block-start:auto;background:var(--tui-background-elevation-1);box-sizing:border-box;scroll-snap-stop:always;scroll-snap-align:start}.t-bar{position:sticky;top:0;z-index:1;display:none;block-size:1.5rem;margin:0 -1rem;border-radius:inherit;background:var(--tui-background-elevation-1)}.t-bar:after{content:\"\";position:absolute;top:.5rem;left:50%;inline-size:2rem;block-size:.25rem;transform:translate(-50%);background:var(--tui-border-normal);border-radius:1rem}.t-content{position:relative;display:flex;flex-direction:column;flex-grow:1;border-radius:inherit;isolation:isolate;padding-block-end:max(1.5rem,env(safe-area-inset-bottom))}.t-content:after{content:\"\";position:relative;top:max(1.5rem,env(safe-area-inset-bottom));z-index:-1;display:block;scroll-snap-stop:always;scroll-snap-align:end;border-image:conic-gradient(var(--tui-background-elevation-1) 0 0) fill 0/0/0 100vh 100vh}* ::ng-deep>header,* ::ng-deep>[tuiSlides]>*>header,* ::ng-deep>ng-component>header,* ::ng-deep>ng-component>[tuiSlides]>*>header{position:sticky;top:var(--t-top);z-index:1;margin:0 -1rem;padding:.75rem 1rem;border-radius:inherit;background:var(--tui-background-elevation-1);font:var(--tui-font-heading-h6)}* ::ng-deep>footer:not([tuiFloatingContainer]),* ::ng-deep>[tuiSlides]>*>footer:not([tuiFloatingContainer]),* ::ng-deep>ng-component>footer:not([tuiFloatingContainer]),* ::ng-deep>ng-component>[tuiSlides]>*>footer:not([tuiFloatingContainer]){display:flex;flex-direction:column-reverse;gap:.5rem;margin-block-start:1rem}\n"] }]
79
+ }] });
83
80
 
84
81
  const TUI_SHEET_DIALOG_DEFAULT_OPTIONS = {
85
82
  label: '',
@@ -87,63 +84,67 @@ const TUI_SHEET_DIALOG_DEFAULT_OPTIONS = {
87
84
  stops: [],
88
85
  initial: 0,
89
86
  offset: 16,
90
- closeable: true,
87
+ closable: true,
91
88
  data: undefined,
92
89
  bar: true,
93
- fullscreen: false,
94
90
  required: false,
95
91
  };
96
92
  /**
97
93
  * Default parameters for mobile dialog component
98
94
  */
99
- const TUI_SHEET_DIALOG_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_SHEET_DIALOG_OPTIONS' : '', {
100
- factory: () => TUI_SHEET_DIALOG_DEFAULT_OPTIONS,
101
- });
102
- function tuiSheetDialogOptionsProvider(options) {
103
- return tuiProvideOptions(TUI_SHEET_DIALOG_OPTIONS, options, TUI_SHEET_DIALOG_DEFAULT_OPTIONS);
104
- }
95
+ const [TUI_SHEET_DIALOG_OPTIONS, tuiSheetDialogOptionsProvider] = tuiCreateOptions(TUI_SHEET_DIALOG_DEFAULT_OPTIONS);
105
96
 
106
97
  const THEME = '#404040';
107
- class TuiSheetDialogService extends TuiPopoverService {
98
+ class TuiSheetDialogService extends TuiModalService {
108
99
  constructor() {
109
100
  super(...arguments);
110
101
  this.theme = inject(TuiThemeColorService);
111
102
  this.initial = this.theme.color;
112
- this.$ = this.items$
113
- .pipe(startWith([]), pairwise(), takeUntilDestroyed())
114
- .subscribe(([prev, next]) => {
115
- if (!prev.length && next.length) {
116
- this.initial = this.theme.color;
117
- this.theme.color = THEME;
118
- }
119
- if (!next.length && prev.length) {
103
+ this.count = 0;
104
+ this.options = inject(TUI_SHEET_DIALOG_OPTIONS);
105
+ this.content = TuiSheetDialogComponent;
106
+ }
107
+ add(component) {
108
+ this.count++;
109
+ this.theme.color = THEME;
110
+ const cleanup = super.add(component);
111
+ return () => {
112
+ cleanup();
113
+ this.count--;
114
+ if (!this.count) {
120
115
  this.theme.color = this.initial;
121
116
  }
122
- });
117
+ };
123
118
  }
124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
125
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialogService, providedIn: 'root', useFactory: () => new TuiSheetDialogService(TUI_DIALOGS, TuiSheetDialogComponent, inject(TUI_SHEET_DIALOG_OPTIONS)) }); }
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
120
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialogService, providedIn: 'root' }); }
126
121
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialogService, decorators: [{
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialogService, decorators: [{
128
123
  type: Injectable,
129
124
  args: [{
130
125
  providedIn: 'root',
131
- useFactory: () => new TuiSheetDialogService(TUI_DIALOGS, TuiSheetDialogComponent, inject(TUI_SHEET_DIALOG_OPTIONS)),
132
126
  }]
133
127
  }] });
134
128
 
135
- class TuiSheetDialog extends TuiPopoverDirective {
136
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialog, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
137
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiSheetDialog, isStandalone: true, selector: "ng-template[tuiSheetDialog]", inputs: { options: ["tuiSheetDialogOptions", "options"], open: ["tuiSheetDialog", "open"] }, outputs: { openChange: "tuiSheetDialogChange" }, providers: [tuiAsPopover(TuiSheetDialogService)], usesInheritance: true, ngImport: i0 }); }
129
+ class TuiSheetDialog {
130
+ constructor() {
131
+ this.tuiSheetDialogOptions = input({});
132
+ }
133
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialog, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
134
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiSheetDialog, isStandalone: true, selector: "ng-template[tuiSheetDialog]", inputs: { tuiSheetDialogOptions: { classPropertyName: "tuiSheetDialogOptions", publicName: "tuiSheetDialogOptions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [tuiAsPortal(TuiSheetDialogService)], hostDirectives: [{ directive: i1$1.TuiPortalDirective, inputs: ["options", "tuiSheetDialogOptions", "open", "tuiSheetDialog"], outputs: ["openChange", "tuiSheetDialogChange"] }], ngImport: i0 }); }
138
135
  }
139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSheetDialog, decorators: [{
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSheetDialog, decorators: [{
140
137
  type: Directive,
141
138
  args: [{
142
- standalone: true,
143
139
  selector: 'ng-template[tuiSheetDialog]',
144
- inputs: ['options: tuiSheetDialogOptions', 'open: tuiSheetDialog'],
145
- outputs: ['openChange: tuiSheetDialogChange'],
146
- providers: [tuiAsPopover(TuiSheetDialogService)],
140
+ providers: [tuiAsPortal(TuiSheetDialogService)],
141
+ hostDirectives: [
142
+ {
143
+ directive: TuiPortalDirective,
144
+ inputs: ['options: tuiSheetDialogOptions', 'open: tuiSheetDialog'],
145
+ outputs: ['openChange: tuiSheetDialogChange'],
146
+ },
147
+ ],
147
148
  }]
148
149
  }] });
149
150
 
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-components-sheet-dialog.mjs","sources":["../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.template.html","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.options.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.service.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.directive.ts","../../../projects/addon-mobile/components/sheet-dialog/taiga-ui-addon-mobile-components-sheet-dialog.ts"],"sourcesContent":["import {NgForOf, NgIf} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n type QueryList,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {EMPTY_QUERY, TUI_TRUE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiCloseWatcher, tuiZonefull} from '@taiga-ui/cdk/observables';\nimport {type TuiPopover} from '@taiga-ui/cdk/services';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_DIALOGS_CLOSE} from '@taiga-ui/core/components/dialog';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {exhaustMap, filter, isObservable, map, merge, of, Subject, take} from 'rxjs';\n\nimport {type TuiSheetDialogOptions} from './sheet-dialog.options';\n\nconst REQUIRED_ERROR = new Error(ngDevMode ? 'Required dialog was dismissed' : '');\n\n@Component({\n standalone: true,\n selector: 'tui-sheet-dialog',\n imports: [NgForOf, NgIf, PolymorpheusOutlet],\n templateUrl: './sheet-dialog.template.html',\n styleUrls: ['./sheet-dialog.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)],\n hostDirectives: [TuiAnimated],\n host: {\n '[attr.data-appearance]': 'context.appearance',\n '[style.--tui-offset.px]': 'context.offset',\n '[class._closeable]': 'context.closeable',\n '[class._fullscreen]': 'context.fullscreen === true',\n '(document:touchstart.passive.zoneless)': 'onPointerChange(1)',\n '(document:touchend.zoneless)': 'onPointerChange(-1)',\n '(document:touchcancel.zoneless)': 'onPointerChange(-1)',\n '(scroll.zoneless)': 'onPointerChange(0)',\n '(click.self)': 'close$.next()',\n },\n})\nexport class TuiSheetDialogComponent<I> implements AfterViewInit {\n @ViewChildren('stops')\n private readonly stops: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n private readonly el = tuiInjectElement();\n private pointers = 0;\n\n protected readonly context =\n injectContext<TuiPopover<TuiSheetDialogOptions<I>, any>>();\n\n protected readonly close$ = new Subject<void>();\n protected readonly $ = merge(\n this.close$,\n tuiCloseWatcher(),\n inject(TUI_DIALOGS_CLOSE).pipe(map(TUI_TRUE_HANDLER)),\n )\n .pipe(\n tuiZonefull(),\n exhaustMap(() => {\n if (isObservable(this.context.closeable)) {\n if (this.el.scrollTop <= 0) {\n this.el.scrollTo({top: this.initial, behavior: 'smooth'});\n }\n\n return this.context.closeable.pipe(take(1));\n }\n\n return of(this.context.closeable);\n }),\n filter(Boolean),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.close());\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.initial;\n }\n\n protected onPointerChange(delta: number): void {\n this.pointers = Math.max(this.pointers + delta, 0);\n\n if (!this.pointers && this.el.scrollTop <= 0) {\n this.close$.next();\n }\n }\n\n private get initial(): number {\n if (!this.context.closeable) {\n return 0;\n }\n\n return (\n this.stops\n .map((e) => e.nativeElement.offsetTop - this.context.offset)\n .concat(this.el.clientHeight ?? Infinity)[this.context.initial] ?? 0\n );\n }\n\n private close(): void {\n if (this.context.required) {\n this.context.$implicit.error(REQUIRED_ERROR);\n } else {\n this.context.$implicit.complete();\n }\n }\n}\n","<div class=\"t-stops\">\n <div\n *ngFor=\"let stop of context.stops\"\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n</div>\n<div class=\"t-sheet\">\n <div\n *ngIf=\"context.bar && !context.appearance.includes('fullscreen')\"\n class=\"t-top\"\n ></div>\n <h2\n *ngIf=\"context.label\"\n class=\"t-heading\"\n [id]=\"context.id\"\n >\n <ng-container *polymorpheusOutlet=\"context.label as label; context: context\">\n {{ label }}\n </ng-container>\n </h2>\n <div class=\"t-content\">\n <div\n *polymorpheusOutlet=\"context.content as text; context: context\"\n [innerHTML]=\"text\"\n ></div>\n </div>\n</div>\n","import {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiPopover} from '@taiga-ui/cdk/services';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {type Observable} from 'rxjs';\n\nexport interface TuiSheetDialogOptions<I = undefined> {\n readonly appearance: string;\n readonly closeable: Observable<boolean> | boolean;\n readonly data: I;\n readonly initial: number;\n readonly label: PolymorpheusContent<TuiPopover<TuiSheetDialogOptions<I>, any>>;\n readonly offset: number;\n readonly stops: readonly string[];\n readonly bar: boolean;\n /** @deprecated add 'fullscreen' in appearance string */\n readonly fullscreen: boolean;\n readonly required: boolean;\n}\n\nexport const TUI_SHEET_DIALOG_DEFAULT_OPTIONS: TuiSheetDialogOptions = {\n label: '',\n appearance: '',\n stops: [],\n initial: 0,\n offset: 16,\n closeable: true,\n data: undefined,\n bar: true,\n fullscreen: false,\n required: false,\n};\n\n/**\n * Default parameters for mobile dialog component\n */\nexport const TUI_SHEET_DIALOG_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_SHEET_DIALOG_OPTIONS' : '',\n {\n factory: () => TUI_SHEET_DIALOG_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiSheetDialogOptionsProvider(\n options: Partial<TuiSheetDialogOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_SHEET_DIALOG_OPTIONS,\n options,\n TUI_SHEET_DIALOG_DEFAULT_OPTIONS,\n );\n}\n","import {inject, Injectable} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiPopoverService, TuiThemeColorService} from '@taiga-ui/cdk/services';\nimport {TUI_DIALOGS} from '@taiga-ui/core/components/dialog';\nimport {pairwise, startWith} from 'rxjs';\n\nimport {TuiSheetDialogComponent} from './sheet-dialog.component';\nimport {\n TUI_SHEET_DIALOG_OPTIONS,\n type TuiSheetDialogOptions,\n} from './sheet-dialog.options';\n\nconst THEME = '#404040';\n\n@Injectable({\n providedIn: 'root',\n useFactory: () =>\n new TuiSheetDialogService(\n TUI_DIALOGS,\n TuiSheetDialogComponent,\n inject(TUI_SHEET_DIALOG_OPTIONS),\n ),\n})\nexport class TuiSheetDialogService extends TuiPopoverService<TuiSheetDialogOptions<any>> {\n private readonly theme = inject(TuiThemeColorService);\n private initial = this.theme.color;\n\n protected readonly $ = this.items$\n .pipe(startWith([]), pairwise(), takeUntilDestroyed())\n .subscribe(([prev, next]) => {\n if (!prev.length && next.length) {\n this.initial = this.theme.color;\n this.theme.color = THEME;\n }\n\n if (!next.length && prev.length) {\n this.theme.color = this.initial;\n }\n });\n}\n","import {Directive} from '@angular/core';\nimport {TuiPopoverDirective} from '@taiga-ui/cdk/directives/popover';\nimport {tuiAsPopover} from '@taiga-ui/cdk/services';\n\nimport {type TuiSheetDialogOptions} from './sheet-dialog.options';\nimport {TuiSheetDialogService} from './sheet-dialog.service';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[tuiSheetDialog]',\n inputs: ['options: tuiSheetDialogOptions', 'open: tuiSheetDialog'],\n outputs: ['openChange: tuiSheetDialogChange'],\n providers: [tuiAsPopover(TuiSheetDialogService)],\n})\nexport class TuiSheetDialog extends TuiPopoverDirective<TuiSheetDialogOptions> {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwBA,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,SAAS,GAAG,+BAA+B,GAAG,EAAE,CAAC,CAAC;AAEnF,MAqBa,uBAAuB,CAAA;AArBpC,IAAA,WAAA,GAAA;QAuBqB,IAAK,CAAA,KAAA,GAAuC,WAAW,CAAC;QAExD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE,CAAC;QACjC,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAC;QAEF,IAAO,CAAA,OAAA,GACtB,aAAa,EAA6C,CAAC;AAE5C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,EAAQ,CAAC;QAC7B,IAAC,CAAA,CAAA,GAAG,KAAK,CACxB,IAAI,CAAC,MAAM,EACX,eAAe,EAAE,EACjB,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CACxD;AACI,aAAA,IAAI,CACD,WAAW,EAAE,EACb,UAAU,CAAC,MAAK;YACZ,IAAI,YAAY,CA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AO,EAAE,CAAC,kCAAkC,CAAC;AAC7C,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AACnD,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components-sheet-dialog.mjs","sources":["../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.template.html","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.options.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.service.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.directive.ts","../../../projects/addon-mobile/components/sheet-dialog/taiga-ui-addon-mobile-components-sheet-dialog.ts"],"sourcesContent":["import {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n viewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TUI_TRUE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiCloseWatcher, tuiZonefull} from '@taiga-ui/cdk/observables';\nimport {type TuiPortalContext} from '@taiga-ui/cdk/portals';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/components/scrollbar';\nimport {TUI_DIALOGS_CLOSE} from '@taiga-ui/core/portals/dialog';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {exhaustMap, filter, isObservable, map, merge, of, Subject, take} from 'rxjs';\n\nimport {type TuiSheetDialogOptions} from './sheet-dialog.options';\n\nconst REQUIRED_ERROR = new Error(ngDevMode ? 'Required dialog was dismissed' : '');\n\n@Component({\n selector: 'tui-sheet-dialog',\n imports: [PolymorpheusOutlet],\n templateUrl: './sheet-dialog.template.html',\n styleUrl: './sheet-dialog.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)],\n hostDirectives: [TuiAnimated],\n host: {\n '[attr.data-appearance]': 'context.appearance',\n '[style.--tui-offset.px]': 'context.offset',\n '[class._bar]': 'context.bar',\n '[class._closeable]': 'context.closable',\n '(document:touchstart.passive.zoneless)': 'onPointerChange(1)',\n '(document:touchend.zoneless)': 'onPointerChange(-1)',\n '(document:touchcancel.zoneless)': 'onPointerChange(-1)',\n '(scroll.zoneless)': 'onPointerChange(0)',\n '(click.self)': 'close$.next()',\n },\n})\nexport class TuiSheetDialogComponent<I> implements AfterViewInit {\n private readonly stops = viewChildren('stops', {read: ElementRef});\n private readonly el = tuiInjectElement();\n private pointers = 0;\n\n protected readonly context =\n injectContext<TuiPortalContext<TuiSheetDialogOptions<I>, any>>();\n\n protected readonly close$ = new Subject<void>();\n protected readonly $ = merge(\n this.close$,\n tuiCloseWatcher(),\n inject(TUI_DIALOGS_CLOSE).pipe(map(TUI_TRUE_HANDLER)),\n )\n .pipe(\n tuiZonefull(),\n exhaustMap(() => {\n if (isObservable(this.context.closable)) {\n if (this.el.scrollTop <= 0) {\n this.el.scrollTo({top: this.initial, behavior: 'smooth'});\n }\n\n return this.context.closable.pipe(take(1));\n }\n\n return of(this.context.closable);\n }),\n filter(Boolean),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.close());\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.initial || 0;\n }\n\n protected onPointerChange(delta: number): void {\n this.pointers = Math.max(this.pointers + delta, 0);\n\n if (!this.pointers && this.el.scrollTop <= 0) {\n this.close$.next();\n }\n }\n\n private get initial(): number | undefined {\n return this.context.closable\n ? this.stops()\n .map((e) => e.nativeElement.offsetTop - this.context.offset)\n .concat(this.el.clientHeight ?? Infinity)[this.context.initial]\n : 0;\n }\n\n private close(): void {\n if (this.context.required) {\n this.context.$implicit.error(REQUIRED_ERROR);\n } else {\n this.context.$implicit.complete();\n }\n }\n}\n","<div class=\"t-stops\">\n @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-block-start]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n <div class=\"t-bar\"></div>\n <div class=\"t-content\">\n @if (context.label) {\n <header\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></header>\n }\n <div\n *polymorpheusOutlet=\"context.content as text; context: context\"\n [innerHTML]=\"text\"\n ></div>\n </div>\n</div>\n","import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type Observable} from 'rxjs';\n\nexport interface TuiSheetDialogOptions<I = undefined> {\n readonly appearance: string;\n readonly closable: Observable<boolean> | boolean;\n readonly data: I extends void ? undefined : I;\n readonly initial: number;\n readonly label: string;\n readonly offset: number;\n readonly stops: readonly string[];\n readonly bar: boolean;\n readonly required: boolean;\n}\n\nexport const TUI_SHEET_DIALOG_DEFAULT_OPTIONS: TuiSheetDialogOptions = {\n label: '',\n appearance: '',\n stops: [],\n initial: 0,\n offset: 16,\n closable: true,\n data: undefined,\n bar: true,\n required: false,\n};\n\n/**\n * Default parameters for mobile dialog component\n */\nexport const [TUI_SHEET_DIALOG_OPTIONS, tuiSheetDialogOptionsProvider] = tuiCreateOptions(\n TUI_SHEET_DIALOG_DEFAULT_OPTIONS,\n);\n","import {inject, Injectable} from '@angular/core';\nimport {TuiThemeColorService} from '@taiga-ui/addon-mobile/services';\nimport {type TuiModalComponent, TuiModalService} from '@taiga-ui/core/portals/modal';\nimport {type PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\nimport {TuiSheetDialogComponent} from './sheet-dialog.component';\nimport {\n TUI_SHEET_DIALOG_OPTIONS,\n type TuiSheetDialogOptions,\n} from './sheet-dialog.options';\n\nconst THEME = '#404040';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiSheetDialogService extends TuiModalService<TuiSheetDialogOptions<any>> {\n private readonly theme = inject(TuiThemeColorService);\n private readonly initial = this.theme.color;\n private count = 0;\n\n protected readonly options = inject(TUI_SHEET_DIALOG_OPTIONS);\n protected readonly content = TuiSheetDialogComponent;\n\n protected override add(\n component: PolymorpheusComponent<TuiModalComponent<TuiSheetDialogOptions>>,\n ): () => void {\n this.count++;\n this.theme.color = THEME;\n\n const cleanup = super.add(component);\n\n return () => {\n cleanup();\n this.count--;\n\n if (!this.count) {\n this.theme.color = this.initial;\n }\n };\n }\n}\n","import {Directive, input} from '@angular/core';\nimport {tuiAsPortal, TuiPortalDirective} from '@taiga-ui/cdk/portals';\n\nimport {type TuiSheetDialogOptions} from './sheet-dialog.options';\nimport {TuiSheetDialogService} from './sheet-dialog.service';\n\n@Directive({\n selector: 'ng-template[tuiSheetDialog]',\n providers: [tuiAsPortal(TuiSheetDialogService)],\n hostDirectives: [\n {\n directive: TuiPortalDirective,\n inputs: ['options: tuiSheetDialogOptions', 'open: tuiSheetDialog'],\n outputs: ['openChange: tuiSheetDialogChange'],\n },\n ],\n})\nexport class TuiSheetDialog {\n public readonly tuiSheetDialogOptions = input<Partial<TuiSheetDialogOptions>>({});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,SAAS,GAAG,+BAA+B,GAAG,EAAE,CAAC;MAsBrE,uBAAuB,CAAA;AApBpC,IAAA,WAAA,GAAA;QAqBqB,IAAK,CAAA,KAAA,GAAG,YAAY,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC;QACjD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAChC,IAAQ,CAAA,QAAA,GAAG,CAAC;QAED,IAAO,CAAA,OAAA,GACtB,aAAa,EAAmD;AAEjD,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,EAAQ;QAC5B,IAAC,CAAA,CAAA,GAAG,KAAK,CACxB,IAAI,CAAC,MAAM,EACX,eAAe,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directive, Input } from '@angular/core';
2
+ import { inject, ChangeDetectorRef, ChangeDetectionStrategy, Component, input, Directive } from '@angular/core';
3
3
  import { WaResizeObserver } from '@ng-web-apis/resize-observer';
4
4
  import { tuiInjectElement, tuiGetActualTarget } from '@taiga-ui/cdk/utils/dom';
5
5
 
@@ -12,45 +12,37 @@ class TuiSwipeActions {
12
12
  this.actionsWidth = target.clientWidth;
13
13
  this.cdr.detectChanges();
14
14
  }
15
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSwipeActions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
16
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiSwipeActions, isStandalone: true, selector: "tui-swipe-actions", host: { properties: { "style.--t-actions-width": "actionsWidth" } }, ngImport: i0, template: "<div class=\"t-content\">\n <ng-content />\n</div>\n\n<div\n class=\"t-actions\"\n (waResizeObserver)=\"$event[0] && onResize($event[0])\"\n>\n <ng-content select=\"[tuiSwipeAction]\" />\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;--tui-action-gap: 24;--tui-actions-padding: .5rem;--tui-item-size: 44;--t-x: calc(50% + 50% * var(--tui-inline));display:flex;inline-size:-webkit-fill-available;inline-size:-moz-available;inline-size:stretch;align-items:center;overflow-x:scroll;overflow-y:hidden;scroll-snap-type:x mandatory;perspective:1px;perspective-origin:calc(var(--t-x) + var(--tui-inline) * (calc(1px * var(--tui-item-size) / 2) + var(--tui-actions-padding)))}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}.t-content{scroll-snap-align:start;flex-shrink:0;inline-size:100%}.t-actions{display:flex;gap:calc(1px * var(--tui-action-gap));padding:0 1rem 0 var(--tui-actions-padding);scroll-snap-align:start;align-items:center;transform-style:preserve-3d;pointer-events:none;transform:translateZ(-.00001px)}.t-actions:empty{display:none}::ng-deep .t-actions>*{pointer-events:auto}::ng-deep .t-actions>*:nth-child(2){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 1 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (2 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(3){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 2 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (3 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(4){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 3 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (4 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(5){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 4 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (5 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(6){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 5 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (6 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}@media (hover: hover) and (pointer: fine){.t-actions{display:none}}\n"], dependencies: [{ kind: "directive", type: WaResizeObserver, selector: "[waResizeObserver]", inputs: ["box"], outputs: ["waResizeObserver"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
15
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSwipeActions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
16
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TuiSwipeActions, isStandalone: true, selector: "tui-swipe-actions", host: { properties: { "style.--t-actions-width": "actionsWidth" } }, ngImport: i0, template: "<div class=\"t-content\">\n <ng-content />\n</div>\n\n<div\n class=\"t-actions\"\n (waResizeObserver)=\"$event[0] && onResize($event[0])\"\n>\n <ng-content select=\"[tuiSwipeAction]\" />\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;--tui-action-gap: 24;--tui-actions-padding: .5rem;--tui-item-size: 44;--t-x: calc(50% + 50% * var(--tui-inline));display:flex;inline-size:-webkit-fill-available;align-items:center;overflow-x:scroll;overflow-y:hidden;scroll-snap-type:x mandatory;perspective:1px;perspective-origin:calc(var(--t-x) + var(--tui-inline) * (calc(1px * var(--tui-item-size) / 2) + var(--tui-actions-padding)))}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}.t-content{scroll-snap-align:start;flex-shrink:0;inline-size:100%}.t-actions{display:flex;gap:calc(1px * var(--tui-action-gap));padding:0 1rem 0 var(--tui-actions-padding);scroll-snap-align:start;align-items:center;transform-style:preserve-3d;pointer-events:none;transform:translateZ(-.00001px)}.t-actions:empty{display:none}::ng-deep .t-actions>*{pointer-events:auto}::ng-deep .t-actions>*:nth-child(2){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 1 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (2 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(3){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 2 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (3 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(4){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 3 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (4 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(5){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 4 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (5 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(6){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 5 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (6 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}@media (hover: hover) and (pointer: fine){.t-actions{display:none}}\n"], dependencies: [{ kind: "directive", type: WaResizeObserver, selector: "[waResizeObserver]", inputs: ["waResizeBox"], outputs: ["waResizeObserver"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
17
17
  }
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSwipeActions, decorators: [{
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSwipeActions, decorators: [{
19
19
  type: Component,
20
- args: [{ standalone: true, selector: 'tui-swipe-actions', imports: [WaResizeObserver], changeDetection: ChangeDetectionStrategy.OnPush, host: {
21
- '[style.--t-actions-width]': 'actionsWidth',
22
- }, template: "<div class=\"t-content\">\n <ng-content />\n</div>\n\n<div\n class=\"t-actions\"\n (waResizeObserver)=\"$event[0] && onResize($event[0])\"\n>\n <ng-content select=\"[tuiSwipeAction]\" />\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;--tui-action-gap: 24;--tui-actions-padding: .5rem;--tui-item-size: 44;--t-x: calc(50% + 50% * var(--tui-inline));display:flex;inline-size:-webkit-fill-available;inline-size:-moz-available;inline-size:stretch;align-items:center;overflow-x:scroll;overflow-y:hidden;scroll-snap-type:x mandatory;perspective:1px;perspective-origin:calc(var(--t-x) + var(--tui-inline) * (calc(1px * var(--tui-item-size) / 2) + var(--tui-actions-padding)))}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}.t-content{scroll-snap-align:start;flex-shrink:0;inline-size:100%}.t-actions{display:flex;gap:calc(1px * var(--tui-action-gap));padding:0 1rem 0 var(--tui-actions-padding);scroll-snap-align:start;align-items:center;transform-style:preserve-3d;pointer-events:none;transform:translateZ(-.00001px)}.t-actions:empty{display:none}::ng-deep .t-actions>*{pointer-events:auto}::ng-deep .t-actions>*:nth-child(2){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 1 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (2 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(3){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 2 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (3 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(4){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 3 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (4 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(5){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 4 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (5 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(6){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 5 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (6 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}@media (hover: hover) and (pointer: fine){.t-actions{display:none}}\n"] }]
20
+ args: [{ selector: 'tui-swipe-actions', imports: [WaResizeObserver], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[style.--t-actions-width]': 'actionsWidth' }, template: "<div class=\"t-content\">\n <ng-content />\n</div>\n\n<div\n class=\"t-actions\"\n (waResizeObserver)=\"$event[0] && onResize($event[0])\"\n>\n <ng-content select=\"[tuiSwipeAction]\" />\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;--tui-action-gap: 24;--tui-actions-padding: .5rem;--tui-item-size: 44;--t-x: calc(50% + 50% * var(--tui-inline));display:flex;inline-size:-webkit-fill-available;align-items:center;overflow-x:scroll;overflow-y:hidden;scroll-snap-type:x mandatory;perspective:1px;perspective-origin:calc(var(--t-x) + var(--tui-inline) * (calc(1px * var(--tui-item-size) / 2) + var(--tui-actions-padding)))}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}.t-content{scroll-snap-align:start;flex-shrink:0;inline-size:100%}.t-actions{display:flex;gap:calc(1px * var(--tui-action-gap));padding:0 1rem 0 var(--tui-actions-padding);scroll-snap-align:start;align-items:center;transform-style:preserve-3d;pointer-events:none;transform:translateZ(-.00001px)}.t-actions:empty{display:none}::ng-deep .t-actions>*{pointer-events:auto}::ng-deep .t-actions>*:nth-child(2){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 1 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (2 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(3){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 2 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (3 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(4){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 3 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (4 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(5){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 4 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (5 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}::ng-deep .t-actions>*:nth-child(6){--t-distance: calc(var(--tui-item-size) + var(--tui-action-gap)) * 5 ;--t-factor: calc((var(--t-actions-width) - var(--t-distance)) / var(--t-actions-width));--t-scale: calc(1 / var(--t-factor));--t-translate: calc(1px * (1 - 1 / var(--t-factor)));transform:translate3d(calc(calc((-100% * var(--tui-inline) - calc(1px * var(--tui-inline) * var(--tui-action-gap))) * (6 - 1)) / var(--t-scale)),0,var(--t-translate));scale:var(--t-scale)}@media (hover: hover) and (pointer: fine){.t-actions{display:none}}\n"] }]
23
21
  }] });
24
22
 
25
23
  class TuiSwipeActionsAutoClose {
26
24
  constructor() {
27
25
  this.el = tuiInjectElement();
28
- this.autoClose = true;
26
+ this.autoClose = input(true);
29
27
  }
30
28
  handleEvent(event) {
31
- if (this.autoClose !== false && !this.el.contains(tuiGetActualTarget(event))) {
32
- this.el.scrollTo({
33
- left: 0,
34
- behavior: 'smooth',
35
- });
29
+ if (this.autoClose() !== false && !this.el.contains(tuiGetActualTarget(event))) {
30
+ this.el.scrollTo({ left: 0, behavior: 'smooth' });
36
31
  }
37
32
  }
38
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSwipeActionsAutoClose, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
39
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiSwipeActionsAutoClose, isStandalone: true, selector: "tui-swipe-actions[autoClose]", inputs: { autoClose: "autoClose" }, host: { listeners: { "document:pointerdown.zoneless": "handleEvent($event)", "document:focusin.zoneless": "handleEvent($event)" } }, ngImport: i0 }); }
33
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSwipeActionsAutoClose, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
34
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiSwipeActionsAutoClose, isStandalone: true, selector: "tui-swipe-actions[autoClose]", inputs: { autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:pointerdown.zoneless": "handleEvent($event)", "document:focusin.zoneless": "handleEvent($event)" } }, ngImport: i0 }); }
40
35
  }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSwipeActionsAutoClose, decorators: [{
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSwipeActionsAutoClose, decorators: [{
42
37
  type: Directive,
43
38
  args: [{
44
- standalone: true,
45
39
  selector: 'tui-swipe-actions[autoClose]',
46
40
  host: {
47
41
  '(document:pointerdown.zoneless)': 'handleEvent($event)',
48
42
  '(document:focusin.zoneless)': 'handleEvent($event)',
49
43
  },
50
44
  }]
51
- }], propDecorators: { autoClose: [{
52
- type: Input
53
- }] } });
45
+ }] });
54
46
 
55
47
  /**
56
48
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-components-swipe-action.mjs","sources":["../../../projects/addon-mobile/components/swipe-action/swipe-actions.component.ts","../../../projects/addon-mobile/components/swipe-action/swipe-actions.template.html","../../../projects/addon-mobile/components/swipe-action/swipe-actions-auto-close.directive.ts","../../../projects/addon-mobile/components/swipe-action/taiga-ui-addon-mobile-components-swipe-action.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n inject,\n} from '@angular/core';\nimport {WaResizeObserver} from '@ng-web-apis/resize-observer';\n\n@Component({\n standalone: true,\n selector: 'tui-swipe-actions',\n imports: [WaResizeObserver],\n templateUrl: './swipe-actions.template.html',\n styleUrls: ['./swipe-actions.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.--t-actions-width]': 'actionsWidth',\n },\n})\nexport class TuiSwipeActions {\n protected actionsWidth = 0;\n\n protected readonly cdr = inject(ChangeDetectorRef);\n\n protected onResize({target}: ResizeObserverEntry): void {\n this.actionsWidth = target.clientWidth;\n this.cdr.detectChanges();\n }\n}\n","<div class=\"t-content\">\n <ng-content />\n</div>\n\n<div\n class=\"t-actions\"\n (waResizeObserver)=\"$event[0] && onResize($event[0])\"\n>\n <ng-content select=\"[tuiSwipeAction]\" />\n</div>\n","import {Directive, Input} from '@angular/core';\nimport {tuiGetActualTarget, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\n\n@Directive({\n standalone: true,\n selector: 'tui-swipe-actions[autoClose]',\n host: {\n '(document:pointerdown.zoneless)': 'handleEvent($event)',\n '(document:focusin.zoneless)': 'handleEvent($event)',\n },\n})\nexport class TuiSwipeActionsAutoClose {\n private readonly el = tuiInjectElement();\n\n @Input()\n public autoClose: boolean | string = true;\n\n protected handleEvent(event: Event): void {\n if (this.autoClose !== false && !this.el.contains(tuiGetActualTarget(event))) {\n this.el.scrollTo({\n left: 0,\n behavior: 'smooth',\n });\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA,MAWa,eAAe,CAAA;AAX5B,IAAA,WAAA,GAAA;QAYc,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;AAER,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAMtD,KAAA;IAJa,QAAQ,CAAC,EAAC,MAAM,EAAsB,EAAA;AAC5C,QAAA,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;AACvC,QAAA,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;KAC5B;+GARQ,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,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SAAA;KACJ;+GAbQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,+BAAA,EAAA,qBAAA,EAAA,2BAAA,EAAA,qBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBARpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,IAAI,EAAE;AACF,wBAAA,iCAAiC,EAAE,qBAAqB;AACxD,wBAAA,6BAA6B,EAAE,qBAAqB;AACvD,qBAAA;AACJ,iBAAA,CAAA;8BAKU,SAAS,EAAA,CAAA;sBADf,KAAK;;;ACdV;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components-swipe-action.mjs","sources":["../../../projects/addon-mobile/components/swipe-action/swipe-actions.component.ts","../../../projects/addon-mobile/components/swipe-action/swipe-actions.template.html","../../../projects/addon-mobile/components/swipe-action/swipe-actions-auto-close.directive.ts","../../../projects/addon-mobile/components/swipe-action/taiga-ui-addon-mobile-components-swipe-action.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n inject,\n} from '@angular/core';\nimport {WaResizeObserver} from '@ng-web-apis/resize-observer';\n\n@Component({\n selector: 'tui-swipe-actions',\n imports: [WaResizeObserver],\n templateUrl: './swipe-actions.template.html',\n styleUrl: './swipe-actions.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'[style.--t-actions-width]': 'actionsWidth'},\n})\nexport class TuiSwipeActions {\n protected actionsWidth = 0;\n protected readonly cdr = inject(ChangeDetectorRef);\n\n protected onResize({target}: ResizeObserverEntry): void {\n this.actionsWidth = target.clientWidth;\n this.cdr.detectChanges();\n }\n}\n","<div class=\"t-content\">\n <ng-content />\n</div>\n\n<div\n class=\"t-actions\"\n (waResizeObserver)=\"$event[0] && onResize($event[0])\"\n>\n <ng-content select=\"[tuiSwipeAction]\" />\n</div>\n","import {Directive, input} from '@angular/core';\nimport {tuiGetActualTarget, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\n\n@Directive({\n selector: 'tui-swipe-actions[autoClose]',\n host: {\n '(document:pointerdown.zoneless)': 'handleEvent($event)',\n '(document:focusin.zoneless)': 'handleEvent($event)',\n },\n})\nexport class TuiSwipeActionsAutoClose {\n private readonly el = tuiInjectElement();\n\n public readonly autoClose = input<boolean | string>(true);\n\n protected handleEvent(event: Event): void {\n if (this.autoClose() !== false && !this.el.contains(tuiGetActualTarget(event))) {\n this.el.scrollTo({left: 0, behavior: 'smooth'});\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAgBa,eAAe,CAAA;AAR5B,IAAA,WAAA,GAAA;QASc,IAAY,CAAA,YAAA,GAAG,CAAC;AACP,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAMrD;IAJa,QAAQ,CAAC,EAAC,MAAM,EAAsB,EAAA;AAC5C,QAAA,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW;AACtC,QAAA,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE;;+GANnB,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA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