@taiga-ui/core 4.52.0-canary.a59c4d0 → 4.52.0-canary.b61d3d0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/components/alert/alert.component.d.ts +3 -3
  2. package/components/alert/alert.interfaces.d.ts +2 -3
  3. package/components/alert/alert.service.d.ts +3 -2
  4. package/components/alert/alert.tokens.d.ts +1 -7
  5. package/components/alert/index.d.ts +0 -1
  6. package/components/data-list/data-list.component.d.ts +1 -1
  7. package/components/dialog/dialog.component.d.ts +1 -1
  8. package/components/dialog/dialog.directive.d.ts +4 -3
  9. package/components/dialog/dialog.service.d.ts +5 -2
  10. package/components/error/error.component.d.ts +1 -1
  11. package/components/index.d.ts +1 -0
  12. package/components/link/link.directive.d.ts +2 -2
  13. package/components/loader/loader.component.d.ts +7 -7
  14. package/components/modal/index.d.ts +2 -0
  15. package/components/modal/modal.component.d.ts +17 -0
  16. package/components/modal/modal.service.d.ts +13 -0
  17. package/components/notification/notification.directive.d.ts +7 -11
  18. package/components/scrollbar/scroll-into-view.directive.d.ts +3 -2
  19. package/components/scrollbar/scrollbar.component.d.ts +2 -2
  20. package/components/scrollbar/scrollbar.directive.d.ts +2 -2
  21. package/components/spin-button/spin-button.component.d.ts +8 -9
  22. package/components/textfield/textfield-multi/textfield-multi.component.d.ts +2 -2
  23. package/components/textfield/textfield.component.d.ts +4 -5
  24. package/components/textfield/textfield.directive.d.ts +10 -13
  25. package/components/textfield/textfield.options.d.ts +8 -11
  26. package/directives/date-format/date-format.directive.d.ts +3 -7
  27. package/directives/dropdown/dropdown.directive.d.ts +1 -2
  28. package/directives/hint/hint-describe.directive.d.ts +4 -6
  29. package/directives/hint/hint-host.directive.d.ts +2 -2
  30. package/directives/hint/hint-hover.directive.d.ts +3 -4
  31. package/directives/hint/hint-manual.directive.d.ts +2 -2
  32. package/directives/hint/hint-overflow.directive.d.ts +2 -2
  33. package/directives/hint/hint-position.directive.d.ts +4 -5
  34. package/directives/hint/hint-unstyled.component.d.ts +2 -7
  35. package/directives/hint/hint.component.d.ts +7 -6
  36. package/directives/hint/hint.directive.d.ts +9 -11
  37. package/directives/hint/index.d.ts +0 -2
  38. package/directives/index.d.ts +1 -0
  39. package/directives/notification/index.d.ts +2 -0
  40. package/directives/notification/notification.directive.d.ts +11 -0
  41. package/directives/notification/notification.service.d.ts +12 -0
  42. package/directives/number-format/number-format.directive.d.ts +3 -7
  43. package/fesm2022/taiga-ui-core-components-alert.mjs +40 -93
  44. package/fesm2022/taiga-ui-core-components-alert.mjs.map +1 -1
  45. package/fesm2022/taiga-ui-core-components-calendar.mjs +7 -8
  46. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-core-components-data-list.mjs +4 -11
  48. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  49. package/fesm2022/taiga-ui-core-components-dialog.mjs +31 -20
  50. package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
  51. package/fesm2022/taiga-ui-core-components-error.mjs +2 -2
  52. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  53. package/fesm2022/taiga-ui-core-components-icon.mjs +1 -2
  54. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  55. package/fesm2022/taiga-ui-core-components-link.mjs +5 -7
  56. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  57. package/fesm2022/taiga-ui-core-components-loader.mjs +12 -25
  58. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-core-components-modal.mjs +89 -0
  60. package/fesm2022/taiga-ui-core-components-modal.mjs.map +1 -0
  61. package/fesm2022/taiga-ui-core-components-notification.mjs +12 -27
  62. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  63. package/fesm2022/taiga-ui-core-components-root.mjs +3 -5
  64. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  65. package/fesm2022/taiga-ui-core-components-scrollbar.mjs +35 -43
  66. package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
  67. package/fesm2022/taiga-ui-core-components-spin-button.mjs +14 -27
  68. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  69. package/fesm2022/taiga-ui-core-components-textfield.mjs +52 -102
  70. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  71. package/fesm2022/taiga-ui-core-components.mjs +1 -0
  72. package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
  73. package/fesm2022/taiga-ui-core-directives-appearance.mjs +0 -1
  74. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  75. package/fesm2022/taiga-ui-core-directives-date-format.mjs +24 -18
  76. package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
  77. package/fesm2022/taiga-ui-core-directives-dropdown.mjs +3 -22
  78. package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
  79. package/fesm2022/taiga-ui-core-directives-hint.mjs +94 -183
  80. package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
  81. package/fesm2022/taiga-ui-core-directives-icons.mjs +0 -1
  82. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  83. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +2 -5
  84. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  85. package/fesm2022/taiga-ui-core-directives-notification.mjs +73 -0
  86. package/fesm2022/taiga-ui-core-directives-notification.mjs.map +1 -0
  87. package/fesm2022/taiga-ui-core-directives-number-format.mjs +30 -18
  88. package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
  89. package/fesm2022/taiga-ui-core-directives-popup.mjs +2 -3
  90. package/fesm2022/taiga-ui-core-directives-popup.mjs.map +1 -1
  91. package/fesm2022/taiga-ui-core-directives.mjs +1 -0
  92. package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
  93. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -1
  94. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +1 -1
  95. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -1
  96. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +1 -1
  97. package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -1
  98. package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +1 -1
  99. package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -1
  100. package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +1 -1
  101. package/fesm2022/taiga-ui-core-pipes-format-number.mjs +2 -2
  102. package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
  103. package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -1
  104. package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +1 -1
  105. package/fesm2022/taiga-ui-core-pipes-month.mjs +2 -2
  106. package/fesm2022/taiga-ui-core-pipes-month.mjs.map +1 -1
  107. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -1
  108. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +1 -1
  109. package/fesm2022/taiga-ui-core-tokens.mjs +18 -8
  110. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  111. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +1 -1
  112. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  113. package/package.json +9 -1
  114. package/styles/mixins/mixins.less +0 -8
  115. package/styles/mixins/mixins.scss +0 -8
  116. package/tokens/date-format.d.ts +2 -3
  117. package/tokens/i18n.d.ts +7 -7
  118. package/tokens/number-format.d.ts +2 -3
  119. package/types/index.d.ts +0 -1
  120. package/components/alert/alerts.component.d.ts +0 -12
  121. package/directives/hint/hint.service.d.ts +0 -13
  122. package/directives/hint/hints.component.d.ts +0 -12
  123. 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, type TuiHintOptions } from './hint-options.directive';
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: TuiHintOptions['direction'];
13
- readonly directionChange: EventEmitter<TuiHintDirection>;
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 { type WritableSignal } from '@angular/core';
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 context: TuiContext<TuiPortalItem<any> & {
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<C = any> {
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<C>;
18
+ protected readonly hint: TuiHintDirective<any>;
18
19
  protected readonly isMobile: boolean;
19
- protected readonly content: import("@angular/core").WritableSignal<import("@taiga-ui/polymorpheus").PolymorpheusContent<C>>;
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").WritableSignal<string>;
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<any>, never>;
27
- static ɵcmp: i0.ɵɵComponentDeclaration<TuiHintComponent<any>, "tui-hint", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.TuiAppearance; inputs: {}; outputs: {}; }, { directive: typeof i2.TuiAnimated; inputs: {}; outputs: {}; }]>;
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 { EventEmitter, type OnDestroy } from '@angular/core';
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, TuiPortalItem<C>, TuiRectAccessor, TuiVehicle {
8
+ export declare class TuiHintDirective<C> implements OnDestroy, OnChanges, TuiRectAccessor, TuiVehicle {
11
9
  private readonly service;
12
- context?: C;
13
- appearance: "" | ("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: EventEmitter<boolean>;
15
- content: import("@angular/core").WritableSignal<PolymorpheusContent<C>>;
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
- set tuiHint(content: PolymorpheusContent<C>);
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, { "context": { "alias": "tuiHintContext"; "required": false; }; "appearance": { "alias": "tuiHintAppearance"; "required": false; }; "tuiHint": { "alias": "tuiHint"; "required": false; }; }, { "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"; }; }]>;
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';
@@ -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,2 @@
1
+ export * from './notification.directive';
2
+ export * from './notification.service';
@@ -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,7 @@
1
1
  import { type TuiNumberFormatSettings } from '@taiga-ui/core/tokens';
2
- import { Observable } from 'rxjs';
3
2
  import * as i0 from "@angular/core";
4
- export declare class TuiNumberFormat extends Observable<TuiNumberFormatSettings> {
5
- private readonly settings;
6
- private readonly parent;
7
- constructor();
8
- set tuiNumberFormat(format: Partial<TuiNumberFormatSettings>);
3
+ export declare class TuiNumberFormat {
4
+ readonly tuiNumberFormat: import("@angular/core").InputSignal<Partial<TuiNumberFormatSettings>>;
9
5
  static ɵfac: i0.ɵɵFactoryDeclaration<TuiNumberFormat, never>;
10
- static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNumberFormat, "[tuiNumberFormat]", never, { "tuiNumberFormat": { "alias": "tuiNumberFormat"; "required": false; }; }, {}, never, never, true, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNumberFormat, "[tuiNumberFormat]", never, { "tuiNumberFormat": { "alias": "tuiNumberFormat"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
11
7
  }
@@ -1,29 +1,50 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ChangeDetectionStrategy, Component, Injectable, input, Directive, INJECTOR, Injector, ViewEncapsulation } from '@angular/core';
3
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
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, TuiAnimatedParent } from '@taiga-ui/cdk/directives/animated';
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 { TUI_NOTIFICATION_OPTIONS, TuiNotification } from '@taiga-ui/core/components/notification';
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, POLYMORPHEUS_CONTEXT } from '@taiga-ui/polymorpheus';
12
- import { BehaviorSubject, combineLatest, of, map, switchMap, timer, EMPTY, takeUntil, fromEvent, repeat, identity } from 'rxjs';
13
- import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
13
+ import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
14
+ import { of, switchMap, timer, EMPTY, takeUntil, fromEvent, repeat } from 'rxjs';
14
15
  import * as i1$1 from '@taiga-ui/cdk/portals';
15
- import { TuiPortal, tuiAsPortal, TuiPortalDirective } from '@taiga-ui/cdk/portals';
16
- import { TuiPopupService } from '@taiga-ui/core/directives/popup';
17
- import { AsyncPipe, NgComponentOutlet } from '@angular/common';
18
- import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
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';
19
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);
20
41
  const TUI_ALERT_DEFAULT_OPTIONS = {
21
42
  autoClose: 3000,
22
43
  label: '',
23
44
  closable: true,
24
45
  data: undefined,
25
- position: 'top',
26
- orientation: 'end',
46
+ block: 'start',
47
+ inline: 'end',
27
48
  };
