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

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 +20 -14
  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 +41 -29
  37. package/index.d.ts +41 -29
  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
@@ -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 C=require("react"),k=require("@progress/kendo-react-intl"),n=require("../messages/index.js"),m=require("@progress/kendo-react-buttons"),E=require("../calendar/components/Calendar.js"),P=require("../timepicker/TimePart.js"),o=require("../utils.js"),b=require("@progress/kendo-date-math"),l=require("@progress/kendo-react-common"),y=require("../timepicker/utils.js");function w(u){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const e in u)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(u,e);Object.defineProperty(a,e,t.get?t:{enumerable:!0,get:()=>u[e]})}}return a.default=u,Object.freeze(a)}const i=w(C),f=class f extends i.Component{constructor(a){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=e=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();this.state.tab==="date"&&t&&t.focus(e)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=e=>{if(e==="right"&&this.state.tab==="time"||e==="left"&&this.state.tab==="date")return;const t=e==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e}=this.props,t=this.localizationService.toLanguageString(n.dateTimePickerCancel,n.messages[n.dateTimePickerCancel]),s=this.localizationService.toLanguageString(n.dateTimePickerSet,n.messages[n.dateTimePickerSet]);return i.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched"},e&&i.createElement(m.Button,{type:"button",ref:r=>{this._cancelButton=r},className:"k-time-cancel",onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:t,"aria-label":t},t),i.createElement(m.Button,{type:"button",themeColor:"primary",ref:r=>{this._acceptButton=r},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:s,"aria-label":s},s))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||o.MIDNIGHT_DATE});const t=this.mergeDate(this.props.value,this.props.value||o.MIDNIGHT_DATE);if(this.props.onReject){const s={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,s)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const s=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:s,target:this})},this.handleNowClick=e=>{this.setState({timeValue:y.getNow()}),this.handleAccept(e,y.getNow())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:s}=e;if(!this.props.disabled)switch(t){case l.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e);return;case l.Keys.left:if(!s)return;this.move("left");return;case l.Keys.right:if(!s)return;this.move("right");return;default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===l.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===l.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var r,d,c,p;const{keyCode:t,shiftKey:s}=e;s&&t===l.Keys.tab&&(e.stopPropagation(),this.hasDateValue?(p=(c=this._acceptButton)==null?void 0:c.element)==null||p.focus():(d=(r=this._cancelButton)==null?void 0:r.element)==null||d.focus()),t===l.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===l.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||o.MIDNIGHT_DATE}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return k.provideLocalizationService(this)}componentDidUpdate(a,e){var t,s;this.shouldFocusPart&&this.focus({preventScroll:!0}),(((t=a.value)==null?void 0:t.getTime())!==((s=this.props.value)==null?void 0:s.getTime())||this.state.tab!==e.tab&&this.props.value)&&this.setState({dateValue:a.value&&this.props.value&&b.isEqualDate(a.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||o.MIDNIGHT_DATE}),this.shouldFocusPart=!1}render(){const{disabled:a,min:e,max:t,weekNumber:s,focusedDate:r,format:d,mobileMode:c,footerActions:p}=this.props,D=l.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":a},"k-datetime-wrap"),T=this.localizationService.toLanguageString(n.date,n.messages[n.date]),_=this.localizationService.toLanguageString(n.time,n.messages[n.time]),v={min:e,max:t,weekNumber:s,focusedDate:r,disabled:a||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:a||this.state.tab!=="date"?-1:void 0,mobileMode:c};return i.createElement("div",{onKeyDown:this.handleKeyDown,className:D,tabIndex:-1},i.createElement("div",{className:"k-datetime-buttongroup"},i.createElement(m.ButtonGroup,{width:"100%"},i.createElement(m.Button,{ref:h=>this._dateButtonRef=h,type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},T),i.createElement(m.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},_))),i.createElement("div",{className:"k-datetime-selector"},i.createElement("div",{className:"k-datetime-calendar-wrap",ref:h=>this._calendarWrap=h},this.props.calendar?i.createElement(this.props.calendar,{key:this.state.tab,...v}):i.createElement(E.Calendar,{key:this.state.tab,ref:h=>{this._calendar=h},...v})),i.createElement("div",{className:"k-datetime-time-wrap"},i.createElement("div",{className:c?"k-reset k-timeselector-lg k-timeselector":""},i.createElement(P.TimePart,{key:1,onNowClick:this.handleNowClick,disabled:a||this.state.tab!=="time",ref:h=>{this._timePart=h},min:this.minTime||o.MIN_TIME,max:this.maxTime||o.MAX_TIME,steps:this.props.steps,value:this.state.timeValue,format:d,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:c})))),p&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(a,e){return b.isEqualDate(a,e||o.getToday())?a:null}hasActiveButton(){if(!this._acceptButton)return!1;const a=l.getActiveElement(document);return this._acceptButton&&a===this._acceptButton.element||this._cancelButton&&a===this._cancelButton.element}mergeTime(a,e){return a&&e?o.setTime(e,a):e}mergeDate(a,e){return a?o.setTime(a||o.getToday(),e):e}};f.defaultProps={footerActions:!0};let g=f;k.registerForLocalization(g);exports.DateTimeSelector=g;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),_=require("@progress/kendo-react-intl"),l=require("../messages/index.js"),p=require("@progress/kendo-react-buttons"),N=require("../calendar/components/Calendar.js"),B=require("../timepicker/TimePart.js"),r=require("../utils.js"),y=require("@progress/kendo-date-math"),a=require("@progress/kendo-react-common"),b=require("../timepicker/utils.js");function V(d){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return s.default=d,Object.freeze(s)}const n=V(E),D=class D extends n.Component{constructor(s){super(s),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._dateButtonRef=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();this.state.tab==="date"&&t&&t.focus(e)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-calendar"),this.move=e=>{if(e==="right"&&this.state.tab==="time"||e==="left"&&this.state.tab==="date")return;const t=e==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e,unstyled:t}=this.props,i=t&&t.uDateTimePicker,c=this.localizationService.toLanguageString(l.dateTimePickerCancel,l.messages[l.dateTimePickerCancel]),h=this.localizationService.toLanguageString(l.dateTimePickerSet,l.messages[l.dateTimePickerSet]);return n.createElement("div",{className:a.classNames(a.uDateTimePicker.timeFooter({c:i}))},e&&n.createElement(p.Button,{type:"button",ref:o=>{this._cancelButton=o},className:a.classNames(a.uTime.cancel({c:i})),onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:c,"aria-label":c},c),n.createElement(p.Button,{type:"button",themeColor:"primary",ref:o=>{this._acceptButton=o},className:a.classNames(a.uTime.accept({c:i})),disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:h,"aria-label":h},h))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||r.MIDNIGHT_DATE});const t=this.mergeDate(this.props.value,this.props.value||r.MIDNIGHT_DATE);if(this.props.onReject){const i={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,i)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const i=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:this})},this.handleNowClick=e=>{this.setState({timeValue:b.getNow()}),this.handleAccept(e,b.getNow())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;if(!this.props.disabled)switch(t){case a.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e);return;case a.Keys.left:if(!i)return;this.move("left");return;case a.Keys.right:if(!i)return;this.move("right");return;default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===a.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===a.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var c,h,o,g;const{keyCode:t,shiftKey:i}=e;i&&t===a.Keys.tab&&(e.stopPropagation(),this.hasDateValue?(g=(o=this._acceptButton)==null?void 0:o.element)==null||g.focus():(h=(c=this._cancelButton)==null?void 0:c.element)==null||h.focus()),t===a.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===a.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||r.MIDNIGHT_DATE}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return _.provideLocalizationService(this)}componentDidUpdate(s,e){var t,i;this.shouldFocusPart&&this.focus({preventScroll:!0}),(((t=s.value)==null?void 0:t.getTime())!==((i=this.props.value)==null?void 0:i.getTime())||this.state.tab!==e.tab&&this.props.value)&&this.setState({dateValue:s.value&&this.props.value&&y.isEqualDate(s.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||r.MIDNIGHT_DATE}),this.shouldFocusPart=!1}render(){const{disabled:s,min:e,max:t,weekNumber:i,focusedDate:c,format:h,mobileMode:o,footerActions:g,unstyled:v}=this.props,m=v&&v.uDateTimePicker,k=a.classNames(a.uDateTimePicker.wrap({c:m,date:this.state.tab==="date",time:this.state.tab==="time",disabled:s})),C=this.localizationService.toLanguageString(l.date,l.messages[l.date]),P=this.localizationService.toLanguageString(l.time,l.messages[l.time]),T={min:e,max:t,weekNumber:i,focusedDate:c,disabled:s||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:s||this.state.tab!=="date"?-1:void 0,mobileMode:o};return n.createElement("div",{onKeyDown:this.handleKeyDown,className:k,tabIndex:-1},n.createElement("div",{className:a.classNames(a.uDateTimePicker.buttonGroup({c:m}))},n.createElement(p.ButtonGroup,{width:"100%"},n.createElement(p.Button,{ref:u=>this._dateButtonRef=u,type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},C),n.createElement(p.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},P))),n.createElement("div",{className:a.classNames(a.uDateTimePicker.selector({c:m}))},n.createElement("div",{className:a.classNames(a.uDateTimePicker.calendarWrap({c:m})),ref:u=>this._calendarWrap=u},this.props.calendar?n.createElement(this.props.calendar,{key:this.state.tab,...T}):n.createElement(N.Calendar,{key:this.state.tab,ref:u=>{this._calendar=u},...T})),n.createElement("div",{className:a.classNames(a.uDateTimePicker.timeWrap({c:m}))},n.createElement("div",{className:a.classNames(a.uDateTimePicker.timeSelector({c:m,mobileMode:o}))},n.createElement(B.TimePart,{key:1,onNowClick:this.handleNowClick,disabled:s||this.state.tab!=="time",ref:u=>{this._timePart=u},min:this.minTime||r.MIN_TIME,max:this.maxTime||r.MAX_TIME,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:o,unstyled:v})))),g&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(s,e){return y.isEqualDate(s,e||r.getToday())?s:null}hasActiveButton(){if(!this._acceptButton)return!1;const s=a.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}mergeTime(s,e){return s&&e?r.setTime(e,s):e}mergeDate(s,e){return s?r.setTime(s||r.getToday(),e):e}};D.defaultProps={footerActions:!0};let f=D;_.registerForLocalization(f);exports.DateTimeSelector=f;
@@ -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
  };