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

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 (179) hide show
  1. package/components/alert/alert.component.d.ts +2 -3
  2. package/components/alert/alert.directive.d.ts +4 -3
  3. package/components/alert/alert.interfaces.d.ts +3 -1
  4. package/components/alert/alert.service.d.ts +5 -2
  5. package/components/button/button.directive.d.ts +2 -2
  6. package/components/button/button.options.d.ts +1 -1
  7. package/components/cell/cell.directive.d.ts +9 -0
  8. package/components/cell/cell.options.d.ts +6 -0
  9. package/components/cell/index.d.ts +2 -0
  10. package/components/dialog/active-zone-adapter.directive.d.ts +11 -0
  11. package/components/dialog/dialog.component.d.ts +6 -11
  12. package/components/dialog/dialog.directive.d.ts +1 -1
  13. package/components/dialog/dialog.factory.d.ts +1 -1
  14. package/components/dialog/dialog.options.d.ts +26 -0
  15. package/components/dialog/{dialog-close.service.d.ts → dialog.providers.d.ts} +4 -1
  16. package/components/dialog/dialog.service.d.ts +1 -1
  17. package/components/dialog/index.d.ts +2 -3
  18. package/components/error/error.component.d.ts +5 -7
  19. package/components/error/error.d.ts +4 -0
  20. package/components/error/error.directive.d.ts +19 -0
  21. package/components/error/error.pipe.d.ts +10 -0
  22. package/components/error/index.d.ts +3 -0
  23. package/components/expand/expand.component.d.ts +9 -28
  24. package/components/expand/index.d.ts +0 -2
  25. package/components/header/header.directive.d.ts +17 -0
  26. package/components/header/index.d.ts +1 -0
  27. package/components/icon/icon.component.d.ts +6 -11
  28. package/components/index.d.ts +2 -1
  29. package/components/notification/notification.directive.d.ts +1 -1
  30. package/components/notification/notification.options.d.ts +1 -1
  31. package/components/root/root.component.d.ts +4 -6
  32. package/components/scrollbar/scrollbar.options.d.ts +1 -1
  33. package/components/textfield/index.d.ts +1 -3
  34. package/components/textfield/textfield-content.directive.d.ts +3 -2
  35. package/components/textfield/textfield-icon.d.ts +3 -3
  36. package/components/textfield/textfield-multi/textfield-multi.component.d.ts +4 -5
  37. package/components/textfield/textfield.component.d.ts +1 -2
  38. package/components/textfield/textfield.d.ts +2 -3
  39. package/components/textfield/textfield.directive.d.ts +1 -1
  40. package/directives/appearance/appearance.directive.d.ts +5 -13
  41. package/directives/appearance/appearance.options.d.ts +1 -1
  42. package/directives/dropdown/dropdown-content.directive.d.ts +9 -0
  43. package/directives/dropdown/dropdown.d.ts +2 -2
  44. package/directives/dropdown/index.d.ts +1 -3
  45. package/directives/hint/hint-options.directive.d.ts +3 -3
  46. package/directives/hint/hint.component.d.ts +6 -8
  47. package/directives/hint/hint.directive.d.ts +1 -1
  48. package/directives/icons/icons.bindings.d.ts +5 -0
  49. package/directives/icons/icons.directive.d.ts +8 -16
  50. package/directives/icons/index.d.ts +1 -0
  51. package/directives/index.d.ts +0 -1
  52. package/directives/popup/popup.directive.d.ts +6 -5
  53. package/directives/popup/popup.service.d.ts +1 -1
  54. package/directives/popup/popups.component.d.ts +2 -2
  55. package/directives/title/title.directive.d.ts +2 -3
  56. package/fesm2022/taiga-ui-core-animations.mjs.map +1 -1
  57. package/fesm2022/taiga-ui-core-classes.mjs +3 -3
  58. package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-core-components-alert.mjs +46 -32
  60. package/fesm2022/taiga-ui-core-components-alert.mjs.map +1 -1
  61. package/fesm2022/taiga-ui-core-components-button.mjs +13 -20
  62. package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
  63. package/fesm2022/taiga-ui-core-components-calendar.mjs +16 -19
  64. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  65. package/fesm2022/taiga-ui-core-components-cell.mjs +45 -0
  66. package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -0
  67. package/fesm2022/taiga-ui-core-components-data-list.mjs +28 -29
  68. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  69. package/fesm2022/taiga-ui-core-components-dialog.mjs +101 -82
  70. package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
  71. package/fesm2022/taiga-ui-core-components-error.mjs +107 -24
  72. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  73. package/fesm2022/taiga-ui-core-components-expand.mjs +34 -132
  74. package/fesm2022/taiga-ui-core-components-expand.mjs.map +1 -1
  75. package/fesm2022/taiga-ui-core-components-header.mjs +42 -0
  76. package/fesm2022/taiga-ui-core-components-header.mjs.map +1 -0
  77. package/fesm2022/taiga-ui-core-components-icon.mjs +22 -39
  78. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  79. package/fesm2022/taiga-ui-core-components-label.mjs +9 -12
  80. package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
  81. package/fesm2022/taiga-ui-core-components-link.mjs +9 -12
  82. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  83. package/fesm2022/taiga-ui-core-components-loader.mjs +5 -6
  84. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  85. package/fesm2022/taiga-ui-core-components-notification.mjs +16 -30
  86. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  87. package/fesm2022/taiga-ui-core-components-root.mjs +20 -48
  88. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  89. package/fesm2022/taiga-ui-core-components-scrollbar.mjs +26 -26
  90. package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
  91. package/fesm2022/taiga-ui-core-components-spin-button.mjs +6 -6
  92. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  93. package/fesm2022/taiga-ui-core-components-textfield.mjs +154 -248
  94. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  95. package/fesm2022/taiga-ui-core-components.mjs +2 -1
  96. package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
  97. package/fesm2022/taiga-ui-core-directives-appearance.mjs +26 -63
  98. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  99. package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
  100. package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
  101. package/fesm2022/taiga-ui-core-directives-dropdown.mjs +82 -119
  102. package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
  103. package/fesm2022/taiga-ui-core-directives-group.mjs +9 -12
  104. package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
  105. package/fesm2022/taiga-ui-core-directives-hint.mjs +71 -81
  106. package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
  107. package/fesm2022/taiga-ui-core-directives-icons.mjs +35 -45
  108. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  109. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +9 -9
  110. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  111. package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
  112. package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
  113. package/fesm2022/taiga-ui-core-directives-popup.mjs +20 -26
  114. package/fesm2022/taiga-ui-core-directives-popup.mjs.map +1 -1
  115. package/fesm2022/taiga-ui-core-directives-title.mjs +13 -19
  116. package/fesm2022/taiga-ui-core-directives-title.mjs.map +1 -1
  117. package/fesm2022/taiga-ui-core-directives.mjs +0 -1
  118. package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
  119. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +3 -3
  120. package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +1 -1
  121. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +3 -3
  122. package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +1 -1
  123. package/fesm2022/taiga-ui-core-pipes-flag.mjs +3 -3
  124. package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +1 -1
  125. package/fesm2022/taiga-ui-core-pipes-format-date.mjs +3 -3
  126. package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +1 -1
  127. package/fesm2022/taiga-ui-core-pipes-format-number.mjs +3 -3
  128. package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
  129. package/fesm2022/taiga-ui-core-pipes-initials.mjs +3 -3
  130. package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +1 -1
  131. package/fesm2022/taiga-ui-core-pipes-month.mjs +3 -3
  132. package/fesm2022/taiga-ui-core-pipes-month.mjs.map +1 -1
  133. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +3 -3
  134. package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +1 -1
  135. package/fesm2022/taiga-ui-core-pipes.mjs +0 -1
  136. package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
  137. package/fesm2022/taiga-ui-core-services.mjs +15 -15
  138. package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
  139. package/fesm2022/taiga-ui-core-tokens.mjs +24 -32
  140. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  141. package/fesm2022/taiga-ui-core-utils-dom.mjs.map +1 -1
  142. package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
  143. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +49 -3
  144. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  145. package/package.json +10 -14
  146. package/pipes/index.d.ts +0 -1
  147. package/styles/components/button.less +0 -2
  148. package/styles/components/icon.less +32 -26
  149. package/styles/components/icons.less +14 -12
  150. package/styles/components/link.less +0 -3
  151. package/styles/mixins/mixins.less +9 -2
  152. package/styles/mixins/mixins.scss +9 -2
  153. package/styles/mixins/slider.less +21 -16
  154. package/tokens/icon-resolver.d.ts +1 -5
  155. package/tokens/index.d.ts +1 -0
  156. package/tokens/validation-errors.d.ts +4 -0
  157. package/utils/miscellaneous/index.d.ts +1 -0
  158. package/utils/miscellaneous/provide-taiga.d.ts +13 -0
  159. package/components/dialog/dialog.interfaces.d.ts +0 -34
  160. package/components/dialog/dialog.tokens.d.ts +0 -15
  161. package/components/expand/expand-content.directive.d.ts +0 -8
  162. package/components/expand/expand.d.ts +0 -6
  163. package/components/fullscreen/fullscreen.component.d.ts +0 -14
  164. package/components/fullscreen/index.d.ts +0 -1
  165. package/components/textfield/select.directive.d.ts +0 -19
  166. package/components/textfield/textfield-dropdown.directive.d.ts +0 -16
  167. package/directives/dropdown/dropdown-portal.directive.d.ts +0 -14
  168. package/directives/dropdown/dropdown.service.d.ts +0 -6
  169. package/directives/dropdown/dropdowns.component.d.ts +0 -9
  170. package/directives/surface/index.d.ts +0 -1
  171. package/directives/surface/surface.directive.d.ts +0 -8
  172. package/fesm2022/taiga-ui-core-components-fullscreen.mjs +0 -66
  173. package/fesm2022/taiga-ui-core-components-fullscreen.mjs.map +0 -1
  174. package/fesm2022/taiga-ui-core-directives-surface.mjs +0 -50
  175. package/fesm2022/taiga-ui-core-directives-surface.mjs.map +0 -1
  176. package/fesm2022/taiga-ui-core-pipes-fallback-src.mjs +0 -29
  177. package/fesm2022/taiga-ui-core-pipes-fallback-src.mjs.map +0 -1
  178. package/pipes/fallback-src/fallback-src.pipe.d.ts +0 -9
  179. package/pipes/fallback-src/index.d.ts +0 -1
