@taiga-ui/addon-mobile 4.52.0-canary.669a014 → 4.52.0-canary.692273c
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.
- package/components/sheet-dialog/sheet-dialog.options.d.ts +1 -1
- package/directives/dropdown-mobile/dropdown-mobile-wrapper.component.d.ts +20 -0
- package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +5 -15
- package/directives/index.d.ts +0 -1
- package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs +8 -8
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +105 -85
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives.mjs +0 -1
- package/fesm2022/taiga-ui-addon-mobile-directives.mjs.map +1 -1
- package/package.json +2 -6
- package/styles/common/toast.less +21 -0
- package/styles/taiga-ui-mobile.less +8 -0
- package/directives/sidebar/index.d.ts +0 -3
- package/directives/sidebar/sidebar.component.d.ts +0 -21
- package/directives/sidebar/sidebar.d.ts +0 -6
- package/directives/sidebar/sidebar.directive.d.ts +0 -22
- package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs +0 -114
- package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs.map +0 -1
|
@@ -4,7 +4,7 @@ import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
|
4
4
|
import { type Observable } from 'rxjs';
|
|
5
5
|
export interface TuiSheetDialogOptions<I = undefined> {
|
|
6
6
|
readonly appearance: string;
|
|
7
|
-
readonly
|
|
7
|
+
readonly closable: Observable<boolean> | boolean;
|
|
8
8
|
readonly data: I;
|
|
9
9
|
readonly initial: number;
|
|
10
10
|
readonly label: PolymorpheusContent<TuiPopover<TuiSheetDialogOptions<I>, any>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DestroyRef, type OnInit } from '@angular/core';
|
|
2
|
+
import { TuiSheetDialogService } from '@taiga-ui/addon-mobile/components/sheet-dialog';
|
|
3
|
+
import { TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
|
|
4
|
+
import { TuiDropdownMobile } from './dropdown-mobile.directive';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@taiga-ui/cdk/directives/active-zone";
|
|
7
|
+
import * as i2 from "@taiga-ui/cdk/directives/animated";
|
|
8
|
+
export declare class TuiDropdownMobileWrapperComponent implements OnInit {
|
|
9
|
+
private readonly content?;
|
|
10
|
+
protected readonly destroyRef: DestroyRef;
|
|
11
|
+
protected readonly dialogs: TuiSheetDialogService;
|
|
12
|
+
protected readonly directive: TuiDropdownMobile;
|
|
13
|
+
protected readonly dropdown: TuiDropdownDirective;
|
|
14
|
+
protected readonly context: {
|
|
15
|
+
$implicit: () => void;
|
|
16
|
+
};
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiDropdownMobileWrapperComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TuiDropdownMobileWrapperComponent, "ng-component", never, {}, {}, never, never, true, [{ directive: typeof i1.TuiActiveZone; inputs: {}; outputs: {}; }, { directive: typeof i2.TuiAnimated; inputs: {}; outputs: {}; }]>;
|
|
20
|
+
}
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type TuiSwipeEvent } from '@taiga-ui/cdk/directives/swipe';
|
|
3
|
-
import { TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
|
|
4
|
-
import { TuiDropdownMobile } from './dropdown-mobile.directive';
|
|
1
|
+
import { type OnDestroy } from '@angular/core';
|
|
5
2
|
import * as i0 from "@angular/core";
|
|
6
|
-
|
|
7
|
-
import * as i2 from "@taiga-ui/cdk/directives/animated";
|
|
8
|
-
export declare class TuiDropdownMobileComponent implements OnDestroy, AfterViewInit {
|
|
3
|
+
export declare class TuiDropdownMobileComponent implements OnDestroy {
|
|
9
4
|
private readonly el;
|
|
10
5
|
private readonly keyboard;
|
|
11
6
|
private readonly doc;
|
|
12
7
|
private readonly scrollTop;
|
|
8
|
+
private readonly dropdown;
|
|
13
9
|
private readonly observer;
|
|
14
|
-
protected readonly directive: TuiDropdownMobile;
|
|
15
|
-
protected readonly dropdown: TuiDropdownDirective;
|
|
16
10
|
constructor();
|
|
17
|
-
ngAfterViewInit(): void;
|
|
18
11
|
ngOnDestroy(): void;
|
|
19
|
-
protected readonly close: () => void;
|
|
20
12
|
protected onClick(event: MouseEvent): void;
|
|
21
|
-
protected
|
|
22
|
-
protected onIntersection({ isIntersecting }: IntersectionObserverEntry): void;
|
|
23
|
-
protected refresh({ offsetTop, height }: VisualViewport): void;
|
|
13
|
+
protected refresh(): void;
|
|
24
14
|
private get focused();
|
|
25
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiDropdownMobileComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TuiDropdownMobileComponent, "tui-dropdown-mobile", never, {}, {}, never,
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TuiDropdownMobileComponent, "tui-dropdown-mobile", never, {}, {}, never, ["*"], true, never>;
|
|
27
17
|
}
|
package/directives/index.d.ts
CHANGED
|
@@ -2,5 +2,4 @@ export * from '@taiga-ui/addon-mobile/directives/dropdown-mobile';
|
|
|
2
2
|
export * from '@taiga-ui/addon-mobile/directives/elastic-sticky';
|
|
3
3
|
export * from '@taiga-ui/addon-mobile/directives/responsive-dialog';
|
|
4
4
|
export * from '@taiga-ui/addon-mobile/directives/ripple';
|
|
5
|
-
export * from '@taiga-ui/addon-mobile/directives/sidebar';
|
|
6
5
|
export * from '@taiga-ui/addon-mobile/directives/touchable';
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Input, ViewChild, ViewChildren, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
4
4
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
5
|
-
import { tuiHeaderOptionsProvider } from '@taiga-ui/
|
|
5
|
+
import { tuiHeaderOptionsProvider } from '@taiga-ui/core/components/header';
|
|
6
6
|
|
|
7
7
|
const OPTIONS = {
|
|
8
8
|
duration: 20,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-components-bottom-sheet.mjs","sources":["../../../projects/addon-mobile/components/bottom-sheet/bottom-sheet.component.ts","../../../projects/addon-mobile/components/bottom-sheet/bottom-sheet.template.html","../../../projects/addon-mobile/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n Input,\n type QueryList,\n ViewChild,\n ViewChildren,\n} from '@angular/core';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiHeaderOptionsProvider} from '@taiga-ui/
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-components-bottom-sheet.mjs","sources":["../../../projects/addon-mobile/components/bottom-sheet/bottom-sheet.component.ts","../../../projects/addon-mobile/components/bottom-sheet/bottom-sheet.template.html","../../../projects/addon-mobile/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n Input,\n type QueryList,\n ViewChild,\n ViewChildren,\n} from '@angular/core';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiHeaderOptionsProvider} from '@taiga-ui/core/components/header';\n\nconst OPTIONS = {\n duration: 20,\n easing: 'ease-in',\n fill: 'forwards',\n} as const;\n\n@Component({\n selector: 'tui-bottom-sheet',\n templateUrl: './bottom-sheet.template.html',\n styleUrls: ['./bottom-sheet.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiHeaderOptionsProvider({size: 'h5'})],\n host: {\n '[style.--t-initial]': 'stops[0]',\n '[style.scroll-snap-type]': 'stops.length > 1 ? \"y mandatory\" : null',\n '(scroll.zoneless)': 'onScroll()',\n '(resize)': 'onScroll()',\n },\n})\nexport class TuiBottomSheet {\n @ViewChildren('stops')\n private readonly elements: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n @ViewChild('content')\n private readonly content?: ElementRef<HTMLElement>;\n\n private readonly el = tuiInjectElement();\n\n @Input()\n public stops: readonly string[] = ['1.5rem'];\n\n protected onScroll(): void {\n const {clientHeight, scrollTop, scrollHeight} = this.el;\n const top = this.elements.get(0)?.nativeElement.clientHeight || 0;\n const max = this.content?.nativeElement.clientHeight || Infinity;\n const height = Math.min(clientHeight, max);\n const scrolled = Math.min(scrollTop, height - top);\n const transform = `translate3d(0, ${-1 * scrolled}px, 0)`;\n\n this.el.style.setProperty('--t-height', `${scrollHeight}px`);\n this.el.animate([{transform}], OPTIONS);\n }\n}\n","@for (stop of stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.top]=\"stop\"\n ></div>\n}\n<div\n #content\n class=\"t-content\"\n (resize)=\"onScroll()\"\n>\n <ng-content />\n</div>\n<div class=\"t-bottom\"></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAaA,MAAM,OAAO,GAAG;AACZ,IAAA,QAAQ,EAAE,EAAE;AACZ,IAA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AA;sBADxB,YAAY;uBAAC,OAAO;gBAIJ,OAAO,EAAA,CAAA;sBADvB,SAAS;uBAAC,SAAS;gBAMb,KAAK,EAAA,CAAA;sBADX;;;AEzCL;;AAEG;;;;"}
|
|
@@ -64,7 +64,7 @@ const TUI_PULL_TO_REFRESH_COMPONENT = new InjectionToken(ngDevMode ? 'TUI_PULL_T
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
const MICRO_OFFSET = 10 ** -6;
|
|
67
|
-
const EXCLUSION_SELECTORS = 'tui-dialog, tui-dropdown, tui-dropdown-mobile';
|
|
67
|
+
const EXCLUSION_SELECTORS = 'tui-dialog, tui-sheet-dialog, tui-dropdown, tui-dropdown-mobile';
|
|
68
68
|
class TuiPullToRefreshService extends Observable {
|
|
69
69
|
constructor() {
|
|
70
70
|
const component = inject(TUI_PULL_TO_REFRESH_COMPONENT);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-components-pull-to-refresh.mjs","sources":["../../../projects/addon-mobile/components/pull-to-refresh/loader-ios/loader-ios.component.ts","../../../projects/addon-mobile/components/pull-to-refresh/loader-ios/loader-ios.template.html","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.providers.ts","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.service.ts","../../../projects/addon-mobile/components/pull-to-refresh/loader-android/loader-android.component.ts","../../../projects/addon-mobile/components/pull-to-refresh/loader-android/loader-android.template.html","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.component.ts","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.template.html","../../../projects/addon-mobile/components/pull-to-refresh/taiga-ui-addon-mobile-components-pull-to-refresh.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {injectContext, PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\nimport {TUI_PULL_TO_REFRESH_THRESHOLD} from '../pull-to-refresh.providers';\n\nconst LOADED_STEP = 8;\nconst ROTATE_X_STEP = 30;\n\n@Component({\n selector: 'tui-mobile-ios-loader',\n imports: [TuiRepeatTimes],\n templateUrl: './loader-ios.template.html',\n styleUrls: ['./loader-ios.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMobileLoaderIOS {\n private readonly context = injectContext<TuiContext<number>>();\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n protected readonly steps = 12;\n\n protected get finished(): boolean {\n return this.percent >= 100;\n }\n\n protected get percent(): number {\n return (this.context.$implicit * 100) / this.threshold;\n }\n\n protected isShown(index: number): boolean {\n return this.percent > (index + 1) * LOADED_STEP;\n }\n\n protected calculateTransform(index: number): string {\n return `rotate(${index * ROTATE_X_STEP} 50 50)`;\n }\n\n protected calculateAnimationBegin(index: number): string {\n return `${(index * LOADED_STEP) / 100}s`;\n }\n}\n\nexport const TUI_IOS_LOADER = new PolymorpheusComponent(TuiMobileLoaderIOS);\n","<svg\n height=\"36\"\n preserveAspectRatio=\"xMidYMid\"\n viewBox=\"0 0 100 100\"\n width=\"36\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <ng-container *tuiRepeatTimes=\"let index of steps\">\n @if (isShown(index)) {\n <g [attr.transform]=\"calculateTransform(index)\">\n <rect\n fill=\"#c7c9cc\"\n height=\"16\"\n rx=\"7.05\"\n ry=\"3.3\"\n width=\"6\"\n x=\"47\"\n y=\"22\"\n >\n @if (finished) {\n <animate\n attributeName=\"opacity\"\n dur=\"1s\"\n keyTimes=\"0;1\"\n repeatCount=\"indefinite\"\n values=\"1;0\"\n [attr.begin]=\"calculateAnimationBegin(index)\"\n />\n }\n </rect>\n </g>\n }\n </ng-container>\n</svg>\n","import {inject, InjectionToken} from '@angular/core';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {EMPTY, type Observable} from 'rxjs';\n\nimport {TUI_ANDROID_LOADER} from './loader-android/loader-android.component';\nimport {TUI_IOS_LOADER} from './loader-ios/loader-ios.component';\n\n/**\n * Stream that emits when loading is over\n */\nexport const TUI_PULL_TO_REFRESH_LOADED = new InjectionToken<Observable<unknown>>(\n ngDevMode ? 'TUI_PULL_TO_REFRESH_LOADED' : '',\n {\n factory: () => EMPTY,\n },\n);\n\n/**\n * Pull threshold in pixels until loading starts\n */\nexport const TUI_PULL_TO_REFRESH_THRESHOLD = new InjectionToken(\n ngDevMode ? 'TUI_PULL_TO_REFRESH_THRESHOLD' : '',\n {\n factory: () => 50,\n },\n);\n\n/**\n * Loading indicator component that gets current pull distance in pixels as context\n */\nexport const TUI_PULL_TO_REFRESH_COMPONENT = new InjectionToken<\n PolymorpheusContent<TuiContext<number>>\n>(ngDevMode ? 'TUI_PULL_TO_REFRESH_COMPONENT' : '', {\n factory: () => (inject(TUI_IS_IOS) ? TUI_IOS_LOADER : TUI_ANDROID_LOADER),\n});\n","import {type ElementRef, inject, Injectable} from '@angular/core';\nimport {\n tuiScrollFrom,\n tuiTypedFromEvent,\n tuiZonefreeScheduler,\n tuiZoneOptimized,\n} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {\n debounceTime,\n distinctUntilChanged,\n EMPTY,\n endWith,\n filter,\n map,\n Observable,\n scan,\n share,\n startWith,\n switchMap,\n takeUntil,\n takeWhile,\n tap,\n} from 'rxjs';\n\nimport {\n TUI_PULL_TO_REFRESH_COMPONENT,\n TUI_PULL_TO_REFRESH_LOADED,\n TUI_PULL_TO_REFRESH_THRESHOLD,\n} from './pull-to-refresh.providers';\n\nexport const MICRO_OFFSET = 10 ** -6;\nconst EXCLUSION_SELECTORS = 'tui-dialog, tui-dropdown, tui-dropdown-mobile';\n\n@Injectable()\nexport class TuiPullToRefreshService extends Observable<number> {\n private readonly el = tuiInjectElement();\n private readonly scrollRef: ElementRef<HTMLElement> = inject(TUI_SCROLL_REF);\n private readonly loaded$ = inject(TUI_PULL_TO_REFRESH_LOADED);\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n // Hack for iOS to determine if pulling stopped due to scroll\n // because Safari does not support `touch-action: pan-down`\n private touched = false;\n\n private readonly pulling$ = this.loaded$.pipe(\n startWith(null),\n switchMap(() =>\n tuiTypedFromEvent(this.el, 'touchstart', {passive: true}).pipe(\n filter(\n () =>\n !this.scrollRef.nativeElement.scrollTop &&\n !this.el.querySelector(EXCLUSION_SELECTORS),\n ),\n map(({touches}) => touches[0]?.clientY ?? 0),\n switchMap((start) =>\n tuiTypedFromEvent(this.el, 'touchmove').pipe(\n tap((): void => {\n this.touched = true;\n }),\n map(({touches}) => (touches[0]?.clientY ?? 0) - start),\n filter((distance) => distance > 0),\n takeUntil(\n tuiTypedFromEvent(this.el, 'touchend').pipe(\n tap((): void => {\n this.touched = false;\n }),\n ),\n ),\n takeUntil(tuiScrollFrom(this.scrollRef.nativeElement)),\n endWith(0),\n ),\n ),\n scan(\n (prev, current) =>\n !current && !this.touched && prev > this.threshold\n ? this.threshold\n : current + current * MICRO_OFFSET,\n 0,\n ),\n takeWhile((distance) => distance !== this.threshold, true),\n startWith(0),\n ),\n ),\n debounceTime(0, tuiZonefreeScheduler()),\n distinctUntilChanged(),\n tuiZoneOptimized(),\n share(),\n );\n\n constructor() {\n const component = inject(TUI_PULL_TO_REFRESH_COMPONENT);\n\n super((subscriber) => (component ? this.pulling$ : EMPTY).subscribe(subscriber));\n }\n}\n","import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {TuiLoader} from '@taiga-ui/core/components/loader';\nimport {injectContext, PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\nimport {TUI_PULL_TO_REFRESH_THRESHOLD} from '../pull-to-refresh.providers';\nimport {MICRO_OFFSET} from '../pull-to-refresh.service';\n\nconst ROTATE_X_DEFAULT = 180;\nconst ROTATE_X_MAX = 500;\nconst ROTATE_X_MULTIPLIER = 2.3;\n\n@Component({\n selector: 'tui-mobile-android-loader',\n imports: [TuiLoader],\n templateUrl: './loader-android.template.html',\n styleUrls: ['./loader-android.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._visible]': 'percent',\n '[class._dropped]': 'dropped',\n '[style.transform]': 'hostTransform',\n },\n})\nexport class TuiMobileLoaderAndroid {\n private readonly context = injectContext<TuiContext<number>>();\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n protected get percent(): number {\n return (this.context.$implicit * 100) / this.threshold;\n }\n\n protected get dropped(): boolean {\n return (\n this.context.$implicit <= MICRO_OFFSET ||\n this.context.$implicit === this.threshold\n );\n }\n\n protected get hostTransform(): string {\n return `translateY(${Math.min(this.context.$implicit, this.threshold * 1.5)}px)`;\n }\n\n protected get opacity(): number {\n return this.context.$implicit / (this.threshold * 1.5);\n }\n\n protected get transform(): string {\n const rotateX = Math.min(\n ROTATE_X_DEFAULT + this.percent * ROTATE_X_MULTIPLIER,\n ROTATE_X_MAX,\n );\n\n return `rotate(${rotateX} 0 0)`;\n }\n}\n\nexport const TUI_ANDROID_LOADER = new PolymorpheusComponent(TuiMobileLoaderAndroid);\n","<div class=\"t-wrapper\">\n @if (percent !== 100) {\n <svg\n fill=\"none\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.transform]=\"transform\"\n [style.opacity]=\"opacity\"\n >\n <defs>\n <mask id=\"mask-1\">\n <path\n clip-rule=\"evenodd\"\n d=\"M21 12C21 7.03 16.97 3 12 3C7.03 3 3 7.03 3 12C3 16.97 7.03 21 12 21C14.06 21 15.96 20.3 17.48 19.14L16.06 17.7C14.91 18.51 13.51 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12H16L20 16L24 12H21Z\"\n fill=\"white\"\n fill-rule=\"evenodd\"\n />\n </mask>\n </defs>\n <g mask=\"url(#mask-1)\">\n <path\n clip-rule=\"evenodd\"\n d=\"M21 12C21 7.03 16.97 3 12 3C7.03 3 3 7.03 3 12C3 16.97 7.03 21 12 21C14.06 21 15.96 20.3 17.48 19.14L16.06 17.7C14.91 18.51 13.51 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12H16L20 16L24 12H21Z\"\n fill=\"black\"\n fill-rule=\"evenodd\"\n />\n </g>\n </svg>\n } @else {\n <tui-loader\n size=\"s\"\n class=\"t-loader\"\n [inheritColor]=\"true\"\n />\n }\n</div>\n","import {AsyncPipe} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, inject, Input, Output} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiScrollFrom, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {type TuiContext, type TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {distinctUntilChanged, filter, map, type Observable, startWith} from 'rxjs';\n\nimport {\n TUI_PULL_TO_REFRESH_COMPONENT,\n TUI_PULL_TO_REFRESH_THRESHOLD,\n} from './pull-to-refresh.providers';\nimport {MICRO_OFFSET, TuiPullToRefreshService} from './pull-to-refresh.service';\n\n@Component({\n selector: 'tui-pull-to-refresh',\n imports: [AsyncPipe, PolymorpheusOutlet],\n templateUrl: './pull-to-refresh.template.html',\n styleUrls: ['./pull-to-refresh.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiPullToRefreshService],\n})\nexport class TuiPullToRefresh {\n private readonly isIOS = inject(TUI_IS_IOS);\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n protected readonly pulling$ = inject(TuiPullToRefreshService);\n protected readonly component = inject<PolymorpheusContent<TuiContext<number>>>(\n TUI_PULL_TO_REFRESH_COMPONENT,\n );\n\n protected readonly dropped$: Observable<boolean> = this.pulling$.pipe(\n map((distance) => distance <= MICRO_OFFSET || distance === this.threshold),\n distinctUntilChanged(),\n );\n\n @Input()\n public styleHandler: TuiHandler<number, Record<string, unknown> | null> = this.isIOS\n ? (distance) => ({top: tuiPx(distance / 2)})\n : () => null;\n\n @Output()\n public readonly pulled: Observable<unknown> = inject(TuiPullToRefreshService).pipe(\n filter((distance) => distance === this.threshold),\n );\n\n constructor() {\n if (!this.component) {\n return; // Ensure scrolling down is impossible while pulling\n }\n\n const el: HTMLElement = inject(TUI_SCROLL_REF).nativeElement;\n\n tuiScrollFrom(el)\n .pipe(startWith(null), tuiZonefree(), takeUntilDestroyed())\n .subscribe(() => {\n if (el.scrollTop) {\n el.style.touchAction = '';\n } else {\n el.style.touchAction = 'pan-down';\n }\n });\n }\n}\n","<ng-container *polymorpheusOutlet=\"component; context: {$implicit: (pulling$ | async) || 0}\" />\n\n<div\n [class.t-drop]=\"dropped$ | async\"\n [style.position]=\"'relative'\"\n [style]=\"styleHandler((pulling$ | async) || 0)\"\n>\n <ng-content />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,MAAM,WAAW,GAAG,CAAC;AACrB,MAAM,aAAa,GAAG,EAAE;MASX,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;QAQqB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAsB;AAC7C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,6BAA6B,CAAC;QAE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components/pull-to-refresh/loader-ios/loader-ios.component.ts","../../../projects/addon-mobile/components/pull-to-refresh/loader-ios/loader-ios.template.html","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.providers.ts","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.service.ts","../../../projects/addon-mobile/components/pull-to-refresh/loader-android/loader-android.component.ts","../../../projects/addon-mobile/components/pull-to-refresh/loader-android/loader-android.template.html","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.component.ts","../../../projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.template.html","../../../projects/addon-mobile/components/pull-to-refresh/taiga-ui-addon-mobile-components-pull-to-refresh.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {injectContext, PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\nimport {TUI_PULL_TO_REFRESH_THRESHOLD} from '../pull-to-refresh.providers';\n\nconst LOADED_STEP = 8;\nconst ROTATE_X_STEP = 30;\n\n@Component({\n selector: 'tui-mobile-ios-loader',\n imports: [TuiRepeatTimes],\n templateUrl: './loader-ios.template.html',\n styleUrls: ['./loader-ios.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiMobileLoaderIOS {\n private readonly context = injectContext<TuiContext<number>>();\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n protected readonly steps = 12;\n\n protected get finished(): boolean {\n return this.percent >= 100;\n }\n\n protected get percent(): number {\n return (this.context.$implicit * 100) / this.threshold;\n }\n\n protected isShown(index: number): boolean {\n return this.percent > (index + 1) * LOADED_STEP;\n }\n\n protected calculateTransform(index: number): string {\n return `rotate(${index * ROTATE_X_STEP} 50 50)`;\n }\n\n protected calculateAnimationBegin(index: number): string {\n return `${(index * LOADED_STEP) / 100}s`;\n }\n}\n\nexport const TUI_IOS_LOADER = new PolymorpheusComponent(TuiMobileLoaderIOS);\n","<svg\n height=\"36\"\n preserveAspectRatio=\"xMidYMid\"\n viewBox=\"0 0 100 100\"\n width=\"36\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <ng-container *tuiRepeatTimes=\"let index of steps\">\n @if (isShown(index)) {\n <g [attr.transform]=\"calculateTransform(index)\">\n <rect\n fill=\"#c7c9cc\"\n height=\"16\"\n rx=\"7.05\"\n ry=\"3.3\"\n width=\"6\"\n x=\"47\"\n y=\"22\"\n >\n @if (finished) {\n <animate\n attributeName=\"opacity\"\n dur=\"1s\"\n keyTimes=\"0;1\"\n repeatCount=\"indefinite\"\n values=\"1;0\"\n [attr.begin]=\"calculateAnimationBegin(index)\"\n />\n }\n </rect>\n </g>\n }\n </ng-container>\n</svg>\n","import {inject, InjectionToken} from '@angular/core';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {EMPTY, type Observable} from 'rxjs';\n\nimport {TUI_ANDROID_LOADER} from './loader-android/loader-android.component';\nimport {TUI_IOS_LOADER} from './loader-ios/loader-ios.component';\n\n/**\n * Stream that emits when loading is over\n */\nexport const TUI_PULL_TO_REFRESH_LOADED = new InjectionToken<Observable<unknown>>(\n ngDevMode ? 'TUI_PULL_TO_REFRESH_LOADED' : '',\n {\n factory: () => EMPTY,\n },\n);\n\n/**\n * Pull threshold in pixels until loading starts\n */\nexport const TUI_PULL_TO_REFRESH_THRESHOLD = new InjectionToken(\n ngDevMode ? 'TUI_PULL_TO_REFRESH_THRESHOLD' : '',\n {\n factory: () => 50,\n },\n);\n\n/**\n * Loading indicator component that gets current pull distance in pixels as context\n */\nexport const TUI_PULL_TO_REFRESH_COMPONENT = new InjectionToken<\n PolymorpheusContent<TuiContext<number>>\n>(ngDevMode ? 'TUI_PULL_TO_REFRESH_COMPONENT' : '', {\n factory: () => (inject(TUI_IS_IOS) ? TUI_IOS_LOADER : TUI_ANDROID_LOADER),\n});\n","import {type ElementRef, inject, Injectable} from '@angular/core';\nimport {\n tuiScrollFrom,\n tuiTypedFromEvent,\n tuiZonefreeScheduler,\n tuiZoneOptimized,\n} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {\n debounceTime,\n distinctUntilChanged,\n EMPTY,\n endWith,\n filter,\n map,\n Observable,\n scan,\n share,\n startWith,\n switchMap,\n takeUntil,\n takeWhile,\n tap,\n} from 'rxjs';\n\nimport {\n TUI_PULL_TO_REFRESH_COMPONENT,\n TUI_PULL_TO_REFRESH_LOADED,\n TUI_PULL_TO_REFRESH_THRESHOLD,\n} from './pull-to-refresh.providers';\n\nexport const MICRO_OFFSET = 10 ** -6;\nconst EXCLUSION_SELECTORS =\n 'tui-dialog, tui-sheet-dialog, tui-dropdown, tui-dropdown-mobile';\n\n@Injectable()\nexport class TuiPullToRefreshService extends Observable<number> {\n private readonly el = tuiInjectElement();\n private readonly scrollRef: ElementRef<HTMLElement> = inject(TUI_SCROLL_REF);\n private readonly loaded$ = inject(TUI_PULL_TO_REFRESH_LOADED);\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n // Hack for iOS to determine if pulling stopped due to scroll\n // because Safari does not support `touch-action: pan-down`\n private touched = false;\n\n private readonly pulling$ = this.loaded$.pipe(\n startWith(null),\n switchMap(() =>\n tuiTypedFromEvent(this.el, 'touchstart', {passive: true}).pipe(\n filter(\n () =>\n !this.scrollRef.nativeElement.scrollTop &&\n !this.el.querySelector(EXCLUSION_SELECTORS),\n ),\n map(({touches}) => touches[0]?.clientY ?? 0),\n switchMap((start) =>\n tuiTypedFromEvent(this.el, 'touchmove').pipe(\n tap((): void => {\n this.touched = true;\n }),\n map(({touches}) => (touches[0]?.clientY ?? 0) - start),\n filter((distance) => distance > 0),\n takeUntil(\n tuiTypedFromEvent(this.el, 'touchend').pipe(\n tap((): void => {\n this.touched = false;\n }),\n ),\n ),\n takeUntil(tuiScrollFrom(this.scrollRef.nativeElement)),\n endWith(0),\n ),\n ),\n scan(\n (prev, current) =>\n !current && !this.touched && prev > this.threshold\n ? this.threshold\n : current + current * MICRO_OFFSET,\n 0,\n ),\n takeWhile((distance) => distance !== this.threshold, true),\n startWith(0),\n ),\n ),\n debounceTime(0, tuiZonefreeScheduler()),\n distinctUntilChanged(),\n tuiZoneOptimized(),\n share(),\n );\n\n constructor() {\n const component = inject(TUI_PULL_TO_REFRESH_COMPONENT);\n\n super((subscriber) => (component ? this.pulling$ : EMPTY).subscribe(subscriber));\n }\n}\n","import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {TuiLoader} from '@taiga-ui/core/components/loader';\nimport {injectContext, PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\nimport {TUI_PULL_TO_REFRESH_THRESHOLD} from '../pull-to-refresh.providers';\nimport {MICRO_OFFSET} from '../pull-to-refresh.service';\n\nconst ROTATE_X_DEFAULT = 180;\nconst ROTATE_X_MAX = 500;\nconst ROTATE_X_MULTIPLIER = 2.3;\n\n@Component({\n selector: 'tui-mobile-android-loader',\n imports: [TuiLoader],\n templateUrl: './loader-android.template.html',\n styleUrls: ['./loader-android.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._visible]': 'percent',\n '[class._dropped]': 'dropped',\n '[style.transform]': 'hostTransform',\n },\n})\nexport class TuiMobileLoaderAndroid {\n private readonly context = injectContext<TuiContext<number>>();\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n protected get percent(): number {\n return (this.context.$implicit * 100) / this.threshold;\n }\n\n protected get dropped(): boolean {\n return (\n this.context.$implicit <= MICRO_OFFSET ||\n this.context.$implicit === this.threshold\n );\n }\n\n protected get hostTransform(): string {\n return `translateY(${Math.min(this.context.$implicit, this.threshold * 1.5)}px)`;\n }\n\n protected get opacity(): number {\n return this.context.$implicit / (this.threshold * 1.5);\n }\n\n protected get transform(): string {\n const rotateX = Math.min(\n ROTATE_X_DEFAULT + this.percent * ROTATE_X_MULTIPLIER,\n ROTATE_X_MAX,\n );\n\n return `rotate(${rotateX} 0 0)`;\n }\n}\n\nexport const TUI_ANDROID_LOADER = new PolymorpheusComponent(TuiMobileLoaderAndroid);\n","<div class=\"t-wrapper\">\n @if (percent !== 100) {\n <svg\n fill=\"none\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.transform]=\"transform\"\n [style.opacity]=\"opacity\"\n >\n <defs>\n <mask id=\"mask-1\">\n <path\n clip-rule=\"evenodd\"\n d=\"M21 12C21 7.03 16.97 3 12 3C7.03 3 3 7.03 3 12C3 16.97 7.03 21 12 21C14.06 21 15.96 20.3 17.48 19.14L16.06 17.7C14.91 18.51 13.51 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12H16L20 16L24 12H21Z\"\n fill=\"white\"\n fill-rule=\"evenodd\"\n />\n </mask>\n </defs>\n <g mask=\"url(#mask-1)\">\n <path\n clip-rule=\"evenodd\"\n d=\"M21 12C21 7.03 16.97 3 12 3C7.03 3 3 7.03 3 12C3 16.97 7.03 21 12 21C14.06 21 15.96 20.3 17.48 19.14L16.06 17.7C14.91 18.51 13.51 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12H16L20 16L24 12H21Z\"\n fill=\"black\"\n fill-rule=\"evenodd\"\n />\n </g>\n </svg>\n } @else {\n <tui-loader\n size=\"s\"\n class=\"t-loader\"\n [inheritColor]=\"true\"\n />\n }\n</div>\n","import {AsyncPipe} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, inject, Input, Output} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiScrollFrom, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {type TuiContext, type TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {distinctUntilChanged, filter, map, type Observable, startWith} from 'rxjs';\n\nimport {\n TUI_PULL_TO_REFRESH_COMPONENT,\n TUI_PULL_TO_REFRESH_THRESHOLD,\n} from './pull-to-refresh.providers';\nimport {MICRO_OFFSET, TuiPullToRefreshService} from './pull-to-refresh.service';\n\n@Component({\n selector: 'tui-pull-to-refresh',\n imports: [AsyncPipe, PolymorpheusOutlet],\n templateUrl: './pull-to-refresh.template.html',\n styleUrls: ['./pull-to-refresh.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiPullToRefreshService],\n})\nexport class TuiPullToRefresh {\n private readonly isIOS = inject(TUI_IS_IOS);\n private readonly threshold = inject(TUI_PULL_TO_REFRESH_THRESHOLD);\n\n protected readonly pulling$ = inject(TuiPullToRefreshService);\n protected readonly component = inject<PolymorpheusContent<TuiContext<number>>>(\n TUI_PULL_TO_REFRESH_COMPONENT,\n );\n\n protected readonly dropped$: Observable<boolean> = this.pulling$.pipe(\n map((distance) => distance <= MICRO_OFFSET || distance === this.threshold),\n distinctUntilChanged(),\n );\n\n @Input()\n public styleHandler: TuiHandler<number, Record<string, unknown> | null> = this.isIOS\n ? (distance) => ({top: tuiPx(distance / 2)})\n : () => null;\n\n @Output()\n public readonly pulled: Observable<unknown> = inject(TuiPullToRefreshService).pipe(\n filter((distance) => distance === this.threshold),\n );\n\n constructor() {\n if (!this.component) {\n return; // Ensure scrolling down is impossible while pulling\n }\n\n const el: HTMLElement = inject(TUI_SCROLL_REF).nativeElement;\n\n tuiScrollFrom(el)\n .pipe(startWith(null), tuiZonefree(), takeUntilDestroyed())\n .subscribe(() => {\n if (el.scrollTop) {\n el.style.touchAction = '';\n } else {\n el.style.touchAction = 'pan-down';\n }\n });\n }\n}\n","<ng-container *polymorpheusOutlet=\"component; context: {$implicit: (pulling$ | async) || 0}\" />\n\n<div\n [class.t-drop]=\"dropped$ | async\"\n [style.position]=\"'relative'\"\n [style]=\"styleHandler((pulling$ | async) || 0)\"\n>\n <ng-content />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,MAAM,WAAW,GAAG,CAAC;AACrB,MAAM,aAAa,GAAG,EAAE;MASX,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;QAQqB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAsB;AAC7C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,6BAA6B,CAAC;QAE/C,IAAK,CAAA,KAAA,GAAG,EAAE;AAqBhC;AAnBG,IAAA,IAAc,QAAQ,GAAA;AAClB,QAAA,OAAO,IAAI,CAAC,OAAO,IAAI,GAAG;;AAG9B,IAAA,IAAc,OAAO,GAAA;AACjB,QAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS;;AAGhD,IAAA,OAAO,CAAC,KAAa,EAAA;QAC3B,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,WAAW;;AAGzC,IAAA,kBAAkB,CAAC,KAAa,EAAA;AACtC,QAAA,OAAO,CAAU,OAAA,EAAA,KAAK,GAAG,aAAa,SAAS;;AAGzC,IAAA,uBAAuB,CAAC,KAAa,EAAA;QAC3C,OAAO,CAAA,EAAG,CAAC,KAAK,GAAG,WAAW,IAAI,GAAG,CAAA,CAAA,CAAG;;+GAvBnC,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,M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AAA,EAAA,CAAA,oBAAA,EAAA,2BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAM9B,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAR5B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EACtB,OAAA,EAAA,CAAC,SAAS,EAAE,kBAAkB,CAAC,EAGvB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA,CAAC,uBAAuB,CAAC,EAAA,QAAA,EAAA,iRAAA,EAAA,MAAA,EAAA,CAAA,uEAAA,CAAA,EAAA;wDAiB7B,YAAY,EAAA,CAAA;sBADlB;gBAMe,MAAM,EAAA,CAAA;sBADrB;;;AE5CL;;AAEG;;;;"}
|
|
@@ -24,13 +24,13 @@ class TuiSheetDialogComponent {
|
|
|
24
24
|
this.close$ = new Subject();
|
|
25
25
|
this.$ = merge(this.close$, tuiCloseWatcher(), inject(TUI_DIALOGS_CLOSE).pipe(map(TUI_TRUE_HANDLER)))
|
|
26
26
|
.pipe(tuiZonefull(), exhaustMap(() => {
|
|
27
|
-
if (isObservable(this.context.
|
|
27
|
+
if (isObservable(this.context.closable)) {
|
|
28
28
|
if (this.el.scrollTop <= 0) {
|
|
29
29
|
this.el.scrollTo({ top: this.initial, behavior: 'smooth' });
|
|
30
30
|
}
|
|
31
|
-
return this.context.
|
|
31
|
+
return this.context.closable.pipe(take(1));
|
|
32
32
|
}
|
|
33
|
-
return of(this.context.
|
|
33
|
+
return of(this.context.closable);
|
|
34
34
|
}), filter(Boolean), takeUntilDestroyed())
|
|
35
35
|
.subscribe(() => this.close());
|
|
36
36
|
}
|
|
@@ -44,7 +44,7 @@ class TuiSheetDialogComponent {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
get initial() {
|
|
47
|
-
if (!this.context.
|
|
47
|
+
if (!this.context.closable) {
|
|
48
48
|
return 0;
|
|
49
49
|
}
|
|
50
50
|
return (this.stops
|
|
@@ -60,21 +60,21 @@ class TuiSheetDialogComponent {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSheetDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", 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.
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", 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.closable", "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 @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n @if (context.bar && !context.appearance.includes('fullscreen')) {\n <div class=\"t-top\"></div>\n }\n @if (context.label) {\n <h2\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 }\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}: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]{margin-inline-start:calc(-1 * var(--t-option-padding-inline));margin-inline-end:calc(-1 * var(--t-option-padding-inline))}.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: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
64
64
|
}
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSheetDialogComponent, decorators: [{
|
|
66
66
|
type: Component,
|
|
67
67
|
args: [{ selector: 'tui-sheet-dialog', imports: [PolymorpheusOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], hostDirectives: [TuiAnimated], host: {
|
|
68
68
|
'[attr.data-appearance]': 'context.appearance',
|
|
69
69
|
'[style.--tui-offset.px]': 'context.offset',
|
|
70
|
-
'[class._closeable]': 'context.
|
|
70
|
+
'[class._closeable]': 'context.closable',
|
|
71
71
|
'[class._fullscreen]': 'context.fullscreen === true',
|
|
72
72
|
'(document:touchstart.passive.zoneless)': 'onPointerChange(1)',
|
|
73
73
|
'(document:touchend.zoneless)': 'onPointerChange(-1)',
|
|
74
74
|
'(document:touchcancel.zoneless)': 'onPointerChange(-1)',
|
|
75
75
|
'(scroll.zoneless)': 'onPointerChange(0)',
|
|
76
76
|
'(click.self)': 'close$.next()',
|
|
77
|
-
}, template: "<div class=\"t-stops\">\n @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n @if (context.bar && !context.appearance.includes('fullscreen')) {\n <div class=\"t-top\"></div>\n }\n @if (context.label) {\n <h2\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 }\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"] }]
|
|
77
|
+
}, template: "<div class=\"t-stops\">\n @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n @if (context.bar && !context.appearance.includes('fullscreen')) {\n <div class=\"t-top\"></div>\n }\n @if (context.label) {\n <h2\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 }\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}: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]{margin-inline-start:calc(-1 * var(--t-option-padding-inline));margin-inline-end:calc(-1 * var(--t-option-padding-inline))}.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"] }]
|
|
78
78
|
}], propDecorators: { stops: [{
|
|
79
79
|
type: ViewChildren,
|
|
80
80
|
args: ['stops']
|
|
@@ -86,7 +86,7 @@ const TUI_SHEET_DIALOG_DEFAULT_OPTIONS = {
|
|
|
86
86
|
stops: [],
|
|
87
87
|
initial: 0,
|
|
88
88
|
offset: 16,
|
|
89
|
-
|
|
89
|
+
closable: true,
|
|
90
90
|
data: undefined,
|
|
91
91
|
bar: true,
|
|
92
92
|
fullscreen: false,
|
|
@@ -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 {\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 selector: 'tui-sheet-dialog',\n imports: [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 @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n @if (context.bar && !context.appearance.includes('fullscreen')) {\n <div class=\"t-top\"></div>\n }\n @if (context.label) {\n <h2\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 }\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":";;;;;;;;;;;;;;;;AAuBA,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,SAAS,GAAG,+BAA+B,GAAG,EAAE,CAAC;MAsBrE,uBAAuB,CAAA;AApBpC,IAAA,WAAA,GAAA;QAsBqB,IAAK,CAAA,KAAA,GAAuC,WAAW;QAEvD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAChC,IAAQ,CAAA,QAAA,GAAG,CAAC;QAED,IAAO,CAAA,OAAA,GACtB,aAAa,EAA6C;AAE3C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,EAAQ;QAC5B,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;AAEpD,aAAA,IAAI,CACD,WAAW,EAAE,EACb,UAAU,CAAC,MAAK;YACZ,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;gBACtC,IAAI,IAAI,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,EAAE;AACxB,oBAAA,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;;AAG7D,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,C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ClB,oBAAA,UAAU,EAAE,MACR,IACI,qBAAA,CAAA,WAAW,EACX,uBAAuB,EACvB,MAAM,CAAC,wBAAwB,CAAC,CACnC;AACR,iBAAA;;;ACRK,MAAO,cAAe,SAAQ,mBAA0C,CAAA;+GAAjE,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,cAAc,wNAFZ,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAEvC,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,MAAM,EAAE,CAAC,gCAAgC,EAAE,sBAAsB,CAAC;oBAClE,OAAO,EAAE,CAAC,kCAAkC,CAAC;AAC7C,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AACnD,iBAAA;;;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 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 selector: 'tui-sheet-dialog',\n imports: [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.closable',\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.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;\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.closable) {\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 @for (stop of context.stops; track stop) {\n <div\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n }\n</div>\n<div class=\"t-sheet\">\n @if (context.bar && !context.appearance.includes('fullscreen')) {\n <div class=\"t-top\"></div>\n }\n @if (context.label) {\n <h2\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 }\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 closable: 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 closable: 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":";;;;;;;;;;;;;;;;AAuBA,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,SAAS,GAAG,+BAA+B,GAAG,EAAE,CAAC;MAsBrE,uBAAuB,CAAA;AApBpC,IAAA,WAAA,GAAA;QAsBqB,IAAK,CAAA,KAAA,GAAuC,WAAW;QAEvD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;QAChC,IAAQ,CAAA,QAAA,GAAG,CAAC;QAED,IAAO,CAAA,OAAA,GACtB,aAAa,EAA6C;AAE3C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,EAAQ;QAC5B,IAAC,CAAA,CAAA,GAAG,KAAK,CACxB,IAAI,CAAC,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AsB,CAAC;oBAClE,OAAO,EAAE,CAAC,kCAAkC,CAAC;AAC7C,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AACnD,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,67 +1,19 @@
|
|
|
1
|
-
import { DOCUMENT } from '@angular/common';
|
|
1
|
+
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject,
|
|
4
|
-
import * as i3 from '@ng-web-apis/intersection-observer';
|
|
5
|
-
import { WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
|
|
3
|
+
import { inject, ChangeDetectionStrategy, ViewEncapsulation, Component, DestroyRef, ViewChild, Input, Directive } from '@angular/core';
|
|
6
4
|
import { TuiKeyboardService } from '@taiga-ui/addon-mobile/services';
|
|
5
|
+
import { tuiInjectElement, tuiIsElement, tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
|
|
6
|
+
import { tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
7
|
+
import { tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
8
|
+
import { TuiDropdownDirective, TUI_DROPDOWN_COMPONENT } from '@taiga-ui/core/directives/dropdown';
|
|
9
|
+
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
10
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
|
+
import { TuiSheetDialogService } from '@taiga-ui/addon-mobile/components/sheet-dialog';
|
|
7
12
|
import * as i1 from '@taiga-ui/cdk/directives/active-zone';
|
|
8
13
|
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
9
14
|
import * as i2 from '@taiga-ui/cdk/directives/animated';
|
|
10
15
|
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
11
|
-
import { TuiSwipe } from '@taiga-ui/cdk/directives/swipe';
|
|
12
|
-
import { tuiIsHTMLElement, tuiInjectElement, tuiIsElement } from '@taiga-ui/cdk/utils/dom';
|
|
13
|
-
import { tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
14
|
-
import { tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
15
|
-
import { TUI_DROPDOWN_COMPONENT, TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
|
|
16
16
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
17
|
-
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
18
|
-
|
|
19
|
-
class TuiDropdownMobile {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.isMobile = inject(TUI_IS_MOBILE);
|
|
22
|
-
this.tuiDropdownMobile = '';
|
|
23
|
-
}
|
|
24
|
-
onMouseDown(event) {
|
|
25
|
-
if (!this.isMobile ||
|
|
26
|
-
!tuiIsHTMLElement(event.target) ||
|
|
27
|
-
!event.target.matches('input,textarea') ||
|
|
28
|
-
this.tuiDropdownMobile) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
event.target.focus({ preventScroll: true });
|
|
33
|
-
}
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobile, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
35
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiDropdownMobile, isStandalone: true, selector: "[tuiDropdownMobile]", inputs: { tuiDropdownMobile: "tuiDropdownMobile" }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "style.visibility": "\"visible\"" } }, providers: [
|
|
36
|
-
{
|
|
37
|
-
provide: TUI_DROPDOWN_COMPONENT,
|
|
38
|
-
useFactory: () => inject(TUI_IS_MOBILE)
|
|
39
|
-
? TuiDropdownMobileComponent
|
|
40
|
-
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
41
|
-
},
|
|
42
|
-
], ngImport: i0 }); }
|
|
43
|
-
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobile, decorators: [{
|
|
45
|
-
type: Directive,
|
|
46
|
-
args: [{
|
|
47
|
-
standalone: true,
|
|
48
|
-
selector: '[tuiDropdownMobile]',
|
|
49
|
-
providers: [
|
|
50
|
-
{
|
|
51
|
-
provide: TUI_DROPDOWN_COMPONENT,
|
|
52
|
-
useFactory: () => inject(TUI_IS_MOBILE)
|
|
53
|
-
? TuiDropdownMobileComponent
|
|
54
|
-
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
host: {
|
|
58
|
-
'[style.visibility]': '"visible"',
|
|
59
|
-
'(mousedown)': 'onMouseDown($event)',
|
|
60
|
-
},
|
|
61
|
-
}]
|
|
62
|
-
}], propDecorators: { tuiDropdownMobile: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}] } });
|
|
65
17
|
|
|
66
18
|
const GAP = 16;
|
|
67
19
|
class TuiDropdownMobileComponent {
|
|
@@ -70,17 +22,11 @@ class TuiDropdownMobileComponent {
|
|
|
70
22
|
this.keyboard = inject(TuiKeyboardService);
|
|
71
23
|
this.doc = inject(DOCUMENT);
|
|
72
24
|
this.scrollTop = this.doc.documentElement.scrollTop;
|
|
73
|
-
this.observer = new ResizeObserver(() => this.doc.defaultView?.visualViewport &&
|
|
74
|
-
this.refresh(this.doc.defaultView.visualViewport));
|
|
75
|
-
this.directive = inject(TuiDropdownMobile);
|
|
76
25
|
this.dropdown = inject(TuiDropdownDirective);
|
|
77
|
-
this.
|
|
26
|
+
this.observer = new ResizeObserver(() => this.refresh());
|
|
78
27
|
this.observer.observe(this.dropdown.el);
|
|
79
28
|
this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');
|
|
80
29
|
}
|
|
81
|
-
ngAfterViewInit() {
|
|
82
|
-
this.el.scrollTop = this.directive.tuiDropdownMobile ? this.el.clientHeight : 0;
|
|
83
|
-
}
|
|
84
30
|
ngOnDestroy() {
|
|
85
31
|
this.observer.disconnect();
|
|
86
32
|
this.doc.body.classList.remove('t-dropdown-mobile');
|
|
@@ -99,21 +45,10 @@ class TuiDropdownMobileComponent {
|
|
|
99
45
|
event.stopPropagation();
|
|
100
46
|
}
|
|
101
47
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
el.getBoundingClientRect().bottom > Number(this.doc.defaultView?.innerHeight)) {
|
|
105
|
-
this.close();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
onIntersection({ isIntersecting }) {
|
|
109
|
-
if (isIntersecting) {
|
|
110
|
-
this.close();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
refresh({ offsetTop, height }) {
|
|
48
|
+
refresh() {
|
|
49
|
+
const { offsetTop = 0, height = 0 } = this.doc.defaultView?.visualViewport || {};
|
|
114
50
|
this.doc.body.style.removeProperty('--t-root-top');
|
|
115
51
|
if (!this.focused ||
|
|
116
|
-
this.directive.tuiDropdownMobile ||
|
|
117
52
|
!this.doc.documentElement.style.getPropertyValue('scroll-behavior')) {
|
|
118
53
|
return;
|
|
119
54
|
}
|
|
@@ -121,28 +56,113 @@ class TuiDropdownMobileComponent {
|
|
|
121
56
|
const rect = this.dropdown.el.getBoundingClientRect();
|
|
122
57
|
const topMargin = `max(var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)}), env(safe-area-inset-top))`;
|
|
123
58
|
const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;
|
|
59
|
+
const top = `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`;
|
|
124
60
|
this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);
|
|
125
61
|
this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);
|
|
126
62
|
this.doc.body.classList.add('t-dropdown-mobile');
|
|
127
|
-
this.doc.body.style.setProperty('--t-root-top',
|
|
63
|
+
this.doc.body.style.setProperty('--t-root-top', top);
|
|
128
64
|
}
|
|
129
65
|
get focused() {
|
|
130
66
|
return this.dropdown.el.contains(tuiGetFocused(this.doc));
|
|
131
67
|
}
|
|
132
68
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
133
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
69
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiDropdownMobileComponent, isStandalone: true, selector: "tui-dropdown-mobile", host: { listeners: { "pointerdown.prevent": "0", "document:click.zoneless.capture": "onClick($event)", "window>scroll.zoneless.capture": "refresh()", "visualViewport>resize.zoneless": "refresh()", "visualViewport>scroll.zoneless": "refresh()" } }, ngImport: i0, template: `
|
|
70
|
+
<div class="t-container">
|
|
71
|
+
<div class="t-content"><ng-content /></div>
|
|
72
|
+
</div>
|
|
73
|
+
`, isInline: true, styles: ["tui-dropdown-mobile{scrollbar-width:none;-ms-overflow-style:none;position:absolute;top:0;left:0;inline-size:100%;block-size:100%;visibility:visible!important;background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base);box-sizing:border-box;padding-block-end:env(safe-area-inset-bottom);pointer-events:auto}tui-dropdown-mobile::-webkit-scrollbar,tui-dropdown-mobile::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile>.t-container::-webkit-scrollbar,tui-dropdown-mobile>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));display:inline-flex}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
134
74
|
}
|
|
135
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobileComponent, decorators: [{
|
|
136
76
|
type: Component,
|
|
137
|
-
args: [{ selector: 'tui-dropdown-mobile',
|
|
138
|
-
|
|
77
|
+
args: [{ standalone: true, selector: 'tui-dropdown-mobile', template: `
|
|
78
|
+
<div class="t-container">
|
|
79
|
+
<div class="t-content"><ng-content /></div>
|
|
80
|
+
</div>
|
|
81
|
+
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
82
|
+
'(pointerdown.prevent)': '0',
|
|
139
83
|
'(document:click.zoneless.capture)': 'onClick($event)',
|
|
140
|
-
'(window>scroll.zoneless.capture)': 'refresh(
|
|
141
|
-
'(visualViewport>resize.zoneless)': 'refresh(
|
|
142
|
-
'(visualViewport>scroll.zoneless)': 'refresh(
|
|
143
|
-
},
|
|
84
|
+
'(window>scroll.zoneless.capture)': 'refresh()',
|
|
85
|
+
'(visualViewport>resize.zoneless)': 'refresh()',
|
|
86
|
+
'(visualViewport>scroll.zoneless)': 'refresh()',
|
|
87
|
+
}, styles: ["tui-dropdown-mobile{scrollbar-width:none;-ms-overflow-style:none;position:absolute;top:0;left:0;inline-size:100%;block-size:100%;visibility:visible!important;background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base);box-sizing:border-box;padding-block-end:env(safe-area-inset-bottom);pointer-events:auto}tui-dropdown-mobile::-webkit-scrollbar,tui-dropdown-mobile::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile>.t-container::-webkit-scrollbar,tui-dropdown-mobile>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));display:inline-flex}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"] }]
|
|
144
88
|
}], ctorParameters: () => [] });
|
|
145
89
|
|
|
90
|
+
class TuiDropdownMobileWrapperComponent {
|
|
91
|
+
constructor() {
|
|
92
|
+
this.destroyRef = inject(DestroyRef);
|
|
93
|
+
this.dialogs = inject(TuiSheetDialogService);
|
|
94
|
+
this.directive = inject(TuiDropdownMobile);
|
|
95
|
+
this.dropdown = inject(TuiDropdownDirective);
|
|
96
|
+
this.context = {
|
|
97
|
+
$implicit: () => this.dropdown.toggle(false),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
ngOnInit() {
|
|
101
|
+
if (this.directive.tuiDropdownMobile) {
|
|
102
|
+
this.dialogs
|
|
103
|
+
.open(this.content, { label: this.directive.tuiDropdownMobile })
|
|
104
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
105
|
+
.subscribe({ complete: () => this.dropdown.toggle(false) });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobileWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiDropdownMobileWrapperComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }], hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "@if (!directive.tuiDropdownMobile) {\n <tui-dropdown-mobile>\n <ng-container *ngTemplateOutlet=\"content\" />\n </tui-dropdown-mobile>\n}\n<ng-template #content>\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: context\">\n {{ text }}\n </ng-container>\n</ng-template>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;pointer-events:none}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: TuiDropdownMobileComponent, selector: "tui-dropdown-mobile" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
110
|
+
}
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobileWrapperComponent, decorators: [{
|
|
112
|
+
type: Component,
|
|
113
|
+
args: [{ standalone: true, imports: [NgTemplateOutlet, PolymorpheusOutlet, TuiDropdownMobileComponent], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiActiveZone, TuiAnimated], template: "@if (!directive.tuiDropdownMobile) {\n <tui-dropdown-mobile>\n <ng-container *ngTemplateOutlet=\"content\" />\n </tui-dropdown-mobile>\n}\n<ng-template #content>\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: context\">\n {{ text }}\n </ng-container>\n</ng-template>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;pointer-events:none}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}\n"] }]
|
|
114
|
+
}], propDecorators: { content: [{
|
|
115
|
+
type: ViewChild,
|
|
116
|
+
args: ['content', { static: true }]
|
|
117
|
+
}] } });
|
|
118
|
+
|
|
119
|
+
class TuiDropdownMobile {
|
|
120
|
+
constructor() {
|
|
121
|
+
this.isMobile = inject(TUI_IS_MOBILE);
|
|
122
|
+
this.tuiDropdownMobile = '';
|
|
123
|
+
}
|
|
124
|
+
onMouseDown(event) {
|
|
125
|
+
if (!this.isMobile ||
|
|
126
|
+
!tuiIsHTMLElement(event.target) ||
|
|
127
|
+
!event.target.matches('input,textarea') ||
|
|
128
|
+
this.tuiDropdownMobile) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
event.target.focus({ preventScroll: true });
|
|
133
|
+
}
|
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobile, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
135
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiDropdownMobile, isStandalone: true, selector: "[tuiDropdownMobile]", inputs: { tuiDropdownMobile: "tuiDropdownMobile" }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "style.visibility": "\"visible\"" } }, providers: [
|
|
136
|
+
{
|
|
137
|
+
provide: TUI_DROPDOWN_COMPONENT,
|
|
138
|
+
useFactory: () => inject(TUI_IS_MOBILE)
|
|
139
|
+
? TuiDropdownMobileWrapperComponent
|
|
140
|
+
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
141
|
+
},
|
|
142
|
+
], ngImport: i0 }); }
|
|
143
|
+
}
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownMobile, decorators: [{
|
|
145
|
+
type: Directive,
|
|
146
|
+
args: [{
|
|
147
|
+
standalone: true,
|
|
148
|
+
selector: '[tuiDropdownMobile]',
|
|
149
|
+
providers: [
|
|
150
|
+
{
|
|
151
|
+
provide: TUI_DROPDOWN_COMPONENT,
|
|
152
|
+
useFactory: () => inject(TUI_IS_MOBILE)
|
|
153
|
+
? TuiDropdownMobileWrapperComponent
|
|
154
|
+
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
host: {
|
|
158
|
+
'[style.visibility]': '"visible"',
|
|
159
|
+
'(mousedown)': 'onMouseDown($event)',
|
|
160
|
+
},
|
|
161
|
+
}]
|
|
162
|
+
}], propDecorators: { tuiDropdownMobile: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}] } });
|
|
165
|
+
|
|
146
166
|
/**
|
|
147
167
|
* Generated bundle index. Do not edit.
|
|
148
168
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-mobile.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.directive.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.ts"],"sourcesContent":["import {Directive, inject, Input} from '@angular/core';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/directives/dropdown';\n\nimport {TuiDropdownMobileComponent} from './dropdown-mobile.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiDropdownMobile]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(TUI_IS_MOBILE)\n ? TuiDropdownMobileComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n ],\n host: {\n '[style.visibility]': '\"visible\"',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiDropdownMobile {\n private readonly isMobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public tuiDropdownMobile = '';\n\n protected onMouseDown(event: MouseEvent): void {\n if (\n !this.isMobile ||\n !tuiIsHTMLElement(event.target) ||\n !event.target.matches('input,textarea') ||\n this.tuiDropdownMobile\n ) {\n return;\n }\n\n event.preventDefault();\n event.target.focus({preventScroll: true});\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n inject,\n type OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {WaIntersectionObserver} from '@ng-web-apis/intersection-observer';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiSwipe, type TuiSwipeEvent} from '@taiga-ui/cdk/directives/swipe';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownMobile} from './dropdown-mobile.directive';\n\nconst GAP = 16;\n\n@Component({\n selector: 'tui-dropdown-mobile',\n imports: [PolymorpheusOutlet, TuiSwipe, WaIntersectionObserver],\n templateUrl: './dropdown-mobile.template.html',\n styleUrls: ['./dropdown-mobile.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiActiveZone, TuiAnimated],\n host: {\n '[class._sheet]': 'directive.tuiDropdownMobile',\n '(document:click.zoneless.capture)': 'onClick($event)',\n '(window>scroll.zoneless.capture)':\n 'refresh($event.currentTarget.visualViewport)',\n '(visualViewport>resize.zoneless)': 'refresh($event.target)',\n '(visualViewport>scroll.zoneless)': 'refresh($event.target)',\n },\n})\nexport class TuiDropdownMobileComponent implements OnDestroy, AfterViewInit {\n private readonly el = tuiInjectElement();\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly doc = inject(DOCUMENT);\n private readonly scrollTop = this.doc.documentElement.scrollTop;\n private readonly observer = new ResizeObserver(\n () =>\n this.doc.defaultView?.visualViewport &&\n this.refresh(this.doc.defaultView.visualViewport),\n );\n\n protected readonly directive = inject(TuiDropdownMobile);\n protected readonly dropdown = inject(TuiDropdownDirective);\n\n constructor() {\n this.observer.observe(this.dropdown.el);\n this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');\n }\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.directive.tuiDropdownMobile ? this.el.clientHeight : 0;\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n this.doc.body.classList.remove('t-dropdown-mobile');\n this.doc.body.style.removeProperty('--t-root-top');\n this.doc.documentElement.scrollTop = this.scrollTop;\n this.doc.documentElement.style.removeProperty('scroll-behavior');\n\n if (this.focused) {\n this.keyboard.hide();\n }\n }\n\n protected readonly close = (): void => this.dropdown.toggle(false);\n\n protected onClick(event: MouseEvent): void {\n if (\n tuiIsElement(event.target) &&\n !this.el.contains(event.target) &&\n (!this.dropdown.el.contains(event.target) ||\n event.target.matches('input,textarea'))\n ) {\n event.stopPropagation();\n }\n }\n\n protected onSwipe({direction}: TuiSwipeEvent, el: HTMLElement): void {\n if (\n direction === 'bottom' &&\n el.getBoundingClientRect().bottom > Number(this.doc.defaultView?.innerHeight)\n ) {\n this.close();\n }\n }\n\n protected onIntersection({isIntersecting}: IntersectionObserverEntry): void {\n if (isIntersecting) {\n this.close();\n }\n }\n\n protected refresh({offsetTop, height}: VisualViewport): void {\n this.doc.body.style.removeProperty('--t-root-top');\n\n if (\n !this.focused ||\n this.directive.tuiDropdownMobile ||\n !this.doc.documentElement.style.getPropertyValue('scroll-behavior')\n ) {\n return;\n }\n\n this.doc.documentElement.scrollTop = 0;\n\n const rect = this.dropdown.el.getBoundingClientRect();\n const topMargin = `max(var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)}), env(safe-area-inset-top))`;\n const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;\n\n this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);\n this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);\n\n this.doc.body.classList.add('t-dropdown-mobile');\n this.doc.body.style.setProperty(\n '--t-root-top',\n `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`,\n );\n }\n\n private get focused(): boolean {\n return this.dropdown.el.contains(tuiGetFocused(this.doc));\n }\n}\n","@if (directive.tuiDropdownMobile) {\n <div\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n ></div>\n}\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n @if (directive.tuiDropdownMobile) {\n <h2 class=\"t-heading\">\n {{ directive.tuiDropdownMobile }}\n </h2>\n }\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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ile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile-wrapper.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile-wrapper.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.directive.ts","../../../projects/addon-mobile/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n type OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\n\nconst GAP = 16;\n\n@Component({\n standalone: true,\n selector: 'tui-dropdown-mobile',\n template: `\n <div class=\"t-container\">\n <div class=\"t-content\"><ng-content /></div>\n </div>\n `,\n styleUrls: ['./dropdown-mobile.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(pointerdown.prevent)': '0',\n '(document:click.zoneless.capture)': 'onClick($event)',\n '(window>scroll.zoneless.capture)': 'refresh()',\n '(visualViewport>resize.zoneless)': 'refresh()',\n '(visualViewport>scroll.zoneless)': 'refresh()',\n },\n})\nexport class TuiDropdownMobileComponent implements OnDestroy {\n private readonly el = tuiInjectElement();\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly doc = inject(DOCUMENT);\n private readonly scrollTop = this.doc.documentElement.scrollTop;\n private readonly dropdown = inject(TuiDropdownDirective);\n private readonly observer = new ResizeObserver(() => this.refresh());\n\n constructor() {\n this.observer.observe(this.dropdown.el);\n this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n this.doc.body.classList.remove('t-dropdown-mobile');\n this.doc.body.style.removeProperty('--t-root-top');\n this.doc.documentElement.scrollTop = this.scrollTop;\n this.doc.documentElement.style.removeProperty('scroll-behavior');\n\n if (this.focused) {\n this.keyboard.hide();\n }\n }\n\n protected onClick(event: MouseEvent): void {\n if (\n tuiIsElement(event.target) &&\n !this.el.contains(event.target) &&\n (!this.dropdown.el.contains(event.target) ||\n event.target.matches('input,textarea'))\n ) {\n event.stopPropagation();\n }\n }\n\n protected refresh(): void {\n const {offsetTop = 0, height = 0} = this.doc.defaultView?.visualViewport || {};\n\n this.doc.body.style.removeProperty('--t-root-top');\n\n if (\n !this.focused ||\n !this.doc.documentElement.style.getPropertyValue('scroll-behavior')\n ) {\n return;\n }\n\n this.doc.documentElement.scrollTop = 0;\n\n const rect = this.dropdown.el.getBoundingClientRect();\n const topMargin = `max(var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)}), env(safe-area-inset-top))`;\n const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;\n const top = `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`;\n\n this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);\n this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);\n this.doc.body.classList.add('t-dropdown-mobile');\n this.doc.body.style.setProperty('--t-root-top', top);\n }\n\n private get focused(): boolean {\n return this.dropdown.el.contains(tuiGetFocused(this.doc));\n }\n}\n","import {NgTemplateOutlet} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n inject,\n type OnInit,\n type TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiSheetDialogService} from '@taiga-ui/addon-mobile/components/sheet-dialog';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownMobileComponent} from './dropdown-mobile.component';\nimport {TuiDropdownMobile} from './dropdown-mobile.directive';\n\n@Component({\n standalone: true,\n imports: [NgTemplateOutlet, PolymorpheusOutlet, TuiDropdownMobileComponent],\n templateUrl: './dropdown-mobile-wrapper.template.html',\n styleUrls: ['./dropdown-mobile-wrapper.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiActiveZone, TuiAnimated],\n})\nexport class TuiDropdownMobileWrapperComponent implements OnInit {\n @ViewChild('content', {static: true})\n private readonly content?: TemplateRef<unknown>;\n\n protected readonly destroyRef = inject(DestroyRef);\n protected readonly dialogs = inject(TuiSheetDialogService);\n protected readonly directive = inject(TuiDropdownMobile);\n protected readonly dropdown = inject(TuiDropdownDirective);\n protected readonly context = {\n $implicit: (): void => this.dropdown.toggle(false),\n };\n\n public ngOnInit(): void {\n if (this.directive.tuiDropdownMobile) {\n this.dialogs\n .open(this.content, {label: this.directive.tuiDropdownMobile})\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({complete: () => this.dropdown.toggle(false)});\n }\n }\n}\n","@if (!directive.tuiDropdownMobile) {\n <tui-dropdown-mobile>\n <ng-container *ngTemplateOutlet=\"content\" />\n </tui-dropdown-mobile>\n}\n<ng-template #content>\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: context\">\n {{ text }}\n </ng-container>\n</ng-template>\n","import {Directive, inject, Input} from '@angular/core';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/directives/dropdown';\n\nimport {TuiDropdownMobileWrapperComponent} from './dropdown-mobile-wrapper.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiDropdownMobile]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(TUI_IS_MOBILE)\n ? TuiDropdownMobileWrapperComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n ],\n host: {\n '[style.visibility]': '\"visible\"',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiDropdownMobile {\n private readonly isMobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public tuiDropdownMobile = '';\n\n protected onMouseDown(event: MouseEvent): void {\n if (\n !this.isMobile ||\n !tuiIsHTMLElement(event.target) ||\n !event.target.matches('input,textarea') ||\n this.tuiDropdownMobile\n ) {\n return;\n }\n\n event.preventDefault();\n event.target.focus({preventScroll: true});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAM,GAAG,GAAG,EAAE;MAqBD,0BAA0B,CAAA;AAQnC,IAAA,WAAA,GAAA;QAPiB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACrC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;QACtB,IAAS,CAAA,SAAA,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,SAAS;AAC9C,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACvC,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QAGhE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;AACvC,QAAA,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC;;IAGrE,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC1B,IAAI,CAAC,GA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EAAA,WAAA,EAAA,qBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,aAAA,EAAA,EAAA,EAAA,SAAA,EAAA;AACP,YAAA;AACI,gBAAA,OAAO,EAAE,sBAAsB;AAC/B,gBAAA,UAAU,EAAE,MACR,MAAM,CAAC,aAAa;AAChB,sBAAE;sBACA,MAAM,CAAC,sBAAsB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AAC7D,aAAA;AACJ,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAMQ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAjB7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,SAAS,EAAE;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,sBAAsB;AAC/B,4BAAA,UAAU,EAAE,MACR,MAAM,CAAC,aAAa;AAChB,kCAAE;kCACA,MAAM,CAAC,sBAAsB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AAC7D,yBAAA;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,oBAAoB,EAAE,WAAW;AACjC,wBAAA,aAAa,EAAE,qBAAqB;AACvC,qBAAA;AACJ,iBAAA;8BAKU,iBAAiB,EAAA,CAAA;sBADvB;;;AC3BL;;AAEG;;;;"}
|
|
@@ -2,7 +2,6 @@ export * from '@taiga-ui/addon-mobile/directives/dropdown-mobile';
|
|
|
2
2
|
export * from '@taiga-ui/addon-mobile/directives/elastic-sticky';
|
|
3
3
|
export * from '@taiga-ui/addon-mobile/directives/responsive-dialog';
|
|
4
4
|
export * from '@taiga-ui/addon-mobile/directives/ripple';
|
|
5
|
-
export * from '@taiga-ui/addon-mobile/directives/sidebar';
|
|
6
5
|
export * from '@taiga-ui/addon-mobile/directives/touchable';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives.mjs","sources":["../../../projects/addon-mobile/directives/taiga-ui-addon-mobile-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives.mjs","sources":["../../../projects/addon-mobile/directives/taiga-ui-addon-mobile-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-mobile",
|
|
3
|
-
"version": "4.52.0-canary.
|
|
3
|
+
"version": "4.52.0-canary.692273c",
|
|
4
4
|
"description": "Extension package for Taiga UI that adds support for mobile specific behaviors such as custom data pickers, dropdowns, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -83,10 +83,6 @@
|
|
|
83
83
|
"types": "./directives/ripple/index.d.ts",
|
|
84
84
|
"default": "./fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs"
|
|
85
85
|
},
|
|
86
|
-
"./directives/sidebar": {
|
|
87
|
-
"types": "./directives/sidebar/index.d.ts",
|
|
88
|
-
"default": "./fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs"
|
|
89
|
-
},
|
|
90
86
|
"./directives/touchable": {
|
|
91
87
|
"types": "./directives/touchable/index.d.ts",
|
|
92
88
|
"default": "./fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs"
|
|
@@ -96,7 +92,7 @@
|
|
|
96
92
|
"@angular/cdk": ">=19.0.0",
|
|
97
93
|
"@angular/common": ">=19.0.0",
|
|
98
94
|
"@angular/core": ">=19.0.0",
|
|
99
|
-
"@ng-web-apis/common": "^4.12.
|
|
95
|
+
"@ng-web-apis/common": "^4.12.2",
|
|
100
96
|
"@taiga-ui/cdk": "^4.52.0",
|
|
101
97
|
"@taiga-ui/core": "^4.52.0",
|
|
102
98
|
"@taiga-ui/kit": "^4.52.0",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[tuiToast] {
|
|
2
|
+
min-block-size: 3rem;
|
|
3
|
+
border-radius: 1.5rem;
|
|
4
|
+
font: var(--tui-font-text-m);
|
|
5
|
+
|
|
6
|
+
[tuiButton]:last-child {
|
|
7
|
+
margin: -0.1875rem -0.4375rem -0.1875rem 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&:has([tuiAvatar]) {
|
|
11
|
+
gap: 1rem;
|
|
12
|
+
|
|
13
|
+
[tuiAvatar] {
|
|
14
|
+
margin: 0 -0.25rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[tuiButton]:last-child {
|
|
18
|
+
margin-inline-end: 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import '@taiga-ui/core/styles/taiga-ui-local.less';
|
|
1
2
|
@import 'common/search.less';
|
|
2
3
|
|
|
3
4
|
[data-platform='android'] {
|
|
@@ -22,6 +23,12 @@
|
|
|
22
23
|
tui-segmented > .tui-segmented_active:active {
|
|
23
24
|
opacity: var(--tui-disabled-opacity);
|
|
24
25
|
}
|
|
26
|
+
|
|
27
|
+
[tuiToast]:active {
|
|
28
|
+
.interactive({
|
|
29
|
+
transform: scale(0.95);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
[data-platform='android'],
|
|
@@ -38,4 +45,5 @@
|
|
|
38
45
|
@import 'common/header.less';
|
|
39
46
|
@import 'common/message.less';
|
|
40
47
|
@import 'common/notification-middle.less';
|
|
48
|
+
@import 'common/toast.less';
|
|
41
49
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type AnimationOptions } from '@angular/animations';
|
|
2
|
-
import { type DoCheck } from '@angular/core';
|
|
3
|
-
import { type TuiHorizontalDirection } from '@taiga-ui/core/types';
|
|
4
|
-
import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated use {@link TuiDrawer} instead
|
|
8
|
-
*/
|
|
9
|
-
export declare class TuiSidebarComponent implements DoCheck {
|
|
10
|
-
private readonly directive;
|
|
11
|
-
private readonly options;
|
|
12
|
-
private readonly left;
|
|
13
|
-
private readonly right;
|
|
14
|
-
ngDoCheck(): void;
|
|
15
|
-
protected get animation(): AnimationOptions;
|
|
16
|
-
protected get direction(): TuiHorizontalDirection;
|
|
17
|
-
protected get content(): PolymorpheusContent;
|
|
18
|
-
protected get autoWidth(): boolean;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiSidebarComponent, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TuiSidebarComponent, "aside[tuiSidebar]", never, {}, {}, never, never, true, never>;
|
|
21
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TuiSidebarComponent } from './sidebar.component';
|
|
2
|
-
import { TuiSidebarDirective } from './sidebar.directive';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated use {@link TuiDrawer} instead
|
|
5
|
-
*/
|
|
6
|
-
export declare const TuiSidebar: readonly [typeof TuiSidebarComponent, typeof TuiSidebarDirective];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
-
import { type TuiHorizontalDirection } from '@taiga-ui/core/types';
|
|
3
|
-
import { PolymorpheusTemplate } from '@taiga-ui/polymorpheus';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated use {@link TuiDrawer} instead
|
|
7
|
-
*/
|
|
8
|
-
export declare class TuiSidebarDirective<T = Record<string, unknown>> extends PolymorpheusTemplate<T> implements OnDestroy {
|
|
9
|
-
private readonly injector;
|
|
10
|
-
private readonly service;
|
|
11
|
-
private readonly component;
|
|
12
|
-
private sidebarRef;
|
|
13
|
-
direction: TuiHorizontalDirection;
|
|
14
|
-
autoWidth: boolean;
|
|
15
|
-
readonly content: TemplateRef<any>;
|
|
16
|
-
set tuiSidebar(open: boolean);
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
private show;
|
|
19
|
-
private hide;
|
|
20
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiSidebarDirective<any>, never>;
|
|
21
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiSidebarDirective<any>, "[tuiSidebar]", never, { "direction": { "alias": "tuiSidebarDirection"; "required": false; }; "autoWidth": { "alias": "tuiSidebarAutoWidth"; "required": false; }; "tuiSidebar": { "alias": "tuiSidebar"; "required": false; }; }, {}, never, never, true, never>;
|
|
22
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, INJECTOR, TemplateRef, Input, Directive, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
4
|
-
import { tuiSlideIn } from '@taiga-ui/core/animations';
|
|
5
|
-
import { TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
|
|
6
|
-
import { tuiToAnimationOptions } from '@taiga-ui/core/utils/miscellaneous';
|
|
7
|
-
import { PolymorpheusTemplate, PolymorpheusComponent, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
8
|
-
import { TuiPopupService } from '@taiga-ui/core/directives/popup';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated use {@link TuiDrawer} instead
|
|
12
|
-
*/
|
|
13
|
-
class TuiSidebarDirective extends PolymorpheusTemplate {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.injector = inject(INJECTOR);
|
|
17
|
-
this.service = inject(TuiPopupService);
|
|
18
|
-
this.component = new PolymorpheusComponent(TuiSidebarComponent, this.injector);
|
|
19
|
-
this.sidebarRef = null;
|
|
20
|
-
this.direction = 'left';
|
|
21
|
-
this.autoWidth = false;
|
|
22
|
-
this.content = inject((TemplateRef));
|
|
23
|
-
}
|
|
24
|
-
set tuiSidebar(open) {
|
|
25
|
-
if (open) {
|
|
26
|
-
this.show();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.hide();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
ngOnDestroy() {
|
|
33
|
-
this.hide();
|
|
34
|
-
}
|
|
35
|
-
show() {
|
|
36
|
-
if (this.sidebarRef !== null) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
this.sidebarRef = this.service.add(this.component);
|
|
40
|
-
this.sidebarRef.changeDetectorRef.detectChanges();
|
|
41
|
-
}
|
|
42
|
-
hide() {
|
|
43
|
-
if (this.sidebarRef === null) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
this.service.remove(this.sidebarRef);
|
|
47
|
-
this.sidebarRef = null;
|
|
48
|
-
}
|
|
49
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSidebarDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
50
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiSidebarDirective, isStandalone: true, selector: "[tuiSidebar]", inputs: { direction: ["tuiSidebarDirection", "direction"], autoWidth: ["tuiSidebarAutoWidth", "autoWidth"], tuiSidebar: "tuiSidebar" }, usesInheritance: true, ngImport: i0 }); }
|
|
51
|
-
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSidebarDirective, decorators: [{
|
|
53
|
-
type: Directive,
|
|
54
|
-
args: [{
|
|
55
|
-
standalone: true,
|
|
56
|
-
selector: '[tuiSidebar]',
|
|
57
|
-
}]
|
|
58
|
-
}], propDecorators: { direction: [{
|
|
59
|
-
type: Input,
|
|
60
|
-
args: ['tuiSidebarDirection']
|
|
61
|
-
}], autoWidth: [{
|
|
62
|
-
type: Input,
|
|
63
|
-
args: ['tuiSidebarAutoWidth']
|
|
64
|
-
}], tuiSidebar: [{
|
|
65
|
-
type: Input
|
|
66
|
-
}] } });
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @deprecated use {@link TuiDrawer} instead
|
|
70
|
-
*/
|
|
71
|
-
class TuiSidebarComponent {
|
|
72
|
-
constructor() {
|
|
73
|
-
this.directive = inject(TuiSidebarDirective);
|
|
74
|
-
this.options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));
|
|
75
|
-
this.left = { ...this.options, value: 'left' };
|
|
76
|
-
this.right = { ...this.options, value: 'right' };
|
|
77
|
-
}
|
|
78
|
-
ngDoCheck() {
|
|
79
|
-
this.directive.check();
|
|
80
|
-
}
|
|
81
|
-
get animation() {
|
|
82
|
-
return this.direction === 'left' ? this.left : this.right;
|
|
83
|
-
}
|
|
84
|
-
get direction() {
|
|
85
|
-
return this.directive.direction;
|
|
86
|
-
}
|
|
87
|
-
get content() {
|
|
88
|
-
return this.directive.content;
|
|
89
|
-
}
|
|
90
|
-
get autoWidth() {
|
|
91
|
-
return this.directive.autoWidth;
|
|
92
|
-
}
|
|
93
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
94
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiSidebarComponent, isStandalone: true, selector: "aside[tuiSidebar]", host: { properties: { "class": "\"t-\" + direction", "@tuiSlideIn": "animation" } }, ngImport: i0, template: "<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host:before,:host:after{position:absolute;top:0;left:0;inline-size:100%;content:\"\";block-size:100%;background:#00000061;animation:tuiFadeIn var(--tui-duration)}:host:before{left:-100%;inline-size:200%}:host:after{left:100%}:host.ng-animating:before,:host.ng-animating:after{opacity:0;transition:opacity var(--tui-duration)}:host.t-right{justify-content:flex-end}:host.t-left{justify-content:flex-start}.t-wrapper{position:relative;display:flex;flex-direction:column;background:var(--tui-background-base);box-shadow:0 10rem var(--tui-background-base);inline-size:17.25rem}.t-wrapper_auto-width{inline-size:auto}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiActiveZone, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }], animations: [tuiSlideIn], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
95
|
-
}
|
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiSidebarComponent, decorators: [{
|
|
97
|
-
type: Component,
|
|
98
|
-
args: [{ selector: 'aside[tuiSidebar]', imports: [PolymorpheusOutlet, TuiActiveZone], changeDetection: ChangeDetectionStrategy.OnPush, animations: [tuiSlideIn], host: {
|
|
99
|
-
'[class]': '"t-" + direction',
|
|
100
|
-
'[@tuiSlideIn]': 'animation',
|
|
101
|
-
}, template: "<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host:before,:host:after{position:absolute;top:0;left:0;inline-size:100%;content:\"\";block-size:100%;background:#00000061;animation:tuiFadeIn var(--tui-duration)}:host:before{left:-100%;inline-size:200%}:host:after{left:100%}:host.ng-animating:before,:host.ng-animating:after{opacity:0;transition:opacity var(--tui-duration)}:host.t-right{justify-content:flex-end}:host.t-left{justify-content:flex-start}.t-wrapper{position:relative;display:flex;flex-direction:column;background:var(--tui-background-base);box-shadow:0 10rem var(--tui-background-base);inline-size:17.25rem}.t-wrapper_auto-width{inline-size:auto}\n"] }]
|
|
102
|
-
}] });
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated use {@link TuiDrawer} instead
|
|
106
|
-
*/
|
|
107
|
-
const TuiSidebar = [TuiSidebarComponent, TuiSidebarDirective];
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Generated bundle index. Do not edit.
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
export { TuiSidebar, TuiSidebarComponent, TuiSidebarDirective };
|
|
114
|
-
//# sourceMappingURL=taiga-ui-addon-mobile-directives-sidebar.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-sidebar.mjs","sources":["../../../projects/addon-mobile/directives/sidebar/sidebar.directive.ts","../../../projects/addon-mobile/directives/sidebar/sidebar.component.ts","../../../projects/addon-mobile/directives/sidebar/sidebar.template.html","../../../projects/addon-mobile/directives/sidebar/sidebar.ts","../../../projects/addon-mobile/directives/sidebar/taiga-ui-addon-mobile-directives-sidebar.ts"],"sourcesContent":["import {\n type ComponentRef,\n Directive,\n inject,\n INJECTOR,\n Input,\n type OnDestroy,\n TemplateRef,\n} from '@angular/core';\nimport {TuiPopupService} from '@taiga-ui/core/directives/popup';\nimport {type TuiHorizontalDirection} from '@taiga-ui/core/types';\nimport {PolymorpheusComponent, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';\n\nimport {TuiSidebarComponent} from './sidebar.component';\n\n/**\n * @deprecated use {@link TuiDrawer} instead\n */\n@Directive({\n standalone: true,\n selector: '[tuiSidebar]',\n})\nexport class TuiSidebarDirective<T = Record<string, unknown>>\n extends PolymorpheusTemplate<T>\n implements OnDestroy\n{\n private readonly injector = inject(INJECTOR);\n private readonly service = inject(TuiPopupService);\n\n private readonly component = new PolymorpheusComponent(\n TuiSidebarComponent,\n this.injector,\n );\n\n private sidebarRef: ComponentRef<TuiSidebarComponent> | null = null;\n\n @Input('tuiSidebarDirection')\n public direction: TuiHorizontalDirection = 'left';\n\n @Input('tuiSidebarAutoWidth')\n public autoWidth = false;\n\n public readonly content = inject(TemplateRef<T>);\n\n @Input()\n public set tuiSidebar(open: boolean) {\n if (open) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n public ngOnDestroy(): void {\n this.hide();\n }\n\n private show(): void {\n if (this.sidebarRef !== null) {\n return;\n }\n\n this.sidebarRef = this.service.add(this.component);\n this.sidebarRef.changeDetectorRef.detectChanges();\n }\n\n private hide(): void {\n if (this.sidebarRef === null) {\n return;\n }\n\n this.service.remove(this.sidebarRef);\n this.sidebarRef = null;\n }\n}\n","import {type AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, type DoCheck, inject} from '@angular/core';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {tuiSlideIn} from '@taiga-ui/core/animations';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {type TuiHorizontalDirection} from '@taiga-ui/core/types';\nimport {tuiToAnimationOptions} from '@taiga-ui/core/utils/miscellaneous';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiSidebarDirective} from './sidebar.directive';\n\n/**\n * @deprecated use {@link TuiDrawer} instead\n */\n@Component({\n selector: 'aside[tuiSidebar]',\n imports: [PolymorpheusOutlet, TuiActiveZone],\n templateUrl: './sidebar.template.html',\n styleUrls: ['./sidebar.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiSlideIn],\n host: {\n '[class]': '\"t-\" + direction',\n '[@tuiSlideIn]': 'animation',\n },\n})\nexport class TuiSidebarComponent implements DoCheck {\n private readonly directive = inject(TuiSidebarDirective);\n private readonly options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));\n private readonly left = {...this.options, value: 'left'};\n private readonly right = {...this.options, value: 'right'};\n\n public ngDoCheck(): void {\n this.directive.check();\n }\n\n protected get animation(): AnimationOptions {\n return this.direction === 'left' ? this.left : this.right;\n }\n\n protected get direction(): TuiHorizontalDirection {\n return this.directive.direction;\n }\n\n protected get content(): PolymorpheusContent {\n return this.directive.content;\n }\n\n protected get autoWidth(): boolean {\n return this.directive.autoWidth;\n }\n}\n","<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n","import {TuiSidebarComponent} from './sidebar.component';\nimport {TuiSidebarDirective} from './sidebar.directive';\n\n/**\n * @deprecated use {@link TuiDrawer} instead\n */\nexport const TuiSidebar = [TuiSidebarComponent, TuiSidebarDirective] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAeA;;AAEG;AAKG,MAAO,mBACT,SAAQ,oBAAuB,CAAA;AALnC,IAAA,WAAA,GAAA;;AAQqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;QAEjC,IAAS,CAAA,SAAA,GAAG,IAAI,qBAAqB,CAClD,mBAAmB,EACnB,IAAI,CAAC,QAAQ,CAChB;QAEO,IAAU,CAAA,UAAA,GAA6C,IAAI;QAG5D,IAA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