@taiga-ui/core 4.52.0-canary.05c3268 → 4.52.0-canary.0ec45da
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/alert/alert.component.d.ts +5 -6
- package/components/alert/alert.directive.d.ts +4 -3
- package/components/alert/alert.interfaces.d.ts +2 -1
- package/components/alert/alert.service.d.ts +6 -2
- package/components/alert/alert.tokens.d.ts +1 -7
- package/components/alert/index.d.ts +0 -1
- package/components/data-list/data-list.component.d.ts +1 -1
- package/components/dialog/dialog.component.d.ts +1 -1
- package/components/dialog/dialog.directive.d.ts +4 -3
- package/components/dialog/dialog.service.d.ts +5 -2
- package/components/error/error.component.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/components/link/link.directive.d.ts +2 -2
- package/components/loader/loader.component.d.ts +7 -7
- package/components/modal/index.d.ts +2 -0
- package/components/modal/modal.component.d.ts +17 -0
- package/components/modal/modal.service.d.ts +13 -0
- package/components/notification/notification.directive.d.ts +7 -11
- package/components/root/root.component.d.ts +1 -1
- package/components/spin-button/spin-button.component.d.ts +8 -9
- package/components/textfield/textfield-multi/textfield-multi.component.d.ts +2 -2
- package/components/textfield/textfield.component.d.ts +4 -5
- package/components/textfield/textfield.directive.d.ts +10 -13
- package/components/textfield/textfield.options.d.ts +8 -11
- package/directives/appearance/appearance.directive.d.ts +1 -1
- package/directives/appearance/appearance.options.d.ts +1 -1
- package/directives/dropdown/dropdown.directive.d.ts +1 -2
- package/directives/dropdown/index.d.ts +0 -2
- package/directives/hint/hint-describe.directive.d.ts +4 -6
- package/directives/hint/hint-host.directive.d.ts +2 -2
- package/directives/hint/hint-hover.directive.d.ts +3 -4
- package/directives/hint/hint-manual.directive.d.ts +2 -2
- package/directives/hint/hint-options.directive.d.ts +1 -1
- package/directives/hint/hint-overflow.directive.d.ts +2 -2
- package/directives/hint/hint-position.directive.d.ts +4 -5
- package/directives/hint/hint-unstyled.component.d.ts +2 -7
- package/directives/hint/hint.component.d.ts +7 -6
- package/directives/hint/hint.directive.d.ts +9 -11
- package/directives/hint/index.d.ts +0 -2
- package/directives/index.d.ts +1 -0
- package/directives/notification/index.d.ts +2 -0
- package/directives/notification/notification.directive.d.ts +11 -0
- package/directives/notification/notification.service.d.ts +12 -0
- package/directives/popup/popup.directive.d.ts +6 -5
- package/directives/popup/popup.service.d.ts +1 -1
- package/directives/popup/popups.component.d.ts +2 -2
- package/fesm2022/taiga-ui-core-components-alert.mjs +57 -96
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-calendar.mjs +7 -8
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +31 -19
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +2 -2
- package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-expand.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-header.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +5 -7
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +12 -25
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-modal.mjs +89 -0
- package/fesm2022/taiga-ui-core-components-modal.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-components-notification.mjs +12 -27
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +3 -13
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +14 -27
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +51 -94
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components.mjs +1 -0
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs +4 -34
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs +94 -182
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +2 -2
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-notification.mjs +73 -0
- package/fesm2022/taiga-ui-core-directives-notification.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-directives-popup.mjs +13 -20
- package/fesm2022/taiga-ui-core-directives-popup.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-title.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives.mjs +1 -0
- package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +2 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/package.json +9 -1
- package/tokens/i18n.d.ts +7 -7
- package/types/index.d.ts +0 -1
- package/components/alert/alerts.component.d.ts +0 -12
- package/directives/dropdown/dropdown.service.d.ts +0 -6
- package/directives/dropdown/dropdowns.component.d.ts +0 -9
- package/directives/hint/hint.service.d.ts +0 -13
- package/directives/hint/hints.component.d.ts +0 -12
- package/types/portal-item.d.ts +0 -9
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import { TuiPositionAccessor } from '@taiga-ui/core/classes';
|
|
3
2
|
import { type TuiPoint } from '@taiga-ui/core/types';
|
|
4
|
-
import { type TuiHintDirection
|
|
3
|
+
import { type TuiHintDirection } from './hint-options.directive';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
5
|
export declare class TuiHintPosition extends TuiPositionAccessor {
|
|
7
6
|
private readonly el;
|
|
@@ -9,13 +8,13 @@ export declare class TuiHintPosition extends TuiPositionAccessor {
|
|
|
9
8
|
private readonly viewport;
|
|
10
9
|
private readonly accessor;
|
|
11
10
|
private readonly points;
|
|
12
|
-
direction:
|
|
13
|
-
readonly directionChange:
|
|
11
|
+
readonly direction: import("@angular/core").InputSignal<TuiHintDirection | TuiHintDirection[]>;
|
|
12
|
+
readonly directionChange: import("@angular/core").OutputEmitterRef<TuiHintDirection>;
|
|
14
13
|
readonly type = "hint";
|
|
15
14
|
emitDirection(direction: TuiHintDirection): void;
|
|
16
15
|
getPosition(rect: DOMRect, el?: HTMLElement): TuiPoint;
|
|
17
16
|
private get fallback();
|
|
18
17
|
private checkPosition;
|
|
19
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHintPosition, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiHintPosition, never, never, { "direction": { "alias": "tuiHintDirection"; "required": false; }; }, { "directionChange": "tuiHintDirectionChange"; }, never, never, true, never>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiHintPosition, never, never, { "direction": { "alias": "tuiHintDirection"; "required": false; "isSignal": true; }; }, { "directionChange": "tuiHintDirectionChange"; }, never, never, true, never>;
|
|
21
20
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type TuiContext } from '@taiga-ui/cdk/types';
|
|
3
|
-
import { type TuiPortalItem } from '@taiga-ui/core/types';
|
|
4
|
-
import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
1
|
+
import { TuiHintDirective } from './hint.directive';
|
|
5
2
|
import * as i0 from "@angular/core";
|
|
6
3
|
export declare class TuiHintUnstyledComponent {
|
|
7
|
-
protected readonly
|
|
8
|
-
content: WritableSignal<PolymorpheusContent>;
|
|
9
|
-
}>;
|
|
4
|
+
protected readonly hint: TuiHintDirective<any>;
|
|
10
5
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHintUnstyledComponent, never>;
|
|
11
6
|
static ɵcmp: i0.ɵɵComponentDeclaration<TuiHintUnstyledComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
12
7
|
}
|
|
@@ -6,23 +6,24 @@ import { TuiHintPointer } from './hint-pointer.directive';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
import * as i1 from "@taiga-ui/core/directives/appearance";
|
|
8
8
|
import * as i2 from "@taiga-ui/cdk/directives/animated";
|
|
9
|
+
import * as i3 from "@taiga-ui/cdk/directives/active-zone";
|
|
9
10
|
export declare const TUI_HINT_PROVIDERS: (import("@angular/core").FactoryProvider | typeof TuiHoveredService | typeof TuiPositionService)[];
|
|
10
|
-
export declare class TuiHintComponent
|
|
11
|
+
export declare class TuiHintComponent {
|
|
11
12
|
private readonly el;
|
|
12
13
|
private readonly hover;
|
|
13
14
|
private readonly vvs;
|
|
14
15
|
private readonly viewport;
|
|
15
16
|
protected readonly pointer: TuiHintPointer | null;
|
|
16
17
|
protected readonly accessor: TuiRectAccessor;
|
|
17
|
-
protected readonly hint: TuiHintDirective<
|
|
18
|
+
protected readonly hint: TuiHintDirective<any>;
|
|
18
19
|
protected readonly isMobile: boolean;
|
|
19
|
-
protected readonly content: import("@angular/core").
|
|
20
|
+
protected readonly content: import("@angular/core").InputSignal<import("@taiga-ui/polymorpheus").PolymorpheusContent<any>> | import("@angular/core").WritableSignal<string>;
|
|
20
21
|
protected readonly theme: string | null | undefined;
|
|
21
|
-
protected readonly appearance: import("@angular/core").
|
|
22
|
+
protected readonly appearance: import("@angular/core").Signal<string>;
|
|
22
23
|
constructor();
|
|
23
24
|
protected onClick(target: HTMLElement): void;
|
|
24
25
|
private apply;
|
|
25
26
|
private update;
|
|
26
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHintComponent
|
|
27
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TuiHintComponent
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHintComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TuiHintComponent, "tui-hint", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.TuiAppearance; inputs: {}; outputs: {}; }, { directive: typeof i2.TuiAnimated; inputs: {}; outputs: {}; }, { directive: typeof i3.TuiActiveZone; inputs: {}; outputs: {}; }]>;
|
|
28
29
|
}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
1
|
+
import { type OnChanges, type OnDestroy } from '@angular/core';
|
|
3
2
|
import { type TuiRectAccessor, type TuiVehicle } from '@taiga-ui/core/classes';
|
|
4
|
-
import { type TuiPortalItem } from '@taiga-ui/core/types';
|
|
5
3
|
import { PolymorpheusComponent, type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
6
4
|
import * as i0 from "@angular/core";
|
|
7
5
|
import * as i1 from "./hint-driver.directive";
|
|
8
6
|
import * as i2 from "./hint-hover.directive";
|
|
9
7
|
import * as i3 from "./hint-position.directive";
|
|
10
|
-
export declare class TuiHintDirective<C> implements OnDestroy,
|
|
8
|
+
export declare class TuiHintDirective<C> implements OnDestroy, OnChanges, TuiRectAccessor, TuiVehicle {
|
|
11
9
|
private readonly service;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
readonly
|
|
15
|
-
|
|
10
|
+
private ref?;
|
|
11
|
+
readonly content: import("@angular/core").InputSignal<PolymorpheusContent<C>>;
|
|
12
|
+
readonly context: import("@angular/core").InputSignal<C | undefined>;
|
|
13
|
+
readonly appearance: import("@angular/core").InputSignal<"" | ("accent" | "action-destructive" | "action-grayscale" | "action" | "flat-destructive" | "flat-grayscale" | "flat" | "floating" | "glass" | "icon" | "info" | "negative" | "neutral" | "outline-destructive" | "outline-grayscale" | "outline" | "positive" | "primary-destructive" | "primary-grayscale" | "primary" | "secondary-destructive" | "secondary-grayscale" | "secondary" | "textfield" | "warning" | (Record<never, never> & string))>;
|
|
14
|
+
readonly visible: import("@angular/core").OutputEmitterRef<boolean>;
|
|
16
15
|
component: PolymorpheusComponent<any>;
|
|
17
16
|
readonly el: HTMLElement;
|
|
18
|
-
readonly activeZone?: TuiActiveZone | null | undefined;
|
|
19
17
|
readonly type = "hint";
|
|
20
|
-
|
|
18
|
+
ngOnChanges(): void;
|
|
21
19
|
ngOnDestroy(): void;
|
|
22
20
|
getClientRect(): DOMRect;
|
|
23
21
|
toggle(show: boolean): void;
|
|
24
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHintDirective<any>, never>;
|
|
25
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiHintDirective<any>, "[tuiHint]:not(ng-container):not(ng-template)", never, { "
|
|
23
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiHintDirective<any>, "[tuiHint]:not(ng-container):not(ng-template)", never, { "content": { "alias": "tuiHint"; "required": false; "isSignal": true; }; "context": { "alias": "tuiHintContext"; "required": false; "isSignal": true; }; "appearance": { "alias": "tuiHintAppearance"; "required": false; "isSignal": true; }; }, { "visible": "tuiHintVisible"; }, never, never, true, [{ directive: typeof i1.TuiHintDriver; inputs: {}; outputs: {}; }, { directive: typeof i2.TuiHintHover; inputs: { "tuiHintHideDelay": "tuiHintHideDelay"; "tuiHintShowDelay": "tuiHintShowDelay"; }; outputs: {}; }, { directive: typeof i3.TuiHintPosition; inputs: { "tuiHintDirection": "tuiHintDirection"; }; outputs: { "tuiHintDirectionChange": "tuiHintDirectionChange"; }; }]>;
|
|
26
24
|
}
|
|
@@ -2,7 +2,6 @@ export * from './hint';
|
|
|
2
2
|
export * from './hint.component';
|
|
3
3
|
export * from './hint.directive';
|
|
4
4
|
export * from './hint.providers';
|
|
5
|
-
export * from './hint.service';
|
|
6
5
|
export * from './hint-describe.directive';
|
|
7
6
|
export * from './hint-driver.directive';
|
|
8
7
|
export * from './hint-host.directive';
|
|
@@ -13,4 +12,3 @@ export * from './hint-overflow.directive';
|
|
|
13
12
|
export * from './hint-pointer.directive';
|
|
14
13
|
export * from './hint-position.directive';
|
|
15
14
|
export * from './hint-unstyled.component';
|
|
16
|
-
export * from './hints.component';
|
package/directives/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from '@taiga-ui/core/directives/group';
|
|
|
5
5
|
export * from '@taiga-ui/core/directives/hint';
|
|
6
6
|
export * from '@taiga-ui/core/directives/icons';
|
|
7
7
|
export * from '@taiga-ui/core/directives/items-handlers';
|
|
8
|
+
export * from '@taiga-ui/core/directives/notification';
|
|
8
9
|
export * from '@taiga-ui/core/directives/number-format';
|
|
9
10
|
export * from '@taiga-ui/core/directives/popup';
|
|
10
11
|
export * from '@taiga-ui/core/directives/title';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface TuiPositionOptions {
|
|
3
|
+
readonly block: 'end' | 'start';
|
|
4
|
+
readonly inline: 'center' | 'end' | 'start';
|
|
5
|
+
}
|
|
6
|
+
export declare class TuiNotificationDirective {
|
|
7
|
+
protected readonly nothing: undefined;
|
|
8
|
+
protected readonly context: TuiPositionOptions;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiNotificationDirective, never>;
|
|
10
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNotificationDirective, never, never, {}, {}, never, never, true, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TuiPortal } from '@taiga-ui/cdk/portals';
|
|
2
|
+
import { type PolymorpheusComponent } from '@taiga-ui/polymorpheus';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare abstract class TuiNotificationService<T, K = void> extends TuiPortal<T, K> {
|
|
5
|
+
private readonly concurrency;
|
|
6
|
+
private readonly current;
|
|
7
|
+
private readonly queue;
|
|
8
|
+
constructor(concurrency: number);
|
|
9
|
+
protected add(component: PolymorpheusComponent<unknown>): () => void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiNotificationService<any, any>, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TuiNotificationService<any, any>>;
|
|
12
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type OnDestroy } from '@angular/core';
|
|
1
|
+
import { type OnChanges, type OnDestroy } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiPopup implements OnDestroy {
|
|
3
|
+
export declare class TuiPopup implements OnChanges, OnDestroy {
|
|
4
4
|
private readonly template;
|
|
5
5
|
private readonly service;
|
|
6
|
-
private
|
|
7
|
-
|
|
6
|
+
private ref?;
|
|
7
|
+
readonly show: import("@angular/core").InputSignal<boolean>;
|
|
8
|
+
ngOnChanges(): void;
|
|
8
9
|
ngOnDestroy(): void;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPopup, never>;
|
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiPopup, "ng-template[tuiPopup]", never, { "
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiPopup, "ng-template[tuiPopup]", never, { "show": { "alias": "tuiPopup"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
11
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TuiPortalService } from '@taiga-ui/cdk/
|
|
1
|
+
import { TuiPortalService } from '@taiga-ui/cdk/portals';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class TuiPopupService extends TuiPortalService {
|
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPopupService, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TuiPortals } from '@taiga-ui/cdk/
|
|
1
|
+
import { TuiPortals } from '@taiga-ui/cdk/portals';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class TuiPopups extends TuiPortals {
|
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPopups, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TuiPopups, "tui-popups", never, {}, {}, never,
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TuiPopups, "tui-popups", never, {}, {}, never, ["*"], true, never>;
|
|
6
6
|
}
|
|
@@ -1,26 +1,50 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { inject, ChangeDetectionStrategy, Component, InjectionToken, Injectable, input, Directive } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import * as i1 from '@taiga-ui/cdk/directives/animated';
|
|
5
|
-
import { TuiAnimated
|
|
5
|
+
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
6
6
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
7
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
8
|
-
import {
|
|
8
|
+
import { TuiNotification, TUI_NOTIFICATION_OPTIONS } from '@taiga-ui/core/components/notification';
|
|
9
|
+
import * as i2 from '@taiga-ui/core/directives';
|
|
10
|
+
import { TuiNotificationDirective } from '@taiga-ui/core/directives';
|
|
9
11
|
import { TuiTitle } from '@taiga-ui/core/directives/title';
|
|
10
12
|
import { TUI_COMMON_ICONS, TUI_CLOSE_WORD } from '@taiga-ui/core/tokens';
|
|
11
|
-
import { injectContext, PolymorpheusOutlet
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
13
|
+
import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
14
|
+
import { of, switchMap, timer, EMPTY, takeUntil, fromEvent, repeat } from 'rxjs';
|
|
15
|
+
import * as i1$1 from '@taiga-ui/cdk/portals';
|
|
16
|
+
import { tuiAsPortal, TuiPortalDirective } from '@taiga-ui/cdk/portals';
|
|
17
|
+
import { TuiNotificationService } from '@taiga-ui/core/directives/notification';
|
|
18
|
+
import { tuiCreateToken } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
18
19
|
|
|
20
|
+
class TuiAlertComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.el = tuiInjectElement();
|
|
23
|
+
this.icons = inject(TUI_COMMON_ICONS);
|
|
24
|
+
this.close = inject(TUI_CLOSE_WORD);
|
|
25
|
+
this.item = injectContext();
|
|
26
|
+
this.sub = of(typeof this.item.autoClose === 'function'
|
|
27
|
+
? this.item.autoClose(this.item.appearance)
|
|
28
|
+
: this.item.autoClose)
|
|
29
|
+
.pipe(switchMap((autoClose) => (autoClose ? timer(autoClose) : EMPTY)), takeUntil(fromEvent(this.el, 'mouseenter')), repeat({ delay: () => fromEvent(this.el, 'mouseleave') }), takeUntilDestroyed())
|
|
30
|
+
.subscribe(() => this.item.$implicit.complete());
|
|
31
|
+
}
|
|
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,a[tuiNotification],button[tuiNotification]", inputs: ["appearance", "icon", "size"] }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertComponent, decorators: [{
|
|
36
|
+
type: Component,
|
|
37
|
+
args: [{ selector: 'tui-alert', imports: [PolymorpheusOutlet, TuiButton, TuiNotification, TuiTitle], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiAnimated, TuiNotificationDirective], host: { role: 'alert' }, 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"] }]
|
|
38
|
+
}] });
|
|
39
|
+
|
|
40
|
+
const TUI_ALERT_CONCURRENCY = tuiCreateToken(5);
|
|
19
41
|
const TUI_ALERT_DEFAULT_OPTIONS = {
|
|
20
42
|
autoClose: 3000,
|
|
21
43
|
label: '',
|
|
22
44
|
closable: true,
|
|
23
45
|
data: undefined,
|
|
46
|
+
block: 'start',
|
|
47
|
+
inline: 'end',
|
|
24
48
|
};
|
|
25
49
|
const TUI_ALERT_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_ALERT_OPTIONS' : '', {
|
|
26
50
|
factory: () => ({
|
|
@@ -28,29 +52,6 @@ const TUI_ALERT_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_ALERT_OPTIONS' : '
|
|
|
28
52
|
...inject(TUI_NOTIFICATION_OPTIONS),
|
|
29
53
|
}),
|
|
30
54
|
});
|
|
31
|
-
const TUI_ALERT_POSITION = new InjectionToken(ngDevMode ? 'TUI_ALERT_POSITION' : '', {
|
|
32
|
-
factory: () => (inject(TUI_IS_MOBILE) ? '1rem 1rem 0 auto' : '2rem 3rem 0 auto'),
|
|
33
|
-
});
|
|
34
|
-
const TUI_ALERTS = new InjectionToken(ngDevMode ? 'TUI_ALERTS' : '', {
|
|
35
|
-
factory: () => new BehaviorSubject([]),
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* Grouping alerts by their component
|
|
39
|
-
*/
|
|
40
|
-
const TUI_ALERTS_GROUPED = new InjectionToken(ngDevMode ? 'TUI_ALERTS_GROUPED' : '', {
|
|
41
|
-
factory: () => combineLatest([
|
|
42
|
-
of(new Map()),
|
|
43
|
-
inject(TUI_ALERTS),
|
|
44
|
-
]).pipe(map(([map, alerts]) => {
|
|
45
|
-
map.forEach((_, key) => map.set(key, []));
|
|
46
|
-
alerts.forEach((alert) => {
|
|
47
|
-
const key = alert.component.component;
|
|
48
|
-
const value = map.get(key) || [];
|
|
49
|
-
map.set(key, [...value, alert]);
|
|
50
|
-
});
|
|
51
|
-
return Array.from(map.values());
|
|
52
|
-
})),
|
|
53
|
-
});
|
|
54
55
|
function tuiAlertOptionsProvider(options) {
|
|
55
56
|
return {
|
|
56
57
|
provide: TUI_ALERT_OPTIONS,
|
|
@@ -63,87 +64,47 @@ function tuiAlertOptionsProvider(options) {
|
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
class
|
|
67
|
+
class TuiAlertService extends TuiNotificationService {
|
|
67
68
|
constructor() {
|
|
68
|
-
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.position = inject(TUI_ALERT_POSITION);
|
|
72
|
-
this.item = injectContext();
|
|
73
|
-
this.sub = of(typeof this.item.autoClose === 'function'
|
|
74
|
-
? this.item.autoClose(this.item.appearance)
|
|
75
|
-
: this.item.autoClose)
|
|
76
|
-
.pipe(switchMap((autoClose) => (autoClose ? timer(autoClose) : EMPTY)), takeUntil(fromEvent(this.el, 'mouseenter')), repeat({ delay: () => fromEvent(this.el, 'mouseleave') }), takeUntilDestroyed())
|
|
77
|
-
.subscribe(() => this.item.$implicit.complete());
|
|
78
|
-
}
|
|
79
|
-
get from() {
|
|
80
|
-
return this.position.endsWith('auto') ? 'translateX(100%)' : 'translateX(-100%)';
|
|
69
|
+
super(inject(TUI_ALERT_CONCURRENCY));
|
|
70
|
+
this.options = inject(TUI_ALERT_OPTIONS);
|
|
71
|
+
this.component = TuiAlertComponent;
|
|
81
72
|
}
|
|
82
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type:
|
|
83
|
-
static { this.ɵ
|
|
84
|
-
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertComponent, decorators: [{
|
|
86
|
-
type: Component,
|
|
87
|
-
args: [{ selector: 'tui-alert', imports: [PolymorpheusOutlet, TuiButton, TuiNotification, TuiTitle], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiAnimated], host: {
|
|
88
|
-
role: 'alert',
|
|
89
|
-
'[style.margin]': 'position',
|
|
90
|
-
'[style.--tui-from]': 'from',
|
|
91
|
-
}, 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{display:grid;inline-size:18rem;flex-shrink:0;word-break:break-word}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide,tuiCollapse}:host:not(:first-child){margin-block-start:0!important}:host:not(:last-child){margin-block-end:0!important}.t-wrapper{transition-property:margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;grid-row:1 / span 2;overflow:hidden;margin-block-end:.75rem;background:var(--tui-background-base);border-radius:var(--tui-radius-m);box-shadow:var(--tui-shadow-medium)}:host.tui-leave .t-wrapper{margin:0}.t-closable{padding-inline-end:2.5rem}\n"] }]
|
|
92
|
-
}] });
|
|
93
|
-
|
|
94
|
-
class TuiAlertService extends TuiPopoverService {
|
|
95
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
96
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, providedIn: 'root', useFactory: () => new TuiAlertService(TUI_ALERTS, TuiAlertComponent, inject(TUI_ALERT_OPTIONS)) }); }
|
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
74
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, providedIn: 'root' }); }
|
|
97
75
|
}
|
|
98
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, decorators: [{
|
|
99
77
|
type: Injectable,
|
|
100
78
|
args: [{
|
|
101
79
|
providedIn: 'root',
|
|
102
|
-
useFactory: () => new TuiAlertService(TUI_ALERTS, TuiAlertComponent, inject(TUI_ALERT_OPTIONS)),
|
|
103
80
|
}]
|
|
104
|
-
}] });
|
|
81
|
+
}], ctorParameters: () => [] });
|
|
105
82
|
|
|
106
|
-
class TuiAlert
|
|
107
|
-
|
|
108
|
-
|
|
83
|
+
class TuiAlert {
|
|
84
|
+
constructor() {
|
|
85
|
+
this.tuiAlertOptions = input({});
|
|
86
|
+
}
|
|
87
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlert, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
88
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiAlert, isStandalone: true, selector: "ng-template[tuiAlert]", inputs: { tuiAlertOptions: { classPropertyName: "tuiAlertOptions", publicName: "tuiAlertOptions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [tuiAsPortal(TuiAlertService)], hostDirectives: [{ directive: i1$1.TuiPortalDirective, inputs: ["options", "tuiAlertOptions", "open", "tuiAlert"], outputs: ["openChange", "tuiAlertChange"] }], ngImport: i0 }); }
|
|
109
89
|
}
|
|
110
90
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlert, decorators: [{
|
|
111
91
|
type: Directive,
|
|
112
92
|
args: [{
|
|
113
|
-
standalone: true,
|
|
114
93
|
selector: 'ng-template[tuiAlert]',
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
94
|
+
providers: [tuiAsPortal(TuiAlertService)],
|
|
95
|
+
hostDirectives: [
|
|
96
|
+
{
|
|
97
|
+
directive: TuiPortalDirective,
|
|
98
|
+
inputs: ['options: tuiAlertOptions', 'open: tuiAlert'],
|
|
99
|
+
outputs: ['openChange: tuiAlertChange'],
|
|
100
|
+
},
|
|
101
|
+
],
|
|
118
102
|
}]
|
|
119
103
|
}] });
|
|
120
104
|
|
|
121
|
-
class TuiAlerts {
|
|
122
|
-
constructor() {
|
|
123
|
-
this.injector = inject(INJECTOR);
|
|
124
|
-
this.alerts$ = inject(TUI_ALERTS_GROUPED);
|
|
125
|
-
this.trackBy = identity;
|
|
126
|
-
this.mapper = (useValue) => Injector.create({
|
|
127
|
-
providers: [
|
|
128
|
-
{
|
|
129
|
-
provide: POLYMORPHEUS_CONTEXT,
|
|
130
|
-
useValue,
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
parent: this.injector,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlerts, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
137
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiAlerts, isStandalone: true, selector: "tui-alerts", ngImport: i0, template: "@for (group of alerts$ | async; track trackBy(group)) {\n <div\n tuiAnimatedParent\n class=\"t-wrapper\"\n >\n @for (item of group; track item) {\n <ng-container\n [ngComponentOutlet]=\"item.component.component\"\n [ngComponentOutletInjector]=\"item | tuiMapper: mapper\"\n />\n }\n </div>\n}\n", styles: ["tui-alerts>.t-wrapper{position:fixed;top:0;left:0;inline-size:100%;display:flex;flex-direction:column;pointer-events:none;box-sizing:border-box;block-size:100%;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}tui-alerts>.t-wrapper>*{pointer-events:auto}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: TuiAnimatedParent, selector: "[tuiAnimatedParent]" }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
138
|
-
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlerts, decorators: [{
|
|
140
|
-
type: Component,
|
|
141
|
-
args: [{ selector: 'tui-alerts', imports: [AsyncPipe, NgComponentOutlet, TuiAnimatedParent, TuiMapperPipe], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, template: "@for (group of alerts$ | async; track trackBy(group)) {\n <div\n tuiAnimatedParent\n class=\"t-wrapper\"\n >\n @for (item of group; track item) {\n <ng-container\n [ngComponentOutlet]=\"item.component.component\"\n [ngComponentOutletInjector]=\"item | tuiMapper: mapper\"\n />\n }\n </div>\n}\n", styles: ["tui-alerts>.t-wrapper{position:fixed;top:0;left:0;inline-size:100%;display:flex;flex-direction:column;pointer-events:none;box-sizing:border-box;block-size:100%;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}tui-alerts>.t-wrapper>*{pointer-events:auto}\n"] }]
|
|
142
|
-
}] });
|
|
143
|
-
|
|
144
105
|
/**
|
|
145
106
|
* Generated bundle index. Do not edit.
|
|
146
107
|
*/
|
|
147
108
|
|
|
148
|
-
export {
|
|
109
|
+
export { TUI_ALERT_CONCURRENCY, TUI_ALERT_DEFAULT_OPTIONS, TUI_ALERT_OPTIONS, TuiAlert, TuiAlertComponent, TuiAlertService, tuiAlertOptionsProvider };
|
|
149
110
|
//# sourceMappingURL=taiga-ui-core-components-alert.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-alert.mjs","sources":["../../../projects/core/components/alert/alert.tokens.ts","../../../projects/core/components/alert/alert.component.ts","../../../projects/core/components/alert/alert.template.html","../../../projects/core/components/alert/alert.service.ts","../../../projects/core/components/alert/alert.directive.ts","../../../projects/core/components/alert/alerts.component.ts","../../../projects/core/components/alert/alerts.template.html","../../../projects/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {type FactoryProvider, inject, InjectionToken, type Type} from '@angular/core';\nimport {type TuiPopover} from '@taiga-ui/cdk/services';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\nimport {BehaviorSubject, combineLatest, map, of} from 'rxjs';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\n\nexport const TUI_ALERT_DEFAULT_OPTIONS: Omit<TuiAlertOptions, 'appearance' | 'icon'> = {\n autoClose: 3000,\n label: '',\n closable: true,\n data: undefined,\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 const TUI_ALERT_POSITION = new InjectionToken<string>(\n ngDevMode ? 'TUI_ALERT_POSITION' : '',\n {\n factory: () => (inject(TUI_IS_MOBILE) ? '1rem 1rem 0 auto' : '2rem 3rem 0 auto'),\n },\n);\n\nexport const TUI_ALERTS = new InjectionToken(ngDevMode ? 'TUI_ALERTS' : '', {\n factory: () => new BehaviorSubject<ReadonlyArray<TuiPopover<any, any>>>([]),\n});\n\n/**\n * Grouping alerts by their component\n */\nexport const TUI_ALERTS_GROUPED = new InjectionToken(\n ngDevMode ? 'TUI_ALERTS_GROUPED' : '',\n {\n factory: () =>\n combineLatest([\n of(new Map<Type<any>, ReadonlyArray<TuiPopover<any, any>>>()),\n inject(TUI_ALERTS),\n ]).pipe(\n map(([map, alerts]) => {\n map.forEach((_, key) => map.set(key, []));\n\n alerts.forEach((alert) => {\n const key = alert.component.component;\n const value = map.get(key) || [];\n\n map.set(key, [...value, alert]);\n });\n\n return Array.from(map.values());\n }),\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 {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {type TuiPopover} from '@taiga-ui/cdk/services';\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 {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';\nimport {TUI_ALERT_POSITION} from './alert.tokens';\n\n@Component({\n selector: 'tui-alert',\n imports: [PolymorpheusOutlet, TuiButton, TuiNotification, TuiTitle],\n templateUrl: './alert.template.html',\n styleUrls: ['./alert.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiAnimated],\n host: {\n role: 'alert',\n '[style.margin]': 'position',\n '[style.--tui-from]': 'from',\n },\n})\nexport class TuiAlertComponent<O, I> {\n private readonly el = tuiInjectElement();\n\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly close = toSignal(inject(TUI_CLOSE_WORD));\n protected readonly position = inject(TUI_ALERT_POSITION);\n protected readonly item = injectContext<TuiPopover<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 public get from(): string {\n return this.position.endsWith('auto') ? 'translateX(100%)' : 'translateX(-100%)';\n }\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 {inject, Injectable} from '@angular/core';\nimport {TuiPopoverService} from '@taiga-ui/cdk/services';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TUI_ALERT_OPTIONS, TUI_ALERTS} from './alert.tokens';\n\n@Injectable({\n providedIn: 'root',\n useFactory: () =>\n new TuiAlertService(TUI_ALERTS, TuiAlertComponent, inject(TUI_ALERT_OPTIONS)),\n})\nexport class TuiAlertService extends TuiPopoverService<TuiAlertOptions<any>> {}\n","import {Directive} from '@angular/core';\nimport {TuiPopoverDirective} from '@taiga-ui/cdk/directives/popover';\nimport {tuiAsPopover} from '@taiga-ui/cdk/services';\n\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TuiAlertService} from './alert.service';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[tuiAlert]',\n inputs: ['options: tuiAlertOptions', 'open: tuiAlert'],\n outputs: ['openChange: tuiAlertChange'],\n providers: [tuiAsPopover(TuiAlertService)],\n})\nexport class TuiAlert<T> extends TuiPopoverDirective<TuiAlertOptions<T>> {}\n","import {AsyncPipe, NgComponentOutlet} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n INJECTOR,\n Injector,\n type Type,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiAnimatedParent} from '@taiga-ui/cdk/directives/animated';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {type TuiMapper} from '@taiga-ui/cdk/types';\n// eslint-disable-next-line no-restricted-imports\nimport {POLYMORPHEUS_CONTEXT} from '@taiga-ui/polymorpheus';\nimport {identity} from 'rxjs';\n\nimport {TUI_ALERTS_GROUPED} from './alert.tokens';\n\n@Component({\n selector: 'tui-alerts',\n imports: [AsyncPipe, NgComponentOutlet, TuiAnimatedParent, TuiMapperPipe],\n templateUrl: './alerts.template.html',\n styleUrls: ['./alerts.style.less'],\n encapsulation: ViewEncapsulation.None,\n // So that we do not force OnPush on custom alerts\n // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection\n changeDetection: ChangeDetectionStrategy.Default,\n})\nexport class TuiAlerts {\n private readonly injector = inject(INJECTOR);\n\n protected readonly alerts$ = inject(TUI_ALERTS_GROUPED);\n protected readonly trackBy = identity;\n protected readonly mapper: TuiMapper<[Type<any>], Injector> = (useValue) =>\n Injector.create({\n providers: [\n {\n provide: POLYMORPHEUS_CONTEXT,\n useValue,\n },\n ],\n parent: this.injector,\n });\n}\n","@for (group of alerts$ | async; track trackBy(group)) {\n <div\n tuiAnimatedParent\n class=\"t-wrapper\"\n >\n @for (item of group; track item) {\n <ng-container\n [ngComponentOutlet]=\"item.component.component\"\n [ngComponentOutletInjector]=\"item | tuiMapper: mapper\"\n />\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAQa,MAAA,yBAAyB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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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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-button.mjs","sources":["../../../projects/core/components/button/button.options.ts","../../../projects/core/components/button/button.directive.ts","../../../projects/core/components/button/taiga-ui-core-components-button.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiAppearanceOptions} from '@taiga-ui/core/directives/appearance';\nimport {type TuiSizeXL, type TuiSizeXS} from '@taiga-ui/core/types';\n\nexport interface TuiButtonOptions extends TuiAppearanceOptions {\n readonly size: TuiSizeXL | TuiSizeXS;\n}\n\nexport const TUI_BUTTON_DEFAULT_OPTIONS: TuiButtonOptions = {\n appearance: 'primary',\n size: 'l',\n};\n\nexport const [TUI_BUTTON_OPTIONS, tuiButtonOptionsProvider] = tuiCreateOptions(\n TUI_BUTTON_DEFAULT_OPTIONS,\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n tuiAppearanceOptionsProvider,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {TuiWithIcons} from '@taiga-ui/core/directives/icons';\n\nimport {TUI_BUTTON_OPTIONS} from './button.options';\n\n@Component({\n template: '',\n styles:
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-button.mjs","sources":["../../../projects/core/components/button/button.options.ts","../../../projects/core/components/button/button.directive.ts","../../../projects/core/components/button/taiga-ui-core-components-button.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiAppearanceOptions} from '@taiga-ui/core/directives/appearance';\nimport {type TuiSizeXL, type TuiSizeXS} from '@taiga-ui/core/types';\n\nexport interface TuiButtonOptions extends TuiAppearanceOptions {\n readonly size: TuiSizeXL | TuiSizeXS;\n}\n\nexport const TUI_BUTTON_DEFAULT_OPTIONS: TuiButtonOptions = {\n appearance: 'primary',\n size: 'l',\n};\n\nexport const [TUI_BUTTON_OPTIONS, tuiButtonOptionsProvider] = tuiCreateOptions(\n TUI_BUTTON_DEFAULT_OPTIONS,\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n tuiAppearanceOptionsProvider,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {TuiWithIcons} from '@taiga-ui/core/directives/icons';\n\nimport {TUI_BUTTON_OPTIONS} from './button.options';\n\n@Component({\n template: '',\n styles: '@import \"@taiga-ui/core/styles/components/button.less\";',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {class: 'tui-button'},\n})\nclass Styles {}\n\n@Directive({\n selector: 'a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]',\n providers: [tuiAppearanceOptionsProvider(TUI_BUTTON_OPTIONS)],\n hostDirectives: [TuiWithAppearance, TuiWithIcons],\n host: {'[attr.data-size]': 'size()'},\n})\nexport class TuiButton {\n protected readonly nothing = tuiWithStyles(Styles);\n\n public readonly size = input(inject(TUI_BUTTON_OPTIONS).size);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQa,MAAA,0BAA0B,GAAqB;AACxD,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,IAAI,EAAE,GAAG;;AAGN,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,GAAG,gBAAgB,CAC1E,0BAA0B;;ACG9B,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,+lHAAA,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,EAAA,CAAA,+lHAAA,CAAA,EAAA;;MAUlB,SAAS,CAAA;AANtB,IAAA,WAAA,GAAA;AAOuB,QAAA,IAAA,CAAA,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC;QAElC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC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