@@ -1,40 +1,123 @@
1
- import { NgIf } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, Input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, computed, input, ChangeDetectionStrategy, Component, isSignal, Directive, TemplateRef, untracked, Pipe } from '@angular/core';
4
3
  import { toSignal } from '@angular/core/rxjs-interop';
5
4
  import { TuiValidationError } from '@taiga-ui/cdk/classes';
6
5
  import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
7
- import { tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
8
- import { TUI_ANIMATIONS_SPEED, TUI_DEFAULT_ERROR_MESSAGE } from '@taiga-ui/core/tokens';
9
- import { tuiToAnimationOptions } from '@taiga-ui/core/utils';
10
- import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
6
+ import { tuiIsString, tuiDirectiveBinding, tuiProvide, tuiSetSignal } from '@taiga-ui/cdk/utils/miscellaneous';
7
+ import { TUI_DEFAULT_ERROR_MESSAGE, TUI_VALIDATION_ERRORS } from '@taiga-ui/core/tokens';
8
+ import { PolymorpheusOutlet, PolymorpheusTemplate, PolymorpheusComponent } from '@taiga-ui/polymorpheus';
9
+ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';
10
+ import { Subject, distinctUntilChanged, switchMap, startWith, map } from 'rxjs';
11
11
 
12
- class TuiError {
12
+ class TuiErrorComponent {
13
13
  constructor() {
14
- this.options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));
15
- this.error = null;
16
- this.visible = true;
17
14
  this.default = toSignal(inject(TUI_DEFAULT_ERROR_MESSAGE));
15
+ this.content = computed((error = this.error()) => tuiIsString(error) ? new TuiValidationError(error) : error);
16
+ this.error = input(null);
18
17
  }
19
- set errorSetter(error) {
20
- this.error = tuiIsString(error) ? new TuiValidationError(error) : error;
21
- }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiError, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
23
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiError, isStandalone: true, selector: "tui-error", inputs: { errorSetter: ["error", "errorSetter"] }, host: { properties: { "class._error": "error" } }, ngImport: i0, template: "<div\n *ngIf=\"error\"\n automation-id=\"tui-error__text\"\n tuiAnimated\n class=\"t-message-text\"\n>\n <ng-container *polymorpheusOutlet=\"error.message || default() as text; context: error.context || {}\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{transition-property:grid-template-rows;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:grid;font:var(--tui-font-text-s);color:var(--tui-text-negative);overflow-wrap:break-word;grid-template-rows:0fr}:host._error{grid-template-rows:1fr}.t-message-text{white-space:pre-line;grid-row:1 / span 2;overflow:hidden}.t-message-text.tui-enter,.t-message-text.tui-leave{animation-name:tuiFade}.t-message-text:before{content:\"\";line-height:1.5rem;vertical-align:bottom}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiAnimated, selector: "[tuiAnimated]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
18
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
19
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiErrorComponent, isStandalone: true, selector: "tui-error", inputs: { error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class._error": "content()" } }, ngImport: i0, template: "@if (content(); as error) {\n <span\n tuiAnimated\n class=\"t-message-text\"\n >\n <span\n *polymorpheusOutlet=\"error.message || default() as text; context: error.context || {}\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n}\n", styles: [":host{transition-property:grid-template-rows;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:grid;font:var(--tui-font-text-s);color:var(--tui-text-negative);overflow-wrap:break-word;grid-template-rows:0fr}:host._error{grid-template-rows:1fr}.t-message-text{white-space:pre-line;grid-area:1 / 1 / span 2;overflow:hidden}.t-message-text.tui-enter,.t-message-text.tui-leave{animation-name:tuiFade}.t-message-text:before{content:\"\";line-height:1.5rem;vertical-align:bottom}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiAnimated, selector: "[tuiAnimated]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
24
20
  }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiError, decorators: [{
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorComponent, decorators: [{
26
22
  type: Component,
27
- args: [{ selector: 'tui-error', imports: [NgIf, PolymorpheusOutlet, TuiAnimated], changeDetection: ChangeDetectionStrategy.OnPush, host: {
28
- '[class._error]': 'error',
29
- }, template: "<div\n *ngIf=\"error\"\n automation-id=\"tui-error__text\"\n tuiAnimated\n class=\"t-message-text\"\n>\n <ng-container *polymorpheusOutlet=\"error.message || default() as text; context: error.context || {}\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{transition-property:grid-template-rows;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:grid;font:var(--tui-font-text-s);color:var(--tui-text-negative);overflow-wrap:break-word;grid-template-rows:0fr}:host._error{grid-template-rows:1fr}.t-message-text{white-space:pre-line;grid-row:1 / span 2;overflow:hidden}.t-message-text.tui-enter,.t-message-text.tui-leave{animation-name:tuiFade}.t-message-text:before{content:\"\";line-height:1.5rem;vertical-align:bottom}\n"] }]
30
- }], propDecorators: { errorSetter: [{
31
- type: Input,
32
- args: ['error']
33
- }] } });
23
+ args: [{ selector: 'tui-error', imports: [PolymorpheusOutlet, TuiAnimated], changeDetection: ChangeDetectionStrategy.OnPush, host: {
24
+ '[class._error]': 'content()',
25
+ }, template: "@if (content(); as error) {\n <span\n tuiAnimated\n class=\"t-message-text\"\n >\n <span\n *polymorpheusOutlet=\"error.message || default() as text; context: error.context || {}\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n}\n", styles: [":host{transition-property:grid-template-rows;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:grid;font:var(--tui-font-text-s);color:var(--tui-text-negative);overflow-wrap:break-word;grid-template-rows:0fr}:host._error{grid-template-rows:1fr}.t-message-text{white-space:pre-line;grid-area:1 / 1 / span 2;overflow:hidden}.t-message-text.tui-enter,.t-message-text.tui-leave{animation-name:tuiFade}.t-message-text:before{content:\"\";line-height:1.5rem;vertical-align:bottom}\n"] }]
26
+ }] });
27
+
28
+ class TuiErrorDirective {
29
+ constructor() {
30
+ this.content = inject(TUI_VALIDATION_ERRORS);
31
+ this.control = new Subject();
32
+ this.errors = toSignal(this.control.pipe(distinctUntilChanged(), switchMap((control) => control.events.pipe(startWith(null), map(() => control.invalid && control.touched && control.errors)))));
33
+ this.key = computed((errors = this.errors() || {}) => this.order().find((id) => errors[id]) || Object.keys(errors)[0] || '');
34
+ this.order = input([]);
35
+ this.error = tuiDirectiveBinding(TuiErrorComponent, 'error', computed((errors = this.errors() || null) => errors && this.getError(errors[this.key()], this.content[this.key()])), { self: true, optional: true });
36
+ }
37
+ registerOnChange() { }
38
+ registerOnTouched() { }
39
+ writeValue() { }
40
+ validate(control) {
41
+ this.control.next(control);
42
+ return null;
43
+ }
44
+ getError(context, content) {
45
+ context = isSignal(context) ? context() : context;
46
+ if (context instanceof TuiValidationError) {
47
+ return context;
48
+ }
49
+ if (content === undefined && isContent(context)) {
50
+ return getError(context);
51
+ }
52
+ if (isSignal(content)) {
53
+ return getError(content(), context);
54
+ }
55
+ if (content instanceof Function) {
56
+ const message = content(context);
57
+ return getError(isSignal(message) ? message() : message, context);
58
+ }
59
+ return getError(content, context);
60
+ }
61
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
62
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiErrorDirective, isStandalone: true, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName]", inputs: { order: { classPropertyName: "order", publicName: "order", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
63
+ tuiProvide(NG_VALUE_ACCESSOR, TuiErrorDirective, true),
64
+ tuiProvide(NG_VALIDATORS, TuiErrorDirective, true),
65
+ ], ngImport: i0 }); }
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorDirective, decorators: [{
68
+ type: Directive,
69
+ args: [{
70
+ selector: 'tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName]',
71
+ providers: [
72
+ tuiProvide(NG_VALUE_ACCESSOR, TuiErrorDirective, true),
73
+ tuiProvide(NG_VALIDATORS, TuiErrorDirective, true),
74
+ ],
75
+ }]
76
+ }] });
77
+ function getError(content = '', context) {
78
+ return new TuiValidationError(content, context);
79
+ }
80
+ function isContent(value) {
81
+ return (tuiIsString(value) ||
82
+ value instanceof TemplateRef ||
83
+ value instanceof PolymorpheusTemplate ||
84
+ value instanceof PolymorpheusComponent);
85
+ }
86
+
87
+ class TuiErrorPipe {
88
+ constructor() {
89
+ this.control = inject(NgControl);
90
+ this.directive = new TuiErrorDirective();
91
+ }
92
+ transform(order) {
93
+ untracked(() => {
94
+ this.directive.validate(this.control.control);
95
+ tuiSetSignal(this.directive.order, order);
96
+ });
97
+ const error = this.directive.error();
98
+ if (!error) {
99
+ return '';
100
+ }
101
+ return typeof error.message === 'function'
102
+ ? error.message(error.context)
103
+ : error.message;
104
+ }
105
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
106
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorPipe, isStandalone: true, name: "tuiError", pure: false }); }
107
+ }
108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiErrorPipe, decorators: [{
109
+ type: Pipe,
110
+ args: [{
111
+ name: 'tuiError',
112
+ pure: false,
113
+ }]
114
+ }] });
115
+
116
+ const TuiError = [TuiErrorComponent, TuiErrorDirective, TuiErrorPipe];
34
117
 
