@taiga-ui/core 2.31.0 → 2.32.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 (169) hide show
  1. package/abstract/abstract-hint-options.d.ts +7 -0
  2. package/abstract/abstract-hint.d.ts +5 -4
  3. package/abstract/index.d.ts +1 -0
  4. package/abstract/taiga-ui-core-abstract.metadata.json +1 -1
  5. package/bundles/taiga-ui-core-abstract.umd.js +13 -4
  6. package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
  7. package/bundles/taiga-ui-core-abstract.umd.min.js +1 -1
  8. package/bundles/taiga-ui-core-abstract.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-core-components-dialog.umd.js +1 -1
  10. package/bundles/taiga-ui-core-components-dialog.umd.min.js +1 -1
  11. package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-core-components-link.umd.js +2 -2
  13. package/bundles/taiga-ui-core-components-link.umd.js.map +1 -1
  14. package/bundles/taiga-ui-core-components-link.umd.min.js +1 -1
  15. package/bundles/taiga-ui-core-components-link.umd.min.js.map +1 -1
  16. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +30 -7
  17. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  18. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +1 -1
  19. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
  20. package/bundles/taiga-ui-core-components-scroll-controls.umd.js +1 -1
  21. package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js +2 -2
  22. package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js.map +1 -1
  23. package/bundles/taiga-ui-core-components-tooltip.umd.js +23 -13
  24. package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
  25. package/bundles/taiga-ui-core-components-tooltip.umd.min.js +2 -2
  26. package/bundles/taiga-ui-core-components-tooltip.umd.min.js.map +1 -1
  27. package/bundles/taiga-ui-core-constants.umd.js +1 -1
  28. package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
  29. package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
  30. package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
  31. package/bundles/taiga-ui-core-directives-hint-controller.umd.js +17 -12
  32. package/bundles/taiga-ui-core-directives-hint-controller.umd.js.map +1 -1
  33. package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js +2 -2
  34. package/bundles/taiga-ui-core-directives-hint-controller.umd.min.js.map +1 -1
  35. package/bundles/taiga-ui-core-directives-hint.umd.js +20 -6
  36. package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
  37. package/bundles/taiga-ui-core-directives-hint.umd.min.js +1 -1
  38. package/bundles/taiga-ui-core-directives-hint.umd.min.js.map +1 -1
  39. package/bundles/taiga-ui-core-directives-manual-hint.umd.js +15 -4
  40. package/bundles/taiga-ui-core-directives-manual-hint.umd.js.map +1 -1
  41. package/bundles/taiga-ui-core-directives-manual-hint.umd.min.js +1 -1
  42. package/bundles/taiga-ui-core-directives-manual-hint.umd.min.js.map +1 -1
  43. package/bundles/taiga-ui-core-directives-pointer-hint.umd.js +17 -6
  44. package/bundles/taiga-ui-core-directives-pointer-hint.umd.js.map +1 -1
  45. package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js +1 -1
  46. package/bundles/taiga-ui-core-directives-pointer-hint.umd.min.js.map +1 -1
  47. package/bundles/taiga-ui-core-utils-mask.umd.js +1 -1
  48. package/bundles/taiga-ui-core-utils-mask.umd.js.map +1 -1
  49. package/bundles/taiga-ui-core-utils-mask.umd.min.js +1 -1
  50. package/bundles/taiga-ui-core-utils-mask.umd.min.js.map +1 -1
  51. package/components/dialog/taiga-ui-core-components-dialog.metadata.json +1 -1
  52. package/components/link/taiga-ui-core-components-link.metadata.json +1 -1
  53. package/components/primitive-textfield/index.d.ts +1 -0
  54. package/components/primitive-textfield/primitive-textfield-options.d.ts +11 -0
  55. package/components/primitive-textfield/primitive-textfield.component.d.ts +7 -4
  56. package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
  57. package/components/scroll-controls/taiga-ui-core-components-scroll-controls.metadata.json +1 -1
  58. package/components/tooltip/taiga-ui-core-components-tooltip.metadata.json +1 -1
  59. package/components/tooltip/tooltip.component.d.ts +9 -6
  60. package/constants/taiga-ui-core-constants.metadata.json +1 -1
  61. package/constants/version.d.ts +1 -1
  62. package/directives/hint/hint-options.d.ts +12 -0
  63. package/directives/hint/hint.directive.d.ts +5 -3
  64. package/directives/hint/index.d.ts +1 -0
  65. package/directives/hint/taiga-ui-core-directives-hint.metadata.json +1 -1
  66. package/directives/hint-controller/hint-controller.directive.d.ts +7 -5
  67. package/directives/hint-controller/taiga-ui-core-directives-hint-controller.metadata.json +1 -1
  68. package/directives/manual-hint/index.d.ts +1 -0
  69. package/directives/manual-hint/manual-hint-options.d.ts +6 -0
  70. package/directives/manual-hint/manual-hint.directive.d.ts +3 -1
  71. package/directives/manual-hint/taiga-ui-core-directives-manual-hint.metadata.json +1 -1
  72. package/directives/pointer-hint/index.d.ts +1 -0
  73. package/directives/pointer-hint/pointer-hint-options.d.ts +9 -0
  74. package/directives/pointer-hint/pointer-hint.directive.d.ts +5 -3
  75. package/directives/pointer-hint/taiga-ui-core-directives-pointer-hint.metadata.json +1 -1
  76. package/esm2015/abstract/abstract-hint-options.js +6 -0
  77. package/esm2015/abstract/abstract-hint.js +7 -5
  78. package/esm2015/abstract/index.js +2 -1
  79. package/esm2015/components/dialog/dialog.component.js +1 -1
  80. package/esm2015/components/link/link.component.js +3 -3
  81. package/esm2015/components/primitive-textfield/index.js +2 -1
  82. package/esm2015/components/primitive-textfield/primitive-textfield-options.js +12 -0
  83. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +18 -8
  84. package/esm2015/components/scroll-controls/scroll-controls.component.js +1 -1
  85. package/esm2015/components/tooltip/tooltip.component.js +16 -9
  86. package/esm2015/components/tooltip/tooltip.module.js +3 -2
  87. package/esm2015/constants/version.js +2 -2
  88. package/esm2015/directives/hint/hint-options.js +10 -0
  89. package/esm2015/directives/hint/hint.directive.js +11 -7
  90. package/esm2015/directives/hint/index.js +2 -1
  91. package/esm2015/directives/hint-controller/hint-controller.directive.js +16 -10
  92. package/esm2015/directives/hint-controller/hint-controller.token.js +4 -3
  93. package/esm2015/directives/manual-hint/index.js +2 -1
  94. package/esm2015/directives/manual-hint/manual-hint-options.js +8 -0
  95. package/esm2015/directives/manual-hint/manual-hint.directive.js +9 -5
  96. package/esm2015/directives/pointer-hint/index.js +2 -1
  97. package/esm2015/directives/pointer-hint/pointer-hint-options.js +8 -0
  98. package/esm2015/directives/pointer-hint/pointer-hint.directive.js +11 -7
  99. package/esm2015/utils/mask/create-number-mask.js +2 -2
  100. package/esm5/abstract/abstract-hint-options.js +6 -0
  101. package/esm5/abstract/abstract-hint.js +7 -5
  102. package/esm5/abstract/index.js +2 -1
  103. package/esm5/components/dialog/dialog.component.js +1 -1
  104. package/esm5/components/link/link.component.js +3 -3
  105. package/esm5/components/primitive-textfield/index.js +2 -1
  106. package/esm5/components/primitive-textfield/primitive-textfield-options.js +12 -0
  107. package/esm5/components/primitive-textfield/primitive-textfield.component.js +18 -8
  108. package/esm5/components/scroll-controls/scroll-controls.component.js +1 -1
  109. package/esm5/components/tooltip/tooltip.component.js +20 -9
  110. package/esm5/components/tooltip/tooltip.module.js +3 -2
  111. package/esm5/constants/version.js +2 -2
  112. package/esm5/directives/hint/hint-options.js +11 -0
  113. package/esm5/directives/hint/hint.directive.js +11 -7
  114. package/esm5/directives/hint/index.js +2 -1
  115. package/esm5/directives/hint-controller/hint-controller.directive.js +16 -10
  116. package/esm5/directives/hint-controller/hint-controller.token.js +4 -3
  117. package/esm5/directives/manual-hint/index.js +2 -1
  118. package/esm5/directives/manual-hint/manual-hint-options.js +9 -0
  119. package/esm5/directives/manual-hint/manual-hint.directive.js +9 -5
  120. package/esm5/directives/pointer-hint/index.js +2 -1
  121. package/esm5/directives/pointer-hint/pointer-hint-options.js +9 -0
  122. package/esm5/directives/pointer-hint/pointer-hint.directive.js +11 -7
  123. package/esm5/utils/mask/create-number-mask.js +2 -2
  124. package/fesm2015/taiga-ui-core-abstract.js +13 -5
  125. package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
  126. package/fesm2015/taiga-ui-core-components-dialog.js +1 -1
  127. package/fesm2015/taiga-ui-core-components-link.js +2 -2
  128. package/fesm2015/taiga-ui-core-components-link.js.map +1 -1
  129. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +29 -9
  130. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  131. package/fesm2015/taiga-ui-core-components-scroll-controls.js +1 -1
  132. package/fesm2015/taiga-ui-core-components-tooltip.js +17 -9
  133. package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
  134. package/fesm2015/taiga-ui-core-constants.js +1 -1
  135. package/fesm2015/taiga-ui-core-constants.js.map +1 -1
  136. package/fesm2015/taiga-ui-core-directives-hint-controller.js +16 -10
  137. package/fesm2015/taiga-ui-core-directives-hint-controller.js.map +1 -1
  138. package/fesm2015/taiga-ui-core-directives-hint.js +20 -9
  139. package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
  140. package/fesm2015/taiga-ui-core-directives-manual-hint.js +16 -7
  141. package/fesm2015/taiga-ui-core-directives-manual-hint.js.map +1 -1
  142. package/fesm2015/taiga-ui-core-directives-pointer-hint.js +18 -9
  143. package/fesm2015/taiga-ui-core-directives-pointer-hint.js.map +1 -1
  144. package/fesm2015/taiga-ui-core-utils-mask.js +1 -1
  145. package/fesm2015/taiga-ui-core-utils-mask.js.map +1 -1
  146. package/fesm5/taiga-ui-core-abstract.js +13 -5
  147. package/fesm5/taiga-ui-core-abstract.js.map +1 -1
  148. package/fesm5/taiga-ui-core-components-dialog.js +1 -1
  149. package/fesm5/taiga-ui-core-components-link.js +2 -2
  150. package/fesm5/taiga-ui-core-components-link.js.map +1 -1
  151. package/fesm5/taiga-ui-core-components-primitive-textfield.js +29 -9
  152. package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  153. package/fesm5/taiga-ui-core-components-scroll-controls.js +1 -1
  154. package/fesm5/taiga-ui-core-components-tooltip.js +21 -9
  155. package/fesm5/taiga-ui-core-components-tooltip.js.map +1 -1
  156. package/fesm5/taiga-ui-core-constants.js +1 -1
  157. package/fesm5/taiga-ui-core-constants.js.map +1 -1
  158. package/fesm5/taiga-ui-core-directives-hint-controller.js +16 -10
  159. package/fesm5/taiga-ui-core-directives-hint-controller.js.map +1 -1
  160. package/fesm5/taiga-ui-core-directives-hint.js +21 -10
  161. package/fesm5/taiga-ui-core-directives-hint.js.map +1 -1
  162. package/fesm5/taiga-ui-core-directives-manual-hint.js +17 -8
  163. package/fesm5/taiga-ui-core-directives-manual-hint.js.map +1 -1
  164. package/fesm5/taiga-ui-core-directives-pointer-hint.js +19 -10
  165. package/fesm5/taiga-ui-core-directives-pointer-hint.js.map +1 -1
  166. package/fesm5/taiga-ui-core-utils-mask.js +1 -1
  167. package/fesm5/taiga-ui-core-utils-mask.js.map +1 -1
  168. package/package.json +10 -10
  169. package/styles/mixins/textfield.less +7 -0
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-primitive-textfield.js","sources":["ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield.providers.ts","ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield.component.ts","ng://@taiga-ui/core/components/primitive-textfield/value-decoration/value-decoration.component.ts","ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield.module.ts","ng://@taiga-ui/core/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.ts"],"sourcesContent":["import {forwardRef} from '@angular/core';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk';\nimport {HINT_CONTROLLER_PROVIDER} from '@taiga-ui/core/directives/hint-controller';\nimport {TEXTFIELD_CONTROLLER_PROVIDER} from '@taiga-ui/core/directives/textfield-controller';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\n\nimport {TuiPrimitiveTextfieldComponent} from './primitive-textfield.component';\n\nexport const TUI_PRIMITIVE_TEXTFIELD_PROVIDERS = [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiPrimitiveTextfieldComponent),\n },\n TEXTFIELD_CONTROLLER_PROVIDER,\n HINT_CONTROLLER_PROVIDER,\n MODE_PROVIDER,\n];\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n Output,\n QueryList,\n ViewChild,\n} from '@angular/core';\nimport {\n AbstractTuiInteractive,\n isNativeFocused,\n setNativeFocused,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {\n TUI_HINT_WATCHED_CONTROLLER,\n TuiHintControllerDirective,\n} from '@taiga-ui/core/directives/hint-controller';\nimport {\n TUI_TEXTFIELD_WATCHED_CONTROLLER,\n TuiTextfieldController,\n} from '@taiga-ui/core/directives/textfield-controller';\nimport {TUI_MODE, TUI_TEXTFIELD_APPEARANCE} from '@taiga-ui/core/tokens';\nimport {\n TuiBrightness,\n TuiHorizontalDirection,\n TuiSizeL,\n TuiSizeS,\n} from '@taiga-ui/core/types';\nimport {getBorder} from '@taiga-ui/core/utils/miscellaneous';\nimport {PolymorpheusContent, PolymorpheusOutletComponent} from '@tinkoff/ng-polymorpheus';\nimport {fromEvent, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TUI_PRIMITIVE_TEXTFIELD_PROVIDERS} from './primitive-textfield.providers';\n\nconst ICON_PADDING = 1.75;\nconst ICON_PADDING_S = 1.5;\n\n@Component({\n selector: 'tui-primitive-textfield',\n templateUrl: './primitive-textfield.template.html',\n styleUrls: ['./primitive-textfield.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_PRIMITIVE_TEXTFIELD_PROVIDERS,\n host: {\n '($.data-mode.attr)': 'mode$',\n },\n})\nexport class TuiPrimitiveTextfieldComponent\n extends AbstractTuiInteractive\n implements TuiFocusableElementAccessor\n{\n @ViewChild('focusableElement')\n private readonly focusableElement?: ElementRef<HTMLInputElement>;\n\n private autofilled = false;\n\n @Input()\n @tuiDefaultProp()\n editable = true;\n\n @Input()\n @tuiDefaultProp()\n filler = '';\n\n @Input()\n @tuiDefaultProp()\n iconAlign: TuiHorizontalDirection = 'right';\n\n // TODO: Remove null in 3.0\n @Input()\n @tuiDefaultProp()\n iconContent: PolymorpheusContent | null = null;\n\n @Input()\n @HostBinding('class._readonly')\n @tuiDefaultProp()\n readOnly = false;\n\n @Input()\n @tuiDefaultProp()\n invalid = false;\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n @tuiDefaultProp()\n prefix = '';\n\n @Input()\n @tuiDefaultProp()\n postfix = '';\n\n @Input()\n @tuiDefaultProp()\n value = '';\n\n @Output()\n readonly valueChange = new EventEmitter<string>();\n\n @Output()\n readonly autofilledChange = new EventEmitter<boolean>();\n\n @ContentChildren(PolymorpheusOutletComponent)\n readonly content?: QueryList<unknown>;\n\n constructor(\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_TEXTFIELD_APPEARANCE) readonly appearance: string,\n @Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)\n readonly controller: TuiTextfieldController,\n @Inject(TUI_HINT_WATCHED_CONTROLLER)\n readonly hintController: TuiHintControllerDirective,\n ) {\n super();\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.computedDisabled || !this.focusableElement\n ? null\n : this.focusableElement.nativeElement;\n }\n\n get focused(): boolean {\n return isNativeFocused(this.nativeFocusableElement);\n }\n\n @HostBinding('attr.data-tui-host-size')\n get size(): TuiSizeS | TuiSizeL {\n return this.controller.size;\n }\n\n @HostBinding('class._label-outside')\n get labelOutside(): boolean {\n return this.controller.labelOutside;\n }\n\n @HostBinding('class._invalid')\n get computedInvalid(): boolean {\n return !this.readOnly && !this.disabled && this.invalid;\n }\n\n get inputHidden(): boolean {\n return !!this.content?.length;\n }\n\n get hasValue(): boolean {\n return !!this.value;\n }\n\n get hasCleaner(): boolean {\n return (\n this.controller.cleaner && this.hasValue && !this.disabled && !this.readOnly\n );\n }\n\n get hasTooltip(): boolean {\n return !!this.hintController?.content && !this.disabled;\n }\n\n get hasCustomContent(): boolean {\n return !!this.controller.customContent;\n }\n\n get hasPlaceholder(): boolean {\n const hasDecor = this.controller.exampleText || this.prefix || this.postfix;\n const showDecor = hasDecor && !this.readOnly && this.computedFocused;\n const placeholderVisible = !this.hasValue && !showDecor;\n\n return this.placeholderRaisable || placeholderVisible;\n }\n\n get placeholderRaised(): boolean {\n return (\n this.placeholderRaisable &&\n ((this.computedFocused && !this.readOnly) || this.hasValue || this.autofilled)\n );\n }\n\n get borderLeft(): number {\n return this.iconAlignLeft ? this.iconPaddingLeft : 0;\n }\n\n get borderRight(): number {\n return getBorder(\n this.iconAlignRight,\n this.hasCleaner,\n this.hasTooltip,\n this.hasCustomContent,\n );\n }\n\n get iconAlignLeft(): boolean {\n return this.hasIcon && this.iconAlign === 'left';\n }\n\n get iconAlignRight(): boolean {\n return this.hasIcon && this.iconAlign === 'right';\n }\n\n // Safari expiration date autofill workaround\n get name(): 'ccexpiryyear' | null {\n return this.controller.autocomplete === TuiCreditCardAutofillName.CcExp\n ? 'ccexpiryyear'\n : null;\n }\n\n @tuiPure\n getIndent$(element: HTMLElement): Observable<number> {\n return fromEvent(element, 'scroll').pipe(map(() => -1 * element.scrollLeft));\n }\n\n clear() {\n if (this.nativeFocusableElement) {\n this.nativeFocusableElement.value = '';\n }\n\n this.updateValue('');\n }\n\n onMouseDown(event: MouseEvent) {\n if (\n !this.focusableElement ||\n event.target === this.focusableElement.nativeElement\n ) {\n return;\n }\n\n event.preventDefault();\n setNativeFocused(this.focusableElement.nativeElement);\n }\n\n onModelChange(value: string) {\n this.updateValue(value);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onAutofilled(autofilled: boolean) {\n this.updateAutofilled(autofilled);\n }\n\n private get iconPaddingLeft(): number {\n return this.size === 's' ? ICON_PADDING_S : ICON_PADDING;\n }\n\n private get placeholderRaisable(): boolean {\n return this.size !== 's' && !this.labelOutside;\n }\n\n private get hasIcon(): boolean {\n return !!this.iconContent;\n }\n\n private updateAutofilled(autofilled: boolean) {\n if (this.autofilled === autofilled) {\n return;\n }\n\n this.autofilled = autofilled;\n this.autofilledChange.emit(autofilled);\n }\n\n private updateValue(value: string) {\n this.value = value;\n this.valueChange.emit(value);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n ViewChild,\n} from '@angular/core';\nimport {MutationObserverDirective} from '@ng-web-apis/mutation-observer';\nimport {\n TUI_TEXTFIELD_WATCHED_CONTROLLER,\n TuiTextfieldController,\n} from '@taiga-ui/core/directives';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\nimport {defer, EMPTY} from 'rxjs';\nimport {distinctUntilChanged, map, startWith} from 'rxjs/operators';\n\nimport {TuiPrimitiveTextfieldComponent} from '../primitive-textfield.component';\n\n@Component({\n selector: 'tui-value-decoration',\n templateUrl: 'value-decoration.template.html',\n styleUrls: ['value-decoration.style.less'],\n // It follows Change Detection of PrimitiveTextfield\n changeDetection: ChangeDetectionStrategy.Default,\n})\nexport class TuiValueDecorationComponent {\n @ViewChild('pre', {read: ElementRef, static: true})\n private readonly pre?: ElementRef<HTMLElement>;\n\n @ViewChild(MutationObserverDirective, {static: true})\n private readonly directive?: MutationObserverDirective;\n\n readonly pre$ = defer(() => this.directive?.waMutationObserver ?? EMPTY).pipe(\n map(() => this.pre?.nativeElement.offsetWidth ?? 0),\n startWith(0),\n distinctUntilChanged(),\n );\n\n constructor(\n @Inject(TuiPrimitiveTextfieldComponent)\n private readonly textfield: TuiPrimitiveTextfieldComponent,\n @Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)\n private readonly controller: TuiTextfieldController,\n ) {}\n\n @HostBinding('class._table')\n get isContextTable(): boolean {\n return this.textfield.appearance === TuiAppearance.Table;\n }\n\n get value(): string {\n return this.textfield.value;\n }\n\n get filler(): string {\n return this.focused\n ? this.exampleText || this.textfield.filler.slice(this.value.length)\n : '';\n }\n\n get prefix(): string {\n return this.decorationsVisible ? this.textfield.prefix : '';\n }\n\n get postfix(): string {\n return this.decorationsVisible ? this.computedPostfix : '';\n }\n\n private get exampleText(): string {\n return !this.value && this.focused ? this.controller.exampleText : '';\n }\n\n private get decorationsVisible(): boolean {\n return !!this.value || this.focused;\n }\n\n private get focused(): boolean {\n return this.textfield.computedFocused && !this.textfield.readOnly;\n }\n\n private get computedPostfix(): string {\n return this.textfield.postfix && (this.filler || this.value)\n ? ` ${this.textfield.postfix}`\n : this.textfield.postfix;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {MutationObserverModule} from '@ng-web-apis/mutation-observer';\nimport {\n TuiAutofilledModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiPreventDefaultModule,\n} from '@taiga-ui/cdk';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiTooltipModule} from '@taiga-ui/core/components/tooltip';\nimport {TuiWrapperModule} from '@taiga-ui/core/components/wrapper';\nimport {TuiBorderModule} from '@taiga-ui/core/directives/border';\nimport {TuiDescribedByModule} from '@taiga-ui/core/directives/described-by';\nimport {TuiMaskAccessorModule} from '@taiga-ui/core/directives/mask-accessor';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiPrimitiveTextfieldComponent} from './primitive-textfield.component';\nimport {TuiValueDecorationComponent} from './value-decoration/value-decoration.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n TuiMaskAccessorModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n PolymorpheusModule,\n TuiWrapperModule,\n TuiSvgModule,\n TuiTooltipModule,\n TuiAutofilledModule,\n TuiDescribedByModule,\n TuiPreventDefaultModule,\n TuiBorderModule,\n MutationObserverModule,\n ],\n declarations: [TuiPrimitiveTextfieldComponent, TuiValueDecorationComponent],\n exports: [TuiPrimitiveTextfieldComponent],\n})\nexport class TuiPrimitiveTextfieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TuiTextfieldController","TUI_TEXTFIELD_WATCHED_CONTROLLER"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAQa,iCAAiC,GAAG;IAC7C;QACI,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,UAAU,CAAC,MAAM,8BAA8B,CAAC;KAChE;IACD,6BAA6B;IAC7B,wBAAwB;IACxB,aAAa;;;AC6BjB,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,cAAc,GAAG,GAAG,CAAC;IAYd,8BAA8B,GAA3C,MAAa,8BACT,SAAQ,sBAAsB;IA2D9B,YAC+B,KAAuC,EACvB,UAAkB,EAEpD,UAAkC,EAElC,cAA0C;QAEnD,KAAK,EAAE,CAAC;QAPmB,UAAK,GAAL,KAAK,CAAkC;QACvB,eAAU,GAAV,UAAU,CAAQ;QAEpD,eAAU,GAAV,UAAU,CAAwB;QAElC,mBAAc,GAAd,cAAc,CAA4B;QA3D/C,eAAU,GAAG,KAAK,CAAC;QAI3B,aAAQ,GAAG,IAAI,CAAC;QAIhB,WAAM,GAAG,EAAE,CAAC;QAIZ,cAAS,GAA2B,OAAO,CAAC;;QAK5C,gBAAW,GAA+B,IAAI,CAAC;QAK/C,aAAQ,GAAG,KAAK,CAAC;QAIjB,YAAO,GAAG,KAAK,CAAC;QAIhB,aAAQ,GAAG,KAAK,CAAC;QA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YACX,qBAAqB;YACrB,kBAAkB;YAClB,gBAAgB;YAChB,gBAAgB;YAChB,kBAAkB;YAClB,kBAAkB;YAClB,gBAAgB;YAChB,YAAY;YACZ,gBAAgB;YAChB,mBAAmB;YACnB,oBAAoB;YACpB,uBAAuB;YACvB,eAAe;YACf,sBAAsB;SACzB;QACD,YAAY,EAAE,CAAC,8BAA8B,EAAE,2BAA2B,CAAC;QAC3E,OAAO,EAAE,CAAC,8BAA8B,CAAC;KAC5C,CAAC;GACW,2BAA2B,CAAG;;AC7C3C;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-primitive-textfield.js","sources":["ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield.providers.ts","ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield-options.ts","ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield.component.ts","ng://@taiga-ui/core/components/primitive-textfield/value-decoration/value-decoration.component.ts","ng://@taiga-ui/core/components/primitive-textfield/primitive-textfield.module.ts","ng://@taiga-ui/core/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.ts"],"sourcesContent":["import {forwardRef} from '@angular/core';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk';\nimport {HINT_CONTROLLER_PROVIDER} from '@taiga-ui/core/directives/hint-controller';\nimport {TEXTFIELD_CONTROLLER_PROVIDER} from '@taiga-ui/core/directives/textfield-controller';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\n\nimport {TuiPrimitiveTextfieldComponent} from './primitive-textfield.component';\n\nexport const TUI_PRIMITIVE_TEXTFIELD_PROVIDERS = [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiPrimitiveTextfieldComponent),\n },\n TEXTFIELD_CONTROLLER_PROVIDER,\n HINT_CONTROLLER_PROVIDER,\n MODE_PROVIDER,\n];\n","import {InjectionToken} from '@angular/core';\nimport {TuiHorizontalDirection} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface TuiPrimitiveTextfieldOptions {\n readonly iconAlign: TuiHorizontalDirection;\n readonly iconCleaner: PolymorpheusContent;\n}\n\n// TODO: remove in ivy compilation\nexport const TUI_PRIMITIVE_TEXTFIELD_ICON_CLEANER = 'tuiIconCloseLarge';\n\n/** Default values for primitive textfield options */\nexport const TUI_PRIMITIVE_TEXTFIELD_DEFAULT_OPTIONS: TuiPrimitiveTextfieldOptions = {\n iconAlign: 'right',\n iconCleaner: TUI_PRIMITIVE_TEXTFIELD_ICON_CLEANER,\n};\n\nexport const TUI_PRIMITIVE_TEXTFIELD_OPTIONS =\n new InjectionToken<TuiPrimitiveTextfieldOptions>(\n 'Default parameters for primitive textfield component',\n {\n factory: () => TUI_PRIMITIVE_TEXTFIELD_DEFAULT_OPTIONS,\n },\n );\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n HostBinding,\n Inject,\n Input,\n Output,\n QueryList,\n ViewChild,\n} from '@angular/core';\nimport {\n AbstractTuiInteractive,\n isNativeFocused,\n setNativeFocused,\n TuiCreditCardAutofillName,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {\n TUI_HINT_WATCHED_CONTROLLER,\n TuiHintControllerDirective,\n} from '@taiga-ui/core/directives/hint-controller';\nimport {\n TUI_TEXTFIELD_WATCHED_CONTROLLER,\n TuiTextfieldController,\n} from '@taiga-ui/core/directives/textfield-controller';\nimport {TUI_MODE, TUI_TEXTFIELD_APPEARANCE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness, TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\nimport {getBorder} from '@taiga-ui/core/utils/miscellaneous';\nimport {PolymorpheusContent, PolymorpheusOutletComponent} from '@tinkoff/ng-polymorpheus';\nimport {fromEvent, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {TUI_PRIMITIVE_TEXTFIELD_PROVIDERS} from './primitive-textfield.providers';\nimport {\n TUI_PRIMITIVE_TEXTFIELD_OPTIONS,\n TuiPrimitiveTextfieldOptions,\n} from './primitive-textfield-options';\n\nconst ICON_PADDING = 1.75;\nconst ICON_PADDING_S = 1.5;\n\n@Component({\n selector: 'tui-primitive-textfield',\n templateUrl: './primitive-textfield.template.html',\n styleUrls: ['./primitive-textfield.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_PRIMITIVE_TEXTFIELD_PROVIDERS,\n host: {\n '($.data-mode.attr)': 'mode$',\n '[class._autofilled]': 'autofilled',\n },\n})\nexport class TuiPrimitiveTextfieldComponent\n extends AbstractTuiInteractive\n implements TuiFocusableElementAccessor\n{\n @ViewChild('focusableElement')\n private readonly focusableElement?: ElementRef<HTMLInputElement>;\n\n @Input()\n @tuiDefaultProp()\n editable = true;\n\n @Input()\n @tuiDefaultProp()\n filler = '';\n\n @Input()\n @tuiDefaultProp()\n iconAlign: TuiPrimitiveTextfieldOptions['iconAlign'] = this.options.iconAlign;\n\n // TODO: Remove null in 3.0\n @Input()\n @tuiDefaultProp()\n iconContent: PolymorpheusContent | null = null;\n\n @Input()\n @tuiDefaultProp()\n iconCleaner: TuiPrimitiveTextfieldOptions['iconCleaner'] = this.options.iconCleaner;\n\n @Input()\n @HostBinding('class._readonly')\n @tuiDefaultProp()\n readOnly = false;\n\n @Input()\n @tuiDefaultProp()\n invalid = false;\n\n @Input()\n @tuiDefaultProp()\n disabled = false;\n\n @Input()\n @tuiDefaultProp()\n prefix = '';\n\n @Input()\n @tuiDefaultProp()\n postfix = '';\n\n @Input()\n @tuiDefaultProp()\n value = '';\n\n @Output()\n readonly valueChange = new EventEmitter<string>();\n\n @Output()\n readonly autofilledChange = new EventEmitter<boolean>();\n\n @ContentChildren(PolymorpheusOutletComponent)\n readonly content?: QueryList<unknown>;\n\n autofilled = false;\n\n constructor(\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_TEXTFIELD_APPEARANCE) readonly appearance: string,\n @Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)\n readonly controller: TuiTextfieldController,\n @Inject(TUI_HINT_WATCHED_CONTROLLER)\n readonly hintController: TuiHintControllerDirective,\n @Inject(TUI_PRIMITIVE_TEXTFIELD_OPTIONS)\n readonly options: TuiPrimitiveTextfieldOptions,\n ) {\n super();\n }\n\n get nativeFocusableElement(): HTMLInputElement | null {\n return this.computedDisabled || !this.focusableElement\n ? null\n : this.focusableElement.nativeElement;\n }\n\n get focused(): boolean {\n return isNativeFocused(this.nativeFocusableElement);\n }\n\n @HostBinding('attr.data-tui-host-size')\n get size(): TuiSizeS | TuiSizeL {\n return this.controller.size;\n }\n\n @HostBinding('class._label-outside')\n get labelOutside(): boolean {\n return this.controller.labelOutside;\n }\n\n @HostBinding('class._invalid')\n get computedInvalid(): boolean {\n return !this.readOnly && !this.disabled && this.invalid;\n }\n\n get inputHidden(): boolean {\n return !!this.content?.length;\n }\n\n get hasValue(): boolean {\n return !!this.value;\n }\n\n get hasCleaner(): boolean {\n return (\n this.controller.cleaner && this.hasValue && !this.disabled && !this.readOnly\n );\n }\n\n get hasTooltip(): boolean {\n return !!this.hintController?.content && !this.disabled;\n }\n\n get hasCustomContent(): boolean {\n return !!this.controller.customContent;\n }\n\n get hasPlaceholder(): boolean {\n const hasDecor = this.controller.exampleText || this.prefix || this.postfix;\n const showDecor = hasDecor && !this.readOnly && this.computedFocused;\n const placeholderVisible = !this.hasValue && !showDecor;\n\n return this.placeholderRaisable || placeholderVisible;\n }\n\n get placeholderRaised(): boolean {\n return (\n this.placeholderRaisable &&\n ((this.computedFocused && !this.readOnly) || this.hasValue || this.autofilled)\n );\n }\n\n get borderLeft(): number {\n return this.iconAlignLeft ? this.iconPaddingLeft : 0;\n }\n\n get borderRight(): number {\n return getBorder(\n this.iconAlignRight,\n this.hasCleaner,\n this.hasTooltip,\n this.hasCustomContent,\n );\n }\n\n get iconAlignLeft(): boolean {\n return this.hasIcon && this.iconAlign === 'left';\n }\n\n get iconAlignRight(): boolean {\n return this.hasIcon && this.iconAlign === 'right';\n }\n\n // Safari expiration date autofill workaround\n get name(): 'ccexpiryyear' | null {\n return this.controller.autocomplete === TuiCreditCardAutofillName.CcExp\n ? 'ccexpiryyear'\n : null;\n }\n\n @tuiPure\n getIndent$(element: HTMLElement): Observable<number> {\n return fromEvent(element, 'scroll').pipe(map(() => -1 * element.scrollLeft));\n }\n\n clear() {\n if (this.nativeFocusableElement) {\n this.nativeFocusableElement.value = '';\n }\n\n this.updateValue('');\n }\n\n onMouseDown(event: MouseEvent) {\n if (\n !this.focusableElement ||\n event.target === this.focusableElement.nativeElement\n ) {\n return;\n }\n\n event.preventDefault();\n setNativeFocused(this.focusableElement.nativeElement);\n }\n\n onModelChange(value: string) {\n this.updateValue(value);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n }\n\n onAutofilled(autofilled: boolean) {\n this.updateAutofilled(autofilled);\n }\n\n private get iconPaddingLeft(): number {\n return this.size === 's' ? ICON_PADDING_S : ICON_PADDING;\n }\n\n private get placeholderRaisable(): boolean {\n return this.size !== 's' && !this.labelOutside;\n }\n\n private get hasIcon(): boolean {\n return !!this.iconContent;\n }\n\n private updateAutofilled(autofilled: boolean) {\n if (this.autofilled === autofilled) {\n return;\n }\n\n this.autofilled = autofilled;\n this.autofilledChange.emit(autofilled);\n }\n\n private updateValue(value: string) {\n this.value = value;\n this.valueChange.emit(value);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n ViewChild,\n} from '@angular/core';\nimport {MutationObserverDirective} from '@ng-web-apis/mutation-observer';\nimport {\n TUI_TEXTFIELD_WATCHED_CONTROLLER,\n TuiTextfieldController,\n} from '@taiga-ui/core/directives';\nimport {TuiAppearance} from '@taiga-ui/core/enums';\nimport {defer, EMPTY} from 'rxjs';\nimport {distinctUntilChanged, map, startWith} from 'rxjs/operators';\n\nimport {TuiPrimitiveTextfieldComponent} from '../primitive-textfield.component';\n\n@Component({\n selector: 'tui-value-decoration',\n templateUrl: 'value-decoration.template.html',\n styleUrls: ['value-decoration.style.less'],\n // It follows Change Detection of PrimitiveTextfield\n changeDetection: ChangeDetectionStrategy.Default,\n})\nexport class TuiValueDecorationComponent {\n @ViewChild('pre', {read: ElementRef, static: true})\n private readonly pre?: ElementRef<HTMLElement>;\n\n @ViewChild(MutationObserverDirective, {static: true})\n private readonly directive?: MutationObserverDirective;\n\n readonly pre$ = defer(() => this.directive?.waMutationObserver ?? EMPTY).pipe(\n map(() => this.pre?.nativeElement.offsetWidth ?? 0),\n startWith(0),\n distinctUntilChanged(),\n );\n\n constructor(\n @Inject(TuiPrimitiveTextfieldComponent)\n private readonly textfield: TuiPrimitiveTextfieldComponent,\n @Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)\n private readonly controller: TuiTextfieldController,\n ) {}\n\n @HostBinding('class._table')\n get isContextTable(): boolean {\n return this.textfield.appearance === TuiAppearance.Table;\n }\n\n get value(): string {\n return this.textfield.value;\n }\n\n get filler(): string {\n return this.focused\n ? this.exampleText || this.textfield.filler.slice(this.value.length)\n : '';\n }\n\n get prefix(): string {\n return this.decorationsVisible ? this.textfield.prefix : '';\n }\n\n get postfix(): string {\n return this.decorationsVisible ? this.computedPostfix : '';\n }\n\n private get exampleText(): string {\n return !this.value && this.focused ? this.controller.exampleText : '';\n }\n\n private get decorationsVisible(): boolean {\n return !!this.value || this.focused;\n }\n\n private get focused(): boolean {\n return this.textfield.computedFocused && !this.textfield.readOnly;\n }\n\n private get computedPostfix(): string {\n return this.textfield.postfix && (this.filler || this.value)\n ? ` ${this.textfield.postfix}`\n : this.textfield.postfix;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {MutationObserverModule} from '@ng-web-apis/mutation-observer';\nimport {\n TuiAutofilledModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiPreventDefaultModule,\n} from '@taiga-ui/cdk';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiTooltipModule} from '@taiga-ui/core/components/tooltip';\nimport {TuiWrapperModule} from '@taiga-ui/core/components/wrapper';\nimport {TuiBorderModule} from '@taiga-ui/core/directives/border';\nimport {TuiDescribedByModule} from '@taiga-ui/core/directives/described-by';\nimport {TuiMaskAccessorModule} from '@taiga-ui/core/directives/mask-accessor';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiPrimitiveTextfieldComponent} from './primitive-textfield.component';\nimport {TuiValueDecorationComponent} from './value-decoration/value-decoration.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n TuiMaskAccessorModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n PolymorpheusModule,\n TuiWrapperModule,\n TuiSvgModule,\n TuiTooltipModule,\n TuiAutofilledModule,\n TuiDescribedByModule,\n TuiPreventDefaultModule,\n TuiBorderModule,\n MutationObserverModule,\n ],\n declarations: [TuiPrimitiveTextfieldComponent, TuiValueDecorationComponent],\n exports: [TuiPrimitiveTextfieldComponent],\n})\nexport class TuiPrimitiveTextfieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TuiTextfieldController","TUI_TEXTFIELD_WATCHED_CONTROLLER"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAQa,iCAAiC,GAAG;IAC7C;QACI,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,UAAU,CAAC,MAAM,8BAA8B,CAAC;KAChE;IACD,6BAA6B;IAC7B,wBAAwB;IACxB,aAAa;;;ACNjB;MACa,oCAAoC,GAAG,oBAAoB;AAExE;MACa,uCAAuC,GAAiC;IACjF,SAAS,EAAE,OAAO;IAClB,WAAW,EAAE,oCAAoC;EACnD;MAEW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,EAAE,CAAC,8BAA8B,CAAC;KAC5C,CAAC;GACW,2BAA2B,CAAG;;AC7C3C;;;;;;"}
@@ -49,7 +49,7 @@ TuiScrollControlsComponent = __decorate([
49
49
  host: {
50
50
  '($.data-mode.attr)': 'mode$',
51
51
  },
52
- styles: [":host{position:sticky;top:0;left:0;z-index:1;min-width:calc(100% - 1px);min-height:calc(100% - 1px);float:left;margin-right:calc(-100% + 1px);-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:calc(-100% + 1px);margin-inline-end:calc(-100% + 1px);pointer-events:none}.bar{position:absolute;right:0;bottom:0;pointer-events:auto}.bar_vertical{top:0;width:.875rem}.bar_horizontal{left:0;height:.875rem}.bar_has-horizontal{bottom:.5rem}.bar_has-vertical{right:.5rem}.thumb{transition-duration:.15s;transition-timing-function:ease-in-out;position:absolute;border-radius:6.25rem;border:.25rem solid transparent;cursor:pointer;pointer-events:auto;background:var(--tui-text-01);background-clip:content-box;box-sizing:border-box;transition-property:width,height;opacity:.2}.thumb:hover{opacity:.24}.thumb:active{opacity:.48}:host[data-mode=onDark] .thumb{background-color:var(--tui-text-01-night)}.bar_vertical .thumb{right:0;width:.75rem;min-height:1.25rem}.bar_vertical .thumb:active,.bar_vertical:hover .thumb{width:.875rem}.bar_horizontal .thumb{bottom:0;height:.75rem;min-width:1.25rem}.bar_horizontal .thumb:active,.bar_horizontal:hover .thumb{height:.875rem}"]
52
+ styles: [":host{position:-webkit-sticky;position:sticky;top:0;left:0;z-index:1;min-width:calc(100% - 1px);min-height:calc(100% - 1px);float:left;margin-right:calc(-100% + 1px);-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:calc(-100% + 1px);margin-inline-end:calc(-100% + 1px);pointer-events:none}.bar{position:absolute;right:0;bottom:0;pointer-events:auto}.bar_vertical{top:0;width:.875rem}.bar_horizontal{left:0;height:.875rem}.bar_has-horizontal{bottom:.5rem}.bar_has-vertical{right:.5rem}.thumb{transition-duration:.15s;transition-timing-function:ease-in-out;position:absolute;border-radius:6.25rem;border:.25rem solid transparent;cursor:pointer;pointer-events:auto;background:var(--tui-text-01);background-clip:content-box;box-sizing:border-box;transition-property:width,height;opacity:.2}.thumb:hover{opacity:.24}.thumb:active{opacity:.48}:host[data-mode=onDark] .thumb{background-color:var(--tui-text-01-night)}.bar_vertical .thumb{right:0;width:.75rem;min-height:1.25rem}.bar_vertical .thumb:active,.bar_vertical:hover .thumb{width:.875rem}.bar_horizontal .thumb{bottom:0;height:.75rem;min-width:1.25rem}.bar_horizontal .thumb:active,.bar_horizontal:hover .thumb{height:.875rem}"]
53
53
  }),
