Skip to content

Commit

Permalink
fix(kit): deprecate selectedPeriod property and removed setter `ite…
Browse files Browse the repository at this point in the history
…m` property
  • Loading branch information
zhd-dm committed Aug 20, 2024
1 parent ce147e9 commit 1fa8f99
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ import {takeUntil} from 'rxjs/operators';
providers: [TuiDestroyService],
})
export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax<TuiDay> {
/**
* @deprecated use `item`
*/
private selectedPeriod: TuiDayRangePeriod | null = null;

@Input()
Expand Down Expand Up @@ -78,9 +81,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax<TuiDay>
value: TuiDayRange | null = null;

@Input()
set item(item: TuiDayRangePeriod | null) {
this.selectedActivePeriod = item;
}
item: TuiDayRangePeriod | null = null;

@Output()
readonly valueChange = new EventEmitter<TuiDayRange | null>();
Expand Down Expand Up @@ -236,6 +237,7 @@ export class TuiCalendarRangeComponent implements TuiWithOptionalMinMax<TuiDay>

private get activePeriod(): TuiDayRangePeriod | null {
return (
this.item ??
this.selectedActivePeriod ??
(this.items.find(item =>
tuiNullableSame<TuiDayRange>(
Expand Down

0 comments on commit 1fa8f99

Please sign in to comment.