@taiga-ui/kit 2.35.0 → 2.36.0

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 (111) hide show
  1. package/bundles/taiga-ui-kit-components-combo-box.umd.js +1 -1
  2. package/bundles/taiga-ui-kit-components-combo-box.umd.js.map +1 -1
  3. package/bundles/taiga-ui-kit-components-combo-box.umd.min.js +1 -1
  4. package/bundles/taiga-ui-kit-components-combo-box.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-kit-components-input-range.umd.js +2 -2
  6. package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
  7. package/bundles/taiga-ui-kit-components-input-range.umd.min.js +1 -1
  8. package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-kit-components-input-slider.umd.js +2 -2
  10. package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
  11. package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +1 -1
  12. package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-kit-components-input-tag.umd.js +2 -2
  14. package/bundles/taiga-ui-kit-components-input-tag.umd.js.map +1 -1
  15. package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +2 -2
  16. package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
  17. package/bundles/taiga-ui-kit-components-line-clamp.umd.js +1 -0
  18. package/bundles/taiga-ui-kit-components-line-clamp.umd.js.map +1 -1
  19. package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js +1 -1
  20. package/bundles/taiga-ui-kit-components-line-clamp.umd.min.js.map +1 -1
  21. package/bundles/taiga-ui-kit-components-slider.umd.js +129 -12
  22. package/bundles/taiga-ui-kit-components-slider.umd.js.map +1 -1
  23. package/bundles/taiga-ui-kit-components-slider.umd.min.js +2 -2
  24. package/bundles/taiga-ui-kit-components-slider.umd.min.js.map +1 -1
  25. package/bundles/taiga-ui-kit-components-text-area.umd.js +50 -13
  26. package/bundles/taiga-ui-kit-components-text-area.umd.js.map +1 -1
  27. package/bundles/taiga-ui-kit-components-text-area.umd.min.js +1 -1
  28. package/bundles/taiga-ui-kit-components-text-area.umd.min.js.map +1 -1
  29. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js +22 -5
  30. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.js.map +1 -1
  31. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js +1 -1
  32. package/bundles/taiga-ui-kit-directives-dropdown-selection.umd.min.js.map +1 -1
  33. package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
  34. package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
  35. package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
  36. package/components/slider/index.d.ts +2 -0
  37. package/components/slider/slider-key-steps.directive.d.ts +17 -0
  38. package/components/slider/slider-options.d.ts +9 -0
  39. package/components/slider/slider.component.d.ts +6 -3
  40. package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
  41. package/components/text-area/index.d.ts +1 -0
  42. package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
  43. package/components/text-area/text-area.component.d.ts +2 -1
  44. package/components/text-area/text-area.directive.d.ts +5 -0
  45. package/directives/dropdown-selection/dropdown-selection.directive.d.ts +2 -2
  46. package/directives/dropdown-selection/taiga-ui-kit-directives-dropdown-selection.metadata.json +1 -1
  47. package/esm2015/components/combo-box/combo-box.component.js +2 -2
  48. package/esm2015/components/input-range/input-range.component.js +3 -3
  49. package/esm2015/components/input-slider/input-slider.component.js +3 -3
  50. package/esm2015/components/input-tag/input-tag.component.js +3 -3
  51. package/esm2015/components/line-clamp/line-clamp.directive.js +2 -1
  52. package/esm2015/components/slider/index.js +3 -1
  53. package/esm2015/components/slider/slider-key-steps.directive.js +81 -0
  54. package/esm2015/components/slider/slider-options.js +11 -0
  55. package/esm2015/components/slider/slider.component.js +19 -11
  56. package/esm2015/components/slider/slider.module.js +4 -3
  57. package/esm2015/components/text-area/index.js +2 -1
  58. package/esm2015/components/text-area/text-area.component.js +21 -13
  59. package/esm2015/components/text-area/text-area.directive.js +22 -0
  60. package/esm2015/components/text-area/text-area.module.js +7 -6
  61. package/esm2015/components/text-area/text-area.providers.js +6 -2
  62. package/esm2015/directives/dropdown-selection/dropdown-selection.directive.js +23 -6
  63. package/esm5/components/combo-box/combo-box.component.js +2 -2
  64. package/esm5/components/input-range/input-range.component.js +3 -3
  65. package/esm5/components/input-slider/input-slider.component.js +3 -3
  66. package/esm5/components/input-tag/input-tag.component.js +3 -3
  67. package/esm5/components/line-clamp/line-clamp.directive.js +2 -1
  68. package/esm5/components/slider/index.js +3 -1
  69. package/esm5/components/slider/slider-key-steps.directive.js +102 -0
  70. package/esm5/components/slider/slider-options.js +12 -0
  71. package/esm5/components/slider/slider.component.js +19 -11
  72. package/esm5/components/slider/slider.module.js +4 -3
  73. package/esm5/components/text-area/index.js +2 -1
  74. package/esm5/components/text-area/text-area.component.js +21 -13
  75. package/esm5/components/text-area/text-area.directive.js +28 -0
  76. package/esm5/components/text-area/text-area.module.js +7 -6
  77. package/esm5/components/text-area/text-area.providers.js +6 -2
  78. package/esm5/directives/dropdown-selection/dropdown-selection.directive.js +23 -6
  79. package/fesm2015/taiga-ui-kit-components-combo-box.js +1 -1
  80. package/fesm2015/taiga-ui-kit-components-combo-box.js.map +1 -1
  81. package/fesm2015/taiga-ui-kit-components-input-range.js +2 -2
  82. package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
  83. package/fesm2015/taiga-ui-kit-components-input-slider.js +2 -2
  84. package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
  85. package/fesm2015/taiga-ui-kit-components-input-tag.js +2 -2
  86. package/fesm2015/taiga-ui-kit-components-input-tag.js.map +1 -1
  87. package/fesm2015/taiga-ui-kit-components-line-clamp.js +1 -0
  88. package/fesm2015/taiga-ui-kit-components-line-clamp.js.map +1 -1
  89. package/fesm2015/taiga-ui-kit-components-slider.js +107 -15
  90. package/fesm2015/taiga-ui-kit-components-slider.js.map +1 -1
  91. package/fesm2015/taiga-ui-kit-components-text-area.js +47 -17
  92. package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
  93. package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js +22 -5
  94. package/fesm2015/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
  95. package/fesm5/taiga-ui-kit-components-combo-box.js +1 -1
  96. package/fesm5/taiga-ui-kit-components-combo-box.js.map +1 -1
  97. package/fesm5/taiga-ui-kit-components-input-range.js +2 -2
  98. package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
  99. package/fesm5/taiga-ui-kit-components-input-slider.js +2 -2
  100. package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
  101. package/fesm5/taiga-ui-kit-components-input-tag.js +2 -2
  102. package/fesm5/taiga-ui-kit-components-input-tag.js.map +1 -1
  103. package/fesm5/taiga-ui-kit-components-line-clamp.js +1 -0
  104. package/fesm5/taiga-ui-kit-components-line-clamp.js.map +1 -1
  105. package/fesm5/taiga-ui-kit-components-slider.js +129 -16
  106. package/fesm5/taiga-ui-kit-components-slider.js.map +1 -1
  107. package/fesm5/taiga-ui-kit-components-text-area.js +53 -17
  108. package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
  109. package/fesm5/taiga-ui-kit-directives-dropdown-selection.js +22 -5
  110. package/fesm5/taiga-ui-kit-directives-dropdown-selection.js.map +1 -1
  111. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-line-clamp.js","sources":["ng://@taiga-ui/kit/components/line-clamp/line-clamp.component.ts","ng://@taiga-ui/kit/components/line-clamp/line-clamp.directive.ts","ng://@taiga-ui/kit/components/line-clamp/line-clamp.module.ts","ng://@taiga-ui/kit/components/line-clamp/taiga-ui-kit-components-line-clamp.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n Input,\n NgZone,\n Renderer2,\n ViewChild,\n} from '@angular/core';\nimport {isCurrentTarget, tuiDefaultProp, tuiPure, typedFromEvent} from '@taiga-ui/cdk';\nimport {PolymorpheusContent, PolymorpheusOutletComponent} from '@tinkoff/ng-polymorpheus';\nimport {BehaviorSubject, Observable, of} from 'rxjs';\nimport {filter, mapTo, pairwise, startWith, switchMap} from 'rxjs/operators';\n\n@Component({\n selector: 'tui-line-clamp',\n templateUrl: './line-clamp.template.html',\n styleUrls: ['./line-clamp.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiLineClampComponent implements AfterViewInit {\n @ViewChild(PolymorpheusOutletComponent, {read: ElementRef})\n private readonly outlet?: ElementRef<HTMLElement>;\n\n private readonly linesLimit$ = new BehaviorSubject(1);\n private initialized = false;\n\n @Input()\n @tuiDefaultProp()\n set linesLimit(linesLimit: number) {\n this.linesLimit$.next(linesLimit);\n }\n\n @Input()\n @tuiDefaultProp()\n lineHeight = 24;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(ChangeDetectorRef) private readonly cd: ChangeDetectorRef,\n @Inject(NgZone) private readonly ngZone: NgZone,\n ) {\n this.skipInitialTransition();\n }\n\n @tuiPure\n get lineClamp$(): Observable<number> {\n return this.linesLimit$.pipe(\n startWith(1),\n pairwise(),\n switchMap(([prev, next]) =>\n next >= prev\n ? of(next)\n : typedFromEvent(this.elementRef.nativeElement, 'transitionend').pipe(\n filter(isCurrentTarget),\n mapTo(next),\n ),\n ),\n );\n }\n\n get overflown(): boolean {\n if (!this.outlet) {\n return false;\n }\n\n const {scrollHeight, scrollWidth} = this.outlet.nativeElement;\n const {clientHeight, clientWidth} = this.elementRef.nativeElement;\n\n // 4px buffer for IE/Edge incorrectly rounding scrollHeight\n return scrollHeight - clientHeight > 4 || scrollWidth - clientWidth > 0;\n }\n\n get computedContent(): PolymorpheusContent {\n return this.overflown ? this.content : '';\n }\n\n get oneLine(): boolean {\n return this.linesLimit$.value === 1;\n }\n\n @HostBinding('style.maxHeight.px')\n get maxHeight(): number | null {\n return this.initialized ? this.lineHeight * this.linesLimit$.value : null;\n }\n\n @HostBinding('style.height.px')\n get height(): number | null {\n return !this.outlet ? 0 : this.outlet.nativeElement.scrollHeight + 4 || null;\n }\n\n updateView() {\n this.cd.detectChanges();\n }\n\n ngAfterViewInit() {\n this.initialized = true;\n }\n\n private skipInitialTransition() {\n this.ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n this.renderer.addClass(this.elementRef.nativeElement, '_initialized');\n this.cd.detectChanges();\n });\n });\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {ANIMATION_FRAME, CSS} from '@ng-web-apis/common';\nimport {CHAR_ELLIPSIS, TuiDestroyService, tuiZonefree} from '@taiga-ui/cdk';\nimport {setRangeOffset} from '@taiga-ui/kit/utils/dom';\nimport {Observable} from 'rxjs';\nimport {map, takeUntil} from 'rxjs/operators';\n\nimport {TuiLineClampComponent} from './line-clamp.component';\n\nconst HIDDEN_LEFT = -200;\n\n// @dynamic\n@Directive({\n selector: '[lineClamp]',\n providers: [TuiDestroyService],\n})\nexport class TuiLineClampDirective {\n constructor(\n @Inject(TuiLineClampComponent) component: TuiLineClampComponent,\n @Inject(ViewContainerRef) viewContainerRef: ViewContainerRef,\n @Inject(DOCUMENT) documentRef: Document,\n @Inject(Renderer2) renderer: Renderer2,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) destroy$: TuiDestroyService,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n /**\n * TODO: remove \"any\" in new TS version; https://github.com/ng-web-apis/common/pull/6\n */\n @Inject(CSS) cssRef: any,\n ) {\n if (\n cssRef.supports('-webkit-line-clamp', '1') ||\n !(nativeElement.parentElement instanceof HTMLElement)\n ) {\n return;\n }\n\n const range = documentRef.createRange();\n const ellipsis: HTMLElement = renderer.createElement('div');\n const {parentElement} = nativeElement;\n const {style} = ellipsis;\n\n style.position = 'absolute';\n style.bottom = '0';\n style.left = `${HIDDEN_LEFT}px`;\n ellipsis.textContent = CHAR_ELLIPSIS;\n\n viewContainerRef.element.nativeElement.appendChild(ellipsis);\n\n animationFrame$\n .pipe(\n map(() => {\n // 4px buffer for IE/Edge incorrectly rounding scrollHeight\n if (\n component.oneLine ||\n nativeElement.scrollHeight - parentElement.clientHeight < 4\n ) {\n return HIDDEN_LEFT;\n }\n\n let result = 0;\n const length = nativeElement.textContent\n ? nativeElement.textContent.length\n : 0;\n\n for (let char = 0; char < length - 2; char++) {\n setRangeOffset(range, nativeElement, char, 'setStart');\n setRangeOffset(range, nativeElement, char + 1, 'setEnd');\n\n const rangeRect = range.getBoundingClientRect();\n const clientRect = parentElement.getBoundingClientRect();\n\n if (Math.round(rangeRect.top - clientRect.bottom) >= 0) {\n break;\n }\n\n result = rangeRect.right - clientRect.left;\n }\n\n return result;\n }),\n tuiZonefree(ngZone),\n takeUntil(destroy$),\n )\n .subscribe(left => {\n style.left = `${left}px`;\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiResizeModule} from '@taiga-ui/cdk';\nimport {TuiHintModule} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiLineClampComponent} from './line-clamp.component';\nimport {TuiLineClampDirective} from './line-clamp.directive';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiHintModule, TuiResizeModule],\n declarations: [TuiLineClampComponent, TuiLineClampDirective],\n exports: [TuiLineClampComponent],\n})\nexport class TuiLineClampModule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+ {"version":3,"file":"taiga-ui-kit-components-line-clamp.js","sources":["ng://@taiga-ui/kit/components/line-clamp/line-clamp.component.ts","ng://@taiga-ui/kit/components/line-clamp/line-clamp.directive.ts","ng://@taiga-ui/kit/components/line-clamp/line-clamp.module.ts","ng://@taiga-ui/kit/components/line-clamp/taiga-ui-kit-components-line-clamp.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n Input,\n NgZone,\n Renderer2,\n ViewChild,\n} from '@angular/core';\nimport {isCurrentTarget, tuiDefaultProp, tuiPure, typedFromEvent} from '@taiga-ui/cdk';\nimport {PolymorpheusContent, PolymorpheusOutletComponent} from '@tinkoff/ng-polymorpheus';\nimport {BehaviorSubject, Observable, of} from 'rxjs';\nimport {filter, mapTo, pairwise, startWith, switchMap} from 'rxjs/operators';\n\n@Component({\n selector: 'tui-line-clamp',\n templateUrl: './line-clamp.template.html',\n styleUrls: ['./line-clamp.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiLineClampComponent implements AfterViewInit {\n @ViewChild(PolymorpheusOutletComponent, {read: ElementRef})\n private readonly outlet?: ElementRef<HTMLElement>;\n\n private readonly linesLimit$ = new BehaviorSubject(1);\n private initialized = false;\n\n @Input()\n @tuiDefaultProp()\n set linesLimit(linesLimit: number) {\n this.linesLimit$.next(linesLimit);\n }\n\n @Input()\n @tuiDefaultProp()\n lineHeight = 24;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(ChangeDetectorRef) private readonly cd: ChangeDetectorRef,\n @Inject(NgZone) private readonly ngZone: NgZone,\n ) {\n this.skipInitialTransition();\n }\n\n @tuiPure\n get lineClamp$(): Observable<number> {\n return this.linesLimit$.pipe(\n startWith(1),\n pairwise(),\n switchMap(([prev, next]) =>\n next >= prev\n ? of(next)\n : typedFromEvent(this.elementRef.nativeElement, 'transitionend').pipe(\n filter(isCurrentTarget),\n mapTo(next),\n ),\n ),\n );\n }\n\n get overflown(): boolean {\n if (!this.outlet) {\n return false;\n }\n\n const {scrollHeight, scrollWidth} = this.outlet.nativeElement;\n const {clientHeight, clientWidth} = this.elementRef.nativeElement;\n\n // 4px buffer for IE/Edge incorrectly rounding scrollHeight\n return scrollHeight - clientHeight > 4 || scrollWidth - clientWidth > 0;\n }\n\n get computedContent(): PolymorpheusContent {\n return this.overflown ? this.content : '';\n }\n\n get oneLine(): boolean {\n return this.linesLimit$.value === 1;\n }\n\n @HostBinding('style.maxHeight.px')\n get maxHeight(): number | null {\n return this.initialized ? this.lineHeight * this.linesLimit$.value : null;\n }\n\n @HostBinding('style.height.px')\n get height(): number | null {\n return !this.outlet ? 0 : this.outlet.nativeElement.scrollHeight + 4 || null;\n }\n\n updateView() {\n this.cd.detectChanges();\n }\n\n ngAfterViewInit() {\n this.initialized = true;\n }\n\n private skipInitialTransition() {\n this.ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n this.renderer.addClass(this.elementRef.nativeElement, '_initialized');\n this.cd.detectChanges();\n });\n });\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {ANIMATION_FRAME, CSS} from '@ng-web-apis/common';\nimport {CHAR_ELLIPSIS, TuiDestroyService, tuiZonefree} from '@taiga-ui/cdk';\nimport {setRangeOffset} from '@taiga-ui/kit/utils/dom';\nimport {Observable} from 'rxjs';\nimport {map, takeUntil} from 'rxjs/operators';\n\nimport {TuiLineClampComponent} from './line-clamp.component';\n\nconst HIDDEN_LEFT = -200;\n\n// @dynamic\n@Directive({\n selector: '[lineClamp]',\n providers: [TuiDestroyService],\n})\nexport class TuiLineClampDirective {\n constructor(\n @Inject(TuiLineClampComponent) component: TuiLineClampComponent,\n @Inject(ViewContainerRef) viewContainerRef: ViewContainerRef,\n @Inject(DOCUMENT) documentRef: Document,\n @Inject(Renderer2) renderer: Renderer2,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) destroy$: TuiDestroyService,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n /**\n * TODO: remove \"any\" in new TS version; https://github.com/ng-web-apis/common/pull/6\n */\n @Inject(CSS) cssRef: any,\n ) {\n if (\n cssRef.supports('-webkit-line-clamp', '1') ||\n !documentRef.createRange ||\n !(nativeElement.parentElement instanceof HTMLElement)\n ) {\n return;\n }\n\n const range = documentRef.createRange();\n const ellipsis: HTMLElement = renderer.createElement('div');\n const {parentElement} = nativeElement;\n const {style} = ellipsis;\n\n style.position = 'absolute';\n style.bottom = '0';\n style.left = `${HIDDEN_LEFT}px`;\n ellipsis.textContent = CHAR_ELLIPSIS;\n\n viewContainerRef.element.nativeElement.appendChild(ellipsis);\n\n animationFrame$\n .pipe(\n map(() => {\n // 4px buffer for IE/Edge incorrectly rounding scrollHeight\n if (\n component.oneLine ||\n nativeElement.scrollHeight - parentElement.clientHeight < 4\n ) {\n return HIDDEN_LEFT;\n }\n\n let result = 0;\n const length = nativeElement.textContent\n ? nativeElement.textContent.length\n : 0;\n\n for (let char = 0; char < length - 2; char++) {\n setRangeOffset(range, nativeElement, char, 'setStart');\n setRangeOffset(range, nativeElement, char + 1, 'setEnd');\n\n const rangeRect = range.getBoundingClientRect();\n const clientRect = parentElement.getBoundingClientRect();\n\n if (Math.round(rangeRect.top - clientRect.bottom) >= 0) {\n break;\n }\n\n result = rangeRect.right - clientRect.left;\n }\n\n return result;\n }),\n tuiZonefree(ngZone),\n takeUntil(destroy$),\n )\n .subscribe(left => {\n style.left = `${left}px`;\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiResizeModule} from '@taiga-ui/cdk';\nimport {TuiHintModule} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiLineClampComponent} from './line-clamp.component';\nimport {TuiLineClampDirective} from './line-clamp.directive';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiHintModule, TuiResizeModule],\n declarations: [TuiLineClampComponent, TuiLineClampDirective],\n exports: [TuiLineClampComponent],\n})\nexport class TuiLineClampModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;IA6CI,+BACyC,UAAmC,EACpC,QAAmB,EACX,EAAqB,EAChC,MAAc;QAHV,eAAU,GAAV,UAAU,CAAyB;QACpC,aAAQ,GAAR,QAAQ,CAAW;QACX,OAAE,GAAF,EAAE,CAAmB;QAChC,WAAM,GAAN,MAAM,CAAQ;QArBlC,gBAAW,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC9C,gBAAW,GAAG,KAAK,CAAC;QAU5B,eAAU,GAAG,EAAE,CAAC;QAIhB,YAAO,GAAwB,EAAE,CAAC;QAQ9B,IAAI,CAAC,qBAAqB,EAAE,CAAC;KAChC;IAnBD,sBAAI,6CAAU;aAAd,UAAe,UAAkB;YAC7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACrC;;;OAAA;IAoBD,sBAAI,6CAAU;aAAd;YADA,iBAcC;YAZG,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CACxB,SAAS,CAAC,CAAC,CAAC,EACZ,QAAQ,EAAE,EACV,SAAS,CAAC,UAAC,EAAY;oBAAZ,kBAAY,EAAX,YAAI,EAAE,YAAI;gBAClB,OAAA,IAAI,IAAI,IAAI;sBACN,EAAE,CAAC,IAAI,CAAC;sBACR,cAAc,CAAC,KAAI,CAAC,UAAU,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC,IAAI,CAC/D,MAAM,CAAC,eAAe,CAAC,EACvB,KAAK,CAA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AC;CA1ED;;;ICVA;KAAkC;IAArB,kBAAkB;QAL9B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,CAAC;YAC3E,YAAY,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;YAC5D,OAAO,EAAE,CAAC,qBAAqB,CAAC;SACnC,CAAC;OACW,kBAAkB,CAAG;IAAD,yBAAC;CAAlC;;ACdA;;;;;;"}
