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