35
118
  /**
36
119
  * Generated bundle index. Do not edit.
37
120
  */
38
121
 
39
- export { TuiError };
122
+ export { TuiError, TuiErrorComponent, TuiErrorDirective, TuiErrorPipe };
40
123
  //# sourceMappingURL=taiga-ui-core-components-error.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-error.mjs","sources":["../../../projects/core/components/error/error.component.ts","../../../projects/core/components/error/error.template.html","../../../projects/core/components/error/taiga-ui-core-components-error.ts"],"sourcesContent":["import {NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TuiValidationError} from '@taiga-ui/cdk/classes';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_ANIMATIONS_SPEED, TUI_DEFAULT_ERROR_MESSAGE} from '@taiga-ui/core/tokens';\nimport {tuiToAnimationOptions} from '@taiga-ui/core/utils';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\n@Component({\n selector: 'tui-error',\n imports: [NgIf, PolymorpheusOutlet, TuiAnimated],\n templateUrl: './error.template.html',\n styleUrls: ['./error.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._error]': 'error',\n },\n})\nexport class TuiError {\n protected readonly options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));\n protected error: TuiValidationError | null = null;\n protected visible = true;\n protected readonly default = toSignal(inject(TUI_DEFAULT_ERROR_MESSAGE));\n\n @Input('error')\n public set errorSetter(error: TuiValidationError | string | null) {\n this.error = tuiIsString(error) ? new TuiValidationError(error) : error;\n }\n}\n","<div\n *ngIf=\"error\"\n automation-id=\"tui-error__text\"\n tuiAnimated\n class=\"t-message-text\"\n>\n <ng-container *polymorpheusOutlet=\"error.message || default() as text; context: error.context || {}\">\n {{ text }}\n </ng-container>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAoBa,QAAQ,CAAA;AAVrB,IAAA,WAAA,GAAA;QAWuB,IAAA,CAAA,OAAO,GAAG,qBAAqB,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACtE,IAAA,CAAA,KAAK,GAA8B,IAAI;QACvC,IAAA,CAAA,OAAO,GAAG,IAAI;QACL,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAM3E,IAAA;IAJG,IACW,WAAW,CAAC,KAAyC,EAAA;AAC5D,QAAA,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,KAAK;IAC3E;8GATS,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAR,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAQ,2KCpBrB,oRAUA,EAAA,MAAA,EAAA,CAAA,kgBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDEc,IAAI,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,kBAAkB,8HAAE,WAAW,EAAA,QAAA,EAAA,eAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAQtC,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAVpB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,OAAA,EACZ,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAAA,eAAA,EAG/B,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACF,wBAAA,gBAAgB,EAAE,OAAO;AAC5B,qBAAA,EAAA,QAAA,EAAA,oRAAA,EAAA,MAAA,EAAA,CAAA,kgBAAA,CAAA,EAAA;8BASU,WAAW,EAAA,CAAA;sBADrB,KAAK;uBAAC,OAAO;;;AE1BlB;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-error.mjs","sources":["../../../projects/core/components/error/error.component.ts","../../../projects/core/components/error/error.template.html","../../../projects/core/components/error/error.directive.ts","../../../projects/core/components/error/error.pipe.ts","../../../projects/core/components/error/error.ts","../../../projects/core/components/error/taiga-ui-core-components-error.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, computed, inject, input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TuiValidationError} from '@taiga-ui/cdk/classes';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_DEFAULT_ERROR_MESSAGE} from '@taiga-ui/core/tokens';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\n@Component({\n selector: 'tui-error',\n imports: [PolymorpheusOutlet, TuiAnimated],\n templateUrl: './error.template.html',\n styleUrl: './error.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._error]': 'content()',\n },\n})\nexport class TuiErrorComponent {\n protected readonly default = toSignal(inject(TUI_DEFAULT_ERROR_MESSAGE));\n protected readonly content = computed((error = this.error()) =>\n tuiIsString(error) ? new TuiValidationError(error) : error,\n );\n\n public readonly error = input<TuiValidationError | string | null>(null);\n}\n","@if (content(); as error) {\n <span\n tuiAnimated\n class=\"t-message-text\"\n >\n <span\n *polymorpheusOutlet=\"error.message || default() as text; context: error.context || {}\"\n [innerHTML]=\"text\"\n ></span>\n </span>\n}\n","import {\n computed,\n Directive,\n inject,\n input,\n isSignal,\n type Signal,\n TemplateRef,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {\n type AbstractControl,\n type ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n type ValidationErrors,\n type Validator,\n} from '@angular/forms';\nimport {TuiValidationError} from '@taiga-ui/cdk/classes';\nimport {\n tuiDirectiveBinding,\n tuiIsString,\n tuiProvide,\n} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_VALIDATION_ERRORS} from '@taiga-ui/core/tokens';\nimport {\n PolymorpheusComponent,\n type PolymorpheusContent,\n PolymorpheusTemplate,\n} from '@taiga-ui/polymorpheus';\nimport {distinctUntilChanged, map, startWith, Subject, switchMap} from 'rxjs';\n\nimport {TuiErrorComponent} from './error.component';\n\n@Directive({\n selector:\n 'tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName]',\n providers: [\n tuiProvide(NG_VALUE_ACCESSOR, TuiErrorDirective, true),\n tuiProvide(NG_VALIDATORS, TuiErrorDirective, true),\n ],\n})\nexport class TuiErrorDirective implements ControlValueAccessor, Validator {\n private readonly content = inject(TUI_VALIDATION_ERRORS);\n private readonly control = new Subject<AbstractControl>();\n\n private readonly errors = toSignal(\n this.control.pipe(\n distinctUntilChanged(),\n switchMap((control) =>\n control.events.pipe(\n startWith(null),\n map(() => control.invalid && control.touched && control.errors),\n ),\n ),\n ),\n );\n\n private readonly key = computed(\n (errors = this.errors() || {}) =>\n this.order().find((id) => errors[id]) || Object.keys(errors)[0] || '',\n );\n\n public readonly order = input<readonly string[]>([]);\n public readonly error = tuiDirectiveBinding(\n TuiErrorComponent,\n 'error',\n computed(\n (errors = this.errors() || null) =>\n errors && this.getError(errors[this.key()], this.content[this.key()]),\n ),\n {self: true, optional: true},\n );\n\n public registerOnChange(): void {}\n public registerOnTouched(): void {}\n public writeValue(): void {}\n public validate(control: AbstractControl): ValidationErrors | null {\n this.control.next(control);\n\n return null;\n }\n\n private getError(\n context: unknown,\n content?: PolymorpheusContent | Signal<PolymorpheusContent>,\n ): TuiValidationError {\n context = isSignal(context) ? context() : context;\n\n if (context instanceof TuiValidationError) {\n return context;\n }\n\n if (content === undefined && isContent(context)) {\n return getError(context);\n }\n\n if (isSignal(content)) {\n return getError(content(), context);\n }\n\n if (content instanceof Function) {\n const message = content(context);\n\n return getError(isSignal(message) ? message() : message, context);\n }\n\n return getError(content, context);\n }\n}\n\nfunction getError(content: unknown = '', context?: any): TuiValidationError {\n return new TuiValidationError(content as PolymorpheusContent, context);\n}\n\nfunction isContent(value: unknown): value is PolymorpheusContent {\n return (\n tuiIsString(value) ||\n value instanceof TemplateRef ||\n value instanceof PolymorpheusTemplate ||\n value instanceof PolymorpheusComponent\n );\n}\n","import {inject, Pipe, type PipeTransform, untracked} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {tuiSetSignal} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nimport {TuiErrorDirective} from './error.directive';\n\n@Pipe({\n name: 'tuiError',\n pure: false,\n})\nexport class TuiErrorPipe implements PipeTransform {\n private readonly control = inject(NgControl);\n private readonly directive = new TuiErrorDirective();\n\n public transform(order: readonly string[]): PolymorpheusContent {\n untracked(() => {\n this.directive.validate(this.control.control!);\n tuiSetSignal(this.directive.order, order);\n });\n\n const error = this.directive.error();\n\n if (!error) {\n return '';\n }\n\n return typeof error.message === 'function'\n ? error.message(error.context)\n : error.message;\n }\n}\n","import {TuiErrorComponent} from './error.component';\nimport {TuiErrorDirective} from './error.directive';\nimport {TuiErrorPipe} from './error.pipe';\n\nexport const TuiError = [TuiErrorComponent, TuiErrorDirective, TuiErrorPipe] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAkBa,iBAAiB,CAAA;AAV9B,IAAA,WAAA,GAAA;QAWuB,IAAO,CAAA,OAAA,GAAG,QAAQ,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACrD,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,KACvD,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,KAAK,CAC7D;AAEe,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAqC,IAAI,CAAC;AAC1E;+GAPY,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,EClB9B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,cAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,iSAWA,EDDc,MAAA,EAAA,CAAA,ugBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,kBAAkB,8HAAE,W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angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, inject, ChangeDetectorRef, DestroyRef, TemplateRef, Input, ContentChild, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { tuiParentAnimation } from '@taiga-ui/core/animations';
