@progress/kendo-react-dateinputs 15.2.0-develop.1 → 15.2.0-develop.3

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.
Files changed (39) hide show
  1. package/calendar/components/Calendar.js +1 -1
  2. package/calendar/components/Calendar.mjs +1 -1
  3. package/calendar/components/CalendarHeaderTitle.js +1 -1
  4. package/calendar/components/CalendarHeaderTitle.mjs +17 -5
  5. package/calendar/components/HorizontalViewList.js +1 -1
  6. package/calendar/components/HorizontalViewList.mjs +29 -29
  7. package/calendar/components/MultiViewCalendar.js +1 -1
  8. package/calendar/components/MultiViewCalendar.mjs +131 -128
  9. package/calendar/components/TodayCommand.js +1 -1
  10. package/calendar/components/TodayCommand.mjs +21 -32
  11. package/calendar/components/View.js +1 -1
  12. package/calendar/components/View.mjs +66 -66
  13. package/calendar/components/ViewList.js +1 -1
  14. package/calendar/components/ViewList.mjs +135 -125
  15. package/calendar/models/WeekDaysFormat.d.ts +1 -1
  16. package/common/AdaptiveMode.js +1 -1
  17. package/common/AdaptiveMode.mjs +30 -31
  18. package/dateinput/DateInput.js +1 -1
  19. package/dateinput/DateInput.mjs +35 -36
  20. package/datepicker/DatePicker.js +1 -1
  21. package/datepicker/DatePicker.mjs +21 -20
  22. package/datetimepicker/DateTimePicker.js +1 -1
  23. package/datetimepicker/DateTimePicker.mjs +15 -14
  24. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  25. package/messages/index.d.ts +5 -0
  26. package/messages/index.js +1 -1
  27. package/messages/index.mjs +46 -44
  28. package/package-metadata.js +1 -1
  29. package/package-metadata.mjs +2 -2
  30. package/package.json +9 -9
  31. package/timepicker/TimeList.js +2 -2
  32. package/timepicker/TimeList.mjs +51 -47
  33. package/timepicker/TimePart.js +1 -1
  34. package/timepicker/TimePart.mjs +57 -68
  35. package/timepicker/TimePicker.d.ts +7 -0
  36. package/timepicker/TimePicker.js +1 -1
  37. package/timepicker/TimePicker.mjs +20 -17
  38. package/timepicker/TimeSelector.js +1 -1
  39. package/timepicker/TimeSelector.mjs +56 -57
@@ -6,118 +6,118 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as a from "react";
9
- import { weekInYear as re, cloneDate as h } from "@progress/kendo-date-math";
10
- import { useInternationalization as se } from "@progress/kendo-react-intl";
11
- import { CalendarCell as ce } from "./CalendarCell.mjs";
12
- import { CalendarWeekCell as ie } from "./CalendarWeekCell.mjs";
13
- import { CalendarViewEnum as M } from "../models/CalendarViewEnum.mjs";
14
- import { getToday as S, setTime as me } from "../../utils.mjs";
15
- import { WeekNamesService as ue } from "../services/WeekNamesService.mjs";
9
+ import { weekInYear as se, cloneDate as p } from "@progress/kendo-date-math";
10
+ import { useInternationalization as ce } from "@progress/kendo-react-intl";
11
+ import { CalendarCell as ie } from "./CalendarCell.mjs";
12
+ import { CalendarWeekCell as me } from "./CalendarWeekCell.mjs";
13
+ import { CalendarViewEnum as S } from "../models/CalendarViewEnum.mjs";
14
+ import { getToday as z, setTime as ue } from "../../utils.mjs";
15
+ import { WeekNamesService as de } from "../services/WeekNamesService.mjs";
16
16
  import { classNames as r, uCalendar as s } from "@progress/kendo-react-common";
