UNPKG

igniteui-webcomponents-grids

Version:

Ignite UI Web Components grid components.

190 lines (189 loc) 7.01 kB
/* 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 { __extends } from "tslib"; import { DataGridCellLayoutPanel } from "./DataGridCellLayoutPanel"; import { DomWrapper_$type } from "igniteui-webcomponents-core"; import { List$1 } from "igniteui-webcomponents-core"; import { Stack$1 } from "igniteui-webcomponents-core"; import { FastIterationDictionary$2 } from "igniteui-webcomponents-core"; import { AccessibilityRow } from "./AccessibilityRow"; import { Number_$type, markType } from "igniteui-webcomponents-core"; /** * @hidden */ var DataGridAccessibilityLayoutPanel = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataGridAccessibilityLayoutPanel, _super); function DataGridAccessibilityLayoutPanel(a, b, c) { var _this = _super.call(this, a, b, c) || this; _this.a2 = new List$1(DomWrapper_$type, 0); _this.a3 = new Stack$1(DomWrapper_$type); _this.a0 = new FastIterationDictionary$2(Number_$type, AccessibilityRow.$, 0); _this.ay = null; _this.a7 = null; _this.a7 = DataGridAccessibilityLayoutPanel.a6.toString(); DataGridAccessibilityLayoutPanel.a6++; return _this; } DataGridAccessibilityLayoutPanel.prototype.refresh = function (a, b) { _super.prototype.refresh.call(this, a, b); if (this.rootElement != null) { var c = a.c5(); var d = a.b9.count; if (a.c6 > 0) { c++; } this.rootElement.setAttribute("role", "grid"); this.rootElement.setAttribute("aria-rowcount", c.toString()); this.rootElement.setAttribute("aria-colcount", d.toString()); this.rootElement.setAttribute("aria-multiselectable", "true"); } }; DataGridAccessibilityLayoutPanel.prototype.ah = function (a, b) { if (this.a1(a)) { if (a.l.g) { if (this.ay == null) { this.ay = new AccessibilityRow(); this.ay.i = this.a7; this.ay.e = -1; this.ay.d = this.g.b9.count; this.ay.f = "columnheader"; } this.ay.j(a, b); } else { var c = a.l.g ? -1 : a.l.x; var d = this.az(c); if (d == null) { d = new AccessibilityRow(); d.i = this.a7; d.e = c; d.d = this.g.b9.count; d.f = "gridcell"; this.a0.s(c, d); } d.j(a, b); } } }; DataGridAccessibilityLayoutPanel.prototype.aj = function (a, b) { if (this.a1(a)) { this.bb(b, "id"); this.bb(b, "role"); this.bb(b, "aria-colindex"); this.bb(b, "aria-selected"); if (a.l.g) { this.bb(b, "aria-sort"); } } }; DataGridAccessibilityLayoutPanel.prototype.ai = function (a, b) { if (this.a1(a)) { this.ah(a, b); } }; DataGridAccessibilityLayoutPanel.prototype.an = function () { this.a8(); if (this.ay != null) { this.ba(this.ay); this.ay.k(); } var a = this.a0.q; for (var b = 0; b < a.count; b++) { var c = a._inner[b]; this.ba(c); c.k(); } this.ay = null; this.a0.u(); }; DataGridAccessibilityLayoutPanel.prototype.az = function (a) { var b = this.a0.o; for (var c = 0; c < b.count; c++) { var d = b._inner[c]; var e = this.a0.item(d); if (e != null && e.e == a) { return e; } } return null; }; DataGridAccessibilityLayoutPanel.prototype.a4 = function () { if (this.a3.f > 0) { return this.a3.e(); } return null; }; DataGridAccessibilityLayoutPanel.prototype.a5 = function (a) { for (var b = 0; b < this.a2.count; b++) { var c = parseInt(this.a2._inner[b].getAttribute("aria-rowindex")); if (c == a.c) { return this.a2._inner[b]; } } return null; }; DataGridAccessibilityLayoutPanel.prototype.ba = function (a) { var b = this.a5(a); if (b != null) { b.setAttribute("aria-owns", a.h()); return; } b = this.a4(); if (b != null) { b.setAttribute("aria-rowindex", a.c.toString()); b.setAttribute("aria-owns", a.h()); this.a9(a, b); return; } b = this.s.createElement("div"); b.setAttribute("role", "row"); b.setAttribute("aria-rowindex", a.c.toString()); b.setAttribute("aria-owns", a.h()); this.a9(a, b); }; DataGridAccessibilityLayoutPanel.prototype.a8 = function () { for (var a = 0; a < this.a2.count; a++) { var b = this.a2._inner[a]; var c = parseInt(b.getAttribute("aria-rowindex")) - 2; if (c != -1 && !this.a0.d(c)) { b.remove(); this.a3.h(b); this.a2.removeAt(a); a--; } } }; DataGridAccessibilityLayoutPanel.prototype.a9 = function (a, b) { var c = -1; for (var d = 0; d < this.a2.count; d++) { var e = parseInt(this.a2._inner[d].getAttribute("aria-rowindex")); if (a.c < e) { c = d; break; } } if (c != -1) { var native_ = this.element.getNativeElement(); native_.insertBefore(b.getNativeElement(), this.a2._inner[c].getNativeElement()); this.a2.insert(c, b); } else { this.element.append(b); this.a2.add(b); } }; DataGridAccessibilityLayoutPanel.prototype.a1 = function (a) { return a.l.aj || (a.l.an && !a.l.h); }; DataGridAccessibilityLayoutPanel.prototype.bb = function (a, b) { a.getNativeElement().removeAttribute(b); }; DataGridAccessibilityLayoutPanel.$t = markType(DataGridAccessibilityLayoutPanel, 'DataGridAccessibilityLayoutPanel', DataGridCellLayoutPanel.$); DataGridAccessibilityLayoutPanel.a6 = 0; return DataGridAccessibilityLayoutPanel; }(DataGridCellLayoutPanel)); export { DataGridAccessibilityLayoutPanel };