@progress/kendo-react-dateinputs 9.0.0-develop.9 → 9.0.1-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.
@@ -6,33 +6,33 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
9
+ import * as n from "react";
10
10
  import e from "prop-types";
11
- import { Popup as H } from "@progress/kendo-react-popup";
12
- import { cloneDate as O } from "@progress/kendo-date-math";
13
- import { Keys as d, validatePackage as W, canUseDOM as M, AsyncFocusBlur as X, classNames as I, uDateTimePicker as D, createPropsContext as Z, withIdHOC as G, withPropsContext as J, withUnstyledHOC as Q } from "@progress/kendo-react-common";
14
- import { calendarIcon as Y } from "@progress/kendo-svg-icons";
15
- import { DateInput as $ } from "../dateinput/DateInput.mjs";
16
- import { Button as ee } from "@progress/kendo-react-buttons";
17
- import { packageMetadata as te } from "../package-metadata.mjs";
18
- import { MAX_DATE as ie, MIN_DATE as se, isInDateRange as oe, MAX_TIME as ne, MIN_TIME as ae } from "../utils.mjs";
19
- import { MOBILE_MEDIUM_DEVISE as re } from "../common/constants.mjs";
11
+ import { Popup as Q } from "@progress/kendo-react-popup";
12
+ import { cloneDate as M } from "@progress/kendo-date-math";
13
+ import { Keys as d, validatePackage as $, canUseDOM as O, AsyncFocusBlur as ee, classNames as I, uDateTimePicker as D, createPropsContext as te, withIdHOC as ie, withPropsContext as se, withUnstyledHOC as oe } from "@progress/kendo-react-common";
14
+ import { calendarIcon as ae } from "@progress/kendo-svg-icons";
15
+ import { DateInput as ne } from "../dateinput/DateInput.mjs";
16
+ import { Button as re } from "@progress/kendo-react-buttons";
17
+ import { packageMetadata as le } from "../package-metadata.mjs";
18
+ import { MAX_DATE as he, MIN_DATE as de, isInDateRange as ue, MAX_TIME as pe, MIN_TIME as ce } from "../utils.mjs";
19
+ import { MOBILE_MEDIUM_DEVISE as me } 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 le } from "@progress/kendo-react-intl";
22
- import { DateTimeSelector as he } from "./DateTimeSelector.mjs";
23
- import { isInTimeRange as de } from "../timepicker/utils.mjs";
24
- import { PickerFloatingLabel as ue } from "../hooks/usePickerFloatingLabel.mjs";
25
- import { AdaptiveMode as pe } from "../common/AdaptiveMode.mjs";
26
- import { ActionSheetContent as ce } from "@progress/kendo-react-layout";
27
- const o = class o extends a.Component {
21
+ import { provideLocalizationService as m, registerForLocalization as fe } from "@progress/kendo-react-intl";
22
+ import { DateTimeSelector as ge } from "./DateTimeSelector.mjs";
23
+ import { isInTimeRange as ve } from "../timepicker/utils.mjs";
24
+ import { PickerFloatingLabel as we } from "../hooks/usePickerFloatingLabel.mjs";
25
+ import { AdaptiveMode as be } from "../common/AdaptiveMode.mjs";
26
+ import { ActionSheetContent as ye } from "@progress/kendo-react-layout";
27
+ const o = class o extends n.Component {
28
28
  constructor(t) {
29
- super(t), this._element = null, this._dateInput = a.createRef(), this._dateTimeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
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: n, format: h, calendar: l, cancelButton: r, weekNumber: u, focusedDate: g, unstyled: v } = this.props;
34
- return /* @__PURE__ */ a.createElement(
35
- he,
33
+ const { disabled: i, minTime: s, maxTime: a, format: h, calendar: l, cancelButton: r, weekNumber: u, focusedDate: g, unstyled: v } = this.props;
34
+ return /* @__PURE__ */ n.createElement(
35
+ ge,
36
36
  {
37
37
  ref: (w) => {
38
38
  this._dateTimeSelector = w;
@@ -47,7 +47,7 @@ const o = class o extends a.Component {
47
47
  min: this.min,
48
48
  max: this.max,
49
49
  minTime: s,
50
- maxTime: n,
50
+ maxTime: a,
51
51
  focusedDate: g,
52
52
  format: h,
53
53
  calendar: l,
@@ -60,7 +60,7 @@ const o = class o extends a.Component {
60
60
  const { windowWidth: i = 0 } = this.state, s = m(this).toLanguageString(
61
61
  P,
62
62
  p[P]
63
- ), n = m(this).toLanguageString(
63
+ ), a = m(this).toLanguageString(
64
64
  C,
65
65
  p[C]
66
66
  ), h = {
@@ -74,19 +74,19 @@ const o = class o extends a.Component {
74
74
  var r;
75
75
  return (r = this._dateTimeSelector) == null ? void 0 : r.handleReject(l);
76
76
  },
77
- applyText: n,
77
+ applyText: a,
78
78
  onApply: (l) => {
79
79
  var r;
80
80
  return (r = this._dateTimeSelector) == null ? void 0 : r.handleAccept(l);
81
81
  }
82
82
  }
83
83
  };
84
- return /* @__PURE__ */ a.createElement(pe, { ...h }, /* @__PURE__ */ a.createElement(ce, { overflowHidden: !0 }, this.renderPicker()));
84
+ return /* @__PURE__ */ n.createElement(be, { ...h }, /* @__PURE__ */ n.createElement(ye, { overflowHidden: !0 }, this.renderPicker()));
85
85
  }, this.handleReject = () => {
86
86
  this.shouldFocusDateInput = !0, this.setShow(!1);
87
87
  }, this.handleValueChange = (i) => {
88
88
  this.setState({
89
- value: O(i.value || void 0)
89
+ value: M(i.value || void 0)
90
90
  }), this.valueDuringOnChange = i.value, this.showDuringOnChange = !1, this.mobileMode || (this.shouldFocusDateInput = !0);
91
91
  const { onChange: s } = this.props;
92
92
  s && s.call(void 0, {
@@ -105,13 +105,13 @@ const o = class o extends a.Component {
105
105
  }, this.handleIconMouseDown = (i) => {
106
106
  i.preventDefault();
107
107
  }, this.handleKeyDown = (i) => {
108
- const { altKey: s, keyCode: n } = i;
109
- if (n === d.esc) {
108
+ const { altKey: s, keyCode: a } = i;
109
+ if (a === d.esc) {
110
110
  this.shouldFocusDateInput = !0, this.setShow(!1);
111
111
  return;
112
112
  }
113
- s && (n === d.up || n === d.down) && (i.preventDefault(), i.stopPropagation(), this.shouldFocusDateInput = n === d.up, this.setShow(n === d.down));
114
- }, this.dateInputElement = () => this.dateInput && this.dateInput.element || this.element && this.element.querySelector(".k-dateinput > input.k-input-inner"), W(te), this.state = {
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"), $(le), this.state = {
115
115
  value: this.props.defaultValue || o.defaultProps.defaultValue,
116
116
  show: this.props.defaultShow || o.defaultProps.defaultShow,
117
117
  focused: !1
@@ -121,7 +121,7 @@ const o = class o extends a.Component {
121
121
  return this.props.id + "-popup-id";
122
122
  }
123
123
  get document() {
124
- if (M)
124
+ if (O)
125
125
  return this.element && this.element.ownerDocument || document;
126
126
  }
127
127
  /**
@@ -141,7 +141,7 @@ const o = class o extends a.Component {
141
141
  */
142
142
  get value() {
143
143
  const t = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
144
- return t !== null ? O(t) : null;
144
+ return t !== null ? M(t) : null;
145
145
  }
146
146
  /**
147
147
  * Gets the popup state of the DateTimePicker.
@@ -159,7 +159,7 @@ const o = class o extends a.Component {
159
159
  * The mobile mode of the ComboBox.
160
160
  */
161
161
  get mobileMode() {
162
- return !!(this.state.windowWidth && this.state.windowWidth <= re && this.props.adaptive);
162
+ return !!(this.state.windowWidth && this.state.windowWidth <= me && this.props.adaptive);
163
163
  }
164
164
  get min() {
165
165
  return this.props.min !== void 0 ? this.props.min : o.defaultProps.min;
@@ -171,12 +171,12 @@ const o = class o extends a.Component {
171
171
  * Represents the validity state into which the DateTimePicker is set.
172
172
  */
173
173
  get validity() {
174
- const t = oe(this.value, this.min, this.max) && de(this.value, this.props.minTime || ae, this.props.maxTime || ne), i = this.props.validationMessage !== void 0, s = (!this.required || this.value !== null) && t, n = this.props.valid !== void 0 ? this.props.valid : s;
174
+ const t = ue(this.value, this.min, this.max) && ve(this.value, this.props.minTime || ce, this.props.maxTime || pe), 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,
178
178
  rangeUnderflow: this.value && this.value.getTime() < this.min.getTime() || !1,
179
- valid: n,
179
+ valid: a,
180
180
  valueMissing: this.value === null
181
181
  };
182
182
  }
@@ -203,7 +203,7 @@ const o = class o extends a.Component {
203
203
  */
204
204
  componentDidMount() {
205
205
  var t;
206
- this.observerResize = M && 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);
206
+ this.observerResize = O && 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);
207
207
  }
208
208
  /**
209
209
  * @hidden
@@ -227,7 +227,7 @@ const o = class o extends a.Component {
227
227
  size: t = o.defaultProps.size,
228
228
  rounded: i = o.defaultProps.rounded,
229
229
  fillMode: s = o.defaultProps.fillMode,
230
- autoFocus: n = o.defaultProps.autoFocus,
230
+ autoFocus: a = o.defaultProps.autoFocus,
231
231
  disabled: h,
232
232
  tabIndex: l,
233
233
  title: r,
@@ -246,9 +246,16 @@ const o = class o extends a.Component {
246
246
  maxTime: N,
247
247
  ariaLabelledBy: V,
248
248
  ariaDescribedBy: L,
249
- popup: _ = H,
250
- unstyled: b
251
- } = this.props, y = b && b.uDateTimePicker, S = !this.validityStyles || this.validity.valid, q = {
249
+ popup: _ = Q,
250
+ unstyled: b,
251
+ autoFill: q,
252
+ twoDigitYearMax: K,
253
+ enableMouseWheel: U,
254
+ autoCorrectParts: j,
255
+ autoSwitchParts: H,
256
+ autoSwitchKeys: W,
257
+ allowCaretMode: X
258
+ } = this.props, y = b && b.uDateTimePicker, S = !this.validityStyles || this.validity.valid, Y = {
252
259
  id: u,
253
260
  ariaLabelledBy: V,
254
261
  ariaDescribedBy: L,
@@ -275,20 +282,27 @@ const o = class o extends a.Component {
275
282
  size: null,
276
283
  fillMode: null,
277
284
  rounded: null,
278
- unstyled: b
279
- }, T = /* @__PURE__ */ a.createElement(
280
- X,
285
+ unstyled: b,
286
+ autoFill: q,
287
+ twoDigitYearMax: K,
288
+ enableMouseWheel: U,
289
+ autoCorrectParts: j,
290
+ autoSwitchParts: H,
291
+ autoSwitchKeys: W,
292
+ allowCaretMode: X
293
+ }, T = /* @__PURE__ */ n.createElement(
294
+ ee,
281
295
  {
282
296
  onFocus: this.handleFocus,
283
297
  onBlur: this.handleBlur,
284
298
  onSyncFocus: this.props.onFocus,
285
299
  onSyncBlur: this.props.onBlur
286
300
  },
287
- ({ onFocus: U, onBlur: K }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
301
+ ({ onFocus: Z, onBlur: G }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
288
302
  "div",
289
303
  {
290
- ref: (j) => {
291
- this._element = j;
304
+ ref: (J) => {
305
+ this._element = J;
292
306
  },
293
307
  className: I(
294
308
  D.wrapper({
@@ -304,11 +318,11 @@ const o = class o extends a.Component {
304
318
  ),
305
319
  onKeyDown: this.handleKeyDown,
306
320
  style: { width: k },
307
- onFocus: this.mobileMode ? void 0 : U,
308
- onBlur: K,
321
+ onFocus: this.mobileMode ? void 0 : Z,
322
+ onBlur: G,
309
323
  onClick: this.mobileMode ? this.handleDateIconClick : void 0
310
324
  },
311
- /* @__PURE__ */ a.createElement(
325
+ /* @__PURE__ */ n.createElement(
312
326
  this.dateInputComp,
313
327
  {
314
328
  _ref: this._dateInput,
@@ -316,17 +330,17 @@ const o = class o extends a.Component {
316
330
  ariaControls: this._popupId,
317
331
  ariaHasPopup: "dialog",
318
332
  readonly: this.mobileMode,
319
- autoFocus: n,
320
- ...q
333
+ autoFocus: a,
334
+ ...Y
321
335
  }
322
336
  ),
323
- /* @__PURE__ */ a.createElement(
324
- ee,
337
+ /* @__PURE__ */ n.createElement(
338
+ re,
325
339
  {
326
340
  tabIndex: -1,
327
341
  type: "button",
328
342
  icon: "calendar",
329
- svgIcon: Y,
343
+ svgIcon: ae,
330
344
  onMouseDown: this.handleIconMouseDown,
331
345
  onClick: this.mobileMode ? void 0 : this.handleDateIconClick,
332
346
  title: m(this).toLanguageString(
@@ -342,7 +356,7 @@ const o = class o extends a.Component {
342
356
  )
343
357
  }
344
358
  ),
345
- /* @__PURE__ */ a.createElement(
359
+ /* @__PURE__ */ n.createElement(
346
360
  _,
347
361
  {
348
362
  show: this.show,
@@ -363,8 +377,8 @@ const o = class o extends a.Component {
363
377
  )
364
378
  ), this.mobileMode && this.renderAdaptivePopup())
365
379
  );
366
- return this.props.label ? /* @__PURE__ */ a.createElement(
367
- ue,
380
+ return this.props.label ? /* @__PURE__ */ n.createElement(
381
+ we,
368
382
  {
369
383
  dateInput: this._dateInput,
370
384
  label: this.props.label,
@@ -466,30 +480,30 @@ o.displayName = "DateTimePicker", o.propTypes = {
466
480
  disabled: !1,
467
481
  format: "g",
468
482
  // general date and time pattern (short time): "M/d/y h:mm a" for en.
469
- max: ie,
470
- min: se,
483
+ max: he,
484
+ min: de,
471
485
  popupSettings: {},
472
486
  tabIndex: 0,
473
487
  weekNumber: !1,
474
488
  validityStyles: !0,
475
489
  cancelButton: !0,
476
- dateInput: $,
490
+ dateInput: ne,
477
491
  size: "medium",
478
492
  rounded: "medium",
479
493
  fillMode: "solid",
480
494
  autoFocus: !1
481
495
  };
482
496
  let f = o;
483
- const me = Z(), fe = G(
484
- J(
485
- me,
486
- Q(f)
497
+ const Ie = te(), De = ie(
498
+ se(
499
+ Ie,
500
+ oe(f)
487
501
  )
488
502
  );
489
- fe.displayName = "KendoReactDateTimePicker";
490
- le(f);
503
+ De.displayName = "KendoReactDateTimePicker";
504
+ fe(f);
491
505
  export {
492
- fe as DateTimePicker,
493
- me as DateTimePickerPropsContext,
506
+ De as DateTimePicker,
507
+ Ie as DateTimePickerPropsContext,
494
508
  f as DateTimePickerWithoutContext
495
509
  };