@taiga-ui/core 2.61.0 → 2.62.2

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 (102) hide show
  1. package/bundles/taiga-ui-core-components-alert.umd.js +0 -1
  2. package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
  3. package/bundles/taiga-ui-core-components-alert.umd.min.js.map +1 -1
  4. package/bundles/taiga-ui-core-components-button.umd.js +32 -15
  5. package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
  6. package/bundles/taiga-ui-core-components-button.umd.min.js +1 -1
  7. package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
  8. package/bundles/taiga-ui-core-components-notification.umd.js +1 -1
  9. package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
  10. package/bundles/taiga-ui-core-components-notification.umd.min.js +1 -1
  11. package/bundles/taiga-ui-core-components-notification.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +3 -3
  13. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  14. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +1 -1
  15. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
  16. package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
  17. package/bundles/taiga-ui-core-components-scrollbar.umd.min.js.map +1 -1
  18. package/bundles/taiga-ui-core-pipes-format-date.umd.js +293 -0
  19. package/bundles/taiga-ui-core-pipes-format-date.umd.js.map +1 -0
  20. package/bundles/taiga-ui-core-pipes-format-date.umd.min.js +2 -0
  21. package/bundles/taiga-ui-core-pipes-format-date.umd.min.js.map +1 -0
  22. package/bundles/taiga-ui-core-pipes.umd.js +12 -4
  23. package/bundles/taiga-ui-core-pipes.umd.js.map +1 -1
  24. package/bundles/taiga-ui-core-pipes.umd.min.js +1 -1
  25. package/bundles/taiga-ui-core-services.umd.js +24 -0
  26. package/bundles/taiga-ui-core-services.umd.js.map +1 -1
  27. package/bundles/taiga-ui-core-services.umd.min.js +1 -1
  28. package/bundles/taiga-ui-core-services.umd.min.js.map +1 -1
  29. package/components/button/button.component.d.ts +7 -2
  30. package/components/button/taiga-ui-core-components-button.metadata.json +1 -1
  31. package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
  32. package/components/scrollbar/scrollbar.component.d.ts +3 -1
  33. package/components/scrollbar/taiga-ui-core-components-scrollbar.metadata.json +1 -1
  34. package/constants/version.d.ts +1 -1
  35. package/esm2015/components/alert/alert.service.js +1 -2
  36. package/esm2015/components/button/button.component.js +29 -15
  37. package/esm2015/components/notification/notification.component.js +3 -3
  38. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +1 -1
  39. package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +3 -3
  40. package/esm2015/components/scrollbar/scrollbar.component.js +5 -5
  41. package/esm2015/pipes/format-date/format-date.module.js +13 -0
  42. package/esm2015/pipes/format-date/format-date.pipe.js +22 -0
  43. package/esm2015/pipes/format-date/index.js +3 -0
  44. package/esm2015/pipes/format-date/taiga-ui-core-pipes-format-date.js +5 -0
  45. package/esm2015/pipes/index.js +2 -1
  46. package/esm2015/services/format-date.service.js +27 -0
  47. package/esm2015/services/index.js +2 -1
  48. package/esm5/components/alert/alert.service.js +1 -2
  49. package/esm5/components/button/button.component.js +33 -15
  50. package/esm5/components/notification/notification.component.js +3 -3
  51. package/esm5/components/primitive-textfield/primitive-textfield.component.js +1 -1
  52. package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +3 -3
  53. package/esm5/components/scrollbar/scrollbar.component.js +5 -5
  54. package/esm5/pipes/format-date/format-date.module.js +16 -0
  55. package/esm5/pipes/format-date/format-date.pipe.js +23 -0
  56. package/esm5/pipes/format-date/index.js +3 -0
  57. package/esm5/pipes/format-date/taiga-ui-core-pipes-format-date.js +5 -0
  58. package/esm5/pipes/index.js +2 -1
  59. package/esm5/services/format-date.service.js +28 -0
  60. package/esm5/services/index.js +2 -1
  61. package/fesm2015/taiga-ui-core-components-alert.js +0 -1
  62. package/fesm2015/taiga-ui-core-components-alert.js.map +1 -1
  63. package/fesm2015/taiga-ui-core-components-button.js +28 -14
  64. package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
  65. package/fesm2015/taiga-ui-core-components-notification.js +2 -2
  66. package/fesm2015/taiga-ui-core-components-notification.js.map +1 -1
  67. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +3 -3
  68. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  69. package/fesm2015/taiga-ui-core-components-scrollbar.js.map +1 -1
  70. package/fesm2015/taiga-ui-core-pipes-format-date.js +37 -0
  71. package/fesm2015/taiga-ui-core-pipes-format-date.js.map +1 -0
  72. package/fesm2015/taiga-ui-core-pipes.js +1 -0
  73. package/fesm2015/taiga-ui-core-pipes.js.map +1 -1
  74. package/fesm2015/taiga-ui-core-services.js +25 -3
  75. package/fesm2015/taiga-ui-core-services.js.map +1 -1
  76. package/fesm5/taiga-ui-core-components-alert.js +0 -1
  77. package/fesm5/taiga-ui-core-components-alert.js.map +1 -1
  78. package/fesm5/taiga-ui-core-components-button.js +32 -14
  79. package/fesm5/taiga-ui-core-components-button.js.map +1 -1
  80. package/fesm5/taiga-ui-core-components-notification.js +2 -2
  81. package/fesm5/taiga-ui-core-components-notification.js.map +1 -1
  82. package/fesm5/taiga-ui-core-components-primitive-textfield.js +3 -3
  83. package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  84. package/fesm5/taiga-ui-core-components-scrollbar.js.map +1 -1
  85. package/fesm5/taiga-ui-core-pipes-format-date.js +41 -0
  86. package/fesm5/taiga-ui-core-pipes-format-date.js.map +1 -0
  87. package/fesm5/taiga-ui-core-pipes.js +1 -0
  88. package/fesm5/taiga-ui-core-pipes.js.map +1 -1
  89. package/fesm5/taiga-ui-core-services.js +27 -4
  90. package/fesm5/taiga-ui-core-services.js.map +1 -1
  91. package/package.json +4 -4
  92. package/pipes/format-date/format-date.module.d.ts +2 -0
  93. package/pipes/format-date/format-date.pipe.d.ts +8 -0
  94. package/pipes/format-date/index.d.ts +2 -0
  95. package/pipes/format-date/package.json +13 -0
  96. package/pipes/format-date/taiga-ui-core-pipes-format-date.d.ts +4 -0
  97. package/pipes/format-date/taiga-ui-core-pipes-format-date.metadata.json +1 -0
  98. package/pipes/index.d.ts +1 -0
  99. package/pipes/taiga-ui-core-pipes.metadata.json +1 -1
  100. package/services/format-date.service.d.ts +6 -0
  101. package/services/index.d.ts +1 -0
  102. package/services/taiga-ui-core-services.metadata.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { ɵɵdefineInjectable, Injectable, Inject, ɵɵinject, Optional, NgZone, SecurityContext, Sanitizer } from '@angular/core';
3
- import { BehaviorSubject, Observable, fromEvent, EMPTY } from 'rxjs';
2
+ import { Inject, LOCALE_ID, ɵɵdefineInjectable, ɵɵinject, Injectable, Optional, NgZone, SecurityContext, Sanitizer } from '@angular/core';
3
+ import { of, BehaviorSubject, Observable, fromEvent, EMPTY } from 'rxjs';
4
4
  import { WINDOW, ANIMATION_FRAME } from '@ng-web-apis/common';
5
5
  import { startWith, map, share, distinctUntilChanged, takeUntil } from 'rxjs/operators';
6
6
  import { RouterLinkActive } from '@angular/router';
@@ -9,6 +9,28 @@ import { DomSanitizer } from '@angular/platform-browser';
9
9
  import { TUI_SANITIZER, TUI_ICONS } from '@taiga-ui/core/tokens';
10
10
  import { processIcon } from '@taiga-ui/core/utils/dom';
11
11
 
