import { formatDate } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { BrowserService } from '../../services/browser/browser.service';
import * as i0 from "@angular/core";
import * as i1 from "../../services/browser/browser.service";
import * as i2 from "@angular/common";
import * as i3 from "@angular/router";
import * as i4 from "../pagination/pagination.component";
import * as i5 from "ngx-pagination";
import * as i6 from "rpx-xui-translation";
const _c0 = (a0, a1, a2) => ({ itemsPerPage: a0, currentPage: a1, totalItems: a2 });
function CaseListComponent_td_6_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "td", 8)(1, "div", 9)(2, "input", 10);
    i0.ɵɵlistener("change", function CaseListComponent_td_6_Template_input_change_2_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.selectAll()); });
    i0.ɵɵelementEnd();
    i0.ɵɵelement(3, "label", 11);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("checked", ctx_r1.allOnPageSelected())("disabled", !ctx_r1.canAnyBeShared());
    i0.ɵɵadvance();
    i0.ɵɵattribute("aria-labelledby", "select-all");
} }
function CaseListComponent_th_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "th", 12);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const h_r3 = ctx.$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, h_r3.header));
} }
function CaseListComponent_ng_container_9_td_2_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "td", 15)(1, "div", 9)(2, "input", 16);
    i0.ɵɵlistener("change", function CaseListComponent_ng_container_9_td_2_Template_input_change_2_listener() { i0.ɵɵrestoreView(_r4); const c_r5 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.changeSelection(c_r5)); })("keyup", function CaseListComponent_ng_container_9_td_2_Template_input_keyup_2_listener($event) { i0.ɵɵrestoreView(_r4); const c_r5 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onKeyUp($event, c_r5)); });
    i0.ɵɵelementEnd();
    i0.ɵɵelement(3, "label", 17);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext();
    const c_r5 = ctx_r5.$implicit;
    const i_r7 = ctx_r5.index;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("id", "select-", c_r5[ctx_r1.tableConfig.idField] || i_r7, "");
    i0.ɵɵpropertyInterpolate1("name", "select-", c_r5[ctx_r1.tableConfig.idField] || i_r7, "");
    i0.ɵɵproperty("checked", ctx_r1.isSelected(c_r5))("disabled", !ctx_r1.canBeShared(c_r5));
    i0.ɵɵadvance();
    i0.ɵɵpropertyInterpolate1("for", "select-", c_r5[ctx_r1.tableConfig.idField] || i_r7, "");
    i0.ɵɵattribute("aria-labelledby", "select-" + (c_r5[ctx_r1.tableConfig.idField] || i_r7));
} }
function CaseListComponent_ng_container_9_ng_container_3_th_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, c_r5[col_r8.key]));
} }
function CaseListComponent_ng_container_9_ng_container_3_th_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "a", 20);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵproperty("routerLink", c_r5.routerLink);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, c_r5[col_r8.key]));
} }
function CaseListComponent_ng_container_9_ng_container_3_th_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "th", 15);
    i0.ɵɵtemplate(1, CaseListComponent_ng_container_9_ng_container_3_th_1_ng_container_1_Template, 3, 3, "ng-container", 19)(2, CaseListComponent_ng_container_9_ng_container_3_th_1_ng_container_2_Template, 4, 4, "ng-container", 19);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext().$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !col_r8.type || col_r8.type === "text");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", col_r8.type === "link" && c_r5.routerLink);
} }
function CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "a", 20);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵproperty("routerLink", c_r5.routerLink);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, c_r5[col_r8.key]));
} }
function CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "currency");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1("-", i0.ɵɵpipeBind2(2, 1, c_r5[col_r8.key], "GBP"), "");
} }
function CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r1.formatDate(c_r5[col_r8.key]));
} }
function CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r1.formatDateAtTime(c_r5[col_r8.key]));
} }
function CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext(2).$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, c_r5[col_r8.key]));
} }
function CaseListComponent_ng_container_9_ng_container_3_td_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 21);
    i0.ɵɵtemplate(1, CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_1_Template, 4, 4, "ng-container", 19)(2, CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_2_Template, 3, 4, "ng-container", 22)(3, CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_3_Template, 2, 1, "ng-container", 22)(4, CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_4_Template, 2, 1, "ng-container", 22)(5, CaseListComponent_ng_container_9_ng_container_3_td_2_ng_container_5_Template, 3, 3, "ng-container", 23);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const col_r8 = i0.ɵɵnextContext().$implicit;
    const c_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("ngSwitch", col_r8 == null ? null : col_r8.type);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", col_r8.type === "link" && c_r5.routerLink);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", "money");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", "date");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", "dateAtTime");
} }
function CaseListComponent_ng_container_9_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, CaseListComponent_ng_container_9_ng_container_3_th_1_Template, 3, 2, "th", 14)(2, CaseListComponent_ng_container_9_ng_container_3_td_2_Template, 6, 5, "td", 18);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const isFirst_r9 = ctx.first;
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", isFirst_r9 && ctx_r1.firstCellIsHeader);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !(isFirst_r9 && ctx_r1.firstCellIsHeader));
} }
function CaseListComponent_ng_container_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "tr", 13);
    i0.ɵɵtemplate(2, CaseListComponent_ng_container_9_td_2_Template, 4, 9, "td", 14)(3, CaseListComponent_ng_container_9_ng_container_3_Template, 3, 2, "ng-container", 6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r1.selectionEnabled);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", ctx_r1.tableConfig.columnConfigs);
} }
function CaseListComponent_ccd_pagination_11_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ccd-pagination", 24);
    i0.ɵɵlistener("pageChange", function CaseListComponent_ccd_pagination_11_Template_ccd_pagination_pageChange_0_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.goToPage($event)); });
    i0.ɵɵelementEnd();
} }
export class DateTimeFormatUtils {
    static formatDateAtTime(date, is24Hour) {
        return `${formatDate(date, 'dd MMM yyyy', 'en-GB')} at ${DateTimeFormatUtils.formatTime(date, is24Hour)}`;
    }
    static formatTime(date, is24Hour) {
        return is24Hour ? formatDate(date, 'HH:mm', 'en-GB') : formatDate(date, 'h:mm a', 'en-GB').toLowerCase();
    }
}
export class CaseListComponent {
    browserService;
    classes = '';
    caption;
    firstCellIsHeader = false;
    cases;
    tableConfig = {
        idField: 'id',
        columnConfigs: [
            { header: 'Date', key: 'date', type: 'text' },
            { header: 'Amount', key: 'amount' }
        ]
    };
    selectionEnabled = false;
    selection = new EventEmitter();
    selectedCases = [];
    currentPageNo;
    totalResultsCount;
    pageSize;
    pageChange = new EventEmitter();
    constructor(browserService) {
        this.browserService = browserService;
    }
    formatDate(date) {
        return date ? formatDate(date, 'dd MMM yyyy', 'en-GB') : '-';
    }
    formatDateAtTime(date) {
        return date ? DateTimeFormatUtils.formatDateAtTime(date, false) : '-';
    }
    canBeShared(c) {
        return true;
    }
    canAnyBeShared() {
        return this.cases.some(c => this.canBeShared(c));
    }
    selectAll() {
        if (this.allOnPageSelected()) {
            // All cases already selected, so unselect all on this page
            this.selectedCases = [];
        }
        else {
            this.cases.forEach(aCase => {
                if (!this.isSelected(aCase) && this.canBeShared(aCase)) {
                    this.selectedCases = [...this.selectedCases, aCase];
                }
            });
        }
        this.selection.emit(this.selectedCases);
    }
    changeSelection(aCase) {
        if (this.isSelected(aCase)) {
            this.selectedCases.forEach((aSelectedCase, i) => {
                if (aCase.case_id === aSelectedCase.case_id) {
                    this.selectedCases = this.selectedCases.slice(0, i).concat(this.selectedCases.slice(i + 1));
                }
            });
        }
        else {
            if (this.canBeShared(aCase)) {
                this.selectedCases = [...this.selectedCases, aCase];
            }
        }
        this.selection.emit(this.selectedCases);
    }
    isSelected(aCase) {
        if (this.selectedCases) {
            for (let index = 0, length = this.selectedCases.length; index < length; index++) {
                if (aCase.case_id === this.selectedCases[index].case_id) {
                    return true;
                }
            }
        }
        return false;
    }
    allOnPageSelected() {
        return !this.cases.some(aCase => !this.isSelected(aCase));
    }
    onKeyUp($event, aCase) {
        if ($event.key === 'Space') {
            if (this.browserService.isFirefox || this.browserService.isSafari || this.browserService.isIEOrEdge) {
                this.changeSelection(aCase);
            }
        }
    }
    goToPage(pageNumber) {
        this.currentPageNo = pageNumber;
        this.pageChange.emit(pageNumber);
    }
    static ɵfac = function CaseListComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseListComponent)(i0.ɵɵdirectiveInject(i1.BrowserService)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseListComponent, selectors: [["ccd-case-list"]], inputs: { classes: "classes", caption: "caption", firstCellIsHeader: "firstCellIsHeader", cases: "cases", tableConfig: "tableConfig", selectionEnabled: "selectionEnabled", selectedCases: "selectedCases", currentPageNo: "currentPageNo", totalResultsCount: "totalResultsCount", pageSize: "pageSize" }, outputs: { selection: "selection", pageChange: "pageChange" }, decls: 12, vars: 17, consts: [[1, "govuk-table__caption"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["class", "govuk-table__header", 4, "ngIf"], ["class", "govuk-table__header", "scope", "col", 4, "ngFor", "ngForOf"], [1, "govuk-table__body"], [4, "ngFor", "ngForOf"], [3, "pageChange", 4, "ngIf"], [1, "govuk-table__header"], [1, "govuk-checkboxes__item"], ["id", "select-all", "name", "select-all", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "checked", "disabled"], ["for", "select-all", 1, "govuk-label", "govuk-checkboxes__label"], ["scope", "col", 1, "govuk-table__header"], ["data-selector", "table-row", 1, "govuk-table__row"], ["data-selector", "table-header", "class", "govuk-table__header", "scope", "row", 4, "ngIf"], ["data-selector", "table-header", "scope", "row", 1, "govuk-table__header"], ["type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "keyup", "id", "name", "checked", "disabled"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["data-selector", "table-cell", "class", "govuk-table__cell", 3, "ngSwitch", 4, "ngIf"], [4, "ngIf"], [1, "govuk-link", 3, "routerLink"], ["data-selector", "table-cell", 1, "govuk-table__cell", 3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], [3, "pageChange"]], template: function CaseListComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "table")(1, "caption", 0);
            i0.ɵɵtext(2);
            i0.ɵɵpipe(3, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "thead", 1)(5, "tr", 2);
            i0.ɵɵtemplate(6, CaseListComponent_td_6_Template, 4, 3, "td", 3)(7, CaseListComponent_th_7_Template, 3, 3, "th", 4);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(8, "tbody", 5);
            i0.ɵɵtemplate(9, CaseListComponent_ng_container_9_Template, 4, 2, "ng-container", 6);
            i0.ɵɵpipe(10, "paginate");
            i0.ɵɵelementEnd()();
            i0.ɵɵtemplate(11, CaseListComponent_ccd_pagination_11_Template, 1, 0, "ccd-pagination", 7);
        } if (rf & 2) {
            i0.ɵɵclassMap("govuk-table " + ctx.classes);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 8, ctx.caption));
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("ngIf", ctx.selectionEnabled);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngForOf", ctx.tableConfig.columnConfigs);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind2(10, 10, ctx.cases, i0.ɵɵpureFunction3(13, _c0, ctx.pageSize, ctx.currentPageNo, ctx.totalResultsCount)));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.totalResultsCount > ctx.pageSize);
        } }, dependencies: [i2.NgForOf, i2.NgIf, i2.NgSwitch, i2.NgSwitchCase, i2.NgSwitchDefault, i3.RouterLink, i4.PaginationComponent, i2.CurrencyPipe, i5.PaginatePipe, i6.RpxTranslatePipe] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseListComponent, [{
        type: Component,
        args: [{ selector: 'ccd-case-list', template: "<table class=\"{{'govuk-table ' + classes}}\">\n  <caption class=\"govuk-table__caption\">{{caption | rpxTranslate}}</caption>\n  <thead class=\"govuk-table__head\">\n    <tr class=\"govuk-table__row\">\n      <td class=\"govuk-table__header\" *ngIf=\"selectionEnabled\">\n        <div class=\"govuk-checkboxes__item\">\n          <input class=\"govuk-checkboxes__input\" id=\"select-all\" name=\"select-all\" type=\"checkbox\" (change)=\"selectAll()\"\n                 [checked]=\"allOnPageSelected()\" [disabled]=\"!canAnyBeShared()\" />\n          <!-- This label element is used to hide the standard checkbox with a govuk-styled one -->\n          <label class=\"govuk-label govuk-checkboxes__label\" for=\"select-all\" [attr.aria-labelledby]=\"'select-all'\">\n          </label>\n        </div>\n      </td>\n      <th class=\"govuk-table__header\" scope=\"col\" *ngFor=\"let h of tableConfig.columnConfigs\">{{h.header | rpxTranslate}}</th>\n    </tr>\n  </thead>\n  <tbody class=\"govuk-table__body\">\n    <ng-container *ngFor=\"let c of cases | paginate: { itemsPerPage: pageSize, currentPage: currentPageNo, totalItems: totalResultsCount };  index as i\">\n      <tr data-selector=\"table-row\" class=\"govuk-table__row\">\n        <td data-selector=\"table-header\" class=\"govuk-table__header\" scope=\"row\" *ngIf=\"selectionEnabled\">\n          <div class=\"govuk-checkboxes__item\">\n            <input class=\"govuk-checkboxes__input\" id=\"select-{{ c[tableConfig.idField] || i }}\" name=\"select-{{ c[tableConfig.idField] || i }}\"\n                  type=\"checkbox\" (change)=\"changeSelection(c)\" [checked]=\"isSelected(c)\" [disabled]=\"!canBeShared(c)\" (keyup)=\"onKeyUp($event, c)\" />\n            <!-- This label element is used to hide the standard checkbox with a govuk-styled one -->\n            <label class=\"govuk-label govuk-checkboxes__label\" for=\"select-{{ c[tableConfig.idField] || i }}\" [attr.aria-labelledby]=\"'select-' + (c[tableConfig.idField] || i)\">\n            </label>\n          </div>\n        </td>\n        <ng-container *ngFor=\"let col of tableConfig.columnConfigs; first as isFirst\">\n          <th data-selector=\"table-header\" class=\"govuk-table__header\" scope=\"row\" *ngIf=\"isFirst && firstCellIsHeader\">\n            <ng-container *ngIf=\"!col.type || col.type === 'text'\">{{c[col.key] | rpxTranslate}}</ng-container>\n            <ng-container *ngIf=\"col.type === 'link' && c.routerLink\">\n              <a class=\"govuk-link\" [routerLink]=\"c.routerLink\">{{c[col.key] | rpxTranslate}}</a>\n            </ng-container>\n          </th>\n          <td data-selector=\"table-cell\" class=\"govuk-table__cell\" *ngIf=\"!(isFirst && firstCellIsHeader)\" [ngSwitch]=\"col?.type\">\n            <ng-container *ngIf=\"col.type === 'link' && c.routerLink\">\n              <a class=\"govuk-link\" [routerLink]=\"c.routerLink\">{{c[col.key] | rpxTranslate}}</a>\n            </ng-container>\n            <ng-container *ngSwitchCase=\"'money'\">-{{ c[col.key] | currency:'GBP' }}</ng-container>\n            <ng-container *ngSwitchCase=\"'date'\">{{formatDate(c[col.key])}}</ng-container>\n            <ng-container *ngSwitchCase=\"'dateAtTime'\">{{formatDateAtTime(c[col.key])}}</ng-container>\n            <ng-container *ngSwitchDefault>{{c[col.key] | rpxTranslate}}</ng-container>\n          </td>\n        </ng-container>\n      </tr>\n    </ng-container>\n  </tbody>\n</table>\n<ccd-pagination *ngIf=\"totalResultsCount > pageSize\"\n  (pageChange)=\"goToPage($event)\"\n></ccd-pagination>\n" }]
    }], () => [{ type: i1.BrowserService }], { classes: [{
            type: Input
        }], caption: [{
            type: Input
        }], firstCellIsHeader: [{
            type: Input
        }], cases: [{
            type: Input
        }], tableConfig: [{
            type: Input
        }], selectionEnabled: [{
            type: Input
        }], selection: [{
            type: Output
        }], selectedCases: [{
            type: Input
        }], currentPageNo: [{
            type: Input
        }], totalResultsCount: [{
            type: Input
        }], pageSize: [{
            type: Input
        }], pageChange: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseListComponent, { className: "CaseListComponent", filePath: "lib/shared/components/case-list/case-list.component.ts", lineNumber: 20 }); })();
export class TableColumnConfig {
    header;
    key;
    type;
    constructor() {
        this.header = '';
        this.key = '';
        this.type = 'text';
    }
}
export class TableConfig {
    // Specifies which field of an item uniquely identifies it among others of the same type
    idField;
    columnConfigs;
    constructor() {
        this.idField = '';
        this.columnConfigs = [];
    }
}
//# sourceMappingURL=data:application/json;base64, 