54
54
  __param(0, Inject(TUI_ANIMATION_OPTIONS)),
55
55
  __param(1, Inject(NgZone)),
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __param } from 'tslib';
2
2
  import { Inject, Input, HostBinding, HostListener, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import { TuiDestroyService, TUI_IS_MOBILE, tuiDefaultProp } from '@taiga-ui/cdk';
4
+ import { TUI_HINT_OPTIONS } from '@taiga-ui/core/directives';
4
5
  import { MODE_PROVIDER } from '@taiga-ui/core/providers';
5
6
  import { TUI_MODE } from '@taiga-ui/core/tokens';
6
7
  import { Observable } from 'rxjs';
@@ -8,16 +9,18 @@ import { takeUntil } from 'rxjs/operators';
8
9
  import { CommonModule } from '@angular/common';
9
10
  import { TuiSvgModule } from '@taiga-ui/core/components/svg';
10
11
  import { TuiHintModule } from '@taiga-ui/core/directives/hint';
12
+ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
11
13
 
12
14
  let TuiTooltipComponent = class TuiTooltipComponent {
13
- constructor(destroy$, mode$, isMobile) {
15
+ constructor(destroy$, mode$, isMobile, options) {
14
16
  this.isMobile = isMobile;
17
+ this.options = options;
15
18
  this.globalMode = null;
16
19
  this.content = '';
17
- this.mode = null;
18
- this.direction = 'bottom-left';
19
- this.showDelay = 500;
20
- this.hideDelay = 200;
20
+ this.mode = this.options.mode;
21
+ this.direction = this.options.direction;
22
+ this.showDelay = this.options.tuiHintShowDelay;
23
+ this.hideDelay = this.options.tuiHintHideDelay;
21
24
  this.describeId = '';
22
25
  mode$.pipe(takeUntil(destroy$)).subscribe(mode => {
23
26
  this.globalMode = mode;
@@ -33,11 +36,15 @@ let TuiTooltipComponent = class TuiTooltipComponent {
33
36
  event.stopPropagation();
34
37
  }
35
38
  }
39
+ get icon() {
40
+ return this.options.tooltipIcon;
41
+ }
36
42
  };
37
43
  TuiTooltipComponent.ctorParameters = () => [
38
44
  { type: Observable, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
39
45
  { type: Observable, decorators: [{ type: Inject, args: [TUI_MODE,] }] },
40
- { type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_MOBILE,] }] }
46
+ { type: Boolean, decorators: [{ type: Inject, args: [TUI_IS_MOBILE,] }] },
47
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_HINT_OPTIONS,] }] }
41
48
  ];
