import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/flex-layout/flex";
import * as i3 from "@angular/material/button";
import * as i4 from "@angular/material/icon";
import * as i5 from "@angular/material/divider";
export class FailedItemsListComponent {
    constructor(location) {
        this.location = location;
        this.onReUpload = new EventEmitter();
    }
    ngOnInit() {
    }
    isValidDate(d) {
        var date = new Date(d);
        return date instanceof Date && !isNaN(date.getTime());
    }
    reUpload() {
        this.onReUpload.emit(true);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FailedItemsListComponent, deps: [{ token: i1.Location }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FailedItemsListComponent, selector: "app-failed-items-list", inputs: { failedItems: "failedItems", selectedFields: "selectedFields" }, outputs: { onReUpload: "onReUpload" }, ngImport: i0, template: "<div *ngIf=\"failedItems.length\" class=\"mt-4\" fxLayout=\"column\">\n  <div fxLayout=\"row wrap\" class=\"pb-3\">\n    <h5 fxFlex=\"30%\" class=\"primary-color\">Summary</h5>\n    <div fxFlex=\"70%\" fxLayoutAlign=\"center center\">\n      <h5 class=\"secondary-color\">\n        <span class=\"font-weight-bold\">{{failedItems.length}}</span>\n      </h5>\n      <span class=\"text-muted ml-2\"> Error(s) Found In Uploaded File</span>\n    </div>\n  </div>\n\n  <div>\n    <mat-divider></mat-divider>\n  </div>\n  <div fxLayout=\"row wrap\" class=\"pt-3\">\n    <h5 class=\"primary-color\">Errors</h5>\n    <div style=\"overflow-x: auto;width: 1100px;\" class=\"pt-3\">\n      <table class=\"table table-bordered table-striped table-hover table-sm ml-4 w-100\">\n        <thead>\n          <tr>\n            <th>#</th>\n            <th *ngFor=\"let field of selectedFields;\">{{field?.label}}</th>\n            <th class=\"text-danger\">Error</th>\n          </tr>\n        </thead>\n        <tbody>\n          <ng-container *ngFor=\"let timesheet of failedItems; let i=index\">\n            <tr>\n              <td>{{i + 1}}</td>\n              <td *ngFor=\"let field of selectedFields;\">\n                <ng-container *ngIf=\"(field.propertyType == 'date' || field.propertyType == 'dateTime')\n                 &&isValidDate(timesheet[field.property]);else elseProperty;\">\n                  {{ timesheet[field.property] | date: 'MMM d, y, H:mm:ss' }}\n                </ng-container>\n                <ng-template #elseProperty>\n                  {{ timesheet[field.property] }}\n                </ng-template>\n              </td>\n              <td class=\"text-danger\">\n                {{timesheet?.error}}\n              </td>\n            </tr>\n          </ng-container>\n        </tbody>\n      </table>\n    </div>\n  </div>\n  <div class=\"mt-1\" fxFlex=\"100%\" fxLayoutAlign=\"end\">\n    <button mat-button class=\"mt-2 mr-2\" type=\"button\" (click)=\"location.back()\">\n      Close\n    </button>\n    <button mat-stroked-button class=\"mt-2 mr-2 primary-color\" type=\"button\" (click)=\"reUpload()\">\n      <mat-icon>\n        <span class=\"material-icons-outlined\">\n          file_upload\n        </span>\n      </mat-icon>\n      Re-upload\n    </button>\n  </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: "  [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],  [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],  [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],  [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: "  [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md],  [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md],  [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm],  [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: "  [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md],  [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md],  [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm],  [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i3.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FailedItemsListComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-failed-items-list', template: "<div *ngIf=\"failedItems.length\" class=\"mt-4\" fxLayout=\"column\">\n  <div fxLayout=\"row wrap\" class=\"pb-3\">\n    <h5 fxFlex=\"30%\" class=\"primary-color\">Summary</h5>\n    <div fxFlex=\"70%\" fxLayoutAlign=\"center center\">\n      <h5 class=\"secondary-color\">\n        <span class=\"font-weight-bold\">{{failedItems.length}}</span>\n      </h5>\n      <span class=\"text-muted ml-2\"> Error(s) Found In Uploaded File</span>\n    </div>\n  </div>\n\n  <div>\n    <mat-divider></mat-divider>\n  </div>\n  <div fxLayout=\"row wrap\" class=\"pt-3\">\n    <h5 class=\"primary-color\">Errors</h5>\n    <div style=\"overflow-x: auto;width: 1100px;\" class=\"pt-3\">\n      <table class=\"table table-bordered table-striped table-hover table-sm ml-4 w-100\">\n        <thead>\n          <tr>\n            <th>#</th>\n            <th *ngFor=\"let field of selectedFields;\">{{field?.label}}</th>\n            <th class=\"text-danger\">Error</th>\n          </tr>\n        </thead>\n        <tbody>\n          <ng-container *ngFor=\"let timesheet of failedItems; let i=index\">\n            <tr>\n              <td>{{i + 1}}</td>\n              <td *ngFor=\"let field of selectedFields;\">\n                <ng-container *ngIf=\"(field.propertyType == 'date' || field.propertyType == 'dateTime')\n                 &&isValidDate(timesheet[field.property]);else elseProperty;\">\n                  {{ timesheet[field.property] | date: 'MMM d, y, H:mm:ss' }}\n                </ng-container>\n                <ng-template #elseProperty>\n                  {{ timesheet[field.property] }}\n                </ng-template>\n              </td>\n              <td class=\"text-danger\">\n                {{timesheet?.error}}\n              </td>\n            </tr>\n          </ng-container>\n        </tbody>\n      </table>\n    </div>\n  </div>\n  <div class=\"mt-1\" fxFlex=\"100%\" fxLayoutAlign=\"end\">\n    <button mat-button class=\"mt-2 mr-2\" type=\"button\" (click)=\"location.back()\">\n      Close\n    </button>\n    <button mat-stroked-button class=\"mt-2 mr-2 primary-color\" type=\"button\" (click)=\"reUpload()\">\n      <mat-icon>\n        <span class=\"material-icons-outlined\">\n          file_upload\n        </span>\n      </mat-icon>\n      Re-upload\n    </button>\n  </div>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.Location }], propDecorators: { failedItems: [{
                type: Input
            }], selectedFields: [{
                type: Input
            }], onReUpload: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 