12
+ let TuiFormatDateService = class TuiFormatDateService {
13
+ constructor(locale) {
14
+ this.locale = locale;
15
+ }
16
+ format(timestamp) {
17
+ return of(new Date(timestamp).toLocaleTimeString(this.locale, {
18
+ hour: `numeric`,
19
+ minute: `2-digit`,
20
+ }));
21
+ }
22
+ };
23
+ TuiFormatDateService.ctorParameters = () => [
24
+ { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
25
+ ];
26
+ TuiFormatDateService.ɵprov = ɵɵdefineInjectable({ factory: function TuiFormatDateService_Factory() { return new TuiFormatDateService(ɵɵinject(LOCALE_ID)); }, token: TuiFormatDateService, providedIn: "root" });
27
+ TuiFormatDateService = __decorate([
28
+ Injectable({
29
+ providedIn: `root`,
30
+ }),
31
+ __param(0, Inject(LOCALE_ID))
32
+ ], TuiFormatDateService);
33
+
12
34
  /**
13
35
  * Service for displaying hints/tooltips
14
36
  */
@@ -166,5 +188,5 @@ TuiSvgService = __decorate([
166
188
  * Generated bundle index. Do not edit.
167
189
  */
168
190
 
169
- export { TuiHintService, TuiNightThemeService, TuiRouterLinkActiveService, TuiSvgService };
191
+ export { TuiFormatDateService, TuiHintService, TuiNightThemeService, TuiRouterLinkActiveService, TuiSvgService };
170
192
  //# sourceMappingURL=taiga-ui-core-services.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-services.js","sources":["ng://@taiga-ui/core/services/hint.service.ts","ng://@taiga-ui/core/services/night-theme.service.ts","ng://@taiga-ui/core/services/router-link-active.service.ts","ng://@taiga-ui/core/services/svg.service.ts","ng://@taiga-ui/core/services/taiga-ui-core-services.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {BehaviorSubject} from 'rxjs';\n\n// TODO: 3.0 can it be removed? It prevented seps cycling before 2.0\ntype TuiHintDirective = any;\n\ntype AbstractTuiHint = any;\n\n/**\n * Service for displaying hints/tooltips\n */\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiHintService extends BehaviorSubject<readonly AbstractTuiHint[]> {\n /**\n * TODO:\n * We need the following logic for desribedBy\n * move it into another service that can register hints and\n * manage it using TuiHintService inside\n */\n private directives: readonly TuiHintDirective[] = [];\n\n constructor() {\n super([]);\n }\n\n add(directive: AbstractTuiHint): void {\n this.next(this.value.concat(directive));\n }\n\n remove(directive: AbstractTuiHint): void {\n if (this.value.includes(directive)) {\n this.next(this.value.filter(hint => hint !== directive));\n }\n }\n\n register(directive: TuiHintDirective): void {\n this.directives = [...this.directives, directive];\n }\n\n unregister(directive: TuiHintDirective): void {\n this.remove(directive);\n this.directives = this.directives.filter(dir => dir !== directive);\n }\n\n showHintForId(id: string): void {\n const directive = this.findDirectiveWithHintId(id);\n\n if (directive) {\n this.add(directive);\n }\n }\n\n hideHintForId(id: string): void {\n const directive = this.findDirectiveWithHintId(id);\n\n if (directive) {\n this.remove(directive);\n }\n }\n\n private findDirectiveWithHintId(id: string): TuiHintDirective | undefined {\n return this.directives.find(directive => directive.tuiHintId === id);\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {fromEvent, Observable} from 'rxjs';\nimport {map, share, startWith} from 'rxjs/operators';\n\n// @dynamic\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiNightThemeService extends Observable<boolean> {\n constructor(@Inject(WINDOW) windowRef: Window) {\n const media = windowRef.matchMedia(`(prefers-color-scheme: dark)`);\n const media$ = fromEvent(media, `change`).pipe(\n startWith(null),\n map(() => media.matches),\n share(),\n );\n\n super(subscriber => media$.subscribe(subscriber));\n }\n}\n","import {Inject, Injectable, NgZone, Optional} from '@angular/core';\nimport {RouterLinkActive} from '@angular/router';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {TuiDestroyService, tuiZoneOptimized} from '@taiga-ui/cdk';\nimport {EMPTY, Observable} from 'rxjs';\nimport {distinctUntilChanged, map, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiRouterLinkActiveService extends Observable<boolean> {\n constructor(\n @Optional()\n @Inject(RouterLinkActive)\n routerLinkActive: RouterLinkActive | null,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n @Inject(TuiDestroyService) destroy$: TuiDestroyService,\n ) {\n const stream$ = routerLinkActive\n ? animationFrame$.pipe(\n map(() => routerLinkActive.isActive),\n distinctUntilChanged(),\n tuiZoneOptimized(ngZone),\n takeUntil(destroy$),\n )\n : EMPTY;\n\n super(subscriber => stream$.subscribe(subscriber));\n }\n}\n","import {Inject, Injectable, Optional, Sanitizer, SecurityContext} from '@angular/core';\nimport {DomSanitizer, SafeHtml} from '@angular/platform-browser';\nimport {tuiAssert} from '@taiga-ui/cdk';\nimport {TUI_ICONS, TUI_SANITIZER} from '@taiga-ui/core/tokens';\nimport {processIcon} from '@taiga-ui/core/utils/dom';\nimport {BehaviorSubject} from 'rxjs';\n\n/**\n * Service for reusing SVGs without inlining each instance\n */\n// @dynamic\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiSvgService {\n private originals: Record<string, string> = {};\n\n readonly items$ = new BehaviorSubject<Map<string, SafeHtml>>(new Map());\n\n constructor(\n @Optional()\n @Inject(TUI_SANITIZER)\n private readonly tuiSanitizer: Sanitizer | null,\n @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,\n @Inject(TUI_ICONS) icons: Record<string, string>,\n ) {\n this.define(icons);\n }\n\n define(icons: Record<string, string>): void {\n const {value} = this.items$;\n\n Object.keys(icons).forEach(key => {\n this.defineIcon(key, icons[key], value);\n });\n\n this.items$.next(value);\n }\n\n getOriginal(name: string): string | null {\n return this.originals[name] || null;\n }\n\n private defineIcon(name: string, src: string, map: Map<string, SafeHtml>): void {\n if (map.has(name)) {\n return;\n }\n\n const parsed = this.parseSrc(name, src);\n\n if (!parsed) {\n tuiAssert.assert(false, `Unable to parse given SVG src`);\n\n return;\n }\n\n map.set(name, parsed);\n this.originals = {\n ...this.originals,\n [name]: src,\n };\n }\n\n private parseSrc(name: string, src: string): SafeHtml {\n return this.sanitize(processIcon(src, name));\n }\n\n private sanitize(src: string): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(\n (this.tuiSanitizer\n ? this.tuiSanitizer.sanitize(SecurityContext.HTML, src)\n : this.sanitizer.sanitize(SecurityContext.HTML, src)) || ``,\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;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AAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAExC,IAAI,CAAC,MAAM,EAAE;YACT,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,+BAA+B,CAAC,CAAC;YAEzD,OAAO;SACV;QAED,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtB,IAAI,CAAC,SAAS,mCACP,IAAI,CAAC,SAAS,KACjB,CAAC,IAAI,GAAG,GAAG,GACd,CAAC;KACL;IAEO,QAAQ,CAAC,IAAY,EAAE,GAAW;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;KAChD;IAEO,QAAQ,CAAC,GAAW;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CACzC,CAAC,IAAI,CAAC,YAAY;cACZ,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC;cACrD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,CAClE,CAAC;KACL;EACJ;;YApDsC,SAAS,uBAFvC,QAAQ,YACR,MAAM,SAAC,aAAa;YAE6B,YAAY,uBAA7D,MAAM,SAAC,YAAY;4CACnB,MAAM,SAAC,SAAS;;;AAVZ,aAAa;IAHzB,UAAU,CAAC;QACR,UAAU,EAAE,MAAM;KACrB,CAAC;IAOO,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;IAErB,WAAA,MAAM,CAAC,YAAY,CAAC,CAAA;IACpB,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;GAVb,aAAa,CA4DzB;;AC1ED;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-services.js","sources":["ng://@taiga-ui/core/services/format-date.service.ts","ng://@taiga-ui/core/services/hint.service.ts","ng://@taiga-ui/core/services/night-theme.service.ts","ng://@taiga-ui/core/services/router-link-active.service.ts","ng://@taiga-ui/core/services/svg.service.ts","ng://@taiga-ui/core/services/taiga-ui-core-services.ts"],"sourcesContent":["import {Inject, Injectable, LOCALE_ID} from '@angular/core';\nimport {Observable, of} from 'rxjs';\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiFormatDateService {\n constructor(@Inject(LOCALE_ID) protected readonly locale: string) {}\n\n format(timestamp: number): Observable<string> {\n return of(\n new Date(timestamp).toLocaleTimeString(this.locale, {\n hour: `numeric`,\n minute: `2-digit`,\n }),\n );\n }\n}\n","import {Injectable} from '@angular/core';\nimport {BehaviorSubject} from 'rxjs';\n\n// TODO: 3.0 can it be removed? It prevented seps cycling before 2.0\ntype TuiHintDirective = any;\n\ntype AbstractTuiHint = any;\n\n/**\n * Service for displaying hints/tooltips\n */\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiHintService extends BehaviorSubject<readonly AbstractTuiHint[]> {\n /**\n * TODO:\n * We need the following logic for desribedBy\n * move it into another service that can register hints and\n * manage it using TuiHintService inside\n */\n private directives: readonly TuiHintDirective[] = [];\n\n constructor() {\n super([]);\n }\n\n add(directive: AbstractTuiHint): void {\n this.next(this.value.concat(directive));\n }\n\n remove(directive: AbstractTuiHint): void {\n if (this.value.includes(directive)) {\n this.next(this.value.filter(hint => hint !== directive));\n }\n }\n\n register(directive: TuiHintDirective): void {\n this.directives = [...this.directives, directive];\n }\n\n unregister(directive: TuiHintDirective): void {\n this.remove(directive);\n this.directives = this.directives.filter(dir => dir !== directive);\n }\n\n showHintForId(id: string): void {\n const directive = this.findDirectiveWithHintId(id);\n\n if (directive) {\n this.add(directive);\n }\n }\n\n hideHintForId(id: string): void {\n const directive = this.findDirectiveWithHintId(id);\n\n if (directive) {\n this.remove(directive);\n }\n }\n\n private findDirectiveWithHintId(id: string): TuiHintDirective | undefined {\n return this.directives.find(directive => directive.tuiHintId === id);\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {fromEvent, Observable} from 'rxjs';\nimport {map, share, startWith} from 'rxjs/operators';\n\n// @dynamic\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiNightThemeService extends Observable<boolean> {\n constructor(@Inject(WINDOW) windowRef: Window) {\n const media = windowRef.matchMedia(`(prefers-color-scheme: dark)`);\n const media$ = fromEvent(media, `change`).pipe(\n startWith(null),\n map(() => media.matches),\n share(),\n );\n\n super(subscriber => media$.subscribe(subscriber));\n }\n}\n","import {Inject, Injectable, NgZone, Optional} from '@angular/core';\nimport {RouterLinkActive} from '@angular/router';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {TuiDestroyService, tuiZoneOptimized} from '@taiga-ui/cdk';\nimport {EMPTY, Observable} from 'rxjs';\nimport {distinctUntilChanged, map, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiRouterLinkActiveService extends Observable<boolean> {\n constructor(\n @Optional()\n @Inject(RouterLinkActive)\n routerLinkActive: RouterLinkActive | null,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n @Inject(TuiDestroyService) destroy$: TuiDestroyService,\n ) {\n const stream$ = routerLinkActive\n ? animationFrame$.pipe(\n map(() => routerLinkActive.isActive),\n distinctUntilChanged(),\n tuiZoneOptimized(ngZone),\n takeUntil(destroy$),\n )\n : EMPTY;\n\n super(subscriber => stream$.subscribe(subscriber));\n }\n}\n","import {Inject, Injectable, Optional, Sanitizer, SecurityContext} from '@angular/core';\nimport {DomSanitizer, SafeHtml} from '@angular/platform-browser';\nimport {tuiAssert} from '@taiga-ui/cdk';\nimport {TUI_ICONS, TUI_SANITIZER} from '@taiga-ui/core/tokens';\nimport {processIcon} from '@taiga-ui/core/utils/dom';\nimport {BehaviorSubject} from 'rxjs';\n\n/**\n * Service for reusing SVGs without inlining each instance\n */\n// @dynamic\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiSvgService {\n private originals: Record<string, string> = {};\n\n readonly items$ = new BehaviorSubject<Map<string, SafeHtml>>(new Map());\n\n constructor(\n @Optional()\n @Inject(TUI_SANITIZER)\n private readonly tuiSanitizer: Sanitizer | null,\n @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,\n @Inject(TUI_ICONS) icons: Record<string, string>,\n ) {\n this.define(icons);\n }\n\n define(icons: Record<string, string>): void {\n const {value} = this.items$;\n\n Object.keys(icons).forEach(key => {\n this.defineIcon(key, icons[key], value);\n });\n\n this.items$.next(value);\n }\n\n getOriginal(name: string): string | null {\n return this.originals[name] || null;\n }\n\n private defineIcon(name: string, src: string, map: Map<string, SafeHtml>): void {\n if (map.has(name)) {\n return;\n }\n\n const parsed = this.parseSrc(name, src);\n\n if (!parsed) {\n tuiAssert.assert(false, `Unable to parse given SVG src`);\n\n return;\n }\n\n map.set(name, parsed);\n this.originals = {\n ...this.originals,\n [name]: src,\n };\n }\n\n private parseSrc(name: string, src: string): SafeHtml {\n return this.sanitize(processIcon(src, name));\n }\n\n private sanitize(src: string): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(\n (this.tuiSanitizer\n ? this.tuiSanitizer.sanitize(SecurityContext.HTML, src)\n : this.sanitizer.sanitize(SecurityContext.HTML, src)) || ``,\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;IAMa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC7B,YAAkD,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;KAAI;IAEpE,MAAM,CAAC,SAAiB;QACpB,OAAO,EAAE,CACL,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE;YAChD,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;SACpB,CAAC,CACL,CAAC;KACL;EACJ;;yCAVgB,MAAM,SAAC,SAAS;;;AADpB,oBAAoB;IAHhC,UAAU,CA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
@@ -126,7 +126,6 @@ var TuiNotificationsService = /** @class */ (function () {
126
126
  }
127
127
  TuiNotificationsService.prototype.show = function (content, options) {
128
128
  if (options === void 0) { options = {}; }
129
- // @ts-ignore
130
129
  return this.alert.open(content, options);
131
130
  };
132
131
  TuiNotificationsService.ctorParameters = function () { return [
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-alert.js","sources":["ng://@taiga-ui/core/components/alert/alert.component.ts","ng://@taiga-ui/core/components/alert/alert.service.ts","ng://@taiga-ui/core/components/alert/alert.module.ts","ng://@taiga-ui/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n OnInit,\n} from '@angular/core';\nimport {\n isNumber,\n TuiContextWithImplicit,\n TuiDestroyService,\n TuiDialog,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiHeightCollapse, tuiSlideInRight} from '@taiga-ui/core/animations';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiAlertOptions} from '@taiga-ui/core/interfaces';\nimport {\n TUI_ANIMATION_OPTIONS,\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\n// TODO: 3.0 Remove and start using TuiDialog<TuiAlertOptions<I>, O>\nexport interface TuiNotificationContentContext<O = void, I = undefined>\n extends TuiContextWithImplicit<TuiNotification> {\n label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>>;\n data: I;\n closeHook: () => void;\n emitHook: (data: O) => void;\n emitAndCloseHook: (data: O) => void;\n}\n\n// TODO: 3.0 Refactor according to new context by 3.0 and get rid of $any in template\n@Component({\n selector: `tui-alert`,\n templateUrl: `./alert.template.html`,\n styleUrls: [`./alert.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],\n host: {role: `alert`},\n})\nexport class TuiAlertComponent<O, I> implements OnInit {\n private readonly autoClose =\n typeof this.item.autoClose === `function`\n ? this.item.autoClose(this.item.status)\n : this.item.autoClose;\n\n @HostBinding(`@tuiFadeIn`)\n @HostBinding(`@tuiSlideInRight`)\n @HostBinding(`@tuiHeightCollapse`)\n readonly animation = {value: ``, ...this.animationOptions} as const;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n private readonly options: TuiNotificationDefaultOptions,\n @Inject(TUI_ANIMATION_OPTIONS)\n private readonly animationOptions: AnimationOptions,\n @Inject(POLYMORPHEUS_CONTEXT) readonly item: TuiDialog<TuiAlertOptions<I>, O>,\n ) {}\n\n ngOnInit(): void {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification(): void {\n this.item.$implicit.complete();\n }\n\n @tuiPure\n private calculateContext({\n $implicit,\n status,\n data,\n label,\n }: TuiDialog<TuiAlertOptions<I>, O>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data,\n label,\n closeHook: () => {\n $implicit.complete();\n },\n emitHook: (data: O) => {\n $implicit.next(data);\n },\n emitAndCloseHook: (data: O) => {\n $implicit.next(data);\n $implicit.complete();\n },\n };\n }\n\n private initAutoClose(): void {\n if (!this.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.autoClose) ? this.autoClose : this.options.defaultAutoCloseTime,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, `mouseenter`)),\n // eslint-disable-next-line rxjs/no-ignored-notifier\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, `mouseleave`)),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {AbstractTuiDialogService, TuiIdService} from '@taiga-ui/cdk';\nimport {\n TuiAlertOptions,\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/tokens';\nimport {PolymorpheusComponent, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TuiAlertComponent, TuiNotificationContentContext} from './alert.component';\n\n@Injectable({providedIn: `root`})\nexport class TuiAlertService extends AbstractTuiDialogService<TuiAlertOptions<any>> {\n protected readonly component = new PolymorpheusComponent(TuiAlertComponent);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n protected readonly defaultOptions: TuiAlertOptions<any>,\n @Inject(TuiIdService) idService: TuiIdService,\n ) {\n super(idService);\n }\n}\n\n/** @deprecated use {@link TuiAlertService} */\n@Injectable({providedIn: `root`})\nexport class TuiNotificationsService {\n constructor(@Inject(TuiAlertService) private readonly alert: TuiAlertService) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n // @ts-ignore\n return this.alert.open(content, options);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_ALERTS} from '@taiga-ui/cdk';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {TuiAlertService} from './alert.service';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiAlertComponent],\n exports: [TuiAlertComponent],\n entryComponents: [TuiAlertComponent],\n providers: [\n {\n provide: TUI_ALERTS,\n useExisting: TuiAlertService,\n multi: true,\n },\n ],\n})\nexport class TuiAlertModule {}\n\n/** @deprecated use {@link TuiAlertModule} */\n@NgModule({imports: [TuiAlertModule]})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAsCA;;IAqBI,2BACyC,UAAmC,EAC5B,QAA2B,EAEtD,OAAsC,EAEtC,gBAAkC,EACZ,IAAsC;QANxC,eAAU,GAAV,UAAU,CAAyB;QAC5B,aAAQ,GAAR,QAAQ,CAAmB;QAEtD,YAAO,GAAP,OAAO,CAA+B;QAEtC,qBAAgB,GAAhB,gBAAgB,CAAkB;QACZ,SAAI,GAAJ,IAAI,CAAkC;QAjBhE,cAAS,GACtB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,UAAU;cACnC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;cACrC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAKrB,cAAS,GAAG,WAAC,KAAK,EAAE,EAAE,IAAK,IAAI,CAAC,gBAAgB,CAAU,CAAC;KAUhE;IAEJ,oCAAQ,GAAR;QACI,IAAI,CAAC,aAAa,EAAE,CAAC;KACxB;IAED,sBAAI,sCAAO;aAAX;YACI,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC3C;;;OAAA;IAED,6CAAiB,GAAjB;QACI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAClC;IAGO,4CAAgB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,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KAC5C;;gBAnB4D,eAAe,uBAA/D,MAAM,SAAC,eAAe;;;IAD1B,uBAAuB;QADnC,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;QAEhB,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;OAD3B,uBAAuB,CAqBnC;kCAjDD;CA4BA;;;ICNA;KAA8B;IAAjB,cAAc;QAb1B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,CAAC;YAClE,YAAY,EAAE,CAAC,iBAAiB,CAAC;YACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;YAC5B,eAAe,EAAE,CAAC,iBAAiB,CAAC;YACpC,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,eAAe;oBAC5B,KAAK,EAAE,IAAI;iBACd;aACJ;SACJ,CAAC;OACW,cAAc,CAAG;IAAD,qBAAC;CAA9B,IAA8B;AAE9B;;IAEA;KAAsC;IAAzB,sBAAsB;QADlC,QAAQ,CAAC,EAAC,OAAO,EAAE,CAAC,cAAc,CAAC,EAAC,CAAC;OACzB,sBAAsB,CAAG;IAAD,6BAAC;CAAtC;;AC1BA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-alert.js","sources":["ng://@taiga-ui/core/components/alert/alert.component.ts","ng://@taiga-ui/core/components/alert/alert.service.ts","ng://@taiga-ui/core/components/alert/alert.module.ts","ng://@taiga-ui/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n OnInit,\n} from '@angular/core';\nimport {\n isNumber,\n TuiContextWithImplicit,\n TuiDestroyService,\n TuiDialog,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiHeightCollapse, tuiSlideInRight} from '@taiga-ui/core/animations';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiAlertOptions} from '@taiga-ui/core/interfaces';\nimport {\n TUI_ANIMATION_OPTIONS,\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\n// TODO: 3.0 Remove and start using TuiDialog<TuiAlertOptions<I>, O>\nexport interface TuiNotificationContentContext<O = void, I = undefined>\n extends TuiContextWithImplicit<TuiNotification> {\n label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>>;\n data: I;\n closeHook: () => void;\n emitHook: (data: O) => void;\n emitAndCloseHook: (data: O) => void;\n}\n\n// TODO: 3.0 Refactor according to new context by 3.0 and get rid of $any in template\n@Component({\n selector: `tui-alert`,\n templateUrl: `./alert.template.html`,\n styleUrls: [`./alert.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],\n host: {role: `alert`},\n})\nexport class TuiAlertComponent<O, I> implements OnInit {\n private readonly autoClose =\n typeof this.item.autoClose === `function`\n ? this.item.autoClose(this.item.status)\n : this.item.autoClose;\n\n @HostBinding(`@tuiFadeIn`)\n @HostBinding(`@tuiSlideInRight`)\n @HostBinding(`@tuiHeightCollapse`)\n readonly animation = {value: ``, ...this.animationOptions} as const;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n private readonly options: TuiNotificationDefaultOptions,\n @Inject(TUI_ANIMATION_OPTIONS)\n private readonly animationOptions: AnimationOptions,\n @Inject(POLYMORPHEUS_CONTEXT) readonly item: TuiDialog<TuiAlertOptions<I>, O>,\n ) {}\n\n ngOnInit(): void {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification(): void {\n this.item.$implicit.complete();\n }\n\n @tuiPure\n private calculateContext({\n $implicit,\n status,\n data,\n label,\n }: TuiDialog<TuiAlertOptions<I>, O>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data,\n label,\n closeHook: () => {\n $implicit.complete();\n },\n emitHook: (data: O) => {\n $implicit.next(data);\n },\n emitAndCloseHook: (data: O) => {\n $implicit.next(data);\n $implicit.complete();\n },\n };\n }\n\n private initAutoClose(): void {\n if (!this.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.autoClose) ? this.autoClose : this.options.defaultAutoCloseTime,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, `mouseenter`)),\n // eslint-disable-next-line rxjs/no-ignored-notifier\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, `mouseleave`)),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {AbstractTuiDialogService, TuiIdService} from '@taiga-ui/cdk';\nimport {\n TuiAlertOptions,\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/tokens';\nimport {PolymorpheusComponent, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TuiAlertComponent, TuiNotificationContentContext} from './alert.component';\n\n@Injectable({providedIn: `root`})\nexport class TuiAlertService extends AbstractTuiDialogService<TuiAlertOptions<any>> {\n protected readonly component = new PolymorpheusComponent(TuiAlertComponent);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n protected readonly defaultOptions: TuiAlertOptions<any>,\n @Inject(TuiIdService) idService: TuiIdService,\n ) {\n super(idService);\n }\n}\n\n/** @deprecated use {@link TuiAlertService} */\n@Injectable({providedIn: `root`})\nexport class TuiNotificationsService {\n constructor(@Inject(TuiAlertService) private readonly alert: TuiAlertService) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n return this.alert.open(content as any, options) as unknown as Observable<O>;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_ALERTS} from '@taiga-ui/cdk';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {TuiAlertService} from './alert.service';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiAlertComponent],\n exports: [TuiAlertComponent],\n entryComponents: [TuiAlertComponent],\n providers: [\n {\n provide: TUI_ALERTS,\n useExisting: TuiAlertService,\n multi: true,\n },\n ],\n})\nexport class TuiAlertModule {}\n\n/** @deprecated use {@link TuiAlertModule} */\n@NgModule({imports: [TuiAlertModule]})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAsCA;;IAqBI,2BACyC,UAAmC,EAC5B,QAA2B,EAEtD,OAAsC,EAEtC,gBAAkC,EACZ,IAAsC;QANxC,eAAU,GAAV,UAAU,CAAyB;QAC5B,aAAQ,GAAR,QAAQ,CAAmB;QAEtD,YAAO,GAAP,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I;iBACd;aACJ;SACJ,CAAC;OACW,cAAc,CAAG;IAAD,qBAAC;CAA9B,IAA8B;AAE9B;;IAEA;KAAsC;IAAzB,sBAAsB;QADlC,QAAQ,CAAC,EAAC,OAAO,EAAE,CAAC,cAAc,CAAC,EAAC,CAAC;OACzB,sBAAsB,CAAG;IAAD,6BAAC;CAAtC;;AC1BA;;;;;;"}
@@ -1,8 +1,9 @@
1
1
  import { __assign, __extends, __decorate, __param } from 'tslib';
2
- import { InjectionToken, ElementRef, Inject, ChangeDetectorRef, Input, HostBinding, HostListener, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
2
+ import { InjectionToken, Optional, Inject, ElementRef, ChangeDetectorRef, Input, HostBinding, HostListener, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
3
3
  import { watch, pressedObservable, isNativeFocused, TuiFocusVisibleService, TuiHoveredService, TuiDestroyService, TUI_TAKE_ONLY_TRUSTED_EVENTS, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiInteractive } from '@taiga-ui/cdk';
4
- import { Observable } from 'rxjs';
5
- import { takeUntil } from 'rxjs/operators';
4
+ import { TuiModeDirective } from '@taiga-ui/core/directives';
5
+ import { EMPTY, Observable } from 'rxjs';
6
+ import { startWith, map, distinctUntilChanged, takeUntil } from 'rxjs/operators';
6
7
  import { CommonModule } from '@angular/common';
7
8
  import { TuiLoaderModule } from '@taiga-ui/core/components/loader';
8
9
  import { TuiSvgModule } from '@taiga-ui/core/components/svg';
@@ -24,18 +25,22 @@ var tuiButtonOptionsProvider = function (options) { return ({
24
25
 
25
26
  var TuiButtonComponent = /** @class */ (function (_super) {
26
27
  __extends(TuiButtonComponent, _super);
27
- function TuiButtonComponent(elementRef, focusVisible$, hoveredService, destroy$, changeDetectorRef, takeOnlyTrustedEvents, options) {
28
+ function TuiButtonComponent(mode, elementRef, focusVisible$, hoveredService, destroy$, changeDetectorRef, takeOnlyTrustedEvents, options) {
29
+ var _a;
28
30
  var _this = _super.call(this) || this;
31
+ _this.mode = mode;
29
32
  _this.elementRef = elementRef;
30
33
  _this.takeOnlyTrustedEvents = takeOnlyTrustedEvents;
31
34
  _this.options = options;
32
- _this.appearance = _this.options.appearance || "";
35
+ _this.mode$ = ((_a = _this.mode) === null || _a === void 0 ? void 0 : _a.change$) || EMPTY;
36
+ _this.appearance = null;
33
37
  _this.disabled = false;
34
38
  _this.icon = "";
35
39
  _this.iconRight = "";
36
40
  _this.shape = _this.options.shape;
37
41
  _this.showLoader = false;
38
42
  _this.size = _this.options.size;
43
+ _this.appearance$ = _this.mode$.pipe(startWith(null), map(function () { return _this.computedAppearance; }), distinctUntilChanged());
39
44
  hoveredService
40
45
  .createHovered$(elementRef.nativeElement)
41
46
  .pipe(watch(changeDetectorRef), takeUntil(destroy$))
@@ -76,6 +81,14 @@ var TuiButtonComponent = /** @class */ (function (_super) {
76
81
  enumerable: true,
77
82
  configurable: true
78
83
  });
84
+ Object.defineProperty(TuiButtonComponent.prototype, "computedAppearance", {
85
+ get: function () {
86
+ var _a;
87
+ return (_a = this.appearance) !== null && _a !== void 0 ? _a : (this.options.appearance || "");
88
+ },
89
+ enumerable: true,
90
+ configurable: true
91
+ });
79
92
  Object.defineProperty(TuiButtonComponent.prototype, "nativeDisabled", {
80
93
  get: function () {
81
94
  return this.computedDisabled || this.showLoader ? "" : null;
@@ -95,6 +108,7 @@ var TuiButtonComponent = /** @class */ (function (_super) {
95
108
  };
96
109
  var TuiButtonComponent_1;
97
110
  TuiButtonComponent.ctorParameters = function () { return [
111
+ { type: TuiModeDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiModeDirective,] }] },
98
112
  { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
99
113
  { type: TuiFocusVisibleService, decorators: [{ type: Inject, args: [TuiFocusVisibleService,] }] },
100
114
  { type: TuiHoveredService, decorators: [{ type: Inject, args: [TuiHoveredService,] }] },
@@ -105,7 +119,6 @@ var TuiButtonComponent = /** @class */ (function (_super) {
105
119
  ]; };
106
120
  __decorate([
107
121
  Input(),
108
- HostBinding("attr.data-appearance"),
109
122
  tuiDefaultProp()
110
123
  ], TuiButtonComponent.prototype, "appearance", void 0);
111
124
  __decorate([
@@ -135,6 +148,9 @@ var TuiButtonComponent = /** @class */ (function (_super) {
135
148
  HostBinding("attr.data-size"),
136
149
  tuiDefaultProp()
137
150
  ], TuiButtonComponent.prototype, "size", void 0);
151
+ __decorate([
152
+ HostBinding("attr.data-appearance")
153
+ ], TuiButtonComponent.prototype, "computedAppearance", null);
138
154
  __decorate([
139
155
  HostBinding("attr.disabled")
140
156
  ], TuiButtonComponent.prototype, "nativeDisabled", null);
@@ -148,7 +164,7 @@ var TuiButtonComponent = /** @class */ (function (_super) {
148
164
  TuiButtonComponent = TuiButtonComponent_1 = __decorate([
149
165
  Component({
150
166
  selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]",
151
- template: "<tui-wrapper\n class=\"t-wrapper\"\n [appearance]=\"appearance\"\n [hovered]=\"computedHovered\"\n [pressed]=\"computedPressed\"\n [disabled]=\"computedDisabled\"\n [focused]=\"computedFocusVisible\"\n>\n <span class=\"t-content\">\n <span\n *ngIf=\"icon\"\n polymorpheus-outlet\n class=\"t-left\"\n [content]=\"icon\"\n >\n <ng-template let-icon>\n <tui-svg\n class=\"t-icon\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </span>\n <ng-content></ng-content>\n <span\n *ngIf=\"iconRight\"\n polymorpheus-outlet\n class=\"t-right\"\n [content]=\"iconRight\"\n >\n <ng-template let-icon>\n <tui-svg\n class=\"t-icon\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </span>\n </span>\n <tui-loader\n *ngIf=\"showLoader\"\n class=\"t-loader\"\n [size]=\"loaderSize\"\n [inheritColor]=\"true\"\n ></tui-loader>\n</tui-wrapper>\n",
167
+ template: "<ng-container *ngIf=\"appearance$ | async\"></ng-container>\n<tui-wrapper\n class=\"t-wrapper\"\n [appearance]=\"computedAppearance\"\n [hovered]=\"computedHovered\"\n [pressed]=\"computedPressed\"\n [disabled]=\"computedDisabled\"\n [focused]=\"computedFocusVisible\"\n>\n <span class=\"t-content\">\n <span\n *ngIf=\"icon\"\n polymorpheus-outlet\n class=\"t-left\"\n [content]=\"icon\"\n >\n <ng-template let-icon>\n <tui-svg\n class=\"t-icon\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </span>\n <ng-content></ng-content>\n <span\n *ngIf=\"iconRight\"\n polymorpheus-outlet\n class=\"t-right\"\n [content]=\"iconRight\"\n >\n <ng-template let-icon>\n <tui-svg\n class=\"t-icon\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </span>\n </span>\n <tui-loader\n *ngIf=\"showLoader\"\n class=\"t-loader\"\n [size]=\"loaderSize\"\n [inheritColor]=\"true\"\n ></tui-loader>\n</tui-wrapper>\n",
152
168
  changeDetection: ChangeDetectionStrategy.OnPush,
153
169
  providers: [
154
170
  {
@@ -160,13 +176,15 @@ var TuiButtonComponent = /** @class */ (function (_super) {
160
176
  ],
161
177
  styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:inline-block;flex-shrink:0;vertical-align:top;border-radius:var(--tui-radius-m);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;outline:0}:host[disabled]{pointer-events:none}:host[tuiIconButton] .t-left,:host[tuiIconButton] .t-right{margin:0}:host[data-shape=rounded]{border-radius:6.25rem}:host[data-size=xs]{height:var(--tui-height-xs);font-weight:400}:host[data-size=xs][data-shape=square],:host[data-size=xs][tuiIconButton]{height:var(--tui-height-xs);width:var(--tui-height-xs)}:host[data-size='s']{height:var(--tui-height-s);font-weight:400}:host[data-size='s'][data-shape=square],:host[data-size='s'][tuiIconButton]{height:var(--tui-height-s);width:var(--tui-height-s)}:host[data-size='m']{height:var(--tui-height-m);font:var(--tui-font-text-m);font-weight:700}:host[data-size='m'][data-shape=square],:host[data-size='m'][tuiIconButton]{height:var(--tui-height-m);width:var(--tui-height-m)}:host[data-size='l']{height:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700}:host[data-size='l'][data-shape=square],:host[data-size='l'][tuiIconButton]{height:var(--tui-height-l);width:var(--tui-height-l)}:host[data-size=xl]{height:3.75rem;font:var(--tui-font-text-m);font-weight:700}:host[data-size=xl][data-shape=square],:host[data-size=xl][tuiIconButton]{height:3.75rem;width:3.75rem}.t-loader{position:absolute;top:0;left:0;width:100%;height:100%;cursor:default}.t-left{margin:0 .5rem 0 -.25rem}.t-right{margin:0 -.5rem 0 .25rem}.t-icon{display:block}:host[data-size='s'] .t-icon,:host[data-size=xs] .t-icon{width:1rem;height:1rem}:host[tuiIconButton] .t-icon,:host[tuiIconButton] .t-left,:host[tuiIconButton] .t-right{display:flex;width:100%;height:100%;align-items:center;justify-content:center}.t-wrapper{position:relative;z-index:0;box-sizing:border-box;cursor:pointer}:host[data-size=xs] .t-wrapper{padding:0 .5rem}:host[data-size='s'] .t-wrapper{padding:0 .75rem}:host[data-size='m'] .t-wrapper{padding:0 1.5rem}:host[data-size='l'] .t-wrapper{padding:0 2.25rem}:host[data-size=xl] .t-wrapper{padding:0 2.5rem}:host[data-shape=square] .t-wrapper,:host[tuiIconButton] .t-wrapper{padding:0}.t-content{display:flex;height:100%;align-items:center;justify-content:center;text-align:center}:host._loading .t-content{opacity:0}"]
162
178
  }),
163
- __param(0, Inject(ElementRef)),
164
- __param(1, Inject(TuiFocusVisibleService)),
165
- __param(2, Inject(TuiHoveredService)),
166
- __param(3, Inject(TuiDestroyService)),
167
- __param(4, Inject(ChangeDetectorRef)),
168
- __param(5, Inject(TUI_TAKE_ONLY_TRUSTED_EVENTS)),
169
- __param(6, Inject(TUI_BUTTON_OPTIONS))
179
+ __param(0, Optional()),
180
+ __param(0, Inject(TuiModeDirective)),
181
+ __param(1, Inject(ElementRef)),
182
+ __param(2, Inject(TuiFocusVisibleService)),
183
+ __param(3, Inject(TuiHoveredService)),
184
+ __param(4, Inject(TuiDestroyService)),
185
+ __param(5, Inject(ChangeDetectorRef)),
186
+ __param(6, Inject(TUI_TAKE_ONLY_TRUSTED_EVENTS)),
187
+ __param(7, Inject(TUI_BUTTON_OPTIONS))
170
188
  ], TuiButtonComponent);
171
189
  return TuiButtonComponent;
172
190
  }(AbstractTuiInteractive));
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-button.js","sources":["ng://@taiga-ui/core/components/button/button-options.ts","ng://@taiga-ui/core/components/button/button.component.ts","ng://@taiga-ui/core/components/button/button.module.ts","ng://@taiga-ui/core/components/button/taiga-ui-core-components-button.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\nimport {TuiSizeXL, TuiSizeXS} from '@taiga-ui/core/types';\n\nexport interface TuiButtonOptions {\n readonly size: TuiSizeXS | TuiSizeXL;\n readonly appearance:\n | keyof Record<TuiAppearance, string>\n | TuiAppearance\n | string\n | null; // TODO: 3.0 need remove `null`\n readonly shape: 'square' | 'rounded' | null; // TODO: 3.0 need remove `null`\n}\n\n/**\n * @deprecated: use TuiButtonOptions instead\n * todo: remove in 3.0\n */\nexport type ButtonOptions = TuiButtonOptions;\n\nexport const TUI_BUTTON_DEFAULT_OPTIONS: TuiButtonOptions = {\n size: `l`,\n shape: null,\n appearance: TuiAppearance.Primary,\n};\n\nexport const TUI_BUTTON_OPTIONS = new InjectionToken<TuiButtonOptions>(\n `Default parameters for button component`,\n {\n factory: () => TUI_BUTTON_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiButtonOptionsProvider: (\n options: Partial<TuiButtonOptions>,\n) => ValueProvider = (options: Partial<TuiButtonOptions>) => ({\n provide: TUI_BUTTON_OPTIONS,\n useValue: {...TUI_BUTTON_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n AbstractTuiInteractive,\n isNativeFocused,\n pressedObservable,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_TAKE_ONLY_TRUSTED_EVENTS,\n tuiDefaultProp,\n TuiDestroyService,\n TuiFocusableElementAccessor,\n TuiFocusVisibleService,\n TuiHoveredService,\n watch,\n} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {TUI_BUTTON_OPTIONS, TuiButtonOptions} from './button-options';\n\n@Component({\n selector: `button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]`,\n templateUrl: `./button.template.html`,\n styleUrls: [`./button.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiButtonComponent),\n },\n TuiDestroyService,\n TuiFocusVisibleService,\n ],\n})\nexport class TuiButtonComponent\n extends AbstractTuiInteractive\n implements TuiFocusableElementAccessor, TuiButtonOptions\n{\n @Input()\n @HostBinding(`attr.data-appearance`)\n @tuiDefaultProp()\n appearance = this.options.appearance || ``;\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n @tuiDefaultProp()\n icon: PolymorpheusContent = ``;\n\n @Input()\n @tuiDefaultProp()\n iconRight: PolymorpheusContent = ``;\n\n @Input()\n @HostBinding(`attr.data-shape`)\n @tuiDefaultProp()\n shape = this.options.shape;\n\n @Input()\n @HostBinding(`class._loading`)\n @tuiDefaultProp()\n showLoader = false;\n\n @Input()\n @HostBinding(`attr.data-size`)\n @tuiDefaultProp()\n size = this.options.size;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiFocusVisibleService) focusVisible$: TuiFocusVisibleService,\n @Inject(TuiHoveredService) hoveredService: TuiHoveredService,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TAKE_ONLY_TRUSTED_EVENTS)\n private readonly takeOnlyTrustedEvents: boolean,\n @Inject(TUI_BUTTON_OPTIONS) private readonly options: TuiButtonOptions,\n ) {\n super();\n\n hoveredService\n .createHovered$(elementRef.nativeElement)\n .pipe(watch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(hovered => {\n this.updateHovered(hovered);\n });\n pressedObservable(elementRef.nativeElement, {\n onlyTrusted: this.takeOnlyTrustedEvents,\n })\n .pipe(watch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(pressed => {\n this.updatePressed(pressed);\n });\n focusVisible$.subscribe(focusVisible => {\n this.updateFocusVisible(focusVisible);\n });\n }\n\n get nativeFocusableElement(): HTMLElement | null {\n return this.nativeDisabled ? null : this.elementRef.nativeElement;\n }\n\n get focused(): boolean {\n return !this.showLoader && isNativeFocused(this.elementRef.nativeElement);\n }\n\n get loaderSize(): TuiSizeS {\n return this.size === `l` || this.size === `xl` ? `m` : `s`;\n }\n\n @HostBinding(`attr.disabled`)\n get nativeDisabled(): '' | null {\n return this.computedDisabled || this.showLoader ? `` : null;\n }\n\n @HostBinding(`tabIndex`)\n get tabIndex(): number {\n return this.focusable ? 0 : -1;\n }\n\n @HostListener(`focusin`, [`true`])\n @HostListener(`focusout`, [`false`])\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLoaderModule} from '@taiga-ui/core/components/loader';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiWrapperModule} from '@taiga-ui/core/directives/wrapper';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiButtonComponent} from './button.component';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiWrapperModule,\n TuiSvgModule,\n TuiLoaderModule,\n ],\n declarations: [TuiButtonComponent],\n exports: [TuiButtonComponent],\n})\nexport class TuiButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;IAoBa,0BAA0B,GAAqB;IACxD,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,IAAI;IACX,UAAU;EACZ;IAEW,kBAAkB,GAAG,IAAI,cAAc,CAChD,yCAAyC,EACzC;IACI,OAAO,EAAE,cAAM,OAAA,0BAA0B,GAAA;CAC5C,EACH;IAEW,wBAAwB,GAEhB,UAAC,OAAkC,IAAK,QAAC;IAC1D,OAAO,EAAE,kBAAkB;IAC3B,QAAQ,wBAAM,0BAA0B,GAAK,OAAO,CAAC;CACxD;;;ICQW,sCAAsB;IAmC9B,4BACyC,UAAmC,EACxC,aAAqC,EAC1C,cAAiC,EACjC,QAA0B,EAC1B,iBAAoC,EAE9C,qBAA8B,EACF,OAAyB;QAR1E,YAUI,iBAAO,SAkBV;QA3BwC,gBAAU,GAAV,UAAU,CAAyB;QAMvD,2BAAqB,GAArB,qBAAqB,CAAS;QACF,aAAO,GAAP,OAAO,CAAkB;QArC1E,gBAAU,GAAG,KAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;QAI3C,cAAQ,GAAG,KAAK,CAAC;QAIjB,UAAI,GAAwB,EAAE,CAAC;QAI/B,eAAS,GAAwB,EAAE,CAAC;QAKpC,WAAK,GAAG,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAK3B,gBAAU,GAAG,KAAK,CAAC;QAKnB,UAAI,GAAG,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAcrB,cAAc;aACT,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC;aACxC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,SAAS,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gBACD,iBAAiB;gBACjB,sBAAsB;aACzB;;SACJ,CAAC;QAsCO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAClB,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;QAC9B,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,4BAA4B,CAAC,CAAA;QAEpC,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;OA5CtB,kBAAkB,CA6F9B;IAAD,yBAAC;CAAA,CA5FW,sBAAsB;;;IC1BlC;KAA+B;IAAlB,eAAe;QAX3B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,kBAAkB;gBAClB,gBAAgB;gBAChB,YAAY;gBACZ,eAAe;aAClB;YACD,YAAY,EAAE,CAAC,kBAAkB,CAAC;YAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;SAChC,CAAC;OACW,eAAe,CAAG;IAAD,sBAAC;CAA/B;;ACpBA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-button.js","sources":["ng://@taiga-ui/core/components/button/button-options.ts","ng://@taiga-ui/core/components/button/button.component.ts","ng://@taiga-ui/core/components/button/button.module.ts","ng://@taiga-ui/core/components/button/taiga-ui-core-components-button.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\nimport {TuiSizeXL, TuiSizeXS} from '@taiga-ui/core/types';\n\nexport interface TuiButtonOptions {\n readonly size: TuiSizeXS | TuiSizeXL;\n readonly appearance:\n | keyof Record<TuiAppearance, string>\n | TuiAppearance\n | string\n | null; // TODO: 3.0 need remove `null`\n readonly shape: 'square' | 'rounded' | null; // TODO: 3.0 need remove `null`\n}\n\n/**\n * @deprecated: use TuiButtonOptions instead\n * todo: remove in 3.0\n */\nexport type ButtonOptions = TuiButtonOptions;\n\nexport const TUI_BUTTON_DEFAULT_OPTIONS: TuiButtonOptions = {\n size: `l`,\n shape: null,\n appearance: TuiAppearance.Primary,\n};\n\nexport const TUI_BUTTON_OPTIONS = new InjectionToken<TuiButtonOptions>(\n `Default parameters for button component`,\n {\n factory: () => TUI_BUTTON_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiButtonOptionsProvider: (\n options: Partial<TuiButtonOptions>,\n) => ValueProvider = (options: Partial<TuiButtonOptions>) => ({\n provide: TUI_BUTTON_OPTIONS,\n useValue: {...TUI_BUTTON_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Optional,\n} from '@angular/core';\nimport {\n AbstractTuiInteractive,\n isNativeFocused,\n pressedObservable,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_TAKE_ONLY_TRUSTED_EVENTS,\n tuiDefaultProp,\n TuiDestroyService,\n TuiFocusableElementAccessor,\n TuiFocusVisibleService,\n TuiHoveredService,\n watch,\n} from '@taiga-ui/cdk';\nimport {TuiModeDirective} from '@taiga-ui/core/directives';\nimport {TuiSizeS} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, Observable} from 'rxjs';\nimport {distinctUntilChanged, map, startWith, takeUntil} from 'rxjs/operators';\n\nimport {TUI_BUTTON_OPTIONS, TuiButtonOptions} from './button-options';\n\n@Component({\n selector: `button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]`,\n templateUrl: `./button.template.html`,\n styleUrls: [`./button.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiButtonComponent),\n },\n TuiDestroyService,\n TuiFocusVisibleService,\n ],\n})\nexport class TuiButtonComponent\n extends AbstractTuiInteractive\n implements TuiFocusableElementAccessor, TuiButtonOptions\n{\n private readonly mode$: Observable<unknown> = this.mode?.change$ || EMPTY;\n\n @Input()\n @tuiDefaultProp()\n appearance: TuiButtonOptions['appearance'] = null;\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n @tuiDefaultProp()\n icon: PolymorpheusContent = ``;\n\n @Input()\n @tuiDefaultProp()\n iconRight: PolymorpheusContent = ``;\n\n @Input()\n @HostBinding(`attr.data-shape`)\n @tuiDefaultProp()\n shape = this.options.shape;\n\n @Input()\n @HostBinding(`class._loading`)\n @tuiDefaultProp()\n showLoader = false;\n\n @Input()\n @HostBinding(`attr.data-size`)\n @tuiDefaultProp()\n size = this.options.size;\n\n readonly appearance$ = this.mode$.pipe(\n startWith(null),\n map(() => this.computedAppearance),\n distinctUntilChanged(),\n );\n\n constructor(\n @Optional()\n @Inject(TuiModeDirective)\n private readonly mode: TuiModeDirective | null,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiFocusVisibleService) focusVisible$: TuiFocusVisibleService,\n @Inject(TuiHoveredService) hoveredService: TuiHoveredService,\n @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TAKE_ONLY_TRUSTED_EVENTS)\n private readonly takeOnlyTrustedEvents: boolean,\n @Inject(TUI_BUTTON_OPTIONS) private readonly options: TuiButtonOptions,\n ) {\n super();\n\n hoveredService\n .createHovered$(elementRef.nativeElement)\n .pipe(watch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(hovered => {\n this.updateHovered(hovered);\n });\n pressedObservable(elementRef.nativeElement, {\n onlyTrusted: this.takeOnlyTrustedEvents,\n })\n .pipe(watch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(pressed => {\n this.updatePressed(pressed);\n });\n focusVisible$.subscribe(focusVisible => {\n this.updateFocusVisible(focusVisible);\n });\n }\n\n get nativeFocusableElement(): HTMLElement | null {\n return this.nativeDisabled ? null : this.elementRef.nativeElement;\n }\n\n get focused(): boolean {\n return !this.showLoader && isNativeFocused(this.elementRef.nativeElement);\n }\n\n get loaderSize(): TuiSizeS {\n return this.size === `l` || this.size === `xl` ? `m` : `s`;\n }\n\n @HostBinding(`attr.data-appearance`)\n get computedAppearance(): string {\n return this.appearance ?? (this.options.appearance || ``);\n }\n\n @HostBinding(`attr.disabled`)\n get nativeDisabled(): '' | null {\n return this.computedDisabled || this.showLoader ? `` : null;\n }\n\n @HostBinding(`tabIndex`)\n get tabIndex(): number {\n return this.focusable ? 0 : -1;\n }\n\n @HostListener(`focusin`, [`true`])\n @HostListener(`focusout`, [`false`])\n onFocused(focused: boolean): void {\n this.updateFocused(focused);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLoaderModule} from '@taiga-ui/core/components/loader';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiWrapperModule} from '@taiga-ui/core/directives/wrapper';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiButtonComponent} from './button.component';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiWrapperModule,\n TuiSvgModule,\n TuiLoaderModule,\n ],\n declarations: [TuiButtonComponent],\n exports: [TuiButtonComponent],\n})\nexport class TuiButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;IAoBa,0BAA0B,GAAqB;IACxD,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,IAAI;IACX,UAAU;EACZ;IAEW,kBAAkB,GAAG,IAAI,cAAc,CAChD,yCAAyC,EACzC;IACI,OAAO,EAAE,cAAM,OAAA,0BAA0B,GAAA;CAC5C,EACH;IAEW,wBAAwB,GAEhB,UAAC,OAAkC,IAAK,QAAC;IAC1D,OAAO,EAAE,kBAAkB;IAC3B,QAAQ,wBAAM,0BAA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QAAQ,EAAE,CAAA;QACV,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;QAExB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAClB,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;QAC9B,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,4BAA4B,CAAC,CAAA;QAEpC,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;OAtDtB,kBAAkB,CA4G9B;IAAD,yBAAC;CAAA,CA3GW,sBAAsB;;;IC5BlC;KAA+B;IAAlB,eAAe;QAX3B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,kBAAkB;gBAClB,gBAAgB;gBAChB,YAAY;gBACZ,eAAe;aAClB;YACD,YAAY,EAAE,CAAC,kBAAkB,CAAC;YAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;SAChC,CAAC;OACW,eAAe,CAAG;IAAD,sBAAC;CAA/B;;ACpBA;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from 'tslib';
2
2
  import { EventEmitter, Inject, Input, HostBinding, Output, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
- import { tuiDefaultProp } from '@taiga-ui/cdk';
3
+ import { tuiIsObserved, tuiDefaultProp } from '@taiga-ui/cdk';
4
4
  import { TUI_CLOSE_WORD, TUI_NOTIFICATION_OPTIONS } from '@taiga-ui/core/tokens';
5
5
  import { Observable } from 'rxjs';
6
6
  import { CommonModule } from '@angular/common';
@@ -31,7 +31,7 @@ var TuiNotificationComponent = /** @class */ (function () {
31
31
  });
32
32
  Object.defineProperty(TuiNotificationComponent.prototype, "hasClose", {
33
33
  get: function () {
34
- return !!this.close.observers.length;
34
+ return tuiIsObserved(this.close);
35
35
  },
36
36
  enumerable: true,
37
37
  configurable: true
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-notification.js","sources":["ng://@taiga-ui/core/components/notification/notification.component.ts","ng://@taiga-ui/core/components/notification/notification.module.ts","ng://@taiga-ui/core/components/notification/taiga-ui-core-components-notification.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n TUI_CLOSE_WORD,\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {Observable} from 'rxjs';\n\nexport const STATUS_ICON = {\n info: `tuiIconInfo`,\n success: `tuiIconCheckCircle`,\n error: `tuiIconCancel`,\n warning: `tuiIconAttention`,\n} as const;\n\n// @bad TODO: Think about moving to kit\n@Component({\n selector: `tui-notification`,\n templateUrl: `./notification.template.html`,\n styleUrls: [`./notification.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiNotificationComponent {\n @Input()\n @HostBinding(`class._has-icon`)\n @tuiDefaultProp()\n hasIcon = this.options.hasIcon;\n\n @Input()\n @HostBinding(`attr.data-tui-host-status`)\n @tuiDefaultProp()\n status: 'info' | 'error' | 'warning' | 'success' = this.options.status;\n\n @Output()\n readonly close = new EventEmitter<void>();\n\n constructor(\n @Inject(TUI_CLOSE_WORD) readonly closeWord$: Observable<string>,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: TuiNotificationDefaultOptions,\n ) {}\n\n get icon(): string {\n return STATUS_ICON[this.status];\n }\n\n @HostBinding(`class._has-close-button`)\n get hasClose(): boolean {\n return !!this.close.observers.length;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiButtonModule} from '@taiga-ui/core/components/button';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\n\nimport {TuiNotificationComponent} from './notification.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, TuiButtonModule],\n declarations: [TuiNotificationComponent],\n exports: [TuiNotificationComponent],\n})\nexport class TuiNotificationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAiBa,WAAW,GAAG;IACvB,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,oBAAoB;IAC7B,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,kBAAkB;EACpB;AAEX;;IAqBI,kCACqC,UAA8B,EAEtD,OAAsC;QAFd,eAAU,GAAV,UAAU,CAAoB;QAEtD,YAAO,GAAP,OAAO,CAA+B;QAbnD,YAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAK/B,WAAM,GAA6C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAG9D,UAAK,GAAG,IAAI,YAAY,EAAQ,CAAC;KAMtC;IAEJ,sBAAI,0CAAI;aAAR;YACI,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACnC;;;OAAA;IAGD,sBAAI,8CAAQ;aAAZ;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;SACxC;;;OAAA;;gBAZgD,UAAU,uBAAtD,MAAM,SAAC,cAAc;gDACrB,MAAM,SAAC,wBAAwB;;IAZpC;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,iBAAiB,CAAC;QAC9B,cAAc,EAAE;6DACc;IAK/B;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,2BAA2B,CAAC;QACxC,cAAc,EAAE;4DACsD;IAGvE;QADC,MAAM,EAAE;2DACiC;IAa1C;QADC,WAAW,CAAC,yBAAyB,CAAC;4DAGtC;IA3BQ,wBAAwB;QANpC,SAAS,CAAC;YACP,QAAQ,EAAE,kBAAkB;YAC5B,2fAA2C;YAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;;SAClD,CAAC;QAgBO,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;QACtB,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;OAhB5B,wBAAwB,CA4BpC;IAAD,+BAAC;CA5BD;;;ICnBA;KAAqC;IAAxB,qBAAqB;QALjC,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC;YACtD,YAAY,EAAE,CAAC,wBAAwB,CAAC;YACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;OACW,qBAAqB,CAAG;IAAD,4BAAC;CAArC;;ACZA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-notification.js","sources":["ng://@taiga-ui/core/components/notification/notification.component.ts","ng://@taiga-ui/core/components/notification/notification.module.ts","ng://@taiga-ui/core/components/notification/taiga-ui-core-components-notification.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp, tuiIsObserved} from '@taiga-ui/cdk';\nimport {\n TUI_CLOSE_WORD,\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {Observable} from 'rxjs';\n\nexport const STATUS_ICON = {\n info: `tuiIconInfo`,\n success: `tuiIconCheckCircle`,\n error: `tuiIconCancel`,\n warning: `tuiIconAttention`,\n} as const;\n\n// @bad TODO: Think about moving to kit\n@Component({\n selector: `tui-notification`,\n templateUrl: `./notification.template.html`,\n styleUrls: [`./notification.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiNotificationComponent {\n @Input()\n @HostBinding(`class._has-icon`)\n @tuiDefaultProp()\n hasIcon = this.options.hasIcon;\n\n @Input()\n @HostBinding(`attr.data-tui-host-status`)\n @tuiDefaultProp()\n status: 'info' | 'error' | 'warning' | 'success' = this.options.status;\n\n @Output()\n readonly close = new EventEmitter<void>();\n\n constructor(\n @Inject(TUI_CLOSE_WORD) readonly closeWord$: Observable<string>,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: TuiNotificationDefaultOptions,\n ) {}\n\n get icon(): string {\n return STATUS_ICON[this.status];\n }\n\n @HostBinding(`class._has-close-button`)\n get hasClose(): boolean {\n return tuiIsObserved(this.close);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiButtonModule} from '@taiga-ui/core/components/button';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\n\nimport {TuiNotificationComponent} from './notification.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, TuiButtonModule],\n declarations: [TuiNotificationComponent],\n exports: [TuiNotificationComponent],\n})\nexport class TuiNotificationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAiBa,WAAW,GAAG;IACvB,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,oBAAoB;IAC7B,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,kBAAkB;EACpB;AAEX;;IAqBI,kCACqC,UAA8B,EAEtD,OAAsC;QAFd,eAAU,GAAV,UAAU,CAAoB;QAEtD,YAAO,GAAP,OAAO,CAA+B;QAbnD,YAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAK/B,WAAM,GAA6C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAG9D,UAAK,GAAG,IAAI,YAAY,EAAQ,CAAC;KAMtC;IAEJ,sBAAI,0CAAI;aAAR;YACI,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACnC;;;OAAA;IAGD,sBAAI,8CAAQ;aAAZ;YACI,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpC;;;OAAA;;gBAZgD,UAAU,uBAAtD,MAAM,SAAC,cAAc;gDACrB,MAAM,SAAC,wBAAwB;;IAZpC;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,iBAAiB,CAAC;QAC9B,cAAc,EAAE;6DACc;IAK/B;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,2BAA2B,CAAC;QACxC,cAAc,EAAE;4DACsD;IAGvE;QADC,MAAM,EAAE;2DACiC;IAa1C;QADC,WAAW,CAAC,yBAAyB,CAAC;4DAGtC;IA3BQ,wBAAwB;QANpC,SAAS,CAAC;YACP,QAAQ,EAAE,kBAAkB;YAC5B,2fAA2C;YAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;;SAClD,CAAC;QAgBO,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;QACtB,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;OAhB5B,wBAAwB,CA4BpC;IAAD,+BAAC;CA5BD;;;ICnBA;KAAqC;IAAxB,qBAAqB;QALjC,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC;YACtD,YAAY,EAAE,CAAC,wBAAwB,CAAC;YACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;OACW,qBAAqB,CAAG;IAAD,4BAAC;CAArC;;ACZA;;;;;;"}
@@ -389,7 +389,7 @@ var TuiPrimitiveTextfieldComponent = /** @class */ (function (_super) {
389
389
  '[class._autofilled]': "autofilled",
390
390
  '[class._label-outside]': "controller.labelOutside",
391
391
  },
392
- styles: [":host{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:block;border-radius:var(--tui-radius-m);text-align:left}:host[data-size='s']{height:var(--tui-height-s);min-height:var(--tui-height-s);max-height:var(--tui-height-s)}:host[data-size='m']{height:var(--tui-height-m);min-height:var(--tui-height-m);max-height:var(--tui-height-m)}:host[data-size='l']{height:var(--tui-height-l);min-height:var(--tui-height-l);max-height:var(--tui-height-l);font:var(--tui-font-text-m);line-height:1.25rem}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0;margin:0;border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:solid transparent;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),.t-input :host-context(tui-text-area._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.t-content .t-placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.t-content .t-placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-content{display:flex;height:100%;width:100%;padding:0 var(--tui-padding-m);box-sizing:border-box;align-items:center;overflow:hidden}:host[data-size='s'] .t-content{padding:0 var(--tui-padding-s)}:host[data-size='l'] .t-content{padding:0 var(--tui-padding-l)}.t-content:after{content:'';margin-right:-.25rem}:host[data-size='m'] .t-content:after{display:none}.t-wrapper{flex:1;min-width:0;padding-right:.25rem;-webkit-padding-end:.25rem;padding-inline-end:.25rem;-webkit-padding-start:0;padding-inline-start:0}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0)}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font:var(--tui-font-text-xs);transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}@supports (-webkit-hyphens:none){.t-placeholder{will-change:unset;transition-property:transform,color,letter-spacing}}.t-cleaner{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-cleaner:hover{color:var(--tui-text-02)}:host._disabled .t-cleaner,:host._readonly .t-cleaner{pointer-events:none}:host[data-mode=onDark] .t-cleaner{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-cleaner:hover{color:var(--tui-text-01-night)}.t-icon{display:flex;align-items:center;justify-content:center;color:var(--tui-text-03)}.t-icon_left{margin:0 .5rem 0 -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}:host[data-size='s'] .t-icon_left{margin-right:.25rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem}:host._autofilled .t-value-decoration:not(.t-has-value){visibility:hidden}:host._autofilled[data-size='m']:not(._focused) .t-placeholder,:host._autofilled[data-size='s']:not(._focused) .t-placeholder{visibility:hidden}.t-custom-content{position:relative;display:flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;margin-right:.25rem;pointer-events:none}.t-custom-icon{width:2rem;height:100%}.t-icon{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);box-sizing:border-box;cursor:pointer;transition-property:color,transform;position:relative;pointer-events:none}.t-icon:hover{color:var(--tui-text-02)}:host._disabled .t-icon,:host._readonly .t-icon{pointer-events:none}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-icon:hover{color:var(--tui-text-01-night)}:host:hover:not(._readonly) .t-icon{color:var(--tui-text-02)}:host[data-mode=onDark]:hover:not(._readonly) .t-icon{color:var(--tui-text-01-night)}:host[data-mode=onLight]:hover:not(._readonly) .t-icon{color:var(--tui-text-01)}.t-input:not(:first-child){display:none}:host[data-size] .t-input_template{display:flex;width:calc(100% - 1rem);max-width:calc(100% - 1rem);align-items:center;pointer-events:none;-webkit-padding-end:0;padding-inline-end:0}.t-input::-webkit-caps-lock-indicator{margin-right:.375rem;align-self:center}:host[data-size='l']:not(._label-outside) .t-input::-webkit-caps-lock-indicator{margin-top:-1.25rem}.t-input::-webkit-contacts-auto-fill-button,.t-input::-webkit-credentials-auto-fill-button,.t-input::-webkit-credit-card-auto-fill-button{background-color:var(--tui-text-03)}:host[data-size='l']:not(._label-outside) .t-input::-webkit-contacts-auto-fill-button,:host[data-size='l']:not(._label-outside) .t-input::-webkit-credentials-auto-fill-button,:host[data-size='l']:not(._label-outside) .t-input::-webkit-credit-card-auto-fill-button{margin-top:-1.25rem}.t-input::-webkit-contacts-auto-fill-button:hover,.t-input::-webkit-credentials-auto-fill-button:hover,.t-input::-webkit-credit-card-auto-fill-button:hover{background-color:var(--tui-text-02)}.t-input:-webkit-autofill,.t-input:-webkit-autofill::first-line{font-size:inherit;line-height:inherit}.t-text-template{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-wrapper-value-decoration{position:relative;pointer-events:none}.t-value-decoration{overflow:hidden}.t-value-decoration.t-has-value{overflow:unset}"]
392
+ styles: [":host{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:block;border-radius:var(--tui-radius-m);text-align:left}:host[data-size='s']{height:var(--tui-height-s);min-height:var(--tui-height-s);max-height:var(--tui-height-s)}:host[data-size='m']{height:var(--tui-height-m);min-height:var(--tui-height-m);max-height:var(--tui-height-m)}:host[data-size='l']{height:var(--tui-height-l);min-height:var(--tui-height-l);max-height:var(--tui-height-l);font:var(--tui-font-text-m);line-height:1.25rem}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0;margin:0;border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:solid transparent;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),.t-input :host-context(tui-text-area._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.t-content .t-placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.t-content .t-placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.t-content .t-placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-content{display:flex;height:100%;width:100%;padding:0 var(--tui-padding-m);box-sizing:border-box;align-items:center;overflow:hidden}:host[data-size='s'] .t-content{padding:0 var(--tui-padding-s)}:host[data-size='l'] .t-content{padding:0 var(--tui-padding-l)}.t-content:after{content:'';margin-right:-.25rem}:host[data-size='m'] .t-content:after{display:none}.t-wrapper{flex:1;min-width:0;padding-right:.25rem;-webkit-padding-end:.25rem;padding-inline-end:.25rem;-webkit-padding-start:0;padding-inline-start:0}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0)}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font:var(--tui-font-text-xs);transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}@supports (-webkit-hyphens:none){.t-placeholder{will-change:unset;transition-property:transform,color,letter-spacing}}.t-cleaner{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-cleaner:hover{color:var(--tui-text-02)}:host._disabled .t-cleaner,:host._readonly .t-cleaner{pointer-events:none}:host[data-mode=onDark] .t-cleaner{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-cleaner:hover{color:var(--tui-text-01-night)}.t-icon{display:flex;align-items:center;justify-content:center;color:var(--tui-text-03)}.t-icon_left{margin:0 .5rem 0 -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}:host[data-size='s'] .t-icon_left{margin-right:.25rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem}:host._autofilled .t-value-decoration:not(.t-has-value){visibility:hidden}:host._autofilled[data-size='m']:not(._focused) .t-placeholder,:host._autofilled[data-size='s']:not(._focused) .t-placeholder{visibility:hidden}.t-custom-content{position:relative;display:flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;margin-right:.25rem;pointer-events:none}.t-custom-icon{width:2rem;height:100%}.t-icon{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);box-sizing:border-box;cursor:pointer;transition-property:color,transform;position:relative;pointer-events:none}.t-icon:hover{color:var(--tui-text-02)}:host._disabled .t-icon,:host._readonly .t-icon{pointer-events:none}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-icon:hover{color:var(--tui-text-01-night)}:host:hover:not(._readonly) .t-icon{color:var(--tui-text-02)}:host[data-mode=onDark]:hover:not(._readonly) .t-icon{color:var(--tui-text-01-night)}:host[data-mode=onLight]:hover:not(._readonly) .t-icon{color:var(--tui-text-01)}.t-input:not(:first-child){display:none}:host[data-size] .t-input_template{display:flex;width:calc(100% - 1rem);max-width:calc(100% - 1rem);align-items:center;pointer-events:none;-webkit-padding-end:0;padding-inline-end:0}.t-input::-webkit-caps-lock-indicator{margin-right:.375rem;align-self:center}:host[data-size='l']:not(._label-outside) .t-input::-webkit-caps-lock-indicator{margin-top:-1.25rem}.t-input::-webkit-contacts-auto-fill-button,.t-input::-webkit-credentials-auto-fill-button,.t-input::-webkit-credit-card-auto-fill-button{background-color:var(--tui-text-03)}:host[data-size='l']:not(._label-outside) .t-input::-webkit-contacts-auto-fill-button,:host[data-size='l']:not(._label-outside) .t-input::-webkit-credentials-auto-fill-button,:host[data-size='l']:not(._label-outside) .t-input::-webkit-credit-card-auto-fill-button{margin-top:-1.25rem}.t-input::-webkit-contacts-auto-fill-button:hover,.t-input::-webkit-credentials-auto-fill-button:hover,.t-input::-webkit-credit-card-auto-fill-button:hover{background-color:var(--tui-text-02)}.t-input:-webkit-autofill,.t-input:-webkit-autofill::first-line{font-size:inherit;line-height:inherit}.t-text-template{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-wrapper-value-decoration{position:relative;pointer-events:none}"]
393
393
  }),
394
394
  __param(0, Inject(TUI_MODE)),
395
395
  __param(1, Inject(TUI_TEXTFIELD_APPEARANCE)),
@@ -620,10 +620,10 @@ var TuiValueDecorationComponent = /** @class */ (function () {
620
620
  TuiValueDecorationComponent = __decorate([
621
621
  Component({
622
622
  selector: "tui-value-decoration",
623
- template: "<span\n #pre\n class=\"t-prefix\"\n [textContent]=\"prefix\"\n></span>\n<span\n class=\"t-ghost\"\n [textContent]=\"value\"\n></span>\n<span\n class=\"t-filler\"\n [textContent]=\"filler\"\n></span>\n<span\n class=\"t-postfix\"\n [textContent]=\"postfix\"\n></span>\n",
623
+ template: "<span\n #pre\n class=\"t-prefix t-inline\"\n [textContent]=\"prefix\"\n></span>\n<span\n class=\"t-ghost t-inline\"\n [textContent]=\"value\"\n></span>\n<span\n class=\"t-filler t-inline\"\n [textContent]=\"filler\"\n></span>\n<span\n class=\"t-postfix t-inline\"\n [textContent]=\"postfix\"\n></span>\n",
624
624
  // It follows Change Detection of PrimitiveTextfield
625
625
  changeDetection: ChangeDetectionStrategy.Default,
626
- styles: [":host{position:absolute;display:block;height:2.5rem;line-height:2.25;width:100%;margin:-1.15rem 0;box-sizing:content-box;color:var(--tui-text-03);-webkit-animation:1s tuiPresent;animation:1s tuiPresent;vertical-align:middle;text-overflow:ellipsis;white-space:nowrap}:host:after{content:'';display:inline-block;vertical-align:middle;height:100%}:host._table{position:static}:host-context(tui-textfield[data-mode=onDark]) :host{color:var(--tui-text-01-night)}.t-ghost{visibility:hidden;white-space:pre;text-overflow:clip}.t-postfix,.t-prefix{color:var(--tui-text-01);white-space:pre}.t-filler{text-overflow:ellipsis;max-width:100%;white-space:nowrap}:host-context(tui-textfield[data-mode=onDark]) .t-filler{color:var(--tui-text-03-night)}"]
626
+ styles: [":host{position:absolute;display:block;height:1.25rem;line-height:1;width:100%;margin:-1.25rem 0;padding:.625rem 0;box-sizing:content-box;color:var(--tui-text-01);-webkit-animation:1s tuiPresent;animation:1s tuiPresent}:host._table{position:static}:host-context(tui-textfield[data-mode=onDark]) :host{color:var(--tui-text-01-night)}:host:after{content:'';display:inline-block;vertical-align:middle;height:100%}.t-ghost{visibility:hidden;white-space:pre;text-overflow:clip}.t-postfix,.t-prefix{white-space:pre}.t-filler{overflow:hidden;color:var(--tui-text-03);text-overflow:ellipsis;max-width:100%;white-space:nowrap}:host-context(tui-textfield[data-mode=onDark]) .t-filler{color:var(--tui-text-03-night)}.t-inline{display:inline-block;vertical-align:middle}"]
627
627
  }),
628
628
  __param(0, Inject(TuiPrimitiveTextfieldComponent)),
629
629
  __param(1, Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER$1))