42
49
  __decorate([
43
50
  Input(),
@@ -73,21 +80,22 @@ __decorate([
73
80
  TuiTooltipComponent = __decorate([
74
81
  Component({
75
82
  selector: 'tui-tooltip',
76
- template: "<tui-svg\n src=\"tuiIconTooltipLarge\"\n automation-id=\"tui-tooltip__icon\"\n class=\"icon\"\n [tuiHintId]=\"describeId\"\n [tuiHint]=\"content\"\n [tuiHintDirection]=\"direction\"\n [tuiHintShowDelay]=\"showDelay\"\n [tuiHintHideDelay]=\"hideDelay\"\n [tuiHintMode]=\"computedMode\"\n></tui-svg>\n",
83
+ template: "<span\n polymorpheus-outlet\n automation-id=\"tui-tooltip__icon\"\n class=\"icon\"\n [content]=\"icon\"\n [tuiHintId]=\"describeId\"\n [tuiHint]=\"content\"\n [tuiHintDirection]=\"direction\"\n [tuiHintShowDelay]=\"showDelay\"\n [tuiHintHideDelay]=\"hideDelay\"\n [tuiHintMode]=\"computedMode\"\n>\n <ng-template let-icon>\n <tui-svg [src]=\"icon\"></tui-svg>\n </ng-template>\n</span>\n",
77
84
  changeDetection: ChangeDetectionStrategy.OnPush,
78
85
  providers: [TuiDestroyService, MODE_PROVIDER],
79
86
  styles: [":host{transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:relative;display:inline-block;width:1.5rem;height:1.5rem;vertical-align:middle;font-size:0;line-height:0;cursor:pointer;color:var(--tui-text-03)}:host:hover{color:var(--tui-text-02)}:host[data-mode=onDark]{color:var(--tui-text-01-night)}:host[data-mode=onLight]{color:var(--tui-text-01)}:host[data-mode=error]{color:var(--tui-error-fill)}.icon{transition-property:opacity,color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;width:100%;height:100%}:host:not([data-mode]) .icon._hint_hovered{color:var(--tui-text-02)}:host[data-mode=onDark] .icon,:host[data-mode=onLight] .icon{opacity:var(--tui-disabled-opacity)}:host[data-mode=onDark] .icon._hint_hovered,:host[data-mode=onDark] .icon:hover,:host[data-mode=onLight] .icon._hint_hovered,:host[data-mode=onLight] .icon:hover{opacity:1}"]
80
87
  }),
81
88
  __param(0, Inject(TuiDestroyService)),
82
89
  __param(1, Inject(TUI_MODE)),
83
- __param(2, Inject(TUI_IS_MOBILE))
90
+ __param(2, Inject(TUI_IS_MOBILE)),
91
+ __param(3, Inject(TUI_HINT_OPTIONS))
84
92
  ], TuiTooltipComponent);
85
93
 
86
94
  let TuiTooltipModule = class TuiTooltipModule {
87
95
  };
88
96
  TuiTooltipModule = __decorate([
89
97
  NgModule({
90
- imports: [CommonModule, TuiSvgModule, TuiHintModule],
98
+ imports: [CommonModule, TuiSvgModule, TuiHintModule, PolymorpheusModule],
91
99
  declarations: [TuiTooltipComponent],
92
100
  exports: [TuiTooltipComponent],
93
101
  })
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-components-tooltip.js","sources":["ng://@taiga-ui/core/components/tooltip/tooltip.component.ts","ng://@taiga-ui/core/components/tooltip/tooltip.module.ts","ng://@taiga-ui/core/components/tooltip/taiga-ui-core-components-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {TUI_IS_MOBILE, tuiDefaultProp, TuiDestroyService} from '@taiga-ui/cdk';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness, TuiDirection, TuiHintModeT} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n selector: 'tui-tooltip',\n templateUrl: './tooltip.template.html',\n styleUrls: ['./tooltip.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService, MODE_PROVIDER],\n})\nexport class TuiTooltipComponent {\n private globalMode: TuiBrightness | null = null;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n mode: TuiHintModeT | null = null;\n\n @Input()\n @tuiDefaultProp()\n direction: TuiDirection = 'bottom-left';\n\n @Input()\n @tuiDefaultProp()\n showDelay = 500;\n\n @Input()\n @tuiDefaultProp()\n hideDelay = 200;\n\n @Input()\n @tuiDefaultProp()\n describeId = '';\n\n constructor(\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(TUI_MODE) mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,\n ) {\n mode$.pipe(takeUntil(destroy$)).subscribe(mode => {\n this.globalMode = mode;\n });\n }\n\n // TODO: Simplify\n @HostBinding('attr.data-mode')\n get computedMode(): TuiHintModeT | TuiBrightness | null {\n return this.mode || this.globalMode;\n }\n\n @HostListener('mousedown', ['$event'])\n @HostListener('click', ['$event'])\n stopOnMobile(event: MouseEvent) {\n if (this.isMobile) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiHintModule} from '@taiga-ui/core/directives/hint';\n\nimport {TuiTooltipComponent} from './tooltip.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, TuiHintModule],\n declarations: [TuiTooltipComponent],\n exports: [TuiTooltipComponent],\n})\nexport class TuiTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;IAuBa,mBAAmB,GAAhC,MAAa,mBAAmB;IA2B5B,YAC+B,QAA6B,EACtC,KAAuC,EACjB,QAAiB;QAAjB,aAAQ,GAAR,QAAQ,CAAS;QA7BrD,eAAU,GAAyB,IAAI,CAAC;QAIhD,YAAO,GAAwB,EAAE,CAAC;QAIlC,SAAI,GAAwB,IAAI,CAAC;QAIjC,cAAS,GAAiB,aAAa,CAAC;QAIxC,cAAS,GAAG,GAAG,CAAC;QAIhB,cAAS,GAAG,GAAG,CAAC;QAIhB,eAAU,GAAG,EAAE,CAAC;QAOZ,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI;YAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SAC1B,CAAC,CAAC;KACN;;IAID,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC;KACvC;IAID,YAAY,CAAC,KAAiB;QAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,eAAe,EAAE,CAAC;SAC3B;KACJ;EACJ;;YAvB4C,UAAU,uBAA9C,MAAM,SAAC,iBAAiB;YACA,UAAU,uBAAlC,MAAM,SAAC,QAAQ;0CACf,MAAM,SAAC,aAAa;;AAzBzB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;oDACiB;AAIlC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;iDACgB;AAIjC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACuB;AAIxC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACD;AAIhB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACD;AAIhB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;uDACD;AAchB;IADC,WAAW,CAAC,gBAAgB,CAAC;uDAG7B;AAID;IAFC,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC;IACrC,YAAY,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;uDAMjC;AAlDQ,mBAAmB;IAP/B,SAAS,CAAC;QACP,QAAQ,EAAE,aAAa;QACvB,kVAAsC;QAEtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE,CAAC,iBAAiB,EAAE,aAAa,CAAC;;KAChD,CAAC;IA6BO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChB,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;GA9BjB,mBAAmB,CAmD/B;;IC9DY,gBAAgB,GAA7B,MAAa,gBAAgB;EAAG;AAAnB,gBAAgB;IAL5B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC;QACpD,YAAY,EAAE,CAAC,mBAAmB,CAAC;QACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;KACjC,CAAC;GACW,gBAAgB,CAAG;;ACZhC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-components-tooltip.js","sources":["ng://@taiga-ui/core/components/tooltip/tooltip.component.ts","ng://@taiga-ui/core/components/tooltip/tooltip.module.ts","ng://@taiga-ui/core/components/tooltip/taiga-ui-core-components-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\nimport {TUI_IS_MOBILE, tuiDefaultProp, TuiDestroyService} from '@taiga-ui/cdk';\nimport {TUI_HINT_OPTIONS, TuiHintOptions} from '@taiga-ui/core/directives';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness, TuiHintModeT} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n@Component({\n selector: 'tui-tooltip',\n templateUrl: './tooltip.template.html',\n styleUrls: ['./tooltip.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService, MODE_PROVIDER],\n})\nexport class TuiTooltipComponent {\n private globalMode: TuiBrightness | null = null;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n @Input()\n @tuiDefaultProp()\n mode: TuiHintOptions['mode'] = this.options.mode;\n\n @Input()\n @tuiDefaultProp()\n direction: TuiHintOptions['direction'] = this.options.direction;\n\n @Input()\n @tuiDefaultProp()\n showDelay: TuiHintOptions['tuiHintShowDelay'] = this.options.tuiHintShowDelay;\n\n @Input()\n @tuiDefaultProp()\n hideDelay: TuiHintOptions['tuiHintHideDelay'] = this.options.tuiHintHideDelay;\n\n @Input()\n @tuiDefaultProp()\n describeId = '';\n\n constructor(\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(TUI_MODE) mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,\n @Inject(TUI_HINT_OPTIONS) private readonly options: TuiHintOptions,\n ) {\n mode$.pipe(takeUntil(destroy$)).subscribe(mode => {\n this.globalMode = mode;\n });\n }\n\n // TODO: Simplify\n @HostBinding('attr.data-mode')\n get computedMode(): TuiHintModeT | TuiBrightness | null {\n return this.mode || this.globalMode;\n }\n\n @HostListener('mousedown', ['$event'])\n @HostListener('click', ['$event'])\n stopOnMobile(event: MouseEvent) {\n if (this.isMobile) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n get icon(): PolymorpheusContent {\n return this.options.tooltipIcon;\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core/components/svg';\nimport {TuiHintModule} from '@taiga-ui/core/directives/hint';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiTooltipComponent} from './tooltip.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule, TuiHintModule, PolymorpheusModule],\n declarations: [TuiTooltipComponent],\n exports: [TuiTooltipComponent],\n})\nexport class TuiTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;IAwBa,mBAAmB,GAAhC,MAAa,mBAAmB;IA2B5B,YAC+B,QAA6B,EACtC,KAAuC,EACjB,QAAiB,EACd,OAAuB;QAD1B,aAAQ,GAAR,QAAQ,CAAS;QACd,YAAO,GAAP,OAAO,CAAgB;QA9B9D,eAAU,GAAyB,IAAI,CAAC;QAIhD,YAAO,GAAwB,EAAE,CAAC;QAIlC,SAAI,GAA2B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAIjD,cAAS,GAAgC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QAIhE,cAAS,GAAuC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAI9E,cAAS,GAAuC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAI9E,eAAU,GAAG,EAAE,CAAC;QAQZ,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI;YAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SAC1B,CAAC,CAAC;KACN;;IAID,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC;KACvC;IAID,YAAY,CAAC,KAAiB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AAnB,gBAAgB;IAL5B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,CAAC;QACxE,YAAY,EAAE,CAAC,mBAAmB,CAAC;QACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;KACjC,CAAC;GACW,gBAAgB,CAAG;;ACbhC;;;;;;"}
@@ -63,7 +63,7 @@ const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]$/;
63
63
  const TUI_LATIN_REGEXP = /[A-z]/;
64
64
  const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;
65
65
 
66
- const VERSION = '2.31.0';
66
+ const VERSION = '2.32.0';
67
67
 
68
68
  /**
69
69
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-constants.js","sources":["ng://@taiga-ui/core/constants/absolute-box-sizes.ts","ng://@taiga-ui/core/constants/decimal-symbols.ts","ng://@taiga-ui/core/constants/default-icons-path.ts","ng://@taiga-ui/core/constants/default-marker-handler.ts","ng://@taiga-ui/core/constants/editing-keys.ts","ng://@taiga-ui/core/constants/events.ts","ng://@taiga-ui/core/constants/mask-caret-trap.ts","ng://@taiga-ui/core/constants/media.ts","ng://@taiga-ui/core/constants/regexp.ts","ng://@taiga-ui/core/constants/version.ts","ng://@taiga-ui/core/constants/taiga-ui-core-constants.ts"],"sourcesContent":["export const DEFAULT_MARGIN = 4;\nexport const DEFAULT_MIN_HEIGHT = 80;\nexport const DEFAULT_MAX_HEIGHT = 400;\nexport const DEFAULT_MAX_WIDTH = 600;\n","export const TUI_DECIMAL_SYMBOLS: ReadonlyArray<string> = [',', '.'];\n","import {TuiStringHandler} from '@taiga-ui/cdk';\n\nexport const DEFAULT_ICONS_PATH: TuiStringHandler<string> = name =>\n name.includes('.svg#') ? name : `#${name}`;\n","import {EMPTY_ARRAY} from '@taiga-ui/cdk';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\nexport const TUI_DEFAULT_MARKER_HANDLER: TuiMarkerHandler = () => EMPTY_ARRAY;\n","export const tuiEditingKeys: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n","/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * An event for scrolling an element into view within {@link TuiScrollbarComponent}.\n */\nexport const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';\n\n/**\n * An event to notify {@link TuiScrollbarComponent} that\n * it should control a nested element.\n */\nexport const TUI_SCROLLABLE = 'tui-scrollable';\n\n/**\n * An event indicating and error during icon loading in {@link TuiSvgComponent}.\n */\nexport const TUI_ICON_ERROR = 'tui-icon-error';\n","export const MASK_CARET_TRAP = '[]';\n","/**\n * Media constants are exact the same as css media breakpoints\n * @deprecated use TUI_MEDIA token\n */\nexport const MEDIA = {\n mobile: 320,\n tablet: 600,\n desktopSmall: 1024,\n desktopLarge: 1280,\n};\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\nexport const TUI_LEADING_ZEROES_REGEXP = /^0+/;\nexport const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\\\/#!$%\\\\^&\\\\*;:{}=\\\\-_`~()]$/;\nexport const TUI_LATIN_REGEXP = /[A-z]/;\nexport const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;\n","export const VERSION = '2.31.0';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAAa,cAAc,GAAG,EAAE;MACnB,kBAAkB,GAAG,GAAG;MACxB,kBAAkB,GAAG,IAAI;MACzB,iBAAiB,GAAG;;MCHpB,mBAAmB,GAA0B,CAAC,GAAG,EAAE,GAAG;;MCEtD,kBAAkB,GAA6B,IAAI,IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI;;MCA/B,0BAA0B,GAAqB,MAAM;;MCHrD,cAAc,GAAsB;IAC7C,UAAU;IACV,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;ACTV;;;;MAIa,iBAAiB,GAAG,oBAAoB;AAErD;;;MAGa,oBAAoB,GAAG,uBAAuB;AAE3D;;;;MAIa,cAAc,GAAG,iBAAiB;AAE/C;;;MAGa,cAAc,GAAG;;MCpBjB,eAAe,GAAG;;ACA/B;;;;MAIa,KAAK,GAAG;IACjB,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;;;MCRT,gBAAgB,GAAG,KAAK;MACxB,oBAAoB,GAAG,KAAK;MAC5B,qBAAqB,GAAG,OAAO;MAC/B,yBAAyB,GAAG,MAAM;MAClC,gCAAgC,GAAG,mCAAmC;MACtE,gBAAgB,GAAG,QAAQ;MAC3B,4BAA4B,GAAG;;MCN/B,OAAO,GAAG;;ACAvB;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-constants.js","sources":["ng://@taiga-ui/core/constants/absolute-box-sizes.ts","ng://@taiga-ui/core/constants/decimal-symbols.ts","ng://@taiga-ui/core/constants/default-icons-path.ts","ng://@taiga-ui/core/constants/default-marker-handler.ts","ng://@taiga-ui/core/constants/editing-keys.ts","ng://@taiga-ui/core/constants/events.ts","ng://@taiga-ui/core/constants/mask-caret-trap.ts","ng://@taiga-ui/core/constants/media.ts","ng://@taiga-ui/core/constants/regexp.ts","ng://@taiga-ui/core/constants/version.ts","ng://@taiga-ui/core/constants/taiga-ui-core-constants.ts"],"sourcesContent":["export const DEFAULT_MARGIN = 4;\nexport const DEFAULT_MIN_HEIGHT = 80;\nexport const DEFAULT_MAX_HEIGHT = 400;\nexport const DEFAULT_MAX_WIDTH = 600;\n","export const TUI_DECIMAL_SYMBOLS: ReadonlyArray<string> = [',', '.'];\n","import {TuiStringHandler} from '@taiga-ui/cdk';\n\nexport const DEFAULT_ICONS_PATH: TuiStringHandler<string> = name =>\n name.includes('.svg#') ? name : `#${name}`;\n","import {EMPTY_ARRAY} from '@taiga-ui/cdk';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\nexport const TUI_DEFAULT_MARKER_HANDLER: TuiMarkerHandler = () => EMPTY_ARRAY;\n","export const tuiEditingKeys: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n","/**\n * An event indicating that async data for expand has finished loading.\n * Dispatch to finish loading states for {@link TuiExpandComponent}.\n */\nexport const TUI_EXPAND_LOADED = 'tui-expand-loaded';\n\n/**\n * An event for scrolling an element into view within {@link TuiScrollbarComponent}.\n */\nexport const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';\n\n/**\n * An event to notify {@link TuiScrollbarComponent} that\n * it should control a nested element.\n */\nexport const TUI_SCROLLABLE = 'tui-scrollable';\n\n/**\n * An event indicating and error during icon loading in {@link TuiSvgComponent}.\n */\nexport const TUI_ICON_ERROR = 'tui-icon-error';\n","export const MASK_CARET_TRAP = '[]';\n","/**\n * Media constants are exact the same as css media breakpoints\n * @deprecated use TUI_MEDIA token\n */\nexport const MEDIA = {\n mobile: 320,\n tablet: 600,\n desktopSmall: 1024,\n desktopLarge: 1280,\n};\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\nexport const TUI_LEADING_ZEROES_REGEXP = /^0+/;\nexport const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\\\/#!$%\\\\^&\\\\*;:{}=\\\\-_`~()]$/;\nexport const TUI_LATIN_REGEXP = /[A-z]/;\nexport const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;\n","export const VERSION = '2.32.0';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAAa,cAAc,GAAG,EAAE;MACnB,kBAAkB,GAAG,GAAG;MACxB,kBAAkB,GAAG,IAAI;MACzB,iBAAiB,GAAG;;MCHpB,mBAAmB,GAA0B,CAAC,GAAG,EAAE,GAAG;;MCEtD,kBAAkB,GAA6B,IAAI,IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI;;MCA/B,0BAA0B,GAAqB,MAAM;;MCHrD,cAAc,GAAsB;IAC7C,UAAU;IACV,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;ACTV;;;;MAIa,iBAAiB,GAAG,oBAAoB;AAErD;;;MAGa,oBAAoB,GAAG,uBAAuB;AAE3D;;;;MAIa,cAAc,GAAG,iBAAiB;AAE/C;;;MAGa,cAAc,GAAG;;MCpBjB,eAAe,GAAG;;ACA/B;;;;MAIa,KAAK,GAAG;IACjB,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;;;MCRT,gBAAgB,GAAG,KAAK;MACxB,oBAAoB,GAAG,KAAK;MAC5B,qBAAqB,GAAG,OAAO;MAC/B,yBAAyB,GAAG,MAAM;MAClC,gCAAgC,GAAG,mCAAmC;MACtE,gBAAgB,GAAG,QAAQ;MAC3B,4BAA4B,GAAG;;MCN/B,OAAO,GAAG;;ACAvB;;;;;;"}
@@ -1,25 +1,30 @@
1
- import { __decorate } from 'tslib';
2
- import { InjectionToken, Input, Directive, forwardRef, NgModule, ChangeDetectorRef } from '@angular/core';
1
+ import { __decorate, __param } from 'tslib';
2
+ import { InjectionToken, inject, Inject, Input, Directive, forwardRef, NgModule, ChangeDetectorRef } from '@angular/core';
3
3
  import { TuiController, tuiDefaultProp, TuiDestroyService } from '@taiga-ui/cdk';
4
+ import { TUI_HINT_OPTIONS } from '@taiga-ui/core/directives/hint';
4
5
  import { watchedControllerFactory } from '@taiga-ui/core/providers';
5
6
 
6
7
  const TUI_HINT_CONTROLLER = new InjectionToken('Controls configuration of hints', {
7
- factory: () => new TuiHintControllerDirective(),
8
+ factory: () => new TuiHintControllerDirective(inject(TUI_HINT_OPTIONS)),
8
9
  });
9
10
 
10
11
  var TuiHintControllerDirective_1;
11
12
  // TODO: v2.0 use in Charts
12
13
  let TuiHintControllerDirective = TuiHintControllerDirective_1 = class TuiHintControllerDirective extends TuiController {
13
- constructor() {
14
- super(...arguments);
14
+ constructor(options) {
15
+ super();
16
+ this.options = options;
15
17
  // TODO: Remove null in 3.0
16
18
  this.content = null;
17
- this.direction = 'bottom-left';
18
- this.mode = null;
19
- this.showDelay = 500;
20
- this.hideDelay = 200;
19
+ this.direction = this.options.direction;
20
+ this.mode = this.options.mode;
21
+ this.showDelay = this.options.tuiHintShowDelay;
22
+ this.hideDelay = this.options.tuiHintHideDelay;
21
23
  }
22
24
  };
25
+ TuiHintControllerDirective.ctorParameters = () => [
26
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_HINT_OPTIONS,] }] }
27
+ ];
23
28
  __decorate([
24
29
  Input('tuiHintContent'),
25
30
  tuiDefaultProp()
@@ -49,7 +54,8 @@ TuiHintControllerDirective = TuiHintControllerDirective_1 = __decorate([
49
54
  useExisting: forwardRef(() => TuiHintControllerDirective_1),
50
55
  },
51
56
  ],
52
- })
57
+ }),
58
+ __param(0, Inject(TUI_HINT_OPTIONS))
53
59
  ], TuiHintControllerDirective);