@@ -1,8 +1,8 @@
1
- import { __decorate, __param, __extends } from 'tslib';
2
- import { Optional, Self, Inject, ChangeDetectorRef, ElementRef, Input, HostBinding, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
1
+ import { __assign, __decorate, __param, __extends, __read } from 'tslib';
2
+ import { InjectionToken, Optional, Self, Inject, ChangeDetectorRef, ElementRef, Input, HostBinding, Component, ChangeDetectionStrategy, HostListener, Directive, forwardRef, NgModule } from '@angular/core';
3
3
  import { NgModel, NgControl } from '@angular/forms';
4
4
  import { USER_AGENT } from '@ng-web-apis/common';
5
- import { watch, isEdgeOlderThan, CHROMIUM_EDGE_START_VERSION, tuiDefaultProp, isNativeFocused, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiRepeatTimesModule, TuiFocusableModule, TuiFocusVisibleModule, TuiActiveZoneModule } from '@taiga-ui/cdk';
5
+ import { watch, isEdgeOlderThan, CHROMIUM_EDGE_START_VERSION, tuiDefaultProp, isNativeFocused, AbstractTuiControl, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiRepeatTimesModule, TuiFocusableModule, TuiFocusVisibleModule, TuiActiveZoneModule } from '@taiga-ui/cdk';
6
6
  import { take } from 'rxjs/operators';
7
7
  import { DOCUMENT, CommonModule } from '@angular/common';
8
8
  import { TuiFormatNumberPipeModule } from '@taiga-ui/core';
@@ -10,12 +10,23 @@ import { AbstractTuiSlider } from '@taiga-ui/kit/abstract';
10
10
  import { TUI_FROM_TO_TEXTS } from '@taiga-ui/kit/tokens';
11
11
  import { Observable } from 'rxjs';
12
12
 
13
+ var TUI_SLIDER_DEFAULT_OPTIONS = {
14
+ size: 'm',
15
+ trackColor: 'var(--tui-base-03)',
16
+ };
17
+ var TUI_SLIDER_OPTIONS = new InjectionToken('Default parameters for Slider component', { factory: function () { return TUI_SLIDER_DEFAULT_OPTIONS; } });
18
+ var tuiSliderOptionsProvider = function (options) { return ({
19
+ provide: TUI_SLIDER_OPTIONS,
20
+ useValue: __assign(__assign({}, TUI_SLIDER_DEFAULT_OPTIONS), options),
21
+ }); };
22
+
13
23
  var TuiSliderComponent = /** @class */ (function () {
14
- function TuiSliderComponent(control, changeDetectorRef, elementRef, userAgent) {
24
+ function TuiSliderComponent(control, changeDetectorRef, options, elementRef, userAgent) {
15
25
  var _a;
26
+ this.options = options;
16
27
  this.elementRef = elementRef;
17
28
  this.userAgent = userAgent;
18
- this.size = 'm';
29
+ this.size = this.options.size;
19
30
  this.segments = 1;
20
31
  if (control instanceof NgModel) {
21
32
  /**
@@ -53,19 +64,22 @@ var TuiSliderComponent = /** @class */ (function () {
53
64
  get: function () {
54
65
  return Number(this.elementRef.nativeElement.value) || 0;
55
66
  },
67
+ set: function (newValue) {
68
+ this.elementRef.nativeElement.value = "" + newValue;
69
+ },
56
70
  enumerable: true,
57
71
  configurable: true
58
72
  });
59
- Object.defineProperty(TuiSliderComponent.prototype, "fillPercentage", {
73
+ Object.defineProperty(TuiSliderComponent.prototype, "valuePercentage", {
60
74
  get: function () {
61
75
  return (100 * this.value) / (this.max - this.min);
62
76
  },
63
77
  enumerable: true,
64
78
  configurable: true
65
79
  });
66
- Object.defineProperty(TuiSliderComponent.prototype, "stepPercentage", {
80
+ Object.defineProperty(TuiSliderComponent.prototype, "segmentWidth", {
67
81
  get: function () {
68
- return 100 / this.segments - 0.1;
82
+ return 100 / Math.max(1, this.segments);
69
83
  },
70
84
  enumerable: true,
71
85
  configurable: true
@@ -80,6 +94,7 @@ var TuiSliderComponent = /** @class */ (function () {
80
94
  TuiSliderComponent.ctorParameters = function () { return [
81
95
  { type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
82
96
  { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
97
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_SLIDER_OPTIONS,] }] },
83
98
  { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
84
99
  { type: String, decorators: [{ type: Inject, args: [USER_AGENT,] }] }
85
100
  ]; };
@@ -94,10 +109,10 @@ var TuiSliderComponent = /** @class */ (function () {
94
109
  ], TuiSliderComponent.prototype, "segments", void 0);
95
110
  __decorate([
96
111
  HostBinding('style.--tui-slider-fill-percentage.%')
97
- ], TuiSliderComponent.prototype, "fillPercentage", null);
112
+ ], TuiSliderComponent.prototype, "valuePercentage", null);
98
113
  __decorate([
99
114
  HostBinding('style.--tui-slider-segment-width.%')
100
- ], TuiSliderComponent.prototype, "stepPercentage", null);
115
+ ], TuiSliderComponent.prototype, "segmentWidth", null);
101
116
  __decorate([
102
117
  HostBinding('class._old-edge')
103
118
  ], TuiSliderComponent.prototype, "isOldEdge", null);
@@ -119,20 +134,118 @@ var TuiSliderComponent = /** @class */ (function () {
119
134
  * This function triggers change detection (for `fillPercentage` function) when we drag thumb of the input.
120
135
  */
121
136
  '(input)': '0',
137
+ '[style.--tui-slider-track-color]': 'options.trackColor',
122
138
  },
123
139
  changeDetection: ChangeDetectionStrategy.OnPush,
124
- styles: [":host{display:block;width:100%;color:var(--tui-primary);cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:auto}:host:not(._old-edge){-webkit-appearance:none;-moz-appearance:none;appearance:none;height:.125rem;padding:.4375rem 0;background:var(--tui-base-03);background-clip:content-box;outline:0}:host:not(._old-edge)::-webkit-slider-runnable-track{height:.125rem;border-radius:var(--tui-radius-m);background:linear-gradient(to right,currentColor 0 .25rem,transparent .25rem),linear-gradient(to left,var(--tui-base-03) 0 .25rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent .25rem var(--tui-slider-segment-width)),linear-gradient(to right,currentColor var(--tui-slider-fill-percentage),transparent var(--tui-slider-fill-percentage))}:host:not(._old-edge)::-moz-range-track{height:.125rem;border-radius:var(--tui-radius-m);background:linear-gradient(to right,currentColor 0 .25rem,transparent .25rem),linear-gradient(to left,var(--tui-base-03) 0 .25rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent .25rem var(--tui-slider-segment-width))}:host:not(._old-edge)[data-size='m']::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:1rem;width:1rem;margin-top:-.4375rem}:not(:disabled):host:not(._old-edge)[data-size='m']::-webkit-slider-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='m']::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size='s']::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:.5rem;width:.5rem;margin-top:-.1875rem}:not(:disabled):host:not(._old-edge)[data-size='s']::-webkit-slider-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='s']::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size='m']::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:1rem;width:1rem}:not(:disabled):host:not(._old-edge)[data-size='m']::-moz-range-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='m']::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size='s']::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:.5rem;width:.5rem}:not(:disabled):host:not(._old-edge)[data-size='s']::-moz-range-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='s']::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)::-moz-range-progress{background:currentColor}:host._old-edge::-ms-thumb{background:currentColor}:host._old-edge::-ms-fill-lower{background:currentColor}:host._old-edge::-ms-track{background:var(--tui-base-03)}"]
140
+ styles: [":host{display:block;width:100%;color:var(--tui-primary);cursor:pointer}:host:disabled{opacity:var(--tui-disabled-opacity);cursor:auto}:host:not(._old-edge){-webkit-appearance:none;-moz-appearance:none;appearance:none;height:.125rem;padding:.4375rem 0;background:var(--tui-slider-track-color);background-clip:content-box;outline:0;border-radius:var(--tui-radius-m)}:host:not(._old-edge)::-webkit-slider-container{border-radius:inherit}:host:not(._old-edge)[data-size='m']::-webkit-slider-runnable-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-image:linear-gradient(to right,currentColor 0 .625rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width)),linear-gradient(to right,currentColor var(--tui-slider-fill-percentage),transparent var(--tui-slider-fill-percentage));background-position-x:0,.375rem,0;background-size:calc(100% - 1rem),calc(100% - 1rem),auto}:host:not(._old-edge)[data-size='s']::-webkit-slider-runnable-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-image:linear-gradient(to right,currentColor 0 .375rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width)),linear-gradient(to right,currentColor var(--tui-slider-fill-percentage),transparent var(--tui-slider-fill-percentage));background-position-x:0,.125rem,0;background-size:calc(100% - .5rem),calc(100% - .5rem),auto}:host:not(._old-edge)[data-size='m']::-moz-range-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-image:linear-gradient(to right,currentColor 0 .625rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width));background-position-x:0,.375rem;background-size:calc(100% - 1rem)}:host:not(._old-edge)[data-size='s']::-moz-range-track{height:.125rem;border-radius:inherit;background-repeat:no-repeat;background-image:linear-gradient(to right,currentColor 0 .375rem,transparent .25rem),repeating-linear-gradient(to right,var(--tui-base-07) 0 .25rem,transparent 0 var(--tui-slider-segment-width));background-position-x:0,.125rem;background-size:calc(100% - .5rem)}:host:not(._old-edge)[data-size='m']::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:1rem;width:1rem;margin-top:-.4375rem}:not(:disabled):host:not(._old-edge)[data-size='m']::-webkit-slider-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='m']::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size='s']::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:.5rem;width:.5rem;margin-top:-.1875rem}:not(:disabled):host:not(._old-edge)[data-size='s']::-webkit-slider-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='s']::-webkit-slider-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size='m']::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:1rem;width:1rem}:not(:disabled):host:not(._old-edge)[data-size='m']::-moz-range-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='m']::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)[data-size='s']::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border:none;border-radius:50%;height:.5rem;width:.5rem}:not(:disabled):host:not(._old-edge)[data-size='s']::-moz-range-thumb{cursor:ew-resize}:focus-visible:host:not(._old-edge)[data-size='s']::-moz-range-thumb{box-shadow:0 0 0 2px inset var(--tui-focus)}:host:not(._old-edge)::-moz-range-progress{background:currentColor;border-radius:inherit;border-top-right-radius:0;border-bottom-right-radius:0}:host._old-edge::-ms-thumb{background:currentColor}:host._old-edge::-ms-fill-lower{background:currentColor}:host._old-edge::-ms-track{background:var(--tui-slider-track-color)}"]
125
141
  }),
126
142
  __param(0, Optional()),
127
143
  __param(0, Self()),
128
144
  __param(0, Inject(NgControl)),
129
145
  __param(1, Inject(ChangeDetectorRef)),
130
- __param(2, Inject(ElementRef)),
131
- __param(3, Inject(USER_AGENT))
146
+ __param(2, Inject(TUI_SLIDER_OPTIONS)),
147
+ __param(3, Inject(ElementRef)),
148
+ __param(4, Inject(USER_AGENT))
132
149
  ], TuiSliderComponent);
133
150
  return TuiSliderComponent;
134
151
  }());
135
152
 
153
+ // @dynamic
154
+ var TuiSliderKeyStepsDirective = /** @class */ (function (_super) {
155
+ __extends(TuiSliderKeyStepsDirective, _super);
156
+ function TuiSliderKeyStepsDirective(control, changeDetectorRef, elementRef, slider) {
157
+ var _this = _super.call(this, control, changeDetectorRef) || this;
158
+ _this.elementRef = elementRef;
159
+ _this.slider = slider;
160
+ _this.keySteps = [];
161
+ return _this;
162
+ }
163
+ Object.defineProperty(TuiSliderKeyStepsDirective.prototype, "nativeFocusableElement", {
164
+ get: function () {
165
+ return this.computedDisabled ? null : this.elementRef.nativeElement;
166
+ },
167
+ enumerable: true,
168
+ configurable: true
169
+ });
170
+ Object.defineProperty(TuiSliderKeyStepsDirective.prototype, "focused", {
171
+ get: function () {
172
+ return isNativeFocused(this.nativeFocusableElement);
173
+ },
174
+ enumerable: true,
175
+ configurable: true
176
+ });
177
+ TuiSliderKeyStepsDirective.prototype.onInput = function () {
178
+ var valuePercentage = this.slider.valuePercentage;
179
+ var _a = __read(findKeyStepsBoundariesByFn(this.keySteps, function (_a) {
180
+ var _b = __read(_a, 2), keyStepPercentage = _b[0], _ = _b[1];
181
+ return valuePercentage <= keyStepPercentage;
182
+ }), 2), lowerStep = _a[0], upperStep = _a[1];
183
+ var newControlValue = transformToControlValue(valuePercentage, lowerStep, upperStep);
184
+ this.updateValue(newControlValue);
185
+ };
186
+ TuiSliderKeyStepsDirective.prototype.writeValue = function (controlValue) {
187
+ if (controlValue === null) {
188
+ return;
189
+ }
190
+ var _a = __read(findKeyStepsBoundariesByFn(this.keySteps, function (_a) {
191
+ var _b = __read(_a, 2), _ = _b[0], keyStepValue = _b[1];
192
+ return controlValue <= keyStepValue;
193
+ }), 2), lowerStep = _a[0], upperStep = _a[1];
194
+ this.slider.value = this.transformToNativeValue(controlValue, lowerStep, upperStep);
195
+ };
196
+ TuiSliderKeyStepsDirective.prototype.getFallbackValue = function () {
197
+ return 0;
198
+ };
199
+ TuiSliderKeyStepsDirective.prototype.transformToNativeValue = function (controlValue, _a, _b) {
200
+ var _c = __read(_a, 2), upperStepPercent = _c[0], upperStepValue = _c[1];
201
+ var _d = __read(_b, 2), lowerStepPercent = _d[0], lowerStepValue = _d[1];
202
+ var _e = this.slider, min = _e.min, max = _e.max;
203
+ var ratio = (controlValue - lowerStepValue) / (upperStepValue - lowerStepValue);
204
+ var newValuePercentage = (upperStepPercent - lowerStepPercent) * ratio + lowerStepPercent;
205
+ return (newValuePercentage * (max - min)) / 100;
206
+ };
207
+ TuiSliderKeyStepsDirective.ctorParameters = function () { return [
208
+ { type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
209
+ { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
210
+ { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
211
+ { type: TuiSliderComponent, decorators: [{ type: Inject, args: [TuiSliderComponent,] }] }
212
+ ]; };
213
+ __decorate([
214
+ Input(),
215
+ tuiDefaultProp(checkHasMinMaxPercents, 'Should contain min and max values')
216
+ ], TuiSliderKeyStepsDirective.prototype, "keySteps", void 0);
217
+ __decorate([
218
+ HostListener('change')
219
+ ], TuiSliderKeyStepsDirective.prototype, "onInput", null);
220
+ TuiSliderKeyStepsDirective = __decorate([
221
+ Directive({
222
+ selector: 'input[tuiSlider][keySteps]',
223
+ }),
224
+ __param(0, Optional()),
225
+ __param(0, Self()),
226
+ __param(0, Inject(NgControl)),
227
+ __param(1, Inject(ChangeDetectorRef)),
228
+ __param(2, Inject(ElementRef)),
229
+ __param(3, Inject(TuiSliderComponent))
230
+ ], TuiSliderKeyStepsDirective);
231
+ return TuiSliderKeyStepsDirective;
232
+ }(AbstractTuiControl));
233
+ function checkHasMinMaxPercents(steps) {
234
+ return !steps.length || (steps[0][0] === 0 && steps[steps.length - 1][0] === 100);
235
+ }
236
+ function findKeyStepsBoundariesByFn(keySteps, fn) {
237
+ var keyStepUpperIndex = keySteps.findIndex(function (ketStep, i) { return i && fn(ketStep); });
238
+ var lowerStep = keySteps[keyStepUpperIndex - 1];
239
+ var upperStep = keySteps[keyStepUpperIndex];
240
+ return [lowerStep, upperStep];
241
+ }
242
+ function transformToControlValue(valuePercentage, _a, _b) {
243
+ var _c = __read(_a, 2), upperStepPercent = _c[0], upperStepValue = _c[1];
244
+ var _d = __read(_b, 2), lowerStepPercent = _d[0], lowerStepValue = _d[1];
245
+ var ratio = (valuePercentage - lowerStepPercent) / (upperStepPercent - lowerStepPercent);
246
+ return (upperStepValue - lowerStepValue) * ratio + lowerStepValue;
247
+ }
248
+
136
249
  /**
137
250
  * @deprecated use {@link TuiSliderComponent} instead
138
251
  * TODO remove in 3.0
@@ -227,8 +340,8 @@ var TuiSliderModule = /** @class */ (function () {
227
340
  TuiActiveZoneModule,
228
341
  TuiFormatNumberPipeModule,
229
342
  ],
230
- declarations: [TuiSliderComponent, TuiSliderOldComponent],
231
- exports: [TuiSliderComponent, TuiSliderOldComponent],
343
+ declarations: [TuiSliderComponent, TuiSliderKeyStepsDirective, TuiSliderOldComponent],
344
+ exports: [TuiSliderComponent, TuiSliderKeyStepsDirective, TuiSliderOldComponent],
232
345
  })
233
346
  ], TuiSliderModule);
234
347
  return TuiSliderModule;
@@ -238,5 +351,5 @@ var TuiSliderModule = /** @class */ (function () {
238
351
  * Generated bundle index. Do not edit.
239
352
  */
240
353
 
241
- export { TuiSliderComponent, TuiSliderModule, TuiSliderOldComponent };
354
+ export { TUI_SLIDER_DEFAULT_OPTIONS, TUI_SLIDER_OPTIONS, TuiSliderComponent, TuiSliderKeyStepsDirective, TuiSliderModule, TuiSliderOldComponent, tuiSliderOptionsProvider };
242
355
  //# sourceMappingURL=taiga-ui-kit-components-slider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-slider.js","sources":["ng://@taiga-ui/kit/components/slider/slider.component.ts","ng://@taiga-ui/kit/components/slider/slider-old.component.ts","ng://@taiga-ui/kit/components/slider/slider.module.ts","ng://@taiga-ui/kit/components/slider/taiga-ui-kit-components-slider.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n Input,\n Optional,\n Self,\n} from '@angular/core';\nimport {NgControl, NgModel} from '@angular/forms';\nimport {USER_AGENT} from '@ng-web-apis/common';\nimport {\n CHROMIUM_EDGE_START_VERSION,\n isEdgeOlderThan,\n tuiDefaultProp,\n watch,\n} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core';\nimport {take} from 'rxjs/operators';\n\n@Component({\n /**\n * We have to call our component as `<input tuiSlider type=\"range\" ... />`\n * because otherwise built-in angular\n * {@link https://github.com/angular/angular/blob/master/packages/forms/src/directives/range_value_accessor.ts#L45 RangeValueAccessor}\n * cannot be matched by its CSS selector.\n */\n selector: 'input[type=range][tuiSlider]',\n template: ``,\n styleUrls: ['./slider.style.less'],\n host: {\n /**\n * For change detection.\n * Webkit does not have built-in method for customization of filling progress (as Firefox).\n * We draw filling of progress by `background: linear-gradient(...)` of the track.\n * This function triggers change detection (for `fillPercentage` function) when we drag thumb of the input.\n */\n '(input)': '0',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiSliderComponent {\n @Input()\n @HostBinding('attr.data-size')\n @tuiDefaultProp()\n size: TuiSizeS = 'm';\n\n @Input()\n @tuiDefaultProp()\n segments = 1;\n\n get min(): number {\n return Number(this.elementRef.nativeElement.min);\n }\n\n get max(): number {\n return Number(this.elementRef.nativeElement.max) || 100;\n }\n\n get step(): number {\n return Number(this.elementRef.nativeElement.step) || 1;\n }\n\n get value(): number {\n return Number(this.elementRef.nativeElement.value) || 0;\n }\n\n @HostBinding('style.--tui-slider-fill-percentage.%')\n get fillPercentage(): number {\n return (100 * this.value) / (this.max - this.min);\n }\n\n @HostBinding('style.--tui-slider-segment-width.%')\n get stepPercentage(): number {\n return 100 / this.segments - 0.1;\n }\n\n @HostBinding('class._old-edge')\n get isOldEdge(): boolean {\n return isEdgeOlderThan(CHROMIUM_EDGE_START_VERSION, this.userAgent);\n }\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLInputElement>,\n @Inject(USER_AGENT) private readonly userAgent: string,\n ) {\n if (control instanceof NgModel) {\n /**\n * The ValueAccessor.writeValue method is called twice on any value accessor during component initialization,\n * when a control is bound using [(ngModel)], first time with a phantom null value.\n * With `changeDetection: ChangeDetectionStrategy.OnPush` the second call of writeValue with real value don't re-render the view.\n * ___\n * See this {@link https://github.com/angular/angular/issues/14988 issue}\n */\n control.valueChanges?.pipe(watch(changeDetectorRef), take(1)).subscribe();\n }\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Optional,\n Self,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n isNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiSlider} from '@taiga-ui/kit/abstract';\nimport {TUI_FROM_TO_TEXTS} from '@taiga-ui/kit/tokens';\nimport {Observable} from 'rxjs';\n\n/**\n * @deprecated use {@link TuiSliderComponent} instead\n * TODO remove in 3.0\n */\n// @dynamic\n@Component({\n selector: 'tui-slider',\n templateUrl: '../../abstract/slider/slider.common.template.html',\n styleUrls: [\n '../../abstract/slider/slider.common.style.less',\n './slider-old.style.less',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiSliderOldComponent),\n },\n ],\n})\nexport class TuiSliderOldComponent\n extends AbstractTuiSlider<number>\n implements TuiFocusableElementAccessor\n{\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(DOCUMENT) documentRef: Document,\n @Inject(TUI_FROM_TO_TEXTS) fromToTexts$: Observable<[string, string]>,\n ) {\n super(control, changeDetectorRef, documentRef, fromToTexts$);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.dotRight ? this.dotRight.nativeElement : null;\n }\n\n get focused(): boolean {\n return isNativeFocused(this.nativeFocusableElement);\n }\n\n get left(): number {\n return 0;\n }\n\n get right(): number {\n return 100 - 100 * this.getFractionFromValue(this.value);\n }\n\n protected getFallbackValue(): number {\n return 0;\n }\n\n protected processStep(increment: boolean) {\n const fraction = this.getFractionFromValue(this.value);\n const step = this.computedStep;\n const value = this.getValueFromFraction(\n increment ? fraction + step : fraction - step,\n );\n\n this.processValue(value);\n }\n\n protected processValue(value: number) {\n this.updateValue(this.valueGuard(value));\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiFocusVisibleModule,\n TuiRepeatTimesModule,\n} from '@taiga-ui/cdk';\nimport {TuiFormatNumberPipeModule} from '@taiga-ui/core';\n\nimport {TuiSliderComponent} from './slider.component';\nimport {TuiSliderOldComponent} from './slider-old.component';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiRepeatTimesModule,\n TuiFocusableModule,\n TuiFocusVisibleModule,\n TuiActiveZoneModule,\n TuiFormatNumberPipeModule,\n ],\n declarations: [TuiSliderComponent, TuiSliderOldComponent],\n exports: [TuiSliderComponent, TuiSliderOldComponent],\n})\nexport class TuiSliderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;IAoFI,4BAII,OAAyB,EACE,iBAAoC,EAC1B,UAAwC,EACxC,SAAiB;;QADjB,eAAU,GAAV,UAAU,CAA8B;QACxC,cAAS,GAAT,SAAS,CAAQ;QA5C1D,SAAI,GAAa,GAAG,CAAC;QAIrB,aAAQ,GAAG,CAAC,CAAC;QA0CT,IAAI,OAAO,YAAY,OAAO,EAAE;;;;;;;;YAQ5B,MAAA,OAAO,CAAC,YAAY,0CAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG;SAC7E;KACJ;IAlDD,sBAAI,mCAAG;aAAP;YACI,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;SACpD;;;OAAA;IAED,sBAAI,mCAAG;aAAP;YACI,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;SAC3D;;;OAAA;IAED,sBAAI,oCAAI;aAAR;YACI,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC1D;;;OAAA;IAED,sBAAI,qCAAK;aAAT;YACI,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3D;;;OAAA;IAGD,sBAAI,8CAAc;aAAlB;YACI,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CA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BAAiB;;IAXpB,qBAAqB;QAfjC,SAAS,CAAC;YACP,QAAQ,EAAE,YAAY;YACtB,61EAAgE;YAKhE,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,2BAA2B;oBACpC,WAAW,EAAE,UAAU,CAAC,cAAM,OAAA,uBAAqB,GAAA,CAAC;iBACvD;aACJ;;SACJ,CAAC;QAMO,WAAA,QAAQ,EAAE,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OAXrB,qBAAqB,CAiDjC;IAAD,4BAAC;CAAA,CAhDW,iBAAiB;;;ICjB7B;KAA+B;IAAlB,eAAe;QAZ3B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,oBAAoB;gBACpB,kBAAkB;gBAClB,qBAAqB;gBACrB,mBAAmB;gBACnB,yBAAyB;aAC5B;YACD,YAAY,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;YACzD,OAAO,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;SACvD,CAAC;OACW,eAAe,CAAG;IAAD,sBAAC;CAA/B;;ACzBA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-slider.js","sources":["ng://@taiga-ui/kit/components/slider/slider-options.ts","ng://@taiga-ui/kit/components/slider/slider.component.ts","ng://@taiga-ui/kit/components/slider/slider-key-steps.directive.ts","ng://@taiga-ui/kit/components/slider/slider-old.component.ts","ng://@taiga-ui/kit/components/slider/slider.module.ts","ng://@taiga-ui/kit/components/slider/taiga-ui-kit-components-slider.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiSizeS} from '@taiga-ui/core';\n\nexport interface TuiSliderOptions {\n readonly size: TuiSizeS;\n readonly trackColor: string;\n}\n\nexport const TUI_SLIDER_DEFAULT_OPTIONS: TuiSliderOptions = {\n size: 'm',\n trackColor: 'var(--tui-base-03)',\n};\n\nexport const TUI_SLIDER_OPTIONS = new InjectionToken<TuiSliderOptions>(\n 'Default parameters for Slider component',\n {factory: () => TUI_SLIDER_DEFAULT_OPTIONS},\n);\n\nexport const tuiSliderOptionsProvider = (\n options: Partial<TuiSliderOptions>,\n): ValueProvider => ({\n provide: TUI_SLIDER_OPTIONS,\n useValue: {...TUI_SLIDER_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n Input,\n Optional,\n Self,\n} from '@angular/core';\nimport {NgControl, NgModel} from '@angular/forms';\nimport {USER_AGENT} from '@ng-web-apis/common';\nimport {\n CHROMIUM_EDGE_START_VERSION,\n isEdgeOlderThan,\n tuiDefaultProp,\n watch,\n} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core';\nimport {take} from 'rxjs/operators';\n\nimport {TUI_SLIDER_OPTIONS, TuiSliderOptions} from './slider-options';\n\n@Component({\n /**\n * We have to call our component as `<input tuiSlider type=\"range\" ... />`\n * because otherwise built-in angular\n * {@link https://github.com/angular/angular/blob/master/packages/forms/src/directives/range_value_accessor.ts#L45 RangeValueAccessor}\n * cannot be matched by its CSS selector.\n */\n selector: 'input[type=range][tuiSlider]',\n template: ``,\n styleUrls: ['./slider.style.less'],\n host: {\n /**\n * For change detection.\n * Webkit does not have built-in method for customization of filling progress (as Firefox).\n * We draw filling of progress by `background: linear-gradient(...)` of the track.\n * This function triggers change detection (for `fillPercentage` function) when we drag thumb of the input.\n */\n '(input)': '0',\n '[style.--tui-slider-track-color]': 'options.trackColor',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiSliderComponent {\n @Input()\n @HostBinding('attr.data-size')\n @tuiDefaultProp()\n size: TuiSizeS = this.options.size;\n\n @Input()\n @tuiDefaultProp()\n segments = 1;\n\n get min(): number {\n return Number(this.elementRef.nativeElement.min);\n }\n\n get max(): number {\n return Number(this.elementRef.nativeElement.max) || 100;\n }\n\n get step(): number {\n return Number(this.elementRef.nativeElement.step) || 1;\n }\n\n get value(): number {\n return Number(this.elementRef.nativeElement.value) || 0;\n }\n\n set value(newValue: number) {\n this.elementRef.nativeElement.value = `${newValue}`;\n }\n\n @HostBinding('style.--tui-slider-fill-percentage.%')\n get valuePercentage(): number {\n return (100 * this.value) / (this.max - this.min);\n }\n\n @HostBinding('style.--tui-slider-segment-width.%')\n get segmentWidth(): number {\n return 100 / Math.max(1, this.segments);\n }\n\n @HostBinding('class._old-edge')\n get isOldEdge(): boolean {\n return isEdgeOlderThan(CHROMIUM_EDGE_START_VERSION, this.userAgent);\n }\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_SLIDER_OPTIONS) readonly options: TuiSliderOptions,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLInputElement>,\n @Inject(USER_AGENT) private readonly userAgent: string,\n ) {\n if (control instanceof NgModel) {\n /**\n * The ValueAccessor.writeValue method is called twice on any value accessor during component initialization,\n * when a control is bound using [(ngModel)], first time with a phantom null value.\n * With `changeDetection: ChangeDetectionStrategy.OnPush` the second call of writeValue with real value don't re-render the view.\n * ___\n * See this {@link https://github.com/angular/angular/issues/14988 issue}\n */\n control.valueChanges?.pipe(watch(changeDetectorRef), take(1)).subscribe();\n }\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Inject,\n Input,\n Optional,\n Self,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n AbstractTuiControl,\n isNativeFocused,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n} from '@taiga-ui/cdk';\nimport {TuiKeySteps} from '@taiga-ui/kit/types';\n\nimport {TuiSliderComponent} from './slider.component';\n\n// @dynamic\n@Directive({\n selector: 'input[tuiSlider][keySteps]',\n})\nexport class TuiSliderKeyStepsDirective\n extends AbstractTuiControl<number>\n implements TuiFocusableElementAccessor\n{\n @Input()\n @tuiDefaultProp(checkHasMinMaxPercents, 'Should contain min and max values')\n keySteps: TuiKeySteps = [];\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.computedDisabled ? null : this.elementRef.nativeElement;\n }\n\n get focused(): boolean {\n return isNativeFocused(this.nativeFocusableElement);\n }\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLInputElement>,\n @Inject(TuiSliderComponent) private readonly slider: TuiSliderComponent,\n ) {\n super(control, changeDetectorRef);\n }\n\n @HostListener('change')\n onInput() {\n const {valuePercentage} = this.slider;\n const [lowerStep, upperStep] = findKeyStepsBoundariesByFn(\n this.keySteps,\n ([keyStepPercentage, _]) => valuePercentage <= keyStepPercentage,\n );\n const newControlValue = transformToControlValue(\n valuePercentage,\n lowerStep,\n upperStep,\n );\n\n this.updateValue(newControlValue);\n }\n\n writeValue(controlValue: number | null) {\n if (controlValue === null) {\n return;\n }\n\n const [lowerStep, upperStep] = findKeyStepsBoundariesByFn(\n this.keySteps,\n ([_, keyStepValue]) => controlValue <= keyStepValue,\n );\n\n this.slider.value = this.transformToNativeValue(\n controlValue,\n lowerStep,\n upperStep,\n );\n }\n\n protected getFallbackValue(): number {\n return 0;\n }\n\n private transformToNativeValue(\n controlValue: number,\n [upperStepPercent, upperStepValue]: [number, number],\n [lowerStepPercent, lowerStepValue]: [number, number],\n ): number {\n const {min, max} = this.slider;\n const ratio = (controlValue - lowerStepValue) / (upperStepValue - lowerStepValue);\n const newValuePercentage =\n (upperStepPercent - lowerStepPercent) * ratio + lowerStepPercent;\n\n return (newValuePercentage * (max - min)) / 100;\n }\n}\n\nfunction checkHasMinMaxPercents(steps: TuiKeySteps): boolean {\n return !steps.length || (steps[0][0] === 0 && steps[steps.length - 1][0] === 100);\n}\n\nfunction findKeyStepsBoundariesByFn(\n keySteps: TuiKeySteps,\n fn: ([keyStepPercent, keyStepValue]: [number, number]) => boolean,\n): [[number, number], [number, number]] {\n const keyStepUpperIndex = keySteps.findIndex((ketStep, i) => i && fn(ketStep));\n const lowerStep = keySteps[keyStepUpperIndex - 1];\n const upperStep = keySteps[keyStepUpperIndex];\n\n return [lowerStep, upperStep];\n}\n\nfunction transformToControlValue(\n valuePercentage: number,\n [upperStepPercent, upperStepValue]: [number, number],\n [lowerStepPercent, lowerStepValue]: [number, number],\n): number {\n const ratio =\n (valuePercentage - lowerStepPercent) / (upperStepPercent - lowerStepPercent);\n\n return (upperStepValue - lowerStepValue) * ratio + lowerStepValue;\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n Inject,\n Optional,\n Self,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n isNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiSlider} from '@taiga-ui/kit/abstract';\nimport {TUI_FROM_TO_TEXTS} from '@taiga-ui/kit/tokens';\nimport {Observable} from 'rxjs';\n\n/**\n * @deprecated use {@link TuiSliderComponent} instead\n * TODO remove in 3.0\n */\n// @dynamic\n@Component({\n selector: 'tui-slider',\n templateUrl: '../../abstract/slider/slider.common.template.html',\n styleUrls: [\n '../../abstract/slider/slider.common.style.less',\n './slider-old.style.less',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiSliderOldComponent),\n },\n ],\n})\nexport class TuiSliderOldComponent\n extends AbstractTuiSlider<number>\n implements TuiFocusableElementAccessor\n{\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(DOCUMENT) documentRef: Document,\n @Inject(TUI_FROM_TO_TEXTS) fromToTexts$: Observable<[string, string]>,\n ) {\n super(control, changeDetectorRef, documentRef, fromToTexts$);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return this.dotRight ? this.dotRight.nativeElement : null;\n }\n\n get focused(): boolean {\n return isNativeFocused(this.nativeFocusableElement);\n }\n\n get left(): number {\n return 0;\n }\n\n get right(): number {\n return 100 - 100 * this.getFractionFromValue(this.value);\n }\n\n protected getFallbackValue(): number {\n return 0;\n }\n\n protected processStep(increment: boolean) {\n const fraction = this.getFractionFromValue(this.value);\n const step = this.computedStep;\n const value = this.getValueFromFraction(\n increment ? fraction + step : fraction - step,\n );\n\n this.processValue(value);\n }\n\n protected processValue(value: number) {\n this.updateValue(this.valueGuard(value));\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiFocusVisibleModule,\n TuiRepeatTimesModule,\n} from '@taiga-ui/cdk';\nimport {TuiFormatNumberPipeModule} from '@taiga-ui/core';\n\nimport {TuiSliderComponent} from './slider.component';\nimport {TuiSliderKeyStepsDirective} from './slider-key-steps.directive';\nimport {TuiSliderOldComponent} from './slider-old.component';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiRepeatTimesModule,\n TuiFocusableModule,\n TuiFocusVisibleModule,\n TuiActiveZoneModule,\n TuiFormatNumberPipeModule,\n ],\n declarations: [TuiSliderComponent, TuiSliderKeyStepsDirective, TuiSliderOldComponent],\n exports: [TuiSliderComponent, TuiSliderKeyStepsDirective, TuiSliderOldComponent],\n})\nexport class TuiSliderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"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AAE,UAAU,CAAC,cAAM,OAAA,uBAAqB,GAAA,CAAC;iBACvD;aACJ;;SACJ,CAAC;QAMO,WAAA,QAAQ,EAAE,CAAA;QACV,WAAA,IAAI,EAAE,CAAA;QACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACzB,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;QAChB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OAXrB,qBAAqB,CAiDjC;IAAD,4BAAC;CAAA,CAhDW,iBAAiB;;;IChB7B;KAA+B;IAAlB,eAAe;QAZ3B,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,oBAAoB;gBACpB,kBAAkB;gBAClB,qBAAqB;gBACrB,mBAAmB;gBACnB,yBAAyB;aAC5B;YACD,YAAY,EAAE,CAAC,kBAAkB,EAAE,0BAA0B,EAAE,qBAAqB,CAAC;YACrF,OAAO,EAAE,CAAC,kBAAkB,EAAE,0BAA0B,EAAE,qBAAqB,CAAC;SACnF,CAAC;OACW,eAAe,CAAG;IAAD,sBAAC;CAA/B;;AC1BA;;;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { __extends, __decorate, __param } from 'tslib';
2
- import { forwardRef, Optional, Self, Inject, ChangeDetectorRef, ViewChild, Input, HostBinding, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { forwardRef, Optional, Self, Inject, ChangeDetectorRef, ViewChild, ContentChild, ElementRef, Input, HostBinding, HostListener, Component, ChangeDetectionStrategy, Directive, NgModule } from '@angular/core';
3
3
  import { NgControl, FormsModule } from '@angular/forms';
4
- import { TUI_FOCUSABLE_ITEM_ACCESSOR, isNativeFocused, setNativeFocused, TUI_IS_IOS, tuiDefaultProp, AbstractTuiControl, TuiFocusableModule, TuiFocusedModule, TuiHoveredModule } from '@taiga-ui/cdk';
5
- import { TEXTFIELD_CONTROLLER_PROVIDER, HINT_CONTROLLER_PROVIDER, MODE_PROVIDER, getBorder, TUI_TEXTFIELD_APPEARANCE, TUI_MODE, TuiTextfieldController, TUI_TEXTFIELD_WATCHED_CONTROLLER, TuiHintControllerDirective, TUI_HINT_WATCHED_CONTROLLER, TuiScrollbarModule, TuiTooltipModule, TuiWrapperModule, TuiDescribedByModule, TuiSvgModule } from '@taiga-ui/core';
4
+ import { TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiControl, isNativeFocused, setNativeFocused, TUI_IS_IOS, tuiDefaultProp, TuiFocusableModule, TuiHoveredModule } from '@taiga-ui/cdk';
5
+ import { TEXTFIELD_CONTROLLER_PROVIDER, HINT_CONTROLLER_PROVIDER, MODE_PROVIDER, getBorder, TUI_TEXTFIELD_APPEARANCE, TUI_MODE, TuiTextfieldController, TUI_TEXTFIELD_WATCHED_CONTROLLER, TuiHintControllerDirective, TUI_HINT_WATCHED_CONTROLLER, TuiTextfieldComponent, TUI_TEXTFIELD_HOST, TuiAbstractTextfieldHost, TuiScrollbarModule, TuiTooltipModule, TuiWrapperModule, TuiDescribedByModule, TuiSvgModule, TuiPrimitiveTextfieldModule } from '@taiga-ui/core';
6
6
  import { Observable } from 'rxjs';
7
7
  import { CommonModule } from '@angular/common';
8
8
 
@@ -11,6 +11,10 @@ var TUI_TEXT_AREA_PROVIDERS = [
11
11
  provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
12
12
  useExisting: forwardRef(function () { return TuiTextAreaComponent; }),
13
13
  },
14
+ {
15
+ provide: AbstractTuiControl,
16
+ useExisting: forwardRef(function () { return TuiTextAreaComponent; }),
17
+ },
14
18
  TEXTFIELD_CONTROLLER_PROVIDER,
15
19
  HINT_CONTROLLER_PROVIDER,
16
20
  MODE_PROVIDER,
@@ -41,9 +45,11 @@ var TuiTextAreaComponent = /** @class */ (function (_super) {
41
45
  });
42
46
  Object.defineProperty(TuiTextAreaComponent.prototype, "nativeFocusableElement", {
43
47
  get: function () {
44
- return this.computedDisabled || !this.focusableElement
45
- ? null
46
- : this.focusableElement.nativeElement;
48
+ var _a, _b;
49
+ if (this.computedDisabled) {
50
+ return null;
51
+ }
52
+ return (((_a = this.textfield) === null || _a === void 0 ? void 0 : _a.nativeElement) || ((_b = this.focusableElement) === null || _b === void 0 ? void 0 : _b.nativeElement) || null);
47
53
  },
48
54
  enumerable: true,
49
55
  configurable: true
@@ -106,10 +112,9 @@ var TuiTextAreaComponent = /** @class */ (function (_super) {
106
112
  });
107
113
  Object.defineProperty(TuiTextAreaComponent.prototype, "hasExampleText", {
108
114
  get: function () {
109
- return (!!this.controller.exampleText &&
110
- this.focused &&
111
- !this.hasValue &&
112
- !this.readOnly);
115
+ var _a;
116
+ var text = this.controller.exampleText || ((_a = this.textfield) === null || _a === void 0 ? void 0 : _a.nativeElement.placeholder);
117
+ return !!text && this.focused && !this.hasValue && !this.readOnly;
113
118
  },
114
119
  enumerable: true,
115
120
  configurable: true
@@ -152,7 +157,7 @@ var TuiTextAreaComponent = /** @class */ (function (_super) {
152
157
  TuiTextAreaComponent.prototype.onPressed = function (pressed) {
153
158
  this.updatePressed(pressed);
154
159
  };
155
- TuiTextAreaComponent.prototype.onValue = function (value) {
160
+ TuiTextAreaComponent.prototype.onValueChange = function (value) {
156
161
  this.updateValue(value);
157
162
  };
158
163
  TuiTextAreaComponent.prototype.onMouseDown = function (event) {
@@ -186,6 +191,9 @@ var TuiTextAreaComponent = /** @class */ (function (_super) {
186
191
  __decorate([
187
192
  ViewChild('focusableElement')
188
193
  ], TuiTextAreaComponent.prototype, "focusableElement", void 0);
194
+ __decorate([
195
+ ContentChild(TuiTextfieldComponent, { read: ElementRef })
196
+ ], TuiTextAreaComponent.prototype, "textfield", void 0);
189
197
  __decorate([
190
198
  Input(),
191
199
  tuiDefaultProp()
@@ -213,17 +221,21 @@ var TuiTextAreaComponent = /** @class */ (function (_super) {
213
221
  __decorate([
214
222
  HostBinding('class._has-counter')
215
223
  ], TuiTextAreaComponent.prototype, "hasCounter", null);
224
+ __decorate([
225
+ HostListener('focusin', ['true']),
226
+ HostListener('focusout', ['false'])
227
+ ], TuiTextAreaComponent.prototype, "onFocused", null);
216
228
  TuiTextAreaComponent = __decorate([
217
229
  Component({
218
230
  selector: 'tui-text-area',
219
- template: "<tui-wrapper\n automation-id=\"tui-text-area__wrapper\"\n class=\"outline\"\n [appearance]=\"appearance\"\n [disabled]=\"disabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n>\n <div\n *ngIf=\"hasCounter\"\n automation-id=\"tui-text-area__counter\"\n class=\"counter\"\n >\n {{ value.length }}/{{ controller.maxLength }}\n </div>\n</tui-wrapper>\n\n<label\n class=\"content\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"wrapper\">\n <div\n *ngIf=\"hasPlaceholder\"\n automation-id=\"tui-text-area__placeholder\"\n class=\"placeholder\"\n [class.placeholder_raised]=\"placeholderRaised\"\n >\n <ng-content></ng-content>\n </div>\n <tui-scrollbar\n automation-id=\"tui-text-area__scrollbar\"\n class=\"box\"\n [style.maxHeight.px]=\"computeMaxHeight\"\n >\n <div class=\"input-wrapper\">\n <div class=\"relative\">\n <div aria-hidden=\"true\" class=\"pseudo-content\">\n <span\n [textContent]=\"fittedContent || controller.exampleText\"\n ></span>\n <span\n class=\"pseudo-content__extra\"\n [textContent]=\"extraContent\"\n ></span>\n &nbsp;\n </div>\n <textarea\n #focusableElement\n automation-id=\"tui-text-area__native\"\n class=\"input\"\n [placeholder]=\"controller.exampleText\"\n [id]=\"id\"\n [tuiDescribedBy]=\"id\"\n [tuiFocusable]=\"focusable\"\n [disabled]=\"disabled\"\n [ngModel]=\"value\"\n [readOnly]=\"readOnly\"\n (tuiFocusedChange)=\"onFocused($event)\"\n (ngModelChange)=\"onValue($event)\"\n ></textarea>\n </div>\n </div>\n </tui-scrollbar>\n </div>\n <div class=\"icons\">\n <tui-svg\n *ngIf=\"hasCleaner\"\n src=\"tuiIconCloseLarge\"\n class=\"cleaner\"\n (click.stop)=\"onValue('')\"\n ></tui-svg>\n <tui-tooltip\n *ngIf=\"hasTooltip\"\n automation-id=\"tui-text-area__tooltip\"\n class=\"tooltip\"\n [describeId]=\"id\"\n [direction]=\"hintController.direction\"\n [mode]=\"hintController.mode\"\n [content]=\"hintController.content\"\n [showDelay]=\"hintController.showDelay\"\n [hideDelay]=\"hintController.hideDelay\"\n ></tui-tooltip>\n </div>\n</label>\n",
231
+ template: "<tui-wrapper\n automation-id=\"tui-text-area__wrapper\"\n class=\"t-outline\"\n [appearance]=\"appearance\"\n [disabled]=\"disabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [readOnly]=\"readOnly\"\n [invalid]=\"computedInvalid\"\n>\n <div\n *ngIf=\"hasCounter\"\n automation-id=\"tui-text-area__counter\"\n class=\"t-counter\"\n >\n {{ value.length }}/{{ controller.maxLength }}\n </div>\n</tui-wrapper>\n\n<label\n class=\"t-content\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <div\n *ngIf=\"hasPlaceholder\"\n automation-id=\"tui-text-area__placeholder\"\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n <ng-content></ng-content>\n </div>\n <tui-scrollbar\n automation-id=\"tui-text-area__scrollbar\"\n class=\"t-box\"\n [style.maxHeight.px]=\"computeMaxHeight\"\n >\n <div class=\"t-input-wrapper\">\n <div class=\"t-relative\">\n <div aria-hidden=\"true\" class=\"t-pseudo-content\">\n <span\n [textContent]=\"fittedContent || controller.exampleText\"\n ></span>\n <span\n class=\"t-pseudo-content__extra\"\n [textContent]=\"extraContent\"\n ></span>\n &nbsp;\n </div>\n <textarea\n #focusableElement\n automation-id=\"tui-text-area__native\"\n class=\"t-input\"\n [placeholder]=\"controller.exampleText\"\n [id]=\"id\"\n [tuiDescribedBy]=\"id\"\n [tuiFocusable]=\"computedFocusable\"\n [disabled]=\"computedDisabled\"\n [ngModel]=\"value\"\n [readOnly]=\"readOnly\"\n (ngModelChange)=\"onValueChange($event)\"\n ></textarea>\n <ng-content select=\"textarea\"></ng-content>\n </div>\n </div>\n </tui-scrollbar>\n </div>\n <div class=\"t-icons\">\n <tui-svg\n *ngIf=\"hasCleaner\"\n src=\"tuiIconCloseLarge\"\n class=\"t-cleaner\"\n (click.stop)=\"onValueChange('')\"\n ></tui-svg>\n <tui-tooltip\n *ngIf=\"hasTooltip\"\n automation-id=\"tui-text-area__tooltip\"\n class=\"t-tooltip\"\n [describeId]=\"id\"\n [direction]=\"hintController.direction\"\n [mode]=\"hintController.mode\"\n [content]=\"hintController.content\"\n [showDelay]=\"hintController.showDelay\"\n [hideDelay]=\"hintController.hideDelay\"\n ></tui-tooltip>\n </div>\n</label>\n",
220
232
  changeDetection: ChangeDetectionStrategy.OnPush,
221
233
  providers: TUI_TEXT_AREA_PROVIDERS,
222
234
  host: {
223
235
  '($.data-mode.attr)': 'mode$',
224
236
  '[class._ios]': 'isIOS',
225
237
  },
226
- styles: [":host{position:relative;z-index:0;display:flex;font:var(--tui-font-text-m);flex-direction:column;min-height:6.75rem;border-radius:var(--tui-radius-m);color:var(--tui-text-01)}:host[data-mode=onDark]{color:var(--tui-text-01-night)}:host[data-size='m']{font:var(--tui-font-text-s);min-height:5.5rem}:host[data-size='m']._has-counter{min-height:6.625rem}:host[data-size='l']._has-counter{min-height:7.875rem}.outline{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1}.content{margin-top:0;margin-bottom:0;min-height:inherit;width:100%;box-sizing:border-box;overflow:hidden;cursor:text}:host._disabled .content{cursor:auto;opacity:var(--tui-disabled-opacity)}:host:not(._expandable) .content{position:absolute;top:0;left:0;bottom:1px;right:0;min-height:auto}:host._has-counter:not(._expandable) .content{bottom:1.6875rem}.wrapper{position:relative;width:100%;height:100%;min-height:inherit;padding-bottom:.4375rem;box-sizing:border-box}:host[data-size='m']._label-outside .wrapper{padding-top:.75rem}:host[data-size='l']._label-outside .wrapper{padding-top:1rem}:host[data-size='m']:not(._label-outside) .wrapper{padding-top:1.375rem}:host[data-size='l']:not(._label-outside) .wrapper{padding-top:1.625rem}.input-wrapper{min-height:inherit;width:100%;flex:1}.relative{position:relative;min-height:inherit}.box{display:flex;min-height:100%;width:100%}:host:not(._expandable) .box{height:100%}:host._has-counter._expandable .box{margin-bottom:1.25rem}.pseudo-content{white-space:pre-wrap;word-wrap:break-word;pointer-events:none;color:transparent;overflow:hidden;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)}:host[data-size='m'] .pseudo-content{padding:0 .75rem}:host[data-size='l'] .pseudo-content{padding:0 1rem}.pseudo-content__extra{background-color:var(--tui-error-bg-night)}.input{padding:0;border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;-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%;box-sizing:border-box;resize:none;overflow:hidden;outline:0;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)}.input:-webkit-autofill,.input:-webkit-autofill:focus,.input:-webkit-autofill:hover{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 1000px var(--tui-autofill) inset!important}.input::-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.input::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .input::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .input::placeholder{color:var(--tui-text-03-night)}:host._focused .input:not(:read-only)::-ms-input-placeholder{opacity:1}:host._focused .input:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .input:not(:read-only)::placeholder{opacity:1}:host[data-size='m'] .input{padding:0 .75rem}:host[data-size='l'] .input{padding:0 1rem}:host._ios .input{padding-left:.8125rem}:host[data-mode=onDark]._disabled .input{color:var(--tui-text-03-night)}.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%;font-size:.8125rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;position:absolute;left:0;max-width:100%;padding:0 1rem;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);box-sizing:border-box}.placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .placeholder_raised{font-size:.69rem;transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .placeholder_raised,:host._invalid:not(._focused)._hovered .placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused)._hovered .placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .placeholder,:host[data-size='l']._focused._label-outside .placeholder,:host[data-size='m']._focused._label-outside .placeholder{color:var(--tui-text-03)}:host[data-size='l'] .placeholder{font-size:.9375rem}:host[data-size='l'] .placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .placeholder,:host[data-size='m']._focused:not(._label-outside) .placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .placeholder{color:var(--tui-text-02-night)}:host[data-size='m'] .placeholder{top:.75rem;padding:0 .75rem}:host[data-size='l'] .placeholder{top:1rem}:host._label-outside .placeholder{overflow:initial;height:auto;white-space:initial}.icons{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;justify-content:flex-end;pointer-events:none;padding:1rem .75rem}:host[data-size='m'] .icons{padding:.75rem}.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;pointer-events:auto}.cleaner:hover{color:var(--tui-text-02)}:host._disabled .cleaner,:host._readonly .cleaner{pointer-events:none}:host[data-mode=onDark] .cleaner{color:var(--tui-text-03-night)}:host[data-mode=onDark] .cleaner:hover{color:var(--tui-text-01-night)}.tooltip{pointer-events:auto}.counter{position:absolute;right:.75rem;bottom:.5rem;font:var(--tui-font-text-s);pointer-events:none;margin-top:auto;text-align:right;color:var(--tui-text-03)}:host[data-mode=onDark] .counter{color:var(--tui-text-03-night)}"]
238
+ styles: [":host{position:relative;z-index:0;display:flex;font:var(--tui-font-text-m);flex-direction:column;min-height:6.75rem;border-radius:var(--tui-radius-m);color:var(--tui-text-01)}:host[data-mode=onDark]{color:var(--tui-text-01-night)}:host[data-size='m']{font:var(--tui-font-text-s);min-height:5.5rem}:host[data-size='m']._has-counter{min-height:6.625rem}:host[data-size='l']._has-counter{min-height:7.875rem}.t-outline{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1}.t-content{margin-top:0;margin-bottom:0;min-height:inherit;width:100%;box-sizing:border-box;overflow:hidden;cursor:text}:host._disabled .t-content{cursor:auto;opacity:var(--tui-disabled-opacity)}:host:not(._expandable) .t-content{position:absolute;top:0;left:0;bottom:1px;right:0;min-height:auto}:host._has-counter:not(._expandable) .t-content{bottom:1.6875rem}.t-wrapper{position:relative;width:100%;height:100%;min-height:inherit;padding-bottom:.4375rem;box-sizing:border-box}:host[data-size='m']._label-outside .t-wrapper{padding-top:.75rem}:host[data-size='l']._label-outside .t-wrapper{padding-top:1rem}:host[data-size='m']:not(._label-outside) .t-wrapper{padding-top:1.375rem}:host[data-size='l']:not(._label-outside) .t-wrapper{padding-top:1.625rem}.t-input-wrapper{min-height:inherit;width:100%;flex:1}.t-relative{position:relative;min-height:inherit}.t-box{display:flex;min-height:100%;width:100%}:host:not(._expandable) .t-box{height:100%}:host._has-counter._expandable .t-box{margin-bottom:1.25rem}.t-pseudo-content{white-space:pre-wrap;word-wrap:break-word;pointer-events:none;color:transparent;overflow:hidden;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)}:host[data-size='m'] .t-pseudo-content{padding:0 .75rem}:host[data-size='l'] .t-pseudo-content{padding:0 1rem}.t-pseudo-content__extra{background-color:var(--tui-error-bg-night)}.t-input{padding:0;border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;-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%;box-sizing:border-box;resize:none;overflow:hidden;outline:0;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)}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{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 1000px var(--tui-autofill) inset!important}.t-input:not(:last-child){display:none}.t-input::-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.t-input::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .t-input::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-input::placeholder{color:var(--tui-text-03-night)}:host._focused .t-input:not(:read-only)::-ms-input-placeholder{opacity:1}:host._focused .t-input:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .t-input:not(:read-only)::placeholder{opacity:1}:host[data-size='m'] .t-input{padding:0 .75rem}:host[data-size='l'] .t-input{padding:0 1rem}:host._ios .t-input{padding-left:.8125rem}:host[data-mode=onDark]._disabled .t-input{color:var(--tui-text-03-night)}.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%;font-size:.8125rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;position:absolute;left:0;max-width:100%;padding:0 1rem;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);box-sizing:border-box}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font-size:.69rem;transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused)._hovered .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)._hovered .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)}:host[data-size='m'] .t-placeholder{top:.75rem;padding:0 .75rem}:host[data-size='l'] .t-placeholder{top:1rem}:host._label-outside .t-placeholder{overflow:initial;height:auto;white-space:initial}.t-icons{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;justify-content:flex-end;pointer-events:none;padding:1rem .75rem}:host[data-size='m'] .t-icons{padding:.75rem}.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;pointer-events:auto}.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-tooltip{pointer-events:auto}.t-counter{position:absolute;right:.75rem;bottom:.5rem;font:var(--tui-font-text-s);pointer-events:none;margin-top:auto;text-align:right;color:var(--tui-text-03)}:host[data-mode=onDark] .t-counter{color:var(--tui-text-03-night)}"]
227
239
  }),
228
240
  __param(0, Optional()),
229
241
  __param(0, Self()),
@@ -238,6 +250,30 @@ var TuiTextAreaComponent = /** @class */ (function (_super) {
238
250
  return TuiTextAreaComponent;
239
251
  }(AbstractTuiControl));
240
252
 
253
+ var TuiTextAreaDirective = /** @class */ (function (_super) {
254
+ __extends(TuiTextAreaDirective, _super);
255
+ function TuiTextAreaDirective() {
256
+ return _super !== null && _super.apply(this, arguments) || this;
257
+ }
258
+ TuiTextAreaDirective_1 = TuiTextAreaDirective;
259
+ TuiTextAreaDirective.prototype.onValueChange = function (value) {
260
+ this.host.onValueChange(value);
261
+ };
262
+ var TuiTextAreaDirective_1;
263
+ TuiTextAreaDirective = TuiTextAreaDirective_1 = __decorate([
264
+ Directive({
265
+ selector: 'tui-text-area',
266
+ providers: [
267
+ {
268
+ provide: TUI_TEXTFIELD_HOST,
269
+ useExisting: forwardRef(function () { return TuiTextAreaDirective_1; }),
270
+ },
271
+ ],
272
+ })
273
+ ], TuiTextAreaDirective);
274
+ return TuiTextAreaDirective;
275
+ }(TuiAbstractTextfieldHost));
276
+
241
277
  var TuiTextAreaModule = /** @class */ (function () {
242
278
  function TuiTextAreaModule() {
243
279
  }
@@ -247,16 +283,16 @@ var TuiTextAreaModule = /** @class */ (function () {
247
283
  CommonModule,
248
284
  FormsModule,
249
285
  TuiFocusableModule,
250
- TuiFocusedModule,
251
286
  TuiHoveredModule,
252
287
  TuiScrollbarModule,
253
288
  TuiTooltipModule,
254
289
  TuiWrapperModule,
255
290
  TuiDescribedByModule,
256
291
  TuiSvgModule,
292
+ TuiPrimitiveTextfieldModule,
257
293
  ],
258
- declarations: [TuiTextAreaComponent],
259
- exports: [TuiTextAreaComponent],
294
+ declarations: [TuiTextAreaComponent, TuiTextAreaDirective],
295
+ exports: [TuiTextAreaComponent, TuiTextAreaDirective, TuiTextfieldComponent],
260
296
  })
261
297
  ], TuiTextAreaModule);
262
298
  return TuiTextAreaModule;
@@ -266,5 +302,5 @@ var TuiTextAreaModule = /** @class */ (function () {
266
302
  * Generated bundle index. Do not edit.
267
303
  */
268
304
 
269
- export { DEFAULT_ROWS, LINE_HEIGHT_L, LINE_HEIGHT_M, TUI_TEXT_AREA_PROVIDERS, TuiTextAreaComponent, TuiTextAreaModule };
305
+ export { DEFAULT_ROWS, LINE_HEIGHT_L, LINE_HEIGHT_M, TUI_TEXT_AREA_PROVIDERS, TuiTextAreaComponent, TuiTextAreaDirective, TuiTextAreaModule };
270
306
  //# sourceMappingURL=taiga-ui-kit-components-text-area.js.map