17
- const R = (k, f) => {
17
+ const T = (k, f) => {
18
18
  const m = f;
19
19
  return /* @__PURE__ */ a.createElement("td", { key: k, role: "gridcell", className: r(s.td({ c: m, isEmpty: !0 })) }, " ");
20
- }, p = {
20
+ }, C = {
21
21
  direction: "vertical",
22
- selectedDate: S(),
22
+ selectedDate: z(),
23
23
  showWeekNumbers: !1
24
- }, Ee = (k) => {
24
+ }, ye = (k) => {
25
25
  const {
26
26
  activeRangeEnd: f,
27
27
  activeView: m,
28
- bus: T,
29
- cellUID: z,
30
- direction: L = p.direction,
31
- focusedDate: q,
32
- weekCell: C,
33
- max: x,
34
- weekDaysFormat: O,
35
- min: P,
36
- cell: D,
37
- onCellEnter: E,
38
- onCellLeave: y,
39
- onChange: v,
40
- onWeekSelect: N,
41
- selectedDate: $ = p.selectedDate,
42
- selectionRange: A,
28
+ bus: L,
29
+ cellUID: q,
30
+ direction: x = C.direction,
31
+ focusedDate: O,
32
+ weekCell: D,
33
+ max: P,
34
+ weekDaysFormat: $,
35
+ min: A,
36
+ cell: E,
37
+ onCellEnter: y,
38
+ onCellLeave: v,
39
+ onChange: N,
40
+ onWeekSelect: g,
41
+ selectedDate: B = C.selectedDate,
42
+ selectionRange: F,
43
43
  service: w,
44
- showWeekNumbers: B = p.showWeekNumbers,
45
- showOtherMonthDays: F,
46
- viewDate: g,
47
- allowReverse: H,
44
+ showWeekNumbers: H = C.showWeekNumbers,
45
+ showOtherMonthDays: K,
46
+ viewDate: W,
47
+ allowReverse: U,
48
48
  unstyled: d
49
- } = k, W = L === "horizontal", K = m === M.month, u = !!(B && m === M.month), U = (e, t) => {
50
- if (v && t) {
49
+ } = k, h = x === "horizontal", b = m === S.month, u = !!(H && m === S.month), Y = (e, t) => {
50
+ if (N && t) {
51
51
  const l = {
52
- value: h(e),
52
+ value: p(e),
53
53
  target: null,
54
54
  nativeEvent: t == null ? void 0 : t.nativeEvent,
55
55
  syntheticEvent: t
56
56
  };
57
- v(l);
57
+ N(l);
58
58
  }
59
- }, Y = (e, t, l) => {
59
+ }, j = (e, t, l) => {
60
60
  const o = t.findIndex((n) => (n == null ? void 0 : n.value) === e);
61
- N && l && N(e, o, l);
62
- }, j = (e) => {
63
- E && E(h(e));
61
+ g && l && g(e, o, l);
64
62
  }, G = (e) => {
65
- y && y(h(e));
66
- }, b = se(), J = new ue(b), c = d && d.uCalendar, Q = (e) => u ? re(e, b.firstDay()) : null, X = (e) => {
63
+ y && y(p(e));
64
+ }, J = (e) => {
65
+ v && v(p(e));
66
+ }, V = ce(), I = new de(V), c = d && d.uCalendar, Q = (e) => u ? se(e, V.firstDay()) : null, X = (e) => {
67
67
  if (!u)
68
68
  return null;
69
69
  let t = 0, l = e[t];
70
70
  for (; !l && t < e.length; )
71
71
  l = e[++t];
72
72
  return l;
73
- }, V = (e) => {
73
+ }, M = (e) => {
74
74
  const t = X(e);
75
75
  return t ? t.value : null;
76
76
  }, Z = (e, t) => {
77
- if (!V(e))
78
- return R(`week-cell-${t}`);
79
- const o = V(e), n = Q(o), i = `kendo-react-calendar-week-cell-${n}`, I = {
77
+ if (!M(e))
78
+ return T(`week-cell-${t}`);
79
+ const o = M(e), n = Q(o), i = `kendo-react-calendar-week-cell-${n}`, R = {
80
80
  value: n,
81
81
  firstDate: o,
82
82
  weekDays: e,
83
83
  unstyled: d,
84
- onClick: Y
84
+ onClick: j
85
85
  };
86
- return C ? /* @__PURE__ */ a.createElement(C, { ...I, key: i }, n) : /* @__PURE__ */ a.createElement(ie, { ...I, key: i }, n);
86
+ return D ? /* @__PURE__ */ a.createElement(D, { ...R, key: i }, n) : /* @__PURE__ */ a.createElement(me, { ...R, key: i }, n);
87
87
  }, _ = (e) => e.map((t, l) => {
88
88
  if (!t)
89
- return R(l);
90
- const o = { "aria-selected": t.isSelected }, n = `kendo-react-calendar-cell-${t.value.getTime()}`, i = {
89
+ return T(l);
90
+ const o = { "aria-selected": t.isSelected ? !0 : void 0, role: "gridcell" }, n = `kendo-react-calendar-cell-${t.value.getTime()}`, i = {
91
91
  ...o,
92
92
  ...t,
93
93
  isDisabled: !t.isInRange,
94
94
  view: m,
95
- showOtherMonthDays: F,
96
- allowReverse: H,
95
+ showOtherMonthDays: K,
96
+ allowReverse: U,
97
97
  activeRangeEnd: f,
98
98
  unstyled: d,
99
- onClick: U,
100
- onMouseEnter: j,
101
- onMouseLeave: G
99
+ onClick: Y,
100
+ onMouseEnter: G,
101
+ onMouseLeave: J
102
102
  };
103
- return D ? /* @__PURE__ */ a.createElement(D, { ...i, key: n }, t.formattedValue) : /* @__PURE__ */ a.createElement(ce, { ...i, key: n }, t.formattedValue);
104
- }), ee = J.getWeekNames(u, O), te = w.rowLength(u), ne = w.title(g), ae = S(), le = me(g, ae), oe = w.data({
105
- cellUID: z,
106
- min: P,
107
- max: x,
108
- focusedDate: q,
109
- isActiveView: !T.canMoveDown(m),
110
- selectedDate: $,
111
- selectionRange: A,
112
- viewDate: le
103
+ return E ? /* @__PURE__ */ a.createElement(E, { ...i, key: n }, t.formattedValue) : /* @__PURE__ */ a.createElement(ie, { ...i, key: n }, t.formattedValue);
104
+ }), ee = I.getWeekNames(u, $), te = b && h ? I.getWeekNames(u, "wide") : [], ne = w.rowLength(u), ae = w.title(W), le = z(), oe = ue(W, le), re = w.data({
105
+ cellUID: q,
106
+ min: A,
107
+ max: P,
108
+ focusedDate: O,
109
+ isActiveView: !L.canMoveDown(m),
110
+ selectedDate: B,
111
+ selectionRange: F,
112
+ viewDate: oe
113
113
  });
114
- return /* @__PURE__ */ a.createElement(a.Fragment, null, K && W && /* @__PURE__ */ a.createElement("thead", { className: r(s.thead({ c })) }, /* @__PURE__ */ a.createElement("tr", { role: "row", className: r(s.tr({ c })) }, ee.map((e) => /* @__PURE__ */ a.createElement("th", { key: e, className: r(s.th({ c })) }, e)))), /* @__PURE__ */ a.createElement("tbody", { className: r(s.tbody({ c })) }, !W && /* @__PURE__ */ a.createElement("tr", { className: r(s.tr({ c })) }, /* @__PURE__ */ a.createElement("th", { scope: "col", colSpan: te, className: r(s.caption({ c })) }, ne)), oe.map((e, t) => {
114
+ return /* @__PURE__ */ a.createElement(a.Fragment, null, b && h && /* @__PURE__ */ a.createElement("thead", { className: r(s.thead({ c })), role: "rowgroup" }, /* @__PURE__ */ a.createElement("tr", { role: "row", className: r(s.tr({ c })) }, ee.map((e, t) => /* @__PURE__ */ a.createElement("th", { key: e, className: r(s.th({ c })), role: "columnheader", "aria-label": te[t] }, e)))), /* @__PURE__ */ a.createElement("tbody", { className: r(s.tbody({ c })), role: "rowgroup" }, !h && /* @__PURE__ */ a.createElement("tr", { className: r(s.tr({ c })), "aria-hidden": !0, role: "row" }, /* @__PURE__ */ a.createElement("th", { scope: "col", colSpan: ne, className: r(s.caption({ c })) }, ae)), re.map((e, t) => {
115
115
  var o, n;
116
116
  const l = (n = (o = e.find((i) => i != null)) == null ? void 0 : o.value.getTime()) != null ? n : t;
117
117
  return /* @__PURE__ */ a.createElement("tr", { role: "row", className: r(s.tr({ c })), key: l }, u && Z(e, t), _(e));
118
118
  })));
119
119
  };
120
120
  export {
121
- Ee as View,
122
- p as viewDefaultProps
121
+ ye as View,
122
+ C as viewDefaultProps
123
123
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("react"),r=require("@progress/kendo-react-common"),b=require("@progress/kendo-date-math"),De=require("@progress/kendo-react-intl"),Se=require("../../virtualization/Virtualization.js"),Ve=require("./View.js"),be=require("./Header.js"),Ne=require("../services/WeekNamesService.js"),N=require("../../utils.js"),f=require("../models/CalendarViewEnum.js"),Te=require("./TodayCommand.js");function Ie(l){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const i in l)if(i!=="default"){const E=Object.getOwnPropertyDescriptor(l,i);Object.defineProperty(C,i,E.get?E:{enumerable:!0,get:()=>l[i]})}}return C.default=l,Object.freeze(C)}const t=Ie(Ee),qe=5,R={take:qe,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0},Q=t.forwardRef((l,C)=>{const{take:i=R.take,showWeekNumbers:E=R.showWeekNumbers,weekDaysFormat:X=R.weekDaysFormat,smoothScroll:Z=R.smoothScroll,activeView:n,bus:W,cellUID:M,dom:o,focusedDate:h,max:u,min:a,cell:ee,onScroll:te,onChange:P,service:s,value:ne,weekCell:ae,showOtherMonthDays:re,headerTitle:se,header:ce,shouldScroll:j,tabIndex:k,unstyled:w}=l,T=!!(E&&n===f.CalendarViewEnum.month),oe=N.isInRange(N.getToday(),b.getDate(a),b.getDate(u)),A=()=>{if(!m.current)return;const e=m.current.querySelector("td.k-focus"),c=m.current.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),c&&c.classList.add("k-focus"),H.current=!0},le=()=>{if(!m.current)return;const e=m.current.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),H.current=!1},F=(e,c=!1)=>{if(P){const v={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:b.cloneDate(e.value),target:I.current,isTodayClick:c};P(v)}},ie=e=>{O.current=!0,F(e,!0)},ue=({index:e,scrollAction:c,pageAction:v})=>{const V=v?v.skip:void 0;if(me(y=>{const J=V!==void 0?V:y.skip;return y.index!==e||y.skip!==J?{index:e,skip:J}:y}),p.current&&c){const y=`translateY(${c.offset}px)`;p.current.style.transform=y}},de=e=>{if(d.current=e,d.current&&p.current){const c=-1*o.headerHeight;p.current.style.transform=`translateY(${c}px)`;const v=N.dateInRange(h,a,u),V=s.skip(v,a);d.current.scrollToIndex(V)}},d=t.useRef(null),I=t.useRef(null);t.useImperativeHandle(I,()=>({get element(){return m.current},get virtualization(){return d.current},focusActiveDate:A,blurActiveDate:le})),t.useImperativeHandle(C,()=>I.current);const m=t.useRef(null),p=t.useRef(null),q=t.useRef(n),_=t.useRef(h),H=t.useRef(!1),B=t.useRef(!0),O=t.useRef(!1),D=t.useRef(void 0),[Y,me]=t.useState(()=>{const e=s.skip(h,a);return{skip:e,index:e}});t.useEffect(()=>{if(O.current=!1,D.current!==void 0&&d.current){const e=!!(Z&&B.current);d.current[e?"animateToIndex":"scrollToIndex"](D.current)}H.current&&A(),q.current=n,D.current=void 0});const fe=De.useInternationalization(),he=new Ne.WeekNamesService(fe).getWeekNames(T,X),g=w&&w.uCalendar;let U=0,x=0,L=1;o&&(U=(n===f.CalendarViewEnum.month?o.scrollableContentHeight:o.scrollableYearContentHeight)-o.viewHeight(n),x=-1*o.headerHeight,L=o.viewHeight(n)||1);const ke=q.current!==n,S=N.dateInRange(h,a,u),z=ke?s.skip(S,a):Y.skip,$=s.total(a,u),we=Math.min($-z,i),ge=s.addToDate(a,z),ve=s.addToDate(a,Y.index),K=Array.from({length:s.rowLength(T)},(e,c)=>c),G=n!==q.current;B.current=!G,(G||!b.isEqualDate(_.current,S)||O.current||!j||j())&&(D.current=s.skip(S,a)),_.current=S;const ye=r.classNames(r.uCalendar.view({c:g,month:n===f.CalendarViewEnum.month,year:n===f.CalendarViewEnum.year,decade:n===f.CalendarViewEnum.decade,century:n===f.CalendarViewEnum.century})),Ce=t.createElement("table",{className:r.classNames(r.uCalendar.table({c:g})),ref:p,role:"grid",tabIndex:k!=null?k:0,"aria-activedescendant":M+h.getTime()},t.createElement("colgroup",null,K.map(e=>t.createElement("col",{key:e}))),s.datesList(ge,we).map(e=>t.createElement(Ve.View,{key:e.getTime(),activeView:n,viewDate:e,min:a,max:u,cellUID:M,focusedDate:h,cell:ee,selectedDate:ne,showWeekNumbers:T,onChange:F,bus:W,service:s,weekCell:ae,showOtherMonthDays:re,unstyled:w}))),pe=n===f.CalendarViewEnum.month?t.createElement("table",{key:"calendar-view-list-weekdays",className:r.classNames(r.uCalendar.table({c:g,weekdays:!0})),role:"grid",tabIndex:k},t.createElement("colgroup",null,K.map(e=>t.createElement("col",{key:e}))),t.createElement("thead",{className:r.classNames(r.uCalendar.thead({c:g}))},t.createElement("tr",{className:r.classNames(r.uCalendar.tr({c:g}))},he.map(e=>t.createElement("th",{key:e,className:r.classNames(r.uCalendar.th({c:g}))},e))))):null,Re=t.createElement(t.Fragment,null,t.createElement(be.Header,{key:"calendar-view-list-header",currentDate:ve,min:a,max:u,activeView:n,bus:W,service:s,headerTitle:se,header:ce,unstyled:w,commands:t.createElement(Te.TodayCommand,{min:a,max:u,onClick:ie,disabled:!oe,tabIndex:k,unstyled:w})}),pe,t.createElement(Se.Virtualization,{key:"calendar-view-list-content",skip:z,take:i,total:$,itemHeight:L,topOffset:x,bottomOffset:U,scrollOffsetSize:x,maxScrollDifference:L,onScroll:te,onScrollAction:ue,onMount:e=>!d.current&&de(e),tabIndex:k,unstyled:w},Ce));return t.createElement("div",{ref:m,className:ye},o.didCalculate?Re:null)});Q.displayName="KendoReactViewList";const He=Q;exports.ViewList=He;exports.viewListDefaultProps=R;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ve=require("react"),s=require("@progress/kendo-react-common"),S=require("@progress/kendo-date-math"),De=require("@progress/kendo-react-intl"),Ne=require("../../virtualization/Virtualization.js"),Se=require("./View.js"),Te=require("./Header.js"),Ie=require("../services/WeekNamesService.js"),T=require("../../utils.js"),l=require("../models/CalendarViewEnum.js"),qe=require("./TodayCommand.js");function He(i){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const u in i)if(u!=="default"){const R=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(C,u,R.get?R:{enumerable:!0,get:()=>i[u]})}}return C.default=i,Object.freeze(C)}const t=He(Ve),Oe=5,E={take:Oe,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0},X=t.forwardRef((i,C)=>{const{take:u=E.take,showWeekNumbers:R=E.showWeekNumbers,weekDaysFormat:Z=E.weekDaysFormat,smoothScroll:ee=E.smoothScroll,activeView:n,bus:z,cellUID:M,dom:c,focusedDate:h,max:d,min:a,cell:te,onScroll:ne,onChange:P,service:o,value:ae,weekCell:re,showOtherMonthDays:se,headerTitle:oe,header:ce,shouldScroll:j,tabIndex:w,unstyled:k}=i,b=!!(R&&n===l.CalendarViewEnum.month),le=T.isInRange(T.getToday(),S.getDate(a),S.getDate(d)),A=()=>{if(!f.current)return;const e=f.current.querySelector("td.k-focus"),r=f.current.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),r&&r.classList.add("k-focus"),H.current=!0},ie=()=>{if(!f.current)return;const e=f.current.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),H.current=!1},F=(e,r=!1)=>{if(P){const v={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:S.cloneDate(e.value),target:I.current,isTodayClick:r};P(v)}},ue=e=>{O.current=!0,F(e,!0)},de=({index:e,scrollAction:r,pageAction:v})=>{const N=v?v.skip:void 0;if(fe(y=>{const Q=N!==void 0?N:y.skip;return y.index!==e||y.skip!==Q?{index:e,skip:Q}:y}),p.current&&r){const y=`translateY(${r.offset}px)`;p.current.style.transform=y}},me=e=>{if(m.current=e,m.current&&p.current){const r=-1*c.headerHeight;p.current.style.transform=`translateY(${r}px)`;const v=T.dateInRange(h,a,d),N=o.skip(v,a);m.current.scrollToIndex(N)}},m=t.useRef(null),I=t.useRef(null);t.useImperativeHandle(I,()=>({get element(){return f.current},get virtualization(){return m.current},focusActiveDate:A,blurActiveDate:ie})),t.useImperativeHandle(C,()=>I.current);const f=t.useRef(null),p=t.useRef(null),q=t.useRef(n),_=t.useRef(h),H=t.useRef(!1),B=t.useRef(!0),O=t.useRef(!1),V=t.useRef(void 0),[Y,fe]=t.useState(()=>{const e=o.skip(h,a);return{skip:e,index:e}});t.useEffect(()=>{if(O.current=!1,V.current!==void 0&&m.current){const e=!!(ee&&B.current);m.current[e?"animateToIndex":"scrollToIndex"](V.current)}H.current&&A(),q.current=n,V.current=void 0});const he=De.useInternationalization(),U=new Ie.WeekNamesService(he),we=U.getWeekNames(b,Z),ke=U.getWeekNames(b,"wide"),g=k&&k.uCalendar;let $=0,x=0,L=1;c&&($=(n===l.CalendarViewEnum.month?c.scrollableContentHeight:c.scrollableYearContentHeight)-c.viewHeight(n),x=-1*c.headerHeight,L=c.viewHeight(n)||1);const ge=q.current!==n,D=T.dateInRange(h,a,d),W=ge?o.skip(D,a):Y.skip,K=o.total(a,d),ve=Math.min(K-W,u),ye=o.addToDate(a,W),Ce=o.addToDate(a,Y.index),G=Array.from({length:o.rowLength(b)},(e,r)=>r),J=n!==q.current;B.current=!J,(J||!S.isEqualDate(_.current,D)||O.current||!j||j())&&(V.current=o.skip(D,a)),_.current=D;const pe=s.classNames(s.uCalendar.view({c:g,month:n===l.CalendarViewEnum.month,year:n===l.CalendarViewEnum.year,decade:n===l.CalendarViewEnum.decade,century:n===l.CalendarViewEnum.century})),Ee=t.createElement("table",{className:s.classNames(s.uCalendar.table({c:g})),ref:p,role:"grid",tabIndex:w!=null?w:0,"aria-activedescendant":n===l.CalendarViewEnum.month?M+h.getTime():void 0},t.createElement("colgroup",null,G.map(e=>t.createElement("col",{key:e}))),o.datesList(ye,ve).map(e=>t.createElement(Se.View,{key:e.getTime(),activeView:n,viewDate:e,min:a,max:d,cellUID:M,focusedDate:h,cell:te,selectedDate:ae,showWeekNumbers:b,onChange:F,bus:z,service:o,weekCell:re,showOtherMonthDays:se,unstyled:k}))),Re=n===l.CalendarViewEnum.month?t.createElement("table",{key:"calendar-view-list-weekdays",className:s.classNames(s.uCalendar.table({c:g,weekdays:!0})),role:"table",tabIndex:w},t.createElement("colgroup",null,G.map(e=>t.createElement("col",{key:e}))),t.createElement("thead",{className:s.classNames(s.uCalendar.thead({c:g})),role:"rowgroup"},t.createElement("tr",{className:s.classNames(s.uCalendar.tr({c:g})),role:"row"},we.map((e,r)=>t.createElement("th",{key:e,className:s.classNames(s.uCalendar.th({c:g})),"aria-label":ke[r],role:"columnheader"},e))))):null,be=t.createElement(t.Fragment,null,t.createElement(Te.Header,{key:"calendar-view-list-header",currentDate:Ce,min:a,max:d,activeView:n,bus:z,service:o,headerTitle:oe,header:ce,unstyled:k,commands:t.createElement(qe.TodayCommand,{min:a,max:d,onClick:ue,disabled:!le,tabIndex:w,unstyled:k})}),Re,t.createElement(Ne.Virtualization,{key:"calendar-view-list-content",skip:W,take:u,total:K,itemHeight:L,topOffset:x,bottomOffset:$,scrollOffsetSize:x,maxScrollDifference:L,onScroll:ne,onScrollAction:de,onMount:e=>!m.current&&me(e),tabIndex:w,role:"none",unstyled:k},Ee));return t.createElement("div",{ref:f,className:pe},c.didCalculate?be:null)});X.displayName="KendoReactViewList";const xe=X;exports.ViewList=xe;exports.viewListDefaultProps=E;
@@ -7,213 +7,223 @@
7
7
  */
8
8
  import * as t from "react";
9
9
  import { classNames as p, uCalendar as v } from "@progress/kendo-react-common";
10
- import { getDate as K, isEqualDate as Se, cloneDate as Ce } from "@progress/kendo-date-math";
11
- import { useInternationalization as be } from "@progress/kendo-react-intl";
12
- import { Virtualization as Ne } from "../../virtualization/Virtualization.mjs";
13
- import { View as Ve } from "./View.mjs";
14
- import { Header as Te } from "./Header.mjs";
15
- import { WeekNamesService as xe } from "../services/WeekNamesService.mjs";
16
- import { isInRange as Ie, getToday as He, dateInRange as j } from "../../utils.mjs";
17
- import { CalendarViewEnum as u } from "../models/CalendarViewEnum.mjs";
18
- import { TodayCommand as Le } from "./TodayCommand.mjs";
19
- const Oe = 5, E = {
20
- take: Oe,
10
+ import { getDate as j, isEqualDate as be, cloneDate as Ne } from "@progress/kendo-date-math";
11
+ import { useInternationalization as Ve } from "@progress/kendo-react-intl";
12
+ import { Virtualization as Te } from "../../virtualization/Virtualization.mjs";
13
+ import { View as xe } from "./View.mjs";
14
+ import { Header as Ie } from "./Header.mjs";
15
+ import { WeekNamesService as He } from "../services/WeekNamesService.mjs";
16
+ import { isInRange as Le, getToday as We, dateInRange as G } from "../../utils.mjs";
17
+ import { CalendarViewEnum as c } from "../models/CalendarViewEnum.mjs";
18
+ import { TodayCommand as Oe } from "./TodayCommand.mjs";
19
+ const ze = 5, C = {
20
+ take: ze,
21
21
  showWeekNumbers: !1,
22
22
  weekDaysFormat: "short",
23
23
  smoothScroll: !0
24
- }, G = t.forwardRef((J, Q) => {
24
+ }, J = t.forwardRef((Q, X) => {
25
25
  const {
26
- take: H = E.take,
27
- showWeekNumbers: X = E.showWeekNumbers,
28
- weekDaysFormat: Z = E.weekDaysFormat,
29
- smoothScroll: ee = E.smoothScroll,
26
+ take: H = C.take,
27
+ showWeekNumbers: Z = C.showWeekNumbers,
28
+ weekDaysFormat: ee = C.weekDaysFormat,
29
+ smoothScroll: te = C.smoothScroll,
30
30
  activeView: n,
31
31
  bus: L,
32
- cellUID: O,
33
- dom: a,
32
+ cellUID: W,
33
+ dom: s,
34
34
  focusedDate: m,
35
- max: c,
35
+ max: l,
36
36
  min: r,
37
- cell: te,
38
- onScroll: ne,
39
- onChange: W,
40
- service: o,
41
- value: re,
42
- weekCell: oe,
37
+ cell: ne,
38
+ onScroll: re,
39
+ onChange: O,
40
+ service: a,
41
+ value: oe,
42
+ weekCell: ae,
43
43
  showOtherMonthDays: se,
44
- headerTitle: ae,
45
- header: ce,
44
+ headerTitle: ce,
45
+ header: le,
46
46
  shouldScroll: z,
47
- tabIndex: f,
48
- unstyled: d
49
- } = J, S = !!(X && n === u.month), le = Ie(He(), K(r), K(c)), A = () => {
50
- if (!i.current)
47
+ tabIndex: d,
48
+ unstyled: f
49
+ } = Q, y = !!(Z && n === c.month), ie = Le(We(), j(r), j(l)), A = () => {
50
+ if (!u.current)
51
51
  return;
52
- const e = i.current.querySelector("td.k-focus"), s = i.current.querySelector(".k-state-pending-focus");
53
- e && e[0] && e[0].classList.remove("k-focus"), s && s.classList.add("k-focus"), N.current = !0;
54
- }, ie = () => {
55
- if (!i.current)
52
+ const e = u.current.querySelector("td.k-focus"), o = u.current.querySelector(".k-state-pending-focus");
53
+ e && e[0] && e[0].classList.remove("k-focus"), o && o.classList.add("k-focus"), N.current = !0;
54
+ }, ue = () => {
55
+ if (!u.current)
56
56
  return;
57
- const e = i.current.querySelector("td.k-focus");
57
+ const e = u.current.querySelector("td.k-focus");
58
58
  e && e.classList.remove("k-focus"), N.current = !1;
59
- }, F = (e, s = !1) => {
60
- if (W) {
59
+ }, F = (e, o = !1) => {
60
+ if (O) {
61
61
  const k = {
62
62
  syntheticEvent: e.syntheticEvent,
63
63
  nativeEvent: e.nativeEvent,
64
- value: Ce(e.value),
65
- target: C.current,
66
- isTodayClick: s
64
+ value: Ne(e.value),
65
+ target: S.current,
66
+ isTodayClick: o
67
67
  };
68
- W(k);
68
+ O(k);
69
69
  }
70
- }, ue = (e) => {
70
+ }, me = (e) => {
71
71
  V.current = !0, F(e, !0);
72
- }, me = ({ index: e, scrollAction: s, pageAction: k }) => {
73
- const D = k ? k.skip : void 0;
74
- if (de((w) => {
75
- const $ = D !== void 0 ? D : w.skip;
76
- return w.index !== e || w.skip !== $ ? { index: e, skip: $ } : w;
77
- }), g.current && s) {
78
- const w = `translateY(${s.offset}px)`;
72
+ }, de = ({ index: e, scrollAction: o, pageAction: k }) => {
73
+ const E = k ? k.skip : void 0;
74
+ if (he((w) => {
75
+ const K = E !== void 0 ? E : w.skip;
76
+ return w.index !== e || w.skip !== K ? { index: e, skip: K } : w;
77
+ }), g.current && o) {
78
+ const w = `translateY(${o.offset}px)`;
79
79
  g.current.style.transform = w;
80
80
  }
81
81
  }, fe = (e) => {
82
- if (l.current = e, l.current && g.current) {
83
- const s = -1 * a.headerHeight;
84
- g.current.style.transform = `translateY(${s}px)`;
85
- const k = j(m, r, c), D = o.skip(k, r);
86
- l.current.scrollToIndex(D);
82
+ if (i.current = e, i.current && g.current) {
83
+ const o = -1 * s.headerHeight;
84
+ g.current.style.transform = `translateY(${o}px)`;
85
+ const k = G(m, r, l), E = a.skip(k, r);
86
+ i.current.scrollToIndex(E);
87
87
  }
88
- }, l = t.useRef(null), C = t.useRef(null);
88
+ }, i = t.useRef(null), S = t.useRef(null);
89
89
  t.useImperativeHandle(
90
- C,
90
+ S,
91
91
  () => ({
92
92
  get element() {
93
- return i.current;
93
+ return u.current;
94
94
  },
95
95
  get virtualization() {
96
- return l.current;
96
+ return i.current;
97
97
  },
98
98
  focusActiveDate: A,
99
- blurActiveDate: ie
99
+ blurActiveDate: ue
100
100
  })
101
- ), t.useImperativeHandle(Q, () => C.current);
102
- const i = t.useRef(null), g = t.useRef(null), b = t.useRef(n), q = t.useRef(m), N = t.useRef(!1), M = t.useRef(!0), V = t.useRef(!1), y = t.useRef(void 0), [B, de] = t.useState(() => {
103
- const e = o.skip(m, r);
101
+ ), t.useImperativeHandle(X, () => S.current);
102
+ const u = t.useRef(null), g = t.useRef(null), b = t.useRef(n), q = t.useRef(m), N = t.useRef(!1), M = t.useRef(!0), V = t.useRef(!1), R = t.useRef(void 0), [B, he] = t.useState(() => {
103
+ const e = a.skip(m, r);
104
104
  return { skip: e, index: e };
105
105
  });
106
106
  t.useEffect(() => {
107
- if (V.current = !1, y.current !== void 0 && l.current) {
108
- const e = !!(ee && M.current);
109
- l.current[e ? "animateToIndex" : "scrollToIndex"](y.current);
107
+ if (V.current = !1, R.current !== void 0 && i.current) {
108
+ const e = !!(te && M.current);
109
+ i.current[e ? "animateToIndex" : "scrollToIndex"](R.current);
110
110
  }
111
- N.current && A(), b.current = n, y.current = void 0;
111
+ N.current && A(), b.current = n, R.current = void 0;
112
112
  });
113
- const he = be(), ke = new xe(he).getWeekNames(S, Z), h = d && d.uCalendar;
114
- let Y = 0, T = 0, x = 1;
115
- a && (Y = (n === u.month ? a.scrollableContentHeight : a.scrollableYearContentHeight) - a.viewHeight(n), T = -1 * a.headerHeight, x = a.viewHeight(n) || 1);
116
- const we = b.current !== n, R = j(m, r, c), I = we ? o.skip(R, r) : B.skip, P = o.total(r, c), pe = Math.min(P - I, H), ve = o.addToDate(r, I), ge = o.addToDate(r, B.index), U = Array.from({ length: o.rowLength(S) }, (e, s) => s), _ = n !== b.current;
117
- M.current = !_, (_ || !Se(q.current, R) || V.current || !z || z()) && (y.current = o.skip(R, r)), q.current = R;
118
- const ye = p(
113
+ const ke = Ve(), Y = new He(ke), we = Y.getWeekNames(y, ee), pe = Y.getWeekNames(y, "wide"), h = f && f.uCalendar;
114
+ let P = 0, T = 0, x = 1;
115
+ s && (P = (n === c.month ? s.scrollableContentHeight : s.scrollableYearContentHeight) - s.viewHeight(n), T = -1 * s.headerHeight, x = s.viewHeight(n) || 1);
116
+ const ve = b.current !== n, D = G(m, r, l), I = ve ? a.skip(D, r) : B.skip, U = a.total(r, l), ge = Math.min(U - I, H), ye = a.addToDate(r, I), Re = a.addToDate(r, B.index), _ = Array.from({ length: a.rowLength(y) }, (e, o) => o), $ = n !== b.current;
117
+ M.current = !$, ($ || !be(q.current, D) || V.current || !z || z()) && (R.current = a.skip(D, r)), q.current = D;
118
+ const De = p(
119
119
  v.view({
120
120
  c: h,
121
- month: n === u.month,
122
- year: n === u.year,
123
- decade: n === u.decade,
124
- century: n === u.century
121
+ month: n === c.month,
122
+ year: n === c.year,
123
+ decade: n === c.decade,
124
+ century: n === c.century
125
125
  })
126
- ), Re = /* @__PURE__ */ t.createElement(
126
+ ), Ee = /* @__PURE__ */ t.createElement(
127
127
  "table",
128
128
  {
129
129
  className: p(v.table({ c: h })),
130
130
  ref: g,
131
131
  role: "grid",
132
- tabIndex: f != null ? f : 0,
133
- "aria-activedescendant": O + m.getTime()
132
+ tabIndex: d != null ? d : 0,
133
+ "aria-activedescendant": n === c.month ? W + m.getTime() : void 0
134
134
  },
135
- /* @__PURE__ */ t.createElement("colgroup", null, U.map((e) => /* @__PURE__ */ t.createElement("col", { key: e }))),
136
- o.datesList(ve, pe).map((e) => /* @__PURE__ */ t.createElement(
137
- Ve,
135
+ /* @__PURE__ */ t.createElement("colgroup", null, _.map((e) => /* @__PURE__ */ t.createElement("col", { key: e }))),
136
+ a.datesList(ye, ge).map((e) => /* @__PURE__ */ t.createElement(
137
+ xe,
138
138
  {
139
139
  key: e.getTime(),
140
140
  activeView: n,
141
141
  viewDate: e,
142
142
  min: r,
143
- max: c,
144
- cellUID: O,
143
+ max: l,
144
+ cellUID: W,
145
145
  focusedDate: m,
146
- cell: te,
147
- selectedDate: re,
148
- showWeekNumbers: S,
146
+ cell: ne,
147
+ selectedDate: oe,
148
+ showWeekNumbers: y,
149
149
  onChange: F,
150
150
  bus: L,
151
- service: o,
152
- weekCell: oe,
151
+ service: a,
152
+ weekCell: ae,
153
153
  showOtherMonthDays: se,
154
- unstyled: d
154
+ unstyled: f
155
155
  }
156
156
  ))
157
- ), De = n === u.month ? /* @__PURE__ */ t.createElement(
157
+ ), Ce = n === c.month ? /* @__PURE__ */ t.createElement(
158
158
  "table",
159
159
  {
160
160
  key: "calendar-view-list-weekdays",
161
161
  className: p(v.table({ c: h, weekdays: !0 })),
162
- role: "grid",
163
- tabIndex: f
162
+ role: "table",
163
+ tabIndex: d
164
164
  },
165
- /* @__PURE__ */ t.createElement("colgroup", null, U.map((e) => /* @__PURE__ */ t.createElement("col", { key: e }))),
166
- /* @__PURE__ */ t.createElement("thead", { className: p(v.thead({ c: h })) }, /* @__PURE__ */ t.createElement("tr", { className: p(v.tr({ c: h })) }, ke.map((e) => /* @__PURE__ */ t.createElement("th", { key: e, className: p(v.th({ c: h })) }, e))))
167
- ) : null, Ee = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
168
- Te,
165
+ /* @__PURE__ */ t.createElement("colgroup", null, _.map((e) => /* @__PURE__ */ t.createElement("col", { key: e }))),
166
+ /* @__PURE__ */ t.createElement("thead", { className: p(v.thead({ c: h })), role: "rowgroup" }, /* @__PURE__ */ t.createElement("tr", { className: p(v.tr({ c: h })), role: "row" }, we.map((e, o) => /* @__PURE__ */ t.createElement(
167
+ "th",
168
+ {
169
+ key: e,
170
+ className: p(v.th({ c: h })),
171
+ "aria-label": pe[o],
172
+ role: "columnheader"
173
+ },
174
+ e
175
+ ))))
176
+ ) : null, Se = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
177
+ Ie,
169
178
  {
170
179
  key: "calendar-view-list-header",
171
- currentDate: ge,
180
+ currentDate: Re,
172
181
  min: r,
173
- max: c,
182
+ max: l,
174
183
  activeView: n,
175
184
  bus: L,
176
- service: o,
177
- headerTitle: ae,
178
- header: ce,
179
- unstyled: d,
185
+ service: a,
186
+ headerTitle: ce,
187
+ header: le,
188
+ unstyled: f,
180
189
  commands: /* @__PURE__ */ t.createElement(
181
- Le,
190
+ Oe,
182
191
  {
183
192
  min: r,
184
- max: c,
185
- onClick: ue,
186
- disabled: !le,
187
- tabIndex: f,
188
- unstyled: d
193
+ max: l,
194
+ onClick: me,
195
+ disabled: !ie,
196
+ tabIndex: d,
197
+ unstyled: f
189
198
  }
190
199
  )
191
200
  }
192
- ), De, /* @__PURE__ */ t.createElement(
193
- Ne,
201
+ ), Ce, /* @__PURE__ */ t.createElement(
202
+ Te,
194
203
  {
195
204
  key: "calendar-view-list-content",
196
205
  skip: I,
197
206
  take: H,
198
- total: P,
207
+ total: U,
199
208
  itemHeight: x,
200
209
  topOffset: T,
201
- bottomOffset: Y,
210
+ bottomOffset: P,
202
211
  scrollOffsetSize: T,
203
212
  maxScrollDifference: x,
204
- onScroll: ne,
205
- onScrollAction: me,
206
- onMount: (e) => !l.current && fe(e),
207
- tabIndex: f,
208
- unstyled: d
213
+ onScroll: re,
214
+ onScrollAction: de,
215
+ onMount: (e) => !i.current && fe(e),
216
+ tabIndex: d,
217
+ role: "none",
218
+ unstyled: f
209
219
  },
210
- Re
220
+ Ee
211
221
  ));
212
- return /* @__PURE__ */ t.createElement("div", { ref: i, className: ye }, a.didCalculate ? Ee : null);
222
+ return /* @__PURE__ */ t.createElement("div", { ref: u, className: De }, s.didCalculate ? Se : null);
213
223
  });
214
- G.displayName = "KendoReactViewList";
215
- const $e = G;
224
+ J.displayName = "KendoReactViewList";
225
+ const Ke = J;
216
226
  export {
217
- $e as ViewList,
218
- E as viewListDefaultProps
227
+ Ke as ViewList,
228
+ C as viewListDefaultProps
219
229
  };
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Specifies the possible format options for the displayed Calendar week days' names.
10
10
  */
11
- export type WeekDaysFormat = 'short' | 'narrow' | 'abbreviated';
11
+ export type WeekDaysFormat = 'short' | 'narrow' | 'abbreviated' | 'wide';
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),c=require("@progress/kendo-react-layout"),h=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-react-common");function x(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const n=x(v),C=t=>{const{footer:e,windowWidth:a=0,mobileFilter:o,children:s,navigatable:d,navigatableElements:u,expand:b,animation:m,title:p,subTitle:f,onClose:r}=t,g=()=>n.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:h.checkIcon,onClick:r}),l=k.useAdaptiveModeContext(),y={navigatable:d||!1,navigatableElements:u||[],expand:b,animation:m!==!1,suffixActions:g(),filter:o,onClose:r,animationStyles:l&&a<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:p,subTitle:f,className:"k-adaptive-actionsheet",position:l&&a<=l.small?"fullscreen":void 0};return n.createElement(c.ActionSheet,{...y},s,e&&n.createElement(c.ActionSheetFooter,{className:"k-actions k-actions-stretched"},n.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),n.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=C;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),c=require("@progress/kendo-react-layout"),x=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),C=require("@progress/kendo-react-common");function k(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const a=k(h),A=t=>{const{footer:e,id:n,windowWidth:o=0,mobileFilter:s,children:u,navigatable:d,navigatableElements:p,expand:m,animation:b,title:f,subTitle:g,onClose:r}=t,y=()=>a.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:x.checkIcon,onClick:r}),l=C.useAdaptiveModeContext(),v={id:n,navigatable:d||!1,navigatableElements:p||[],expand:m,animation:b!==!1,suffixActions:y(),filter:s,onClose:r,animationStyles:l&&o<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:f,subTitle:g,className:"k-adaptive-actionsheet",position:l&&o<=l.small?"fullscreen":void 0};return a.createElement(c.ActionSheet,{...v},u,e&&a.createElement(c.ActionSheetFooter,null,a.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,type:"button",onClick:e.onCancel},e.cancelText),a.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=A;