@progress/kendo-react-dateinputs 14.4.0-develop.2 → 14.4.0-develop.3

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