54
60
 
55
61
  let TuiHintControllerModule = class TuiHintControllerModule {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-directives-hint-controller.js","sources":["ng://@taiga-ui/core/directives/hint-controller/hint-controller.token.ts","ng://@taiga-ui/core/directives/hint-controller/hint-controller.directive.ts","ng://@taiga-ui/core/directives/hint-controller/hint-controller.module.ts","ng://@taiga-ui/core/directives/hint-controller/hint-controller.provider.ts","ng://@taiga-ui/core/directives/hint-controller/taiga-ui-core-directives-hint-controller.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {TuiHintControllerDirective} from './hint-controller.directive';\n\nexport const TUI_HINT_CONTROLLER = new InjectionToken<TuiHintControllerDirective>(\n 'Controls configuration of hints',\n {\n factory: () => new TuiHintControllerDirective(),\n },\n);\n","import {Directive, forwardRef, Input} from '@angular/core';\nimport {TuiController, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiDirection, TuiHintModeT} from '@taiga-ui/core/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TUI_HINT_CONTROLLER} from './hint-controller.token';\n\n// TODO: v2.0 use in Charts\n@Directive({\n selector: '[tuiHintContent]',\n providers: [\n {\n provide: TUI_HINT_CONTROLLER,\n useExisting: forwardRef(() => TuiHintControllerDirective),\n },\n ],\n})\nexport class TuiHintControllerDirective extends TuiController {\n // TODO: Remove null in 3.0\n @Input('tuiHintContent')\n @tuiDefaultProp()\n content: PolymorpheusContent | null = null;\n\n @Input('tuiHintDirection')\n @tuiDefaultProp()\n direction: TuiDirection = 'bottom-left';\n\n @Input('tuiHintMode')\n @tuiDefaultProp()\n mode: TuiHintModeT | null = null;\n\n @Input('tuiHintShowDelay')\n @tuiDefaultProp()\n showDelay = 500;\n\n @Input('tuiHintHideDelay')\n @tuiDefaultProp()\n hideDelay = 200;\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHintControllerDirective} from './hint-controller.directive';\n\n@NgModule({\n declarations: [TuiHintControllerDirective],\n exports: [TuiHintControllerDirective],\n})\nexport class TuiHintControllerModule {}\n","import {ChangeDetectorRef, InjectionToken, Provider} from '@angular/core';\nimport {TuiDestroyService} from '@taiga-ui/cdk';\nimport {watchedControllerFactory} from '@taiga-ui/core/providers';\n\nimport {TUI_HINT_CONTROLLER} from './hint-controller.token';\n\nexport const TUI_HINT_WATCHED_CONTROLLER = new InjectionToken('watched hint controller');\n// TODO: remove in ivy compilation\nexport const HINT_CONTROLLER_FACTORY = watchedControllerFactory;\nexport const HINT_CONTROLLER_PROVIDER: Provider = [\n TuiDestroyService,\n {\n provide: TUI_HINT_WATCHED_CONTROLLER,\n deps: [TUI_HINT_CONTROLLER, ChangeDetectorRef, TuiDestroyService],\n useFactory: HINT_CONTROLLER_FACTORY,\n },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAIa,mBAAmB,GAAG,IAAI,cAAc,CACjD,iCAAiC,EACjC;IACI,OAAO,EAAE,MAAM,IAAI,0BAA0B,EAAE;CAClD;;;ACDL;IAUa,0BAA0B,kCAAvC,MAAa,0BAA2B,SAAQ,aAAa;IAA7D;;;QAII,YAAO,GAA+B,IAAI,CAAC;QAI3C,cAAS,GAAiB,aAAa,CAAC;QAIxC,SAAI,GAAwB,IAAI,CAAC;QAIjC,cAAS,GAAG,GAAG,CAAC;QAIhB,cAAS,GAAG,GAAG,CAAC;KACnB;EAAA;AAjBG;IAFC,KAAK,CAAC,gBAAgB,CAAC;IACvB,cAAc,EAAE;2DAC0B;AAI3C;IAFC,KAAK,CAAC,kBAAkB,CAAC;IACzB,cAAc,EAAE;6DACuB;AAIxC;IAFC,KAAK,CAAC,aAAa,CAAC;IACpB,cAAc,EAAE;wDACgB;AAIjC;IAFC,KAAK,CAAC,kBAAkB,CAAC;IACzB,cAAc,EAAE;6DACD;AAIhB;IAFC,KAAK,CAAC,kBAAkB,CAAC;IACzB,cAAc,EAAE;6DACD;AApBP,0BAA0B;IATtC,SAAS,CAAC;QACP,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,mBAAmB;gBAC5B,WAAW,EAAE,UAAU,CAAC,MAAM,4BAA0B,CAAC;aAC5D;SACJ;KACJ,CAAC;GACW,0BAA0B,CAqBtC;;IC9BY,uBAAuB,GAApC,MAAa,uBAAuB;EAAG;AAA1B,uBAAuB;IAJnC,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,0BAA0B,CAAC;QAC1C,OAAO,EAAE,CAAC,0BAA0B,CAAC;KACxC,CAAC;GACW,uBAAuB,CAAG;;MCF1B,2BAA2B,GAAG,IAAI,cAAc,CAAC,yBAAyB,EAAE;AACzF;MACa,uBAAuB,GAAG,yBAAyB;MACnD,wBAAwB,GAAa;IAC9C,iBAAiB;IACjB;QACI,OAAO,EAAE,2BAA2B;QACpC,IAAI,EAAE,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;QACjE,UAAU,EAAE,uBAAuB;KACtC;;;ACfL;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-directives-hint-controller.js","sources":["ng://@taiga-ui/core/directives/hint-controller/hint-controller.token.ts","ng://@taiga-ui/core/directives/hint-controller/hint-controller.directive.ts","ng://@taiga-ui/core/directives/hint-controller/hint-controller.module.ts","ng://@taiga-ui/core/directives/hint-controller/hint-controller.provider.ts","ng://@taiga-ui/core/directives/hint-controller/taiga-ui-core-directives-hint-controller.ts"],"sourcesContent":["import {inject, InjectionToken} from '@angular/core';\nimport {TUI_HINT_OPTIONS} from '@taiga-ui/core/directives/hint';\n\nimport {TuiHintControllerDirective} from './hint-controller.directive';\n\nexport const TUI_HINT_CONTROLLER = new InjectionToken<TuiHintControllerDirective>(\n 'Controls configuration of hints',\n {\n factory: () => new TuiHintControllerDirective(inject(TUI_HINT_OPTIONS)),\n },\n);\n","import {Directive, forwardRef, Inject, Input} from '@angular/core';\nimport {TuiController, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TUI_HINT_OPTIONS, TuiHintOptions} from '@taiga-ui/core/directives/hint';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TUI_HINT_CONTROLLER} from './hint-controller.token';\n\n// TODO: v2.0 use in Charts\n@Directive({\n selector: '[tuiHintContent]',\n providers: [\n {\n provide: TUI_HINT_CONTROLLER,\n useExisting: forwardRef(() => TuiHintControllerDirective),\n },\n ],\n})\nexport class TuiHintControllerDirective extends TuiController {\n // TODO: Remove null in 3.0\n @Input('tuiHintContent')\n @tuiDefaultProp()\n content: PolymorpheusContent | null = null;\n\n @Input('tuiHintDirection')\n @tuiDefaultProp()\n direction: TuiHintOptions['direction'] = this.options.direction;\n\n @Input('tuiHintMode')\n @tuiDefaultProp()\n mode: TuiHintOptions['mode'] = this.options.mode;\n\n @Input('tuiHintShowDelay')\n @tuiDefaultProp()\n showDelay: TuiHintOptions['tuiHintShowDelay'] = this.options.tuiHintShowDelay;\n\n @Input('tuiHintHideDelay')\n @tuiDefaultProp()\n hideDelay: TuiHintOptions['tuiHintHideDelay'] = this.options.tuiHintHideDelay;\n\n constructor(@Inject(TUI_HINT_OPTIONS) private readonly options: TuiHintOptions) {\n super();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHintControllerDirective} from './hint-controller.directive';\n\n@NgModule({\n declarations: [TuiHintControllerDirective],\n exports: [TuiHintControllerDirective],\n})\nexport class TuiHintControllerModule {}\n","import {ChangeDetectorRef, InjectionToken, Provider} from '@angular/core';\nimport {TuiDestroyService} from '@taiga-ui/cdk';\nimport {watchedControllerFactory} from '@taiga-ui/core/providers';\n\nimport {TUI_HINT_CONTROLLER} from './hint-controller.token';\n\nexport const TUI_HINT_WATCHED_CONTROLLER = new InjectionToken('watched hint controller');\n// TODO: remove in ivy compilation\nexport const HINT_CONTROLLER_FACTORY = watchedControllerFactory;\nexport const HINT_CONTROLLER_PROVIDER: Provider = [\n TuiDestroyService,\n {\n provide: TUI_HINT_WATCHED_CONTROLLER,\n deps: [TUI_HINT_CONTROLLER, ChangeDetectorRef, TuiDestroyService],\n useFactory: HINT_CONTROLLER_FACTORY,\n },\n];\n","/**\n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;;IClCY,uBAAuB,GAApC,MAAa,uBAAuB;EAAG;AAA1B,uBAAuB;IAJnC,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,0BAA0B,CAAC;QAC1C,OAAO,EAAE,CAAC,0BAA0B,CAAC;KACxC,CAAC;GACW,uBAAuB,CAAG;;MCF1B,2BAA2B,GAAG,IAAI,cAAc,CAAC,yBAAyB,EAAE;AACzF;MACa,uBAAuB,GAAG,yBAAyB;MACnD,wBAAwB,GAAa;IAC9C,iBAAiB;IACjB;QACI,OAAO,EAAE,2BAA2B;QACpC,IAAI,EAAE,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;QACjE,UAAU,EAAE,uBAAuB;KACtC;;;ACfL;;;;;;"}
@@ -1,19 +1,28 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { Renderer2, Inject, ElementRef, Self, Optional, Input, Directive, NgModule } from '@angular/core';
2
+ import { InjectionToken, Renderer2, Inject, ElementRef, Self, Optional, Input, Directive, NgModule } from '@angular/core';
3
3
  import { TuiDestroyService, TuiObscuredService, TuiHoveredService, TuiActiveZoneDirective, tuiDefaultProp, tuiRequiredSetter, TuiParentsScrollService } from '@taiga-ui/cdk';
4
- import { AbstractTuiHint } from '@taiga-ui/core/abstract';
4
+ import { TUI_ABSTRACT_HINT_DEFAULT_OPTIONS, AbstractTuiHint } from '@taiga-ui/core/abstract';
5
5
  import { DESCRIBED_BY } from '@taiga-ui/core/directives/described-by';
6
6
  import { TuiHintService } from '@taiga-ui/core/services';
7
7
  import { Subject, combineLatest, of } from 'rxjs';
8
8
  import { startWith, map, switchMap, delay, take, distinctUntilChanged, takeUntil } from 'rxjs/operators';
9
9
 
10
+ // TODO: remove in ivy compilation
11
+ const TUI_TOOLTIP_ICON = 'tuiIconTooltipLarge';
12
+ /** Default values for hint options */
13
+ const TUI_HINT_DEFAULT_OPTIONS = Object.assign(Object.assign({}, TUI_ABSTRACT_HINT_DEFAULT_OPTIONS), { tuiHintShowDelay: 500, tuiHintHideDelay: 200, tooltipIcon: TUI_TOOLTIP_ICON });
14
+ const TUI_HINT_OPTIONS = new InjectionToken('Default parameters for hint directive', {
15
+ factory: () => TUI_HINT_DEFAULT_OPTIONS,
16
+ });
17
+
10
18
  const HINT_HOVERED_CLASS = '_hint_hovered';
11
19
  let TuiHintDirective = class TuiHintDirective extends AbstractTuiHint {
12
- constructor(renderer, elementRef, hintService, destroy$, obscured$, hoveredService, activeZone) {
13
- super(elementRef, hintService, activeZone);
20
+ constructor(renderer, elementRef, hintService, destroy$, obscured$, hoveredService, activeZone, options) {
21
+ super(elementRef, hintService, activeZone, options);
14
22
  this.renderer = renderer;
15
- this.tuiHintShowDelay = 500;
16
- this.tuiHintHideDelay = 200;
23
+ this.options = options;
24
+ this.tuiHintShowDelay = this.options.tuiHintShowDelay;
25
+ this.tuiHintHideDelay = this.options.tuiHintHideDelay;
17
26
  this.tuiHintHost = null;
18
27
  this.componentHovered$ = new Subject();
19
28
  // @bad TODO: Use private provider
@@ -82,7 +91,8 @@ TuiHintDirective.ctorParameters = () => [
82
91
  { type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
83
92
  { type: TuiObscuredService, decorators: [{ type: Inject, args: [TuiObscuredService,] }, { type: Self }] },
84
93
  { type: TuiHoveredService, decorators: [{ type: Inject, args: [TuiHoveredService,] }] },
85
- { type: TuiActiveZoneDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiActiveZoneDirective,] }] }
94
+ { type: TuiActiveZoneDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiActiveZoneDirective,] }] },
95
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_HINT_OPTIONS,] }] }
86
96
  ];
