From ea0d3996739af6cfa87f3324695fe5b698f5b3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Thu, 28 Dec 2023 17:58:51 +0300 Subject: [PATCH] refactor --- src/app/components/picklist/picklist.ts | 30 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/app/components/picklist/picklist.ts b/src/app/components/picklist/picklist.ts index 4eddd6b5248..45a1272408e 100755 --- a/src/app/components/picklist/picklist.ts +++ b/src/app/components/picklist/picklist.ts @@ -177,7 +177,11 @@ import { [attr.data-pc-section]="'item'" [attr.aria-selected]="isSelected(item, selectedItemsSource)" > - + + + + + @@ -285,7 +289,10 @@ import { [attr.data-pc-section]="'item'" [attr.aria-selected]="isSelected(item, selectedItemsTarget)" > - + + + + @@ -694,9 +701,11 @@ export class PickList implements AfterViewChecked, AfterContentInit { _breakpoint: string = '960px'; - public sourceTemplate: TemplateRef | undefined; + public itemTemplate: TemplateRef | undefined; + + public sourceItemTemplate: TemplateRef | undefined; - public targetTemplate: TemplateRef | undefined; + public targetItemTemplate: TemplateRef | undefined; moveTopIconTemplate: Nullable>; @@ -819,12 +828,15 @@ export class PickList implements AfterViewChecked, AfterContentInit { ngAfterContentInit() { (this.templates as QueryList).forEach((item) => { switch (item.getType()) { - case 'source': - this.sourceTemplate = item.template; + case 'item': + this.itemTemplate = item.template; + + case 'sourceitem': + this.sourceItemTemplate = item.template; break; - case 'target': - this.targetTemplate = item.template; + case 'targetitem': + this.targetItemTemplate = item.template; break; case 'sourceHeader': @@ -900,7 +912,7 @@ export class PickList implements AfterViewChecked, AfterContentInit { break; default: - this.sourceTemplate = item.template; + this.itemTemplate = item.template; break; } });