@taiga-ui/legacy 4.52.0-canary.a4e325d → 4.52.0-canary.e10b718

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 (139) hide show
  1. package/components/color-selector/color-selector.module.d.ts +11 -12
  2. package/components/index.d.ts +0 -7
  3. package/components/input-phone/input-phone.component.d.ts +3 -0
  4. package/components/input-phone/input-phone.directive.d.ts +3 -0
  5. package/components/input-phone/input-phone.module.d.ts +3 -0
  6. package/components/input-phone/input-phone.options.d.ts +10 -1
  7. package/fesm2022/taiga-ui-legacy-classes.mjs +21 -21
  8. package/fesm2022/taiga-ui-legacy-classes.mjs.map +1 -1
  9. package/fesm2022/taiga-ui-legacy-components-arrow.mjs +3 -3
  10. package/fesm2022/taiga-ui-legacy-components-arrow.mjs.map +1 -1
  11. package/fesm2022/taiga-ui-legacy-components-color-selector.mjs +68 -72
  12. package/fesm2022/taiga-ui-legacy-components-color-selector.mjs.map +1 -1
  13. package/fesm2022/taiga-ui-legacy-components-combo-box.mjs +19 -20
  14. package/fesm2022/taiga-ui-legacy-components-combo-box.mjs.map +1 -1
  15. package/fesm2022/taiga-ui-legacy-components-input-color.mjs +7 -7
  16. package/fesm2022/taiga-ui-legacy-components-input-color.mjs.map +1 -1
  17. package/fesm2022/taiga-ui-legacy-components-input-date-range.mjs +22 -22
  18. package/fesm2022/taiga-ui-legacy-components-input-date-range.mjs.map +1 -1
  19. package/fesm2022/taiga-ui-legacy-components-input-date-time.mjs +24 -24
  20. package/fesm2022/taiga-ui-legacy-components-input-date-time.mjs.map +1 -1
  21. package/fesm2022/taiga-ui-legacy-components-input-date.mjs +26 -26
  22. package/fesm2022/taiga-ui-legacy-components-input-date.mjs.map +1 -1
  23. package/fesm2022/taiga-ui-legacy-components-input-month-range.mjs +10 -10
  24. package/fesm2022/taiga-ui-legacy-components-input-month-range.mjs.map +1 -1
  25. package/fesm2022/taiga-ui-legacy-components-input-number.mjs +19 -19
  26. package/fesm2022/taiga-ui-legacy-components-input-number.mjs.map +1 -1
  27. package/fesm2022/taiga-ui-legacy-components-input-phone-international.mjs +5 -5
  28. package/fesm2022/taiga-ui-legacy-components-input-phone-international.mjs.map +1 -1
  29. package/fesm2022/taiga-ui-legacy-components-input-phone.mjs +26 -11
  30. package/fesm2022/taiga-ui-legacy-components-input-phone.mjs.map +1 -1
  31. package/fesm2022/taiga-ui-legacy-components-input-range.mjs +18 -18
  32. package/fesm2022/taiga-ui-legacy-components-input-range.mjs.map +1 -1
  33. package/fesm2022/taiga-ui-legacy-components-input-slider.mjs +15 -16
  34. package/fesm2022/taiga-ui-legacy-components-input-slider.mjs.map +1 -1
  35. package/fesm2022/taiga-ui-legacy-components-input-tag.mjs +19 -19
  36. package/fesm2022/taiga-ui-legacy-components-input-tag.mjs.map +1 -1
  37. package/fesm2022/taiga-ui-legacy-components-input-time.mjs +38 -42
  38. package/fesm2022/taiga-ui-legacy-components-input-time.mjs.map +1 -1
  39. package/fesm2022/taiga-ui-legacy-components-input-year.mjs +10 -10
  40. package/fesm2022/taiga-ui-legacy-components-input-year.mjs.map +1 -1
  41. package/fesm2022/taiga-ui-legacy-components-input.mjs +10 -10
  42. package/fesm2022/taiga-ui-legacy-components-input.mjs.map +1 -1
  43. package/fesm2022/taiga-ui-legacy-components-multi-select-option.mjs +7 -7
  44. package/fesm2022/taiga-ui-legacy-components-multi-select-option.mjs.map +1 -1
  45. package/fesm2022/taiga-ui-legacy-components-multi-select.mjs +45 -45
  46. package/fesm2022/taiga-ui-legacy-components-multi-select.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-legacy-components-primitive-textfield.mjs +26 -26
  48. package/fesm2022/taiga-ui-legacy-components-primitive-textfield.mjs.map +1 -1
  49. package/fesm2022/taiga-ui-legacy-components-select-option.mjs +8 -8
  50. package/fesm2022/taiga-ui-legacy-components-select-option.mjs.map +1 -1
  51. package/fesm2022/taiga-ui-legacy-components-select.mjs +31 -31
  52. package/fesm2022/taiga-ui-legacy-components-select.mjs.map +1 -1
  53. package/fesm2022/taiga-ui-legacy-components-svg.mjs +6 -6
  54. package/fesm2022/taiga-ui-legacy-components-svg.mjs.map +1 -1
  55. package/fesm2022/taiga-ui-legacy-components-tag.mjs +13 -14
  56. package/fesm2022/taiga-ui-legacy-components-tag.mjs.map +1 -1
  57. package/fesm2022/taiga-ui-legacy-components-textarea.mjs +21 -21
  58. package/fesm2022/taiga-ui-legacy-components-textarea.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-legacy-components-tooltip.mjs +7 -7
  60. package/fesm2022/taiga-ui-legacy-components-tooltip.mjs.map +1 -1
  61. package/fesm2022/taiga-ui-legacy-components.mjs +0 -7
  62. package/fesm2022/taiga-ui-legacy-components.mjs.map +1 -1
  63. package/fesm2022/taiga-ui-legacy-directives-legacy-dropdown-open-monitor.mjs +3 -3
  64. package/fesm2022/taiga-ui-legacy-directives-legacy-dropdown-open-monitor.mjs.map +1 -1
  65. package/fesm2022/taiga-ui-legacy-directives-textfield-controller.mjs +34 -34
  66. package/fesm2022/taiga-ui-legacy-directives-textfield-controller.mjs.map +1 -1
  67. package/fesm2022/taiga-ui-legacy-directives-unfinished-validator.mjs +3 -3
  68. package/fesm2022/taiga-ui-legacy-directives-unfinished-validator.mjs.map +1 -1
  69. package/fesm2022/taiga-ui-legacy-directives-value-accessor.mjs +7 -7
  70. package/fesm2022/taiga-ui-legacy-directives-value-accessor.mjs.map +1 -1
  71. package/fesm2022/taiga-ui-legacy-directives-wrapper.mjs +7 -7
  72. package/fesm2022/taiga-ui-legacy-directives-wrapper.mjs.map +1 -1
  73. package/fesm2022/taiga-ui-legacy-pipes-format-phone.mjs +3 -3
  74. package/fesm2022/taiga-ui-legacy-pipes-format-phone.mjs.map +1 -1
  75. package/fesm2022/taiga-ui-legacy-pipes-iso-to-country-code.mjs +3 -3
  76. package/fesm2022/taiga-ui-legacy-pipes-iso-to-country-code.mjs.map +1 -1
  77. package/fesm2022/taiga-ui-legacy-pipes-to-country-code.mjs +3 -3
  78. package/fesm2022/taiga-ui-legacy-pipes-to-country-code.mjs.map +1 -1
  79. package/fesm2022/taiga-ui-legacy-services.mjs +3 -3
  80. package/fesm2022/taiga-ui-legacy-services.mjs.map +1 -1
  81. package/fesm2022/taiga-ui-legacy-tokens.mjs.map +1 -1
  82. package/fesm2022/taiga-ui-legacy-utils.mjs.map +1 -1
  83. package/package.json +5 -33
  84. package/utils/icons-path-factory.d.ts +1 -1
  85. package/components/input-copy/index.d.ts +0 -4
  86. package/components/input-copy/input-copy.component.d.ts +0 -33
  87. package/components/input-copy/input-copy.directive.d.ts +0 -11
  88. package/components/input-copy/input-copy.module.d.ts +0 -18
  89. package/components/input-copy/input-copy.options.d.ts +0 -26
  90. package/components/input-date-multi/index.d.ts +0 -2
  91. package/components/input-date-multi/input-date-multi.component.d.ts +0 -66
  92. package/components/input-date-multi/input-date-multi.module.d.ts +0 -20
  93. package/components/input-month/index.d.ts +0 -3
  94. package/components/input-month/input-month.component.d.ts +0 -44
  95. package/components/input-month/input-month.directive.d.ts +0 -19
  96. package/components/input-month/input-month.module.d.ts +0 -19
  97. package/components/input-password/index.d.ts +0 -4
  98. package/components/input-password/input-password.component.d.ts +0 -33
  99. package/components/input-password/input-password.directive.d.ts +0 -15
  100. package/components/input-password/input-password.module.d.ts +0 -19
  101. package/components/input-password/input-password.options.d.ts +0 -25
  102. package/components/island/index.d.ts +0 -1
  103. package/components/island/island.directive.d.ts +0 -20
  104. package/components/sheet/components/sheet/sheet.component.d.ts +0 -31
  105. package/components/sheet/components/sheet/sheet.providers.d.ts +0 -2
  106. package/components/sheet/components/sheet-bar/sheet-bar.component.d.ts +0 -11
  107. package/components/sheet/components/sheet-heading/sheet-heading.component.d.ts +0 -14
  108. package/components/sheet/components/sheets-host/sheets-host.component.d.ts +0 -15
  109. package/components/sheet/directives/sheet-close/sheet-close.directive.d.ts +0 -14
  110. package/components/sheet/directives/sheet-stop/sheet-stop.directive.d.ts +0 -9
  111. package/components/sheet/directives/sheet-top/sheet-top.directive.d.ts +0 -14
  112. package/components/sheet/directives/sheet-wrapper/sheet-wrapper.directive.d.ts +0 -17
  113. package/components/sheet/index.d.ts +0 -14
  114. package/components/sheet/sheet-options.d.ts +0 -27
  115. package/components/sheet/sheet-tokens.d.ts +0 -18
  116. package/components/sheet/sheet.d.ts +0 -21
  117. package/components/sheet/sheet.directive.d.ts +0 -17
  118. package/components/sheet/sheet.module.d.ts +0 -24
  119. package/components/sheet/sheet.service.d.ts +0 -17
  120. package/components/table-bar/index.d.ts +0 -4
  121. package/components/table-bar/table-bar.component.d.ts +0 -17
  122. package/components/table-bar/table-bar.directive.d.ts +0 -11
  123. package/components/table-bar/table-bar.options.d.ts +0 -31
  124. package/components/table-bar/table-bars-host.component.d.ts +0 -10
  125. package/components/table-bar/table-bars.service.d.ts +0 -11
  126. package/fesm2022/taiga-ui-legacy-components-input-copy.mjs +0 -197
  127. package/fesm2022/taiga-ui-legacy-components-input-copy.mjs.map +0 -1
  128. package/fesm2022/taiga-ui-legacy-components-input-date-multi.mjs +0 -272
  129. package/fesm2022/taiga-ui-legacy-components-input-date-multi.mjs.map +0 -1
  130. package/fesm2022/taiga-ui-legacy-components-input-month.mjs +0 -231
  131. package/fesm2022/taiga-ui-legacy-components-input-month.mjs.map +0 -1
  132. package/fesm2022/taiga-ui-legacy-components-input-password.mjs +0 -187
  133. package/fesm2022/taiga-ui-legacy-components-input-password.mjs.map +0 -1
  134. package/fesm2022/taiga-ui-legacy-components-island.mjs +0 -68
  135. package/fesm2022/taiga-ui-legacy-components-island.mjs.map +0 -1
  136. package/fesm2022/taiga-ui-legacy-components-sheet.mjs +0 -577
  137. package/fesm2022/taiga-ui-legacy-components-sheet.mjs.map +0 -1
  138. package/fesm2022/taiga-ui-legacy-components-table-bar.mjs +0 -145
  139. package/fesm2022/taiga-ui-legacy-components-table-bar.mjs.map +0 -1