6
- import { TuiLoader } from '@taiga-ui/core/components/loader';
7
- import { timer } from 'rxjs';
3
+ import { contentChild, TemplateRef, signal, input, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { TuiItem } from '@taiga-ui/cdk/directives/item';
8
5
 
9
- /**
10
- * @deprecated use {@link TuiExpand} from @taiga-ui/experimental
11
- */
12
- class TuiExpandContent {
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiExpandContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
14
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.9", type: TuiExpandContent, isStandalone: true, selector: "[tuiExpandContent]", ngImport: i0 }); }
15
- }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiExpandContent, decorators: [{
17
- type: Directive,
18
- args: [{
19
- standalone: true,
20
- selector: '[tuiExpandContent]',
21
- }]
22
- }] });
23
-
24
- const State = {
25
- Idle: 0,
26
- Loading: 1,
27
- Prepared: 2,
28
- Animated: 3,
29
- };
30
- const LOADER_HEIGHT = 48;
31
- /**
32
- * An event indicating that async data for expand has finished loading.
33
- * Dispatch to finish loading states for {@link TuiExpandComponent}.
34
- */
35
- const TUI_EXPAND_LOADED = 'tui-expand-loaded';
36
- /**
37
- * @deprecated use {@link TuiExpand} from @taiga-ui/experimental
38
- */
39
- class TuiExpandComponent {
6
+ class TuiExpand {
40
7
  constructor() {
41
- this.cdr = inject(ChangeDetectorRef);
42
- this.destroyRef = inject(DestroyRef);
43
- this.state = State.Idle;
44
- this.content = null;
45
- this.expanded = null;
46
- this.async = false;
47
- }
48
- set expandedSetter(expanded) {
49
- if (this.expanded === null) {
50
- this.expanded = expanded;
51
- return;
52
- }
53
- if (this.state !== State.Idle) {
54
- this.expanded = expanded;
55
- this.state = State.Animated;
56
- return;
57
- }
58
- this.expanded = expanded;
59
- this.retrigger(this.async && expanded ? State.Loading : State.Animated);
60
- }
61
- get contentVisible() {
62
- return this.expanded || this.state !== State.Idle;
8
+ this.content = contentChild(TuiItem, { read: TemplateRef });
9
+ this.open = signal(false);
10
+ this.expanded = input(false);
63
11
  }
64
- get overflow() {
65
- return this.state !== State.Idle;
12
+ ngOnInit() {
13
+ this.open.set(this.expanded());
66
14
  }
67
- get loading() {
68
- return !!this.expanded && this.async && this.state === State.Loading;
69
- }
70
- get height() {
71
- const { expanded, state, contentWrapper } = this;
72
- if ((expanded && state === State.Prepared) ||
73
- (!expanded && state === State.Animated)) {
74
- return 0;
75
- }
76
- if (contentWrapper &&
77
- ((!expanded && state === State.Prepared) ||
78
- (expanded && state === State.Animated))) {
79
- return contentWrapper.nativeElement.offsetHeight;
80
- }
81
- if (contentWrapper && expanded && state === State.Loading) {
82
- return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);
83
- }
84
- return null;
85
- }
86
- onTransitionEnd({ propertyName, pseudoElement }) {
87
- if (propertyName === 'opacity' &&
88
- !pseudoElement &&
89
- this.state === State.Animated) {
90
- this.state = State.Idle;
91
- }
92
- }
93
- onExpandLoaded(event) {
94
- event.stopPropagation();
95
- if (this.state === State.Loading) {
96
- this.retrigger(State.Animated);
15
+ onTransitionEnd({ propertyName }) {
16
+ if (propertyName === 'grid-template-rows') {
17
+ this.open.set(this.expanded());
97
18
  }
98
19
  }
99
- retrigger(state) {
100
- this.state = State.Prepared;
101
- timer(0)
102
- .pipe(takeUntilDestroyed(this.destroyRef))
103
- .subscribe(() => {
104
- // We need delay to re-trigger CSS height transition from the correct number
105
- if (this.state !== State.Prepared) {
106
- return;
20
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiExpand, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
21
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiExpand, isStandalone: true, selector: "tui-expand", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "transitionend.self": "onTransitionEnd($event)" }, properties: { "class._expanded": "expanded()", "class._open": "open()" } }, queries: [{ propertyName: "content", first: true, predicate: TuiItem, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: `
22
+ <div class="t-wrapper">
23
+ @if (expanded() || open()) {
24
+ <ng-container [ngTemplateOutlet]="content() || null" />
107
25
  }
108
- this.state = state;
109
- this.cdr.markForCheck();
110
- });
111
- }
112
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiExpandComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
113
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiExpandComponent, isStandalone: true, selector: "tui-expand", inputs: { async: "async", expandedSetter: ["expanded", "expandedSetter"] }, host: { listeners: { "transitionend.self": "onTransitionEnd($event)", "tui-expand-loaded": "onExpandLoaded($event)" }, properties: { "style.height.px": "height", "class._loading": "loading", "class._overflow": "overflow", "class._expanded": "expanded", "attr.aria-expanded": "expanded" } }, queries: [{ propertyName: "content", first: true, predicate: TuiExpandContent, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "contentWrapper", first: true, predicate: ["wrapper"], descendants: true }], ngImport: i0, template: "<div\n #wrapper\n class=\"t-wrapper\"\n @tuiParentAnimation\n [@.disabled]=\"overflow\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content />\n <tui-loader\n *ngIf=\"async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </tui-loader>\n </ng-container>\n</div>\n", styles: [":host{transition-property:opacity,height,visibility;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;opacity:0;transition-delay:1ms}:host._overflow{overflow:hidden}:host._expanded{opacity:1}:host._loading{opacity:.99}.t-wrapper:before,.t-wrapper:after{content:\"\";display:table}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }], animations: [tuiParentAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
26
+ <ng-content />
27
+ </div>
28
+ `, isInline: true, styles: [":host{transition-property:grid-template-rows,padding;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:grid;grid-template-rows:0fr;transition-delay:1ms}:host:not(._expanded){padding-block:0}:host._expanded{grid-template-rows:1fr}:host._expanded>.t-wrapper{opacity:1;visibility:visible}:host._expanded._open>.t-wrapper{overflow:visible}.t-wrapper{transition-property:all;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;grid-row:1 / span 2;overflow:hidden;opacity:0;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
114
29
  }
115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiExpandComponent, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiExpand, decorators: [{
116
31
  type: Component,
117
- args: [{ selector: 'tui-expand', imports: [NgIf, NgTemplateOutlet, TuiLoader], changeDetection: ChangeDetectionStrategy.OnPush, animations: [tuiParentAnimation], host: {
118
- '[style.height.px]': 'height',
119
- '[class._loading]': 'loading',
120
- '[class._overflow]': 'overflow',
121
- '[class._expanded]': 'expanded',
122
- '[attr.aria-expanded]': 'expanded',
32
+ args: [{ selector: 'tui-expand', imports: [NgTemplateOutlet], template: `
33
+ <div class="t-wrapper">
34
+ @if (expanded() || open()) {
35
+ <ng-container [ngTemplateOutlet]="content() || null" />
36
+ }
37
+ <ng-content />
38
+ </div>
39
+ `, changeDetection: ChangeDetectionStrategy.OnPush, host: {
40
+ '[class._expanded]': 'expanded()',
41
+ '[class._open]': 'open()',
123
42
  '(transitionend.self)': 'onTransitionEnd($event)',
124
- [`(${TUI_EXPAND_LOADED})`]: 'onExpandLoaded($event)',
125
- }, template: "<div\n #wrapper\n class=\"t-wrapper\"\n @tuiParentAnimation\n [@.disabled]=\"overflow\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content />\n <tui-loader\n *ngIf=\"async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </tui-loader>\n </ng-container>\n</div>\n", styles: [":host{transition-property:opacity,height,visibility;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;opacity:0;transition-delay:1ms}:host._overflow{overflow:hidden}:host._expanded{opacity:1}:host._loading{opacity:.99}.t-wrapper:before,.t-wrapper:after{content:\"\";display:table}\n"] }]
126
- }], propDecorators: { contentWrapper: [{
127
- type: ViewChild,
128
- args: ['wrapper']
129
- }], content: [{
130
- type: ContentChild,
131
- args: [TuiExpandContent, { read: TemplateRef }]
132
- }], async: [{
133
- type: Input
134
- }], expandedSetter: [{
135
- type: Input,
136
- args: ['expanded']
137
- }] } });
138
-
139
- /**
140
- * @deprecated use {@link TuiExpand} from @taiga-ui/experimental
141
- */
142
- const TuiExpand = [TuiExpandComponent, TuiExpandContent];
43
+ }, styles: [":host{transition-property:grid-template-rows,padding;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:grid;grid-template-rows:0fr;transition-delay:1ms}:host:not(._expanded){padding-block:0}:host._expanded{grid-template-rows:1fr}:host._expanded>.t-wrapper{opacity:1;visibility:visible}:host._expanded._open>.t-wrapper{overflow:visible}.t-wrapper{transition-property:all;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;grid-row:1 / span 2;overflow:hidden;opacity:0;visibility:hidden}\n"] }]
44
+ }] });
143
45
 
144
46
  /**
145
47
  * Generated bundle index. Do not edit.
146
48
  */
147
49
 
148
- export { TUI_EXPAND_LOADED, TuiExpand, TuiExpandComponent, TuiExpandContent };
50
+ export { TuiExpand };
149
51
  //# sourceMappingURL=taiga-ui-core-components-expand.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-expand.mjs","sources":["../../../projects/core/components/expand/expand-content.directive.ts","../../../projects/core/components/expand/expand.component.ts","../../../projects/core/components/expand/expand.template.html","../../../projects/core/components/expand/expand.ts","../../../projects/core/components/expand/taiga-ui-core-components-expand.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n/**\n * @deprecated use {@link TuiExpand} from @taiga-ui/experimental\n */\n@Directive({\n standalone: true,\n selector: '[tuiExpandContent]',\n})\nexport class TuiExpandContent {}\n","import {NgIf, type NgIfContext, NgTemplateOutlet} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n DestroyRef,\n type ElementRef,\n inject,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {type TuiValuesOf} from '@taiga-ui/cdk/types';\nimport {tuiParentAnimation} from '@taiga-ui/core/animations';\nimport {TuiLoader} from '@taiga-ui/core/components/loader';\nimport {timer} from 'rxjs';\n\nimport {TuiExpandContent} from './expand-content.directive';\n\nconst State = {\n Idle: 0,\n Loading: 1,\n Prepared: 2,\n Animated: 3,\n} as const;\n\nconst LOADER_HEIGHT = 48;\n\n/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * @deprecated use {@link TuiExpand} from @taiga-ui/experimental\n */\n@Component({\n selector: 'tui-expand',\n imports: [NgIf, NgTemplateOutlet, TuiLoader],\n templateUrl: './expand.template.html',\n styleUrls: ['./expand.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiParentAnimation],\n host: {\n '[style.height.px]': 'height',\n '[class._loading]': 'loading',\n '[class._overflow]': 'overflow',\n '[class._expanded]': 'expanded',\n '[attr.aria-expanded]': 'expanded',\n '(transitionend.self)': 'onTransitionEnd($event)',\n [`(${TUI_EXPAND_LOADED})`]: 'onExpandLoaded($event)',\n },\n})\nexport class TuiExpandComponent {\n @ViewChild('wrapper')\n private readonly contentWrapper?: ElementRef<HTMLDivElement>;\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly destroyRef = inject(DestroyRef);\n private state: TuiValuesOf<typeof State> = State.Idle;\n\n @ContentChild(TuiExpandContent, {read: TemplateRef})\n protected content: TemplateRef<NgIfContext<boolean>> | null = null;\n\n protected expanded: boolean | null = null;\n\n @Input()\n public async = false;\n\n @Input('expanded')\n public set expandedSetter(expanded: boolean | null) {\n if (this.expanded === null) {\n this.expanded = expanded;\n\n return;\n }\n\n if (this.state !== State.Idle) {\n this.expanded = expanded;\n this.state = State.Animated;\n\n return;\n }\n\n this.expanded = expanded;\n this.retrigger(this.async && expanded ? State.Loading : State.Animated);\n }\n\n public get contentVisible(): boolean {\n return this.expanded || this.state !== State.Idle;\n }\n\n protected get overflow(): boolean {\n return this.state !== State.Idle;\n }\n\n protected get loading(): boolean {\n return !!this.expanded && this.async && this.state === State.Loading;\n }\n\n protected get height(): number | null {\n const {expanded, state, contentWrapper} = this;\n\n if (\n (expanded && state === State.Prepared) ||\n (!expanded && state === State.Animated)\n ) {\n return 0;\n }\n\n if (\n contentWrapper &&\n ((!expanded && state === State.Prepared) ||\n (expanded && state === State.Animated))\n ) {\n return contentWrapper.nativeElement.offsetHeight;\n }\n\n if (contentWrapper && expanded && state === State.Loading) {\n return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);\n }\n\n return null;\n }\n\n protected onTransitionEnd({propertyName, pseudoElement}: TransitionEvent): void {\n if (\n propertyName === 'opacity' &&\n !pseudoElement &&\n this.state === State.Animated\n ) {\n this.state = State.Idle;\n }\n }\n\n protected onExpandLoaded(event: Event): void {\n event.stopPropagation();\n\n if (this.state === State.Loading) {\n this.retrigger(State.Animated);\n }\n }\n\n private retrigger(state: TuiValuesOf<typeof State>): void {\n this.state = State.Prepared;\n\n timer(0)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n // We need delay to re-trigger CSS height transition from the correct number\n if (this.state !== State.Prepared) {\n return;\n }\n\n this.state = state;\n this.cdr.markForCheck();\n });\n }\n}\n","<div\n #wrapper\n class=\"t-wrapper\"\n @tuiParentAnimation\n [@.disabled]=\"overflow\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content />\n <tui-loader\n *ngIf=\"async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </tui-loader>\n </ng-container>\n</div>\n","import {TuiExpandComponent} from './expand.component';\nimport {TuiExpandContent} from './expand-content.directive';\n\n/**\n * @deprecated use {@link TuiExpand} from @taiga-ui/experimental\n */\nexport const TuiExpand = [TuiExpandComponent, TuiExpandContent] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;AAEG;MAKU,gBAAgB,CAAA;8GAAhB,gBAAgB,EA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AS,CAAC,EAAA,eAAA,EAG3B,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,CAAC,kBAAkB,CAAC,EAAA,IAAA,EAC1B;AACF,wBAAA,mBAAmB,EAAE,QAAQ;AAC7B,wBAAA,kBAAkB,EAAE,SAAS;AAC7B,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,sBAAsB,EAAE,yBAAyB;AACjD,wBAAA,CAAC,CAAA,CAAA,EAAI,iBAAiB,CAAA,CAAA,CAAG,GAAG,wBAAwB;AACvD,qBAAA,EAAA,QAAA,EAAA,ycAAA,EAAA,MAAA,EAAA,CAAA,4UAAA,CAAA,EAAA;8BAIgB,cAAc,EAAA,CAAA;sBAD9B,SAAS;uBAAC,SAAS;gBAQV,OAAO,EAAA,CAAA;sBADhB,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,gBAAgB,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC;gBAM5C,KAAK,EAAA,CAAA;sBADX;gBAIU,cAAc,EAAA,CAAA;sBADxB,KAAK;uBAAC,UAAU;;;AErErB;;AAEG;MACU,SAAS,GAAG,CAAC,kBAAkB,EAAE,gBAAgB;;ACN9D;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-expand.mjs","sources":["../../../projects/core/components/expand/expand.component.ts","../../../projects/core/components/expand/taiga-ui-core-components-expand.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n input,\n type OnInit,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport {TuiItem} from '@taiga-ui/cdk/directives/item';\n\n@Component({\n selector: 'tui-expand',\n imports: [NgTemplateOutlet],\n template: `\n <div class=\"t-wrapper\">\n @if (expanded() || open()) {\n <ng-container [ngTemplateOutlet]=\"content() || null\" />\n }\n <ng-content />\n </div>\n `,\n styleUrl: './expand.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._expanded]': 'expanded()',\n '[class._open]': 'open()',\n '(transitionend.self)': 'onTransitionEnd($event)',\n },\n})\nexport class TuiExpand implements OnInit {\n protected readonly content = contentChild(TuiItem, {read: TemplateRef});\n protected readonly open = signal(false);\n\n public readonly expanded = input(false);\n\n public ngOnInit(): void {\n this.open.set(this.expanded());\n }\n\n protected onTransitionEnd({propertyName}: TransitionEvent): void {\n if (propertyName === 'grid-template-rows') {\n this.open.set(this.expanded());\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MA+Ba,SAAS,CAAA;AAnBtB,IAAA,WAAA,GAAA;QAoBuB,IAAO,CAAA,OAAA,GAAG,YAAY,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC;AACpD,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAEvB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AAW1C;IATU,QAAQ,GAAA;QACX,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;;IAGxB,eAAe,CAAC,EAAC,YAAY,EAAkB,EAAA;AACrD,QAAA,IAAI,YAAY,KAAK,oBAAoB,EAAE;YACvC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;;;+GAZ7B,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,EACwB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EA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EAAA,CAAA,skBAAA,CAAA,EAAA;;;AC7BL;;AAEG;;;;"}
@@ -0,0 +1,42 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ChangeDetectionStrategy, ViewEncapsulation, Component, inject, input, Directive } from '@angular/core';
3
+ import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
4
+ import { tuiWithStyles } from '@taiga-ui/cdk/utils/miscellaneous';
5
+ import { tuiButtonOptionsProvider } from '@taiga-ui/core/components/button';
6
+
7
+ const [TUI_HEADER_OPTIONS, tuiHeaderOptionsProvider] = tuiCreateOptions({ size: 'h5' });
8
+ class Styles {
9
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: Styles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-header" }, ngImport: i0, template: '', isInline: true, styles: ["[tuiHeader]{position:relative;display:flex;align-items:flex-start;box-sizing:content-box;color:var(--tui-text-primary);margin:0;text-align:start;overflow-wrap:break-word}[tuiHeader] p{margin:.25rem 0 0;font:var(--tui-font-text-m)}[tuiHeader] p:empty{display:none}[tuiHeader] [tuiTitle]{flex-grow:2;margin:0}[tuiHeader] [tuiTitle]:empty{display:none}[tuiHeader] [tuiAccessories]{display:flex;align-items:center;gap:.75rem;white-space:nowrap}[tuiHeader] [tuiAccessories]:has([tuiLink]){align-items:baseline}[tuiHeader] [tuiAccessories]:before{content:\"\\200b\";visibility:hidden}[tuiHeader] [tuiSubtitle]{font:var(--tui-font-text-m);color:var(--tui-text-secondary);margin:0}[tuiHeader] [tuiLink]{font:var(--tui-font-text-m)}[tuiHeader] [tuiCaption]{font:var(--tui-font-text-s);color:var(--tui-text-secondary);font-weight:500;text-transform:uppercase;margin:0}[tuiHeader][data-size=h1] [tuiTitle],[tuiHeader][data-size=h1] [tuiAccessories]{font:var(--tui-font-heading-1)}[tuiHeader][data-size=h2] [tuiTitle],[tuiHeader][data-size=h2] [tuiAccessories]{font:var(--tui-font-heading-2)}[tuiHeader][data-size=h3] [tuiTitle],[tuiHeader][data-size=h3] [tuiAccessories]{font:var(--tui-font-heading-3)}[tuiHeader][data-size=h4] [tuiTitle],[tuiHeader][data-size=h4] [tuiAccessories]{font:var(--tui-font-heading-4)}[tuiHeader][data-size=h5] [tuiTitle],[tuiHeader][data-size=h5] [tuiAccessories]{font:var(--tui-font-heading-5)}[tuiHeader][data-size=h6] [tuiTitle],[tuiHeader][data-size=h6] [tuiAccessories]{font:var(--tui-font-heading-6)}[tuiHeader][data-size=body-xl] [tuiTitle],[tuiHeader][data-size=body-xl] [tuiAccessories]{font:var(--tui-font-text-xl)}[tuiHeader][data-size=body-xl] [tuiTitle]{font-weight:700}[tuiHeader][data-size=body-l] [tuiTitle],[tuiHeader][data-size=body-l] [tuiAccessories]{font:var(--tui-font-text-l)}[tuiHeader][data-size=body-l] [tuiTitle]{font-weight:700}[tuiHeader][data-size=body-m] [tuiTitle],[tuiHeader][data-size=body-m] [tuiAccessories]{font:var(--tui-font-text-m)}[tuiHeader][data-size=body-m] [tuiTitle]{gap:.125rem;font-weight:700}[tuiHeader][data-size=body-m] [tuiSubtitle],[tuiHeader][data-size=body-l] [tuiSubtitle],[tuiHeader][data-size=body-m] [tuiLink],[tuiHeader][data-size=body-l] [tuiLink]{font:var(--tui-font-text-s)}[tuiHeader][data-size=h1] [tuiSubtitle],[tuiHeader][data-size=h2] [tuiSubtitle],[tuiHeader][data-size=h3] [tuiSubtitle],[tuiHeader][data-size=h1] [tuiLink],[tuiHeader][data-size=h2] [tuiLink],[tuiHeader][data-size=h3] [tuiLink]{font:var(--tui-font-text-l)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: Styles, decorators: [{
13
+ type: Component,
14
+ args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-header' }, styles: ["[tuiHeader]{position:relative;display:flex;align-items:flex-start;box-sizing:content-box;color:var(--tui-text-primary);margin:0;text-align:start;overflow-wrap:break-word}[tuiHeader] p{margin:.25rem 0 0;font:var(--tui-font-text-m)}[tuiHeader] p:empty{display:none}[tuiHeader] [tuiTitle]{flex-grow:2;margin:0}[tuiHeader] [tuiTitle]:empty{display:none}[tuiHeader] [tuiAccessories]{display:flex;align-items:center;gap:.75rem;white-space:nowrap}[tuiHeader] [tuiAccessories]:has([tuiLink]){align-items:baseline}[tuiHeader] [tuiAccessories]:before{content:\"\\200b\";visibility:hidden}[tuiHeader] [tuiSubtitle]{font:var(--tui-font-text-m);color:var(--tui-text-secondary);margin:0}[tuiHeader] [tuiLink]{font:var(--tui-font-text-m)}[tuiHeader] [tuiCaption]{font:var(--tui-font-text-s);color:var(--tui-text-secondary);font-weight:500;text-transform:uppercase;margin:0}[tuiHeader][data-size=h1] [tuiTitle],[tuiHeader][data-size=h1] [tuiAccessories]{font:var(--tui-font-heading-1)}[tuiHeader][data-size=h2] [tuiTitle],[tuiHeader][data-size=h2] [tuiAccessories]{font:var(--tui-font-heading-2)}[tuiHeader][data-size=h3] [tuiTitle],[tuiHeader][data-size=h3] [tuiAccessories]{font:var(--tui-font-heading-3)}[tuiHeader][data-size=h4] [tuiTitle],[tuiHeader][data-size=h4] [tuiAccessories]{font:var(--tui-font-heading-4)}[tuiHeader][data-size=h5] [tuiTitle],[tuiHeader][data-size=h5] [tuiAccessories]{font:var(--tui-font-heading-5)}[tuiHeader][data-size=h6] [tuiTitle],[tuiHeader][data-size=h6] [tuiAccessories]{font:var(--tui-font-heading-6)}[tuiHeader][data-size=body-xl] [tuiTitle],[tuiHeader][data-size=body-xl] [tuiAccessories]{font:var(--tui-font-text-xl)}[tuiHeader][data-size=body-xl] [tuiTitle]{font-weight:700}[tuiHeader][data-size=body-l] [tuiTitle],[tuiHeader][data-size=body-l] [tuiAccessories]{font:var(--tui-font-text-l)}[tuiHeader][data-size=body-l] [tuiTitle]{font-weight:700}[tuiHeader][data-size=body-m] [tuiTitle],[tuiHeader][data-size=body-m] [tuiAccessories]{font:var(--tui-font-text-m)}[tuiHeader][data-size=body-m] [tuiTitle]{gap:.125rem;font-weight:700}[tuiHeader][data-size=body-m] [tuiSubtitle],[tuiHeader][data-size=body-l] [tuiSubtitle],[tuiHeader][data-size=body-m] [tuiLink],[tuiHeader][data-size=body-l] [tuiLink]{font:var(--tui-font-text-s)}[tuiHeader][data-size=h1] [tuiSubtitle],[tuiHeader][data-size=h2] [tuiSubtitle],[tuiHeader][data-size=h3] [tuiSubtitle],[tuiHeader][data-size=h1] [tuiLink],[tuiHeader][data-size=h2] [tuiLink],[tuiHeader][data-size=h3] [tuiLink]{font:var(--tui-font-text-l)}\n"] }]
15
+ }] });
16
+ class TuiHeader {
17
+ constructor() {
18
+ this.nothing = tuiWithStyles(Styles);
19
+ this.options = inject(TUI_HEADER_OPTIONS);
20
+ this.tuiHeader = input(this.options.size);
21
+ }
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiHeader, isStandalone: true, selector: "[tuiHeader]", inputs: { tuiHeader: { classPropertyName: "tuiHeader", publicName: "tuiHeader", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tuiHeader": "" }, properties: { "attr.data-size": "tuiHeader() || options.size || \"h5\"" } }, providers: [tuiButtonOptionsProvider({ size: 's' })], ngImport: i0 }); }
24
+ }
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiHeader, decorators: [{
26
+ type: Directive,
27
+ args: [{
28
+ selector: '[tuiHeader]',
29
+ providers: [tuiButtonOptionsProvider({ size: 's' })],
30
+ host: {
31
+ tuiHeader: '',
32
+ '[attr.data-size]': 'tuiHeader() || options.size || "h5"',
33
+ },
34
+ }]
35
+ }] });
36
+
37
+ /**
38
+ * Generated bundle index. Do not edit.
39
+ */
40
+
41
+ export { TUI_HEADER_OPTIONS, TuiHeader, tuiHeaderOptionsProvider };
42
+ //# sourceMappingURL=taiga-ui-core-components-header.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-core-components-header.mjs","sources":["../../../projects/core/components/header/header.directive.ts","../../../projects/core/components/header/taiga-ui-core-components-header.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {tuiButtonOptionsProvider} from '@taiga-ui/core/components/button';\n\nexport const [TUI_HEADER_OPTIONS, tuiHeaderOptionsProvider] = tuiCreateOptions<{\n size: '' | 'body-l' | 'body-m' | 'body-xl' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n}>({size: 'h5'});\n\n@Component({\n template: '',\n styleUrl: './header.styles.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {class: 'tui-header'},\n})\nclass Styles {}\n\n@Directive({\n selector: '[tuiHeader]',\n providers: [tuiButtonOptionsProvider({size: 's'})],\n host: {\n tuiHeader: '',\n '[attr.data-size]': 'tuiHeader() || options.size || \"h5\"',\n },\n})\nexport class TuiHeader {\n protected readonly nothing = tuiWithStyles(Styles);\n protected readonly options = inject(TUI_HEADER_OPTIONS);\n\n public readonly tuiHeader = input(this.options.size);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAYa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EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,EAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,uCAAA,EAAA,EAAA,EAAA,SAAA,EANP,CAAC,wBAAwB,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAMzC,SAAS,EAAA,UAAA,EAAA,CAAA;kBARrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;oBACvB,SAAS,EAAE,CAAC,wBAAwB,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC;AAClD,oBAAA,IAAI,EAAE;AACF,wBAAA,SAAS,EAAE,EAAE;AACb,wBAAA,kBAAkB,EAAE,qCAAqC;AAC5D,qBAAA;AACJ,iBAAA;;;AChCD;;AAEG;;;;"}
@@ -1,55 +1,38 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, inject, computed, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, Pipe } from '@angular/core';
3
- import { tuiInjectIconResolver, TUI_ICON_START, TUI_ICON_END, tuiGetIconMode } from '@taiga-ui/core/tokens';
2
+ import { inject, computed, input, ChangeDetectionStrategy, ViewEncapsulation, Component, Pipe } from '@angular/core';
3
+ import * as i1 from '@taiga-ui/core/directives';
4
+ import { TuiIcons } from '@taiga-ui/core/directives';
5
+ import { tuiInjectIconResolver } from '@taiga-ui/core/tokens';
4
6
 