87
97
  __decorate([
88
98
  Input()
@@ -116,7 +126,8 @@ TuiHintDirective = __decorate([
116
126
  __param(4, Self()),
117
127
  __param(5, Inject(TuiHoveredService)),
118
128
  __param(6, Optional()),
119
- __param(6, Inject(TuiActiveZoneDirective))
129
+ __param(6, Inject(TuiActiveZoneDirective)),
130
+ __param(7, Inject(TUI_HINT_OPTIONS))
120
131
  ], TuiHintDirective);
121
132
 
122
133
  let TuiHintModule = class TuiHintModule {
@@ -132,5 +143,5 @@ TuiHintModule = __decorate([
132
143
  * Generated bundle index. Do not edit.
133
144
  */
134
145
 
135
- export { HINT_HOVERED_CLASS, TuiHintDirective, TuiHintModule };
146
+ export { HINT_HOVERED_CLASS, TUI_HINT_DEFAULT_OPTIONS, TUI_HINT_OPTIONS, TUI_TOOLTIP_ICON, TuiHintDirective, TuiHintModule };
136
147
  //# sourceMappingURL=taiga-ui-core-directives-hint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-directives-hint.js","sources":["ng://@taiga-ui/core/directives/hint/hint.directive.ts","ng://@taiga-ui/core/directives/hint/hint.module.ts","ng://@taiga-ui/core/directives/hint/taiga-ui-core-directives-hint.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {\n TuiActiveZoneDirective,\n tuiDefaultProp,\n TuiDestroyService,\n TuiHoveredService,\n TuiObscuredService,\n TuiParentsScrollService,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {DESCRIBED_BY} from '@taiga-ui/core/directives/described-by';\nimport {TuiHintService} from '@taiga-ui/core/services';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {combineLatest, of, Subject} from 'rxjs';\nimport {\n delay,\n distinctUntilChanged,\n map,\n startWith,\n switchMap,\n take,\n takeUntil,\n} from 'rxjs/operators';\n\nexport const HINT_HOVERED_CLASS = '_hint_hovered';\n\n@Directive({\n selector: '[tuiHint]:not(ng-container)',\n providers: [TuiObscuredService, TuiParentsScrollService, TuiDestroyService],\n})\nexport class TuiHintDirective extends AbstractTuiHint implements OnDestroy {\n @Input()\n tuiHintId?: string;\n\n @Input()\n @tuiDefaultProp()\n tuiHintShowDelay = 500;\n\n @Input()\n @tuiDefaultProp()\n tuiHintHideDelay = 200;\n\n @Input()\n @tuiDefaultProp()\n tuiHintHost: HTMLElement | null = null;\n\n // TODO: Remove null in 3.0\n @Input()\n @tuiRequiredSetter()\n set tuiHint(value: PolymorpheusContent | null) {\n if (!value) {\n this.hideTooltip();\n this.content = '';\n\n return;\n }\n\n this.content = value;\n }\n\n readonly componentHovered$ = new Subject<boolean>();\n\n constructor(\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(TuiHintService) hintService: TuiHintService,\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(TuiObscuredService)\n @Self()\n obscured$: TuiObscuredService,\n @Inject(TuiHoveredService) hoveredService: TuiHoveredService,\n @Optional()\n @Inject(TuiActiveZoneDirective)\n activeZone: TuiActiveZoneDirective | null,\n ) {\n super(elementRef, hintService, activeZone);\n\n // @bad TODO: Use private provider\n combineLatest(\n hoveredService.createHovered$(elementRef.nativeElement),\n this.componentHovered$.pipe(startWith(false)),\n )\n .pipe(\n map(\n ([directiveHovered, componentHovered]) =>\n directiveHovered || componentHovered,\n ),\n switchMap(visible => {\n this.toggleClass(visible);\n\n return of(visible).pipe(\n delay(visible ? this.tuiHintShowDelay : this.tuiHintHideDelay),\n );\n }),\n switchMap(visible =>\n visible && this.mode !== 'overflow'\n ? obscured$.pipe(\n map(obscured => !obscured),\n take(2),\n )\n : of(visible),\n ),\n distinctUntilChanged(),\n takeUntil(destroy$),\n )\n .subscribe(visible => {\n if (visible) {\n this.showTooltip();\n } else {\n this.hideTooltip();\n }\n });\n\n this.hintService.register(this);\n }\n\n get id(): string | null {\n return this.tuiHintId ? this.tuiHintId + DESCRIBED_BY : null;\n }\n\n get host(): HTMLElement {\n return this.tuiHintHost ? this.tuiHintHost : this.elementRef.nativeElement;\n }\n\n getElementClientRect(): ClientRect {\n return this.host.getBoundingClientRect();\n }\n\n ngOnDestroy() {\n this.hintService.unregister(this);\n }\n\n protected showTooltip() {\n if (this.content === '') {\n return;\n }\n\n this.toggleClass(true);\n this.hintService.add(this);\n }\n\n protected hideTooltip() {\n this.toggleClass(false);\n this.hintService.remove(this);\n }\n\n private toggleClass(add: boolean) {\n if (add) {\n this.renderer.addClass(this.elementRef.nativeElement, HINT_HOVERED_CLASS);\n } else {\n this.renderer.removeClass(this.elementRef.nativeElement, HINT_HOVERED_CLASS);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHintDirective} from './hint.directive';\n\n@NgModule({\n declarations: [TuiHintDirective],\n exports: [TuiHintDirective],\n})\nexport class TuiHintModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAkCa,kBAAkB,GAAG,gBAAgB;IAMrC,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,eAAe;IAgCjD,YACwC,QAAmB,EACnC,UAAmC,EAC/B,WAA2B,EAEnD,QAA2B,EAG3B,SAA6B,EACF,cAAiC,EAG5D,UAAyC;QAEzC,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAbP,aAAQ,GAAR,QAAQ,CAAW;QA3B3D,qBAAgB,GAAG,GAAG,CAAC;QAIvB,qBAAgB,GAAG,GAAG,CAAC;QAIvB,gBAAW,GAAuB,IAAI,CAAC;QAgB9B,sBAAiB,GAAG,IAAI,OAAO,EAAW,CAAC;;QAmBhD,aAAa,CACT,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,EACvD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAChD;aACI,IAAI,CACD,GAAG,CACC,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,KACjC,gBAAgB,IAAI,gBAAgB,CAC3C,EACD,SAAS,CAAC,OAAO;YACb,IAAI,CAAC,WAAW,CAAC,OAA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EAAE,CAAC,kBAAkB,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;KAC9E,CAAC;IAkCO,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IACjB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAI,EAAE,CAAA;IAEN,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;GA3C1B,gBAAgB,CA4H5B;;IC5JY,aAAa,GAA1B,MAAa,aAAa;EAAG;AAAhB,aAAa;IAJzB,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,gBAAgB,CAAC;QAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;KAC9B,CAAC;GACW,aAAa,CAAG;;ACR7B;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-directives-hint.js","sources":["ng://@taiga-ui/core/directives/hint/hint-options.ts","ng://@taiga-ui/core/directives/hint/hint.directive.ts","ng://@taiga-ui/core/directives/hint/hint.module.ts","ng://@taiga-ui/core/directives/hint/taiga-ui-core-directives-hint.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\nimport {\n TUI_ABSTRACT_HINT_DEFAULT_OPTIONS,\n TuiAbstractHintOptions,\n} from '@taiga-ui/core/abstract';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nexport interface TuiHintOptions extends TuiAbstractHintOptions {\n readonly tuiHintShowDelay: number;\n readonly tuiHintHideDelay: number;\n readonly tooltipIcon: PolymorpheusContent;\n}\n\n// TODO: remove in ivy compilation\nexport const TUI_TOOLTIP_ICON = 'tuiIconTooltipLarge';\n\n/** Default values for hint options */\nexport const TUI_HINT_DEFAULT_OPTIONS: TuiHintOptions = {\n ...TUI_ABSTRACT_HINT_DEFAULT_OPTIONS,\n tuiHintShowDelay: 500,\n tuiHintHideDelay: 200,\n tooltipIcon: TUI_TOOLTIP_ICON,\n};\n\nexport const TUI_HINT_OPTIONS = new InjectionToken<TuiHintOptions>(\n 'Default parameters for hint directive',\n {\n factory: () => TUI_HINT_DEFAULT_OPTIONS,\n },\n);\n","import {\n Directive,\n ElementRef,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {\n TuiActiveZoneDirective,\n tuiDefaultProp,\n TuiDestroyService,\n TuiHoveredService,\n TuiObscuredService,\n TuiParentsScrollService,\n tuiRequiredSetter,\n} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {DESCRIBED_BY} from '@taiga-ui/core/directives/described-by';\nimport {TuiHintService} from '@taiga-ui/core/services';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {combineLatest, of, Subject} from 'rxjs';\nimport {\n delay,\n distinctUntilChanged,\n map,\n startWith,\n switchMap,\n take,\n takeUntil,\n} from 'rxjs/operators';\n\nimport {TUI_HINT_OPTIONS, TuiHintOptions} from './hint-options';\n\nexport const HINT_HOVERED_CLASS = '_hint_hovered';\n\n@Directive({\n selector: '[tuiHint]:not(ng-container)',\n providers: [TuiObscuredService, TuiParentsScrollService, TuiDestroyService],\n})\nexport class TuiHintDirective extends AbstractTuiHint implements OnDestroy {\n @Input()\n tuiHintId?: string;\n\n @Input()\n @tuiDefaultProp()\n tuiHintShowDelay: TuiHintOptions['tuiHintShowDelay'] = this.options.tuiHintShowDelay;\n\n @Input()\n @tuiDefaultProp()\n tuiHintHideDelay: TuiHintOptions['tuiHintHideDelay'] = this.options.tuiHintHideDelay;\n\n @Input()\n @tuiDefaultProp()\n tuiHintHost: HTMLElement | null = null;\n\n // TODO: Remove null in 3.0\n @Input()\n @tuiRequiredSetter()\n set tuiHint(value: PolymorpheusContent | null) {\n if (!value) {\n this.hideTooltip();\n this.content = '';\n\n return;\n }\n\n this.content = value;\n }\n\n readonly componentHovered$ = new Subject<boolean>();\n\n constructor(\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(TuiHintService) hintService: TuiHintService,\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(TuiObscuredService)\n @Self()\n obscured$: TuiObscuredService,\n @Inject(TuiHoveredService) hoveredService: TuiHoveredService,\n @Optional()\n @Inject(TuiActiveZoneDirective)\n activeZone: TuiActiveZoneDirective | null,\n @Inject(TUI_HINT_OPTIONS) protected readonly options: TuiHintOptions,\n ) {\n super(elementRef, hintService, activeZone, options);\n\n // @bad TODO: Use private provider\n combineLatest(\n hoveredService.createHovered$(elementRef.nativeElement),\n this.componentHovered$.pipe(startWith(false)),\n )\n .pipe(\n map(\n ([directiveHovered, componentHovered]) =>\n directiveHovered || componentHovered,\n ),\n switchMap(visible => {\n this.toggleClass(visible);\n\n return of(visible).pipe(\n delay(visible ? this.tuiHintShowDelay : this.tuiHintHideDelay),\n );\n }),\n switchMap(visible =>\n visible && this.mode !== 'overflow'\n ? obscured$.pipe(\n map(obscured => !obscured),\n take(2),\n )\n : of(visible),\n ),\n distinctUntilChanged(),\n takeUntil(destroy$),\n )\n .subscribe(visible => {\n if (visible) {\n this.showTooltip();\n } else {\n this.hideTooltip();\n }\n });\n\n this.hintService.register(this);\n }\n\n get id(): string | null {\n return this.tuiHintId ? this.tuiHintId + DESCRIBED_BY : null;\n }\n\n get host(): HTMLElement {\n return this.tuiHintHost ? this.tuiHintHost : this.elementRef.nativeElement;\n }\n\n getElementClientRect(): ClientRect {\n return this.host.getBoundingClientRect();\n }\n\n ngOnDestroy() {\n this.hintService.unregister(this);\n }\n\n protected showTooltip() {\n if (this.content === '') {\n return;\n }\n\n this.toggleClass(true);\n this.hintService.add(this);\n }\n\n protected hideTooltip() {\n this.toggleClass(false);\n this.hintService.remove(this);\n }\n\n private toggleClass(add: boolean) {\n if (add) {\n this.renderer.addClass(this.elementRef.nativeElement, HINT_HOVERED_CLASS);\n } else {\n this.renderer.removeClass(this.elementRef.nativeElement, HINT_HOVERED_CLASS);\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiHintDirective} from './hint.directive';\n\n@NgModule({\n declarations: [TuiHintDirective],\n exports: [TuiHintDirective],\n})\nexport class TuiHintModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAaA;MACa,gBAAgB,GAAG,sBAAsB;AAEtD;MACa,wBAAwB,mCAC9B,iCAAiC,KACpC,gBAAgB,EAAE,GAAG,EACrB,gBAAgB,EAAE,GAAG,EACrB,WAAW,EAAE,gBAAgB,IAC/B;MAEW,gBAAgB,GAAG,IAAI,cAAc,CAC9C,uCAAuC,EACvC;IACI,OAAO,EAAE,MAAM,wBAAwB;CAC1C;;MCQQ,kBAAkB,GAAG,gBAAgB;IAMrC,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,eAAe;IAgCjD,YACwC,QAAmB,EACnC,UAAmC,EAC/B,WAA2B,EAEnD,QAA2B,EAG3B,SAA6B,EACF,cAAiC,EAG5D,UAAyC,EACI,OAAuB;QAEpE,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAdhB,aAAQ,GAAR,QAAQ,CAAW;QAYV,YAAO,GAAP,OAAO,CAAgB;QAvCxE,qBAAgB,GAAuC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAIrF,qBAAgB,GAAuC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAIrF,gBAAW,GAAuB,IAAI,CAAC;QAgB9B,sBAAiB,GAAG,IAAI,OAAO,EAAW,CAAC;;QAoBhD,aAAa,CACT,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,EACvD,IAAI,CAAC,iBAAi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,cAAc,EAAE;0DACoE;AAIrF;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;0DACoE;AAIrF;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;qDACsB;AAKvC;IAFC,KAAK,EAAE;IACP,iBAAiB,EAAE;+CAUnB;AA5BQ,gBAAgB;IAJ5B,SAAS,CAAC;QACP,QAAQ,EAAE,6BAA6B;QACvC,SAAS,EAAE,CAAC,kBAAkB,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;KAC9E,CAAC;IAkCO,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IACjB,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAI,EAAE,CAAA;IAEN,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;IAE9B,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;GA7CpB,gBAAgB,CA6H5B;;IC/JY,aAAa,GAA1B,MAAa,aAAa;EAAG;AAAhB,aAAa;IAJzB,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,gBAAgB,CAAC;QAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;KAC9B,CAAC;GACW,aAAa,CAAG;;ACR7B;;;;;;"}
@@ -1,12 +1,19 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { ElementRef, Inject, Optional, Input, Directive, NgModule } from '@angular/core';
2
+ import { InjectionToken, ElementRef, Inject, Optional, Input, Directive, NgModule } from '@angular/core';
3
3
  import { TuiActiveZoneDirective, tuiDefaultProp, tuiRequiredSetter } from '@taiga-ui/cdk';
4
- import { AbstractTuiHint } from '@taiga-ui/core/abstract';
4
+ import { TUI_ABSTRACT_HINT_DEFAULT_OPTIONS, AbstractTuiHint } from '@taiga-ui/core/abstract';
5
5
  import { TuiHintService } from '@taiga-ui/core/services';
6
6
 
7
+ /** Default values for manual hint options */
8
+ const TUI_MANUAL_HINT_DEFAULT_OPTIONS = Object.assign({}, TUI_ABSTRACT_HINT_DEFAULT_OPTIONS);
9
+ const TUI_MANUAL_HINT_OPTIONS = new InjectionToken('Default parameters for manual hint directive', {
10
+ factory: () => TUI_MANUAL_HINT_DEFAULT_OPTIONS,
11
+ });
12
+
7
13
  let TuiManualHintDirective = class TuiManualHintDirective extends AbstractTuiHint {
8
- constructor(elementRef, hintService, activeZone) {
9
- super(elementRef, hintService, activeZone);
14
+ constructor(elementRef, hintService, activeZone, options) {
15
+ super(elementRef, hintService, activeZone, options);
16
+ this.options = options;
10
17
  this.content = '';
11
18
  }
12
19
  set tuiManualHintShow(show) {
@@ -24,7 +31,8 @@ let TuiManualHintDirective = class TuiManualHintDirective extends AbstractTuiHin
24
31
  TuiManualHintDirective.ctorParameters = () => [
25
32
  { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
26
33
  { type: TuiHintService, decorators: [{ type: Inject, args: [TuiHintService,] }] },
27
- { type: TuiActiveZoneDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiActiveZoneDirective,] }] }
34
+ { type: TuiActiveZoneDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiActiveZoneDirective,] }] },
35
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_MANUAL_HINT_OPTIONS,] }] }
28
36
  ];
