@progress/kendo-react-dateinputs 7.0.2 → 7.0.3-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-dateinputs.js +4 -4
- package/index.js +1 -1
- package/index.mjs +151 -139
- package/package.json +7 -7
- package/timepicker/TimePart.d.ts +2 -1
- package/timepicker/TimeSelector.d.ts +2 -0
package/index.mjs
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"use client";
|
|
6
6
|
import * as o from "react";
|
|
7
7
|
import n from "prop-types";
|
|
8
|
-
import { classNames as P, canUseDOM as J, createPropsContext as Dt, withIdHOC as yt, withPropsContext as St, Keys as
|
|
9
|
-
import { getDate as
|
|
8
|
+
import { classNames as P, canUseDOM as J, createPropsContext as Dt, withIdHOC as yt, withPropsContext as St, Keys as y, validatePackage as Pt, setScrollbarWidth as fs, getActiveElement as lt, AsyncFocusBlur as we, kendoThemeMaps as mt, noop as Rs, IconWrap as ei } from "@progress/kendo-react-common";
|
|
9
|
+
import { getDate as C, cloneDate as v, addDecades as it, addCenturies as qt, firstDecadeOfCentury as oe, lastDecadeOfCentury as He, firstYearOfDecade as st, durationInCenturies as se, addYears as nt, lastYearOfDecade as Ae, durationInDecades as ie, addDays as Wt, addWeeks as gs, addMonths as $, firstDayOfMonth as fe, lastDayOfMonth as Ot, dayOfWeek as si, durationInMonths as ne, firstMonthOfYear as Ns, lastMonthOfYear as _s, createDate as le, durationInYears as ae, weekInYear as ii, isEqualDate as wt, isEqual as ht } from "@progress/kendo-date-math";
|
|
10
10
|
import { registerForIntl as ft, provideIntlService as ct, registerForLocalization as at, provideLocalizationService as q } from "@progress/kendo-react-intl";
|
|
11
11
|
import { Button as N, ButtonGroup as ni } from "@progress/kendo-react-buttons";
|
|
12
12
|
import { caretAltUpIcon as ai, caretAltDownIcon as ri, xIcon as oi, calendarIcon as Fs, clockIcon as li, chevronRightIcon as vs, chevronLeftIcon as ws, arrowsSwapIcon as hi } from "@progress/kendo-svg-icons";
|
|
@@ -17,7 +17,7 @@ const Rt = {
|
|
|
17
17
|
name: "@progress/kendo-react-dateinputs",
|
|
18
18
|
productName: "KendoReact",
|
|
19
19
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
20
|
-
publishDate:
|
|
20
|
+
publishDate: 1702971801,
|
|
21
21
|
version: "",
|
|
22
22
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
23
23
|
}, pi = (s, t, e) => [
|
|
@@ -360,7 +360,7 @@ class Si extends o.Component {
|
|
|
360
360
|
isRangeSplitEnd: p,
|
|
361
361
|
isToday: m,
|
|
362
362
|
isDisabled: f,
|
|
363
|
-
view:
|
|
363
|
+
view: S,
|
|
364
364
|
value: I,
|
|
365
365
|
...M
|
|
366
366
|
} = this.props, w = this.props.activeRangeEnd === "end" && u, E = this.props.activeRangeEnd === "start" && c, g = P(
|
|
@@ -417,7 +417,7 @@ const ge = (s, t, e) => t === void 0 || e === void 0 || t <= s && s <= e ? s : s
|
|
|
417
417
|
t.getSeconds(),
|
|
418
418
|
t.getMilliseconds()
|
|
419
419
|
), e;
|
|
420
|
-
}, U = () =>
|
|
420
|
+
}, U = () => C(/* @__PURE__ */ new Date()), F = (s, t, e) => !s || !(t && t > s || e && e < s), Hs = (s, t, e) => s === null || !(t && C(t) > C(s) || e && C(e) < C(s)), De = (s, t) => {
|
|
421
421
|
const { start: e, end: i } = t || z;
|
|
422
422
|
return !e || !i ? !1 : e < s && s < i;
|
|
423
423
|
}, Q = (s, t, e = 1) => {
|
|
@@ -439,40 +439,40 @@ function Ci(s, t, e = {}) {
|
|
|
439
439
|
if (typeof s != "function")
|
|
440
440
|
throw new TypeError("Expected a function");
|
|
441
441
|
t = +t || 0;
|
|
442
|
-
function m(
|
|
442
|
+
function m(x) {
|
|
443
443
|
const O = i, tt = a;
|
|
444
444
|
return i = a = void 0, r = s.apply(tt, O), r;
|
|
445
445
|
}
|
|
446
|
-
function f(
|
|
447
|
-
return p ? (h.cancelAnimationFrame(l), h.requestAnimationFrame(
|
|
446
|
+
function f(x, O) {
|
|
447
|
+
return p ? (h.cancelAnimationFrame(l), h.requestAnimationFrame(x)) : setTimeout(x, O);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function S(x) {
|
|
450
450
|
if (p)
|
|
451
|
-
return h.cancelAnimationFrame(
|
|
452
|
-
clearTimeout(
|
|
451
|
+
return h.cancelAnimationFrame(x);
|
|
452
|
+
clearTimeout(x);
|
|
453
453
|
}
|
|
454
|
-
function I(
|
|
454
|
+
function I(x) {
|
|
455
455
|
return l = f(E, t), u ? m() : r;
|
|
456
456
|
}
|
|
457
|
-
function M(
|
|
458
|
-
const O =
|
|
457
|
+
function M(x) {
|
|
458
|
+
const O = x - c;
|
|
459
459
|
return t - O;
|
|
460
460
|
}
|
|
461
|
-
function w(
|
|
462
|
-
const O =
|
|
461
|
+
function w(x) {
|
|
462
|
+
const O = x - c;
|
|
463
463
|
return c === void 0 || O >= t || O < 0 || d;
|
|
464
464
|
}
|
|
465
465
|
function E() {
|
|
466
|
-
const
|
|
467
|
-
if (w(
|
|
466
|
+
const x = Date.now();
|
|
467
|
+
if (w(x))
|
|
468
468
|
return g();
|
|
469
|
-
l = f(E, M(
|
|
469
|
+
l = f(E, M(x));
|
|
470
470
|
}
|
|
471
|
-
function g(
|
|
471
|
+
function g(x) {
|
|
472
472
|
return l = void 0, i ? m() : (i = a = void 0, r);
|
|
473
473
|
}
|
|
474
474
|
function H() {
|
|
475
|
-
l !== void 0 &&
|
|
475
|
+
l !== void 0 && S(l), i = c = a = l = void 0;
|
|
476
476
|
}
|
|
477
477
|
function V() {
|
|
478
478
|
return l === void 0 ? r : g();
|
|
@@ -480,9 +480,9 @@ function Ci(s, t, e = {}) {
|
|
|
480
480
|
function R() {
|
|
481
481
|
return l !== void 0;
|
|
482
482
|
}
|
|
483
|
-
function A(...
|
|
483
|
+
function A(...x) {
|
|
484
484
|
const O = Date.now(), tt = w(O);
|
|
485
|
-
return i =
|
|
485
|
+
return i = x, a = this, c = O, tt && l === void 0 ? I() : (l === void 0 && (l = f(E, t)), r);
|
|
486
486
|
}
|
|
487
487
|
return A.cancel = H, A.flush = V, A.pending = R, A;
|
|
488
488
|
}
|
|
@@ -517,8 +517,8 @@ class Ei {
|
|
|
517
517
|
if (!u)
|
|
518
518
|
return Ii;
|
|
519
519
|
const d = Q(0, Ee), p = oe(u), m = He(u), f = U();
|
|
520
|
-
return Q(0, Mi).map((
|
|
521
|
-
const I = it(p,
|
|
520
|
+
return Q(0, Mi).map((S) => {
|
|
521
|
+
const I = it(p, S * Ee);
|
|
522
522
|
return d.map((M) => {
|
|
523
523
|
const w = this.normalize(it(I, M), l, r), E = this.isEqual(w, h.start), g = this.isEqual(w, h.end), V = !E && !g && De(w, h), R = a && (Array.isArray(c) ? this.isSelectedFromArray(w, c, l, r) : F(c, l, r) && this.isEqual(w, c));
|
|
524
524
|
return As(w, p, m) ? {
|
|
@@ -628,8 +628,8 @@ class Ri {
|
|
|
628
628
|
if (!u)
|
|
629
629
|
return Vi;
|
|
630
630
|
const d = Q(0, Ve), p = st(u), m = Ae(u), f = U();
|
|
631
|
-
return Q(0, Oi).map((
|
|
632
|
-
const I = nt(p,
|
|
631
|
+
return Q(0, Oi).map((S) => {
|
|
632
|
+
const I = nt(p, S * Ve);
|
|
633
633
|
return d.map((M) => {
|
|
634
634
|
const w = this.normalize(nt(I, M), l, r), E = this.isEqual(w, h.start), g = this.isEqual(w, h.end), V = !E && !g && De(w, h), R = a && (Array.isArray(c) ? this.isSelectedFromArray(w, c, l, r) : F(c, l, r) && this.isEqual(w, c));
|
|
635
635
|
return As(w, p, m) ? {
|
|
@@ -741,14 +741,14 @@ class Ai {
|
|
|
741
741
|
} = t;
|
|
742
742
|
if (!u)
|
|
743
743
|
return Ni;
|
|
744
|
-
const d = fe(u), p = Ot(u), m = -1, f = si(d, this.intl.firstDay(), m),
|
|
744
|
+
const d = fe(u), p = Ot(u), m = -1, f = si(d, this.intl.firstDay(), m), S = Q(0, Oe), I = U();
|
|
745
745
|
return Q(0, _i).map((M) => {
|
|
746
746
|
const w = Wt(f, M * Oe);
|
|
747
|
-
return
|
|
747
|
+
return S.map((E) => {
|
|
748
748
|
const g = this.normalize(Wt(w, E), l, r);
|
|
749
749
|
if (g < d || g > p)
|
|
750
750
|
return null;
|
|
751
|
-
const V = this.isEqual(g, h.start), R = this.isEqual(g, h.end),
|
|
751
|
+
const V = this.isEqual(g, h.start), R = this.isEqual(g, h.end), x = !V && !R && De(g, h), O = a && (Array.isArray(c) ? this.isSelectedFromArray(g, c, l, r) : F(c, l, r) && this.isEqual(g, c));
|
|
752
752
|
return {
|
|
753
753
|
formattedValue: this.value(g),
|
|
754
754
|
id: `${e}${g.getTime()}`,
|
|
@@ -757,10 +757,10 @@ class Ai {
|
|
|
757
757
|
isInRange: F(g, l, r),
|
|
758
758
|
isWeekend: this.isWeekend(g),
|
|
759
759
|
isRangeStart: V,
|
|
760
|
-
isRangeMid:
|
|
760
|
+
isRangeMid: x,
|
|
761
761
|
isRangeEnd: R,
|
|
762
|
-
isRangeSplitStart:
|
|
763
|
-
isRangeSplitEnd:
|
|
762
|
+
isRangeSplitStart: x && this.isEqual(g, d),
|
|
763
|
+
isRangeSplitEnd: x && this.isEqual(g, p),
|
|
764
764
|
isToday: this.isEqual(g, I),
|
|
765
765
|
title: this.cellTitle(g),
|
|
766
766
|
value: g
|
|
@@ -769,7 +769,7 @@ class Ai {
|
|
|
769
769
|
});
|
|
770
770
|
}
|
|
771
771
|
isEqual(t, e) {
|
|
772
|
-
return !t || !e ? !1 :
|
|
772
|
+
return !t || !e ? !1 : C(t).getTime() === C(e).getTime();
|
|
773
773
|
}
|
|
774
774
|
isSelectedFromArray(t, e, i, a) {
|
|
775
775
|
let r = !1;
|
|
@@ -781,7 +781,7 @@ class Ai {
|
|
|
781
781
|
return !!e.length && fe(e[0]) <= t && t <= Ot(e[e.length - 1]);
|
|
782
782
|
}
|
|
783
783
|
isInRange(t, e, i) {
|
|
784
|
-
const a =
|
|
784
|
+
const a = C(t), r = !e || C(e) <= a, l = !i || a <= C(i);
|
|
785
785
|
return r && l;
|
|
786
786
|
}
|
|
787
787
|
isInSameView(t, e) {
|
|
@@ -826,7 +826,7 @@ class Ai {
|
|
|
826
826
|
return this.intl.dateFormatNames({ nameType: "abbreviated", type: "months" });
|
|
827
827
|
}
|
|
828
828
|
normalize(t, e, i) {
|
|
829
|
-
return t < e && this.isEqual(t, e) ?
|
|
829
|
+
return t < e && this.isEqual(t, e) ? C(e) : t > i && this.isEqual(t, i) ? C(i) : t;
|
|
830
830
|
}
|
|
831
831
|
wideMonthNames() {
|
|
832
832
|
return this.intl.dateFormatNames({ nameType: "wide", type: "months", standAlone: !0 });
|
|
@@ -865,14 +865,14 @@ class $i {
|
|
|
865
865
|
} = t;
|
|
866
866
|
if (!u)
|
|
867
867
|
return Bi;
|
|
868
|
-
const d = this.abbrMonthNames(), p = Ns(u), m = _s(u), f = p.getFullYear(),
|
|
868
|
+
const d = this.abbrMonthNames(), p = Ns(u), m = _s(u), f = p.getFullYear(), S = Q(0, Pe), I = U();
|
|
869
869
|
return Q(0, zi).map((M) => {
|
|
870
870
|
const w = $(p, M * Pe);
|
|
871
|
-
return
|
|
871
|
+
return S.map((E) => {
|
|
872
872
|
const g = this.normalize($(w, E), l, r);
|
|
873
873
|
if (f < g.getFullYear())
|
|
874
874
|
return null;
|
|
875
|
-
const V = this.isEqual(g, h.start), R = this.isEqual(g, h.end),
|
|
875
|
+
const V = this.isEqual(g, h.start), R = this.isEqual(g, h.end), x = !V && !R && De(g, h), O = a && (Array.isArray(c) ? this.isSelectedFromArray(g, c, l, r) : F(c, l, r) && this.isEqual(g, c));
|
|
876
876
|
return {
|
|
877
877
|
formattedValue: d[g.getMonth()],
|
|
878
878
|
id: `${e}${g.getTime()}`,
|
|
@@ -881,10 +881,10 @@ class $i {
|
|
|
881
881
|
isInRange: F(g, l, r),
|
|
882
882
|
isWeekend: !1,
|
|
883
883
|
isRangeStart: V,
|
|
884
|
-
isRangeMid:
|
|
884
|
+
isRangeMid: x,
|
|
885
885
|
isRangeEnd: R,
|
|
886
|
-
isRangeSplitEnd:
|
|
887
|
-
isRangeSplitStart:
|
|
886
|
+
isRangeSplitEnd: x && this.isEqual(g, m),
|
|
887
|
+
isRangeSplitStart: x && this.isEqual(g, p),
|
|
888
888
|
isToday: this.isEqual(g, I),
|
|
889
889
|
title: this.cellTitle(g),
|
|
890
890
|
value: g
|
|
@@ -1020,7 +1020,7 @@ let ji = class {
|
|
|
1020
1020
|
], "k-calendar-thead")
|
|
1021
1021
|
],
|
|
1022
1022
|
"k-calendar-table k-calendar-weekdays"
|
|
1023
|
-
), f = (k, _) => new Array(k).fill("1").map(_),
|
|
1023
|
+
), f = (k, _) => new Array(k).fill("1").map(_), S = (k, _ = 1) => d([
|
|
1024
1024
|
h(
|
|
1025
1025
|
[c(
|
|
1026
1026
|
[r("1", "k-calendar-td k-alt")]
|
|
@@ -1052,18 +1052,18 @@ let ji = class {
|
|
|
1052
1052
|
)), k) : null;
|
|
1053
1053
|
})(), E = ({ cells: k, rows: _ }, Mt, ti) => {
|
|
1054
1054
|
let Ie;
|
|
1055
|
-
return () => J ? (Ie || (Ie = M(
|
|
1055
|
+
return () => J ? (Ie || (Ie = M(S(_, k), Mt, ti)), Ie) : null;
|
|
1056
1056
|
}, g = (k) => k.querySelector(".k-scrollable"), H = (k) => {
|
|
1057
1057
|
const _ = g(k);
|
|
1058
1058
|
return _.className = `${_.className} k-scrollable-horizontal`, k;
|
|
1059
|
-
}, V = E({ cells: 7, rows: 6 }, "k-calendar-view k-calendar-monthview k-vstack", !0), R = E({ cells: 5, rows: 3 }, "k-calendar-view k-calendar-yearview", !1), A = E({ cells: 5, rows: 2 }, "k-calendar-view k-calendar-decadeview", !1),
|
|
1059
|
+
}, V = E({ cells: 7, rows: 6 }, "k-calendar-view k-calendar-monthview k-vstack", !0), R = E({ cells: 5, rows: 3 }, "k-calendar-view k-calendar-yearview", !1), A = E({ cells: 5, rows: 2 }, "k-calendar-view k-calendar-decadeview", !1), x = () => H(V()), O = () => H(R()), tt = () => H(A()), j = (k) => parseFloat(window.getComputedStyle(k).height) || k.offsetHeight, gt = (k) => {
|
|
1060
1060
|
const _ = window.getComputedStyle(k);
|
|
1061
1061
|
return parseFloat(_.width) + parseFloat(_.paddingLeft) + parseFloat(_.paddingRight) || k.offsetWidth;
|
|
1062
1062
|
}, It = (k) => k.querySelector("tbody");
|
|
1063
1063
|
this.didCalculate = !0, t && (this.hostContainer = t), this.batch(V(), (k) => {
|
|
1064
1064
|
const _ = It(k);
|
|
1065
1065
|
this.calendarHeight = j(k), this.monthViewHeight = j(_), this.headerHeight = j(_.children[0]), this.scrollableContentHeight = j(g(k));
|
|
1066
|
-
}), this.batch(
|
|
1066
|
+
}), this.batch(x(), (k) => {
|
|
1067
1067
|
const _ = It(k);
|
|
1068
1068
|
this.calendarWidth = gt(k), this.monthViewWidth = gt(_), this.scrollableContentWidth = gt(g(k));
|
|
1069
1069
|
}), this.batch(R(), (k) => {
|
|
@@ -1431,7 +1431,7 @@ const Be = "multiviewcalendar.prevView", ze = "multiviewcalendar.nextView", Ft =
|
|
|
1431
1431
|
return this.props.max !== void 0 ? this.props.max : ts.defaultProps.max;
|
|
1432
1432
|
}
|
|
1433
1433
|
get todayIsInRange() {
|
|
1434
|
-
return F(U(),
|
|
1434
|
+
return F(U(), C(this.min), C(this.max));
|
|
1435
1435
|
}
|
|
1436
1436
|
render() {
|
|
1437
1437
|
this.localization = q(this);
|
|
@@ -1579,7 +1579,7 @@ const en = 5, Us = class extends o.Component {
|
|
|
1579
1579
|
return !!(this.props.smoothScroll && this.animateToIndex);
|
|
1580
1580
|
}
|
|
1581
1581
|
get todayIsInRange() {
|
|
1582
|
-
return F(U(),
|
|
1582
|
+
return F(U(), C(this.props.min), C(this.props.max));
|
|
1583
1583
|
}
|
|
1584
1584
|
componentDidUpdate(s, t) {
|
|
1585
1585
|
this.shouldScroll = !1, this.indexToScroll !== void 0 && this.virtualization && this.virtualization[this.animate ? "animateToIndex" : "scrollToIndex"](this.indexToScroll), this.isActive && this.focusActiveDate(), this.lastView = this.props.activeView, this.indexToScroll = void 0;
|
|
@@ -1789,7 +1789,7 @@ ns.propTypes = {
|
|
|
1789
1789
|
ns.defaultProps = {
|
|
1790
1790
|
take: nn
|
|
1791
1791
|
};
|
|
1792
|
-
const Re = (s) => s ? s.virtualization : null, ks = (s = bt.defaultProps.min, t = bt.defaultProps.max, e, i) => i !== void 0 ? i !== null && F(
|
|
1792
|
+
const Re = (s) => s ? s.virtualization : null, ks = (s = bt.defaultProps.min, t = bt.defaultProps.max, e, i) => i !== void 0 ? i !== null && F(C(i), s, t) ? i : null : e !== null && F(C(e), s, t) ? e : null, pt = class extends o.Component {
|
|
1793
1793
|
constructor(s) {
|
|
1794
1794
|
super(s), this.scrollSyncService = null, this.focusedDate = null, this.Navigation = null, this.calendarViewList = null, this._element = null, this.intl = null, this.service = null, this.isActive = !1, this.didNavigationChange = !1, this.focus = () => {
|
|
1795
1795
|
this._element && this._element.focus();
|
|
@@ -1845,7 +1845,7 @@ const Re = (s) => s ? s.virtualization : null, ks = (s = bt.defaultProps.min, t
|
|
|
1845
1845
|
}, this.handleKeyDown = (e) => {
|
|
1846
1846
|
const { keyCode: i } = e;
|
|
1847
1847
|
if (!(!this.focusedDate || !this.service)) {
|
|
1848
|
-
if (i ===
|
|
1848
|
+
if (i === y.enter) {
|
|
1849
1849
|
if (this.value !== null && wt(this.focusedDate, this.value)) {
|
|
1850
1850
|
const r = K(this.focusedDate, this.min, this.max);
|
|
1851
1851
|
Re(this.calendarViewList).scrollToIndex(this.service.skip(r, this.min));
|
|
@@ -1919,10 +1919,10 @@ const Re = (s) => s ? s.virtualization : null, ks = (s = bt.defaultProps.min, t
|
|
|
1919
1919
|
return this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
1920
1920
|
}
|
|
1921
1921
|
get min() {
|
|
1922
|
-
return
|
|
1922
|
+
return C(this.props.min !== void 0 ? this.props.min : pt.defaultProps.min);
|
|
1923
1923
|
}
|
|
1924
1924
|
get max() {
|
|
1925
|
-
return
|
|
1925
|
+
return C(this.props.max !== void 0 ? this.props.max : pt.defaultProps.max);
|
|
1926
1926
|
}
|
|
1927
1927
|
get bottomView() {
|
|
1928
1928
|
return D[this.props.bottomView !== void 0 ? this.props.bottomView : pt.defaultProps.bottomView];
|
|
@@ -1953,8 +1953,8 @@ const Re = (s) => s ? s.virtualization : null, ks = (s = bt.defaultProps.min, t
|
|
|
1953
1953
|
this.state.activeView,
|
|
1954
1954
|
D[this.props.bottomView !== void 0 ? this.props.bottomView : pt.defaultProps.bottomView],
|
|
1955
1955
|
D[this.props.topView !== void 0 ? this.props.topView : pt.defaultProps.topView]
|
|
1956
|
-
), e = ks(this.min, this.max, this.value, this.value), i = e ?
|
|
1957
|
-
this.focusedDate =
|
|
1956
|
+
), e = ks(this.min, this.max, this.value, this.value), i = e ? C(e) : null;
|
|
1957
|
+
this.focusedDate = C(K(
|
|
1958
1958
|
s && e !== null ? e : this.state.focusedDate,
|
|
1959
1959
|
this.min,
|
|
1960
1960
|
this.max
|
|
@@ -2124,7 +2124,7 @@ class pn {
|
|
|
2124
2124
|
m: "m",
|
|
2125
2125
|
s: "s",
|
|
2126
2126
|
y: "y"
|
|
2127
|
-
}, this._value =
|
|
2127
|
+
}, this._value = C(/* @__PURE__ */ new Date()), this.intlProvider = t, this.formatPlaceholder = e, this.format = i, this.monthNames = this.allFormatedMonths();
|
|
2128
2128
|
}
|
|
2129
2129
|
get intl() {
|
|
2130
2130
|
return this.intlProvider();
|
|
@@ -2133,7 +2133,7 @@ class pn {
|
|
|
2133
2133
|
return this._value;
|
|
2134
2134
|
}
|
|
2135
2135
|
setValue(t) {
|
|
2136
|
-
t ? ht(t, this._value) || (this._value = v(t), this.modifyExisting(!0)) : (this._value =
|
|
2136
|
+
t ? ht(t, this._value) || (this._value = v(t), this.modifyExisting(!0)) : (this._value = C(/* @__PURE__ */ new Date()), this.modifyExisting(!1));
|
|
2137
2137
|
}
|
|
2138
2138
|
hasValue() {
|
|
2139
2139
|
const t = (e, i) => e || i.type !== "literal" && i.type !== "dayperiod" && this.getExisting(i.pattern[0]);
|
|
@@ -2245,10 +2245,10 @@ class pn {
|
|
|
2245
2245
|
h = h.slice(1);
|
|
2246
2246
|
h.length >= 4 && (h = "");
|
|
2247
2247
|
for (let m = 0; m < 2; m++) {
|
|
2248
|
-
let f = h + e,
|
|
2249
|
-
if (d = this.intl.parseDate(c + f + u, this.format), !d && !isNaN(
|
|
2248
|
+
let f = h + e, S = parseInt(f, 10);
|
|
2249
|
+
if (d = this.intl.parseDate(c + f + u, this.format), !d && !isNaN(S) && !isNaN(parseInt(e, 10))) {
|
|
2250
2250
|
if (t === "M" && !p) {
|
|
2251
|
-
const I =
|
|
2251
|
+
const I = S - 1;
|
|
2252
2252
|
I > -1 && I < 12 && (d = v(this.value), d.setMonth(I), d.getMonth() !== I && (d = Ot($(d, -1))));
|
|
2253
2253
|
}
|
|
2254
2254
|
t === "y" && (d = le(
|
|
@@ -2510,7 +2510,7 @@ const X = {
|
|
|
2510
2510
|
const i = q(this), a = { ...Z.defaultProps, ...this.props }, { name: r, label: l, id: c } = a, h = this.text, u = h === this.props.placeholder ? "" : h, d = h === this.props.placeholder ? h : void 0, p = c || this._inputId, m = !this.validityStyles || this.validity.valid;
|
|
2511
2511
|
let f = [...dn];
|
|
2512
2512
|
this.props.className && f.push(this.props.className);
|
|
2513
|
-
const
|
|
2513
|
+
const S = /* @__PURE__ */ o.createElement(we, { onFocus: this.elementOnFocus, onBlur: this.elementOnBlur }, ({ onFocus: I, onBlur: M }) => /* @__PURE__ */ o.createElement(
|
|
2514
2514
|
"span",
|
|
2515
2515
|
{
|
|
2516
2516
|
ref: (w) => {
|
|
@@ -2604,10 +2604,10 @@ const X = {
|
|
|
2604
2604
|
editorValue: h,
|
|
2605
2605
|
editorValid: m,
|
|
2606
2606
|
editorDisabled: this.props.disabled,
|
|
2607
|
-
children:
|
|
2607
|
+
children: S,
|
|
2608
2608
|
style: { width: this.props.width }
|
|
2609
2609
|
}
|
|
2610
|
-
) :
|
|
2610
|
+
) : S;
|
|
2611
2611
|
}
|
|
2612
2612
|
/* Public Getters */
|
|
2613
2613
|
/**
|
|
@@ -2976,7 +2976,7 @@ const En = N, Vn = o.forwardRef((s, t) => {
|
|
|
2976
2976
|
}, this.setCalendarRef = (t) => {
|
|
2977
2977
|
this._calendar = t;
|
|
2978
2978
|
}, this.nextValue = (t, e) => t.value !== void 0 ? t.value : e.value, this.nextShow = (t, e) => t.show !== void 0 ? t.show : e.show, this.renderPopup = () => {
|
|
2979
|
-
const { disabled: t, min: e, max: i, weekNumber: a, focusedDate: r } = this.props, { popupClass: l, ...c } = this.props.popupSettings, h = this.show, u = this.value, d = u &&
|
|
2979
|
+
const { disabled: t, min: e, max: i, weekNumber: a, focusedDate: r } = this.props, { popupClass: l, ...c } = this.props.popupSettings, h = this.show, u = this.value, d = u && C(u), p = P(
|
|
2980
2980
|
"k-calendar-container k-group k-reset",
|
|
2981
2981
|
l
|
|
2982
2982
|
), m = {
|
|
@@ -3041,11 +3041,11 @@ const En = N, Vn = o.forwardRef((s, t) => {
|
|
|
3041
3041
|
t.preventDefault();
|
|
3042
3042
|
}, this.handleKeyDown = (t) => {
|
|
3043
3043
|
const { altKey: e, keyCode: i } = t;
|
|
3044
|
-
if (i ===
|
|
3044
|
+
if (i === y.esc) {
|
|
3045
3045
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
3046
3046
|
return;
|
|
3047
3047
|
}
|
|
3048
|
-
e && (i ===
|
|
3048
|
+
e && (i === y.up || i === y.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = i === y.up, this.setShow(i === y.down));
|
|
3049
3049
|
}, Pt(Rt), this.state = {
|
|
3050
3050
|
value: this.props.defaultValue || B.defaultProps.defaultValue,
|
|
3051
3051
|
show: this.props.defaultShow || B.defaultProps.defaultShow,
|
|
@@ -3187,7 +3187,7 @@ const En = N, Vn = o.forwardRef((s, t) => {
|
|
|
3187
3187
|
className: p,
|
|
3188
3188
|
width: m,
|
|
3189
3189
|
name: f,
|
|
3190
|
-
validationMessage:
|
|
3190
|
+
validationMessage: S,
|
|
3191
3191
|
required: I,
|
|
3192
3192
|
validityStyles: M,
|
|
3193
3193
|
ariaLabelledBy: w,
|
|
@@ -3209,7 +3209,7 @@ const En = N, Vn = o.forwardRef((s, t) => {
|
|
|
3209
3209
|
tabIndex: H ? -1 : a,
|
|
3210
3210
|
title: r,
|
|
3211
3211
|
valid: this.validity.valid,
|
|
3212
|
-
validationMessage:
|
|
3212
|
+
validationMessage: S,
|
|
3213
3213
|
validityStyles: M,
|
|
3214
3214
|
value: V,
|
|
3215
3215
|
label: void 0,
|
|
@@ -3218,7 +3218,7 @@ const En = N, Vn = o.forwardRef((s, t) => {
|
|
|
3218
3218
|
size: null,
|
|
3219
3219
|
fillMode: null,
|
|
3220
3220
|
rounded: null
|
|
3221
|
-
},
|
|
3221
|
+
}, x = q(this).toLanguageString(We, T[We]), O = /* @__PURE__ */ o.createElement(
|
|
3222
3222
|
we,
|
|
3223
3223
|
{
|
|
3224
3224
|
onFocus: this.handleFocus,
|
|
@@ -3268,11 +3268,11 @@ const En = N, Vn = o.forwardRef((s, t) => {
|
|
|
3268
3268
|
type: "button",
|
|
3269
3269
|
icon: "calendar",
|
|
3270
3270
|
svgIcon: Fs,
|
|
3271
|
-
title:
|
|
3271
|
+
title: x,
|
|
3272
3272
|
className: "k-input-button",
|
|
3273
3273
|
rounded: null,
|
|
3274
3274
|
onClick: this.mobileMode ? void 0 : this.handleIconClick,
|
|
3275
|
-
"aria-label":
|
|
3275
|
+
"aria-label": x,
|
|
3276
3276
|
onMouseDown: this.handleIconMouseDown
|
|
3277
3277
|
}
|
|
3278
3278
|
),
|
|
@@ -3500,7 +3500,7 @@ class Hn {
|
|
|
3500
3500
|
this.timeListHeight = f.querySelector(".k-scrollable").offsetHeight, this.itemHeight = f.querySelector("li").offsetHeight, m.removeChild(f), this.didCalculate = !0;
|
|
3501
3501
|
}
|
|
3502
3502
|
}
|
|
3503
|
-
const us = 24, An = (s) => (t) => t % s, Ks = An(us), Bn = (s, t) => (e) => Ks(s + e * t), xs = (s, t) => Ks(us + s - t), js = (s) => (t, e) => !e ||
|
|
3503
|
+
const us = 24, An = (s) => (t) => t % s, Ks = An(us), Bn = (s, t) => (e) => Ks(s + e * t), xs = (s, t) => Ks(us + s - t), js = (s) => (t, e) => !e || C(t).getTime() === C(e).getTime() ? t : de(t, s), zn = js(0), qn = js(us - 1);
|
|
3504
3504
|
class Wn {
|
|
3505
3505
|
constructor(t) {
|
|
3506
3506
|
this.intl = t, this.boundRange = !1, this.insertUndividedMax = !1, this.min = null, this.max = null, this.step = 0, this.toListItem = null;
|
|
@@ -3733,10 +3733,10 @@ class Qn {
|
|
|
3733
3733
|
}
|
|
3734
3734
|
}
|
|
3735
3735
|
const ta = 2, Ms = 0.05, ea = 100, sa = 0, Ts = 9, ia = {
|
|
3736
|
-
[
|
|
3737
|
-
[
|
|
3738
|
-
[
|
|
3739
|
-
[
|
|
3736
|
+
[y.end]: (s, t) => s[s.length - 1],
|
|
3737
|
+
[y.home]: (s, t) => s[0],
|
|
3738
|
+
[y.up]: (s, t) => s[t - 1],
|
|
3739
|
+
[y.down]: (s, t) => s[t + 1]
|
|
3740
3740
|
}, es = {
|
|
3741
3741
|
[X.dayperiod]: Ln,
|
|
3742
3742
|
[X.hour]: Wn,
|
|
@@ -3794,7 +3794,7 @@ const ta = 2, Ms = 0.05, ea = 100, sa = 0, Ts = 9, ia = {
|
|
|
3794
3794
|
if (!this.service)
|
|
3795
3795
|
return;
|
|
3796
3796
|
const { keyCode: e } = t;
|
|
3797
|
-
(e ===
|
|
3797
|
+
(e === y.down || e === y.up || e === y.end || e === y.home) && t.preventDefault();
|
|
3798
3798
|
const a = (ia[t.keyCode] || Rs)(
|
|
3799
3799
|
this.service.data(this.props.value),
|
|
3800
3800
|
this.service.selectedIndex(this.props.value)
|
|
@@ -3941,10 +3941,11 @@ Ce.defaultProps = {
|
|
|
3941
3941
|
ft(Ce);
|
|
3942
3942
|
const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`), vt = class extends o.Component {
|
|
3943
3943
|
constructor(s) {
|
|
3944
|
-
super(s), this._element = null, this._nowButton = null, this.dateFormatParts = [], this.timeLists = [], this.focus = (t) => {
|
|
3944
|
+
super(s), this._element = null, this._nowButton = null, this.dateFormatParts = [], this.timeLists = [], this.focus = (t, e) => {
|
|
3945
3945
|
Promise.resolve().then(() => {
|
|
3946
|
-
|
|
3947
|
-
|
|
3946
|
+
e && this._nowButton && this._nowButton.element && this._nowButton.element.focus();
|
|
3947
|
+
const i = this.timeLists[0];
|
|
3948
|
+
!e && this.state.activeListIndex === -1 && !this.hasActiveButton() && i && i.element && i.focus(t);
|
|
3948
3949
|
});
|
|
3949
3950
|
}, this.timeFormatReducer = (t, e) => t + e.pattern, this.timeFormatFilter = (t, e, i) => {
|
|
3950
3951
|
const a = e >= 1 && i[e - 1];
|
|
@@ -3957,13 +3958,13 @@ const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`
|
|
|
3957
3958
|
}], this.showNowButton = () => !this.hasSteps() && this.props.nowButton && hs(Vt(), this.min, this.max), this.handleKeyDown = (t) => {
|
|
3958
3959
|
const { keyCode: e } = t;
|
|
3959
3960
|
switch (e) {
|
|
3960
|
-
case
|
|
3961
|
+
case y.left:
|
|
3961
3962
|
t.preventDefault(), this.focusList(
|
|
3962
3963
|
0
|
|
3963
3964
|
/* Left */
|
|
3964
3965
|
);
|
|
3965
3966
|
return;
|
|
3966
|
-
case
|
|
3967
|
+
case y.right:
|
|
3967
3968
|
t.preventDefault(), this.focusList(
|
|
3968
3969
|
1
|
|
3969
3970
|
/* Right */
|
|
@@ -4038,10 +4039,11 @@ const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`
|
|
|
4038
4039
|
className: i,
|
|
4039
4040
|
disabled: a,
|
|
4040
4041
|
mobileMode: r,
|
|
4041
|
-
show: l
|
|
4042
|
+
show: l,
|
|
4043
|
+
onNowKeyDown: c
|
|
4042
4044
|
} = this.props;
|
|
4043
4045
|
this.snapTime = ys(Ds(this.steps, this.min)), this.dateFormatParts = this.intl.splitDateFormat(s || vt.defaultProps.format).filter(this.timeFormatFilter);
|
|
4044
|
-
const
|
|
4046
|
+
const h = P(
|
|
4045
4047
|
{
|
|
4046
4048
|
"k-disabled": a,
|
|
4047
4049
|
"k-time-part": r
|
|
@@ -4049,23 +4051,24 @@ const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`
|
|
|
4049
4051
|
i
|
|
4050
4052
|
);
|
|
4051
4053
|
this.timeLists = [];
|
|
4052
|
-
const
|
|
4053
|
-
return /* @__PURE__ */ o.createElement("div", { className:
|
|
4054
|
+
const u = q(this), d = u.toLanguageString(je, T[je]);
|
|
4055
|
+
return /* @__PURE__ */ o.createElement("div", { className: h }, /* @__PURE__ */ o.createElement("div", { className: "k-time-header" }, /* @__PURE__ */ o.createElement("span", { className: "k-title" }, this.intl.formatDate(this.value, this.dateFormatParts.reduce(this.timeFormatReducer, ""))), this.showNowButton() && /* @__PURE__ */ o.createElement(
|
|
4054
4056
|
N,
|
|
4055
4057
|
{
|
|
4056
4058
|
type: "button",
|
|
4057
|
-
ref: (
|
|
4058
|
-
this._nowButton =
|
|
4059
|
+
ref: (p) => {
|
|
4060
|
+
this._nowButton = p;
|
|
4059
4061
|
},
|
|
4060
4062
|
className: "k-time-now",
|
|
4061
4063
|
fillMode: "flat",
|
|
4062
4064
|
themeColor: "primary",
|
|
4063
|
-
title:
|
|
4064
|
-
|
|
4065
|
+
title: d,
|
|
4066
|
+
onKeyDown: c,
|
|
4067
|
+
"aria-label": d,
|
|
4065
4068
|
onClick: e,
|
|
4066
4069
|
tabIndex: a ? -1 : 0
|
|
4067
4070
|
},
|
|
4068
|
-
|
|
4071
|
+
u.toLanguageString(Ke, T[Ke])
|
|
4069
4072
|
)), /* @__PURE__ */ o.createElement(
|
|
4070
4073
|
"div",
|
|
4071
4074
|
{
|
|
@@ -4073,34 +4076,34 @@ const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`
|
|
|
4073
4076
|
onKeyDown: this.handleKeyDown
|
|
4074
4077
|
},
|
|
4075
4078
|
/* @__PURE__ */ o.createElement("span", { className: "k-time-highlight" }),
|
|
4076
|
-
this.dateFormatParts.map((
|
|
4079
|
+
this.dateFormatParts.map((p, m) => p.type !== "literal" ? /* @__PURE__ */ o.createElement(
|
|
4077
4080
|
"div",
|
|
4078
4081
|
{
|
|
4079
|
-
key:
|
|
4082
|
+
key: m,
|
|
4080
4083
|
className: P("k-time-list-wrapper", {
|
|
4081
|
-
"k-focus":
|
|
4084
|
+
"k-focus": m === this.state.activeListIndex
|
|
4082
4085
|
}),
|
|
4083
4086
|
role: "presentation",
|
|
4084
4087
|
tabIndex: -1
|
|
4085
4088
|
},
|
|
4086
|
-
/* @__PURE__ */ o.createElement("span", { className: "k-title", onMouseDown: (
|
|
4087
|
-
|
|
4088
|
-
} }, this.intl.dateFieldName(
|
|
4089
|
+
/* @__PURE__ */ o.createElement("span", { className: "k-title", onMouseDown: (f) => {
|
|
4090
|
+
f.preventDefault();
|
|
4091
|
+
} }, this.intl.dateFieldName(p)),
|
|
4089
4092
|
/* @__PURE__ */ o.createElement(
|
|
4090
4093
|
Ce,
|
|
4091
4094
|
{
|
|
4092
4095
|
min: this.min,
|
|
4093
4096
|
max: this.max,
|
|
4094
4097
|
boundRange: this.boundRange,
|
|
4095
|
-
part:
|
|
4096
|
-
step:
|
|
4098
|
+
part: p,
|
|
4099
|
+
step: p.type ? this.steps[p.type] : 1,
|
|
4097
4100
|
smoothScroll: t,
|
|
4098
|
-
ref: (
|
|
4099
|
-
|
|
4101
|
+
ref: (f) => {
|
|
4102
|
+
f && this.timeLists.push(f);
|
|
4100
4103
|
},
|
|
4101
|
-
id:
|
|
4104
|
+
id: m,
|
|
4102
4105
|
onFocus: () => {
|
|
4103
|
-
this.handleListFocus(
|
|
4106
|
+
this.handleListFocus(m);
|
|
4104
4107
|
},
|
|
4105
4108
|
onBlur: this.handleListBlur,
|
|
4106
4109
|
onChange: this.handleChange,
|
|
@@ -4113,10 +4116,10 @@ const Fe = new RegExp(`${X.hour}|${X.minute}|${X.second}|${X.dayperiod}|literal`
|
|
|
4113
4116
|
) : /* @__PURE__ */ o.createElement(
|
|
4114
4117
|
"div",
|
|
4115
4118
|
{
|
|
4116
|
-
key:
|
|
4119
|
+
key: m,
|
|
4117
4120
|
className: "k-time-separator"
|
|
4118
4121
|
},
|
|
4119
|
-
|
|
4122
|
+
p.pattern
|
|
4120
4123
|
))
|
|
4121
4124
|
));
|
|
4122
4125
|
}
|
|
@@ -4189,12 +4192,19 @@ const ss = class extends o.Component {
|
|
|
4189
4192
|
}, this.handleKeyDown = (t) => {
|
|
4190
4193
|
const { keyCode: e } = t;
|
|
4191
4194
|
switch (e) {
|
|
4192
|
-
case
|
|
4195
|
+
case y.enter:
|
|
4193
4196
|
this.hasActiveButton() || this.handleAccept(t);
|
|
4194
4197
|
return;
|
|
4195
4198
|
default:
|
|
4196
4199
|
return;
|
|
4197
4200
|
}
|
|
4201
|
+
}, this.revertToNowButton = (t) => {
|
|
4202
|
+
const { keyCode: e, shiftKey: i } = t;
|
|
4203
|
+
!i && e === y.tab && (t.preventDefault(), this.props.nowButton !== !1 ? this.timePart && this.timePart.focus({ preventScroll: !0 }, !0) : this.timePart && this.timePart.focus({ preventScroll: !0 }));
|
|
4204
|
+
}, this.handleNowKeyDown = (t) => {
|
|
4205
|
+
var a;
|
|
4206
|
+
const { keyCode: e, shiftKey: i } = t;
|
|
4207
|
+
i && e === y.tab ? (t.preventDefault(), this._acceptButton && ((a = this._acceptButton.element) == null || a.focus({ preventScroll: !0 }))) : e === y.enter && (t.stopPropagation(), this.handleNowClick(t));
|
|
4198
4208
|
}, this.handleAccept = (t) => {
|
|
4199
4209
|
const e = this.mergeValue(
|
|
4200
4210
|
v(this.value || Vt()),
|
|
@@ -4279,7 +4289,7 @@ const ss = class extends o.Component {
|
|
|
4279
4289
|
steps: d,
|
|
4280
4290
|
show: p,
|
|
4281
4291
|
mobileMode: m
|
|
4282
|
-
} = this.props, f = q(this),
|
|
4292
|
+
} = this.props, f = q(this), S = f.toLanguageString(ve, T[ve]), I = f.toLanguageString(Ut, T[Ut]);
|
|
4283
4293
|
return /* @__PURE__ */ o.createElement(
|
|
4284
4294
|
"div",
|
|
4285
4295
|
{
|
|
@@ -4310,7 +4320,8 @@ const ss = class extends o.Component {
|
|
|
4310
4320
|
nowButton: u,
|
|
4311
4321
|
steps: d,
|
|
4312
4322
|
show: p,
|
|
4313
|
-
mobileMode: m
|
|
4323
|
+
mobileMode: m,
|
|
4324
|
+
onNowKeyDown: this.handleNowKeyDown
|
|
4314
4325
|
}
|
|
4315
4326
|
),
|
|
4316
4327
|
this.props.footer && /* @__PURE__ */ o.createElement("div", { className: "k-time-footer k-actions k-actions-stretched" }, t && /* @__PURE__ */ o.createElement(
|
|
@@ -4322,10 +4333,10 @@ const ss = class extends o.Component {
|
|
|
4322
4333
|
},
|
|
4323
4334
|
className: "k-time-cancel",
|
|
4324
4335
|
onClick: this.handleReject,
|
|
4325
|
-
title:
|
|
4326
|
-
"aria-label":
|
|
4336
|
+
title: S,
|
|
4337
|
+
"aria-label": S
|
|
4327
4338
|
},
|
|
4328
|
-
|
|
4339
|
+
S
|
|
4329
4340
|
), /* @__PURE__ */ o.createElement(
|
|
4330
4341
|
N,
|
|
4331
4342
|
{
|
|
@@ -4336,6 +4347,7 @@ const ss = class extends o.Component {
|
|
|
4336
4347
|
className: "k-time-accept",
|
|
4337
4348
|
themeColor: "primary",
|
|
4338
4349
|
onClick: this.handleAccept,
|
|
4350
|
+
onKeyDown: this.revertToNowButton,
|
|
4339
4351
|
title: I,
|
|
4340
4352
|
"aria-label": I
|
|
4341
4353
|
},
|
|
@@ -4498,11 +4510,11 @@ const G = class extends o.Component {
|
|
|
4498
4510
|
t.preventDefault();
|
|
4499
4511
|
}, this.handleKeyDown = (t) => {
|
|
4500
4512
|
const { altKey: e, keyCode: i } = t;
|
|
4501
|
-
if (i ===
|
|
4513
|
+
if (i === y.esc) {
|
|
4502
4514
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
4503
4515
|
return;
|
|
4504
4516
|
}
|
|
4505
|
-
e && (i ===
|
|
4517
|
+
e && (i === y.up || i === y.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = i === y.up, this.setShow(i === y.down));
|
|
4506
4518
|
}, Pt(Rt), this.state = {
|
|
4507
4519
|
value: this.props.defaultValue || G.defaultProps.defaultValue,
|
|
4508
4520
|
show: this.props.defaultShow || G.defaultProps.defaultShow,
|
|
@@ -4639,7 +4651,7 @@ const G = class extends o.Component {
|
|
|
4639
4651
|
name: p,
|
|
4640
4652
|
steps: m,
|
|
4641
4653
|
validationMessage: f,
|
|
4642
|
-
required:
|
|
4654
|
+
required: S,
|
|
4643
4655
|
validityStyles: I,
|
|
4644
4656
|
ariaLabelledBy: M,
|
|
4645
4657
|
ariaDescribedBy: w
|
|
@@ -4654,7 +4666,7 @@ const G = class extends o.Component {
|
|
|
4654
4666
|
min: this.normalizeTime(this.min),
|
|
4655
4667
|
name: p,
|
|
4656
4668
|
onChange: this.handleInputValueChange,
|
|
4657
|
-
required:
|
|
4669
|
+
required: S,
|
|
4658
4670
|
steps: m,
|
|
4659
4671
|
tabIndex: this.show ? -1 : a,
|
|
4660
4672
|
title: r,
|
|
@@ -4678,7 +4690,7 @@ const G = class extends o.Component {
|
|
|
4678
4690
|
onSyncBlur: this.props.onBlur,
|
|
4679
4691
|
onSyncFocus: this.props.onFocus
|
|
4680
4692
|
},
|
|
4681
|
-
({ onFocus: A, onBlur:
|
|
4693
|
+
({ onFocus: A, onBlur: x }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
4682
4694
|
"div",
|
|
4683
4695
|
{
|
|
4684
4696
|
id: this.props.id,
|
|
@@ -4701,7 +4713,7 @@ const G = class extends o.Component {
|
|
|
4701
4713
|
onKeyDown: this.handleKeyDown,
|
|
4702
4714
|
style: { width: d },
|
|
4703
4715
|
onFocus: A,
|
|
4704
|
-
onBlur:
|
|
4716
|
+
onBlur: x,
|
|
4705
4717
|
onClick: this.mobileMode ? this.handleIconClick : void 0
|
|
4706
4718
|
},
|
|
4707
4719
|
/* @__PURE__ */ o.createElement(
|
|
@@ -4956,7 +4968,7 @@ Bt.defaultProps = {
|
|
|
4956
4968
|
min: ut,
|
|
4957
4969
|
max: dt
|
|
4958
4970
|
};
|
|
4959
|
-
const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof Date && !Array.isArray(e) && F(
|
|
4971
|
+
const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof Date && !Array.isArray(e) && F(C(e), s, t) ? C(e) : null, Vs = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => Array.isArray(e) ? e.filter((i) => F(i, s, t)).map((i) => C(i)) : null, Os = (s) => typeof s == "object" && !(s instanceof Date) && s !== null && !Array.isArray(s) ? s : z, Ps = (s, t, e) => s || t && t[0] || e && e.start, ra = (s, t) => s.start === null && t === null ? "start" : s.end === null ? "end" : "start", Et = class extends o.Component {
|
|
4960
4972
|
constructor(s) {
|
|
4961
4973
|
super(s), this.dates = [], this.selectedDate = null, this.selectedMultiple = null, this.selectedRange = z, this._focusedDate = /* @__PURE__ */ new Date(), this.cellUID = this.props.id + "-cell-uid", this.activeRangeEnd = "start", this._element = null, this.intl = null, this.localization = null, this.service = null, this.calendarViewList = null, this.isActive = !1, this.calculateFocusFromValue = !0, this.focus = () => {
|
|
4962
4974
|
this._element && this._element.focus();
|
|
@@ -5013,7 +5025,7 @@ const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof
|
|
|
5013
5025
|
this.navigate(b.NextView, this.focusedDate);
|
|
5014
5026
|
}, this.handleKeyDown = (h) => {
|
|
5015
5027
|
const { keyCode: u } = h;
|
|
5016
|
-
if (u ===
|
|
5028
|
+
if (u === y.enter) {
|
|
5017
5029
|
const d = {
|
|
5018
5030
|
syntheticEvent: h,
|
|
5019
5031
|
nativeEvent: h.nativeEvent,
|
|
@@ -5059,10 +5071,10 @@ const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof
|
|
|
5059
5071
|
break;
|
|
5060
5072
|
case "multiple":
|
|
5061
5073
|
if (Array.isArray(this.selectedMultiple)) {
|
|
5062
|
-
let f = this.selectedMultiple.slice(),
|
|
5074
|
+
let f = this.selectedMultiple.slice(), S = -1;
|
|
5063
5075
|
f.forEach((I, M) => {
|
|
5064
|
-
wt(I, h.value) && (
|
|
5065
|
-
}),
|
|
5076
|
+
wt(I, h.value) && (S = M);
|
|
5077
|
+
}), S !== -1 ? f.splice(S, 1) : f.push(v(h.value)), p = f.slice();
|
|
5066
5078
|
} else
|
|
5067
5079
|
this.selectedDate ? p = [v(this.selectedDate), v(h.value)] : p = [v(h.value)];
|
|
5068
5080
|
break;
|
|
@@ -5128,10 +5140,10 @@ const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof
|
|
|
5128
5140
|
return v(this._focusedDate);
|
|
5129
5141
|
}
|
|
5130
5142
|
get min() {
|
|
5131
|
-
return
|
|
5143
|
+
return C(this.props.min !== void 0 ? this.props.min : Et.defaultProps.min);
|
|
5132
5144
|
}
|
|
5133
5145
|
get max() {
|
|
5134
|
-
return
|
|
5146
|
+
return C(this.props.max !== void 0 ? this.props.max : Et.defaultProps.max);
|
|
5135
5147
|
}
|
|
5136
5148
|
get bottomView() {
|
|
5137
5149
|
return D[this.props.bottomView !== void 0 ? this.props.bottomView : Et.defaultProps.bottomView];
|
|
@@ -5143,7 +5155,7 @@ const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof
|
|
|
5143
5155
|
return this.props.activeRangeEnd !== void 0 ? this.props.activeRangeEnd : this.activeRangeEnd;
|
|
5144
5156
|
}
|
|
5145
5157
|
get todayIsInRange() {
|
|
5146
|
-
return F(U(),
|
|
5158
|
+
return F(U(), C(this.min), C(this.max));
|
|
5147
5159
|
}
|
|
5148
5160
|
/**
|
|
5149
5161
|
* @hidden
|
|
@@ -5187,8 +5199,8 @@ const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof
|
|
|
5187
5199
|
return /* @__PURE__ */ o.createElement(
|
|
5188
5200
|
"div",
|
|
5189
5201
|
{
|
|
5190
|
-
ref: (
|
|
5191
|
-
this._element =
|
|
5202
|
+
ref: (S) => {
|
|
5203
|
+
this._element = S;
|
|
5192
5204
|
},
|
|
5193
5205
|
className: e,
|
|
5194
5206
|
id: this.props.id || this.wrapperID,
|
|
@@ -5256,8 +5268,8 @@ const Le = (s = ot.defaultProps.min, t = ot.defaultProps.max, e) => e instanceof
|
|
|
5256
5268
|
/* @__PURE__ */ o.createElement(
|
|
5257
5269
|
Bt,
|
|
5258
5270
|
{
|
|
5259
|
-
ref: (
|
|
5260
|
-
this.calendarViewList =
|
|
5271
|
+
ref: (S) => {
|
|
5272
|
+
this.calendarViewList = S;
|
|
5261
5273
|
},
|
|
5262
5274
|
dates: this.dates,
|
|
5263
5275
|
activeView: s,
|
|
@@ -5462,7 +5474,7 @@ const zt = class extends o.Component {
|
|
|
5462
5474
|
this.handleChange(e, t);
|
|
5463
5475
|
}, this.handleKeyDown = (t) => {
|
|
5464
5476
|
const { keyCode: e, altKey: i } = t;
|
|
5465
|
-
e ===
|
|
5477
|
+
e === y.esc ? (t.preventDefault(), this.shouldFocusDateInput = !0, this.setShow(!1)) : i && e === y.down ? (t.preventDefault(), this.shouldFocusCalendar = !0, this.setShow(!0), this.focusCalendarElement()) : i && e === y.up && (t.preventDefault(), this.shouldFocusDateInput = !0, this.setShow(!1));
|
|
5466
5478
|
}, this.handleChange = (t, e) => {
|
|
5467
5479
|
this.setState({ value: t }), this.valueDuringOnChange = t;
|
|
5468
5480
|
const { onChange: i } = this.props;
|
|
@@ -5829,15 +5841,15 @@ class ms extends o.Component {
|
|
|
5829
5841
|
}, this.handleKeyDown = (e) => {
|
|
5830
5842
|
const { keyCode: i, altKey: a } = e;
|
|
5831
5843
|
switch (i) {
|
|
5832
|
-
case
|
|
5844
|
+
case y.enter:
|
|
5833
5845
|
!this.hasActiveButton() && this.hasDateValue && this.handleAccept(e);
|
|
5834
5846
|
return;
|
|
5835
|
-
case
|
|
5847
|
+
case y.left:
|
|
5836
5848
|
if (!a)
|
|
5837
5849
|
return;
|
|
5838
5850
|
this.move("left");
|
|
5839
5851
|
return;
|
|
5840
|
-
case
|
|
5852
|
+
case y.right:
|
|
5841
5853
|
if (!a)
|
|
5842
5854
|
return;
|
|
5843
5855
|
this.move("right");
|
|
@@ -6062,11 +6074,11 @@ const et = class extends o.Component {
|
|
|
6062
6074
|
t.preventDefault();
|
|
6063
6075
|
}, this.handleKeyDown = (t) => {
|
|
6064
6076
|
const { altKey: e, keyCode: i } = t;
|
|
6065
|
-
if (i ===
|
|
6077
|
+
if (i === y.esc) {
|
|
6066
6078
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
6067
6079
|
return;
|
|
6068
6080
|
}
|
|
6069
|
-
e && (i ===
|
|
6081
|
+
e && (i === y.up || i === y.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = i === y.up, this.setShow(i === y.down));
|
|
6070
6082
|
}, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"), Pt(Rt), this.state = {
|
|
6071
6083
|
value: this.props.defaultValue || et.defaultProps.defaultValue,
|
|
6072
6084
|
show: this.props.defaultShow || et.defaultProps.defaultShow,
|
|
@@ -6194,7 +6206,7 @@ const et = class extends o.Component {
|
|
|
6194
6206
|
className: p,
|
|
6195
6207
|
width: m,
|
|
6196
6208
|
name: f,
|
|
6197
|
-
validationMessage:
|
|
6209
|
+
validationMessage: S,
|
|
6198
6210
|
required: I,
|
|
6199
6211
|
validityStyles: M,
|
|
6200
6212
|
minTime: w,
|
|
@@ -6211,7 +6223,7 @@ const et = class extends o.Component {
|
|
|
6211
6223
|
disabled: i,
|
|
6212
6224
|
title: r,
|
|
6213
6225
|
validityStyles: M,
|
|
6214
|
-
validationMessage:
|
|
6226
|
+
validationMessage: S,
|
|
6215
6227
|
required: I,
|
|
6216
6228
|
min: u,
|
|
6217
6229
|
max: d,
|
|
@@ -6229,7 +6241,7 @@ const et = class extends o.Component {
|
|
|
6229
6241
|
size: null,
|
|
6230
6242
|
fillMode: null,
|
|
6231
6243
|
rounded: null
|
|
6232
|
-
},
|
|
6244
|
+
}, x = /* @__PURE__ */ o.createElement(
|
|
6233
6245
|
we,
|
|
6234
6246
|
{
|
|
6235
6247
|
onFocus: this.handleFocus,
|
|
@@ -6316,10 +6328,10 @@ const et = class extends o.Component {
|
|
|
6316
6328
|
editorId: l,
|
|
6317
6329
|
editorValid: R,
|
|
6318
6330
|
editorDisabled: this.props.disabled,
|
|
6319
|
-
children:
|
|
6331
|
+
children: x,
|
|
6320
6332
|
style: { width: this.props.width }
|
|
6321
6333
|
}
|
|
6322
|
-
) :
|
|
6334
|
+
) : x;
|
|
6323
6335
|
}
|
|
6324
6336
|
setShow(s) {
|
|
6325
6337
|
const { onOpen: t, onClose: e } = this.props;
|