5
7
  class TuiIcon {
6
8
  constructor() {
7
- this.resolver = tuiInjectIconResolver();
8
- this.src = signal(inject(TUI_ICON_START, { self: true, optional: true }) ||
9
- inject(TUI_ICON_END, { self: true, optional: true }));
10
- this.bg = signal(null);
11
- this.resource = computed(() => this.resolve(this.src()));
12
- this.mode = computed(() => tuiGetIconMode(this.src()));
13
- this.bgResource = computed(() => this.resolve(this.bg()));
9
+ this.icons = inject(TuiIcons);
10
+ this.mask = computed(() => this.icons.resolve(this.background()));
11
+ this.background = input('');
14
12
  }
15
- set icon(icon) {
16
- this.src.set(icon);
17
- }
18
- set background(background) {
19
- this.bg.set(background);
20
- }
21
- resolve(value) {
22
- if (!value) {
23
- return null;
24
- }
25
- return tuiGetIconMode(value) === 'font'
26
- ? `'${this.resolver(value)}'`
27
- : `url(${this.resolver(value)})`;
28
- }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
30
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: TuiIcon, isStandalone: true, selector: "tui-icon", inputs: { icon: "icon", background: "background" }, host: { properties: { "style.--t-icon": "resource() || \"url()\"", "style.--t-icon-bg": "bgResource()", "attr.data-icon": "mode()" } }, ngImport: i0, template: '', isInline: true, styles: ["tui-icon{position:relative;display:inline-block;inline-size:1em;block-size:1em;font-size:1.5rem;flex-shrink:0;border:0 solid transparent;vertical-align:middle;box-sizing:border-box;mask:var(--t-icon-bg) no-repeat center / calc(min(1em,100%) + 10 * var(--tui-stroke-width, .125rem)) min(1em,100%) padding-box}@media (hover: hover) and (pointer: fine){tui-icon[data-appearance=icon]:hover{color:var(--tui-text-secondary)}}tui-icon:before,tui-icon[tuiIcons]:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";display:block;mask:var(--t-icon) no-repeat center / calc(min(1em,100%) + 10 * var(--tui-stroke-width, .125rem)) min(1em,100%),100% padding-box;background:currentColor}tui-icon[data-icon=image]:before{mask:none;background:var(--t-icon) no-repeat center / contain}tui-icon[data-icon=font]:before{content:var(--t-icon);mask:none;background:none;font:1em/1 var(--tui-font-icon, inherit);text-align:center;text-transform:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
13
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.15", type: TuiIcon, isStandalone: true, selector: "tui-icon:not([tuiBadge])", inputs: { background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--t-icon-bg": "mask()" } }, hostDirectives: [{ directive: i1.TuiIcons, inputs: ["iconStart", "icon", "iconEnd", "badge"] }], ngImport: i0, template: '', isInline: true, styles: ["tui-icon{--tui-icon-size: 1em;position:relative;display:inline-flex;inline-size:1em;block-size:1em;font-size:1.5rem;flex-shrink:0;border:0 solid transparent;vertical-align:middle;box-sizing:border-box;mask:var(--t-icon-bg) no-repeat center / calc(100% + 10 * var(--tui-stroke-width, .125rem)) 100%}@media (hover: hover) and (pointer: fine){tui-icon[data-appearance=icon]:hover{color:var(--tui-text-secondary)}}tui-icon[data-icon-end]:before{-webkit-mask-image:var(--t-icon-start),radial-gradient(circle at bottom .1em right .1em,transparent calc(.4em - .5px),#000 .4em);mask-image:var(--t-icon-start),radial-gradient(circle at bottom .1em right .1em,transparent calc(.4em - .5px),#000 .4em);-webkit-mask-composite:source-in;mask-composite:intersect}tui-icon[data-icon-end][data-icon-start=img]:before,tui-icon[data-icon-end][data-icon-start=font]:before{mask:radial-gradient(circle at bottom .1em right .1em,transparent calc(.4em - .5px),#000 .4em)}tui-icon[data-icon-end]:after{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}tui-icon[data-icon-start]:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}tui-icon[data-icon-start]:after{transform:translate(36%,36%);--tui-icon-size: .5715em}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
31
15
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiIcon, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIcon, decorators: [{
33
17
  type: Component,
34
- args: [{ standalone: true, selector: 'tui-icon', template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
35
- '[style.--t-icon]': 'resource() || "url()"',
36
- '[style.--t-icon-bg]': 'bgResource()',
37
- '[attr.data-icon]': 'mode()',
38
- }, styles: ["tui-icon{position:relative;display:inline-block;inline-size:1em;block-size:1em;font-size:1.5rem;flex-shrink:0;border:0 solid transparent;vertical-align:middle;box-sizing:border-box;mask:var(--t-icon-bg) no-repeat center / calc(min(1em,100%) + 10 * var(--tui-stroke-width, .125rem)) min(1em,100%) padding-box}@media (hover: hover) and (pointer: fine){tui-icon[data-appearance=icon]:hover{color:var(--tui-text-secondary)}}tui-icon:before,tui-icon[tuiIcons]:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";display:block;mask:var(--t-icon) no-repeat center / calc(min(1em,100%) + 10 * var(--tui-stroke-width, .125rem)) min(1em,100%),100% padding-box;background:currentColor}tui-icon[data-icon=image]:before{mask:none;background:var(--t-icon) no-repeat center / contain}tui-icon[data-icon=font]:before{content:var(--t-icon);mask:none;background:none;font:1em/1 var(--tui-font-icon, inherit);text-align:center;text-transform:none}\n"] }]
39
- }], propDecorators: { icon: [{
40
- type: Input
41
- }], background: [{
42
- type: Input
43
- }] } });
18
+ args: [{ standalone: true, selector: 'tui-icon:not([tuiBadge])', template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
19
+ {
20
+ directive: TuiIcons,
21
+ inputs: ['iconStart: icon', 'iconEnd: badge'],
22
+ },
23
+ ], host: {
24
+ '[style.--t-icon-bg]': 'mask()',
25
+ }, styles: ["tui-icon{--tui-icon-size: 1em;position:relative;display:inline-flex;inline-size:1em;block-size:1em;font-size:1.5rem;flex-shrink:0;border:0 solid transparent;vertical-align:middle;box-sizing:border-box;mask:var(--t-icon-bg) no-repeat center / calc(100% + 10 * var(--tui-stroke-width, .125rem)) 100%}@media (hover: hover) and (pointer: fine){tui-icon[data-appearance=icon]:hover{color:var(--tui-text-secondary)}}tui-icon[data-icon-end]:before{-webkit-mask-image:var(--t-icon-start),radial-gradient(circle at bottom .1em right .1em,transparent calc(.4em - .5px),#000 .4em);mask-image:var(--t-icon-start),radial-gradient(circle at bottom .1em right .1em,transparent calc(.4em - .5px),#000 .4em);-webkit-mask-composite:source-in;mask-composite:intersect}tui-icon[data-icon-end][data-icon-start=img]:before,tui-icon[data-icon-end][data-icon-start=font]:before{mask:radial-gradient(circle at bottom .1em right .1em,transparent calc(.4em - .5px),#000 .4em)}tui-icon[data-icon-end]:after{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}tui-icon[data-icon-start]:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}tui-icon[data-icon-start]:after{transform:translate(36%,36%);--tui-icon-size: .5715em}\n"] }]
26
+ }] });
44
27
 
