UNPKG

igniteui-webcomponents-inputs

Version:

Ignite UI Web Components inputs components.

1,194 lines 107 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { Base, runOn, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateRemove, enumGetBox, delegateCombine, Number_$type } from "igniteui-webcomponents-core"; import { DomWrapper_$type } from "igniteui-webcomponents-core"; import { List$1 } from "igniteui-webcomponents-core"; import { DayOfWeek_$type } from "./DayOfWeek"; import { DayInfo } from "./DayInfo"; import { XButton } from "./XButton"; import { XIcon } from "./XIcon"; import { truncate, intDivide, isNaN_ } from "igniteui-webcomponents-core"; import { dateMinValue, dateGetMonth, dateNow, dateAddYears, dateFromValues, dateMaxValue, dateGetDate, dateAddDays, dateAddMonths } from "igniteui-webcomponents-core"; import { parseBool } from "igniteui-webcomponents-core"; import { SRProvider } from "igniteui-webcomponents-core"; import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core"; import { BaseControlTheme_$type } from "igniteui-webcomponents-core"; import { FirstWeek_$type } from "./FirstWeek"; import { BrushUtil } from "igniteui-webcomponents-core"; import { ObservableCollection$1 } from "igniteui-webcomponents-core"; import { SelectedValueChangedEventArgs } from "./SelectedValueChangedEventArgs"; import { CornerRadius } from "igniteui-webcomponents-core"; import { CalendarVisualModelExport } from "./CalendarVisualModelExport"; import { ButtonVisualModelExport } from "./ButtonVisualModelExport"; import { TextElementsVisualModelExport } from "./TextElementsVisualModelExport"; import { AppearanceHelper } from "igniteui-webcomponents-core"; import { NativeUI } from "igniteui-webcomponents-core"; import { FontUtil } from "igniteui-webcomponents-core"; import { stringIsNullOrWhiteSpace } from "igniteui-webcomponents-core"; import { timeSpanTotalDays } from "igniteui-webcomponents-core"; let CalendarView = /*@__PURE__*/ (() => { class CalendarView extends Base { constructor() { super(); 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; } k() { return this.e; } l() { return this.i; } ap() { } ao(a) { if (a == null) { this.m = null; return; } this.m = a; this.m.rootWrapper.setStyleProperty("background-color", "rgb(255, 255, 255)"); let b = Math.round(a.rootWrapper.width()); let c = Math.round(a.rootWrapper.height()); this.ab(); this.a3(); this.a4(); this.a1(); let d = this.m.rootWrapper; d.listen("keydown", runOn(this, this.aa)); d.listen("focus", runOn(this, this.z)); } y() { return this.x; } ab() { 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 (let a = 0; a < 42; a++) { let 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 (let c = 0; c < 12; c++) { let d = this.m.createElement("div"); this.h.add(d); } this.ad(); for (let e = 0; e < 12; e++) { let 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 (let g = 0; g < 7; g++) { let h = this.m.createElement("div"); this.j.add(h); } this.af(); for (let i = 0; i < 7; i++) { let 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(); } } ae() { 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%"); let a = this.c.ag(); for (let b = 0; b < 6; b++) { let 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)"); let 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); } } } a5() { if (this.t != null) { let a = this.c.ag(); this.i.clear(); for (let b = 0; b < 6; b++) { let c = this.t.getChildAt(b); let d = c.getChildAt(0); d.setText(a._inner[b].toString()); this.i.add(d); } } } a9() { 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%"); } } } ac() { if (this.m != null) { this.o.setStyleProperty("display", "flex"); this.o.setStyleProperty("flex-direction", "column"); this.o.setStyleProperty("justify-content", "space-evenly"); let a = this.m.createElement("div"); a.setStyleProperty("display", "flex"); a.setStyleProperty("justify-content", "space-evenly"); a.setStyleProperty("width", "100%"); a.setAttribute("role", "row"); let b = this.m.createElement("div"); b.setStyleProperty("width", "15%"); let c = this.m.createElement("div"); c.setStyleProperty("width", "20%"); let d = this.m.createElement("div"); d.setStyleProperty("width", "20%"); let 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); let 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); let 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); let h = 0; for (let i = 0; i < 7; i++) { let j = this.m.createElement("div"); j.setAttribute("role", "row"); j.setStyleProperty("display", "flex"); j.setStyleProperty("justify-content", "space-evenly"); if (i == 0) { for (let k = 0; k < 7; k++) { let 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%"); let 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 (let n = 0; n < 7; n++) { let o = this.m.createElement("div"); o.setAttribute("role", "gridcell"); o.setStyleProperty("justify-content", "center"); let p = this.f._inner[h]; let 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"); let 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"); let 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(); } } ad() { 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 (let a = 0; a < 12; a++) { let b = this.m.createElement("div"); b.setStyleProperty("margin", "5px"); b.setAttribute("data-month", (a + 1).toString()); let c = this.h._inner[a]; c.setAttribute("aria-hidden", "true"); this.c.cl(b, c); b.setStyleProperty("width", "28%"); let d = b.getChildAt(0); d.setStyleProperty("width", "100%"); let e = this.m.createElement("span"); e.setAttribute("aria-hidden", "true"); let f; let 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); } } } bd() { for (let a = 0; a < 12; a++) { let b = this.h._inner[a]; let c; let d = a + 1; c = this.c.e(d, a); b.parent().parent().setAttribute("aria-label", c[0]); let e = b.getChildAt(0); e.setText(c[1]); } } af() { if (this.m != null) { this.u.setStyleProperty("width", "100%"); this.u.setStyleProperty("height", "100%"); let a = this.c.aq.getFullYear() - 3; this.u.setStyleProperty("padding", "5px"); this.u.setAttribute("role", "grid"); this.u.setAttribute("aria-readonly", "true"); for (let b = 0; b < 7; b++) { let c = this.m.createElement("div"); let 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"); let e = c.getChildAt(0); e.setStyleProperty("width", "98%"); let 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); } } } a8() { if (this.m != null) { if (this.c.ae == true) { this.s.setStyleProperty("display", "flex"); } else { this.s.setStyleProperty("display", "none"); } } } a3() { if (this.m != null) { let a = this.o.getChildAt(0); for (let b = 0; b < 4; b++) { let c = this.m.createElement("div"); this.g.add(c); } let d = a.getChildAt(0); let e = this.g._inner[0]; let 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); let g = a.getChildAt(1); let h = this.g._inner[1]; let i = this.m.createElement("span"); i.setAttribute("aria-hidden", "true"); h.append(i); this.c.cj(g, h, "month"); i = h.getChildAt(0); let 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); let k = a.getChildAt(2); let l = this.g._inner[2]; let 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); let 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); let o = a.getChildAt(3); let p = this.g._inner[3]; let 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); let r = this.c.a(); for (let 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)); } } bc() { let a = this.g._inner[1]; let b = a.getChildAt(0); let c = this.c.bx(); b.setText(c); } aw(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"); } a4() { if (this.m != null) { let a = this.o.getChildAt(1).getChildAt(1).getChildAt(0); let 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 (let c = 0; c < b.count; c++) { let d = a.getChildAt(c); let e = d.getChildAt(0); let 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); } } } a1() { if (this.m != null) { this.a2(); this.a5(); let a = this.o.getChildAt(1); let b = a.getChildAt(1); for (let c = 1; c < 7; c++) { let d = b.getChildAt(c); for (let e = 0; e < 7; e++) { let f = d.getChildAt(e); f.listen("click", runOn(this, this.ah)); } } } } a2(a = false, b = false) { if (this.m != null) { let c = null; let d = null; let e = null; let f = this.c.value; let g = this.c.aq; let h = this.c.av; for (let i = 0; i < 42; i++) { let j = this.f._inner[i]; let k = j.getChildAt(0); let 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"); } let 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 (let n = 41; n >= 0; n--) { let o = this.c.j(n); if (o.c == dateGetMonth(g)) { let p = this.f._inner[n]; let q = p.getAttribute("data-disabled"); if (q == "false") { e = this.f._inner[n]; break; } } } } else { for (let r = 0; r < 42; r++) { let s = this.c.j(r); if (s.c == dateGetMonth(g)) { let t = this.f._inner[r]; let u = t.getAttribute("data-disabled"); if (u == "false") { e = this.f._inner[r]; break; } } } } this.d(e); } } } } ag(a, b, c) { if (this.m != null) { b.setAttribute("aria-hidden", "true"); let 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"); } } at(a, b) { if (this.m != null) { let c = this.m.getSubRenderer(a); b.provideContainer(c); let d = c.getExternal(b, c.rootWrapper, c.getExternal(this.c, null, null)); } } a0(a) { let b = this.r.getChildAt(0); b.setText(a); this.r.parent().parent().setAttribute("aria-label", a); } ax(a, b) { if (this.m != null) { let c = this.m.getSubRenderer(a); b.provideContainer(c); let d = c.getExternal(b, c.rootWrapper, c.getExternal(this.c, null, null)); } } az() { if (this.m != null) { let a = this.g._inner[1].getChildAt(0); let b = this.c.bx(); a.setText(b); let c = this.g._inner[2].getChildAt(0); let d = this.c.by(); c.setText(d); } } au(a = false, b = false) { if (this.m != null) { this.a2(a, b); this.a5(); let c = this.c.a(); for (let 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"); } } } } ay() { if (this.m != null) { if (this.h.count != 0) { let a = null; let b = null; let c = 0; let d = 0; let e = 0; for (let f = 0; f < 12; f++) { let g = this.h._inner[f]; g.setAttribute("data-section", "months"); g.setAttribute("data-disabled", "false"); g.parent().parent().setAttribute("aria-selected", "false"); let h = f + 1; let i = this.c.value; let 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; } let k = this.c.aa(f, h); if (k) { g.setAttribute("data-disabled", "true"); } } for (let l = 0; l < this.h.count; l++) { let m = this.h._inner[l]; let n = m.getAttribute("data-disabled"); if (n == "false") { e = l; break; } } let o = this.h._inner[c].getAttribute("data-disabled"); let p = this.h._inner[d].getAttribute("data-disabled"); let 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(); } } } } a7() { if (this.m != null) { if (this.j.count != 0) { let a = this.c.aq.getFullYear(); let b = true; this.a6(a, b); } } } a6(a, b = false) { if (a < this.c.au.getFullYear()) { a = this.c.au.getFullYear(); } if (a > this.c.at.getFullYear()) { a = this.c.at.getFullYear(); } let c = a - 3; let d = false; for (let e = 0; e < 7; e++) { let f = this.j._inner[e]; f.setAttribute("data-section", "years"); f.setAttribute("data-disabled", "false"); f.parent().parent().setAttribute("aria-selected", "false"); let g = this.c.ab(e, c); f.setAttribute("data-disabled", g.toString()); let 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) { let i = this.j._inner[3].getAttribute("data-disabled"); if (i == "false") { let j = this.j._inner[3]; this.d(j); } } } as(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(); } av(a = false) { let b = null; let c = null; let d = null; for (let e = 0; e < this.f.count; e++) { let f = this.f._inner[e]; let g = parseBool(f.getAttribute("data-disabled").toString()); let h = f.getAttribute("data-date").toString().split('/'); let i = h[1]; let j = parseBool(f.getAttribute("data-selected").toString()); let k = parseBool(f.getAttribute("data-today").toString()); if (j == true) { c = f; } if (k == true) { d = f; } let 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 (let m = 0; m < this.g.count; m++) { let 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); } } d(a) { if (a == null) { return false; } let b = parseBool(a.getAttribute("data-disabled").toString()); if (b) { return false; } this.p = a; return true; } ai() { if (this.p != null) { this.p.parent().parent().focus(true); } } ar(a = true, b = false) { let c = parseBool(this.g._inner[0].getAttribute("data-disabled").toString()); if (c) { return; } this.c.cc(-1); this.au(a, b); this.az(); } am(a = true, b = false) { let c = parseBool(this.g._inner[3].getAttribute("data-disabled").toString()); if (c) { return; } this.c.cc(1); this.au(a, b); this.az(); } ba() { this.n.hide(); this.q.show(); this.q.setStyleProperty("display", "flex"); this.u.hide(); this.x = "month"; this.ay(); this.ai(); } bb() { this.n.hide(); this.q.hide(); this.u.show(); this.x = "year"; this.a7(); this.ai(); } z(a) { } aa(a) { let b = a.which; if (this.x == "day") { let c = this.p.getAttribute("data-section").toString(); let d = parseInt(this.p.getAttribute("data-index").toString()); if (c == "header") { if (b == 37) { if (d > 0) { let e = this.g._inner[d - 1]; let f = this.d(e); if (f == false && d > 1) { e = this.g._inner[d - 2]; this.d(e); } this.ai(); } else { this.ar(false); let g = parseBool(this.p.getAttribute("data-disabled").toString()); if (g == true) { this.av(); this.ai(); } } } else if (b == 39) { if (d < 3) { let h = this.g._inner[d + 1]; let i = this.d(h); if (i == false && d < 2) { h = this.g._inner[d + 2]; this.d(h); } this.ai(); } else { this.am(false); let 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") { let k = this.p.getAttribute("data-date").toString().split('/'); let l = k[0]; let m = k[1]; if (b == 37) { if (d == 0) { this.ar(true, true); this.ai(); } else { let n = this.f._inner[d - 1]; let o = n.getAttribute("data-date").toString().split('/'); let p = o[0]; let q = o[1]; if (m == q) { this.d(n); this.ai(); } else { this.ar(); let r = this.v(p, q); this.d(r); this.ai(); } } } else if (b == 39) { if (d == 41) { this.am(true, false); this.ai(); } else { let s = this.f._inner[d + 1]; let t = s.getAttribute("data-date").toString().split('/'); let u = t[0]; let v = t[1]; if (m == v) { this.d(s); this.ai(); } else { this.am(); let w = this.v(u, v); this.d(w); this.ai(); } } } else if (b == 40) { if (d >= 35) { this.am(); let x = this.v(l, m); let y = parseInt(x.getAttribute("data-index").toString()); let z = this.f._inner[y + 7]; let aa = z.getAttribute("data-date").toString().split('/'); let ab = aa[0]; let ac = aa[1]; let ad = this.v(ab, ac); this.d(ad); this.ai(); } else { let ae = this.f._inner[d + 7]; let af = ae.getAttribute("data-date").toString().split('/'); let ag = af[0]; let ah = af[1]; if (m == ah) { this.d(ae); this.ai(); } else { this.am(); let ai = this.v(ag, ah); this.d(ai); this.ai(); } } } else if (b == 38) { if (d <= 6) { this.ar(); let aj = this.v(l, m); let ak = parseInt(aj.getAttribute("data-index").toString()); let al = this.f._inner[ak - 7]; let am = al.getAttribute("data-date").toString().split('/'); let an = am[0]; let ao = am[1]; let ap = this.v(an, ao); this.d(ap); this.ai(); } else { let aq = this.f._inner[d - 7]; let ar = aq.getAttribute("data-date").toString().split('/'); let as = ar[0]; let at = ar[1]; if (m == at) { this.d(aq); this.ai(); } else { this.ar(); let 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(); let av = this.g._inner[1]; this.d(av); this.ai(); } else { this.c.cs(); } } } } else if (this.x == "month") { let aw = parseInt(this.p.getAttribute("data-index").toString()); if (b == 37) { if (aw == 0) { let ax = this.h._inner[11]; this.d(ax); this.ai(); } else { let ay = this.h._inner[aw - 1]; this.d(ay); this.ai(); } } else if (b == 39) { if (aw == 11) { let az = this.h._inner[0]; this.d(az); this.ai(); } else { let a0 = this.h._inner[aw + 1]; this.d(a0); this.ai(); } } else if (b == 40) { if (aw >= 9) { let a1 = this.h._inner[aw - 9]; this.d(a1); this.ai(); } else { let a2 = this.h._inner[aw + 3]; this.d(a2); this.ai(); } } else if (b == 38) { if (aw <= 2) { let a3 = this.h._inner[aw + 9]; this.d(a3); this.ai(); } else { let 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") { let a5 = parseInt(this.p.getAttribute("data-index").toString()); let 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(); t