@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,26 +5,26 @@
|
|
|
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 a from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { Popup as
|
|
10
|
+
import { Popup as J } from "@progress/kendo-react-popup";
|
|
11
11
|
import { cloneDate as y } from "@progress/kendo-date-math";
|
|
12
|
-
import { createPropsContext as
|
|
13
|
-
import { clockIcon as
|
|
14
|
-
import { provideLocalizationService as
|
|
12
|
+
import { createPropsContext as Q, classNames as c, uTimePicker as g, Keys as d, validatePackage as Y, getLicenseMessage as $, canUseDOM as T, subscribeToKendoPaste as ee, AsyncFocusBlur as te, WatermarkOverlay as ie, withIdHOC as se, withPropsContext as oe, withUnstyledHOC as ae, withAdaptiveModeContext as ne } from "@progress/kendo-react-common";
|
|
13
|
+
import { clockIcon as re } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { provideLocalizationService as le, registerForLocalization as he } from "@progress/kendo-react-intl";
|
|
15
15
|
import { packageMetadata as C } from "../package-metadata.mjs";
|
|
16
|
-
import { timePickerSet as I, messages as u, toggleClock as f, timePickerCancel as
|
|
17
|
-
import { DateInputInner as
|
|
18
|
-
import { TimeSelector as
|
|
19
|
-
import { MIN_TIME as
|
|
20
|
-
import { isInRange as
|
|
21
|
-
import { PickerFloatingLabel as
|
|
22
|
-
import { Button as
|
|
23
|
-
import { AdaptiveMode as
|
|
24
|
-
import { ActionSheetContent as
|
|
25
|
-
const
|
|
16
|
+
import { timePickerSet as I, messages as u, toggleClock as f, timePickerCancel as de, toggleTimeSelector as M } from "../messages/index.mjs";
|
|
17
|
+
import { DateInputInner as ue } from "../dateinput/DateInput.mjs";
|
|
18
|
+
import { TimeSelector as pe } from "./TimeSelector.mjs";
|
|
19
|
+
import { MIN_TIME as me, MAX_TIME as ce, setTime as P, MIDNIGHT_DATE as ge } from "../utils.mjs";
|
|
20
|
+
import { isInRange as D, isSmallerThanMin as fe, isBiggerThanMax as ve } from "./utils.mjs";
|
|
21
|
+
import { PickerFloatingLabel as be } from "../hooks/usePickerFloatingLabel.mjs";
|
|
22
|
+
import { Button as we } from "@progress/kendo-react-buttons";
|
|
23
|
+
import { AdaptiveMode as Se } from "../common/AdaptiveMode.mjs";
|
|
24
|
+
import { ActionSheetContent as ye } from "@progress/kendo-react-layout";
|
|
25
|
+
const n = class n extends a.Component {
|
|
26
26
|
constructor(s) {
|
|
27
|
-
super(s), this._element = null, this._dateInput =
|
|
27
|
+
super(s), this._element = null, this._dateInput = a.createRef(), this._timeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.showLicenseWatermark = !1, this.handleKendoPasteValue = (t) => {
|
|
28
28
|
if (t instanceof Date && !isNaN(t.getTime())) {
|
|
29
29
|
this.applyKendoPasteTime(t);
|
|
30
30
|
return;
|
|
@@ -36,7 +36,7 @@ const a = class a extends n.Component {
|
|
|
36
36
|
isNaN(o.getTime()) || this.applyKendoPasteTime(o);
|
|
37
37
|
}, this.applyKendoPasteTime = (t) => {
|
|
38
38
|
const i = this.normalizeTime(t);
|
|
39
|
-
if (!
|
|
39
|
+
if (!D(i, this.min, this.max))
|
|
40
40
|
return;
|
|
41
41
|
const o = new Event("change", { bubbles: !0 }), r = {
|
|
42
42
|
target: this._element,
|
|
@@ -51,9 +51,9 @@ const a = class a extends n.Component {
|
|
|
51
51
|
}, this.focus = () => {
|
|
52
52
|
this.dateInput && this.dateInput.focus();
|
|
53
53
|
}, this.renderTimeSelector = () => {
|
|
54
|
-
const { smoothScroll: t, cancelButton: i, nowButton: o, disabled: r, format: h, steps: l, unstyled:
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
|
|
54
|
+
const { smoothScroll: t, cancelButton: i, nowButton: o, disabled: r, format: h, steps: l, unstyled: m } = this.props;
|
|
55
|
+
return /* @__PURE__ */ a.createElement(
|
|
56
|
+
pe,
|
|
57
57
|
{
|
|
58
58
|
ref: this.setTimeSelectorRef,
|
|
59
59
|
mobileMode: this.mobileMode,
|
|
@@ -71,14 +71,14 @@ const a = class a extends n.Component {
|
|
|
71
71
|
handleTimeChange: this.mobileMode && this.handleTimeChange,
|
|
72
72
|
onChange: this.handleValueChange,
|
|
73
73
|
onReject: this.handleValueReject,
|
|
74
|
-
unstyled:
|
|
74
|
+
unstyled: m
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
77
|
}, this.renderPopup = () => {
|
|
78
|
-
const { popupClass: t, ...i } = this.popupSettings, { unstyled: o } = this.props, r = o && o.uTimePicker, h =
|
|
78
|
+
const { popupClass: t, ...i } = this.popupSettings, { unstyled: o } = this.props, r = o && o.uTimePicker, h = c(t), l = {
|
|
79
79
|
popupClass: g.popup({ c: r }),
|
|
80
80
|
show: this.show,
|
|
81
|
-
animate: this.element !== null,
|
|
81
|
+
animate: this.props.animation === !1 ? !1 : this.element !== null,
|
|
82
82
|
anchor: this.element,
|
|
83
83
|
className: h,
|
|
84
84
|
id: this._popupId,
|
|
@@ -92,22 +92,24 @@ const a = class a extends n.Component {
|
|
|
92
92
|
},
|
|
93
93
|
...i
|
|
94
94
|
};
|
|
95
|
-
return this.props.popup ? /* @__PURE__ */
|
|
95
|
+
return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...l }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(J, { ...l }, this.renderTimeSelector());
|
|
96
96
|
}, this.renderAdaptivePopup = () => {
|
|
97
97
|
const { windowWidth: t = 0 } = this.state, i = {
|
|
98
|
+
id: this._popupId,
|
|
98
99
|
expand: this.show,
|
|
99
100
|
onClose: this.handleBlur,
|
|
100
101
|
title: this.props.adaptiveTitle || this.props.label,
|
|
101
102
|
subTitle: this.props.adaptiveSubtitle,
|
|
103
|
+
animation: this.props.animation,
|
|
102
104
|
windowWidth: t,
|
|
103
105
|
footer: {
|
|
104
|
-
cancelText: this.localizationService.toLanguageString(f, u[
|
|
106
|
+
cancelText: this.localizationService.toLanguageString(f, u[de]),
|
|
105
107
|
onCancel: this.handleValueReject,
|
|
106
108
|
applyText: this.localizationService.toLanguageString(I, u[I]),
|
|
107
109
|
onApply: (o) => this.handleValueChange(o)
|
|
108
110
|
}
|
|
109
111
|
};
|
|
110
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ a.createElement(Se, { ...i }, /* @__PURE__ */ a.createElement(ye, null, this.renderTimeSelector()));
|
|
111
113
|
}, this.setTimeSelectorRef = (t) => {
|
|
112
114
|
this._timeSelector = t;
|
|
113
115
|
}, this.nextValue = (t, i) => t.value !== void 0 ? t.value : i.value, this.nextShow = (t, i) => t.show !== void 0 ? t.show : i.show, this.handleInputValueChange = (t) => {
|
|
@@ -144,9 +146,9 @@ const a = class a extends n.Component {
|
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
i && (o === d.up || o === d.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = o === d.up, this.setShow(o === d.down));
|
|
147
|
-
}, this.showLicenseWatermark = !
|
|
148
|
-
value: this.props.defaultValue ||
|
|
149
|
-
show: this.props.defaultShow ||
|
|
149
|
+
}, this.showLicenseWatermark = !Y(C, { component: "TimePicker" }), this.licenseMessage = $(C), this.state = {
|
|
150
|
+
value: this.props.defaultValue || n.defaultProps.defaultValue,
|
|
151
|
+
show: this.props.defaultShow || n.defaultProps.defaultShow,
|
|
150
152
|
focused: !1,
|
|
151
153
|
candidate: null
|
|
152
154
|
}, this.normalizeTime = this.normalizeTime.bind(this), this.setShow = this.setShow.bind(this), this.mergeTime = this.mergeTime.bind(this);
|
|
@@ -199,11 +201,11 @@ const a = class a extends n.Component {
|
|
|
199
201
|
* Represents the validity state into which the TimePicker is set.
|
|
200
202
|
*/
|
|
201
203
|
get validity() {
|
|
202
|
-
const s = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), i = this.normalizeTime(this.max), o =
|
|
204
|
+
const s = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), i = this.normalizeTime(this.max), o = D(s, t, i), r = this.props.validationMessage !== void 0, h = (!this.required || this.value !== null) && o, l = this.props.valid !== void 0 ? this.props.valid : h;
|
|
203
205
|
return {
|
|
204
206
|
customError: r,
|
|
205
|
-
rangeOverflow:
|
|
206
|
-
rangeUnderflow:
|
|
207
|
+
rangeOverflow: ve(s, i),
|
|
208
|
+
rangeUnderflow: fe(s, t),
|
|
207
209
|
valid: l,
|
|
208
210
|
valueMissing: this.value === null
|
|
209
211
|
};
|
|
@@ -219,7 +221,7 @@ const a = class a extends n.Component {
|
|
|
219
221
|
* @hidden
|
|
220
222
|
*/
|
|
221
223
|
get validityStyles() {
|
|
222
|
-
return this.props.validityStyles !== void 0 ? this.props.validityStyles :
|
|
224
|
+
return this.props.validityStyles !== void 0 ? this.props.validityStyles : n.defaultProps.validityStyles;
|
|
223
225
|
}
|
|
224
226
|
/**
|
|
225
227
|
* @hidden
|
|
@@ -228,19 +230,19 @@ const a = class a extends n.Component {
|
|
|
228
230
|
return this.props.required !== void 0 ? this.props.required : !1;
|
|
229
231
|
}
|
|
230
232
|
get popupSettings() {
|
|
231
|
-
return this.props.popupSettings ||
|
|
233
|
+
return this.props.popupSettings || n.defaultProps.popupSettings;
|
|
232
234
|
}
|
|
233
235
|
get min() {
|
|
234
|
-
return this.props.min !== void 0 ? this.props.min :
|
|
236
|
+
return this.props.min !== void 0 ? this.props.min : n.defaultProps.min;
|
|
235
237
|
}
|
|
236
238
|
get max() {
|
|
237
|
-
return this.props.max !== void 0 ? this.props.max :
|
|
239
|
+
return this.props.max !== void 0 ? this.props.max : n.defaultProps.max;
|
|
238
240
|
}
|
|
239
241
|
get dateInputComp() {
|
|
240
|
-
return this.props.dateInput ||
|
|
242
|
+
return this.props.dateInput || n.defaultProps.dateInput;
|
|
241
243
|
}
|
|
242
244
|
get localizationService() {
|
|
243
|
-
return
|
|
245
|
+
return le(this);
|
|
244
246
|
}
|
|
245
247
|
/**
|
|
246
248
|
* @hidden
|
|
@@ -249,7 +251,7 @@ const a = class a extends n.Component {
|
|
|
249
251
|
var t;
|
|
250
252
|
this.observerResize = T && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.show && this.forceUpdate(), (t = this.document) != null && t.body && this.observerResize && this.observerResize.observe(this.document.body);
|
|
251
253
|
const s = this.props.name || this.props.id;
|
|
252
|
-
this.KendoPasteSubscription =
|
|
254
|
+
this.KendoPasteSubscription = ee(this._element, {
|
|
253
255
|
fieldName: s,
|
|
254
256
|
onValueChange: (i) => {
|
|
255
257
|
this.handleKendoPasteValue(i);
|
|
@@ -276,131 +278,132 @@ const a = class a extends n.Component {
|
|
|
276
278
|
*/
|
|
277
279
|
render() {
|
|
278
280
|
const {
|
|
279
|
-
size: s =
|
|
280
|
-
rounded: t =
|
|
281
|
-
fillMode: i =
|
|
281
|
+
size: s = n.defaultProps.size,
|
|
282
|
+
rounded: t = n.defaultProps.rounded,
|
|
283
|
+
fillMode: i = n.defaultProps.fillMode,
|
|
282
284
|
disabled: o,
|
|
283
285
|
tabIndex: r,
|
|
284
286
|
title: h,
|
|
285
287
|
id: l,
|
|
286
|
-
className:
|
|
287
|
-
format:
|
|
288
|
-
formatPlaceholder:
|
|
289
|
-
width:
|
|
290
|
-
name:
|
|
291
|
-
steps:
|
|
292
|
-
validationMessage:
|
|
293
|
-
required:
|
|
294
|
-
validityStyles:
|
|
295
|
-
ariaLabelledBy:
|
|
296
|
-
ariaDescribedBy:
|
|
288
|
+
className: m,
|
|
289
|
+
format: O,
|
|
290
|
+
formatPlaceholder: z,
|
|
291
|
+
width: k,
|
|
292
|
+
name: x,
|
|
293
|
+
steps: E,
|
|
294
|
+
validationMessage: R,
|
|
295
|
+
required: V,
|
|
296
|
+
validityStyles: B,
|
|
297
|
+
ariaLabelledBy: F,
|
|
298
|
+
ariaDescribedBy: L,
|
|
297
299
|
unstyled: v,
|
|
298
|
-
enableMouseWheel:
|
|
299
|
-
autoCorrectParts:
|
|
300
|
+
enableMouseWheel: A,
|
|
301
|
+
autoCorrectParts: N,
|
|
300
302
|
autoSwitchParts: _,
|
|
301
|
-
autoSwitchKeys:
|
|
302
|
-
allowCaretMode:
|
|
303
|
-
inputAttributes:
|
|
304
|
-
} = this.props,
|
|
303
|
+
autoSwitchKeys: K,
|
|
304
|
+
allowCaretMode: q,
|
|
305
|
+
inputAttributes: W
|
|
306
|
+
} = this.props, b = v && v.uTimePicker, w = !this.validityStyles || this.validity.valid, U = {
|
|
305
307
|
disabled: o,
|
|
306
|
-
format:
|
|
307
|
-
formatPlaceholder:
|
|
308
|
+
format: O,
|
|
309
|
+
formatPlaceholder: z,
|
|
308
310
|
id: l,
|
|
309
|
-
ariaLabelledBy:
|
|
310
|
-
ariaDescribedBy:
|
|
311
|
-
ariaLabel:
|
|
311
|
+
ariaLabelledBy: F,
|
|
312
|
+
ariaDescribedBy: L,
|
|
313
|
+
ariaLabel: this.props.ariaLabel,
|
|
312
314
|
max: this.normalizeTime(this.max),
|
|
313
315
|
min: this.normalizeTime(this.min),
|
|
314
|
-
name:
|
|
316
|
+
name: x,
|
|
315
317
|
onChange: this.handleInputValueChange,
|
|
316
|
-
required:
|
|
317
|
-
steps:
|
|
318
|
+
required: V,
|
|
319
|
+
steps: E,
|
|
318
320
|
tabIndex: this.show ? -1 : r,
|
|
319
321
|
title: h,
|
|
320
322
|
valid: this.validity.valid,
|
|
321
|
-
validationMessage:
|
|
322
|
-
validityStyles:
|
|
323
|
+
validationMessage: R,
|
|
324
|
+
validityStyles: B,
|
|
323
325
|
value: this.value && this.normalizeTime(this.value),
|
|
324
326
|
label: void 0,
|
|
325
327
|
placeholder: this.state.focused ? null : this.props.placeholder,
|
|
326
328
|
ariaHasPopup: "dialog",
|
|
327
|
-
ariaExpanded: this.show,
|
|
328
|
-
enableMouseWheel:
|
|
329
|
-
autoCorrectParts:
|
|
329
|
+
ariaExpanded: this.mobileMode ? !1 : this.show,
|
|
330
|
+
enableMouseWheel: A,
|
|
331
|
+
autoCorrectParts: N,
|
|
330
332
|
autoSwitchParts: _,
|
|
331
|
-
autoSwitchKeys:
|
|
332
|
-
allowCaretMode:
|
|
333
|
-
inputAttributes:
|
|
334
|
-
},
|
|
335
|
-
|
|
336
|
-
u[
|
|
337
|
-
), S = /* @__PURE__ */
|
|
338
|
-
|
|
333
|
+
autoSwitchKeys: K,
|
|
334
|
+
allowCaretMode: q,
|
|
335
|
+
inputAttributes: W
|
|
336
|
+
}, j = this.localizationService.toLanguageString(f, u[f]), H = this.localizationService.toLanguageString(
|
|
337
|
+
M,
|
|
338
|
+
u[M]
|
|
339
|
+
), S = /* @__PURE__ */ a.createElement(
|
|
340
|
+
te,
|
|
339
341
|
{
|
|
340
342
|
onFocus: this.handleFocus,
|
|
341
343
|
onBlur: this.mobileMode ? void 0 : this.handleBlur,
|
|
342
344
|
onSyncBlur: this.props.onBlur,
|
|
343
345
|
onSyncFocus: this.props.onFocus
|
|
344
346
|
},
|
|
345
|
-
({ onFocus:
|
|
347
|
+
({ onFocus: G, onBlur: X }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
|
|
346
348
|
"span",
|
|
347
349
|
{
|
|
348
|
-
ref: (
|
|
349
|
-
this._element =
|
|
350
|
+
ref: (Z) => {
|
|
351
|
+
this._element = Z;
|
|
350
352
|
},
|
|
351
|
-
className:
|
|
353
|
+
className: c(
|
|
352
354
|
g.wrapper({
|
|
353
|
-
c:
|
|
355
|
+
c: b,
|
|
354
356
|
size: s,
|
|
355
357
|
rounded: t,
|
|
356
358
|
fillMode: i,
|
|
357
|
-
invalid: !
|
|
359
|
+
invalid: !w,
|
|
358
360
|
required: this.required,
|
|
359
361
|
disabled: o
|
|
360
362
|
}),
|
|
361
363
|
{ "k-focus": this.state.focused },
|
|
362
|
-
|
|
364
|
+
m
|
|
363
365
|
),
|
|
364
366
|
onKeyDown: this.handleKeyDown,
|
|
365
|
-
style: { width:
|
|
366
|
-
onFocus: this.mobileMode ? this.handleClick :
|
|
367
|
-
onBlur:
|
|
367
|
+
style: { width: k },
|
|
368
|
+
onFocus: this.mobileMode ? this.handleClick : G,
|
|
369
|
+
onBlur: X,
|
|
368
370
|
onClick: this.mobileMode ? this.handleClick : void 0
|
|
369
371
|
},
|
|
370
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ a.createElement(
|
|
371
373
|
this.dateInputComp,
|
|
372
374
|
{
|
|
373
375
|
_ref: this._dateInput,
|
|
374
376
|
ariaRole: "combobox",
|
|
375
377
|
ariaControls: this.show ? this._popupId : void 0,
|
|
376
|
-
...
|
|
378
|
+
...U
|
|
377
379
|
}
|
|
378
380
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
|
|
381
|
+
/* @__PURE__ */ a.createElement(
|
|
382
|
+
we,
|
|
381
383
|
{
|
|
382
384
|
tabIndex: -1,
|
|
383
385
|
type: "button",
|
|
386
|
+
disabled: o,
|
|
384
387
|
icon: "clock",
|
|
385
|
-
svgIcon:
|
|
388
|
+
svgIcon: re,
|
|
386
389
|
onMouseDown: this.handleIconMouseDown,
|
|
387
390
|
onClick: this.mobileMode ? void 0 : this.handleClick,
|
|
388
|
-
title:
|
|
389
|
-
className:
|
|
391
|
+
title: H,
|
|
392
|
+
className: c(g.inputButton({ c: b })),
|
|
390
393
|
fillMode: i,
|
|
391
|
-
"aria-label":
|
|
394
|
+
"aria-label": j
|
|
392
395
|
}
|
|
393
396
|
),
|
|
394
397
|
!this.mobileMode && this.renderPopup()
|
|
395
|
-
), this.mobileMode && this.renderAdaptivePopup(), this.showLicenseWatermark && /* @__PURE__ */
|
|
398
|
+
), this.mobileMode && this.renderAdaptivePopup(), this.showLicenseWatermark && /* @__PURE__ */ a.createElement(ie, { message: this.licenseMessage }))
|
|
396
399
|
);
|
|
397
|
-
return this.props.label ? /* @__PURE__ */
|
|
398
|
-
|
|
400
|
+
return this.props.label ? /* @__PURE__ */ a.createElement(
|
|
401
|
+
be,
|
|
399
402
|
{
|
|
400
403
|
dateInput: this._dateInput,
|
|
401
404
|
label: this.props.label,
|
|
402
405
|
editorId: l,
|
|
403
|
-
editorValid:
|
|
406
|
+
editorValid: w,
|
|
404
407
|
editorDisabled: this.props.disabled,
|
|
405
408
|
children: S,
|
|
406
409
|
style: { width: this.props.width }
|
|
@@ -408,7 +411,7 @@ const a = class a extends n.Component {
|
|
|
408
411
|
) : S;
|
|
409
412
|
}
|
|
410
413
|
normalizeTime(s) {
|
|
411
|
-
return
|
|
414
|
+
return P(ge, s);
|
|
412
415
|
}
|
|
413
416
|
setShow(s) {
|
|
414
417
|
const { onOpen: t, onClose: i } = this.props;
|
|
@@ -419,14 +422,14 @@ const a = class a extends n.Component {
|
|
|
419
422
|
}));
|
|
420
423
|
}
|
|
421
424
|
mergeTime(s) {
|
|
422
|
-
return this.value && s ?
|
|
425
|
+
return this.value && s ? P(this.value, s) : s;
|
|
423
426
|
}
|
|
424
427
|
calculateMedia(s) {
|
|
425
428
|
for (const t of s)
|
|
426
429
|
this.setState({ windowWidth: t.target.clientWidth });
|
|
427
430
|
}
|
|
428
431
|
};
|
|
429
|
-
|
|
432
|
+
n.displayName = "TimePicker", n.propTypes = {
|
|
430
433
|
className: e.string,
|
|
431
434
|
cancelButton: e.bool,
|
|
432
435
|
nowButton: e.bool,
|
|
@@ -471,6 +474,7 @@ a.displayName = "TimePicker", a.propTypes = {
|
|
|
471
474
|
]),
|
|
472
475
|
id: e.string,
|
|
473
476
|
ariaLabelledBy: e.string,
|
|
477
|
+
ariaLabel: e.string,
|
|
474
478
|
ariaDescribedBy: e.string,
|
|
475
479
|
min: e.instanceOf(Date),
|
|
476
480
|
max: e.instanceOf(Date),
|
|
@@ -500,33 +504,33 @@ a.displayName = "TimePicker", a.propTypes = {
|
|
|
500
504
|
rounded: e.oneOf(["small", "medium", "large", "full", "none"]),
|
|
501
505
|
fillMode: e.oneOf(["solid", "flat", "outline"]),
|
|
502
506
|
inputAttributes: e.object
|
|
503
|
-
},
|
|
507
|
+
}, n.defaultProps = {
|
|
504
508
|
defaultShow: !1,
|
|
505
509
|
defaultValue: null,
|
|
506
510
|
disabled: !1,
|
|
507
511
|
format: "t",
|
|
508
|
-
max:
|
|
509
|
-
min:
|
|
512
|
+
max: ce,
|
|
513
|
+
min: me,
|
|
510
514
|
popupSettings: {},
|
|
511
515
|
tabIndex: 0,
|
|
512
516
|
steps: {},
|
|
513
517
|
validityStyles: !0,
|
|
514
|
-
dateInput:
|
|
518
|
+
dateInput: ue,
|
|
515
519
|
size: void 0,
|
|
516
520
|
rounded: void 0,
|
|
517
521
|
fillMode: void 0
|
|
518
522
|
};
|
|
519
|
-
let p =
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
523
|
+
let p = n;
|
|
524
|
+
const Te = Q(), Ce = se(
|
|
525
|
+
oe(
|
|
526
|
+
Te,
|
|
527
|
+
ae(ne(p))
|
|
524
528
|
)
|
|
525
529
|
);
|
|
526
|
-
|
|
527
|
-
|
|
530
|
+
Ce.displayName = "KendoReactTimePicker";
|
|
531
|
+
he(p);
|
|
528
532
|
export {
|
|
529
|
-
|
|
530
|
-
|
|
533
|
+
Ce as TimePicker,
|
|
534
|
+
Te as TimePickerPropsContext,
|
|
531
535
|
p as TimePickerWithoutContext
|
|
532
536
|
};
|
|
@@ -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 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"),
|
|
8
|
+
"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"),l=require("../messages/index.js"),b=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 a=x(I),c=class c extends a.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||b.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:E,mobileMode:w,unstyled:h}=this.props,_=h&&h.uTimePicker,v=h&&h.uTime,y=f.provideLocalizationService(this),C=y.toLanguageString(l.timePickerCancel,l.messages[l.timePickerCancel]),D=y.toLanguageString(l.timePickerSet,l.messages[l.timePickerSet]);return a.createElement(a.Fragment,null,a.createElement("div",{ref:r=>{this._element=r},tabIndex:n?void 0:o||0,className:s.classNames(s.uTimePicker.timeSelector({c:_,mobileMode:w,disabled:n}),p),role:"group","aria-label":"Time selector",onKeyDown:this.handleKeyDown},a.createElement(K.TimePart,{ref:r=>{this.timePart=r},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:E,mobileMode:w,onNowKeyDown:this.handleNowKeyDown,unstyled:h})),this.props.footer&&a.createElement("div",{className:s.classNames(s.uTime.footer({c:v}))},t&&a.createElement(O.Button,{type:"button",ref:r=>{this._cancelButton=r},className:s.classNames(s.uTime.cancel({c:v})),onClick:this.handleReject,title:C},C),a.createElement(O.Button,{type:"button",ref:r=>{this._acceptButton=r},className:s.classNames(s.uTime.accept({c:v})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:D},D)))}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:b.MIN_TIME,max:b.MAX_TIME,boundRange:!1,footer:!0};let d=c;f.registerForIntl(d);f.registerForLocalization(d);exports.TimeSelector=d;
|