Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(demo): some translation fixes #68

Merged
merged 2 commits into from
Dec 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
></tui-bar-set>
</div>
<ng-template #hint="polymorpheus" polymorpheus>
<polymorpheus-outlet
<div
polymorpheus-outlet
class="text"
[content]="hintContent"
[context]="getContentContext(index)"
></polymorpheus-outlet>
></div>
</ng-template>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@
[style.bottom.%]="getBottom(point[1])"
></div>
<ng-template #hint>
<polymorpheus-outlet
<div
polymorpheus-outlet
class="text"
[content]="computedHint"
[context]="getContentContext(point)"
></polymorpheus-outlet>
></div>
</ng-template>
</ng-container>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
[xStringify]="xStringify ? daysStringify : null"
></tui-line-chart>
<ng-template #hint let-point>
<polymorpheus-outlet
<div
polymorpheus-outlet
[content]="hintContent"
[context]="getHintContext(point[0], value)"
></polymorpheus-outlet>
></div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
</g>
</svg>
<ng-template #template let-index>
<polymorpheus-outlet
<div
polymorpheus-outlet
class="text"
[content]="hintContent"
[context]="getContentContext(index)"
></polymorpheus-outlet>
></div>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<div *ngIf="hasContent" class="content">
<polymorpheus-outlet
<div
polymorpheus-outlet
class="wrapper"
automation-id="tui-ring-chart__content"
[content]="content"
[context]="contentContext"
></polymorpheus-outlet>
></div>
</div>

