@progress/kendo-react-dateinputs 15.1.1-develop.3 → 15.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.
@@ -7,20 +7,20 @@
7
7
  */
8
8
  import * as n from "react";
9
9
  import e from "prop-types";
10
- import { Popup as ie } from "@progress/kendo-react-popup";
10
+ import { Popup as ee } from "@progress/kendo-react-popup";
11
11
  import { cloneDate as P } from "@progress/kendo-date-math";
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";
12
+ import { createPropsContext as te, Keys as d, canUseDOM as C, subscribeToKendoPaste as ie, AsyncFocusBlur as se, classNames as S, uDateTimePicker as I, withIdHOC as oe, withPropsContext as ae, withUnstyledHOC as ne, withAdaptiveModeContext as re } from "@progress/kendo-react-common";
13
+ import { calendarIcon as le } from "@progress/kendo-svg-icons";
14
+ import { DateInputInner as he } from "../dateinput/DateInput.mjs";
15
+ import { Button as de } from "@progress/kendo-react-buttons";
16
+ import { isInDateRange as M, MIN_DATE as ue, MAX_DATE as pe, MAX_TIME as ce, MIN_TIME as me } from "../utils.mjs";
17
+ import { dateTimePickerCancel as O, messages as p, dateTimePickerSet as x, toggleDateTimeSelector as c } from "../messages/index.mjs";
18
+ import { provideLocalizationService as m, registerForLocalization as fe } from "@progress/kendo-react-intl";
19
+ import { DateTimeSelector as ge } from "./DateTimeSelector.mjs";
20
+ import { isInTimeRange as ve } from "../timepicker/utils.mjs";
21
+ import { PickerFloatingLabel as be } from "../hooks/usePickerFloatingLabel.mjs";
22
+ import { AdaptiveMode as we } from "../common/AdaptiveMode.mjs";
23
+ import { ActionSheetContent as ye } 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,9 +50,9 @@ 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: c, unstyled: v } = this.props;
53
+ const { disabled: t, minTime: s, maxTime: o, format: h, calendar: l, cancelButton: r, weekNumber: g, focusedDate: u, unstyled: v } = this.props;
54
54
  return /* @__PURE__ */ n.createElement(
55
- be,
55
+ ge,
56
56
  {
57
57
  ref: (b) => {
58
58
  this._dateTimeSelector = b;
@@ -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: c,
71
+ focusedDate: u,
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 = p(this).toLanguageString(
80
+ const { windowWidth: t = 0 } = this.state, s = m(this).toLanguageString(
81
81
  O,
82
- u[O]
83
- ), o = p(this).toLanguageString(
82
+ p[O]
83
+ ), o = m(this).toLanguageString(
84
84
  x,
85
- u[x]
85
+ p[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(Se, { ...h }, /* @__PURE__ */ n.createElement(Te, null, this.renderPicker()));
105
+ return /* @__PURE__ */ n.createElement(we, { ...h }, /* @__PURE__ */ n.createElement(ye, 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) && 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;
196
+ const i = M(this.value, this.min, this.max) && ve(this.value, this.props.minTime || me, this.props.maxTime || ce), 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 = oe(this._element, {
230
+ this.KendoPasteSubscription = ie(this._element, {
231
231
  fieldName: i,
232
232
  onValueChange: (s) => {
233
233
  this.handleSmartPasteValue(s);
@@ -263,50 +263,47 @@ const a = class a extends n.Component {
263
263
  disabled: l,
264
264
  tabIndex: r,
265
265
  title: g,
266
- id: c,
266
+ id: u,
267
267
  format: v,
268
268
  formatPlaceholder: b,
269
- min: E,
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
- ariaLabelledBy: V,
280
- ariaDescribedBy: q,
281
- popup: U = ie,
269
+ min: k,
270
+ max: E,
271
+ className: F,
272
+ width: A,
273
+ name: N,
274
+ validationMessage: R,
275
+ required: B,
276
+ validityStyles: z,
277
+ minTime: _,
278
+ maxTime: K,
279
+ ariaLabelledBy: L,
280
+ ariaDescribedBy: V,
281
+ popup: q = ee,
282
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,
295
- ariaLabelledBy: V,
296
- ariaDescribedBy: q,
297
- ariaLabel: J,
283
+ autoFill: U,
284
+ twoDigitYearMax: j,
285
+ enableMouseWheel: H,
286
+ autoCorrectParts: W,
287
+ autoSwitchParts: X,
288
+ autoSwitchKeys: Y,
289
+ allowCaretMode: Z
290
+ } = this.props, y = w && w.uDateTimePicker, T = !this.validityStyles || this.validity.valid, G = {
291
+ id: u,
292
+ ariaLabelledBy: L,
293
+ ariaDescribedBy: V,
294
+ ariaLabel: this.props.ariaLabel,
298
295
  format: v,
299
296
  formatPlaceholder: b,
300
297
  disabled: l,
301
298
  title: g,
302
- validityStyles: _,
303
- validationMessage: B,
304
- required: z,
305
- min: E,
306
- max: F,
307
- minTime: K,
308
- maxTime: L,
309
- name: R,
299
+ validityStyles: z,
300
+ validationMessage: R,
301
+ required: B,
302
+ min: k,
303
+ max: E,
304
+ minTime: _,
305
+ maxTime: K,
306
+ name: N,
310
307
  tabIndex: this.show ? -1 : r,
311
308
  valid: this.validity.valid,
312
309
  value: this.value,
@@ -316,44 +313,44 @@ const a = class a extends n.Component {
316
313
  placeholder: this.state.focused ? null : this.props.placeholder,
317
314
  ariaExpanded: this.show,
318
315
  unstyled: w,
319
- autoFill: j,
320
- twoDigitYearMax: H,
321
- enableMouseWheel: W,
322
- autoCorrectParts: X,
323
- autoSwitchParts: Y,
324
- autoSwitchKeys: Z,
325
- allowCaretMode: G
326
- }, I = /* @__PURE__ */ n.createElement(
327
- ae,
316
+ autoFill: U,
317
+ twoDigitYearMax: j,
318
+ enableMouseWheel: H,
319
+ autoCorrectParts: W,
320
+ autoSwitchParts: X,
321
+ autoSwitchKeys: Y,
322
+ allowCaretMode: Z
323
+ }, D = /* @__PURE__ */ n.createElement(
324
+ se,
328
325
  {
329
326
  onFocus: this.handleFocus,
330
327
  onBlur: this.handleBlur,
331
328
  onSyncFocus: this.props.onFocus,
332
329
  onSyncBlur: this.props.onBlur
333
330
  },
334
- ({ onFocus: $, onBlur: ee }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
331
+ ({ onFocus: J, onBlur: Q }) => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
335
332
  "div",
336
333
  {
337
- ref: (te) => {
338
- this._element = te;
334
+ ref: ($) => {
335
+ this._element = $;
339
336
  },
340
337
  className: S(
341
- T.wrapper({
338
+ I.wrapper({
342
339
  c: y,
343
340
  size: i,
344
341
  fillMode: s,
345
342
  rounded: t,
346
343
  disabled: l,
347
344
  required: this.required,
348
- invalid: !D
345
+ invalid: !T
349
346
  }),
350
347
  { "k-focus": this.state.focused },
351
- A
348
+ F
352
349
  ),
353
350
  onKeyDown: this.handleKeyDown,
354
- style: { width: N },
355
- onFocus: this.mobileMode ? this.handleClick : $,
356
- onBlur: ee,
351
+ style: { width: A },
352
+ onFocus: this.mobileMode ? this.handleClick : J,
353
+ onBlur: Q,
357
354
  onClick: this.mobileMode ? this.handleClick : void 0
358
355
  },
359
356
  /* @__PURE__ */ n.createElement(
@@ -365,37 +362,37 @@ const a = class a extends n.Component {
365
362
  ariaHasPopup: "dialog",
366
363
  autoFocus: o,
367
364
  inputAttributes: h,
368
- ...Q
365
+ ...G
369
366
  }
370
367
  ),
371
368
  /* @__PURE__ */ n.createElement(
372
- pe,
369
+ de,
373
370
  {
374
371
  tabIndex: -1,
375
372
  type: "button",
376
373
  icon: "calendar",
377
- svgIcon: de,
374
+ svgIcon: le,
378
375
  onMouseDown: this.handleIconMouseDown,
379
376
  onClick: this.mobileMode ? void 0 : this.handleClick,
380
- title: p(this).toLanguageString(
381
- m,
382
- u[m]
377
+ title: m(this).toLanguageString(
378
+ c,
379
+ p[c]
383
380
  ),
384
- className: S(T.inputButton({ c: y })),
381
+ className: S(I.inputButton({ c: y })),
385
382
  fillMode: s,
386
- "aria-label": p(this).toLanguageString(
387
- m,
388
- u[m]
383
+ "aria-label": m(this).toLanguageString(
384
+ c,
385
+ p[c]
389
386
  )
390
387
  }
391
388
  ),
392
389
  /* @__PURE__ */ n.createElement(
393
- U,
390
+ q,
394
391
  {
395
392
  show: this.show,
396
393
  animate: this.element !== null,
397
394
  anchor: this.element,
398
- popupClass: S(T.popup({ c: y })),
395
+ popupClass: S(I.popup({ c: y })),
399
396
  id: this._popupId,
400
397
  anchorAlign: {
401
398
  horizontal: "left",
@@ -411,17 +408,17 @@ const a = class a extends n.Component {
411
408
  ), this.mobileMode && this.renderAdaptivePopup())
412
409
  );
413
410
  return this.props.label ? /* @__PURE__ */ n.createElement(
414
- ye,
411
+ be,
415
412
  {
416
413
  dateInput: this._dateInput,
417
414
  label: this.props.label,
418
- editorId: c,
419
- editorValid: D,
415
+ editorId: u,
416
+ editorValid: T,
420
417
  editorDisabled: this.props.disabled,
421
- children: I,
418
+ children: D,
422
419
  style: { width: this.props.width }
423
420
  }
424
- ) : I;
421
+ ) : D;
425
422
  }
426
423
  setShow(i) {
427
424
  const { onOpen: t, onClose: s } = this.props;
@@ -483,6 +480,7 @@ a.displayName = "DateTimePicker", a.propTypes = {
483
480
  ]),
484
481
  id: e.string,
485
482
  ariaLabelledBy: e.string,
483
+ ariaLabel: e.string,
486
484
  ariaDescribedBy: e.string,
487
485
  min: e.instanceOf(Date),
488
486
  max: e.instanceOf(Date),
@@ -515,32 +513,32 @@ a.displayName = "DateTimePicker", a.propTypes = {
515
513
  disabled: !1,
516
514
  format: "g",
517
515
  // general date and time pattern (short time): "M/d/y h:mm a" for en.
518
- max: me,
519
- min: ce,
516
+ max: pe,
517
+ min: ue,
520
518
  popupSettings: {},
521
519
  tabIndex: 0,
522
520
  weekNumber: !1,
523
521
  validityStyles: !0,
524
522
  cancelButton: !0,
525
- dateInput: ue,
523
+ dateInput: he,
526
524
  size: void 0,
527
525
  rounded: void 0,
528
526
  fillMode: void 0,
529
527
  autoFocus: !1
530
528
  };
531
529
  let f = a;
532
- const De = se(), Ie = ne(
533
- re(
534
- De,
535
- le(
536
- he(f)
530
+ const Se = te(), Ie = oe(
531
+ ae(
532
+ Se,
533
+ ne(
534
+ re(f)
537
535
  )
538
536
  )
539
537
  );
540
538
  Ie.displayName = "KendoReactDateTimePicker";
541
- ve(f);
539
+ fe(f);
542
540
  export {
543
541
  Ie as DateTimePicker,
544
- De as DateTimePickerPropsContext,
542
+ Se as DateTimePickerPropsContext,
545
543
  f as DateTimePickerWithoutContext
546
544
  };
@@ -91,6 +91,13 @@ export interface DateTimePickerSettings {
91
91
  * This property is related to accessibility.
92
92
  */
93
93
  ariaLabelledBy?: string;
94
+ /**
95
+ * The accessible label of the component.
96
+ *
97
+ * @remarks
98
+ * This property is related to accessibility.
99
+ */
100
+ ariaLabel?: string;
94
101
  /**
95
102
  * Specifies the greatest valid date
96
103
  * ([see example](https://www.telerik.com/kendo-react-ui/components/dateinputs/datetimepicker/date-ranges)).