>();
+ constructor(@Inject(TUI_TABLE_SHOW_HIDE_MESSAGE) readonly showHideText: string) {}
+
isEnabled(item: T): boolean {
return this.enabled.indexOf(item) !== -1;
}
diff --git a/projects/addon-table/components/reorder/reorder.template.html b/projects/addon-table/components/reorder/reorder.template.html
index 129f3e1befe8..19bcba54d43d 100644
--- a/projects/addon-table/components/reorder/reorder.template.html
+++ b/projects/addon-table/components/reorder/reorder.template.html
@@ -2,14 +2,13 @@
{{item}}
-
diff --git a/projects/addon-table/components/table-pagination/table-pagination.component.ts b/projects/addon-table/components/table-pagination/table-pagination.component.ts
index 0b99bb1f35cc..52313b8b4b10 100644
--- a/projects/addon-table/components/table-pagination/table-pagination.component.ts
+++ b/projects/addon-table/components/table-pagination/table-pagination.component.ts
@@ -1,6 +1,9 @@
-import {Component, EventEmitter, Input, Output} from '@angular/core';
+import {Component, EventEmitter, Inject, Input, Output} from '@angular/core';
+import {TUI_TABLE_PAGINATION_TEXTS} from '@taiga-ui/addon-table/tokens';
import {tuiDefaultProp} from '@taiga-ui/cdk';
+import {TUI_SPIN_TEXTS} from '@taiga-ui/core';
+// @dynamic
@Component({
selector: 'tui-table-pagination',
templateUrl: './table-pagination.template.html',
@@ -31,6 +34,12 @@ export class TuiTablePaginationComponent {
open = false;
+ constructor(
+ @Inject(TUI_SPIN_TEXTS) readonly spinTexts: [string, string],
+ @Inject(TUI_TABLE_PAGINATION_TEXTS)
+ readonly texts: Record<'pages' | 'linesPerPage' | 'of', string>,
+ ) {}
+
get pages(): number {
return Math.ceil(this.total / this.size);
}
diff --git a/projects/addon-table/components/table-pagination/table-pagination.template.html b/projects/addon-table/components/table-pagination/table-pagination.template.html
index 60e0b1b869ca..9556bdce37b9 100644
--- a/projects/addon-table/components/table-pagination/table-pagination.template.html
+++ b/projects/addon-table/components/table-pagination/table-pagination.template.html
@@ -1,7 +1,8 @@
-
-Страниц: {{pages}}
+{{texts.pages}} {{pages}}
- Строк на страницу
+ {{texts.linesPerPage}}
- из {{total}}
+ {{texts.of}} {{total}}
-
diff --git a/projects/addon-table/index.ts b/projects/addon-table/index.ts
index d255ad2c24e2..04360124fcda 100644
--- a/projects/addon-table/index.ts
+++ b/projects/addon-table/index.ts
@@ -1 +1,2 @@
export * from '@taiga-ui/addon-table/components';
+export * from '@taiga-ui/addon-table/tokens';
diff --git a/projects/addon-table/tokens/i18n.ts b/projects/addon-table/tokens/i18n.ts
new file mode 100644
index 000000000000..b52db802f069
--- /dev/null
+++ b/projects/addon-table/tokens/i18n.ts
@@ -0,0 +1,18 @@
+import {InjectionToken} from '@angular/core';
+
+export const TUI_TABLE_SHOW_HIDE_MESSAGE = new InjectionToken(
+ `tui-reorder i18n button`,
+ {
+ factory: () => 'Show/hide',
+ },
+);
+
+export const TUI_TABLE_PAGINATION_TEXTS = new InjectionToken<
+ Record<'pages' | 'linesPerPage' | 'of', string>
+>('tui-table-pagination i18n texts', {
+ factory: () => ({
+ pages: 'Pages',
+ linesPerPage: 'Lines per page',
+ of: 'of',
+ }),
+});
diff --git a/projects/addon-table/tokens/index.ts b/projects/addon-table/tokens/index.ts
new file mode 100644
index 000000000000..e82230f1bf13
--- /dev/null
+++ b/projects/addon-table/tokens/index.ts
@@ -0,0 +1 @@
+export * from './i18n';
diff --git a/projects/addon-table/tokens/package.json b/projects/addon-table/tokens/package.json
new file mode 100644
index 000000000000..289d2d373a50
--- /dev/null
+++ b/projects/addon-table/tokens/package.json
@@ -0,0 +1,7 @@
+{
+ "ngPackage": {
+ "lib": {
+ "entryFile": "index.ts"
+ }
+ }
+}
diff --git a/projects/addon-tablebars/components/table-bars-host/table-bars-host.component.ts b/projects/addon-tablebars/components/table-bars-host/table-bars-host.component.ts
index 548ae892a42d..c645c46befac 100644
--- a/projects/addon-tablebars/components/table-bars-host/table-bars-host.component.ts
+++ b/projects/addon-tablebars/components/table-bars-host/table-bars-host.component.ts
@@ -1,6 +1,6 @@
import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiContextWithImplicit} from '@taiga-ui/cdk';
-import {TuiBrightness, tuiSlideInTop} from '@taiga-ui/core';
+import {TUI_CLOSE_WORD, TuiBrightness, tuiSlideInTop} from '@taiga-ui/core';
import {BehaviorSubject, Subscription} from 'rxjs';
import {TableBar} from '../../classes/table-bar';
import {TuiTableBarsService} from '../../services/table-bars.service';
@@ -19,7 +19,10 @@ export class TuiTableBarsHostComponent {
private readonly subscription: Subscription;
- constructor(@Inject(TuiTableBarsService) service: TuiTableBarsService) {
+ constructor(
+ @Inject(TuiTableBarsService) service: TuiTableBarsService,
+ @Inject(TUI_CLOSE_WORD) readonly closeWord: string,
+ ) {
this.subscription = service.open$.subscribe(item => {
this.addItem(item);
});
diff --git a/projects/addon-tablebars/components/table-bars-host/table-bars-host.template.html b/projects/addon-tablebars/components/table-bars-host/table-bars-host.template.html
index 4b569d86bd95..3ca76e832574 100644
--- a/projects/addon-tablebars/components/table-bars-host/table-bars-host.template.html
+++ b/projects/addon-tablebars/components/table-bars-host/table-bars-host.template.html
@@ -17,18 +17,17 @@
[context]="getItemContext(item)"
>
-
diff --git a/projects/core/components/data-list/data-list.component.ts b/projects/core/components/data-list/data-list.component.ts
index 30fa2453e46d..9bc785c8eb7e 100644
--- a/projects/core/components/data-list/data-list.component.ts
+++ b/projects/core/components/data-list/data-list.component.ts
@@ -22,7 +22,7 @@ import {
tuiPure,
} from '@taiga-ui/cdk';
import {TuiDataListAccessor} from '@taiga-ui/core/interfaces';
-import {TUI_DATA_LIST_ACCESSOR} from '@taiga-ui/core/tokens';
+import {TUI_DATA_LIST_ACCESSOR, TUI_NOTHING_FOUND_MESSAGE} from '@taiga-ui/core/tokens';
import {TuiDataListRole} from '@taiga-ui/core/types';
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';
import {Observable} from 'rxjs';
@@ -50,10 +50,9 @@ export class TuiDataListComponent implements TuiDataListAccessor {
@tuiDefaultProp()
role: TuiDataListRole = 'listbox';
- // TODO i18n
@Input()
@tuiDefaultProp()
- emptyContent: PolymorpheusContent = 'Ничего не найдено';
+ emptyContent: PolymorpheusContent = this.defaultEmptyContent;
@ContentChildren(forwardRef(() => TuiOptionComponent), {descendants: true})
private readonly options: QueryList> = EMPTY_QUERY;
@@ -62,6 +61,7 @@ export class TuiDataListComponent implements TuiDataListAccessor {
constructor(
@Inject(ElementRef) private readonly elementRef: ElementRef,
+ @Inject(TUI_NOTHING_FOUND_MESSAGE) private readonly defaultEmptyContent: string,
) {}
@tuiPure
diff --git a/projects/core/tokens/i18n.ts b/projects/core/tokens/i18n.ts
index 6f364d8ec5c2..c903dae2fd88 100644
--- a/projects/core/tokens/i18n.ts
+++ b/projects/core/tokens/i18n.ts
@@ -4,6 +4,13 @@ export const TUI_CLOSE_WORD = new InjectionToken(`i18n 'close' word`, {
factory: () => 'Close',
});
+export const TUI_NOTHING_FOUND_MESSAGE = new InjectionToken(
+ `i18n 'Nothing found' message`,
+ {
+ factory: () => 'Nothing found',
+ },
+);
+
export const TUI_DEFAULT_ERROR_MESSAGE = new InjectionToken(
`i18n of error message`,
{
diff --git a/projects/demo/src/assets/android-chrome-192x192.png b/projects/demo/src/assets/android-chrome-192x192.png
index c7fdbb292a1e..c9993a8b8edb 100644
Binary files a/projects/demo/src/assets/android-chrome-192x192.png and b/projects/demo/src/assets/android-chrome-192x192.png differ
diff --git a/projects/demo/src/assets/android-chrome-512x512.png b/projects/demo/src/assets/android-chrome-512x512.png
index c448e16f3032..11648476b72a 100644
Binary files a/projects/demo/src/assets/android-chrome-512x512.png and b/projects/demo/src/assets/android-chrome-512x512.png differ
diff --git a/projects/demo/src/assets/apple-touch-icon.png b/projects/demo/src/assets/apple-touch-icon.png
index 1179c13e4b98..dafbbae41a5b 100644
Binary files a/projects/demo/src/assets/apple-touch-icon.png and b/projects/demo/src/assets/apple-touch-icon.png differ
diff --git a/projects/demo/src/assets/browserconfig.xml b/projects/demo/src/assets/browserconfig.xml
index 5cd27e3f179e..5aecc916b9ee 100644
--- a/projects/demo/src/assets/browserconfig.xml
+++ b/projects/demo/src/assets/browserconfig.xml
@@ -3,7 +3,7 @@
- #603cba
+ #00aba9
diff --git a/projects/demo/src/assets/favicon-16x16.png b/projects/demo/src/assets/favicon-16x16.png
index 12fcc5fc3563..e093555a3300 100644
Binary files a/projects/demo/src/assets/favicon-16x16.png and b/projects/demo/src/assets/favicon-16x16.png differ
diff --git a/projects/demo/src/assets/favicon-32x32.png b/projects/demo/src/assets/favicon-32x32.png
index 1ecf73295779..0e7359dd3a02 100644
Binary files a/projects/demo/src/assets/favicon-32x32.png and b/projects/demo/src/assets/favicon-32x32.png differ
diff --git a/projects/demo/src/assets/favicon.ico b/projects/demo/src/assets/favicon.ico
index 6790c25d0c35..0a8fa66fa402 100644
Binary files a/projects/demo/src/assets/favicon.ico and b/projects/demo/src/assets/favicon.ico differ
diff --git a/projects/demo/src/assets/images/taiga.svg b/projects/demo/src/assets/images/taiga.svg
index 107db2255674..5b9347b88dc9 100644
--- a/projects/demo/src/assets/images/taiga.svg
+++ b/projects/demo/src/assets/images/taiga.svg
@@ -1,3 +1,3 @@
diff --git a/projects/demo/src/assets/mstile-144x144.png b/projects/demo/src/assets/mstile-144x144.png
deleted file mode 100644
index 136a8b5c7965..000000000000
Binary files a/projects/demo/src/assets/mstile-144x144.png and /dev/null differ
diff --git a/projects/demo/src/assets/mstile-150x150.png b/projects/demo/src/assets/mstile-150x150.png
index 3cfbc25d1e7a..af568dc21e63 100644
Binary files a/projects/demo/src/assets/mstile-150x150.png and b/projects/demo/src/assets/mstile-150x150.png differ
diff --git a/projects/demo/src/assets/mstile-310x150.png b/projects/demo/src/assets/mstile-310x150.png
deleted file mode 100644
index 2cb0dce2df2b..000000000000
Binary files a/projects/demo/src/assets/mstile-310x150.png and /dev/null differ
diff --git a/projects/demo/src/assets/mstile-310x310.png b/projects/demo/src/assets/mstile-310x310.png
deleted file mode 100644
index 0ea625219b7d..000000000000
Binary files a/projects/demo/src/assets/mstile-310x310.png and /dev/null differ
diff --git a/projects/demo/src/assets/mstile-70x70.png b/projects/demo/src/assets/mstile-70x70.png
deleted file mode 100644
index 418b9f573546..000000000000
Binary files a/projects/demo/src/assets/mstile-70x70.png and /dev/null differ
diff --git a/projects/demo/src/assets/safari-pinned-tab.svg b/projects/demo/src/assets/safari-pinned-tab.svg
index e600f9aea4ff..72326ecf7950 100644
--- a/projects/demo/src/assets/safari-pinned-tab.svg
+++ b/projects/demo/src/assets/safari-pinned-tab.svg
@@ -2,34 +2,119 @@
diff --git a/projects/demo/src/index.html b/projects/demo/src/index.html
index a197266ba54b..4858a7a3c7ec 100644
--- a/projects/demo/src/index.html
+++ b/projects/demo/src/index.html
@@ -30,9 +30,9 @@
-
+
Taiga UI
diff --git a/projects/demo/src/modules/components/input-card/input-card.component.ts b/projects/demo/src/modules/components/input-card/input-card.component.ts
index d83990b09e7c..91b04591eb16 100644
--- a/projects/demo/src/modules/components/input-card/input-card.component.ts
+++ b/projects/demo/src/modules/components/input-card/input-card.component.ts
@@ -86,7 +86,10 @@ export class ExampleTuiInputCardComponent extends AbstractExampleTuiReactiveFiel
autocompleteEnabledExpire = false;
control = new FormGroup({
- card: new FormControl('', [Validators.required, tuiCreateLuhnValidator()]),
+ card: new FormControl('', [
+ Validators.required,
+ tuiCreateLuhnValidator('Invalid card number'),
+ ]),
expire: new FormControl('', Validators.required),
cvc: new FormControl('', Validators.required),
});
diff --git a/projects/icons/ng-package.json b/projects/icons/ng-package.json
index 9f89e3ce4efe..f62b94fb1f88 100644
--- a/projects/icons/ng-package.json
+++ b/projects/icons/ng-package.json
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
- "dest": "../../dist/angular-icons",
+ "dest": "../../dist/icons",
"lib": {
"entryFile": "src/public-api.ts"
}
diff --git a/projects/icons/scripts/copy-icons.js b/projects/icons/scripts/copy-icons.js
index 5300da6e8894..30357620f94b 100644
--- a/projects/icons/scripts/copy-icons.js
+++ b/projects/icons/scripts/copy-icons.js
@@ -1,4 +1,4 @@
const fs = require('fs-extra');
const {resolve} = require('path');
-fs.copy(resolve(__dirname, '..', 'src/icons/src'), './dist/angular-icons/src');
+fs.copy(resolve(__dirname, '..', 'src/icons/src'), './dist/icons/src');
diff --git a/projects/kit/components/calendar-range/calendar-range.component.ts b/projects/kit/components/calendar-range/calendar-range.component.ts
index 38d9c2c4d975..5baf81c2a49d 100644
--- a/projects/kit/components/calendar-range/calendar-range.component.ts
+++ b/projects/kit/components/calendar-range/calendar-range.component.ts
@@ -35,7 +35,7 @@ import {
MAX_DAY_RANGE_LENGTH_MAPPER,
maxDayAssertion,
} from '@taiga-ui/kit/constants';
-import {TUI_CALENDAR_DATA_STREAM} from '@taiga-ui/kit/tokens';
+import {TUI_CALENDAR_DATA_STREAM, TUI_OTHER_DATE_TEXT} from '@taiga-ui/kit/tokens';
import {Observable} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
@@ -100,8 +100,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax
item.range.to.daySameOrAfter(min) &&
(max === null || item.range.from.daySameOrBefore(max)),
),
- // TODO: i18n
- 'Другая дата...',
+ this.otherDateText,
];
constructor(
@@ -110,6 +109,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax
valueChanges: Observable | null,
@Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,
@Inject(TuiDestroyService) destroy$: TuiDestroyService,
+ @Inject(TUI_OTHER_DATE_TEXT) private readonly otherDateText: string,
) {
if (!valueChanges) {
return;
diff --git a/projects/kit/components/calendar-range/test/range-calendar.component.spec.ts b/projects/kit/components/calendar-range/test/range-calendar.component.spec.ts
index 0003ea3cc624..a5eb0245fb4e 100644
--- a/projects/kit/components/calendar-range/test/range-calendar.component.spec.ts
+++ b/projects/kit/components/calendar-range/test/range-calendar.component.spec.ts
@@ -114,13 +114,6 @@ describe('rangeCalendarComponent', () => {
const items = getItems();
expect(items.length).toBe(7);
- expect(items[0].nativeElement.textContent.trim()).toBe('За все время');
- expect(items[1].nativeElement.textContent.trim()).toBe('Сегодня');
- expect(items[2].nativeElement.textContent.trim()).toBe('Вчера');
- expect(items[3].nativeElement.textContent.trim()).toBe('Текущая неделя');
- expect(items[4].nativeElement.textContent.trim()).toBe('Текущий месяц');
- expect(items[5].nativeElement.textContent.trim()).toBe('Прошлый месяц');
- expect(items[6].nativeElement.textContent.trim()).toBe('Другая дата...');
});
it('Если значение не подходит ни под один диапазон — галочка у "Другая дата..."', () => {
@@ -163,8 +156,8 @@ describe('rangeCalendarComponent', () => {
const items = getItems().map(item => item.nativeElement.textContent.trim());
- expect(items.some(item => item === 'Вчера')).toBe(true);
- expect(items.some(item => item === 'Сегодня')).toBe(false);
+ expect(items.some(item => item === 'Yesterday')).toBe(true);
+ expect(items.some(item => item === 'Today')).toBe(false);
});
it('При переопределении интервалов в списке всегда есть "Другая дата..."', () => {
@@ -181,7 +174,7 @@ describe('rangeCalendarComponent', () => {
expect(items.length).toBe(2);
expect(items[0].nativeElement.textContent.trim()).toBe(title);
- expect(items[1].nativeElement.textContent.trim()).toBe('Другая дата...');
+ expect(items[1].nativeElement.textContent.trim()).toBe('Other date...');
});
});
diff --git a/projects/kit/components/data-list-wrapper/data-list-wrapper.component.ts b/projects/kit/components/data-list-wrapper/data-list-wrapper.component.ts
index 81de4ef305f2..0d7f88d6d51a 100644
--- a/projects/kit/components/data-list-wrapper/data-list-wrapper.component.ts
+++ b/projects/kit/components/data-list-wrapper/data-list-wrapper.component.ts
@@ -3,6 +3,7 @@ import {
Component,
ElementRef,
forwardRef,
+ Inject,
Input,
QueryList,
ViewChildren,
@@ -18,6 +19,7 @@ import {
} from '@taiga-ui/cdk';
import {
TUI_DATA_LIST_ACCESSOR,
+ TUI_NOTHING_FOUND_MESSAGE,
TuiDataListAccessor,
TuiOptionComponent,
TuiSizeL,
@@ -47,10 +49,9 @@ export class TuiDataListWrapperComponent implements TuiDataListAccessor {
@tuiDefaultProp()
disabledItemHandler: TuiBooleanHandler = ALWAYS_FALSE_HANDLER;
- // TODO i18n
@Input()
@tuiDefaultProp()
- emptyContent: PolymorpheusContent = 'Ничего не найдено';
+ emptyContent: PolymorpheusContent = this.defaultEmptyContent;
@Input()
@tuiDefaultProp()
@@ -64,6 +65,10 @@ export class TuiDataListWrapperComponent implements TuiDataListAccessor {
@ViewChildren(forwardRef(() => TuiOptionComponent))
private readonly options: QueryList> = EMPTY_QUERY;
+ constructor(
+ @Inject(TUI_NOTHING_FOUND_MESSAGE) private readonly defaultEmptyContent: string,
+ ) {}
+
getContext(
$implicit: T,
{nativeElement}: ElementRef,
diff --git a/projects/kit/components/input-file/file/file.component.ts b/projects/kit/components/input-file/file/file.component.ts
index 0b32c85be5da..2aed7710dcac 100644
--- a/projects/kit/components/input-file/file/file.component.ts
+++ b/projects/kit/components/input-file/file/file.component.ts
@@ -53,7 +53,8 @@ export class TuiFileComponent {
constructor(
@Inject(TUI_IS_MOBILE) readonly isMobile: boolean,
@Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,
- @Inject(TUI_FILE_TEXTS) readonly fileTexts: Record,
+ @Inject(TUI_FILE_TEXTS)
+ readonly fileTexts: Record<'loadingError' | 'preview' | 'remove', string>,
@Inject(TUI_DIGITAL_INFORMATION_UNITS)
private readonly units: [string, string, string],
) {}
diff --git a/projects/kit/components/input-file/input-file.component.ts b/projects/kit/components/input-file/input-file.component.ts
index 73bf5be2fde5..2f7708f7ee97 100644
--- a/projects/kit/components/input-file/input-file.component.ts
+++ b/projects/kit/components/input-file/input-file.component.ts
@@ -103,7 +103,18 @@ export class TuiInputFileComponent
changeDetectorRef: ChangeDetectorRef,
@Inject(TUI_IS_MOBILE)
isMobile: boolean,
- @Inject(TUI_INPUT_FILE_TEXTS) readonly inputFileTexts: Record,
+ @Inject(TUI_INPUT_FILE_TEXTS)
+ readonly inputFileTexts: Record<
+ | 'defaultLabelSingle'
+ | 'defaultLabelMultiple'
+ | 'defaultLinkSingle'
+ | 'defaultLinkMultiple'
+ | 'maxSizeRejectionReason'
+ | 'formatRejectionReason'
+ | 'drop'
+ | 'dropMultiple',
+ string
+ >,
@Inject(TUI_DIGITAL_INFORMATION_UNITS)
private readonly units: [string, string, string],
) {
diff --git a/projects/kit/directives/unfinished-validator/unfinished-validator.directive.ts b/projects/kit/directives/unfinished-validator/unfinished-validator.directive.ts
index 04a65f4349bf..07004e871321 100644
--- a/projects/kit/directives/unfinished-validator/unfinished-validator.directive.ts
+++ b/projects/kit/directives/unfinished-validator/unfinished-validator.directive.ts
@@ -1,6 +1,7 @@
import {Attribute, Directive, Inject, Injector} from '@angular/core';
import {NG_VALIDATORS, Validator} from '@angular/forms';
import {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk';
+import {TUI_UNFINISHED_TEXT} from '@taiga-ui/kit/tokens';
import {tuiCreateUnfinishedValidator} from '@taiga-ui/kit/validators';
@Directive({
@@ -16,7 +17,7 @@ import {tuiCreateUnfinishedValidator} from '@taiga-ui/kit/validators';
export class TuiUnfinishedValidatorDirective implements Validator {
readonly validate = tuiCreateUnfinishedValidator(
() => this.injector.get(TUI_FOCUSABLE_ITEM_ACCESSOR),
- this.message || undefined,
+ this.message || this.defaultMessage,
);
constructor(
@@ -24,5 +25,6 @@ export class TuiUnfinishedValidatorDirective implements Validator {
private readonly injector: Injector,
@Attribute('tuiUnfinishedValidator')
private readonly message: string | null,
+ @Inject(TUI_UNFINISHED_TEXT) private readonly defaultMessage: string,
) {}
}
diff --git a/projects/kit/tokens/i18n.ts b/projects/kit/tokens/i18n.ts
index ad2472900146..795637eead1a 100644
--- a/projects/kit/tokens/i18n.ts
+++ b/projects/kit/tokens/i18n.ts
@@ -13,6 +13,17 @@ export const TUI_MORE_WORD = new InjectionToken(`i18n 'more' word`, {
factory: () => 'More',
});
+export const TUI_OTHER_DATE_TEXT = new InjectionToken(`i18n 'Other date' text`, {
+ factory: () => 'Other date...',
+});
+
+export const TUI_UNFINISHED_TEXT = new InjectionToken(
+ `i18n unfinished validator text`,
+ {
+ factory: () => 'Finish filling the field',
+ },
+);
+
/**
* Works with a tuple
* [@string 'choose day', @param 'choose range']
@@ -82,16 +93,15 @@ export const TUI_CALENDAR_MONTHS = new InjectionToken>(
},
);
-export const TUI_FILE_TEXTS = new InjectionToken>(
- 'file i18n texts',
- {
- factory: () => ({
- loadingError: 'Loading error',
- preview: 'Preview',
- remove: 'Remove',
- }),
- },
-);
+export const TUI_FILE_TEXTS = new InjectionToken<
+ Record<'loadingError' | 'preview' | 'remove', string>
+>('file i18n texts', {
+ factory: () => ({
+ loadingError: 'Loading error',
+ preview: 'Preview',
+ remove: 'Remove',
+ }),
+});
export const TUI_PAGINATION_TEXTS = new InjectionToken<[string, string]>(
'pagination i18n texts',
@@ -100,18 +110,27 @@ export const TUI_PAGINATION_TEXTS = new InjectionToken<[string, string]>(
},
);
-export const TUI_INPUT_FILE_TEXTS = new InjectionToken>(
- 'tui-input-file i18n texts',
- {
- factory: () => ({
- defaultLabelSingle: 'or drag\u00A0it\u00A0here',
- defaultLabelMultiple: 'or drag\u00A0them\u00A0here',
- defaultLinkSingle: 'Choose a file',
- defaultLinkMultiple: 'Choose files',
- maxSizeRejectionReason: 'File exceeds size ',
- formatRejectionReason: 'Wrong file format',
- drop: 'Drop file here',
- dropMultiple: 'Drop files here',
- }),
- },
-);
+export const TUI_INPUT_FILE_TEXTS = new InjectionToken<
+ Record<
+ | 'defaultLabelSingle'
+ | 'defaultLabelMultiple'
+ | 'defaultLinkSingle'
+ | 'defaultLinkMultiple'
+ | 'maxSizeRejectionReason'
+ | 'formatRejectionReason'
+ | 'drop'
+ | 'dropMultiple',
+ string
+ >
+>('tui-input-file i18n texts', {
+ factory: () => ({
+ defaultLabelSingle: 'or drag\u00A0it\u00A0here',
+ defaultLabelMultiple: 'or drag\u00A0them\u00A0here',
+ defaultLinkSingle: 'Choose a file',
+ defaultLinkMultiple: 'Choose files',
+ maxSizeRejectionReason: 'File exceeds size ',
+ formatRejectionReason: 'Wrong file format',
+ drop: 'Drop file here',
+ dropMultiple: 'Drop files here',
+ }),
+});
diff --git a/projects/kit/utils/miscellaneous/create-default-day-range-periods.ts b/projects/kit/utils/miscellaneous/create-default-day-range-periods.ts
index c0165340169b..76cb8259f63c 100644
--- a/projects/kit/utils/miscellaneous/create-default-day-range-periods.ts
+++ b/projects/kit/utils/miscellaneous/create-default-day-range-periods.ts
@@ -1,7 +1,16 @@
import {TUI_FIRST_DAY, TuiDay, TuiDayRange} from '@taiga-ui/cdk';
import {TuiDayRangePeriod} from '@taiga-ui/kit/classes';
-export function tuiCreateDefaultDayRangePeriods(): ReadonlyArray {
+export function tuiCreateDefaultDayRangePeriods(
+ periodTitles: [string, string, string, string, string, string] = [
+ 'For all the time',
+ 'Today',
+ 'Yesterday',
+ 'Current week',
+ 'Current month',
+ 'Previous month',
+ ],
+): ReadonlyArray {
const today = TuiDay.currentLocal();
const yesterday = today.append({day: -1});
const startOfWeek = today.append({day: -today.dayOfWeek()});
@@ -10,16 +19,15 @@ export function tuiCreateDefaultDayRangePeriods(): ReadonlyArray TuiFocusableElementAccessor,
- message: PolymorpheusContent = error,
+ message: PolymorpheusContent,
): ValidatorFn {
return ({
value,