@progress/kendo-react-dateinputs 8.3.0-develop.6 → 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
@@ -7,16 +7,16 @@
7
7
  */
8
8
  "use client";
9
9
  import * as i from "react";
10
- import { provideLocalizationService as B, registerForLocalization as P } from "@progress/kendo-react-intl";
11
- import { dateTimePickerCancel as v, messages as m, dateTimePickerSet as b, date as k, time as y } from "../messages/index.mjs";
12
- import { Button as u, ButtonGroup as S } from "@progress/kendo-react-buttons";
13
- import { Calendar as K } from "../calendar/components/Calendar.mjs";
14
- import { TimePart as N } from "../timepicker/TimePart.mjs";
15
- import { MIDNIGHT_DATE as d, MIN_TIME as R, MAX_TIME as M, getToday as _, setTime as C } from "../utils.mjs";
16
- import { isEqualDate as D } from "@progress/kendo-date-math";
17
- import { Keys as o, classNames as x, getActiveElement as A } from "@progress/kendo-react-common";
18
- import { getNow as E } from "../timepicker/utils.mjs";
19
- const f = class f extends i.Component {
10
+ import { provideLocalizationService as R, registerForLocalization as M } from "@progress/kendo-react-intl";
11
+ import { dateTimePickerCancel as D, messages as p, dateTimePickerSet as _, date as T, time as E } from "../messages/index.mjs";
12
+ import { Button as f, ButtonGroup as x } from "@progress/kendo-react-buttons";
13
+ import { Calendar as A } from "../calendar/components/Calendar.mjs";
14
+ import { TimePart as z } from "../timepicker/TimePart.mjs";
15
+ import { MIDNIGHT_DATE as g, MIN_TIME as F, MAX_TIME as L, getToday as V, setTime as P } from "../utils.mjs";
16
+ import { isEqualDate as k } from "@progress/kendo-date-math";
17
+ import { classNames as o, uDateTimePicker as u, uTime as B, Keys as h, getActiveElement as I } from "@progress/kendo-react-common";
18
+ import { getNow as w } from "../timepicker/utils.mjs";
19
+ const y = class y extends i.Component {
20
20
  constructor(a) {
21
21
  super(a), this._calendar = null, this._timePart = null, this._cancelButton = null, this._acceptButton = null, this._dateButtonRef = null, this._calendarWrap = null, this.shouldFocusPart = !1, this.focus = (t) => {
22
22
  Promise.resolve().then(() => {
@@ -24,47 +24,47 @@ const f = class f extends i.Component {
24
24
  const e = this.calendarElement();
25
25
  this.state.tab === "date" && e && e.focus(t);
26
26
  });
27
- }, this.calendarElement = () => this._calendar && this._calendar.element || this._calendarWrap && this._calendarWrap.querySelector(".k-widget.k-calendar"), this.move = (t) => {
27
+ }, this.calendarElement = () => this._calendar && this._calendar.element || this._calendarWrap && this._calendarWrap.querySelector(".k-calendar"), this.move = (t) => {
28
28
  if (t === "right" && this.state.tab === "time" || t === "left" && this.state.tab === "date")
29
29
  return;
30
30
  const e = t === "left" ? "date" : "time";
31
31
  this.shouldFocusPart = !0, this.setState({ tab: e });
32
32
  }, this.dateTimeFooter = () => {
33
- const { cancelButton: t } = this.props, e = this.localizationService.toLanguageString(v, m[v]), s = this.localizationService.toLanguageString(b, m[b]);
34
- return /* @__PURE__ */ i.createElement("div", { className: "k-datetime-footer k-actions k-actions-stretched" }, t && /* @__PURE__ */ i.createElement(
35
- u,
33
+ const { cancelButton: t, unstyled: e } = this.props, s = e && e.uDateTimePicker, l = this.localizationService.toLanguageString(D, p[D]), r = this.localizationService.toLanguageString(_, p[_]);
34
+ return /* @__PURE__ */ i.createElement("div", { className: o(u.timeFooter({ c: s })) }, t && /* @__PURE__ */ i.createElement(
35
+ f,
36
36
  {
37
37
  type: "button",
38
38
  ref: (n) => {
39
39
  this._cancelButton = n;
40
40
  },
41
- className: "k-time-cancel",
41
+ className: o(B.cancel({ c: s })),
42
42
  onClick: this.handleReject,
43
43
  onKeyDown: this.handleCancelKeyDown,
44
- title: e,
45
- "aria-label": e
44
+ title: l,
45
+ "aria-label": l
46
46
  },
47
- e
47
+ l
48
48
  ), /* @__PURE__ */ i.createElement(
49
- u,
49
+ f,
50
50
  {
51
51
  type: "button",
52
52
  themeColor: "primary",
53
53
  ref: (n) => {
54
54
  this._acceptButton = n;
55
55
  },
56
- className: "k-time-accept",
56
+ className: o(B.accept({ c: s })),
57
57
  disabled: !this.hasDateValue,
58
58
  onClick: this.handleAccept,
59
59
  onKeyDown: this.handleSetKeyDown,
60
- title: s,
61
- "aria-label": s
60
+ title: r,
61
+ "aria-label": r
62
62
  },
63
- s
63
+ r
64
64
  ));
65
65
  }, this.handleReject = (t) => {
66
- this.setState({ dateValue: this.props.value, timeValue: this.props.value || d });
67
- const e = this.mergeDate(this.props.value, this.props.value || d);
66
+ this.setState({ dateValue: this.props.value, timeValue: this.props.value || g });
67
+ const e = this.mergeDate(this.props.value, this.props.value || g);
68
68
  if (this.props.onReject) {
69
69
  const s = {
70
70
  nativeEvent: t.nativeEvent,
@@ -85,7 +85,7 @@ const f = class f extends i.Component {
85
85
  target: this
86
86
  });
87
87
  }, this.handleNowClick = (t) => {
88
- this.setState({ timeValue: E() }), this.handleAccept(t, E());
88
+ this.setState({ timeValue: w() }), this.handleAccept(t, w());
89
89
  }, this.handleCalendarValueChange = (t) => {
90
90
  t.syntheticEvent.stopPropagation(), this.setState({ dateValue: t.value, tab: "time" }), this.shouldFocusPart = !0;
91
91
  }, this.handleTimeListContainerChange = (t) => {
@@ -98,15 +98,15 @@ const f = class f extends i.Component {
98
98
  const { keyCode: e, altKey: s } = t;
99
99
  if (!this.props.disabled)
100
100
  switch (e) {
101
- case o.enter:
101
+ case h.enter:
102
102
  !this.hasActiveButton() && this.hasDateValue && this.handleAccept(t);
103
103
  return;
104
- case o.left:
104
+ case h.left:
105
105
  if (!s)
106
106
  return;
107
107
  this.move("left");
108
108
  return;
109
- case o.right:
109
+ case h.right:
110
110
  if (!s)
111
111
  return;
112
112
  this.move("right");
@@ -116,23 +116,23 @@ const f = class f extends i.Component {
116
116
  }
117
117
  }, this.handleCancelKeyDown = (t) => {
118
118
  const { keyCode: e } = t;
119
- e === o.tab && this._dateButtonRef && this._dateButtonRef.element && !this.hasDateValue && (t.preventDefault(), this._dateButtonRef.element.focus());
119
+ e === h.tab && this._dateButtonRef && this._dateButtonRef.element && !this.hasDateValue && (t.preventDefault(), this._dateButtonRef.element.focus());
120
120
  }, this.handleSetKeyDown = (t) => {
121
121
  const { keyCode: e } = t;
122
- e === o.tab && this._dateButtonRef && this._dateButtonRef.element && (t.preventDefault(), this._dateButtonRef.element.focus());
122
+ e === h.tab && this._dateButtonRef && this._dateButtonRef.element && (t.preventDefault(), this._dateButtonRef.element.focus());
123
123
  }, this.handleDateKeyDown = (t) => {
124
- var n, h, r, c;
124
+ var l, r, n, d;
125
125
  const { keyCode: e, shiftKey: s } = t;
126
- s && e === o.tab && (t.stopPropagation(), this.hasDateValue ? (c = (r = this._acceptButton) == null ? void 0 : r.element) == null || c.focus() : (h = (n = this._cancelButton) == null ? void 0 : n.element) == null || h.focus()), e === o.enter && (t.stopPropagation(), this.move("left"));
126
+ s && e === h.tab && (t.stopPropagation(), this.hasDateValue ? (d = (n = this._acceptButton) == null ? void 0 : n.element) == null || d.focus() : (r = (l = this._cancelButton) == null ? void 0 : l.element) == null || r.focus()), e === h.enter && (t.stopPropagation(), this.move("left"));
127
127
  }, this.handleTimeKeyDown = (t) => {
128
128
  const { keyCode: e } = t;
129
- e === o.enter && (t.stopPropagation(), this.move("right"));
129
+ e === h.enter && (t.stopPropagation(), this.move("right"));
130
130
  }, this.handleTimePartMount = (t) => {
131
131
  this.setState({ timeValue: t });
132
132
  }, this.state = {
133
133
  tab: "date",
134
134
  dateValue: this.props.value,
135
- timeValue: this.props.value || d
135
+ timeValue: this.props.value || g
136
136
  };
137
137
  }
138
138
  get calendar() {
@@ -145,13 +145,13 @@ const f = class f extends i.Component {
145
145
  return this.state.dateValue !== null;
146
146
  }
147
147
  get localizationService() {
148
- return B(this);
148
+ return R(this);
149
149
  }
150
150
  componentDidUpdate(a, t) {
151
151
  var e, s;
152
152
  this.shouldFocusPart && this.focus({ preventScroll: !0 }), (((e = a.value) == null ? void 0 : e.getTime()) !== ((s = this.props.value) == null ? void 0 : s.getTime()) || this.state.tab !== t.tab && this.props.value) && this.setState({
153
- dateValue: a.value && this.props.value && D(a.value, this.props.value) ? this.state.dateValue : this.props.value,
154
- timeValue: this.props.value || d
153
+ dateValue: a.value && this.props.value && k(a.value, this.props.value) ? this.state.dateValue : this.props.value,
154
+ timeValue: this.props.value || g
155
155
  }), this.shouldFocusPart = !1;
156
156
  }
157
157
  render() {
@@ -160,49 +160,50 @@ const f = class f extends i.Component {
160
160
  min: t,
161
161
  max: e,
162
162
  weekNumber: s,
163
- focusedDate: n,
164
- format: h,
165
- mobileMode: r,
166
- footerActions: c
167
- } = this.props, T = x(
168
- {
169
- "k-date-tab": this.state.tab === "date",
170
- "k-time-tab": this.state.tab === "time",
171
- "k-disabled": a
172
- },
173
- "k-datetime-wrap"
174
- ), V = this.localizationService.toLanguageString(k, m[k]), w = this.localizationService.toLanguageString(y, m[y]), g = {
163
+ focusedDate: l,
164
+ format: r,
165
+ mobileMode: n,
166
+ footerActions: d,
167
+ unstyled: v
168
+ } = this.props, m = v && v.uDateTimePicker, S = o(
169
+ u.wrap({
170
+ c: m,
171
+ date: this.state.tab === "date",
172
+ time: this.state.tab === "time",
173
+ disabled: a
174
+ })
175
+ ), K = this.localizationService.toLanguageString(T, p[T]), N = this.localizationService.toLanguageString(E, p[E]), C = {
175
176
  min: t,
176
177
  max: e,
177
178
  weekNumber: s,
178
- focusedDate: n,
179
+ focusedDate: l,
179
180
  disabled: a || this.state.tab !== "date",
180
181
  value: this.state.dateValue,
181
182
  onChange: this.handleCalendarValueChange,
182
183
  navigation: !1,
183
184
  tabIndex: a || this.state.tab !== "date" ? -1 : void 0,
184
- mobileMode: r
185
+ mobileMode: n
185
186
  };
186
187
  return /* @__PURE__ */ i.createElement(
187
188
  "div",
188
189
  {
189
190
  onKeyDown: this.handleKeyDown,
190
- className: T,
191
+ className: S,
191
192
  tabIndex: -1
192
193
  },
193
- /* @__PURE__ */ i.createElement("div", { className: "k-datetime-buttongroup" }, /* @__PURE__ */ i.createElement(S, { width: "100%" }, /* @__PURE__ */ i.createElement(
194
- u,
194
+ /* @__PURE__ */ i.createElement("div", { className: o(u.buttonGroup({ c: m })) }, /* @__PURE__ */ i.createElement(x, { width: "100%" }, /* @__PURE__ */ i.createElement(
195
+ f,
195
196
  {
196
- ref: (l) => this._dateButtonRef = l,
197
+ ref: (c) => this._dateButtonRef = c,
197
198
  type: "button",
198
199
  selected: this.state.tab === "date",
199
200
  togglable: !0,
200
201
  onClick: this.handleDateClick,
201
202
  onKeyDown: this.handleDateKeyDown
202
203
  },
203
- V
204
+ K
204
205
  ), /* @__PURE__ */ i.createElement(
205
- u,
206
+ f,
206
207
  {
207
208
  type: "button",
208
209
  selected: this.state.tab === "time",
@@ -210,37 +211,38 @@ const f = class f extends i.Component {
210
211
  onClick: this.handleTimeClick,
211
212
  onKeyDown: this.handleTimeKeyDown
212
213
  },
213
- w
214
+ N
214
215
  ))),
215
- /* @__PURE__ */ i.createElement("div", { className: "k-datetime-selector" }, /* @__PURE__ */ i.createElement("div", { className: "k-datetime-calendar-wrap", ref: (l) => this._calendarWrap = l }, this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { key: this.state.tab, ...g }) : /* @__PURE__ */ i.createElement(
216
- K,
216
+ /* @__PURE__ */ i.createElement("div", { className: o(u.selector({ c: m })) }, /* @__PURE__ */ i.createElement("div", { className: o(u.calendarWrap({ c: m })), ref: (c) => this._calendarWrap = c }, this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { key: this.state.tab, ...C }) : /* @__PURE__ */ i.createElement(
217
+ A,
217
218
  {
218
219
  key: this.state.tab,
219
- ref: (l) => {
220
- this._calendar = l;
220
+ ref: (c) => {
221
+ this._calendar = c;
221
222
  },
222
- ...g
223
+ ...C
223
224
  }
224
- )), /* @__PURE__ */ i.createElement("div", { className: "k-datetime-time-wrap" }, /* @__PURE__ */ i.createElement("div", { className: r ? "k-reset k-timeselector-lg k-timeselector" : "" }, /* @__PURE__ */ i.createElement(
225
- N,
225
+ )), /* @__PURE__ */ i.createElement("div", { className: o(u.timeWrap({ c: m })) }, /* @__PURE__ */ i.createElement("div", { className: o(u.timeSelector({ c: m, mobileMode: n })) }, /* @__PURE__ */ i.createElement(
226
+ z,
226
227
  {
227
228
  key: 1,
228
229
  onNowClick: this.handleNowClick,
229
230
  disabled: a || this.state.tab !== "time",
230
- ref: (l) => {
231
- this._timePart = l;
231
+ ref: (c) => {
232
+ this._timePart = c;
232
233
  },
233
- min: this.minTime || R,
234
- max: this.maxTime || M,
234
+ min: this.minTime || F,
235
+ max: this.maxTime || L,
235
236
  steps: this.props.steps,
236
237
  value: this.state.timeValue,
237
- format: h,
238
+ format: r,
238
239
  onChange: this.handleTimeListContainerChange,
239
240
  onMount: this.handleTimePartMount,
240
- mobileMode: r
241
+ mobileMode: n,
242
+ unstyled: v
241
243
  }
242
244
  )))),
243
- c && this.dateTimeFooter()
245
+ d && this.dateTimeFooter()
244
246
  );
245
247
  }
246
248
  get minTime() {
@@ -250,26 +252,26 @@ const f = class f extends i.Component {
250
252
  return this.props.maxTime !== void 0 ? this.props.maxTime : this.normalizeRange(this.props.max, this.state.dateValue);
251
253
  }
252
254
  normalizeRange(a, t) {
253
- return D(a, t || _()) ? a : null;
255
+ return k(a, t || V()) ? a : null;
254
256
  }
255
257
  hasActiveButton() {
256
258
  if (!this._acceptButton)
257
259
  return !1;
258
- const a = A(document);
260
+ const a = I(document);
259
261
  return this._acceptButton && a === this._acceptButton.element || this._cancelButton && a === this._cancelButton.element;
260
262
  }
261
263
  mergeTime(a, t) {
262
- return a && t ? C(t, a) : t;
264
+ return a && t ? P(t, a) : t;
263
265
  }
264
266
  mergeDate(a, t) {
265
- return a ? C(a || _(), t) : t;
267
+ return a ? P(a || V(), t) : t;
266
268
  }
267
269
  };
268
- f.defaultProps = {
270
+ y.defaultProps = {
269
271
  footerActions: !0
270
272
  };
271
- let p = f;
272
- P(p);
273
+ let b = y;
274
+ M(b);
273
275
  export {
274
- p as DateTimeSelector
276
+ b as DateTimeSelector
275
277
  };