@progress/kendo-react-dateinputs 10.1.0-develop.7 → 10.1.0-develop.9
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.
package/datepicker/DatePicker.js
CHANGED
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("react"),e=require("prop-types"),tt=require("@progress/kendo-react-popup"),L=require("@progress/kendo-date-math"),u=require("@progress/kendo-react-common"),nt=require("@progress/kendo-svg-icons"),ot=require("../dateinput/DateInput.js"),at=require("../calendar/components/Calendar.js"),a=require("../utils.js"),K=require("../messages/index.js"),rt=require("@progress/kendo-react-intl"),lt=require("./ToggleButton.js"),ut=require("../common/PickerWrap.js"),it=require("../hooks/usePickerFloatingLabel.js"),st=require("@progress/kendo-react-layout"),ct=require("../common/AdaptiveMode.js");function dt(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const f in n)if(f!=="default"){const M=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(h,f,M.get?M:{enumerable:!0,get:()=>n[f]})}}return h.default=n,Object.freeze(h)}const o=dt(et),W=o.forwardRef((n,h)=>{const f=u.useId(n.id),M=rt.useLocalization(),v=u.useAdaptiveModeContext(),{defaultShow:se=l.defaultShow,defaultValue:ce=l.defaultValue,dateInput:de=l.dateInput,calendar:fe=l.calendar,toggleButton:me=l.toggleButton,popup:ge=l.popup,pickerWrap:ft=l.pickerWrap,disabled:w=l.disabled,format:pe=l.format,max:_=l.max,min:E=l.min,popupSettings:y=l.popupSettings,tabIndex:be=l.tabIndex,weekNumber:he=l.weekNumber,validityStyles:j=l.validityStyles,size:T=l.size,rounded:x=l.rounded,fillMode:B=l.fillMode,autoFocus:ve=l.autoFocus,show:H,autoSwitchParts:we,autoSwitchKeys:ye,twoDigitYearMax:ke,ariaLabel:De,adaptive:mt,formatPlaceholder:Ce,adaptiveTitle:Pe,inputAttributes:Oe,validationMessage:U,visited:gt,value:q,touched:pt,modified:bt,_adaptiveMode:ht=v,valid:Y,focusedDate:Me,id:Re,ariaLabelledBy:Ie,...$}=u.usePropsContext(ie,n),A=()=>{if(u.canUseDOM)return D.current&&D.current.ownerDocument||window.document},c=()=>!!(b.windowWidth&&v&&b.windowWidth<=(v==null?void 0:v.medium)&&n.adaptive),m=()=>{const t=R.current!==void 0?R.current:q!==void 0?q:b.value;return t!==null?L.cloneDate(t):null},i=()=>I.current!==void 0?I.current:H!==void 0?H:b.show,Se=()=>de||l.dateInput,_e=()=>me||l.toggleButton,Ee=()=>fe||l.calendar,Te=()=>ge||l.popup,X=()=>n.required!==void 0?n.required:!1,N=()=>{const t=m()||q||null,r=E,s=_,S=a.isInDateRange(t,r,s),F=U!==void 0,V=(!X()||t!=null)&&S,z=Y!==void 0?Y:V;return{customError:F,rangeOverflow:t&&s.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<r.getTime()||!1,valid:z,valueMissing:t===null}},xe=t=>{for(const r of t)O({windowWidth:r.target.clientWidth})},Be=()=>{d.current&&d.current.focus()},Z=t=>{C.current=t},g=t=>{i()!==t&&(O({show:t}),t&&n.onOpen&&n.onOpen.call(void 0,{target:k.current}),!t&&n.onClose&&n.onClose.call(void 0,{target:k.current}))},qe=t=>{const r=m();return r&&t?a.setTime(t,r):t},Ae=t=>{y!=null&&y.onMouseDownOutside&&y.onMouseDownOutside.call(void 0,t)},G=(t,r)=>{O({value:L.cloneDate(t||void 0)}),R.current=t,I.current=!1,c()||(p.current=!0),n.onChange&&n.onChange.call(void 0,{syntheticEvent:r.syntheticEvent,nativeEvent:r.nativeEvent,value:m(),show:i(),target:k.current}),R.current=void 0,I.current=void 0,g(!1)},Ne=t=>{const r=qe(t.value);G(r,t)},J=()=>{const{popupClass:t,...r}=y,s=i(),S=m(),F=S&&L.getDate(S),V=u.classNames(t),z={popupClass:"k-datepicker-popup",show:s,anchor:D.current,className:V,id:ne,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...r,onMouseDownOutside:Ae},le={disabled:w,value:F,min:E,max:_,weekNumber:he,focusedDate:Me,className:c()?"k-calendar-lg":"",navigation:!c(),onChange:Ne},ue=Ee(),Qe=Te();return c()?o.createElement(ue,{_ref:Z,...le}):o.createElement(Qe,{...z},o.createElement(ue,{_ref:Z,...le}))},Q=()=>{O({focused:!1}),g(!1)},Fe=()=>{const{windowWidth:t=0}=b,r={expand:i(),onClose:Q,adaptiveTitle:Pe,windowWidth:t},s=J();return o.createElement(ct.AdaptiveMode,{...r},o.createElement(st.ActionSheetContent,{overflowHidden:!0},s))},Ve=t=>{G(t.value,t)},ze=()=>{O({focused:!0})},Le=()=>{g(!i())},ee=()=>{w||(p.current=!0,g(!i()))},Ke=t=>{t.preventDefault()},We=t=>{const{altKey:r,keyCode:s}=t;if(s===u.Keys.esc&&i()){p.current=!0,g(!1);return}r&&(s===u.Keys.up||s===u.Keys.down)&&(t.preventDefault(),t.stopPropagation(),p.current=s===u.Keys.up,g(s===u.Keys.down))},k=o.useRef(null),D=o.useRef(null),d=o.useRef(null),C=o.useRef(null);o.useImperativeHandle(k,()=>({props:n,get element(){return D.current},get calendar(){return C.current},get dateInput(){return d.current},get name(){return n.name},get show(){return i()},get validity(){return N()},get value(){return m()},get mobileMode(){return c()},togglePopup:Le,focus:Be})),o.useImperativeHandle(h,()=>k.current);const R=o.useRef(void 0),I=o.useRef(void 0),je=o.useRef(null),p=o.useRef(!1),te=o.useRef(!1),P=o.useRef(null),[b,He]=o.useState({value:ce,show:se,focused:!1}),[,Ue]=o.useReducer(t=>t,!0),O=t=>{He(r=>({...r,...t}))};o.useEffect(()=>{C.current&&C.current.element&&i()&&!te.current&&C.current.element.focus({preventScroll:!0}),d.current&&d.current.element&&!i()&&p.current&&d.current.element.focus({preventScroll:!0}),te.current=i(),p.current=!1}),o.useEffect(()=>{var t;return P.current=u.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(r=>xe(r)),i()&&Ue(),(t=A())!=null&&t.body&&P.current&&P.current.observe(A().body),()=>{var r;clearTimeout(je.current),(r=A())!=null&&r.body&&P.current&&P.current.disconnect()}},[]);const ne=f+"-popup-id",Ye=J(),$e=Se(),Xe=m(),Ze=_e(),Ge=Fe(),oe=!j||N().valid,ae=M.toLanguageString(K.toggleCalendar,K.messages[K.toggleCalendar]),Je={disabled:w,format:pe,formatPlaceholder:Ce,id:Re,ariaLabelledBy:Ie,ariaDescribedBy:n.ariaDescribedBy,ariaLabel:De,max:_,min:E,name:n.name,onChange:Ve,required:n.required,_ref:d,tabIndex:i()?-1:be,title:n.title,valid:N().valid,validationMessage:U,validityStyles:j,value:Xe,label:void 0,placeholder:b.focused?null:n.placeholder,ariaExpanded:i(),size:null,fillMode:null,rounded:null,autoFill:n.autoFill,twoDigitYearMax:ke,enableMouseWheel:n.enableMouseWheel,autoCorrectParts:n.autoCorrectParts,autoSwitchParts:we,autoSwitchKeys:ye,allowCaretMode:n.allowCaretMode,inputAttributes:Oe},re=o.createElement(u.AsyncFocusBlur,{onFocus:ze,onBlur:c()?void 0:Q,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>o.createElement(o.Fragment,null,o.createElement("span",{...n.label?{}:$,ref:D,className:u.classNames("k-input","k-datepicker",{[`k-input-${u.kendoThemeMaps.sizeMap[T]||T}`]:T,[`k-rounded-${u.kendoThemeMaps.roundedMap[x]||x}`]:x,[`k-input-${B}`]:B,"k-invalid":!oe,"k-required":X(),"k-disabled":w},n.className),onKeyDown:We,style:{width:n.width},onFocus:t.onFocus,onBlur:t.onBlur,onClick:c()?ee:void 0},o.createElement($e,{_ref:d,ariaRole:"combobox",ariaExpanded:i(),ariaControls:ne,autoFocus:ve,...Je}),o.createElement(Ze,{type:"button",icon:"calendar",svgIcon:nt.calendarIcon,title:ae,className:"k-input-button",rounded:null,onClick:c()?void 0:ee,"aria-label":ae,fillMode:B,onMouseDown:Ke}),!c()&&Ye),c()&&Ge));return n.label?o.createElement(it.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:f,editorValid:oe,editorDisabled:w,children:re,style:{width:n.width},...$}):re});W.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:a.nullable(e.string),pattern:a.nullable(e.string),date:a.nullable(e.oneOf(["short","medium","long","full"])),time:a.nullable(e.oneOf(["short","medium","long","full"])),datetime:a.nullable(e.oneOf(["short","medium","long","full"])),era:a.nullable(e.oneOf(["narrow","short","long"])),year:a.nullable(e.oneOf(["numeric","2-digit"])),month:a.nullable(e.oneOf(["numeric","2-digit","narrow","short","long"])),day:a.nullable(e.oneOf(["numeric","2-digit"])),weekday:a.nullable(e.oneOf(["narrow","short","long"])),hour:a.nullable(e.oneOf(["numeric","2-digit"])),hour12:a.nullable(e.bool),minute:a.nullable(e.oneOf(["numeric","2-digit"])),second:a.nullable(e.oneOf(["numeric","2-digit"])),timeZoneName:a.nullable(e.oneOf(["short","long"]))})]),formatPlaceholder:e.oneOfType([a.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:a.nullable(e.string),month:a.nullable(e.string),day:a.nullable(e.string),hour:a.nullable(e.string),minute:a.nullable(e.string),second:a.nullable(e.string)})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:a.nullable(e.bool),appendTo:a.nullable(e.any),popupClass:a.nullable(e.string)}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const l={defaultShow:!1,defaultValue:null,dateInput:ot.DateInput,calendar:at.Calendar,toggleButton:lt.ToggleButton,popup:tt.Popup,pickerWrap:ut.PickerWrap,disabled:!1,format:"d",max:a.MAX_DATE,min:a.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},ie=u.createPropsContext();W.displayName="KendoReactDatePicker";exports.DatePicker=W;exports.DatePickerPropsContext=ie;exports.datePickerDefaultProps=l;
|
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as o from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { Popup as
|
|
11
|
-
import { cloneDate as oe, getDate as
|
|
12
|
-
import { useId as
|
|
13
|
-
import { calendarIcon as
|
|
14
|
-
import { DateInput as
|
|
15
|
-
import { Calendar as
|
|
16
|
-
import { nullable as a, MAX_DATE as
|
|
17
|
-
import { toggleCalendar as ie, messages as
|
|
18
|
-
import { useLocalization as
|
|
19
|
-
import { ToggleButton as
|
|
20
|
-
import { PickerWrap as
|
|
21
|
-
import { PickerFloatingLabel as
|
|
22
|
-
import { ActionSheetContent as
|
|
23
|
-
import { AdaptiveMode as
|
|
10
|
+
import { Popup as nt } from "@progress/kendo-react-popup";
|
|
11
|
+
import { cloneDate as oe, getDate as ot } from "@progress/kendo-date-math";
|
|
12
|
+
import { useId as rt, useAdaptiveModeContext as at, usePropsContext as lt, canUseDOM as re, AsyncFocusBlur as it, classNames as ae, kendoThemeMaps as le, createPropsContext as ut, Keys as k } from "@progress/kendo-react-common";
|
|
13
|
+
import { calendarIcon as st } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { DateInput as ct } from "../dateinput/DateInput.mjs";
|
|
15
|
+
import { Calendar as dt } from "../calendar/components/Calendar.mjs";
|
|
16
|
+
import { nullable as a, MAX_DATE as ft, MIN_DATE as mt, isInDateRange as pt, setTime as gt } from "../utils.mjs";
|
|
17
|
+
import { toggleCalendar as ie, messages as ht } from "../messages/index.mjs";
|
|
18
|
+
import { useLocalization as vt } from "@progress/kendo-react-intl";
|
|
19
|
+
import { ToggleButton as wt } from "./ToggleButton.mjs";
|
|
20
|
+
import { PickerWrap as bt } from "../common/PickerWrap.mjs";
|
|
21
|
+
import { PickerFloatingLabel as yt } from "../hooks/usePickerFloatingLabel.mjs";
|
|
22
|
+
import { ActionSheetContent as Ct } from "@progress/kendo-react-layout";
|
|
23
|
+
import { AdaptiveMode as Dt } from "../common/AdaptiveMode.mjs";
|
|
24
24
|
const ue = o.forwardRef((n, se) => {
|
|
25
|
-
const N =
|
|
25
|
+
const N = rt(n.id), ce = vt(), g = at(), {
|
|
26
26
|
defaultShow: de = l.defaultShow,
|
|
27
27
|
defaultValue: fe = l.defaultValue,
|
|
28
28
|
dateInput: me = l.dateInput,
|
|
29
29
|
calendar: pe = l.calendar,
|
|
30
30
|
toggleButton: ge = l.toggleButton,
|
|
31
31
|
popup: he = l.popup,
|
|
32
|
-
pickerWrap:
|
|
32
|
+
pickerWrap: Ot = l.pickerWrap,
|
|
33
33
|
disabled: h = l.disabled,
|
|
34
34
|
format: ve = l.format,
|
|
35
35
|
max: R = l.max,
|
|
@@ -42,33 +42,34 @@ const ue = o.forwardRef((n, se) => {
|
|
|
42
42
|
rounded: E = l.rounded,
|
|
43
43
|
fillMode: _ = l.fillMode,
|
|
44
44
|
autoFocus: ye = l.autoFocus,
|
|
45
|
-
show:
|
|
45
|
+
show: L,
|
|
46
46
|
autoSwitchParts: Ce,
|
|
47
47
|
autoSwitchKeys: De,
|
|
48
48
|
twoDigitYearMax: ke,
|
|
49
49
|
ariaLabel: Oe,
|
|
50
|
-
adaptive:
|
|
50
|
+
adaptive: Pt,
|
|
51
51
|
formatPlaceholder: Pe,
|
|
52
52
|
adaptiveTitle: Me,
|
|
53
53
|
inputAttributes: Re,
|
|
54
|
-
validationMessage:
|
|
55
|
-
visited:
|
|
54
|
+
validationMessage: W,
|
|
55
|
+
visited: Mt,
|
|
56
56
|
value: x,
|
|
57
|
-
touched:
|
|
58
|
-
modified:
|
|
59
|
-
_adaptiveMode:
|
|
57
|
+
touched: Rt,
|
|
58
|
+
modified: It,
|
|
59
|
+
_adaptiveMode: St = g,
|
|
60
60
|
valid: K,
|
|
61
61
|
focusedDate: Ie,
|
|
62
62
|
id: Se,
|
|
63
|
+
ariaLabelledBy: Ee,
|
|
63
64
|
...q
|
|
64
|
-
} =
|
|
65
|
+
} = lt(kt, n), B = () => {
|
|
65
66
|
if (re)
|
|
66
67
|
return b.current && b.current.ownerDocument || window.document;
|
|
67
68
|
}, s = () => !!(p.windowWidth && g && p.windowWidth <= (g == null ? void 0 : g.medium) && n.adaptive), d = () => {
|
|
68
69
|
const t = O.current !== void 0 ? O.current : x !== void 0 ? x : p.value;
|
|
69
70
|
return t !== null ? oe(t) : null;
|
|
70
|
-
}, i = () => P.current !== void 0 ? P.current :
|
|
71
|
-
const t = d() || x || null, r = I, u = R, M =
|
|
71
|
+
}, i = () => P.current !== void 0 ? P.current : L !== void 0 ? L : p.show, _e = () => me || l.dateInput, xe = () => ge || l.toggleButton, Be = () => pe || l.calendar, Te = () => he || l.popup, H = () => n.required !== void 0 ? n.required : !1, T = () => {
|
|
72
|
+
const t = d() || x || null, r = I, u = R, M = pt(t, r, u), A = W !== void 0, V = (!H() || t != null) && M, F = K !== void 0 ? K : V;
|
|
72
73
|
return {
|
|
73
74
|
customError: A,
|
|
74
75
|
rangeOverflow: t && u.getTime() < t.getTime() || !1,
|
|
@@ -76,19 +77,19 @@ const ue = o.forwardRef((n, se) => {
|
|
|
76
77
|
valid: F,
|
|
77
78
|
valueMissing: t === null
|
|
78
79
|
};
|
|
79
|
-
},
|
|
80
|
+
}, Ae = (t) => {
|
|
80
81
|
for (const r of t)
|
|
81
82
|
D({ windowWidth: r.target.clientWidth });
|
|
82
|
-
},
|
|
83
|
+
}, Ve = () => {
|
|
83
84
|
c.current && c.current.focus();
|
|
84
85
|
}, U = (t) => {
|
|
85
86
|
y.current = t;
|
|
86
87
|
}, f = (t) => {
|
|
87
88
|
i() !== t && (D({ show: t }), t && n.onOpen && n.onOpen.call(void 0, { target: w.current }), !t && n.onClose && n.onClose.call(void 0, { target: w.current }));
|
|
88
|
-
}, Ve = (t) => {
|
|
89
|
-
const r = d();
|
|
90
|
-
return r && t ? pt(t, r) : t;
|
|
91
89
|
}, Fe = (t) => {
|
|
90
|
+
const r = d();
|
|
91
|
+
return r && t ? gt(t, r) : t;
|
|
92
|
+
}, Ne = (t) => {
|
|
92
93
|
v != null && v.onMouseDownOutside && v.onMouseDownOutside.call(void 0, t);
|
|
93
94
|
}, Y = (t, r) => {
|
|
94
95
|
D({ value: oe(t || void 0) }), O.current = t, P.current = !1, s() || (m.current = !0), n.onChange && n.onChange.call(void 0, {
|
|
@@ -98,11 +99,11 @@ const ue = o.forwardRef((n, se) => {
|
|
|
98
99
|
show: i(),
|
|
99
100
|
target: w.current
|
|
100
101
|
}), O.current = void 0, P.current = void 0, f(!1);
|
|
101
|
-
},
|
|
102
|
-
const r =
|
|
102
|
+
}, ze = (t) => {
|
|
103
|
+
const r = Fe(t.value);
|
|
103
104
|
Y(r, t);
|
|
104
105
|
}, $ = () => {
|
|
105
|
-
const { popupClass: t, ...r } = v, u = i(), M = d(), A = M &&
|
|
106
|
+
const { popupClass: t, ...r } = v, u = i(), M = d(), A = M && ot(M), V = ae(t), F = {
|
|
106
107
|
popupClass: "k-datepicker-popup",
|
|
107
108
|
show: u,
|
|
108
109
|
anchor: b.current,
|
|
@@ -117,7 +118,7 @@ const ue = o.forwardRef((n, se) => {
|
|
|
117
118
|
vertical: "top"
|
|
118
119
|
},
|
|
119
120
|
...r,
|
|
120
|
-
onMouseDownOutside:
|
|
121
|
+
onMouseDownOutside: Ne
|
|
121
122
|
}, te = {
|
|
122
123
|
disabled: h,
|
|
123
124
|
value: A,
|
|
@@ -127,30 +128,30 @@ const ue = o.forwardRef((n, se) => {
|
|
|
127
128
|
focusedDate: Ie,
|
|
128
129
|
className: s() ? "k-calendar-lg" : "",
|
|
129
130
|
navigation: !s(),
|
|
130
|
-
onChange:
|
|
131
|
-
}, ne =
|
|
132
|
-
return s() ? /* @__PURE__ */ o.createElement(ne, { _ref: U, ...te }) : /* @__PURE__ */ o.createElement(
|
|
131
|
+
onChange: ze
|
|
132
|
+
}, ne = Be(), tt = Te();
|
|
133
|
+
return s() ? /* @__PURE__ */ o.createElement(ne, { _ref: U, ...te }) : /* @__PURE__ */ o.createElement(tt, { ...F }, /* @__PURE__ */ o.createElement(ne, { _ref: U, ...te }));
|
|
133
134
|
}, j = () => {
|
|
134
135
|
D({ focused: !1 }), f(!1);
|
|
135
|
-
},
|
|
136
|
+
}, Le = () => {
|
|
136
137
|
const { windowWidth: t = 0 } = p, r = {
|
|
137
138
|
expand: i(),
|
|
138
139
|
onClose: j,
|
|
139
140
|
adaptiveTitle: Me,
|
|
140
141
|
windowWidth: t
|
|
141
142
|
}, u = $();
|
|
142
|
-
return /* @__PURE__ */ o.createElement(
|
|
143
|
+
return /* @__PURE__ */ o.createElement(Dt, { ...r }, /* @__PURE__ */ o.createElement(Ct, { overflowHidden: !0 }, u));
|
|
143
144
|
}, We = (t) => {
|
|
144
145
|
Y(t.value, t);
|
|
145
|
-
}, Le = () => {
|
|
146
|
-
D({ focused: !0 });
|
|
147
146
|
}, Ke = () => {
|
|
147
|
+
D({ focused: !0 });
|
|
148
|
+
}, qe = () => {
|
|
148
149
|
f(!i());
|
|
149
150
|
}, X = () => {
|
|
150
151
|
h || (m.current = !0, f(!i()));
|
|
151
|
-
}, qe = (t) => {
|
|
152
|
-
t.preventDefault();
|
|
153
152
|
}, He = (t) => {
|
|
153
|
+
t.preventDefault();
|
|
154
|
+
}, Ue = (t) => {
|
|
154
155
|
const { altKey: r, keyCode: u } = t;
|
|
155
156
|
if (u === k.esc && i()) {
|
|
156
157
|
m.current = !0, f(!1);
|
|
@@ -186,33 +187,33 @@ const ue = o.forwardRef((n, se) => {
|
|
|
186
187
|
get mobileMode() {
|
|
187
188
|
return s();
|
|
188
189
|
},
|
|
189
|
-
togglePopup:
|
|
190
|
+
togglePopup: qe,
|
|
190
191
|
// Hidden Methods but still accessible
|
|
191
|
-
focus:
|
|
192
|
+
focus: Ve
|
|
192
193
|
})
|
|
193
194
|
), o.useImperativeHandle(se, () => w.current);
|
|
194
|
-
const O = o.useRef(void 0), P = o.useRef(void 0),
|
|
195
|
+
const O = o.useRef(void 0), P = o.useRef(void 0), Ye = o.useRef(null), m = o.useRef(!1), Z = o.useRef(!1), C = o.useRef(null), [p, $e] = o.useState({
|
|
195
196
|
value: fe,
|
|
196
197
|
show: de,
|
|
197
198
|
focused: !1
|
|
198
|
-
}), [,
|
|
199
|
-
|
|
199
|
+
}), [, je] = o.useReducer((t) => t, !0), D = (t) => {
|
|
200
|
+
$e((r) => ({ ...r, ...t }));
|
|
200
201
|
};
|
|
201
202
|
o.useEffect(() => {
|
|
202
203
|
y.current && y.current.element && i() && !Z.current && y.current.element.focus({ preventScroll: !0 }), c.current && c.current.element && !i() && m.current && c.current.element.focus({ preventScroll: !0 }), Z.current = i(), m.current = !1;
|
|
203
204
|
}), o.useEffect(() => {
|
|
204
205
|
var t;
|
|
205
|
-
return C.current = re && window.ResizeObserver && new window.ResizeObserver((r) =>
|
|
206
|
+
return C.current = re && window.ResizeObserver && new window.ResizeObserver((r) => Ae(r)), i() && je(), (t = B()) != null && t.body && C.current && C.current.observe(B().body), () => {
|
|
206
207
|
var r;
|
|
207
|
-
clearTimeout(
|
|
208
|
+
clearTimeout(Ye.current), (r = B()) != null && r.body && C.current && C.current.disconnect();
|
|
208
209
|
};
|
|
209
210
|
}, []);
|
|
210
|
-
const G = N + "-popup-id",
|
|
211
|
+
const G = N + "-popup-id", Xe = $(), Ze = _e(), Ge = d(), Je = xe(), Qe = Le(), J = !z || T().valid, Q = ce.toLanguageString(ie, ht[ie]), et = {
|
|
211
212
|
disabled: h,
|
|
212
213
|
format: ve,
|
|
213
214
|
formatPlaceholder: Pe,
|
|
214
215
|
id: Se,
|
|
215
|
-
ariaLabelledBy:
|
|
216
|
+
ariaLabelledBy: Ee,
|
|
216
217
|
ariaDescribedBy: n.ariaDescribedBy,
|
|
217
218
|
ariaLabel: Oe,
|
|
218
219
|
max: R,
|
|
@@ -224,9 +225,9 @@ const ue = o.forwardRef((n, se) => {
|
|
|
224
225
|
tabIndex: i() ? -1 : we,
|
|
225
226
|
title: n.title,
|
|
226
227
|
valid: T().valid,
|
|
227
|
-
validationMessage:
|
|
228
|
+
validationMessage: W,
|
|
228
229
|
validityStyles: z,
|
|
229
|
-
value:
|
|
230
|
+
value: Ge,
|
|
230
231
|
label: void 0,
|
|
231
232
|
placeholder: p.focused ? null : n.placeholder,
|
|
232
233
|
ariaExpanded: i(),
|
|
@@ -242,9 +243,9 @@ const ue = o.forwardRef((n, se) => {
|
|
|
242
243
|
allowCaretMode: n.allowCaretMode,
|
|
243
244
|
inputAttributes: Re
|
|
244
245
|
}, ee = /* @__PURE__ */ o.createElement(
|
|
245
|
-
|
|
246
|
+
it,
|
|
246
247
|
{
|
|
247
|
-
onFocus:
|
|
248
|
+
onFocus: Ke,
|
|
248
249
|
onBlur: s() ? void 0 : j,
|
|
249
250
|
onSyncBlur: n.onBlur,
|
|
250
251
|
onSyncFocus: n.onFocus
|
|
@@ -267,43 +268,43 @@ const ue = o.forwardRef((n, se) => {
|
|
|
267
268
|
},
|
|
268
269
|
n.className
|
|
269
270
|
),
|
|
270
|
-
onKeyDown:
|
|
271
|
+
onKeyDown: Ue,
|
|
271
272
|
style: { width: n.width },
|
|
272
273
|
onFocus: t.onFocus,
|
|
273
274
|
onBlur: t.onBlur,
|
|
274
275
|
onClick: s() ? X : void 0
|
|
275
276
|
},
|
|
276
277
|
/* @__PURE__ */ o.createElement(
|
|
277
|
-
|
|
278
|
+
Ze,
|
|
278
279
|
{
|
|
279
280
|
_ref: c,
|
|
280
281
|
ariaRole: "combobox",
|
|
281
282
|
ariaExpanded: i(),
|
|
282
283
|
ariaControls: G,
|
|
283
284
|
autoFocus: ye,
|
|
284
|
-
...
|
|
285
|
+
...et
|
|
285
286
|
}
|
|
286
287
|
),
|
|
287
288
|
/* @__PURE__ */ o.createElement(
|
|
288
|
-
|
|
289
|
+
Je,
|
|
289
290
|
{
|
|
290
291
|
type: "button",
|
|
291
292
|
icon: "calendar",
|
|
292
|
-
svgIcon:
|
|
293
|
+
svgIcon: st,
|
|
293
294
|
title: Q,
|
|
294
295
|
className: "k-input-button",
|
|
295
296
|
rounded: null,
|
|
296
297
|
onClick: s() ? void 0 : X,
|
|
297
298
|
"aria-label": Q,
|
|
298
299
|
fillMode: _,
|
|
299
|
-
onMouseDown:
|
|
300
|
+
onMouseDown: He
|
|
300
301
|
}
|
|
301
302
|
),
|
|
302
|
-
!s() &&
|
|
303
|
-
), s() &&
|
|
303
|
+
!s() && Xe
|
|
304
|
+
), s() && Qe)
|
|
304
305
|
);
|
|
305
306
|
return n.label ? /* @__PURE__ */ o.createElement(
|
|
306
|
-
|
|
307
|
+
yt,
|
|
307
308
|
{
|
|
308
309
|
dateInput: c,
|
|
309
310
|
label: n.label,
|
|
@@ -387,15 +388,15 @@ ue.propTypes = {
|
|
|
387
388
|
const l = {
|
|
388
389
|
defaultShow: !1,
|
|
389
390
|
defaultValue: null,
|
|
390
|
-
dateInput:
|
|
391
|
-
calendar:
|
|
392
|
-
toggleButton:
|
|
393
|
-
popup:
|
|
394
|
-
pickerWrap:
|
|
391
|
+
dateInput: ct,
|
|
392
|
+
calendar: dt,
|
|
393
|
+
toggleButton: wt,
|
|
394
|
+
popup: nt,
|
|
395
|
+
pickerWrap: bt,
|
|
395
396
|
disabled: !1,
|
|
396
397
|
format: "d",
|
|
397
|
-
max:
|
|
398
|
-
min:
|
|
398
|
+
max: ft,
|
|
399
|
+
min: mt,
|
|
399
400
|
popupSettings: {},
|
|
400
401
|
tabIndex: 0,
|
|
401
402
|
weekNumber: !1,
|
|
@@ -404,10 +405,10 @@ const l = {
|
|
|
404
405
|
rounded: "medium",
|
|
405
406
|
fillMode: "solid",
|
|
406
407
|
autoFocus: !1
|
|
407
|
-
},
|
|
408
|
+
}, kt = ut();
|
|
408
409
|
ue.displayName = "KendoReactDatePicker";
|
|
409
410
|
export {
|
|
410
411
|
ue as DatePicker,
|
|
411
|
-
|
|
412
|
+
kt as DatePickerPropsContext,
|
|
412
413
|
l as datePickerDefaultProps
|
|
413
414
|
};
|