import { DataTableBuilder } from '../DataTableBuilder/DataTableBuilder.js';

class SummaryDataTableBuilder extends 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);
    }
}

export { SummaryDataTableBuilder, SummaryDataTableBuilder as default };
//# sourceMappingURL=SummaryDataTableBuilder.js.map