29
37
  __decorate([
30
38
  Input('tuiManualHint'),
@@ -41,7 +49,8 @@ TuiManualHintDirective = __decorate([
41
49
  __param(0, Inject(ElementRef)),
42
50
  __param(1, Inject(TuiHintService)),
43
51
  __param(2, Optional()),
44
- __param(2, Inject(TuiActiveZoneDirective))
52
+ __param(2, Inject(TuiActiveZoneDirective)),
53
+ __param(3, Inject(TUI_MANUAL_HINT_OPTIONS))
45
54
  ], TuiManualHintDirective);
46
55
 
47
56
  let TuiManualHintModule = class TuiManualHintModule {
@@ -57,5 +66,5 @@ TuiManualHintModule = __decorate([
57
66
  * Generated bundle index. Do not edit.
58
67
  */
59
68
 
60
- export { TuiManualHintDirective, TuiManualHintModule };
69
+ export { TUI_MANUAL_HINT_DEFAULT_OPTIONS, TUI_MANUAL_HINT_OPTIONS, TuiManualHintDirective, TuiManualHintModule };
61
70
  //# sourceMappingURL=taiga-ui-core-directives-manual-hint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-directives-manual-hint.js","sources":["ng://@taiga-ui/core/directives/manual-hint/manual-hint.directive.ts","ng://@taiga-ui/core/directives/manual-hint/manual-hint.module.ts","ng://@taiga-ui/core/directives/manual-hint/taiga-ui-core-directives-manual-hint.ts"],"sourcesContent":["import {Directive, ElementRef, Inject, Input, Optional} from '@angular/core';\nimport {TuiActiveZoneDirective, tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {TuiHintService} from '@taiga-ui/core/services';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\n@Directive({\n selector: '[tuiManualHint]:not(ng-container)',\n})\nexport class TuiManualHintDirective extends AbstractTuiHint {\n @Input('tuiManualHint')\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n @Input()\n @tuiRequiredSetter()\n set tuiManualHintShow(show: boolean) {\n if (show) {\n this.showTooltip();\n } else {\n this.hideTooltip();\n }\n }\n\n constructor(\n @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(TuiHintService) hintService: TuiHintService,\n @Optional()\n @Inject(TuiActiveZoneDirective)\n activeZone: TuiActiveZoneDirective | null,\n ) {\n super(elementRef, hintService, activeZone);\n }\n\n getElementClientRect(): ClientRect {\n return this.elementRef.nativeElement.getBoundingClientRect();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiManualHintDirective} from './manual-hint.directive';\n\n@NgModule({\n declarations: [TuiManualHintDirective],\n exports: [TuiManualHintDirective],\n})\nexport class TuiManualHintModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;IASa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,eAAe;IAevD,YACwB,UAAmC,EAC/B,WAA2B,EAGnD,UAAyC;QAEzC,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAnB/C,YAAO,GAAwB,EAAE,CAAC;KAoBjC;IAhBD,IAAI,iBAAiB,CAAC,IAAa;QAC/B,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,WAAW,EAAE,CAAC;SACtB;aAAM;YACH,IAAI,CAAC,WAAW,EAAE,CAAC;SACtB;KACJ;IAYD,oBAAoB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;KAChE;EACJ;;YAZuC,UAAU,uBAAzC,MAAM,SAAC,UAAU;YACmB,cAAc,uBAAlD,MAAM,SAAC,cAAc;YAGV,sBAAsB,uBAFjC,QAAQ,YACR,MAAM,SAAC,sBAAsB;;AAhBlC;IAFC,KAAK,CAAC,eAAe,CAAC;IACtB,cAAc,EAAE;uDACiB;AAIlC;IAFC,KAAK,EAAE;IACP,iBAAiB,EAAE;+DAOnB;AAbQ,sBAAsB;IAHlC,SAAS,CAAC;QACP,QAAQ,EAAE,mCAAmC;KAChD,CAAC;IAiBO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;GAnB1B,sBAAsB,CA4BlC;;IC7BY,mBAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IAJ/B,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,sBAAsB,CAAC;QACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;KACpC,CAAC;GACW,mBAAmB,CAAG;;ACRnC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-directives-manual-hint.js","sources":["ng://@taiga-ui/core/directives/manual-hint/manual-hint-options.ts","ng://@taiga-ui/core/directives/manual-hint/manual-hint.directive.ts","ng://@taiga-ui/core/directives/manual-hint/manual-hint.module.ts","ng://@taiga-ui/core/directives/manual-hint/taiga-ui-core-directives-manual-hint.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\nimport {\n TUI_ABSTRACT_HINT_DEFAULT_OPTIONS,\n TuiAbstractHintOptions,\n} from '@taiga-ui/core/abstract';\n\nexport type TuiManualHintOptions = TuiAbstractHintOptions;\n\n/** Default values for manual hint options */\nexport const TUI_MANUAL_HINT_DEFAULT_OPTIONS: TuiManualHintOptions = {\n ...TUI_ABSTRACT_HINT_DEFAULT_OPTIONS,\n};\n\nexport const TUI_MANUAL_HINT_OPTIONS = new InjectionToken<TuiManualHintOptions>(\n 'Default parameters for manual hint directive',\n {\n factory: () => TUI_MANUAL_HINT_DEFAULT_OPTIONS,\n },\n);\n","import {Directive, ElementRef, Inject, Input, Optional} from '@angular/core';\nimport {TuiActiveZoneDirective, tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk';\nimport {AbstractTuiHint} from '@taiga-ui/core/abstract';\nimport {TuiHintService} from '@taiga-ui/core/services';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TUI_MANUAL_HINT_OPTIONS, TuiManualHintOptions} from './manual-hint-options';\n\n@Directive({\n selector: '[tuiManualHint]:not(ng-container)',\n})\nexport class TuiManualHintDirective extends AbstractTuiHint {\n @Input('tuiManualHint')\n @tuiDefaultProp()\n content: PolymorpheusContent = '';\n\n @Input()\n @tuiRequiredSetter()\n set tuiManualHintShow(show: boolean) {\n if (show) {\n this.showTooltip();\n } else {\n this.hideTooltip();\n }\n }\n\n constructor(\n @Inject(ElementRef) elementRef: ElementRef<HTMLElement>,\n @Inject(TuiHintService) hintService: TuiHintService,\n @Optional()\n @Inject(TuiActiveZoneDirective)\n activeZone: TuiActiveZoneDirective | null,\n @Inject(TUI_MANUAL_HINT_OPTIONS) protected readonly options: TuiManualHintOptions,\n ) {\n super(elementRef, hintService, activeZone, options);\n }\n\n getElementClientRect(): ClientRect {\n return this.elementRef.nativeElement.getBoundingClientRect();\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiManualHintDirective} from './manual-hint.directive';\n\n@NgModule({\n declarations: [TuiManualHintDirective],\n exports: [TuiManualHintDirective],\n})\nexport class TuiManualHintModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAQA;MACa,+BAA+B,qBACrC,iCAAiC,EACtC;MAEW,uBAAuB,GAAG,IAAI,cAAc,CACrD,8CAA8C,EAC9C;IACI,OAAO,EAAE,MAAM,+BAA+B;CACjD;;ICNQ,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,eAAe;IAevD,YACwB,UAAmC,EAC/B,WAA2B,EAGnD,UAAyC,EACW,OAA6B;QAEjF,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAFA,YAAO,GAAP,OAAO,CAAsB;QAlBrF,YAAO,GAAwB,EAAE,CAAC;KAqBjC;IAjBD,IAAI,iBAAiB,CAAC,IAAa;QAC/B,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,WAAW,EAAE,CAAC;SACtB;aAAM;YACH,IAAI,CAAC,WAAW,EAAE,CAAC;SACtB;KACJ;IAaD,oBAAoB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;KAChE;EACJ;;YAbuC,UAAU,uBAAzC,MAAM,SAAC,UAAU;YACmB,cAAc,uBAAlD,MAAM,SAAC,cAAc;YAGV,sBAAsB,uBAFjC,QAAQ,YACR,MAAM,SAAC,sBAAsB;4CAE7B,MAAM,SAAC,uBAAuB;;AAlBnC;IAFC,KAAK,CAAC,eAAe,CAAC;IACtB,cAAc,EAAE;uDACiB;AAIlC;IAFC,KAAK,EAAE;IACP,iBAAiB,EAAE;+DAOnB;AAbQ,sBAAsB;IAHlC,SAAS,CAAC;QACP,QAAQ,EAAE,mCAAmC;KAChD,CAAC;IAiBO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,sBAAsB,CAAC,CAAA;IAE9B,WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;GArB3B,sBAAsB,CA6BlC;;IChCY,mBAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IAJ/B,QAAQ,CAAC;QACN,YAAY,EAAE,CAAC,sBAAsB,CAAC;QACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;KACpC,CAAC;GACW,mBAAmB,CAAG;;ACRnC;;;;;;"}
@@ -1,18 +1,25 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { ElementRef, Inject, Input, Directive, NgModule } from '@angular/core';
2
+ import { InjectionToken, ElementRef, Inject, Input, Directive, NgModule } from '@angular/core';
3
3
  import { typedFromEvent, TuiDestroyService, TuiHoveredService, tuiDefaultProp, tuiRequiredSetter } from '@taiga-ui/cdk';
4
- import { AbstractTuiHint } from '@taiga-ui/core/abstract';
4
+ import { TUI_ABSTRACT_HINT_DEFAULT_OPTIONS, AbstractTuiHint } from '@taiga-ui/core/abstract';
5
5
  import { TuiHintService } from '@taiga-ui/core/services';
6
6
  import { of } from 'rxjs';
7
7
  import { filter, startWith, distinctUntilChanged, switchMap, delay, takeUntil } from 'rxjs/operators';
8
8
 
9
+ /** Default values for pointer hint options */
10
+ const TUI_POINTER_HINT_DEFAULT_OPTIONS = Object.assign(Object.assign({}, TUI_ABSTRACT_HINT_DEFAULT_OPTIONS), { tuiHintShowDelay: 0, tuiHintHideDelay: 0 });
11
+ const TUI_POINTER_HINT_OPTIONS = new InjectionToken('Default parameters for pointer hint directive', {
12
+ factory: () => TUI_POINTER_HINT_DEFAULT_OPTIONS,
13
+ });
14
+
9
15
  let TuiPointerHintDirective = class TuiPointerHintDirective extends AbstractTuiHint {
10
- constructor(elementRef, hintService, destroy$, hoveredService) {
11
- super(elementRef, hintService, null);
16
+ constructor(elementRef, hintService, destroy$, hoveredService, options) {
17
+ super(elementRef, hintService, null, options);
12
18
  this.destroy$ = destroy$;
19
+ this.options = options;
13
20
  this.currentMouseRect = this.mousePositionToClientRect();
14
- this.tuiHintShowDelay = 0;
15
- this.tuiHintHideDelay = 0;
21
+ this.tuiHintShowDelay = this.options.tuiHintShowDelay;
22
+ this.tuiHintHideDelay = this.options.tuiHintHideDelay;
16
23
  this.content = '';
17
24
  const hint$ = hoveredService.createHovered$(this.elementRef.nativeElement).pipe(filter(() => !!this.content), startWith(false), distinctUntilChanged());
18
25
  hint$
@@ -65,7 +72,8 @@ TuiPointerHintDirective.ctorParameters = () => [
65
72
  { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
66
73
  { type: TuiHintService, decorators: [{ type: Inject, args: [TuiHintService,] }] },
67
74
  { type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
68
- { type: TuiHoveredService, decorators: [{ type: Inject, args: [TuiHoveredService,] }] }
75
+ { type: TuiHoveredService, decorators: [{ type: Inject, args: [TuiHoveredService,] }] },
76
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_POINTER_HINT_OPTIONS,] }] }
69
77
  ];
70
78
  __decorate([
71
79
  Input(),
@@ -87,7 +95,8 @@ TuiPointerHintDirective = __decorate([
87
95
  __param(0, Inject(ElementRef)),
88
96
  __param(1, Inject(TuiHintService)),
89
97
  __param(2, Inject(TuiDestroyService)),
90
- __param(3, Inject(TuiHoveredService))
98
+ __param(3, Inject(TuiHoveredService)),
99
+ __param(4, Inject(TUI_POINTER_HINT_OPTIONS))
91
100
  ], TuiPointerHintDirective);
92
101
 
93
102
  let TuiPointerHintModule = class TuiPointerHintModule {
@@ -103,5 +112,5 @@ TuiPointerHintModule = __decorate([
103
112
  * Generated bundle index. Do not edit.
104
113
  */
105
114
 
106
- export { TuiPointerHintDirective, TuiPointerHintModule };
115
+ export { TUI_POINTER_HINT_DEFAULT_OPTIONS, TUI_POINTER_HINT_OPTIONS, TuiPointerHintDirective, TuiPointerHintModule };
107
116
  //# sourceMappingURL=taiga-ui-core-directives-pointer-hint.js.map