import { Component, 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 { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component';
import * as i0 from "@angular/core";
import * as i1 from "../../../_helpers/utils";
import * as i2 from "@angular/common";
import * as i3 from "@angular/material/button";
import * as i4 from "@angular/material/menu";
import * as i5 from "@angular/material/progress-spinner";
export class ListUtilityComponent {
    constructor(utils) {
        this.utils = utils;
        this.name$ = '';
        this.icon$ = '';
        this.bLoading$ = false;
        this.count$ = 0;
        this.arActions$ = [];
        this.arItems$ = [];
        this.menuIconOverrideAction$ = [];
        this.noItemsMessage$ = 'No Items';
        this.imagePath$ = '';
    }
    ngOnInit() {
        this.imagePath$ = this.getIconPath();
        this.headerSvgIcon$ = this.utils.getImageSrc(this.icon$, this.utils.getSDKStaticContentUrl());
        this.settingsSvgIcon$ = this.utils.getImageSrc('more', this.utils.getSDKStaticContentUrl());
    }
    getIconPath() {
        return `${this.utils.getSDKStaticContentUrl()}assets/icons/`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListUtilityComponent, deps: [{ token: i1.Utils }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ListUtilityComponent, isStandalone: true, selector: "app-list-utility", inputs: { name$: "name$", icon$: "icon$", bLoading$: "bLoading$", count$: "count$", arActions$: "arActions$", arItems$: "arItems$", menuIconOverrideAction$: "menuIconOverrideAction$", onViewAll$: "onViewAll$" }, ngImport: i0, template: "<div style=\"text-align: left\">\n  <div class=\"psdk-utility\">\n    <div class=\"header\">\n      <div class=\"header-icon\">\n        <img class=\"psdk-utility-svg-icon\" src=\"{{ headerSvgIcon$ }}\" />\n      </div>\n      <div class=\"header-text\">{{ name$ }}</div>\n      <div class=\"psdk-utility-count\" id=\"attachments-count\">{{ count$ }}</div>\n      <div style=\"flex-grow: 1\"></div>\n      <div class=\"header-icon\">\n        <button mat-icon-button [matMenuTriggerFor]=\"utilityMenu\">\n          <img class=\"psdk-utility-card-actions-svg-icon\" src=\"{{ settingsSvgIcon$ }}\" />\n        </button>\n        <mat-menu #utilityMenu=\"matMenu\" overlapTrigger=\"false\">\n          <ng-container *ngFor=\"let action of arActions$\">\n            <button mat-menu-item (click)=\"action.onClick()\">{{ action.text }}</button>\n          </ng-container>\n        </mat-menu>\n      </div>\n    </div>\n    <div class=\"psdk-utiltiy-divider\"></div>\n    <br />\n    <mat-spinner *ngIf=\"bLoading$\" class=\"progress-spinner\" diameter=\"50\"></mat-spinner>\n    <div *ngIf=\"count$ == 0\" class=\"message\">{{ noItemsMessage$ }}</div>\n    <div *ngIf=\"count$ > 0\" class=\"psdk-utility-items\">\n      <component-mapper name=\"SummaryList\" [props]=\"{ arItems$, menuIconOverrideAction$ }\"></component-mapper>\n    </div>\n    <div class=\"psdk-utility-view-all\">\n      <button *ngIf=\"count$ > 3\" mat-button color=\"primary\" (click)=\"onViewAll$.onClick()\">View all</button>\n    </div>\n  </div>\n</div>\n", styles: [".progress-spinner{text-align:center;position:absolute;top:40%;left:40%}.psdk-icon{padding:0rem .125rem;min-width:unset}.psdk-utility-divider{border-bottom:.0625rem solid var(--app-neutral-light-color)}.psdk-utility-view-all{width:100%;display:flex;justify-content:center}.psdk-utility-count{background:var(--app-primary-light-color);border-radius:.5625rem;color:var(--app-inverse-form-color);display:inline-block;font-size:.75rem;font-weight:700;text-align:center;width:1.125rem;vertical-align:top;margin:0 0 .313rem 1rem}.psdk-utility .header-text{font-size:1rem;font-weight:700;padding-bottom:.3125rem;text-align:left;display:inline-block}.psdk-utility .header-icon{display:inline-block}.psdk-utility{width:100%;padding:.625rem 0rem;text-align:left;background-color:var(--app-form-color);border-radius:.6125rem;margin:.3125rem 0rem;position:relative}.psdk-utility .header{text-align:left;display:flex;align-items:center}.psdk-utility-svg-icon{width:1.4rem;display:inline-block}.psdk-settings-svg-icon{width:1.4rem;display:inline-block;filter:var(--app-primary-color-filter)}.psdk-utility .message{text-align:center}.psdk-utility-card{display:flex;flex-direction:row;padding:.25rem 0rem .25rem .25rem}.psdk-utility-card-icon{flex-grow:1;max-width:2.813rem}.psdk-utility-card-svg-icon{width:2.5rem;display:inline-block}.psdk-utility-card-main{flex-grow:2;max-width:16.563rem}.psdk-utility-card-main-primary-url{color:var(--app-primary-color)}.psdk-utility-card-main-primary-url .mat-mdc-button.mat-primary{padding-left:0}.psdk-utility-card-main-primary-label{font-weight:700}.psdk-utility-card-actions{flex-grow:1;text-align:right}.psdk-utility-card-action-svg-icon{width:1.4rem;display:inline-block}.psdk-utility-card-actions-svg-icon{width:1.4rem;display:inline-block;vertical-align:middle;filter:var(--app-primary-color-filter)}.psdk-utility-card-action-actions-svg-icon{width:1.4rem;display:inline-block;vertical-align:bottom}\n"], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(function () { return CommonModule; }) }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i0.forwardRef(function () { return i2.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: i0.forwardRef(function () { return MatButtonModule; }) }, { kind: "component", type: i0.forwardRef(function () { return i3.MatButton; }), selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i0.forwardRef(function () { return i3.MatIconButton; }), selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: i0.forwardRef(function () { return MatMenuModule; }) }, { kind: "component", type: i0.forwardRef(function () { return i4.MatMenu; }), selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i0.forwardRef(function () { return i4.MatMenuItem; }), selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i0.forwardRef(function () { return i4.MatMenuTrigger; }), selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: i0.forwardRef(function () { return MatProgressSpinnerModule; }) }, { kind: "component", type: i0.forwardRef(function () { return i5.MatProgressSpinner; }), selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i0.forwardRef(function () { return ComponentMapperComponent; }), selector: "component-mapper", inputs: ["name", "props", "errorMsg", "outputEvents", "parent"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListUtilityComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-list-utility', standalone: true, imports: [CommonModule, MatButtonModule, MatMenuModule, MatProgressSpinnerModule, forwardRef(() => ComponentMapperComponent)], template: "<div style=\"text-align: left\">\n  <div class=\"psdk-utility\">\n    <div class=\"header\">\n      <div class=\"header-icon\">\n        <img class=\"psdk-utility-svg-icon\" src=\"{{ headerSvgIcon$ }}\" />\n      </div>\n      <div class=\"header-text\">{{ name$ }}</div>\n      <div class=\"psdk-utility-count\" id=\"attachments-count\">{{ count$ }}</div>\n      <div style=\"flex-grow: 1\"></div>\n      <div class=\"header-icon\">\n        <button mat-icon-button [matMenuTriggerFor]=\"utilityMenu\">\n          <img class=\"psdk-utility-card-actions-svg-icon\" src=\"{{ settingsSvgIcon$ }}\" />\n        </button>\n        <mat-menu #utilityMenu=\"matMenu\" overlapTrigger=\"false\">\n          <ng-container *ngFor=\"let action of arActions$\">\n            <button mat-menu-item (click)=\"action.onClick()\">{{ action.text }}</button>\n          </ng-container>\n        </mat-menu>\n      </div>\n    </div>\n    <div class=\"psdk-utiltiy-divider\"></div>\n    <br />\n    <mat-spinner *ngIf=\"bLoading$\" class=\"progress-spinner\" diameter=\"50\"></mat-spinner>\n    <div *ngIf=\"count$ == 0\" class=\"message\">{{ noItemsMessage$ }}</div>\n    <div *ngIf=\"count$ > 0\" class=\"psdk-utility-items\">\n      <component-mapper name=\"SummaryList\" [props]=\"{ arItems$, menuIconOverrideAction$ }\"></component-mapper>\n    </div>\n    <div class=\"psdk-utility-view-all\">\n      <button *ngIf=\"count$ > 3\" mat-button color=\"primary\" (click)=\"onViewAll$.onClick()\">View all</button>\n    </div>\n  </div>\n</div>\n", styles: [".progress-spinner{text-align:center;position:absolute;top:40%;left:40%}.psdk-icon{padding:0rem .125rem;min-width:unset}.psdk-utility-divider{border-bottom:.0625rem solid var(--app-neutral-light-color)}.psdk-utility-view-all{width:100%;display:flex;justify-content:center}.psdk-utility-count{background:var(--app-primary-light-color);border-radius:.5625rem;color:var(--app-inverse-form-color);display:inline-block;font-size:.75rem;font-weight:700;text-align:center;width:1.125rem;vertical-align:top;margin:0 0 .313rem 1rem}.psdk-utility .header-text{font-size:1rem;font-weight:700;padding-bottom:.3125rem;text-align:left;display:inline-block}.psdk-utility .header-icon{display:inline-block}.psdk-utility{width:100%;padding:.625rem 0rem;text-align:left;background-color:var(--app-form-color);border-radius:.6125rem;margin:.3125rem 0rem;position:relative}.psdk-utility .header{text-align:left;display:flex;align-items:center}.psdk-utility-svg-icon{width:1.4rem;display:inline-block}.psdk-settings-svg-icon{width:1.4rem;display:inline-block;filter:var(--app-primary-color-filter)}.psdk-utility .message{text-align:center}.psdk-utility-card{display:flex;flex-direction:row;padding:.25rem 0rem .25rem .25rem}.psdk-utility-card-icon{flex-grow:1;max-width:2.813rem}.psdk-utility-card-svg-icon{width:2.5rem;display:inline-block}.psdk-utility-card-main{flex-grow:2;max-width:16.563rem}.psdk-utility-card-main-primary-url{color:var(--app-primary-color)}.psdk-utility-card-main-primary-url .mat-mdc-button.mat-primary{padding-left:0}.psdk-utility-card-main-primary-label{font-weight:700}.psdk-utility-card-actions{flex-grow:1;text-align:right}.psdk-utility-card-action-svg-icon{width:1.4rem;display:inline-block}.psdk-utility-card-actions-svg-icon{width:1.4rem;display:inline-block;vertical-align:middle;filter:var(--app-primary-color-filter)}.psdk-utility-card-action-actions-svg-icon{width:1.4rem;display:inline-block;vertical-align:bottom}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.Utils }]; }, propDecorators: { name$: [{
                type: Input
            }], icon$: [{
                type: Input
            }], bLoading$: [{
                type: Input
            }], count$: [{
                type: Input
            }], arActions$: [{
                type: Input
            }], arItems$: [{
                type: Input
            }], menuIconOverrideAction$: [{
                type: Input
            }], onViewAll$: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 