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(