UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

176 lines (175 loc) 7.22 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 { NativeUIElementBridge } from "./NativeUIElementBridge"; import { runOn, EnumUtil, markType } from "./type"; import { NativeUIDropDownSelectedValueChangedEventArgs } from "./NativeUIDropDownSelectedValueChangedEventArgs"; import { NativeUIDisplayDensity_$type } from "./NativeUIDisplayDensity"; /** * @hidden */ var IgcDropdownBridge = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcDropdownBridge, _super); function IgcDropdownBridge(a) { var _this = _super.call(this) || this; _this.t = null; _this.s = null; _this.w = null; _this.u = null; _this.x = null; _this.v = null; _this.y = null; _this.v = a; return _this; } IgcDropdownBridge.prototype.addHandler = function (a, b, c, d) { switch (c) { case 3: var e = a; this.t = e.listen("igcChange", runOn(this, this.z)); this.s = d; this.w = b; this.u(); break; } }; IgcDropdownBridge.prototype.z = function (a) { if (this.s != null) { var b = new NativeUIDropDownSelectedValueChangedEventArgs(); this.s(this.w, b); } }; IgcDropdownBridge.prototype.getValue = function (a, b) { switch (b) { case 8: return this.x; case 9: var currItem_ = a.getProperty("selectedItem"); if (currItem_ == null || currItem_ == undefined) { return null; } return currItem_.innerText; } return null; }; IgcDropdownBridge.prototype.removeHandler = function (a, b, c, d) { switch (c) { case 3: if (this.t != null) { this.t(); } this.s = null; this.w = null; break; } }; IgcDropdownBridge.prototype.setValue = function (a, b, c) { switch (b) { case 8: { this.x = c; var d = a.querySelectorAll("igc-dropdown-item"); if (d != null) { for (var e = 0; e < d.length; e++) { var f = d[e]; f.remove(); } } { var g = this.x; for (var h = 0; h < g.length; h++) { var i = g[h]; var j = this.v.createElement("igc-dropdown-item"); j.setText(i); j.setProperty("value", i); a.append(j); if (this.y == null) { this.y = i; } } } if (this.y != null) { d = a.querySelectorAll("igc-dropdown-item"); if (d != null) { var _loop_1 = function (k) { var l = d[k]; var m = l.getText(); if (m == this_1.y) { var targ_1 = a.getNativeElement(); if (targ_1 != null && (targ_1._selectItem)) { var currItem_1 = l.getNativeElement(); if (this_1.s != null) { targ_1._selectItem(currItem_1); } else { this_1.u = function () { return targ_1._selectItem(currItem_1); }; } } else { a.setProperty("selectedItem", l.getNativeElement()); } } }; var this_1 = this; for (var k = 0; k < d.length; k++) { _loop_1(k); } } } } return; case 9: { this.y = c; var n = a.querySelectorAll("igc-dropdown-item"); if (n != null) { for (var o = 0; o < n.length; o++) { var p = n[o]; var q = p.getText(); if (q == this.y) { var targ_ = a.getNativeElement(); if (targ_ != null && (targ_._selectItem)) { var currItem_ = p.getNativeElement(); targ_._selectItem(currItem_); } else { a.setProperty("selectedItem", p.getNativeElement()); } } } } } return; case 1: var r = "large"; switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) { case 0: r = "large"; break; case 1: r = "large"; break; case 3: r = "small"; break; case 2: r = "medium"; break; } a.setProperty("size", r); var s = a.querySelectorAll("igc-input"); if (s != null) { for (var t = 0; t < s.length; t++) { s[t].setProperty("size", r); } } break; } }; IgcDropdownBridge.$t = markType(IgcDropdownBridge, 'IgcDropdownBridge', NativeUIElementBridge.$); return IgcDropdownBridge; }(NativeUIElementBridge)); export { IgcDropdownBridge };