@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
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as n from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { Popup as
|
|
10
|
+
import { Popup as ee } from "@progress/kendo-react-popup";
|
|
11
11
|
import { cloneDate as P } from "@progress/kendo-date-math";
|
|
12
|
-
import { createPropsContext as
|
|
13
|
-
import { calendarIcon as
|
|
14
|
-
import { DateInputInner as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { isInDateRange as M, MIN_DATE as
|
|
17
|
-
import { dateTimePickerCancel as O, messages as
|
|
18
|
-
import { provideLocalizationService as
|
|
19
|
-
import { DateTimeSelector as
|
|
20
|
-
import { isInTimeRange as
|
|
21
|
-
import { PickerFloatingLabel as
|
|
22
|
-
import { AdaptiveMode as
|
|
23
|
-
import { ActionSheetContent as
|
|
12
|
+
import { createPropsContext as te, Keys as d, canUseDOM as C, subscribeToKendoPaste as ie, AsyncFocusBlur as se, classNames as S, uDateTimePicker as I, withIdHOC as oe, withPropsContext as ae, withUnstyledHOC as ne, withAdaptiveModeContext as re } from "@progress/kendo-react-common";
|
|
13
|
+
import { calendarIcon as le } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { DateInputInner as he } from "../dateinput/DateInput.mjs";
|
|
15
|
+
import { Button as de } from "@progress/kendo-react-buttons";
|
|
16
|
+
import { isInDateRange as M, MIN_DATE as ue, MAX_DATE as pe, MAX_TIME as ce, MIN_TIME as me } from "../utils.mjs";
|
|
17
|
+
import { dateTimePickerCancel as O, messages as p, dateTimePickerSet as x, toggleDateTimeSelector as c } from "../messages/index.mjs";
|
|
18
|
+
import { provideLocalizationService as m, registerForLocalization as fe } from "@progress/kendo-react-intl";
|
|
19
|
+
import { DateTimeSelector as ge } from "./DateTimeSelector.mjs";
|
|
20
|
+
import { isInTimeRange as ve } from "../timepicker/utils.mjs";
|
|
21
|
+
import { PickerFloatingLabel as be } from "../hooks/usePickerFloatingLabel.mjs";
|
|
22
|
+
import { AdaptiveMode as we } from "../common/AdaptiveMode.mjs";
|
|
23
|
+
import { ActionSheetContent as ye } from "@progress/kendo-react-layout";
|
|
24
24
|
const a = class a extends n.Component {
|
|
25
25
|
constructor(i) {
|
|
26
26
|
super(i), this._element = null, this._dateInput = n.createRef(), this._dateTimeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.handleSmartPasteValue = (t) => {
|
|
@@ -50,14 +50,14 @@ const a = class a extends n.Component {
|
|
|
50
50
|
const t = this.dateInputElement();
|
|
51
51
|
t && t.focus();
|
|
52
52
|
}, this.renderPicker = () => {
|
|
53
|
-
const { disabled: t, minTime: s, maxTime: o, format: h, calendar:
|
|
53
|
+
const { disabled: t, minTime: s, maxTime: o, format: h, calendar: r, cancelButton: l, weekNumber: g, focusedDate: u, unstyled: v } = this.props;
|
|
54
54
|
return /* @__PURE__ */ n.createElement(
|
|
55
|
-
|
|
55
|
+
ge,
|
|
56
56
|
{
|
|
57
57
|
ref: (b) => {
|
|
58
58
|
this._dateTimeSelector = b;
|
|
59
59
|
},
|
|
60
|
-
cancelButton:
|
|
60
|
+
cancelButton: l,
|
|
61
61
|
steps: this.props.steps,
|
|
62
62
|
value: this.value,
|
|
63
63
|
onChange: this.handleValueChange,
|
|
@@ -68,21 +68,21 @@ const a = class a extends n.Component {
|
|
|
68
68
|
max: this.max,
|
|
69
69
|
minTime: s,
|
|
70
70
|
maxTime: o,
|
|
71
|
-
focusedDate:
|
|
71
|
+
focusedDate: u,
|
|
72
72
|
format: h,
|
|
73
|
-
calendar:
|
|
73
|
+
calendar: r,
|
|
74
74
|
mobileMode: this.mobileMode,
|
|
75
75
|
footerActions: !this.mobileMode,
|
|
76
76
|
unstyled: v
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
79
|
}, this.renderAdaptivePopup = () => {
|
|
80
|
-
const { windowWidth: t = 0 } = this.state, s =
|
|
80
|
+
const { windowWidth: t = 0 } = this.state, s = m(this).toLanguageString(
|
|
81
81
|
O,
|
|
82
|
-
|
|
83
|
-
), o =
|
|
82
|
+
p[O]
|
|
83
|
+
), o = m(this).toLanguageString(
|
|
84
84
|
x,
|
|
85
|
-
|
|
85
|
+
p[x]
|
|
86
86
|
), h = {
|
|
87
87
|
expand: this.show,
|
|
88
88
|
onClose: this.handleBlur,
|
|
@@ -91,18 +91,18 @@ const a = class a extends n.Component {
|
|
|
91
91
|
windowWidth: t,
|
|
92
92
|
footer: {
|
|
93
93
|
cancelText: s,
|
|
94
|
-
onCancel: (
|
|
95
|
-
var
|
|
96
|
-
return (
|
|
94
|
+
onCancel: (r) => {
|
|
95
|
+
var l;
|
|
96
|
+
return (l = this._dateTimeSelector) == null ? void 0 : l.handleReject(r);
|
|
97
97
|
},
|
|
98
98
|
applyText: o,
|
|
99
|
-
onApply: (
|
|
100
|
-
var
|
|
101
|
-
return (
|
|
99
|
+
onApply: (r) => {
|
|
100
|
+
var l;
|
|
101
|
+
return (l = this._dateTimeSelector) == null ? void 0 : l.handleAccept(r);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
return /* @__PURE__ */ n.createElement(
|
|
105
|
+
return /* @__PURE__ */ n.createElement(we, { ...h }, /* @__PURE__ */ n.createElement(ye, null, this.renderPicker()));
|
|
106
106
|
}, this.handleReject = () => {
|
|
107
107
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
108
108
|
}, this.handleValueChange = (t) => {
|
|
@@ -193,7 +193,7 @@ const a = class a extends n.Component {
|
|
|
193
193
|
* Represents the validity state into which the DateTimePicker is set.
|
|
194
194
|
*/
|
|
195
195
|
get validity() {
|
|
196
|
-
const i = M(this.value, this.min, this.max) &&
|
|
196
|
+
const i = M(this.value, this.min, this.max) && ve(this.value, this.props.minTime || me, this.props.maxTime || ce), t = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && i, o = this.props.valid !== void 0 ? this.props.valid : s;
|
|
197
197
|
return {
|
|
198
198
|
customError: t,
|
|
199
199
|
rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
|
|
@@ -227,7 +227,7 @@ const a = class a extends n.Component {
|
|
|
227
227
|
var t;
|
|
228
228
|
this.observerResize = C && 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);
|
|
229
229
|
const i = this.props.name || this.props.id;
|
|
230
|
-
this.KendoPasteSubscription =
|
|
230
|
+
this.KendoPasteSubscription = ie(this._element, {
|
|
231
231
|
fieldName: i,
|
|
232
232
|
onValueChange: (s) => {
|
|
233
233
|
this.handleSmartPasteValue(s);
|
|
@@ -260,54 +260,51 @@ const a = class a extends n.Component {
|
|
|
260
260
|
fillMode: s = a.defaultProps.fillMode,
|
|
261
261
|
autoFocus: o = a.defaultProps.autoFocus,
|
|
262
262
|
inputAttributes: h,
|
|
263
|
-
disabled:
|
|
264
|
-
tabIndex:
|
|
263
|
+
disabled: r,
|
|
264
|
+
tabIndex: l,
|
|
265
265
|
title: g,
|
|
266
|
-
id:
|
|
266
|
+
id: u,
|
|
267
267
|
format: v,
|
|
268
268
|
formatPlaceholder: b,
|
|
269
|
-
min:
|
|
270
|
-
max:
|
|
271
|
-
className:
|
|
272
|
-
width:
|
|
273
|
-
name:
|
|
274
|
-
validationMessage:
|
|
275
|
-
required:
|
|
276
|
-
validityStyles:
|
|
277
|
-
minTime:
|
|
278
|
-
maxTime:
|
|
279
|
-
ariaLabelledBy:
|
|
280
|
-
ariaDescribedBy:
|
|
281
|
-
popup:
|
|
269
|
+
min: k,
|
|
270
|
+
max: E,
|
|
271
|
+
className: F,
|
|
272
|
+
width: A,
|
|
273
|
+
name: N,
|
|
274
|
+
validationMessage: R,
|
|
275
|
+
required: B,
|
|
276
|
+
validityStyles: z,
|
|
277
|
+
minTime: _,
|
|
278
|
+
maxTime: K,
|
|
279
|
+
ariaLabelledBy: L,
|
|
280
|
+
ariaDescribedBy: V,
|
|
281
|
+
popup: q = ee,
|
|
282
282
|
unstyled: w,
|
|
283
|
-
autoFill:
|
|
284
|
-
twoDigitYearMax:
|
|
285
|
-
enableMouseWheel:
|
|
286
|
-
autoCorrectParts:
|
|
287
|
-
autoSwitchParts:
|
|
288
|
-
autoSwitchKeys:
|
|
289
|
-
allowCaretMode:
|
|
290
|
-
} = this.props, y = w && w.uDateTimePicker,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
ariaLabelledBy: V,
|
|
296
|
-
ariaDescribedBy: q,
|
|
297
|
-
ariaLabel: J,
|
|
283
|
+
autoFill: U,
|
|
284
|
+
twoDigitYearMax: j,
|
|
285
|
+
enableMouseWheel: H,
|
|
286
|
+
autoCorrectParts: W,
|
|
287
|
+
autoSwitchParts: X,
|
|
288
|
+
autoSwitchKeys: Y,
|
|
289
|
+
allowCaretMode: Z
|
|
290
|
+
} = this.props, y = w && w.uDateTimePicker, T = !this.validityStyles || this.validity.valid, G = {
|
|
291
|
+
id: u,
|
|
292
|
+
ariaLabelledBy: L,
|
|
293
|
+
ariaDescribedBy: V,
|
|
294
|
+
ariaLabel: this.props.ariaLabel,
|
|
298
295
|
format: v,
|
|
299
296
|
formatPlaceholder: b,
|
|
300
|
-
disabled:
|
|
297
|
+
disabled: r,
|
|
301
298
|
title: g,
|
|
302
|
-
validityStyles:
|
|
303
|
-
validationMessage:
|
|
304
|
-
required:
|
|
305
|
-
min:
|
|
306
|
-
max:
|
|
307
|
-
minTime:
|
|
308
|
-
maxTime:
|
|
309
|
-
name:
|
|
310
|
-
tabIndex: this.show ? -1 :
|
|
299
|
+
validityStyles: z,
|
|
300
|
+
validationMessage: R,
|
|
301
|
+
required: B,
|
|
302
|
+
min: k,
|
|
303
|
+
max: E,
|
|
304
|
+
minTime: _,
|
|
305
|
+
maxTime: K,
|
|
306
|
+
name: N,
|
|
307
|
+
tabIndex: this.show ? -1 : l,
|
|
311
308
|
valid: this.validity.valid,
|
|
312
309
|
value: this.value,
|
|
313
310
|
onChange: this.handleValueChange,
|
|
@@ -316,44 +313,44 @@ const a = class a extends n.Component {
|
|
|
316
313
|
placeholder: this.state.focused ? null : this.props.placeholder,
|
|
317
314
|
ariaExpanded: this.show,
|
|
318
315
|
unstyled: w,
|
|
319
|
-
autoFill:
|
|
320
|
-
twoDigitYearMax:
|
|
321
|
-
enableMouseWheel:
|
|
322
|
-
autoCorrectParts:
|
|
323
|
-
autoSwitchParts:
|
|
324
|
-
autoSwitchKeys:
|
|
325
|
-
allowCaretMode:
|
|
326
|
-
},
|
|
327
|
-
|
|
316
|
+
autoFill: U,
|
|
317
|
+
twoDigitYearMax: j,
|
|
318
|
+
enableMouseWheel: H,
|
|
319
|
+
autoCorrectParts: W,
|
|
320
|
+
autoSwitchParts: X,
|
|
321
|
+
autoSwitchKeys: Y,
|
|
322
|
+
allowCaretMode: Z
|
|
323
|
+
}, D = /* @__PURE__ */ n.createElement(
|
|
324
|
+
se,
|
|
328
325
|
{
|
|
329
326
|
onFocus: this.handleFocus,
|
|
330
327
|
onBlur: this.handleBlur,
|
|
331
328
|
onSyncFocus: this.props.onFocus,
|
|
332
329
|
onSyncBlur: this.props.onBlur
|
|
333
330
|
},
|
|
334
|
-
({ onFocus:
|
|
331
|
+
({ onFocus: J, onBlur: Q }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
335
332
|
"div",
|
|
336
333
|
{
|
|
337
|
-
ref: (
|
|
338
|
-
this._element =
|
|
334
|
+
ref: ($) => {
|
|
335
|
+
this._element = $;
|
|
339
336
|
},
|
|
340
337
|
className: S(
|
|
341
|
-
|
|
338
|
+
I.wrapper({
|
|
342
339
|
c: y,
|
|
343
340
|
size: i,
|
|
344
341
|
fillMode: s,
|
|
345
342
|
rounded: t,
|
|
346
|
-
disabled:
|
|
343
|
+
disabled: r,
|
|
347
344
|
required: this.required,
|
|
348
|
-
invalid: !
|
|
345
|
+
invalid: !T
|
|
349
346
|
}),
|
|
350
347
|
{ "k-focus": this.state.focused },
|
|
351
|
-
|
|
348
|
+
F
|
|
352
349
|
),
|
|
353
350
|
onKeyDown: this.handleKeyDown,
|
|
354
|
-
style: { width:
|
|
355
|
-
onFocus: this.mobileMode ? this.handleClick :
|
|
356
|
-
onBlur:
|
|
351
|
+
style: { width: A },
|
|
352
|
+
onFocus: this.mobileMode ? this.handleClick : J,
|
|
353
|
+
onBlur: Q,
|
|
357
354
|
onClick: this.mobileMode ? this.handleClick : void 0
|
|
358
355
|
},
|
|
359
356
|
/* @__PURE__ */ n.createElement(
|
|
@@ -365,37 +362,38 @@ const a = class a extends n.Component {
|
|
|
365
362
|
ariaHasPopup: "dialog",
|
|
366
363
|
autoFocus: o,
|
|
367
364
|
inputAttributes: h,
|
|
368
|
-
...
|
|
365
|
+
...G
|
|
369
366
|
}
|
|
370
367
|
),
|
|
371
368
|
/* @__PURE__ */ n.createElement(
|
|
372
|
-
|
|
369
|
+
de,
|
|
373
370
|
{
|
|
374
371
|
tabIndex: -1,
|
|
375
372
|
type: "button",
|
|
373
|
+
disabled: r,
|
|
376
374
|
icon: "calendar",
|
|
377
|
-
svgIcon:
|
|
375
|
+
svgIcon: le,
|
|
378
376
|
onMouseDown: this.handleIconMouseDown,
|
|
379
377
|
onClick: this.mobileMode ? void 0 : this.handleClick,
|
|
380
|
-
title:
|
|
381
|
-
|
|
382
|
-
|
|
378
|
+
title: m(this).toLanguageString(
|
|
379
|
+
c,
|
|
380
|
+
p[c]
|
|
383
381
|
),
|
|
384
|
-
className: S(
|
|
382
|
+
className: S(I.inputButton({ c: y })),
|
|
385
383
|
fillMode: s,
|
|
386
|
-
"aria-label":
|
|
387
|
-
|
|
388
|
-
|
|
384
|
+
"aria-label": m(this).toLanguageString(
|
|
385
|
+
c,
|
|
386
|
+
p[c]
|
|
389
387
|
)
|
|
390
388
|
}
|
|
391
389
|
),
|
|
392
390
|
/* @__PURE__ */ n.createElement(
|
|
393
|
-
|
|
391
|
+
q,
|
|
394
392
|
{
|
|
395
393
|
show: this.show,
|
|
396
394
|
animate: this.element !== null,
|
|
397
395
|
anchor: this.element,
|
|
398
|
-
popupClass: S(
|
|
396
|
+
popupClass: S(I.popup({ c: y })),
|
|
399
397
|
id: this._popupId,
|
|
400
398
|
anchorAlign: {
|
|
401
399
|
horizontal: "left",
|
|
@@ -411,17 +409,17 @@ const a = class a extends n.Component {
|
|
|
411
409
|
), this.mobileMode && this.renderAdaptivePopup())
|
|
412
410
|
);
|
|
413
411
|
return this.props.label ? /* @__PURE__ */ n.createElement(
|
|
414
|
-
|
|
412
|
+
be,
|
|
415
413
|
{
|
|
416
414
|
dateInput: this._dateInput,
|
|
417
415
|
label: this.props.label,
|
|
418
|
-
editorId:
|
|
419
|
-
editorValid:
|
|
416
|
+
editorId: u,
|
|
417
|
+
editorValid: T,
|
|
420
418
|
editorDisabled: this.props.disabled,
|
|
421
|
-
children:
|
|
419
|
+
children: D,
|
|
422
420
|
style: { width: this.props.width }
|
|
423
421
|
}
|
|
424
|
-
) :
|
|
422
|
+
) : D;
|
|
425
423
|
}
|
|
426
424
|
setShow(i) {
|
|
427
425
|
const { onOpen: t, onClose: s } = this.props;
|
|
@@ -483,6 +481,7 @@ a.displayName = "DateTimePicker", a.propTypes = {
|
|
|
483
481
|
]),
|
|
484
482
|
id: e.string,
|
|
485
483
|
ariaLabelledBy: e.string,
|
|
484
|
+
ariaLabel: e.string,
|
|
486
485
|
ariaDescribedBy: e.string,
|
|
487
486
|
min: e.instanceOf(Date),
|
|
488
487
|
max: e.instanceOf(Date),
|
|
@@ -515,32 +514,32 @@ a.displayName = "DateTimePicker", a.propTypes = {
|
|
|
515
514
|
disabled: !1,
|
|
516
515
|
format: "g",
|
|
517
516
|
// general date and time pattern (short time): "M/d/y h:mm a" for en.
|
|
518
|
-
max:
|
|
519
|
-
min:
|
|
517
|
+
max: pe,
|
|
518
|
+
min: ue,
|
|
520
519
|
popupSettings: {},
|
|
521
520
|
tabIndex: 0,
|
|
522
521
|
weekNumber: !1,
|
|
523
522
|
validityStyles: !0,
|
|
524
523
|
cancelButton: !0,
|
|
525
|
-
dateInput:
|
|
524
|
+
dateInput: he,
|
|
526
525
|
size: void 0,
|
|
527
526
|
rounded: void 0,
|
|
528
527
|
fillMode: void 0,
|
|
529
528
|
autoFocus: !1
|
|
530
529
|
};
|
|
531
530
|
let f = a;
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
531
|
+
const Se = te(), Ie = oe(
|
|
532
|
+
ae(
|
|
533
|
+
Se,
|
|
534
|
+
ne(
|
|
535
|
+
re(f)
|
|
537
536
|
)
|
|
538
537
|
)
|
|
539
538
|
);
|
|
540
539
|
Ie.displayName = "KendoReactDateTimePicker";
|
|
541
|
-
|
|
540
|
+
fe(f);
|
|
542
541
|
export {
|
|
543
542
|
Ie as DateTimePicker,
|
|
544
|
-
|
|
543
|
+
Se as DateTimePickerPropsContext,
|
|
545
544
|
f as DateTimePickerWithoutContext
|
|
546
545
|
};
|
|
@@ -91,6 +91,13 @@ export interface DateTimePickerSettings {
|
|
|
91
91
|
* This property is related to accessibility.
|
|
92
92
|
*/
|
|
93
93
|
ariaLabelledBy?: string;
|
|
94
|
+
/**
|
|
95
|
+
* The accessible label of the component.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* This property is related to accessibility.
|
|
99
|
+
*/
|
|
100
|
+
ariaLabel?: string;
|
|
94
101
|
/**
|
|
95
102
|
* Specifies the greatest valid date
|
|
96
103
|
* ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datetimepicker/date-ranges)).
|