Skip to content

Commit

Permalink
feat(kit): new refactored version of InputNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Dec 19, 2024
1 parent a9a856b commit ae8dc83
Show file tree
Hide file tree
Showing 46 changed files with 1,919 additions and 602 deletions.
33 changes: 15 additions & 18 deletions projects/demo-cypress/src/tests/input-number/dynamic-postfix.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,40 @@ import '@angular/common/locales/global/ru';
import {I18nPluralPipe} from '@angular/common';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {TuiRoot} from '@taiga-ui/core';
import {TuiInputNumberModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
import {TuiRoot, TuiTextfield} from '@taiga-ui/core';
import {TuiInputNumber} from '@taiga-ui/kit';

@Component({
standalone: true,
imports: [
FormsModule,
I18nPluralPipe,
TuiInputNumberModule,
TuiRoot,
TuiTextfieldControllerModule,
],
imports: [FormsModule, I18nPluralPipe, TuiInputNumber, TuiRoot, TuiTextfield],
template: `
<tui-root>
<tui-input-number
[tuiTextfieldPostfix]="value | i18nPlural: pluralMap : 'ru-RU'"
[(ngModel)]="value"
></tui-input-number>
<tui-textfield>
<input
tuiInputNumber
[postfix]="value | i18nPlural: pluralMap : 'ru-RU'"
[(ngModel)]="value"
/>
</tui-textfield>
</tui-root>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TestInputNumberWithPostfix {
protected value: number | null = null;
protected pluralMap = {
one: 'секунда',
few: 'секунды',
many: 'секунд',
other: 'секунды',
one: ' секунда',
few: ' секунды',
many: ' секунд',
other: ' секунды',
};
}

describe('InputNumber with dynamic postfix', () => {
describe('Plural forms of seconds (locale ru-RU)', () => {
beforeEach(() => {
cy.mount(TestInputNumberWithPostfix);
cy.get('tui-input-number input').as('textfield');
cy.get('[tuiInputNumber]').as('textfield');
});

const withPostfix = (
Expand Down
Loading

0 comments on commit ae8dc83

Please sign in to comment.