@progress/kendo-react-dateinputs 14.5.0-develop.9 → 15.0.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/CalendarMcpWrapper.d.ts +16 -0
- package/CalendarMcpWrapper.js +8 -0
- package/CalendarMcpWrapper.mjs +18 -0
- package/DateRangePickerMcpWrapper.d.ts +16 -0
- package/DateRangePickerMcpWrapper.js +8 -0
- package/DateRangePickerMcpWrapper.mjs +18 -0
- package/DateTimePickerMcpWrapper.d.ts +16 -0
- package/DateTimePickerMcpWrapper.js +8 -0
- package/DateTimePickerMcpWrapper.mjs +18 -0
- package/README.md +4 -4
- package/TimePickerMcpWrapper.d.ts +16 -0
- package/TimePickerMcpWrapper.js +8 -0
- package/TimePickerMcpWrapper.mjs +18 -0
- package/calendar/components/Calendar.d.ts +6 -1
- package/calendar/components/Calendar.mjs +5 -5
- package/dateinput/DateInput.d.ts +11 -1
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +202 -194
- package/datepicker/DatePicker.d.ts +6 -1
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +233 -231
- package/daterangepicker/DateRangePicker.d.ts +6 -1
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +65 -61
- package/datetimepicker/DateTimePicker.d.ts +7 -1
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +106 -100
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +12 -4
- package/index.d.ts +12 -4
- package/index.js +1 -1
- package/index.mjs +110 -105
- package/messages/index.d.ts +25 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +46 -36
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePicker.d.ts +7 -1
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +90 -87
|
@@ -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 ie } from "@progress/kendo-react-popup";
|
|
11
11
|
import { cloneDate as P } from "@progress/kendo-date-math";
|
|
12
|
-
import {
|
|
13
|
-
import { calendarIcon as
|
|
14
|
-
import {
|
|
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 se, Keys as d, canUseDOM as C, subscribeToKendoPaste as oe, AsyncFocusBlur as ae, classNames as S, uDateTimePicker as T, withIdHOC as ne, withPropsContext as re, withUnstyledHOC as le, withAdaptiveModeContext as he } from "@progress/kendo-react-common";
|
|
13
|
+
import { calendarIcon as de } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { DateInputInner as ue } from "../dateinput/DateInput.mjs";
|
|
15
|
+
import { Button as pe } from "@progress/kendo-react-buttons";
|
|
16
|
+
import { isInDateRange as M, MIN_DATE as ce, MAX_DATE as me, MAX_TIME as fe, MIN_TIME as ge } from "../utils.mjs";
|
|
17
|
+
import { dateTimePickerCancel as O, messages as u, dateTimePickerSet as x, selectDateAndTime as k, toggleDateTimeSelector as m } from "../messages/index.mjs";
|
|
18
|
+
import { provideLocalizationService as p, registerForLocalization as ve } from "@progress/kendo-react-intl";
|
|
19
|
+
import { DateTimeSelector as be } from "./DateTimeSelector.mjs";
|
|
20
|
+
import { isInTimeRange as we } from "../timepicker/utils.mjs";
|
|
21
|
+
import { PickerFloatingLabel as ye } from "../hooks/usePickerFloatingLabel.mjs";
|
|
22
|
+
import { AdaptiveMode as Se } from "../common/AdaptiveMode.mjs";
|
|
23
|
+
import { ActionSheetContent as Te } 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,12 +50,12 @@ 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: c, unstyled: v } = this.props;
|
|
54
54
|
return /* @__PURE__ */ n.createElement(
|
|
55
|
-
|
|
55
|
+
be,
|
|
56
56
|
{
|
|
57
|
-
ref: (
|
|
58
|
-
this._dateTimeSelector =
|
|
57
|
+
ref: (b) => {
|
|
58
|
+
this._dateTimeSelector = b;
|
|
59
59
|
},
|
|
60
60
|
cancelButton: r,
|
|
61
61
|
steps: this.props.steps,
|
|
@@ -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: c,
|
|
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 = p(this).toLanguageString(
|
|
81
81
|
O,
|
|
82
|
-
|
|
83
|
-
), o =
|
|
82
|
+
u[O]
|
|
83
|
+
), o = p(this).toLanguageString(
|
|
84
84
|
x,
|
|
85
|
-
|
|
85
|
+
u[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(Se, { ...h }, /* @__PURE__ */ n.createElement(Te, 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) && we(this.value, this.props.minTime || ge, this.props.maxTime || fe), 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 = oe(this._element, {
|
|
231
231
|
fieldName: i,
|
|
232
232
|
onValueChange: (s) => {
|
|
233
233
|
this.handleSmartPasteValue(s);
|
|
@@ -263,46 +263,50 @@ const a = class a extends n.Component {
|
|
|
263
263
|
disabled: l,
|
|
264
264
|
tabIndex: r,
|
|
265
265
|
title: g,
|
|
266
|
-
id:
|
|
266
|
+
id: c,
|
|
267
267
|
format: v,
|
|
268
|
-
formatPlaceholder:
|
|
268
|
+
formatPlaceholder: b,
|
|
269
269
|
min: E,
|
|
270
|
-
max:
|
|
271
|
-
className:
|
|
272
|
-
width:
|
|
273
|
-
name:
|
|
274
|
-
validationMessage:
|
|
275
|
-
required:
|
|
276
|
-
validityStyles:
|
|
277
|
-
minTime:
|
|
278
|
-
maxTime:
|
|
270
|
+
max: F,
|
|
271
|
+
className: A,
|
|
272
|
+
width: N,
|
|
273
|
+
name: R,
|
|
274
|
+
validationMessage: B,
|
|
275
|
+
required: z,
|
|
276
|
+
validityStyles: _,
|
|
277
|
+
minTime: K,
|
|
278
|
+
maxTime: L,
|
|
279
279
|
ariaLabelledBy: V,
|
|
280
280
|
ariaDescribedBy: q,
|
|
281
|
-
popup:
|
|
282
|
-
unstyled:
|
|
283
|
-
autoFill:
|
|
284
|
-
twoDigitYearMax:
|
|
285
|
-
enableMouseWheel:
|
|
286
|
-
autoCorrectParts:
|
|
287
|
-
autoSwitchParts:
|
|
288
|
-
autoSwitchKeys:
|
|
289
|
-
allowCaretMode:
|
|
290
|
-
} = this.props, y =
|
|
291
|
-
|
|
281
|
+
popup: U = ie,
|
|
282
|
+
unstyled: w,
|
|
283
|
+
autoFill: j,
|
|
284
|
+
twoDigitYearMax: H,
|
|
285
|
+
enableMouseWheel: W,
|
|
286
|
+
autoCorrectParts: X,
|
|
287
|
+
autoSwitchParts: Y,
|
|
288
|
+
autoSwitchKeys: Z,
|
|
289
|
+
allowCaretMode: G
|
|
290
|
+
} = this.props, y = w && w.uDateTimePicker, D = !this.validityStyles || this.validity.valid, J = p(this).toLanguageString(
|
|
291
|
+
k,
|
|
292
|
+
u[k]
|
|
293
|
+
), Q = {
|
|
294
|
+
id: c,
|
|
292
295
|
ariaLabelledBy: V,
|
|
293
296
|
ariaDescribedBy: q,
|
|
297
|
+
ariaLabel: J,
|
|
294
298
|
format: v,
|
|
295
|
-
formatPlaceholder:
|
|
299
|
+
formatPlaceholder: b,
|
|
296
300
|
disabled: l,
|
|
297
301
|
title: g,
|
|
298
|
-
validityStyles:
|
|
299
|
-
validationMessage:
|
|
300
|
-
required:
|
|
302
|
+
validityStyles: _,
|
|
303
|
+
validationMessage: B,
|
|
304
|
+
required: z,
|
|
301
305
|
min: E,
|
|
302
|
-
max:
|
|
303
|
-
minTime:
|
|
304
|
-
maxTime:
|
|
305
|
-
name:
|
|
306
|
+
max: F,
|
|
307
|
+
minTime: K,
|
|
308
|
+
maxTime: L,
|
|
309
|
+
name: R,
|
|
306
310
|
tabIndex: this.show ? -1 : r,
|
|
307
311
|
valid: this.validity.valid,
|
|
308
312
|
value: this.value,
|
|
@@ -311,44 +315,45 @@ const a = class a extends n.Component {
|
|
|
311
315
|
label: void 0,
|
|
312
316
|
placeholder: this.state.focused ? null : this.props.placeholder,
|
|
313
317
|
ariaExpanded: this.show,
|
|
314
|
-
unstyled:
|
|
315
|
-
autoFill:
|
|
316
|
-
twoDigitYearMax:
|
|
317
|
-
enableMouseWheel:
|
|
318
|
-
autoCorrectParts:
|
|
319
|
-
autoSwitchParts:
|
|
320
|
-
autoSwitchKeys:
|
|
321
|
-
allowCaretMode:
|
|
318
|
+
unstyled: w,
|
|
319
|
+
autoFill: j,
|
|
320
|
+
twoDigitYearMax: H,
|
|
321
|
+
enableMouseWheel: W,
|
|
322
|
+
autoCorrectParts: X,
|
|
323
|
+
autoSwitchParts: Y,
|
|
324
|
+
autoSwitchKeys: Z,
|
|
325
|
+
allowCaretMode: G
|
|
322
326
|
}, I = /* @__PURE__ */ n.createElement(
|
|
323
|
-
|
|
327
|
+
ae,
|
|
324
328
|
{
|
|
325
329
|
onFocus: this.handleFocus,
|
|
326
330
|
onBlur: this.handleBlur,
|
|
327
331
|
onSyncFocus: this.props.onFocus,
|
|
328
332
|
onSyncBlur: this.props.onBlur
|
|
329
333
|
},
|
|
330
|
-
({ onFocus:
|
|
334
|
+
({ onFocus: $, onBlur: ee }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
331
335
|
"div",
|
|
332
336
|
{
|
|
333
|
-
ref: (
|
|
334
|
-
this._element =
|
|
337
|
+
ref: (te) => {
|
|
338
|
+
this._element = te;
|
|
335
339
|
},
|
|
336
340
|
className: S(
|
|
337
|
-
|
|
341
|
+
T.wrapper({
|
|
338
342
|
c: y,
|
|
339
343
|
size: i,
|
|
340
344
|
fillMode: s,
|
|
341
345
|
rounded: t,
|
|
342
346
|
disabled: l,
|
|
343
347
|
required: this.required,
|
|
344
|
-
invalid: !
|
|
348
|
+
invalid: !D
|
|
345
349
|
}),
|
|
346
|
-
|
|
350
|
+
{ "k-focus": this.state.focused },
|
|
351
|
+
A
|
|
347
352
|
),
|
|
348
353
|
onKeyDown: this.handleKeyDown,
|
|
349
|
-
style: { width:
|
|
350
|
-
onFocus: this.mobileMode ? this.handleClick :
|
|
351
|
-
onBlur:
|
|
354
|
+
style: { width: N },
|
|
355
|
+
onFocus: this.mobileMode ? this.handleClick : $,
|
|
356
|
+
onBlur: ee,
|
|
352
357
|
onClick: this.mobileMode ? this.handleClick : void 0
|
|
353
358
|
},
|
|
354
359
|
/* @__PURE__ */ n.createElement(
|
|
@@ -360,37 +365,37 @@ const a = class a extends n.Component {
|
|
|
360
365
|
ariaHasPopup: "dialog",
|
|
361
366
|
autoFocus: o,
|
|
362
367
|
inputAttributes: h,
|
|
363
|
-
...
|
|
368
|
+
...Q
|
|
364
369
|
}
|
|
365
370
|
),
|
|
366
371
|
/* @__PURE__ */ n.createElement(
|
|
367
|
-
|
|
372
|
+
pe,
|
|
368
373
|
{
|
|
369
374
|
tabIndex: -1,
|
|
370
375
|
type: "button",
|
|
371
376
|
icon: "calendar",
|
|
372
|
-
svgIcon:
|
|
377
|
+
svgIcon: de,
|
|
373
378
|
onMouseDown: this.handleIconMouseDown,
|
|
374
379
|
onClick: this.mobileMode ? void 0 : this.handleClick,
|
|
375
|
-
title:
|
|
376
|
-
|
|
377
|
-
|
|
380
|
+
title: p(this).toLanguageString(
|
|
381
|
+
m,
|
|
382
|
+
u[m]
|
|
378
383
|
),
|
|
379
|
-
className: S(
|
|
384
|
+
className: S(T.inputButton({ c: y })),
|
|
380
385
|
fillMode: s,
|
|
381
|
-
"aria-label":
|
|
382
|
-
|
|
383
|
-
|
|
386
|
+
"aria-label": p(this).toLanguageString(
|
|
387
|
+
m,
|
|
388
|
+
u[m]
|
|
384
389
|
)
|
|
385
390
|
}
|
|
386
391
|
),
|
|
387
392
|
/* @__PURE__ */ n.createElement(
|
|
388
|
-
|
|
393
|
+
U,
|
|
389
394
|
{
|
|
390
395
|
show: this.show,
|
|
391
396
|
animate: this.element !== null,
|
|
392
397
|
anchor: this.element,
|
|
393
|
-
popupClass: S(
|
|
398
|
+
popupClass: S(T.popup({ c: y })),
|
|
394
399
|
id: this._popupId,
|
|
395
400
|
anchorAlign: {
|
|
396
401
|
horizontal: "left",
|
|
@@ -406,12 +411,12 @@ const a = class a extends n.Component {
|
|
|
406
411
|
), this.mobileMode && this.renderAdaptivePopup())
|
|
407
412
|
);
|
|
408
413
|
return this.props.label ? /* @__PURE__ */ n.createElement(
|
|
409
|
-
|
|
414
|
+
ye,
|
|
410
415
|
{
|
|
411
416
|
dateInput: this._dateInput,
|
|
412
417
|
label: this.props.label,
|
|
413
|
-
editorId:
|
|
414
|
-
editorValid:
|
|
418
|
+
editorId: c,
|
|
419
|
+
editorValid: D,
|
|
415
420
|
editorDisabled: this.props.disabled,
|
|
416
421
|
children: I,
|
|
417
422
|
style: { width: this.props.width }
|
|
@@ -487,6 +492,7 @@ a.displayName = "DateTimePicker", a.propTypes = {
|
|
|
487
492
|
appendTo: e.any,
|
|
488
493
|
popupClass: e.string
|
|
489
494
|
}),
|
|
495
|
+
dateInput: e.elementType,
|
|
490
496
|
show: e.bool,
|
|
491
497
|
tabIndex: e.number,
|
|
492
498
|
title: e.string,
|
|
@@ -509,32 +515,32 @@ a.displayName = "DateTimePicker", a.propTypes = {
|
|
|
509
515
|
disabled: !1,
|
|
510
516
|
format: "g",
|
|
511
517
|
// general date and time pattern (short time): "M/d/y h:mm a" for en.
|
|
512
|
-
max:
|
|
513
|
-
min:
|
|
518
|
+
max: me,
|
|
519
|
+
min: ce,
|
|
514
520
|
popupSettings: {},
|
|
515
521
|
tabIndex: 0,
|
|
516
522
|
weekNumber: !1,
|
|
517
523
|
validityStyles: !0,
|
|
518
524
|
cancelButton: !0,
|
|
519
|
-
dateInput:
|
|
525
|
+
dateInput: ue,
|
|
520
526
|
size: void 0,
|
|
521
527
|
rounded: void 0,
|
|
522
528
|
fillMode: void 0,
|
|
523
529
|
autoFocus: !1
|
|
524
530
|
};
|
|
525
531
|
let f = a;
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
532
|
+
const De = se(), Ie = ne(
|
|
533
|
+
re(
|
|
534
|
+
De,
|
|
535
|
+
le(
|
|
536
|
+
he(f)
|
|
531
537
|
)
|
|
532
538
|
)
|
|
533
539
|
);
|
|
534
|
-
|
|
535
|
-
|
|
540
|
+
Ie.displayName = "KendoReactDateTimePicker";
|
|
541
|
+
ve(f);
|
|
536
542
|
export {
|
|
537
|
-
|
|
538
|
-
|
|
543
|
+
Ie as DateTimePicker,
|
|
544
|
+
De as DateTimePickerPropsContext,
|
|
539
545
|
f as DateTimePickerWithoutContext
|
|
540
546
|
};
|