From 22bb699d4f2a92d8448f24dfc83e010a1eafe7b9 Mon Sep 17 00:00:00 2001 From: Demyan <64752156+zhd-dm@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:22:31 +0300 Subject: [PATCH] fix(kit): fix `CalendarRange` typing and checks `otherDateText` in `mapper` function (#8629) --- .../components/calendar-range/calendar-range.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/kit/components/calendar-range/calendar-range.component.ts b/projects/kit/components/calendar-range/calendar-range.component.ts index a90d55d8e29d..bea2271edf01 100644 --- a/projects/kit/components/calendar-range/calendar-range.component.ts +++ b/projects/kit/components/calendar-range/calendar-range.component.ts @@ -122,7 +122,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax valueChanges: Observable | null, @Inject(ChangeDetectorRef) readonly cdr: ChangeDetectorRef, @Self() @Inject(TuiDestroyService) destroy$: TuiDestroyService, - @Inject(TUI_OTHER_DATE_TEXT) readonly otherDateText$: Observable, + @Inject(TUI_OTHER_DATE_TEXT) readonly otherDateText$: Observable, @Inject(TUI_COMMON_ICONS) readonly icons: TuiCommonIcons, ) { if (!valueChanges) { @@ -153,10 +153,10 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax TuiDay | null, TuiDay | null, TuiDayLike | null, - string?, + string | null | undefined, ], ReadonlyArray - > = (items, min, max, minLength, otherDateText = '') => [ + > = (items, min, max, minLength, otherDateText) => [ ...items.filter( item => (minLength === null || @@ -164,7 +164,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax (min === null || item.range.to.daySameOrAfter(min)) && (max === null || item.range.from.daySameOrBefore(max)), ), - otherDateText, + otherDateText ?? '', ]; get calculatedDisabledItemHandler(): TuiBooleanHandler {