@progress/kendo-react-dateinputs 8.2.0-develop.1 → 8.2.0-develop.10

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.
@@ -8,22 +8,22 @@
8
8
  "use client";
9
9
  import * as a from "react";
10
10
  import e from "prop-types";
11
- import { Popup as _ } from "@progress/kendo-react-popup";
11
+ import { Popup as K } from "@progress/kendo-react-popup";
12
12
  import { cloneDate as I } from "@progress/kendo-date-math";
13
- import { Keys as h, validatePackage as K, canUseDOM as y, AsyncFocusBlur as U, classNames as j, kendoThemeMaps as D, createPropsContext as $, withIdHOC as W, withPropsContext as X } from "@progress/kendo-react-common";
14
- import { calendarIcon as H } from "@progress/kendo-svg-icons";
15
- import { DateInput as Z } from "../dateinput/DateInput.mjs";
16
- import { Button as G } from "@progress/kendo-react-buttons";
17
- import { packageMetadata as J } from "../package-metadata.mjs";
18
- import { MAX_DATE as Q, MIN_DATE as Y, isInDateRange as ee, MAX_TIME as te, MIN_TIME as ie } from "../utils.mjs";
19
- import { MOBILE_MEDIUM_DEVISE as se } from "../common/constants.mjs";
20
- import { dateTimePickerCancel as S, messages as u, dateTimePickerSet as T, toggleDateTimeSelector as p } from "../messages/index.mjs";
21
- import { provideLocalizationService as m, registerForLocalization as oe } from "@progress/kendo-react-intl";
22
- import { DateTimeSelector as ne } from "./DateTimeSelector.mjs";
23
- import { isInTimeRange as ae } from "../timepicker/utils.mjs";
24
- import { PickerFloatingLabel as re } from "../hooks/usePickerFloatingLabel.mjs";
25
- import { AdaptiveMode as le } from "../common/AdaptiveMode.mjs";
26
- import { ActionSheetContent as de } from "@progress/kendo-react-layout";
13
+ import { Keys as h, validatePackage as U, canUseDOM as y, AsyncFocusBlur as j, classNames as $, kendoThemeMaps as D, createPropsContext as W, withIdHOC as X, withPropsContext as H } from "@progress/kendo-react-common";
14
+ import { calendarIcon as Z } from "@progress/kendo-svg-icons";
15
+ import { DateInput as G } from "../dateinput/DateInput.mjs";
16
+ import { Button as J } from "@progress/kendo-react-buttons";
17
+ import { packageMetadata as Q } from "../package-metadata.mjs";
18
+ import { MAX_DATE as Y, MIN_DATE as ee, isInDateRange as te, MAX_TIME as ie, MIN_TIME as se } from "../utils.mjs";
19
+ import { MOBILE_MEDIUM_DEVISE as oe } from "../common/constants.mjs";
20
+ import { dateTimePickerCancel as S, messages as p, dateTimePickerSet as T, toggleDateTimeSelector as m } from "../messages/index.mjs";
21
+ import { provideLocalizationService as c, registerForLocalization as ne } from "@progress/kendo-react-intl";
22
+ import { DateTimeSelector as ae } from "./DateTimeSelector.mjs";
23
+ import { isInTimeRange as re } from "../timepicker/utils.mjs";
24
+ import { PickerFloatingLabel as le } from "../hooks/usePickerFloatingLabel.mjs";
25
+ import { AdaptiveMode as de } from "../common/AdaptiveMode.mjs";
26
+ import { ActionSheetContent as he } from "@progress/kendo-react-layout";
27
27
  const o = class o extends a.Component {
28
28
  constructor(t) {
29
29
  super(t), this._element = null, this._dateInput = a.createRef(), this._dateTimeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
@@ -37,11 +37,11 @@ const o = class o extends a.Component {
37
37
  format: d,
38
38
  calendar: l,
39
39
  cancelButton: r,
40
- weekNumber: f,
40
+ weekNumber: u,
41
41
  focusedDate: g
42
42
  } = this.props;
43
43
  return /* @__PURE__ */ a.createElement(
44
- ne,
44
+ ae,
45
45
  {
46
46
  ref: (v) => {
47
47
  this._dateTimeSelector = v;
@@ -52,7 +52,7 @@ const o = class o extends a.Component {
52
52
  onChange: this.handleValueChange,
53
53
  onReject: this.handleReject,
54
54
  disabled: i,
55
- weekNumber: f,
55
+ weekNumber: u,
56
56
  min: this.min,
57
57
  max: this.max,
58
58
  minTime: s,
@@ -65,7 +65,7 @@ const o = class o extends a.Component {
65
65
  }
66
66
  );
67
67
  }, this.renderAdaptivePopup = () => {
68
- const { windowWidth: i = 0 } = this.state, s = m(this).toLanguageString(S, u[S]), n = m(this).toLanguageString(T, u[T]), d = {
68
+ const { windowWidth: i = 0 } = this.state, s = c(this).toLanguageString(S, p[S]), n = c(this).toLanguageString(T, p[T]), d = {
69
69
  expand: this.show,
70
70
  onClose: this.handleBlur,
71
71
  adaptiveTitle: this.props.adaptiveTitle,
@@ -83,7 +83,7 @@ const o = class o extends a.Component {
83
83
  }
84
84
  }
85
85
  };
86
- return /* @__PURE__ */ a.createElement(le, { ...d }, /* @__PURE__ */ a.createElement(de, { className: "!k-overflow-hidden" }, this.renderPicker()));
86
+ return /* @__PURE__ */ a.createElement(de, { ...d }, /* @__PURE__ */ a.createElement(he, { className: "!k-overflow-hidden" }, this.renderPicker()));
87
87
  }, this.handleReject = () => {
88
88
  this.shouldFocusDateInput = !0, this.setShow(!1);
89
89
  }, this.handleValueChange = (i) => {
@@ -113,7 +113,7 @@ const o = class o extends a.Component {
113
113
  return;
114
114
  }
115
115
  s && (n === h.up || n === h.down) && (i.preventDefault(), i.stopPropagation(), this.shouldFocusDateInput = n === h.up, this.setShow(n === h.down));
116
- }, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"), K(J), this.state = {
116
+ }, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"), U(Q), this.state = {
117
117
  value: this.props.defaultValue || o.defaultProps.defaultValue,
118
118
  show: this.props.defaultShow || o.defaultProps.defaultShow,
119
119
  focused: !1
@@ -161,7 +161,7 @@ const o = class o extends a.Component {
161
161
  * The mobile mode of the ComboBox.
162
162
  */
163
163
  get mobileMode() {
164
- return !!(this.state.windowWidth && this.state.windowWidth <= se && this.props.adaptive);
164
+ return !!(this.state.windowWidth && this.state.windowWidth <= oe && this.props.adaptive);
165
165
  }
166
166
  get min() {
167
167
  return this.props.min !== void 0 ? this.props.min : o.defaultProps.min;
@@ -173,7 +173,7 @@ const o = class o extends a.Component {
173
173
  * Represents the validity state into which the DateTimePicker is set.
174
174
  */
175
175
  get validity() {
176
- const t = ee(this.value, this.min, this.max) && ae(this.value, this.props.minTime || ie, this.props.maxTime || te), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, n = this.props.valid !== void 0 ? this.props.valid : s;
176
+ const t = te(this.value, this.min, this.max) && re(this.value, this.props.minTime || se, this.props.maxTime || ie), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, n = this.props.valid !== void 0 ? this.props.valid : s;
177
177
  return {
178
178
  customError: i,
179
179
  rangeOverflow: this.value && this.max.getTime() < this.value.getTime() || !1,
@@ -229,42 +229,43 @@ const o = class o extends a.Component {
229
229
  size: t = o.defaultProps.size,
230
230
  rounded: i = o.defaultProps.rounded,
231
231
  fillMode: s = o.defaultProps.fillMode,
232
- disabled: n,
233
- tabIndex: d,
234
- title: l,
235
- id: r,
236
- format: f,
237
- formatPlaceholder: g,
238
- min: v,
239
- max: M,
240
- className: k,
241
- width: O,
242
- name: P,
243
- validationMessage: C,
244
- required: x,
245
- validityStyles: E,
246
- minTime: F,
247
- maxTime: R,
248
- ariaLabelledBy: z,
249
- ariaDescribedBy: A,
250
- popup: B = _
251
- } = this.props, w = !this.validityStyles || this.validity.valid, N = {
252
- id: r,
253
- ariaLabelledBy: z,
254
- ariaDescribedBy: A,
255
- format: f,
256
- formatPlaceholder: g,
257
- disabled: n,
258
- title: l,
259
- validityStyles: E,
260
- validationMessage: C,
261
- required: x,
262
- min: v,
263
- max: M,
264
- minTime: F,
265
- maxTime: R,
266
- name: P,
267
- tabIndex: this.show ? -1 : d,
232
+ autoFocus: n = o.defaultProps.autoFocus,
233
+ disabled: d,
234
+ tabIndex: l,
235
+ title: r,
236
+ id: u,
237
+ format: g,
238
+ formatPlaceholder: v,
239
+ min: M,
240
+ max: k,
241
+ className: O,
242
+ width: P,
243
+ name: C,
244
+ validationMessage: x,
245
+ required: E,
246
+ validityStyles: F,
247
+ minTime: R,
248
+ maxTime: z,
249
+ ariaLabelledBy: A,
250
+ ariaDescribedBy: B,
251
+ popup: N = K
252
+ } = this.props, w = !this.validityStyles || this.validity.valid, q = {
253
+ id: u,
254
+ ariaLabelledBy: A,
255
+ ariaDescribedBy: B,
256
+ format: g,
257
+ formatPlaceholder: v,
258
+ disabled: d,
259
+ title: r,
260
+ validityStyles: F,
261
+ validationMessage: x,
262
+ required: E,
263
+ min: M,
264
+ max: k,
265
+ minTime: R,
266
+ maxTime: z,
267
+ name: C,
268
+ tabIndex: this.show ? -1 : l,
268
269
  valid: this.validity.valid,
269
270
  value: this.value,
270
271
  onChange: this.handleValueChange,
@@ -276,20 +277,20 @@ const o = class o extends a.Component {
276
277
  fillMode: null,
277
278
  rounded: null
278
279
  }, b = /* @__PURE__ */ a.createElement(
279
- U,
280
+ j,
280
281
  {
281
282
  onFocus: this.handleFocus,
282
283
  onBlur: this.handleBlur,
283
284
  onSyncFocus: this.props.onFocus,
284
285
  onSyncBlur: this.props.onBlur
285
286
  },
286
- ({ onFocus: q, onBlur: V }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
287
+ ({ onFocus: V, onBlur: L }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
287
288
  "div",
288
289
  {
289
- ref: (L) => {
290
- this._element = L;
290
+ ref: (_) => {
291
+ this._element = _;
291
292
  },
292
- className: j(
293
+ className: $(
293
294
  "k-input",
294
295
  "k-datetimepicker",
295
296
  {
@@ -300,12 +301,12 @@ const o = class o extends a.Component {
300
301
  "k-required": this.required,
301
302
  "k-disabled": this.props.disabled
302
303
  },
303
- k
304
+ O
304
305
  ),
305
306
  onKeyDown: this.handleKeyDown,
306
- style: { width: O },
307
- onFocus: this.mobileMode ? void 0 : q,
308
- onBlur: V,
307
+ style: { width: P },
308
+ onFocus: this.mobileMode ? void 0 : V,
309
+ onBlur: L,
309
310
  onClick: this.mobileMode ? this.handleDateIconClick : void 0
310
311
  },
311
312
  /* @__PURE__ */ a.createElement(
@@ -315,27 +316,28 @@ const o = class o extends a.Component {
315
316
  ariaRole: "combobox",
316
317
  ariaControls: this._popupId,
317
318
  readonly: this.mobileMode,
318
- ...N
319
+ autoFocus: n,
320
+ ...q
319
321
  }
320
322
  ),
321
323
  /* @__PURE__ */ a.createElement(
322
- G,
324
+ J,
323
325
  {
324
326
  tabIndex: -1,
325
327
  type: "button",
326
328
  icon: "calendar",
327
- svgIcon: H,
329
+ svgIcon: Z,
328
330
  onMouseDown: this.handleIconMouseDown,
329
331
  onClick: this.mobileMode ? void 0 : this.handleDateIconClick,
330
- title: m(this).toLanguageString(p, u[p]),
332
+ title: c(this).toLanguageString(m, p[m]),
331
333
  className: "k-input-button",
332
334
  rounded: null,
333
335
  fillMode: s,
334
- "aria-label": m(this).toLanguageString(p, u[p])
336
+ "aria-label": c(this).toLanguageString(m, p[m])
335
337
  }
336
338
  ),
337
339
  /* @__PURE__ */ a.createElement(
338
- B,
340
+ N,
339
341
  {
340
342
  show: this.show,
341
343
  animate: this.element !== null,
@@ -356,11 +358,11 @@ const o = class o extends a.Component {
356
358
  ), this.mobileMode && this.renderAdaptivePopup())
357
359
  );
358
360
  return this.props.label ? /* @__PURE__ */ a.createElement(
359
- re,
361
+ le,
360
362
  {
361
363
  dateInput: this._dateInput,
362
364
  label: this.props.label,
363
- editorId: r,
365
+ editorId: u,
364
366
  editorValid: w,
365
367
  editorDisabled: this.props.disabled,
366
368
  children: b,
@@ -445,32 +447,34 @@ o.displayName = "DateTimePicker", o.propTypes = {
445
447
  cancelButton: e.bool,
446
448
  size: e.oneOf([null, "small", "medium", "large"]),
447
449
  rounded: e.oneOf([null, "small", "medium", "large", "full"]),
448
- fillMode: e.oneOf([null, "solid", "flat", "outline"])
450
+ fillMode: e.oneOf([null, "solid", "flat", "outline"]),
451
+ autoFocus: e.bool
449
452
  }, o.defaultProps = {
450
453
  defaultShow: !1,
451
454
  defaultValue: null,
452
455
  disabled: !1,
453
456
  format: "g",
454
457
  // general date and time pattern (short time): "M/d/y h:mm a" for en.
455
- max: Q,
456
- min: Y,
458
+ max: Y,
459
+ min: ee,
457
460
  popupSettings: {},
458
461
  tabIndex: 0,
459
462
  weekNumber: !1,
460
463
  required: !1,
461
464
  validityStyles: !0,
462
465
  cancelButton: !0,
463
- dateInput: Z,
466
+ dateInput: G,
464
467
  size: "medium",
465
468
  rounded: "medium",
466
- fillMode: "solid"
469
+ fillMode: "solid",
470
+ autoFocus: !1
467
471
  };
468
- let c = o;
469
- const he = $(), ue = W(X(he, c));
470
- ue.displayName = "KendoReactDateTimePicker";
471
- oe(c);
472
+ let f = o;
473
+ const ue = W(), pe = X(H(ue, f));
474
+ pe.displayName = "KendoReactDateTimePicker";
475
+ ne(f);
472
476
  export {
473
- ue as DateTimePicker,
474
- he as DateTimePickerPropsContext,
475
- c as DateTimePickerWithoutContext
477
+ pe as DateTimePicker,
478
+ ue as DateTimePickerPropsContext,
479
+ f as DateTimePickerWithoutContext
476
480
  };