@progress/kendo-react-dateinputs 8.3.0-develop.5 → 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
@@ -8,14 +8,14 @@
8
8
  "use client";
9
9
  import * as a from "react";
10
10
  import t from "prop-types";
11
- import { cloneDate as c } from "@progress/kendo-date-math";
12
- import { Keys as h, classNames as E, getActiveElement as T } from "@progress/kendo-react-common";
13
- import { provideIntlService as _, provideLocalizationService as I, registerForIntl as S, registerForLocalization as x } from "@progress/kendo-react-intl";
14
- import { timePickerCancel as v, messages as g, timePickerSet as w } from "../messages/index.mjs";
15
- import { MIDNIGHT_DATE as A, MIN_TIME as K, MAX_TIME as M } from "../utils.mjs";
16
- import { getNow as d, valueMerger as R, generateGetters as F } from "./utils.mjs";
17
- import { TimePart as L } from "./TimePart.mjs";
18
- import { Button as b } from "@progress/kendo-react-buttons";
11
+ import { cloneDate as u } from "@progress/kendo-date-math";
12
+ import { Keys as h, classNames as m, uTimePicker as x, uTime as g, getActiveElement as A } from "@progress/kendo-react-common";
13
+ import { provideIntlService as K, provideLocalizationService as M, registerForIntl as R, registerForLocalization as F } from "@progress/kendo-react-intl";
14
+ import { timePickerCancel as y, messages as B, timePickerSet as D } from "../messages/index.mjs";
15
+ import { MIDNIGHT_DATE as L, MIN_TIME as j, MAX_TIME as z } from "../utils.mjs";
16
+ import { getNow as w, valueMerger as V, generateGetters as G } from "./utils.mjs";
17
+ import { TimePart as H } from "./TimePart.mjs";
18
+ import { Button as O } from "@progress/kendo-react-buttons";
19
19
  const r = class r extends a.Component {
20
20
  constructor(i) {
21
21
  super(i), this._element = null, this._cancelButton = null, this._acceptButton = null, this.timePart = null, this.focusActiveList = () => {
@@ -33,12 +33,12 @@ const r = class r extends a.Component {
33
33
  const { keyCode: n, shiftKey: o } = e;
34
34
  !o && n === h.tab && (e.preventDefault(), this.props.nowButton !== !1 ? this.timePart && this.timePart.focus({ preventScroll: !0 }, !0) : this.timePart && this.timePart.focus({ preventScroll: !0 }));
35
35
  }, this.handleNowKeyDown = (e) => {
36
- var l;
36
+ var c;
37
37
  const { keyCode: n, shiftKey: o } = e;
38
- o && n === h.tab ? (e.preventDefault(), this._acceptButton && ((l = this._acceptButton.element) == null || l.focus({ preventScroll: !0 }))) : n === h.enter && (e.stopPropagation(), this.handleNowClick(e));
38
+ o && n === h.tab ? (e.preventDefault(), this._acceptButton && ((c = this._acceptButton.element) == null || c.focus({ preventScroll: !0 }))) : n === h.enter && (e.stopPropagation(), this.handleNowClick(e));
39
39
  }, this.handleAccept = (e) => {
40
40
  const n = this.mergeValue(
41
- c(this.value || d()),
41
+ u(this.value || w()),
42
42
  this.timePart ? this.timePart.value : this.current
43
43
  );
44
44
  this.setState({ value: n }), this.valueDuringOnChange = n;
@@ -55,8 +55,8 @@ const r = class r extends a.Component {
55
55
  n && n.call(void 0, e);
56
56
  }, this.handleNowClick = (e) => {
57
57
  const n = this.mergeValue(
58
- c(this.value || d()),
59
- d()
58
+ u(this.value || w()),
59
+ w()
60
60
  );
61
61
  this.setState({
62
62
  current: n,
@@ -75,8 +75,8 @@ const r = class r extends a.Component {
75
75
  n && n.call(void 0, {
76
76
  time: e
77
77
  });
78
- }, this.dateFormatParts = this.intl.splitDateFormat(this.props.format || r.defaultProps.format), this.mergeValue = R(F(this.dateFormatParts)), this.hasActiveButton = this.hasActiveButton.bind(this), this.state = {
79
- current: this.props.value || A,
78
+ }, this.dateFormatParts = this.intl.splitDateFormat(this.props.format || r.defaultProps.format), this.mergeValue = V(G(this.dateFormatParts)), this.hasActiveButton = this.hasActiveButton.bind(this), this.state = {
79
+ current: this.props.value || L,
80
80
  value: this.props.value || r.defaultProps.value
81
81
  };
82
82
  }
@@ -88,13 +88,13 @@ const r = class r extends a.Component {
88
88
  }
89
89
  get value() {
90
90
  const i = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
91
- return i !== null ? c(i) : null;
91
+ return i !== null ? u(i) : null;
92
92
  }
93
93
  get intl() {
94
- return _(this);
94
+ return K(this);
95
95
  }
96
96
  get current() {
97
- return this.state.current !== null ? c(this.state.current) : null;
97
+ return this.state.current !== null ? u(this.state.current) : null;
98
98
  }
99
99
  /**
100
100
  * @hidden
@@ -111,16 +111,17 @@ const r = class r extends a.Component {
111
111
  cancelButton: e,
112
112
  disabled: n,
113
113
  tabIndex: o,
114
- className: l,
115
- smoothScroll: k,
116
- min: B,
117
- max: y,
118
- boundRange: C,
119
- nowButton: D,
120
- steps: O,
121
- show: N,
122
- mobileMode: P
123
- } = this.props, f = I(this), m = f.toLanguageString(v, g[v]), p = f.toLanguageString(w, g[w]);
114
+ className: c,
115
+ smoothScroll: P,
116
+ min: N,
117
+ max: k,
118
+ boundRange: T,
119
+ nowButton: E,
120
+ steps: S,
121
+ show: _,
122
+ mobileMode: b,
123
+ unstyled: l
124
+ } = this.props, I = l && l.uTimePicker, d = l && l.uTime, C = M(this), f = C.toLanguageString(y, B[y]), v = C.toLanguageString(D, B[D]);
124
125
  return /* @__PURE__ */ a.createElement(
125
126
  "div",
126
127
  {
@@ -128,13 +129,18 @@ const r = class r extends a.Component {
128
129
  this._element = s;
129
130
  },
130
131
  tabIndex: n ? void 0 : o || 0,
131
- className: E("k-timeselector k-timeselector-md", l, {
132
- "k-disabled": n
133
- }),
132
+ className: m(
133
+ x.timeSelector({
134
+ c: I,
135
+ mobileMode: b,
136
+ disabled: n
137
+ }),
138
+ c
139
+ ),
134
140
  onKeyDown: this.handleKeyDown
135
141
  },
136
142
  /* @__PURE__ */ a.createElement(
137
- L,
143
+ H,
138
144
  {
139
145
  ref: (s) => {
140
146
  this.timePart = s;
@@ -143,46 +149,47 @@ const r = class r extends a.Component {
143
149
  onChange: this.handleChange,
144
150
  onNowClick: this.handleNowClick,
145
151
  format: i,
146
- smoothScroll: k,
147
- min: B,
148
- max: y,
149
- boundRange: C,
152
+ smoothScroll: P,
153
+ min: N,
154
+ max: k,
155
+ boundRange: T,
150
156
  disabled: n,
151
- nowButton: D,
152
- steps: O,
153
- show: N,
154
- mobileMode: P,
155
- onNowKeyDown: this.handleNowKeyDown
157
+ nowButton: E,
158
+ steps: S,
159
+ show: _,
160
+ mobileMode: b,
161
+ onNowKeyDown: this.handleNowKeyDown,
162
+ unstyled: l
156
163
  }
157
164
  ),
158
- this.props.footer && /* @__PURE__ */ a.createElement("div", { className: "k-time-footer k-actions k-actions-stretched k-actions-horizontal" }, e && /* @__PURE__ */ a.createElement(
159
- b,
165
+ this.props.footer && /* @__PURE__ */ a.createElement("div", { className: m(g.footer({ c: d })) }, e && /* @__PURE__ */ a.createElement(
166
+ O,
160
167
  {
161
168
  type: "button",
162
169
  ref: (s) => {
163
170
  this._cancelButton = s;
164
171
  },
165
- className: "k-time-cancel",
172
+ className: m(g.cancel({ c: d })),
166
173
  onClick: this.handleReject,
167
- title: m,
168
- "aria-label": m
174
+ title: f,
175
+ "aria-label": f
169
176
  },
170
- m
177
+ f
171
178
  ), /* @__PURE__ */ a.createElement(
172
- b,
179
+ O,
173
180
  {
174
181
  type: "button",
175
182
  ref: (s) => {
176
183
  this._acceptButton = s;
177
184
  },
178
- className: "k-time-accept",
185
+ className: m(g.accept({ c: d })),
179
186
  themeColor: "primary",
180
187
  onClick: this.handleAccept,
181
188
  onKeyDown: this.revertToNowButton,
182
- title: p,
183
- "aria-label": p
189
+ title: v,
190
+ "aria-label": v
184
191
  },
185
- p
192
+ v
186
193
  ))
187
194
  );
188
195
  }
@@ -192,7 +199,7 @@ const r = class r extends a.Component {
192
199
  hasActiveButton() {
193
200
  if (!this._acceptButton || !this._acceptButton.element)
194
201
  return !1;
195
- const i = T(document);
202
+ const i = A(document);
196
203
  return this._acceptButton && i === this._acceptButton.element || this._cancelButton && i === this._cancelButton.element;
197
204
  }
198
205
  };
@@ -237,14 +244,14 @@ r.propTypes = {
237
244
  disabled: !1,
238
245
  cancelButton: !0,
239
246
  format: "t",
240
- min: K,
241
- max: M,
247
+ min: j,
248
+ max: z,
242
249
  boundRange: !1,
243
250
  footer: !0
244
251
  };
245
- let u = r;
246
- S(u);
247
- x(u);
252
+ let p = r;
253
+ R(p);
254
+ F(p);
248
255
  export {
249
- u as TimeSelector
256
+ p as TimeSelector
250
257
  };
@@ -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 b=require("react"),s=require("prop-types"),d=require("@progress/kendo-react-common"),w=require("./services/ScrollerService.js");function H(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const h=H(b),P=(r,e,t)=>Math.min(Math.abs(e-r),t),T=17,O=10,A={1:r=>e=>e+r,0:r=>e=>e-r},x={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},I={1:r=>e=>e<r,0:r=>e=>e>r},c=class c extends h.Component{constructor(e){super(e),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const i=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const o=this.scrollContainer[i];this.restrictScroll&&i==="scrollTop"&&(!Number.isInteger(o)||!Number.isInteger(t))&&Math.abs(o-t)<O||(this.scrollContainer[i]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const i=this.rowHeightService.offset(t),o=this.getContainerScrollDirection(i);let{start:n,end:l}=this.scrollRange(i,o);if(n===l)return;const f=this.scrollStep(n,l),a=A[o](f),p=x[o](l),g=I[o](a(l)),m=v=>{this.animationInProgress=!0;const S=a(v);this.scrollTo(p(S)),g(S)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(S)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(n)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const o=this.props.scrollDuration||c.defaultProps.scrollDuration;return Math.abs(i-t)/(o/T)},this.scrollRange=(t,i)=>{const o=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${o}`,10))return{start:t,end:t};const n=this.containerMaxScroll(),l=i===0?1:-1,f=P(o,t,this.props.maxScrollDifference||0),a=Math.min(t,n);return{start:Math.min(Math.max(a+l*f,0),n),end:a}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const i=this.direction==="vertical"?t.itemHeight:t.itemWidth;i!==void 0&&(this.rowHeightService=new d.RowHeightService(t.total,i,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const i=t.target;this.scrollerService.onScroll({scrollLeft:i.scrollLeft,scrollTop:i.scrollTop,offsetHeight:i.offsetHeight,offsetWidth:i.offsetWidth});const o=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:n}=this.props,l={index:o,target:i,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),n&&n.call(void 0,l),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new w.ScrollerService(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(h.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:c.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:c.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,o=this.rowHeightService.offset(e),n=o+this.rowHeightService.height(e);return o>=t&&n<=i}isListScrolled(e){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(e):!1}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const e=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${e}px`}:{width:`${e}px`},i=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),o=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return h.createElement("div",{ref:n=>{this.scrollContainer=n},onScroll:this.handleScroll,className:i,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,h.createElement("div",{style:t,className:o}))}};c.propTypes={bottomOffset:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},c.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let u=c;exports.Virtualization=u;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),s=require("prop-types"),d=require("@progress/kendo-react-common"),H=require("./services/ScrollerService.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const g=P(w),T=(r,e,t)=>Math.min(Math.abs(e-r),t),C=17,O=10,A={1:r=>e=>e+r,0:r=>e=>e-r},x={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},I={1:r=>e=>e<r,0:r=>e=>e>r},a=class a extends g.Component{constructor(e){super(e),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const i=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const o=this.scrollContainer[i];this.restrictScroll&&i==="scrollTop"&&(!Number.isInteger(o)||!Number.isInteger(t))&&Math.abs(o-t)<O||(this.scrollContainer[i]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const i=this.rowHeightService.offset(t),o=this.getContainerScrollDirection(i);let{start:n,end:l}=this.scrollRange(i,o);if(n===l)return;const h=this.scrollStep(n,l),c=A[o](h),f=x[o](l),u=I[o](c(l)),m=p=>{this.animationInProgress=!0;const S=c(p);this.scrollTo(f(S)),u(S)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(S)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(n)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const o=this.props.scrollDuration||a.defaultProps.scrollDuration;return Math.abs(i-t)/(o/C)},this.scrollRange=(t,i)=>{const o=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${o}`,10))return{start:t,end:t};const n=this.containerMaxScroll(),l=i===0?1:-1,h=T(o,t,this.props.maxScrollDifference||0),c=Math.min(t,n);return{start:Math.min(Math.max(c+l*h,0),n),end:c}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const i=this.direction==="vertical"?t.itemHeight:t.itemWidth;i!==void 0&&(this.rowHeightService=new d.RowHeightService(t.total,i,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const i=t.target;this.scrollerService.onScroll({scrollLeft:i.scrollLeft,scrollTop:i.scrollTop,offsetHeight:i.offsetHeight,offsetWidth:i.offsetWidth});const o=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:n}=this.props,l={index:o,target:i,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),n&&n.call(void 0,l),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new H.ScrollerService(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(g.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:a.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:a.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,o=this.rowHeightService.offset(e),n=o+this.rowHeightService.height(e);return o>=t&&n<=i}isListScrolled(e){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(e):!1}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){const{total:e,take:t,bottomOffset:i,className:o,tabIndex:n,role:l,children:h,unstyled:c}=this.props,f=c&&c.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const u=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,m=this.direction==="vertical"?{height:`${u}px`}:{width:`${u}px`},p=d.classNames(d.uCalendar.scrollable({c:f,horizontal:this.direction==="horizontal"}),o),S=d.classNames(d.uCalendar.scrollablePlaceholder({c:f,horizontal:this.direction==="horizontal"}));return g.createElement("div",{ref:b=>{this.scrollContainer=b},onScroll:this.handleScroll,className:p,tabIndex:n,role:l},h,g.createElement("div",{style:m,className:S}))}};a.propTypes={bottomOffset:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},a.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let v=a;exports.Virtualization=v;
@@ -6,27 +6,27 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
9
+ import * as u from "react";
10
10
  import o from "prop-types";
11
- import { RowHeightService as w, classNames as m } from "@progress/kendo-react-common";
12
- import { ScrollerService as b } from "./services/ScrollerService.mjs";
13
- const H = (s, i, t) => Math.min(Math.abs(i - s), t), P = 17, T = 10, x = {
11
+ import { RowHeightService as b, classNames as p, uCalendar as v } from "@progress/kendo-react-common";
12
+ import { ScrollerService as P } from "./services/ScrollerService.mjs";
13
+ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
14
14
  1: (s) => (i) => i + s,
15
15
  0: (s) => (i) => i - s
16
- }, A = {
16
+ }, I = {
17
17
  1: (s) => (i) => Math.min(i, s),
18
18
  0: (s) => (i) => Math.max(i, s)
19
- }, I = {
19
+ }, M = {
20
20
  1: (s) => (i) => i < s,
21
21
  0: (s) => (i) => i > s
22
- }, c = class c extends a.Component {
22
+ }, a = class a extends u.Component {
23
23
  constructor(i) {
24
24
  super(i), this.rowHeightService = null, this.scrollContainer = null, this.lastDirection = null, this.lastTotal = 0, this.lastTake = 0, this.animationInProgress = !1, this.restrictScroll = !1, this.scrollTo = (t) => {
25
25
  const e = this.direction === "vertical" ? "scrollTop" : "scrollLeft";
26
26
  if (!this.scrollContainer)
27
27
  return;
28
28
  const r = this.scrollContainer[e];
29
- this.restrictScroll && e === "scrollTop" && (!Number.isInteger(r) || !Number.isInteger(t)) && Math.abs(r - t) < T || (this.scrollContainer[e] = t);
29
+ this.restrictScroll && e === "scrollTop" && (!Number.isInteger(r) || !Number.isInteger(t)) && Math.abs(r - t) < C || (this.scrollContainer[e] = t);
30
30
  }, this.scrollToIndex = (t) => {
31
31
  this.animationInProgress = !1, this.rowHeightService && this.scrollTo(this.rowHeightService.offset(t));
32
32
  }, this.animateToIndex = (t) => {
@@ -37,30 +37,30 @@ const H = (s, i, t) => Math.min(Math.abs(i - s), t), P = 17, T = 10, x = {
37
37
  let { start: n, end: l } = this.scrollRange(e, r);
38
38
  if (n === l)
39
39
  return;
40
- const f = this.scrollStep(n, l), h = x[r](f), d = A[r](l), u = I[r](h(l)), p = (v) => {
40
+ const h = this.scrollStep(n, l), c = x[r](h), f = I[r](l), d = M[r](c(l)), m = (g) => {
41
41
  this.animationInProgress = !0;
42
- const S = h(v);
43
- this.scrollTo(d(S)), u(S) ? this.cancelAnimation = window.requestAnimationFrame(() => {
44
- p(S);
42
+ const S = c(g);
43
+ this.scrollTo(f(S)), d(S) ? this.cancelAnimation = window.requestAnimationFrame(() => {
44
+ m(S);
45
45
  }) : this.animationInProgress = !1;
46
46
  };
47
47
  this.cancelAnimation = window.requestAnimationFrame(() => {
48
- p(n);
48
+ m(n);
49
49
  });
50
50
  }, this.scrollToBottom = () => {
51
51
  this.rowHeightService && this.scrollTo(this.rowHeightService.totalHeight() + this.props.bottomOffset);
52
52
  }, this.scrollStep = (t, e) => {
53
- const r = this.props.scrollDuration || c.defaultProps.scrollDuration;
54
- return Math.abs(e - t) / (r / P);
53
+ const r = this.props.scrollDuration || a.defaultProps.scrollDuration;
54
+ return Math.abs(e - t) / (r / A);
55
55
  }, this.scrollRange = (t, e) => {
56
56
  const r = this.containerScrollPosition;
57
57
  if (parseInt(`${t}`, 10) === parseInt(`${r}`, 10))
58
58
  return { start: t, end: t };
59
- const n = this.containerMaxScroll(), l = e === 0 ? 1 : -1, f = H(r, t, this.props.maxScrollDifference || 0), h = Math.min(t, n);
60
- return { start: Math.min(Math.max(h + l * f, 0), n), end: h };
59
+ const n = this.containerMaxScroll(), l = e === 0 ? 1 : -1, h = T(r, t, this.props.maxScrollDifference || 0), c = Math.min(t, n);
60
+ return { start: Math.min(Math.max(c + l * h, 0), n), end: c };
61
61
  }, this.containerMaxScroll = () => this.containerScrollSize - this.containerOffsetSize, this.getContainerScrollDirection = (t) => t < this.containerScrollPosition ? 0 : 1, this.initServices = (t = this.props) => {
62
62
  const e = this.direction === "vertical" ? t.itemHeight : t.itemWidth;
63
- e !== void 0 && (this.rowHeightService = new w(t.total, e, 0), this.scrollerService.create(
63
+ e !== void 0 && (this.rowHeightService = new b(t.total, e, 0), this.scrollerService.create(
64
64
  this.rowHeightService,
65
65
  t.skip,
66
66
  t.take,
@@ -91,10 +91,10 @@ const H = (s, i, t) => Math.min(Math.abs(i - s), t), P = 17, T = 10, x = {
91
91
  this.scrollAction = t;
92
92
  }, this.handlePageAction = (t) => {
93
93
  this.pageAction = t;
94
- }, this.scrollerService = new b(
94
+ }, this.scrollerService = new P(
95
95
  this.handleScrollAction,
96
96
  this.handlePageAction
97
- ), this.restrictScroll = Number.parseFloat(a.version) > 17;
97
+ ), this.restrictScroll = Number.parseFloat(u.version) > 17;
98
98
  }
99
99
  get element() {
100
100
  return this.scrollContainer;
@@ -109,10 +109,10 @@ const H = (s, i, t) => Math.min(Math.abs(i - s), t), P = 17, T = 10, x = {
109
109
  return this.getContainerProperty(this.direction === "vertical" ? "scrollTop" : "scrollLeft");
110
110
  }
111
111
  get direction() {
112
- return this.props.direction !== void 0 ? this.props.direction : c.defaultProps.direction;
112
+ return this.props.direction !== void 0 ? this.props.direction : a.defaultProps.direction;
113
113
  }
114
114
  get scrollOffsetSize() {
115
- return this.props.scrollOffsetSize !== void 0 ? this.props.scrollOffsetSize : c.defaultProps.scrollOffsetSize;
115
+ return this.props.scrollOffsetSize !== void 0 ? this.props.scrollOffsetSize : a.defaultProps.scrollOffsetSize;
116
116
  }
117
117
  activeIndex() {
118
118
  return this.itemIndex(Math.ceil(this.containerScrollPosition));
@@ -137,42 +137,43 @@ const H = (s, i, t) => Math.min(Math.abs(i - s), t), P = 17, T = 10, x = {
137
137
  i && i.call(void 0, this);
138
138
  }
139
139
  render() {
140
- (this.lastTotal !== this.props.total || this.lastDirection !== this.direction || this.lastTake !== this.props.take) && (this.initServices(), this.lastTotal = this.props.total, this.lastDirection = this.direction, this.lastTake = this.props.take);
141
- const i = `${(this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + this.props.bottomOffset}`, t = this.direction === "vertical" ? { height: `${i}px` } : { width: `${i}px` }, e = m(
142
- "k-content k-scrollable",
143
- {
144
- "k-scrollable-horizontal": this.direction === "horizontal"
145
- },
146
- this.props.className
147
- ), r = m(
148
- "k-scrollable-placeholder",
149
- {
150
- "k-scrollable-horizontal-placeholder": this.direction === "horizontal"
151
- }
140
+ const { total: i, take: t, bottomOffset: e, className: r, tabIndex: n, role: l, children: h, unstyled: c } = this.props, f = c && c.uCalendar;
141
+ (this.lastTotal !== i || this.lastDirection !== this.direction || this.lastTake !== t) && (this.initServices(), this.lastTotal = i, this.lastDirection = this.direction, this.lastTake = t);
142
+ const d = `${(this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + e}`, m = this.direction === "vertical" ? { height: `${d}px` } : { width: `${d}px` }, g = p(
143
+ v.scrollable({
144
+ c: f,
145
+ horizontal: this.direction === "horizontal"
146
+ }),
147
+ r
148
+ ), S = p(
149
+ v.scrollablePlaceholder({
150
+ c: f,
151
+ horizontal: this.direction === "horizontal"
152
+ })
152
153
  );
153
- return /* @__PURE__ */ a.createElement(
154
+ return /* @__PURE__ */ u.createElement(
154
155
  "div",
155
156
  {
156
- ref: (n) => {
157
- this.scrollContainer = n;
157
+ ref: (H) => {
158
+ this.scrollContainer = H;
158
159
  },
159
160
  onScroll: this.handleScroll,
160
- className: e,
161
- tabIndex: this.props.tabIndex,
162
- role: this.props.role
161
+ className: g,
162
+ tabIndex: n,
163
+ role: l
163
164
  },
164
- this.props.children,
165
- /* @__PURE__ */ a.createElement(
165
+ h,
166
+ /* @__PURE__ */ u.createElement(
166
167
  "div",
167
168
  {
168
- style: t,
169
- className: r
169
+ style: m,
170
+ className: S
170
171
  }
171
172
  )
172
173
  );
173
174
  }
174
175
  };
175
- c.propTypes = {
176
+ a.propTypes = {
176
177
  bottomOffset: o.number.isRequired,
177
178
  className: o.string,
178
179
  direction: o.oneOf(["horizontal", "vertical"]),
@@ -190,14 +191,14 @@ c.propTypes = {
190
191
  topOffset: o.number.isRequired,
191
192
  total: o.number.isRequired,
192
193
  role: o.string
193
- }, c.defaultProps = {
194
+ }, a.defaultProps = {
194
195
  direction: "vertical",
195
196
  forceScroll: !1,
196
197
  scrollOffsetSize: 0,
197
198
  maxScrollDifference: 100,
198
199
  scrollDuration: 100
199
200
  };
200
- let g = c;
201
+ let w = a;
201
202
  export {
202
- g as Virtualization
203
+ w as Virtualization
203
204
  };