@progress/kendo-react-dateinputs 9.2.0-develop.2 → 9.2.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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +1 -1
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +1 -1
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +1 -1
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +1 -1
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +1 -1
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +1 -1
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +1 -1
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +1 -1
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +1 -1
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +1 -1
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +1 -1
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +1 -1
- package/calendar/models/CalendarViewEnum.js +1 -1
- package/calendar/models/CalendarViewEnum.mjs +1 -1
- package/calendar/models/NavigationAction.js +1 -1
- package/calendar/models/NavigationAction.mjs +1 -1
- package/calendar/models/SelectionRange.js +1 -1
- package/calendar/models/SelectionRange.mjs +1 -1
- package/calendar/services/BusViewService.js +1 -1
- package/calendar/services/BusViewService.mjs +1 -1
- package/calendar/services/CenturyViewService.js +1 -1
- package/calendar/services/CenturyViewService.mjs +1 -1
- package/calendar/services/DOMService.js +1 -1
- package/calendar/services/DOMService.mjs +1 -1
- package/calendar/services/DecadeViewService.js +1 -1
- package/calendar/services/DecadeViewService.mjs +1 -1
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +1 -1
- package/calendar/services/NavigationService.js +1 -1
- package/calendar/services/NavigationService.mjs +1 -1
- package/calendar/services/ScrollSyncService.js +1 -1
- package/calendar/services/ScrollSyncService.mjs +1 -1
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +1 -1
- package/calendar/services/YearViewService.js +1 -1
- package/calendar/services/YearViewService.mjs +1 -1
- package/common/AdaptiveMode.js +2 -2
- package/common/AdaptiveMode.mjs +44 -37
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +1 -1
- package/common/PickerWrap.js +1 -1
- package/common/PickerWrap.mjs +1 -1
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +1 -1
- package/dateinput/dateInputIntl.js +1 -1
- package/dateinput/dateInputIntl.mjs +1 -1
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +1 -1
- package/datepicker/DatePicker.js +2 -2
- package/datepicker/DatePicker.mjs +70 -71
- package/datepicker/ToggleButton.js +1 -1
- package/datepicker/ToggleButton.mjs +1 -1
- package/daterangepicker/DateRangePicker.js +2 -2
- package/daterangepicker/DateRangePicker.mjs +25 -26
- package/datetimepicker/DateTimePicker.js +2 -2
- package/datetimepicker/DateTimePicker.mjs +38 -39
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +1 -1
- package/dist/cdn/js/kendo-react-dateinputs.js +2 -2
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/messages/index.js +1 -1
- package/messages/index.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +7 -7
- package/timepicker/TimeList.js +1 -1
- package/timepicker/TimeList.mjs +1 -1
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +1 -1
- package/timepicker/TimePicker.js +2 -2
- package/timepicker/TimePicker.mjs +49 -50
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +1 -1
- package/timepicker/models/TimePart.js +1 -1
- package/timepicker/models/TimePart.mjs +1 -1
- package/timepicker/services/DOMService.js +1 -1
- package/timepicker/services/DOMService.mjs +1 -1
- package/timepicker/services/DayPeriodService.js +1 -1
- package/timepicker/services/DayPeriodService.mjs +1 -1
- package/timepicker/services/HoursService.js +1 -1
- package/timepicker/services/HoursService.mjs +1 -1
- package/timepicker/services/MinutesService.js +1 -1
- package/timepicker/services/MinutesService.mjs +1 -1
- package/timepicker/services/SecondsService.js +1 -1
- package/timepicker/services/SecondsService.mjs +1 -1
- package/timepicker/utils.js +1 -1
- package/timepicker/utils.mjs +1 -1
- package/utils.js +1 -1
- package/utils.mjs +1 -1
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +1 -1
- package/virtualization/services/ScrollerService.js +1 -1
- package/virtualization/services/ScrollerService.mjs +1 -1
- package/common/constants.js +0 -8
- package/common/constants.mjs +0 -12
package/common/AdaptiveMode.mjs
CHANGED
|
@@ -1,73 +1,80 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { ActionSheet as
|
|
11
|
-
import { xIcon as
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { ActionSheet as x, ActionSheetFooter as u } from "@progress/kendo-react-layout";
|
|
11
|
+
import { xIcon as A } from "@progress/kendo-svg-icons";
|
|
12
12
|
import { Button as a } from "@progress/kendo-react-buttons";
|
|
13
|
-
|
|
13
|
+
import { ADAPTIVE_SMALL_BREAKPOINT as i } from "@progress/kendo-react-common";
|
|
14
|
+
const I = (l) => {
|
|
14
15
|
const {
|
|
15
|
-
footer:
|
|
16
|
+
footer: e,
|
|
17
|
+
windowWidth: n = 0,
|
|
18
|
+
mobileFilter: r,
|
|
16
19
|
children: s,
|
|
17
|
-
|
|
18
|
-
navigatable: r,
|
|
20
|
+
navigatable: c,
|
|
19
21
|
navigatableElements: m,
|
|
20
22
|
expand: d,
|
|
21
23
|
animation: p,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} =
|
|
26
|
-
navigatable:
|
|
24
|
+
title: b,
|
|
25
|
+
subTitle: f,
|
|
26
|
+
onClose: o
|
|
27
|
+
} = l, h = {
|
|
28
|
+
navigatable: c || !1,
|
|
27
29
|
navigatableElements: m || [],
|
|
28
30
|
expand: d,
|
|
29
31
|
animation: p !== !1,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
actions: /* @__PURE__ */ t.createElement(
|
|
33
|
+
a,
|
|
34
|
+
{
|
|
35
|
+
tabIndex: 0,
|
|
36
|
+
"aria-label": "Cancel",
|
|
37
|
+
"aria-disabled": "false",
|
|
38
|
+
type: "button",
|
|
39
|
+
fillMode: "flat",
|
|
40
|
+
icon: "x",
|
|
41
|
+
svgIcon: A,
|
|
42
|
+
onClick: o
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
filter: r,
|
|
46
|
+
onClose: o,
|
|
47
|
+
animationStyles: n <= i ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
48
|
+
title: b,
|
|
49
|
+
subTitle: f,
|
|
50
|
+
className: "k-adaptive-actionsheet",
|
|
51
|
+
position: n <= i ? "fullscreen" : void 0
|
|
33
52
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
a,
|
|
36
|
-
{
|
|
37
|
-
tabIndex: 0,
|
|
38
|
-
"aria-label": "Cancel",
|
|
39
|
-
"aria-disabled": "false",
|
|
40
|
-
type: "button",
|
|
41
|
-
fillMode: "flat",
|
|
42
|
-
icon: "x",
|
|
43
|
-
svgIcon: v,
|
|
44
|
-
onClick: n
|
|
45
|
-
}
|
|
46
|
-
))), i && /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, i)), s, t && /* @__PURE__ */ e.createElement(E, { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ e.createElement(
|
|
53
|
+
return /* @__PURE__ */ t.createElement(x, { ...h }, s, e && /* @__PURE__ */ t.createElement(u, { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ t.createElement(
|
|
47
54
|
a,
|
|
48
55
|
{
|
|
49
56
|
size: "large",
|
|
50
57
|
tabIndex: 0,
|
|
51
|
-
"aria-label":
|
|
58
|
+
"aria-label": e.cancelText,
|
|
52
59
|
"aria-disabled": "false",
|
|
53
60
|
type: "button",
|
|
54
|
-
onClick:
|
|
61
|
+
onClick: e.onCancel
|
|
55
62
|
},
|
|
56
|
-
|
|
57
|
-
), /* @__PURE__ */
|
|
63
|
+
e.cancelText
|
|
64
|
+
), /* @__PURE__ */ t.createElement(
|
|
58
65
|
a,
|
|
59
66
|
{
|
|
60
67
|
tabIndex: 0,
|
|
61
68
|
themeColor: "primary",
|
|
62
69
|
size: "large",
|
|
63
|
-
"aria-label":
|
|
70
|
+
"aria-label": e.applyText,
|
|
64
71
|
"aria-disabled": "false",
|
|
65
72
|
type: "button",
|
|
66
|
-
onClick:
|
|
73
|
+
onClick: e.onApply
|
|
67
74
|
},
|
|
68
|
-
|
|
75
|
+
e.applyText
|
|
69
76
|
)));
|
|
70
77
|
};
|
|
71
78
|
export {
|
|
72
|
-
|
|
79
|
+
I as AdaptiveMode
|
|
73
80
|
};
|
package/common/ClearButton.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/common/ClearButton.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/common/PickerWrap.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/common/PickerWrap.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/dateinput/DateInput.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/dateinput/DateInput.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/dateinput/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/dateinput/utils.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/datepicker/DatePicker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
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"),e=require("prop-types"),J=require("@progress/kendo-react-popup"),I=require("@progress/kendo-date-math"),n=require("@progress/kendo-react-common"),Q=require("@progress/kendo-svg-icons"),ee=require("../package-metadata.js"),te=require("../dateinput/DateInput.js"),se=require("../calendar/components/Calendar.js"),m=require("../utils.js"),k=require("../messages/index.js"),q=require("@progress/kendo-react-intl"),ie=require("./ToggleButton.js"),oe=require("../common/PickerWrap.js"),ae=require("../hooks/usePickerFloatingLabel.js"),ne=require("@progress/kendo-react-layout"),re=require("../common/AdaptiveMode.js"),le=require("../common/constants.js");function ue(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return s.default=l,Object.freeze(s)}const r=ue(G),o=class o extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.nextValue=(t,i)=>t.value!==void 0?t.value:i.value,this.nextShow=(t,i)=>t.show!==void 0?t.show:i.show,this.renderPopup=()=>{const{disabled:t,min:i,max:a,weekNumber:g,focusedDate:f,popupSettings:d}=this.props,{popupClass:v,...w}=d,b=this.show,h=this.value,y=h&&I.getDate(h),p=n.classNames(v),D={popupClass:"k-datepicker-popup",show:b,anchor:this._element,className:p,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...w,onMouseDownOutside:this.handleMouseDownOutside},c={disabled:t,value:y,min:i,max:a,weekNumber:g,focusedDate:f,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...c}):r.createElement(this.popupComp,{...D},r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...c}))},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,i={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t};return r.createElement(re.AdaptiveMode,{...i},r.createElement(ne.ActionSheetContent,{overflowHidden:!0},this.renderPopup()))},this.handleInputValueChange=t=>{this.handleValueChange(t.value,t)},this.handleCalendarValueChange=t=>{const i=this.mergeTime(t.value);this.handleValueChange(i,t)},this.handleValueChange=(t,i)=>{this.setState({value:I.cloneDate(t||void 0)}),this.valueDuringOnChange=t,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:a}=this.props;a&&a.call(void 0,{syntheticEvent:i.syntheticEvent,nativeEvent:i.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.togglePopup=()=>{this.setShow(!this.show)},this.handleMouseDownOutside=t=>{var i;(i=this.props.popupSettings)!=null&&i.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,t)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:i,keyCode:a}=t;if(a===n.Keys.esc&&this.show){this.shouldFocusDateInput=!0,this.setShow(!1);return}i&&(a===n.Keys.up||a===n.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=a===n.Keys.up,this.setShow(a===n.Keys.down))},n.validatePackage(ee.packageMetadata),this.state={value:this.props.defaultValue||o.defaultProps.defaultValue,show:this.props.defaultShow||o.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(n.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=le.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?I.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:o.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:o.defaultProps.max}get dateInputComp(){return this.props.dateInput||o.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||o.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||o.defaultProps.calendar}get popupComp(){return this.props.popup||o.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||o.defaultProps.pickerWrap}get validity(){const s=m.isInDateRange(this.value,this.min,this.max),t=this.props.validationMessage!==void 0,i=(!this.required||this.value!==null)&&s,a=this.props.valid!==void 0?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:a,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:o.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}componentDidMount(){var s;this.observerResize=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=o.defaultProps.size,rounded:t=o.defaultProps.rounded,fillMode:i=o.defaultProps.fillMode,disabled:a,tabIndex:g,title:f,id:d,format:v,formatPlaceholder:w,min:b,max:h,className:y,width:p,name:D,validationMessage:c,required:E,validityStyles:F,ariaLabelledBy:R,ariaDescribedBy:z,ariaLabel:V,placeholder:N,label:C,popupSettings:de,defaultValue:he,defaultShow:pe,value:ce,popup:me,weekNumber:ge,dateInput:fe,calendar:ve,toggleButton:we,onChange:be,onBlur:ye,onFocus:De,show:Ce,onOpen:Ie,pickerWrap:ke,adaptive:Oe,adaptiveTitle:Me,valid:Se,autoFocus:A,inputAttributes:K,visited:Pe,touched:Te,modified:qe,autoFill:L,twoDigitYearMax:W,enableMouseWheel:_,autoCorrectParts:U,autoSwitchParts:j,autoSwitchKeys:$,allowCaretMode:H,...O}=this.props,X=this.value,M=!this.validityStyles||this.validity.valid,Y={disabled:a,format:v,formatPlaceholder:w,id:d,ariaLabelledBy:R,ariaDescribedBy:z,ariaLabel:V,max:h,min:b,name:D,onChange:this.handleInputValueChange,required:E,tabIndex:this.show?-1:g,title:f,valid:this.validity.valid,validationMessage:c,validityStyles:F,value:X,label:void 0,placeholder:this.state.focused?null:N,ariaExpanded:this.show,size:null,fillMode:null,rounded:null,autoFill:L,twoDigitYearMax:W,enableMouseWheel:_,autoCorrectParts:U,autoSwitchParts:j,autoSwitchKeys:$,allowCaretMode:H,inputAttributes:K},S=q.provideLocalizationService(this).toLanguageString(k.toggleCalendar,k.messages[k.toggleCalendar]),P=r.createElement(n.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},T=>r.createElement(r.Fragment,null,r.createElement("span",{...C?{}:O,ref:Z=>{this._element=Z},className:n.classNames("k-input","k-datepicker",{[`k-input-${n.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${n.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${i}`]:i,"k-invalid":!M,"k-required":this.required,"k-disabled":a},y),onKeyDown:this.handleKeyDown,style:{width:p},onFocus:T.onFocus,onBlur:T.onBlur,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaExpanded:this.show,ariaControls:this._popupId,autoFocus:A,...Y}),r.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:Q.calendarIcon,title:S,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":S,fillMode:i,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return C?r.createElement(ae.PickerFloatingLabel,{dateInput:this._dateInput,label:C,editorId:d,editorValid:M,editorDisabled:a,children:P,style:{width:p},...O}):P}setShow(s){const{onOpen:t,onClose:i}=this.props;this.show!==s&&(this.setState({show:s}),s&&t&&t.call(void 0,{target:this}),!s&&i&&i.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?m.setTime(s,this.value):s}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(const t of s)this.setState({windowWidth:t.target.clientWidth})}};o.displayName="DatePicker",o.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object},o.defaultProps={defaultShow:!1,defaultValue:null,dateInput:te.DateInput,calendar:se.Calendar,toggleButton:ie.ToggleButton,popup:J.Popup,pickerWrap:oe.PickerWrap,disabled:!1,format:"d",max:m.MAX_DATE,min:m.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let u=o;const x=n.createPropsContext(),B=n.withIdHOC(n.withPropsContext(x,u));B.displayName="KendoReactDatePicker";q.registerForLocalization(u);exports.DatePicker=B;exports.DatePickerPropsContext=x;exports.DatePickerWithoutContext=u;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),e=require("prop-types"),J=require("@progress/kendo-react-popup"),I=require("@progress/kendo-date-math"),a=require("@progress/kendo-react-common"),Q=require("@progress/kendo-svg-icons"),ee=require("../package-metadata.js"),te=require("../dateinput/DateInput.js"),se=require("../calendar/components/Calendar.js"),m=require("../utils.js"),k=require("../messages/index.js"),x=require("@progress/kendo-react-intl"),ie=require("./ToggleButton.js"),oe=require("../common/PickerWrap.js"),ae=require("../hooks/usePickerFloatingLabel.js"),ne=require("@progress/kendo-react-layout"),re=require("../common/AdaptiveMode.js");function le(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return s.default=l,Object.freeze(s)}const r=le(G),o=class o extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.nextValue=(t,i)=>t.value!==void 0?t.value:i.value,this.nextShow=(t,i)=>t.show!==void 0?t.show:i.show,this.renderPopup=()=>{const{disabled:t,min:i,max:n,weekNumber:g,focusedDate:f,popupSettings:d}=this.props,{popupClass:v,...w}=d,b=this.show,h=this.value,y=h&&I.getDate(h),p=a.classNames(v),D={popupClass:"k-datepicker-popup",show:b,anchor:this._element,className:p,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...w,onMouseDownOutside:this.handleMouseDownOutside},c={disabled:t,value:y,min:i,max:n,weekNumber:g,focusedDate:f,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...c}):r.createElement(this.popupComp,{...D},r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...c}))},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,i={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle,windowWidth:t};return r.createElement(re.AdaptiveMode,{...i},r.createElement(ne.ActionSheetContent,{overflowHidden:!0},this.renderPopup()))},this.handleInputValueChange=t=>{this.handleValueChange(t.value,t)},this.handleCalendarValueChange=t=>{const i=this.mergeTime(t.value);this.handleValueChange(i,t)},this.handleValueChange=(t,i)=>{this.setState({value:I.cloneDate(t||void 0)}),this.valueDuringOnChange=t,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:n}=this.props;n&&n.call(void 0,{syntheticEvent:i.syntheticEvent,nativeEvent:i.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.togglePopup=()=>{this.setShow(!this.show)},this.handleMouseDownOutside=t=>{var i;(i=this.props.popupSettings)!=null&&i.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,t)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:i,keyCode:n}=t;if(n===a.Keys.esc&&this.show){this.shouldFocusDateInput=!0,this.setShow(!1);return}i&&(n===a.Keys.up||n===a.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=n===a.Keys.up,this.setShow(n===a.Keys.down))},a.validatePackage(ee.packageMetadata),this.state={value:this.props.defaultValue||o.defaultProps.defaultValue,show:this.props.defaultShow||o.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(a.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=a.ADAPTIVE_MEDIUM_BREAKPOINT&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?I.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:o.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:o.defaultProps.max}get dateInputComp(){return this.props.dateInput||o.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||o.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||o.defaultProps.calendar}get popupComp(){return this.props.popup||o.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||o.defaultProps.pickerWrap}get validity(){const s=m.isInDateRange(this.value,this.min,this.max),t=this.props.validationMessage!==void 0,i=(!this.required||this.value!==null)&&s,n=this.props.valid!==void 0?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:n,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:o.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:!1}componentDidMount(){var s;this.observerResize=a.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=o.defaultProps.size,rounded:t=o.defaultProps.rounded,fillMode:i=o.defaultProps.fillMode,disabled:n,tabIndex:g,title:f,id:d,format:v,formatPlaceholder:w,min:b,max:h,className:y,width:p,name:D,validationMessage:c,required:E,validityStyles:F,ariaLabelledBy:R,ariaDescribedBy:z,ariaLabel:N,placeholder:V,label:C,popupSettings:ue,defaultValue:de,defaultShow:he,value:pe,popup:ce,weekNumber:me,dateInput:ge,calendar:fe,toggleButton:ve,onChange:we,onBlur:be,onFocus:ye,show:De,onOpen:Ce,pickerWrap:Ie,adaptive:ke,adaptiveTitle:Oe,valid:Me,autoFocus:A,inputAttributes:K,visited:Se,touched:Pe,modified:Te,autoFill:W,twoDigitYearMax:_,enableMouseWheel:L,autoCorrectParts:U,autoSwitchParts:j,autoSwitchKeys:$,allowCaretMode:H,...O}=this.props,X=this.value,M=!this.validityStyles||this.validity.valid,Y={disabled:n,format:v,formatPlaceholder:w,id:d,ariaLabelledBy:R,ariaDescribedBy:z,ariaLabel:N,max:h,min:b,name:D,onChange:this.handleInputValueChange,required:E,tabIndex:this.show?-1:g,title:f,valid:this.validity.valid,validationMessage:c,validityStyles:F,value:X,label:void 0,placeholder:this.state.focused?null:V,ariaExpanded:this.show,size:null,fillMode:null,rounded:null,autoFill:W,twoDigitYearMax:_,enableMouseWheel:L,autoCorrectParts:U,autoSwitchParts:j,autoSwitchKeys:$,allowCaretMode:H,inputAttributes:K},S=x.provideLocalizationService(this).toLanguageString(k.toggleCalendar,k.messages[k.toggleCalendar]),P=r.createElement(a.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},T=>r.createElement(r.Fragment,null,r.createElement("span",{...C?{}:O,ref:Z=>{this._element=Z},className:a.classNames("k-input","k-datepicker",{[`k-input-${a.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${a.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${i}`]:i,"k-invalid":!M,"k-required":this.required,"k-disabled":n},y),onKeyDown:this.handleKeyDown,style:{width:p},onFocus:T.onFocus,onBlur:T.onBlur,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaExpanded:this.show,ariaControls:this._popupId,autoFocus:A,...Y}),r.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:Q.calendarIcon,title:S,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":S,fillMode:i,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return C?r.createElement(ae.PickerFloatingLabel,{dateInput:this._dateInput,label:C,editorId:d,editorValid:M,editorDisabled:n,children:P,style:{width:p},...O}):P}setShow(s){const{onOpen:t,onClose:i}=this.props;this.show!==s&&(this.setState({show:s}),s&&t&&t.call(void 0,{target:this}),!s&&i&&i.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?m.setTime(s,this.value):s}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(const t of s)this.setState({windowWidth:t.target.clientWidth})}};o.displayName="DatePicker",o.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object},o.defaultProps={defaultShow:!1,defaultValue:null,dateInput:te.DateInput,calendar:se.Calendar,toggleButton:ie.ToggleButton,popup:J.Popup,pickerWrap:oe.PickerWrap,disabled:!1,format:"d",max:m.MAX_DATE,min:m.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let u=o;const q=a.createPropsContext(),B=a.withIdHOC(a.withPropsContext(q,u));B.displayName="KendoReactDatePicker";x.registerForLocalization(u);exports.DatePicker=B;exports.DatePickerPropsContext=q;exports.DatePickerWithoutContext=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -10,20 +10,19 @@ import * as n from "react";
|
|
|
10
10
|
import e from "prop-types";
|
|
11
11
|
import { Popup as Y } from "@progress/kendo-react-popup";
|
|
12
12
|
import { getDate as Z, cloneDate as M } from "@progress/kendo-date-math";
|
|
13
|
-
import { classNames as k, Keys as r, validatePackage as G, canUseDOM as P,
|
|
14
|
-
import { calendarIcon as
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
import { DateInput as
|
|
17
|
-
import { Calendar as
|
|
18
|
-
import { MAX_DATE as
|
|
19
|
-
import { toggleCalendar as x, messages as
|
|
20
|
-
import { provideLocalizationService as
|
|
21
|
-
import { ToggleButton as
|
|
22
|
-
import { PickerWrap as
|
|
23
|
-
import { PickerFloatingLabel as
|
|
24
|
-
import { ActionSheetContent as
|
|
25
|
-
import { AdaptiveMode as
|
|
26
|
-
import { MOBILE_MEDIUM_DEVISE as we } from "../common/constants.mjs";
|
|
13
|
+
import { classNames as k, Keys as r, validatePackage as G, canUseDOM as P, ADAPTIVE_MEDIUM_BREAKPOINT as J, AsyncFocusBlur as Q, kendoThemeMaps as T, createPropsContext as ee, withIdHOC as te, withPropsContext as ie } from "@progress/kendo-react-common";
|
|
14
|
+
import { calendarIcon as se } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { packageMetadata as oe } from "../package-metadata.mjs";
|
|
16
|
+
import { DateInput as ae } from "../dateinput/DateInput.mjs";
|
|
17
|
+
import { Calendar as ne } from "../calendar/components/Calendar.mjs";
|
|
18
|
+
import { MAX_DATE as re, MIN_DATE as le, isInDateRange as ue, setTime as de } from "../utils.mjs";
|
|
19
|
+
import { toggleCalendar as x, messages as he } from "../messages/index.mjs";
|
|
20
|
+
import { provideLocalizationService as pe, registerForLocalization as ce } from "@progress/kendo-react-intl";
|
|
21
|
+
import { ToggleButton as me } from "./ToggleButton.mjs";
|
|
22
|
+
import { PickerWrap as fe } from "../common/PickerWrap.mjs";
|
|
23
|
+
import { PickerFloatingLabel as ge } from "../hooks/usePickerFloatingLabel.mjs";
|
|
24
|
+
import { ActionSheetContent as ve } from "@progress/kendo-react-layout";
|
|
25
|
+
import { AdaptiveMode as we } from "../common/AdaptiveMode.mjs";
|
|
27
26
|
const o = class o extends n.Component {
|
|
28
27
|
constructor(i) {
|
|
29
28
|
super(i), this._element = null, this._dateInput = n.createRef(), this._calendar = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
|
|
@@ -63,10 +62,10 @@ const o = class o extends n.Component {
|
|
|
63
62
|
const { windowWidth: t = 0 } = this.state, s = {
|
|
64
63
|
expand: this.show,
|
|
65
64
|
onClose: this.handleBlur,
|
|
66
|
-
|
|
65
|
+
title: this.props.adaptiveTitle,
|
|
67
66
|
windowWidth: t
|
|
68
67
|
};
|
|
69
|
-
return /* @__PURE__ */ n.createElement(
|
|
68
|
+
return /* @__PURE__ */ n.createElement(we, { ...s }, /* @__PURE__ */ n.createElement(ve, { overflowHidden: !0 }, this.renderPopup()));
|
|
70
69
|
}, this.handleInputValueChange = (t) => {
|
|
71
70
|
this.handleValueChange(t.value, t);
|
|
72
71
|
}, this.handleCalendarValueChange = (t) => {
|
|
@@ -104,7 +103,7 @@ const o = class o extends n.Component {
|
|
|
104
103
|
return;
|
|
105
104
|
}
|
|
106
105
|
s && (a === r.up || a === r.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = a === r.up, this.setShow(a === r.down));
|
|
107
|
-
}, G(
|
|
106
|
+
}, G(oe), this.state = {
|
|
108
107
|
value: this.props.defaultValue || o.defaultProps.defaultValue,
|
|
109
108
|
show: this.props.defaultShow || o.defaultProps.defaultShow,
|
|
110
109
|
focused: !1
|
|
@@ -127,7 +126,7 @@ const o = class o extends n.Component {
|
|
|
127
126
|
* The mobile mode of the DatePicker.
|
|
128
127
|
*/
|
|
129
128
|
get mobileMode() {
|
|
130
|
-
return !!(this.state.windowWidth && this.state.windowWidth <=
|
|
129
|
+
return !!(this.state.windowWidth && this.state.windowWidth <= J && this.props.adaptive);
|
|
131
130
|
}
|
|
132
131
|
/**
|
|
133
132
|
* Gets the DateInput component inside the DatePicker component.
|
|
@@ -185,7 +184,7 @@ const o = class o extends n.Component {
|
|
|
185
184
|
* Represents the validity state into which the DatePicker is set.
|
|
186
185
|
*/
|
|
187
186
|
get validity() {
|
|
188
|
-
const i =
|
|
187
|
+
const i = ue(this.value, this.min, this.max), t = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && i, a = this.props.valid !== void 0 ? this.props.valid : s;
|
|
189
188
|
return {
|
|
190
189
|
customError: t,
|
|
191
190
|
rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
|
|
@@ -246,42 +245,42 @@ const o = class o extends n.Component {
|
|
|
246
245
|
width: d,
|
|
247
246
|
name: b,
|
|
248
247
|
validationMessage: h,
|
|
249
|
-
required:
|
|
250
|
-
validityStyles:
|
|
248
|
+
required: B,
|
|
249
|
+
validityStyles: E,
|
|
251
250
|
ariaLabelledBy: F,
|
|
252
251
|
ariaDescribedBy: V,
|
|
253
252
|
ariaLabel: z,
|
|
254
|
-
placeholder:
|
|
253
|
+
placeholder: A,
|
|
255
254
|
label: y,
|
|
256
255
|
popupSettings: Ce,
|
|
257
256
|
defaultValue: Ie,
|
|
258
257
|
defaultShow: De,
|
|
259
|
-
value:
|
|
260
|
-
popup:
|
|
258
|
+
value: Oe,
|
|
259
|
+
popup: Se,
|
|
261
260
|
weekNumber: Me,
|
|
262
261
|
dateInput: ke,
|
|
263
262
|
calendar: Pe,
|
|
264
263
|
toggleButton: Te,
|
|
265
264
|
onChange: xe,
|
|
266
|
-
onBlur:
|
|
267
|
-
onFocus:
|
|
265
|
+
onBlur: Be,
|
|
266
|
+
onFocus: Ee,
|
|
268
267
|
show: Fe,
|
|
269
268
|
onOpen: Ve,
|
|
270
269
|
pickerWrap: ze,
|
|
271
|
-
adaptive:
|
|
272
|
-
adaptiveTitle:
|
|
273
|
-
valid:
|
|
274
|
-
autoFocus:
|
|
275
|
-
inputAttributes:
|
|
270
|
+
adaptive: Ae,
|
|
271
|
+
adaptiveTitle: Ne,
|
|
272
|
+
valid: Re,
|
|
273
|
+
autoFocus: N,
|
|
274
|
+
inputAttributes: R,
|
|
276
275
|
// Removed to support direct use in Form Field component
|
|
277
|
-
visited:
|
|
278
|
-
touched:
|
|
279
|
-
modified:
|
|
280
|
-
autoFill:
|
|
281
|
-
twoDigitYearMax:
|
|
282
|
-
enableMouseWheel:
|
|
283
|
-
autoCorrectParts:
|
|
284
|
-
autoSwitchParts:
|
|
276
|
+
visited: We,
|
|
277
|
+
touched: qe,
|
|
278
|
+
modified: Ke,
|
|
279
|
+
autoFill: W,
|
|
280
|
+
twoDigitYearMax: q,
|
|
281
|
+
enableMouseWheel: K,
|
|
282
|
+
autoCorrectParts: L,
|
|
283
|
+
autoSwitchParts: _,
|
|
285
284
|
autoSwitchKeys: U,
|
|
286
285
|
allowCaretMode: $,
|
|
287
286
|
...C
|
|
@@ -297,39 +296,39 @@ const o = class o extends n.Component {
|
|
|
297
296
|
min: v,
|
|
298
297
|
name: b,
|
|
299
298
|
onChange: this.handleInputValueChange,
|
|
300
|
-
required:
|
|
299
|
+
required: B,
|
|
301
300
|
tabIndex: this.show ? -1 : c,
|
|
302
301
|
title: m,
|
|
303
302
|
valid: this.validity.valid,
|
|
304
303
|
validationMessage: h,
|
|
305
|
-
validityStyles:
|
|
304
|
+
validityStyles: E,
|
|
306
305
|
value: H,
|
|
307
306
|
label: void 0,
|
|
308
|
-
placeholder: this.state.focused ? null :
|
|
307
|
+
placeholder: this.state.focused ? null : A,
|
|
309
308
|
ariaExpanded: this.show,
|
|
310
309
|
size: null,
|
|
311
310
|
fillMode: null,
|
|
312
311
|
rounded: null,
|
|
313
|
-
autoFill:
|
|
314
|
-
twoDigitYearMax:
|
|
315
|
-
enableMouseWheel:
|
|
316
|
-
autoCorrectParts:
|
|
317
|
-
autoSwitchParts:
|
|
312
|
+
autoFill: W,
|
|
313
|
+
twoDigitYearMax: q,
|
|
314
|
+
enableMouseWheel: K,
|
|
315
|
+
autoCorrectParts: L,
|
|
316
|
+
autoSwitchParts: _,
|
|
318
317
|
autoSwitchKeys: U,
|
|
319
318
|
allowCaretMode: $,
|
|
320
|
-
inputAttributes:
|
|
321
|
-
}, D =
|
|
319
|
+
inputAttributes: R
|
|
320
|
+
}, D = pe(this).toLanguageString(
|
|
322
321
|
x,
|
|
323
|
-
|
|
324
|
-
),
|
|
325
|
-
|
|
322
|
+
he[x]
|
|
323
|
+
), O = /* @__PURE__ */ n.createElement(
|
|
324
|
+
Q,
|
|
326
325
|
{
|
|
327
326
|
onFocus: this.handleFocus,
|
|
328
327
|
onBlur: this.mobileMode ? void 0 : this.handleBlur,
|
|
329
328
|
onSyncBlur: this.props.onBlur,
|
|
330
329
|
onSyncFocus: this.props.onFocus
|
|
331
330
|
},
|
|
332
|
-
(
|
|
331
|
+
(S) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
333
332
|
"span",
|
|
334
333
|
{
|
|
335
334
|
...y ? {} : C,
|
|
@@ -351,8 +350,8 @@ const o = class o extends n.Component {
|
|
|
351
350
|
),
|
|
352
351
|
onKeyDown: this.handleKeyDown,
|
|
353
352
|
style: { width: d },
|
|
354
|
-
onFocus:
|
|
355
|
-
onBlur:
|
|
353
|
+
onFocus: S.onFocus,
|
|
354
|
+
onBlur: S.onBlur,
|
|
356
355
|
onClick: this.mobileMode ? this.handleIconClick : void 0
|
|
357
356
|
},
|
|
358
357
|
/* @__PURE__ */ n.createElement(
|
|
@@ -362,7 +361,7 @@ const o = class o extends n.Component {
|
|
|
362
361
|
ariaRole: "combobox",
|
|
363
362
|
ariaExpanded: this.show,
|
|
364
363
|
ariaControls: this._popupId,
|
|
365
|
-
autoFocus:
|
|
364
|
+
autoFocus: N,
|
|
366
365
|
...j
|
|
367
366
|
}
|
|
368
367
|
),
|
|
@@ -371,7 +370,7 @@ const o = class o extends n.Component {
|
|
|
371
370
|
{
|
|
372
371
|
type: "button",
|
|
373
372
|
icon: "calendar",
|
|
374
|
-
svgIcon:
|
|
373
|
+
svgIcon: se,
|
|
375
374
|
title: D,
|
|
376
375
|
className: "k-input-button",
|
|
377
376
|
rounded: null,
|
|
@@ -385,18 +384,18 @@ const o = class o extends n.Component {
|
|
|
385
384
|
), this.mobileMode && this.renderAdaptivePopup())
|
|
386
385
|
);
|
|
387
386
|
return y ? /* @__PURE__ */ n.createElement(
|
|
388
|
-
|
|
387
|
+
ge,
|
|
389
388
|
{
|
|
390
389
|
dateInput: this._dateInput,
|
|
391
390
|
label: y,
|
|
392
391
|
editorId: l,
|
|
393
392
|
editorValid: I,
|
|
394
393
|
editorDisabled: a,
|
|
395
|
-
children:
|
|
394
|
+
children: O,
|
|
396
395
|
style: { width: d },
|
|
397
396
|
...C
|
|
398
397
|
}
|
|
399
|
-
) :
|
|
398
|
+
) : O;
|
|
400
399
|
}
|
|
401
400
|
setShow(i) {
|
|
402
401
|
const { onOpen: t, onClose: s } = this.props;
|
|
@@ -407,7 +406,7 @@ const o = class o extends n.Component {
|
|
|
407
406
|
}));
|
|
408
407
|
}
|
|
409
408
|
mergeTime(i) {
|
|
410
|
-
return this.value && i ?
|
|
409
|
+
return this.value && i ? de(i, this.value) : i;
|
|
411
410
|
}
|
|
412
411
|
nextTick(i) {
|
|
413
412
|
clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => i());
|
|
@@ -491,15 +490,15 @@ o.displayName = "DatePicker", o.propTypes = {
|
|
|
491
490
|
}, o.defaultProps = {
|
|
492
491
|
defaultShow: !1,
|
|
493
492
|
defaultValue: null,
|
|
494
|
-
dateInput:
|
|
495
|
-
calendar:
|
|
496
|
-
toggleButton:
|
|
493
|
+
dateInput: ae,
|
|
494
|
+
calendar: ne,
|
|
495
|
+
toggleButton: me,
|
|
497
496
|
popup: Y,
|
|
498
|
-
pickerWrap:
|
|
497
|
+
pickerWrap: fe,
|
|
499
498
|
disabled: !1,
|
|
500
499
|
format: "d",
|
|
501
|
-
max:
|
|
502
|
-
min:
|
|
500
|
+
max: re,
|
|
501
|
+
min: le,
|
|
503
502
|
popupSettings: {},
|
|
504
503
|
tabIndex: 0,
|
|
505
504
|
weekNumber: !1,
|
|
@@ -510,11 +509,11 @@ o.displayName = "DatePicker", o.propTypes = {
|
|
|
510
509
|
autoFocus: !1
|
|
511
510
|
};
|
|
512
511
|
let p = o;
|
|
513
|
-
const be =
|
|
514
|
-
|
|
512
|
+
const be = ee(), ye = te(
|
|
513
|
+
ie(be, p)
|
|
515
514
|
);
|
|
516
515
|
ye.displayName = "KendoReactDatePicker";
|
|
517
|
-
|
|
516
|
+
ce(p);
|
|
518
517
|
export {
|
|
519
518
|
ye as DatePicker,
|
|
520
519
|
be as DatePickerPropsContext,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|