@progress/kendo-react-dateinputs 8.3.0-develop.5 → 8.3.0-develop.7

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.
Files changed (49) hide show
  1. package/calendar/components/Calendar.js +2 -2
  2. package/calendar/components/Calendar.mjs +123 -115
  3. package/calendar/components/CalendarCell.js +1 -1
  4. package/calendar/components/CalendarCell.mjs +37 -39
  5. package/calendar/components/CalendarHeaderTitle.js +1 -1
  6. package/calendar/components/CalendarHeaderTitle.mjs +6 -12
  7. package/calendar/components/CalendarNavigationItem.js +1 -1
  8. package/calendar/components/CalendarNavigationItem.mjs +15 -19
  9. package/calendar/components/CalendarWeekCell.js +1 -1
  10. package/calendar/components/CalendarWeekCell.mjs +10 -15
  11. package/calendar/components/Header.js +1 -1
  12. package/calendar/components/Header.mjs +30 -40
  13. package/calendar/components/Navigation.js +1 -1
  14. package/calendar/components/Navigation.mjs +52 -49
  15. package/calendar/components/TodayCommand.js +1 -1
  16. package/calendar/components/TodayCommand.mjs +21 -25
  17. package/calendar/components/View.js +1 -1
  18. package/calendar/components/View.mjs +48 -42
  19. package/calendar/components/ViewList.js +1 -1
  20. package/calendar/components/ViewList.mjs +99 -94
  21. package/common/ClearButton.js +1 -1
  22. package/common/ClearButton.mjs +25 -31
  23. package/dateinput/DateInput.js +1 -1
  24. package/dateinput/DateInput.mjs +113 -110
  25. package/dateinput/utils.js +1 -1
  26. package/dateinput/utils.mjs +22 -23
  27. package/datepicker/DatePicker.js +1 -1
  28. package/datepicker/DatePicker.mjs +9 -9
  29. package/daterangepicker/DateRangePicker.js +1 -1
  30. package/daterangepicker/DateRangePicker.mjs +5 -5
  31. package/datetimepicker/DateTimePicker.js +1 -1
  32. package/datetimepicker/DateTimePicker.mjs +95 -90
  33. package/datetimepicker/DateTimeSelector.js +1 -1
  34. package/datetimepicker/DateTimeSelector.mjs +83 -81
  35. package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
  36. package/index.d.mts +38 -28
  37. package/index.d.ts +38 -28
  38. package/package-metadata.mjs +1 -1
  39. package/package.json +7 -7
  40. package/timepicker/TimeList.js +3 -3
  41. package/timepicker/TimeList.mjs +83 -81
  42. package/timepicker/TimePart.js +1 -1
  43. package/timepicker/TimePart.mjs +74 -68
  44. package/timepicker/TimePicker.js +1 -1
  45. package/timepicker/TimePicker.mjs +112 -107
  46. package/timepicker/TimeSelector.js +1 -1
  47. package/timepicker/TimeSelector.mjs +66 -59
  48. package/virtualization/Virtualization.js +1 -1
  49. package/virtualization/Virtualization.mjs +49 -48
@@ -8,59 +8,59 @@
8
8
  "use client";
9
9
  import * as a from "react";
10
10
  import e from "prop-types";