<tui-pie-chart
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"peerDependencies": {
"@angular/common": ">=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"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-commerce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<polymorpheus-outlet
<div
polymorpheus-outlet
*ngIf="!!sourceCode"
[content]="sourceCode"
[context]="pathOptions"
Expand All @@ -16,4 +17,4 @@
[href]="link"
></a>
</ng-template>
</polymorpheus-outlet>
</div>
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<h2 *ngIf="!!internal.label" class="heading" [id]="context.id">
{{internal.label}}
</h2>
<polymorpheus-outlet
<div
polymorpheus-outlet
class="content"
[content]="internal.content"
[context]="context"
></polymorpheus-outlet>
></div>
<button
*ngFor="let action of internal.actions; let index = index"
tuiButton
Expand Down
5 changes: 2 additions & 3 deletions projects/addon-mobile/directives/ripple/ripple.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand All @@ -49,7 +48,7 @@ const STYLE = `
}
}

*${RIPPLE_SELECTOR} {
*[tuiRipple] {
position: relative;
overflow: hidden;
}
Expand All @@ -67,7 +66,7 @@ const STYLE = `
`;

@Directive({
selector: RIPPLE_SELECTOR,
selector: '[tuiRipple]',
providers: TUI_RIPPLE_PROVIDERS,
})
export class TuiRippleDirective {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<polymorpheus-outlet
<div
polymorpheus-outlet
class="wrapper"
tuiActiveZone
[content]="content"
></polymorpheus-outlet>
></div>
2 changes: 1 addition & 1 deletion projects/addon-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@angular/cdk": ">=7.0.0",
"@angular/common": ">=7.0.0",
"@angular/core": ">=7.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",
"@taiga-ui/kit": "1.6.5",
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@angular/cdk": ">=7.0.0",
"@angular/common": ">=7.0.0",
"@angular/core": ">=7.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",
"rxjs": ">=6.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
[class.tui-container_adaptive]="item.adaptive"
>
<div class="inner">
<polymorpheus-outlet
<div
polymorpheus-outlet
class="content"
[content]="item.content"
[context]="getItemContext(item)"
></polymorpheus-outlet>
></div>

<button
*ngIf="item.hasCloseButton"
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-tablebars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"peerDependencies": {
"@angular/common": ">=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",
"rxjs": ">=6.0.0"
Expand Down
5 changes: 3 additions & 2 deletions projects/cdk/components/dialog-host/dialog-host.template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<polymorpheus-outlet
<div
polymorpheus-outlet
*ngFor="let item of dialogs$ | async"
tuiFocusTrap
tuiOverscroll="all"
Expand All @@ -9,5 +10,5 @@
[content]="item.component"
[context]="item"
[@tuiParentAnimation]
></polymorpheus-outlet>
></div>
<div class="overlay"></div>
8 changes: 4 additions & 4 deletions projects/cdk/decorators/default-prop.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {tuiAssert} from '@taiga-ui/cdk/classes';
import {TuiAssertion} from '@taiga-ui/cdk/types';
import {TuiBooleanHandler} from '@taiga-ui/cdk/types';

/**
* Decorator for checking input values for undefined. You can also pass
Expand All @@ -10,7 +10,7 @@ import {TuiAssertion} from '@taiga-ui/cdk/types';
* CAUTION: This decorator overwrites other getters and setters.
*/
export function tuiDefaultProp<T extends object, K extends keyof T>(
assertion?: TuiAssertion<T, K>,
assertion?: TuiBooleanHandler<T[K]>,
...args: any[]
): PropertyDecorator {
return (target, key) => {
Expand All @@ -33,7 +33,7 @@ export function tuiDefaultProp<T extends object, K extends keyof T>(

if (isValid && assertion) {
tuiAssert.assert(
assertion(initialValue, this),
assertion.call(this, initialValue),
`${String(key)} in ${name} received:`,
initialValue,
...args,
Expand All @@ -56,7 +56,7 @@ export function tuiDefaultProp<T extends object, K extends keyof T>(

if (isValid && assertion) {
tuiAssert.assert(
assertion(value, this),
assertion.call(this, value),
`${String(key)} in ${name} received:`,
value,
...args,
Expand Down
6 changes: 3 additions & 3 deletions projects/cdk/decorators/required-setter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {tuiAssert} from '@taiga-ui/cdk/classes';
import {TuiAssertion} from '@taiga-ui/cdk/types';
import {TuiBooleanHandler} from '@taiga-ui/cdk/types';

/**
* Decorator for checking input setter values against a custom assertion which
Expand All @@ -8,7 +8,7 @@ import {TuiAssertion} from '@taiga-ui/cdk/types';
* original setter in this case.
*/
export function tuiRequiredSetter<T extends object, K extends keyof T>(
assertion?: TuiAssertion<T, K>,
assertion?: TuiBooleanHandler<T[K]>,
...args: any[]
): MethodDecorator {
return (
Expand All @@ -25,7 +25,7 @@ export function tuiRequiredSetter<T extends object, K extends keyof T>(
set(this: T, value: T[K]) {
if (value !== undefined && assertion) {
tuiAssert.assert(
assertion(value, this),
assertion.call(this, value),
`${String(key)} in ${name} received:`,
value,
...args,
Expand Down
4 changes: 2 additions & 2 deletions projects/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"repository": "https://github.com/TinkoffCreditSystems/taiga-ui",
"homepage": "https://github.com/TinkoffCreditSystems/taiga-ui",
"dependencies": {
"@ng-web-apis/common": "1.7.0",
"@ng-web-apis/common": "1.9.0",
"@ng-web-apis/mutation-observer": "1.1.0",
"@ng-web-apis/resize-observer": "1.0.3",
"@tinkoff/ng-event-plugins": "2.0.0",
"@tinkoff/ng-polymorpheus": "2.1.0",
"@tinkoff/ng-polymorpheus": "3.0.0",
"@types/resize-observer-browser": "0.1.3"
},
"peerDependencies": {
Expand Down
4 changes: 0 additions & 4 deletions projects/cdk/types/assertion.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/cdk/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './assertion';
export * from './event-with';
export * from './handler';
export * from './mapper';
Expand Down
9 changes: 5 additions & 4 deletions projects/core/components/button/button.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
[focused]="computedFocusVisible"
>
<span class="content">
<polymorpheus-outlet *ngIf="icon" class="left" [content]="icon">
<span polymorpheus-outlet *ngIf="icon" class="left" [content]="icon">
<ng-template let-icon>
<tui-svg class="icon" [src]="icon"></tui-svg>
</ng-template>
</polymorpheus-outlet>
</span>
<ng-content></ng-content>
<polymorpheus-outlet
<span
polymorpheus-outlet
*ngIf="iconRight"
class="right"
[content]="iconRight"
>
<ng-template let-icon>
<tui-svg class="icon" [src]="icon"></tui-svg>
</ng-template>
</polymorpheus-outlet>
</span>
</span>
<tui-loader
*ngIf="showLoader"
Expand Down
19 changes: 2 additions & 17 deletions projects/core/components/calendar/calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ import {TUI_DEFAULT_MARKER_HANDLER} from '@taiga-ui/core/constants';
import {TuiWithOptionalMinMax} from '@taiga-ui/core/interfaces';
import {TuiMarkerHandler} from '@taiga-ui/core/types';

function maxDayAssertion(max: TuiDay, context: {min: TuiDay}): boolean {
return max.dayAfter(context.min);
}

function maxMonthAssertion(
maxViewedMonth: TuiMonth,
context: {minViewedMonth: TuiMonth},
): boolean {
return maxViewedMonth.month >= context.minViewedMonth.month;
}

const incorrectMaxMessage = 'Min value must be less than max value';
const incorrectMaxMonthMessage =
'Min month value must be equal or less than max month value';

// @dynamic
@Component({
selector: 'tui-calendar',
Expand All @@ -62,15 +47,15 @@ export class TuiCalendarComponent implements TuiWithOptionalMinMax<TuiDay> {
min = TUI_FIRST_DAY;

@Input()
@tuiDefaultProp(maxDayAssertion, incorrectMaxMessage)
@tuiDefaultProp()
max = TUI_LAST_DAY;

@Input()
@tuiDefaultProp()
minViewedMonth: TuiMonth = TUI_FIRST_DAY;

@Input()
@tuiDefaultProp(maxMonthAssertion, incorrectMaxMonthMessage)
@tuiDefaultProp()
maxViewedMonth: TuiMonth = TUI_LAST_DAY;

@Input()
Expand Down
Loading