export class StatusCellRenderer {
    init(params) {
        this.eGui = document.createElement('div');
        this.render(params);
    }
    getGui() {
        return this.eGui;
    }
    refresh(params) {
        this.render(params);
        return true;
    }
    render(params) {
        var _a, _b, _c;
        const field = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.field;
        const cfg = ((_b = params.value) !== null && _b !== void 0 ? _b : (_c = params.data) === null || _c === void 0 ? void 0 : _c[field]);
        this.eGui.textContent = '';
        if (cfg && typeof cfg === 'object' && 'label' in cfg) {
            const el = document.createElement('ifx-status');
            el.label = cfg.label;
            if (cfg.color != null)
                el.color = cfg.color;
            el.border = !!cfg.border;
            this.eGui.appendChild(el);
        }
        else if (cfg != null) {
            this.eGui.textContent = String(cfg);
        }
    }
}
//# sourceMappingURL=statusCellRenderer.js.map