28
49
  const TUI_ALERT_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_ALERT_OPTIONS' : '', {
29
50
  factory: () => ({
@@ -31,29 +52,6 @@ const TUI_ALERT_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_ALERT_OPTIONS' : '
31
52
  ...inject(TUI_NOTIFICATION_OPTIONS),
32
53
  }),
33
54
  });
34
- const TUI_ALERT_POSITION = new InjectionToken(ngDevMode ? 'TUI_ALERT_POSITION' : '', {
35
- factory: () => (inject(TUI_IS_MOBILE) ? '0.625rem 1rem' : '1.625rem 3rem'),
36
- });
37
- const TUI_ALERTS = new InjectionToken(ngDevMode ? 'TUI_ALERTS' : '', {
38
- factory: () => new BehaviorSubject([]),
39
- });
40
- /**
41
- * Grouping alerts by their component
42
- */
43
- const TUI_ALERTS_GROUPED = new InjectionToken(ngDevMode ? 'TUI_ALERTS_GROUPED' : '', {
44
- factory: () => combineLatest([
45
- of(new Map()),
46
- inject(TUI_ALERTS),
47
- ]).pipe(map(([map, alerts]) => {
48
- map.forEach((_, key) => map.set(key, []));
49
- alerts.forEach((alert) => {
50
- const key = alert.component.component;
51
- const value = map.get(key) || [];
52
- map.set(key, [...value, alert]);
53
- });
54
- return Array.from(map.values());
55
- })),
56
- });
57
55
  function tuiAlertOptionsProvider(options) {
58
56
  return {
59
57
  provide: TUI_ALERT_OPTIONS,
@@ -66,49 +64,21 @@ function tuiAlertOptionsProvider(options) {
66
64
  };
67
65
  }
68
66
 
69
- class TuiAlertComponent {
70
- constructor() {
71
- this.el = tuiInjectElement();
72
- this.icons = inject(TUI_COMMON_ICONS);
73
- this.close = toSignal(inject(TUI_CLOSE_WORD));
74
- this.position = inject(TUI_ALERT_POSITION);
75
- this.item = injectContext();
76
- this.sub = of(typeof this.item.autoClose === 'function'
77
- ? this.item.autoClose(this.item.appearance)
78
- : this.item.autoClose)
79
- .pipe(switchMap((autoClose) => (autoClose ? timer(autoClose) : EMPTY)), takeUntil(fromEvent(this.el, 'mouseenter')), repeat({ delay: () => fromEvent(this.el, 'mouseleave') }), takeUntilDestroyed())
80
- .subscribe(() => this.item.$implicit.complete());
81
- }
82
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
83
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiAlertComponent, isStandalone: true, selector: "tui-alert", host: { attributes: { "role": "alert" }, properties: { "attr.data-orientation": "item.orientation", "class._bottom": "item.position === \"bottom\"", "style.margin": "position" } }, hostDirectives: [{ directive: i1.TuiAnimated }], 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{position:relative;display:grid;inline-size:18rem;word-break:break-word;isolation:isolate;grid-column:1;place-self:start start;filter:drop-shadow(0 .375rem 1rem rgba(0,0,0,.12));--tui-from: translateX(-100%)}:host[data-orientation=end]{justify-self:end;--tui-from: translateX(100%)}:host[data-orientation=center]{justify-self:center;--tui-from: translateY(-100%)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide,tuiCollapse}:host:not(:first-of-type){margin-block-start:0!important}:host:not(:last-of-type){margin-block-end:0!important}:host._bottom{align-self:end}:host._bottom:nth-of-type(1){grid-row:10001}:host._bottom:nth-of-type(2){grid-row:10002}:host._bottom:nth-of-type(3){grid-row:10003}:host._bottom:nth-of-type(4){grid-row:10004}:host._bottom:nth-of-type(5){grid-row:10005}:host._bottom:nth-of-type(6){grid-row:10006}:host._bottom:nth-of-type(7){grid-row:10007}:host._bottom:nth-of-type(8){grid-row:10008}:host._bottom:nth-of-type(9){grid-row:10009}:host._bottom:nth-of-type(10){grid-row:100010}:host._bottom[data-orientation=center]{--tui-from: translateY(100%)}.t-wrapper{grid-row:1 / span 2;background:var(--tui-background-base);clip-path:inset(.375rem 0 round var(--tui-radius-m))}.t-wrapper:before,.t-wrapper:after{content:\"\";display:block;block-size:.375rem}.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 }); }
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
- '[attr.data-orientation]': 'item.orientation',
90
- '[class._bottom]': 'item.position === "bottom"',
91
- '[style.margin]': 'position',
92
- }, 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{position:relative;display:grid;inline-size:18rem;word-break:break-word;isolation:isolate;grid-column:1;place-self:start start;filter:drop-shadow(0 .375rem 1rem rgba(0,0,0,.12));--tui-from: translateX(-100%)}:host[data-orientation=end]{justify-self:end;--tui-from: translateX(100%)}:host[data-orientation=center]{justify-self:center;--tui-from: translateY(-100%)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide,tuiCollapse}:host:not(:first-of-type){margin-block-start:0!important}:host:not(:last-of-type){margin-block-end:0!important}:host._bottom{align-self:end}:host._bottom:nth-of-type(1){grid-row:10001}:host._bottom:nth-of-type(2){grid-row:10002}:host._bottom:nth-of-type(3){grid-row:10003}:host._bottom:nth-of-type(4){grid-row:10004}:host._bottom:nth-of-type(5){grid-row:10005}:host._bottom:nth-of-type(6){grid-row:10006}:host._bottom:nth-of-type(7){grid-row:10007}:host._bottom:nth-of-type(8){grid-row:10008}:host._bottom:nth-of-type(9){grid-row:10009}:host._bottom:nth-of-type(10){grid-row:100010}:host._bottom[data-orientation=center]{--tui-from: translateY(100%)}.t-wrapper{grid-row:1 / span 2;background:var(--tui-background-base);clip-path:inset(.375rem 0 round var(--tui-radius-m))}.t-wrapper:before,.t-wrapper:after{content:\"\";display:block;block-size:.375rem}.t-closable{padding-inline-end:2.5rem}\n"] }]
93
- }] });
94
-
95
- class TuiAlertService extends TuiPortal {
67
+ class TuiAlertService extends TuiNotificationService {
96
68
  constructor() {
97
- super(...arguments);
69
+ super(inject(TUI_ALERT_CONCURRENCY));
98
70
  this.options = inject(TUI_ALERT_OPTIONS);
99
71
  this.component = TuiAlertComponent;
100
72
  }
101
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
102
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, providedIn: 'root', useClass: TuiAlertService, deps: [{ token: TuiPopupService }] }); }
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' }); }
103
75
  }
