diff --git a/package.json b/package.json index 1e1b8b1d6ba9..9ee10b818a8a 100644 --- a/package.json +++ b/package.json @@ -85,8 +85,7 @@ "i18n/no-russian-character": "off", "i18n/no-thai-character": "off", "jest/prefer-importing-jest-globals": "off", - "sonarjs/prefer-nullish-coalescing": "off", - "@angular-eslint/template/elements-content": "off" + "sonarjs/prefer-nullish-coalescing": "off" }, "overrides": [ { diff --git a/projects/core/components/textfield/textfield.component.ts b/projects/core/components/textfield/textfield.component.ts index 6c8bf06b0eed..d72428928aae 100644 --- a/projects/core/components/textfield/textfield.component.ts +++ b/projects/core/components/textfield/textfield.component.ts @@ -13,6 +13,7 @@ import { ViewContainerRef, ViewEncapsulation, } from '@angular/core'; +import {toSignal} from '@angular/core/rxjs-interop'; import {NgControl} from '@angular/forms'; import {WaResizeObserver} from '@ng-web-apis/resize-observer'; import {tuiInjectId} from '@taiga-ui/cdk/services'; @@ -31,7 +32,7 @@ import { TuiWithDropdownOpen, } from '@taiga-ui/core/directives/dropdown'; import {TuiWithIcons} from '@taiga-ui/core/directives/icons'; -import {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens'; +import {TUI_CLEAR_WORD, TUI_COMMON_ICONS} from '@taiga-ui/core/tokens'; import type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types'; import type {PolymorpheusContent} from '@taiga-ui/polymorpheus'; import {PolymorpheusOutlet} from '@taiga-ui/polymorpheus'; @@ -81,6 +82,7 @@ export class TuiTextfieldComponent implements TuiDataListHost { protected readonly control?: NgControl; protected readonly icons = inject(TUI_COMMON_ICONS); + protected readonly clear = toSignal(inject(TUI_CLEAR_WORD)); protected computedFiller = computed(() => { const value = this.directive?.nativeValue() || ''; diff --git a/projects/core/components/textfield/textfield.template.html b/projects/core/components/textfield/textfield.template.html index aba2f6b964ca..32ddda880a7a 100644 --- a/projects/core/components/textfield/textfield.template.html +++ b/projects/core/components/textfield/textfield.template.html @@ -18,7 +18,9 @@ [iconStart]="icons.close" (click)="directive?.setValue(null)" (pointerdown.silent.prevent)="input?.nativeElement?.focus()" - > + > + {{ clear() }} + diff --git a/projects/core/tokens/i18n.ts b/projects/core/tokens/i18n.ts index df553ddf237f..f5f61cf6789a 100644 --- a/projects/core/tokens/i18n.ts +++ b/projects/core/tokens/i18n.ts @@ -11,6 +11,11 @@ export const TUI_MONTHS = tuiCreateTokenFromFactory(tuiExtractI18n('months')); */ export const TUI_CLOSE_WORD = tuiCreateTokenFromFactory(tuiExtractI18n('close')); +/** + * i18n 'clear' word + */ +export const TUI_CLEAR_WORD = tuiCreateTokenFromFactory(tuiExtractI18n('clear')); + /** * i18n 'Nothing found' message */ diff --git a/projects/demo/src/modules/components/app-bar/examples/1/index.html b/projects/demo/src/modules/components/app-bar/examples/1/index.html index 45a62a964c05..8deb7091b498 100644 --- a/projects/demo/src/modules/components/app-bar/examples/1/index.html +++ b/projects/demo/src/modules/components/app-bar/examples/1/index.html @@ -37,6 +37,7 @@

iOS

+ > + Previous +

Carousel is awesome

@@ -66,7 +68,9 @@

Buttons

type="button" class="tui-space_left-4" (click)="navigate(1)" - > + > + Next +
+> + Open + Multi select control [tuiDropdown]="content" [tuiDropdownMaxHeight]="500" [(tuiDropdownOpen)]="control" -> +> + Open + Separate toggles [tuiDropdown]="separate" [tuiDropdownMaxHeight]="500" [(tuiDropdownOpen)]="label" -> +> + Open + {{ hint }} diff --git a/projects/demo/src/modules/components/slider/examples/6/index.html b/projects/demo/src/modules/components/slider/examples/6/index.html index dc815b948999..9ca6ca1fd93d 100644 --- a/projects/demo/src/modules/components/slider/examples/6/index.html +++ b/projects/demo/src/modules/components/slider/examples/6/index.html @@ -7,7 +7,9 @@ type="button" class="minus" (click)="change(-0.25)" - > + > + Minus +