/*
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 { Base, Number_$type, markType } from "igniteui-webcomponents-core";
import { FastIterationDictionary$2 } from "igniteui-webcomponents-core";
import { CellModel } from "./CellModel";
/**
 * @hidden
 */
export let AccessibilityRow = /*@__PURE__*/ (() => {
    class AccessibilityRow extends Base {
        constructor() {
            super(...arguments);
            this.i = null;
            this.e = 0;
            this.d = 0;
            this.f = null;
            this.a = new FastIterationDictionary$2(Number_$type, CellModel.$, 0);
        }
        get c() {
            return this.e + 2;
        }
        get b() {
            return this.a;
        }
        j(a, b) {
            if (!this.b.d(a.k.a0)) {
                this.b.s(a.k.a0, a);
            }
            else if (this.b.item(a.k.a0) != a) {
                this.b.item(a.k.a0, a);
            }
            b.setAttribute("id", this.g(a));
            b.setAttribute("role", this.f);
            if (a.k.av) {
                b.setAttribute("aria-colindex", "1");
                b.setAttribute("aria-colspan", this.d.toString());
            }
            else {
                b.setAttribute("aria-colindex", (a.k.a0 + 1).toString());
            }
            if (a.b8 == 1) {
                b.setAttribute("aria-selected", "true");
            }
            else {
                b.setAttribute("aria-selected", "false");
            }
            if (a.k.g) {
                if (a.m == 1) {
                    b.setAttribute("aria-sort", "ascending");
                }
                else if (a.m == 2) {
                    b.setAttribute("aria-sort", "descending");
                }
                else {
                    b.setAttribute("aria-sort", "none");
                }
            }
            if (a.ar) {
                b.setAttribute("aria-expanded", a.az ? "true" : "false");
            }
        }
        h() {
            let a = "";
            for (let b = 0; b < this.d; b++) {
                if (this.b.d(b)) {
                    if (a.length > 0) {
                        a += " ";
                    }
                    let c = this.g(this.b.item(b));
                    a += c;
                }
            }
            if (a == "") {
                for (let d = 0; d < this.b.o.count; d++) {
                    let e = this.b.o._inner[d];
                    let f = this.b.item(e);
                    let g = this.g(f);
                    a += g;
                }
            }
            return a;
        }
        k() {
            this.b.u();
        }
        g(a) {
            if (a.k.ag || (a.k.aj && !a.k.h)) {
                if (a.k.av) {
                    return "cellid" + this.i + "r" + this.c + "span";
                }
                return "cellid" + this.i + "r" + this.c + "c" + a.k.a0;
            }
            return null;
        }
        l(a, b) {
            a.getNativeElement().removeAttribute(b);
        }
    }
    AccessibilityRow.$t = /*@__PURE__*/ markType(AccessibilityRow, 'AccessibilityRow');
    return AccessibilityRow;
})();
//# sourceMappingURL=AccessibilityRow.js.map
