@progress/kendo-react-dateinputs 15.1.1-develop.3 → 15.2.0-develop.2
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 +1 -1
- package/calendar/components/Calendar.mjs +1 -1
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +17 -5
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +29 -29
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +131 -128
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +21 -32
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +66 -66
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +135 -125
- package/calendar/models/WeekDaysFormat.d.ts +1 -1
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +30 -31
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +35 -36
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +184 -183
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +61 -63
- package/datetimepicker/DateTimePicker.d.ts +1 -0
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +117 -118
- package/datetimepicker/models/DateTimePickerSettings.d.ts +7 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +46 -44
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/timepicker/TimeList.js +2 -2
- package/timepicker/TimeList.mjs +51 -47
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +57 -68
- package/timepicker/TimePicker.d.ts +8 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +122 -118
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +56 -57
- package/timepicker/models/TimePickerSettings.d.ts +7 -0
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as s from "react";
|
|
9
9
|
import t from "prop-types";
|
|
10
|
-
import { cloneDate as
|
|
11
|
-
import { Keys as
|
|
12
|
-
import { provideIntlService as K, provideLocalizationService as M, registerForIntl as
|
|
10
|
+
import { cloneDate as u } from "@progress/kendo-date-math";
|
|
11
|
+
import { Keys as h, classNames as m, uTimePicker as x, uTime as f, getActiveElement as A } from "@progress/kendo-react-common";
|
|
12
|
+
import { provideIntlService as K, provideLocalizationService as M, registerForIntl as F, registerForLocalization as R } from "@progress/kendo-react-intl";
|
|
13
13
|
import { timePickerCancel as y, messages as B, timePickerSet as D } from "../messages/index.mjs";
|
|
14
14
|
import { MIDNIGHT_DATE as L, MAX_TIME as j, MIN_TIME as z } from "../utils.mjs";
|
|
15
|
-
import { getNow as
|
|
15
|
+
import { getNow as g, valueMerger as V, generateGetters as G } from "./utils.mjs";
|
|
16
16
|
import { TimePart as H } from "./TimePart.mjs";
|
|
17
17
|
import { Button as O } from "@progress/kendo-react-buttons";
|
|
18
|
-
const r = class r extends
|
|
18
|
+
const r = class r extends s.Component {
|
|
19
19
|
constructor(i) {
|
|
20
20
|
super(i), this._element = null, this._cancelButton = null, this._acceptButton = null, this.timePart = null, this.focusActiveList = () => {
|
|
21
21
|
this.timePart && this.timePart.focus({ preventScroll: !0 });
|
|
22
22
|
}, this.handleKeyDown = (e) => {
|
|
23
23
|
const { keyCode: n } = e;
|
|
24
24
|
switch (n) {
|
|
25
|
-
case
|
|
25
|
+
case h.enter:
|
|
26
26
|
this.hasActiveButton() || this.handleAccept(e);
|
|
27
27
|
return;
|
|
28
28
|
default:
|
|
@@ -30,14 +30,14 @@ const r = class r extends a.Component {
|
|
|
30
30
|
}
|
|
31
31
|
}, this.revertToNowButton = (e) => {
|
|
32
32
|
const { keyCode: n, shiftKey: o } = e;
|
|
33
|
-
!o && n ===
|
|
33
|
+
!o && n === h.tab && (e.preventDefault(), this.props.nowButton !== !1 ? this.timePart && this.timePart.focus({ preventScroll: !0 }, !0) : this.timePart && this.timePart.focus({ preventScroll: !0 }));
|
|
34
34
|
}, this.handleNowKeyDown = (e) => {
|
|
35
35
|
var c;
|
|
36
36
|
const { keyCode: n, shiftKey: o } = e;
|
|
37
|
-
o && n ===
|
|
37
|
+
o && n === h.tab ? (e.preventDefault(), this._acceptButton && ((c = this._acceptButton.element) == null || c.focus({ preventScroll: !0 }))) : n === h.enter && (e.stopPropagation(), this.handleNowClick(e));
|
|
38
38
|
}, this.handleAccept = (e) => {
|
|
39
39
|
const n = this.mergeValue(
|
|
40
|
-
|
|
40
|
+
u(this.value || g()),
|
|
41
41
|
this.timePart ? this.timePart.value : this.current
|
|
42
42
|
);
|
|
43
43
|
this.setState({ value: n }), this.valueDuringOnChange = n;
|
|
@@ -53,7 +53,7 @@ const r = class r extends a.Component {
|
|
|
53
53
|
const { onReject: n } = this.props;
|
|
54
54
|
n && n.call(void 0, e);
|
|
55
55
|
}, this.handleNowClick = (e) => {
|
|
56
|
-
const n = this.mergeValue(
|
|
56
|
+
const n = this.mergeValue(u(this.value || g()), g());
|
|
57
57
|
this.setState({
|
|
58
58
|
current: n,
|
|
59
59
|
value: n
|
|
@@ -84,13 +84,13 @@ const r = class r extends a.Component {
|
|
|
84
84
|
}
|
|
85
85
|
get value() {
|
|
86
86
|
const i = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
87
|
-
return i !== null ?
|
|
87
|
+
return i !== null ? u(i) : null;
|
|
88
88
|
}
|
|
89
89
|
get intl() {
|
|
90
90
|
return K(this);
|
|
91
91
|
}
|
|
92
92
|
get current() {
|
|
93
|
-
return this.state.current !== null ?
|
|
93
|
+
return this.state.current !== null ? u(this.state.current) : null;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* @hidden
|
|
@@ -110,36 +110,38 @@ const r = class r extends a.Component {
|
|
|
110
110
|
className: c,
|
|
111
111
|
smoothScroll: P,
|
|
112
112
|
min: N,
|
|
113
|
-
max:
|
|
114
|
-
boundRange:
|
|
113
|
+
max: T,
|
|
114
|
+
boundRange: k,
|
|
115
115
|
nowButton: E,
|
|
116
116
|
steps: S,
|
|
117
117
|
show: _,
|
|
118
|
-
mobileMode:
|
|
118
|
+
mobileMode: v,
|
|
119
119
|
unstyled: l
|
|
120
|
-
} = this.props, I = l && l.uTimePicker, d = l && l.uTime,
|
|
121
|
-
return /* @__PURE__ */
|
|
120
|
+
} = this.props, I = l && l.uTimePicker, d = l && l.uTime, w = M(this), C = w.toLanguageString(y, B[y]), b = w.toLanguageString(D, B[D]);
|
|
121
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
|
-
ref: (
|
|
125
|
-
this._element =
|
|
124
|
+
ref: (a) => {
|
|
125
|
+
this._element = a;
|
|
126
126
|
},
|
|
127
127
|
tabIndex: n ? void 0 : o || 0,
|
|
128
128
|
className: m(
|
|
129
129
|
x.timeSelector({
|
|
130
130
|
c: I,
|
|
131
|
-
mobileMode:
|
|
131
|
+
mobileMode: v,
|
|
132
132
|
disabled: n
|
|
133
133
|
}),
|
|
134
134
|
c
|
|
135
135
|
),
|
|
136
|
+
role: "group",
|
|
137
|
+
"aria-label": "Time selector",
|
|
136
138
|
onKeyDown: this.handleKeyDown
|
|
137
139
|
},
|
|
138
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ s.createElement(
|
|
139
141
|
H,
|
|
140
142
|
{
|
|
141
|
-
ref: (
|
|
142
|
-
this.timePart =
|
|
143
|
+
ref: (a) => {
|
|
144
|
+
this.timePart = a;
|
|
143
145
|
},
|
|
144
146
|
value: this.current,
|
|
145
147
|
onChange: this.handleChange,
|
|
@@ -147,47 +149,44 @@ const r = class r extends a.Component {
|
|
|
147
149
|
format: i,
|
|
148
150
|
smoothScroll: P,
|
|
149
151
|
min: N,
|
|
150
|
-
max:
|
|
151
|
-
boundRange:
|
|
152
|
+
max: T,
|
|
153
|
+
boundRange: k,
|
|
152
154
|
disabled: n,
|
|
153
155
|
nowButton: E,
|
|
154
156
|
steps: S,
|
|
155
157
|
show: _,
|
|
156
|
-
mobileMode:
|
|
158
|
+
mobileMode: v,
|
|
157
159
|
onNowKeyDown: this.handleNowKeyDown,
|
|
158
160
|
unstyled: l
|
|
159
161
|
}
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
},
|
|
168
|
-
className: m(g.cancel({ c: d })),
|
|
169
|
-
onClick: this.handleReject,
|
|
170
|
-
title: f,
|
|
171
|
-
"aria-label": f
|
|
162
|
+
)
|
|
163
|
+
), this.props.footer && /* @__PURE__ */ s.createElement("div", { className: m(f.footer({ c: d })) }, e && /* @__PURE__ */ s.createElement(
|
|
164
|
+
O,
|
|
165
|
+
{
|
|
166
|
+
type: "button",
|
|
167
|
+
ref: (a) => {
|
|
168
|
+
this._cancelButton = a;
|
|
172
169
|
},
|
|
173
|
-
f
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
onKeyDown: this.revertToNowButton,
|
|
185
|
-
title: v,
|
|
186
|
-
"aria-label": v
|
|
170
|
+
className: m(f.cancel({ c: d })),
|
|
171
|
+
onClick: this.handleReject,
|
|
172
|
+
title: C
|
|
173
|
+
},
|
|
174
|
+
C
|
|
175
|
+
), /* @__PURE__ */ s.createElement(
|
|
176
|
+
O,
|
|
177
|
+
{
|
|
178
|
+
type: "button",
|
|
179
|
+
ref: (a) => {
|
|
180
|
+
this._acceptButton = a;
|
|
187
181
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
182
|
+
className: m(f.accept({ c: d })),
|
|
183
|
+
themeColor: "primary",
|
|
184
|
+
onClick: this.handleAccept,
|
|
185
|
+
onKeyDown: this.revertToNowButton,
|
|
186
|
+
title: b
|
|
187
|
+
},
|
|
188
|
+
b
|
|
189
|
+
)));
|
|
191
190
|
}
|
|
192
191
|
nextTick(i) {
|
|
193
192
|
clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => i());
|
|
@@ -246,8 +245,8 @@ r.propTypes = {
|
|
|
246
245
|
footer: !0
|
|
247
246
|
};
|
|
248
247
|
let p = r;
|
|
249
|
-
R(p);
|
|
250
248
|
F(p);
|
|
249
|
+
R(p);
|
|
251
250
|
export {
|
|
252
251
|
p as TimeSelector
|
|
253
252
|
};
|
|
@@ -65,6 +65,13 @@ export interface TimePickerSettings {
|
|
|
65
65
|
* This property is related to accessibility.
|
|
66
66
|
*/
|
|
67
67
|
ariaLabelledBy?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The accessible label of the component.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* This property is related to accessibility.
|
|
73
|
+
*/
|
|
74
|
+
ariaLabel?: string;
|
|
68
75
|
/**
|
|
69
76
|
* Specifies the greatest valid time ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/timepicker/time-ranges)).
|
|
70
77
|
*/
|