/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { Base, markType } from "igniteui-webcomponents-core";
import { Color } from "igniteui-webcomponents-core";
import { CellModel } from "./CellModel";
import { FontUtil } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
var ContentCellModelHelper = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(ContentCellModelHelper, _super);
    function ContentCellModelHelper() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ContentCellModelHelper.g = function (a) {
        if (a == null) {
            return ContentCellModelHelper.f;
        }
        return a.color;
    };
    ContentCellModelHelper.c = function (a, b, c) {
        switch (c) {
            case 0:
                a.setRawStyleProperty("text-align", "left");
                break;
            case 1:
                a.setRawStyleProperty("text-align", "center");
                break;
            case 2:
                a.setRawStyleProperty("text-align", "right");
                break;
            case 3:
                a.setRawStyleProperty("text-align", "center");
                break;
        }
    };
    ContentCellModelHelper.e = function (a, b, c) {
        switch (c) {
            case 0:
                b.setRawStyleProperty("vertical-align", "top");
                break;
            case 1:
                b.setRawStyleProperty("vertical-align", "center");
                break;
            case 2:
                b.setRawStyleProperty("vertical-align", "bottom");
                break;
            case 3:
                b.setRawStyleProperty("vertical-align", "center");
                break;
        }
    };
    ContentCellModelHelper.a = function (a, b, c, d, e) {
        if (b.as) {
            if (b.ax(CellModel.ei) || b.ax(CellModel.dw) || b.ax(CellModel.gf) || b.aw("IsRowPinned") || b.aw("IsRowSticky") || b.aw("PinnedRowOpacity")) {
                var f = Math.min(1, Math.max(0, b.cb));
                var g = b.bz * (1 - f);
                d.setRawStyleProperty("opacity", g.toString());
                if (b.a4) {
                    e.b6(b.bz * f);
                }
            }
            if (b.ax(CellModel.d7)) {
                ContentCellModelHelper.d(d, b.kg);
                if (b.a4) {
                    e.b3(b.kg);
                }
            }
            if (b.ax(CellModel.fj)) {
                switch (b.z) {
                    case 0:
                        d.setRawStyleProperty("white-space", "nowrap");
                        d.setRawStyleProperty("text-overflow", "ellipsis");
                        break;
                    case 3:
                    case 2:
                        d.setRawStyleProperty("white-space", "pre-wrap");
                        d.setRawStyleProperty("text-overflow", "ellipsis");
                        break;
                    case 1:
                        d.setRawStyleProperty("white-space", "nowrap");
                        d.setRawStyleProperty("text-overflow", "clip");
                        break;
                }
            }
            if (b.ax(CellModel.e2) || b.ax(CellModel.ge)) {
                var h = b.f;
                var i = b.h;
                ContentCellModelHelper.c(c, d, h);
                e.bf(c, d, h);
                ContentCellModelHelper.e(c, d, i);
                if (b.a4) {
                    e.b2(h, i);
                }
            }
            if (b.aw("ActualFontInfo")) {
                ContentCellModelHelper.b(a, d, b.ad);
            }
            if (b.aw("IsEdited") || b.aw("IsDeleted")) {
                if (b.ay || b.av) {
                    if (b.av) {
                        d.setRawStyleProperty("text-decoration", "line-through");
                    }
                    else {
                        d.setRawStyleProperty("text-decoration", "none");
                    }
                }
                else {
                    d.setRawStyleProperty("text-decoration", "none");
                }
            }
        }
    };
    ContentCellModelHelper.b = function (a, b, c) {
        if (c == null) {
            c = FontUtil.getDefaultFont(a);
        }
        b.setRawStyleProperty("font", c.fontString);
    };
    ContentCellModelHelper.d = function (a, b) {
        var c = ContentCellModelHelper.g(b);
        a.setRawStyleProperty("color", c.colorString);
    };
    ContentCellModelHelper.$t = markType(ContentCellModelHelper, 'ContentCellModelHelper');
    ContentCellModelHelper.f = Color.u(0, 0, 0, 0);
    return ContentCellModelHelper;
}(Base));
export { ContentCellModelHelper };
//# sourceMappingURL=ContentCellModelHelper.js.map
