@taiga-ui/addon-mobile 4.52.0-canary.38dfc57 → 4.52.0-canary.3915ce7
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/directives/dropdown-mobile/dropdown-mobile-wrapper.component.d.ts +20 -0
- package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +5 -15
- package/directives/ripple/ripple.directive.d.ts +1 -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 +7 -7
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +106 -86
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs +14 -35
- package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-services.mjs +2 -2
- package/fesm2022/taiga-ui-addon-mobile-services.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/common/toast.less +21 -0
- package/styles/taiga-ui-mobile.less +8 -0
|
@@ -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
|
}
|
|
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
export declare class TuiRipple {
|
|
3
3
|
private readonly doc;
|
|
4
4
|
private readonly destroyRef;
|
|
5
|
-
private readonly
|
|
5
|
+
private readonly duration;
|
|
6
6
|
protected readonly nothing: undefined;
|
|
7
7
|
tuiRipple: string;
|
|
8
8
|
protected start(x: number, y: number, target: HTMLElement, el: HTMLElement): void;
|
|
@@ -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,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,IAAI,EAAE,UAAU;CACV;MAeG,cAAc,CAAA;AAb3B,IAAA,WAAA,GAAA;QAeqB,IAAQ,CAAA,QAAA,GAAuC,WAAW;QAK1D,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AAGjC,QAAA,IAAA,CAAA,KAAK,GAAsB,CAAC,QAAQ,CAAC;AAa/C;IAXa,QAAQ,GAAA;QACd,MAAM,EAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAC,GAAG,IAAI,CAAC,EAAE;AACvD,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,YAAY,IAAI,CAAC;QACjE,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,YAAY,IAAI,QA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AA,EAAA,CAAA,OAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECxBvD,iRAeA,EAAA,MAAA,EAAA,CAAA,89CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FDiBa,cAAc,EAAA,UAAA,EAAA,CAAA;kBAb1B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAGX,eAAA,EAAA,uBAAuB,CAAC,MAAM,aACpC,CAAC,wBAAwB,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,EAC7C,IAAA,EAAA;AACF,wBAAA,qBAAqB,EAAE,UAAU;AACjC,wBAAA,0BAA0B,EAAE,yCAAyC;AACrE,wBAAA,mBAAmB,EAAE,YAAY;AACjC,wBAAA,UAAU,EAAE,YAAY;AAC3B,qBAAA,EAAA,QAAA,EAAA,iRAAA,EAAA,MAAA,EAAA,CAAA,89CAAA,CAAA,EAAA;8BAIgB,QAAQ,EAAA,CAAA;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/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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AAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,kBAAkB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,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;;;;"}
|
|
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 =\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;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18 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ElementRef, ViewChildren, ChangeDetectionStrategy, Component, InjectionToken,
|
|
2
|
+
import { inject, ElementRef, ViewChildren, ChangeDetectionStrategy, Component, InjectionToken, Injectable, Directive } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
4
|
+
import { EMPTY_QUERY, TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
5
5
|
import * as i1 from '@taiga-ui/cdk/directives/animated';
|
|
6
6
|
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
7
7
|
import { tuiCloseWatcher, tuiZonefull } from '@taiga-ui/cdk/observables';
|
|
8
8
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
9
9
|
import { tuiProvide, tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
10
|
+
import { TUI_DIALOGS_CLOSE, TUI_DIALOGS } from '@taiga-ui/core/components/dialog';
|
|
10
11
|
import { TUI_SCROLL_REF } from '@taiga-ui/core/tokens';
|
|
11
12
|
import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
12
|
-
import { Subject, merge, exhaustMap, isObservable, take, of, filter, startWith, pairwise } from 'rxjs';
|
|
13
|
+
import { Subject, merge, map, exhaustMap, isObservable, take, of, filter, startWith, pairwise } from 'rxjs';
|
|
13
14
|
import { TuiPopoverDirective } from '@taiga-ui/cdk/directives/popover';
|
|
14
15
|
import { TuiPopoverService, TuiThemeColorService, tuiAsPopover } from '@taiga-ui/cdk/services';
|
|
15
|
-
import { TUI_DIALOGS } from '@taiga-ui/core/components/dialog';
|
|
16
16
|
|
|
17
17
|
const REQUIRED_ERROR = new Error(ngDevMode ? 'Required dialog was dismissed' : '');
|
|
18
18
|
class TuiSheetDialogComponent {
|
|
@@ -22,7 +22,7 @@ class TuiSheetDialogComponent {
|
|
|
22
22
|
this.pointers = 0;
|
|
23
23
|
this.context = injectContext();
|
|
24
24
|
this.close$ = new Subject();
|
|
25
|
-
this.$ = merge(this.close$, tuiCloseWatcher())
|
|
25
|
+
this.$ = merge(this.close$, tuiCloseWatcher(), inject(TUI_DIALOGS_CLOSE).pipe(map(TUI_TRUE_HANDLER)))
|
|
26
26
|
.pipe(tuiZonefull(), exhaustMap(() => {
|
|
27
27
|
if (isObservable(this.context.closeable)) {
|
|
28
28
|
if (this.el.scrollTop <= 0) {
|
|
@@ -60,7 +60,7 @@ 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.closeable", "class._fullscreen": "context.fullscreen === true" } }, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], viewQueries: [{ propertyName: "stops", predicate: ["stops"], descendants: true }], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<div class=\"t-stops\">\n @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:
|
|
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.closeable", "class._fullscreen": "context.fullscreen === true" } }, providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)], viewQueries: [{ propertyName: "stops", predicate: ["stops"], descendants: true }], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<div class=\"t-stops\">\n @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,
|
|
@@ -74,7 +74,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
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:
|
|
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']
|
|
@@ -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 type QueryList,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {EMPTY_QUERY} 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_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {exhaustMap, filter, isObservable, 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(this.close$, tuiCloseWatcher())\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":";;;;;;;;;;;;;;;;AAqBA,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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AChB,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.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,CAAC;;YAG/C,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;SACpC,CAAC,EACF,MAAM,CAAC,OAAO,CAAC,E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BAAA;;;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,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 { tuiGetNativeFocused } 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
|
-
return this.dropdown.el.contains(
|
|
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 {tuiGetNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownMobile} from './dropdown-mobile.directive';\n\nconst GAP = 16;\n\n@Component({\n 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(tuiGetNativeFocused(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":";;;;;;;;;;;;;;;;;;MAwBa,iBAAiB,CAAA;AAjB9B,IAAA,WAAA,GAAA;AAkBqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC;QAG1C,IAAiB,CAAA,iBAAA,GAAG,EAAE;AAehC;AAba,IAAA,WAAW,CAAC,KAAiB,EAAA;QACnC,IACI,CAAC,IAAI,CAAC,QAAQ;AACd,YAAA,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;AAC/B,YAAA,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACvC,IAAI,CAAC,iBAAiB,EACxB;YACE;;QAGJ,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC;;+GAjBpC,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,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A,CAAA;kBAjBtC,SAAS;+BACI,qBAAqB,EAAA,OAAA,EACtB,CAAC,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,EAAA,aAAA,EAGhD,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,aAAa,EAAE,WAAW,CAAC,EACtC,IAAA,EAAA;AACF,wBAAA,gBAAgB,EAAE,6BAA6B;AAC/C,wBAAA,mCAAmC,EAAE,iBAAiB;AACtD,wBAAA,kCAAkC,EAC9B,8CAA8C;AAClD,wBAAA,kCAAkC,EAAE,wBAAwB;AAC5D,wBAAA,kCAAkC,EAAE,wBAAwB;AAC/D,qBAAA,EAAA,QAAA,EAAA,2tBAAA,EAAA,MAAA,EAAA,CAAA,6hHAAA,CAAA,EAAA;;;AEvCL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-mobile.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile-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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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,48 +2,28 @@ import { DOCUMENT } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { ChangeDetectionStrategy, ViewEncapsulation, Component, inject, DestroyRef, Input, Directive } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
6
5
|
import { tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
6
|
import { tuiWithStyles, tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
8
7
|
import { TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
|
|
9
8
|
import { tuiGetDuration } from '@taiga-ui/core/utils/miscellaneous';
|
|
10
|
-
import { merge, race, switchMap, first, tap } from 'rxjs';
|
|
9
|
+
import { merge, fromEvent, race, switchMap, first, tap } from 'rxjs';
|
|
11
10
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
opacity: '0.12',
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
const FROM_KEYFRAMES = [
|
|
22
|
-
{
|
|
23
|
-
opacity: '0.12',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
opacity: '0',
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
class TuiRippleStyles {
|
|
30
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRippleStyles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
31
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiRippleStyles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-ripple-styles" }, ngImport: i0, template: '', isInline: true, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
11
|
+
const TO = [{ transform: 'scale(0)', opacity: '0.12' }, { opacity: '0.12' }];
|
|
12
|
+
const FROM = [{ opacity: '0.12' }, { opacity: '0' }];
|
|
13
|
+
class Styles {
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: Styles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-ripple" }, ngImport: i0, template: '', isInline: true, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
32
16
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type:
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: Styles, decorators: [{
|
|
34
18
|
type: Component,
|
|
35
|
-
args: [{
|
|
36
|
-
class: 'tui-ripple-styles',
|
|
37
|
-
}, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"] }]
|
|
19
|
+
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-ripple' }, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"] }]
|
|
38
20
|
}] });
|
|
39
21
|
class TuiRipple {
|
|
40
22
|
constructor() {
|
|
41
23
|
this.doc = inject(DOCUMENT);
|
|
42
24
|
this.destroyRef = inject(DestroyRef);
|
|
43
|
-
this.
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
this.nothing = tuiWithStyles(TuiRippleStyles);
|
|
25
|
+
this.duration = tuiGetDuration(inject(TUI_ANIMATIONS_SPEED));
|
|
26
|
+
this.nothing = tuiWithStyles(Styles);
|
|
47
27
|
this.tuiRipple = '';
|
|
48
28
|
}
|
|
49
29
|
start(x, y, target, el) {
|
|
@@ -52,11 +32,11 @@ class TuiRipple {
|
|
|
52
32
|
return;
|
|
53
33
|
}
|
|
54
34
|
const ripple = this.createRipple(x, y, element.getBoundingClientRect());
|
|
55
|
-
const touchEnd$ = merge(
|
|
35
|
+
const touchEnd$ = merge(fromEvent(element, 'pointerup'), fromEvent(element, 'pointercancel'), fromEvent(element, 'pointermove'));
|
|
56
36
|
element.appendChild(ripple);
|
|
57
|
-
const
|
|
58
|
-
race(touchEnd$.pipe(switchMap(() =>
|
|
59
|
-
.pipe(first(), switchMap(() =>
|
|
37
|
+
const animationEnd$ = fromEvent(ripple.animate(TO, this.duration), 'finish');
|
|
38
|
+
race(touchEnd$.pipe(switchMap(() => animationEnd$)), animationEnd$.pipe(switchMap(() => touchEnd$)))
|
|
39
|
+
.pipe(first(), switchMap(() => fromEvent(ripple.animate(FROM, this.duration), 'finish')), first(), tap(() => element.removeChild(ripple)), takeUntilDestroyed(this.destroyRef))
|
|
60
40
|
.subscribe();
|
|
61
41
|
}
|
|
62
42
|
createRipple(clientX, clientY, { width, height, top, left }) {
|
|
@@ -86,7 +66,6 @@ class TuiRipple {
|
|
|
86
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRipple, decorators: [{
|
|
87
67
|
type: Directive,
|
|
88
68
|
args: [{
|
|
89
|
-
standalone: true,
|
|
90
69
|
selector: '[tuiRipple]',
|
|
91
70
|
host: {
|
|
92
71
|
'(pointerdown.zoneless)': 'start($event.clientX, $event.clientY, $event.target, $event.currentTarget)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-ripple.mjs","sources":["../../../projects/addon-mobile/directives/ripple/ripple.directive.ts","../../../projects/addon-mobile/directives/ripple/taiga-ui-addon-mobile-directives-ripple.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-ripple.mjs","sources":["../../../projects/addon-mobile/directives/ripple/ripple.directive.ts","../../../projects/addon-mobile/directives/ripple/taiga-ui-addon-mobile-directives-ripple.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiPx, tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {tuiGetDuration} from '@taiga-ui/core/utils/miscellaneous';\nimport {first, fromEvent, merge, race, switchMap, tap} from 'rxjs';\n\nconst TO = [{transform: 'scale(0)', opacity: '0.12'}, {opacity: '0.12'}];\nconst FROM = [{opacity: '0.12'}, {opacity: '0'}];\n\n@Component({\n template: '',\n styleUrls: ['./ripple.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {class: 'tui-ripple'},\n})\nclass Styles {}\n\n@Directive({\n selector: '[tuiRipple]',\n host: {\n '(pointerdown.zoneless)':\n 'start($event.clientX, $event.clientY, $event.target, $event.currentTarget)',\n },\n})\nexport class TuiRipple {\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly duration = tuiGetDuration(inject(TUI_ANIMATIONS_SPEED));\n\n protected readonly nothing = tuiWithStyles(Styles);\n\n @Input()\n public tuiRipple = '';\n\n protected start(x: number, y: number, target: HTMLElement, el: HTMLElement): void {\n const element = this.tuiRipple ? target.closest(this.tuiRipple) : el;\n\n if (!tuiIsHTMLElement(element)) {\n return;\n }\n\n const ripple = this.createRipple(x, y, element.getBoundingClientRect());\n const touchEnd$ = merge(\n fromEvent(element, 'pointerup'),\n fromEvent(element, 'pointercancel'),\n fromEvent(element, 'pointermove'),\n );\n\n element.appendChild(ripple);\n\n const animationEnd$ = fromEvent(ripple.animate(TO, this.duration), 'finish');\n\n race(\n touchEnd$.pipe(switchMap(() => animationEnd$)),\n animationEnd$.pipe(switchMap(() => touchEnd$)),\n )\n .pipe(\n first(),\n switchMap(() => fromEvent(ripple.animate(FROM, this.duration), 'finish')),\n first(),\n tap(() => element.removeChild(ripple)),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe();\n }\n\n private createRipple(\n clientX: number,\n clientY: number,\n {width, height, top, left}: DOMRect,\n ): HTMLElement {\n const ripple: HTMLElement = this.doc.createElement('div');\n const radius = Math.sqrt(width * width + height * height);\n const dimension = radius * 2;\n const x = clientX - left - radius;\n const y = clientY - top - radius;\n\n Object.assign(ripple.style, {\n position: 'absolute',\n top: tuiPx(y),\n left: tuiPx(x),\n width: tuiPx(dimension),\n height: tuiPx(dimension),\n zIndex: 100,\n opacity: 0.12,\n borderRadius: '100%',\n background: 'var(--tui-ripple-background, currentColor)',\n animationFillMode: 'forwards',\n pointerEvents: 'none',\n });\n\n return ripple;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAiBA,MAAM,EAAE,GAAG,CAAC,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAC,EAAE,EAAC,OAAO,EAAE,MAAM,EAAC,CAAC;AACxE,MAAM,IAAI,GAAG,CAAC,EAAC,OAAO,EAAE,MAAM,EAAC,EAAE,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AAEhD,MAOM,MAAM,CAAA;+GAAN,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAN,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAM,gHANE,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,oLAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAMV,MAAM,EAAA,UAAA,EAAA,CAAA;kBAPX,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAE,EAEG,aAAA,EAAA,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA,EAAC,KAAK,EAAE,YAAY,EAAC,EAAA,MAAA,E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C;AAEF,QAAA,OAAO,MAAM;;+GAnER,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,sBAAA,EAAA,4EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAPrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,IAAI,EAAE;AACF,wBAAA,wBAAwB,EACpB,4EAA4E;AACnF,qBAAA;AACJ,iBAAA;8BASU,SAAS,EAAA,CAAA;sBADf;;;AC3CL;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, Injectable } from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
5
5
|
import { merge, fromEvent, filter } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
class TuiKeyboardService {
|
|
@@ -25,7 +25,7 @@ class TuiKeyboardService {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
hide() {
|
|
28
|
-
const focused =
|
|
28
|
+
const focused = tuiGetFocused(this.doc);
|
|
29
29
|
if (focused?.inputMode === undefined || this.element) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-services.mjs","sources":["../../../projects/addon-mobile/services/keyboard.service.ts","../../../projects/addon-mobile/services/taiga-ui-addon-mobile-services.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, Injectable, type OnDestroy} from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-services.mjs","sources":["../../../projects/addon-mobile/services/keyboard.service.ts","../../../projects/addon-mobile/services/taiga-ui-addon-mobile-services.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, Injectable, type OnDestroy} from '@angular/core';\nimport {tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\nimport {filter, fromEvent, merge} from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiKeyboardService implements OnDestroy {\n private readonly doc = inject(DOCUMENT);\n private readonly sub = merge(\n fromEvent(this.doc, 'focusout'),\n fromEvent(this.doc, 'mousedown').pipe(\n filter((e) => Object.is(e.target, this.element)),\n ),\n ).subscribe(() => {\n this.show();\n });\n\n private element?: ElementContentEditable;\n private inputMode = '';\n\n public ngOnDestroy(): void {\n this.sub.unsubscribe();\n this.show();\n }\n\n public toggle(): void {\n if (this.element) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n public hide(): void {\n const focused = tuiGetFocused(this.doc) as HTMLInputElement;\n\n if (focused?.inputMode === undefined || this.element) {\n return;\n }\n\n this.element = focused;\n this.inputMode = focused.inputMode;\n focused.inputMode = 'none';\n }\n\n public show(): void {\n if (!this.element) {\n return;\n }\n\n this.element.inputMode = 'none';\n this.element.inputMode = this.inputMode;\n this.element = undefined;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAQa,kBAAkB,CAAA;AAH/B,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;QACtB,IAAG,CAAA,GAAA,GAAG,KAAK,CACxB,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,EAC/B,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW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A,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFf,MAAM,EAAA,CAAA,CAAA;;4FAET,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;ACPD;;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.3915ce7",
|
|
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",
|
|
@@ -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
|
}
|