From 1fa8f99b62e2327e951a1399e18cac3ee17e2a88 Mon Sep 17 00:00:00 2001 From: Demyan Date: Tue, 20 Aug 2024 12:03:07 +0300 Subject: [PATCH] fix(kit): deprecate `selectedPeriod` property and removed setter `item` property --- .../components/calendar-range/calendar-range.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/kit/components/calendar-range/calendar-range.component.ts b/projects/kit/components/calendar-range/calendar-range.component.ts index 66a12faeb201..a90d55d8e29d 100644 --- a/projects/kit/components/calendar-range/calendar-range.component.ts +++ b/projects/kit/components/calendar-range/calendar-range.component.ts @@ -48,6 +48,9 @@ import {takeUntil} from 'rxjs/operators'; providers: [TuiDestroyService], }) export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax { + /** + * @deprecated use `item` + */ private selectedPeriod: TuiDayRangePeriod | null = null; @Input() @@ -78,9 +81,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax value: TuiDayRange | null = null; @Input() - set item(item: TuiDayRangePeriod | null) { - this.selectedActivePeriod = item; - } + item: TuiDayRangePeriod | null = null; @Output() readonly valueChange = new EventEmitter(); @@ -236,6 +237,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax private get activePeriod(): TuiDayRangePeriod | null { return ( + this.item ?? this.selectedActivePeriod ?? (this.items.find(item => tuiNullableSame(