igniteui-react-inputs
Version:
Ignite UI React input components.
1,583 lines (1,582 loc) • 72.4 kB
JavaScript
/*
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, __values } from "tslib";
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
*/
var NativeUIXInputsFactory = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(NativeUIXInputsFactory, _super);
function NativeUIXInputsFactory() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.c = 2;
return _this;
}
Object.defineProperty(NativeUIXInputsFactory, "b", {
get: function () {
if (NativeUIXInputsFactory.a == null) {
NativeUIXInputsFactory.a = new NativeUIXInputsFactory();
}
return NativeUIXInputsFactory.a;
},
enumerable: false,
configurable: true
});
NativeUIXInputsFactory.m = function () {
NativeUIComponent.as(NativeUIXInputsFactory.b);
};
Object.defineProperty(NativeUIXInputsFactory.prototype, "flavor", {
get: function () {
return this.c;
},
enumerable: false,
configurable: true
});
NativeUIXInputsFactory.prototype.createComponent = function (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;
}
};
NativeUIXInputsFactory.prototype.createComponentSync = function (a, b, c) {
this.createComponent(a, b, c);
};
NativeUIXInputsFactory.prototype.supportsComponent = function (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;
};
NativeUIXInputsFactory.prototype.j = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new XInputGroup();
f.provideContainer(e);
var g = e.getExternal(f, e.rootWrapper, null);
var h = c.createElement("div");
h.setRawStyleProperty("width", "100%");
var i = c.getSubRenderer(h);
var j = new XInput();
j.provideContainer(i);
var k = e.getExternal(j, i.rootWrapper, null);
f.appendContentChild(h);
f.inputs.add(j);
var l = new XInputBridge(f);
var m = new NativeUIInput();
m.an = d;
m.d = l;
b(m);
};
NativeUIXInputsFactory.prototype.d = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new XButton();
f.provideContainer(e);
f.fj = "none";
var g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var h = new XButtonBridge(f);
var i = new NativeUIButton();
i.an = d;
i.d = h;
b(i);
};
NativeUIXInputsFactory.prototype.l = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new MultiSlider();
var g = new MultiSliderThumb();
f.provideContainer(e);
f.thumbs.add(g);
var h = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var i = new MultiSliderBridge(f);
var j = new NativeUISlider();
j.an = d;
j.d = i;
b(j);
};
NativeUIXInputsFactory.prototype.e = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new XButtonGroup();
f.provideContainer(e);
var g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var h = new XButtonGroupBridge(f);
var i = new NativeUIButtonGroup();
i.an = d;
i.d = h;
b(i);
};
NativeUIXInputsFactory.prototype.g = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new ColorEditor();
f.provideContainer(e);
var g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var h = new ColorEditorBridge(f);
var i = new NativeUIColorEditor();
i.an = d;
i.d = h;
b(i);
};
NativeUIXInputsFactory.prototype.f = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new XCheckbox();
f.provideContainer(e);
var g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var h = new XCheckboxBridge(f);
var i = new NativeUICheckbox();
i.an = d;
i.d = h;
b(i);
};
NativeUIXInputsFactory.prototype.i = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new XIcon();
f.provideContainer(e);
var g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var h = new XIconBridge(f);
var i = new NativeUIIcon();
i.an = d;
i.d = h;
var j = c.createElement("div");
var k = c.getSubRenderer(j);
var l = new XButton();
l.provideContainer(k);
l.e = 4;
l.fj = "none";
var m = k.getExternal(l, k.rootWrapper, k.getExternal(l, null, null));
var n = new XButtonBridge(l);
var o = new NativeUIButton();
o.an = j;
o.d = n;
o.bo = i;
b(o);
};
NativeUIXInputsFactory.prototype.h = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new XIcon();
f.provideContainer(e);
var g = e.getExternal(f, e.rootWrapper, e.getExternal(f, null, null));
var h = new XIconBridge(f);
var i = new NativeUIIcon();
i.an = d;
i.d = h;
b(i);
};
NativeUIXInputsFactory.prototype.k = function (a, b) {
var c = a;
var d = c.createElement("div");
var e = c.getSubRenderer(d);
var f = new Popup();
f.provideRenderer(e);
var g = new XPopupBridge(f);
var h = new NativeUIPopup();
h.an = d;
h.d = g;
b(h);
};
NativeUIXInputsFactory.$t = markType(NativeUIXInputsFactory, 'NativeUIXInputsFactory', Base.$, [INativeUIElementFactory_$type]);
NativeUIXInputsFactory.a = null;
return NativeUIXInputsFactory;
}(Base));
export { NativeUIXInputsFactory };
/**
* @hidden
*/
var ColorEditorBridge = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ColorEditorBridge, _super);
function ColorEditorBridge(a) {
var _this = _super.call(this, a) || this;
_this.u = null;
_this.w = null;
_this.v = null;
_this.x = null;
return _this;
}
ColorEditorBridge.prototype.addHandler = function (a, b, c, d) {
switch (c) {
case 0:
var e = a;
e.valueChanging = delegateCombine(e.valueChanging, runOn(this, this.z));
this.v = d;
this.x = b;
break;
case 4:
var f = a;
f.valueChanged = delegateCombine(f.valueChanged, runOn(this, this.y));
this.u = d;
this.w = b;
break;
}
};
ColorEditorBridge.prototype.y = function (a, b) {
if (this.u != null) {
var c = new NativeUIColorEditorValueChangedEventArgs();
this.u(this.w, c);
}
};
ColorEditorBridge.prototype.z = function (a, b) {
if (this.v != null) {
var c = new NativeUIColorEditorValueChangedEventArgs();
this.v(this.x, c);
}
};
ColorEditorBridge.prototype.getValue = function (a, b) {
switch (b) {
case 2: return a.value;
}
return null;
};
ColorEditorBridge.prototype.removeHandler = function (a, b, c, d) {
switch (c) {
case 0:
var e = a;
e.valueChanging = delegateRemove(e.valueChanging, runOn(this, this.z));
this.v = null;
this.x = null;
break;
case 4:
var f = a;
f.valueChanged = delegateRemove(f.valueChanged, runOn(this, this.y));
this.u = null;
this.w = null;
break;
}
};
ColorEditorBridge.prototype.setValue = function (a, b, c) {
switch (b) {
case 2:
a.value = c;
break;
}
};
ColorEditorBridge.$t = markType(ColorEditorBridge, 'ColorEditorBridge', XComponentBridge.$);
return ColorEditorBridge;
}(XComponentBridge));
export { ColorEditorBridge };
/**
* @hidden
*/
var ColorEditorPanelView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ColorEditorPanelView, _super);
function ColorEditorPanelView() {
var _this = _super.call(this) || this;
_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;
return _this;
}
ColorEditorPanelView.prototype.bj = function () {
};
ColorEditorPanelView.prototype.f = function () {
return true;
};
ColorEditorPanelView.prototype.bh = function (a) {
var e_1, _a;
if (a == null) {
try {
for (var _b = __values(fromEnum(this.g)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
b();
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
this.g.clear();
return;
}
this.aa = a;
if (isNaN_(this.a.ae)) {
this.a.ab = window.devicePixelRatio;
}
this.a.a4();
};
ColorEditorPanelView.prototype.bd = function () {
if (KeyFrameAnimationFactory.h == null) {
KeyFrameAnimationFactory.h = this.aa;
}
};
ColorEditorPanelView.prototype.bg = function () {
this.d = true;
};
ColorEditorPanelView.prototype.bi = function () {
this.d = false;
};
ColorEditorPanelView.prototype.a7 = function () {
return this.aa;
};
ColorEditorPanelView.prototype.bf = function (a) {
};
ColorEditorPanelView.prototype.a8 = function (a) {
this.aa.append(this.aa.getWrapper(a.an));
};
ColorEditorPanelView.prototype.be = function (a, b, c, d, e, f, g) {
var h = truncate(Math.round(f * this.a.ab));
var 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
};
};
ColorEditorPanelView.prototype.ba = function (a) {
if (this.ae == null || a.ao == null) {
a.ao = "image";
var b = this.aa.createElement("canvas");
this.ae = b;
var 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");
var d = a.an;
d.append(this.ae);
this.bm(this.a.ad());
}
};
ColorEditorPanelView.prototype.bm = function (a) {
if (this.k == a && !this.e) {
return;
}
if (this.ae != null) {
this.k = a;
var 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;
var c = this.au;
var d = this.at;
var e = this.a3;
if (this.ak == null) {
var f = (this.ae.getNativeElement());
var 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);
}
};
ColorEditorPanelView.prototype.a9 = function (a) {
if (this.ad == null || a.ao == null) {
a.ao = "image";
var b = this.aa.createElement("canvas");
this.ad = b;
var 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");
var d = a.an;
d.append(this.ad);
this.bl(0);
}
};
ColorEditorPanelView.prototype.bl = function (a) {
if (a == this.i && !this.e) {
return;
}
if (this.ad != null) {
this.i = a;
var 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;
var c = this.as;
var d = this.ar;
var e = this.a2;
if (this.aj == null) {
var f = (this.ad.getNativeElement());
var 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);
}
};
ColorEditorPanelView.prototype.bb = function (a) {
var b = a.an;
if (b.getChildCount() == 1) {
a.ao = "image";
var c = this.aa.createElement("canvas");
this.ah = c;
var 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);
var e = b.getChildAt(0);
e.before(c);
}
};
ColorEditorPanelView.prototype.bc = function (a) {
if (this.ai == null || a.ao == null) {
a.ao = "image";
var b = this.aa.createElement("canvas");
this.ai = b;
var 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");
var d = a.an;
d.append(this.ai);
this.bo(0, 1, 0.5);
}
};
ColorEditorPanelView.prototype.bn = function (a) {
if (this.q == a && !this.e) {
return;
}
if (this.ah != null) {
this.q = a;
var 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;
var c = this.ay;
var d = this.ax;
var e = this.a4;
if (this.al == null) {
var f = (this.ah.getNativeElement());
var 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);
}
};
ColorEditorPanelView.prototype.bo = function (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;
var 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;
var e = this.a0;
var f = this.az;
var g = this.a5;
if (this.am == null) {
var h = (this.ai.getNativeElement());
var 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);
}
};
ColorEditorPanelView.prototype.bk = function () {
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 = markType(ColorEditorPanelView, 'ColorEditorPanelView');
return ColorEditorPanelView;
}(Base));
export { ColorEditorPanelView };
/**
* @hidden
*/
var ColorEditorView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ColorEditorView, _super);
function ColorEditorView() {
var _this = _super.call(this) || this;
_this.a = null;
_this.h = null;
_this.d = null;
_this.g = new List$1(Delegate_$type, 0);
_this.e = true;
_this.b = null;
return _this;
}
ColorEditorView.prototype.q = function () {
};
ColorEditorView.prototype.f = function () {
return true;
};
ColorEditorView.prototype.o = function (a) {
var e_2, _a;
if (a == null) {
try {
for (var _b = __values(fromEnum(this.g)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
b();
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_2)
throw e_2.error;
}
}
this.g.clear();
return;
}
if (this.a.a == null) {
this.a.a = new DOMExecutionContext(a);
}
this.h = a;
this.a.bg();
};
ColorEditorView.prototype.m = function () {
if (KeyFrameAnimationFactory.h == null) {
KeyFrameAnimationFactory.h = this.h;
}
};
ColorEditorView.prototype.n = function () {
this.e = true;
};
ColorEditorView.prototype.p = function () {
this.e = false;
};
ColorEditorView.prototype.j = function () {
return this.h;
};
ColorEditorView.prototype.i = function () {
var a = new ColorEditorPanel();
this.b = a;
var b = this.h.createElement("div");
var c = this.h.getSubRenderer(b);
a.provideContainer(c);
var d = this.h.getExternal(a, null, null);
return b;
};
ColorEditorView.prototype.k = function (a, b) {
var c = a.an;
c.append(this.h.getWrapper(b));
};
ColorEditorView.prototype.l = function (a) {
this.h.append(this.h.getWrapper(a.an));
};
ColorEditorView.prototype.c = function (a) {
return this.b;
};
ColorEditorView.prototype.r = function (a) {
if (this.h != null) {
var b = this.h.rootWrapper.getNativeElement();
var 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;
};
ColorEditorView.prototype.s = function () {
return new Size(1, NaN, NaN);
};
ColorEditorView.$t = markType(ColorEditorView, 'ColorEditorView');
return ColorEditorView;
}(Base));
export { ColorEditorView };
/**
* @hidden
*/
var ColorEditor = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ColorEditor, _super);
function ColorEditor() {
var _this = _super.call(this) || this;
_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();
var a = new ColorEditorView();
a.a = _this;
_this.g = a;
_this.g.q();
return _this;
}
ColorEditor.prototype.onAttachedToUI = function () {
this.g.n();
};
ColorEditor.prototype.onDetachedFromUI = function () {
this.g.p();
};
ColorEditor.prototype.b1 = function (a, b) {
if (this.valueChanging != null) {
this.valueChanging(this, ((function () {
var $ret = new ColorEditorPanelSelectedValueChangedEventArgs();
$ret.oldValue = a;
$ret.newValue = b;
return $ret;
})()));
}
if (this.w) {
}
};
ColorEditor.prototype.notifySizeChanged = function () {
};
ColorEditor.prototype.destroy = function () {
this.provideContainer(null);
};
ColorEditor.prototype.provideContainer = function (a) {
this.g.o(a);
};
Object.defineProperty(ColorEditor.prototype, "t", {
get: function () {
if (this.s == null) {
this.s = new SRProvider(this.g.h);
this.s.cb("ColorEditor");
}
return this.s;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "value", {
get: function () {
return this.cl;
},
set: function (a) {
var b = this.cl;
this.cj = b;
this.cl = a;
if (b != this.cl) {
this.b0("Value", b, this.cl);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "az", {
get: function () {
return this.ar;
},
set: function (a) {
var b = this.ar;
this.ar = a;
if (b != this.ar) {
this.b0("Label", b, this.ar);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "cn", {
get: function () {
return this.ci;
},
set: function (a) {
var b = this.ci;
this.ci = a;
if (b != this.ci) {
this.b0("LabelTextColor", b, a);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "o", {
get: function () {
return this.l;
},
set: function (a) {
var b = this.l;
this.l = a;
if (b != this.l) {
this.b0("LabelTextStyle", b, this.l);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "k", {
get: function () {
return this.j;
},
set: function (a) {
var b = this.j;
this.j = a;
if (b != this.j) {
this.b0("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.j));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "i", {
get: function () {
return this.h;
},
set: function (a) {
var b = this.h;
this.h = a;
if (b != this.h) {
this.b0("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.h));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "p", {
get: function () {
return this.m;
},
set: function (a) {
var b = this.m;
this.m = a;
if (b != this.m) {
this.b0("TextStyle", b, this.m);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "co", {
get: function () {
return this.ck;
},
set: function (a) {
var b = this.ck;
this.ck = a;
if (b != this.ck) {
this.b0("TextColor", b, this.ck);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "cm", {
get: function () {
return this.ch;
},
set: function (a) {
var b = this.ch;
this.ch = a;
if (b != this.ch) {
this.b0("IconColor", b, this.ch);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "am", {
get: function () {
return this.ac;
},
set: function (a) {
var b = this.ac;
this.ac = a;
if (b != this.ac) {
this.b0("ShowClearButton", b, this.ac);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "ag", {
get: function () {
return this.u;
},
set: function (a) {
var b = this.u;
this.u = a;
if (b != this.u) {
this.b0("AllowTextInput", b, this.u);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "ak", {
get: function () {
return this.ab;
},
set: function (a) {
var b = this.ab;
this.ab = a;
if (b != this.ab) {
this.b0("OpenOnFocus", b, this.ab);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "ah", {
get: function () {
return this.x;
},
set: function (a) {
var b = this.x;
this.x = a;
if (b != this.x) {
this.b0("IsDisabled", b, this.x);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "aq", {
get: function () {
return this.ap;
},
set: function (a) {
var b = this.ap;
this.ap = a;
if (b != this.ap) {
this.b0("TabIndex", b, this.ap);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "ai", {
get: function () {
return this.y;
},
set: function (a) {
var b = this.y;
this.y = a;
if (b != this.y) {
this.b0("IsFixed", b, this.y);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "aj", {
get: function () {
return this.aa;
},
set: function (a) {
var b = this.aa;
this.aa = a;
if (b != this.aa) {
this.b0("OpenAsChild", b, this.aa);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditor.prototype, "an", {
get: function () {
return this.ae;
},
set: function (a) {
var b = this.ae;
this.ae = a;
if (b != this.ae) {
this.b0("UseTopLayer", b, this.ae);
}
},
enumerable: false,
configurable: true
});
ColorEditor.prototype.b0 = function (a, b, c) {
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
this.b6(a, b, c);
};
ColorEditor.prototype.b6 = function (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;
}
};
ColorEditor.prototype.al = function () {
return this.ah || !this.ag;
};
ColorEditor.prototype.cg = function () {
if (this.q != null) {
this.q.ce = this.co;
}
};
ColorEditor.prototype.ce = function () {
if (this.q != null) {
}
};
ColorEditor.prototype.cf = function () {
if (this.m != null) {
this.q.bk = this.m;
}
};
ColorEditor.prototype.be = function () {
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;
};
ColorEditor.prototype.by = function () {
this.z = true;
};
ColorEditor.prototype.bz = function () {
this.z = false;
};
ColorEditor.prototype.bo = function () {
NativeUIWindow.h(15, runOn(this, this.b4), this.g.h);
NativeUIWindow.h(9, runOn(this, this.b3), this.g.h);
};
ColorEditor.prototype.bs = function () {
NativeUIWindow.i(15, runOn(this, this.b4));
NativeUIWindow.i(9, runOn(this, this.b3));
};
ColorEditor.prototype.b3 = function (a) {
var b = a;
if (this.q != null) {
if (this.r.b6 && !this.r.t(b.b) && !this.q.t(b.b)) {
this.bf();
}
}
};
ColorEditor.prototype.b4 = function (a) {
if (this.q != null) {
var b = this.q.be();
this.r.ce(b);
}
};
ColorEditor.prototype.bg = function () {
var _this = this;
NativeUIComponent.av(this.g.j(), [12, 2, 7, 0], [2, 2, 2, 2], function (a) {
var b = a[0];
var c = a[1];
var d = a[2];
var e = a[3];
var 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;
var g = _this.d;
g.closed = delegateCombine(g.closed, runOn(_this, _this.bc));
var h = _this.d;
h.valueChanged = delegateCombine(h.valueChanged, runOn(_this, _this.bd));
d.o = runOn(_this, _this.bx);
var i = _this.d;
i.valueChanged = delegateCombine(i.valueChanged, runOn(_this, _this.bj));
});
};
ColorEditor.prototype.bd = function (a, b) {
if (this.valueChanged != null) {
this.valueChanged(this, b);
}
};
ColorEditor.prototype.bc = function (a, b) {
this.bi(a);
};
ColorEditor.prototype.bx = function (a, b) {
if (!this.r.t(b.b) && !this.q.t(b.b) && !(this.q.an == b.b)) {
this.bm();
}
};
ColorEditor.prototype.bv = function (a, b) {
this.focus();
};
ColorEditor.prototype.cc = function (a, b) {
this.cd();
};
ColorEditor.prototype.bj = function (a, b) {
this.w = true;
this.value = b.newValue;
this.w = false;
this.b2(b.oldValue, b.newValue);
};
ColorEditor.prototype.b2 = function (a, b) {
if (this.q != null) {
this.q.cb = b;
}
};
ColorEditor.prototype.bi = function (a) {
if (this.r.b6) {
this.v = true;
this.bf();
}
};
ColorEditor.prototype.cd = function () {
if (this.v == false) {
if (this.r.b6) {
this.bf();
}
else {
this.b5();
}
}
else {
this.v = false;
}
};
ColorEditor.prototype.b5 = function () {
if (this.ah) {
return;
}
if (this.r != null) {
var a = this.g.r(false);
var b = this.g.s();
var c = b.height;
var d = 240;
var e = a.bottom + d;
if (!isNaN_(c) && c < e) {
var f = a.top - d;
if (f < 0) {
this.cb(1, 0);
}
else {
this.cb(2, 0);
}
}
else {
this.cb(1, 0);
}
}
};
ColorEditor.prototype.cb = function (a, b) {
{
var c = this.g.r(true);
this.r.cf(c, a, b);
}
};
ColorEditor.prototype.bf = function () {
var _this = this;
if (this.r != null) {
this.a.executeDelayed(function () { return _this.r.cc(); }, 0);
}
if (this.d != null) {
this.d.bg();
}
this.v = false;
};
ColorEditor.prototype.focus = function (a) {
var _this = this;
if (a === void 0) {
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(function () { return _this.bl(); }, 0);
}
else {
if (this.ak == true && this.ad == false) {
this.b5();
this.v = true;
this.a.executeDelayed(function () { return _this.bl(); }, 0);
}
}
}
else {
this.v = false;
}
}
};
ColorEditor.prototype.bm = function () {
this.v = false;
};
ColorEditor.prototype.b8 = function () {
if (this.q != null) {
this.q.b9();
}
};
ColorEditor.prototype.bl = function () {
this.d.a3();
};
ColorEditor.prototype.bq = function () {
var a = new ColorEditorGotFocusEventArgs();
this.bu(a);
};
ColorEditor.prototype.br = function () {
var a = new ColorEditorLostFocusEventArgs();
this.bw(a);
};
ColorEditor.prototype.ca = function () {
};
ColorEditor.prototype.b9 = function () {
};
ColorEditor.prototype.bu = function (a) {
if (null != this.gotFocus) {
this.gotFocus(this, a);
}
};
ColorEditor.prototype.bw = function (a) {
if (null != this.lostFocus) {
this.lostFocus(this, a);
}
};
ColorEditor.$t = 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;
}(Base));
export { ColorEditor };
/**
* @hidden
*/
var ColorEditorPanel = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ColorEditorPanel, _super);
function ColorEditorPanel() {
var _this = _super.call(this) || this;
_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);
var a = new ColorEditorPanelView();
a.a = _this;
_this.d = a;
_this.d.bj();
return _this;
}
ColorEditorPanel.prototype.a8 = function () {
if (this.closed != null) {
this.closed(this, new ColorEditorPanelClosedEventArgs());
}
};
ColorEditorPanel.prototype.bc = function (a) {
var b = this.bx;
this.bx = a;
if (this.valueChanged != null) {
this.valueChanged(this, ((function () {
var $ret = new ColorEditorPanelSelectedValueChangedEventArgs();
$ret.oldValue = b;
$ret.newValue = a;
return $ret;
})()));
}
this.bv = this.value;
};
ColorEditorPanel.prototype.notifySizeChanged = function (a) {
this.d.bf(a);
};
ColorEditorPanel.prototype.destroy = function () {
this.provideContainer(null);
};
ColorEditorPanel.prototype.provideContainer = function (a) {
this.d.bh(a);
};
Object.defineProperty(ColorEditorPanel.prototype, "w", {
get: function () {
if (this.v == null) {
this.v = new SRProvider(this.d.aa);
this.v.cb("ColorEditorPanel");
}
return this.v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditorPanel.prototype, "value", {
get: function () {
return this.bx;
},
set: function (a) {
var b = this.bx;
this.bs = b;
this.bx = a;
if (b != this.bx) {
this.bb("Value", b, this.bx);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditorPanel.prototype, "h", {
get: function () {
return this.g;
},
set: function (a) {
var b = this.g;
this.g = a;
if (b != this.g) {
this.bb("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.g));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditorPanel.prototype, "f", {
get: function () {
return this.e;
},
set: function (a) {
var b = this.e;
this.e = a;
if (b != this.e) {
this.bb("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.e));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditorPanel.prototype, "by", {
get: function () {
return this.bp;
},
set: function (a) {
var b = this.bp;
this.bp = a;
if (b != this.bp) {
this.bb("BackgroundColor", b, this.bp);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ColorEditorPanel.prototype, "b1", {
get: function () {
return this.bt;
},
set: function (a) {