@progress/kendo-react-dateinputs 13.3.0-develop.9 → 13.4.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/PopupSettings.d.ts +22 -0
- package/calendar/components/Calendar.d.ts +202 -0
- package/calendar/components/Calendar.mjs +7 -7
- package/calendar/components/CalendarCell.d.ts +71 -0
- package/calendar/components/CalendarHeaderTitle.d.ts +38 -0
- package/calendar/components/CalendarNavigationItem.d.ts +39 -0
- package/calendar/components/CalendarWeekCell.d.ts +42 -0
- package/calendar/components/Header.d.ts +65 -0
- package/calendar/components/Header.mjs +3 -3
- package/calendar/components/HorizontalViewList.d.ts +80 -0
- package/calendar/components/HorizontalViewList.mjs +3 -3
- package/calendar/components/MultiViewCalendar.d.ts +226 -0
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +17 -17
- package/calendar/components/Navigation.d.ts +85 -0
- package/calendar/components/TodayCommand.d.ts +46 -0
- package/calendar/components/TodayCommand.mjs +3 -3
- package/calendar/components/View.d.ts +101 -0
- package/calendar/components/ViewList.d.ts +128 -0
- package/calendar/models/ActiveView.d.ts +11 -0
- package/calendar/models/CalendarSettings.d.ts +256 -0
- package/calendar/models/CalendarViewEnum.d.ts +16 -0
- package/calendar/models/CellContext.d.ts +72 -0
- package/calendar/models/MultiViewCalendarMode.d.ts +16 -0
- package/calendar/models/MultiViewCalendarSettings.d.ts +129 -0
- package/calendar/models/NavigationAction.d.ts +22 -0
- package/calendar/models/SelectionRange.d.ts +24 -0
- package/calendar/models/SelectionRangeEnd.d.ts +11 -0
- package/calendar/models/ViewService.d.ts +32 -0
- package/calendar/models/WeekDaysFormat.d.ts +11 -0
- package/calendar/models/index.d.ts +18 -0
- package/calendar/services/BusViewService.d.ts +28 -0
- package/calendar/services/CenturyViewService.d.ts +32 -0
- package/calendar/services/CenturyViewService.mjs +4 -4
- package/calendar/services/DOMService.d.ts +36 -0
- package/calendar/services/DecadeViewService.d.ts +34 -0
- package/calendar/services/DecadeViewService.mjs +4 -4
- package/calendar/services/MonthViewService.d.ts +40 -0
- package/calendar/services/MonthViewService.mjs +2 -2
- package/calendar/services/NavigationService.d.ts +21 -0
- package/calendar/services/ScrollSyncService.d.ts +28 -0
- package/calendar/services/WeekNamesService.d.ts +17 -0
- package/calendar/services/YearViewService.d.ts +38 -0
- package/calendar/services/YearViewService.mjs +2 -2
- package/calendar/services/index.d.ts +17 -0
- package/calendar/utils/ScrollSync.d.ts +20 -0
- package/codemods/utils.js +1 -8
- package/codemods/v11/dateinput-handle.js +1 -8
- package/codemods/v11/datepicker-handle.js +1 -8
- package/common/AdaptiveMode.d.ts +22 -0
- package/common/ClearButton.d.ts +20 -0
- package/dateinput/DateInput.d.ts +248 -0
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +63 -65
- package/dateinput/dateInputIntl.d.ts +30 -0
- package/dateinput/models/DateInputSettings.d.ts +107 -0
- package/dateinput/models/common-package-props.d.ts +34 -0
- package/dateinput/models/dateinput-options.d.ts +105 -0
- package/dateinput/models/format-placeholder.d.ts +46 -0
- package/dateinput/models/incremental-steps.d.ts +24 -0
- package/dateinput/models/index.d.ts +15 -0
- package/dateinput/models/kendo-date.d.ts +60 -0
- package/dateinput/models/mask.d.ts +14 -0
- package/dateinput/models/selection.d.ts +14 -0
- package/dateinput/utils.d.ts +31 -0
- package/datepicker/DatePicker.d.ts +279 -0
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +68 -72
- package/datepicker/ToggleButton.d.ts +17 -0
- package/datepicker/models/DatePickerSettings.d.ts +248 -0
- package/datepicker/models/index.d.ts +9 -0
- package/daterangepicker/DateRangePicker.d.ts +357 -0
- package/daterangepicker/DateRangePicker.mjs +13 -13
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +13 -0
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +13 -0
- package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +13 -0
- package/daterangepicker/models/DateRangePickerSettings.d.ts +129 -0
- package/daterangepicker/models/index.d.ts +12 -0
- package/datetimepicker/DateTimePicker.d.ts +420 -0
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +16 -20
- package/datetimepicker/DateTimeSelector.d.ts +111 -0
- package/datetimepicker/DateTimeSelector.mjs +3 -3
- package/datetimepicker/models/DateTimePickerSettings.d.ts +154 -0
- package/datetimepicker/models/index.d.ts +9 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/hooks/usePickerFloatingLabel.d.ts +27 -0
- package/index.d.mts +35 -4952
- package/index.d.ts +35 -4952
- package/messages/index.d.ts +132 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +8 -8
- package/timepicker/TimeList.d.ts +97 -0
- package/timepicker/TimeList.js +5 -5
- package/timepicker/TimeList.mjs +122 -112
- package/timepicker/TimePart.d.ts +146 -0
- package/timepicker/TimePart.mjs +3 -3
- package/timepicker/TimePicker.d.ts +417 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +64 -68
- package/timepicker/TimeSelector.d.ts +149 -0
- package/timepicker/TimeSelector.mjs +3 -3
- package/timepicker/models/IncrementalSteps.d.ts +18 -0
- package/timepicker/models/ListItem.d.ts +14 -0
- package/timepicker/models/ListService.d.ts +22 -0
- package/timepicker/models/ListServiceSettings.d.ts +19 -0
- package/timepicker/models/TimePart.d.ts +17 -0
- package/timepicker/models/TimePickerSettings.d.ts +137 -0
- package/timepicker/models/index.d.ts +14 -0
- package/timepicker/services/DOMService.d.ts +18 -0
- package/timepicker/services/DayPeriodService.d.ts +54 -0
- package/timepicker/services/HoursService.d.ts +40 -0
- package/timepicker/services/MinutesService.d.ts +39 -0
- package/timepicker/services/SecondsService.d.ts +39 -0
- package/timepicker/services/index.d.ts +13 -0
- package/timepicker/utils.d.ts +63 -0
- package/timepicker/utils.mjs +1 -1
- package/utils.d.ts +103 -0
- package/utils.js +1 -1
- package/utils.mjs +46 -46
- package/virtualization/Virtualization.d.ts +125 -0
- package/virtualization/services/ScrollerService.d.ts +56 -0
- package/virtualization/services/index.d.ts +10 -0
package/timepicker/TimeList.mjs
CHANGED
|
@@ -5,97 +5,97 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import { cloneDate as
|
|
11
|
-
import {
|
|
12
|
-
import { provideIntlService as
|
|
13
|
-
import { Virtualization as
|
|
8
|
+
import * as r from "react";
|
|
9
|
+
import d from "prop-types";
|
|
10
|
+
import { cloneDate as H } from "@progress/kendo-date-math";
|
|
11
|
+
import { getActiveElement as S, Keys as c, noop as I, classNames as u, uTime as l } from "@progress/kendo-react-common";
|
|
12
|
+
import { provideIntlService as M, registerForIntl as y } from "@progress/kendo-react-intl";
|
|
13
|
+
import { Virtualization as E } from "../virtualization/Virtualization.mjs";
|
|
14
14
|
import { TIME_PART as f } from "./models/TimePart.mjs";
|
|
15
15
|
import { DayPeriodService as D } from "./services/DayPeriodService.mjs";
|
|
16
|
-
import { DOMService as
|
|
17
|
-
import { HoursService as
|
|
18
|
-
import { MinutesService as
|
|
19
|
-
import { SecondsService as
|
|
20
|
-
import { debounce as
|
|
21
|
-
const F = 2,
|
|
22
|
-
[c.end]: (
|
|
23
|
-
[c.home]: (
|
|
24
|
-
[c.up]: (
|
|
25
|
-
[c.down]: (
|
|
16
|
+
import { DOMService as _ } from "./services/DOMService.mjs";
|
|
17
|
+
import { HoursService as C } from "./services/HoursService.mjs";
|
|
18
|
+
import { MinutesService as w } from "./services/MinutesService.mjs";
|
|
19
|
+
import { SecondsService as R } from "./services/SecondsService.mjs";
|
|
20
|
+
import { debounce as P, MIDNIGHT_DATE as z, MAX_TIME as A } from "../utils.mjs";
|
|
21
|
+
const F = 2, b = 0.05, N = 100, k = 0, O = 9, B = {
|
|
22
|
+
[c.end]: (a, i) => a[a.length - 1],
|
|
23
|
+
[c.home]: (a, i) => a[0],
|
|
24
|
+
[c.up]: (a, i) => a[i - 1],
|
|
25
|
+
[c.down]: (a, i) => a[i + 1]
|
|
26
26
|
}, g = {
|
|
27
27
|
[f.dayperiod]: D,
|
|
28
|
-
[f.hour]:
|
|
29
|
-
[f.minute]:
|
|
30
|
-
[f.second]:
|
|
31
|
-
},
|
|
28
|
+
[f.hour]: C,
|
|
29
|
+
[f.minute]: w,
|
|
30
|
+
[f.second]: R
|
|
31
|
+
}, h = class h extends r.Component {
|
|
32
32
|
constructor(i) {
|
|
33
|
-
super(i), this.intl = null, this._element = null, this.service = null, this.virtualization = null, this.topOffset = 0, this.bottomOffset = 0, this.itemHeight = 0, this.listHeight = 0, this.topThreshold = 0, this.bottomThreshold = 0, this.animateToIndex = !1, this.focus = (
|
|
33
|
+
super(i), this.intl = null, this._element = null, this.service = null, this.virtualization = null, this.topOffset = 0, this.bottomOffset = 0, this.itemHeight = 0, this.listHeight = 0, this.topThreshold = 0, this.bottomThreshold = 0, this.animateToIndex = !1, this.focus = (e) => {
|
|
34
34
|
Promise.resolve().then(() => {
|
|
35
|
-
this.element && this.element.focus(
|
|
35
|
+
this.element && this.element.focus(e);
|
|
36
36
|
});
|
|
37
|
-
}, this.itemOffset = (
|
|
37
|
+
}, this.itemOffset = (e) => {
|
|
38
38
|
if (!this.virtualization || !this.service)
|
|
39
39
|
return -1;
|
|
40
|
-
const s = this.service.selectedIndex(this.props.value),
|
|
41
|
-
if (s ===
|
|
40
|
+
const s = this.service.selectedIndex(this.props.value), t = this.virtualization.activeIndex(), o = this.virtualization.itemOffset(t), n = Math.abs(Math.ceil(e) - o);
|
|
41
|
+
if (s === t && n < F)
|
|
42
42
|
return o;
|
|
43
|
-
const
|
|
44
|
-
return
|
|
43
|
+
const p = s > t;
|
|
44
|
+
return p && n >= this.bottomThreshold || !p && n > this.topThreshold ? this.virtualization.itemOffset(t + 1) : o;
|
|
45
45
|
}, this.calculateHeights = () => {
|
|
46
|
-
this.dom.didCalculate && (this.itemHeight = this.dom.itemHeight, this.listHeight = this.dom.timeListHeight, this.topOffset = (this.listHeight - this.itemHeight) / 2, this.bottomOffset = this.listHeight - this.itemHeight, this.props.mobileMode && (this.topOffset +=
|
|
47
|
-
}, this.configureServices = ({ min:
|
|
46
|
+
this.dom.didCalculate && (this.itemHeight = this.dom.itemHeight, this.listHeight = this.dom.timeListHeight, this.topOffset = (this.listHeight - this.itemHeight) / 2, this.bottomOffset = this.listHeight - this.itemHeight, this.props.mobileMode && (this.topOffset += O, this.bottomOffset += O * 2), this.topThreshold = this.itemHeight * b, this.bottomThreshold = this.itemHeight * (1 - b));
|
|
47
|
+
}, this.configureServices = ({ min: e, max: s, value: t } = this.props) => {
|
|
48
48
|
if (this.service) {
|
|
49
|
-
const [o,
|
|
50
|
-
|
|
49
|
+
const [o, n] = this.service.limitRange(
|
|
50
|
+
e || this.min,
|
|
51
51
|
s || this.max,
|
|
52
|
-
|
|
52
|
+
t || this.props.value
|
|
53
53
|
);
|
|
54
|
-
this.service.configure(this.serviceSettings({ min: o, max:
|
|
54
|
+
this.service.configure(this.serviceSettings({ min: o, max: n }));
|
|
55
55
|
}
|
|
56
|
-
}, this.serviceSettings = (
|
|
56
|
+
}, this.serviceSettings = (e) => {
|
|
57
57
|
const s = {
|
|
58
|
-
boundRange: this.props.boundRange ||
|
|
58
|
+
boundRange: this.props.boundRange || h.defaultProps.boundRange,
|
|
59
59
|
insertUndividedMax: !1,
|
|
60
|
-
min:
|
|
61
|
-
max:
|
|
60
|
+
min: H(this.min),
|
|
61
|
+
max: H(this.max),
|
|
62
62
|
part: this.props.part,
|
|
63
63
|
step: this.step
|
|
64
|
-
},
|
|
65
|
-
return
|
|
66
|
-
}, this.handleScrollAction = ({ target:
|
|
67
|
-
if (!(!this.virtualization || !this.service) &&
|
|
64
|
+
}, t = Object.assign({}, s, e);
|
|
65
|
+
return t.boundRange = t.part.type !== "hour" || this.props.boundRange || h.defaultProps.boundRange, t;
|
|
66
|
+
}, this.handleScrollAction = ({ target: e, animationInProgress: s }) => {
|
|
67
|
+
if (!(!this.virtualization || !this.service) && e && !s) {
|
|
68
68
|
this.animateToIndex = !1;
|
|
69
|
-
const
|
|
69
|
+
const t = this.virtualization.itemIndex(this.itemOffset(e.scrollTop)), o = this.service.data(this.props.value)[t];
|
|
70
70
|
this.handleChange(o);
|
|
71
71
|
}
|
|
72
|
-
}, this.handleFocus = (
|
|
72
|
+
}, this.handleFocus = (e) => {
|
|
73
73
|
const { onFocus: s } = this.props;
|
|
74
|
-
s && s.call(void 0,
|
|
75
|
-
}, this.handleBlur = (
|
|
74
|
+
s && s.call(void 0, e);
|
|
75
|
+
}, this.handleBlur = (e) => {
|
|
76
76
|
const { onBlur: s } = this.props;
|
|
77
|
-
s && s.call(void 0,
|
|
77
|
+
s && s.call(void 0, e);
|
|
78
78
|
}, this.handleMouseOver = () => {
|
|
79
79
|
if (!this._element)
|
|
80
80
|
return;
|
|
81
|
-
const
|
|
82
|
-
document &&
|
|
83
|
-
}, this.handleKeyDown = (
|
|
81
|
+
const e = S(document);
|
|
82
|
+
document && e !== this._element && this.props.show && this._element.focus({ preventScroll: !0 });
|
|
83
|
+
}, this.handleKeyDown = (e) => {
|
|
84
84
|
if (!this.service)
|
|
85
85
|
return;
|
|
86
|
-
const { keyCode: s } =
|
|
87
|
-
(s === c.down || s === c.up || s === c.end || s === c.home) &&
|
|
88
|
-
const o = (B[
|
|
86
|
+
const { keyCode: s } = e;
|
|
87
|
+
(s === c.down || s === c.up || s === c.end || s === c.home) && e.preventDefault();
|
|
88
|
+
const o = (B[e.keyCode] || I)(this.service.data(this.props.value), this.service.selectedIndex(this.props.value));
|
|
89
89
|
o && this.handleChange(o);
|
|
90
|
-
}, this.handleChange =
|
|
90
|
+
}, this.handleChange = P((e) => {
|
|
91
91
|
if (!this.service)
|
|
92
92
|
return;
|
|
93
|
-
const s = this.service.apply(this.props.value,
|
|
93
|
+
const s = this.service.apply(this.props.value, e.value);
|
|
94
94
|
if (this.props.value.getTime() === s.getTime())
|
|
95
95
|
return;
|
|
96
|
-
const { onChange:
|
|
97
|
-
|
|
98
|
-
}, N), this.dom = new
|
|
96
|
+
const { onChange: t } = this.props;
|
|
97
|
+
t && t.call(void 0, s);
|
|
98
|
+
}, N), this.dom = new _();
|
|
99
99
|
}
|
|
100
100
|
get element() {
|
|
101
101
|
return this._element;
|
|
@@ -104,13 +104,13 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
104
104
|
return !!(this.props.smoothScroll && this.animateToIndex);
|
|
105
105
|
}
|
|
106
106
|
get min() {
|
|
107
|
-
return this.props.min ||
|
|
107
|
+
return this.props.min || h.defaultProps.min;
|
|
108
108
|
}
|
|
109
109
|
get max() {
|
|
110
|
-
return this.props.max ||
|
|
110
|
+
return this.props.max || h.defaultProps.max;
|
|
111
111
|
}
|
|
112
112
|
get step() {
|
|
113
|
-
return this.props.step !== void 0 && this.props.step !== 0 ? Math.floor(this.props.step) :
|
|
113
|
+
return this.props.step !== void 0 && this.props.step !== 0 ? Math.floor(this.props.step) : h.defaultProps.step;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* @hidden
|
|
@@ -118,17 +118,27 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
118
118
|
componentDidMount() {
|
|
119
119
|
Promise.resolve().then(() => {
|
|
120
120
|
const { unstyled: i } = this.props;
|
|
121
|
-
this._element && (this.dom.calculateHeights(this._element, i), this.forceUpdate());
|
|
121
|
+
this._element && (this.dom.calculateHeights(this._element, i), this.lastMeasuredHeight = this._element.clientHeight, this.forceUpdate());
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* @hidden
|
|
126
126
|
*/
|
|
127
|
-
componentDidUpdate() {
|
|
127
|
+
componentDidUpdate(i) {
|
|
128
|
+
var s;
|
|
128
129
|
if (!this.virtualization || !this.service)
|
|
129
130
|
return;
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
if (this._element) {
|
|
132
|
+
const t = this._element.clientHeight, o = this.lastMeasuredHeight !== void 0 && Math.abs(t - this.lastMeasuredHeight) > 1, n = this.props.mobileMode !== i.mobileMode;
|
|
133
|
+
if (o || n) {
|
|
134
|
+
const { unstyled: p } = this.props;
|
|
135
|
+
this.dom.calculateHeights(this._element, p), this.calculateHeights(), this.lastMeasuredHeight = t, this.animateToIndex = !1, this.forceUpdate();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
(s = this.lastMeasuredHeight) != null || (this.lastMeasuredHeight = t);
|
|
139
|
+
}
|
|
140
|
+
const e = this.service.selectedIndex(this.props.value);
|
|
141
|
+
if (this.virtualization[this.animate ? "animateToIndex" : "scrollToIndex"](e), this.animateToIndex = !0, !this.topOffset && this._element) {
|
|
132
142
|
const { unstyled: t } = this.props;
|
|
133
143
|
this.dom.calculateHeights(this._element, t);
|
|
134
144
|
}
|
|
@@ -137,72 +147,72 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
137
147
|
* @hidden
|
|
138
148
|
*/
|
|
139
149
|
render() {
|
|
140
|
-
const { part: i, value:
|
|
150
|
+
const { part: i, value: e, unstyled: s } = this.props;
|
|
141
151
|
if (!i.type || !g[i.type])
|
|
142
152
|
return;
|
|
143
|
-
const
|
|
144
|
-
this.calculateHeights(), this.intl =
|
|
145
|
-
const o = this.service.data(
|
|
153
|
+
const t = s && s.uTime;
|
|
154
|
+
this.calculateHeights(), this.intl = M(this), this.service = new g[i.type](this.intl), this.configureServices();
|
|
155
|
+
const o = this.service.data(e), n = "translateY(" + this.topOffset + "px)", p = this.service.total(e), v = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
146
156
|
"ul",
|
|
147
157
|
{
|
|
148
|
-
style: { transform:
|
|
149
|
-
className: u(l.ul({ c:
|
|
158
|
+
style: { transform: n, msTransform: n },
|
|
159
|
+
className: u(l.ul({ c: t }))
|
|
150
160
|
},
|
|
151
|
-
o.map((
|
|
161
|
+
o.map((m, T) => /* @__PURE__ */ r.createElement(
|
|
152
162
|
"li",
|
|
153
163
|
{
|
|
154
|
-
key:
|
|
155
|
-
className: u(l.li({ c:
|
|
164
|
+
key: T,
|
|
165
|
+
className: u(l.li({ c: t })),
|
|
156
166
|
onClick: () => {
|
|
157
|
-
this.handleChange(
|
|
167
|
+
this.handleChange(m);
|
|
158
168
|
}
|
|
159
169
|
},
|
|
160
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ r.createElement("span", null, m.text)
|
|
161
171
|
))
|
|
162
|
-
), /* @__PURE__ */
|
|
163
|
-
return /* @__PURE__ */
|
|
172
|
+
), /* @__PURE__ */ r.createElement("div", { className: u(l.scrollablePlaceholder({ c: t })) }));
|
|
173
|
+
return /* @__PURE__ */ r.createElement(
|
|
164
174
|
"div",
|
|
165
175
|
{
|
|
166
|
-
className: u(l.list({ c:
|
|
176
|
+
className: u(l.list({ c: t })),
|
|
167
177
|
id: String(this.props.id || ""),
|
|
168
178
|
tabIndex: this.props.disabled ? -1 : 0,
|
|
169
|
-
ref: (
|
|
170
|
-
this._element =
|
|
179
|
+
ref: (m) => {
|
|
180
|
+
this._element = m;
|
|
171
181
|
},
|
|
172
182
|
onKeyDown: this.handleKeyDown,
|
|
173
183
|
onFocus: this.handleFocus,
|
|
174
184
|
onBlur: this.handleBlur,
|
|
175
185
|
onMouseOver: this.handleMouseOver
|
|
176
186
|
},
|
|
177
|
-
this.dom.didCalculate ? /* @__PURE__ */
|
|
178
|
-
|
|
187
|
+
this.dom.didCalculate ? /* @__PURE__ */ r.createElement(
|
|
188
|
+
E,
|
|
179
189
|
{
|
|
180
190
|
bottomOffset: this.bottomOffset,
|
|
181
191
|
children: v,
|
|
182
192
|
className: u(
|
|
183
|
-
l.containerSelector({ c:
|
|
184
|
-
l.container({ c:
|
|
193
|
+
l.containerSelector({ c: t }),
|
|
194
|
+
l.container({ c: t })
|
|
185
195
|
),
|
|
186
196
|
itemHeight: this.itemHeight,
|
|
187
197
|
maxScrollDifference: this.listHeight,
|
|
188
198
|
onScrollAction: this.handleScrollAction,
|
|
189
|
-
ref: (
|
|
190
|
-
this.virtualization =
|
|
199
|
+
ref: (m) => {
|
|
200
|
+
this.virtualization = m;
|
|
191
201
|
},
|
|
192
202
|
role: "presentation",
|
|
193
203
|
skip: k,
|
|
194
204
|
tabIndex: -1,
|
|
195
|
-
take:
|
|
205
|
+
take: p,
|
|
196
206
|
topOffset: this.topOffset,
|
|
197
|
-
total:
|
|
207
|
+
total: p,
|
|
198
208
|
unstyled: s
|
|
199
209
|
}
|
|
200
|
-
) : /* @__PURE__ */
|
|
210
|
+
) : /* @__PURE__ */ r.createElement(
|
|
201
211
|
"div",
|
|
202
212
|
{
|
|
203
213
|
className: u(
|
|
204
|
-
l.containerSelector({ c:
|
|
205
|
-
l.container({ c:
|
|
214
|
+
l.containerSelector({ c: t }),
|
|
215
|
+
l.container({ c: t, content: !0, scrollable: !0 })
|
|
206
216
|
)
|
|
207
217
|
},
|
|
208
218
|
v
|
|
@@ -210,40 +220,40 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
210
220
|
);
|
|
211
221
|
}
|
|
212
222
|
};
|
|
213
|
-
|
|
214
|
-
id:
|
|
215
|
-
max:
|
|
216
|
-
min:
|
|
217
|
-
part: function(i,
|
|
218
|
-
const
|
|
219
|
-
if (!
|
|
223
|
+
h.propTypes = {
|
|
224
|
+
id: d.number,
|
|
225
|
+
max: d.instanceOf(Date),
|
|
226
|
+
min: d.instanceOf(Date),
|
|
227
|
+
part: function(i, e, s) {
|
|
228
|
+
const t = i[e];
|
|
229
|
+
if (!t || !g[t.type])
|
|
220
230
|
throw new Error(`
|
|
221
|
-
Invalid prop '${
|
|
231
|
+
Invalid prop '${e}' supplied to ${s}.
|
|
222
232
|
Supported part types are hour|minute|second|dayperiod.
|
|
223
233
|
`);
|
|
224
234
|
return null;
|
|
225
235
|
},
|
|
226
|
-
step: function(i,
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
236
|
+
step: function(i, e, s) {
|
|
237
|
+
const t = i[e];
|
|
238
|
+
if (t !== void 0 && t <= 0)
|
|
229
239
|
throw new Error(`
|
|
230
|
-
Invalid prop '${
|
|
231
|
-
${
|
|
240
|
+
Invalid prop '${e}' supplied to ${s}.
|
|
241
|
+
${e} cannot be less than 1.
|
|
232
242
|
`);
|
|
233
243
|
return null;
|
|
234
244
|
},
|
|
235
|
-
value:
|
|
236
|
-
smoothScroll:
|
|
237
|
-
show:
|
|
238
|
-
},
|
|
245
|
+
value: d.instanceOf(Date),
|
|
246
|
+
smoothScroll: d.bool,
|
|
247
|
+
show: d.bool
|
|
248
|
+
}, h.defaultProps = {
|
|
239
249
|
boundRange: !1,
|
|
240
|
-
max:
|
|
241
|
-
min:
|
|
250
|
+
max: A,
|
|
251
|
+
min: z,
|
|
242
252
|
step: 1,
|
|
243
253
|
smoothScroll: !0
|
|
244
254
|
};
|
|
245
|
-
let x =
|
|
246
|
-
|
|
255
|
+
let x = h;
|
|
256
|
+
y(x);
|
|
247
257
|
export {
|
|
248
258
|
x as TimeList
|
|
249
259
|
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { default as PropTypes } from 'prop-types';
|
|
9
|
+
import { DateInputsClassStructure } from '@progress/kendo-react-common';
|
|
10
|
+
import { DateFormatPart, IntlService, DateFormatOptions } from '@progress/kendo-react-intl';
|
|
11
|
+
import { TimePickerIncrementalSteps } from './models/IncrementalSteps.js';
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare enum Direction {
|
|
17
|
+
Left = 0,
|
|
18
|
+
Right = 1
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export interface TimePartChangeEvent {
|
|
24
|
+
nativeEvent: any;
|
|
25
|
+
syntheticEvent: React.SyntheticEvent<any>;
|
|
26
|
+
value: Date;
|
|
27
|
+
target: TimePart;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export interface TimePartProps {
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
format?: string | DateFormatOptions;
|
|
35
|
+
max?: Date;
|
|
36
|
+
min?: Date;
|
|
37
|
+
nowButton?: boolean;
|
|
38
|
+
onChange?: any;
|
|
39
|
+
steps?: TimePickerIncrementalSteps;
|
|
40
|
+
smoothScroll?: boolean;
|
|
41
|
+
tabIndex?: number;
|
|
42
|
+
value?: Date | null;
|
|
43
|
+
boundRange?: boolean;
|
|
44
|
+
onNowClick?: any;
|
|
45
|
+
className?: string;
|
|
46
|
+
onMount?: (value: Date) => void;
|
|
47
|
+
onNowKeyDown?: (event: React.KeyboardEvent) => void;
|
|
48
|
+
show?: boolean;
|
|
49
|
+
mobileMode?: boolean;
|
|
50
|
+
unstyled?: DateInputsClassStructure;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
export interface TimePartState {
|
|
56
|
+
activeListIndex: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
export declare class TimePart extends React.Component<TimePartProps, TimePartState> {
|
|
62
|
+
static propTypes: {
|
|
63
|
+
cancelButton: PropTypes.Requireable<boolean>;
|
|
64
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
65
|
+
format: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
66
|
+
skeleton: PropTypes.Requireable<string>;
|
|
67
|
+
pattern: PropTypes.Requireable<string>;
|
|
68
|
+
date: PropTypes.Requireable<string>;
|
|
69
|
+
time: PropTypes.Requireable<string>;
|
|
70
|
+
datetime: PropTypes.Requireable<string>;
|
|
71
|
+
era: PropTypes.Requireable<string>;
|
|
72
|
+
year: PropTypes.Requireable<string>;
|
|
73
|
+
month: PropTypes.Requireable<string>;
|
|
74
|
+
day: PropTypes.Requireable<string>;
|
|
75
|
+
weekday: PropTypes.Requireable<string>;
|
|
76
|
+
hour: PropTypes.Requireable<string>;
|
|
77
|
+
hour12: PropTypes.Requireable<boolean>;
|
|
78
|
+
minute: PropTypes.Requireable<string>;
|
|
79
|
+
second: PropTypes.Requireable<string>;
|
|
80
|
+
timeZoneName: PropTypes.Requireable<string>;
|
|
81
|
+
}> | null | undefined>>;
|
|
82
|
+
max: PropTypes.Requireable<Date>;
|
|
83
|
+
min: PropTypes.Requireable<Date>;
|
|
84
|
+
nowButton: PropTypes.Requireable<boolean>;
|
|
85
|
+
steps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
86
|
+
hour: PropTypes.Requireable<number>;
|
|
87
|
+
minute: PropTypes.Requireable<number>;
|
|
88
|
+
second: PropTypes.Requireable<number>;
|
|
89
|
+
}>>;
|
|
90
|
+
smoothScroll: PropTypes.Requireable<boolean>;
|
|
91
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
92
|
+
value: PropTypes.Requireable<Date>;
|
|
93
|
+
show: PropTypes.Requireable<boolean>;
|
|
94
|
+
};
|
|
95
|
+
static defaultProps: {
|
|
96
|
+
value: null;
|
|
97
|
+
disabled: boolean;
|
|
98
|
+
nowButton: boolean;
|
|
99
|
+
cancelButton: boolean;
|
|
100
|
+
format: string;
|
|
101
|
+
min: Date;
|
|
102
|
+
max: Date;
|
|
103
|
+
steps: {};
|
|
104
|
+
boundRange: boolean;
|
|
105
|
+
};
|
|
106
|
+
readonly state: TimePartState;
|
|
107
|
+
private _element;
|
|
108
|
+
private _nowButton;
|
|
109
|
+
private dateFormatParts;
|
|
110
|
+
private timeLists;
|
|
111
|
+
private snapTime;
|
|
112
|
+
private nextTickId;
|
|
113
|
+
constructor(props: TimePartProps);
|
|
114
|
+
/**
|
|
115
|
+
* @hidden
|
|
116
|
+
*/
|
|
117
|
+
get element(): HTMLSpanElement | null;
|
|
118
|
+
get value(): Date;
|
|
119
|
+
protected get intl(): IntlService;
|
|
120
|
+
private get min();
|
|
121
|
+
private get max();
|
|
122
|
+
private get steps();
|
|
123
|
+
protected get boundRange(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* @hidden
|
|
126
|
+
*/
|
|
127
|
+
componentWillUnmount(): void;
|
|
128
|
+
componentDidMount(): void;
|
|
129
|
+
/**
|
|
130
|
+
* @hidden
|
|
131
|
+
*/
|
|
132
|
+
render(): React.JSX.Element;
|
|
133
|
+
focus: (args?: FocusOptions, focusNowButton?: boolean) => void;
|
|
134
|
+
protected timeFormatReducer: (acc: string, current: DateFormatPart) => string;
|
|
135
|
+
protected timeFormatFilter: (part: DateFormatPart, index: number, all: DateFormatPart[]) => boolean;
|
|
136
|
+
protected nextTick(f: () => any): void;
|
|
137
|
+
protected hasActiveButton(): boolean | null;
|
|
138
|
+
protected focusList: (dir: Direction) => void;
|
|
139
|
+
protected listReducer: (state: any, list: any, idx: number, all: any) => any;
|
|
140
|
+
protected showNowButton: () => boolean | undefined;
|
|
141
|
+
protected hasSteps(): boolean;
|
|
142
|
+
private handleKeyDown;
|
|
143
|
+
private handleListBlur;
|
|
144
|
+
private handleListFocus;
|
|
145
|
+
private handleChange;
|
|
146
|
+
}
|
package/timepicker/TimePart.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { Keys as T, classNames as l, uTime as h, getActiveElement as R } from "@
|
|
|
12
12
|
import { provideIntlService as k, provideLocalizationService as S, registerForIntl as C, registerForLocalization as M } from "@progress/kendo-react-intl";
|
|
13
13
|
import { selectNow as L, messages as x, now as I } from "../messages/index.mjs";
|
|
14
14
|
import { TimeList as P } from "./TimeList.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { MAX_TIME as A, MIN_TIME as K, MIDNIGHT_DATE as _ } from "../utils.mjs";
|
|
16
16
|
import { TIME_PART as d } from "./models/TimePart.mjs";
|
|
17
17
|
import { isInTimeRange as $, getNow as z, snapTime as N, generateSnappers as B, timeInRange as W } from "./utils.mjs";
|
|
18
18
|
import { Button as j } from "@progress/kendo-react-buttons";
|
|
@@ -239,8 +239,8 @@ a.propTypes = {
|
|
|
239
239
|
nowButton: !0,
|
|
240
240
|
cancelButton: !0,
|
|
241
241
|
format: "hh:mm a",
|
|
242
|
-
min:
|
|
243
|
-
max:
|
|
242
|
+
min: K,
|
|
243
|
+
max: A,
|
|
244
244
|
steps: {},
|
|
245
245
|
boundRange: !1
|
|
246
246
|
};
|