@@ -1,577 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { InjectionToken, inject, ChangeDetectionStrategy, Component, ElementRef, NgZone, forwardRef, Input, Directive, DestroyRef, ViewChildren, ViewChild, Injectable, ContentChild, Output, ChangeDetectorRef, NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { TUI_TRUE_HANDLER, TUI_FALSE_HANDLER, EMPTY_QUERY } from '@taiga-ui/cdk/constants';
6
- import { tuiTypedFromEvent, tuiZonefree, tuiZonefull, tuiIfMap } from '@taiga-ui/cdk/observables';
7
- import { TUI_IS_IOS, TUI_WINDOW_SIZE } from '@taiga-ui/cdk/tokens';
8
- import { tuiInjectElement, tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
9
- import { tuiProvide, tuiPure, tuiIsFalsy } from '@taiga-ui/cdk/utils/miscellaneous';
10
- import { tuiSlideInTop, tuiFadeIn } from '@taiga-ui/core/animations';
11
- import { TUI_MORE_WORD } from '@taiga-ui/kit/tokens';
12
- import { merge, map, share, delay, switchMap, concat, zip, takeUntil, take, distinctUntilChanged, withLatestFrom, filter, throttleTime, timer, BehaviorSubject, Observable, EMPTY, race, debounceTime, startWith, Subject, ignoreElements, endWith } from 'rxjs';
13
- import { tuiInjectId } from '@taiga-ui/cdk/services';
14
- import { TUI_CLOSE_WORD, TUI_COMMON_ICONS, TUI_SCROLL_REF, TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
15
- import * as i1 from '@taiga-ui/core/components/button';
16
- import { TuiButton } from '@taiga-ui/core/components/button';
17
- import * as i1$1 from '@angular/common';
18
- import { DOCUMENT, CommonModule } from '@angular/common';
19
- import * as i2$1 from '@taiga-ui/polymorpheus';
20
- import { PolymorpheusTemplate, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
21
- import { tuiClamp } from '@taiga-ui/cdk/utils/math';
22
- import * as i2 from '@taiga-ui/cdk/directives/let';
23
- import { TuiLet } from '@taiga-ui/cdk/directives/let';
24
- import { WA_WINDOW } from '@ng-web-apis/common';
25
- import { tuiToAnimationOptions } from '@taiga-ui/core/utils/miscellaneous';
26
- import { tuiGetNativeFocused } from '@taiga-ui/cdk/utils/focus';
27
- import { TuiScrollbar } from '@taiga-ui/core/components/scrollbar';
28
-
29
- /**
30
- * @deprecated: drop in v5.0 use {@link TuiSheetDialog}
31
- * https://taiga-ui.dev/components/sheet-dialog
32
- */
33
- const TUI_SHEET = new InjectionToken(ngDevMode ? 'TUI_SHEET' : '');
34
- /**
35
- * @deprecated: drop in v5.0 use {@link TuiSheetDialog}
36
- * https://taiga-ui.dev/components/sheet-dialog
37
- */
38
- const TUI_SHEET_SCROLL = new InjectionToken(ngDevMode ? 'TUI_SHEET_SCROLL' : '');
39
- /**
40
- * @deprecated: drop in v5.0 use {@link TuiSheetDialog}
41
- * https://taiga-ui.dev/components/sheet-dialog
42
- */
43
- const TUI_SHEET_DRAGGED = new InjectionToken(ngDevMode ? 'TUI_SHEET_DRAGGED' : '');
44
-
45
- const TUI_SHEET_CLOSE = 'tui-sheet-close';
46
- const TUI_SHEET_ID = 'tui-sheet-id';
47
- class TuiSheetHeadingComponent {
48
- constructor() {
49
- this.el = tuiInjectElement();
50
- this.closeWord$ = inject(TUI_CLOSE_WORD);
51
- this.icons = inject(TUI_COMMON_ICONS);
52
- this.autoId = tuiInjectId();
53
- }
54
- ngAfterViewInit() {
55
- this.el.dispatchEvent(new CustomEvent(TUI_SHEET_ID, { bubbles: true, detail: this.autoId }));
56
- }
57
- onClick() {
58
- this.el.dispatchEvent(new CustomEvent(TUI_SHEET_CLOSE, { bubbles: true }));
59
- }
60
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetHeadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
61
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetHeadingComponent, isStandalone: false, selector: "[tuiSheetHeading]", ngImport: i0, template: "<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n (click)=\"onClick()\"\n>\n {{ closeWord$ | async }}\n</button>\n<span [id]=\"autoId\">\n <ng-content />\n</span>\n", styles: [":host{position:sticky;top:0;z-index:1;min-block-size:2rem;box-sizing:border-box;margin:-1.25rem -1rem 0;padding:1.5rem 1rem 1rem;background:var(--tui-background-elevation-1);border-radius:.75rem .75rem 0 0;font:var(--tui-font-heading-6);box-shadow:inset 0 1px #ffffff40}:host:after{content:\"\";position:absolute;top:100%;left:0;right:0;block-size:1px;background:var(--tui-border-normal);opacity:0}:host :host-context(._stuck):after{opacity:1}.t-close{display:none;float:inline-end;margin-inline-end:-.25rem}:host-context(.t-wrapper_closeable) .t-close{display:block}\n"], dependencies: [{ kind: "directive", type: i1.TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
62
- }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetHeadingComponent, decorators: [{
64
- type: Component,
65
- args: [{ standalone: false, selector: '[tuiSheetHeading]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n (click)=\"onClick()\"\n>\n {{ closeWord$ | async }}\n</button>\n<span [id]=\"autoId\">\n <ng-content />\n</span>\n", styles: [":host{position:sticky;top:0;z-index:1;min-block-size:2rem;box-sizing:border-box;margin:-1.25rem -1rem 0;padding:1.5rem 1rem 1rem;background:var(--tui-background-elevation-1);border-radius:.75rem .75rem 0 0;font:var(--tui-font-heading-6);box-shadow:inset 0 1px #ffffff40}:host:after{content:\"\";position:absolute;top:100%;left:0;right:0;block-size:1px;background:var(--tui-border-normal);opacity:0}:host :host-context(._stuck):after{opacity:1}.t-close{display:none;float:inline-end;margin-inline-end:-.25rem}:host-context(.t-wrapper_closeable) .t-close{display:block}\n"] }]
66
- }] });
67
-
68
- const TUI_SHEET_PROVIDERS = [
69
- {
70
- provide: TUI_SHEET_DRAGGED,
71
- deps: [ElementRef],
72
- useFactory: ({ nativeElement }) => merge(tuiTypedFromEvent(nativeElement, 'touchstart', { passive: true }).pipe(map(TUI_TRUE_HANDLER)), tuiTypedFromEvent(nativeElement, 'touchend').pipe(map(TUI_FALSE_HANDLER))),
73
- },
74
- {
75
- provide: TUI_SHEET_SCROLL,
76
- deps: [ElementRef, NgZone, DOCUMENT, TUI_IS_IOS],
77
- useFactory: ({ nativeElement }, zone, doc, isIos) => isIos
78
- ? iosScrollFactory(nativeElement, doc, zone)
79
- : merge(tuiTypedFromEvent(nativeElement, 'scroll'), tuiTypedFromEvent(nativeElement, 'load', { capture: true })).pipe(map(() => nativeElement.scrollTop), tuiZonefree(zone), share()),
80
- },
81
- tuiProvide(TUI_SCROLL_REF, ElementRef),
82
- tuiProvide(TUI_SHEET, forwardRef(() => TuiSheetComponent)),
83
- ];
84
- function iosScrollFactory(element, doc, zone) {
85
- const load$ = tuiTypedFromEvent(element, 'load', { capture: true });
86
- const touchstart$ = tuiTypedFromEvent(element, 'touchstart', { passive: true });
87
- const touchmove$ = tuiTypedFromEvent(doc, 'touchmove', { passive: true });
88
- const touchend$ = tuiTypedFromEvent(doc, 'touchend');
89
- const scroll$ = tuiTypedFromEvent(element, 'scroll').pipe(map(() => element.scrollTop));
90
- const result$ = merge(load$.pipe(delay(0), map(() => element.scrollTop)), touchstart$.pipe(switchMap(({ touches }) => {
91
- const { screenY = 0 } = touches[0] ?? {};
92
- const { scrollTop } = element;
93
- return concat(
94
- // Sometimes touch is triggered without scroll in iOS, filter that
95
- zip(touchmove$, scroll$).pipe(map(([{ touches }]) => scrollTop + screenY - (touches[0]?.screenY ?? 0)), takeUntil(touchend$)), scroll$);
96
- })));
97
- return concat(scroll$.pipe(take(1)), result$).pipe(tuiZonefree(zone), share());
98
- }
99
-
100
- class TuiSheetBarComponent {
101
- constructor() {
102
- this.sheet = inject(TUI_SHEET);
103
- this.scroll$ = inject(TUI_SHEET_SCROLL);
104
- this.zone = inject(NgZone);
105
- this.rotate$ = this.scroll$.pipe(map((y) => tuiClamp(10 - (y - this.stop) / 5, 0, 10)), distinctUntilChanged(), tuiZonefull(this.zone));
106
- }
107
- getTransform(rotate) {
108
- return `rotate(${rotate}deg)`;
109
- }
110
- get stop() {
111
- return this.sheet.stops[0] || 0;
112
- }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
114
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetBarComponent, isStandalone: false, selector: "tui-sheet-bar", ngImport: i0, template: "<ng-container *tuiLet=\"rotate$ | async as deg\">\n <div\n class=\"t-bar\"\n [style]=\"{transform: getTransform(-deg!)}\"\n ></div>\n <ng-content *ngIf=\"deg\" />\n <div\n class=\"t-bar\"\n [style]=\"{transform: getTransform(deg!)}\"\n ></div>\n</ng-container>\n", styles: [":host{transition-property:border-radius;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:sticky;top:0;z-index:2;display:flex;block-size:1.25rem;align-items:center;justify-content:center;opacity:.3}.t-bar{content:\"\";block-size:.25rem;inline-size:1rem;background:var(--tui-text-primary);pointer-events:none}:host-context(._ios:not(._dragged)) .t-bar{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-bar:first-child{border-radius:1rem 0 0 1rem;transform-origin:top right}.t-bar:last-child{border-radius:0 1rem 1rem 0;transform-origin:top left}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
115
- }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetBarComponent, decorators: [{
117
- type: Component,
118
- args: [{ standalone: false, selector: 'tui-sheet-bar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *tuiLet=\"rotate$ | async as deg\">\n <div\n class=\"t-bar\"\n [style]=\"{transform: getTransform(-deg!)}\"\n ></div>\n <ng-content *ngIf=\"deg\" />\n <div\n class=\"t-bar\"\n [style]=\"{transform: getTransform(deg!)}\"\n ></div>\n</ng-container>\n", styles: [":host{transition-property:border-radius;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:sticky;top:0;z-index:2;display:flex;block-size:1.25rem;align-items:center;justify-content:center;opacity:.3}.t-bar{content:\"\";block-size:.25rem;inline-size:1rem;background:var(--tui-text-primary);pointer-events:none}:host-context(._ios:not(._dragged)) .t-bar{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out}.t-bar:first-child{border-radius:1rem 0 0 1rem;transform-origin:top right}.t-bar:last-child{border-radius:0 1rem 1rem 0;transform-origin:top left}\n"] }]
119
- }] });
120
-
121
- // So that borders get rounded when image is visible for at least 10px
122
- const OFFSET$1 = 10;
123
- class TuiSheetTopDirective {
124
- constructor() {
125
- this.scroll$ = inject(TUI_SHEET_SCROLL);
126
- this.component = inject(TUI_SHEET);
127
- this.win = inject(WA_WINDOW);
128
- this.el = tuiInjectElement();
129
- this.rounded$ = this.scroll$
130
- .pipe(map((y) => y < this.stop + OFFSET$1))
131
- .pipe(takeUntilDestroyed())
132
- .subscribe((add) => add
133
- ? this.el.classList.add('_rounded')
134
- : this.el.classList.remove('_rounded'));
135
- this.transform$ = this.scroll$
136
- .pipe(map((y) => `translateY(${this.getY(y)}%) scaleX(-1)`), takeUntilDestroyed())
137
- .subscribe((transform) => this.el.style.setProperty('transform', transform));
138
- this.clickthrough$ = this.scroll$
139
- .pipe(map((y) => !!Math.round(this.getY(y))), takeUntilDestroyed())
140
- .subscribe((add) => add
141
- ? this.el.classList.add('_clickthrough')
142
- : this.el.classList.remove('_clickthrough'));
143
- this.stop = 0;
144
- }
145
- getY(scrollTop) {
146
- const value = scrollTop - this.stop;
147
- const total = this.win.innerHeight - this.component.item.offset - this.stop;
148
- return this.stop && tuiClamp(100 - (value / total) * 100, 0, 100);
149
- }
150
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetTopDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
151
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetTopDirective, isStandalone: false, selector: "[tuiSheetTop]", inputs: { stop: ["tuiSheetTop", "stop"] }, ngImport: i0 }); }
152
- }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetTopDirective, decorators: [{
154
- type: Directive,
155
- args: [{
156
- standalone: false,
157
- selector: '[tuiSheetTop]',
158
- }]
159
- }], propDecorators: { stop: [{
160
- type: Input,
161
- args: ['tuiSheetTop']
162
- }] } });
163
-
164
- class TuiSheetStopDirective {
165
- constructor() {
166
- this.scrollRef = inject(TUI_SCROLL_REF).nativeElement;
167
- this.destroyRef = inject(DestroyRef);
168
- this.el = tuiInjectElement();
169
- this.$ = inject(TUI_SHEET_SCROLL)
170
- .pipe(map((y) => Math.floor(y) > this.el.offsetTop), distinctUntilChanged(), withLatestFrom(inject(TUI_SHEET_DRAGGED)), map(([above, dragged]) => !above && !dragged), filter(Boolean), throttleTime(100), takeUntilDestroyed(this.destroyRef))
171
- .subscribe(() => {
172
- this.scrollRef.style.overflow = 'hidden';
173
- this.scrollRef.classList.remove('_stuck'); // iOS
174
- this.scrollRef.scrollTop = this.el.offsetTop;
175
- timer(100)
176
- .pipe(takeUntilDestroyed(this.destroyRef))
177
- // eslint-disable-next-line rxjs/no-nested-subscribe
178
- .subscribe(() => {
179
- this.scrollRef.style.overflow = '';
180
- });
181
- });
182
- }
183
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetStopDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
184
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetStopDirective, isStandalone: false, selector: "[tuiSheetStop]", ngImport: i0 }); }
185
- }
186
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetStopDirective, decorators: [{
187
- type: Directive,
188
- args: [{
189
- standalone: false,
190
- selector: '[tuiSheetStop]',
191
- }]
192
- }] });
193
-
194
- class TuiSheetComponent {
195
- constructor() {
196
- this.stopsRefs = EMPTY_QUERY;
197
- this.destroyRef = inject(DestroyRef);
198
- this.scroll$ = inject(TUI_SHEET_SCROLL);
199
- this.el = tuiInjectElement();
200
- this.zone = inject(NgZone);
201
- this.id = '';
202
- this.isIos = inject(TUI_IS_IOS);
203
- this.moreWord$ = inject(TUI_MORE_WORD);
204
- this.stuck$ = this.scroll$.pipe(map((y) => Math.floor(y) > this.contentTop));
205
- this.stuck$$ = this.stuck$
206
- .pipe(takeUntilDestroyed())
207
- .subscribe((add) => add ? this.el.classList.add('_stuck') : this.el.classList.remove('_stuck'));
208
- }
209
- get context() {
210
- return {
211
- ...this.item,
212
- scroll$: this.scroll$.pipe(tuiZonefull(this.zone)),
213
- };
214
- }
215
- get stops() {
216
- return this.getStops(this.stopsRefs);
217
- }
218
- get imageStop() {
219
- return (this.item.imageSlide && this.stops[this.stops.length - 1]) || 0;
220
- }
221
- get imageHeight() {
222
- return this.contentTop - this.sheetTop;
223
- }
224
- ngAfterViewInit() {
225
- this.el.scrollTop =
226
- [...this.stops, this.sheetTop, this.contentTop][this.item.initial] ?? 0;
227
- }
228
- onId(id) {
229
- this.id = id;
230
- }
231
- scrollTo(top = this.sheetTop) {
232
- if (this.isIos) {
233
- const offset = top - this.el.scrollTop - 16;
234
- this.el.style.transition = 'none';
235
- this.el.style.transform = `scaleX(-1) translate3d(0, ${offset}px, 0)`;
236
- timer(0)
237
- .pipe(takeUntilDestroyed(this.destroyRef))
238
- .subscribe(() => {
239
- this.el.style.transition = '';
240
- this.el.style.transform = '';
241
- });
242
- }
243
- this.el.scrollTo({ top, behavior: 'smooth' });
244
- }
245
- close() {
246
- if (this.context.closeable) {
247
- this.context.$implicit.complete();
248
- }
249
- }
250
- get contentTop() {
251
- return this.content?.nativeElement.offsetTop ?? Infinity;
252
- }
253
- get sheetTop() {
254
- return this.sheet?.nativeElement.offsetTop ?? Infinity;
255
- }
256
- getStops(stops) {
257
- return stops.map(({ nativeElement }) => nativeElement.offsetTop + nativeElement.clientHeight);
258
- }
259
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
260
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetComponent, isStandalone: false, selector: "tui-sheet", inputs: { item: "item" }, host: { attributes: { "role": "dialog" }, listeners: { "tui-sheet-id": "onId($event.detail)" }, properties: { "attr.aria-labelledby": "id", "class._ios": "isIos" } }, providers: TUI_SHEET_PROVIDERS, viewQueries: [{ propertyName: "sheet", first: true, predicate: ["sheet"], descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true }, { propertyName: "stopsRefs", predicate: ["stops"], descendants: true }], ngImport: i0, template: "<div\n class=\"t-bumpers\"\n (click)=\"close()\"\n>\n <div\n *ngFor=\"let stop of item.stops\"\n #stops\n class=\"t-bumper\"\n [style.marginTop]=\"stop\"\n ></div>\n</div>\n<div\n #sheet\n class=\"t-wrapper\"\n [class.t-wrapper_shadow]=\"!item.image\"\n>\n <header\n *ngIf=\"item.image\"\n class=\"t-top\"\n [tuiSheetTop]=\"imageStop\"\n >\n <img\n *polymorpheusOutlet=\"item.image as src; context: context\"\n alt=\"\"\n class=\"t-image\"\n [src]=\"src\"\n />\n </header>\n <section\n #content\n tuiSheetStop\n class=\"t-sheet\"\n >\n <div class=\"t-bar\"></div>\n <tui-sheet-bar>\n <button\n type=\"button\"\n class=\"t-button\"\n [title]=\"moreWord$ | async\"\n (click)=\"scrollTo(stops[1])\"\n ></button>\n </tui-sheet-bar>\n <div class=\"t-content\">\n <h2\n *polymorpheusOutlet=\"item.content as text; context: context\"\n tuiSheetHeading\n class=\"t-heading\"\n >\n {{ text }}\n </h2>\n </div>\n </section>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;position:absolute;left:0;bottom:0;right:0;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;top:auto;border-radius:.75rem .75rem 0 0;overflow-y:auto;overflow-x:hidden;scroll-snap-type:y mandatory;box-shadow:0 50vh var(--tui-background-elevation-1);padding-inline-end:1rem;margin-inline-start:-1rem;transform:scaleX(-1);clip-path:inset(0 1rem 0 0 round .75rem .75rem 0 0);overscroll-behavior:none}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host._stuck{scroll-snap-type:none}@supports (-moz-appearance: none){:host{scroll-snap-type:none}}.t-bumpers{display:flex;block-size:100%}:host-context(.t-wrapper_closeable) .t-bumpers{scroll-snap-stop:always;scroll-snap-align:start;scroll-margin:-1px}.t-bumper{scroll-snap-stop:always;scroll-snap-align:start;block-size:1rem;inline-size:1rem}.t-wrapper{border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start}.t-wrapper_shadow{box-shadow:var(--tui-shadow-small)}.t-top{position:sticky;top:0;border-radius:.8rem .8rem 0 0;box-shadow:var(--tui-shadow-small);transform:scaleX(-1);overflow:hidden}.t-top._clickthrough{pointer-events:none}:host-context(._overlay:not(._visible)) .t-top{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;transform:scaleX(-1)!important}.t-image{display:block;inline-size:100%}.t-sheet{position:relative;border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start;transform:scaleX(-1)}.t-top:not(._rounded)~.t-sheet .t-bar{border-radius:0}.t-bar{transition-property:border-radius;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:sticky;top:0;z-index:1;block-size:1.5rem;margin-block-end:-1.5rem;border-radius:inherit;background:var(--tui-background-elevation-1);box-shadow:inset 0 1px #ffffff40}.t-button{position:absolute;top:0;block-size:1.5rem;inline-size:3rem;padding:0;border:0;opacity:0}.t-content{padding:1rem;margin-block-start:-1rem;border-radius:inherit;background:var(--tui-background-elevation-1)}.t-heading{padding-block-end:.5rem;background:var(--tui-background-elevation-1)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: TuiSheetBarComponent, selector: "tui-sheet-bar" }, { kind: "component", type: TuiSheetHeadingComponent, selector: "[tuiSheetHeading]" }, { kind: "directive", type: TuiSheetTopDirective, selector: "[tuiSheetTop]", inputs: ["tuiSheetTop"] }, { kind: "directive", type: TuiSheetStopDirective, selector: "[tuiSheetStop]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], animations: [tuiSlideInTop], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
261
- }
262
- __decorate([
263
- tuiPure
264
- ], TuiSheetComponent.prototype, "context", null);
265
- __decorate([
266
- tuiPure
267
- ], TuiSheetComponent.prototype, "getStops", null);
268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetComponent, decorators: [{
269
- type: Component,
270
- args: [{ standalone: false, selector: 'tui-sheet', changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_SHEET_PROVIDERS, animations: [tuiSlideInTop], host: {
271
- role: 'dialog',
272
- '[attr.aria-labelledby]': 'id',
273
- '[class._ios]': 'isIos',
274
- [`(${TUI_SHEET_ID})`]: 'onId($event.detail)',
275
- }, template: "<div\n class=\"t-bumpers\"\n (click)=\"close()\"\n>\n <div\n *ngFor=\"let stop of item.stops\"\n #stops\n class=\"t-bumper\"\n [style.marginTop]=\"stop\"\n ></div>\n</div>\n<div\n #sheet\n class=\"t-wrapper\"\n [class.t-wrapper_shadow]=\"!item.image\"\n>\n <header\n *ngIf=\"item.image\"\n class=\"t-top\"\n [tuiSheetTop]=\"imageStop\"\n >\n <img\n *polymorpheusOutlet=\"item.image as src; context: context\"\n alt=\"\"\n class=\"t-image\"\n [src]=\"src\"\n />\n </header>\n <section\n #content\n tuiSheetStop\n class=\"t-sheet\"\n >\n <div class=\"t-bar\"></div>\n <tui-sheet-bar>\n <button\n type=\"button\"\n class=\"t-button\"\n [title]=\"moreWord$ | async\"\n (click)=\"scrollTo(stops[1])\"\n ></button>\n </tui-sheet-bar>\n <div class=\"t-content\">\n <h2\n *polymorpheusOutlet=\"item.content as text; context: context\"\n tuiSheetHeading\n class=\"t-heading\"\n >\n {{ text }}\n </h2>\n </div>\n </section>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;position:absolute;left:0;bottom:0;right:0;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;top:auto;border-radius:.75rem .75rem 0 0;overflow-y:auto;overflow-x:hidden;scroll-snap-type:y mandatory;box-shadow:0 50vh var(--tui-background-elevation-1);padding-inline-end:1rem;margin-inline-start:-1rem;transform:scaleX(-1);clip-path:inset(0 1rem 0 0 round .75rem .75rem 0 0);overscroll-behavior:none}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host._stuck{scroll-snap-type:none}@supports (-moz-appearance: none){:host{scroll-snap-type:none}}.t-bumpers{display:flex;block-size:100%}:host-context(.t-wrapper_closeable) .t-bumpers{scroll-snap-stop:always;scroll-snap-align:start;scroll-margin:-1px}.t-bumper{scroll-snap-stop:always;scroll-snap-align:start;block-size:1rem;inline-size:1rem}.t-wrapper{border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start}.t-wrapper_shadow{box-shadow:var(--tui-shadow-small)}.t-top{position:sticky;top:0;border-radius:.8rem .8rem 0 0;box-shadow:var(--tui-shadow-small);transform:scaleX(-1);overflow:hidden}.t-top._clickthrough{pointer-events:none}:host-context(._overlay:not(._visible)) .t-top{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;transform:scaleX(-1)!important}.t-image{display:block;inline-size:100%}.t-sheet{position:relative;border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start;transform:scaleX(-1)}.t-top:not(._rounded)~.t-sheet .t-bar{border-radius:0}.t-bar{transition-property:border-radius;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:sticky;top:0;z-index:1;block-size:1.5rem;margin-block-end:-1.5rem;border-radius:inherit;background:var(--tui-background-elevation-1);box-shadow:inset 0 1px #ffffff40}.t-button{position:absolute;top:0;block-size:1.5rem;inline-size:3rem;padding:0;border:0;opacity:0}.t-content{padding:1rem;margin-block-start:-1rem;border-radius:inherit;background:var(--tui-background-elevation-1)}.t-heading{padding-block-end:.5rem;background:var(--tui-background-elevation-1)}\n"] }]
276
- }], propDecorators: { sheet: [{
277
- type: ViewChild,
278
- args: ['sheet']
279
- }], content: [{
280
- type: ViewChild,
281
- args: ['content']
282
- }], stopsRefs: [{
283
- type: ViewChildren,
284
- args: ['stops']
285
- }], item: [{
286
- type: Input
287
- }], context: [], getStops: [] } });
288
-
289
- /**
290
- * @deprecated: drop in v5.0 use {@link TuiSheetDialog}
291
- * https://taiga-ui.dev/components/sheet-dialog
292
- */
293
- const TUI_SHEET_DEFAULT_OPTIONS = {
294
- image: '',
295
- imageSlide: true,
296
- stops: [],
297
- initial: 0,
298
- offset: 16,
299
- closeable: true,
300
- overlay: false,
301
- };
302
- /**
303
- * @deprecated: drop in v5.0 use {@link TuiSheetDialog}
304
- * https://taiga-ui.dev/components/sheet-dialog
305
- */
306
- const TUI_SHEET_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_SHEET_OPTIONS' : '', {
307
- factory: () => ({
308
- ...TUI_SHEET_DEFAULT_OPTIONS,
309
- }),
310
- });
311
-
312
- /**
313
- * @deprecated: use {@link TuiSheetDialogService}
314
- * https://taiga-ui.dev/components/sheet-dialog
315
- */
316
- class TuiSheetService {
317
- constructor() {
318
- this.doc = inject(DOCUMENT);
319
- this.options = inject(TUI_SHEET_OPTIONS);
320
- this.sheets$ = new BehaviorSubject([]);
321
- }
322
- open(content, options = {}) {
323
- return new Observable(($implicit) => {
324
- const completeWith = (result) => {
325
- $implicit.next(result);
326
- $implicit.complete();
327
- };
328
- const sheet = {
329
- ...this.options,
330
- ...options,
331
- content,
332
- completeWith,
333
- $implicit,
334
- scroll$: EMPTY,
335
- };
336
- const focused = tuiGetNativeFocused(this.doc);
337
- if (tuiIsHTMLElement(focused) && sheet.overlay) {
338
- focused.blur();
339
- }
340
- this.sheets$.next([...this.sheets$.value, sheet]);
341
- return () => {
342
- this.sheets$.next(this.sheets$.value.filter((item) => item !== sheet));
343
- };
344
- });
345
- }
346
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
347
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetService, providedIn: 'root' }); }
348
- }
349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetService, decorators: [{
350
- type: Injectable,
351
- args: [{
352
- providedIn: 'root',
353
- }]
354
- }] });
355
-
356
- // Safety offset for shadow
357
- const OFFSET = 16;
358
- function processDragged(dragged$, scroll$) {
359
- const touchstart$ = dragged$.pipe(filter(Boolean));
360
- const touchend$ = dragged$.pipe(filter(tuiIsFalsy));
361
- const race$ = race(scroll$, timer(100)).pipe(debounceTime(200), take(1), map(TUI_FALSE_HANDLER));
362
- return touchstart$.pipe(switchMap(() => touchend$.pipe(switchMap(() => race$), startWith(true))), startWith(false));
363
- }
364
- class TuiSheetWrapperDirective {
365
- constructor() {
366
- this.zone = inject(NgZone);
367
- this.win = inject(WA_WINDOW);
368
- this.tuiSheetWrapper = 16;
369
- }
370
- get overlay$() {
371
- return this.scroll$.pipe(map((y) => y + 16 > this.win.innerHeight - this.tuiSheetWrapper), distinctUntilChanged(), tuiZonefull(this.zone));
372
- }
373
- get visible$() {
374
- return processDragged(this.dragged$, this.scroll$).pipe(distinctUntilChanged(), tuiZonefull(this.zone));
375
- }
376
- get height$() {
377
- return this.scroll$.pipe(map(this.getHeight.bind(this)));
378
- }
379
- getHeight(value) {
380
- return this.sheet?.context.overlay
381
- ? null
382
- : tuiClamp(this.withImage(value) + OFFSET, OFFSET, this.win.innerHeight);
383
- }
384
- withImage(value) {
385
- return !this.sheet?.imageStop || Math.floor(value) > this.sheet.imageStop
386
- ? value
387
- : value - this.sheet.imageHeight;
388
- }
389
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetWrapperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
390
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetWrapperDirective, isStandalone: false, selector: "[tuiSheetWrapper]", inputs: { tuiSheetWrapper: "tuiSheetWrapper" }, queries: [{ propertyName: "sheet", first: true, predicate: TuiSheetComponent, descendants: true }, { propertyName: "dragged$", first: true, predicate: TuiSheetComponent, descendants: true, read: TUI_SHEET_DRAGGED, static: true }, { propertyName: "scroll$", first: true, predicate: TuiSheetComponent, descendants: true, read: TUI_SHEET_SCROLL, static: true }], exportAs: ["tuiSheetWrapper"], ngImport: i0 }); }
391
- }
392
- __decorate([
393
- tuiPure
394
- ], TuiSheetWrapperDirective.prototype, "overlay$", null);
395
- __decorate([
396
- tuiPure
397
- ], TuiSheetWrapperDirective.prototype, "visible$", null);
398
- __decorate([
399
- tuiPure
400
- ], TuiSheetWrapperDirective.prototype, "height$", null);
401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetWrapperDirective, decorators: [{
402
- type: Directive,
403
- args: [{
404
- standalone: false,
405
- selector: '[tuiSheetWrapper]',
406
- exportAs: 'tuiSheetWrapper',
407
- }]
408
- }], propDecorators: { sheet: [{
409
- type: ContentChild,
410
- args: [TuiSheetComponent]
411
- }], dragged$: [{
412
- type: ContentChild,
413
- args: [TuiSheetComponent, { read: TUI_SHEET_DRAGGED, static: true }]
414
- }], scroll$: [{
415
- type: ContentChild,
416
- args: [TuiSheetComponent, { read: TUI_SHEET_SCROLL, static: true }]
417
- }], tuiSheetWrapper: [{
418
- type: Input
419
- }], overlay$: [], visible$: [], height$: [] } });
420
-
421
- class TuiSheetCloseDirective {
422
- constructor() {
423
- this.zone = inject(NgZone);
424
- this.dragged$ = inject(TUI_SHEET_DRAGGED);
425
- this.scroll$ = inject(TUI_SHEET_SCROLL);
426
- this.win = inject(WA_WINDOW);
427
- this.el = tuiInjectElement();
428
- this.sheet = inject(TuiSheetComponent);
429
- this.close = merge(tuiTypedFromEvent(this.el, TUI_SHEET_CLOSE), this.dragged$.pipe(tuiIfMap(() => this.scroll$.pipe(startWith(this.el.scrollTop)), tuiIsFalsy), filter((y) => this.sheet.item?.closeable && this.shouldClose(y)), distinctUntilChanged(), tuiZonefull(this.zone)));
430
- }
431
- shouldClose(scrollTop) {
432
- const height = Math.min(this.win.innerHeight, this.el.scrollHeight - this.win.innerHeight);
433
- const min = Math.min(height, this.sheet.stops[0] || Infinity);
434
- return scrollTop < min / 2;
435
- }
436
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetCloseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
437
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetCloseDirective, isStandalone: false, selector: "tui-sheet[close]", outputs: { close: "close" }, ngImport: i0 }); }
438
- }
439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetCloseDirective, decorators: [{
440
- type: Directive,
441
- args: [{
442
- standalone: false,
443
- selector: 'tui-sheet[close]',
444
- }]
445
- }], propDecorators: { close: [{
446
- type: Output
447
- }] } });
448
-
449
- class TuiSheetsHostComponent {
450
- constructor() {
451
- this.service = inject(TuiSheetService);
452
- this.destroyRef = inject(DestroyRef);
453
- this.cdr = inject(ChangeDetectorRef);
454
- this.height$ = inject(TUI_WINDOW_SIZE).pipe(map(({ height }) => height));
455
- this.sheets = [];
456
- this.options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));
457
- }
458
- ngOnInit() {
459
- // Due to this view being parallel to app content, `markForCheck` from `async` pipe
460
- // can happen after view was checked, so calling `detectChanges` instead
461
- this.service.sheets$
462
- .pipe(takeUntilDestroyed(this.destroyRef))
463
- .subscribe((sheets) => {
464
- this.sheets = sheets;
465
- this.cdr.detectChanges();
466
- });
467
- }
468
- close({ closeable, $implicit }) {
469
- if (closeable) {
470
- $implicit.complete();
471
- }
472
- }
473
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetsHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
474
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetsHostComponent, isStandalone: false, selector: "tui-sheets-host", ngImport: i0, template: "<div\n *ngFor=\"let item of sheets\"\n #wrapper=\"tuiSheetWrapper\"\n class=\"t-wrapper\"\n [@tuiFadeIn]=\"options\"\n [@tuiSlideInTop]=\"options\"\n [class.t-wrapper_closeable]=\"item.closeable\"\n [class.t-wrapper_overlay]=\"item.overlay || (wrapper.overlay$ | async)\"\n [class.t-wrapper_visible]=\"wrapper.visible$ | async\"\n [style.height.px]=\"wrapper.height$ | async\"\n [tuiSheetWrapper]=\"item.offset\"\n (click.self)=\"close(item)\"\n>\n <tui-sheet\n tuiScrollRef\n [item]=\"item\"\n [style.height.px]=\"((height$ | async) || 0) - item.offset\"\n (close)=\"close(item)\"\n />\n</div>\n<div\n class=\"t-overlay\"\n (click)=\"sheets[0] && close(sheets[0])\"\n></div>\n", styles: [":host{position:sticky;bottom:0;display:block;block-size:0}.t-overlay{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:fixed;top:0;left:0;inline-size:100%;z-index:-1;block-size:100%;background:#000;opacity:.001;pointer-events:none}.t-wrapper_overlay~.t-overlay{opacity:.8;pointer-events:auto;touch-action:none}.t-wrapper{position:absolute;bottom:0;z-index:0;inline-size:100%;block-size:100vh;overflow:hidden}.t-wrapper_visible{overflow:visible}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: TuiSheetComponent, selector: "tui-sheet", inputs: ["item"] }, { kind: "directive", type: TuiSheetWrapperDirective, selector: "[tuiSheetWrapper]", inputs: ["tuiSheetWrapper"], exportAs: ["tuiSheetWrapper"] }, { kind: "directive", type: TuiSheetCloseDirective, selector: "tui-sheet[close]", outputs: ["close"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], animations: [tuiSlideInTop, tuiFadeIn], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
475
- }
476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetsHostComponent, decorators: [{
477
- type: Component,
478
- args: [{ standalone: false, selector: 'tui-sheets-host', changeDetection: ChangeDetectionStrategy.OnPush, animations: [tuiSlideInTop, tuiFadeIn], template: "<div\n *ngFor=\"let item of sheets\"\n #wrapper=\"tuiSheetWrapper\"\n class=\"t-wrapper\"\n [@tuiFadeIn]=\"options\"\n [@tuiSlideInTop]=\"options\"\n [class.t-wrapper_closeable]=\"item.closeable\"\n [class.t-wrapper_overlay]=\"item.overlay || (wrapper.overlay$ | async)\"\n [class.t-wrapper_visible]=\"wrapper.visible$ | async\"\n [style.height.px]=\"wrapper.height$ | async\"\n [tuiSheetWrapper]=\"item.offset\"\n (click.self)=\"close(item)\"\n>\n <tui-sheet\n tuiScrollRef\n [item]=\"item\"\n [style.height.px]=\"((height$ | async) || 0) - item.offset\"\n (close)=\"close(item)\"\n />\n</div>\n<div\n class=\"t-overlay\"\n (click)=\"sheets[0] && close(sheets[0])\"\n></div>\n", styles: [":host{position:sticky;bottom:0;display:block;block-size:0}.t-overlay{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:fixed;top:0;left:0;inline-size:100%;z-index:-1;block-size:100%;background:#000;opacity:.001;pointer-events:none}.t-wrapper_overlay~.t-overlay{opacity:.8;pointer-events:auto;touch-action:none}.t-wrapper{position:absolute;bottom:0;z-index:0;inline-size:100%;block-size:100vh;overflow:hidden}.t-wrapper_visible{overflow:visible}\n"] }]
479
- }] });
480
-
481
- /**
482
- * @deprecated: use {@link TuiSheetDialog}
483
- * https://taiga-ui.dev/components/sheet-dialog
484
- */
485
- class TuiSheetDirective extends PolymorpheusTemplate {
486
- constructor() {
487
- super(...arguments);
488
- this.service = inject(TuiSheetService);
489
- this.open$ = new Subject();
490
- this.options = {};
491
- this.tuiSheetChange = this.open$.pipe(tuiIfMap(() => this.service.open(this, this.options).pipe(ignoreElements(), endWith(false))), share());
492
- }
493
- set tuiSheet(open) {
494
- this.open$.next(open);
495
- }
496
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
497
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.9", type: TuiSheetDirective, isStandalone: false, selector: "ng-template[tuiSheet]", inputs: { options: ["tuiSheetOptions", "options"], tuiSheet: "tuiSheet" }, outputs: { tuiSheetChange: "tuiSheetChange" }, usesInheritance: true, ngImport: i0 }); }
498
- }
499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetDirective, decorators: [{
500
- type: Directive,
501
- args: [{
502
- standalone: false,
503
- selector: 'ng-template[tuiSheet]',
504
- }]
505
- }], propDecorators: { options: [{
506
- type: Input,
507
- args: ['tuiSheetOptions']
508
- }], tuiSheetChange: [{
509
- type: Output
510
- }], tuiSheet: [{
511
- type: Input
512
- }] } });
513
-
514
- /**
515
- * @deprecated: use {@link TuiSheetDialog}
516
- * https://taiga-ui.dev/components/sheet-dialog
517
- */
518
- class TuiSheetModule {
519
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
520
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetModule, declarations: [TuiSheetsHostComponent,
521
- TuiSheetComponent,
522
- TuiSheetBarComponent,
523
- TuiSheetHeadingComponent,
524
- TuiSheetTopDirective,
525
- TuiSheetDirective,
526
- TuiSheetWrapperDirective,
527
- TuiSheetCloseDirective,
528
- TuiSheetStopDirective], imports: [CommonModule,
529
- PolymorpheusOutlet,
530
- PolymorpheusTemplate,
531
- TuiLet,
532
- TuiButton,
533
- TuiScrollbar], exports: [TuiSheetsHostComponent,
534
- TuiSheetComponent,
535
- TuiSheetHeadingComponent,
536
- TuiSheetDirective] }); }
537
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetModule, imports: [CommonModule,
538
- TuiScrollbar] }); }
539
- }
540
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiSheetModule, decorators: [{
541
- type: NgModule,
542
- args: [{
543
- imports: [
544
- CommonModule,
545
- PolymorpheusOutlet,
546
- PolymorpheusTemplate,
547
- TuiLet,
548
- TuiButton,
549
- TuiScrollbar,
550
- ],
551
- declarations: [
552
- TuiSheetsHostComponent,
553
- TuiSheetComponent,
554
- TuiSheetBarComponent,
555
- TuiSheetHeadingComponent,
556
- TuiSheetTopDirective,
557
- TuiSheetDirective,
558
- TuiSheetWrapperDirective,
559
- TuiSheetCloseDirective,
560
- TuiSheetStopDirective,
561
- ],
562
- exports: [
563
- TuiSheetsHostComponent,
564
- TuiSheetComponent,
565
- TuiSheetHeadingComponent,
566
- TuiSheetDirective,
567
- ],
568
- schemas: [NO_ERRORS_SCHEMA],
569
- }]
570
- }] });
571
-
572
- /**
573
- * Generated bundle index. Do not edit.
574
- */
575
-
576
- export { TUI_SHEET_CLOSE, TUI_SHEET_DEFAULT_OPTIONS, TUI_SHEET_ID, TUI_SHEET_OPTIONS, TUI_SHEET_PROVIDERS, TuiSheetBarComponent, TuiSheetCloseDirective, TuiSheetComponent, TuiSheetDirective, TuiSheetHeadingComponent, TuiSheetModule, TuiSheetService, TuiSheetStopDirective, TuiSheetTopDirective, TuiSheetWrapperDirective, TuiSheetsHostComponent };
577
- //# sourceMappingURL=taiga-ui-legacy-components-sheet.mjs.map