From 61ae1e8bac67338c61f590f1a785d5a26bb1613b Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 19 Aug 2022 10:17:05 +0300 Subject: [PATCH] remove workflow template inputs --- src/lib/buttons/circle-button/circle-button.component.ts | 8 ++++---- src/lib/listing/workflow/workflow.component.html | 4 +--- src/lib/listing/workflow/workflow.component.ts | 7 ++++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/lib/buttons/circle-button/circle-button.component.ts b/src/lib/buttons/circle-button/circle-button.component.ts index a694712..ed1c0e4 100644 --- a/src/lib/buttons/circle-button/circle-button.component.ts +++ b/src/lib/buttons/circle-button/circle-button.component.ts @@ -32,6 +32,10 @@ export class CircleButtonComponent implements OnInit { constructor(private readonly _elementRef: ElementRef) {} + get buttonId(): string { + return `${Math.random().toString(36).substring(2, 9)}-button`; + } + ngOnInit(): void { (this._elementRef.nativeElement as HTMLElement).style.setProperty('--size', `${this.size}px`); (this._elementRef.nativeElement as HTMLElement).style.setProperty('--iconSize', `${this.iconSize}px`); @@ -51,8 +55,4 @@ export class CircleButtonComponent implements OnInit { this.action.emit($event); } } - - get buttonId(): string { - return `${Math.random().toString(36).substring(2, 9)}-button`; - } } diff --git a/src/lib/listing/workflow/workflow.component.html b/src/lib/listing/workflow/workflow.component.html index 76c22bf..9159965 100644 --- a/src/lib/listing/workflow/workflow.component.html +++ b/src/lib/listing/workflow/workflow.component.html @@ -1,7 +1,5 @@ - - - + extends ContextComponent implements OnInit { - @Input() headerTemplate?: TemplateRef; - @Input() itemTemplate!: TemplateRef; @Input() config!: WorkflowConfig; @Input() itemClasses!: Record boolean>; @Input() addElementIcon!: string; @@ -51,6 +50,8 @@ export class WorkflowComponent extends Co @Output() readonly noDataAction = new EventEmitter(); @Output() readonly addElement = new EventEmitter(); + @ContentChild('workflowItemTemplate') readonly itemTemplate!: TemplateRef; + readonly trackBy = trackByFactory(); itemHeight?: number; itemWidth?: number;