@progress/kendo-react-dateinputs 8.3.0-develop.6 → 8.3.0-develop.7

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 (49) hide show
  1. package/calendar/components/Calendar.js +2 -2
  2. package/calendar/components/Calendar.mjs +123 -115
  3. package/calendar/components/CalendarCell.js +1 -1
  4. package/calendar/components/CalendarCell.mjs +37 -39
  5. package/calendar/components/CalendarHeaderTitle.js +1 -1
  6. package/calendar/components/CalendarHeaderTitle.mjs +6 -12
  7. package/calendar/components/CalendarNavigationItem.js +1 -1
  8. package/calendar/components/CalendarNavigationItem.mjs +15 -19
  9. package/calendar/components/CalendarWeekCell.js +1 -1
  10. package/calendar/components/CalendarWeekCell.mjs +10 -15
  11. package/calendar/components/Header.js +1 -1
  12. package/calendar/components/Header.mjs +30 -40
  13. package/calendar/components/Navigation.js +1 -1
  14. package/calendar/components/Navigation.mjs +52 -49
  15. package/calendar/components/TodayCommand.js +1 -1
  16. package/calendar/components/TodayCommand.mjs +21 -25
  17. package/calendar/components/View.js +1 -1
  18. package/calendar/components/View.mjs +48 -42
  19. package/calendar/components/ViewList.js +1 -1
  20. package/calendar/components/ViewList.mjs +99 -94
  21. package/common/ClearButton.js +1 -1
  22. package/common/ClearButton.mjs +25 -31
  23. package/dateinput/DateInput.js +1 -1
  24. package/dateinput/DateInput.mjs +113 -110
  25. package/dateinput/utils.js +1 -1
  26. package/dateinput/utils.mjs +22 -23
  27. package/datepicker/DatePicker.js +1 -1
  28. package/datepicker/DatePicker.mjs +9 -9
  29. package/daterangepicker/DateRangePicker.js +1 -1
  30. package/daterangepicker/DateRangePicker.mjs +5 -5
  31. package/datetimepicker/DateTimePicker.js +1 -1
  32. package/datetimepicker/DateTimePicker.mjs +95 -90
  33. package/datetimepicker/DateTimeSelector.js +1 -1
  34. package/datetimepicker/DateTimeSelector.mjs +83 -81
  35. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  36. package/index.d.mts +38 -28
  37. package/index.d.ts +38 -28
  38. package/package-metadata.mjs +1 -1
  39. package/package.json +7 -7
  40. package/timepicker/TimeList.js +3 -3
  41. package/timepicker/TimeList.mjs +83 -81
  42. package/timepicker/TimePart.js +1 -1
  43. package/timepicker/TimePart.mjs +74 -68
  44. package/timepicker/TimePicker.js +1 -1
  45. package/timepicker/TimePicker.mjs +112 -107
  46. package/timepicker/TimeSelector.js +1 -1
  47. package/timepicker/TimeSelector.mjs +66 -59
  48. package/virtualization/Virtualization.js +1 -1
  49. package/virtualization/Virtualization.mjs +49 -48
@@ -7,17 +7,11 @@
7
7
  */
8
8
  "use client";
9
9
  import { Button as r } from "@progress/kendo-react-buttons";
