@progress/kendo-react-dateinputs 8.4.0-develop.3 → 8.4.0-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calendar/components/Calendar.js +2 -2
- package/calendar/components/Calendar.mjs +13 -12
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +21 -13
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +25 -24
- package/calendar/services/DOMService.js +7 -7
- package/calendar/services/DOMService.mjs +136 -89
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +1 -1
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +30 -27
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +16 -16
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimeList.js +1 -1
- package/timepicker/TimeList.mjs +68 -60
- package/timepicker/services/DOMService.js +1 -1
- package/timepicker/services/DOMService.mjs +15 -12
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +16 -13
package/index.d.mts
CHANGED
|
@@ -2696,7 +2696,7 @@ export declare class DOMService {
|
|
|
2696
2696
|
didCalculate: boolean;
|
|
2697
2697
|
private hostContainer;
|
|
2698
2698
|
ensureHeights(): void;
|
|
2699
|
-
calculateHeights(container?: HTMLElement): void;
|
|
2699
|
+
calculateHeights(container?: HTMLElement, unstyled?: any): void;
|
|
2700
2700
|
viewHeight(viewType: CalendarViewEnum): number;
|
|
2701
2701
|
viewWidth(viewType: CalendarViewEnum): number;
|
|
2702
2702
|
private viewDimension;
|
|
@@ -2711,7 +2711,7 @@ declare class DOMService_2 {
|
|
|
2711
2711
|
timeListHeight: number;
|
|
2712
2712
|
didCalculate: boolean;
|
|
2713
2713
|
ensureHeights(): void;
|
|
2714
|
-
calculateHeights(container?: HTMLElement): void;
|
|
2714
|
+
calculateHeights(container?: HTMLElement, unstyled?: DateInputsClassStructure): void;
|
|
2715
2715
|
}
|
|
2716
2716
|
|
|
2717
2717
|
/**
|
package/index.d.ts
CHANGED
|
@@ -2696,7 +2696,7 @@ export declare class DOMService {
|
|
|
2696
2696
|
didCalculate: boolean;
|
|
2697
2697
|
private hostContainer;
|
|
2698
2698
|
ensureHeights(): void;
|
|
2699
|
-
calculateHeights(container?: HTMLElement): void;
|
|
2699
|
+
calculateHeights(container?: HTMLElement, unstyled?: any): void;
|
|
2700
2700
|
viewHeight(viewType: CalendarViewEnum): number;
|
|
2701
2701
|
viewWidth(viewType: CalendarViewEnum): number;
|
|
2702
2702
|
private viewDimension;
|
|
@@ -2711,7 +2711,7 @@ declare class DOMService_2 {
|
|
|
2711
2711
|
timeListHeight: number;
|
|
2712
2712
|
didCalculate: boolean;
|
|
2713
2713
|
ensureHeights(): void;
|
|
2714
|
-
calculateHeights(container?: HTMLElement): void;
|
|
2714
|
+
calculateHeights(container?: HTMLElement, unstyled?: DateInputsClassStructure): void;
|
|
2715
2715
|
}
|
|
2716
2716
|
|
|
2717
2717
|
/**
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-dateinputs",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1727785179,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dateinputs",
|
|
3
|
-
"version": "8.4.0-develop.
|
|
3
|
+
"version": "8.4.0-develop.4",
|
|
4
4
|
"description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-date-math": "^1.4.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-buttons": "8.4.0-develop.
|
|
28
|
-
"@progress/kendo-react-common": "8.4.0-develop.
|
|
29
|
-
"@progress/kendo-react-intl": "8.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-labels": "8.4.0-develop.
|
|
31
|
-
"@progress/kendo-react-layout": "8.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-popup": "8.4.0-develop.
|
|
27
|
+
"@progress/kendo-react-buttons": "8.4.0-develop.4",
|
|
28
|
+
"@progress/kendo-react-common": "8.4.0-develop.4",
|
|
29
|
+
"@progress/kendo-react-intl": "8.4.0-develop.4",
|
|
30
|
+
"@progress/kendo-react-labels": "8.4.0-develop.4",
|
|
31
|
+
"@progress/kendo-react-layout": "8.4.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-popup": "8.4.0-develop.4",
|
|
33
33
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
34
34
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
35
35
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/timepicker/TimeList.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),u=require("prop-types"),T=require("@progress/kendo-date-math"),i=require("@progress/kendo-react-common"),b=require("@progress/kendo-react-intl"),I=require("../virtualization/Virtualization.js"),p=require("./models/TimePart.js"),M=require("./services/DayPeriodService.js"),H=require("./services/DOMService.js"),D=require("./services/HoursService.js"),E=require("./services/MinutesService.js"),P=require("./services/SecondsService.js"),v=require("../utils.js");function R(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>o[e]})}}return n.default=o,Object.freeze(n)}const a=R(x),_=2,S=.05,w=100,C=0,O=9,N={[i.Keys.end]:(o,n)=>o[o.length-1],[i.Keys.home]:(o,n)=>o[0],[i.Keys.up]:(o,n)=>o[n-1],[i.Keys.down]:(o,n)=>o[n+1]},g={[p.TIME_PART.dayperiod]:M.DayPeriodService,[p.TIME_PART.hour]:D.HoursService,[p.TIME_PART.minute]:E.MinutesService,[p.TIME_PART.second]:P.SecondsService},l=class l extends a.Component{constructor(n){super(n),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=e=>{Promise.resolve().then(()=>{this.element&&this.element.focus(e)})},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),s=this.virtualization.activeIndex(),r=this.virtualization.itemOffset(s),c=Math.abs(Math.ceil(e)-r);if(t===s&&c<_)return r;const d=t>s;return d&&c>=this.bottomThreshold||!d&&c>this.topThreshold?this.virtualization.itemOffset(s+1):r},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=O,this.bottomOffset+=O*2),this.topThreshold=this.itemHeight*S,this.bottomThreshold=this.itemHeight*(1-S))},this.configureServices=({min:e,max:t,value:s}=this.props)=>{if(this.service){const[r,c]=this.service.limitRange(e||this.min,t||this.max,s||this.props.value);this.service.configure(this.serviceSettings({min:r,max:c}))}},this.serviceSettings=e=>{const t={boundRange:this.props.boundRange||l.defaultProps.boundRange,insertUndividedMax:!1,min:T.cloneDate(this.min),max:T.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},t,e);return s.boundRange=s.part.type!=="hour"||this.props.boundRange||l.defaultProps.boundRange,s},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(!(!this.virtualization||!this.service)&&e&&!t){this.animateToIndex=!1;const s=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),r=this.service.data(this.props.value)[s];this.handleChange(r)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=i.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===i.Keys.down||t===i.Keys.up||t===i.Keys.end||t===i.Keys.home)&&e.preventDefault();const r=(N[e.keyCode]||i.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));r&&this.handleChange(r)},this.handleChange=v.debounce(e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:s}=this.props;s&&s.call(void 0,t)},w),this.dom=new H.DOMService}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||l.defaultProps.min}get max(){return this.props.max||l.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):l.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{const{unstyled:n}=this.props;this._element&&(this.dom.calculateHeights(this._element,n),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const n=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](n),this.animateToIndex=!0}render(){const{part:n,value:e,unstyled:t}=this.props;if(!n.type||!g[n.type])return;const s=t&&t.uTime;this.calculateHeights(),this.intl=b.provideIntlService(this),this.service=new g[n.type](this.intl),this.configureServices();const r=this.service.data(e),c="translateY("+this.topOffset+"px)",d=this.service.total(e),f=a.createElement(a.Fragment,null,a.createElement("ul",{style:{transform:c,msTransform:c},className:i.classNames(i.uTime.ul({c:s}))},r.map((h,y)=>a.createElement("li",{key:y,className:i.classNames(i.uTime.li({c:s})),onClick:()=>{this.handleChange(h)}},a.createElement("span",null,h.text)))),a.createElement("div",{className:i.classNames(i.uTime.scrollablePlaceholder({c:s}))}));return a.createElement("div",{className:i.classNames(i.uTime.list({c:s})),id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:h=>{this._element=h},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?a.createElement(I.Virtualization,{bottomOffset:this.bottomOffset,children:f,className:i.classNames(i.uTime.containerSelector({c:s}),i.uTime.container({c:s})),itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:h=>{this.virtualization=h},role:"presentation",skip:C,tabIndex:-1,take:d,topOffset:this.topOffset,total:d,unstyled:t}):a.createElement("div",{className:i.classNames(i.uTime.containerSelector({c:s}),i.uTime.container({c:s,content:!0,scrollable:!0}))},f))}};l.propTypes={id:u.number,max:u.instanceOf(Date),min:u.instanceOf(Date),part:function(n,e,t){const s=n[e];if(!s||!g[s.type])throw new Error(`
|
|
9
9
|
Invalid prop '${e}' supplied to ${t}.
|
|
10
10
|
Supported part types are hour|minute|second|dayperiod.
|
|
11
11
|
`);return null},step:function(n,e,t){const s=n[e];if(s!==void 0&&s<=0)throw new Error(`
|
package/timepicker/TimeList.mjs
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import
|
|
10
|
+
import m from "prop-types";
|
|
11
11
|
import { cloneDate as O } from "@progress/kendo-date-math";
|
|
12
|
-
import { Keys as
|
|
12
|
+
import { Keys as c, getActiveElement as I, noop as H, classNames as u, uTime as l } from "@progress/kendo-react-common";
|
|
13
13
|
import { provideIntlService as y, registerForIntl as E } from "@progress/kendo-react-intl";
|
|
14
14
|
import { Virtualization as M } from "../virtualization/Virtualization.mjs";
|
|
15
15
|
import { TIME_PART as f } from "./models/TimePart.mjs";
|
|
@@ -19,11 +19,11 @@ import { HoursService as R } from "./services/HoursService.mjs";
|
|
|
19
19
|
import { MinutesService as C } from "./services/MinutesService.mjs";
|
|
20
20
|
import { SecondsService as P } from "./services/SecondsService.mjs";
|
|
21
21
|
import { debounce as z, MAX_TIME as _, MIDNIGHT_DATE as A } from "../utils.mjs";
|
|
22
|
-
const F = 2,
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
22
|
+
const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
23
|
+
[c.end]: (h, s) => h[h.length - 1],
|
|
24
|
+
[c.home]: (h, s) => h[0],
|
|
25
|
+
[c.up]: (h, s) => h[s - 1],
|
|
26
|
+
[c.down]: (h, s) => h[s + 1]
|
|
27
27
|
}, g = {
|
|
28
28
|
[f.dayperiod]: D,
|
|
29
29
|
[f.hour]: R,
|
|
@@ -38,40 +38,40 @@ const F = 2, T = 0.05, N = 100, k = 0, b = 9, B = {
|
|
|
38
38
|
}, this.itemOffset = (t) => {
|
|
39
39
|
if (!this.virtualization || !this.service)
|
|
40
40
|
return -1;
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
41
|
+
const i = this.service.selectedIndex(this.props.value), e = this.virtualization.activeIndex(), o = this.virtualization.itemOffset(e), a = Math.abs(Math.ceil(t) - o);
|
|
42
|
+
if (i === e && a < F)
|
|
43
43
|
return o;
|
|
44
|
-
const d =
|
|
45
|
-
return d && a >= this.bottomThreshold || !d && a > this.topThreshold ? this.virtualization.itemOffset(
|
|
44
|
+
const d = i > e;
|
|
45
|
+
return d && a >= this.bottomThreshold || !d && a > this.topThreshold ? this.virtualization.itemOffset(e + 1) : o;
|
|
46
46
|
}, this.calculateHeights = () => {
|
|
47
|
-
this.dom.didCalculate && (this.itemHeight = this.dom.itemHeight, this.listHeight = this.dom.timeListHeight, this.topOffset = (this.listHeight - this.itemHeight) / 2, this.bottomOffset = this.listHeight - this.itemHeight, this.props.mobileMode && (this.topOffset +=
|
|
48
|
-
}, this.configureServices = ({ min: t, max:
|
|
47
|
+
this.dom.didCalculate && (this.itemHeight = this.dom.itemHeight, this.listHeight = this.dom.timeListHeight, this.topOffset = (this.listHeight - this.itemHeight) / 2, this.bottomOffset = this.listHeight - this.itemHeight, this.props.mobileMode && (this.topOffset += T, this.bottomOffset += T * 2), this.topThreshold = this.itemHeight * S, this.bottomThreshold = this.itemHeight * (1 - S));
|
|
48
|
+
}, this.configureServices = ({ min: t, max: i, value: e } = this.props) => {
|
|
49
49
|
if (this.service) {
|
|
50
|
-
const [o, a] = this.service.limitRange(t || this.min,
|
|
50
|
+
const [o, a] = this.service.limitRange(t || this.min, i || this.max, e || this.props.value);
|
|
51
51
|
this.service.configure(this.serviceSettings({ min: o, max: a }));
|
|
52
52
|
}
|
|
53
53
|
}, this.serviceSettings = (t) => {
|
|
54
|
-
const
|
|
54
|
+
const i = {
|
|
55
55
|
boundRange: this.props.boundRange || r.defaultProps.boundRange,
|
|
56
56
|
insertUndividedMax: !1,
|
|
57
57
|
min: O(this.min),
|
|
58
58
|
max: O(this.max),
|
|
59
59
|
part: this.props.part,
|
|
60
60
|
step: this.step
|
|
61
|
-
},
|
|
62
|
-
return
|
|
63
|
-
}, this.handleScrollAction = ({ target: t, animationInProgress:
|
|
64
|
-
if (!(!this.virtualization || !this.service) && t && !
|
|
61
|
+
}, e = Object.assign({}, i, t);
|
|
62
|
+
return e.boundRange = e.part.type !== "hour" || this.props.boundRange || r.defaultProps.boundRange, e;
|
|
63
|
+
}, this.handleScrollAction = ({ target: t, animationInProgress: i }) => {
|
|
64
|
+
if (!(!this.virtualization || !this.service) && t && !i) {
|
|
65
65
|
this.animateToIndex = !1;
|
|
66
|
-
const
|
|
66
|
+
const e = this.virtualization.itemIndex(this.itemOffset(t.scrollTop)), o = this.service.data(this.props.value)[e];
|
|
67
67
|
this.handleChange(o);
|
|
68
68
|
}
|
|
69
69
|
}, this.handleFocus = (t) => {
|
|
70
|
-
const { onFocus:
|
|
71
|
-
|
|
70
|
+
const { onFocus: i } = this.props;
|
|
71
|
+
i && i.call(void 0, t);
|
|
72
72
|
}, this.handleBlur = (t) => {
|
|
73
|
-
const { onBlur:
|
|
74
|
-
|
|
73
|
+
const { onBlur: i } = this.props;
|
|
74
|
+
i && i.call(void 0, t);
|
|
75
75
|
}, this.handleMouseOver = () => {
|
|
76
76
|
if (!this._element)
|
|
77
77
|
return;
|
|
@@ -80,8 +80,8 @@ const F = 2, T = 0.05, N = 100, k = 0, b = 9, B = {
|
|
|
80
80
|
}, this.handleKeyDown = (t) => {
|
|
81
81
|
if (!this.service)
|
|
82
82
|
return;
|
|
83
|
-
const { keyCode:
|
|
84
|
-
(
|
|
83
|
+
const { keyCode: i } = t;
|
|
84
|
+
(i === c.down || i === c.up || i === c.end || i === c.home) && t.preventDefault();
|
|
85
85
|
const o = (B[t.keyCode] || H)(
|
|
86
86
|
this.service.data(this.props.value),
|
|
87
87
|
this.service.selectedIndex(this.props.value)
|
|
@@ -90,11 +90,11 @@ const F = 2, T = 0.05, N = 100, k = 0, b = 9, B = {
|
|
|
90
90
|
}, this.handleChange = z((t) => {
|
|
91
91
|
if (!this.service)
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
if (this.props.value.getTime() ===
|
|
93
|
+
const i = this.service.apply(this.props.value, t.value);
|
|
94
|
+
if (this.props.value.getTime() === i.getTime())
|
|
95
95
|
return;
|
|
96
|
-
const { onChange:
|
|
97
|
-
|
|
96
|
+
const { onChange: e } = this.props;
|
|
97
|
+
e && e.call(void 0, i);
|
|
98
98
|
}, N), this.dom = new w();
|
|
99
99
|
}
|
|
100
100
|
get element() {
|
|
@@ -117,7 +117,8 @@ const F = 2, T = 0.05, N = 100, k = 0, b = 9, B = {
|
|
|
117
117
|
*/
|
|
118
118
|
componentDidMount() {
|
|
119
119
|
Promise.resolve().then(() => {
|
|
120
|
-
|
|
120
|
+
const { unstyled: s } = this.props;
|
|
121
|
+
this._element && (this.dom.calculateHeights(this._element, s), this.forceUpdate());
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
124
|
/**
|
|
@@ -133,29 +134,29 @@ const F = 2, T = 0.05, N = 100, k = 0, b = 9, B = {
|
|
|
133
134
|
* @hidden
|
|
134
135
|
*/
|
|
135
136
|
render() {
|
|
136
|
-
const { part: s, value: t, unstyled:
|
|
137
|
+
const { part: s, value: t, unstyled: i } = this.props;
|
|
137
138
|
if (!s.type || !g[s.type])
|
|
138
139
|
return;
|
|
139
|
-
const
|
|
140
|
+
const e = i && i.uTime;
|
|
140
141
|
this.calculateHeights(), this.intl = y(this), this.service = new g[s.type](this.intl), this.configureServices();
|
|
141
142
|
const o = this.service.data(t), a = "translateY(" + this.topOffset + "px)", d = this.service.total(t), v = /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
142
143
|
"ul",
|
|
143
144
|
{
|
|
144
145
|
style: { transform: a, msTransform: a },
|
|
145
|
-
className:
|
|
146
|
+
className: u(l.ul({ c: e }))
|
|
146
147
|
},
|
|
147
|
-
o.map((
|
|
148
|
-
this.handleChange(
|
|
149
|
-
} }, /* @__PURE__ */ n.createElement("span", null,
|
|
150
|
-
), /* @__PURE__ */ n.createElement("div", { className:
|
|
148
|
+
o.map((p, b) => /* @__PURE__ */ n.createElement("li", { key: b, className: u(l.li({ c: e })), onClick: () => {
|
|
149
|
+
this.handleChange(p);
|
|
150
|
+
} }, /* @__PURE__ */ n.createElement("span", null, p.text)))
|
|
151
|
+
), /* @__PURE__ */ n.createElement("div", { className: u(l.scrollablePlaceholder({ c: e })) }));
|
|
151
152
|
return /* @__PURE__ */ n.createElement(
|
|
152
153
|
"div",
|
|
153
154
|
{
|
|
154
|
-
className:
|
|
155
|
+
className: u(l.list({ c: e })),
|
|
155
156
|
id: String(this.props.id || ""),
|
|
156
157
|
tabIndex: this.props.disabled ? -1 : 0,
|
|
157
|
-
ref: (
|
|
158
|
-
this._element =
|
|
158
|
+
ref: (p) => {
|
|
159
|
+
this._element = p;
|
|
159
160
|
},
|
|
160
161
|
onKeyDown: this.handleKeyDown,
|
|
161
162
|
onFocus: this.handleFocus,
|
|
@@ -167,49 +168,56 @@ const F = 2, T = 0.05, N = 100, k = 0, b = 9, B = {
|
|
|
167
168
|
{
|
|
168
169
|
bottomOffset: this.bottomOffset,
|
|
169
170
|
children: v,
|
|
170
|
-
className:
|
|
171
|
+
className: u(
|
|
172
|
+
l.containerSelector({ c: e }),
|
|
173
|
+
l.container({ c: e })
|
|
174
|
+
),
|
|
171
175
|
itemHeight: this.itemHeight,
|
|
172
176
|
maxScrollDifference: this.listHeight,
|
|
173
177
|
onScrollAction: this.handleScrollAction,
|
|
174
|
-
ref: (
|
|
175
|
-
this.virtualization =
|
|
178
|
+
ref: (p) => {
|
|
179
|
+
this.virtualization = p;
|
|
176
180
|
},
|
|
177
181
|
role: "presentation",
|
|
178
182
|
skip: k,
|
|
179
183
|
tabIndex: -1,
|
|
180
184
|
take: d,
|
|
181
185
|
topOffset: this.topOffset,
|
|
182
|
-
total: d
|
|
186
|
+
total: d,
|
|
187
|
+
unstyled: i
|
|
183
188
|
}
|
|
184
|
-
) : /* @__PURE__ */ n.createElement("div", { className:
|
|
189
|
+
) : /* @__PURE__ */ n.createElement("div", { className: u(
|
|
190
|
+
l.containerSelector({ c: e }),
|
|
191
|
+
l.container({ c: e, content: !0, scrollable: !0 })
|
|
192
|
+
) }, v)
|
|
185
193
|
);
|
|
186
194
|
}
|
|
187
195
|
};
|
|
188
196
|
r.propTypes = {
|
|
189
|
-
id:
|
|
190
|
-
max:
|
|
191
|
-
min:
|
|
192
|
-
part: function(s, t,
|
|
193
|
-
const
|
|
194
|
-
if (!
|
|
197
|
+
id: m.number,
|
|
198
|
+
max: m.instanceOf(Date),
|
|
199
|
+
min: m.instanceOf(Date),
|
|
200
|
+
part: function(s, t, i) {
|
|
201
|
+
const e = s[t];
|
|
202
|
+
if (!e || !g[e.type])
|
|
195
203
|
throw new Error(`
|
|
196
|
-
Invalid prop '${t}' supplied to ${
|
|
204
|
+
Invalid prop '${t}' supplied to ${i}.
|
|
197
205
|
Supported part types are hour|minute|second|dayperiod.
|
|
198
206
|
`);
|
|
199
207
|
return null;
|
|
200
208
|
},
|
|
201
|
-
step: function(s, t,
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
209
|
+
step: function(s, t, i) {
|
|
210
|
+
const e = s[t];
|
|
211
|
+
if (e !== void 0 && e <= 0)
|
|
204
212
|
throw new Error(`
|
|
205
|
-
Invalid prop '${t}' supplied to ${
|
|
213
|
+
Invalid prop '${t}' supplied to ${i}.
|
|
206
214
|
${t} cannot be less than 1.
|
|
207
215
|
`);
|
|
208
216
|
return null;
|
|
209
217
|
},
|
|
210
|
-
value:
|
|
211
|
-
smoothScroll:
|
|
212
|
-
show:
|
|
218
|
+
value: m.instanceOf(Date),
|
|
219
|
+
smoothScroll: m.bool,
|
|
220
|
+
show: m.bool
|
|
213
221
|
}, r.defaultProps = {
|
|
214
222
|
boundRange: !1,
|
|
215
223
|
max: _,
|
|
@@ -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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../utils.js"),e=require("@progress/kendo-react-common");class g{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(o,c){if(!e.canUseDOM)return;const t=c&&c.uTime,s=i.domContainerFactory("div"),l=i.domContainerFactory("span"),u=i.domContainerFactory("ul"),m=i.domContainerFactory("li"),p=()=>m("<span>02</span>",e.strippedClassNames(e.uTime.li({c:t}))),d=()=>u([p()],e.strippedClassNames(e.uTime.ul({c:t}))),h=()=>s([d()],e.strippedClassNames(e.uTime.containerSelector({c:t}),e.uTime.container({c:t,content:!0,scrollable:!0}))),C=s([l("minute",e.strippedClassNames(e.uTime.title({c:t}))),s([h()],e.strippedClassNames(e.uTime.list({c:t})))],e.strippedClassNames(e.uTime.listWrapper({c:t})),{left:"-10000px",position:"absolute"}),a=`.${e.strippedClassNames(e.uTime.containerSelector({c:t}))}`,n=o&&o.querySelector(a)||document.body,r=n.appendChild(C);this.timeListHeight=r.querySelector(a).offsetHeight,this.itemHeight=r.querySelector("li").offsetHeight,n.removeChild(r),this.didCalculate=!0}}exports.DOMService=g;
|
|
@@ -6,29 +6,32 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { domContainerFactory as
|
|
10
|
-
import { canUseDOM as
|
|
11
|
-
class
|
|
9
|
+
import { domContainerFactory as s } from "../../utils.mjs";
|
|
10
|
+
import { canUseDOM as C, strippedClassNames as i, uTime as e } from "@progress/kendo-react-common";
|
|
11
|
+
class y {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.itemHeight = 0, this.timeListHeight = 0, this.didCalculate = !1;
|
|
14
14
|
}
|
|
15
15
|
ensureHeights() {
|
|
16
16
|
this.timeListHeight === void 0 && this.calculateHeights();
|
|
17
17
|
}
|
|
18
|
-
calculateHeights(
|
|
19
|
-
if (!
|
|
18
|
+
calculateHeights(c, n) {
|
|
19
|
+
if (!C)
|
|
20
20
|
return;
|
|
21
|
-
const
|
|
21
|
+
const t = n && n.uTime, o = s("div"), p = s("span"), u = s("ul"), h = s("li"), m = () => h("<span>02</span>", i(e.li({ c: t }))), d = () => u([m()], i(e.ul({ c: t }))), f = () => o([d()], i(
|
|
22
|
+
e.containerSelector({ c: t }),
|
|
23
|
+
e.container({ c: t, content: !0, scrollable: !0 })
|
|
24
|
+
)), g = o(
|
|
22
25
|
[
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
p("minute", i(e.title({ c: t }))),
|
|
27
|
+
o([f()], i(e.list({ c: t })))
|
|
25
28
|
],
|
|
26
|
-
|
|
29
|
+
i(e.listWrapper({ c: t })),
|
|
27
30
|
{ left: "-10000px", position: "absolute" }
|
|
28
|
-
),
|
|
29
|
-
this.timeListHeight =
|
|
31
|
+
), l = `.${i(e.containerSelector({ c: t }))}`, a = c && c.querySelector(l) || document.body, r = a.appendChild(g);
|
|
32
|
+
this.timeListHeight = r.querySelector(l).offsetHeight, this.itemHeight = r.querySelector("li").offsetHeight, a.removeChild(r), this.didCalculate = !0;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
export {
|
|
33
|
-
|
|
36
|
+
y as DOMService
|
|
34
37
|
};
|
|
@@ -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"),s=require("prop-types"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),s=require("prop-types"),f=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 S=this.scrollStep(n,l),c=A[o](S),h=x[o](l),u=I[o](c(l)),m=p=>{this.animationInProgress=!0;const d=c(p);this.scrollTo(h(d)),u(d)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(d)}):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,S=T(o,t,this.props.maxScrollDifference||0),c=Math.min(t,n);return{start:Math.min(Math.max(c+l*S,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 f.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:S,unstyled:c}=this.props,h=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=f.classNames(f.uCalendar.scrollableSelector({c:h}),f.uCalendar.scrollable({c:h,horizontal:this.direction==="horizontal"}),o),d=f.classNames(f.uCalendar.scrollablePlaceholder({c:h,horizontal:this.direction==="horizontal"}));return g.createElement("div",{ref:b=>{this.scrollContainer=b},onScroll:this.handleScroll,className:p,tabIndex:n,role:l},S,g.createElement("div",{style:m,className:d}))}};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;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as u from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
|
-
import { RowHeightService as b, classNames as
|
|
11
|
+
import { RowHeightService as b, classNames as v, uCalendar as p } from "@progress/kendo-react-common";
|
|
12
12
|
import { ScrollerService as P } from "./services/ScrollerService.mjs";
|
|
13
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,
|
|
@@ -37,10 +37,10 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
37
37
|
let { start: n, end: l } = this.scrollRange(e, r);
|
|
38
38
|
if (n === l)
|
|
39
39
|
return;
|
|
40
|
-
const
|
|
40
|
+
const f = this.scrollStep(n, l), c = x[r](f), h = I[r](l), d = M[r](c(l)), m = (g) => {
|
|
41
41
|
this.animationInProgress = !0;
|
|
42
42
|
const S = c(g);
|
|
43
|
-
this.scrollTo(
|
|
43
|
+
this.scrollTo(h(S)), d(S) ? this.cancelAnimation = window.requestAnimationFrame(() => {
|
|
44
44
|
m(S);
|
|
45
45
|
}) : this.animationInProgress = !1;
|
|
46
46
|
};
|
|
@@ -56,8 +56,8 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
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,
|
|
60
|
-
return { start: Math.min(Math.max(c + l *
|
|
59
|
+
const n = this.containerMaxScroll(), l = e === 0 ? 1 : -1, f = T(r, t, this.props.maxScrollDifference || 0), c = Math.min(t, n);
|
|
60
|
+
return { start: Math.min(Math.max(c + l * f, 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
63
|
e !== void 0 && (this.rowHeightService = new b(t.total, e, 0), this.scrollerService.create(
|
|
@@ -137,17 +137,20 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
137
137
|
i && i.call(void 0, this);
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
|
-
const { total: i, take: t, bottomOffset: e, className: r, tabIndex: n, role: l, children:
|
|
140
|
+
const { total: i, take: t, bottomOffset: e, className: r, tabIndex: n, role: l, children: f, unstyled: c } = this.props, h = c && c.uCalendar;
|
|
141
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 =
|
|
143
|
-
|
|
144
|
-
c:
|
|
142
|
+
const d = `${(this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + e}`, m = this.direction === "vertical" ? { height: `${d}px` } : { width: `${d}px` }, g = v(
|
|
143
|
+
p.scrollableSelector({
|
|
144
|
+
c: h
|
|
145
|
+
}),
|
|
146
|
+
p.scrollable({
|
|
147
|
+
c: h,
|
|
145
148
|
horizontal: this.direction === "horizontal"
|
|
146
149
|
}),
|
|
147
150
|
r
|
|
148
|
-
), S =
|
|
149
|
-
|
|
150
|
-
c:
|
|
151
|
+
), S = v(
|
|
152
|
+
p.scrollablePlaceholder({
|
|
153
|
+
c: h,
|
|
151
154
|
horizontal: this.direction === "horizontal"
|
|
152
155
|
})
|
|
153
156
|
);
|
|
@@ -162,7 +165,7 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
162
165
|
tabIndex: n,
|
|
163
166
|
role: l
|
|
164
167
|
},
|
|
165
|
-
|
|
168
|
+
f,
|
|
166
169
|
/* @__PURE__ */ u.createElement(
|
|
167
170
|
"div",
|
|
168
171
|
{
|