'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var DataTableBuilder = require('../DataTableBuilder/DataTableBuilder.js');

class SummaryDataTableBuilder extends DataTableBuilder.DataTableBuilder {
    summary;
    constructor(summary, sections) {
        const columns = summary.fields
            .filter((field) => !sections || !sections.includes(field.name))
            .map((field) => field.name);
        const fields = summary.fields.map((field) => ({
            ...field,
            calculated: false,
            sortable: false,
            defaultsort: false,
            mandatory: true,
            visible: true,
        }));
        super(fields, true);
        this.summary = summary;
        this.columns = Array.from(new Set(columns));
    }
    buildSummaryTable() {
        return super.buildTable(this.summary.data);
    }
}

exports.SummaryDataTableBuilder = SummaryDataTableBuilder;
exports.default = SummaryDataTableBuilder;
//# sourceMappingURL=SummaryDataTableBuilder.js.map
