@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.3.0-develop.1
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 +12 -0
- package/calendar/components/Calendar.mjs +328 -0
- package/calendar/components/CalendarCell.js +8 -0
- package/calendar/components/CalendarCell.mjs +101 -0
- package/calendar/components/CalendarHeaderTitle.js +8 -0
- package/calendar/components/CalendarHeaderTitle.mjs +23 -0
- package/calendar/components/CalendarNavigationItem.js +8 -0
- package/calendar/components/CalendarNavigationItem.mjs +29 -0
- package/calendar/components/CalendarWeekCell.js +8 -0
- package/calendar/components/CalendarWeekCell.mjs +23 -0
- package/calendar/components/Header.js +8 -0
- package/calendar/components/Header.mjs +78 -0
- package/calendar/components/HorizontalViewList.js +8 -0
- package/calendar/components/HorizontalViewList.mjs +120 -0
- package/calendar/components/MultiViewCalendar.js +8 -0
- package/calendar/components/MultiViewCalendar.mjs +428 -0
- package/calendar/components/Navigation.js +8 -0
- package/calendar/components/Navigation.mjs +117 -0
- package/calendar/components/TodayCommand.js +8 -0
- package/calendar/components/TodayCommand.mjs +74 -0
- package/calendar/components/View.js +8 -0
- package/calendar/components/View.mjs +153 -0
- package/calendar/components/ViewList.js +8 -0
- package/calendar/components/ViewList.mjs +228 -0
- package/calendar/models/CalendarViewEnum.js +8 -0
- package/calendar/models/CalendarViewEnum.mjs +12 -0
- package/calendar/models/NavigationAction.js +8 -0
- package/calendar/models/NavigationAction.mjs +12 -0
- package/calendar/models/SelectionRange.js +8 -0
- package/calendar/models/SelectionRange.mjs +12 -0
- package/calendar/services/BusViewService.js +8 -0
- package/calendar/services/BusViewService.mjs +58 -0
- package/calendar/services/CenturyViewService.js +8 -0
- package/calendar/services/CenturyViewService.mjs +126 -0
- package/calendar/services/DOMService.js +14 -0
- package/calendar/services/DOMService.mjs +124 -0
- package/calendar/services/DecadeViewService.js +8 -0
- package/calendar/services/DecadeViewService.mjs +126 -0
- package/calendar/services/MonthViewService.js +8 -0
- package/calendar/services/MonthViewService.mjs +139 -0
- package/calendar/services/NavigationService.js +8 -0
- package/calendar/services/NavigationService.mjs +36 -0
- package/calendar/services/ScrollSyncService.js +8 -0
- package/calendar/services/ScrollSyncService.mjs +50 -0
- package/calendar/services/WeekNamesService.js +8 -0
- package/calendar/services/WeekNamesService.mjs +24 -0
- package/calendar/services/YearViewService.js +8 -0
- package/calendar/services/YearViewService.mjs +135 -0
- package/common/AdaptiveMode.js +8 -0
- package/common/AdaptiveMode.mjs +73 -0
- package/common/PickerWrap.js +8 -0
- package/common/PickerWrap.mjs +32 -0
- package/common/constants.js +8 -0
- package/common/constants.mjs +12 -0
- package/dateinput/DateInput.js +8 -0
- package/dateinput/DateInput.mjs +503 -0
- package/dateinput/models/kendo-date.js +8 -0
- package/dateinput/models/kendo-date.mjs +233 -0
- package/dateinput/models/mask.js +8 -0
- package/dateinput/models/mask.mjs +16 -0
- package/dateinput/utils.js +8 -0
- package/dateinput/utils.mjs +38 -0
- package/datepicker/DatePicker.js +8 -0
- package/datepicker/DatePicker.mjs +462 -0
- package/datepicker/ToggleButton.js +8 -0
- package/datepicker/ToggleButton.mjs +13 -0
- package/daterangepicker/DateRangePicker.js +8 -0
- package/daterangepicker/DateRangePicker.mjs +426 -0
- package/datetimepicker/DateTimePicker.js +8 -0
- package/datetimepicker/DateTimePicker.mjs +475 -0
- package/datetimepicker/DateTimeSelector.js +8 -0
- package/datetimepicker/DateTimeSelector.mjs +275 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +8 -21
- package/hooks/usePickerFloatingLabel.js +8 -0
- package/hooks/usePickerFloatingLabel.mjs +31 -0
- package/index.d.mts +4528 -5
- package/index.d.ts +4528 -39
- package/index.js +8 -21
- package/index.mjs +114 -6540
- package/messages/index.js +8 -0
- package/messages/index.mjs +59 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +7 -7
- package/timepicker/TimeList.js +14 -0
- package/timepicker/TimeList.mjs +230 -0
- package/timepicker/TimePart.js +8 -0
- package/timepicker/TimePart.mjs +267 -0
- package/timepicker/TimePicker.js +8 -0
- package/timepicker/TimePicker.mjs +479 -0
- package/timepicker/TimeSelector.js +8 -0
- package/timepicker/TimeSelector.mjs +250 -0
- package/timepicker/models/TimePart.js +8 -0
- package/timepicker/models/TimePart.mjs +18 -0
- package/timepicker/services/DOMService.js +8 -0
- package/timepicker/services/DOMService.mjs +34 -0
- package/timepicker/services/DayPeriodService.js +8 -0
- package/timepicker/services/DayPeriodService.mjs +89 -0
- package/timepicker/services/HoursService.js +8 -0
- package/timepicker/services/HoursService.mjs +92 -0
- package/timepicker/services/MinutesService.js +8 -0
- package/timepicker/services/MinutesService.mjs +91 -0
- package/timepicker/services/SecondsService.js +8 -0
- package/timepicker/services/SecondsService.mjs +91 -0
- package/timepicker/utils.js +8 -0
- package/timepicker/utils.mjs +91 -0
- package/utils.js +8 -0
- package/utils.mjs +111 -0
- package/virtualization/Virtualization.js +8 -0
- package/virtualization/Virtualization.mjs +204 -0
- package/virtualization/services/RowHeightService.js +8 -0
- package/virtualization/services/RowHeightService.mjs +50 -0
- package/virtualization/services/ScrollerService.js +8 -0
- package/virtualization/services/ScrollerService.mjs +52 -0
- package/PopupSettings.d.ts +0 -18
- package/calendar/components/Calendar.d.ts +0 -191
- package/calendar/components/CalendarCell.d.ts +0 -39
- package/calendar/components/CalendarHeaderTitle.d.ts +0 -32
- package/calendar/components/CalendarNavigationItem.d.ts +0 -31
- package/calendar/components/CalendarWeekCell.d.ts +0 -29
- package/calendar/components/Header.d.ts +0 -58
- package/calendar/components/HorizontalViewList.d.ts +0 -71
- package/calendar/components/MultiViewCalendar.d.ts +0 -212
- package/calendar/components/Navigation.d.ts +0 -80
- package/calendar/components/TodayCommand.d.ts +0 -35
- package/calendar/components/View.d.ts +0 -89
- package/calendar/components/ViewList.d.ts +0 -115
- package/calendar/models/ActiveView.d.ts +0 -8
- package/calendar/models/CalendarSettings.d.ts +0 -106
- package/calendar/models/CalendarViewEnum.d.ts +0 -13
- package/calendar/models/CellContext.d.ts +0 -23
- package/calendar/models/MultiViewCalendarMode.d.ts +0 -13
- package/calendar/models/MultiViewCalendarSettings.d.ts +0 -115
- package/calendar/models/NavigationAction.d.ts +0 -19
- package/calendar/models/SelectionRange.d.ts +0 -21
- package/calendar/models/SelectionRangeEnd.d.ts +0 -8
- package/calendar/models/ViewService.d.ts +0 -29
- package/calendar/models/index.d.ts +0 -15
- package/calendar/services/BusViewService.d.ts +0 -25
- package/calendar/services/CenturyViewService.d.ts +0 -29
- package/calendar/services/DOMService.d.ts +0 -33
- package/calendar/services/DecadeViewService.d.ts +0 -31
- package/calendar/services/MonthViewService.d.ts +0 -37
- package/calendar/services/NavigationService.d.ts +0 -18
- package/calendar/services/ScrollSyncService.d.ts +0 -25
- package/calendar/services/WeekNamesService.d.ts +0 -13
- package/calendar/services/YearViewService.d.ts +0 -35
- package/calendar/services/index.d.ts +0 -14
- package/common/AdaptiveMode.d.ts +0 -25
- package/common/PickerWrap.d.ts +0 -22
- package/common/constants.d.ts +0 -8
- package/dateinput/DateInput.d.ts +0 -355
- package/dateinput/models/DateInputSettings.d.ts +0 -103
- package/dateinput/models/format-placeholder.d.ts +0 -43
- package/dateinput/models/incremental-steps.d.ts +0 -15
- package/dateinput/models/index.d.ts +0 -11
- package/dateinput/models/kendo-date.d.ts +0 -57
- package/dateinput/models/mask.d.ts +0 -11
- package/dateinput/models/selection.d.ts +0 -11
- package/dateinput/utils.d.ts +0 -34
- package/datepicker/DatePicker.d.ts +0 -358
- package/datepicker/ToggleButton.d.ts +0 -14
- package/datepicker/models/DatePickerSettings.d.ts +0 -141
- package/datepicker/models/index.d.ts +0 -6
- package/daterangepicker/DateRangePicker.d.ts +0 -354
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerSettings.d.ts +0 -126
- package/daterangepicker/models/index.d.ts +0 -9
- package/datetimepicker/DateTimePicker.d.ts +0 -342
- package/datetimepicker/DateTimeSelector.d.ts +0 -106
- package/datetimepicker/models/DateTimePickerSettings.d.ts +0 -144
- package/datetimepicker/models/index.d.ts +0 -6
- package/hooks/usePickerFloatingLabel.d.ts +0 -24
- package/messages/index.d.ts +0 -124
- package/package-metadata.d.ts +0 -9
- package/timepicker/TimeList.d.ts +0 -91
- package/timepicker/TimePart.d.ts +0 -141
- package/timepicker/TimePicker.d.ts +0 -355
- package/timepicker/TimeSelector.d.ts +0 -144
- package/timepicker/models/IncrementalSteps.d.ts +0 -12
- package/timepicker/models/ListItem.d.ts +0 -11
- package/timepicker/models/ListService.d.ts +0 -19
- package/timepicker/models/ListServiceSettings.d.ts +0 -16
- package/timepicker/models/TimePart.d.ts +0 -14
- package/timepicker/models/TimePickerSettings.d.ts +0 -133
- package/timepicker/models/index.d.ts +0 -11
- package/timepicker/services/DOMService.d.ts +0 -14
- package/timepicker/services/DayPeriodService.d.ts +0 -51
- package/timepicker/services/HoursService.d.ts +0 -37
- package/timepicker/services/MinutesService.d.ts +0 -36
- package/timepicker/services/SecondsService.d.ts +0 -36
- package/timepicker/services/index.d.ts +0 -10
- package/timepicker/utils.d.ts +0 -60
- package/utils.d.ts +0 -100
- package/virtualization/Virtualization.d.ts +0 -120
- package/virtualization/services/RowHeightService.d.ts +0 -22
- package/virtualization/services/ScrollerService.d.ts +0 -53
- package/virtualization/services/index.d.ts +0 -7
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import e from "prop-types";
|
|
11
|
+
import { Popup as q } from "@progress/kendo-react-popup";
|
|
12
|
+
import { getDate as L, cloneDate as C } from "@progress/kendo-date-math";
|
|
13
|
+
import { classNames as D, Keys as r, validatePackage as W, canUseDOM as k, AsyncFocusBlur as _, kendoThemeMaps as O, createPropsContext as K, withIdHOC as U, withPropsContext as $ } from "@progress/kendo-react-common";
|
|
14
|
+
import { calendarIcon as H } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { packageMetadata as X } from "../package-metadata.mjs";
|
|
16
|
+
import { DateInput as Z } from "../dateinput/DateInput.mjs";
|
|
17
|
+
import { Calendar as j } from "../calendar/components/Calendar.mjs";
|
|
18
|
+
import { MAX_DATE as G, MIN_DATE as J, isInDateRange as Q, setTime as Y } from "../utils.mjs";
|
|
19
|
+
import { toggleCalendar as S, messages as ee } from "../messages/index.mjs";
|
|
20
|
+
import { provideLocalizationService as te, registerForLocalization as ie } from "@progress/kendo-react-intl";
|
|
21
|
+
import { ToggleButton as se } from "./ToggleButton.mjs";
|
|
22
|
+
import { PickerWrap as oe } from "../common/PickerWrap.mjs";
|
|
23
|
+
import { PickerFloatingLabel as ae } from "../hooks/usePickerFloatingLabel.mjs";
|
|
24
|
+
import { ActionSheetContent as ne } from "@progress/kendo-react-layout";
|
|
25
|
+
import { AdaptiveMode as re } from "../common/AdaptiveMode.mjs";
|
|
26
|
+
import { MOBILE_MEDIUM_DEVISE as le } from "../common/constants.mjs";
|
|
27
|
+
const o = class o extends n.Component {
|
|
28
|
+
constructor(i) {
|
|
29
|
+
super(i), this._element = null, this._dateInput = n.createRef(), this._calendar = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
|
|
30
|
+
this.dateInput && this.dateInput.focus();
|
|
31
|
+
}, this.setCalendarRef = (t) => {
|
|
32
|
+
this._calendar = t;
|
|
33
|
+
}, this.nextValue = (t, s) => t.value !== void 0 ? t.value : s.value, this.nextShow = (t, s) => t.show !== void 0 ? t.show : s.show, this.renderPopup = () => {
|
|
34
|
+
const { disabled: t, min: s, max: a, weekNumber: u, focusedDate: c } = this.props, { popupClass: l, ...m } = this.props.popupSettings, f = this.show, d = this.value, g = d && L(d), v = D(
|
|
35
|
+
"k-calendar-container k-group k-reset",
|
|
36
|
+
l
|
|
37
|
+
), w = {
|
|
38
|
+
popupClass: "k-datepicker-popup",
|
|
39
|
+
show: f,
|
|
40
|
+
anchor: this._element,
|
|
41
|
+
className: v,
|
|
42
|
+
id: this._popupId,
|
|
43
|
+
anchorAlign: {
|
|
44
|
+
horizontal: "left",
|
|
45
|
+
vertical: "bottom"
|
|
46
|
+
},
|
|
47
|
+
popupAlign: {
|
|
48
|
+
horizontal: "left",
|
|
49
|
+
vertical: "top"
|
|
50
|
+
},
|
|
51
|
+
...m
|
|
52
|
+
}, h = {
|
|
53
|
+
disabled: t,
|
|
54
|
+
value: g,
|
|
55
|
+
min: s,
|
|
56
|
+
max: a,
|
|
57
|
+
weekNumber: u,
|
|
58
|
+
focusedDate: c,
|
|
59
|
+
className: this.mobileMode ? "k-calendar-lg" : "",
|
|
60
|
+
navigation: !this.mobileMode,
|
|
61
|
+
onChange: this.handleCalendarValueChange
|
|
62
|
+
};
|
|
63
|
+
return this.mobileMode ? /* @__PURE__ */ n.createElement(this.calendarComp, { _ref: this.setCalendarRef, ...h }) : /* @__PURE__ */ n.createElement(this.popupComp, { ...w }, /* @__PURE__ */ n.createElement(this.calendarComp, { _ref: this.setCalendarRef, ...h }));
|
|
64
|
+
}, this.renderAdaptivePopup = () => {
|
|
65
|
+
const { windowWidth: t = 0 } = this.state, s = {
|
|
66
|
+
expand: this.show,
|
|
67
|
+
onClose: this.handleBlur,
|
|
68
|
+
adaptiveTitle: this.props.adaptiveTitle,
|
|
69
|
+
windowWidth: t
|
|
70
|
+
};
|
|
71
|
+
return /* @__PURE__ */ n.createElement(re, { ...s }, /* @__PURE__ */ n.createElement(ne, { className: "!k-overflow-hidden" }, this.renderPopup()));
|
|
72
|
+
}, this.handleInputValueChange = (t) => {
|
|
73
|
+
this.handleValueChange(t.value, t);
|
|
74
|
+
}, this.handleCalendarValueChange = (t) => {
|
|
75
|
+
const s = this.mergeTime(t.value);
|
|
76
|
+
this.handleValueChange(s, t);
|
|
77
|
+
}, this.handleValueChange = (t, s) => {
|
|
78
|
+
this.setState({
|
|
79
|
+
value: C(t || void 0)
|
|
80
|
+
}), this.valueDuringOnChange = t, this.showDuringOnChange = !1, this.mobileMode || (this.shouldFocusDateInput = !0);
|
|
81
|
+
const { onChange: a } = this.props;
|
|
82
|
+
a && a.call(void 0, {
|
|
83
|
+
syntheticEvent: s.syntheticEvent,
|
|
84
|
+
nativeEvent: s.nativeEvent,
|
|
85
|
+
value: this.value,
|
|
86
|
+
show: this.show,
|
|
87
|
+
target: this
|
|
88
|
+
}), this.valueDuringOnChange = void 0, this.showDuringOnChange = void 0, this.setShow(!1);
|
|
89
|
+
}, this.handleFocus = () => {
|
|
90
|
+
this.setState({ focused: !0 });
|
|
91
|
+
}, this.handleBlur = () => {
|
|
92
|
+
this.setState({ focused: !1 }), this.setShow(!1);
|
|
93
|
+
}, this.handleIconClick = () => {
|
|
94
|
+
this.props.disabled || (this.shouldFocusDateInput = !0, this.setShow(!this.show));
|
|
95
|
+
}, this.handleIconMouseDown = (t) => {
|
|
96
|
+
t.preventDefault();
|
|
97
|
+
}, this.handleKeyDown = (t) => {
|
|
98
|
+
const { altKey: s, keyCode: a } = t;
|
|
99
|
+
if (a === r.esc) {
|
|
100
|
+
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
s && (a === r.up || a === r.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = a === r.up, this.setShow(a === r.down));
|
|
104
|
+
}, W(X), this.state = {
|
|
105
|
+
value: this.props.defaultValue || o.defaultProps.defaultValue,
|
|
106
|
+
show: this.props.defaultShow || o.defaultProps.defaultShow,
|
|
107
|
+
focused: !1
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
get _popupId() {
|
|
111
|
+
return this.props.id + "-popup-id";
|
|
112
|
+
}
|
|
113
|
+
get document() {
|
|
114
|
+
if (k)
|
|
115
|
+
return this.element && this.element.ownerDocument || document;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Gets the wrapping element of the DatePickerWithoutContext.
|
|
119
|
+
*/
|
|
120
|
+
get element() {
|
|
121
|
+
return this._element;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The mobile mode of the DatePicker.
|
|
125
|
+
*/
|
|
126
|
+
get mobileMode() {
|
|
127
|
+
return !!(this.state.windowWidth && this.state.windowWidth <= le && this.props.adaptive);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Gets the DateInput component inside the DatePicker component.
|
|
131
|
+
*/
|
|
132
|
+
get dateInput() {
|
|
133
|
+
return this._dateInput.current;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Gets the Calendar component inside the DatePicker component.
|
|
137
|
+
*/
|
|
138
|
+
get calendar() {
|
|
139
|
+
return this._calendar;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Gets the value of the DatePickerWithoutContext.
|
|
143
|
+
*/
|
|
144
|
+
get value() {
|
|
145
|
+
const i = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
146
|
+
return i !== null ? C(i) : null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Gets the popup state of the DatePickerWithoutContext.
|
|
150
|
+
*/
|
|
151
|
+
get show() {
|
|
152
|
+
return this.showDuringOnChange !== void 0 ? this.showDuringOnChange : this.props.show !== void 0 ? this.props.show : this.state.show;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Gets the `name` property of the DatePickerWithoutContext.
|
|
156
|
+
*/
|
|
157
|
+
get name() {
|
|
158
|
+
return this.props.name;
|
|
159
|
+
}
|
|
160
|
+
get min() {
|
|
161
|
+
return this.props.min !== void 0 ? this.props.min : o.defaultProps.min;
|
|
162
|
+
}
|
|
163
|
+
get max() {
|
|
164
|
+
return this.props.max !== void 0 ? this.props.max : o.defaultProps.max;
|
|
165
|
+
}
|
|
166
|
+
get dateInputComp() {
|
|
167
|
+
return this.props.dateInput || o.defaultProps.dateInput;
|
|
168
|
+
}
|
|
169
|
+
get toggleButtonComp() {
|
|
170
|
+
return this.props.toggleButton || o.defaultProps.toggleButton;
|
|
171
|
+
}
|
|
172
|
+
get calendarComp() {
|
|
173
|
+
return this.props.calendar || o.defaultProps.calendar;
|
|
174
|
+
}
|
|
175
|
+
get popupComp() {
|
|
176
|
+
return this.props.popup || o.defaultProps.popup;
|
|
177
|
+
}
|
|
178
|
+
get pickerWrapComp() {
|
|
179
|
+
return this.props.pickerWrap || o.defaultProps.pickerWrap;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Represents the validity state into which the DatePicker is set.
|
|
183
|
+
*/
|
|
184
|
+
get validity() {
|
|
185
|
+
const i = Q(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;
|
|
186
|
+
return {
|
|
187
|
+
customError: t,
|
|
188
|
+
rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
|
|
189
|
+
rangeUnderflow: this.value && this.value.getTime() < this.min.getTime() || !1,
|
|
190
|
+
valid: a,
|
|
191
|
+
valueMissing: this.value === null
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @hidden
|
|
196
|
+
*/
|
|
197
|
+
get validityStyles() {
|
|
198
|
+
return this.props.validityStyles !== void 0 ? this.props.validityStyles : o.defaultProps.validityStyles;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @hidden
|
|
202
|
+
*/
|
|
203
|
+
get required() {
|
|
204
|
+
return this.props.required !== void 0 ? this.props.required : o.defaultProps.required;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @hidden
|
|
208
|
+
*/
|
|
209
|
+
componentDidMount() {
|
|
210
|
+
var i;
|
|
211
|
+
this.observerResize = k && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.show && this.forceUpdate(), (i = this.document) != null && i.body && this.observerResize && this.observerResize.observe(this.document.body);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @hidden
|
|
215
|
+
*/
|
|
216
|
+
componentDidUpdate() {
|
|
217
|
+
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;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* @hidden
|
|
221
|
+
*/
|
|
222
|
+
componentWillUnmount() {
|
|
223
|
+
var i;
|
|
224
|
+
clearTimeout(this.nextTickId), (i = this.document) != null && i.body && this.observerResize && this.observerResize.disconnect();
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @hidden
|
|
228
|
+
*/
|
|
229
|
+
render() {
|
|
230
|
+
const {
|
|
231
|
+
size: i = o.defaultProps.size,
|
|
232
|
+
rounded: t = o.defaultProps.rounded,
|
|
233
|
+
fillMode: s = o.defaultProps.fillMode,
|
|
234
|
+
disabled: a,
|
|
235
|
+
tabIndex: u,
|
|
236
|
+
title: c,
|
|
237
|
+
id: l,
|
|
238
|
+
format: m,
|
|
239
|
+
formatPlaceholder: f,
|
|
240
|
+
min: d,
|
|
241
|
+
max: g,
|
|
242
|
+
className: v,
|
|
243
|
+
width: w,
|
|
244
|
+
name: h,
|
|
245
|
+
validationMessage: M,
|
|
246
|
+
required: P,
|
|
247
|
+
validityStyles: T,
|
|
248
|
+
ariaLabelledBy: E,
|
|
249
|
+
ariaDescribedBy: x,
|
|
250
|
+
ariaLabel: B
|
|
251
|
+
} = this.props, z = this.show, V = this.value, b = !this.validityStyles || this.validity.valid, F = {
|
|
252
|
+
disabled: a,
|
|
253
|
+
format: m,
|
|
254
|
+
formatPlaceholder: f,
|
|
255
|
+
id: l,
|
|
256
|
+
ariaLabelledBy: E,
|
|
257
|
+
ariaDescribedBy: x,
|
|
258
|
+
ariaLabel: B,
|
|
259
|
+
max: g,
|
|
260
|
+
min: d,
|
|
261
|
+
name: h,
|
|
262
|
+
onChange: this.handleInputValueChange,
|
|
263
|
+
required: P,
|
|
264
|
+
tabIndex: z ? -1 : u,
|
|
265
|
+
title: c,
|
|
266
|
+
valid: this.validity.valid,
|
|
267
|
+
validationMessage: M,
|
|
268
|
+
validityStyles: T,
|
|
269
|
+
value: V,
|
|
270
|
+
label: void 0,
|
|
271
|
+
placeholder: this.state.focused ? null : this.props.placeholder,
|
|
272
|
+
ariaExpanded: this.show,
|
|
273
|
+
size: null,
|
|
274
|
+
fillMode: null,
|
|
275
|
+
rounded: null
|
|
276
|
+
}, y = te(this).toLanguageString(S, ee[S]), I = /* @__PURE__ */ n.createElement(
|
|
277
|
+
_,
|
|
278
|
+
{
|
|
279
|
+
onFocus: this.handleFocus,
|
|
280
|
+
onBlur: this.mobileMode ? void 0 : this.handleBlur,
|
|
281
|
+
onSyncBlur: this.props.onBlur,
|
|
282
|
+
onSyncFocus: this.props.onFocus
|
|
283
|
+
},
|
|
284
|
+
({ onFocus: N, onBlur: R }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
285
|
+
"span",
|
|
286
|
+
{
|
|
287
|
+
ref: (A) => {
|
|
288
|
+
this._element = A;
|
|
289
|
+
},
|
|
290
|
+
className: D(
|
|
291
|
+
"k-input",
|
|
292
|
+
"k-datepicker",
|
|
293
|
+
{
|
|
294
|
+
[`k-input-${O.sizeMap[i] || i}`]: i,
|
|
295
|
+
[`k-rounded-${O.roundedMap[t] || t}`]: t,
|
|
296
|
+
[`k-input-${s}`]: s,
|
|
297
|
+
"k-invalid": !b,
|
|
298
|
+
"k-required": this.required,
|
|
299
|
+
"k-disabled": this.props.disabled
|
|
300
|
+
},
|
|
301
|
+
v
|
|
302
|
+
),
|
|
303
|
+
onKeyDown: this.handleKeyDown,
|
|
304
|
+
style: { width: w },
|
|
305
|
+
onFocus: N,
|
|
306
|
+
onBlur: R,
|
|
307
|
+
onClick: this.mobileMode ? this.handleIconClick : void 0
|
|
308
|
+
},
|
|
309
|
+
/* @__PURE__ */ n.createElement(
|
|
310
|
+
this.dateInputComp,
|
|
311
|
+
{
|
|
312
|
+
_ref: this._dateInput,
|
|
313
|
+
ariaRole: "combobox",
|
|
314
|
+
readonly: this.mobileMode,
|
|
315
|
+
ariaExpanded: this.show,
|
|
316
|
+
ariaControls: this._popupId,
|
|
317
|
+
...F
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
/* @__PURE__ */ n.createElement(
|
|
321
|
+
this.toggleButtonComp,
|
|
322
|
+
{
|
|
323
|
+
type: "button",
|
|
324
|
+
icon: "calendar",
|
|
325
|
+
svgIcon: H,
|
|
326
|
+
title: y,
|
|
327
|
+
className: "k-input-button",
|
|
328
|
+
rounded: null,
|
|
329
|
+
onClick: this.mobileMode ? void 0 : this.handleIconClick,
|
|
330
|
+
"aria-label": y,
|
|
331
|
+
onMouseDown: this.handleIconMouseDown
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
!this.mobileMode && this.renderPopup()
|
|
335
|
+
), this.mobileMode && this.renderAdaptivePopup())
|
|
336
|
+
);
|
|
337
|
+
return this.props.label ? /* @__PURE__ */ n.createElement(
|
|
338
|
+
ae,
|
|
339
|
+
{
|
|
340
|
+
dateInput: this._dateInput,
|
|
341
|
+
label: this.props.label,
|
|
342
|
+
editorId: l,
|
|
343
|
+
editorValid: b,
|
|
344
|
+
editorDisabled: this.props.disabled,
|
|
345
|
+
children: I,
|
|
346
|
+
style: { width: this.props.width }
|
|
347
|
+
}
|
|
348
|
+
) : I;
|
|
349
|
+
}
|
|
350
|
+
setShow(i) {
|
|
351
|
+
const { onOpen: t, onClose: s } = this.props;
|
|
352
|
+
this.show !== i && (this.setState({ show: i }), i && t && t.call(void 0, {
|
|
353
|
+
target: this
|
|
354
|
+
}), !i && s && s.call(void 0, {
|
|
355
|
+
target: this
|
|
356
|
+
}));
|
|
357
|
+
}
|
|
358
|
+
mergeTime(i) {
|
|
359
|
+
return this.value && i ? Y(i, this.value) : i;
|
|
360
|
+
}
|
|
361
|
+
nextTick(i) {
|
|
362
|
+
clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => i());
|
|
363
|
+
}
|
|
364
|
+
calculateMedia(i) {
|
|
365
|
+
for (let t of i)
|
|
366
|
+
this.setState({ windowWidth: t.target.clientWidth });
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
o.displayName = "DatePicker", o.propTypes = {
|
|
370
|
+
className: e.string,
|
|
371
|
+
defaultShow: e.bool,
|
|
372
|
+
defaultValue: e.instanceOf(Date),
|
|
373
|
+
disabled: e.bool,
|
|
374
|
+
focusedDate: e.instanceOf(Date),
|
|
375
|
+
format: e.oneOfType([
|
|
376
|
+
e.string,
|
|
377
|
+
e.shape({
|
|
378
|
+
skeleton: e.string,
|
|
379
|
+
pattern: e.string,
|
|
380
|
+
date: e.oneOf(["short", "medium", "long", "full"]),
|
|
381
|
+
time: e.oneOf(["short", "medium", "long", "full"]),
|
|
382
|
+
datetime: e.oneOf(["short", "medium", "long", "full"]),
|
|
383
|
+
era: e.oneOf(["narrow", "short", "long"]),
|
|
384
|
+
year: e.oneOf(["numeric", "2-digit"]),
|
|
385
|
+
month: e.oneOf(["numeric", "2-digit", "narrow", "short", "long"]),
|
|
386
|
+
day: e.oneOf(["numeric", "2-digit"]),
|
|
387
|
+
weekday: e.oneOf(["narrow", "short", "long"]),
|
|
388
|
+
hour: e.oneOf(["numeric", "2-digit"]),
|
|
389
|
+
hour12: e.bool,
|
|
390
|
+
minute: e.oneOf(["numeric", "2-digit"]),
|
|
391
|
+
second: e.oneOf(["numeric", "2-digit"]),
|
|
392
|
+
timeZoneName: e.oneOf(["short", "long"])
|
|
393
|
+
})
|
|
394
|
+
]),
|
|
395
|
+
formatPlaceholder: e.oneOfType([
|
|
396
|
+
e.oneOf(["wide", "narrow", "short", "formatPattern"]),
|
|
397
|
+
e.shape({
|
|
398
|
+
year: e.string,
|
|
399
|
+
month: e.string,
|
|
400
|
+
day: e.string,
|
|
401
|
+
hour: e.string,
|
|
402
|
+
minute: e.string,
|
|
403
|
+
second: e.string
|
|
404
|
+
})
|
|
405
|
+
]),
|
|
406
|
+
id: e.string,
|
|
407
|
+
ariaLabelledBy: e.string,
|
|
408
|
+
ariaDescribedBy: e.string,
|
|
409
|
+
ariaLabel: e.string,
|
|
410
|
+
min: e.instanceOf(Date),
|
|
411
|
+
max: e.instanceOf(Date),
|
|
412
|
+
name: e.string,
|
|
413
|
+
popupSettings: e.shape({
|
|
414
|
+
animate: e.bool,
|
|
415
|
+
appendTo: e.any,
|
|
416
|
+
popupClass: e.string
|
|
417
|
+
}),
|
|
418
|
+
show: e.bool,
|
|
419
|
+
tabIndex: e.number,
|
|
420
|
+
title: e.string,
|
|
421
|
+
value: e.instanceOf(Date),
|
|
422
|
+
weekNumber: e.bool,
|
|
423
|
+
width: e.oneOfType([e.number, e.string]),
|
|
424
|
+
validationMessage: e.string,
|
|
425
|
+
required: e.bool,
|
|
426
|
+
validate: e.bool,
|
|
427
|
+
valid: e.bool,
|
|
428
|
+
size: e.oneOf([null, "small", "medium", "large"]),
|
|
429
|
+
rounded: e.oneOf([null, "small", "medium", "large", "full"]),
|
|
430
|
+
fillMode: e.oneOf([null, "solid", "flat", "outline"]),
|
|
431
|
+
adaptive: e.bool,
|
|
432
|
+
adaptiveTitle: e.string
|
|
433
|
+
}, o.defaultProps = {
|
|
434
|
+
defaultShow: !1,
|
|
435
|
+
defaultValue: null,
|
|
436
|
+
dateInput: Z,
|
|
437
|
+
calendar: j,
|
|
438
|
+
toggleButton: se,
|
|
439
|
+
popup: q,
|
|
440
|
+
pickerWrap: oe,
|
|
441
|
+
disabled: !1,
|
|
442
|
+
format: "d",
|
|
443
|
+
max: G,
|
|
444
|
+
min: J,
|
|
445
|
+
popupSettings: {},
|
|
446
|
+
tabIndex: 0,
|
|
447
|
+
weekNumber: !1,
|
|
448
|
+
required: !1,
|
|
449
|
+
validityStyles: !0,
|
|
450
|
+
size: "medium",
|
|
451
|
+
rounded: "medium",
|
|
452
|
+
fillMode: "solid"
|
|
453
|
+
};
|
|
454
|
+
let p = o;
|
|
455
|
+
const de = K(), he = U($(de, p));
|
|
456
|
+
he.displayName = "KendoReactDatePicker";
|
|
457
|
+
ie(p);
|
|
458
|
+
export {
|
|
459
|
+
he as DatePicker,
|
|
460
|
+
de as DatePickerPropsContext,
|
|
461
|
+
p as DatePickerWithoutContext
|
|
462
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@progress/kendo-react-buttons"),e=t.Button;exports.ToggleButton=e;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { Button as t } from "@progress/kendo-react-buttons";
|
|
10
|
+
const e = t;
|
|
11
|
+
export {
|
|
12
|
+
e as ToggleButton
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),t=require("prop-types"),M=require("@progress/kendo-react-popup"),D=require("@progress/kendo-date-math"),r=require("@progress/kendo-react-common"),c=require("@progress/kendo-react-intl"),O=require("@progress/kendo-svg-icons"),k=require("../package-metadata.js"),g=require("../dateinput/DateInput.js"),T=require("../calendar/components/MultiViewCalendar.js"),h=require("../calendar/models/SelectionRange.js"),d=require("../utils.js"),x=require("../common/constants.js"),n=require("../messages/index.js"),P=require("@progress/kendo-react-buttons"),_=require("../common/AdaptiveMode.js"),N=require("@progress/kendo-react-layout");function A(u){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const e in u)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(u,e);Object.defineProperty(a,e,s.get?s:{enumerable:!0,get:()=>u[e]})}}return a.default=u,Object.freeze(a)}const i=A(R),l=class l extends i.Component{constructor(a){super(a),this._element=null,this._calendar=null,this._startDateInput=i.createRef(),this._endDateInput=i.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,s)=>(e.value!==void 0?e.value:s.value)||h.EMPTY_SELECTIONRANGE,this.calculateShow=(e,s)=>e.show!==void 0?e.show:s.show,this.renderCalendar=()=>{const e=this.value||h.EMPTY_SELECTIONRANGE,s={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?i.createElement(this.props.calendar,{...s}):i.createElement(T.MultiViewCalendar,{...s,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:"k-daterangepicker-popup",animate:this._element!==null,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?i.createElement(this.props.popup,{...e},this.renderCalendar()):i.createElement(M.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,s={expand:this.show,onClose:o=>this.handleCancel(o),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(n.dateRangePickerCancel,n.messages[n.dateRangePickerCancel]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(n.dateRangePickerSet,n.messages[n.dateRangePickerSet]),onApply:this.handleBlur}};return i.createElement(_.AdaptiveMode,{...s},i.createElement(N.ActionSheetContent,{className:"!k-overflow-hidden"},i.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const s={start:this.value.end,end:this.value.start},o={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(s,o)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:h.EMPTY_SELECTIONRANGE})});const{onCancel:s}=this.props;s&&s.call(void 0,e)},this.handleEndChange=e=>{const s={start:this.value.start,end:D.cloneDate(e.value||void 0)};this.handleChange(s,e)},this.handleStartChange=e=>{const s={start:D.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(s,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||h.EMPTY_SELECTIONRANGE;const s=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?s:this.value.start,end:this.value.start!==null?s:this.value.end}},this.handleCalendarChange=e=>{const s=this.extractRangeFromValue(e);this.handleChange(s,e)},this.handleKeyDown=e=>{const{keyCode:s,altKey:o}=e;s===r.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):o&&s===r.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):o&&s===r.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,s)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:o}=this.props;if(o){const m={syntheticEvent:s.syntheticEvent,nativeEvent:s.nativeEvent,value:this.value,show:this.show,target:this};o.call(void 0,m)}this.valueDuringOnChange=void 0},r.validatePackage(k.packageMetadata),this.state={show:this.props.show||this.props.defaultShow||l.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||l.defaultProps.defaultValue,currentValue:h.EMPTY_SELECTIONRANGE},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||h.EMPTY_SELECTIONRANGE}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:l.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:l.defaultProps.max}get document(){if(r.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return c.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=x.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}componentDidMount(){var a;this.observerResize=r.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(a=this.document)!=null&&a.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var a;clearTimeout(this.nextTickId),(a=this.document)!=null&&a.body&&this.observerResize&&this.observerResize.disconnect()}render(){const a=this.value||h.EMPTY_SELECTIONRANGE,e=this.mobileMode&&this.show?this.state.currentValue:a,s=(this.props.startDateInputSettings||{}).id||this._startInputId,o=(this.props.endDateInputSettings||{}).id||this._endInputId,m=r.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),b=this.localizationService.toLanguageString(n.start,n.messages[n.start]),E=this.localizationService.toLanguageString(n.end,n.messages[n.end]),S=this.localizationService.toLanguageString(n.separator,n.messages[n.separator]),f={disableSelection:this.mobileMode&&!0,label:b,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.startDateInputSettings,value:e.start,onChange:this.handleStartChange},v={disableSelection:this.mobileMode&&!0,label:E,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.endDateInputSettings,value:e.end,onChange:this.handleEndChange},C=i.createElement(P.Button,{type:"button",className:"k-select",fillMode:"flat",title:c.provideLocalizationService(this).toLanguageString(n.swapStartEnd,n.messages[n.swapStartEnd]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":s+" "+o,"aria-label":c.provideLocalizationService(this).toLanguageString(n.swapStartEnd,n.messages[n.swapStartEnd])},i.createElement(r.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:O.arrowsSwapIcon}));return i.createElement(i.Fragment,null,i.createElement("span",{ref:y=>{this._element=y},className:m,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?i.createElement(this.props.startDateInput,{...f}):i.createElement(g.DateInput,{...f,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?C:S,this.props.endDateInput?i.createElement(this.props.endDateInput,{...v}):i.createElement(g.DateInput,{...v,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const a=r.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&a!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):a!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(a){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>a())}setShow(a){const{onOpen:e,onClose:s}=this.props;this.show!==a&&(this.setState({show:a}),a&&e&&e.call(void 0,{target:this}),!a&&s&&s.call(void 0,{target:this}))}calculateMedia(a){for(let e of a)this.setState({windowWidth:e.target.clientWidth})}};l.displayName="DateRangePicker",l.propTypes={allowReverse:t.bool,calendarSettings:t.any,className:t.string,defaultShow:t.bool,defaultValue:t.shape({start:d.nullable(t.instanceOf(Date).isRequired),end:d.nullable(t.instanceOf(Date).isRequired)}),disabled:t.bool,endDateInputSettings:t.shape(g.DateInputWithoutContext.propTypes),focusedDate:t.instanceOf(Date),format:t.oneOfType([t.string,t.shape({skeleton:t.string,pattern:t.string,date:t.oneOf(["short","medium","long","full"]),time:t.oneOf(["short","medium","long","full"]),datetime:t.oneOf(["short","medium","long","full"]),era:t.oneOf(["narrow","short","long"]),year:t.oneOf(["numeric","2-digit"]),month:t.oneOf(["numeric","2-digit","narrow","short","long"]),day:t.oneOf(["numeric","2-digit"]),weekday:t.oneOf(["narrow","short","long"]),hour:t.oneOf(["numeric","2-digit"]),hour12:t.bool,minute:t.oneOf(["numeric","2-digit"]),second:t.oneOf(["numeric","2-digit"]),timeZoneName:t.oneOf(["short","long"])})]),id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,max:t.instanceOf(Date),min:t.instanceOf(Date),onBlur:t.func,onChange:t.func,onFocus:t.func,popupSettings:t.any,show:t.bool,startDateInputSettings:t.any,style:t.any,swapButton:t.any,tabIndex:t.number,dir:t.string,value:t.shape({start:d.nullable(t.instanceOf(Date).isRequired),end:d.nullable(t.instanceOf(Date).isRequired)})},l.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:h.EMPTY_SELECTIONRANGE,disabled:!1,format:"d",max:d.MAX_DATE,min:d.MIN_DATE,swapButton:!1};let p=l;const I=r.createPropsContext(),w=r.withIdHOC(r.withPropsContext(I,p));w.displayName="KendoReactDateRangePicker";c.registerForLocalization(p);exports.DateRangePicker=w;exports.DateRangePickerPropsContext=I;exports.DateRangePickerWithoutContext=p;
|