Smart Collection UI Changes (#3332)

This commit is contained in:
Joe Milazzo 2024-11-04 11:16:17 -06:00 committed by GitHub
parent dcd281c5c3
commit 9e299d08b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 431 additions and 189 deletions

View file

@ -4,8 +4,8 @@ import {
Component,
ContentChild, EventEmitter,
inject,
Input,
OnInit, Output,
Input, OnChanges,
OnInit, Output, SimpleChanges,
TemplateRef
} from '@angular/core';
import {NgTemplateOutlet} from "@angular/common";
@ -20,7 +20,7 @@ import {DefaultValuePipe} from "../../_pipes/default-value.pipe";
styleUrls: ['./badge-expander.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class BadgeExpanderComponent implements OnInit {
export class BadgeExpanderComponent implements OnInit, OnChanges {
private readonly cdRef = inject(ChangeDetectorRef);
@ -47,6 +47,11 @@ export class BadgeExpanderComponent implements OnInit {
this.cdRef.markForCheck();
}
ngOnChanges(changes: SimpleChanges) {
this.visibleItems = this.items.slice(0, this.itemsTillExpander);
this.cdRef.markForCheck();
}
toggleVisible() {
this.toggle.emit();
if (!this.allowToggle) return;