@pega/dx-component-builder-sdk
Version:
Utility for building custom UI components
48 lines (38 loc) • 1.56 kB
text/typescript
import { Component, OnInit, Input, forwardRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { Utils } from '@pega/angular-sdk-components';
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
export class ListUtilityComponent implements OnInit {
name$ = '';
icon$ = '';
bLoading$ = false;
count$ = 0;
arActions$: any[] = [];
arItems$: any[] = [];
menuIconOverrideAction$: any[] = [];
// function to all
onViewAll$: any;
headerSvgIcon$: string;
settingsSvgIcon$: string;
noItemsMessage$ = 'No Items';
imagePath$ = '';
constructor(private utils: Utils) {}
ngOnInit(): void {
this.imagePath$ = this.getIconPath();
this.headerSvgIcon$ = this.utils.getImageSrc(this.icon$, this.utils.getSDKStaticContentUrl());
this.settingsSvgIcon$ = this.utils.getImageSrc('more', this.utils.getSDKStaticContentUrl());
}
getIconPath(): string {
return `${this.utils.getSDKStaticContentUrl()}assets/icons/`;
}
}