Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit 7454205

Browse files
committed
style: addaptive, readme, fix document validator
1 parent 2621f13 commit 7454205

5 files changed

Lines changed: 33 additions & 3 deletions

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
**Angular Forms Test
1+
# Angular Forms Test
2+
3+
### Стек
4+
- Angular 18
5+
- TaigaUI 3
6+
- Maskito
7+
- NX CLI
8+
9+
### Блок 1 (Данные клиента)
10+
### Блок 2 (Адрес регистрации)
11+
### Блок 3 (Банковские реквизиты)
12+
### Блок 4 (Информация о транзакции)
13+
### Блок 5 (Дополнительные документы )
14+
15+
16+
17+

src/app/components/client-info-form/client-info-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { phoneNumberValidator } from 'src/app/validators/phone-number.validator'
2828
import { passportValidator } from 'src/app/validators/passport.validator';
2929

3030
const CURRENT_DATE = new Date();
31-
const GENDERS = ['Мужщина', 'Женщина'];
31+
const GENDERS = ['Мужчина', 'Женщина'];
3232
const PASSPORT_FILLER = 'XXXX XXXXXX';
3333
type GendersType = typeof GENDERS;
3434
type Gender = GendersType[number];

src/app/components/document-info-form/document-info-form.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@if(documentFormArray.length) { @for(formGroup of documentFormArray.controls;
22
let i = $index; track formGroup ) {
3+
34
<form class="formGroup" [formGroup]="documentFormArray.controls[i]">
45
<div tuiGroup class="item-container">
56
<div>
@@ -32,6 +33,7 @@
3233
></tui-error>
3334
</div>
3435
<button
36+
class="removeIconButton"
3537
appearance="icon"
3638
icon="tuiIconClose"
3739
tuiIconButton
@@ -45,6 +47,7 @@
4547
[error]="[] | tuiFieldError | async"
4648
></tui-error>
4749
} }
50+
4851
<button
4952
appearance="icon"
5053
class="addButton"

src/app/components/document-info-form/document-info-form.component.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,15 @@
1212
justify-content: center;
1313
margin: 1em 0;
1414
gap: 1em;
15+
}
16+
17+
@media (max-width: 1040px) {
18+
.item-container {
19+
display: flex;
20+
flex-direction: column;
21+
gap: 0.5em;
22+
}
23+
.removeIconButton {
24+
margin: 0 auto;
25+
}
1526
}

src/app/validators/document.validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function documentValidator(): ValidatorFn {
88

99
const document = control.value.document;
1010
const documentNumber = control.value.documentNumber;
11-
return documentNumber.length === document.length
11+
return documentNumber.length !== document.length
1212
? { invalidDocument: true }
1313
: null;
1414
};

0 commit comments

Comments
 (0)