igniteui-react-inputs
Version:
Ignite UI React input components.
1,448 lines • 64.1 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 } from "tslib";
import { Base, runOn, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateRemove, enumGetBox, delegateCombine } from "igniteui-react-core";
import { XInputGroup } from "./XInputGroup";
import { XLabel } from "./XLabel";
import { XInput } from "./XInput";
import { XSuffix } from "./XSuffix";
import { XIcon } from "./XIcon";
import { Popup } from "igniteui-react-core";
import { XCalendar } from "./XCalendar";
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 { DayOfWeek_$type } from "./DayOfWeek";
import { FirstWeek_$type } from "./FirstWeek";
import { DateFormats_$type } from "./DateFormats";
import { BrushUtil } from "igniteui-react-core";
import { DateTimeValueFormatter } from "./DateTimeValueFormatter";
import { SelectedValueChangedEventArgs } from "./SelectedValueChangedEventArgs";
import { GotFocusEventArgs } from "./GotFocusEventArgs";
import { LostFocusEventArgs } from "./LostFocusEventArgs";
import { DatePickerVisualModelExport } from "./DatePickerVisualModelExport";
import { FontUtil } from "igniteui-react-core";
import { dateMinValue, dateMaxValue, dateGetDate, dateFromValues, dateGetMonth } from "igniteui-react-core";
import { stringContains, stringIsNullOrWhiteSpace, stringIsNullOrEmpty } from "igniteui-react-core";
import { stringSplit } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
* @hidden
*/
var DatePickerView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DatePickerView, _super);
function DatePickerView() {
var _this = _super.call(this) || this;
_this.b = null;
_this.d = null;
_this.k = null;
_this.e = null;
_this.m = null;
_this.l = null;
_this.j = null;
_this.g = null;
_this.f = null;
_this.i = null;
_this.h = null;
_this.o = null;
_this.document_Click = _this.document_Click.bind(_this);
_this.window_Resize = _this.window_Resize.bind(_this);
return _this;
}
DatePickerView.prototype.am = function () {
};
Object.defineProperty(DatePickerView.prototype, "n", {
get: function () {
return this.e;
},
enumerable: false,
configurable: true
});
DatePickerView.prototype.ak = function (a) {
if (a == null) {
this.b.cr();
if (this.d != null) {
var b = this.d.rootWrapper.getChildAt(0);
b.unlistenAll();
document.removeEventListener("click", this.document_Click, false);
window.removeEventListener("resize", this.window_Resize, false);
}
this.d = null;
return;
}
this.d = a;
var c = Math.round(a.rootWrapper.width());
var d = Math.round(a.rootWrapper.height());
this.ad();
this.ae();
var e = this.d.rootWrapper.getChildAt(0);
e.listen("keydown", runOn(this, this.y));
e.listen("focusin", runOn(this, this.w));
e.listen("focusout", runOn(this, this.x));
document.addEventListener("click", this.document_Click, false);
window.addEventListener("resize", this.window_Resize, false);
this.o = new MutationObserver(runOn(this, this.al));
};
DatePickerView.prototype.ad = function () {
if (this.d != null) {
this.k = this.d.rootWrapper.getChildAt(0);
this.k.setAttribute("tabIndex", this.b.bf.toString());
this.k.setStyleProperty("display", "flex");
this.k.setStyleProperty("height", "100%");
this.l = this.d.createElement("div");
this.j = this.d.createElement("div");
this.j.setRawStyleProperty("flex-grow", "1");
this.g = this.d.createElement("div");
this.g.setAttribute("aria-hidden", "true");
this.f = this.d.createElement("div");
this.g.setStyleProperty("padding-right", "2px");
this.i = this.d.createElement("div");
this.i.setAttribute("aria-hidden", "true");
this.h = this.d.createElement("div");
this.b.cs();
this.j.getChildAt(0).setAttribute("aria-expanded", "fasle");
this.j.getChildAt(0).setAttribute("aria-invalid", "false");
this.f.setStyleProperty("height", "16px");
this.f.setStyleProperty("width", "16px");
this.h.setStyleProperty("height", "16px");
this.h.setStyleProperty("width", "16px");
this.f.listen("click", runOn(this, this.ac));
this.f.listen("mousedown", runOn(this, this.aa));
this.f.listen("mouseleave", runOn(this, this.ab));
this.h.listen("click", runOn(this, this.ag));
}
};
DatePickerView.prototype.aq = function (a) {
if (this.d != null) {
var b = this.d.getSubRenderer(this.k);
a.provideContainer(b);
var c = b.getExternal(a, b.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.as = function (a) {
if (this.d != null) {
var b = this.d.getSubRenderer(this.l);
a.provideContainer(b);
var c = b.getExternal(a, b.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.ar = function (a) {
if (this.d != null) {
var b = this.d.getSubRenderer(this.j);
a.provideContainer(b);
var c = b.getExternal(a, b.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.au = function (a, b) {
if (this.d != null) {
var c = this.d.getSubRenderer(b);
a.provideContainer(c);
var d = c.getExternal(a, c.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.ap = function (a, b) {
if (this.d != null) {
var c = this.d.getSubRenderer(b);
a.provideContainer(c);
var d = c.getExternal(a, c.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.v = function () {
return this.l;
};
DatePickerView.prototype.u = function () {
return this.j;
};
DatePickerView.prototype.r = function () {
return this.g;
};
DatePickerView.prototype.q = function () {
return this.f;
};
DatePickerView.prototype.t = function () {
return this.i;
};
DatePickerView.prototype.s = function () {
return this.h;
};
DatePickerView.prototype.aw = function (a) {
if (this.j != null) {
if (a) {
this.j.getChildAt(0).setAttribute("aria-expanded", "true");
}
else {
this.j.getChildAt(0).setAttribute("aria-expanded", "false");
}
}
};
DatePickerView.prototype.ay = function (a) {
if (a != null && a != "") {
this.j.getChildAt(0).setAttribute("aria-label", a);
}
else {
this.j.getChildAt(0).setAttribute("aria-label", "Select a date");
}
};
DatePickerView.prototype.av = function () {
if (this.f != null) {
if (this.b.a0 == true) {
this.f.show();
}
else {
this.f.hide();
}
}
};
DatePickerView.prototype.ah = function () {
if (this.f != null) {
this.f.hide();
}
};
DatePickerView.prototype.ax = function () {
this.k.setAttribute("tabIndex", this.b.bf.toString());
};
DatePickerView.prototype.an = function () {
this.o.observe(document, { childList: true, subtree: true });
};
DatePickerView.prototype.aj = function () {
this.o.disconnect();
};
DatePickerView.prototype.ae = function () {
if (this.d != null) {
this.m = this.d.rootWrapper.getChildAt(1);
this.e = this.d.createElement("div");
this.e.setStyleProperty("width", "100%");
this.e.setStyleProperty("height", "100%");
this.e.setStyleProperty("display", "flex");
this.b.ct();
this.e.parent().setStyleProperty("height", "100%");
if (this.b.a2 == true) {
this.e.parent().parent().setStyleProperty("max-width", "245px");
}
else {
this.e.parent().parent().setStyleProperty("max-width", "232px");
}
}
};
DatePickerView.prototype.z = function () {
if (this.d != null) {
if (this.b.a2 == true) {
this.e.parent().parent().setStyleProperty("max-width", "245px");
}
else {
this.e.parent().parent().setStyleProperty("max-width", "232px");
}
}
};
DatePickerView.prototype.at = function (a) {
if (this.d != null) {
var b = this.d.getSubRenderer(this.m);
a.provideRenderer(b);
var c = b.getExternal(a, b.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.ao = function (a) {
if (this.d != null) {
var b = this.d.getSubRenderer(this.e);
a.provideContainer(b);
var c = b.getExternal(a, b.rootWrapper, this.d.getExternal(this.b, null, null));
}
};
DatePickerView.prototype.p = function () {
return this.e;
};
DatePickerView.prototype.ac = function (a) {
if (this.b.av == true) {
return;
}
this.b.cq();
if (this.f != null) {
this.f.hide();
}
};
DatePickerView.prototype.aa = function (a) {
this.b.c9();
};
DatePickerView.prototype.ab = function (a) {
this.b.da();
};
DatePickerView.prototype.ag = function (a) {
a.stopPropagation();
this.b.cy();
};
DatePickerView.prototype.y = function (a) {
var b = a.which;
if (b == 27) {
this.b.cr();
}
};
DatePickerView.prototype.w = function (a) {
this.b.focus();
var b = (a.originalEvent.relatedTarget);
if (!this.c(b)) {
this.b.c4();
}
};
DatePickerView.prototype.x = function (a) {
var b = (a.originalEvent.relatedTarget);
if (!this.c(b)) {
this.b.cx();
this.b.c5();
}
};
DatePickerView.prototype.al = function (a, b) {
if (this.d != null) {
var c = this.d.rootWrapper.getNativeElement();
if (!document.documentElement.contains(c)) {
this.b.cr();
}
}
else {
this.b.cr();
}
};
DatePickerView.prototype.document_Click = function (a) {
var b = a.target;
if (!this.c(b)) {
this.b.cr();
}
};
DatePickerView.prototype.window_Resize = function (a) {
this.b.dn();
};
DatePickerView.prototype.a0 = function (a) {
if (this.d != null) {
var b = this.d.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;
};
DatePickerView.prototype.a = function () {
var a = (window.innerWidth);
var b = (window.innerHeight);
var c = new Array(2);
c[0] = a;
c[1] = b;
return c;
};
DatePickerView.prototype.c = function (a) {
if (null == a) {
return false;
}
var b = this.d.rootWrapper.getNativeElement();
var c = this.e.getNativeElement();
return b.contains(a) || c.contains(a);
};
DatePickerView.prototype.ai = function () {
};
DatePickerView.$t = markType(DatePickerView, 'DatePickerView');
return DatePickerView;
}(Base));
export { DatePickerView };
/**
* @hidden
*/
var XDatePicker = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(XDatePicker, _super);
function XDatePicker() {
var _this = _super.call(this) || this;
_this.h = null;
_this.u = null;
_this.q = null;
_this.o = null;
_this.r = null;
_this.m = null;
_this.n = null;
_this.c = null;
_this.bh = "dd";
_this.bl = "mm";
_this.bo = "yyyy";
_this.bi = "mdy";
_this.bn = "/";
_this.ah = false;
_this.at = false;
_this.ar = false;
_this.a6 = dateMinValue();
_this.ai = false;
_this.propertyChanged = null;
_this.selectedValueChanged = null;
_this.ae = null;
_this.a8 = dateMinValue();
_this.a7 = dateMinValue();
_this.bk = "";
_this.du = BrushUtil.j(255, 24, 29, 31);
_this.z = null;
_this.bm = "";
_this.a5 = dateMinValue();
_this.a4 = dateMaxValue();
_this.x = 2;
_this.v = 1;
_this.aa = null;
_this.dv = BrushUtil.j(255, 24, 29, 31);
_this.dt = BrushUtil.j(255, 163, 172, 184);
_this.ao = true;
_this.ap = false;
_this.ag = true;
_this.an = true;
_this.i = 0;
_this.k = 0;
_this.aq = false;
_this.a = new DateTimeValueFormatter();
_this.d = 0;
_this.bj = null;
_this.aj = false;
_this.be = 0;
_this.ak = false;
_this.am = false;
_this.as = false;
_this.al = false;
_this.gotFocus = null;
_this.lostFocus = null;
_this.keyDown = null;
_this.changing = null;
var a = new DatePickerView();
a.b = _this;
_this.h = a;
_this.h.am();
_this.cp();
return _this;
}
XDatePicker.prototype.dc = function (a, b) {
if (this.u != null) {
this.ah = true;
this.cr();
}
this.dm();
if (this.selectedValueChanged != null) {
this.selectedValueChanged(this, ((function () {
var $ret = new SelectedValueChangedEventArgs();
$ret.oldValue = a;
$ret.newValue = b;
return $ret;
})()));
}
if (this.ai) {
this.dg();
}
};
XDatePicker.prototype.notifySizeChanged = function () {
this.h.ai();
};
XDatePicker.prototype.destroy = function () {
if (this.c != null) {
var a = this.c;
a.selectedValueChanged = delegateRemove(a.selectedValueChanged, runOn(this, this.co));
var b = this.c;
b.close = delegateRemove(b.close, runOn(this, this.cn));
}
this.provideContainer(null);
};
XDatePicker.prototype.provideContainer = function (a) {
this.h.ak(a);
};
XDatePicker.prototype.setName = function (a) {
this.o.e = a;
};
Object.defineProperty(XDatePicker.prototype, "af", {
get: function () {
if (this.ae == null) {
this.ae = new SRProvider(this.h.d);
this.ae.cb("Calendar");
}
return this.ae;
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "value", {
get: function () {
return this.a8;
},
set: function (a) {
var b = this.a8;
this.a6 = b;
this.a8 = a;
if (+b != +(this.a8)) {
this.db("Value", b, this.a8);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "bb", {
get: function () {
return this.a7;
},
set: function (a) {
var b = this.a7;
this.a7 = a;
if (+b != +(this.a7)) {
this.db("Today", b, this.a7);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "b4", {
get: function () {
return this.bk;
},
set: function (a) {
var b = this.bk;
this.bk = a;
if (b != this.bk) {
this.db("Label", b, this.bk);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "dx", {
get: function () {
return this.du;
},
set: function (a) {
var b = this.du;
this.du = a;
if (b != this.du) {
this.db("LabelTextColor", b, a);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "ac", {
get: function () {
return this.z;
},
set: function (a) {
var b = this.z;
this.z = a;
if (b != this.z) {
this.db("LabelTextStyle", b, this.z);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "cc", {
get: function () {
return this.bm;
},
set: function (a) {
var b = this.bm;
this.bm = a;
if (b != this.bm) {
this.db("Placeholder", b, this.bm);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "ba", {
get: function () {
return this.a5;
},
set: function (a) {
var b = this.a5;
this.a5 = a;
if (+b != +(this.a5)) {
this.db("MinDate", b, this.a5);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "a9", {
get: function () {
return this.a4;
},
set: function (a) {
var b = this.a4;
this.a4 = a;
if (+b != +(this.a4)) {
this.db("MaxDate", b, this.a4);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "y", {
get: function () {
return this.x;
},
set: function (a) {
var b = this.x;
this.x = a;
if (b != this.x) {
this.db("Density", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.x));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "w", {
get: function () {
return this.v;
},
set: function (a) {
var b = this.v;
this.v = a;
if (b != this.v) {
this.db("BaseTheme", enumGetBox(BaseControlTheme_$type, b), enumGetBox(BaseControlTheme_$type, this.v));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "ad", {
get: function () {
return this.aa;
},
set: function (a) {
var b = this.aa;
this.aa = a;
if (b != this.aa) {
this.db("TextStyle", b, this.aa);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "dy", {
get: function () {
return this.dv;
},
set: function (a) {
var b = this.dv;
this.dv = a;
if (b != this.dv) {
this.db("TextColor", b, this.dv);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "dw", {
get: function () {
return this.dt;
},
set: function (a) {
var b = this.dt;
this.dt = a;
if (b != this.dt) {
this.db("IconColor", b, this.dt);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "a0", {
get: function () {
return this.ao;
},
set: function (a) {
var b = this.ao;
this.ao = a;
if (b != this.ao) {
this.db("ShowClearButton", b, this.ao);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "a1", {
get: function () {
return this.ap;
},
set: function (a) {
var b = this.ap;
this.ap = a;
if (b != this.ap) {
this.db("ShowTodayButton", b, this.ap);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "au", {
get: function () {
return this.ag;
},
set: function (a) {
var b = this.ag;
this.ag = a;
if (b != this.ag) {
this.db("AllowTextInput", b, this.ag);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "ay", {
get: function () {
return this.an;
},
set: function (a) {
var b = this.an;
this.an = a;
if (b != this.an) {
this.db("OpenOnFocus", b, this.an);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "j", {
get: function () {
return this.i;
},
set: function (a) {
var b = this.i;
this.i = a;
if (b != this.i) {
this.db("FirstDayOfWeek", enumGetBox(DayOfWeek_$type, b), enumGetBox(DayOfWeek_$type, this.i));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "l", {
get: function () {
return this.k;
},
set: function (a) {
var b = this.k;
this.k = a;
if (b != this.k) {
this.db("FirstWeekOfYear", enumGetBox(FirstWeek_$type, b), enumGetBox(FirstWeek_$type, this.k));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "a2", {
get: function () {
return this.aq;
},
set: function (a) {
var b = this.aq;
this.aq = a;
if (b != this.aq) {
this.db("ShowWeekNumbers", b, this.aq);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "e", {
get: function () {
return this.d;
},
set: function (a) {
var b = this.d;
this.d = a;
if (this.d != b) {
this.db("DateFormat", enumGetBox(DateFormats_$type, b), enumGetBox(DateFormats_$type, this.d));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "bz", {
get: function () {
return this.bj;
},
set: function (a) {
var b = this.bj;
this.bj = a;
if (b != this.bj) {
this.db("FormatString", b, this.bj);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "av", {
get: function () {
return this.aj;
},
set: function (a) {
var b = this.aj;
this.aj = a;
if (b != this.aj) {
this.db("IsDisabled", b, this.aj);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "bf", {
get: function () {
return this.be;
},
set: function (a) {
var b = this.be;
this.be = a;
if (b != this.be) {
this.db("TabIndex", b, this.be);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "aw", {
get: function () {
return this.ak;
},
set: function (a) {
var b = this.ak;
this.ak = a;
if (b != this.ak) {
this.db("IsFixed", b, this.ak);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "ax", {
get: function () {
return this.am;
},
set: function (a) {
var b = this.am;
this.am = a;
if (b != this.am) {
this.db("OpenAsChild", b, this.am);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XDatePicker.prototype, "a3", {
get: function () {
return this.as;
},
set: function (a) {
var b = this.as;
this.as = a;
if (b != this.as) {
this.db("UseTopLayer", b, this.as);
}
},
enumerable: false,
configurable: true
});
XDatePicker.prototype.db = function (a, b, c) {
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
this.de(a, b, c);
};
XDatePicker.prototype.de = function (a, b, c) {
switch (a) {
case "Density":
this.dh();
break;
case "BaseTheme":
this.dj();
break;
case "Value":
if (+(dateGetDate(this.value)) != +(dateGetDate(dateMinValue()))) {
if (dateGetDate(this.value) < dateGetDate(this.ba) || dateGetDate(this.value) > dateGetDate(this.a9)) {
this.ai = true;
this.value = this.a6;
this.ai = false;
}
}
this.dc(this.a6, this.value);
this.a6 = this.value;
if (this.c != null) {
if (+(dateGetDate(this.value)) == +(dateGetDate(dateMinValue()))) {
this.c.value = dateMinValue();
}
else {
this.c.value = this.value;
}
}
break;
case "Label":
if (this.r != null) {
this.r.text = this.b4;
if (this.b4 != null && this.b4 != "") {
if (!this.q.inputs.contains(this.r)) {
this.q.inputs.insert(0, this.r);
}
}
else {
if (this.q.inputs.contains(this.r)) {
this.q.inputs.remove(this.r);
}
}
}
break;
case "Placeholder":
if (this.o != null) {
this.o.cg = this.cc;
this.h.ay(this.cc);
}
break;
case "Today":
if (this.c != null) {
this.c.av = this.bb;
}
break;
case "MaxDate":
if (this.c != null) {
var d = Base.compareSimple(this.ba, this.a9);
if (d >= 0) {
this.a9 = dateMaxValue();
}
this.c.at = this.a4;
}
if (dateGetDate(this.value) > dateGetDate(this.a9)) {
this.a6 = dateMinValue();
this.ai = true;
this.value = dateMinValue();
this.ai = false;
}
break;
case "MinDate":
if (this.c != null) {
this.c.au = this.a5;
var e = Base.compareSimple(this.ba, this.a9);
if (e >= 0) {
this.a6 = dateMaxValue();
this.c.at = this.a9;
}
}
if (dateGetDate(this.value) < dateGetDate(this.ba)) {
this.a6 = dateMinValue();
this.ai = true;
this.value = dateMinValue();
this.ai = false;
}
break;
case "TextStyle":
this.dp();
break;
case "ShowClearButton":
if (this.o != null) {
if (this.o.cq != "") {
this.h.av();
}
}
break;
case "LabelTextColor":
case "LabelTextStyle":
case "TextColor":
case "IconColor":
this.dq();
break;
case "ShowTodayButton":
if (this.c != null) {
this.c.ae = this.a1;
this.h.z();
}
break;
case "AllowTextInput":
if (this.o != null) {
this.o.disabled = this.az();
}
break;
case "OpenOnFocus": break;
case "DateFormat":
this.a.k(this.e);
this.dm();
break;
case "FormatString":
this.cp();
this.dm();
break;
case "FirstDayOfWeek":
if (this.c != null) {
this.c.l = this.j;
}
break;
case "ShowWeekNumbers":
if (this.c != null) {
this.c.af = this.a2;
this.h.z();
}
break;
case "FirstWeekOfYear":
if (this.c != null) {
this.c.o = this.l;
}
break;
case "IsDisabled":
{
if (this.q != null) {
this.q.disabled = this.av;
}
if (this.o != null) {
this.o.disabled = this.az();
}
}
break;
case "TabIndex":
this.h.ax();
break;
case "IsFixed":
if (this.u != null) {
this.u.ar = this.aw;
}
break;
case "UseTopLayer":
if (this.u != null) {
this.u.ay = this.a3;
}
break;
}
};
XDatePicker.prototype.az = function () {
return this.av || !this.au;
};
XDatePicker.prototype.cp = function () {
var a = '/';
var b = this.bz != null ? this.bz.toLowerCase() : this.a.j();
if (stringContains(b, "/")) {
a = '/';
}
else if (stringContains(b, "-")) {
a = '-';
}
else if (stringContains(b, " ")) {
a = ' ';
}
else if (stringContains(b, ".")) {
a = '.';
}
else if (stringContains(b, ",")) {
a = ',';
}
this.bn = a.toString();
var c = b.split(a);
if (c.length == 3) {
var d = "";
for (var e = 0; e < 3; e++) {
if (stringContains(c[e], "d")) {
d += "d";
switch (c[e]) {
case "d":
this.bh = c[e];
break;
case "dd":
this.bh = c[e];
break;
case "ddd":
this.bh = c[e];
break;
case "dddd":
this.bh = c[e];
break;
default:
this.bh = "dd";
break;
}
}
else if (stringContains(c[e], "m")) {
d += "m";
switch (c[e]) {
case "m":
this.bl = c[e];
break;
case "mm":
this.bl = c[e];
break;
case "mmm":
this.bl = c[e];
break;
case "mmmm":
this.bl = c[e];
break;
default:
this.bl = "mm";
break;
}
this.bl = c[e];
}
else if (stringContains(c[e], "y")) {
d += "y";
switch (c[e]) {
case "yy":
this.bo = c[e];
break;
case "yyyy":
this.bo = c[e];
break;
default:
this.bo = "yyyy";
break;
}
}
}
if (d == "dmy" || d == "mdy" || d == "ymd") {
this.bi = d;
}
else {
this.bi = "mdy";
}
}
};
XDatePicker.prototype.dq = function () {
if (this.o != null) {
this.o.d8 = this.dy;
}
if (this.m != null) {
this.m.fill = this.dw;
}
if (this.n != null) {
this.n.fill = this.dw;
}
if (this.r != null) {
this.r.dj = this.dx;
this.r.y = this.ac;
}
};
XDatePicker.prototype.dl = function () {
if (this.q != null) {
}
};
XDatePicker.prototype.dp = function () {
if (this.aa != null) {
this.o.af = this.aa;
}
};
XDatePicker.prototype.cs = function () {
this.q = new XInputGroup();
this.h.aq(this.q);
this.q.d = 0;
this.q.p = this.w;
this.q.t = this.y;
this.r = new XLabel();
this.h.as(this.r);
this.r.dj = this.dx;
this.r.y = this.ac;
this.q.appendContentChild(this.h.v());
if (this.b4 != null && this.b4 != "") {
this.r.text = this.b4;
this.q.inputs.add(this.r);
}
this.o = new XInput();
this.h.ar(this.o);
this.o.b8 = "text";
if (this.aa != null) {
this.o.af = this.aa;
}
this.o.disabled = this.az();
this.o.d8 = this.dy;
this.q.appendContentChild(this.h.u());
this.q.inputs.add(this.o);
this.o.cg = this.cc;
this.h.ay(this.cc);
var a = this.o;
a.change = delegateCombine(a.change, runOn(this, this.cz));
var b = this.o;
b.changing = delegateCombine(b.changing, runOn(this, this.c0));
var c = this.o;
c.keyDown = delegateCombine(c.keyDown, runOn(this, this.c1));
var d = new XSuffix();
this.h.au(d, this.h.r());
this.m = new XIcon();
this.h.ap(this.m, this.h.q());
this.m.svgPath = XDatePicker.bs;
this.m.fill = this.dw;
d.appendContentChild(this.h.q());
this.q.appendContentChild(this.h.r());
this.q.inputs.add(d);
this.dm();
var e = new XSuffix();
this.h.au(e, this.h.t());
this.n = new XIcon();
this.h.ap(this.n, this.h.s());
this.n.svgPath = XDatePicker.br;
this.n.fill = this.dw;
e.appendContentChild(this.h.s());
this.q.appendContentChild(this.h.t());
this.q.inputs.add(e);
};
XDatePicker.prototype.c1 = function (a, b) {
this.c7(b);
if (b.defaultPrevented) {
return;
}
var c = b.keyCode;
var d = b.modifiers;
switch (c) {
case 9:
this.ar = true;
if (!this.at) {
this.ds(this.o.cq);
}
this.ah = true;
this.cr();
this.ar = false;
break;
case 13:
this.ar = true;
if (!this.at) {
this.ds(this.o.cq);
}
this.ah = true;
this.cr();
this.ar = false;
break;
case 40:
if (d == 1) {
this.dd();
this.cw();
}
break;
case 38:
if (d == 1) {
this.cr();
}
break;
}
};
XDatePicker.prototype.c0 = function (a, b) {
this.c3(b);
if (b.value.length > 0) {
this.h.av();
}
else {
this.h.ah();
}
};
XDatePicker.prototype.cz = function (a, b) {
this.at = true;
this.ds(b.value);
this.at = false;
};
XDatePicker.prototype.ds = function (a) {
var b = ['/', '-', ' ', '.', ','];
var c = stringSplit(a, b, 1);
var d = 0;
var e = 0;
var f = 0;
var g = true;
if (c.length == 3) {
if (c[0].length == 0 || c[1].length == 0 || c[2].length == 0) {
g = false;
}
if (this.bi == "dmy") {
d = parseInt(c[0]);
e = parseInt(c[1]);
f = parseInt(c[2]);
}
else if (this.bi == "mdy") {
e = parseInt(c[0]);
d = parseInt(c[1]);
f = parseInt(c[2]);
}
else if (this.bi == "ymd") {
f = parseInt(c[0]);
e = parseInt(c[1]);
d = parseInt(c[2]);
}
if (isNaN_(d) || isNaN_(f)) {
g = false;
}
if (f < 50) {
f = f + 2000;
}
if (isNaN_(e)) {
var h = "";
if (this.bi == "dmy") {
h = c[1].toLowerCase();
}
else if (this.bi == "mdy") {
h = c[0].toLowerCase();
}
else if (this.bi == "ymd") {
h = c[1].toLowerCase();
}
var i = !stringIsNullOrWhiteSpace(this.af.b1("January_Full")) ? this.af.b1("January_Full").toLowerCase() : "january";
var j = !stringIsNullOrWhiteSpace(this.af.b1("January_Short")) ? this.af.b1("January_Short").toLowerCase() : "jan";
var k = !stringIsNullOrWhiteSpace(this.af.b1("February_Full")) ? this.af.b1("February_Full").toLowerCase() : "february";
var l = !stringIsNullOrWhiteSpace(this.af.b1("February_Short")) ? this.af.b1("February_Short").toLowerCase() : "feb";
var m = !stringIsNullOrWhiteSpace(this.af.b1("March_Full")) ? this.af.b1("March_Full").toLowerCase() : "march";
var n = !stringIsNullOrWhiteSpace(this.af.b1("March_Short")) ? this.af.b1("March_Short").toLowerCase() : "mar";
var o = !stringIsNullOrWhiteSpace(this.af.b1("April_Full")) ? this.af.b1("April_Full").toLowerCase() : "april";
var p = !stringIsNullOrWhiteSpace(this.af.b1("April_Short")) ? this.af.b1("April_Short").toLowerCase() : "apr";
var q = !stringIsNullOrWhiteSpace(this.af.b1("May_Full")) ? this.af.b1("May_Full").toLowerCase() : "may";
var r = !stringIsNullOrWhiteSpace(this.af.b1("May_Short")) ? this.af.b1("May_Short").toLowerCase() : "may";
var s = !stringIsNullOrWhiteSpace(this.af.b1("June_Full")) ? this.af.b1("June_Full").toLowerCase() : "june";
var t = !stringIsNullOrWhiteSpace(this.af.b1("June_Short")) ? this.af.b1("June_Short").toLowerCase() : "jun";
var u = !stringIsNullOrWhiteSpace(this.af.b1("July_Full")) ? this.af.b1("July_Full").toLowerCase() : "july";
var v = !stringIsNullOrWhiteSpace(this.af.b1("July_Short")) ? this.af.b1("July_Short").toLowerCase() : "jul";
var w = !stringIsNullOrWhiteSpace(this.af.b1("August_Full")) ? this.af.b1("August_Full").toLowerCase() : "august";
var x = !stringIsNullOrWhiteSpace(this.af.b1("August_Short")) ? this.af.b1("August_Short").toLowerCase() : "aug";
var y = !stringIsNullOrWhiteSpace(this.af.b1("September_Full")) ? this.af.b1("September_Full").toLowerCase() : "september";
var z = !stringIsNullOrWhiteSpace(this.af.b1("September_Short")) ? this.af.b1("September_Short").toLowerCase() : "sep";
var aa = !stringIsNullOrWhiteSpace(this.af.b1("October_Full")) ? this.af.b1("October_Full").toLowerCase() : "october";
var ab = !stringIsNullOrWhiteSpace(this.af.b1("October_Short")) ? this.af.b1("October_Short").toLowerCase() : "oct";
var ac = !stringIsNullOrWhiteSpace(this.af.b1("November_Full")) ? this.af.b1("November_Full").toLowerCase() : "november";
var ad = !stringIsNullOrWhiteSpace(this.af.b1("November_Short")) ? this.af.b1("November_Short").toLowerCase() : "nov";
var ae = !stringIsNullOrWhiteSpace(this.af.b1("December_Full")) ? this.af.b1("December_Full").toLowerCase() : "december";
var af = !stringIsNullOrWhiteSpace(this.af.b1("December_Short")) ? this.af.b1("December_Short").toLowerCase() : "dec";
if (h == i || h == j) {
e = 1;
}
else if (h == k || h == l) {
e = 2;
}
else if (h == m || h == n) {
e = 3;
}
else if (h == o || h == p) {
e = 4;
}
else if (h == q || h == r) {
e = 5;
}
else if (h == s || h == t) {
e = 6;
}
else if (h == u || h == v) {
e = 7;
}
else if (h == w || h == x) {
e = 8;
}
else if (h == y || h == z) {
e = 9;
}
else if (h == aa || h == ab) {
e = 10;
}
else if (h == ac || h == ad) {
e = 11;
}
else if (h == ae || h == af) {
e = 12;
}
else {
g = false;
}
}
if (e > 12 || e < 1) {
g = false;
}
}
else {
g = false;
}
if (g) {
var ag = dateFromValues(f, e, d, 0, 0, 0, 0);
var ah = Base.compareSimple(ag, this.ba);
var ai = Base.compareSimple(ag, this.a9);
if (ah < 0 || ai > 0) {
this.dm();
}
else {
this.dr(ag);
this.h.av();
}
}
else {
if (stringIsNullOrEmpty(a)) {
this.cq();
}
else {
this.dm();
}
}
};
XDatePicker.prototype.dr = function (a) {
var b = this.value;
this.value = a;
};
XDatePicker.prototype.dm = function () {
if (this.o != null) {
if (+(dateGetDate(this.a8)) != +(dateGetDate(dateMinValue()))) {
var a = "";
if (this.bz == null) {
a = this.a.i(this.value);
}
else {
var b = this.value.getDate().toString();
var c = b;
if (this.bh == "dd") {
if (this.value.getDate() < 10) {
b = "0" + b;
}
}
else if (this.bh == "ddd") {
switch (this.value.getDay()) {
case 0:
b = !stringIsNullOrWhiteSpace(this.af.b1("Sunday_Short")) ? this.af.b1("Sunday_Short") : "Sun";
break;
case 1:
b = !stringIsNullOrWhiteSpace(this.af.b1("Monday_Short")) ? this.af.b1("Monday_Short") : "Mon";
break;
case 2:
b = !stringIsNullOrWhiteSpace(this.af.b1("Tuesday_Short")) ? this.af.b1("Tuesday_Short") : "Tue";
break;
case 3:
b = !stringIsNullOrWhiteSpace(this.af.b1("Wednesday_Short")) ? this.af.b1("Wednesday_Short") : "Wed";
break;
case 4:
b = !stringIsNullOrWhiteSpace(this.af.b1("Thursday_Short")) ? this.af.b1("Thursday_Short") : "Thu";
break;
case 5:
b = !stringIsNullOrWhiteSpace(this.af.b1("Friday_Short")) ? this.af.b1("Friday_Short") : "Fri";
break;
case 6:
b = !stringIsNullOrWhiteSpace(this.af.b1("Saturday_Short")) ? this.af.b1("Saturday_Short") : "Sat";
break;
}
}
else if (this.bh == "dddd") {
switch (this.value.getDay()) {
case 0:
b = !stringIsNullOrWhiteSpace(this.af.b1("Sunday_Full")) ? this.af.b1("Sunday_Full") : "Sunday";
break;
case 1:
b = !stringIsNullOrWhiteSpace(this.af.b1("Monday_Full")) ? this.af.b1("Monday_Full") : "Monday";
break;
case 2:
b = !stringIsNullOrWhiteSpace(this.af.b1("Tuesday_Full")) ? this.af.b1("Tuesday_Full") : "Tuesday";
break;
case 3:
b = !stringIsNullOrWhiteSpace(this.af.b1("Wednesday_Full")) ? this.af.b1("Wednesday_Full") : "Wednesday";
break;
case 4:
b = !stringIsNullOrWhiteSpace(this.af.b1("Thursday_Full")) ? this.af.b1("Thursday_Full") : "Thursday";
break;
case 5:
b = !stringIsNullOrWhiteSpace(this.af.b1("Friday_Full")) ? this.af.b1("Friday_Full") : "Friday";
break;
case 6:
b = !stringIsNullOrWhiteSpace(this.af.b1("Saturday_Full")) ? this.af.b1("Saturday_Full") : "Saturday";
break;
}
}
var d = dateGetMonth(this.value).toString();
if (this.bl == "mm") {
if (dateGetMonth(this.value) < 10) {
d = "0" + d;
}
}
else if (this.bl == "mmm") {
switch (dateGetMonth(this.value)) {
case 1:
d = !stringIsNullOrWhiteSpace(this.af.b1("January_Short")) ? this.af.b1("January_Short") : "Jan";
break;
case 2:
d = !stringIsNullOrWhiteSpace(this.af.b1("February_Short")) ? this.af.b1("February_Short") : "Feb