From ee8316f715b63338c254f7e6d0fee898ed094da8 Mon Sep 17 00:00:00 2001 From: Vladimir Potekhin <46284632+vladimirpotekhin@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:48:17 +0300 Subject: [PATCH] fix(kit): `InputYear` fix dropdown paddings (#6431) --- .../input-year/input-year.module.ts | 4 ++-- .../input-year/input-year.style.less | 10 +++++++++ .../input-year/input-year.template.html | 22 +++++++++++-------- ...primitive-calendar-range.component.spec.ts | 4 ++-- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/projects/kit/components/input-year/input-year.module.ts b/projects/kit/components/input-year/input-year.module.ts index e412020717dc..6fbe8e977a93 100644 --- a/projects/kit/components/input-year/input-year.module.ts +++ b/projects/kit/components/input-year/input-year.module.ts @@ -1,10 +1,10 @@ import {NgModule} from '@angular/core'; import {MaskitoModule} from '@maskito/angular'; -import {TuiPreventDefaultModule} from '@taiga-ui/cdk'; import { TuiHostedDropdownModule, TuiPrimitiveTextfieldModule, TuiPrimitiveYearPickerModule, + TuiScrollbarModule, TuiTextfieldComponent, TuiTextfieldControllerModule, } from '@taiga-ui/core'; @@ -19,7 +19,7 @@ import {TuiInputYearDirective} from './input-year.directive'; TuiHostedDropdownModule, TuiPrimitiveTextfieldModule, TuiPrimitiveYearPickerModule, - TuiPreventDefaultModule, + TuiScrollbarModule, TuiTextfieldControllerModule, TuiToYearPipeModule, ], diff --git a/projects/kit/components/input-year/input-year.style.less b/projects/kit/components/input-year/input-year.style.less index 74ca630e5245..f33ffea18396 100644 --- a/projects/kit/components/input-year/input-year.style.less +++ b/projects/kit/components/input-year/input-year.style.less @@ -11,6 +11,16 @@ border-radius: inherit; } +.t-container { + width: 15.75rem; + padding: 1rem 1.125rem; +} + +.t-scrollbar { + height: 18.25rem; + width: 16.875rem; +} + .t-textfield { border-radius: inherit; text-align: inherit; diff --git a/projects/kit/components/input-year/input-year.template.html b/projects/kit/components/input-year/input-year.template.html index ffc0cba857bb..27b1f63fa77b 100644 --- a/projects/kit/components/input-year/input-year.template.html +++ b/projects/kit/components/input-year/input-year.template.html @@ -28,14 +28,18 @@ - +
+ + + +
diff --git a/projects/kit/internal/primitive-calendar-range/test/primitive-calendar-range.component.spec.ts b/projects/kit/internal/primitive-calendar-range/test/primitive-calendar-range.component.spec.ts index 7de609abf82e..c45d4b848961 100644 --- a/projects/kit/internal/primitive-calendar-range/test/primitive-calendar-range.component.spec.ts +++ b/projects/kit/internal/primitive-calendar-range/test/primitive-calendar-range.component.spec.ts @@ -56,7 +56,7 @@ describe('PrimitiveRangeCalendar component', () => { }); it('Returns min when initialized with default less than min', () => { - const minDate = new TuiDay(2024, 1, 1); + const minDate = TuiDay.currentLocal().append({month: 2}); component.min = minDate; component.ngOnInit(); @@ -90,7 +90,7 @@ describe('PrimitiveRangeCalendar component', () => { }); it('Returns min when initialized with default less than min', () => { - const minDate = new TuiDay(2024, 1, 1); + const minDate = TuiDay.currentLocal().append({month: 2}); component.min = minDate; component.ngOnInit();