@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.
@@ -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 Q } from "@progress/kendo-react-popup";
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 $, 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";
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 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";
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: u, focusedDate: g, unstyled: v } = this.props;
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
- ge,
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: u,
46
+ weekNumber: g,
47
47
  min: this.min,
48
48
  max: this.max,
49
49
  minTime: s,
50
50
  maxTime: a,
51
- focusedDate: g,
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(be, { ...h }, /* @__PURE__ */ n.createElement(ye, { overflowHidden: !0 }, this.renderPicker()));
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"), $(le), this.state = {
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 <= me && this.props.adaptive);
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 = 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;
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
- disabled: h,
232
- tabIndex: l,
233
- title: r,
231
+ inputAttributes: h,
232
+ disabled: l,
233
+ tabIndex: r,
234
+ title: g,
234
235
  id: u,
235
- format: g,
236
- formatPlaceholder: v,
237
- min: w,
238
- max: x,
239
- className: E,
240
- width: k,
241
- name: F,
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: A,
246
- maxTime: N,
247
- ariaLabelledBy: V,
248
- ariaDescribedBy: L,
249
- popup: _ = Q,
246
+ minTime: N,
247
+ maxTime: V,
248
+ ariaLabelledBy: L,
249
+ ariaDescribedBy: _,
250
+ popup: q = $,
250
251
  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
+ 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: V,
261
- ariaDescribedBy: L,
262
- format: g,
263
- formatPlaceholder: v,
264
- disabled: h,
265
- title: r,
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: w,
270
- max: x,
271
- minTime: A,
272
- maxTime: N,
273
- name: F,
274
- tabIndex: this.show ? -1 : l,
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: q,
287
- twoDigitYearMax: K,
288
- enableMouseWheel: U,
289
- autoCorrectParts: j,
290
- autoSwitchParts: H,
291
- autoSwitchKeys: W,
292
- allowCaretMode: X
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
- ee,
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: Z, onBlur: G }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
302
+ ({ onFocus: G, onBlur: J }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
302
303
  "div",
303
304
  {
304
- ref: (J) => {
305
- this._element = J;
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: h,
314
+ disabled: l,
314
315
  required: this.required,
315
316
  invalid: !S
316
317
  }),
317
- E
318
+ k
318
319
  ),
319
320
  onKeyDown: this.handleKeyDown,
320
- style: { width: k },
321
- onFocus: this.mobileMode ? void 0 : Z,
322
- onBlur: G,
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
- ...Y
334
+ inputAttributes: h,
335
+ ...Z
334
336
  }
335
337
  ),
336
338
  /* @__PURE__ */ n.createElement(
337
- re,
339
+ le,
338
340
  {
339
341
  tabIndex: -1,
340
342
  type: "button",
341
343
  icon: "calendar",
342
- svgIcon: ae,
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
- we,
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: he,
483
- min: de,
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: ne,
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 Ie = te(), De = ie(
497
- se(
498
- Ie,
499
- oe(f)
499
+ const De = ie(), Se = se(
500
+ oe(
501
+ De,
502
+ ae(f)
500
503
  )
501
504
  );
502
- De.displayName = "KendoReactDateTimePicker";
503
- fe(f);
505
+ Se.displayName = "KendoReactDateTimePicker";
506
+ ge(f);
504
507
  export {
505
- De as DateTimePicker,
506
- Ie as DateTimePickerPropsContext,
508
+ Se as DateTimePicker,
509
+ De as DateTimePickerPropsContext,
507
510
  f as DateTimePickerWithoutContext
508
511
  };