UNPKG

igniteui-react-inputs

Version:

Ignite UI React input components.

1,600 lines (1,599 loc) 67.3 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, markType, runOn, delegateCombine, delegateRemove, Delegate_$type, fromEnum, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox } from "igniteui-react-core"; import { INativeUIElementFactory_$type } from "igniteui-react-core"; import { NativeUIComponent } from "igniteui-react-core"; import { XInputGroup } from "./XInputGroup"; import { XInput } from "./XInput"; import { XInputBridge } from "./XInputBridge"; import { NativeUIInput } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { XButton } from "./XButton"; import { XButtonBridge } from "./XButtonBridge"; import { NativeUIButton } from "igniteui-react-core"; import { MultiSlider } from "./MultiSlider"; import { MultiSliderThumb } from "./MultiSliderThumb"; import { MultiSliderBridge } from "./MultiSliderBridge"; import { NativeUISlider } from "igniteui-react-core"; import { XButtonGroup } from "./XButtonGroup"; import { XButtonGroupBridge } from "./XButtonGroupBridge"; import { NativeUIButtonGroup } from "igniteui-react-core"; import { NativeUIColorEditor } from "igniteui-react-core"; import { XCheckbox } from "./XCheckbox"; import { XCheckboxBridge } from "./XCheckboxBridge"; import { NativeUICheckbox } from "igniteui-react-core"; import { XIcon } from "./XIcon"; import { XIconBridge } from "./XIconBridge"; import { NativeUIIcon } from "igniteui-react-core"; import { Popup } from "igniteui-react-core"; import { XPopupBridge } from "./XPopupBridge"; import { NativeUIPopup } from "igniteui-react-core"; import { XComponentBridge } from "./XComponentBridge"; import { ColorEditorPanelSelectedValueChangedEventArgs } from "./ColorEditorPanelSelectedValueChangedEventArgs"; import { NativeUIColorEditorValueChangedEventArgs } from "igniteui-react-core"; import { KeyFrameAnimationFactory } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { NativeUIContent } from "igniteui-react-core"; import { truncate, isNaN_, intDivide } from "igniteui-react-core"; import { DOMExecutionContext } from "igniteui-react-core"; import { Rect } from "igniteui-react-core"; import { SRProvider } from "igniteui-react-core"; import { ControlDisplayDensity_$type } from "igniteui-react-core"; import { BaseControlTheme_$type } from "igniteui-react-core"; import { BrushUtil } from "igniteui-react-core"; import { NativeUIInputsFactory } from "igniteui-react-core"; import { NativeUIWindow } from "igniteui-react-core"; import { ColorEditorPanelClosedEventArgs } from "./ColorEditorPanelClosedEventArgs"; import { ColorEditorGotFocusEventArgs } from "./ColorEditorGotFocusEventArgs"; import { ColorEditorLostFocusEventArgs } from "./ColorEditorLostFocusEventArgs"; import { Color } from "igniteui-react-core"; import { ColorUtil } from "igniteui-react-core"; import { Thickness } from "igniteui-react-core"; /** * @hidden */ export let NativeUIXInputsFactory = /*@__PURE__*/ (() => { class NativeUIXInputsFactory extends Base { constructor() { super(...arguments); this.c = 2; } static get b() { if (NativeUIXInputsFactory.a == null) { NativeUIXInputsFactory.a = new NativeUIXInputsFactory(); } return NativeUIXInputsFactory.a; } static m() { NativeUIComponent.as(NativeUIXInputsFactory.b); } get flavor() { return this.c; } createComponent(a, b, c) { switch (b) { case 1: this.d(a, c); break; case 6: this.f(a, c); break; case 10: this.i(a, c); break; case 2: this.j(a, c); break; case 11: this.h(a, c); break; case 12: this.k(a, c); break; case 17: this.e(a, c); break; case 20: this.g(a, c); break; case 5: this.l(a, c); break; } } createComponentSync(a, b, c) { this.createComponent(a, b, c); } supportsComponent(a) { switch (a) { case 1: return true; case 6: return true; case 10: return true; case 2: return true; case 11: return true; case 12: return true; case 17: return true; case 20: return true; case 5: return true; } return false; } j(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new XInputGroup(); f.provideContainer(e); let g = e.getExternal(f, e.rootWrapper, null); let h = c.createElement("div"); h.setRawStyleProperty("width", "100%"); let i = c.getSubRenderer(h); let j = new XInput(); j.provideContainer(i); let k = e.getExternal(j, i.rootWrapper, null); f.appendContentChild(h); f.inputs.add(j); let l = new XInputBridge(f); let m = new NativeUIInput(); m.an = d; m.d = l; b(m); } d(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new XButton(); f.provideContainer(e); f.fj = "none"; let g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let h = new XButtonBridge(f); let i = new NativeUIButton(); i.an = d; i.d = h; b(i); } l(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new MultiSlider(); let g = new MultiSliderThumb(); f.provideContainer(e); f.thumbs.add(g); let h = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let i = new MultiSliderBridge(f); let j = new NativeUISlider(); j.an = d; j.d = i; b(j); } e(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new XButtonGroup(); f.provideContainer(e); let g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let h = new XButtonGroupBridge(f); let i = new NativeUIButtonGroup(); i.an = d; i.d = h; b(i); } g(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new ColorEditor(); f.provideContainer(e); let g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let h = new ColorEditorBridge(f); let i = new NativeUIColorEditor(); i.an = d; i.d = h; b(i); } f(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new XCheckbox(); f.provideContainer(e); let g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let h = new XCheckboxBridge(f); let i = new NativeUICheckbox(); i.an = d; i.d = h; b(i); } i(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new XIcon(); f.provideContainer(e); let g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let h = new XIconBridge(f); let i = new NativeUIIcon(); i.an = d; i.d = h; let j = c.createElement("div"); let k = c.getSubRenderer(j); let l = new XButton(); l.provideContainer(k); l.e = 4; l.fj = "none"; let m = k.getExternal(l, k.rootWrapper, k.getExternal(l, null, null)); let n = new XButtonBridge(l); let o = new NativeUIButton(); o.an = j; o.d = n; o.bo = i; b(o); } h(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new XIcon(); f.provideContainer(e); let g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null)); let h = new XIconBridge(f); let i = new NativeUIIcon(); i.an = d; i.d = h; b(i); } k(a, b) { let c = a; let d = c.createElement("div"); let e = c.getSubRenderer(d); let f = new Popup(); f.provideRenderer(e); let g = new XPopupBridge(f); let h = new NativeUIPopup(); h.an = d; h.d = g; b(h); } } NativeUIXInputsFactory.$t = /*@__PURE__*/ markType(NativeUIXInputsFactory, 'NativeUIXInputsFactory', Base.$, [INativeUIElementFactory_$type]); NativeUIXInputsFactory.a = null; return NativeUIXInputsFactory; })(); /** * @hidden */ export let ColorEditorBridge = /*@__PURE__*/ (() => { class ColorEditorBridge extends XComponentBridge { constructor(a) { super(a); this.u = null; this.w = null; this.v = null; this.x = null; } addHandler(a, b, c, d) { switch (c) { case 0: let e = a; e.valueChanging = delegateCombine(e.valueChanging, runOn(this, this.z)); this.v = d; this.x = b; break; case 4: let f = a; f.valueChanged = delegateCombine(f.valueChanged, runOn(this, this.y)); this.u = d; this.w = b; break; } } y(a, b) { if (this.u != null) { let c = new NativeUIColorEditorValueChangedEventArgs(); this.u(this.w, c); } } z(a, b) { if (this.v != null) { let c = new NativeUIColorEditorValueChangedEventArgs(); this.v(this.x, c); } } getValue(a, b) { switch (b) { case 2: return a.value; } return null; } removeHandler(a, b, c, d) { switch (c) { case 0: let e = a; e.valueChanging = delegateRemove(e.valueChanging, runOn(this, this.z)); this.v = null; this.x = null; break; case 4: let f = a; f.valueChanged = delegateRemove(f.valueChanged, runOn(this, this.y)); this.u = null; this.w = null; break; } } setValue(a, b, c) { switch (b) { case 2: a.value = c; break; } } } ColorEditorBridge.$t = /*@__PURE__*/ markType(ColorEditorBridge, 'ColorEditorBridge', XComponentBridge.$); return ColorEditorBridge; })(); /** * @hidden */ export let ColorEditorPanelView = /*@__PURE__*/ (() => { class ColorEditorPanelView extends Base { constructor() { super(); this.a = null; this.aa = null; this.c = null; this.g = new List$1(Delegate_$type, 0); this.d = true; this.af = null; this.o = NaN; this.n = NaN; this.ab = null; this.b = null; this.ac = null; this.a1 = null; this.ag = null; this.ae = null; this.m = -1; this.l = -1; this.au = -1; this.at = -1; this.a3 = null; this.k = -1; this.j = -1; this.h = -1; this.i = -1; this.a2 = null; this.t = -1; this.p = -1; this.aw = -1; this.av = -1; this.z = -1; this.v = -1; this.a0 = -1; this.az = -1; this.u = -1; this.a6 = null; this.ai = null; this.w = -1; this.s = -1; this.r = -1; this.ay = -1; this.ax = -1; this.a5 = null; this.y = -1; this.x = -1; this.ad = null; this.ak = null; this.ao = null; this.as = -1; this.ar = -1; this.aj = null; this.an = null; this.ah = null; this.al = null; this.ap = null; this.am = null; this.aq = null; this.a4 = null; this.q = -1; this.e = false; } bj() { } f() { return true; } bh(a) { if (a == null) { for (let b of fromEnum(this.g)) { b(); } this.g.clear(); return; } this.aa = a; if (isNaN_(this.a.ae)) { this.a.ab = window.devicePixelRatio; } this.a.a4(); } bd() { if (KeyFrameAnimationFactory.h == null) { KeyFrameAnimationFactory.h = this.aa; } } bg() { this.d = true; } bi() { this.d = false; } a7() { return this.aa; } bf(a) { } a8(a) { this.aa.append(this.aa.getWrapper(a.an)); } be(a, b, c, d, e, f, g) { let h = truncate(Math.round(f * this.a.ab)); let i = truncate(Math.round(g * this.a.ab)); if (f != b || g != c || h != d || i != e) { a.setProperty("width", h); a.setProperty("height", i); a.setStyleProperty("width", f + "px"); a.setStyleProperty("height", g + "px"); b = f; c = g; d = h; e = i; } return { p1: b, p2: c, p3: d, p4: e }; } ba(a) { if (this.ae == null || a.ao == null) { a.ao = "image"; let b = this.aa.createElement("canvas"); this.ae = b; let c = this.be(this.ae, this.m, this.l, this.au, this.at, 148, 148); this.m = c.p1; this.l = c.p2; this.au = c.p3; this.at = c.p4; this.ae.setStyleProperty("justify-self", "center"); this.ae.setStyleProperty("align-self", "center"); let d = a.an; d.append(this.ae); this.bm(this.a.ad()); } } bm(a) { if (this.k == a && !this.e) { return; } if (this.ae != null) { this.k = a; let b = this.be(this.ae, this.m, this.l, this.au, this.at, 148, 148); this.m = b.p1; this.l = b.p2; this.au = b.p3; this.at = b.p4; let c = this.au; let d = this.at; let e = this.a3; if (this.ak == null) { let f = (this.ae.getNativeElement()); let g = f.getContext("2d"); this.ak = g; } if (e == null || e.length != (c * d) * 4) { this.ao = this.ak.getImageData(0, 0, c, d); e = this.ao.data; this.a3 = e; } this.a.a0(e, c, d); this.ak.putImageData(this.ao, 0, 0); } } a9(a) { if (this.ad == null || a.ao == null) { a.ao = "image"; let b = this.aa.createElement("canvas"); this.ad = b; let c = this.be(this.ad, this.j, this.h, this.as, this.ar, 248, 19); this.j = c.p1; this.h = c.p2; this.as = c.p3; this.ar = c.p4; this.ad.setStyleProperty("justify-self", "center"); this.ad.setStyleProperty("align-self", "center"); let d = a.an; d.append(this.ad); this.bl(0); } } bl(a) { if (a == this.i && !this.e) { return; } if (this.ad != null) { this.i = a; let b = this.be(this.ad, this.j, this.h, this.as, this.ar, 248, 19); this.j = b.p1; this.h = b.p2; this.as = b.p3; this.ar = b.p4; let c = this.as; let d = this.ar; let e = this.a2; if (this.aj == null) { let f = (this.ad.getNativeElement()); let g = f.getContext("2d"); this.aj = g; } if (e == null || e.length != (c * d) * 4) { this.an = this.aj.getImageData(0, 0, c, d); e = this.an.data; this.a2 = e; } this.a.az(e, c, d); this.aj.putImageData(this.an, 0, 0); } } bb(a) { let b = a.an; if (b.getChildCount() == 1) { a.ao = "image"; let c = this.aa.createElement("canvas"); this.ah = c; let d = this.be(this.ah, this.t, this.p, this.aw, this.av, 85, 148); this.t = d.p1; this.p = d.p2; this.aw = d.p3; this.av = d.p4; this.ah.setStyleProperty("margin-left", "5px"); this.ah.setStyleProperty("margin-top", "16px"); this.ah.setStyleProperty("margin-right", "0px"); this.ah.setStyleProperty("margin-bottom", "11px"); this.ah.setStyleProperty("grid-row-start", "1"); this.ah.setStyleProperty("grid-row-end", "2"); this.ah.setStyleProperty("grid-column-start", "1"); this.ah.setStyleProperty("grid-column-end", "2"); this.bn(0); let e = b.getChildAt(0); e.before(c); } } bc(a) { if (this.ai == null || a.ao == null) { a.ao = "image"; let b = this.aa.createElement("canvas"); this.ai = b; let c = this.be(this.ai, this.z, this.v, this.aw, this.av, 25, 148); this.z = c.p1; this.v = c.p2; this.aw = c.p3; this.av = c.p4; this.ai.setStyleProperty("justify-self", "center"); this.ai.setStyleProperty("align-self", "center"); let d = a.an; d.append(this.ai); this.bo(0, 1, 0.5); } } bn(a) { if (this.q == a && !this.e) { return; } if (this.ah != null) { this.q = a; let b = this.be(this.ah, this.s, this.r, this.ay, this.ax, 85, 148); this.s = b.p1; this.r = b.p2; this.ay = b.p3; this.ax = b.p4; let c = this.ay; let d = this.ax; let e = this.a4; if (this.al == null) { let f = (this.ah.getNativeElement()); let g = f.getContext("2d"); this.al = g; } if (e == null || e.length != (c * d) * 4) { this.ap = this.al.getImageData(0, 0, c, d); e = this.ap.data; this.a4 = e; } this.a.a1(e, c, d); this.al.putImageData(this.ap, 0, 0); } } bo(a, b, c) { if (this.w == a && this.y == b && this.x == c && !this.e) { return; } if (this.ai != null) { this.w = a; this.y = b; this.x = c; let d = this.be(this.ai, this.z, this.v, this.a0, this.az, 25, 148); this.z = d.p1; this.v = d.p2; this.a0 = d.p3; this.az = d.p4; let e = this.a0; let f = this.az; let g = this.a5; if (this.am == null) { let h = (this.ai.getNativeElement()); let i = h.getContext("2d"); this.am = i; } if (g == null || g.length != (e * f) * 4) { this.aq = this.am.getImageData(0, 0, e, f); g = this.aq.data; this.a5 = g; } this.a.a2(g, e, f); this.am.putImageData(this.aq, 0, 0); } } bk() { this.e = true; this.bm(this.k); this.bl(this.i); this.bn(this.q); this.bo(this.u, this.y, this.x); this.e = false; } } ColorEditorPanelView.$t = /*@__PURE__*/ markType(ColorEditorPanelView, 'ColorEditorPanelView'); return ColorEditorPanelView; })(); /** * @hidden */ export let ColorEditorView = /*@__PURE__*/ (() => { class ColorEditorView extends Base { constructor() { super(); this.a = null; this.h = null; this.d = null; this.g = new List$1(Delegate_$type, 0); this.e = true; this.b = null; } q() { } f() { return true; } o(a) { if (a == null) { for (let b of fromEnum(this.g)) { b(); } this.g.clear(); return; } if (this.a.a == null) { this.a.a = new DOMExecutionContext(a); } this.h = a; this.a.bg(); } m() { if (KeyFrameAnimationFactory.h == null) { KeyFrameAnimationFactory.h = this.h; } } n() { this.e = true; } p() { this.e = false; } j() { return this.h; } i() { let a = new ColorEditorPanel(); this.b = a; let b = this.h.createElement("div"); let c = this.h.getSubRenderer(b); a.provideContainer(c); let d = this.h.getExternal(a, null, null); return b; } k(a, b) { let c = a.an; c.append(this.h.getWrapper(b)); } l(a) { this.h.append(this.h.getWrapper(a.an)); } c(a) { return this.b; } r(a) { if (this.h != null) { let b = this.h.rootWrapper.getNativeElement(); let c = (b.getBoundingClientRect()); if (a) { c = new Rect(0, c.left + window.pageXOffset, c.top + window.pageYOffset, c.width, c.height); } return c; } return null; } s() { return new Size(1, NaN, NaN); } } ColorEditorView.$t = /*@__PURE__*/ markType(ColorEditorView, 'ColorEditorView'); return ColorEditorView; })(); /** * @hidden */ export let ColorEditor = /*@__PURE__*/ (() => { class ColorEditor extends Base { constructor() { super(); this.g = null; this.r = null; this.q = null; this.d = null; this.v = false; this.af = false; this.ad = false; this.cj = BrushUtil.j(0, 0, 0, 0); this.w = false; this.propertyChanged = null; this.valueChanged = null; this.valueChanging = null; this.s = null; this.a = null; this.cl = BrushUtil.j(255, 0, 0, 255); this.ar = ""; this.ci = BrushUtil.j(255, 24, 29, 31); this.l = null; this.j = 2; this.h = 1; this.m = null; this.ck = BrushUtil.j(255, 24, 29, 31); this.ch = BrushUtil.j(255, 163, 172, 184); this.ac = true; this.u = true; this.ab = true; this.x = false; this.ap = 0; this.y = false; this.aa = false; this.ae = false; this.z = false; this.gotFocus = null; this.lostFocus = null; NativeUIInputsFactory.n(); NativeUIXInputsFactory.m(); let a = new ColorEditorView(); a.a = this; this.g = a; this.g.q(); } onAttachedToUI() { this.g.n(); } onDetachedFromUI() { this.g.p(); } b1(a, b) { if (this.valueChanging != null) { this.valueChanging(this, ((() => { let $ret = new ColorEditorPanelSelectedValueChangedEventArgs(); $ret.oldValue = a; $ret.newValue = b; return $ret; })())); } if (this.w) { } } notifySizeChanged() { } destroy() { this.provideContainer(null); } provideContainer(a) { this.g.o(a); } get t() { if (this.s == null) { this.s = new SRProvider(this.g.h); this.s.cb("ColorEditor"); } return this.s; } get value() { return this.cl; } set value(a) { let b = this.cl; this.cj = b; this.cl = a; if (b != this.cl) { this.b0("Value", b, this.cl); } } get az() { return this.ar; } set az(a) { let b = this.ar; this.ar = a; if (b != this.ar) { this.b0("Label", b, this.ar); } } get cn() { return this.ci; } set cn(a) { let b = this.ci; this.ci = a; if (b != this.ci) { this.b0("LabelTextColor", b, a); } } get o() { return this.l; } set o(a) { let b = this.l; this.l = a; if (b != this.l) { this.b0("LabelTextStyle", b, this.l); } } get k() { return this.j; } set k(a) { let b = this.j; this.j = a; if (b != this.j) { this.b0("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.j)); } } get i() { return this.h; } set i(a) { let b = this.h; this.h = a; if (b != this.h) { this.b0("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.h)); } } get p() { return this.m; } set p(a) { let b = this.m; this.m = a; if (b != this.m) { this.b0("TextStyle", b, this.m); } } get co() { return this.ck; } set co(a) { let b = this.ck; this.ck = a; if (b != this.ck) { this.b0("TextColor", b, this.ck); } } get cm() { return this.ch; } set cm(a) { let b = this.ch; this.ch = a; if (b != this.ch) { this.b0("IconColor", b, this.ch); } } get am() { return this.ac; } set am(a) { let b = this.ac; this.ac = a; if (b != this.ac) { this.b0("ShowClearButton", b, this.ac); } } get ag() { return this.u; } set ag(a) { let b = this.u; this.u = a; if (b != this.u) { this.b0("AllowTextInput", b, this.u); } } get ak() { return this.ab; } set ak(a) { let b = this.ab; this.ab = a; if (b != this.ab) { this.b0("OpenOnFocus", b, this.ab); } } get ah() { return this.x; } set ah(a) { let b = this.x; this.x = a; if (b != this.x) { this.b0("IsDisabled", b, this.x); } } get aq() { return this.ap; } set aq(a) { let b = this.ap; this.ap = a; if (b != this.ap) { this.b0("TabIndex", b, this.ap); } } get ai() { return this.y; } set ai(a) { let b = this.y; this.y = a; if (b != this.y) { this.b0("IsFixed", b, this.y); } } get aj() { return this.aa; } set aj(a) { let b = this.aa; this.aa = a; if (b != this.aa) { this.b0("OpenAsChild", b, this.aa); } } get an() { return this.ae; } set an(a) { let b = this.ae; this.ae = a; if (b != this.ae) { this.b0("UseTopLayer", b, this.ae); } } b0(a, b, c) { if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } this.b6(a, b, c); } b6(a, b, c) { switch (a) { case "Density": this.b9(); break; case "BaseTheme": this.ca(); break; case "Value": this.b1(this.cj, this.value); this.cj = this.value; if (this.d != null && !this.w) { this.d.value = this.value; } break; case "Label": if (this.q != null) { this.q.b5 = this.az; } break; case "TextStyle": this.cf(); break; case "ShowClearButton": if (this.q != null) { if (this.q.b7 != "") { } } break; case "LabelTextColor": case "LabelTextStyle": case "TextColor": case "IconColor": this.cg(); break; case "AllowTextInput": if (this.q != null) { this.q.b0 = this.al(); } break; case "OpenOnFocus": break; case "IsDisabled": { if (this.q != null) { this.q.b0 = this.al(); } } break; } } al() { return this.ah || !this.ag; } cg() { if (this.q != null) { this.q.ce = this.co; } } ce() { if (this.q != null) { } } cf() { if (this.m != null) { this.q.bk = this.m; } } be() { if (this.ah == true) { return; } if (this.q != null) { this.q.b7 = ""; } this.value = BrushUtil.j(0, 0, 0, 0); this.d.ax(); this.z = false; } by() { this.z = true; } bz() { this.z = false; } bo() { NativeUIWindow.h(15, runOn(this, this.b4), this.g.h); NativeUIWindow.h(9, runOn(this, this.b3), this.g.h); } bs() { NativeUIWindow.i(15, runOn(this, this.b4)); NativeUIWindow.i(9, runOn(this, this.b3)); } b3(a) { let b = a; if (this.q != null) { if (this.r.b6 && !this.r.t(b.b) && !this.q.t(b.b)) { this.bf(); } } } b4(a) { if (this.q != null) { let b = this.q.be(); this.r.ce(b); } } bg() { NativeUIComponent.av(this.g.j(), [12, 2, 7, 0], [2, 2, 2, 2], (a) => { let b = a[0]; let c = a[1]; let d = a[2]; let e = a[3]; let f = this.g.i(); this.g.k(e, f); b.bn(d); d.bn(e); this.g.l(c); b.ch = BrushUtil.j(255, 255, 255, 255); b.ca = 150; b.b8 = 8; b.cb = 4; b.b1 = true; this.q = c; this.q.c = this.i; this.q.bp = this.k; this.q.b6 = ColorEditor.a5; this.q.cc = BrushUtil.j(255, 255, 255, 255); this.q.cd = BrushUtil.j(255, 0, 0, 0); this.q.bn = runOn(this, this.cc); this.q.n = runOn(this, this.bv); this.q.o = runOn(this, this.bx); this.q.cb = BrushUtil.j(255, 0, 0, 255); this.r = b; this.d = this.g.c(f); this.d.value = this.value; let g = this.d; g.closed = delegateCombine(g.closed, runOn(this, this.bc)); let h = this.d; h.valueChanged = delegateCombine(h.valueChanged, runOn(this, this.bd)); d.o = runOn(this, this.bx); let i = this.d; i.valueChanged = delegateCombine(i.valueChanged, runOn(this, this.bj)); }); } bd(a, b) { if (this.valueChanged != null) { this.valueChanged(this, b); } } bc(a, b) { this.bi(a); } bx(a, b) { if (!this.r.t(b.b) && !this.q.t(b.b) && !(this.q.an == b.b)) { this.bm(); } } bv(a, b) { this.focus(); } cc(a, b) { this.cd(); } bj(a, b) { this.w = true; this.value = b.newValue; this.w = false; this.b2(b.oldValue, b.newValue); } b2(a, b) { if (this.q != null) { this.q.cb = b; } } bi(a) { if (this.r.b6) { this.v = true; this.bf(); } } cd() { if (this.v == false) { if (this.r.b6) { this.bf(); } else { this.b5(); } } else { this.v = false; } } b5() { if (this.ah) { return; } if (this.r != null) { let a = this.g.r(false); let b = this.g.s(); let c = b.height; let d = 240; let e = a.bottom + d; if (!isNaN_(c) && c < e) { let f = a.top - d; if (f < 0) { this.cb(1, 0); } else { this.cb(2, 0); } } else { this.cb(1, 0); } } } cb(a, b) { { let c = this.g.r(true); this.r.cf(c, a, b); } } bf() { if (this.r != null) { this.a.executeDelayed(() => this.r.cc(), 0); } if (this.d != null) { this.d.bg(); } this.v = false; } focus(a = false) { if (this.q != null) { this.q.a0(); } if (!this.r.b6 && this.ak == true) { if (this.v == false) { if (this.z) { return; } if (this.ag == false) { this.b5(); this.v = true; this.a.executeDelayed(() => this.bl(), 0); } else { if (this.ak == true && this.ad == false) { this.b5(); this.v = true; this.a.executeDelayed(() => this.bl(), 0); } } } else { this.v = false; } } } bm() { this.v = false; } b8() { if (this.q != null) { this.q.b9(); } } bl() { this.d.a3(); } bq() { let a = new ColorEditorGotFocusEventArgs(); this.bu(a); } br() { let a = new ColorEditorLostFocusEventArgs(); this.bw(a); } ca() { } b9() { } bu(a) { if (null != this.gotFocus) { this.gotFocus(this, a); } } bw(a) { if (null != this.lostFocus) { this.lostFocus(this, a); } } } ColorEditor.$t = /*@__PURE__*/ markType(ColorEditor, 'ColorEditor', Base.$, [INotifyPropertyChanged_$type]); ColorEditor.a5 = "M13.093 6.743a1.074 1.074 0 011.306.251l.237.237-6.4 6.4-.242-.231a1.074 1.074 0 01-.251-1.306c.446-.693 1.553-2.516.515-3.554-1.584-1.585-2.225-.94-3.809-2.528S2.714 3 3.354 2.354s2.073-.489 3.658 1.095.943 2.225 2.527 3.809c1.038 1.042 2.861-.069 3.554-.515zm6.93 5.874L15.31 7.9 8.9 14.31l4.433 4.433c-.039.159-.084.327-.137.508 0 0-.8 2.749.8 2.749s.8-2.749.8-2.749a10.75 10.75 0 01-.272-1.14L16.2 16.44a8.944 8.944 0 00-2.072-3.314s.555-.545 3.323 2.063l.811-.811-1.54-2.5 2.5 1.539z"; ColorEditor.n = null; return ColorEditor; })(); /** * @hidden */ export let ColorEditorPanel = /*@__PURE__*/ (() => { class ColorEditorPanel extends Base { constructor() { super(); this.d = null; this.bv = BrushUtil.j(0, 0, 0, 0); this.bo = null; this.bs = BrushUtil.j(0, 0, 0, 0); this.propertyChanged = null; this.closed = null; this.valueChanged = null; this.valueChanging = null; this.v = null; this.bx = BrushUtil.j(255, 0, 0, 255); this.g = 3; this.e = 1; this.bp = BrushUtil.j(0, 255, 255, 255); this.bt = BrushUtil.j(255, 33, 150, 243); this.bu = BrushUtil.j(255, 21, 112, 184); this.bq = BrushUtil.j(76, 33, 150, 243); this.br = BrushUtil.j(50, 186, 191, 199); this.bw = BrushUtil.j(255, 24, 29, 31); this.i = null; this.n = null; this.s = null; this.u = null; this.m = null; this.t = null; this.o = null; this.r = null; this.q = null; this.l = null; this.k = null; this.p = null; this.aa = NaN; this.z = 1; this.y = false; this.x = false; NativeUIInputsFactory.n(); NativeUIXInputsFactory.m(); this.bo = BrushUtil.j(0, 0, 0, 0); let a = new ColorEditorPanelView(); a.a = this; this.d = a; this.d.bj(); } a8() { if (this.closed != null) { this.closed(this, new ColorEditorPanelClosedEventArgs()); } } bc(a) { let b = this.bx; this.bx = a; if (this.valueChanged != null) { this.valueChanged(this, ((() => { let $ret = new ColorEditorPanelSelectedValueChangedEventArgs(); $ret.oldValue = b; $ret.newValue = a; return $ret; })())); } this.bv = this.value; } notifySizeChanged(a) { this.d.bf(a); } destroy() { this.provideContainer(null); } provideContainer(a) { this.d.bh(a); } get w() { if (this.v == null) { this.v = new SRProvider(this.d.aa); this.v.cb("ColorEditorPanel"); } return this.v; } get value() { return this.bx; } set value(a) { let b = this.bx; this.bs = b; this.bx = a; if (b != this.bx) { this.bb("Value", b, this.bx); } } get h() { return this.g; } set h(a) { let b = this.g; this.g = a; if (b != this.g) { this.bb("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.g)); } } get f() { return this.e; } set f(a) { let b = this.e; this.e = a; if (b != this.e) { this.bb("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.e)); } } get by() { return this.bp; } set by(a) { let b = this.bp; this.bp = a; if (b != this.bp) { this.bb("BackgroundColor", b, this.bp); } } get b1() { return this.bt; } set b1(a) { let b = this.bt; this.bt = a; if (b != this.bt) { this.bb("SelectedColorBorderColor", b, this.bt); } } get b2() { return this.bu; } set b2(a) { let b = this.bu; this.bu = a; if (b != this.bu) { this.bb("SelectedFocusColorBorderColor", b, this.bu); } } get bz() { return this.bq; } set bz(a) { let b = this.bq; this.bq = a; if (b != this.bq) { this.bb("FocusColorBorderColor", b, this.bq); } } get b0() { return this.br; } set b0(a) { let b = this.br; this.br = a; if (b != this.br) { this.bb("HoverBackgroundColor", b, this.br); } } get b3() { return this.bw; } set b3(a) { let b = this.bw; this.bw = a; if (b != this.bw) { this.bb("TextColor", b, this.bw); } } get j() { return this.i; } set j(a) { let b = this.i; this.i = a; if (b != this.i) { this.bb("TextStyle", b, this.i); } } get ae() { return this.aa; } set ae(a) { let b = this.aa; this.aa = a; if (b != this.aa) { this.bb("PixelScalingRatio", b, a); } } get ab() { return this.z; } set ab(a) { let b = this.z; this.z = a; if (b != this.z) { this.bb("ActualPixelScalingRatio", b, a); } } bb(a, b, c) { if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } this.bd(a, b, c); } bd(a, b, c) { switch (a) { case "Density": this.bi(); break; case "BaseTheme": this.bj(); break; case "Value": this.bs = this.value; this.bv = this.value; if (b != null && c != null) { if (BrushUtil.d(b, c)) { break; } } this.bf(); this.bc(this.value); break; case "TextColor": case "BackgroundColor": case "FocusColorBorderColor": case "SelectedFocusColorBorderColor": case "SelectedColorBorderColor": case "HoverBackgroundColor": this.bk(); break; case "TextStyle": this.bl(); break; case "PixelScalingRatio": if (!isNaN_(c)) { this.ab = c; } break; case "ActualPixelScalingRatio": if (this.d != null) { this.d.bk(); } break; } } a4() { NativeUIContent.av(this.d.a7(), [7, 7, 0, 5, 0, 5, 0, 5, 2, 7, 1, 1, 7, 2, 7], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], (a) => { let b = a[0]; let c = a[1]; let d = a[2]; let e = a[3]; let f = a[4]; let g = a[5]; let h = a[6]; let i = a[7]; let j = a[8]; let k = a[9]; let l = a[10]; let m = a[11]; let n = a[12]; let o = a[13]; let p = a[14]; e.bk = 2; i.bk = 0; g.bk = 1; e.bw = BrushUtil.j(0, 0, 0, 0); i.bw = BrushUtil.j(0, 0, 0, 0); g.bw = BrushUtil.j(0, 0, 0, 0); g.bh = new Thickness(1, 0, 5, 5, 0); f.bh = new Thickness(1, 0, 5, 5, 0); l.bz = "Ok"; l.c = this.f; m.bz = "Cancel"; m.c = this.f; i.bh = new Thickness(1, 5, 0, 5, 2); h.bh = new Thickness(1, 5, 0, 5, 2); e.bh = new Thickness(1, 5, 5, 5, 0); d.bh = new Thickness(1, 5, 5, 5, 0); p.bh = new Thickness(1, 5, 16, 0, 11); p.a8 = BrushUtil.j(255, 255, 0, 0); c.cc(p, 0); c.ca(p, 0); c.bn(p); n.b2(0, 2, 1); n.b2(1, 2, 1); n.bh = new Thickness(1, 5, 2, 5, 2);