104
76
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlertService, decorators: [{
105
77
  type: Injectable,
106
78
  args: [{
107
79
  providedIn: 'root',
108
- deps: [TuiPopupService],
109
- useClass: TuiAlertService,
110
80
  }]
111
- }] });
81
+ }], ctorParameters: () => [] });
112
82
 
113
83
  class TuiAlert {
114
84
  constructor() {
@@ -132,32 +102,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
132
102
  }]
133
103
  }] });
134
104
 
135
- class TuiAlerts {
136
- constructor() {
137
- this.injector = inject(INJECTOR);
138
- this.alerts$ = inject(TUI_ALERTS_GROUPED);
139
- this.trackBy = identity;
140
- this.mapper = (useValue) => Injector.create({
141
- providers: [
142
- {
143
- provide: POLYMORPHEUS_CONTEXT,
144
- useValue,
145
- },
146
- ],
147
- parent: this.injector,
148
- });
149
- }
150
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlerts, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
151
- 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 }); }
152
- }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAlerts, decorators: [{
154
- type: Component,
155
- 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"] }]
156
- }] });
157
-
158
105
  /**
159
106
  * Generated bundle index. Do not edit.
160
107
  */
161
108
 
162
- export { TUI_ALERTS, TUI_ALERTS_GROUPED, TUI_ALERT_DEFAULT_OPTIONS, TUI_ALERT_OPTIONS, TUI_ALERT_POSITION, TuiAlert, TuiAlertComponent, TuiAlertService, TuiAlerts, tuiAlertOptionsProvider };
109
+ export { TUI_ALERT_CONCURRENCY, TUI_ALERT_DEFAULT_OPTIONS, TUI_ALERT_OPTIONS, TuiAlert, TuiAlertComponent, TuiAlertService, tuiAlertOptionsProvider };
163
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 position: 'top',\n orientation: '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 const TUI_ALERT_POSITION = new InjectionToken<string>(\n ngDevMode ? 'TUI_ALERT_POSITION' : '',\n {\n factory: () => (inject(TUI_IS_MOBILE) ? '0.625rem 1rem' : '1.625rem 3rem'),\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 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 {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 styleUrl: './alert.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiAnimated],\n host: {\n role: 'alert',\n '[attr.data-orientation]': 'item.orientation',\n '[class._bottom]': 'item.position === \"bottom\"',\n '[style.margin]': 'position',\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<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 {inject, Injectable} from '@angular/core';\nimport {TuiPortal} from '@taiga-ui/cdk/portals';\nimport {TuiPopupService} from '@taiga-ui/core/directives/popup';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {type TuiAlertOptions} from './alert.interfaces';\nimport {TUI_ALERT_OPTIONS} from './alert.tokens';\n\n@Injectable({\n providedIn: 'root',\n deps: [TuiPopupService],\n useClass: TuiAlertService,\n})\nexport class TuiAlertService extends TuiPortal<TuiAlertOptions<any>> {\n protected override readonly options = inject(TUI_ALERT_OPTIONS);\n protected override readonly component = TuiAlertComponent;\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","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 styleUrl: './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":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;AAQa,MAAA,yBAAyB,GAAiD;AACnF,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,QAAQ,EAAE,K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AAA,uBAAuB,CAAC,OAAO,EAAA,QAAA,EAAA,iYAAA,EAAA,MAAA,EAAA,CAAA,+QAAA,CAAA,EAAA;;;AE3BpD;;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<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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