@progress/kendo-react-dateinputs 8.3.0-develop.5 → 8.3.0-develop.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calendar/components/Calendar.js +2 -2
- package/calendar/components/Calendar.mjs +123 -115
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +37 -39
- package/calendar/components/CalendarHeaderTitle.js +1 -1
- package/calendar/components/CalendarHeaderTitle.mjs +6 -12
- package/calendar/components/CalendarNavigationItem.js +1 -1
- package/calendar/components/CalendarNavigationItem.mjs +15 -19
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +10 -15
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +30 -40
- package/calendar/components/Navigation.js +1 -1
- package/calendar/components/Navigation.mjs +52 -49
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +21 -25
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +48 -42
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +99 -94
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +25 -31
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +113 -110
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +22 -23
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +9 -9
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +5 -5
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +95 -90
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +83 -81
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +38 -28
- package/index.d.ts +38 -28
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimeList.js +3 -3
- package/timepicker/TimeList.mjs +83 -81
- package/timepicker/TimePart.js +1 -1
- package/timepicker/TimePart.mjs +74 -68
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +112 -107
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +66 -59
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +49 -48
|
@@ -8,59 +8,59 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { Popup as
|
|
12
|
-
import { cloneDate as
|
|
13
|
-
import { classNames as
|
|
14
|
-
import { clockIcon as
|
|
15
|
-
import { provideLocalizationService as
|
|
16
|
-
import { packageMetadata as
|
|
17
|
-
import { toggleClock as
|
|
18
|
-
import { DateInput as
|
|
19
|
-
import { TimeSelector as
|
|
20
|
-
import { MAX_TIME as
|
|
21
|
-
import { isInRange as
|
|
22
|
-
import { PickerFloatingLabel as
|
|
23
|
-
import { Button as
|
|
24
|
-
import { MOBILE_MEDIUM_DEVISE as
|
|
25
|
-
import { AdaptiveMode as
|
|
26
|
-
import { ActionSheetContent as
|
|
11
|
+
import { Popup as U } from "@progress/kendo-react-popup";
|
|
12
|
+
import { cloneDate as y } from "@progress/kendo-date-math";
|
|
13
|
+
import { classNames as c, uTimePicker as g, Keys as d, validatePackage as K, canUseDOM as I, AsyncFocusBlur as H, createPropsContext as j, withIdHOC as W, withPropsContext as G, withUnstyledHOC as X } from "@progress/kendo-react-common";
|
|
14
|
+
import { clockIcon as Z } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { provideLocalizationService as J, registerForLocalization as Q } from "@progress/kendo-react-intl";
|
|
16
|
+
import { packageMetadata as Y } from "../package-metadata.mjs";
|
|
17
|
+
import { toggleClock as f, messages as u, timePickerCancel as $, timePickerSet as T, toggleTimeSelector as C } from "../messages/index.mjs";
|
|
18
|
+
import { DateInput as ee } from "../dateinput/DateInput.mjs";
|
|
19
|
+
import { TimeSelector as te } from "./TimeSelector.mjs";
|
|
20
|
+
import { MAX_TIME as ie, MIN_TIME as se, setTime as M, MIDNIGHT_DATE as oe } from "../utils.mjs";
|
|
21
|
+
import { isInRange as ne, isBiggerThanMax as ae, isSmallerThanMin as re } from "./utils.mjs";
|
|
22
|
+
import { PickerFloatingLabel as le } from "../hooks/usePickerFloatingLabel.mjs";
|
|
23
|
+
import { Button as he } from "@progress/kendo-react-buttons";
|
|
24
|
+
import { MOBILE_MEDIUM_DEVISE as de } from "../common/constants.mjs";
|
|
25
|
+
import { AdaptiveMode as ue } from "../common/AdaptiveMode.mjs";
|
|
26
|
+
import { ActionSheetContent as pe } from "@progress/kendo-react-layout";
|
|
27
27
|
const n = class n extends a.Component {
|
|
28
28
|
constructor(i) {
|
|
29
29
|
super(i), this._element = null, this._dateInput = a.createRef(), this._timeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
|
|
30
30
|
this.dateInput && this.dateInput.focus();
|
|
31
31
|
}, this.renderTimeSelector = () => {
|
|
32
|
-
const { smoothScroll: t, cancelButton: s, nowButton: o, disabled:
|
|
32
|
+
const { smoothScroll: t, cancelButton: s, nowButton: o, disabled: l, format: h, steps: r, unstyled: m } = this.props;
|
|
33
33
|
return /* @__PURE__ */ a.createElement(
|
|
34
|
-
|
|
34
|
+
te,
|
|
35
35
|
{
|
|
36
36
|
ref: this.setTimeSelectorRef,
|
|
37
|
-
className: this.mobileMode ? "k-reset k-timeselector-lg" : "",
|
|
38
37
|
mobileMode: this.mobileMode,
|
|
39
38
|
show: this.show,
|
|
40
39
|
cancelButton: s,
|
|
41
|
-
disabled:
|
|
40
|
+
disabled: l,
|
|
42
41
|
nowButton: o,
|
|
43
42
|
format: h,
|
|
44
43
|
min: this.min,
|
|
45
44
|
max: this.max,
|
|
46
|
-
steps:
|
|
45
|
+
steps: r,
|
|
47
46
|
smoothScroll: t,
|
|
48
47
|
value: this.value,
|
|
49
48
|
footer: !this.mobileMode,
|
|
50
49
|
handleTimeChange: this.mobileMode && this.handleTimeChange,
|
|
51
50
|
onChange: this.handleValueChange,
|
|
52
|
-
onReject: this.handleValueReject
|
|
51
|
+
onReject: this.handleValueReject,
|
|
52
|
+
unstyled: m
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}, this.renderPopup = () => {
|
|
56
|
-
const { popupClass: t, ...s } = this.popupSettings, o =
|
|
56
|
+
const { popupClass: t, ...s } = this.popupSettings, { unstyled: o } = this.props, l = o && o.uTimePicker, h = c(
|
|
57
57
|
t
|
|
58
58
|
), r = {
|
|
59
|
-
popupClass:
|
|
59
|
+
popupClass: g.popup({ c: l }),
|
|
60
60
|
show: this.show,
|
|
61
61
|
animate: this.element !== null,
|
|
62
62
|
anchor: this.element,
|
|
63
|
-
className:
|
|
63
|
+
className: h,
|
|
64
64
|
id: this._popupId,
|
|
65
65
|
anchorAlign: {
|
|
66
66
|
horizontal: "left",
|
|
@@ -72,7 +72,7 @@ const n = class n extends a.Component {
|
|
|
72
72
|
},
|
|
73
73
|
...s
|
|
74
74
|
};
|
|
75
|
-
return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...r }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(
|
|
75
|
+
return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...r }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(U, { ...r }, this.renderTimeSelector());
|
|
76
76
|
}, this.renderAdaptivePopup = () => {
|
|
77
77
|
const { windowWidth: t = 0 } = this.state, s = {
|
|
78
78
|
expand: this.show,
|
|
@@ -80,13 +80,13 @@ const n = class n extends a.Component {
|
|
|
80
80
|
adaptiveTitle: this.props.adaptiveTitle,
|
|
81
81
|
windowWidth: t,
|
|
82
82
|
footer: {
|
|
83
|
-
cancelText: this.localizationService.toLanguageString(
|
|
83
|
+
cancelText: this.localizationService.toLanguageString(f, u[$]),
|
|
84
84
|
onCancel: this.handleValueReject,
|
|
85
|
-
applyText: this.localizationService.toLanguageString(
|
|
85
|
+
applyText: this.localizationService.toLanguageString(T, u[T]),
|
|
86
86
|
onApply: (o) => this.handleValueChange(o)
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
return /* @__PURE__ */ a.createElement(
|
|
89
|
+
return /* @__PURE__ */ a.createElement(ue, { ...s }, /* @__PURE__ */ a.createElement(pe, { overflowHidden: !0 }, this.renderTimeSelector()));
|
|
90
90
|
}, this.setTimeSelectorRef = (t) => {
|
|
91
91
|
this._timeSelector = t;
|
|
92
92
|
}, 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.handleInputValueChange = (t) => {
|
|
@@ -96,7 +96,7 @@ const n = class n extends a.Component {
|
|
|
96
96
|
this.setState({ candidate: t.time });
|
|
97
97
|
}, this.handleValueChange = (t) => {
|
|
98
98
|
this.setState({
|
|
99
|
-
value:
|
|
99
|
+
value: y(t.value || this.state.candidate)
|
|
100
100
|
}), this.valueDuringOnChange = t.value, this.showDuringOnChange = !1, this.shouldFocusDateInput = !0;
|
|
101
101
|
const { onChange: s } = this.props, o = this.state.candidate || this.value;
|
|
102
102
|
s && s.call(void 0, {
|
|
@@ -123,7 +123,7 @@ const n = class n extends a.Component {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
s && (o === d.up || o === d.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = o === d.up, this.setShow(o === d.down));
|
|
126
|
-
},
|
|
126
|
+
}, K(Y), this.state = {
|
|
127
127
|
value: this.props.defaultValue || n.defaultProps.defaultValue,
|
|
128
128
|
show: this.props.defaultShow || n.defaultProps.defaultShow,
|
|
129
129
|
focused: !1,
|
|
@@ -134,7 +134,7 @@ const n = class n extends a.Component {
|
|
|
134
134
|
return this.props.id + "-popup-id";
|
|
135
135
|
}
|
|
136
136
|
get document() {
|
|
137
|
-
if (
|
|
137
|
+
if (I)
|
|
138
138
|
return this.element && this.element.ownerDocument || document;
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
@@ -160,7 +160,7 @@ const n = class n extends a.Component {
|
|
|
160
160
|
*/
|
|
161
161
|
get value() {
|
|
162
162
|
const i = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
|
|
163
|
-
return i !== null ?
|
|
163
|
+
return i !== null ? y(i) : null;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Gets the popup state of the TimeSelector.
|
|
@@ -178,12 +178,12 @@ const n = class n extends a.Component {
|
|
|
178
178
|
* Represents the validity state into which the TimePicker is set.
|
|
179
179
|
*/
|
|
180
180
|
get validity() {
|
|
181
|
-
const i = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), s = this.normalizeTime(this.max), o =
|
|
181
|
+
const i = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), s = this.normalizeTime(this.max), o = ne(i, t, s), l = this.props.validationMessage !== void 0, h = (!this.required || this.value !== null) && o, r = this.props.valid !== void 0 ? this.props.valid : h;
|
|
182
182
|
return {
|
|
183
|
-
customError:
|
|
184
|
-
rangeOverflow:
|
|
185
|
-
rangeUnderflow:
|
|
186
|
-
valid:
|
|
183
|
+
customError: l,
|
|
184
|
+
rangeOverflow: ae(i, s),
|
|
185
|
+
rangeUnderflow: re(i, t),
|
|
186
|
+
valid: r,
|
|
187
187
|
valueMissing: this.value === null
|
|
188
188
|
};
|
|
189
189
|
}
|
|
@@ -191,7 +191,7 @@ const n = class n extends a.Component {
|
|
|
191
191
|
* The mobile mode of the ComboBox.
|
|
192
192
|
*/
|
|
193
193
|
get mobileMode() {
|
|
194
|
-
return !!(this.state.windowWidth && this.state.windowWidth <=
|
|
194
|
+
return !!(this.state.windowWidth && this.state.windowWidth <= de && this.props.adaptive);
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
197
|
* @hidden
|
|
@@ -218,14 +218,14 @@ const n = class n extends a.Component {
|
|
|
218
218
|
return this.props.dateInput || n.defaultProps.dateInput;
|
|
219
219
|
}
|
|
220
220
|
get localizationService() {
|
|
221
|
-
return
|
|
221
|
+
return J(this);
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
224
|
* @hidden
|
|
225
225
|
*/
|
|
226
226
|
componentDidMount() {
|
|
227
227
|
var i;
|
|
228
|
-
this.observerResize =
|
|
228
|
+
this.observerResize = I && 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);
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* @hidden
|
|
@@ -249,38 +249,39 @@ const n = class n extends a.Component {
|
|
|
249
249
|
rounded: t = n.defaultProps.rounded,
|
|
250
250
|
fillMode: s = n.defaultProps.fillMode,
|
|
251
251
|
disabled: o,
|
|
252
|
-
tabIndex:
|
|
252
|
+
tabIndex: l,
|
|
253
253
|
title: h,
|
|
254
|
-
id:
|
|
255
|
-
className:
|
|
256
|
-
format:
|
|
257
|
-
formatPlaceholder:
|
|
258
|
-
width:
|
|
259
|
-
name:
|
|
260
|
-
steps:
|
|
261
|
-
validationMessage:
|
|
262
|
-
required:
|
|
263
|
-
validityStyles:
|
|
264
|
-
ariaLabelledBy:
|
|
265
|
-
ariaDescribedBy:
|
|
266
|
-
|
|
254
|
+
id: r,
|
|
255
|
+
className: m,
|
|
256
|
+
format: D,
|
|
257
|
+
formatPlaceholder: O,
|
|
258
|
+
width: P,
|
|
259
|
+
name: z,
|
|
260
|
+
steps: x,
|
|
261
|
+
validationMessage: E,
|
|
262
|
+
required: k,
|
|
263
|
+
validityStyles: B,
|
|
264
|
+
ariaLabelledBy: R,
|
|
265
|
+
ariaDescribedBy: V,
|
|
266
|
+
unstyled: v
|
|
267
|
+
} = this.props, w = v && v.uTimePicker, S = !this.validityStyles || this.validity.valid, F = {
|
|
267
268
|
disabled: o,
|
|
268
|
-
format:
|
|
269
|
-
formatPlaceholder:
|
|
270
|
-
id:
|
|
271
|
-
ariaLabelledBy:
|
|
272
|
-
ariaDescribedBy:
|
|
269
|
+
format: D,
|
|
270
|
+
formatPlaceholder: O,
|
|
271
|
+
id: r,
|
|
272
|
+
ariaLabelledBy: R,
|
|
273
|
+
ariaDescribedBy: V,
|
|
273
274
|
max: this.normalizeTime(this.max),
|
|
274
275
|
min: this.normalizeTime(this.min),
|
|
275
|
-
name:
|
|
276
|
+
name: z,
|
|
276
277
|
onChange: this.handleInputValueChange,
|
|
277
|
-
required:
|
|
278
|
-
steps:
|
|
279
|
-
tabIndex: this.show ? -1 :
|
|
278
|
+
required: k,
|
|
279
|
+
steps: x,
|
|
280
|
+
tabIndex: this.show ? -1 : l,
|
|
280
281
|
title: h,
|
|
281
282
|
valid: this.validity.valid,
|
|
282
|
-
validationMessage:
|
|
283
|
-
validityStyles:
|
|
283
|
+
validationMessage: E,
|
|
284
|
+
validityStyles: B,
|
|
284
285
|
value: this.value && this.normalizeTime(this.value),
|
|
285
286
|
label: void 0,
|
|
286
287
|
placeholder: this.state.focused ? null : this.props.placeholder,
|
|
@@ -290,38 +291,37 @@ const n = class n extends a.Component {
|
|
|
290
291
|
fillMode: null,
|
|
291
292
|
rounded: null,
|
|
292
293
|
readonly: this.mobileMode
|
|
293
|
-
},
|
|
294
|
-
|
|
294
|
+
}, A = this.localizationService.toLanguageString(f, u[f]), N = this.localizationService.toLanguageString(C, u[C]), b = /* @__PURE__ */ a.createElement(
|
|
295
|
+
H,
|
|
295
296
|
{
|
|
296
297
|
onFocus: this.handleFocus,
|
|
297
298
|
onBlur: this.mobileMode ? void 0 : this.handleBlur,
|
|
298
299
|
onSyncBlur: this.props.onBlur,
|
|
299
300
|
onSyncFocus: this.props.onFocus
|
|
300
301
|
},
|
|
301
|
-
({ onFocus:
|
|
302
|
+
({ onFocus: L, onBlur: q }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
|
|
302
303
|
"span",
|
|
303
304
|
{
|
|
304
305
|
id: this.props.id,
|
|
305
|
-
ref: (
|
|
306
|
-
this._element =
|
|
306
|
+
ref: (_) => {
|
|
307
|
+
this._element = _;
|
|
307
308
|
},
|
|
308
|
-
className:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
M
|
|
309
|
+
className: c(
|
|
310
|
+
g.wrapper({
|
|
311
|
+
c: w,
|
|
312
|
+
size: i,
|
|
313
|
+
rounded: t,
|
|
314
|
+
fillMode: s,
|
|
315
|
+
invalid: !S,
|
|
316
|
+
required: this.required,
|
|
317
|
+
disabled: o
|
|
318
|
+
}),
|
|
319
|
+
m
|
|
320
320
|
),
|
|
321
321
|
onKeyDown: this.handleKeyDown,
|
|
322
|
-
style: { width:
|
|
323
|
-
onFocus:
|
|
324
|
-
onBlur:
|
|
322
|
+
style: { width: P },
|
|
323
|
+
onFocus: L,
|
|
324
|
+
onBlur: q,
|
|
325
325
|
onClick: this.mobileMode ? this.handleIconClick : void 0
|
|
326
326
|
},
|
|
327
327
|
/* @__PURE__ */ a.createElement(
|
|
@@ -330,43 +330,43 @@ const n = class n extends a.Component {
|
|
|
330
330
|
_ref: this._dateInput,
|
|
331
331
|
ariaRole: "combobox",
|
|
332
332
|
ariaControls: this._popupId,
|
|
333
|
-
...
|
|
333
|
+
...F
|
|
334
334
|
}
|
|
335
335
|
),
|
|
336
336
|
/* @__PURE__ */ a.createElement(
|
|
337
|
-
|
|
337
|
+
he,
|
|
338
338
|
{
|
|
339
339
|
tabIndex: -1,
|
|
340
340
|
type: "button",
|
|
341
341
|
icon: "clock",
|
|
342
|
-
svgIcon:
|
|
342
|
+
svgIcon: Z,
|
|
343
343
|
onMouseDown: this.handleIconMouseDown,
|
|
344
344
|
onClick: this.mobileMode ? void 0 : this.handleIconClick,
|
|
345
|
-
title:
|
|
346
|
-
className:
|
|
345
|
+
title: N,
|
|
346
|
+
className: c(g.inputButton({ c: w })),
|
|
347
347
|
rounded: null,
|
|
348
348
|
fillMode: s,
|
|
349
|
-
"aria-label":
|
|
349
|
+
"aria-label": A
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
352
|
!this.mobileMode && this.renderPopup()
|
|
353
353
|
), this.mobileMode && this.renderAdaptivePopup())
|
|
354
354
|
);
|
|
355
355
|
return this.props.label ? /* @__PURE__ */ a.createElement(
|
|
356
|
-
|
|
356
|
+
le,
|
|
357
357
|
{
|
|
358
358
|
dateInput: this._dateInput,
|
|
359
359
|
label: this.props.label,
|
|
360
|
-
editorId:
|
|
361
|
-
editorValid:
|
|
360
|
+
editorId: r,
|
|
361
|
+
editorValid: S,
|
|
362
362
|
editorDisabled: this.props.disabled,
|
|
363
|
-
children:
|
|
363
|
+
children: b,
|
|
364
364
|
style: { width: this.props.width }
|
|
365
365
|
}
|
|
366
|
-
) :
|
|
366
|
+
) : b;
|
|
367
367
|
}
|
|
368
368
|
normalizeTime(i) {
|
|
369
|
-
return
|
|
369
|
+
return M(oe, i);
|
|
370
370
|
}
|
|
371
371
|
setShow(i) {
|
|
372
372
|
const { onOpen: t, onClose: s } = this.props;
|
|
@@ -377,7 +377,7 @@ const n = class n extends a.Component {
|
|
|
377
377
|
}));
|
|
378
378
|
}
|
|
379
379
|
mergeTime(i) {
|
|
380
|
-
return this.value && i ?
|
|
380
|
+
return this.value && i ? M(this.value, i) : i;
|
|
381
381
|
}
|
|
382
382
|
calculateMedia(i) {
|
|
383
383
|
for (let t of i)
|
|
@@ -456,24 +456,29 @@ n.displayName = "TimePicker", n.propTypes = {
|
|
|
456
456
|
defaultValue: null,
|
|
457
457
|
disabled: !1,
|
|
458
458
|
format: "t",
|
|
459
|
-
max:
|
|
460
|
-
min:
|
|
459
|
+
max: ie,
|
|
460
|
+
min: se,
|
|
461
461
|
popupSettings: {},
|
|
462
462
|
tabIndex: 0,
|
|
463
463
|
steps: {},
|
|
464
464
|
required: !1,
|
|
465
465
|
validityStyles: !0,
|
|
466
|
-
dateInput:
|
|
466
|
+
dateInput: ee,
|
|
467
467
|
size: "medium",
|
|
468
468
|
rounded: "medium",
|
|
469
469
|
fillMode: "solid"
|
|
470
470
|
};
|
|
471
471
|
let p = n;
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
472
|
+
const me = j(), ce = W(
|
|
473
|
+
G(
|
|
474
|
+
me,
|
|
475
|
+
X(p)
|
|
476
|
+
)
|
|
477
|
+
);
|
|
478
|
+
ce.displayName = "KendoReactTimePicker";
|
|
479
|
+
Q(p);
|
|
475
480
|
export {
|
|
476
|
-
|
|
477
|
-
|
|
481
|
+
ce as TimePicker,
|
|
482
|
+
me as TimePickerPropsContext,
|
|
478
483
|
p as TimePickerWithoutContext
|
|
479
484
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),e=require("prop-types"),g=require("@progress/kendo-date-math"),s=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),y=require("../utils.js"),m=require("./utils.js"),K=require("./TimePart.js"),O=require("@progress/kendo-react-buttons");function x(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return i.default=u,Object.freeze(i)}const l=x(I),c=class c extends l.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:n}=t;switch(n){case s.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:n,shiftKey:o}=t;!o&&n===s.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var p;const{keyCode:n,shiftKey:o}=t;o&&n===s.Keys.tab?(t.preventDefault(),this._acceptButton&&((p=this._acceptButton.element)==null||p.focus({preventScroll:!0}))):n===s.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),this.timePart?this.timePart.value:this.current);this.setState({value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:n}=this.props;n&&n.call(void 0,t)},this.handleNowClick=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),m.getNow());this.setState({current:n,value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:n}=this.props;n&&n.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||c.defaultProps.format),this.mergeValue=m.valueMerger(m.generateGetters(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||y.MIDNIGHT_DATE,value:this.props.value||c.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?g.cloneDate(i):null}get intl(){return f.provideIntlService(this)}get current(){return this.state.current!==null?g.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:n,tabIndex:o,className:p,smoothScroll:P,min:B,max:k,boundRange:N,nowButton:T,steps:S,show:_,mobileMode:C,unstyled:h}=this.props,E=h&&h.uTimePicker,v=h&&h.uTime,D=f.provideLocalizationService(this),b=D.toLanguageString(r.timePickerCancel,r.messages[r.timePickerCancel]),w=D.toLanguageString(r.timePickerSet,r.messages[r.timePickerSet]);return l.createElement("div",{ref:a=>{this._element=a},tabIndex:n?void 0:o||0,className:s.classNames(s.uTimePicker.timeSelector({c:E,mobileMode:C,disabled:n}),p),onKeyDown:this.handleKeyDown},l.createElement(K.TimePart,{ref:a=>{this.timePart=a},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:P,min:B,max:k,boundRange:N,disabled:n,nowButton:T,steps:S,show:_,mobileMode:C,onNowKeyDown:this.handleNowKeyDown,unstyled:h}),this.props.footer&&l.createElement("div",{className:s.classNames(s.uTime.footer({c:v}))},t&&l.createElement(O.Button,{type:"button",ref:a=>{this._cancelButton=a},className:s.classNames(s.uTime.cancel({c:v})),onClick:this.handleReject,title:b,"aria-label":b},b),l.createElement(O.Button,{type:"button",ref:a=>{this._acceptButton=a},className:s.classNames(s.uTime.accept({c:v})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:w,"aria-label":w},w)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=s.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};c.propTypes={cancelButton:e.bool,className:e.string,disabled:e.bool,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"])})]),max:e.instanceOf(Date),min:e.instanceOf(Date),nowButton:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,value:e.instanceOf(Date),show:e.bool},c.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:y.MIN_TIME,max:y.MAX_TIME,boundRange:!1,footer:!0};let d=c;f.registerForIntl(d);f.registerForLocalization(d);exports.TimeSelector=d;
|