From fbe6563f1dcf76b20abf021d6a27245826c4f702 Mon Sep 17 00:00:00 2001 From: waterplea Date: Fri, 25 Dec 2020 15:34:00 +0300 Subject: [PATCH 1/2] feat(demo): some translation fixes --- .../directives/ripple/ripple.directive.ts | 5 +- .../notification/notification.component.ts | 10 +-- .../notification/notification.template.html | 4 +- .../test/notification.component.spec.ts | 26 ++++--- .../components/wrapper/wrapper.component.ts | 2 +- projects/core/karma.conf.js | 2 +- .../notification-alert.template.html | 19 ++++- .../app/home/examples/angular-json-styles.txt | 3 +- .../app/home/examples/app-module-icons.txt | 9 --- .../app/home/examples/app-module-optional.txt | 2 - .../modules/app/home/examples/ie-support.txt | 16 ++--- .../src/modules/app/home/home.template.html | 71 ++++++++++++------- .../line-days-chart/examples/2/index.html | 2 +- .../components/button/button.template.html | 2 +- .../data-list/data-list.template.html | 6 +- .../components/editor/editor.template.html | 7 +- .../marker-icon/marker-icon.template.html | 2 +- .../mobile-themes/examples/1/index.html | 4 +- .../mobile-themes/examples/1/index.ts | 15 ++++ .../mobile-themes/examples/2/index.html | 6 +- .../mobile-themes/examples/2/index.ts | 15 ++++ .../mobile-themes/mobile-themes.module.ts | 9 ++- .../mobile-themes/mobile-themes.template.html | 2 +- .../notification/examples/1/index.html | 2 +- .../notification/examples/1/index.ts | 4 +- .../examples/import/insert-template.txt | 11 +-- .../notification/notification.component.ts | 1 - .../notification/notification.template.html | 16 ++--- .../pull-to-refresh.template.html | 2 +- .../scrollbar/scrollbar.template.html | 6 +- .../components/tabs/tabs.template.html | 2 +- .../modules/info/browsers/browsers.module.ts | 2 + .../info/browsers/browsers.template.html | 17 ++++- .../src/modules/info/doc/doc.template.html | 19 ++--- .../info/related/related.template.html | 32 ++++++--- .../markup/colors/colors.template.html | 2 +- .../modules/markup/grid/examples/1/index.html | 41 ----------- .../src/modules/markup/icons/icons.module.ts | 2 + .../modules/markup/icons/icons.template.html | 12 +--- .../modules/markup/shadows/shadows.style.less | 21 +++--- .../markup/shadows/shadows.template.html | 55 ++++++-------- .../markup/skeleton/examples/1/index.html | 6 +- .../1/{index.style.less => index.less} | 4 ++ .../markup/skeleton/examples/1/index.ts | 2 +- .../markup/skeleton/examples/2/index.html | 6 +- .../2/{index.style.less => index.less} | 1 + .../markup/skeleton/examples/2/index.ts | 2 +- .../markup/skeleton/skeleton.component.ts | 4 +- .../markup/skeleton/skeleton.module.ts | 3 +- .../markup/skeleton/skeleton.template.html | 2 +- .../markup/spaces/spaces.template.html | 17 ++--- .../modules/markup/tables/tables.module.ts | 5 +- .../markup/tables/tables.template.html | 6 ++ .../modules/markup/theme/theme.template.html | 9 +-- .../services/dialogs/dialogs.template.html | 12 +--- .../notifications/notifications.template.html | 2 +- .../table-bar/table-bar.template.html | 2 +- .../themes/bootstrap/bootstrap.style.less | 2 + .../themes/material/material.style.less | 5 +- 59 files changed, 304 insertions(+), 272 deletions(-) rename projects/demo/src/modules/markup/skeleton/examples/1/{index.style.less => index.less} (83%) rename projects/demo/src/modules/markup/skeleton/examples/2/{index.style.less => index.less} (78%) diff --git a/projects/addon-mobile/directives/ripple/ripple.directive.ts b/projects/addon-mobile/directives/ripple/ripple.directive.ts index d5fa1cfdfd4a..1683b219c080 100644 --- a/projects/addon-mobile/directives/ripple/ripple.directive.ts +++ b/projects/addon-mobile/directives/ripple/ripple.directive.ts @@ -22,7 +22,6 @@ import { TUI_RIPPLE_START, } from './ripple.providers'; -const RIPPLE_SELECTOR = '[tuiRipple]'; const TOUCH_MOVE_DELAY = 100; const STYLE = ` @keyframes ${RIPPLE_ON} { @@ -49,7 +48,7 @@ const STYLE = ` } } -*${RIPPLE_SELECTOR} { +*[tuiRipple] { position: relative; overflow: hidden; } @@ -67,7 +66,7 @@ const STYLE = ` `; @Directive({ - selector: RIPPLE_SELECTOR, + selector: '[tuiRipple]', providers: TUI_RIPPLE_PROVIDERS, }) export class TuiRippleDirective { diff --git a/projects/core/components/notification/notification.component.ts b/projects/core/components/notification/notification.component.ts index 646d03b6532b..aeb379173aba 100644 --- a/projects/core/components/notification/notification.component.ts +++ b/projects/core/components/notification/notification.component.ts @@ -31,11 +31,6 @@ export class TuiNotificationComponent { @tuiDefaultProp() hasIcon = true; - @Input() - @tuiDefaultProp() - @HostBinding('class._has-close-button') - hasCloseButton = true; - @Input() @HostBinding('attr.data-tui-host-status') @tuiDefaultProp() @@ -50,7 +45,8 @@ export class TuiNotificationComponent { return STATUS_ICON[this.status]; } - onCloseClick() { - this.close.emit(); + @HostBinding('class._has-close-button') + get hasClose(): boolean { + return !!this.close.observers.length; } } diff --git a/projects/core/components/notification/notification.template.html b/projects/core/components/notification/notification.template.html index 28f8d0b9252c..9a63982299ce 100644 --- a/projects/core/components/notification/notification.template.html +++ b/projects/core/components/notification/notification.template.html @@ -8,7 +8,7 @@ diff --git a/projects/core/components/notification/test/notification.component.spec.ts b/projects/core/components/notification/test/notification.component.spec.ts index 16af986b62a9..ea4f37d18fe0 100644 --- a/projects/core/components/notification/test/notification.component.spec.ts +++ b/projects/core/components/notification/test/notification.component.spec.ts @@ -12,26 +12,33 @@ describe('Notification', () => { @Component({ template: ` Короткое простое информационное сообщение + + + Короткое простое информационное сообщение + + `, }) class TestComponent { - @ViewChild(TuiNotificationComponent, {static: true}) + @ViewChild(TuiNotificationComponent, {static: false}) component: TuiNotificationComponent; hasCloseButton = true; hasIcon = true; status: TuiNotification = TuiNotification.Info; + + onClose() {} } let fixture: ComponentFixture; let testComponent: TestComponent; - let component: TuiNotificationComponent; let pageObject: PageObject; function getIcon(): DebugElement { @@ -55,7 +62,6 @@ describe('Notification', () => { pageObject = new PageObject(fixture); testComponent = fixture.componentInstance; fixture.detectChanges(); - component = testComponent.component; }); describe('icon', () => { @@ -64,19 +70,19 @@ describe('Notification', () => { }); it('выбирается правильно в зависимости от статуса', () => { - expect(component.icon).toBe(STATUS_ICON[testComponent.status]); + expect(testComponent.component.icon).toBe(STATUS_ICON[testComponent.status]); testComponent.status = TuiNotification.Success; fixture.detectChanges(); - expect(component.icon).toBe(STATUS_ICON[testComponent.status]); + expect(testComponent.component.icon).toBe(STATUS_ICON[testComponent.status]); testComponent.status = TuiNotification.Error; fixture.detectChanges(); - expect(component.icon).toBe(STATUS_ICON[testComponent.status]); + expect(testComponent.component.icon).toBe(STATUS_ICON[testComponent.status]); testComponent.status = TuiNotification.Warning; fixture.detectChanges(); - expect(component.icon).toBe(STATUS_ICON[testComponent.status]); + expect(testComponent.component.icon).toBe(STATUS_ICON[testComponent.status]); }); it('при hasIcon=false отсутствует', () => { @@ -88,11 +94,11 @@ describe('Notification', () => { }); describe('крестик закрытия', () => { - it('по умолчанию присутствует', () => { + it('присутствует при подписке на close', () => { expect(getClose()).not.toBeNull(); }); - it('при hasCloseButton=false отсутствует', () => { + it('без подписки на close отсутствует', () => { testComponent.hasCloseButton = false; fixture.detectChanges(); diff --git a/projects/core/components/wrapper/wrapper.component.ts b/projects/core/components/wrapper/wrapper.component.ts index e4d66c635e86..3f3c9349c520 100644 --- a/projects/core/components/wrapper/wrapper.component.ts +++ b/projects/core/components/wrapper/wrapper.component.ts @@ -74,7 +74,7 @@ export class TuiWrapperComponent { return TuiInteractiveState.Readonly; } - if (this.pressed) { + if (this.pressed && !this.isMobile) { return TuiInteractiveState.Pressed; } diff --git a/projects/core/karma.conf.js b/projects/core/karma.conf.js index c743656e3c38..d5fc3979853c 100644 --- a/projects/core/karma.conf.js +++ b/projects/core/karma.conf.js @@ -1,4 +1,4 @@ -const base = require('../../karma.conf'); +const base = require('../../karma.config'); module.exports = function (config) { base(config); diff --git a/projects/core/modules/notifications/notification-alert/notification-alert.template.html b/projects/core/modules/notifications/notification-alert/notification-alert.template.html index c8cc7bf42784..2bebc02d8d07 100644 --- a/projects/core/modules/notifications/notification-alert/notification-alert.template.html +++ b/projects/core/modules/notifications/notification-alert/notification-alert.template.html @@ -1,5 +1,5 @@ @@ -17,3 +17,20 @@ [context]="context" > + + + + + + diff --git a/projects/demo/src/modules/app/home/examples/angular-json-styles.txt b/projects/demo/src/modules/app/home/examples/angular-json-styles.txt index a76ea0a8306e..270970bc2644 100644 --- a/projects/demo/src/modules/app/home/examples/angular-json-styles.txt +++ b/projects/demo/src/modules/app/home/examples/angular-json-styles.txt @@ -6,7 +6,8 @@ "options": { "styles": [ "src/styles.scss", - "node_modules/@taiga-ui/core/styles/taiga-ui-angular-global.less" + "node_modules/@taiga-ui/core/styles/taiga-ui-global.less", + "node_modules/@taiga-ui/core/styles/taiga-ui-theme.less" ] } } diff --git a/projects/demo/src/modules/app/home/examples/app-module-icons.txt b/projects/demo/src/modules/app/home/examples/app-module-icons.txt index d57efbdd756d..0022308c9bc7 100644 --- a/projects/demo/src/modules/app/home/examples/app-module-icons.txt +++ b/projects/demo/src/modules/app/home/examples/app-module-icons.txt @@ -1,18 +1,9 @@ -import {TUI_SANITIZER} from '@taiga-ui/cdk'; import {iconsPathFactory, TUI_ICONS_PATH} from '@taiga-ui/core'; ... -const unsafeSanitizer: Sanitizer = { - sanitize: (_: any, value: any) => value, -}; - @NgModule({ ... providers: [ - { - provide: TUI_SANITIZER, - useValue: unsafeSanitizer, - }, { provide: TUI_ICONS_PATH, useValue: iconsPathFactory('assets/taiga-ui/icons/'), diff --git a/projects/demo/src/modules/app/home/examples/app-module-optional.txt b/projects/demo/src/modules/app/home/examples/app-module-optional.txt index a7716afe8345..ebca15d643b4 100644 --- a/projects/demo/src/modules/app/home/examples/app-module-optional.txt +++ b/projects/demo/src/modules/app/home/examples/app-module-optional.txt @@ -1,6 +1,5 @@ import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; -import {TuiTableBarsHostModule} from '@taiga-ui/addon-tablebars'; import { TuiNotificationsModule, TuiDialogModule, @@ -16,7 +15,6 @@ import {AppComponent} from './app.component'; imports: [ BrowserModule, TuiRootModule, - TuiTableBarsHostModule, TuiNotificationsModule, TuiDialogModule, AppRoutingModule, diff --git a/projects/demo/src/modules/app/home/examples/ie-support.txt b/projects/demo/src/modules/app/home/examples/ie-support.txt index bc61d6d0c7ca..39441eec9955 100644 --- a/projects/demo/src/modules/app/home/examples/ie-support.txt +++ b/projects/demo/src/modules/app/home/examples/ie-support.txt @@ -5,20 +5,14 @@ import {areCssVarsSupported} from '@taiga-ui/core/utils/dom'; import cssVars from 'css-vars-ponyfill'; export function bootstrapListenerFactory( - documentRef: Document, - cssRef: any, // TODO: change it to CSS if you have TS 3.9+ (https://github.com/ng-web-apis/common/pull/6) + rootElement: Document, + cssRef: CSS, userAgent: string, ): () => void { const factory = () => { - if (areCssVarsSupported(cssRef, userAgent)) { - return; + if (!areCssVarsSupported(cssRef, userAgent)) { + cssVars({rootElement, onlyLegacy: false, watch: true}); } - - cssVars({ - rootElement: documentRef, - onlyLegacy: false, - watch: true, - }); }; return factory; @@ -35,4 +29,4 @@ export function bootstrapListenerFactory( } ], }) -export class AppModule {} \ No newline at end of file +export class AppModule {} diff --git a/projects/demo/src/modules/app/home/home.template.html b/projects/demo/src/modules/app/home/home.template.html index cc44e1e0cfc6..61dc43252102 100644 --- a/projects/demo/src/modules/app/home/home.template.html +++ b/projects/demo/src/modules/app/home/home.template.html @@ -115,15 +115,14 @@
  • - Otherwise, do not forget about file type if you import styles - directly from our library + For non-LESS environment, do not forget about file type if you + import styles directly from our library
  • Many of our components need your app to be wrapped into tui-root. Import TuiRootModule in your - main module and add TuiRootScroller into providers for - correct working of Angular router + main module. Wrap all content of your app with root component

    + + Note: your window will no longer scroll. To control + scrolling when modal dialogs are shown, + tui-root tag will be topmost scroll container. + +
  • - Taiga UI has also optional modules for dialogs, notifications and - tablebars. If you need these features, add modules into your - app.module.ts + Taiga UI also has optional modules for dialogs and notifications. If + you need these features, add modules into your app.module.ts
  • - Icons do not included into library bundle. Add our standart icon - pack providing token TUI_ICONS_PATH with a function - that gets icon name and returs path to it. + Icons are not included in the bundle. To add icons provide + TUI_ICONS_PATH token with a function that gets icon + name and returns path to it.

    First of all, add icons into assets of your app:

    @@ -164,21 +168,7 @@ [code]="examples.assets" > -

    - Then you should provide path with a token. Moreover, - Sanitizer of Angular removes SVG code - and that is why you also need to reassign - TUI_SANITIZER token that is used to sanitize icons. - If you use safe icons, you can reassign it with unsafe sanitizer - from the sample below. Otherwise, we recommend you using our - library - ng-dompurify -

    +

    Then you should provide path with a token:

    Taiga UI uses CSS custom properties for styling that is not supported by Internet Explorer. - If you need to support IE 11, use this package + If you need to support IE 11, use css-vars-ponyfill + css-vars-ponyfill + + package

    Install it:

    @@ -222,6 +214,31 @@ filename="app.module.ts" [code]="examples.ieSupport" >
    + +

    + Internet Explorer also does not support native + SVG inlining. Taiga UI icons will be automatically + downloaded and inlined directly into DOM. However, Angular + Sanitizer removes SVG code in that + case. To use custom sanitizer that properly supports + SVG provide TUI_SANITIZER token. We + recommend you using our library + + ng-dompurify + + to properly sanitize code with + + DOMPurify + +

  • diff --git a/projects/demo/src/modules/charts/line-days-chart/examples/2/index.html b/projects/demo/src/modules/charts/line-days-chart/examples/2/index.html index eb8bafc621cc..988972e5b229 100644 --- a/projects/demo/src/modules/charts/line-days-chart/examples/2/index.html +++ b/projects/demo/src/modules/charts/line-days-chart/examples/2/index.html @@ -1,4 +1,4 @@ - + TuiLineDaysChart is used to show data of several months to simplify working with different number of days in months diff --git a/projects/demo/src/modules/components/button/button.template.html b/projects/demo/src/modules/components/button/button.template.html index b4490e884cbc..28bc7588c84c 100644 --- a/projects/demo/src/modules/components/button/button.template.html +++ b/projects/demo/src/modules/components/button/button.template.html @@ -14,7 +14,7 @@ [content]="example1" > - + Link cannot be disabled. If you want to make an unactive link, remove href attribute or send an empty string into routerLink. To prevent keyboard diff --git a/projects/demo/src/modules/components/data-list/data-list.template.html b/projects/demo/src/modules/components/data-list/data-list.template.html index 76a302b3b22b..dea43751ebdc 100644 --- a/projects/demo/src/modules/components/data-list/data-list.template.html +++ b/projects/demo/src/modules/components/data-list/data-list.template.html @@ -12,11 +12,7 @@ heading="Links" [content]="example1" > - + Import TuiArrowModule if you need a rotated arrow diff --git a/projects/demo/src/modules/components/editor/editor.template.html b/projects/demo/src/modules/components/editor/editor.template.html index b116e7f0be6f..90d5d41144aa 100644 --- a/projects/demo/src/modules/components/editor/editor.template.html +++ b/projects/demo/src/modules/components/editor/editor.template.html @@ -2,12 +2,7 @@

    Rich Text Editor for using with Angular forms

    - + This component is experimental. Use it with caution. diff --git a/projects/demo/src/modules/components/marker-icon/marker-icon.template.html b/projects/demo/src/modules/components/marker-icon/marker-icon.template.html index 42325eea8510..1037b7547ddf 100644 --- a/projects/demo/src/modules/components/marker-icon/marker-icon.template.html +++ b/projects/demo/src/modules/components/marker-icon/marker-icon.template.html @@ -5,7 +5,7 @@ mode param to choose appearance or set it with custom styles

    - + Marker icons should be 48х48px or smaller. If icon is smaller, it will be cantered. diff --git a/projects/demo/src/modules/components/mobile-themes/examples/1/index.html b/projects/demo/src/modules/components/mobile-themes/examples/1/index.html index bd490e7dc5e6..0a16c2b4e7e4 100644 --- a/projects/demo/src/modules/components/mobile-themes/examples/1/index.html +++ b/projects/demo/src/modules/components/mobile-themes/examples/1/index.html @@ -2,7 +2,7 @@

    Button:

    - +

    Link:

    @@ -12,4 +12,4 @@

    Island:

    - Wow! +Wow! diff --git a/projects/demo/src/modules/components/mobile-themes/examples/1/index.ts b/projects/demo/src/modules/components/mobile-themes/examples/1/index.ts index f6fb88738109..2a9e62ec7adf 100644 --- a/projects/demo/src/modules/components/mobile-themes/examples/1/index.ts +++ b/projects/demo/src/modules/components/mobile-themes/examples/1/index.ts @@ -1,4 +1,5 @@ import {Component} from '@angular/core'; +import {TUI_IS_ANDROID, TUI_IS_IOS, TUI_IS_MOBILE} from '@taiga-ui/cdk'; import {changeDetection} from '../../../../../change-detection-strategy'; import {encapsulation} from '../../../../../view-encapsulation'; @@ -7,5 +8,19 @@ import {encapsulation} from '../../../../../view-encapsulation'; templateUrl: './index.html', changeDetection, encapsulation, + providers: [ + { + provide: TUI_IS_MOBILE, + useValue: true, + }, + { + provide: TUI_IS_ANDROID, + useValue: true, + }, + { + provide: TUI_IS_IOS, + useValue: false, + }, + ], }) export class TuiMobileThemesExample1 {} diff --git a/projects/demo/src/modules/components/mobile-themes/examples/2/index.html b/projects/demo/src/modules/components/mobile-themes/examples/2/index.html index 0c5fa476006c..7d7e667e6c6f 100644 --- a/projects/demo/src/modules/components/mobile-themes/examples/2/index.html +++ b/projects/demo/src/modules/components/mobile-themes/examples/2/index.html @@ -2,14 +2,14 @@

    Button:

    - +

    Link:

    - + Let's check it

    Island:

    - Wow! +Wow! diff --git a/projects/demo/src/modules/components/mobile-themes/examples/2/index.ts b/projects/demo/src/modules/components/mobile-themes/examples/2/index.ts index d83de71c9779..d79c3807491e 100644 --- a/projects/demo/src/modules/components/mobile-themes/examples/2/index.ts +++ b/projects/demo/src/modules/components/mobile-themes/examples/2/index.ts @@ -1,4 +1,5 @@ import {Component} from '@angular/core'; +import {TUI_IS_ANDROID, TUI_IS_IOS, TUI_IS_MOBILE} from '@taiga-ui/cdk'; import {changeDetection} from '../../../../../change-detection-strategy'; import {encapsulation} from '../../../../../view-encapsulation'; @@ -7,5 +8,19 @@ import {encapsulation} from '../../../../../view-encapsulation'; templateUrl: './index.html', changeDetection, encapsulation, + providers: [ + { + provide: TUI_IS_MOBILE, + useValue: true, + }, + { + provide: TUI_IS_ANDROID, + useValue: false, + }, + { + provide: TUI_IS_IOS, + useValue: true, + }, + ], }) export class TuiMobileThemesExample2 {} diff --git a/projects/demo/src/modules/components/mobile-themes/mobile-themes.module.ts b/projects/demo/src/modules/components/mobile-themes/mobile-themes.module.ts index 617af22b7333..c17ffd9fb728 100644 --- a/projects/demo/src/modules/components/mobile-themes/mobile-themes.module.ts +++ b/projects/demo/src/modules/components/mobile-themes/mobile-themes.module.ts @@ -2,7 +2,12 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; import {generateRoutes, TUI_DOC_PAGE_MODULES} from '@taiga-ui/addon-doc'; -import {TuiThemeAndroidModule, TuiThemeIosModule} from '@taiga-ui/addon-mobile'; +import { + TuiRippleModule, + TuiThemeAndroidModule, + TuiThemeIosModule, + TuiTouchableModule, +} from '@taiga-ui/addon-mobile'; import {TuiButtonModule, TuiLinkModule} from '@taiga-ui/core'; import {TuiIslandModule} from '@taiga-ui/kit'; import {TuiMobileThemesExample1} from './examples/1'; @@ -18,6 +23,8 @@ import {ExampleTuiMobileThemesComponent} from './mobile-themes.component'; TuiButtonModule, TuiLinkModule, TuiIslandModule, + TuiRippleModule, + TuiTouchableModule, ...TUI_DOC_PAGE_MODULES, RouterModule.forChild(generateRoutes(ExampleTuiMobileThemesComponent)), ], diff --git a/projects/demo/src/modules/components/mobile-themes/mobile-themes.template.html b/projects/demo/src/modules/components/mobile-themes/mobile-themes.template.html index fab943d2163c..14b999413bbf 100644 --- a/projects/demo/src/modules/components/mobile-themes/mobile-themes.template.html +++ b/projects/demo/src/modules/components/mobile-themes/mobile-themes.template.html @@ -1,7 +1,7 @@ Import TuiThemeAndroidModule into your app.module and add - tui-theme-android compoent to enable anroid theme. + tui-theme-android component to enable Android theme. TUI_IS_ANDROID can help to recognize Android user diff --git a/projects/demo/src/modules/components/notification/examples/1/index.html b/projects/demo/src/modules/components/notification/examples/1/index.html index 1e717c68b4d8..89242a2bc24e 100644 --- a/projects/demo/src/modules/components/notification/examples/1/index.html +++ b/projects/demo/src/modules/components/notification/examples/1/index.html @@ -1,5 +1,5 @@
    - + A short simple informative message. It can be multiline if you need it diff --git a/projects/demo/src/modules/components/notification/examples/1/index.ts b/projects/demo/src/modules/components/notification/examples/1/index.ts index 04cebb5b3667..e654a484f989 100644 --- a/projects/demo/src/modules/components/notification/examples/1/index.ts +++ b/projects/demo/src/modules/components/notification/examples/1/index.ts @@ -9,4 +9,6 @@ import {encapsulation} from '../../../../../view-encapsulation'; changeDetection, encapsulation, }) -export class TuiNotificationExample1 {} +export class TuiNotificationExample1 { + onClose() {} +} diff --git a/projects/demo/src/modules/components/notification/examples/import/insert-template.txt b/projects/demo/src/modules/components/notification/examples/import/insert-template.txt index 1e9618d28651..5537425fc4e9 100644 --- a/projects/demo/src/modules/components/notification/examples/import/insert-template.txt +++ b/projects/demo/src/modules/components/notification/examples/import/insert-template.txt @@ -1,4 +1,7 @@ -Some content + + Some content + diff --git a/projects/demo/src/modules/components/notification/notification.component.ts b/projects/demo/src/modules/components/notification/notification.component.ts index 682a22b4125f..52ebde1d9dd7 100644 --- a/projects/demo/src/modules/components/notification/notification.component.ts +++ b/projects/demo/src/modules/components/notification/notification.component.ts @@ -26,7 +26,6 @@ export class ExampleTuiNotificationComponent { }; hasIcon = true; - hasCloseButton = true; readonly statusVariants: ReadonlyArray = [ TuiNotification.Info, diff --git a/projects/demo/src/modules/components/notification/notification.template.html b/projects/demo/src/modules/components/notification/notification.template.html index 107f0f7d5822..ad0300dd8a91 100644 --- a/projects/demo/src/modules/components/notification/notification.template.html +++ b/projects/demo/src/modules/components/notification/notification.template.html @@ -18,23 +18,14 @@ A short simple informative message + A short simple informative message + - - Enables close cross - - Emits click on close cross + Emits click on close cross. When subscribed to, close button + appears. diff --git a/projects/demo/src/modules/components/pull-to-refresh/pull-to-refresh.template.html b/projects/demo/src/modules/components/pull-to-refresh/pull-to-refresh.template.html index 2863935e2926..a25ea4110e23 100644 --- a/projects/demo/src/modules/components/pull-to-refresh/pull-to-refresh.template.html +++ b/projects/demo/src/modules/components/pull-to-refresh/pull-to-refresh.template.html @@ -5,7 +5,7 @@ of native iOS and Android components

    - +
    It emits (pulled) event when user wants to start loading. diff --git a/projects/demo/src/modules/components/scrollbar/scrollbar.template.html b/projects/demo/src/modules/components/scrollbar/scrollbar.template.html index 889e5b83b513..aac017238c2f 100644 --- a/projects/demo/src/modules/components/scrollbar/scrollbar.template.html +++ b/projects/demo/src/modules/components/scrollbar/scrollbar.template.html @@ -9,11 +9,7 @@ Native scrollbar is hidden to keep native platform scroll expirience

    - + Use TUI_SCROLL_REF token to get a scrollable container. For example, when working with virtual scroll. diff --git a/projects/demo/src/modules/components/tabs/tabs.template.html b/projects/demo/src/modules/components/tabs/tabs.template.html index a693995e28f6..a684a03a88dd 100644 --- a/projects/demo/src/modules/components/tabs/tabs.template.html +++ b/projects/demo/src/modules/components/tabs/tabs.template.html @@ -5,7 +5,7 @@ native iOS and Android components.

    - + If you use routerLink, add also routerLinkActive directive. diff --git a/projects/demo/src/modules/info/browsers/browsers.module.ts b/projects/demo/src/modules/info/browsers/browsers.module.ts index 6f8f2c994bcb..66261197f4a1 100644 --- a/projects/demo/src/modules/info/browsers/browsers.module.ts +++ b/projects/demo/src/modules/info/browsers/browsers.module.ts @@ -1,10 +1,12 @@ import {NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; import {generateRoutes, TUI_DOC_PAGE_MODULES} from '@taiga-ui/addon-doc'; +import {TuiLinkModule} from '@taiga-ui/core'; import {BrowsersComponent} from './browsers.component'; @NgModule({ imports: [ + TuiLinkModule, ...TUI_DOC_PAGE_MODULES, RouterModule.forChild(generateRoutes(BrowsersComponent)), ], diff --git a/projects/demo/src/modules/info/browsers/browsers.template.html b/projects/demo/src/modules/info/browsers/browsers.template.html index 6b6d501f18c4..8b09c008b228 100644 --- a/projects/demo/src/modules/info/browsers/browsers.template.html +++ b/projects/demo/src/modules/info/browsers/browsers.template.html @@ -28,7 +28,22 @@

    Desktop

    Microsoft Internet Explorer - 11+ + + 11+ +
    + + See + + instructions + + on how to enable + +
    + Edge (EdgeHTML) diff --git a/projects/demo/src/modules/info/doc/doc.template.html b/projects/demo/src/modules/info/doc/doc.template.html index 326e2a116f8a..3054bc767de0 100644 --- a/projects/demo/src/modules/info/doc/doc.template.html +++ b/projects/demo/src/modules/info/doc/doc.template.html @@ -7,12 +7,15 @@
    npm install @taiga-ui/addon-doc
    -

    And setup with project README intructions:

    - - README.md - +

    + And use with project + + README.md + + instructions. +

    diff --git a/projects/demo/src/modules/info/related/related.template.html b/projects/demo/src/modules/info/related/related.template.html index 91c11e991b00..dea607f0af04 100644 --- a/projects/demo/src/modules/info/related/related.template.html +++ b/projects/demo/src/modules/info/related/related.template.html @@ -1,7 +1,7 @@

    - We maintain these projects by ourselves and higly recommend them for - modern Angular app + We maintain these projects ourselves and higly recommend them for modern + Angular apps

    @@ -20,9 +20,10 @@ @@ -35,10 +36,15 @@ @@ -84,7 +90,13 @@ diff --git a/projects/demo/src/modules/markup/colors/colors.template.html b/projects/demo/src/modules/markup/colors/colors.template.html index a4b87f4b1c92..15c2692c0a4b 100644 --- a/projects/demo/src/modules/markup/colors/colors.template.html +++ b/projects/demo/src/modules/markup/colors/colors.template.html @@ -4,7 +4,7 @@
    - A tiny library for polymorphic templates in Angular that - abstracts over different ways of view customization in - Angular with one simple attribute component + A tiny library that abstracts over different ways of view + customization in Angular with one simple attribute + component. + Included with @taiga-ui/cdk
    - A tiny (1KB gzip) library for optimizing change detection - cycles for performance sensitive events (such as touchmove, - scroll, drag etc.) and declarative preventDefault() and - stopPropagation(). + Angular event plugins library for optimizing change + detection cycles for performance sensitive events (such as + touchmove, scroll, + drag etc.) and declarative + preventDefault() and + stopPropagation() as well as capture phase + listeners. + Included with @taiga-ui/cdk + and enabled by TuiRootModule
    High quality lightweight wrappers for native Web APIs for - idiomatic use with Angular + idiomatic use with Angular. + + @ng-web-apis/common, + @ng-web-apis/mutation-observer and + @ng-web-apis/resize-observer are included + with @taiga-ui/cdk +
    - +
    diff --git a/projects/demo/src/modules/markup/grid/examples/1/index.html b/projects/demo/src/modules/markup/grid/examples/1/index.html index 648a597b708c..46d1a85d82b4 100644 --- a/projects/demo/src/modules/markup/grid/examples/1/index.html +++ b/projects/demo/src/modules/markup/grid/examples/1/index.html @@ -104,44 +104,3 @@
    -

    Temporary layout for SME transition

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    diff --git a/projects/demo/src/modules/markup/icons/icons.module.ts b/projects/demo/src/modules/markup/icons/icons.module.ts index bef18fb83507..bd753d7c6207 100644 --- a/projects/demo/src/modules/markup/icons/icons.module.ts +++ b/projects/demo/src/modules/markup/icons/icons.module.ts @@ -5,6 +5,7 @@ import {RouterModule} from '@angular/router'; import {generateRoutes, TUI_DOC_PAGE_MODULES} from '@taiga-ui/addon-doc'; import { TuiButtonModule, + TuiHintControllerModule, TuiLinkModule, TuiSvgModule, TuiTextfieldControllerModule, @@ -23,6 +24,7 @@ import {IconsComponent} from './icons.component'; TuiInputModule, TuiButtonModule, TuiTextfieldControllerModule, + TuiHintControllerModule, ...TUI_DOC_PAGE_MODULES, RouterModule.forChild(generateRoutes(IconsComponent)), ], diff --git a/projects/demo/src/modules/markup/icons/icons.template.html b/projects/demo/src/modules/markup/icons/icons.template.html index 35c9c36393bf..d8a90ab5a202 100644 --- a/projects/demo/src/modules/markup/icons/icons.template.html +++ b/projects/demo/src/modules/markup/icons/icons.template.html @@ -1,22 +1,14 @@ -

    - Icons can be imported in a component or can be used - by its name. You can copy icon's name with a click -

    -

    - Use CSS color style to set an icon color. You can also - use fill for icons with two colors: - -

    Search by name

    - Input icons name to highlight + Input icon name to highlight

    Логотипы

    diff --git a/projects/demo/src/modules/markup/shadows/shadows.style.less b/projects/demo/src/modules/markup/shadows/shadows.style.less index ae348454d667..ecd3ad0eaf64 100644 --- a/projects/demo/src/modules/markup/shadows/shadows.style.less +++ b/projects/demo/src/modules/markup/shadows/shadows.style.less @@ -1,10 +1,5 @@ @import 'taiga-ui-local'; -.wrapper { - display: flex; - align-items: flex-start; -} - .example { display: flex; flex: 1; @@ -12,10 +7,6 @@ padding: 20px; } -.code { - flex: 1; -} - .item { .transition(box-shadow); display: flex; @@ -23,14 +14,14 @@ justify-content: center; margin-top: 40px; margin-left: 40px; - width: 160px; + width: 280px; height: 80px; border-radius: var(--tui-radius); color: var(--tui-text-03); cursor: pointer; text-align: center; - &_standart { + &_default { .shadow(); &:hover { @@ -49,4 +40,12 @@ &_sidebar { .shadow(4); } + + &_navigation { + .shadow(6); + } + + &_mobile { + .shadow(7); + } } diff --git a/projects/demo/src/modules/markup/shadows/shadows.template.html b/projects/demo/src/modules/markup/shadows/shadows.template.html index 36ac9ec59f38..53331182b133 100644 --- a/projects/demo/src/modules/markup/shadows/shadows.template.html +++ b/projects/demo/src/modules/markup/shadows/shadows.template.html @@ -1,39 +1,28 @@ -
    -
    -
    Basic shadow
    -
    Dropdown shadow
    -
    Modal shadow
    -
    Sidebar shadow
    +

    Different kinds of shadows can be applied with mixin:

    +
    +
    + + Basic shadow: .shadow(1) with + .shadow(5) when hovered + +
    +
    + Dropdown shadow: .shadow(2) +
    +
    + Modal shadow: .shadow(3) +
    +
    + Sidebar shadow: .shadow(4) +
    +
    + Navigation shadow: .shadow(6) +
    +
    + Mobile modal shadow: .shadow(7)
    -
    -                .item {
    -                    // Card
    -                    &_standart {
    -                        .shadow();
    -
    -                        &:hover {
    -                            .shadow(5);
    -                        }
    -                    }
    -
    -                    // Dropdown
    -                    &_dropdown {
    -                        .shadow(2);
    -                    }
    -
    -                    // Modal
    -                    &_modal {
    -                        .shadow(3);
    -                    }
    -
    -                    // Sidebar
    -                    &_dialog {
    -                        .shadow(4);
    -                    }
    -                }
    -            
    diff --git a/projects/demo/src/modules/markup/skeleton/examples/1/index.html b/projects/demo/src/modules/markup/skeleton/examples/1/index.html index e3180b0e2c16..fefb9b9921c8 100644 --- a/projects/demo/src/modules/markup/skeleton/examples/1/index.html +++ b/projects/demo/src/modules/markup/skeleton/examples/1/index.html @@ -13,7 +13,11 @@

    -
    +
    diff --git a/projects/demo/src/modules/markup/skeleton/examples/1/index.style.less b/projects/demo/src/modules/markup/skeleton/examples/1/index.less similarity index 83% rename from projects/demo/src/modules/markup/skeleton/examples/1/index.style.less rename to projects/demo/src/modules/markup/skeleton/examples/1/index.less index b5ac74334fd2..d302a1f2fdb2 100644 --- a/projects/demo/src/modules/markup/skeleton/examples/1/index.style.less +++ b/projects/demo/src/modules/markup/skeleton/examples/1/index.less @@ -4,6 +4,10 @@ &_dark { background-image: linear-gradient(225deg, #3023ae, #c86dd7); + + & * { + color: var(--tui-text-01-night); + } } } diff --git a/projects/demo/src/modules/markup/skeleton/examples/1/index.ts b/projects/demo/src/modules/markup/skeleton/examples/1/index.ts index 37454976489b..55e0974ff7a4 100644 --- a/projects/demo/src/modules/markup/skeleton/examples/1/index.ts +++ b/projects/demo/src/modules/markup/skeleton/examples/1/index.ts @@ -6,7 +6,7 @@ import {encapsulation} from '../../../../../view-encapsulation'; @Component({ selector: 'tui-skeleton-example-1', templateUrl: './index.html', - styleUrls: ['./index.style.less'], + styleUrls: ['./index.less'], changeDetection, encapsulation, }) diff --git a/projects/demo/src/modules/markup/skeleton/examples/2/index.html b/projects/demo/src/modules/markup/skeleton/examples/2/index.html index dce479a6ce27..000f7ef18ba7 100644 --- a/projects/demo/src/modules/markup/skeleton/examples/2/index.html +++ b/projects/demo/src/modules/markup/skeleton/examples/2/index.html @@ -16,7 +16,11 @@
    -
    +

    - Use .tui-skeleton class to an element to add + Use .tui-skeleton class on an element to add skeleton of the same size above it.

    You can also use the following modifiers:

    diff --git a/projects/demo/src/modules/markup/spaces/spaces.template.html b/projects/demo/src/modules/markup/spaces/spaces.template.html index 52cee3535b89..e204083776ae 100644 --- a/projects/demo/src/modules/markup/spaces/spaces.template.html +++ b/projects/demo/src/modules/markup/spaces/spaces.template.html @@ -14,20 +14,21 @@ (tui-space_<direction>-<value>).
    - -
    Mixins are included in local LESS styles, so you need to import them into LESS styles file and add it to classes of your component
    - Mixin also gets a direction and a value (.tui-space(<direction>, <value>);). + + +

    + Mixin also gets a direction and a value ( + .tui-space(<direction>, <value>);). +

    Use .tui-table class to add Taiga styles to a table

    + + + An advanced separate @taiga-ui/table package with + interactive tables is in development + +

    Elements

      :root block in CSS to make a custom theme. You can also reassign a speficic component styles with tui-wrapper. Theme can be switched in runtime with a - ThemeSwitcher - component. + + ThemeSwitcher + + component. More advanced theming tools and techniques are planned for + future releases.

      Examples diff --git a/projects/demo/src/modules/services/dialogs/dialogs.template.html b/projects/demo/src/modules/services/dialogs/dialogs.template.html index 3c505711aed0..7bd6a3e29d6f 100644 --- a/projects/demo/src/modules/services/dialogs/dialogs.template.html +++ b/projects/demo/src/modules/services/dialogs/dialogs.template.html @@ -2,22 +2,14 @@

      Optional service to show modal windows

      - + Use TUI_DIALOGS_CLOSE token if you need to close dialog with from a stream. For example, this way you can close dialogs by routing:

      - + Do not forget to add TuiDialogModule into your app.module to use dialogs (See also "Setup" for details) diff --git a/projects/demo/src/modules/services/notifications/notifications.template.html b/projects/demo/src/modules/services/notifications/notifications.template.html index 68e975de4231..42a8c5c68172 100644 --- a/projects/demo/src/modules/services/notifications/notifications.template.html +++ b/projects/demo/src/modules/services/notifications/notifications.template.html @@ -121,7 +121,7 @@ documentationPropertyType="boolean" [(documentationPropertyValue)]="hasCloseButton" > - Has close cross + Has close button
      diff --git a/projects/demo/src/modules/services/table-bar/table-bar.template.html b/projects/demo/src/modules/services/table-bar/table-bar.template.html index ae730583243e..e46275f88f64 100644 --- a/projects/demo/src/modules/services/table-bar/table-bar.template.html +++ b/projects/demo/src/modules/services/table-bar/table-bar.template.html @@ -49,7 +49,7 @@ documentationPropertyType="boolean" [(documentationPropertyValue)]="hasCloseButton" > - Enable close cross + Enable close button Date: Sat, 26 Dec 2020 00:06:09 +0300 Subject: [PATCH 2/2] feat(demo): more translation fixes --- package-lock.json | 8 ++-- package.json | 2 +- .../bar-chart/bar-chart.template.html | 5 ++- .../line-chart/line-chart.template.html | 5 ++- .../line-days-chart.template.html | 5 ++- .../pie-chart/pie-chart.template.html | 5 ++- .../ring-chart/ring-chart.template.html | 5 ++- projects/addon-charts/package.json | 2 +- projects/addon-commerce/package.json | 2 +- projects/addon-doc/package.json | 2 +- .../source-code/source-code.template.html | 5 ++- .../mobile-dialog/mobile-dialog.template.html | 5 ++- .../directives/sidebar/sidebar.template.html | 5 ++- projects/addon-mobile/package.json | 2 +- projects/addon-table/package.json | 2 +- .../table-bars-host.template.html | 5 ++- projects/addon-tablebars/package.json | 2 +- .../dialog-host/dialog-host.template.html | 5 ++- projects/cdk/decorators/default-prop.ts | 8 ++-- projects/cdk/decorators/required-setter.ts | 6 +-- projects/cdk/package.json | 4 +- projects/cdk/types/assertion.ts | 4 -- projects/cdk/types/index.ts | 1 - .../components/button/button.template.html | 9 +++-- .../components/calendar/calendar.component.ts | 19 +-------- .../dropdown-box/dropdown-box.template.html | 5 ++- .../core/components/error/error.template.html | 5 ++- .../components/expand/expand.template.html | 2 +- .../hints-host/hints-host.template.html | 4 +- .../core/components/label/label.template.html | 4 +- .../components/loader/loader.template.html | 5 ++- .../primitive-textfield.template.html | 15 ++++--- .../notification-alert.template.html | 10 +++-- projects/core/package.json | 2 +- projects/demo/src/assets/images/card.jpg | Bin 0 -> 105533 bytes projects/demo/src/index.html | 36 +++++++++++++++-- .../modules/app/landing/landing.component.ts | 22 +++++++++- .../modules/app/landing/landing.style.less | 9 +++-- .../modules/app/landing/landing.template.html | 8 +++- projects/demo/src/modules/app/pages.ts | 8 ++-- .../modules/charts/axes/axes.template.html | 2 +- .../charts/bar-chart/bar-chart.template.html | 2 +- .../charts/bar-set/bar-set.template.html | 2 +- .../src/modules/charts/bar/bar.template.html | 2 +- .../legend-item/legend-item.template.html | 2 +- .../line-chart/line-chart.template.html | 2 +- .../line-days-chart.template.html | 2 +- .../charts/pie-chart/pie-chart.template.html | 2 +- .../ring-chart/ring-chart.template.html | 2 +- .../components/action/action.template.html | 2 +- .../components/avatar/avatar.template.html | 2 +- .../components/badge/badge.template.html | 2 +- .../badged-content.template.html | 2 +- .../breadcrumbs/breadcrumbs.component.ts | 38 +++++++++--------- .../breadcrumbs/breadcrumbs.template.html | 4 +- .../components/button/button.template.html | 2 +- .../calendar-month.template.html | 2 +- .../calendar/calendar.template.html | 2 +- .../components/card/card.template.html | 2 +- .../checkbox-block.template.html | 2 +- .../checkbox-labeled.template.html | 2 +- .../checkbox/checkbox.template.html | 2 +- .../color-picker/color-picker.template.html | 2 +- .../combo-box/combo-box.template.html | 2 +- .../data-list/data-list.template.html | 2 +- .../components/editor/editor.template.html | 2 +- .../components/error/error.template.html | 2 +- .../components/expand/expand.template.html | 2 +- .../field-error/field-error.template.html | 2 +- .../components/filter/filter.template.html | 2 +- .../components/group/group.template.html | 2 +- .../hosted-dropdown.template.html | 2 +- .../input-card-grouped.template.html | 2 +- .../input-card/input-card.template.html | 2 +- .../input-copy/input-copy.template.html | 2 +- .../input-count/input-count.template.html | 2 +- .../input-file/input-file.template.html | 2 +- .../input-inline/input-inline.template.html | 2 +- .../input-number/input-number.template.html | 2 +- .../input-password.template.html | 2 +- .../input-phone-international.template.html | 2 +- .../input-phone/input-phone.template.html | 2 +- .../input-range/input-range.template.html | 2 +- .../input-slider/input-slider.template.html | 2 +- .../input-tag/input-tag.template.html | 2 +- .../input-time/input-time.template.html | 2 +- .../components/input/input.template.html | 2 +- .../components/island/island.template.html | 2 +- .../components/label/label.template.html | 2 +- .../line-clamp/line-clamp.template.html | 2 +- .../components/link/examples/1/index.html | 5 +-- .../components/link/link.template.html | 2 +- .../components/loader/loader.template.html | 2 +- .../marker-icon/marker-icon.template.html | 2 +- .../mobile-calendar.template.html | 2 +- .../components/money/money.template.html | 2 +- .../multi-select/multi-select.template.html | 2 +- .../notification/examples/1/index.html | 2 +- .../notification/examples/1/index.ts | 4 +- .../notification/notification.template.html | 2 +- .../pagination/pagination.template.html | 10 ++--- .../primitive-checkbox.template.html | 2 +- .../primitive-textfield.template.html | 2 +- .../pull-to-refresh.template.html | 2 +- .../radio-block/radio-block.template.html | 2 +- .../radio-labeled/radio-labeled.template.html | 2 +- .../radio-list/radio-list.template.html | 2 +- .../components/radio/radio.template.html | 2 +- .../components/range/range.template.html | 2 +- .../scrollbar/scrollbar.template.html | 2 +- .../components/select/select.template.html | 2 +- .../components/slider/slider.template.html | 2 +- .../components/stepper/stepper.template.html | 2 +- .../modules/components/svg/svg.template.html | 2 +- .../components/tabs/tabs.template.html | 9 +++-- .../modules/components/tag/tag.template.html | 2 +- .../text-area/text-area.template.html | 2 +- .../components/toggle/toggle.template.html | 2 +- .../components/toolbar/toolbar.template.html | 2 +- .../components/tooltip/tooltip.template.html | 2 +- .../default-prop-demo.component.ts | 9 ++--- .../default-prop/default-prop.component.ts | 2 - .../default-prop/default-prop.template.html | 34 +++++++--------- .../default-prop/import/example-decorator.txt | 9 ++--- .../decorators/pure/pure.template.html | 18 ++++----- .../import/example-decorator.txt | 9 ++--- .../required-setter-demo.component.ts | 9 ++--- .../required-setter.component.ts | 4 +- .../required-setter.template.html | 30 +++++++------- .../active-zone/active-zone.template.html | 2 +- .../auto-focus/auto-focus.template.html | 2 +- .../directives/color/color.template.html | 2 +- .../dropdown-selection.template.html | 2 +- .../dropdown/dropdown.template.html | 2 +- .../elastic-sticky.template.html | 2 +- .../directives/element/element.template.html | 2 +- .../highlight/highlight.template.html | 2 +- .../directives/hint/hint.template.html | 2 +- .../modules/directives/let/let.template.html | 2 +- .../manual-hint/manual-hint.template.html | 2 +- .../directives/media/media.template.html | 2 +- .../directives/mode/mode.template.html | 2 +- .../pointer-hint/pointer-hint.template.html | 2 +- .../directives/present/present.template.html | 2 +- .../directives/ripple/ripple.template.html | 2 +- .../touchable/touchable.template.html | 2 +- .../validator/validator.template.html | 2 +- .../tables/reorder/reorder.template.html | 2 +- .../resizable-column.template.html | 2 +- .../table-pagination.template.html | 2 +- projects/kit/abstract/input-slider.ts | 12 +++--- .../accordion-item.template.html | 5 ++- .../badged-content.template.html | 10 +++-- .../calendar-month.component.ts | 8 +--- .../calendar-range.component.ts | 8 +--- .../combo-box/combo-box.template.html | 5 ++- .../components/filter/filter.template.html | 5 ++- .../input-copy/input-copy.template.html | 2 +- .../input-count/input-count.component.ts | 3 +- .../input-date-range.component.ts | 4 +- .../input-date-time.component.ts | 9 +---- .../input-date/input-date.component.ts | 9 +---- .../input-file/file/file.template.html | 5 ++- .../input-month-range.component.ts | 3 +- .../input-month/input-month.component.ts | 3 +- .../input-number/input-number.component.ts | 3 +- .../line-clamp/line-clamp.template.html | 5 ++- .../pagination/pagination.component.ts | 9 ++--- .../pagination/pagination.template.html | 5 ++- .../radio-list/radio-list.template.html | 5 ++- .../components/select/select.template.html | 5 ++- .../tabs-with-more.template.html | 4 +- projects/kit/components/tag/tag.template.html | 5 ++- projects/kit/constants/assert-functions.ts | 16 -------- projects/kit/constants/assert-messages.ts | 8 ---- projects/kit/constants/index.ts | 2 - projects/kit/package.json | 2 +- 177 files changed, 392 insertions(+), 410 deletions(-) delete mode 100644 projects/cdk/types/assertion.ts create mode 100644 projects/demo/src/assets/images/card.jpg delete mode 100644 projects/kit/constants/assert-functions.ts delete mode 100644 projects/kit/constants/assert-messages.ts diff --git a/package-lock.json b/package-lock.json index d30ca5a2d5dd..a072da56e676 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2822,11 +2822,11 @@ } }, "@tinkoff/ng-polymorpheus": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@tinkoff/ng-polymorpheus/-/ng-polymorpheus-2.1.0.tgz", - "integrity": "sha512-3w3b6GNHjNhEArRWv7SOY2YuQt8ELZQW6TBMV7Q/idvaMPSdWcinYq7xPFZjC2i/ha4LexHnvqXnRmhFpleo9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@tinkoff/ng-polymorpheus/-/ng-polymorpheus-3.0.0.tgz", + "integrity": "sha512-I4b0c3u6XRNUb/hpXETlezK5FxQCRwyEoPYs8WQ6xnphFzHPeeSZzQjjMbp83qaJHon3go56aktv6lFoNDI3KA==", "requires": { - "tslib": "^1.9.0" + "tslib": "^1.10.0" } }, "@types/body-parser": { diff --git a/package.json b/package.json index a0120c08bd8e..1a202e3563ed 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@tinkoff/angular-contenteditable-accessor": "1.1.0", "@tinkoff/ng-dompurify": "3.0.0", "@tinkoff/ng-event-plugins": "2.0.0", - "@tinkoff/ng-polymorpheus": "2.1.0", + "@tinkoff/ng-polymorpheus": "3.0.0", "angular2-text-mask": "9.0.0", "classlist.js": "^1.1.20150312", "core-js": "^2.6.9", diff --git a/projects/addon-charts/components/bar-chart/bar-chart.template.html b/projects/addon-charts/components/bar-chart/bar-chart.template.html index 6b549501f17c..17496e59a5fe 100644 --- a/projects/addon-charts/components/bar-chart/bar-chart.template.html +++ b/projects/addon-charts/components/bar-chart/bar-chart.template.html @@ -21,10 +21,11 @@ >

    - + >
    diff --git a/projects/addon-charts/components/line-chart/line-chart.template.html b/projects/addon-charts/components/line-chart/line-chart.template.html index bb67c05f8518..ea3c629b4818 100644 --- a/projects/addon-charts/components/line-chart/line-chart.template.html +++ b/projects/addon-charts/components/line-chart/line-chart.template.html @@ -72,11 +72,12 @@ [style.bottom.%]="getBottom(point[1])" >
    - + >
    diff --git a/projects/addon-charts/components/line-days-chart/line-days-chart.template.html b/projects/addon-charts/components/line-days-chart/line-days-chart.template.html index 170fa48ed28a..8dde776b3d30 100644 --- a/projects/addon-charts/components/line-days-chart/line-days-chart.template.html +++ b/projects/addon-charts/components/line-days-chart/line-days-chart.template.html @@ -14,8 +14,9 @@ [xStringify]="xStringify ? daysStringify : null" > - + >
    diff --git a/projects/addon-charts/components/pie-chart/pie-chart.template.html b/projects/addon-charts/components/pie-chart/pie-chart.template.html index 515d8020c18d..b4426b96b233 100644 --- a/projects/addon-charts/components/pie-chart/pie-chart.template.html +++ b/projects/addon-charts/components/pie-chart/pie-chart.template.html @@ -41,9 +41,10 @@ - + >
    diff --git a/projects/addon-charts/components/ring-chart/ring-chart.template.html b/projects/addon-charts/components/ring-chart/ring-chart.template.html index b1a075fb78fa..4120d3f2a9ee 100644 --- a/projects/addon-charts/components/ring-chart/ring-chart.template.html +++ b/projects/addon-charts/components/ring-chart/ring-chart.template.html @@ -1,10 +1,11 @@
    - + >
    =6.0.0", "@angular/core": ">=6.0.0", - "@tinkoff/ng-polymorpheus": ">=2.0.0", + "@tinkoff/ng-polymorpheus": ">=3.0.0", "@taiga-ui/cdk": "1.6.5", "@taiga-ui/core": "1.6.5" }, diff --git a/projects/addon-commerce/package.json b/projects/addon-commerce/package.json index f53a0ad1f1bc..3da0bb7ddfb1 100644 --- a/projects/addon-commerce/package.json +++ b/projects/addon-commerce/package.json @@ -17,7 +17,7 @@ "@angular/common": ">=6.0.0", "@angular/core": ">=6.0.0", "@angular/forms": ">=6.0.0", - "@tinkoff/ng-polymorpheus": ">=2.0.0", + "@tinkoff/ng-polymorpheus": ">=3.0.0", "@taiga-ui/cdk": "1.6.5", "@taiga-ui/core": "1.6.5", "angular2-text-mask": "9.0.0", diff --git a/projects/addon-doc/package.json b/projects/addon-doc/package.json index 694b4d450962..dc505feaf5d1 100644 --- a/projects/addon-doc/package.json +++ b/projects/addon-doc/package.json @@ -20,7 +20,7 @@ "@angular/forms": ">=6.0.0", "@angular/router": ">=6.0.0", "@angular-devkit/schematics": "^8.3.21", - "@tinkoff/ng-polymorpheus": ">=2.0.0", + "@tinkoff/ng-polymorpheus": ">=3.0.0", "@taiga-ui/cdk": "1.6.5", "@taiga-ui/core": "1.6.5", "@taiga-ui/kit": "1.6.5", diff --git a/projects/addon-doc/src/internal/source-code/source-code.template.html b/projects/addon-doc/src/internal/source-code/source-code.template.html index c9b59b0dd251..3aa8a4680e84 100644 --- a/projects/addon-doc/src/internal/source-code/source-code.template.html +++ b/projects/addon-doc/src/internal/source-code/source-code.template.html @@ -1,4 +1,5 @@ - - +
    diff --git a/projects/addon-mobile/components/mobile-dialog/mobile-dialog.template.html b/projects/addon-mobile/components/mobile-dialog/mobile-dialog.template.html index e21e38f4f869..16d0f37ef681 100644 --- a/projects/addon-mobile/components/mobile-dialog/mobile-dialog.template.html +++ b/projects/addon-mobile/components/mobile-dialog/mobile-dialog.template.html @@ -1,11 +1,12 @@

    {{internal.label}}

    - +> by Tinkoff diff --git a/projects/demo/src/modules/app/pages.ts b/projects/demo/src/modules/app/pages.ts index 9cc2894691b5..0afb22fcc4cb 100644 --- a/projects/demo/src/modules/app/pages.ts +++ b/projects/demo/src/modules/app/pages.ts @@ -753,7 +753,7 @@ export const pages: TuiDocPages = [ }, { section: $localize`Tools`, - title: 'Декораторы', + title: $localize`Decorators`, subPages: [ { section: $localize`Tools`, @@ -780,7 +780,7 @@ export const pages: TuiDocPages = [ }, { section: $localize`Tools`, - title: 'Директивы', + title: $localize`Directives`, subPages: [ { section: $localize`Tools`, @@ -926,7 +926,7 @@ export const pages: TuiDocPages = [ }, { section: $localize`Tools`, - title: 'Пайпы', + title: $localize`Pipes`, subPages: [ { section: $localize`Tools`, @@ -965,7 +965,7 @@ export const pages: TuiDocPages = [ }, { section: $localize`Tools`, - title: 'Сервисы', + title: $localize`Services`, subPages: [ { section: $localize`Tools`, diff --git a/projects/demo/src/modules/charts/axes/axes.template.html b/projects/demo/src/modules/charts/axes/axes.template.html index 607a30f9258f..09e37eff6ebf 100644 --- a/projects/demo/src/modules/charts/axes/axes.template.html +++ b/projects/demo/src/modules/charts/axes/axes.template.html @@ -184,7 +184,7 @@
  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    = ['m', 'l']; diff --git a/projects/demo/src/modules/components/breadcrumbs/breadcrumbs.template.html b/projects/demo/src/modules/components/breadcrumbs/breadcrumbs.template.html index ea759ee7e7ad..16c421e86ad6 100644 --- a/projects/demo/src/modules/components/breadcrumbs/breadcrumbs.template.html +++ b/projects/demo/src/modules/components/breadcrumbs/breadcrumbs.template.html @@ -1,7 +1,7 @@

    - Navigation element that shows a path from root page to current + Navigation element that shows a path from root page to the current

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    Option
  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    Some heading
  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    Link -

    - Previous visited link -

    +Link diff --git a/projects/demo/src/modules/components/link/link.template.html b/projects/demo/src/modules/components/link/link.template.html index 3110ddb51e52..da44ed7095a2 100644 --- a/projects/demo/src/modules/components/link/link.template.html +++ b/projects/demo/src/modules/components/link/link.template.html @@ -129,7 +129,7 @@
  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    - + A short simple informative message. It can be multiline if you need it diff --git a/projects/demo/src/modules/components/notification/examples/1/index.ts b/projects/demo/src/modules/components/notification/examples/1/index.ts index e654a484f989..04cebb5b3667 100644 --- a/projects/demo/src/modules/components/notification/examples/1/index.ts +++ b/projects/demo/src/modules/components/notification/examples/1/index.ts @@ -9,6 +9,4 @@ import {encapsulation} from '../../../../../view-encapsulation'; changeDetection, encapsulation, }) -export class TuiNotificationExample1 { - onClose() {} -} +export class TuiNotificationExample1 {} diff --git a/projects/demo/src/modules/components/notification/notification.template.html b/projects/demo/src/modules/components/notification/notification.template.html index ad0300dd8a91..6c59fd1fa23c 100644 --- a/projects/demo/src/modules/components/notification/notification.template.html +++ b/projects/demo/src/modules/components/notification/notification.template.html @@ -72,7 +72,7 @@
  • -

    Add into template:

    +

    Add to the template:

    - Принимает фокус с клавиатуры + Accepts focus with keyboard - Индекс активной страницы + Active page index - Количество страниц + Total pages count - Размер + Size @@ -101,7 +101,7 @@
  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    Component for creating tabs. It emulates appearance and behaviour of - native iOS and Android components. + native iOS and Android components when + TUI_MOBILE_AWARE token is true.

    @@ -61,8 +62,8 @@ documentationPropertyType="number" [(documentationPropertyValue)]="itemsLimit" > - Visible tabs by default - for TabsWithMore + Visible tabs count limit + for TabsWithMore only
  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    ( - (quantity, context) => Number.isInteger(quantity) && quantity >= context.min, - 'Should be ingeter number more than min value', + @tuiDefaultProp( + quantity => Number.isInteger(quantity) && quantity >= 5, + 'Should be integer number more than min value', ) quantity = 10; } diff --git a/projects/demo/src/modules/decorators/default-prop/default-prop.component.ts b/projects/demo/src/modules/decorators/default-prop/default-prop.component.ts index b2822075b297..3f606a6f8709 100644 --- a/projects/demo/src/modules/decorators/default-prop/default-prop.component.ts +++ b/projects/demo/src/modules/decorators/default-prop/default-prop.component.ts @@ -12,8 +12,6 @@ export class ExampleTuiDefaultPropComponent { quantity: number | undefined = 10; - min = 10; - setUndefined() { this.quantity = undefined; } diff --git a/projects/demo/src/modules/decorators/default-prop/default-prop.template.html b/projects/demo/src/modules/decorators/default-prop/default-prop.template.html index f179c124859d..975b6958a9b7 100644 --- a/projects/demo/src/modules/decorators/default-prop/default-prop.template.html +++ b/projects/demo/src/modules/decorators/default-prop/default-prop.template.html @@ -7,28 +7,29 @@ Warning: decorator overrides getter/setter of input +

    + Decorator stops undefined values if they were passed + into input. If it gets undefined, it will use default + value and show an error message about the problem in console in dev + mode. +

    +
    See - RequiredSetter + + RequiredSetter + for work with setters
    - -
    -

    See console

    +

    See console. Min value is 5

    quantity - - min -
  • -

    Add into template and subscribe to a change:

    +

    Add to the template and subscribe to a change:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

  • -

    Add into template:

    +

    Add to the template:

    0; +} + /** * @internal */ @@ -65,7 +65,7 @@ export abstract class AbstractTuiInputSlider steps = 0; @Input() - @tuiDefaultProp(quantumAssertion, incorrectQuantumMessage) + @tuiDefaultProp(quantumAssertion, 'Quantum must be positive') quantum = 1; @Input() diff --git a/projects/kit/components/accordion/accordion-item/accordion-item.template.html b/projects/kit/components/accordion/accordion-item/accordion-item.template.html index d58ccab77dbd..ff4079e5b3f5 100644 --- a/projects/kit/components/accordion/accordion-item/accordion-item.template.html +++ b/projects/kit/components/accordion/accordion-item/accordion-item.template.html @@ -29,11 +29,12 @@ - + > diff --git a/projects/kit/components/badged-content/badged-content.template.html b/projects/kit/components/badged-content/badged-content.template.html index 92871b3d6b89..bd6c0656794e 100644 --- a/projects/kit/components/badged-content/badged-content.template.html +++ b/projects/kit/components/badged-content/badged-content.template.html @@ -14,7 +14,8 @@ [style.boxShadow]="boxShadow" > - - + - - + diff --git a/projects/kit/components/calendar-month/calendar-month.component.ts b/projects/kit/components/calendar-month/calendar-month.component.ts index 8eeef2f07893..9963cc67ba34 100644 --- a/projects/kit/components/calendar-month/calendar-month.component.ts +++ b/projects/kit/components/calendar-month/calendar-month.component.ts @@ -25,12 +25,6 @@ import {TuiMonthContext} from '@taiga-ui/kit/interfaces'; import {TUI_CALENDAR_MONTHS} from '@taiga-ui/kit/tokens'; import {TuiBooleanHandlerWithContext} from '@taiga-ui/kit/types'; -function maxMonthAssertion(max: TuiMonth, context: {min: TuiMonth}): boolean { - return max.monthAfter(context.min); -} - -const incorrectMaxMessage = 'Min value must be less than max value'; - const TODAY = TuiDay.currentLocal(); // @dynamic @@ -61,7 +55,7 @@ export class TuiCalendarMonthComponent implements TuiWithOptionalMinMax min: TuiDay = TUI_FIRST_DAY; @Input() - @tuiDefaultProp(maxDayAssertion, incorrectMaxMessage) + @tuiDefaultProp() max: TuiDay = TUI_LAST_DAY; @Input() diff --git a/projects/kit/components/combo-box/combo-box.template.html b/projects/kit/components/combo-box/combo-box.template.html index 870ea13e8c72..ff9a228377b6 100644 --- a/projects/kit/components/combo-box/combo-box.template.html +++ b/projects/kit/components/combo-box/combo-box.template.html @@ -23,12 +23,13 @@ (keydown.enter)="onFieldKeyDownEnter($event)" > - + > diff --git a/projects/kit/components/filter/filter.template.html b/projects/kit/components/filter/filter.template.html index 443ec2aa828e..5e28ac05d9e5 100644 --- a/projects/kit/components/filter/filter.template.html +++ b/projects/kit/components/filter/filter.template.html @@ -9,10 +9,11 @@ (ngModelChange)="onCheckbox($event, item)" >
    - + >
    - +
    diff --git a/projects/kit/components/input-count/input-count.component.ts b/projects/kit/components/input-count/input-count.component.ts index eab6d8dc11e1..48db29fad0ca 100644 --- a/projects/kit/components/input-count/input-count.component.ts +++ b/projects/kit/components/input-count/input-count.component.ts @@ -35,7 +35,6 @@ import { TuiWithOptionalMinMax, TuiWithTextMask, } from '@taiga-ui/core'; -import {incorrectMaxMessage, maxAssertion} from '@taiga-ui/kit/constants'; import {TUI_PLUS_MINUS_TEXTS} from '@taiga-ui/kit/tokens'; // @dynamic @@ -66,7 +65,7 @@ export class TuiInputCountComponent min = 0; @Input() - @tuiDefaultProp(maxAssertion, incorrectMaxMessage) + @tuiDefaultProp() max = Infinity; @Input() diff --git a/projects/kit/components/input-date-range/input-date-range.component.ts b/projects/kit/components/input-date-range/input-date-range.component.ts index 6236e2bbd531..b9a3a042a6a8 100644 --- a/projects/kit/components/input-date-range/input-date-range.component.ts +++ b/projects/kit/components/input-date-range/input-date-range.component.ts @@ -48,9 +48,7 @@ import { import {TuiDayRangePeriod} from '@taiga-ui/kit/classes'; import { EMPTY_MASK, - incorrectMaxMessage, MAX_DAY_RANGE_LENGTH_MAPPER, - maxDayAssertion, TUI_DATE_RANGE_MASK, } from '@taiga-ui/kit/constants'; import {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers'; @@ -101,7 +99,7 @@ export class TuiInputDateRangeComponent min = TUI_FIRST_DAY; @Input() - @tuiDefaultProp(maxDayAssertion, incorrectMaxMessage) + @tuiDefaultProp() max = TUI_LAST_DAY; @Input() diff --git a/projects/kit/components/input-date-time/input-date-time.component.ts b/projects/kit/components/input-date-time/input-date-time.component.ts index 062d878669eb..573b16dc3435 100644 --- a/projects/kit/components/input-date-time/input-date-time.component.ts +++ b/projects/kit/components/input-date-time/input-date-time.component.ts @@ -35,12 +35,7 @@ import { TuiTextMaskOptions, TuiWithOptionalMinMax, } from '@taiga-ui/core'; -import { - DATE_TIME_SEPARATOR, - incorrectMaxMessage, - maxDayAssertion, - TUI_DATE_MASK, -} from '@taiga-ui/kit/constants'; +import {DATE_TIME_SEPARATOR, TUI_DATE_MASK} from '@taiga-ui/kit/constants'; import {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers'; import {TUI_CALENDAR_DATA_STREAM, TUI_TIME_TEXTS} from '@taiga-ui/kit/tokens'; import { @@ -76,7 +71,7 @@ export class TuiInputDateTimeComponent min = TUI_FIRST_DAY; @Input() - @tuiDefaultProp(maxDayAssertion, incorrectMaxMessage) + @tuiDefaultProp() max = TUI_LAST_DAY; @Input() diff --git a/projects/kit/components/input-date/input-date.component.ts b/projects/kit/components/input-date/input-date.component.ts index cabc165b707f..cf01a6b13af8 100644 --- a/projects/kit/components/input-date/input-date.component.ts +++ b/projects/kit/components/input-date/input-date.component.ts @@ -39,12 +39,7 @@ import { TuiWithOptionalMinMax, } from '@taiga-ui/core'; import {TuiNamedDay} from '@taiga-ui/kit/classes'; -import { - EMPTY_MASK, - incorrectMaxMessage, - maxDayAssertion, - TUI_DATE_MASK, -} from '@taiga-ui/kit/constants'; +import {EMPTY_MASK, TUI_DATE_MASK} from '@taiga-ui/kit/constants'; import {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit/providers'; import {TUI_CALENDAR_DATA_STREAM, TUI_MOBILE_CALENDAR} from '@taiga-ui/kit/tokens'; import {tuiCreateAutoCorrectedDatePipe} from '@taiga-ui/kit/utils/mask'; @@ -78,7 +73,7 @@ export class TuiInputDateComponent min = TUI_FIRST_DAY; @Input() - @tuiDefaultProp(maxDayAssertion, incorrectMaxMessage) + @tuiDefaultProp() max = TUI_LAST_DAY; @Input() diff --git a/projects/kit/components/input-file/file/file.template.html b/projects/kit/components/input-file/file/file.template.html index f1754c1d3d70..6270bb9a9ef5 100644 --- a/projects/kit/components/input-file/file/file.template.html +++ b/projects/kit/components/input-file/file/file.template.html @@ -54,12 +54,13 @@ {{fileSize}} - + > diff --git a/projects/kit/components/radio-list/radio-list.template.html b/projects/kit/components/radio-list/radio-list.template.html index 0b49c98e25bf..fcd3c4cec923 100644 --- a/projects/kit/components/radio-list/radio-list.template.html +++ b/projects/kit/components/radio-list/radio-list.template.html @@ -12,9 +12,10 @@ [ngModel]="value" (ngModelChange)="onModelChange($event)" > - + > diff --git a/projects/kit/components/select/select.template.html b/projects/kit/components/select/select.template.html index 1b76edc0824c..e7f466a96ad5 100644 --- a/projects/kit/components/select/select.template.html +++ b/projects/kit/components/select/select.template.html @@ -23,12 +23,13 @@ (keydown.backspace.prevent)="onKeyDownDelete()" > - + > diff --git a/projects/kit/components/tabs/tabs-with-more/tabs-with-more.template.html b/projects/kit/components/tabs/tabs-with-more/tabs-with-more.template.html index e46060edd9f9..39f56dce8d7f 100644 --- a/projects/kit/components/tabs/tabs-with-more/tabs-with-more.template.html +++ b/projects/kit/components/tabs/tabs-with-more/tabs-with-more.template.html @@ -35,9 +35,7 @@ [tuiFocusable]="isMoreFocusable" (keydown.arrowLeft.prevent)="onArrowLeft()" > - +
    {{moreWord}} diff --git a/projects/kit/components/tag/tag.template.html b/projects/kit/components/tag/tag.template.html index 66a49d0fa1e6..2098d7031c59 100644 --- a/projects/kit/components/tag/tag.template.html +++ b/projects/kit/components/tag/tag.template.html @@ -3,11 +3,12 @@ [style.backgroundColor]="backgroundColor" (dblclick)="edit($event)" > - + > {{displayText}} 0; -} - -export function maxAssertion(max: number, context: {min: number}): boolean { - return max >= context.min; -} - -export function maxDayAssertion(max: TuiDay, context: {min: TuiDay}): boolean { - return max.dayAfter(context.min); -} diff --git a/projects/kit/constants/assert-messages.ts b/projects/kit/constants/assert-messages.ts deleted file mode 100644 index d09eb823e653..000000000000 --- a/projects/kit/constants/assert-messages.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @internal - */ -export const incorrectQuantumMessage = 'Quantum must be positive'; -export const incorrectMaxMessage = 'Min value must be less than max value'; -export const incorrectLengthMessage = 'Length must be positive and bigger than index'; -export const progressIncorrectMaxValueMessage = - 'In separated mode maxValue required to be less than 10'; diff --git a/projects/kit/constants/index.ts b/projects/kit/constants/index.ts index 7f7aa3bd34da..6f3ce26fce2c 100644 --- a/projects/kit/constants/index.ts +++ b/projects/kit/constants/index.ts @@ -1,5 +1,3 @@ -export * from './assert-functions'; -export * from './assert-messages'; export * from './date-time-separator'; export * from './empty-mask'; export * from './group-class-names'; diff --git a/projects/kit/package.json b/projects/kit/package.json index 836859e04dad..78a782ac6648 100644 --- a/projects/kit/package.json +++ b/projects/kit/package.json @@ -18,7 +18,7 @@ "@angular/forms": ">= 6.0.0", "@angular/router": ">= 6.0.0", "@ng-web-apis/common": ">=1.6.0", - "@tinkoff/ng-polymorpheus": ">=2.0.0", + "@tinkoff/ng-polymorpheus": ">=3.0.0", "@taiga-ui/cdk": "1.6.5", "@taiga-ui/core": "1.6.5", "rxjs": ">=6.0.0"