45
28
  class TuiIconPipe {
46
29
  constructor() {
47
30
  this.transform = tuiInjectIconResolver();
48
31
  }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiIconPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
50
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.9", ngImport: i0, type: TuiIconPipe, isStandalone: true, name: "tuiIcon" }); }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIconPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
33
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TuiIconPipe, isStandalone: true, name: "tuiIcon" }); }
51
34
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TuiIconPipe, decorators: [{
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiIconPipe, decorators: [{
53
36
  type: Pipe,
54
37
  args: [{
55
38
  standalone: true,
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-icon.mjs","sources":["../../../projects/core/components/icon/icon.component.ts","../../../projects/core/components/icon/icon.pipe.ts","../../../projects/core/components/icon/taiga-ui-core-components-icon.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {\n TUI_ICON_END,\n TUI_ICON_START,\n tuiGetIconMode,\n tuiInjectIconResolver,\n} from '@taiga-ui/core/tokens';\n\n@Component({\n standalone: true,\n selector: 'tui-icon',\n template: '',\n styles: ['@import \"@taiga-ui/core/styles/components/icon.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.--t-icon]': 'resource() || \"url()\"',\n '[style.--t-icon-bg]': 'bgResource()',\n '[attr.data-icon]': 'mode()',\n },\n})\nexport class TuiIcon {\n protected readonly resolver: TuiStringHandler<string> = tuiInjectIconResolver();\n protected readonly src = signal(\n inject(TUI_ICON_START, {self: true, optional: true}) ||\n inject(TUI_ICON_END, {self: true, optional: true}),\n );\n\n protected readonly bg = signal<string | null>(null);\n protected readonly resource = computed(() => this.resolve(this.src()));\n protected readonly mode = computed(() => tuiGetIconMode(this.src()));\n protected readonly bgResource = computed(() => this.resolve(this.bg()));\n\n @Input()\n public set icon(icon: string) {\n this.src.set(icon);\n }\n\n @Input()\n public set background(background: string) {\n this.bg.set(background);\n }\n\n public resolve(value?: string | null): string | null {\n if (!value) {\n return null;\n }\n\n return tuiGetIconMode(value) === 'font'\n ? `'${this.resolver(value)}'`\n : `url(${this.resolver(value)})`;\n }\n}\n","import {Pipe, type PipeTransform} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiInjectIconResolver} from '@taiga-ui/core/tokens';\n\n@Pipe({\n standalone: true,\n name: 'tuiIcon',\n})\nexport class TuiIconPipe implements PipeTransform {\n public readonly transform: TuiStringHandler<string> = tuiInjectIconResolver();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MA8Ba,OAAO,CAAA;AAbpB,IAAA,WAAA,GAAA;QAcuB,IAAA,CAAA,QAAQ,GAA6B,qBAAqB,EAAE;AAC5D,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAC3B,MAAM,CAAC,cAAc,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;AAChD,YAAA,MAAM,CAAC,YAAY,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CACzD;AAEkB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAgB,IAAI,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AACnD,QAAA,IAAA,CAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AACjD,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAqB1E,IAAA;IAnBG,IACW,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wBAAA,kBAAkB,EAAE,QAAQ;AAC/B,qBAAA,EAAA,MAAA,EAAA,CAAA,o8BAAA,CAAA,EAAA;8BAeU,IAAI,EAAA,CAAA;sBADd;gBAMU,UAAU,EAAA,CAAA;sBADpB;;;MCvCQ,WAAW,CAAA;AAJxB,IAAA,WAAA,GAAA;QAKoB,IAAA,CAAA,SAAS,GAA6B,qBAAqB,EAAE;AAChF,IAAA;8GAFY,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,SAAS;AAClB,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-icon.mjs","sources":["../../../projects/core/components/icon/icon.component.ts","../../../projects/core/components/icon/icon.pipe.ts","../../../projects/core/components/icon/taiga-ui-core-components-icon.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiIcons} from '@taiga-ui/core/directives';\n\n@Component({\n standalone: true,\n // :not([tuiBadge]) is required to avoid double matching of TuiIcons\n selector: 'tui-icon:not([tuiBadge])',\n template: '',\n styles: '@import \"@taiga-ui/core/styles/components/icon.less\";',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: TuiIcons,\n inputs: ['iconStart: icon', 'iconEnd: badge'],\n },\n ],\n host: {\n '[style.--t-icon-bg]': 'mask()',\n },\n})\nexport class TuiIcon {\n protected readonly icons = inject(TuiIcons);\n protected readonly mask = computed(() => this.icons.resolve(this.background()));\n\n public readonly background = input('');\n}\n","import {Pipe, type PipeTransform} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiInjectIconResolver} from '@taiga-ui/core/tokens';\n\n@Pipe({\n standalone: true,\n name: 'tuiIcon',\n})\nexport class TuiIconPipe implements PipeTransform {\n public readonly transform: TuiStringHandler<string> = tuiInjectIconResolver();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA4Ba,OAAO,CAAA;AAlBpB,IAAA,WAAA,GAAA;AAmBuB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC;AACxB,QAAA,IAAA,CAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;AAE/D,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;AACzC;+GALY,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAP,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,OAAO,iYAdN,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,8sCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAcH,OAAO,EAAA,UAAA,EAAA,CAAA;kBAlBnB,SAAS;AACM,YAAA,IAAA,EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EAEN,QAAA,EAAA,0BAA0B,EAC1B,QAAA,EAAA,EAAE,EAEG,aAAA,EAAA,iB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