UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

145 lines (144 loc) 5.79 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 { NativeUIElementBridge } from "./NativeUIElementBridge"; import { runOn, EnumUtil, markType } from "./type"; import { NativeUIDropDownSelectedValueChangedEventArgs } from "./NativeUIDropDownSelectedValueChangedEventArgs"; import { NativeUIDisplayDensity_$type } from "./NativeUIDisplayDensity"; /** * @hidden */ export let IgcDropdownBridge = /*@__PURE__*/ (() => { class IgcDropdownBridge extends NativeUIElementBridge { constructor(a) { super(); this.d = null; this.c = null; this.f = null; this.g = null; this.e = null; this.h = null; this.e = a; } addHandler(a, b, c, d) { switch (c) { case 3: let e = a; this.d = e.listen("igcChange", runOn(this, this.i)); this.c = d; this.f = b; break; } } i(a) { if (this.c != null) { let b = new NativeUIDropDownSelectedValueChangedEventArgs(); this.c(this.f, b); } } getValue(a, b) { switch (b) { case 6: return this.g; case 7: let currItem_ = a.getProperty("selectedItem"); if (currItem_ == null || currItem_ == undefined) { return null; } return currItem_.innerText; } return null; } removeHandler(a, b, c, d) { switch (c) { case 3: if (this.d != null) { this.d(); } this.c = null; this.f = null; break; } } setValue(a, b, c) { switch (b) { case 6: { this.g = c; let d = a.querySelectorAll("igc-dropdown-item"); if (d != null) { for (let e = 0; e < d.length; e++) { let f = d[e]; f.remove(); } } { let g = this.g; for (let h = 0; h < g.length; h++) { let i = g[h]; let j = this.e.createElement("igc-dropdown-item"); j.setText(i); a.append(j); } } if (this.h != null) { d = a.querySelectorAll("igc-dropdown-item"); if (d != null) { for (let k = 0; k < d.length; k++) { let l = d[k]; let m = l.getText(); if (m == this.h) { a.setProperty("selectedItem", l.getNativeElement()); } } } } } return; case 7: { this.h = c; let n = a.querySelectorAll("igc-dropdown-item"); if (n != null) { for (let o = 0; o < n.length; o++) { let p = n[o]; let q = p.getText(); if (q == this.h) { a.setProperty("selectedItem", p.getNativeElement()); } } } } return; case 1: let r = "large"; switch (EnumUtil.getEnumValue(NativeUIDisplayDensity_$type, c)) { case 0: r = "large"; break; case 1: r = "large"; break; case 2: r = "small"; break; case 3: r = "medium"; break; } a.setProperty("size", r); let s = a.querySelectorAll("igc-input"); if (s != null) { for (let t = 0; t < s.length; t++) { s[t].setProperty("size", r); } } break; } } } IgcDropdownBridge.$t = markType(IgcDropdownBridge, 'IgcDropdownBridge', NativeUIElementBridge.$); return IgcDropdownBridge; })();