@taiga-ui/core 4.52.0-canary.b61d3d0 → 4.52.0-canary.bb543c6
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/classes/accessors.d.ts +1 -1
- package/components/alert/alert.interfaces.d.ts +4 -5
- package/components/dialog/dialog.component.d.ts +2 -3
- package/components/dialog/dialog.options.d.ts +2 -3
- package/components/dialog/dialog.providers.d.ts +1 -2
- package/components/dialog/index.d.ts +0 -1
- package/components/index.d.ts +0 -1
- package/components/modal/modal.component.d.ts +3 -3
- package/components/modal/modal.service.d.ts +3 -3
- package/components/notification/notification.directive.d.ts +2 -3
- package/directives/dropdown/dropdown-position.directive.d.ts +1 -1
- package/fesm2022/taiga-ui-core-classes.mjs +1 -1
- package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-alert.mjs +1 -1
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +8 -76
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +2 -2
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-modal.mjs +10 -10
- package/fesm2022/taiga-ui-core-components-modal.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +5 -6
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +3 -4
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components.mjs +0 -1
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs +13 -17
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs +5 -7
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +21 -12
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs +1 -0
- package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
- package/package.json +5 -6
- package/pipes/format-number/format-number.pipe.d.ts +5 -3
- package/styles/components/link.less +1 -0
- package/styles/mixins/appearance.less +1 -1
- package/styles/mixins/mixins.less +0 -5
- package/styles/mixins/mixins.scss +0 -5
- package/styles/theme/variables.less +2 -4
- package/components/dialog/active-zone-adapter.directive.d.ts +0 -11
- package/components/dialog/dialogs.component.d.ts +0 -8
- package/components/header/header.directive.d.ts +0 -17
- package/components/header/index.d.ts +0 -1
- package/fesm2022/taiga-ui-core-components-header.mjs +0 -42
- package/fesm2022/taiga-ui-core-components-header.mjs.map +0 -1
package/classes/accessors.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare abstract class TuiRectAccessor extends TuiAccessor {
|
|
|
10
10
|
abstract getClientRect(): DOMRect;
|
|
11
11
|
}
|
|
12
12
|
export declare function tuiProvideAccessor<T extends TuiAccessor>(provide: AbstractType<T>, type: string, fallback: Type<T>): FactoryProvider;
|
|
13
|
-
export declare function tuiFallbackAccessor<T extends TuiAccessor>(type: string): (accessors: readonly T[] | null, fallback: T) => T;
|
|
13
|
+
export declare function tuiFallbackAccessor<T extends TuiAccessor>(type: string): (accessors: readonly T[] | null, fallback: Omit<T, 'type'>) => T;
|
|
14
14
|
export declare function tuiPositionAccessorFor(type: string, fallback: Type<TuiPositionAccessor>): FactoryProvider;
|
|
15
15
|
export declare function tuiRectAccessorFor(type: string, fallback: Type<TuiRectAccessor>): FactoryProvider;
|
|
16
16
|
export declare function tuiAsPositionAccessor(accessor: Type<TuiPositionAccessor>): ExistingProvider;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type TuiPortalContext } from '@taiga-ui/cdk/portals';
|
|
2
|
+
import { type TuiNumberHandler } from '@taiga-ui/cdk/types';
|
|
3
3
|
import { type TuiNotificationOptions } from '@taiga-ui/core/components/notification';
|
|
4
4
|
import { type TuiPositionOptions } from '@taiga-ui/core/directives';
|
|
5
5
|
import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
6
6
|
export interface TuiAlertOptions<I = undefined> extends Omit<TuiNotificationOptions, 'size'>, TuiPositionOptions {
|
|
7
|
-
readonly autoClose:
|
|
7
|
+
readonly autoClose: TuiNumberHandler<string> | number;
|
|
8
8
|
readonly data: I;
|
|
9
9
|
readonly closable: boolean;
|
|
10
10
|
readonly label: PolymorpheusContent<TuiAlertOptions<I>>;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
}
|
|
12
|
+
export type TuiAlertContext<O = void, I = undefined> = TuiPortalContext<TuiAlertOptions<I>, O>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type TuiPopover } from '@taiga-ui/cdk/services';
|
|
2
1
|
import { Subject } from 'rxjs';
|
|
3
|
-
import { type
|
|
2
|
+
import { type TuiDialogContext } from './dialog.options';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
import * as i1 from "@taiga-ui/cdk/directives/animated";
|
|
6
5
|
export declare class TuiDialogComponent<O, I> {
|
|
7
6
|
protected readonly close$: Subject<void>;
|
|
8
7
|
protected readonly close: import("@angular/core").Signal<string>;
|
|
9
8
|
protected readonly icons: import("@taiga-ui/core/tokens").TuiCommonIcons;
|
|
10
|
-
protected readonly context:
|
|
9
|
+
protected readonly context: TuiDialogContext<I, O>;
|
|
11
10
|
protected readonly primitive: boolean;
|
|
12
11
|
protected readonly sub: import("rxjs").Subscription;
|
|
13
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiDialogComponent<any, any>, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type TuiPortalContext } from '@taiga-ui/cdk/portals';
|
|
2
2
|
import { type TuiSizeL, type TuiSizeS } from '@taiga-ui/core/types';
|
|
3
3
|
import { type Observable } from 'rxjs';
|
|
4
4
|
/**
|
|
@@ -21,6 +21,5 @@ export interface TuiDialogOptions<I> {
|
|
|
21
21
|
readonly required: boolean;
|
|
22
22
|
readonly size: TuiSizeL | TuiSizeS;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
25
|
-
}
|
|
24
|
+
export type TuiDialogContext<O = void, I = undefined> = TuiPortalContext<TuiDialogOptions<I>, O>;
|
|
26
25
|
export declare const TUI_DIALOG_OPTIONS: import("@angular/core").InjectionToken<TuiDialogOptions<void>>, tuiDialogOptionsProvider: (item: Partial<TuiDialogOptions<void>> | (() => Partial<TuiDialogOptions<void>>)) => import("@angular/core").FactoryProvider;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare const TUI_DIALOGS: InjectionToken<BehaviorSubject<readonly any[]>>;
|
|
5
4
|
export declare const TUI_DIALOGS_CLOSE: InjectionToken<Observable<unknown>>;
|
|
6
5
|
export declare class TuiDialogCloseService extends Observable<unknown> {
|
|
7
6
|
private readonly win;
|
package/components/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from '@taiga-ui/core/components/data-list';
|
|
|
6
6
|
export * from '@taiga-ui/core/components/dialog';
|
|
7
7
|
export * from '@taiga-ui/core/components/error';
|
|
8
8
|
export * from '@taiga-ui/core/components/expand';
|
|
9
|
-
export * from '@taiga-ui/core/components/header';
|
|
10
9
|
export * from '@taiga-ui/core/components/icon';
|
|
11
10
|
export * from '@taiga-ui/core/components/label';
|
|
12
11
|
export * from '@taiga-ui/core/components/link';
|
|
@@ -5,13 +5,13 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
import * as i1 from "@taiga-ui/cdk/directives/active-zone";
|
|
6
6
|
import * as i2 from "@taiga-ui/cdk/directives/focus-trap";
|
|
7
7
|
import * as i3 from "@taiga-ui/core/components/scrollbar";
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class TuiModalComponent<T> implements OnDestroy, OnInit {
|
|
9
9
|
private readonly current;
|
|
10
10
|
private readonly parent;
|
|
11
11
|
readonly context: TuiPortalContext<T>;
|
|
12
12
|
readonly component: import("@angular/core").WritableSignal<PolymorpheusContent<TuiPortalContext<T>>>;
|
|
13
13
|
ngOnInit(): void;
|
|
14
14
|
ngOnDestroy(): void;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiModalComponent<any>, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TuiModalComponent<any>, "tui-modal", never, {}, {}, never, never, true, [{ directive: typeof i1.TuiActiveZone; inputs: {}; outputs: {}; }, { directive: typeof i2.TuiFocusTrap; inputs: {}; outputs: {}; }, { directive: typeof i3.TuiScrollRef; inputs: {}; outputs: {}; }]>;
|
|
17
17
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type Type } from '@angular/core';
|
|
2
2
|
import { TuiPortal } from '@taiga-ui/cdk/portals';
|
|
3
3
|
import { PolymorpheusComponent } from '@taiga-ui/polymorpheus';
|
|
4
|
-
import {
|
|
4
|
+
import { TuiModalComponent } from './modal.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare abstract class TuiModalService<T, K = void> extends TuiPortal<T, K> {
|
|
7
7
|
protected abstract readonly content: Type<unknown>;
|
|
8
|
-
protected readonly component: typeof
|
|
8
|
+
protected readonly component: typeof TuiModalComponent;
|
|
9
9
|
constructor();
|
|
10
|
-
protected add(component: PolymorpheusComponent<
|
|
10
|
+
protected add(component: PolymorpheusComponent<TuiModalComponent<T>>): () => void;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiModalService<any, any>, never>;
|
|
12
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<TuiModalService<any, any>>;
|
|
13
13
|
}
|
|
@@ -4,12 +4,11 @@ import * as i1 from "@taiga-ui/core/directives/icons";
|
|
|
4
4
|
import * as i2 from "@taiga-ui/core/directives/appearance";
|
|
5
5
|
export declare class TuiNotification {
|
|
6
6
|
private readonly options;
|
|
7
|
-
protected readonly computedIcon: import("@angular/core").Signal<string>;
|
|
8
7
|
protected readonly nothing: undefined;
|
|
9
8
|
protected readonly icons: import("@angular/core").Signal<string>;
|
|
10
9
|
readonly appearance: import("@angular/core").InputSignal<"" | ("info" | "positive" | "negative" | "warning" | "neutral" | "accent" | "action-destructive" | "action-grayscale" | "action" | "flat-destructive" | "flat-grayscale" | "flat" | "floating" | "glass" | "icon" | "outline-destructive" | "outline-grayscale" | "outline" | "primary-destructive" | "primary-grayscale" | "primary" | "secondary-destructive" | "secondary-grayscale" | "secondary" | "textfield" | (Record<never, never> & string))>;
|
|
11
|
-
readonly icon: import("@angular/core").InputSignal<string | TuiStringHandler<string>>;
|
|
12
10
|
readonly size: import("@angular/core").InputSignal<"m" | "l" | "s">;
|
|
11
|
+
readonly icon: import("@angular/core").InputSignal<string | TuiStringHandler<string>>;
|
|
13
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiNotification, never>;
|
|
14
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNotification, "tui-notification,
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNotification, "tui-notification,[tuiNotification]", never, { "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.TuiWithIcons; inputs: {}; outputs: {}; }, { directive: typeof i2.TuiWithAppearance; inputs: {}; outputs: {}; }]>;
|
|
15
14
|
}
|
|
@@ -10,7 +10,7 @@ export declare class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
10
10
|
private previous?;
|
|
11
11
|
readonly directionChange: EventEmitter<TuiVerticalDirection>;
|
|
12
12
|
readonly type = "dropdown";
|
|
13
|
-
readonly accessor: TuiRectAccessor
|
|
13
|
+
readonly accessor: TuiRectAccessor;
|
|
14
14
|
emitDirection(direction: TuiVerticalDirection): void;
|
|
15
15
|
getPosition({ width, height }: DOMRect): TuiPoint;
|
|
16
16
|
getAlign(align: TuiDropdownAlign): TuiDropdownAlign;
|
|
@@ -18,7 +18,7 @@ function tuiProvideAccessor(provide, type, fallback) {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
function tuiFallbackAccessor(type) {
|
|
21
|
-
return (accessors, fallback) => accessors?.find?.((accessor) => accessor !== fallback && accessor.type === type) || fallback;
|
|
21
|
+
return (accessors, fallback) => accessors?.find?.((accessor) => accessor !== fallback && accessor.type === type) || Object.create(fallback, { type: { value: type } });
|
|
22
22
|
}
|
|
23
23
|
function tuiPositionAccessorFor(type, fallback) {
|
|
24
24
|
return tuiProvideAccessor(TuiPositionAccessor, type, fallback);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-classes.mjs","sources":["../../../projects/core/classes/accessors.ts","../../../projects/core/classes/vehicle.ts","../../../projects/core/classes/driver.ts","../../../projects/core/classes/taiga-ui-core-classes.ts"],"sourcesContent":["import {\n type AbstractType,\n type ExistingProvider,\n type FactoryProvider,\n Optional,\n SkipSelf,\n type Type,\n} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiPoint} from '@taiga-ui/core/types';\n\nexport abstract class TuiAccessor {\n public abstract readonly type: string;\n}\n\nexport abstract class TuiPositionAccessor extends TuiAccessor {\n /*\n * TODO @deprecated switching from DOMRect to HTMLElement in v5\n */\n public abstract getPosition(rect: DOMRect, element?: HTMLElement): TuiPoint;\n}\n\nexport abstract class TuiRectAccessor extends TuiAccessor {\n public abstract getClientRect(): DOMRect;\n}\n\nexport function tuiProvideAccessor<T extends TuiAccessor>(\n provide: AbstractType<T>,\n type: string,\n fallback: Type<T>,\n): FactoryProvider {\n return {\n provide,\n deps: [[new SkipSelf(), new Optional(), provide], fallback],\n useFactory: tuiFallbackAccessor<T>(type),\n };\n}\n\nexport function tuiFallbackAccessor<T extends TuiAccessor>(\n type: string,\n): (accessors: readonly T[] | null, fallback: T) => T {\n return (accessors, fallback) =>\n accessors?.find?.(\n (accessor) => accessor !== fallback && accessor.type === type,\n ) || fallback;\n}\n\nexport function tuiPositionAccessorFor(\n type: string,\n fallback: Type<TuiPositionAccessor>,\n): FactoryProvider {\n return tuiProvideAccessor(TuiPositionAccessor, type, fallback);\n}\n\nexport function tuiRectAccessorFor(\n type: string,\n fallback: Type<TuiRectAccessor>,\n): FactoryProvider {\n return tuiProvideAccessor(TuiRectAccessor, type, fallback);\n}\n\nexport function tuiAsPositionAccessor(\n accessor: Type<TuiPositionAccessor>,\n): ExistingProvider {\n return tuiProvide(TuiPositionAccessor, accessor, true);\n}\n\nexport function tuiAsRectAccessor(accessor: Type<TuiRectAccessor>): ExistingProvider {\n return tuiProvide(TuiRectAccessor, accessor, true);\n}\n","import {type ExistingProvider, type Type} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport abstract class TuiVehicle {\n public abstract readonly type: string;\n public abstract toggle(value: boolean): void;\n}\n\nexport function tuiAsVehicle(vehicle: Type<TuiVehicle>): ExistingProvider {\n return tuiProvide(TuiVehicle, vehicle, true);\n}\n","import {\n type AfterViewInit,\n DestroyRef,\n Directive,\n type ExistingProvider,\n inject,\n type Type,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {distinctUntilChanged, merge, Observable} from 'rxjs';\n\nimport {TuiVehicle} from './vehicle';\n\nexport abstract class TuiDriver extends Observable<boolean> {\n public abstract readonly type: string;\n}\n\nexport function tuiAsDriver(driver: Type<TuiDriver>): ExistingProvider {\n return tuiProvide(TuiDriver, driver, true);\n}\n\n@Directive()\nexport abstract class TuiDriverDirective implements AfterViewInit {\n public abstract type: string;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly drivers: readonly TuiDriver[] =\n inject<any>(TuiDriver, {self: true, optional: true}) || [];\n\n private readonly vehicles: readonly TuiVehicle[] = inject<any>(TuiVehicle, {\n self: true,\n optional: true,\n });\n\n public ngAfterViewInit(): void {\n const vehicle = this.vehicles?.find(({type}) => type === this.type);\n\n merge(...this.drivers.filter(({type}) => type === this.type))\n .pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n vehicle?.toggle(value);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAWsB,WAAW,CAAA;AAEhC;AAEK,MAAgB,mBAAoB,SAAQ,WAAW,CAAA;AAK5D;AAEK,MAAgB,eAAgB,SAAQ,WAAW,CAAA;AAExD;SAEe,kBAAkB,CAC9B,OAAwB,EACxB,IAAY,EACZ,QAAiB,EAAA;IAEjB,OAAO;QACH,OAAO;AACP,QAAA,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC;AAC3D,QAAA,UAAU,EAAE,mBAAmB,CAAI,IAAI,CAAC;KAC3C;AACL;AAEM,SAAU,mBAAmB,CAC/B,IAAY,EAAA;
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-classes.mjs","sources":["../../../projects/core/classes/accessors.ts","../../../projects/core/classes/vehicle.ts","../../../projects/core/classes/driver.ts","../../../projects/core/classes/taiga-ui-core-classes.ts"],"sourcesContent":["import {\n type AbstractType,\n type ExistingProvider,\n type FactoryProvider,\n Optional,\n SkipSelf,\n type Type,\n} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiPoint} from '@taiga-ui/core/types';\n\nexport abstract class TuiAccessor {\n public abstract readonly type: string;\n}\n\nexport abstract class TuiPositionAccessor extends TuiAccessor {\n /*\n * TODO @deprecated switching from DOMRect to HTMLElement in v5\n */\n public abstract getPosition(rect: DOMRect, element?: HTMLElement): TuiPoint;\n}\n\nexport abstract class TuiRectAccessor extends TuiAccessor {\n public abstract getClientRect(): DOMRect;\n}\n\nexport function tuiProvideAccessor<T extends TuiAccessor>(\n provide: AbstractType<T>,\n type: string,\n fallback: Type<T>,\n): FactoryProvider {\n return {\n provide,\n deps: [[new SkipSelf(), new Optional(), provide], fallback],\n useFactory: tuiFallbackAccessor<T>(type),\n };\n}\n\nexport function tuiFallbackAccessor<T extends TuiAccessor>(\n type: string,\n): (accessors: readonly T[] | null, fallback: Omit<T, 'type'>) => T {\n return (accessors, fallback) =>\n accessors?.find?.(\n (accessor) => accessor !== fallback && accessor.type === type,\n ) || Object.create(fallback, {type: {value: type}});\n}\n\nexport function tuiPositionAccessorFor(\n type: string,\n fallback: Type<TuiPositionAccessor>,\n): FactoryProvider {\n return tuiProvideAccessor(TuiPositionAccessor, type, fallback);\n}\n\nexport function tuiRectAccessorFor(\n type: string,\n fallback: Type<TuiRectAccessor>,\n): FactoryProvider {\n return tuiProvideAccessor(TuiRectAccessor, type, fallback);\n}\n\nexport function tuiAsPositionAccessor(\n accessor: Type<TuiPositionAccessor>,\n): ExistingProvider {\n return tuiProvide(TuiPositionAccessor, accessor, true);\n}\n\nexport function tuiAsRectAccessor(accessor: Type<TuiRectAccessor>): ExistingProvider {\n return tuiProvide(TuiRectAccessor, accessor, true);\n}\n","import {type ExistingProvider, type Type} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport abstract class TuiVehicle {\n public abstract readonly type: string;\n public abstract toggle(value: boolean): void;\n}\n\nexport function tuiAsVehicle(vehicle: Type<TuiVehicle>): ExistingProvider {\n return tuiProvide(TuiVehicle, vehicle, true);\n}\n","import {\n type AfterViewInit,\n DestroyRef,\n Directive,\n type ExistingProvider,\n inject,\n type Type,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {distinctUntilChanged, merge, Observable} from 'rxjs';\n\nimport {TuiVehicle} from './vehicle';\n\nexport abstract class TuiDriver extends Observable<boolean> {\n public abstract readonly type: string;\n}\n\nexport function tuiAsDriver(driver: Type<TuiDriver>): ExistingProvider {\n return tuiProvide(TuiDriver, driver, true);\n}\n\n@Directive()\nexport abstract class TuiDriverDirective implements AfterViewInit {\n public abstract type: string;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly drivers: readonly TuiDriver[] =\n inject<any>(TuiDriver, {self: true, optional: true}) || [];\n\n private readonly vehicles: readonly TuiVehicle[] = inject<any>(TuiVehicle, {\n self: true,\n optional: true,\n });\n\n public ngAfterViewInit(): void {\n const vehicle = this.vehicles?.find(({type}) => type === this.type);\n\n merge(...this.drivers.filter(({type}) => type === this.type))\n .pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))\n .subscribe((value) => {\n vehicle?.toggle(value);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAWsB,WAAW,CAAA;AAEhC;AAEK,MAAgB,mBAAoB,SAAQ,WAAW,CAAA;AAK5D;AAEK,MAAgB,eAAgB,SAAQ,WAAW,CAAA;AAExD;SAEe,kBAAkB,CAC9B,OAAwB,EACxB,IAAY,EACZ,QAAiB,EAAA;IAEjB,OAAO;QACH,OAAO;AACP,QAAA,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC;AAC3D,QA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,IAAA,CAAA,OAAO,GACpB,MAAM,CAAM,SAAS,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,IAAI,EAAE;AAE7C,QAAA,IAAA,CAAA,QAAQ,GAA0B,MAAM,CAAM,UAAU,EAAE;AACvE,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,QAAQ,EAAE,IAAI;AACjB,SAAA,CAAC;AAWL;IATU,eAAe,GAAA;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAC,IAAI,EAAC,KAAK,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;QAEnE,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAC,IAAI,EAAC,KAAK,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;aACvD,IAAI,CAAC,oBAAoB,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;AAChE,aAAA,SAAS,CAAC,CAAC,KAAK,KAAI;AACjB,YAAA,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;AAC1B,SAAC,CAAC;;+GAnBQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBADvC;;;ACtBD;;AAEG;;;;"}
|
|
@@ -30,7 +30,7 @@ class TuiAlertComponent {
|
|
|
30
30
|
.subscribe(() => this.item.$implicit.complete());
|
|
31
31
|
}
|
|
32
32
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiAlertComponent, isStandalone: true, selector: "tui-alert", host: { attributes: { "role": "alert" } }, hostDirectives: [{ directive: i1.TuiAnimated }, { directive: i2.TuiNotificationDirective }], ngImport: i0, template: "<div class=\"t-wrapper\">\n <tui-notification\n size=\"m\"\n [appearance]=\"item.appearance\"\n [class.t-closable]=\"item.closable\"\n [icon]=\"item.icon\"\n >\n <span tuiTitle>\n <ng-container *polymorpheusOutlet=\"item.label as text; context: item\">\n {{ text }}\n </ng-container>\n <span tuiSubtitle>\n <span\n *polymorpheusOutlet=\"item.content as text; context: item\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n </span>\n @if (item.closable) {\n <button\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click)=\"item.$implicit.complete()\"\n >\n {{ close() }}\n </button>\n }\n </tui-notification>\n</div>\n", styles: [":host{inline-size:18rem;margin:1.625rem 3rem;word-break:break-word;transform:translateZ(0);filter:drop-shadow(0 .375rem 1rem rgba(0,0,0,.12))}:host :host-context(tui-root._mobile){margin:.625rem 1rem}.t-wrapper{background:var(--tui-background-base);clip-path:inset(.375rem 0 round var(--tui-radius-m))}.t-closable{padding-inline-end:2.5rem}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiNotification, selector: "tui-notification,
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiAlertComponent, isStandalone: true, selector: "tui-alert", host: { attributes: { "role": "alert" } }, hostDirectives: [{ directive: i1.TuiAnimated }, { directive: i2.TuiNotificationDirective }], ngImport: i0, template: "<div class=\"t-wrapper\">\n <tui-notification\n size=\"m\"\n [appearance]=\"item.appearance\"\n [class.t-closable]=\"item.closable\"\n [icon]=\"item.icon\"\n >\n <span tuiTitle>\n <ng-container *polymorpheusOutlet=\"item.label as text; context: item\">\n {{ text }}\n </ng-container>\n <span tuiSubtitle>\n <span\n *polymorpheusOutlet=\"item.content as text; context: item\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n </span>\n @if (item.closable) {\n <button\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click)=\"item.$implicit.complete()\"\n >\n {{ close() }}\n </button>\n }\n </tui-notification>\n</div>\n", styles: [":host{inline-size:18rem;margin:1.625rem 3rem;word-break:break-word;transform:translateZ(0);filter:drop-shadow(0 .375rem 1rem rgba(0,0,0,.12))}:host :host-context(tui-root._mobile){margin:.625rem 1rem}.t-wrapper{background:var(--tui-background-base);clip-path:inset(.375rem 0 round var(--tui-radius-m))}.t-closable{padding-inline-end:2.5rem}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiNotification, selector: "tui-notification,[tuiNotification]", inputs: ["appearance", "size", "icon"] }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
34
34
|
}
|
|
35
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertComponent, decorators: [{
|
|
36
36
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-alert.mjs","sources":["../../../projects/core/components/alert/alert.component.ts","../../../projects/core/components/alert/alert.template.html","../../../projects/core/components/alert/alert.tokens.ts","../../../projects/core/components/alert/alert.service.ts","../../../projects/core/components/alert/alert.directive.ts","../../../projects/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {type TuiPortalContext} from '@taiga-ui/cdk/portals';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiNotification} from '@taiga-ui/core/components/notification';\nimport {TuiNotificationDirective} from '@taiga-ui/core/directives';\nimport {TuiTitle} from '@taiga-ui/core/directives/title';\nimport {TUI_CLOSE_WORD, TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {EMPTY, fromEvent, of, repeat, switchMap, takeUntil, timer} from 'rxjs';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\n\n@Component({\n selector: 'tui-alert',\n imports: [PolymorpheusOutlet, TuiButton, TuiNotification, TuiTitle],\n templateUrl: './alert.template.html',\n styleUrl: './alert.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiAnimated, TuiNotificationDirective],\n host: {role: 'alert'},\n})\nexport class TuiAlertComponent<O, I> {\n private readonly el = tuiInjectElement();\n\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly close = inject(TUI_CLOSE_WORD);\n protected readonly item = injectContext<TuiPortalContext<TuiAlertOptions<I>, O>>();\n\n protected readonly sub = of(\n typeof this.item.autoClose === 'function'\n ? this.item.autoClose(this.item.appearance)\n : this.item.autoClose,\n )\n .pipe(\n switchMap((autoClose) => (autoClose ? timer(autoClose) : EMPTY)),\n takeUntil(fromEvent(this.el, 'mouseenter')),\n repeat({delay: () => fromEvent(this.el, 'mouseleave')}),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.item.$implicit.complete());\n}\n","<div class=\"t-wrapper\">\n <tui-notification\n size=\"m\"\n [appearance]=\"item.appearance\"\n [class.t-closable]=\"item.closable\"\n [icon]=\"item.icon\"\n >\n <span tuiTitle>\n <ng-container *polymorpheusOutlet=\"item.label as text; context: item\">\n {{ text }}\n </ng-container>\n <span tuiSubtitle>\n <span\n *polymorpheusOutlet=\"item.content as text; context: item\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n </span>\n @if (item.closable) {\n <button\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click)=\"item.$implicit.complete()\"\n >\n {{ close() }}\n </button>\n }\n </tui-notification>\n</div>\n","import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {tuiCreateToken} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\n\nexport const TUI_ALERT_CONCURRENCY = tuiCreateToken<number>(5);\n\nexport const TUI_ALERT_DEFAULT_OPTIONS: Omit<TuiAlertOptions, 'appearance' | 'icon'> = {\n autoClose: 3000,\n label: '',\n closable: true,\n data: undefined,\n block: 'start',\n inline: 'end',\n};\n\nexport const TUI_ALERT_OPTIONS = new InjectionToken<TuiAlertOptions>(\n ngDevMode ? 'TUI_ALERT_OPTIONS' : '',\n {\n factory: () => ({\n ...TUI_ALERT_DEFAULT_OPTIONS,\n ...inject(TUI_NOTIFICATION_OPTIONS),\n }),\n },\n);\n\nexport function tuiAlertOptionsProvider(\n options: Partial<TuiAlertOptions>,\n): FactoryProvider {\n return {\n provide: TUI_ALERT_OPTIONS,\n useFactory: (): TuiAlertOptions => ({\n ...TUI_ALERT_DEFAULT_OPTIONS,\n ...(inject(TUI_ALERT_OPTIONS, {optional: true, skipSelf: true}) ||\n inject(TUI_NOTIFICATION_OPTIONS)),\n ...options,\n }),\n };\n}\n","import {inject, Injectable} from '@angular/core';\nimport {TuiNotificationService} from '@taiga-ui/core/directives/notification';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TUI_ALERT_CONCURRENCY, TUI_ALERT_OPTIONS} from './alert.tokens';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiAlertService extends TuiNotificationService<TuiAlertOptions<any>> {\n protected override readonly options = inject(TUI_ALERT_OPTIONS);\n protected override readonly component = TuiAlertComponent;\n\n constructor() {\n super(inject(TUI_ALERT_CONCURRENCY));\n }\n}\n","import {Directive, input} from '@angular/core';\nimport {tuiAsPortal, TuiPortalDirective} from '@taiga-ui/cdk/portals';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TuiAlertService} from './alert.service';\n\n@Directive({\n selector: 'ng-template[tuiAlert]',\n providers: [tuiAsPortal(TuiAlertService)],\n hostDirectives: [\n {\n directive: TuiPortalDirective,\n inputs: ['options: tuiAlertOptions', 'open: tuiAlert'],\n outputs: ['openChange: tuiAlertChange'],\n },\n ],\n})\nexport class TuiAlert<T> {\n public readonly tuiAlertOptions = input<Partial<TuiAlertOptions<T>>>({});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;MAwBa,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;QAUqB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AAErB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAChC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;QAC9B,IAAI,CAAA,IAAA,GAAG,aAAa,EAA2C;QAE/D,IAAG,CAAA,GAAA,GAAG,EAAE,CACvB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK;AAC3B,cAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU;AAC1C,cAAE,IAAI,CAAC,IAAI,CAAC,SAAS;aAExB,IAAI,CACD,SAAS,CAAC,CAAC,SAAS,MAAM,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A,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAShC,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAXpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,SAAS,EAAE,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;AACzC,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,kBAAkB;AAC7B,4BAAA,MAAM,EAAE,CAAC,0BAA0B,EAAE,gBAAgB,CAAC;4BACtD,OAAO,EAAE,CAAC,4BAA4B,CAAC;AAC1C,yBAAA;AACJ,qBAAA;AACJ,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-alert.mjs","sources":["../../../projects/core/components/alert/alert.component.ts","../../../projects/core/components/alert/alert.template.html","../../../projects/core/components/alert/alert.tokens.ts","../../../projects/core/components/alert/alert.service.ts","../../../projects/core/components/alert/alert.directive.ts","../../../projects/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {type TuiPortalContext} from '@taiga-ui/cdk/portals';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiNotification} from '@taiga-ui/core/components/notification';\nimport {TuiNotificationDirective} from '@taiga-ui/core/directives';\nimport {TuiTitle} from '@taiga-ui/core/directives/title';\nimport {TUI_CLOSE_WORD, TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {EMPTY, fromEvent, of, repeat, switchMap, takeUntil, timer} from 'rxjs';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\n\n@Component({\n selector: 'tui-alert',\n imports: [PolymorpheusOutlet, TuiButton, TuiNotification, TuiTitle],\n templateUrl: './alert.template.html',\n styleUrl: './alert.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiAnimated, TuiNotificationDirective],\n host: {role: 'alert'},\n})\nexport class TuiAlertComponent<O, I> {\n private readonly el = tuiInjectElement();\n\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly close = inject(TUI_CLOSE_WORD);\n protected readonly item = injectContext<TuiPortalContext<TuiAlertOptions<I>, O>>();\n\n protected readonly sub = of(\n typeof this.item.autoClose === 'function'\n ? this.item.autoClose(this.item.appearance)\n : this.item.autoClose,\n )\n .pipe(\n switchMap((autoClose) => (autoClose ? timer(autoClose) : EMPTY)),\n takeUntil(fromEvent(this.el, 'mouseenter')),\n repeat({delay: () => fromEvent(this.el, 'mouseleave')}),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.item.$implicit.complete());\n}\n","<div class=\"t-wrapper\">\n <tui-notification\n size=\"m\"\n [appearance]=\"item.appearance\"\n [class.t-closable]=\"item.closable\"\n [icon]=\"item.icon\"\n >\n <span tuiTitle>\n <ng-container *polymorpheusOutlet=\"item.label as text; context: item\">\n {{ text }}\n </ng-container>\n <span tuiSubtitle>\n <span\n *polymorpheusOutlet=\"item.content as text; context: item\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n </span>\n @if (item.closable) {\n <button\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click)=\"item.$implicit.complete()\"\n >\n {{ close() }}\n </button>\n }\n </tui-notification>\n</div>\n","import {type FactoryProvider, inject, InjectionToken} from '@angular/core';\nimport {tuiCreateToken} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\n\nexport const TUI_ALERT_CONCURRENCY = tuiCreateToken<number>(5);\n\nexport const TUI_ALERT_DEFAULT_OPTIONS: Omit<TuiAlertOptions, 'appearance' | 'icon'> = {\n autoClose: 3000,\n label: '',\n closable: true,\n data: undefined,\n block: 'start',\n inline: 'end',\n};\n\nexport const TUI_ALERT_OPTIONS = new InjectionToken<TuiAlertOptions>(\n ngDevMode ? 'TUI_ALERT_OPTIONS' : '',\n {\n factory: () => ({\n ...TUI_ALERT_DEFAULT_OPTIONS,\n ...inject(TUI_NOTIFICATION_OPTIONS),\n }),\n },\n);\n\nexport function tuiAlertOptionsProvider(\n options: Partial<TuiAlertOptions>,\n): FactoryProvider {\n return {\n provide: TUI_ALERT_OPTIONS,\n useFactory: (): TuiAlertOptions => ({\n ...TUI_ALERT_DEFAULT_OPTIONS,\n ...(inject(TUI_ALERT_OPTIONS, {optional: true, skipSelf: true}) ||\n inject(TUI_NOTIFICATION_OPTIONS)),\n ...options,\n }),\n };\n}\n","import {inject, Injectable} from '@angular/core';\nimport {TuiNotificationService} from '@taiga-ui/core/directives/notification';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TUI_ALERT_CONCURRENCY, TUI_ALERT_OPTIONS} from './alert.tokens';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiAlertService extends TuiNotificationService<TuiAlertOptions<any>> {\n protected override readonly options = inject(TUI_ALERT_OPTIONS);\n protected override readonly component = TuiAlertComponent;\n\n constructor() {\n super(inject(TUI_ALERT_CONCURRENCY));\n }\n}\n","import {Directive, input} from '@angular/core';\nimport {tuiAsPortal, TuiPortalDirective} from '@taiga-ui/cdk/portals';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TuiAlertService} from './alert.service';\n\n@Directive({\n selector: 'ng-template[tuiAlert]',\n providers: [tuiAsPortal(TuiAlertService)],\n hostDirectives: [\n {\n directive: TuiPortalDirective,\n inputs: ['options: tuiAlertOptions', 'open: tuiAlert'],\n outputs: ['openChange: tuiAlertChange'],\n },\n ],\n})\nexport class TuiAlert<T> {\n public readonly tuiAlertOptions = input<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AAU,EAAE,MAAM;AACrB,iBAAA;;;MCQY,QAAQ,CAAA;AAXrB,IAAA,WAAA,GAAA;AAYoB,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAA8B,EAAE,CAAC;AAC3E;+GAFY,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAR,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,QAAQ,sOATN,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAShC,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAXpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,SAAS,EAAE,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;AACzC,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,kBAAkB;AAC7B,4BAAA,MAAM,EAAE,CAAC,0BAA0B,EAAE,gBAAgB,CAAC;4BACtD,OAAO,EAAE,CAAC,4BAA4B,CAAC;AAC1C,yBAAA;AACJ,qBAAA;AACJ,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Injectable, ChangeDetectionStrategy, ViewEncapsulation, Component, input, Directive, assertInInjectionContext, INJECTOR } from '@angular/core';
|
|
3
|
-
import { takeUntilDestroyed
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
5
5
|
import * as i1 from '@taiga-ui/cdk/directives/animated';
|
|
6
|
-
import { TuiAnimated
|
|
6
|
+
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
7
7
|
import { TuiAutoFocus } from '@taiga-ui/cdk/directives/auto-focus';
|
|
8
8
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
9
|
-
import { TuiHeader, tuiHeaderOptionsProvider } from '@taiga-ui/core/components/header';
|
|
10
9
|
import { TuiTitle } from '@taiga-ui/core/directives/title';
|
|
11
10
|
import { TUI_CLOSE_WORD, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
|
|
12
11
|
import { injectContext, PolymorpheusOutlet, PolymorpheusComponent } from '@taiga-ui/polymorpheus';
|
|
13
|
-
import {
|
|
12
|
+
import { filter, Observable, merge, switchMap, take, map, of, isObservable, Subject, exhaustMap } from 'rxjs';
|
|
14
13
|
import { DOCUMENT } from '@angular/common';
|
|
15
14
|
import { Router, ActivationStart } from '@angular/router';
|
|
16
15
|
import { WA_WINDOW } from '@ng-web-apis/common';
|
|
@@ -21,15 +20,7 @@ import * as i1$1 from '@taiga-ui/cdk/portals';
|
|
|
21
20
|
import { tuiAsPortal, TuiPortalDirective } from '@taiga-ui/cdk/portals';
|
|
22
21
|
import { TuiModalService } from '@taiga-ui/core/components/modal';
|
|
23
22
|
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
24
|
-
import { TuiFocusTrap } from '@taiga-ui/cdk/directives/focus-trap';
|
|
25
|
-
import { TuiScrollControls, TuiScrollRef } from '@taiga-ui/core/components/scrollbar';
|
|
26
|
-
import * as i1$2 from '@taiga-ui/cdk/directives/active-zone';
|
|
27
|
-
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
28
|
-
import { tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
29
23
|
|
|
30
|
-
const TUI_DIALOGS = new InjectionToken(ngDevMode ? 'TUI_DIALOGS' : '', {
|
|
31
|
-
factory: () => new BehaviorSubject([]),
|
|
32
|
-
});
|
|
33
24
|
const TUI_DIALOGS_CLOSE = new InjectionToken(ngDevMode ? 'TUI_DIALOGS_CLOSE' : '', {
|
|
34
25
|
factory: () => inject(Router).events.pipe(filter((e) => e instanceof ActivationStart)),
|
|
35
26
|
});
|
|
@@ -87,28 +78,17 @@ class TuiDialogComponent {
|
|
|
87
78
|
});
|
|
88
79
|
}
|
|
89
80
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
90
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiDialogComponent, isStandalone: true, selector: "tui-dialog", host: { properties: { "attr.data-appearance": "context.appearance", "attr.data-size": "context.size", "class._closable": "context.closable" } }, providers: [
|
|
91
|
-
TuiDialogCloseService,
|
|
92
|
-
tuiHeaderOptionsProvider(() => ({ size: getSize(injectContext()) })),
|
|
93
|
-
], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "@if (context.closable) {\n <button\n size=\"s\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [appearance]=\"context.appearance.includes('fullscreen') ? 'action' : 'neutral'\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"close$.next()\"\n (mousedown.prevent.zoneless)=\"(0)\"\n >\n {{ close() }}\n </button>\n}\n\n@if (!primitive && context.label) {\n <header tuiHeader>\n <hgroup tuiTitle>\n <h2\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></h2>\n </hgroup>\n </header>\n}\n\n<ng-container *polymorpheusOutlet=\"context.content as text; context: context\">\n <header tuiHeader>\n <hgroup tuiTitle>\n <h2\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></h2>\n <p [innerHTML]=\"text\"></p>\n </hgroup>\n </header>\n @if (context.closable || context.dismissible) {\n <footer>\n <button\n size=\"m\"\n tuiAutoFocus\n tuiButton\n type=\"button\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ context.data || 'OK' }}\n </button>\n </footer>\n }\n</ng-container>\n", styles: ["tui-dialog{position:relative;box-sizing:border-box;font:var(--tui-font-text-m);background:var(--tui-background-elevation-1);box-shadow:var(--tui-shadow-popup)}tui-dialog:not([data-appearance~=fullscreen])._closable>header,tui-dialog:not([data-appearance~=fullscreen])._closable>ng-component>header{padding-inline-end:2.5rem}tui-dialog>.t-close{position:absolute;top:1rem;z-index:1;inset-inline-end:1rem}tui-dialog[data-appearance~=taiga]{max-inline-size:calc(100vw - 5rem);margin:2.5rem;padding:1.75rem;border-radius:1.5rem;--tui-from: translateY(2.5rem)}tui-dialog[data-appearance~=taiga].tui-enter,tui-dialog[data-appearance~=taiga].tui-leave{animation-name:tuiFade,tuiSlide}tui-dialog[data-appearance~=taiga][data-size=s]{inline-size:25rem;padding:1.5rem}tui-dialog[data-appearance~=taiga][data-size=s]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>header:not(:last-child){margin-block-end:1.25rem}tui-dialog[data-appearance~=taiga][data-size=s]>footer,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>footer,tui-dialog[data-appearance~=taiga][data-size=s]>tui-confirm>footer{margin-block-start:1.25rem}tui-dialog[data-appearance~=taiga][data-size=m]{inline-size:37.5rem}tui-dialog[data-appearance~=taiga][data-size=l]{inline-size:50rem}tui-dialog[data-appearance~=taiga]>header:not(:last-child),tui-dialog[data-appearance~=taiga]>ng-component>header:not(:last-child){margin-block-end:1.5rem}tui-dialog[data-appearance~=taiga]>footer,tui-dialog[data-appearance~=taiga]>ng-component>footer,tui-dialog[data-appearance~=taiga]>tui-confirm>footer{display:flex;justify-content:flex-end;flex-wrap:wrap-reverse;gap:.75rem;margin-block-start:2rem}tui-dialog[data-appearance~=fullscreen]{display:flex;flex-direction:column;block-size:100%;inline-size:100%;padding:env(safe-area-inset-top) max(calc(50vw - var(--tui-width) / 2),1rem) max(2rem,env(safe-area-inset-bottom));background:var(--tui-background-base);box-shadow:none;--tui-width: 45rem;--tui-from: translateY(2rem)}tui-dialog[data-appearance~=fullscreen].tui-enter,tui-dialog[data-appearance~=fullscreen].tui-leave{animation-name:tuiFade,tuiSlide}tui-dialog[data-appearance~=fullscreen]>.t-close{position:sticky;top:env(safe-area-inset-top);block-size:4rem;inline-size:auto;align-self:flex-end;margin-block-end:2rem;border-radius:0!important;font:var(--tui-font-text-m)!important;border-image:conic-gradient(var(--tui-background-base) 0 0) fill 0 / 0 / env(safe-area-inset-top) 100vw 0}tui-dialog[data-appearance~=fullscreen]>.t-close:before{display:none}tui-dialog[data-appearance~=fullscreen].tui-app-bar .t-close{display:none}tui-dialog[data-appearance~=fullscreen]:not(._closable):not(.tui-app-bar):before{content:\"\";block-size:1.5rem}tui-dialog[data-appearance~=fullscreen]>tui-app-bar,tui-dialog[data-appearance~=fullscreen]>ng-component>tui-app-bar{position:sticky;top:0;z-index:1;order:-1;border-inline-end:calc(50vw - var(--tui-width) / 2) solid transparent;border-inline-start:calc(50vw - var(--tui-width) / 2) solid transparent;margin:0 calc(var(--tui-width) / 2 - 50vw) 2rem}tui-dialog[data-appearance~=fullscreen]>header,tui-dialog[data-appearance~=fullscreen]>[tuiSlides]>*>header,tui-dialog[data-appearance~=fullscreen]>ng-component>header,tui-dialog[data-appearance~=fullscreen]>ng-component>[tuiSlides]>*>header{margin-block-end:2rem}tui-dialog[data-appearance~=fullscreen]>footer,tui-dialog[data-appearance~=fullscreen]>ng-component>footer{display:flex;gap:.5rem .75rem;padding:2rem calc(50vw - var(--tui-width) / 2);margin:0 calc(var(--tui-width) / 2 - 50vw) calc(-2rem - env(safe-area-inset-top))}tui-dialog[data-appearance~=fullscreen]>footer:before,tui-dialog[data-appearance~=fullscreen]>ng-component>footer:before{left:0;right:0}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>footer,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>ng-component>footer{flex-direction:row;background:color-mix(in hsl,var(--tui-background-base) 80%,transparent);-webkit-backdrop-filter:blur(2rem);backdrop-filter:blur(2rem)}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>footer:before,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>ng-component>footer:before{display:none}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>footer>button,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>ng-component>footer>button,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>footer>a,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen]>ng-component>footer>a{inline-size:auto}tui-root._mobile tui-dialog[data-appearance~=fullscreen]{padding-block-end:max(1rem,env(safe-area-inset-bottom));--tui-from: translateY(4rem)}tui-root._mobile tui-dialog[data-appearance~=fullscreen] .t-close{align-self:flex-start;block-size:3.5rem;margin-block-end:1rem}tui-root._mobile tui-dialog[data-appearance~=fullscreen]>tui-app-bar,tui-root._mobile tui-dialog[data-appearance~=fullscreen]>ng-component>tui-app-bar{margin:calc(-1*env(safe-area-inset-top)) -1rem 1rem;padding-block-start:env(safe-area-inset-top);box-sizing:content-box}tui-root._mobile tui-dialog[data-appearance~=fullscreen]>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen]>[tuiSlides]>*>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen]>ng-component>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen]>ng-component>[tuiSlides]>*>header{margin:-.25rem 0 1.5rem}tui-root._mobile tui-dialog[data-appearance~=fullscreen]>footer,tui-root._mobile tui-dialog[data-appearance~=fullscreen]>ng-component>footer{padding:0 1rem max(1rem,env(safe-area-inset-bottom));margin:1.5rem -1rem calc(-1*max(1rem,env(safe-area-inset-bottom)))}tui-modal:has(tui-dialog[data-appearance~=fullscreen]){-webkit-backdrop-filter:none!important;backdrop-filter:none!important;animation:none!important}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiHeader, selector: "[tuiHeader]", inputs: ["tuiHeader"] }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
81
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiDialogComponent, isStandalone: true, selector: "tui-dialog", host: { properties: { "attr.data-appearance": "context.appearance", "attr.data-size": "context.size", "class._closable": "context.closable", "class.tui-backdrop-hidden": "context.appearance.includes(\"fullscreen\")" } }, providers: [TuiDialogCloseService], hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "@if (context.closable) {\n <button\n size=\"s\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [appearance]=\"context.appearance.includes('fullscreen') ? 'action' : 'neutral'\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"close$.next()\"\n (mousedown.prevent.zoneless)=\"(0)\"\n >\n {{ close() }}\n </button>\n}\n\n@if (!primitive && context.label) {\n <header>\n <hgroup tuiTitle>\n <h2\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></h2>\n </hgroup>\n </header>\n}\n\n<ng-container *polymorpheusOutlet=\"context.content as text; context: context\">\n <header>\n <hgroup tuiTitle>\n <h2\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></h2>\n <p [innerHTML]=\"text\"></p>\n </hgroup>\n </header>\n @if (context.closable || context.dismissible) {\n <footer>\n <button\n size=\"m\"\n tuiAutoFocus\n tuiButton\n type=\"button\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ context.data || 'OK' }}\n </button>\n </footer>\n }\n</ng-container>\n", styles: ["tui-dialog{position:relative;box-sizing:border-box;font:var(--tui-font-text-m);background:var(--tui-background-elevation-1);box-shadow:var(--tui-shadow-popup)}tui-dialog:not([data-appearance~=fullscreen])._closable>header,tui-dialog:not([data-appearance~=fullscreen])._closable>ng-component>header{padding-inline-end:2.5rem}tui-dialog>header,tui-dialog>ng-component>header{font:var(--tui-font-heading-5)}tui-dialog>header [tuiTitle],tui-dialog>ng-component>header [tuiTitle]{font:inherit}tui-dialog>header p,tui-dialog>ng-component>header p{margin:.25rem 0 0;font:var(--tui-font-text-m)}tui-dialog>header p:empty,tui-dialog>ng-component>header p:empty{display:none}tui-dialog>.t-close{position:absolute;top:1rem;z-index:1;inset-inline-end:1rem}tui-dialog[data-appearance~=taiga]{max-inline-size:calc(100vw - 5rem);margin:2.5rem;padding:1.75rem;border-radius:1.5rem;--tui-from: translateY(2.5rem)}tui-dialog[data-appearance~=taiga].tui-enter,tui-dialog[data-appearance~=taiga].tui-leave{animation-name:tuiFade,tuiSlide}tui-dialog[data-appearance~=taiga][data-size=s]{inline-size:25rem;padding:1.5rem}tui-dialog[data-appearance~=taiga][data-size=s]>header,tui-dialog[data-appearance~=taiga][data-size=s]>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>header,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>[tuiSlides]>*>header{font:var(--tui-font-heading-5)}tui-dialog[data-appearance~=taiga][data-size=s]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>[tuiSlides]>*>header:not(:last-child){margin-block-end:1.25rem}tui-dialog[data-appearance~=taiga][data-size=s]>footer,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>footer{margin-block-start:1.25rem}tui-dialog[data-appearance~=taiga][data-size=m],tui-dialog[data-appearance~=taiga][data-size=l]{inline-size:37.5rem}tui-dialog[data-appearance~=taiga][data-size=m]>header,tui-dialog[data-appearance~=taiga][data-size=l]>header,tui-dialog[data-appearance~=taiga][data-size=m]>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=l]>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>header,tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>header,tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>[tuiSlides]>*>header{font:var(--tui-font-heading-4)}tui-dialog[data-appearance~=taiga][data-size=m]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=m]>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>[tuiSlides]>*>header:not(:last-child){margin-block-end:1.5rem}tui-dialog[data-appearance~=taiga][data-size=l]{inline-size:50rem}tui-dialog[data-appearance~=taiga]>footer,tui-dialog[data-appearance~=taiga]>ng-component>footer{display:flex;justify-content:flex-end;flex-wrap:wrap-reverse;gap:.75rem;margin-block-start:2rem}tui-dialog[data-appearance~=fullscreen][data-size]{display:flex;flex-direction:column;block-size:100%;inline-size:100%;padding:env(safe-area-inset-top) max(calc(50vw - var(--tui-width) / 2),1rem) max(2rem,env(safe-area-inset-bottom));background:var(--tui-background-base);box-shadow:none;--tui-width: 45rem;--tui-from: translateY(2rem)}tui-dialog[data-appearance~=fullscreen][data-size].tui-enter,tui-dialog[data-appearance~=fullscreen][data-size].tui-leave{animation-name:tuiFade,tuiSlide}tui-dialog[data-appearance~=fullscreen][data-size]>.t-close{position:sticky;top:env(safe-area-inset-top);block-size:4rem;inline-size:auto;align-self:flex-end;margin-block-end:2rem;border-radius:0!important;font:var(--tui-font-text-m)!important;border-image:conic-gradient(var(--tui-background-base) 0 0) fill 0 / 0 / env(safe-area-inset-top) 100vw 0}tui-dialog[data-appearance~=fullscreen][data-size]>.t-close:before{display:none}tui-dialog[data-appearance~=fullscreen][data-size].tui-app-bar .t-close{display:none}tui-dialog[data-appearance~=fullscreen][data-size]:not(._closable):not(.tui-app-bar):before{content:\"\";block-size:1.5rem}tui-dialog[data-appearance~=fullscreen][data-size]>tui-app-bar,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>tui-app-bar{position:sticky;top:0;z-index:1;order:-1;border-inline-end:calc(50vw - var(--tui-width) / 2) solid transparent;border-inline-start:calc(50vw - var(--tui-width) / 2) solid transparent;margin:0 calc(var(--tui-width) / 2 - 50vw) 2rem}tui-dialog[data-appearance~=fullscreen][data-size]>header,tui-dialog[data-appearance~=fullscreen][data-size]>[tuiSlides]>*>header,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>header,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>[tuiSlides]>*>header{font:var(--tui-font-heading-3);margin-block-end:2rem}tui-dialog[data-appearance~=fullscreen][data-size]>footer,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer{display:flex;gap:.5rem .75rem;padding:2rem calc(50vw - var(--tui-width) / 2);margin:0 calc(var(--tui-width) / 2 - 50vw) calc(-2rem - env(safe-area-inset-top))}tui-dialog[data-appearance~=fullscreen][data-size]>footer:before,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer:before{left:0;right:0}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer{flex-direction:row;background:color-mix(in hsl,var(--tui-background-base) 80%,transparent);-webkit-backdrop-filter:blur(2rem);backdrop-filter:blur(2rem)}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer:before,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer:before{display:none}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer>button,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer>button,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer>a,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer>a{inline-size:auto}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]{padding-block-end:max(1rem,env(safe-area-inset-bottom));--tui-from: translateY(4rem)}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size] .t-close{align-self:flex-start;block-size:3.5rem;margin-block-end:1rem}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>tui-app-bar,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>tui-app-bar{margin:calc(-1*env(safe-area-inset-top)) -1rem 1rem;padding-block-start:env(safe-area-inset-top);box-sizing:content-box}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>[tuiSlides]>*>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>[tuiSlides]>*>header{margin:-.25rem 0 1.5rem}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>footer,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer{padding:0 1rem max(1rem,env(safe-area-inset-bottom));margin:1.5rem -1rem calc(-1*max(1rem,env(safe-area-inset-bottom)))}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
94
82
|
}
|
|
95
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDialogComponent, decorators: [{
|
|
96
84
|
type: Component,
|
|
97
|
-
args: [{ selector: 'tui-dialog', imports: [PolymorpheusOutlet, TuiAutoFocus, TuiButton,
|
|
98
|
-
TuiDialogCloseService,
|
|
99
|
-
tuiHeaderOptionsProvider(() => ({ size: getSize(injectContext()) })),
|
|
100
|
-
], hostDirectives: [TuiAnimated], host: {
|
|
85
|
+
args: [{ selector: 'tui-dialog', imports: [PolymorpheusOutlet, TuiAutoFocus, TuiButton, TuiTitle], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, providers: [TuiDialogCloseService], hostDirectives: [TuiAnimated], host: {
|
|
101
86
|
'[attr.data-appearance]': 'context.appearance',
|
|
102
87
|
'[attr.data-size]': 'context.size',
|
|
103
88
|
'[class._closable]': 'context.closable',
|
|
104
|
-
|
|
89
|
+
'[class.tui-backdrop-hidden]': 'context.appearance.includes("fullscreen")',
|
|
90
|
+
}, template: "@if (context.closable) {\n <button\n size=\"s\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [appearance]=\"context.appearance.includes('fullscreen') ? 'action' : 'neutral'\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"close$.next()\"\n (mousedown.prevent.zoneless)=\"(0)\"\n >\n {{ close() }}\n </button>\n}\n\n@if (!primitive && context.label) {\n <header>\n <hgroup tuiTitle>\n <h2\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></h2>\n </hgroup>\n </header>\n}\n\n<ng-container *polymorpheusOutlet=\"context.content as text; context: context\">\n <header>\n <hgroup tuiTitle>\n <h2\n [id]=\"context.id\"\n [innerHTML]=\"context.label\"\n ></h2>\n <p [innerHTML]=\"text\"></p>\n </hgroup>\n </header>\n @if (context.closable || context.dismissible) {\n <footer>\n <button\n size=\"m\"\n tuiAutoFocus\n tuiButton\n type=\"button\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ context.data || 'OK' }}\n </button>\n </footer>\n }\n</ng-container>\n", styles: ["tui-dialog{position:relative;box-sizing:border-box;font:var(--tui-font-text-m);background:var(--tui-background-elevation-1);box-shadow:var(--tui-shadow-popup)}tui-dialog:not([data-appearance~=fullscreen])._closable>header,tui-dialog:not([data-appearance~=fullscreen])._closable>ng-component>header{padding-inline-end:2.5rem}tui-dialog>header,tui-dialog>ng-component>header{font:var(--tui-font-heading-5)}tui-dialog>header [tuiTitle],tui-dialog>ng-component>header [tuiTitle]{font:inherit}tui-dialog>header p,tui-dialog>ng-component>header p{margin:.25rem 0 0;font:var(--tui-font-text-m)}tui-dialog>header p:empty,tui-dialog>ng-component>header p:empty{display:none}tui-dialog>.t-close{position:absolute;top:1rem;z-index:1;inset-inline-end:1rem}tui-dialog[data-appearance~=taiga]{max-inline-size:calc(100vw - 5rem);margin:2.5rem;padding:1.75rem;border-radius:1.5rem;--tui-from: translateY(2.5rem)}tui-dialog[data-appearance~=taiga].tui-enter,tui-dialog[data-appearance~=taiga].tui-leave{animation-name:tuiFade,tuiSlide}tui-dialog[data-appearance~=taiga][data-size=s]{inline-size:25rem;padding:1.5rem}tui-dialog[data-appearance~=taiga][data-size=s]>header,tui-dialog[data-appearance~=taiga][data-size=s]>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>header,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>[tuiSlides]>*>header{font:var(--tui-font-heading-5)}tui-dialog[data-appearance~=taiga][data-size=s]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>[tuiSlides]>*>header:not(:last-child){margin-block-end:1.25rem}tui-dialog[data-appearance~=taiga][data-size=s]>footer,tui-dialog[data-appearance~=taiga][data-size=s]>ng-component>footer{margin-block-start:1.25rem}tui-dialog[data-appearance~=taiga][data-size=m],tui-dialog[data-appearance~=taiga][data-size=l]{inline-size:37.5rem}tui-dialog[data-appearance~=taiga][data-size=m]>header,tui-dialog[data-appearance~=taiga][data-size=l]>header,tui-dialog[data-appearance~=taiga][data-size=m]>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=l]>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>header,tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>header,tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>[tuiSlides]>*>header,tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>[tuiSlides]>*>header{font:var(--tui-font-heading-4)}tui-dialog[data-appearance~=taiga][data-size=m]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=m]>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=m]>ng-component>[tuiSlides]>*>header:not(:last-child),tui-dialog[data-appearance~=taiga][data-size=l]>ng-component>[tuiSlides]>*>header:not(:last-child){margin-block-end:1.5rem}tui-dialog[data-appearance~=taiga][data-size=l]{inline-size:50rem}tui-dialog[data-appearance~=taiga]>footer,tui-dialog[data-appearance~=taiga]>ng-component>footer{display:flex;justify-content:flex-end;flex-wrap:wrap-reverse;gap:.75rem;margin-block-start:2rem}tui-dialog[data-appearance~=fullscreen][data-size]{display:flex;flex-direction:column;block-size:100%;inline-size:100%;padding:env(safe-area-inset-top) max(calc(50vw - var(--tui-width) / 2),1rem) max(2rem,env(safe-area-inset-bottom));background:var(--tui-background-base);box-shadow:none;--tui-width: 45rem;--tui-from: translateY(2rem)}tui-dialog[data-appearance~=fullscreen][data-size].tui-enter,tui-dialog[data-appearance~=fullscreen][data-size].tui-leave{animation-name:tuiFade,tuiSlide}tui-dialog[data-appearance~=fullscreen][data-size]>.t-close{position:sticky;top:env(safe-area-inset-top);block-size:4rem;inline-size:auto;align-self:flex-end;margin-block-end:2rem;border-radius:0!important;font:var(--tui-font-text-m)!important;border-image:conic-gradient(var(--tui-background-base) 0 0) fill 0 / 0 / env(safe-area-inset-top) 100vw 0}tui-dialog[data-appearance~=fullscreen][data-size]>.t-close:before{display:none}tui-dialog[data-appearance~=fullscreen][data-size].tui-app-bar .t-close{display:none}tui-dialog[data-appearance~=fullscreen][data-size]:not(._closable):not(.tui-app-bar):before{content:\"\";block-size:1.5rem}tui-dialog[data-appearance~=fullscreen][data-size]>tui-app-bar,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>tui-app-bar{position:sticky;top:0;z-index:1;order:-1;border-inline-end:calc(50vw - var(--tui-width) / 2) solid transparent;border-inline-start:calc(50vw - var(--tui-width) / 2) solid transparent;margin:0 calc(var(--tui-width) / 2 - 50vw) 2rem}tui-dialog[data-appearance~=fullscreen][data-size]>header,tui-dialog[data-appearance~=fullscreen][data-size]>[tuiSlides]>*>header,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>header,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>[tuiSlides]>*>header{font:var(--tui-font-heading-3);margin-block-end:2rem}tui-dialog[data-appearance~=fullscreen][data-size]>footer,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer{display:flex;gap:.5rem .75rem;padding:2rem calc(50vw - var(--tui-width) / 2);margin:0 calc(var(--tui-width) / 2 - 50vw) calc(-2rem - env(safe-area-inset-top))}tui-dialog[data-appearance~=fullscreen][data-size]>footer:before,tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer:before{left:0;right:0}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer{flex-direction:row;background:color-mix(in hsl,var(--tui-background-base) 80%,transparent);-webkit-backdrop-filter:blur(2rem);backdrop-filter:blur(2rem)}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer:before,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer:before{display:none}tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer>button,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer>button,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>footer>a,tui-root:not(._mobile) tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer>a{inline-size:auto}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]{padding-block-end:max(1rem,env(safe-area-inset-bottom));--tui-from: translateY(4rem)}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size] .t-close{align-self:flex-start;block-size:3.5rem;margin-block-end:1rem}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>tui-app-bar,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>tui-app-bar{margin:calc(-1*env(safe-area-inset-top)) -1rem 1rem;padding-block-start:env(safe-area-inset-top);box-sizing:content-box}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>[tuiSlides]>*>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>header,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>[tuiSlides]>*>header{margin:-.25rem 0 1.5rem}tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>footer,tui-root._mobile tui-dialog[data-appearance~=fullscreen][data-size]>ng-component>footer{padding:0 1rem max(1rem,env(safe-area-inset-bottom));margin:1.5rem -1rem calc(-1*max(1rem,env(safe-area-inset-bottom)))}\n"] }]
|
|
105
91
|
}] });
|
|
106
|
-
function getSize({ appearance, size }) {
|
|
107
|
-
if (appearance.includes('fullscreen')) {
|
|
108
|
-
return 'h3';
|
|
109
|
-
}
|
|
110
|
-
return size === 's' ? 'h5' : 'h4';
|
|
111
|
-
}
|
|
112
92
|
|
|
113
93
|
const [TUI_DIALOG_OPTIONS, tuiDialogOptionsProvider] = tuiCreateOptions({
|
|
114
94
|
appearance: 'taiga',
|
|
@@ -170,57 +150,9 @@ function tuiDialog(component, { injector, ...options } = {}) {
|
|
|
170
150
|
});
|
|
171
151
|
}
|
|
172
152
|
|
|
173
|
-
class TuiActiveZoneAdapter {
|
|
174
|
-
constructor() {
|
|
175
|
-
this.current = inject(TuiActiveZone);
|
|
176
|
-
this.parent = findActive(inject(TuiActiveZone, { skipSelf: true }), tuiGetFocused(inject(DOCUMENT)));
|
|
177
|
-
}
|
|
178
|
-
ngOnInit() {
|
|
179
|
-
this.current.tuiActiveZoneParentSetter = this.parent;
|
|
180
|
-
}
|
|
181
|
-
ngOnDestroy() {
|
|
182
|
-
this.current.tuiActiveZoneParentSetter = null;
|
|
183
|
-
}
|
|
184
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiActiveZoneAdapter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
185
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiActiveZoneAdapter, isStandalone: true, selector: "[tuiActiveZoneAdapter]", hostDirectives: [{ directive: i1$2.TuiActiveZone }], ngImport: i0 }); }
|
|
186
|
-
}
|
|
187
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiActiveZoneAdapter, decorators: [{
|
|
188
|
-
type: Directive,
|
|
189
|
-
args: [{
|
|
190
|
-
selector: '[tuiActiveZoneAdapter]',
|
|
191
|
-
hostDirectives: [TuiActiveZone],
|
|
192
|
-
}]
|
|
193
|
-
}] });
|
|
194
|
-
function findActive(zone, el) {
|
|
195
|
-
if (!el || !zone.contains(el)) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
const active = zone.children.find((child) => !child['el'].matches('[tuiActiveZoneAdapter]') && child.contains(el));
|
|
199
|
-
return active ? findActive(active, el) : zone;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
class TuiDialogs {
|
|
203
|
-
constructor() {
|
|
204
|
-
this.dialogs = toSignal(inject(TUI_DIALOGS), { initialValue: [] });
|
|
205
|
-
}
|
|
206
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDialogs, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
207
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiDialogs, isStandalone: true, selector: "tui-dialogs", ngImport: i0, template: "<div\n class=\"t-overlay\"\n [class.t-overlay_visible]=\"dialogs().length\"\n></div>\n<!--TODO: Rename to <article> in v5-->\n@for (item of dialogs(); track item) {\n <section\n aria-modal=\"true\"\n role=\"dialog\"\n tuiActiveZoneAdapter\n tuiAnimatedParent\n tuiFocusTrap\n tuiScrollRef\n class=\"t-dialog\"\n [attr.aria-labelledby]=\"item.id\"\n >\n <ng-container *polymorpheusOutlet=\"item.component; context: item\" />\n <tui-scroll-controls class=\"t-scrollbars\" />\n </section>\n}\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;scrollbar-width:none;-ms-overflow-style:none;pointer-events:none;overflow:hidden;overscroll-behavior:none;overflow-wrap:break-word;margin-block-start:var(--t-root-top)}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host:has(section){pointer-events:auto;overflow:auto}:host:has(section:only-of-type ::ng-deep tui-dialog[data-appearance~=fullscreen])>.t-overlay,:host:has(section:only-of-type ::ng-deep tui-notification-middle)>.t-overlay{opacity:0}:host:before{content:\"\";display:block;block-size:200%}.t-overlay,.t-dialog{transition-property:filter;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;scrollbar-width:none;-ms-overflow-style:none;position:fixed;top:0;left:0;bottom:0;right:0;display:flex;block-size:100%;align-items:flex-start;outline:none;overflow:auto}.t-overlay::-webkit-scrollbar,.t-dialog::-webkit-scrollbar,.t-overlay::-webkit-scrollbar-thumb,.t-dialog::-webkit-scrollbar-thumb{display:none}.t-dialog{position:sticky;display:grid;place-items:center;overscroll-behavior:none;filter:brightness(.25)}.t-dialog ::ng-deep>.tui-enter+.t-scrollbars .t-bar_vertical,.t-dialog ::ng-deep>.tui-leave+.t-scrollbars .t-bar_vertical{display:none}.t-overlay{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;background:var(--tui-service-backdrop);-webkit-backdrop-filter:var(--tui-backdrop, none);backdrop-filter:var(--tui-backdrop, none);opacity:0;transition-timing-function:ease-in}.t-overlay_visible{opacity:1;transition-timing-function:ease-out}.t-dialog:last-child{pointer-events:auto;filter:none}.t-scrollbars{position:fixed;top:0;left:0;bottom:0;right:0;margin:0;color:#747474}.t-scrollbars ::ng-deep .t-bar_horizontal,.t-scrollbars ::ng-deep .t-bar_vertical .t-thumb[style*=\"height: 100%\"]{display:none}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiActiveZoneAdapter, selector: "[tuiActiveZoneAdapter]" }, { kind: "directive", type: TuiAnimatedParent, selector: "[tuiAnimatedParent]" }, { kind: "directive", type: TuiFocusTrap, selector: "[tuiFocusTrap]" }, { kind: "component", type: TuiScrollControls, selector: "tui-scroll-controls" }, { kind: "directive", type: TuiScrollRef, selector: "[tuiScrollRef]" }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
208
|
-
}
|
|
209
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDialogs, decorators: [{
|
|
210
|
-
type: Component,
|
|
211
|
-
args: [{ selector: 'tui-dialogs', imports: [
|
|
212
|
-
PolymorpheusOutlet,
|
|
213
|
-
TuiActiveZoneAdapter,
|
|
214
|
-
TuiAnimatedParent,
|
|
215
|
-
TuiFocusTrap,
|
|
216
|
-
TuiScrollControls,
|
|
217
|
-
TuiScrollRef,
|
|
218
|
-
], changeDetection: ChangeDetectionStrategy.Default, template: "<div\n class=\"t-overlay\"\n [class.t-overlay_visible]=\"dialogs().length\"\n></div>\n<!--TODO: Rename to <article> in v5-->\n@for (item of dialogs(); track item) {\n <section\n aria-modal=\"true\"\n role=\"dialog\"\n tuiActiveZoneAdapter\n tuiAnimatedParent\n tuiFocusTrap\n tuiScrollRef\n class=\"t-dialog\"\n [attr.aria-labelledby]=\"item.id\"\n >\n <ng-container *polymorpheusOutlet=\"item.component; context: item\" />\n <tui-scroll-controls class=\"t-scrollbars\" />\n </section>\n}\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;scrollbar-width:none;-ms-overflow-style:none;pointer-events:none;overflow:hidden;overscroll-behavior:none;overflow-wrap:break-word;margin-block-start:var(--t-root-top)}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host:has(section){pointer-events:auto;overflow:auto}:host:has(section:only-of-type ::ng-deep tui-dialog[data-appearance~=fullscreen])>.t-overlay,:host:has(section:only-of-type ::ng-deep tui-notification-middle)>.t-overlay{opacity:0}:host:before{content:\"\";display:block;block-size:200%}.t-overlay,.t-dialog{transition-property:filter;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;scrollbar-width:none;-ms-overflow-style:none;position:fixed;top:0;left:0;bottom:0;right:0;display:flex;block-size:100%;align-items:flex-start;outline:none;overflow:auto}.t-overlay::-webkit-scrollbar,.t-dialog::-webkit-scrollbar,.t-overlay::-webkit-scrollbar-thumb,.t-dialog::-webkit-scrollbar-thumb{display:none}.t-dialog{position:sticky;display:grid;place-items:center;overscroll-behavior:none;filter:brightness(.25)}.t-dialog ::ng-deep>.tui-enter+.t-scrollbars .t-bar_vertical,.t-dialog ::ng-deep>.tui-leave+.t-scrollbars .t-bar_vertical{display:none}.t-overlay{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;background:var(--tui-service-backdrop);-webkit-backdrop-filter:var(--tui-backdrop, none);backdrop-filter:var(--tui-backdrop, none);opacity:0;transition-timing-function:ease-in}.t-overlay_visible{opacity:1;transition-timing-function:ease-out}.t-dialog:last-child{pointer-events:auto;filter:none}.t-scrollbars{position:fixed;top:0;left:0;bottom:0;right:0;margin:0;color:#747474}.t-scrollbars ::ng-deep .t-bar_horizontal,.t-scrollbars ::ng-deep .t-bar_vertical .t-thumb[style*=\"height: 100%\"]{display:none}\n"] }]
|
|
219
|
-
}] });
|
|
220
|
-
|
|
221
153
|
/**
|
|
222
154
|
* Generated bundle index. Do not edit.
|
|
223
155
|
*/
|
|
224
156
|
|
|
225
|
-
export {
|
|
157
|
+
export { TUI_DIALOGS_CLOSE, TUI_DIALOG_OPTIONS, TuiDialog, TuiDialogCloseService, TuiDialogComponent, TuiDialogService, tuiDialog, tuiDialogOptionsProvider };
|
|
226
158
|
//# sourceMappingURL=taiga-ui-core-components-dialog.mjs.map
|