@progress/kendo-react-dateinputs 15.1.1-develop.3 → 15.2.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/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +164 -164
- 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 +103 -105
- package/datetimepicker/models/DateTimePickerSettings.d.ts +7 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePicker.d.ts +1 -0
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +113 -112
- 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,9 +50,9 @@ 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: l, cancelButton: r, weekNumber: g, focusedDate:
|
|
53
|
+
const { disabled: t, minTime: s, maxTime: o, format: h, calendar: l, cancelButton: r, 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;
|
|
@@ -68,7 +68,7 @@ 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
73
|
calendar: l,
|
|
74
74
|
mobileMode: this.mobileMode,
|
|
@@ -77,12 +77,12 @@ const a = class a extends n.Component {
|
|
|
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,
|
|
@@ -102,7 +102,7 @@ const a = class a extends n.Component {
|
|
|
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);
|
|
@@ -263,50 +263,47 @@ const a = class a extends n.Component {
|
|
|
263
263
|
disabled: l,
|
|
264
264
|
tabIndex: r,
|
|
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
297
|
disabled: l,
|
|
301
298
|
title: g,
|
|
302
|
-
validityStyles:
|
|
303
|
-
validationMessage:
|
|
304
|
-
required:
|
|
305
|
-
min:
|
|
306
|
-
max:
|
|
307
|
-
minTime:
|
|
308
|
-
maxTime:
|
|
309
|
-
name:
|
|
299
|
+
validityStyles: z,
|
|
300
|
+
validationMessage: R,
|
|
301
|
+
required: B,
|
|
302
|
+
min: k,
|
|
303
|
+
max: E,
|
|
304
|
+
minTime: _,
|
|
305
|
+
maxTime: K,
|
|
306
|
+
name: N,
|
|
310
307
|
tabIndex: this.show ? -1 : r,
|
|
311
308
|
valid: this.validity.valid,
|
|
312
309
|
value: this.value,
|
|
@@ -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
343
|
disabled: l,
|
|
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,37 @@ 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",
|
|
376
373
|
icon: "calendar",
|
|
377
|
-
svgIcon:
|
|
374
|
+
svgIcon: le,
|
|
378
375
|
onMouseDown: this.handleIconMouseDown,
|
|
379
376
|
onClick: this.mobileMode ? void 0 : this.handleClick,
|
|
380
|
-
title:
|
|
381
|
-
|
|
382
|
-
|
|
377
|
+
title: m(this).toLanguageString(
|
|
378
|
+
c,
|
|
379
|
+
p[c]
|
|
383
380
|
),
|
|
384
|
-
className: S(
|
|
381
|
+
className: S(I.inputButton({ c: y })),
|
|
385
382
|
fillMode: s,
|
|
386
|
-
"aria-label":
|
|
387
|
-
|
|
388
|
-
|
|
383
|
+
"aria-label": m(this).toLanguageString(
|
|
384
|
+
c,
|
|
385
|
+
p[c]
|
|
389
386
|
)
|
|
390
387
|
}
|
|
391
388
|
),
|
|
392
389
|
/* @__PURE__ */ n.createElement(
|
|
393
|
-
|
|
390
|
+
q,
|
|
394
391
|
{
|
|
395
392
|
show: this.show,
|
|
396
393
|
animate: this.element !== null,
|
|
397
394
|
anchor: this.element,
|
|
398
|
-
popupClass: S(
|
|
395
|
+
popupClass: S(I.popup({ c: y })),
|
|
399
396
|
id: this._popupId,
|
|
400
397
|
anchorAlign: {
|
|
401
398
|
horizontal: "left",
|
|
@@ -411,17 +408,17 @@ const a = class a extends n.Component {
|
|
|
411
408
|
), this.mobileMode && this.renderAdaptivePopup())
|
|
412
409
|
);
|
|
413
410
|
return this.props.label ? /* @__PURE__ */ n.createElement(
|
|
414
|
-
|
|
411
|
+
be,
|
|
415
412
|
{
|
|
416
413
|
dateInput: this._dateInput,
|
|
417
414
|
label: this.props.label,
|
|
418
|
-
editorId:
|
|
419
|
-
editorValid:
|
|
415
|
+
editorId: u,
|
|
416
|
+
editorValid: T,
|
|
420
417
|
editorDisabled: this.props.disabled,
|
|
421
|
-
children:
|
|
418
|
+
children: D,
|
|
422
419
|
style: { width: this.props.width }
|
|
423
420
|
}
|
|
424
|
-
) :
|
|
421
|
+
) : D;
|
|
425
422
|
}
|
|
426
423
|
setShow(i) {
|
|
427
424
|
const { onOpen: t, onClose: s } = this.props;
|
|
@@ -483,6 +480,7 @@ a.displayName = "DateTimePicker", a.propTypes = {
|
|
|
483
480
|
]),
|
|
484
481
|
id: e.string,
|
|
485
482
|
ariaLabelledBy: e.string,
|
|
483
|
+
ariaLabel: e.string,
|
|
486
484
|
ariaDescribedBy: e.string,
|
|
487
485
|
min: e.instanceOf(Date),
|
|
488
486
|
max: e.instanceOf(Date),
|
|
@@ -515,32 +513,32 @@ a.displayName = "DateTimePicker", a.propTypes = {
|
|
|
515
513
|
disabled: !1,
|
|
516
514
|
format: "g",
|
|
517
515
|
// general date and time pattern (short time): "M/d/y h:mm a" for en.
|
|
518
|
-
max:
|
|
519
|
-
min:
|
|
516
|
+
max: pe,
|
|
517
|
+
min: ue,
|
|
520
518
|
popupSettings: {},
|
|
521
519
|
tabIndex: 0,
|
|
522
520
|
weekNumber: !1,
|
|
523
521
|
validityStyles: !0,
|
|
524
522
|
cancelButton: !0,
|
|
525
|
-
dateInput:
|
|
523
|
+
dateInput: he,
|
|
526
524
|
size: void 0,
|
|
527
525
|
rounded: void 0,
|
|
528
526
|
fillMode: void 0,
|
|
529
527
|
autoFocus: !1
|
|
530
528
|
};
|
|
531
529
|
let f = a;
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
530
|
+
const Se = te(), Ie = oe(
|
|
531
|
+
ae(
|
|
532
|
+
Se,
|
|
533
|
+
ne(
|
|
534
|
+
re(f)
|
|
537
535
|
)
|
|
538
536
|
)
|
|
539
537
|
);
|
|
540
538
|
Ie.displayName = "KendoReactDateTimePicker";
|
|
541
|
-
|
|
539
|
+
fe(f);
|
|
542
540
|
export {
|
|
543
541
|
Ie as DateTimePicker,
|
|
544
|
-
|
|
542
|
+
Se as DateTimePickerPropsContext,
|
|
545
543
|
f as DateTimePickerWithoutContext
|
|
546
544
|
};
|
|
@@ -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)).
|