11
- import { Popup as q } from "@progress/kendo-react-popup";
12
- import { cloneDate as f } from "@progress/kendo-date-math";
13
- import { classNames as v, Keys as d, validatePackage as _, canUseDOM as w, AsyncFocusBlur as K, kendoThemeMaps as b, createPropsContext as U, withIdHOC as j, withPropsContext as H } from "@progress/kendo-react-common";
14
- import { clockIcon as $ } from "@progress/kendo-svg-icons";
15
- import { provideLocalizationService as W, registerForLocalization as G } from "@progress/kendo-react-intl";
16
- import { packageMetadata as X } from "../package-metadata.mjs";
17
- import { toggleClock as m, messages as u, timePickerCancel as Z, timePickerSet as S, toggleTimeSelector as y } from "../messages/index.mjs";
18
- import { DateInput as J } from "../dateinput/DateInput.mjs";
19
- import { TimeSelector as Q } from "./TimeSelector.mjs";
20
- import { MAX_TIME as Y, MIN_TIME as ee, setTime as I, MIDNIGHT_DATE as te } from "../utils.mjs";
21
- import { isInRange as ie, isBiggerThanMax as se, isSmallerThanMin as oe } from "./utils.mjs";
22
- import { PickerFloatingLabel as ne } from "../hooks/usePickerFloatingLabel.mjs";
23
- import { Button as ae } from "@progress/kendo-react-buttons";
24
- import { MOBILE_MEDIUM_DEVISE as re } from "../common/constants.mjs";
25
- import { AdaptiveMode as le } from "../common/AdaptiveMode.mjs";
26
- import { ActionSheetContent as he } from "@progress/kendo-react-layout";
11
+ import { Popup as U } from "@progress/kendo-react-popup";
12
+ import { cloneDate as y } from "@progress/kendo-date-math";
13
+ import { classNames as c, uTimePicker as g, Keys as d, validatePackage as K, canUseDOM as I, AsyncFocusBlur as H, createPropsContext as j, withIdHOC as W, withPropsContext as G, withUnstyledHOC as X } from "@progress/kendo-react-common";
14
+ import { clockIcon as Z } from "@progress/kendo-svg-icons";
15
+ import { provideLocalizationService as J, registerForLocalization as Q } from "@progress/kendo-react-intl";
16
+ import { packageMetadata as Y } from "../package-metadata.mjs";
17
+ import { toggleClock as f, messages as u, timePickerCancel as $, timePickerSet as T, toggleTimeSelector as C } from "../messages/index.mjs";
18
+ import { DateInput as ee } from "../dateinput/DateInput.mjs";
19
+ import { TimeSelector as te } from "./TimeSelector.mjs";
20
+ import { MAX_TIME as ie, MIN_TIME as se, setTime as M, MIDNIGHT_DATE as oe } from "../utils.mjs";
21
+ import { isInRange as ne, isBiggerThanMax as ae, isSmallerThanMin as re } from "./utils.mjs";
22
+ import { PickerFloatingLabel as le } from "../hooks/usePickerFloatingLabel.mjs";
23
+ import { Button as he } from "@progress/kendo-react-buttons";
24
+ import { MOBILE_MEDIUM_DEVISE as de } from "../common/constants.mjs";
25
+ import { AdaptiveMode as ue } from "../common/AdaptiveMode.mjs";
26
+ import { ActionSheetContent as pe } from "@progress/kendo-react-layout";
27
27
  const n = class n extends a.Component {
28
28
  constructor(i) {
29
29
  super(i), this._element = null, this._dateInput = a.createRef(), this._timeSelector = null, this.shouldFocusDateInput = !1, this.prevShow = !1, this.focus = () => {
30
30
  this.dateInput && this.dateInput.focus();
31
31
  }, this.renderTimeSelector = () => {
32
- const { smoothScroll: t, cancelButton: s, nowButton: o, disabled: r, format: h, steps: l } = this.props;
32
+ const { smoothScroll: t, cancelButton: s, nowButton: o, disabled: l, format: h, steps: r, unstyled: m } = this.props;
33
33
  return /* @__PURE__ */ a.createElement(
34
- Q,
34
+ te,
35
35
  {
36
36
  ref: this.setTimeSelectorRef,
37
- className: this.mobileMode ? "k-reset k-timeselector-lg" : "",
38
37
  mobileMode: this.mobileMode,
39
38
  show: this.show,
40
39
  cancelButton: s,
41
- disabled: r,
40
+ disabled: l,
42
41
  nowButton: o,
43
42
  format: h,
44
43
  min: this.min,
45
44
  max: this.max,
46
- steps: l,
45
+ steps: r,
47
46
  smoothScroll: t,
48
47
  value: this.value,
49
48
  footer: !this.mobileMode,
50
49
  handleTimeChange: this.mobileMode && this.handleTimeChange,
51
50
  onChange: this.handleValueChange,
52
- onReject: this.handleValueReject
51
+ onReject: this.handleValueReject,
52
+ unstyled: m
53
53
  }
54
54
  );
55
55
  }, this.renderPopup = () => {
56
- const { popupClass: t, ...s } = this.popupSettings, o = v(
56
+ const { popupClass: t, ...s } = this.popupSettings, { unstyled: o } = this.props, l = o && o.uTimePicker, h = c(
57
57
  t
58
58
  ), r = {
59
- popupClass: "k-timepicker-popup k-list-container",
59
+ popupClass: g.popup({ c: l }),
60
60
  show: this.show,
61
61
  animate: this.element !== null,
62
62
  anchor: this.element,
63
- className: o,
63
+ className: h,
64
64
  id: this._popupId,
65
65
  anchorAlign: {
66
66
  horizontal: "left",
@@ -72,7 +72,7 @@ const n = class n extends a.Component {
72
72
  },
73
73
  ...s
74
74
  };
75
- return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...r }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(q, { ...r }, this.renderTimeSelector());
75
+ return this.props.popup ? /* @__PURE__ */ a.createElement(this.props.popup, { ...r }, this.renderTimeSelector()) : /* @__PURE__ */ a.createElement(U, { ...r }, this.renderTimeSelector());
76
76
  }, this.renderAdaptivePopup = () => {
77
77
  const { windowWidth: t = 0 } = this.state, s = {
78
78
  expand: this.show,
@@ -80,13 +80,13 @@ const n = class n extends a.Component {
80
80
  adaptiveTitle: this.props.adaptiveTitle,
81
81
  windowWidth: t,
82
82
  footer: {
83
- cancelText: this.localizationService.toLanguageString(m, u[Z]),
83
+ cancelText: this.localizationService.toLanguageString(f, u[$]),
84
84
  onCancel: this.handleValueReject,
85
- applyText: this.localizationService.toLanguageString(S, u[S]),
85
+ applyText: this.localizationService.toLanguageString(T, u[T]),
86
86
  onApply: (o) => this.handleValueChange(o)
87
87
  }
88
88
  };
89
- return /* @__PURE__ */ a.createElement(le, { ...s }, /* @__PURE__ */ a.createElement(he, { className: "!k-overflow-hidden" }, this.renderTimeSelector()));
89
+ return /* @__PURE__ */ a.createElement(ue, { ...s }, /* @__PURE__ */ a.createElement(pe, { overflowHidden: !0 }, this.renderTimeSelector()));
90
90
  }, this.setTimeSelectorRef = (t) => {
91
91
  this._timeSelector = t;
92
92
  }, this.nextValue = (t, s) => t.value !== void 0 ? t.value : s.value, this.nextShow = (t, s) => t.show !== void 0 ? t.show : s.show, this.handleInputValueChange = (t) => {
@@ -96,7 +96,7 @@ const n = class n extends a.Component {
96
96
  this.setState({ candidate: t.time });
97
97
  }, this.handleValueChange = (t) => {
98
98
  this.setState({
99
- value: f(t.value || this.state.candidate)
99
+ value: y(t.value || this.state.candidate)
100
100
  }), this.valueDuringOnChange = t.value, this.showDuringOnChange = !1, this.shouldFocusDateInput = !0;
101
101
  const { onChange: s } = this.props, o = this.state.candidate || this.value;
102
102
  s && s.call(void 0, {
@@ -123,7 +123,7 @@ const n = class n extends a.Component {
123
123
  return;
124
124
  }
125
125
  s && (o === d.up || o === d.down) && (t.preventDefault(), t.stopPropagation(), this.shouldFocusDateInput = o === d.up, this.setShow(o === d.down));
126
- }, _(X), this.state = {
126
+ }, K(Y), this.state = {
127
127
  value: this.props.defaultValue || n.defaultProps.defaultValue,
128
128
  show: this.props.defaultShow || n.defaultProps.defaultShow,
129
129
  focused: !1,
@@ -134,7 +134,7 @@ const n = class n extends a.Component {
134
134
  return this.props.id + "-popup-id";
135
135
  }
136
136
  get document() {
137
- if (w)
137
+ if (I)
138
138
  return this.element && this.element.ownerDocument || document;
139
139
  }
140
140
  /**
@@ -160,7 +160,7 @@ const n = class n extends a.Component {
160
160
  */
161
161
  get value() {
162
162
  const i = this.valueDuringOnChange !== void 0 ? this.valueDuringOnChange : this.props.value !== void 0 ? this.props.value : this.state.value;
163
- return i !== null ? f(i) : null;
163
+ return i !== null ? y(i) : null;
164
164
  }
165
165
  /**
166
166
  * Gets the popup state of the TimeSelector.
@@ -178,12 +178,12 @@ const n = class n extends a.Component {
178
178
  * Represents the validity state into which the TimePicker is set.
179
179
  */
180
180
  get validity() {
181
- const i = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), s = this.normalizeTime(this.max), o = ie(i, t, s), r = this.props.validationMessage !== void 0, h = (!this.required || this.value !== null) && o, l = this.props.valid !== void 0 ? this.props.valid : h;
181
+ const i = this.value && this.normalizeTime(this.value), t = this.normalizeTime(this.min), s = this.normalizeTime(this.max), o = ne(i, t, s), l = this.props.validationMessage !== void 0, h = (!this.required || this.value !== null) && o, r = this.props.valid !== void 0 ? this.props.valid : h;
182
182
  return {
183
- customError: r,
184
- rangeOverflow: se(i, s),
185
- rangeUnderflow: oe(i, t),
186
- valid: l,
183
+ customError: l,
184
+ rangeOverflow: ae(i, s),
185
+ rangeUnderflow: re(i, t),
186
+ valid: r,
187
187
  valueMissing: this.value === null
188
188
  };
189
189
  }
@@ -191,7 +191,7 @@ const n = class n extends a.Component {
191
191
  * The mobile mode of the ComboBox.
192
192
  */
193
193
  get mobileMode() {
194
- return !!(this.state.windowWidth && this.state.windowWidth <= re && this.props.adaptive);
194
+ return !!(this.state.windowWidth && this.state.windowWidth <= de && this.props.adaptive);
195
195
  }
196
196
  /**
197
197
  * @hidden
@@ -218,14 +218,14 @@ const n = class n extends a.Component {
218
218
  return this.props.dateInput || n.defaultProps.dateInput;
219
219
  }
220
220
  get localizationService() {
221
- return W(this);
221
+ return J(this);
222
222
  }
223
223
  /**
224
224
  * @hidden
225
225
  */
226
226
  componentDidMount() {
227
227
  var i;
228
- this.observerResize = w && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.show && this.forceUpdate(), (i = this.document) != null && i.body && this.observerResize && this.observerResize.observe(this.document.body);
228
+ this.observerResize = I && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.show && this.forceUpdate(), (i = this.document) != null && i.body && this.observerResize && this.observerResize.observe(this.document.body);
229
229
  }
230
230
  /**
231
231
  * @hidden
@@ -249,38 +249,39 @@ const n = class n extends a.Component {
249
249
  rounded: t = n.defaultProps.rounded,
250
250
  fillMode: s = n.defaultProps.fillMode,
251
251
  disabled: o,
252
- tabIndex: r,
252
+ tabIndex: l,
253
253
  title: h,
254
- id: l,
255
- className: M,
256
- format: T,
257
- formatPlaceholder: C,
258
- width: D,
259
- name: O,
260
- steps: k,
261
- validationMessage: P,
262
- required: z,
263
- validityStyles: x,
264
- ariaLabelledBy: E,
265
- ariaDescribedBy: R
266
- } = this.props, c = !this.validityStyles || this.validity.valid, B = {
254
+ id: r,
255
+ className: m,
256
+ format: D,
257
+ formatPlaceholder: O,
258
+ width: P,
259
+ name: z,
260
+ steps: x,
261
+ validationMessage: E,
262
+ required: k,
263
+ validityStyles: B,
264
+ ariaLabelledBy: R,
265
+ ariaDescribedBy: V,
266
+ unstyled: v
267
+ } = this.props, w = v && v.uTimePicker, S = !this.validityStyles || this.validity.valid, F = {
267
268
  disabled: o,
268
- format: T,
269
- formatPlaceholder: C,
270
- id: l,
271
- ariaLabelledBy: E,
272
- ariaDescribedBy: R,
269
+ format: D,
270
+ formatPlaceholder: O,
271
+ id: r,
272
+ ariaLabelledBy: R,
273
+ ariaDescribedBy: V,
273
274
  max: this.normalizeTime(this.max),
274
275
  min: this.normalizeTime(this.min),
275
- name: O,
276
+ name: z,
276
277
  onChange: this.handleInputValueChange,
277
- required: z,
278
- steps: k,
279
- tabIndex: this.show ? -1 : r,
278
+ required: k,
279
+ steps: x,
280
+ tabIndex: this.show ? -1 : l,
280
281
  title: h,
281
282
  valid: this.validity.valid,
282
- validationMessage: P,
283
- validityStyles: x,
283
+ validationMessage: E,
284
+ validityStyles: B,
284
285
  value: this.value && this.normalizeTime(this.value),
285
286
  label: void 0,
286
287
  placeholder: this.state.focused ? null : this.props.placeholder,
@@ -290,38 +291,37 @@ const n = class n extends a.Component {
290
291
  fillMode: null,
291
292
  rounded: null,
292
293
  readonly: this.mobileMode
293
- }, V = this.localizationService.toLanguageString(m, u[m]), F = this.localizationService.toLanguageString(y, u[y]), g = /* @__PURE__ */ a.createElement(
294
- K,
294
+ }, A = this.localizationService.toLanguageString(f, u[f]), N = this.localizationService.toLanguageString(C, u[C]), b = /* @__PURE__ */ a.createElement(
295
+ H,
295
296
  {
296
297
  onFocus: this.handleFocus,
297
298
  onBlur: this.mobileMode ? void 0 : this.handleBlur,
298
299
  onSyncBlur: this.props.onBlur,
299
300
  onSyncFocus: this.props.onFocus
300
301
  },
301
- ({ onFocus: N, onBlur: A }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
302
+ ({ onFocus: L, onBlur: q }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
302
303
  "span",
303
304
  {
304
305
  id: this.props.id,
305
- ref: (L) => {
306
- this._element = L;
306
+ ref: (_) => {
307
+ this._element = _;
307
308
  },
308
- className: v(
309
- "k-input",
310
- "k-timepicker",
311
- {
312
- [`k-input-${b.sizeMap[i] || i}`]: i,
313
- [`k-rounded-${b.roundedMap[t] || t}`]: t,
314
- [`k-input-${s}`]: s,
315
- "k-invalid": !c,
316
- "k-required": this.required,
317
- "k-disabled": this.props.disabled
318
- },
319
- M
309
+ className: c(
310
+ g.wrapper({
311
+ c: w,
312
+ size: i,
313
+ rounded: t,
314
+ fillMode: s,
315
+ invalid: !S,
316
+ required: this.required,
317
+ disabled: o
318
+ }),
319
+ m
320
320
  ),
321
321
  onKeyDown: this.handleKeyDown,
322
- style: { width: D },
323
- onFocus: N,
324
- onBlur: A,
322
+ style: { width: P },
323
+ onFocus: L,
324
+ onBlur: q,
325
325
  onClick: this.mobileMode ? this.handleIconClick : void 0
326
326
  },
327
327
  /* @__PURE__ */ a.createElement(
@@ -330,43 +330,43 @@ const n = class n extends a.Component {
330
330
  _ref: this._dateInput,
331
331
  ariaRole: "combobox",
332
332
  ariaControls: this._popupId,
333
- ...B
333
+ ...F
334
334
  }
335
335
  ),
336
336
  /* @__PURE__ */ a.createElement(
337
- ae,
337
+ he,
338
338
  {
339
339
  tabIndex: -1,
340
340
  type: "button",
341
341
  icon: "clock",
342
- svgIcon: $,
342
+ svgIcon: Z,
343
343
  onMouseDown: this.handleIconMouseDown,
344
344
  onClick: this.mobileMode ? void 0 : this.handleIconClick,
345
- title: F,
346
- className: "k-input-button",
345
+ title: N,
346
+ className: c(g.inputButton({ c: w })),
347
347
  rounded: null,
348
348
  fillMode: s,
349
- "aria-label": V
349
+ "aria-label": A
350
350
  }
351
351
  ),
352
352
  !this.mobileMode && this.renderPopup()
353
353
  ), this.mobileMode && this.renderAdaptivePopup())
354
354
  );
355
355
  return this.props.label ? /* @__PURE__ */ a.createElement(
356
- ne,
356
+ le,
357
357
  {
358
358
  dateInput: this._dateInput,
359
359
  label: this.props.label,
360
- editorId: l,
361
- editorValid: c,
360
+ editorId: r,
361
+ editorValid: S,
362
362
  editorDisabled: this.props.disabled,
363
- children: g,
363
+ children: b,
364
364
  style: { width: this.props.width }
365
365
  }
366
- ) : g;
366
+ ) : b;
367
367
  }
368
368
  normalizeTime(i) {
369
- return I(te, i);
369
+ return M(oe, i);
370
370
  }
371
371
  setShow(i) {
372
372
  const { onOpen: t, onClose: s } = this.props;
@@ -377,7 +377,7 @@ const n = class n extends a.Component {
377
377
  }));
378
378
  }
379
379
  mergeTime(i) {
380
- return this.value && i ? I(this.value, i) : i;
380
+ return this.value && i ? M(this.value, i) : i;
381
381
  }
382
382
  calculateMedia(i) {
383
383
  for (let t of i)
@@ -456,24 +456,29 @@ n.displayName = "TimePicker", n.propTypes = {
456
456
  defaultValue: null,
457
457
  disabled: !1,
458
458
  format: "t",
459
- max: Y,
460
- min: ee,
459
+ max: ie,
460
+ min: se,
461
461
  popupSettings: {},
462
462
  tabIndex: 0,
463
463
  steps: {},
464
464
  required: !1,
465
465
  validityStyles: !0,
466
- dateInput: J,
466
+ dateInput: ee,
467
467
  size: "medium",
468
468
  rounded: "medium",
469
469
  fillMode: "solid"
470
470
  };
471
471
  let p = n;
472
- const de = U(), ue = j(H(de, p));
473
- ue.displayName = "KendoReactTimePicker";
474
- G(p);
472
+ const me = j(), ce = W(
473
+ G(
474
+ me,
475
+ X(p)
476
+ )
477
+ );
478
+ ce.displayName = "KendoReactTimePicker";
479
+ Q(p);
475
480
  export {
476
- ue as TimePicker,
477
- de as TimePickerPropsContext,
481
+ ce as TimePicker,
482
+ me as TimePickerPropsContext,
478
483
  p as TimePickerWithoutContext
479
484
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),e=require("prop-types"),p=require("@progress/kendo-date-math"),a=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),b=require("../utils.js"),h=require("./utils.js"),_=require("./TimePart.js"),w=require("@progress/kendo-react-buttons");function E(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return i.default=u,Object.freeze(i)}const l=E(T),c=class c extends l.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:n}=t;switch(n){case a.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:n,shiftKey:o}=t;!o&&n===a.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var d;const{keyCode:n,shiftKey:o}=t;o&&n===a.Keys.tab?(t.preventDefault(),this._acceptButton&&((d=this._acceptButton.element)==null||d.focus({preventScroll:!0}))):n===a.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const n=this.mergeValue(p.cloneDate(this.value||h.getNow()),this.timePart?this.timePart.value:this.current);this.setState({value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:n}=this.props;n&&n.call(void 0,t)},this.handleNowClick=t=>{const n=this.mergeValue(p.cloneDate(this.value||h.getNow()),h.getNow());this.setState({current:n,value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:n}=this.props;n&&n.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||c.defaultProps.format),this.mergeValue=h.valueMerger(h.generateGetters(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||b.MIDNIGHT_DATE,value:this.props.value||c.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?p.cloneDate(i):null}get intl(){return g.provideIntlService(this)}get current(){return this.state.current!==null?p.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:n,tabIndex:o,className:d,smoothScroll:y,min:D,max:O,boundRange:B,nowButton:C,steps:P,show:N,mobileMode:S}=this.props,k=g.provideLocalizationService(this),f=k.toLanguageString(r.timePickerCancel,r.messages[r.timePickerCancel]),v=k.toLanguageString(r.timePickerSet,r.messages[r.timePickerSet]);return l.createElement("div",{ref:s=>{this._element=s},tabIndex:n?void 0:o||0,className:a.classNames("k-timeselector k-timeselector-md",d,{"k-disabled":n}),onKeyDown:this.handleKeyDown},l.createElement(_.TimePart,{ref:s=>{this.timePart=s},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:y,min:D,max:O,boundRange:B,disabled:n,nowButton:C,steps:P,show:N,mobileMode:S,onNowKeyDown:this.handleNowKeyDown}),this.props.footer&&l.createElement("div",{className:"k-time-footer k-actions k-actions-stretched k-actions-horizontal"},t&&l.createElement(w.Button,{type:"button",ref:s=>{this._cancelButton=s},className:"k-time-cancel",onClick:this.handleReject,title:f,"aria-label":f},f),l.createElement(w.Button,{type:"button",ref:s=>{this._acceptButton=s},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:v,"aria-label":v},v)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=a.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};c.propTypes={cancelButton:e.bool,className:e.string,disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),max:e.instanceOf(Date),min:e.instanceOf(Date),nowButton:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,value:e.instanceOf(Date),show:e.bool},c.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:b.MIN_TIME,max:b.MAX_TIME,boundRange:!1,footer:!0};let m=c;g.registerForIntl(m);g.registerForLocalization(m);exports.TimeSelector=m;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),e=require("prop-types"),g=require("@progress/kendo-date-math"),s=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),y=require("../utils.js"),m=require("./utils.js"),K=require("./TimePart.js"),O=require("@progress/kendo-react-buttons");function x(u){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return i.default=u,Object.freeze(i)}const l=x(I),c=class c extends l.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:n}=t;switch(n){case s.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:n,shiftKey:o}=t;!o&&n===s.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var p;const{keyCode:n,shiftKey:o}=t;o&&n===s.Keys.tab?(t.preventDefault(),this._acceptButton&&((p=this._acceptButton.element)==null||p.focus({preventScroll:!0}))):n===s.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),this.timePart?this.timePart.value:this.current);this.setState({value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:n}=this.props;n&&n.call(void 0,t)},this.handleNowClick=t=>{const n=this.mergeValue(g.cloneDate(this.value||m.getNow()),m.getNow());this.setState({current:n,value:n}),this.valueDuringOnChange=n;const{onChange:o}=this.props;o&&o.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:n}=this.props;n&&n.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||c.defaultProps.format),this.mergeValue=m.valueMerger(m.generateGetters(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||y.MIDNIGHT_DATE,value:this.props.value||c.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?g.cloneDate(i):null}get intl(){return f.provideIntlService(this)}get current(){return this.state.current!==null?g.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:n,tabIndex:o,className:p,smoothScroll:P,min:B,max:k,boundRange:N,nowButton:T,steps:S,show:_,mobileMode:C,unstyled:h}=this.props,E=h&&h.uTimePicker,v=h&&h.uTime,D=f.provideLocalizationService(this),b=D.toLanguageString(r.timePickerCancel,r.messages[r.timePickerCancel]),w=D.toLanguageString(r.timePickerSet,r.messages[r.timePickerSet]);return l.createElement("div",{ref:a=>{this._element=a},tabIndex:n?void 0:o||0,className:s.classNames(s.uTimePicker.timeSelector({c:E,mobileMode:C,disabled:n}),p),onKeyDown:this.handleKeyDown},l.createElement(K.TimePart,{ref:a=>{this.timePart=a},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:P,min:B,max:k,boundRange:N,disabled:n,nowButton:T,steps:S,show:_,mobileMode:C,onNowKeyDown:this.handleNowKeyDown,unstyled:h}),this.props.footer&&l.createElement("div",{className:s.classNames(s.uTime.footer({c:v}))},t&&l.createElement(O.Button,{type:"button",ref:a=>{this._cancelButton=a},className:s.classNames(s.uTime.cancel({c:v})),onClick:this.handleReject,title:b,"aria-label":b},b),l.createElement(O.Button,{type:"button",ref:a=>{this._acceptButton=a},className:s.classNames(s.uTime.accept({c:v})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:w,"aria-label":w},w)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=s.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};c.propTypes={cancelButton:e.bool,className:e.string,disabled:e.bool,format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),max:e.instanceOf(Date),min:e.instanceOf(Date),nowButton:e.bool,steps:e.shape({hour:e.number,minute:e.number,second:e.number}),smoothScroll:e.bool,tabIndex:e.number,value:e.instanceOf(Date),show:e.bool},c.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:y.MIN_TIME,max:y.MAX_TIME,boundRange:!1,footer:!0};let d=c;f.registerForIntl(d);f.registerForLocalization(d);exports.TimeSelector=d;