10
- import * as e from "react";
11
- class s extends e.PureComponent {
12
- /**
13
- * @return
14
- * Returns a `<span />` element with the [`value`]({% slug api_dateinputs_calendarheadertitleprops %}#toc-value) of the title as a child.
15
- */
16
- render() {
17
- const { view: n, ...t } = this.props;
18
- return /* @__PURE__ */ e.createElement(r, { type: "button", fillMode: "flat", themeColor: "primary", ...t }, this.props.children);
19
- }
20
- }
10
+ import * as o from "react";
11
+ const a = (e) => {
12
+ const { view: l, ...t } = e;
13
+ return /* @__PURE__ */ o.createElement(r, { type: "button", fillMode: "flat", themeColor: "primary", ...t }, e.children);
14
+ };
21
15
  export {
22
- s as CalendarHeaderTitle
16
+ a as CalendarHeaderTitle
23
17
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),s=require("@progress/kendo-react-common");function i(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const r=i(c);class l extends r.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:a}=this.props;e&&e.call(void 0,a,t)}}render(){const{isRangeStart:t,value:e,text:a,...o}=this.props;return r.createElement("li",{...o,onClick:this.handleClick},r.createElement("span",{className:s.classNames({"k-calendar-navigation-marker":t})},this.props.children))}}exports.CalendarNavigationItem=l;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),c=require("@progress/kendo-react-common");function f(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=f(m),g=e=>{const{isRangeStart:n,value:t,text:a,...s}=e,r=c.useUnstyled(),i=r&&r.uCalendar,u=d=>{const{onClick:l}=e;l&&l.call(void 0,t,d)};return o.createElement("li",{...s,onClick:u},o.createElement("span",{className:c.classNames(c.uCalendar.navigationMarker({c:i,isRangeStart:n}))},e.children))};exports.CalendarNavigationItem=g;
@@ -6,24 +6,20 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
10
- import { classNames as n } from "@progress/kendo-react-common";
11
- class o extends a.Component {
12
- constructor() {
13
- super(...arguments), this.handleClick = (e) => {
14
- const { onClick: t, value: r } = this.props;
15
- t && t.call(void 0, r, e);
16
- };
17
- }
18
- /**
19
- * @return
20
- * Returns a `<li />` element with a `<span />` inside. The text inside represents the [`value`]({% slug api_dateinputs_calendarnavigationitemprops %}#toc-value) of the `navigationItem`.
21
- */
22
- render() {
23
- const { isRangeStart: e, value: t, text: r, ...s } = this.props;
24
- return /* @__PURE__ */ a.createElement("li", { ...s, onClick: this.handleClick }, /* @__PURE__ */ a.createElement("span", { className: n({ "k-calendar-navigation-marker": e }) }, this.props.children));
25
- }
26
- }
9
+ import * as n from "react";
10
+ import { useUnstyled as m, classNames as d, uCalendar as u } from "@progress/kendo-react-common";
11
+ const v = (e) => {
12
+ const { isRangeStart: l, value: c, text: C, ...s } = e, a = m(), i = a && a.uCalendar, o = (r) => {
13
+ const { onClick: t } = e;
14
+ t && t.call(void 0, c, r);
15
+ };
16
+ return /* @__PURE__ */ n.createElement("li", { ...s, onClick: o }, /* @__PURE__ */ n.createElement("span", { className: d(
17
+ u.navigationMarker({
18
+ c: i,
19
+ isRangeStart: l
20
+ })
21
+ ) }, e.children));
22
+ };
27
23
  export {
28
- o as CalendarNavigationItem
24
+ v as CalendarNavigationItem
29
25
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=require("@progress/kendo-react-common");function l(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const a=l(c);class i extends a.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,firstDate:n,weekDays:s}=this.props;t&&e&&t.call(void 0,n,s||[],e)}}render(){const{className:e,firstDate:t,weekDays:n,...s}=this.props;return a.createElement("td",{className:o.classNames("k-calendar-td",e),...s,onClick:this.handleClick},this.props.children)}}exports.CalendarWeekCell=i;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("@progress/kendo-react-common");function f(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const m=f(d),C=e=>{const{className:n,firstDate:t,weekDays:c,...o}=e,i=r=>{const{onClick:s}=e;s&&r&&s.call(void 0,t,c||[],r)},l=a.useUnstyled(),u=l&&l.uCalendar;return m.createElement("td",{className:a.classNames(a.uCalendar.td({c:u,isWeek:!0}),n),...o,onClick:i},e.children)};exports.CalendarWeekCell=C;
@@ -6,20 +6,15 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
10
- import { classNames as l } from "@progress/kendo-react-common";
11
- class i extends a.Component {
12
- constructor() {
13
- super(...arguments), this.handleClick = (e) => {
14
- const { onClick: s, firstDate: r, weekDays: t } = this.props;
15
- s && e && s.call(void 0, r, t || [], e);
16
- };
17
- }
18
- render() {
19
- const { className: e, firstDate: s, weekDays: r, ...t } = this.props;
20
- return /* @__PURE__ */ a.createElement("td", { className: l("k-calendar-td", e), ...t, onClick: this.handleClick }, this.props.children);
21
- }
22
- }
9
+ import * as d from "react";
10
+ import { useUnstyled as m, classNames as C, uCalendar as u } from "@progress/kendo-react-common";
11
+ const f = (e) => {
12
+ const { className: l, firstDate: c, weekDays: n, ...o } = e, r = (t) => {
13
+ const { onClick: a } = e;
14
+ a && t && a.call(void 0, c, n || [], t);
15
+ }, s = m(), i = s && s.uCalendar;
16
+ return /* @__PURE__ */ d.createElement("td", { className: C(u.td({ c: i, isWeek: !0 }), l), ...o, onClick: r }, e.children);
17
+ };
23
18
  export {
24
- i as CalendarWeekCell
19
+ f as CalendarWeekCell
25
20
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("prop-types"),m=require("@progress/kendo-react-intl"),c=require("@progress/kendo-react-common"),g=require("./CalendarHeaderTitle.js"),p=require("../../utils.js");function v(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const s=v(d),i=class i extends s.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),r=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(r,this.min,this.max)?t:`${t} - ${this.props.service.title(r)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return this.props.min!==void 0?this.props.min:i.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:i.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:i.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const e=this.getTitle(),t=c.classNames("k-calendar-title"),r={children:e,value:e,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},l={headerTitleProps:r,commands:this.props.commands},h=this.props.headerTitle?s.createElement(this.props.headerTitle,{...r},e):s.createElement(g.CalendarHeaderTitle,{...r},e),u=this.props.header?s.createElement(this.props.header,{...l}):s.createElement(s.Fragment,null,h,s.createElement("span",{className:"k-spacer"}),s.createElement("span",{className:"k-calendar-nav"},this.props.commands));return s.createElement("div",{className:c.classNames("k-calendar-header",{"k-vstack":this.props.verticalView})},u)}};i.propTypes={activeView:a.number.isRequired,currentDate:a.instanceOf(Date).isRequired,max:a.instanceOf(Date).isRequired,min:a.instanceOf(Date).isRequired,rangeLength:a.number},i.defaultProps={rangeLength:1,min:p.MIN_DATE,max:p.MAX_DATE};let o=i;m.registerForLocalization(o);exports.Header=o;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),c=require("prop-types"),T=require("@progress/kendo-react-intl"),a=require("@progress/kendo-react-common"),C=require("./CalendarHeaderTitle.js"),h=require("../../utils.js");function b(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const s=b(f),n=class n extends s.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),r=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(r,this.min,this.max)?t:`${t} - ${this.props.service.title(r)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:n.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const{activeView:e,commands:t,unstyled:r}=this.props,o=r&&r.uCalendar,p=this.getTitle(),d=a.classNames(a.uCalendar.title({c:o})),u={children:p,value:p,view:e,className:d,onClick:this.handleTitleClick,disabled:!this.canMoveUp},m={headerTitleProps:u,commands:t},g=this.props.headerTitle?s.createElement(this.props.headerTitle,{...u},p):s.createElement(C.CalendarHeaderTitle,{...u},p),v=this.props.header?s.createElement(this.props.header,{...m}):s.createElement(s.Fragment,null,g,s.createElement("span",{className:a.classNames(a.uCalendar.spacer({c:o}))}),s.createElement("span",{className:a.classNames(a.uCalendar.nav({c:o}))},this.props.commands));return s.createElement("div",{className:a.classNames(a.uCalendar.header({c:o,vertical:this.props.verticalView}))},v)}};n.propTypes={activeView:c.number.isRequired,currentDate:c.instanceOf(Date).isRequired,max:c.instanceOf(Date).isRequired,min:c.instanceOf(Date).isRequired,rangeLength:c.number},n.defaultProps={rangeLength:1,min:h.MIN_DATE,max:h.MAX_DATE};let l=n;T.registerForLocalization(l);exports.Header=l;
@@ -6,73 +6,63 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as t from "react";
9
+ import * as e from "react";
10
10
  import i from "prop-types";
11
- import { registerForLocalization as m } from "@progress/kendo-react-intl";
12
- import { classNames as p } from "@progress/kendo-react-common";
13
- import { CalendarHeaderTitle as l } from "./CalendarHeaderTitle.mjs";
14
- import { MIN_DATE as d, MAX_DATE as u } from "../../utils.mjs";
15
- const s = class s extends t.Component {
11
+ import { registerForLocalization as v } from "@progress/kendo-react-intl";
12
+ import { classNames as o, uCalendar as c } from "@progress/kendo-react-common";
13
+ import { CalendarHeaderTitle as f } from "./CalendarHeaderTitle.mjs";
14
+ import { MIN_DATE as T, MAX_DATE as D } from "../../utils.mjs";
15
+ const t = class t extends e.Component {
16
16
  constructor() {
17
17
  super(...arguments), this.getTitle = () => {
18
18
  if (!this.props.currentDate)
19
19
  return "";
20
- const e = this.rangeLength - 1, a = this.props.service.title(this.props.currentDate), r = this.props.service.addToDate(this.props.currentDate, e);
21
- return e < 1 || !this.props.service.isInRange(r, this.min, this.max) ? a : `${a} - ${this.props.service.title(r)}`;
22
- }, this.handleTitleClick = (e) => {
23
- this.canMoveUp && this.props.bus.moveUp(this.props.activeView, e);
20
+ const s = this.rangeLength - 1, a = this.props.service.title(this.props.currentDate), r = this.props.service.addToDate(this.props.currentDate, s);
21
+ return s < 1 || !this.props.service.isInRange(r, this.min, this.max) ? a : `${a} - ${this.props.service.title(r)}`;
22
+ }, this.handleTitleClick = (s) => {
23
+ this.canMoveUp && this.props.bus.moveUp(this.props.activeView, s);
24
24
  };
25
25
  }
26
26
  get min() {
27
- return this.props.min !== void 0 ? this.props.min : s.defaultProps.min;
27
+ return this.props.min !== void 0 ? this.props.min : t.defaultProps.min;
28
28
  }
29
29
  get max() {
30
- return this.props.max !== void 0 ? this.props.max : s.defaultProps.max;
30
+ return this.props.max !== void 0 ? this.props.max : t.defaultProps.max;
31
31
  }
32
32
  get rangeLength() {
33
- return this.props.rangeLength !== void 0 ? this.props.rangeLength : s.defaultProps.rangeLength;
33
+ return this.props.rangeLength !== void 0 ? this.props.rangeLength : t.defaultProps.rangeLength;
34
34
  }
35
35
  get canMoveUp() {
36
36
  return this.props.bus.canMoveUp(this.props.activeView);
37
37
  }
38
38
  render() {
39
- const e = this.getTitle(), a = p(
40
- "k-calendar-title"
41
- ), r = {
42
- children: e,
43
- value: e,
44
- view: this.props.activeView,
45
- className: a,
39
+ const { activeView: s, commands: a, unstyled: r } = this.props, n = r && r.uCalendar, p = this.getTitle(), m = o(c.title({ c: n })), h = {
40
+ children: p,
41
+ value: p,
42
+ view: s,
43
+ className: m,
46
44
  onClick: this.handleTitleClick,
47
45
  disabled: !this.canMoveUp
48
- }, o = {
49
- headerTitleProps: r,
50
- commands: this.props.commands
51
- }, c = this.props.headerTitle ? /* @__PURE__ */ t.createElement(this.props.headerTitle, { ...r }, e) : /* @__PURE__ */ t.createElement(l, { ...r }, e), h = this.props.header ? /* @__PURE__ */ t.createElement(this.props.header, { ...o }) : /* @__PURE__ */ t.createElement(t.Fragment, null, c, /* @__PURE__ */ t.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ t.createElement("span", { className: "k-calendar-nav" }, this.props.commands));
52
- return /* @__PURE__ */ t.createElement(
53
- "div",
54
- {
55
- className: p("k-calendar-header", {
56
- "k-vstack": this.props.verticalView
57
- })
58
- },
59
- h
60
- );
46
+ }, d = {
47
+ headerTitleProps: h,
48
+ commands: a
49
+ }, u = this.props.headerTitle ? /* @__PURE__ */ e.createElement(this.props.headerTitle, { ...h }, p) : /* @__PURE__ */ e.createElement(f, { ...h }, p), g = this.props.header ? /* @__PURE__ */ e.createElement(this.props.header, { ...d }) : /* @__PURE__ */ e.createElement(e.Fragment, null, u, /* @__PURE__ */ e.createElement("span", { className: o(c.spacer({ c: n })) }), /* @__PURE__ */ e.createElement("span", { className: o(c.nav({ c: n })) }, this.props.commands));
50
+ return /* @__PURE__ */ e.createElement("div", { className: o(c.header({ c: n, vertical: this.props.verticalView })) }, g);
61
51
  }
62
52
  };
63
- s.propTypes = {
53
+ t.propTypes = {
64
54
  activeView: i.number.isRequired,
65
55
  currentDate: i.instanceOf(Date).isRequired,
66
56
  max: i.instanceOf(Date).isRequired,
67
57
  min: i.instanceOf(Date).isRequired,
68
58
  rangeLength: i.number
69
- }, s.defaultProps = {
59
+ }, t.defaultProps = {
70
60
  rangeLength: 1,
71
- min: d,
72
- max: u
61
+ min: T,
62
+ max: D
73
63
  };
74
- let n = s;
75
- m(n);
64
+ let l = t;
65
+ v(l);
76
66
  export {
77
- n as Header
67
+ l as Header
78
68
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),r=require("prop-types"),m=require("@progress/kendo-date-math"),v=require("./CalendarNavigationItem.js"),f=require("../../utils.js"),k=require("../../virtualization/Virtualization.js");function x(p){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const i in p)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(p,i);Object.defineProperty(a,i,o.get?o:{enumerable:!0,get:()=>p[i]})}}return a.default=p,Object.freeze(a)}const h=x(g),D=30,c=class c extends h.Component{constructor(a){super(a),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=t=>{if(this.virtualization=t,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const e=f.dateInRange(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildNavigationItem=t=>{const e=this.props.service.navigationTitle(t),s=this.props.service.isRangeStart(t),n=`kendo-react-calendar-nav-item-${t.getTime()}`,l={text:e,value:t,isRangeStart:s,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?h.createElement(this.props.navigationItem,{...l,key:n},e):h.createElement(v.CalendarNavigationItem,{...l,key:n},e)},this.calculateHeights=()=>{const t=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(t-this.itemHeight)/2,this.bottomOffset=t-this.itemHeight},this.handleDateChange=(t,e)=>{const{onChange:s}=this.props;if(s&&e){const n={value:m.cloneDate(t),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};s.call(void 0,n)}},this.handleScrollAction=({scrollAction:t,pageAction:e})=>{const s=e?e.skip:this.state.skip;if(this.state.skip!==s&&this.setState({skip:s}),this.list&&t){const n=`translateY(${t.offset}px)`;this.list.style.transform=n}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const i=this.props.service.skip(this.props.focusedDate,this.props.min),o=this.props.service.total(this.props.min,this.props.max);this.state={skip:i-this.getTake(i,o)>0?i:0}}get take(){return this.props.take!==void 0?this.props.take:c.defaultProps.take}componentDidUpdate(a,i){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){this.calculateHeights();const a=this.lastView!==this.props.activeView,i=f.dateInRange(this.props.focusedDate,this.props.min,this.props.max),o=a?this.props.service.skip(i,this.props.min):this.state.skip,t=this.props.service.total(this.props.min,this.props.max),e=this.getTake(o,t),s=this.props.service.addToDate(this.props.min,o),n=this.props.service.datesList(s,e);(this.props.activeView!==this.lastView||!m.isEqual(i,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(i,this.props.min));const l=h.createElement(k.Virtualization,{skip:o,take:this.take,total:t,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},h.createElement("ul",{ref:u=>{this.list=u},className:"k-reset"},n.map(u=>this.buildNavigationItem(u))));return h.createElement("div",{className:"k-calendar-navigation"},h.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?l:null)}getTake(a,i){return Math.min(i-a,this.take)}};c.propTypes={activeView:r.number.isRequired,focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,take:r.number,tabIndex:r.number},c.defaultProps={take:D};let d=c;exports.Navigation=d;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),r=require("prop-types"),v=require("@progress/kendo-date-math"),T=require("./CalendarNavigationItem.js"),k=require("../../utils.js"),w=require("../../virtualization/Virtualization.js"),h=require("@progress/kendo-react-common");function V(p){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const e in p)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(a,e,n.get?n:{enumerable:!0,get:()=>p[e]})}}return a.default=p,Object.freeze(a)}const l=V(O),C=30,u=class u extends l.Component{constructor(a){super(a),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=t=>{if(this.virtualization=t,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const i=k.dateInRange(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(i,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildNavigationItem=t=>{const i=this.props.service.navigationTitle(t),s=this.props.service.isRangeStart(t),o=`kendo-react-calendar-nav-item-${t.getTime()}`,c={text:i,value:t,isRangeStart:s,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?l.createElement(this.props.navigationItem,{...c,key:o},i):l.createElement(T.CalendarNavigationItem,{...c,key:o},i)},this.calculateHeights=()=>{const t=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(t-this.itemHeight)/2,this.bottomOffset=t-this.itemHeight},this.handleDateChange=(t,i)=>{const{onChange:s}=this.props;if(s&&i){const o={value:v.cloneDate(t),target:this,nativeEvent:i&&i.nativeEvent,syntheticEvent:i};s.call(void 0,o)}},this.handleScrollAction=({scrollAction:t,pageAction:i})=>{const s=i?i.skip:this.state.skip;if(this.state.skip!==s&&this.setState({skip:s}),this.list&&t){const o=`translateY(${t.offset}px)`;this.list.style.transform=o}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const e=this.props.service.skip(this.props.focusedDate,this.props.min),n=this.props.service.total(this.props.min,this.props.max);this.state={skip:e-this.getTake(e,n)>0?e:0}}get take(){return this.props.take!==void 0?this.props.take:u.defaultProps.take}componentDidUpdate(a,e){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){const{activeView:a,min:e,max:n,service:t,unstyled:i}=this.props;this.calculateHeights();const s=i&&i.uCalendar,o=this.lastView!==a,c=k.dateInRange(this.props.focusedDate,e,n),d=o?t.skip(c,e):this.state.skip,g=t.total(e,n),x=this.getTake(d,g),D=t.addToDate(e,d),b=t.datesList(D,x);(a!==this.lastView||!v.isEqual(c,this.lastFocus))&&(this.indexToScroll=t.skip(c,e));const S=l.createElement(w.Virtualization,{skip:d,take:this.take,total:g,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex,unstyled:i},l.createElement("ul",{ref:m=>{this.list=m},className:h.classNames(h.uCalendar.ul({c:s}))},b.map(m=>this.buildNavigationItem(m))));return l.createElement("div",{className:h.classNames(h.uCalendar.navigation({c:s}))},l.createElement("span",{className:h.classNames(h.uCalendar.navigationHighlight({c:s}))}),this.props.dom.didCalculate?S:null)}getTake(a,e){return Math.min(e-a,this.take)}};u.propTypes={activeView:r.number.isRequired,focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,take:r.number,tabIndex:r.number},u.defaultProps={take:C};let f=u;exports.Navigation=f;
@@ -6,74 +6,76 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
10
- import n from "prop-types";
11
- import { cloneDate as u, isEqual as f } from "@progress/kendo-date-math";
12
- import { CalendarNavigationItem as v } from "./CalendarNavigationItem.mjs";
13
- import { dateInRange as m } from "../../utils.mjs";
14
- import { Virtualization as g } from "../../virtualization/Virtualization.mjs";
15
- const k = 30, p = class p extends a.Component {
16
- constructor(r) {
17
- super(r), this.virtualization = null, this.list = null, this.itemHeight = 0, this.topOffset = 0, this.maxViewHeight = 0, this.bottomOffset = 0, this.handleVirtualizationMount = (t) => {
9
+ import * as n from "react";
10
+ import r from "prop-types";
11
+ import { cloneDate as T, isEqual as V } from "@progress/kendo-date-math";
12
+ import { CalendarNavigationItem as H } from "./CalendarNavigationItem.mjs";
13
+ import { dateInRange as v } from "../../utils.mjs";
14
+ import { Virtualization as S } from "../../virtualization/Virtualization.mjs";
15
+ import { classNames as d, uCalendar as u } from "@progress/kendo-react-common";
16
+ const I = 30, l = class l extends n.Component {
17
+ constructor(o) {
18
+ super(o), this.virtualization = null, this.list = null, this.itemHeight = 0, this.topOffset = 0, this.maxViewHeight = 0, this.bottomOffset = 0, this.handleVirtualizationMount = (t) => {
18
19
  if (this.virtualization = t, this.virtualization && this.list) {
19
20
  this.list.style.transform = `translateY(${this.topOffset}px)`;
20
- const i = m(this.props.focusedDate, this.props.min, this.props.max), s = this.props.service.skip(i, this.props.min);
21
+ const i = v(this.props.focusedDate, this.props.min, this.props.max), s = this.props.service.skip(i, this.props.min);
21
22
  this.virtualization.scrollToIndex(s);
22
23
  }
23
24
  }, this.buildNavigationItem = (t) => {
24
- const i = this.props.service.navigationTitle(t), s = this.props.service.isRangeStart(t), o = `kendo-react-calendar-nav-item-${t.getTime()}`, l = {
25
+ const i = this.props.service.navigationTitle(t), s = this.props.service.isRangeStart(t), a = `kendo-react-calendar-nav-item-${t.getTime()}`, h = {
25
26
  text: i,
26
27
  value: t,
27
28
  isRangeStart: s,
28
29
  view: this.props.activeView,
29
30
  onClick: this.handleDateChange
30
31
  };
31
- return this.props.navigationItem ? /* @__PURE__ */ a.createElement(this.props.navigationItem, { ...l, key: o }, i) : /* @__PURE__ */ a.createElement(v, { ...l, key: o }, i);
32
+ return this.props.navigationItem ? /* @__PURE__ */ n.createElement(this.props.navigationItem, { ...h, key: a }, i) : /* @__PURE__ */ n.createElement(H, { ...h, key: a }, i);
32
33
  }, this.calculateHeights = () => {
33
34
  const t = this.props.dom.calendarHeight;
34
35
  this.itemHeight = this.props.dom.navigationItemHeight || 1, this.maxViewHeight = this.props.dom.monthViewHeight, this.topOffset = (t - this.itemHeight) / 2, this.bottomOffset = t - this.itemHeight;
35
36
  }, this.handleDateChange = (t, i) => {
36
37
  const { onChange: s } = this.props;
37
38
  if (s && i) {
38
- const o = {
39
- value: u(t),
39
+ const a = {
40
+ value: T(t),
40
41
  target: this,
41
42
  nativeEvent: i && i.nativeEvent,
42
43
  syntheticEvent: i
43
44
  };
44
- s.call(void 0, o);
45
+ s.call(void 0, a);
45
46
  }
46
47
  }, this.handleScrollAction = ({ scrollAction: t, pageAction: i }) => {
47
48
  const s = i ? i.skip : this.state.skip;
48
49
  if (this.state.skip !== s && this.setState({ skip: s }), this.list && t) {
49
- const o = `translateY(${t.offset}px)`;
50
- this.list.style.transform = o;
50
+ const a = `translateY(${t.offset}px)`;
51
+ this.list.style.transform = a;
51
52
  }
52
53
  }, this.lastView = this.props.activeView, this.lastFocus = this.props.focusedDate;
53
- const e = this.props.service.skip(this.props.focusedDate, this.props.min), h = this.props.service.total(this.props.min, this.props.max);
54
+ const e = this.props.service.skip(this.props.focusedDate, this.props.min), p = this.props.service.total(this.props.min, this.props.max);
54
55
  this.state = {
55
- skip: e - this.getTake(e, h) > 0 ? e : 0
56
+ skip: e - this.getTake(e, p) > 0 ? e : 0
56
57
  };
57
58
  }
58
59
  get take() {
59
- return this.props.take !== void 0 ? this.props.take : p.defaultProps.take;
60
+ return this.props.take !== void 0 ? this.props.take : l.defaultProps.take;
60
61
  }
61
62
  /**
62
63
  * @hidden
63
64
  */
64
- componentDidUpdate(r, e) {
65
+ componentDidUpdate(o, e) {
65
66
  this.indexToScroll !== void 0 && this.virtualization && this.virtualization.scrollToIndex(this.indexToScroll), this.lastView = this.props.activeView, this.lastFocus = this.props.focusedDate, this.indexToScroll = void 0;
66
67
  }
67
68
  render() {
69
+ const { activeView: o, min: e, max: p, service: t, unstyled: i } = this.props;
68
70
  this.calculateHeights();
69
- const r = this.lastView !== this.props.activeView, e = m(this.props.focusedDate, this.props.min, this.props.max), h = r ? this.props.service.skip(e, this.props.min) : this.state.skip, t = this.props.service.total(this.props.min, this.props.max), i = this.getTake(h, t), s = this.props.service.addToDate(this.props.min, h), o = this.props.service.datesList(s, i);
70
- (this.props.activeView !== this.lastView || !f(e, this.lastFocus)) && (this.indexToScroll = this.props.service.skip(e, this.props.min));
71
- const l = /* @__PURE__ */ a.createElement(
72
- g,
71
+ const s = i && i.uCalendar, a = this.lastView !== o, h = v(this.props.focusedDate, e, p), c = a ? t.skip(h, e) : this.state.skip, f = t.total(e, p), k = this.getTake(c, f), x = t.addToDate(e, c), D = t.datesList(x, k);
72
+ (o !== this.lastView || !V(h, this.lastFocus)) && (this.indexToScroll = t.skip(h, e));
73
+ const w = /* @__PURE__ */ n.createElement(
74
+ S,
73
75
  {
74
- skip: h,
76
+ skip: c,
75
77
  take: this.take,
76
- total: t,
78
+ total: f,
77
79
  itemHeight: this.itemHeight,
78
80
  topOffset: this.topOffset,
79
81
  bottomOffset: this.bottomOffset,
@@ -81,37 +83,38 @@ const k = 30, p = class p extends a.Component {
81
83
  maxScrollDifference: this.maxViewHeight,
82
84
  onScrollAction: this.handleScrollAction,
83
85
  onMount: this.handleVirtualizationMount,
84
- tabIndex: this.props.tabIndex
86
+ tabIndex: this.props.tabIndex,
87
+ unstyled: i
85
88
  },
86
- /* @__PURE__ */ a.createElement("ul", { ref: (c) => {
87
- this.list = c;
88
- }, className: "k-reset" }, o.map((c) => this.buildNavigationItem(c)))
89
+ /* @__PURE__ */ n.createElement("ul", { ref: (m) => {
90
+ this.list = m;
91
+ }, className: d(u.ul({ c: s })) }, D.map((m) => this.buildNavigationItem(m)))
89
92
  );
90
- return /* @__PURE__ */ a.createElement(
93
+ return /* @__PURE__ */ n.createElement(
91
94
  "div",
92
95
  {
93
- className: "k-calendar-navigation"
96
+ className: d(u.navigation({ c: s }))
94
97
  },
95
- /* @__PURE__ */ a.createElement("span", { className: "k-calendar-navigation-highlight" }),
96
- this.props.dom.didCalculate ? l : null
98
+ /* @__PURE__ */ n.createElement("span", { className: d(u.navigationHighlight({ c: s })) }),
99
+ this.props.dom.didCalculate ? w : null
97
100
  );
98
101
  }
99
- getTake(r, e) {
100
- return Math.min(e - r, this.take);
102
+ getTake(o, e) {
103
+ return Math.min(e - o, this.take);
101
104
  }
102
105
  };
103
- p.propTypes = {
104
- activeView: n.number.isRequired,
105
- focusedDate: n.instanceOf(Date).isRequired,
106
- max: n.instanceOf(Date).isRequired,
107
- min: n.instanceOf(Date).isRequired,
108
- onChange: n.func,
109
- take: n.number,
110
- tabIndex: n.number
111
- }, p.defaultProps = {
112
- take: k
106
+ l.propTypes = {
107
+ activeView: r.number.isRequired,
108
+ focusedDate: r.instanceOf(Date).isRequired,
109
+ max: r.instanceOf(Date).isRequired,
110
+ min: r.instanceOf(Date).isRequired,
111
+ onChange: r.func,
112
+ take: r.number,
113
+ tabIndex: r.number
114
+ }, l.defaultProps = {
115
+ take: I
113
116
  };
114
- let d = p;
117
+ let g = l;
115
118
  export {
116
- d as Navigation
119
+ g as Navigation
117
120
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),a=require("prop-types"),d=require("@progress/kendo-react-intl"),m=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-date-math"),r=require("../../messages/index.js"),i=require("../../utils.js");function h(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const u=h(p),n=class n extends u.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:i.dateInRange(i.getToday(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:n.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:n.defaultProps.max}get todayIsInRange(){return i.isInRange(i.getToday(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=d.provideLocalizationService(this);const e=this.localization.toLanguageString(r.today,r.messages[r.today]),t=m.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return u.createElement(g.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat",themeColor:"base",role:"link"},e)}};n.propTypes={max:a.instanceOf(Date).isRequired,min:a.instanceOf(Date).isRequired,onClick:a.func,disabled:a.bool},n.defaultProps={min:i.MIN_DATE,max:i.MAX_DATE};let o=n;d.registerForLocalization(o);exports.TodayCommand=o;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),o=require("prop-types"),p=require("@progress/kendo-react-intl"),l=require("@progress/kendo-react-common"),y=require("@progress/kendo-react-buttons"),u=require("@progress/kendo-date-math"),c=require("../../messages/index.js"),n=require("../../utils.js");function b(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const d=b(f),s=class s extends d.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:n.dateInRange(n.getToday(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:s.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:s.defaultProps.max}get todayIsInRange(){return n.isInRange(n.getToday(),u.getDate(this.min),u.getDate(this.max))}render(){const{disabled:e,tabIndex:t,unstyled:a}=this.props,m=a&&a.uCalendar;this.localization=p.provideLocalizationService(this);const g=this.localization.toLanguageString(c.today,c.messages[c.today]),h=l.classNames(l.uCalendar.today({c:m,disabled:e}));return d.createElement(y.Button,{className:h,onClick:this.handleClick,tabIndex:t,fillMode:"flat",themeColor:"base",role:"link"},g)}};s.propTypes={max:o.instanceOf(Date).isRequired,min:o.instanceOf(Date).isRequired,onClick:o.func,disabled:o.bool},s.defaultProps={min:n.MIN_DATE,max:n.MAX_DATE};let r=s;p.registerForLocalization(r);exports.TodayCommand=r;
@@ -6,22 +6,22 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as o from "react";
9
+ import * as r from "react";
10
10
  import e from "prop-types";
11
- import { provideLocalizationService as p, registerForLocalization as m } from "@progress/kendo-react-intl";
12
- import { classNames as c } from "@progress/kendo-react-common";
13
- import { Button as d } from "@progress/kendo-react-buttons";
14
- import { getDate as r } from "@progress/kendo-date-math";
15
- import { today as n, messages as h } from "../../messages/index.mjs";
16
- import { dateInRange as u, getToday as l, MIN_DATE as f, MAX_DATE as g, isInRange as x } from "../../utils.mjs";
17
- const t = class t extends o.Component {
11
+ import { provideLocalizationService as h, registerForLocalization as u } from "@progress/kendo-react-intl";
12
+ import { classNames as f, uCalendar as g } from "@progress/kendo-react-common";
13
+ import { Button as x } from "@progress/kendo-react-buttons";
14
+ import { getDate as n } from "@progress/kendo-date-math";
15
+ import { today as l, messages as v } from "../../messages/index.mjs";
16
+ import { dateInRange as C, getToday as m, MIN_DATE as k, MAX_DATE as I, isInRange as y } from "../../utils.mjs";
17
+ const t = class t extends r.Component {
18
18
  constructor() {
19
19
  super(...arguments), this.localization = null, this.handleClick = (i) => {
20
20
  if (this.todayIsInRange && this.props.onClick) {
21
21
  const s = {
22
22
  syntheticEvent: i,
23
23
  nativeEvent: i.nativeEvent,
24
- value: u(l(), this.min, this.max),
24
+ value: C(m(), this.min, this.max),
25
25
  target: this,
26
26
  isTodayClick: !0
27
27
  };
@@ -36,27 +36,23 @@ const t = class t extends o.Component {
36
36
  return this.props.max !== void 0 ? this.props.max : t.defaultProps.max;
37
37
  }
38
38
  get todayIsInRange() {
39
- return x(l(), r(this.min), r(this.max));
39
+ return y(m(), n(this.min), n(this.max));
40
40
  }
41
41
  render() {
42
- this.localization = p(this);
43
- const i = this.localization.toLanguageString(n, h[n]), s = c(
44
- "k-calendar-nav-today",
42
+ const { disabled: i, tabIndex: s, unstyled: o } = this.props, p = o && o.uCalendar;
43
+ this.localization = h(this);
44
+ const c = this.localization.toLanguageString(l, v[l]), d = f(g.today({ c: p, disabled: i }));
45
+ return /* @__PURE__ */ r.createElement(
46
+ x,
45
47
  {
46
- "k-disabled": this.props.disabled
47
- }
48
- );
49
- return /* @__PURE__ */ o.createElement(
50
- d,
51
- {
52
- className: s,
48
+ className: d,
53
49
  onClick: this.handleClick,
54
- tabIndex: this.props.tabIndex,
50
+ tabIndex: s,
55
51
  fillMode: "flat",
56
52
  themeColor: "base",
57
53
  role: "link"
58
54
  },
59
- i
55
+ c
60
56
  );
61
57
  }
62
58
  };
@@ -66,11 +62,11 @@ t.propTypes = {
66
62
  onClick: e.func,
67
63
  disabled: e.bool
68
64
  }, t.defaultProps = {
69
- min: f,
70
- max: g
65
+ min: k,
66
+ max: I
71
67
  };
72
68
  let a = t;
73
- m(a);
69
+ u(a);
74
70
  export {
75
71
  a as TodayCommand
76
72
  };
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),r=require("prop-types"),p=require("@progress/kendo-date-math"),D=require("@progress/kendo-react-intl"),v=require("./CalendarCell.js"),g=require("./CalendarWeekCell.js"),k=require("../models/CalendarViewEnum.js"),m=require("../../utils.js"),b=require("../services/WeekNamesService.js");function y(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const i=y(w),f=o=>i.createElement("td",{key:o,className:"k-calendar-td k-empty"}," "),h=class h extends i.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(t,e)=>{if(!this.firstDate(t))return f(`week-cell-${e}`);const a=this.firstDate(t),n=this.getWeekNumber(a),l=`kendo-react-calendar-week-cell-${n}`,c={className:"k-alt",value:n,firstDate:a,weekDays:t,onClick:this.handleWeekCellClick};return this.props.weekCell?i.createElement(this.props.weekCell,{...c,key:l},n):i.createElement(g.CalendarWeekCell,{...c,key:l},n)},this.buildRow=t=>t.map((e,s)=>{if(!e)return f(s);const a={"aria-selected":e.isSelected},n=`kendo-react-calendar-cell-${e.value.getTime()}`,l={...a,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?i.createElement(this.props.cell,{...l,key:n},e.formattedValue):i.createElement(v.CalendarCell,{...l,key:n},e.formattedValue)}),this.firstDate=t=>{const e=this.firstWeekDateContext(t);return e?e.value:null},this.firstWeekDateContext=t=>{if(!this.weekNumber)return null;let e=0,s=t[e];for(;!s&&e<t.length;)s=t[++e];return s},this.handleClick=(t,e)=>{const{onChange:s}=this.props;if(s&&e){const a={value:p.cloneDate(t),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};s.call(void 0,a)}},this.handleWeekCellClick=(t,e,s)=>{const{onWeekSelect:a}=this.props,n=e.findIndex(l=>l&&l.value===t);a&&s&&a.call(void 0,t,n,s)},this.handleMouseEnter=t=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,p.cloneDate(t))},this.handleMouseLeave=t=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,p.cloneDate(t))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===k.CalendarViewEnum.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===k.CalendarViewEnum.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:h.defaultProps.selectedDate}render(){this.intl=D.provideIntlService(this),this.weekService=new b.WeekNamesService(this.intl);const t=this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat),e=this.props.service.rowLength(this.weekNumber),s=this.props.service.title(this.props.viewDate),a=m.getToday(),n=m.setTime(this.props.viewDate,a),l=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:n});return i.createElement(i.Fragment,null,this.isMonthView&&this.isHorizontal&&i.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},i.createElement("tr",{role:"row",className:"k-calendar-tr"},t.map((c,u)=>i.createElement("th",{key:u,className:"k-calendar-th"},c)))),i.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&i.createElement("tr",{role:"presentation",className:"k-calendar-tr"},i.createElement("th",{scope:"col",colSpan:e,className:"k-calendar-caption"},s)),l.map((c,u)=>i.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(c,u),this.buildRow(c)))))}getWeekNumber(t){return!this.weekNumber||!this.intl?null:p.weekInYear(t,this.intl.firstDay())}};h.propTypes={activeRangeEnd:r.oneOf(["start","end",null]),activeView:r.number.isRequired,cellUID:r.string.isRequired,direction:r.oneOf(["horizontal","vertical"]),focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,selectedDate:r.oneOfType([r.instanceOf(Date),r.arrayOf(r.instanceOf(Date))]),showWeekNumbers:r.bool,showOtherMonthDays:r.bool,viewDate:r.instanceOf(Date).isRequired},h.defaultProps={direction:"vertical",selectedDate:m.getToday(),showWeekNumbers:!1};let d=h;D.registerForIntl(d);exports.View=d;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),r=require("prop-types"),k=require("@progress/kendo-date-math"),y=require("@progress/kendo-react-intl"),R=require("./CalendarCell.js"),M=require("./CalendarWeekCell.js"),v=require("../models/CalendarViewEnum.js"),w=require("../../utils.js"),S=require("../services/WeekNamesService.js"),a=require("@progress/kendo-react-common");function V(c){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const e in c)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(c,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>c[e]})}}return t.default=c,Object.freeze(t)}const n=V(W),C=(c,t)=>{const e=t;return n.createElement("td",{key:c,role:"gridcell",className:a.classNames(a.uCalendar.td({c:e,isEmpty:!0}))}," ")},h=class h extends n.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(t,e)=>{if(!this.firstDate(t))return C(`week-cell-${e}`);const i=this.firstDate(t),l=this.getWeekNumber(i),o=`kendo-react-calendar-week-cell-${l}`,d={value:l,firstDate:i,weekDays:t,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?n.createElement(this.props.weekCell,{...d,key:o},l):n.createElement(M.CalendarWeekCell,{...d,key:o},l)},this.buildRow=t=>t.map((e,s)=>{if(!e)return C(s);const i={"aria-selected":e.isSelected},l=`kendo-react-calendar-cell-${e.value.getTime()}`,o={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,unstyled:this.props.unstyled,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?n.createElement(this.props.cell,{...o,key:l},e.formattedValue):n.createElement(R.CalendarCell,{...o,key:l},e.formattedValue)}),this.firstDate=t=>{const e=this.firstWeekDateContext(t);return e?e.value:null},this.firstWeekDateContext=t=>{if(!this.weekNumber)return null;let e=0,s=t[e];for(;!s&&e<t.length;)s=t[++e];return s},this.handleClick=(t,e)=>{const{onChange:s}=this.props;if(s&&e){const i={value:k.cloneDate(t),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};s.call(void 0,i)}},this.handleWeekCellClick=(t,e,s)=>{const{onWeekSelect:i}=this.props,l=e.findIndex(o=>o&&o.value===t);i&&s&&i.call(void 0,t,l,s)},this.handleMouseEnter=t=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,k.cloneDate(t))},this.handleMouseLeave=t=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,k.cloneDate(t))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===v.CalendarViewEnum.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===v.CalendarViewEnum.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:h.defaultProps.selectedDate}render(){const{service:t,weekDaysFormat:e,cellUID:s,focusedDate:i,bus:l,activeView:o,selectionRange:d,unstyled:D}=this.props,u=D&&D.uCalendar;this.intl=y.provideIntlService(this),this.weekService=new S.WeekNamesService(this.intl);const g=this.weekService.getWeekNames(this.weekNumber,e),N=t.rowLength(this.weekNumber),b=t.title(this.props.viewDate),E=w.getToday(),O=w.setTime(this.props.viewDate,E),q=t.data({cellUID:s,min:this.min,max:this.max,focusedDate:i,isActiveView:!l.canMoveDown(o),selectedDate:this.selectedDate,selectionRange:d,viewDate:O});return n.createElement(n.Fragment,null,this.isMonthView&&this.isHorizontal&&n.createElement("thead",{role:"rowgroup",className:a.classNames(a.uCalendar.thead({c:u}))},n.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u}))},g.map((m,p)=>n.createElement("th",{key:p,className:a.classNames(a.uCalendar.th({c:u}))},m)))),n.createElement("tbody",{role:"rowgroup",className:a.classNames(a.uCalendar.tbody({c:u}))},!this.isHorizontal&&n.createElement("tr",{role:"presentation",className:a.classNames(a.uCalendar.tr({c:u}))},n.createElement("th",{scope:"col",colSpan:N,className:a.classNames(a.uCalendar.caption({c:u}))},b)),q.map((m,p)=>n.createElement("tr",{role:"row",className:a.classNames(a.uCalendar.tr({c:u})),key:p},this.weekNumber&&this.buildWeekNumber(m,p),this.buildRow(m)))))}getWeekNumber(t){return!this.weekNumber||!this.intl?null:k.weekInYear(t,this.intl.firstDay())}};h.propTypes={activeRangeEnd:r.oneOf(["start","end",null]),activeView:r.number.isRequired,cellUID:r.string.isRequired,direction:r.oneOf(["horizontal","vertical"]),focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,selectedDate:r.oneOfType([r.instanceOf(Date),r.arrayOf(r.instanceOf(Date))]),showWeekNumbers:r.bool,showOtherMonthDays:r.bool,viewDate:r.instanceOf(Date).isRequired},h.defaultProps={direction:"vertical",selectedDate:w.getToday(),showWeekNumbers:!1};let f=h;y.registerForIntl(f);exports.View=f;