UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

1,447 lines (1,446 loc) 46.9 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 { Base, runOn, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox, fromEnum } from "./type"; import { Size } from "./Size"; import { ElevationHelper } from "./ElevationHelper"; import { CornerRadius } from "./CornerRadius"; import { NativeUI } from "./NativeUI"; import { PopupPointerPosition_$type } from "./PopupPointerPosition"; import { Popup_OuterAnimationInfo } from "./Popup_OuterAnimationInfo"; import { Popup_InnerAnimationInfo } from "./Popup_InnerAnimationInfo"; import { AnimationKeyFrameEffect } from "./AnimationKeyFrameEffect"; import { AnimationKeyFrameEffectTiming } from "./AnimationKeyFrameEffectTiming"; import { KeyFrameAnimationFactory } from "./KeyFrameAnimationFactory"; import { Rect } from "./Rect"; import { PopupAnimationType_$type } from "./PopupAnimationType"; import { stringFormat } from "./stringExtended"; import { isNaN_, truncate } from "./number"; import { stringEmpty } from "./string"; import { NativeUIInputsFactory } from "./NativeUIInputsFactory"; import { OnClosedEventArgs } from "./OnClosedEventArgs"; import { MouseEventArgs } from "./MouseEventArgs"; import { FocusEventArgs } from "./FocusEventArgs"; import { PopupAnimation } from "./PopupAnimation"; import { IKeyFrameAnimation_$type } from "./IKeyFrameAnimation"; import { List$1 } from "./List$1"; import { AnimationKeyFrameProperty } from "./AnimationKeyFrameProperty"; import { TranslateTransform } from "./TranslateTransform"; import { OnPopupEventArgs } from "./OnPopupEventArgs"; import { DeviceUtils } from "./DeviceUtils"; import { PopupVisualModelExport } from "./PopupVisualModelExport"; import { AppearanceHelper } from "./AppearanceHelper"; import { PopupMeasuringContentSizeEventArgs } from "./PopupMeasuringContentSizeEventArgs"; import { BrushUtil } from "./BrushUtil"; /** * @hidden */ export let PopupView = /*@__PURE__*/ (() => { class PopupView extends Base { constructor() { super(...arguments); this.ag = null; this.f = null; this.ao = null; this.an = null; this.am = null; this.aj = null; this.al = null; this.ak = null; this.aq = null; this.v = 0; this.w = 0; this.u = 0; this.m = false; this.x = 0; this.s = 0; this.t = 0; this.q = 0; this.r = 0; this.ai = null; this.ap = null; this.br = new Size(1, 0, 0); this.k = true; this.p = false; } get af() { return this.g.a4; } get ac() { return this.af / 2; } get ab() { return this.af * 1.414; } get aa() { return this.ab / 2; } get ad() { return (this.bs.width / 2 - this.ac); } get ae() { return (this.bs.height / 2 - this.ac); } get g() { return this.f; } get ah() { return this.ag; } a6() { this.ao.setStyleProperty("height", "0%"); this.ao.setStyleProperty("width", "0%"); this.aj = this.ag.createElement("div"); this.be(this.g.ar); this.aj.setStyleProperty("z-index", "10000"); this.aj.setStyleProperty("inset", "unset"); this.aj.setStyleProperty("padding", "0px"); this.aj.setStyleProperty("border-width", "0px"); this.al = this.ag.createElement("div"); this.al.setStyleProperty("height", 20 * 1.414 / 2 + "px"); this.ak = this.ag.createElement("div"); this.ak.setStyleProperty("position", "relative"); this.ak.setStyleProperty("width", this.af + "px"); this.ak.setStyleProperty("height", this.af + "px"); this.ak.setStyleProperty("z-index", "1"); this.ak.setStyleProperty("clip-path", stringFormat("path(\"M0,0l{0},{0}l0,-{0}l-{0},0Z\")", this.af)); this.al.append(this.ak); this.an = this.ag.createElement("div"); this.an.setStyleProperty("position", "relative"); this.an.setStyleProperty("overflow", "hidden"); this.an.setAttribute("key", "popupContentAreaOuter"); this.bf(this.g.as); this.aj.listen("mouseenter", runOn(this, this.a7)); this.aj.listen("mouseleave", runOn(this, this.a8)); this.aj.listen("focusin", runOn(this, this.a4)); this.aj.listen("focusout", runOn(this, this.a5)); this.am = this.ag.createElement("div"); this.am.setAttribute("key", "popupContentAreaInner"); this.an.append(this.am); this.aj.append(this.an); } bn() { let a = this.g; let b = ElevationHelper.e(a.a7, a.cz, a.cy, a.cx); if (this.l()) { this.aj.setStyleProperty("box-shadow", b); } else { this.an.setStyleProperty("box-shadow", b); } } bl() { if (this.g.c0 != null) { this.an.setStyleProperty("background-color", this.g.c0._fill); this.ak.setStyleProperty("background-color", this.g.c0._fill); } if (this.g.c4 != null) { this.ak.setStyleProperty("background-color", this.g.c4._fill); } } bm() { if (!isNaN_(this.g.a1)) { NativeUI.o(this.an, new CornerRadius(0, this.g.a1)); } } bo() { if (null == this.ao) { return; } this.be(this.g.ar); this.bn(); this.bl(); this.bm(); } a7(a) { this.g.cf(); } a8(a) { this.g.cg(); } a4(a) { this.g.cc(); } a5(a) { this.g.cd(a.originalEvent.relatedTarget, a.originalEvent.target); } o() { return (HTMLElement.prototype.hasOwnProperty("popover")); } l() { return this.o() && this.g.ay; } at() { if (null != this.aj) { this.bo(); this.an.setStyleProperty("height", "0px"); let a = this.aj.getNativeElement(); if (false == this.m) { this.al.remove(); if (this.g.au) { let b = this.g.u(); if (b == 1) { this.aj.setStyleProperty("display", "block"); let c = this.aj.getNativeElement(); let d = this.al.getNativeElement(); let e = this.an.getNativeElement(); c.insertBefore(d, e); } else if (b == 2) { this.aj.setStyleProperty("display", "block"); this.aj.append(this.al); } else if (b == 3) { this.aj.setStyleProperty("display", "flex"); let f = this.aj.getNativeElement(); let g = this.al.getNativeElement(); let h = this.an.getNativeElement(); f.insertBefore(g, h); this.al.setStyleProperty("height", "unset"); this.al.setStyleProperty("width", 20 * 1.414 / 2 + "px"); } else if (b == 4) { this.aj.setStyleProperty("display", "flex"); this.aj.append(this.al); this.al.setStyleProperty("height", "unset"); this.al.setStyleProperty("width", 20 * 1.414 / 2 + "px"); } } if (this.g.be != null) { this.g.be.appendChild(a); } else { document.body.appendChild(a); } this.bh(this.g.ay); if (this.l()) { a.showPopover(); } this.m = true; if (this.k) { this.a1(); } } } } au(a, b) { this.aj.setStyleProperty("top", PopupView.ar(a.f)); this.an.setStyleProperty("height", PopupView.as(a.h)); this.am.setStyleProperty("top", PopupView.as(b.b)); this.am.setStyleProperty("opacity", "1"); this.am.setStyleProperty("transform", stringEmpty()); this.x = 0; if (this.p) { this.bk(); } if (this.g.ax) { this.ap.observe(this.ai.getNativeElement()); } else { this.ap.disconnect(); } if (this.g.ao) { this.bg(this.g.at); } return { p0: a, p1: b }; } av(a) { this.x = a; if (this.g.ao) { this.bg(false); } this.bi(this.bs.width, a); this.bj(); } bc() { if (null != this.aj && this.m) { let a = this.aj.getNativeElement(); if (this.g.be != null) { this.g.be.removeChild(a); } else { document.body.removeChild(a); } this.m = false; } } aw(a) { this.ai = a; this.am.append(this.ai); this.ap = new ResizeObserver(runOn(this, this.a3)); } a3(a) { if (this.m) { if (this.g.ap() && this.g.p == 0) { return; } this.g.b9(); } } j(a) { let b = this.aj.getNativeElement(); return b.contains(a); } bb(a) { this.ai = null; this.ap.disconnect(); this.ap = null; a.remove(); } d(a) { return new AnimationKeyFrameEffect(0, this.am, 0, null, a); } e(a) { return new AnimationKeyFrameEffect(0, this.an, 0, null, a); } ay() { if (KeyFrameAnimationFactory.h == null) { KeyFrameAnimationFactory.h = this.ah; } } c(a) { return new AnimationKeyFrameEffect(0, this.aj, 0, null, a); } b(a) { return new AnimationKeyFrameEffect(0, this.an, 0, null, a); } a(a) { return new AnimationKeyFrameEffect(0, this.aj, 0, null, a); } i() { return 12; } h() { return 11; } n() { return this.g.be != null && !this.g.ar && !this.l(); } get bs() { if (this.k) { this.a1(); } return this.br; } y(a, b, c) { let d; switch (b) { case 3: d = (!this.n() ? a.left : 0) - (this.bs.width + (this.g.au ? this.aa : 0)); break; case 4: d = !this.n() ? a.right : a.width; break; case 0: case 2: case 1: default: switch (c) { case 2: d = (!this.n() ? a.right : a.width) - this.bs.width; break; case 3: d = (!this.n() ? a.right : a.width) - (a.width / 2) - (this.bs.width / 2); break; case 0: case 1: default: d = !this.n() ? a.left : 0; break; } break; } return d; } z(a, b, c) { let d; switch (b) { case 3: case 4: switch (c) { case 2: d = (!this.n() ? a.bottom : 0) - this.bs.height; break; case 3: d = (!this.n() ? a.top : -a.height) - (this.bs.height / 2) + (a.height / 2); break; case 0: case 1: default: d = !this.n() ? a.top : -a.height; break; } break; case 2: d = (!this.n() ? a.top : -a.height) - (this.bs.height + (this.g.au ? this.aa : 0)); break; case 0: case 1: default: d = !this.n() ? a.bottom : 0; break; } return d; } static as(a) { return stringFormat("{0}px", a); } static ar(a) { return stringFormat("{0}px", a); } bj() { if (this.g.r == 1 || this.g.r == 2) { switch (this.g.j) { case 3: this.v = this.ad + (this.s - this.q); break; } } else if (this.g.r == 3 || this.g.r == 4) { switch (this.g.j) { case 3: this.w = this.ae + (this.t - this.r); break; } } this.ak.setStyleProperty("transform", "translate(" + this.v + "px, " + this.w + "px) rotate(" + this.u + "deg)"); } ax(a, b, c, d) { this.s = a; this.t = b; if (this.g.r == 1 || this.g.r == 2) { let e = (window.innerWidth); let f = a; let g = f + c; if (f < 5) { a = 5; } else if (g > e - 5) { a = f - (g - (e - 5)); } } else if (this.g.r == 3 || this.g.r == 4) { let h = (window.innerHeight); let i = b; let j = i + d; if (i < 5) { b = 5; } else if (j > h - 5) { b = i - (j - (h - 5)); } } return { p0: a, p1: b }; } bq(a, b, c) { let d = this.z(a, b, c); let e = this.y(a, b, c); if (this.g.be == null) { let f = this.ax(e, d, this.bs.width, this.bs.height); e = f.p0; d = f.p1; } this.bd(e, d); if (b == 2 || c == 2) { let g = 10; while (g > 0) { let h = this.z(a, b, c); let i = this.y(a, b, c); if (this.g.be == null) { let j = this.ax(i, h, this.bs.width, this.bs.height); i = j.p0; h = j.p1; } if (h == d && i == e) { g = 0; break; } d = h; e = i; this.bd(e, d); g--; } } this.bj(); return new Rect(0, e, d, this.bs.width, this.bs.height); } bp(a, b, c) { let d = new Rect(4); let target_ = a; if ((target_.getBoundingClientRect)) { let bRect_ = target_.getBoundingClientRect(); d.left = (bRect_.left); d.top = (bRect_.top); d.width = (bRect_.width); d.height = (bRect_.height); } let e = this.bq(d, b, c); return e; } a1() { if (this.m) { this.an.setStyleProperty("width", stringEmpty()); this.an.setStyleProperty("height", stringEmpty()); this.aj.setStyleProperty("width", stringEmpty()); this.aj.setStyleProperty("height", stringEmpty()); this.aj.setStyleProperty("position", "absolute"); this.g.ce(); this.br = new Size(1, this.am.outerWidth(), this.am.outerHeight()); this.k = false; this.bk(); } else { this.k = true; } } bd(a, b) { let c = stringFormat("{0}px", a); let d = stringFormat("{0}px", b); this.aj.setStyleProperty("left", c); this.aj.setStyleProperty("top", d); this.q = a; this.r = b; } a9(a) { if (a == null) { this.ag = null; if (this.aj != null) { this.aj.unlistenAll(); } return; } this.ag = a; let b = a.rootWrapper; this.az(b); this.ag.getPortal(this.am, "ChildContent", (c) => { let comp_ = c.componentRef; this.aq = comp_; }, true); } bk() { let a = new Size(1, this.bs.width, this.bs.height); if (!this.m || (!this.g.ax && !this.g.aq)) { a.height = 0; } let b = a.width; let c = a.height; let d = stringFormat("{0}px", b); let e = stringFormat("{0}px", c); this.bi(b, c); if (this.g.au) { switch (this.g.u()) { case 2: d = stringFormat("{0}px", b); e = stringFormat("{0}px", this.aa + c); break; case 1: d = stringFormat("{0}px", b); e = stringFormat("{0}px", this.aa + c); break; case 3: d = stringFormat("{0}px", this.aa + b); e = stringFormat("{0}px", c); break; case 4: d = stringFormat("{0}px", this.aa + b); e = stringFormat("{0}px", c); break; } } if (this.f.ap()) { if (this.g.aq || this.x == c) { return; } this.f.b3(); this.p = true; return; } this.p = false; let f = stringFormat("{0}px", b); let g = stringFormat("{0}px", c); this.an.setStyleProperty("width", f); this.an.setStyleProperty("height", g); if (!this.l()) { if (this.g.be != null) { e = "0px"; } this.aj.setStyleProperty("width", d); this.aj.setStyleProperty("height", e); } this.be(this.g.ar); } bi(a, b) { if (this.g.au) { let c = 0; let d = 0; switch (this.g.u()) { case 2: c = 135; d = -this.ac; this.v = a / 2 - this.ac; this.w = d; break; case 1: c = -45; d = this.aa - this.ac; this.v = a / 2 - this.ac; this.w = d; break; case 3: c = -135; d = this.aa - this.ac; this.v = d; this.w = b / 2 - this.ac; break; case 4: c = 45; d = -this.ac; this.v = d; this.w = b / 2 - this.ac; break; } this.u = c; this.ak.setStyleProperty("transform", "translate(" + this.v + "px, " + this.w + "px) rotate(" + this.u + "deg)"); } } az(a) { this.ao = a; this.a6(); } a0(a) { this.f = a; } a2() { } ba() { this.at(); if (this.g.ax) { return; } this.bk(); } bg(a) { if (this.aj != null) { this.aj.setStyleProperty("pointer-events", a ? "auto" : "none"); } } bf(a) { if (this.aj != null) { this.aj.setAttribute("tabindex", a ? "-1" : ""); } } be(a) { if (this.aj != null) { this.aj.setStyleProperty("position", a ? "fixed" : this.g.be != null ? "relative" : "absolute"); } } bh(a) { if (this.aj != null && this.o()) { let b = this.aj.getNativeElement(); if (a) { b.popover = "manual"; } else { b.popover = undefined; } } } } PopupView.$t = markType(PopupView, 'PopupView'); return PopupView; })(); /** * @hidden */ export let Popup = /*@__PURE__*/ (() => { class Popup extends Base { constructor() { super(); this.q = 0; this.i = 0; this.a2 = 0; this.c7 = null; this.c5 = null; this.bc = null; this.onClosed = null; this.onPopup = null; this.propertyChanged = null; this.popupMouseEnter = null; this.popupMouseLeave = null; this.popupGotFocus = null; this.popupLostFocus = null; this.x = null; this.ag = false; this.a8 = 50; this.al = true; this.o = 0; this.a6 = -1; this.a5 = Popup.ba; this.aw = false; this.cu = Popup.c3; this.ct = Popup.c2; this.cs = Popup.c1; this.cv = null; this.az = 0; this.ah = true; this.ad = false; this.ai = false; this.t = 0; this.cw = null; this.a0 = 20; this.aj = false; this.ae = false; this.af = false; this.ak = false; this.k = null; this.measuringContentSize = null; NativeUIInputsFactory.n(); let a = this.w(); this.x = a; a.a0(this); } get c8() { return this.c7; } get c6() { return this.c5; } get r() { return this.q; } set r(a) { this.q = a; } get j() { return this.i; } get a3() { return this.a2; } get be() { return this.bc; } ch(a, b, c) { if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } this.ck(a, b, c); } cf() { if (this.popupMouseEnter != null) { this.popupMouseEnter(this, new MouseEventArgs()); } } cg() { if (this.popupMouseLeave != null) { this.popupMouseLeave(this, new MouseEventArgs()); } } cc() { if (this.popupGotFocus != null) { this.popupGotFocus(this, new FocusEventArgs()); } } cd(a, b) { if (this.popupLostFocus != null) { this.popupLostFocus(this, ((() => { let $ret = new FocusEventArgs(); $ret.b = a; $ret.a = b; return $ret; })())); } } get as() { return this.ag; } set as(a) { let b = this.ag; this.ag = a; if (b != this.ag) { this.ch("IsFocusable", b, this.ag); } } get a9() { return this.a8; } set a9(a) { let b = this.a8; this.a8 = a; if (b != this.a8) { this.ch("AnimationDuration", b, a); } } get am() { return this.al; } set am(a) { let b = this.al; this.al = a; if (b != this.al) { this.ch("AnimationEnabled", b, a); } } get p() { return this.o; } set p(a) { let b = this.o; this.o = a; if (b != this.o) { this.ch("AnimationType", enumGetBox(PopupAnimationType_$type, b), enumGetBox(PopupAnimationType_$type, this.o)); } } get bb() { return this.a6; } set bb(a) { let b = this.a6; this.a6 = a; if (b != this.a6) { this.ch("Elevation", b, a); } } get a7() { return this.a5; } set a7(a) { let b = this.a5; this.a5 = a; if (b != this.a5) { this.ch("ActualElevation", b, a); } } get ax() { return this.aw; } get cz() { return this.cu; } set cz(a) { let b = this.cu; this.cu = a; if (b != this.cu) { this.ch("ActualUmbraShadowColor", b, a); } } get cy() { return this.ct; } set cy(a) { let b = this.ct; this.ct = a; if (b != this.ct) { this.ch("ActualPenumbraShadowColor", b, a); } } get cx() { return this.cs; } set cx(a) { let b = this.cs; this.cs = a; if (b != this.cs) { this.ch("ActualAmbientShadowColor", b, a); } } get c0() { return this.cv; } set c0(a) { let b = this.cv; this.cv = a; if (b != this.cv) { this.ch("Background", b, this.cv); } } get a1() { return this.az; } set a1(a) { let b = this.az; this.az = a; if (b != this.az) { this.ch("CornerRadius", b, this.az); } } get at() { return this.ah; } set at(a) { let b = this.ah; this.ah = a; if (b != this.ah) { this.ch("IsHitTestVisible", b, this.ah); } } get ao() { return this.ad; } set ao(a) { let b = this.ad; this.ad = a; if (b != this.ad) { this.ch("DisableHitTestDuringAnimation", b, this.ad); } } get au() { return this.ai; } set au(a) { let b = this.ai; this.ai = a; if (b != this.ai) { this.ch("IsPointerEnabled", b, this.ai); } } get v() { return this.t; } set v(a) { let b = this.t; this.t = a; if (b != this.t) { this.ch("PointerPosition", enumGetBox(PopupPointerPosition_$type, b), enumGetBox(PopupPointerPosition_$type, this.t)); } } get c4() { return this.cw; } set c4(a) { let b = this.cw; this.cw = a; if (b != this.cw) { this.ch("PointerBackground", b, this.cw); } } get a4() { return this.a0; } set a4(a) { let b = this.a0; this.a0 = a; if (b != this.a0) { this.ch("PointerSize", b, this.a0); } } get av() { return this.aj; } set av(a) { this.aj = a; } get aq() { return this.ae; } set aq(a) { this.ae = a; } get ar() { return this.af; } set ar(a) { let b = this.af; this.af = a; if (b != this.af) { this.ch("IsFixed", b, this.af); } } get ay() { return this.ak; } set ay(a) { let b = this.ak; this.ak = a; if (b != this.ak) { this.ch("UseTopLayer", b, this.ak); } } w() { return new PopupView(); } ck(a, b, c) { switch (a) { case "IsShown": if (false == this.ax) { this.x.bc(); this.bc = null; } break; case "Elevation": this.a7 = this.bb == -1 ? Popup.ba : this.bb; break; case "ActualElevation": case "ActualUmbraShadowColor": case "ActualPenumbraShadowColor": case "ActualAmbientShadowColor": case "Background": case "CornerRadius": this.x.bo(); break; case "AnimationEnabled": if (false == this.am) { this.b3(); } break; case "IsHitTestVisible": this.x.bg(this.at); break; case "IsFocusable": this.x.bf(this.as); break; case "IsFixed": this.x.be(this.ar); break; case "UseTopLayer": this.x.bh(this.ay); break; } } b3() { if (this.ap()) { this.k.e(); } } aa(a) { let b = this.g(a); let c = a ? this.c() : this.b(); let d = this.x.d(c); let e = new List$1(AnimationKeyFrameProperty.$, 0); let f = new List$1(AnimationKeyFrameProperty.$, 0); let g = new TranslateTransform(); g.k = b.a; let h = new TranslateTransform(); h.k = b.b; let i = new AnimationKeyFrameProperty(14, g); let j = new AnimationKeyFrameProperty(14, h); e.add(i); f.add(j); d.m(...e.toArray()); d.m(...f.toArray()); return KeyFrameAnimationFactory.f.c(d); } a(a) { let b = new List$1(IKeyFrameAnimation_$type, 0); let c = this.h(a); this.x.av(c.h); let d = a ? this.c() : this.b(); let e = this.x.e(d); let f = new List$1(AnimationKeyFrameProperty.$, 0); let g = new List$1(AnimationKeyFrameProperty.$, 0); let h = new AnimationKeyFrameProperty(10, c.g); let i = new AnimationKeyFrameProperty(10, c.h); f.add(h); g.add(i); e.m(...f.toArray()); e.m(...g.toArray()); b.add(KeyFrameAnimationFactory.f.c(e)); if (this.q == 2) { let j = c.c; let k = c.f; let l = this.x.c(d); let m = new List$1(AnimationKeyFrameProperty.$, 0); let n = new List$1(AnimationKeyFrameProperty.$, 0); let o = new AnimationKeyFrameProperty(12, j); let p = new AnimationKeyFrameProperty(12, k); m.add(o); n.add(p); l.m(...m.toArray()); l.m(...n.toArray()); b.add(KeyFrameAnimationFactory.f.c(l)); } return b.toArray(); } b() { let a = new AnimationKeyFrameEffectTiming(); a.g = this.a9; a.b = 3; return a; } c() { let a = new AnimationKeyFrameEffectTiming(); a.g = this.a9; a.b = 3; return a; } b8() { this.x.ay(); } g(a) { let b = truncate(this.x.bs.height); if (b <= 0) { b = 500; } let c = a ? -b : 0; let d = a ? 0 : -b; if (this.q == 2) { c = 0; d = 0; } let e = ((() => { let $ret = new Popup_InnerAnimationInfo(); $ret.a = c; $ret.b = d; return $ret; })()); return e; } h(a) { let b = truncate(this.x.bs.height); if (b <= 0) { b = 500; } let c = a ? 0 : b; let d = a ? b : 0; let e = this.c7.top; let f = this.c7.top; let g = this.c7.left; let h = g; switch (this.q) { case 2: e = a ? this.c7.bottom : this.c7.top; f = a ? this.c7.top : this.c7.bottom; g = this.c7.left; h = g; break; case 1: e = this.c7.top; f = this.c7.top; g = this.c7.left; h = g; break; case 3: case 4: e = this.c7.top; f = e; g = this.c7.left; h = g; break; } let i = ((() => { let $ret = new Popup_OuterAnimationInfo(); $ret.g = c; $ret.h = d; $ret.c = e; $ret.f = f; $ret.a = g; $ret.d = h; return $ret; })()); return i; } ap() { if (this.k == null) { return false; } return this.k.b; } b9() { this.x.a1(); if (this.ax) { if (this.be != null) { this.c7 = this.x.bp(this.be, this.q, this.i); } else { this.c7 = this.x.bq(this.c5, this.q, this.i); } } } cj(a, b, c) { this.c5 = a; this.q = b; this.i = c; this.a2 = 0; this.x.ba(); this.c7 = this.x.bq(a, b, c); } ci(a, b, c) { this.bc = a; this.q = b; this.i = c; this.a2 = 0; this.x.ba(); this.c7 = this.x.bp(a, b, c); } co(a, b, c) { if (this.aw) { this.aw = false; this.ch("IsShown", true, this.aw); } this.cj(a, b, c); this.cp(true); } cn(a, b, c) { if (this.aw) { this.aw = false; this.ch("IsShown", true, this.aw); } this.ci(a, b, c); this.cp(true); } cp(a) { let b = this.aw; this.aw = a; this.av = a; this.aq = !a; if (false == this.am) { let c = this.h(a); let d = this.g(a); let e = this.x.au(c, d); c = e.p0; d = e.p1; return; } if (this.ap()) { this.k.i(); return; } this.b8(); this.k = this.l(this.p, this.aw); this.k.h((f) => { this.k.g(); if (f) { switch (this.p) { case 0: this.b5(this.aw); break; case 1: this.b4(this.aw); break; } } this.ch("IsShown", b, this.aw); if (this.aw) { if (this.onPopup != null) { this.onPopup(this, new OnPopupEventArgs()); } } else { if (this.onClosed != null) { this.onClosed(this, new OnClosedEventArgs()); } } this.av = false; this.aq = false; let g = this.h(this.aw); let h = this.g(this.aw); let i = this.x.au(g, h); g = i.p0; h = i.p1; }); } l(a, b) { switch (a) { case 0: return this.n(b); case 1: return this.m(b); default: return this.n(b); } } n(a) { let b = this.aa(a); let c = this.a(a); let d = new PopupAnimation(); d.c.add(b); for (let f = 0; f < c.length; f++) { let e = c[f]; d.c.add(e); } return d; } b5(a) { let b = this.h(a); let c = this.g(a); for (let d of fromEnum(this.k.c)) { for (let e = 0; e < d.effect.f.length; e++) { switch (d.effect.f[e]) { case 14: d.effect.g[e].c(d.effect.a4, ((() => { let $ret = new TranslateTransform(); $ret.k = c.b; return $ret; })())); break; case 10: d.effect.g[e].c(d.effect.a4, b.h); break; case 12: d.effect.g[e].c(d.effect.a4, b.f); break; } } } } m(a) { let b = this.h(a); this.x.av(a ? b.h : b.g); let c = this.c(); let d = this.x.c(c); let e = DeviceUtils.g(30); let f = this.x.i(); let g = b.f - e; let h = b.f; switch (this.q) { case 2: g = a ? b.f + e : b.c + e; h = a ? b.f : b.c; f = this.x.i(); break; case 1: g = b.f - e; h = b.f; f = this.x.i(); break; case 3: g = b.d + e; h = b.d; f = this.x.h(); break; case 4: g = b.d - e; h = b.d; f = this.x.h(); break; } d.m(new AnimationKeyFrameProperty(f, a ? g : h)); d.m(new AnimationKeyFrameProperty(f, a ? h : g)); let i = this.x.a(c); i.m(new AnimationKeyFrameProperty(1, a ? 0 : 1)); i.m(new AnimationKeyFrameProperty(1, a ? 1 : 0)); let j = this.x.b(c); j.m(new AnimationKeyFrameProperty(10, (a ? b.h : b.g))); j.m(new AnimationKeyFrameProperty(10, (a ? b.h : b.g))); let k = new PopupAnimation(); k.c.add(KeyFrameAnimationFactory.f.c(d)); k.c.add(KeyFrameAnimationFactory.f.c(i)); k.c.add(KeyFrameAnimationFactory.f.c(j)); return k; } b4(a) { let b = this.h(a); let c = this.x.i(); let d = NaN; let e = a ? 1 : 0; let f = a ? b.h : b.g; switch (this.q) { case 2: c = this.x.i(); d = a ? b.f : b.c; break; case 1: c = this.x.i(); d = b.f; break; case 3: c = this.x.h(); d = b.d; break; case 4: c = this.x.h(); d = b.d; break; } for (let g of fromEnum(this.k.c)) { for (let h = 0; h < g.effect.f.length; h++) { if (g.effect.f[h] == c) { g.effect.g[h].c(g.effect.a4, d); } else if (g.effect.f[h] == 1) { g.effect.g[h].c(g.effect.a4, e); } else if (g.effect.f[h] == 10) { g.effect.g[h].c(g.effect.a4, f); } } } } contains(a) { return this.x.j(a); } appendPopupContent(a) { this.x.aw(a); } removePopupContent(a) { this.x.bb(a); } b6() { if (!this.aw) { return; } this.cp(false); } destroy() { this.provideRenderer(null); } showRelativeToExclusionRect(a, b, c) { this.co(a, b, c); } cr(a, b, c) { this.cn(a, b, c); } ca(a) { this.c5 = a; this.c7 = this.x.bq(a, this.q, this.i); } notifySizeChanged() { } provideRenderer(a) { this.x.a9(a); } bd() { return this.d(); } bq() { let a = this.d(); return a.f(); } d() { let a = new PopupVisualModelExport(); a.e = this.a7; a.d = this.ax; a.c = AppearanceHelper.a(this.cz); a.b = AppearanceHelper.a(this.cy); a.a = AppearanceHelper.a(this.cx); return a; } u() { let a = this.v; if (a == 0) { switch (this.r) { case 4: a = 3; break; case 3: a = 4; break; case 2: a = 2; break; case 1: a = 1; break; } } return a; } ce() { if (this.measuringContentSize != null) { this.measuringContentSize(this, new PopupMeasuringContentSizeEventArgs()); } } } Popup.$t = markType(Popup, 'Popup', Base.$, [INotifyPropertyChanged_$type]); Popup.ba = 2; Popup.c3 = BrushUtil.j(66, 0, 0, 0); Popup.c2 = BrushUtil.j(30, 0, 0, 0); Popup.c1 = BrushUtil.j(20, 0, 0, 0); return Popup; })();