igniteui-react-inputs
Version:
Ignite UI React input components.
1,319 lines (1,318 loc) • 104 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, Number_$type } from "igniteui-react-core";
import { DomWrapper_$type } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { DayOfWeek_$type } from "./DayOfWeek";
import { DayInfo } from "./DayInfo";
import { XButton } from "./XButton";
import { XIcon } from "./XIcon";
import { truncate, intDivide, isNaN_ } from "igniteui-react-core";
import { dateMinValue, dateGetMonth, dateNow, dateAddYears, dateFromValues, dateMaxValue, dateGetDate, dateAddDays, dateAddMonths } from "igniteui-react-core";
import { parseBool } 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 { FirstWeek_$type } from "./FirstWeek";
import { BrushUtil } from "igniteui-react-core";
import { ObservableCollection$1 } from "igniteui-react-core";
import { SelectedValueChangedEventArgs } from "./SelectedValueChangedEventArgs";
import { CornerRadius } from "igniteui-react-core";
import { CalendarVisualModelExport } from "./CalendarVisualModelExport";
import { ButtonVisualModelExport } from "./ButtonVisualModelExport";
import { TextElementsVisualModelExport } from "./TextElementsVisualModelExport";
import { AppearanceHelper } from "igniteui-react-core";
import { NativeUI } from "igniteui-react-core";
import { FontUtil } from "igniteui-react-core";
import { stringIsNullOrWhiteSpace } from "igniteui-react-core";
import { timeSpanTotalDays } from "igniteui-react-core";
/**
* @hidden
*/
var CalendarView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(CalendarView, _super);
function CalendarView() {
var _this = _super.call(this) || this;
_this.n = null;
_this.o = null;
_this.t = null;
_this.q = null;
_this.u = null;
_this.s = null;
_this.r = null;
_this.g = new List$1(DomWrapper_$type, 0);
_this.f = new List$1(DomWrapper_$type, 0);
_this.h = new List$1(DomWrapper_$type, 0);
_this.j = new List$1(DomWrapper_$type, 0);
_this.i = new List$1(DomWrapper_$type, 0);
_this.e = new List$1(DomWrapper_$type, 0);
_this.p = null;
_this.x = null;
_this.w = 0;
_this.c = null;
_this.m = null;
_this.x = "day";
_this.p = null;
return _this;
}
CalendarView.prototype.k = function () {
return this.e;
};
CalendarView.prototype.l = function () {
return this.i;
};
CalendarView.prototype.ap = function () {
};
CalendarView.prototype.ao = function (a) {
if (a == null) {
this.m = null;
return;
}
this.m = a;
this.m.rootWrapper.setStyleProperty("background-color", "rgb(255, 255, 255)");
var b = Math.round(a.rootWrapper.width());
var c = Math.round(a.rootWrapper.height());
this.ab();
this.a3();
this.a4();
this.a1();
var d = this.m.rootWrapper;
d.listen("keydown", runOn(this, this.aa));
d.listen("focus", runOn(this, this.z));
};
CalendarView.prototype.y = function () {
return this.x;
};
CalendarView.prototype.ab = function () {
if (this.m != null) {
this.n = this.m.createElement("div");
this.n.setStyleProperty("display", "flex");
this.n.setStyleProperty("width", "100%");
this.n.setStyleProperty("height", "100%");
this.o = this.m.createElement("div");
this.o.setStyleProperty("height", "100%");
this.o.setStyleProperty("width", "100%");
this.t = this.m.createElement("div");
this.ae();
this.n.append(this.o);
this.m.append(this.n);
for (var a = 0; a < 42; a++) {
var b = this.m.createElement("div");
this.f.add(b);
}
this.ac();
this.a9();
this.q = this.m.createElement("div");
this.q.setStyleProperty("height", "100%");
this.m.append(this.q);
for (var c = 0; c < 12; c++) {
var d = this.m.createElement("div");
this.h.add(d);
}
this.ad();
for (var e = 0; e < 12; e++) {
var f = this.q.getChildAt(e);
f.listen("click", runOn(this, this.aj));
}
this.q.hide();
this.u = this.m.createElement("div");
this.u.setStyleProperty("height", "100%");
this.m.append(this.u);
for (var g = 0; g < 7; g++) {
var h = this.m.createElement("div");
this.j.add(h);
}
this.af();
for (var i = 0; i < 7; i++) {
var j = this.u.getChildAt(i);
j.listen("click", runOn(this, this.be));
}
this.u.listen("wheel", runOn(this, this.bh));
this.u.listen("touchstart", runOn(this, this.bg));
this.u.listen("touchmove", runOn(this, this.bf));
this.u.hide();
}
};
CalendarView.prototype.ae = function () {
if (this.m != null) {
this.t.setStyleProperty("display", "flex");
this.t.setStyleProperty("flex-direction", "column");
this.t.setStyleProperty("padding-top", "26px");
this.t.setStyleProperty("width", "12%");
var a = this.c.ag();
for (var b = 0; b < 6; b++) {
var c = this.m.createElement("div");
c.setAttribute("aria-hidden", "true");
c.setStyleProperty("text-align", "center");
c.setStyleProperty("vertical-align", "middle");
c.setStyleProperty("height", "30px");
c.setStyleProperty("width", "25px");
c.setStyleProperty("border-width", "0px 1px 0px 0px");
c.setStyleProperty("border-style", "solid");
c.setStyleProperty("border-color", "rgb(163, 172, 184)");
var d = this.m.createElement("span");
d.setAttribute("aria-hidden", "true");
d.setStyleProperty("font", "14px Verdana");
d.setStyleProperty("color", "rgb(24, 29, 31)");
c.append(d);
this.i.add(d);
d.setText(a._inner[b].toString());
this.t.append(c);
}
}
};
CalendarView.prototype.a5 = function () {
if (this.t != null) {
var a = this.c.ag();
this.i.clear();
for (var b = 0; b < 6; b++) {
var c = this.t.getChildAt(b);
var d = c.getChildAt(0);
d.setText(a._inner[b].toString());
this.i.add(d);
}
}
};
CalendarView.prototype.a9 = function () {
if (this.t != null) {
if (this.c.af == true) {
this.t.show();
this.t.setStyleProperty("width", "12%");
this.t.parent().setStyleProperty("max-width", "245px");
this.t.parent().getChildAt(1).setStyleProperty("width", "88%");
}
else {
this.t.hide();
this.t.parent().setStyleProperty("max-width", "231px");
this.t.parent().getChildAt(1).setStyleProperty("width", "100%");
}
}
};
CalendarView.prototype.ac = function () {
if (this.m != null) {
this.o.setStyleProperty("display", "flex");
this.o.setStyleProperty("flex-direction", "column");
this.o.setStyleProperty("justify-content", "space-evenly");
var a = this.m.createElement("div");
a.setStyleProperty("display", "flex");
a.setStyleProperty("justify-content", "space-evenly");
a.setStyleProperty("width", "100%");
a.setAttribute("role", "row");
var b = this.m.createElement("div");
b.setStyleProperty("width", "15%");
var c = this.m.createElement("div");
c.setStyleProperty("width", "20%");
var d = this.m.createElement("div");
d.setStyleProperty("width", "20%");
var e = this.m.createElement("div");
e.setStyleProperty("width", "15%");
a.append(b);
a.append(c);
a.append(d);
a.append(e);
this.o.append(a);
var f = this.m.createElement("div");
f.setStyleProperty("width", "100%");
f.setStyleProperty("height", "100%");
f.setStyleProperty("display", "flex");
f.setStyleProperty("flex-direction", "row");
f.setStyleProperty("justify-content", "space-evenly");
this.t.setStyleProperty("padding-bottom", "6px");
f.append(this.t);
var g = this.m.createElement("div");
g.setStyleProperty("display", "flex");
g.setStyleProperty("flex-direction", "column");
g.setStyleProperty("width", "88%");
g.setAttribute("role", "grid");
g.setAttribute("aria-readonly", "true");
f.append(g);
this.o.append(f);
var h = 0;
for (var i = 0; i < 7; i++) {
var j = this.m.createElement("div");
j.setAttribute("role", "row");
j.setStyleProperty("display", "flex");
j.setStyleProperty("justify-content", "space-evenly");
if (i == 0) {
for (var k = 0; k < 7; k++) {
var l = this.m.createElement("div");
l.setAttribute("role", "columnheader");
l.setAttribute("scope", "col");
l.setStyleProperty("text-align", "center");
l.setStyleProperty("vertical-align", "middle");
l.setStyleProperty("width", "12%");
var m = this.m.createElement("span");
m.setStyleProperty("font", "16px Verdana");
m.setStyleProperty("color", "rgb(24, 29, 31)");
l.append(m);
this.e.add(m);
j.append(l);
}
g.append(j);
}
else {
for (var n = 0; n < 7; n++) {
var o = this.m.createElement("div");
o.setAttribute("role", "gridcell");
o.setStyleProperty("justify-content", "center");
var p = this.f._inner[h];
var q = this.m.createElement("span");
q.setAttribute("aria-hidden", "true");
p.append(q);
this.ag(o, p, h);
p.parent().setStyleProperty("max-height", "30px");
p.parent().setStyleProperty("display", "flex");
o.setStyleProperty("width", "12%");
o.setStyleProperty("height", "100%");
j.append(o);
h++;
}
g.append(j);
}
}
this.s = this.m.createElement("div");
this.s.setStyleProperty("display", "flex");
this.s.setStyleProperty("padding-bottom", "4px");
var r = this.m.createElement("div");
r.setStyleProperty("width", "100%");
r.setStyleProperty("justify-content", "center");
this.r = this.m.createElement("div");
this.r.setAttribute("aria-hidden", "true");
var s = this.m.createElement("span");
s.setAttribute("aria-hidden", "true");
this.r.append(s);
this.c.cm(r, this.r);
this.r.parent().setAttribute("aria-hidden", "true");
this.r.parent().parent().setAttribute("tabindex", "-1");
this.r.parent().parent().setAttribute("aria-readonly", "true");
this.r.parent().parent().setAttribute("aria-selected", "false");
this.r.parent().parent().setAttribute("aria-disabled", "false");
this.r.parent().parent().setAttribute("data-is-focusable", "true");
this.s.append(r);
this.o.append(this.s);
this.a8();
this.c.cf();
}
};
CalendarView.prototype.ad = function () {
if (this.m != null) {
this.q.setStyleProperty("display", "flex");
this.q.setStyleProperty("flex-direction", "row");
this.q.setStyleProperty("flex-wrap", "wrap");
this.q.setStyleProperty("margin", "2px");
this.q.setStyleProperty("justify-content", "center");
this.q.setStyleProperty("width", "100%");
this.q.setStyleProperty("height", "100%");
this.q.setAttribute("role", "grid");
this.q.setAttribute("aria-readonly", "true");
for (var a = 0; a < 12; a++) {
var b = this.m.createElement("div");
b.setStyleProperty("margin", "5px");
b.setAttribute("data-month", (a + 1).toString());
var c = this.h._inner[a];
c.setAttribute("aria-hidden", "true");
this.c.cl(b, c);
b.setStyleProperty("width", "28%");
var d = b.getChildAt(0);
d.setStyleProperty("width", "100%");
var e = this.m.createElement("span");
e.setAttribute("aria-hidden", "true");
var f = void 0;
var g = a + 1;
f = this.c.e(g, a);
c.parent().parent().setAttribute("aria-label", f[0]);
e.setText(f[1]);
c.append(e);
c.parent().setAttribute("aria-hidden", "true");
c.parent().parent().setAttribute("tabindex", "-1");
c.parent().parent().setAttribute("aria-readonly", "true");
c.parent().parent().setAttribute("aria-selected", "false");
c.parent().parent().setAttribute("aria-disabled", "false");
c.parent().parent().setAttribute("data-is-focusable", "true");
c.setAttribute("data-index", a.toString());
this.q.append(b);
}
}
};
CalendarView.prototype.bd = function () {
for (var a = 0; a < 12; a++) {
var b = this.h._inner[a];
var c = void 0;
var d = a + 1;
c = this.c.e(d, a);
b.parent().parent().setAttribute("aria-label", c[0]);
var e = b.getChildAt(0);
e.setText(c[1]);
}
};
CalendarView.prototype.af = function () {
if (this.m != null) {
this.u.setStyleProperty("width", "100%");
this.u.setStyleProperty("height", "100%");
var a = this.c.aq.getFullYear() - 3;
this.u.setStyleProperty("padding", "5px");
this.u.setAttribute("role", "grid");
this.u.setAttribute("aria-readonly", "true");
for (var b = 0; b < 7; b++) {
var c = this.m.createElement("div");
var d = this.j._inner[b];
d.setAttribute("aria-hidden", "true");
this.c.cn(c, d, b);
d.parent().setAttribute("aria-hidden", "true");
d.parent().parent().setAttribute("tabindex", "-1");
d.parent().parent().setAttribute("aria-readonly", "true");
d.parent().parent().setAttribute("aria-selected", "false");
d.parent().parent().setAttribute("aria-disabled", "false");
d.parent().parent().setAttribute("data-is-focusable", "true");
c.setStyleProperty("width", "100%");
c.setStyleProperty("height", "14%");
c.setStyleProperty("justify-content", "center");
var e = c.getChildAt(0);
e.setStyleProperty("width", "98%");
var f = this.m.createElement("span");
f.setAttribute("aria-hidden", "true");
f.setText(a.toString());
a++;
d.setAttribute("data-index", b.toString());
d.append(f);
this.u.append(c);
}
}
};
CalendarView.prototype.a8 = function () {
if (this.m != null) {
if (this.c.ae == true) {
this.s.setStyleProperty("display", "flex");
}
else {
this.s.setStyleProperty("display", "none");
}
}
};
CalendarView.prototype.a3 = function () {
if (this.m != null) {
var a = this.o.getChildAt(0);
for (var b = 0; b < 4; b++) {
var c = this.m.createElement("div");
this.g.add(c);
}
var d = a.getChildAt(0);
var e = this.g._inner[0];
var f = this.m.createElement("div");
f.setAttribute("aria-hidden", "true");
e.append(f);
this.c.ck(d, f, e, "prev");
e.parent().parent().setAttribute("aria-label", "Previous Month");
e.parent().setStyleProperty("max-height", "30px");
e.parent().setStyleProperty("display", "flex");
e.setAttribute("data-index", "0");
this.aw(e);
var g = a.getChildAt(1);
var h = this.g._inner[1];
var i = this.m.createElement("span");
i.setAttribute("aria-hidden", "true");
h.append(i);
this.c.cj(g, h, "month");
i = h.getChildAt(0);
var j = this.c.bx();
i.setText(j);
h.parent().parent().setAttribute("aria-label", "Select Month");
h.parent().setStyleProperty("min-width", "40px");
h.parent().setStyleProperty("max-height", "30px");
h.parent().setStyleProperty("display", "flex");
h.setAttribute("data-index", "1");
this.aw(h);
var k = a.getChildAt(2);
var l = this.g._inner[2];
var m = this.m.createElement("span");
m.setAttribute("aria-hidden", "true");
l.append(m);
this.c.cj(k, l, "year");
m = this.g._inner[2].getChildAt(0);
var n = this.c.by();
m.setText(n);
l.parent().parent().setAttribute("aria-label", "Select Year");
l.parent().setStyleProperty("min-width", "40px");
l.parent().setStyleProperty("max-height", "30px");
l.parent().setStyleProperty("display", "flex");
l.setAttribute("data-index", "2");
this.aw(l);
var o = a.getChildAt(3);
var p = this.g._inner[3];
var q = this.m.createElement("div");
q.setAttribute("aria-hidden", "true");
p.append(q);
this.c.ck(o, q, p, "next");
p.parent().parent().setAttribute("aria-label", "Next Month");
p.parent().setStyleProperty("max-height", "30px");
p.parent().setStyleProperty("display", "flex");
p.setAttribute("data-index", "3");
this.aw(p);
var r = this.c.a();
for (var s = 0; s < this.g.count; s++) {
if (r[s] == true) {
this.g._inner[s].setAttribute("data-disabled", "true");
}
else {
this.g._inner[s].setAttribute("data-disabled", "false");
}
}
d.listen("click", runOn(this, this.aq));
o.listen("click", runOn(this, this.al));
g.listen("click", runOn(this, this.ak));
k.listen("click", runOn(this, this.bi));
}
};
CalendarView.prototype.bc = function () {
var a = this.g._inner[1];
var b = a.getChildAt(0);
var c = this.c.bx();
b.setText(c);
};
CalendarView.prototype.aw = function (a) {
a.setAttribute("aria-hidden", "true");
a.parent().setAttribute("aria-hidden", "true");
a.parent().parent().setAttribute("tabindex", "-1");
a.parent().parent().setAttribute("aria-readonly", "true");
a.parent().parent().setAttribute("aria-selected", "false");
a.parent().parent().setAttribute("aria-disabled", "false");
a.parent().parent().setAttribute("data-is-focusable", "true");
a.setAttribute("data-section", "header");
a.setAttribute("data-disabled", "false");
};
CalendarView.prototype.a4 = function () {
if (this.m != null) {
var a = this.o.getChildAt(1).getChildAt(1).getChildAt(0);
var b = new List$1(DayOfWeek_$type, 0);
switch (this.c.l) {
case 0:
b.add(0);
b.add(1);
b.add(2);
b.add(3);
b.add(4);
b.add(5);
b.add(6);
break;
case 1:
b.add(1);
b.add(2);
b.add(3);
b.add(4);
b.add(5);
b.add(6);
b.add(0);
break;
case 2:
b.add(2);
b.add(3);
b.add(4);
b.add(5);
b.add(6);
b.add(0);
b.add(1);
break;
case 3:
b.add(3);
b.add(4);
b.add(5);
b.add(6);
b.add(0);
b.add(1);
b.add(2);
break;
case 4:
b.add(4);
b.add(5);
b.add(6);
b.add(0);
b.add(1);
b.add(2);
b.add(3);
break;
case 5:
b.add(5);
b.add(6);
b.add(0);
b.add(1);
b.add(2);
b.add(3);
b.add(4);
break;
case 6:
b.add(6);
b.add(0);
b.add(1);
b.add(2);
b.add(3);
b.add(4);
b.add(5);
break;
}
this.e.clear();
for (var c = 0; c < b.count; c++) {
var d = a.getChildAt(c);
var e = d.getChildAt(0);
var f = this.c.d(b._inner[c]);
d.setAttribute("title", f[0]);
d.setAttribute("aria-label", f[0]);
e.setText(f[1]);
this.e.add(e);
}
}
};
CalendarView.prototype.a1 = function () {
if (this.m != null) {
this.a2();
this.a5();
var a = this.o.getChildAt(1);
var b = a.getChildAt(1);
for (var c = 1; c < 7; c++) {
var d = b.getChildAt(c);
for (var e = 0; e < 7; e++) {
var f = d.getChildAt(e);
f.listen("click", runOn(this, this.ah));
}
}
}
};
CalendarView.prototype.a2 = function (a, b) {
if (a === void 0) {
a = false;
}
if (b === void 0) {
b = false;
}
if (this.m != null) {
var c = null;
var d = null;
var e = null;
var f = this.c.value;
var g = this.c.aq;
var h = this.c.av;
for (var i = 0; i < 42; i++) {
var j = this.f._inner[i];
var k = j.getChildAt(0);
var l = this.c.j(i);
if (l != null) {
j.parent().parent().setAttribute("aria-label", l.c.toString() + "/" + l.b.toString() + "/" + l.d.toString());
j.setAttribute("data-section", "days");
j.setAttribute("data-index", i.toString());
j.setAttribute("data-date", l.b.toString() + "/" + l.c.toString() + "/" + l.d.toString());
j.setAttribute("data-selected", "false");
j.setAttribute("data-disabled", "false");
j.setAttribute("data-today", "false");
k.setText(l.b.toString());
if (+f != +(dateMinValue()) && l.b == f.getDate() && l.c == dateGetMonth(f) && l.d == f.getFullYear()) {
c = j;
j.parent().parent().setAttribute("aria-selected", "true");
j.setAttribute("data-selected", "true");
}
else if (l.b == h.getDate() && l.c == dateGetMonth(h) && l.d == h.getFullYear()) {
d = j;
j.setAttribute("data-today", "true");
}
var m = this.c.ad(i);
if (m) {
j.setAttribute("data-disabled", "true");
}
if (l.b == 1 && l.c == dateGetMonth(g)) {
e = j;
}
}
}
if (a == true) {
if (c != null && +f != +(dateMinValue()) && f.getFullYear() == g.getFullYear() && dateGetMonth(f) == dateGetMonth(g)) {
this.d(c);
}
else if (d != null && h.getFullYear() == g.getFullYear() && dateGetMonth(h) == dateGetMonth(g)) {
this.d(d);
}
else if (e != null) {
if (b == true) {
for (var n = 41; n >= 0; n--) {
var o = this.c.j(n);
if (o.c == dateGetMonth(g)) {
var p = this.f._inner[n];
var q = p.getAttribute("data-disabled");
if (q == "false") {
e = this.f._inner[n];
break;
}
}
}
}
else {
for (var r = 0; r < 42; r++) {
var s = this.c.j(r);
if (s.c == dateGetMonth(g)) {
var t = this.f._inner[r];
var u = t.getAttribute("data-disabled");
if (u == "false") {
e = this.f._inner[r];
break;
}
}
}
}
this.d(e);
}
}
}
};
CalendarView.prototype.ag = function (a, b, c) {
if (this.m != null) {
b.setAttribute("aria-hidden", "true");
var d = this.m.createElement("span");
d.setAttribute("aria-hidden", "true");
b.append(d);
this.c.ci(a, b, c);
b.parent().setAttribute("aria-hidden", "true");
b.parent().parent().setAttribute("tabindex", "-1");
b.parent().parent().setAttribute("aria-readonly", "true");
b.parent().parent().setAttribute("aria-selected", "false");
b.parent().parent().setAttribute("aria-disabled", "false");
b.parent().parent().setAttribute("data-is-focusable", "true");
}
};
CalendarView.prototype.at = function (a, b) {
if (this.m != null) {
var c = this.m.getSubRenderer(a);
b.provideContainer(c);
var d = c.getExternal(b, c.rootWrapper, c.getExternal(this.c, null, null));
}
};
CalendarView.prototype.a0 = function (a) {
var b = this.r.getChildAt(0);
b.setText(a);
this.r.parent().parent().setAttribute("aria-label", a);
};
CalendarView.prototype.ax = function (a, b) {
if (this.m != null) {
var c = this.m.getSubRenderer(a);
b.provideContainer(c);
var d = c.getExternal(b, c.rootWrapper, c.getExternal(this.c, null, null));
}
};
CalendarView.prototype.az = function () {
if (this.m != null) {
var a = this.g._inner[1].getChildAt(0);
var b = this.c.bx();
a.setText(b);
var c = this.g._inner[2].getChildAt(0);
var d = this.c.by();
c.setText(d);
}
};
CalendarView.prototype.au = function (a, b) {
if (a === void 0) {
a = false;
}
if (b === void 0) {
b = false;
}
if (this.m != null) {
this.a2(a, b);
this.a5();
var c = this.c.a();
for (var d = 0; d < this.g.count; d++) {
if (c[d] == true) {
this.g._inner[d].setAttribute("data-disabled", "true");
}
else {
this.g._inner[d].setAttribute("data-disabled", "false");
}
}
}
};
CalendarView.prototype.ay = function () {
if (this.m != null) {
if (this.h.count != 0) {
var a = null;
var b = null;
var c = 0;
var d = 0;
var e = 0;
for (var f = 0; f < 12; f++) {
var g = this.h._inner[f];
g.setAttribute("data-section", "months");
g.setAttribute("data-disabled", "false");
g.parent().parent().setAttribute("aria-selected", "false");
var h = f + 1;
var i = this.c.value;
var j = this.c.av;
if (+i != +(dateMinValue()) && dateGetMonth(i) == h) {
b = g;
c = f;
g.parent().parent().setAttribute("aria-selected", "true");
}
if (dateGetMonth(j) == h) {
a = g;
d = f;
}
var k = this.c.aa(f, h);
if (k) {
g.setAttribute("data-disabled", "true");
}
}
for (var l = 0; l < this.h.count; l++) {
var m = this.h._inner[l];
var n = m.getAttribute("data-disabled");
if (n == "false") {
e = l;
break;
}
}
var o = this.h._inner[c].getAttribute("data-disabled");
var p = this.h._inner[d].getAttribute("data-disabled");
var q = this.h._inner[e].getAttribute("data-disabled");
if (b != null && o == "false") {
this.d(b);
}
else if (a != null && p == "false") {
this.d(a);
}
else if (q == "false") {
this.d(this.h._inner[e]);
}
else {
this.as();
}
}
}
};
CalendarView.prototype.a7 = function () {
if (this.m != null) {
if (this.j.count != 0) {
var a = this.c.aq.getFullYear();
var b = true;
this.a6(a, b);
}
}
};
CalendarView.prototype.a6 = function (a, b) {
if (b === void 0) {
b = false;
}
if (a < this.c.au.getFullYear()) {
a = this.c.au.getFullYear();
}
if (a > this.c.at.getFullYear()) {
a = this.c.at.getFullYear();
}
var c = a - 3;
var d = false;
for (var e = 0; e < 7; e++) {
var f = this.j._inner[e];
f.setAttribute("data-section", "years");
f.setAttribute("data-disabled", "false");
f.parent().parent().setAttribute("aria-selected", "false");
var g = this.c.ab(e, c);
f.setAttribute("data-disabled", g.toString());
var h = f.getChildAt(0);
h.setText(c.toString());
f.parent().parent().setAttribute("aria-label", c.toString());
if (c == a && b) {
if (g == false) {
f.parent().parent().setAttribute("aria-selected", "true");
d = true;
this.d(f);
}
}
c++;
}
if (d == false) {
var i = this.j._inner[3].getAttribute("data-disabled");
if (i == "false") {
var j = this.j._inner[3];
this.d(j);
}
}
};
CalendarView.prototype.as = function (a) {
if (a === void 0) {
a = false;
}
this.au();
this.az();
this.x = "day";
this.n.show();
this.n.setStyleProperty("display", "flex");
this.q.hide();
this.u.hide();
this.av(a);
this.ai();
};
CalendarView.prototype.av = function (a) {
if (a === void 0) {
a = false;
}
var b = null;
var c = null;
var d = null;
for (var e = 0; e < this.f.count; e++) {
var f = this.f._inner[e];
var g = parseBool(f.getAttribute("data-disabled").toString());
var h = f.getAttribute("data-date").toString().split('/');
var i = h[1];
var j = parseBool(f.getAttribute("data-selected").toString());
var k = parseBool(f.getAttribute("data-today").toString());
if (j == true) {
c = f;
}
if (k == true) {
d = f;
}
var l = dateGetMonth(this.c.aq).toString();
if (g == false && l == i && b == null) {
b = f;
}
}
if (d != null) {
b = d;
}
if (c != null && a == false) {
b = c;
}
if (b == null) {
for (var m = 0; m < this.g.count; m++) {
var n = parseBool(this.g._inner[m].getAttribute("data-disabled").toString());
if (n == false) {
b = this.g._inner[m];
break;
}
}
}
if (b != null) {
this.d(b);
}
};
CalendarView.prototype.d = function (a) {
if (a == null) {
return false;
}
var b = parseBool(a.getAttribute("data-disabled").toString());
if (b) {
return false;
}
this.p = a;
return true;
};
CalendarView.prototype.ai = function () {
if (this.p != null) {
this.p.parent().parent().focus(true);
}
};
CalendarView.prototype.ar = function (a, b) {
if (a === void 0) {
a = true;
}
if (b === void 0) {
b = false;
}
var c = parseBool(this.g._inner[0].getAttribute("data-disabled").toString());
if (c) {
return;
}
this.c.cc(-1);
this.au(a, b);
this.az();
};
CalendarView.prototype.am = function (a, b) {
if (a === void 0) {
a = true;
}
if (b === void 0) {
b = false;
}
var c = parseBool(this.g._inner[3].getAttribute("data-disabled").toString());
if (c) {
return;
}
this.c.cc(1);
this.au(a, b);
this.az();
};
CalendarView.prototype.ba = function () {
this.n.hide();
this.q.show();
this.q.setStyleProperty("display", "flex");
this.u.hide();
this.x = "month";
this.ay();
this.ai();
};
CalendarView.prototype.bb = function () {
this.n.hide();
this.q.hide();
this.u.show();
this.x = "year";
this.a7();
this.ai();
};
CalendarView.prototype.z = function (a) {
};
CalendarView.prototype.aa = function (a) {
var b = a.which;
if (this.x == "day") {
var c = this.p.getAttribute("data-section").toString();
var d = parseInt(this.p.getAttribute("data-index").toString());
if (c == "header") {
if (b == 37) {
if (d > 0) {
var e = this.g._inner[d - 1];
var f = this.d(e);
if (f == false && d > 1) {
e = this.g._inner[d - 2];
this.d(e);
}
this.ai();
}
else {
this.ar(false);
var g = parseBool(this.p.getAttribute("data-disabled").toString());
if (g == true) {
this.av();
this.ai();
}
}
}
else if (b == 39) {
if (d < 3) {
var h = this.g._inner[d + 1];
var i = this.d(h);
if (i == false && d < 2) {
h = this.g._inner[d + 2];
this.d(h);
}
this.ai();
}
else {
this.am(false);
var j = parseBool(this.p.getAttribute("data-disabled").toString());
if (j == true) {
this.av();
this.ai();
}
}
}
else if (b == 9) {
if (a.shiftKey) {
this.c.cs();
}
else {
a.preventDefault();
this.au(true);
this.ai();
}
}
else if (b == 13) {
a.preventDefault();
if (d == 0) {
this.ar(false);
}
else if (d == 1) {
this.ba();
}
else if (d == 2) {
this.bb();
}
else if (d == 3) {
this.am(false);
}
}
}
else if (c == "days") {
var k = this.p.getAttribute("data-date").toString().split('/');
var l = k[0];
var m = k[1];
if (b == 37) {
if (d == 0) {
this.ar(true, true);
this.ai();
}
else {
var n = this.f._inner[d - 1];
var o = n.getAttribute("data-date").toString().split('/');
var p = o[0];
var q = o[1];
if (m == q) {
this.d(n);
this.ai();
}
else {
this.ar();
var r = this.v(p, q);
this.d(r);
this.ai();
}
}
}
else if (b == 39) {
if (d == 41) {
this.am(true, false);
this.ai();
}
else {
var s = this.f._inner[d + 1];
var t = s.getAttribute("data-date").toString().split('/');
var u = t[0];
var v = t[1];
if (m == v) {
this.d(s);
this.ai();
}
else {
this.am();
var w = this.v(u, v);
this.d(w);
this.ai();
}
}
}
else if (b == 40) {
if (d >= 35) {
this.am();
var x = this.v(l, m);
var y = parseInt(x.getAttribute("data-index").toString());
var z = this.f._inner[y + 7];
var aa = z.getAttribute("data-date").toString().split('/');
var ab = aa[0];
var ac = aa[1];
var ad = this.v(ab, ac);
this.d(ad);
this.ai();
}
else {
var ae = this.f._inner[d + 7];
var af = ae.getAttribute("data-date").toString().split('/');
var ag = af[0];
var ah = af[1];
if (m == ah) {
this.d(ae);
this.ai();
}
else {
this.am();
var ai = this.v(ag, ah);
this.d(ai);
this.ai();
}
}
}
else if (b == 38) {
if (d <= 6) {
this.ar();
var aj = this.v(l, m);
var ak = parseInt(aj.getAttribute("data-index").toString());
var al = this.f._inner[ak - 7];
var am = al.getAttribute("data-date").toString().split('/');
var an = am[0];
var ao = am[1];
var ap = this.v(an, ao);
this.d(ap);
this.ai();
}
else {
var aq = this.f._inner[d - 7];
var ar = aq.getAttribute("data-date").toString().split('/');
var as = ar[0];
var at = ar[1];
if (m == at) {
this.d(aq);
this.ai();
}
else {
this.ar();
var au = this.v(as, at);
this.d(au);
this.ai();
}
}
}
else if (b == 34) {
this.am();
this.ai();
}
else if (b == 33) {
this.ar();
this.ai();
}
else if (b == 9) {
if (a.shiftKey) {
a.preventDefault();
var av = this.g._inner[1];
this.d(av);
this.ai();
}
else {
this.c.cs();
}
}
}
}
else if (this.x == "month") {
var aw = parseInt(this.p.getAttribute("data-index").toString());
if (b == 37) {
if (aw == 0) {
var ax = this.h._inner[11];
this.d(ax);
this.ai();
}
else {
var ay = this.h._inner[aw - 1];
this.d(ay);
this.ai();
}
}
else if (b == 39) {
if (aw == 11) {
var az = this.h._inner[0];
this.d(az);
this.ai();
}
else {
var a0 = this.h._inner[aw + 1];
this.d(a0);
this.ai();
}
}
else if (b == 40) {
if (aw >= 9) {
var a1 = this.h._inner[aw - 9];
this.d(a1);
this.ai();
}
else {
var a2 = this.h._inner[aw + 3];
this.d(a2);
this.ai();
}
}
else if (b == 38) {
if (aw <= 2) {
var a3 = this.h._inner[aw + 9];
this.d(a3);
this.ai();
}
else {
var a4 = this.h._inner[aw - 3];
this.d(a4);
this.ai();
}
}
else if (b == 13) {
this.d(this.g._inner[1]);
this.ai();
}
}
else if (this.x == "year") {
var a5 = parseInt(this.p.getAttribute("data-index").toString());
var a6 = parseInt(this.j._inner[3].getChildAt(0).getText());
if (b == 40) {
this.c.cz(a6, 1);
this.ai();
}
else if (b == 38) {
this.c.cz(a6, -1);
this.ai();
}
else if (b == 13) {
this.d(this.g._inner[2]);
this.ai();
}
}
if (b == 27) {
this.as();
this.c.cs();
}
if (a.altKey == true) {
if (b == 38) {
this.as();
this.c.cs();
}
}
};
CalendarView.prototype.v = function (a, b) {
var c = null;
var d = null;
for (var e = 0; e < 42; e++) {
var f = this.f._inner[e];
var g = f.getAttribute("data-date").toString().split('/');
var h = g[0];
var i = g[1];
if (b == i && d == null) {
d = f;
}
if (b == i && a == h) {
c = f;
break;
}
}
if (c == null) {
c = d;
}
return c;
};
CalendarView.prototype.aq = function (a) {
var b = this.g._inner[0];
var c = parseBool(b.getAttribute("data-disabled").toString());
if (c == true) {
return;
}
this.ar();
};
CalendarView.prototype.al = function (a) {
var b = this.g._inner[3];
var c = parseBool(b.getAttribute("data-disabled").toString());
if (c == true) {
return;
}
this.am();
};
CalendarView.prototype.ak = function (a) {
var b = this.g._inner[1];
var c = parseBool(b.getAttribute("data-disabled").toString());
if (c == true) {
return;
}
this.ba();
};
CalendarView.prototype.bi = function (a) {
var b = this.g._inner[2];
var c = parseBool(b.getAttribute("data-disabled").toString());
if (c == true) {
return;
}
this.bb();
};
CalendarView.prototype.ah = function (e_) {
var a = (e_.originalEvent.currentTarget);
var b = (a.textContent);
if (b != "") {
var c = a.lastChild.lastChild.lastChild;
var d = parseBool(c.getAttribute("data-disabled").toString());
if (d == false) {
var e = c.getAttribute("data-date").toString().split('/');
var f = e[1];
var g = e[2];
this.c.co(b, f, g);
}
}
};
CalendarView.prototype.aj = function (e_) {
var a = (e_.originalEvent.currentTarget);
var b = a.getAttribute("data-month").toString();
if (b != "") {
var c = parseInt(b);
var d = a.lastChild.lastChild.lastChild;
var e = parseBool(d.getAttribute("data-disabled").toString());
if (e == false) {
this.c.cd(c);
this.as();
}