@progress/kendo-react-dateinputs 9.1.1-develop.4 → 9.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/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +87 -84
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +78 -75
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +58 -55
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +93 -90
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +31 -0
- package/index.d.ts +31 -0
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +59 -56
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
10
|
import e from "prop-types";
|
|
11
|
-
import { Popup as
|
|
11
|
+
import { Popup as $ } from "@progress/kendo-react-popup";
|
|
12
12
|
import { cloneDate as M } from "@progress/kendo-date-math";
|
|
13
|
-
import { Keys as d, validatePackage as
|
|
14
|
-
import { calendarIcon as
|
|
15
|
-
import { DateInput as
|
|
16
|
-
import { Button as
|
|
17
|
-
import { packageMetadata as
|
|
18
|
-
import { MAX_DATE as
|
|
19
|
-
import { MOBILE_MEDIUM_DEVISE as
|
|
13
|
+
import { Keys as d, validatePackage as ee, canUseDOM as O, AsyncFocusBlur as te, classNames as I, uDateTimePicker as D, createPropsContext as ie, withIdHOC as se, withPropsContext as oe, withUnstyledHOC as ae } from "@progress/kendo-react-common";
|
|
14
|
+
import { calendarIcon as ne } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { DateInput as re } from "../dateinput/DateInput.mjs";
|
|
16
|
+
import { Button as le } from "@progress/kendo-react-buttons";
|
|
17
|
+
import { packageMetadata as he } from "../package-metadata.mjs";
|
|
18
|
+
import { MAX_DATE as de, MIN_DATE as ue, isInDateRange as pe, MAX_TIME as ce, MIN_TIME as me } from "../utils.mjs";
|
|
19
|
+
import { MOBILE_MEDIUM_DEVISE as fe } from "../common/constants.mjs";
|
|
20
20
|
import { dateTimePickerCancel as P, messages as p, dateTimePickerSet as C, toggleDateTimeSelector as c } from "../messages/index.mjs";
|
|
21
|
-
import { provideLocalizationService as m, registerForLocalization as
|
|
22
|
-
import { DateTimeSelector as
|
|
23
|
-
import { isInTimeRange as
|
|
24
|
-
import { PickerFloatingLabel as
|
|
25
|
-
import { AdaptiveMode as
|
|
26
|
-
import { ActionSheetContent as
|
|
21
|
+
import { provideLocalizationService as m, registerForLocalization as ge } from "@progress/kendo-react-intl";
|
|
22
|
+
import { DateTimeSelector as ve } from "./DateTimeSelector.mjs";
|
|
23
|
+
import { isInTimeRange as we } from "../timepicker/utils.mjs";
|
|
24
|
+
import { PickerFloatingLabel as be } from "../hooks/usePickerFloatingLabel.mjs";
|
|
25
|
+
import { AdaptiveMode as ye } from "../common/AdaptiveMode.mjs";
|
|
26
|
+
import { ActionSheetContent as Ie } from "@progress/kendo-react-layout";
|
|
27
27
|
const o = class o extends n.Component {
|
|
28
28
|
constructor(t) {
|
|
29
29
|
super(t), this._element = null, this._dateInput = n.createRef(), this._dateTimeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
|
|
30
30
|
const i = this.dateInputElement();
|
|
31
31
|
i && i.focus();
|
|
32
32
|
}, this.renderPicker = () => {
|
|
33
|
-
const { disabled: i, minTime: s, maxTime: a, format: h, calendar: l, cancelButton: r, weekNumber:
|
|
33
|
+
const { disabled: i, minTime: s, maxTime: a, format: h, calendar: l, cancelButton: r, weekNumber: g, focusedDate: u, unstyled: v } = this.props;
|
|
34
34
|
return /* @__PURE__ */ n.createElement(
|
|
35
|
-
|
|
35
|
+
ve,
|
|
36
36
|
{
|
|
37
37
|
ref: (w) => {
|
|
38
38
|
this._dateTimeSelector = w;
|
|
@@ -43,12 +43,12 @@ const o = class o extends n.Component {
|
|
|
43
43
|
onChange: this.handleValueChange,
|
|
44
44
|
onReject: this.handleReject,
|
|
45
45
|
disabled: i,
|
|
46
|
-
weekNumber:
|
|
46
|
+
weekNumber: g,
|
|
47
47
|
min: this.min,
|
|
48
48
|
max: this.max,
|
|
49
49
|
minTime: s,
|
|
50
50
|
maxTime: a,
|
|
51
|
-
focusedDate:
|
|
51
|
+
focusedDate: u,
|
|
52
52
|
format: h,
|
|
53
53
|
calendar: l,
|
|
54
54
|
mobileMode: this.mobileMode,
|
|
@@ -81,7 +81,7 @@ const o = class o extends n.Component {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
return /* @__PURE__ */ n.createElement(
|
|
84
|
+
return /* @__PURE__ */ n.createElement(ye, { ...h }, /* @__PURE__ */ n.createElement(Ie, { overflowHidden: !0 }, this.renderPicker()));
|
|
85
85
|
}, this.handleReject = () => {
|
|
86
86
|
this.shouldFocusDateInput = !0, this.setShow(!1);
|
|
87
87
|
}, this.handleValueChange = (i) => {
|
|
@@ -111,7 +111,7 @@ const o = class o extends n.Component {
|
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
s && (a === d.up || a === d.down) && (i.preventDefault(), i.stopPropagation(), this.shouldFocusDateInput = a === d.up, this.setShow(a === d.down));
|
|
114
|
-
}, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"),
|
|
114
|
+
}, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"), ee(he), this.state = {
|
|
115
115
|
value: this.props.defaultValue || o.defaultProps.defaultValue,
|
|
116
116
|
show: this.props.defaultShow || o.defaultProps.defaultShow,
|
|
117
117
|
focused: !1
|
|
@@ -159,7 +159,7 @@ const o = class o extends n.Component {
|
|
|
159
159
|
* The mobile mode of the ComboBox.
|
|
160
160
|
*/
|
|
161
161
|
get mobileMode() {
|
|
162
|
-
return !!(this.state.windowWidth && this.state.windowWidth <=
|
|
162
|
+
return !!(this.state.windowWidth && this.state.windowWidth <= fe && this.props.adaptive);
|
|
163
163
|
}
|
|
164
164
|
get min() {
|
|
165
165
|
return this.props.min !== void 0 ? this.props.min : o.defaultProps.min;
|
|
@@ -171,7 +171,7 @@ const o = class o extends n.Component {
|
|
|
171
171
|
* Represents the validity state into which the DateTimePicker is set.
|
|
172
172
|
*/
|
|
173
173
|
get validity() {
|
|
174
|
-
const t =
|
|
174
|
+
const t = pe(this.value, this.min, this.max) && we(this.value, this.props.minTime || me, this.props.maxTime || ce), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, a = this.props.valid !== void 0 ? this.props.valid : s;
|
|
175
175
|
return {
|
|
176
176
|
customError: i,
|
|
177
177
|
rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
|
|
@@ -228,50 +228,51 @@ const o = class o extends n.Component {
|
|
|
228
228
|
rounded: i = o.defaultProps.rounded,
|
|
229
229
|
fillMode: s = o.defaultProps.fillMode,
|
|
230
230
|
autoFocus: a = o.defaultProps.autoFocus,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
inputAttributes: h,
|
|
232
|
+
disabled: l,
|
|
233
|
+
tabIndex: r,
|
|
234
|
+
title: g,
|
|
234
235
|
id: u,
|
|
235
|
-
format:
|
|
236
|
-
formatPlaceholder:
|
|
237
|
-
min:
|
|
238
|
-
max:
|
|
239
|
-
className:
|
|
240
|
-
width:
|
|
241
|
-
name:
|
|
236
|
+
format: v,
|
|
237
|
+
formatPlaceholder: w,
|
|
238
|
+
min: x,
|
|
239
|
+
max: E,
|
|
240
|
+
className: k,
|
|
241
|
+
width: F,
|
|
242
|
+
name: A,
|
|
242
243
|
validationMessage: R,
|
|
243
244
|
required: B,
|
|
244
245
|
validityStyles: z,
|
|
245
|
-
minTime:
|
|
246
|
-
maxTime:
|
|
247
|
-
ariaLabelledBy:
|
|
248
|
-
ariaDescribedBy:
|
|
249
|
-
popup:
|
|
246
|
+
minTime: N,
|
|
247
|
+
maxTime: V,
|
|
248
|
+
ariaLabelledBy: L,
|
|
249
|
+
ariaDescribedBy: _,
|
|
250
|
+
popup: q = $,
|
|
250
251
|
unstyled: b,
|
|
251
|
-
autoFill:
|
|
252
|
-
twoDigitYearMax:
|
|
253
|
-
enableMouseWheel:
|
|
254
|
-
autoCorrectParts:
|
|
255
|
-
autoSwitchParts:
|
|
256
|
-
autoSwitchKeys:
|
|
257
|
-
allowCaretMode:
|
|
258
|
-
} = this.props, y = b && b.uDateTimePicker, S = !this.validityStyles || this.validity.valid,
|
|
252
|
+
autoFill: K,
|
|
253
|
+
twoDigitYearMax: U,
|
|
254
|
+
enableMouseWheel: j,
|
|
255
|
+
autoCorrectParts: H,
|
|
256
|
+
autoSwitchParts: W,
|
|
257
|
+
autoSwitchKeys: X,
|
|
258
|
+
allowCaretMode: Y
|
|
259
|
+
} = this.props, y = b && b.uDateTimePicker, S = !this.validityStyles || this.validity.valid, Z = {
|
|
259
260
|
id: u,
|
|
260
|
-
ariaLabelledBy:
|
|
261
|
-
ariaDescribedBy:
|
|
262
|
-
format:
|
|
263
|
-
formatPlaceholder:
|
|
264
|
-
disabled:
|
|
265
|
-
title:
|
|
261
|
+
ariaLabelledBy: L,
|
|
262
|
+
ariaDescribedBy: _,
|
|
263
|
+
format: v,
|
|
264
|
+
formatPlaceholder: w,
|
|
265
|
+
disabled: l,
|
|
266
|
+
title: g,
|
|
266
267
|
validityStyles: z,
|
|
267
268
|
validationMessage: R,
|
|
268
269
|
required: B,
|
|
269
|
-
min:
|
|
270
|
-
max:
|
|
271
|
-
minTime:
|
|
272
|
-
maxTime:
|
|
273
|
-
name:
|
|
274
|
-
tabIndex: this.show ? -1 :
|
|
270
|
+
min: x,
|
|
271
|
+
max: E,
|
|
272
|
+
minTime: N,
|
|
273
|
+
maxTime: V,
|
|
274
|
+
name: A,
|
|
275
|
+
tabIndex: this.show ? -1 : r,
|
|
275
276
|
valid: this.validity.valid,
|
|
276
277
|
value: this.value,
|
|
277
278
|
onChange: this.handleValueChange,
|
|
@@ -283,26 +284,26 @@ const o = class o extends n.Component {
|
|
|
283
284
|
fillMode: null,
|
|
284
285
|
rounded: null,
|
|
285
286
|
unstyled: b,
|
|
286
|
-
autoFill:
|
|
287
|
-
twoDigitYearMax:
|
|
288
|
-
enableMouseWheel:
|
|
289
|
-
autoCorrectParts:
|
|
290
|
-
autoSwitchParts:
|
|
291
|
-
autoSwitchKeys:
|
|
292
|
-
allowCaretMode:
|
|
287
|
+
autoFill: K,
|
|
288
|
+
twoDigitYearMax: U,
|
|
289
|
+
enableMouseWheel: j,
|
|
290
|
+
autoCorrectParts: H,
|
|
291
|
+
autoSwitchParts: W,
|
|
292
|
+
autoSwitchKeys: X,
|
|
293
|
+
allowCaretMode: Y
|
|
293
294
|
}, T = /* @__PURE__ */ n.createElement(
|
|
294
|
-
|
|
295
|
+
te,
|
|
295
296
|
{
|
|
296
297
|
onFocus: this.handleFocus,
|
|
297
298
|
onBlur: this.handleBlur,
|
|
298
299
|
onSyncFocus: this.props.onFocus,
|
|
299
300
|
onSyncBlur: this.props.onBlur
|
|
300
301
|
},
|
|
301
|
-
({ onFocus:
|
|
302
|
+
({ onFocus: G, onBlur: J }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
302
303
|
"div",
|
|
303
304
|
{
|
|
304
|
-
ref: (
|
|
305
|
-
this._element =
|
|
305
|
+
ref: (Q) => {
|
|
306
|
+
this._element = Q;
|
|
306
307
|
},
|
|
307
308
|
className: I(
|
|
308
309
|
D.wrapper({
|
|
@@ -310,16 +311,16 @@ const o = class o extends n.Component {
|
|
|
310
311
|
size: t,
|
|
311
312
|
fillMode: s,
|
|
312
313
|
rounded: i,
|
|
313
|
-
disabled:
|
|
314
|
+
disabled: l,
|
|
314
315
|
required: this.required,
|
|
315
316
|
invalid: !S
|
|
316
317
|
}),
|
|
317
|
-
|
|
318
|
+
k
|
|
318
319
|
),
|
|
319
320
|
onKeyDown: this.handleKeyDown,
|
|
320
|
-
style: { width:
|
|
321
|
-
onFocus: this.mobileMode ? void 0 :
|
|
322
|
-
onBlur:
|
|
321
|
+
style: { width: F },
|
|
322
|
+
onFocus: this.mobileMode ? void 0 : G,
|
|
323
|
+
onBlur: J,
|
|
323
324
|
onClick: this.mobileMode ? this.handleDateIconClick : void 0
|
|
324
325
|
},
|
|
325
326
|
/* @__PURE__ */ n.createElement(
|
|
@@ -330,16 +331,17 @@ const o = class o extends n.Component {
|
|
|
330
331
|
ariaControls: this._popupId,
|
|
331
332
|
ariaHasPopup: "dialog",
|
|
332
333
|
autoFocus: a,
|
|
333
|
-
|
|
334
|
+
inputAttributes: h,
|
|
335
|
+
...Z
|
|
334
336
|
}
|
|
335
337
|
),
|
|
336
338
|
/* @__PURE__ */ n.createElement(
|
|
337
|
-
|
|
339
|
+
le,
|
|
338
340
|
{
|
|
339
341
|
tabIndex: -1,
|
|
340
342
|
type: "button",
|
|
341
343
|
icon: "calendar",
|
|
342
|
-
svgIcon:
|
|
344
|
+
svgIcon: ne,
|
|
343
345
|
onMouseDown: this.handleIconMouseDown,
|
|
344
346
|
onClick: this.mobileMode ? void 0 : this.handleDateIconClick,
|
|
345
347
|
title: m(this).toLanguageString(
|
|
@@ -356,7 +358,7 @@ const o = class o extends n.Component {
|
|
|
356
358
|
}
|
|
357
359
|
),
|
|
358
360
|
/* @__PURE__ */ n.createElement(
|
|
359
|
-
|
|
361
|
+
q,
|
|
360
362
|
{
|
|
361
363
|
show: this.show,
|
|
362
364
|
animate: this.element !== null,
|
|
@@ -377,7 +379,7 @@ const o = class o extends n.Component {
|
|
|
377
379
|
), this.mobileMode && this.renderAdaptivePopup())
|
|
378
380
|
);
|
|
379
381
|
return this.props.label ? /* @__PURE__ */ n.createElement(
|
|
380
|
-
|
|
382
|
+
be,
|
|
381
383
|
{
|
|
382
384
|
dateInput: this._dateInput,
|
|
383
385
|
label: this.props.label,
|
|
@@ -472,37 +474,38 @@ o.displayName = "DateTimePicker", o.propTypes = {
|
|
|
472
474
|
size: e.oneOf([null, "small", "medium", "large"]),
|
|
473
475
|
rounded: e.oneOf([null, "small", "medium", "large", "full"]),
|
|
474
476
|
fillMode: e.oneOf([null, "solid", "flat", "outline"]),
|
|
475
|
-
autoFocus: e.bool
|
|
477
|
+
autoFocus: e.bool,
|
|
478
|
+
inputAttributes: e.object
|
|
476
479
|
}, o.defaultProps = {
|
|
477
480
|
defaultShow: !1,
|
|
478
481
|
defaultValue: null,
|
|
479
482
|
disabled: !1,
|
|
480
483
|
format: "g",
|
|
481
484
|
// general date and time pattern (short time): "M/d/y h:mm a" for en.
|
|
482
|
-
max:
|
|
483
|
-
min:
|
|
485
|
+
max: de,
|
|
486
|
+
min: ue,
|
|
484
487
|
popupSettings: {},
|
|
485
488
|
tabIndex: 0,
|
|
486
489
|
weekNumber: !1,
|
|
487
490
|
validityStyles: !0,
|
|
488
491
|
cancelButton: !0,
|
|
489
|
-
dateInput:
|
|
492
|
+
dateInput: re,
|
|
490
493
|
size: "medium",
|
|
491
494
|
rounded: "medium",
|
|
492
495
|
fillMode: "solid",
|
|
493
496
|
autoFocus: !1
|
|
494
497
|
};
|
|
495
498
|
let f = o;
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
499
|
+
const De = ie(), Se = se(
|
|
500
|
+
oe(
|
|
501
|
+
De,
|
|
502
|
+
ae(f)
|
|
500
503
|
)
|
|
501
504
|
);
|
|
502
|
-
|
|
503
|
-
|
|
505
|
+
Se.displayName = "KendoReactDateTimePicker";
|
|
506
|
+
ge(f);
|
|
504
507
|
export {
|
|
505
|
-
|
|
506
|
-
|
|
508
|
+
Se as DateTimePicker,
|
|
509
|
+
De as DateTimePickerPropsContext,
|
|
507
510
|
f as DateTimePickerWithoutContext
|
|
508
511
|
};
|