'use strict';

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

const core = require('./core-b7b9d752.js');
require('./utils-2a7c8f6e.js');
const table_utils = require('./table.utils-12a2d306.js');

const RenderRow = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        /**
         * Renderer to use for cell content when the selected cell conditions are met
         */
        this.row = this.renderRow.bind(this);
        /**
         * Test function for when to use this renderer
         */
        this.when = () => true;
        this.anjRowControlDidLoad = core.createEvent(this, "anjRowControlDidLoad", 7);
    }
    componentDidLoad() {
        this.anjRowControlDidLoad.emit();
    }
    renderRow(props) {
        if (this.template) {
            return core.h("tr", { class: table_utils.TableClasses.row, ref: r => props.renderer.rowTemplate(this.template, r, props.row, props.rowIndex) });
        }
        else if (this.formatter) {
            return core.h("tr", { class: table_utils.TableClasses.row, innerHTML: this.formatter(props.row) });
        }
        else {
            return core.h("tr", { class: table_utils.TableClasses.row }, this.renderer(props.row));
        }
    }
};

exports.anj_render_row = RenderRow;
