Skip to content

Commit d42ebff

Browse files
committed
fix counter for textarea & error-icon position & onboarding specialization groups
1 parent 408cb46 commit d42ebff

8 files changed

Lines changed: 42 additions & 27 deletions

File tree

projects/social_platform/src/app/office/onboarding/stage-one/stage-one.component.scss

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
@use "styles/typography";
33

44
.auth {
5-
&__greeting {
5+
&__greeting {
66
position: relative;
77
display: flex;
8+
flex-direction: column;
89
gap: 10px;
9-
align-items: center;
10+
max-width: 100%;
11+
12+
@include responsive.apply-desktop {
13+
max-width: 60%;
14+
flex-direction: row;
15+
align-items: center;
16+
}
1017
}
1118
}
1219

projects/social_platform/src/app/office/onboarding/stage-two/stage-two.component.scss

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
&__greeting {
66
position: relative;
77
display: flex;
8+
flex-direction: column;
89
gap: 10px;
9-
align-items: center;
10+
max-width: 100%;
11+
12+
@include responsive.apply-desktop {
13+
max-width: 60%;
14+
flex-direction: row;
15+
align-items: center;
16+
}
1017
}
1118
}
1219

@@ -15,6 +22,14 @@
1522
display: inline-flex;
1623
gap: 10px;
1724
align-items: center;
25+
26+
::ng-deep {
27+
app-tooltip {
28+
.tooltip__content--right {
29+
top: 110%;
30+
}
31+
}
32+
}
1833
}
1934

2035
.content {

projects/social_platform/src/app/office/shared/specializations-group/specializations-group.component.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
@if (contentVisible()) {
1616
<div class="content" [class.content--open]="hasOpenGroups">
1717
@for (opt of options; track opt.id) {
18-
<div
19-
class="content__option"
20-
[class.content__option--disabled]="disabled"
21-
(click)="onSelectOption(opt)"
22-
>
23-
<label class="text-body-12">{{ opt.name }}</label>
18+
<div class="content__option" [class.content__option--disabled]="disabled">
19+
<label class="text-body-12" (click)="onSelectOption(opt)">{{ opt.name }}</label>
2420
</div>
2521
}
2622
</div>

projects/social_platform/src/app/office/shared/specializations-group/specializations-group.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
}
2121

2222
&--open {
23+
z-index: 1000;
2324
i {
2425
transform: rotate(90deg);
2526
}
@@ -57,6 +58,7 @@
5758

5859
&--open {
5960
width: 40%;
61+
z-index: 1000;
6062
}
6163

6264
&__option {

projects/social_platform/src/app/ui/components/input/input.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
justify-content: center;
121121
padding: 0 4px;
122122
color: var(--red) !important;
123-
background: var(--white);
123+
background: var(--light-white);
124124
transform: translateY(-50%);
125125
}
126126

projects/social_platform/src/app/ui/components/input/input.component.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class InputComponent implements ControlValueAccessor {
5252
@Input() maxLength?: number;
5353

5454
@Input()
55-
set appValue(value: string) {
56-
this.value = value;
55+
set appValue(value: string | null) {
56+
this.value = value ?? "";
5757
}
5858

5959
get appValue(): string {
@@ -105,13 +105,9 @@ export class InputComponent implements ControlValueAccessor {
105105
}
106106

107107
onInput(event: Event): void {
108-
const nextValue = (event.target as HTMLInputElement).value;
108+
const nextValue = (event.target as HTMLInputElement).value ?? "";
109109

110-
if (this.maxLength && nextValue.length > this.maxLength) {
111-
this.isLengthOverflow = true;
112-
} else {
113-
this.isLengthOverflow = false;
114-
}
110+
this.isLengthOverflow = !!this.maxLength && nextValue.length > this.maxLength;
115111

116112
this.value = nextValue;
117113
this.onChange(nextValue);
@@ -147,10 +143,8 @@ export class InputComponent implements ControlValueAccessor {
147143
return false;
148144
}
149145

150-
writeValue(value: string): void {
151-
setTimeout(() => {
152-
this.value = value;
153-
});
146+
writeValue(value: string | null): void {
147+
this.value = value ?? "";
154148
}
155149

156150
onChange: (value: string) => void = () => {};

projects/social_platform/src/app/ui/components/textarea/textarea.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@
5151

5252
&__error-icon {
5353
position: absolute;
54-
top: 15%;
54+
top: 25px;
5555
right: 15px;
5656
display: flex;
5757
align-items: center;
5858
justify-content: center;
5959
color: var(--red) !important;
6060
transform: translateY(-50%);
61+
background-color: var(--light-white);
6162

6263
i {
6364
color: var(--red) !important;
@@ -66,7 +67,7 @@
6667

6768
&__tooltip-wrapper {
6869
position: absolute;
69-
top: 15%;
70+
top: 25px;
7071
right: 15px;
7172
z-index: 10;
7273
transform: translateY(-50%);

projects/social_platform/src/app/ui/components/textarea/textarea.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class TextareaComponent implements OnInit, ControlValueAccessor {
7070

7171
/** Двустороннее связывание текста */
7272
@Input() set text(value: string) {
73-
this.value = value;
73+
this.value = value ?? "";
7474
}
7575

7676
get text(): string {
@@ -86,7 +86,7 @@ export class TextareaComponent implements OnInit, ControlValueAccessor {
8686

8787
/** Обработчик ввода текста */
8888
onInput(event: Event): void {
89-
const nextValue = (event.target as HTMLInputElement).value;
89+
const nextValue = (event.target as HTMLInputElement).value ?? "";
9090

9191
if (this.maxLength && nextValue.length > this.maxLength) {
9292
this.isLengthOverflow = true;
@@ -123,7 +123,7 @@ export class TextareaComponent implements OnInit, ControlValueAccessor {
123123

124124
// Методы ControlValueAccessor
125125
writeValue(value: string): void {
126-
this.value = value;
126+
this.value = value ?? "";
127127
}
128128

129129
onChange: (value: string) => void = () => {};

0 commit comments

Comments
 (0)