@progress/kendo-react-dateinputs 11.0.0-develop.1 → 11.0.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.
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +14 -13
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +166 -159
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +17 -15
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +49 -46
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +23 -21
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +42 -6
- package/index.d.ts +42 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +39 -37
- package/timepicker/TimeSelector.js +1 -1
- package/timepicker/TimeSelector.mjs +49 -48
- package/utils.js +1 -1
- package/utils.mjs +3 -1
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +1 -1
package/common/AdaptiveMode.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 v=require("react"),c=require("@progress/kendo-react-layout"),h=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-react-common");function x(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const n=x(v),C=t=>{const{footer:e,windowWidth:a=0,mobileFilter:o,children:s,navigatable:d,navigatableElements:u,expand:b,animation:m,title:p,subTitle:f,onClose:r}=t,g=()=>n.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:h.checkIcon,onClick:r}),l=k.useAdaptiveModeContext(),y={navigatable:d||!1,navigatableElements:u||[],expand:b,animation:m!==!1,suffixActions:g(),filter:o,onClose:r,animationStyles:l&&a<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:p,subTitle:f,className:"k-adaptive-actionsheet",position:l&&a<=l.small?"fullscreen":void 0};return n.createElement(c.ActionSheet,{...y},s,e&&n.createElement(c.ActionSheetFooter,{className:"k-actions k-actions-stretched"},n.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),n.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=C;
|
package/common/AdaptiveMode.mjs
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import { ActionSheet as u, ActionSheetFooter as v } from "@progress/kendo-react-layout";
|
|
10
|
-
import {
|
|
10
|
+
import { checkIcon as C } from "@progress/kendo-svg-icons";
|
|
11
11
|
import { Button as o } from "@progress/kendo-react-buttons";
|
|
12
12
|
import { useAdaptiveModeContext as g } from "@progress/kendo-react-common";
|
|
13
|
-
const I = (
|
|
13
|
+
const I = (n) => {
|
|
14
14
|
const {
|
|
15
15
|
footer: e,
|
|
16
|
-
windowWidth:
|
|
16
|
+
windowWidth: l = 0,
|
|
17
17
|
mobileFilter: r,
|
|
18
18
|
children: s,
|
|
19
19
|
navigatable: c,
|
|
@@ -22,8 +22,8 @@ const I = (i) => {
|
|
|
22
22
|
animation: p,
|
|
23
23
|
title: b,
|
|
24
24
|
subTitle: f,
|
|
25
|
-
onClose:
|
|
26
|
-
} =
|
|
25
|
+
onClose: i
|
|
26
|
+
} = n, h = () => /* @__PURE__ */ t.createElement(
|
|
27
27
|
o,
|
|
28
28
|
{
|
|
29
29
|
tabIndex: 0,
|
|
@@ -31,25 +31,26 @@ const I = (i) => {
|
|
|
31
31
|
"aria-disabled": "false",
|
|
32
32
|
type: "button",
|
|
33
33
|
fillMode: "flat",
|
|
34
|
-
|
|
34
|
+
size: "large",
|
|
35
|
+
themeColor: "primary",
|
|
35
36
|
svgIcon: C,
|
|
36
|
-
onClick:
|
|
37
|
+
onClick: i
|
|
37
38
|
}
|
|
38
|
-
), a = g(),
|
|
39
|
+
), a = g(), x = {
|
|
39
40
|
navigatable: c || !1,
|
|
40
41
|
navigatableElements: m || [],
|
|
41
42
|
expand: d,
|
|
42
43
|
animation: p !== !1,
|
|
43
|
-
suffixActions:
|
|
44
|
+
suffixActions: h(),
|
|
44
45
|
filter: r,
|
|
45
|
-
onClose:
|
|
46
|
-
animationStyles: a &&
|
|
46
|
+
onClose: i,
|
|
47
|
+
animationStyles: a && l <= a.small ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
47
48
|
title: b,
|
|
48
49
|
subTitle: f,
|
|
49
50
|
className: "k-adaptive-actionsheet",
|
|
50
|
-
position: a &&
|
|
51
|
+
position: a && l <= a.small ? "fullscreen" : void 0
|
|
51
52
|
};
|
|
52
|
-
return /* @__PURE__ */ t.createElement(u, { ...
|
|
53
|
+
return /* @__PURE__ */ t.createElement(u, { ...x }, s, e && /* @__PURE__ */ t.createElement(v, { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ t.createElement(
|
|
53
54
|
o,
|
|
54
55
|
{
|
|
55
56
|
size: "large",
|
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 at=require("react"),e=require("prop-types"),ot=require("@progress/kendo-react-popup"),W=require("@progress/kendo-date-math"),i=require("@progress/kendo-react-common"),rt=require("@progress/kendo-svg-icons"),lt=require("../dateinput/DateInput.js"),ut=require("../calendar/components/Calendar.js"),o=require("../utils.js"),j=require("../messages/index.js"),it=require("@progress/kendo-react-intl"),st=require("./ToggleButton.js"),ct=require("../common/PickerWrap.js"),dt=require("../hooks/usePickerFloatingLabel.js"),ft=require("@progress/kendo-react-layout"),mt=require("../common/AdaptiveMode.js");function pt(n){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const m in n)if(m!=="default"){const M=Object.getOwnPropertyDescriptor(n,m);Object.defineProperty(v,m,M.get?M:{enumerable:!0,get:()=>n[m]})}}return v.default=n,Object.freeze(v)}const a=pt(at),U=a.forwardRef((n,v)=>{const m=i.useId(n.id),M=it.useLocalization(),w=i.useAdaptiveModeContext(),{defaultShow:se=l.defaultShow,defaultValue:ce=l.defaultValue,dateInput:de=l.dateInput,calendar:fe=l.calendar,toggleButton:me=l.toggleButton,popup:pe=l.popup,pickerWrap:gt=l.pickerWrap,disabled:y=l.disabled,format:ge=l.format,max:_=l.max,min:T=l.min,popupSettings:k=l.popupSettings,tabIndex:be=l.tabIndex,weekNumber:he=l.weekNumber,validityStyles:H=l.validityStyles,size:B=l.size,rounded:E=l.rounded,fillMode:x=l.fillMode,autoFocus:ve=l.autoFocus,show:Y,autoSwitchParts:we,autoSwitchKeys:ye,twoDigitYearMax:ke,ariaLabel:De,adaptive:bt,adaptiveTitle:Ce=n.label||void 0,adaptiveSubtitle:Pe,formatPlaceholder:Oe,inputAttributes:Me,validationMessage:$,visited:ht,value:q,touched:vt,modified:wt,_adaptiveMode:yt=w,valid:X,focusedDate:Re,id:Se,ariaLabelledBy:Ie,ariaDescribedBy:_e,placeholder:Te,...Z}=i.usePropsContext(ie,n),A=()=>{if(i.canUseDOM)return C.current&&C.current.ownerDocument||window.document},s=()=>!!(h.windowWidth&&w&&h.windowWidth<=(w==null?void 0:w.medium)&&n.adaptive),p=()=>{const t=R.current!==void 0?R.current:q!==void 0?q:h.value;return t!==null?W.cloneDate(t):null},u=()=>S.current!==void 0?S.current:Y!==void 0?Y:h.show,Be=()=>de||l.dateInput,Ee=()=>me||l.toggleButton,xe=()=>fe||l.calendar,qe=()=>pe||l.popup,G=()=>n.required!==void 0?n.required:!1,N=()=>{const t=p()||q||null,r=T,c=_,I=o.isInDateRange(t,r,c),z=$!==void 0,L=(!G()||t!=null)&&I,K=X!==void 0?X:L;return{customError:z,rangeOverflow:t&&c.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<r.getTime()||!1,valid:K,valueMissing:t===null}},Ae=t=>{for(const r of t)O({windowWidth:r.target.clientWidth})},Ne=()=>{d.current&&d.current.focus()},J=t=>{f.current=t},g=t=>{u()!==t&&(O({show:t}),t&&n.onOpen&&n.onOpen.call(void 0,{target:D.current}),!t&&n.onClose&&n.onClose.call(void 0,{target:D.current}))},Fe=t=>{const r=p();return r&&t?o.setTime(t,r):t},Ve=t=>{k!=null&&k.onMouseDownOutside&&k.onMouseDownOutside.call(void 0,t)},Q=(t,r)=>{O({value:W.cloneDate(t||void 0)}),R.current=t,S.current=!1,s()||(b.current=!0),n.onChange&&n.onChange.call(void 0,{syntheticEvent:r.syntheticEvent,nativeEvent:r.nativeEvent,value:p(),show:u(),target:D.current}),R.current=void 0,S.current=void 0,g(!1)},ze=t=>{const r=Fe(t.value);Q(r,t)},ee=()=>{const{popupClass:t,...r}=k,c=u(),I=p(),z=I&&W.getDate(I),L=i.classNames(t),K={popupClass:"k-datepicker-popup",show:c,anchor:C.current,className:L,id:ne,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...r,onMouseDownOutside:Ve},le={disabled:y,value:z,min:T,max:_,weekNumber:he,focusedDate:Re,className:s()?"k-calendar-lg":"",navigation:!s(),onChange:ze},ue=xe(),nt=qe();return s()?a.createElement(ue,{_ref:J,...le}):a.createElement(nt,{...K},a.createElement(ue,{_ref:J,...le}))},te=()=>{O({focused:!1}),g(!1)},Le=()=>{const{windowWidth:t=0}=h,r={expand:u(),onClose:te,title:Ce,subTitle:Pe,windowWidth:t};return a.createElement(mt.AdaptiveMode,{...r},a.createElement(ft.ActionSheetContent,null,ee()))},Ke=t=>{Q(t.value,t)},We=()=>{O({focused:!0})},je=()=>{g(!u())},F=()=>{y||(b.current=!0,g(!u()))},Ue=t=>{t.preventDefault()},He=t=>{const{altKey:r,keyCode:c}=t;if(c===i.Keys.esc&&u()){b.current=!0,g(!1);return}r&&(c===i.Keys.up||c===i.Keys.down)&&(t.preventDefault(),t.stopPropagation(),b.current=c===i.Keys.up,g(c===i.Keys.down))},D=a.useRef(null),C=a.useRef(null),d=a.useRef(null),f=a.useRef(null);a.useImperativeHandle(D,()=>({props:n,get element(){return C.current},get calendar(){return f.current},get dateInput(){return d.current},get name(){return n.name},get show(){return u()},get validity(){return N()},get value(){return p()},get mobileMode(){return s()},togglePopup:je,focus:Ne})),a.useImperativeHandle(v,()=>D.current);const R=a.useRef(void 0),S=a.useRef(void 0),Ye=a.useRef(null),b=a.useRef(!1),V=a.useRef(!1),P=a.useRef(null),[h,$e]=a.useState({value:ce,show:se,focused:!1}),[,Xe]=a.useReducer(t=>t,!0),O=t=>{$e(r=>({...r,...t}))};a.useEffect(()=>{f.current&&f.current.element&&u()&&!V.current&&f.current.element.focus({preventScroll:!0}),s()&&u()&&!V.current&&setTimeout(()=>{f.current&&f.current.element&&f.current.element.focus({preventScroll:!0})},300),d.current&&d.current.element&&!u()&&b.current&&d.current.element.focus({preventScroll:!0}),V.current=u(),b.current=!1}),a.useEffect(()=>{var t;return P.current=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(r=>Ae(r)),u()&&Xe(),(t=A())!=null&&t.body&&P.current&&P.current.observe(A().body),()=>{var r;clearTimeout(Ye.current),(r=A())!=null&&r.body&&P.current&&P.current.disconnect()}},[]);const ne=m+"-popup-id",Ze=ee(),Ge=Be(),Je=p(),Qe=Ee(),et=Le(),ae=!H||N().valid,oe=M.toLanguageString(j.toggleCalendar,j.messages[j.toggleCalendar]),tt={disabled:y,format:ge,formatPlaceholder:Oe,id:Se,ariaLabelledBy:Ie,ariaDescribedBy:_e,ariaLabel:De,max:_,min:T,name:n.name,onChange:Ke,required:n.required,_ref:d,tabIndex:u()?-1:be,title:n.title,valid:N().valid,validationMessage:$,validityStyles:H,value:Je,label:void 0,placeholder:h.focused?null:Te,ariaExpanded:u(),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:Me},re=a.createElement(i.AsyncFocusBlur,{onFocus:We,onBlur:s()?void 0:te,onSyncBlur:n.onBlur,onSyncFocus:n.onFocus},t=>a.createElement(a.Fragment,null,a.createElement("span",{...n.label?{}:Z,ref:C,className:i.classNames("k-input","k-datepicker",{[`k-input-${i.kendoThemeMaps.sizeMap[B]||B}`]:B,[`k-rounded-${i.kendoThemeMaps.roundedMap[E]||E}`]:E,[`k-input-${x}`]:x,"k-invalid":!ae,"k-required":G(),"k-disabled":y},n.className),onKeyDown:He,style:{width:n.width},onFocus:s()?F:t.onFocus,onBlur:t.onBlur,onClick:s()?F:void 0},a.createElement(Ge,{_ref:d,ariaRole:"combobox",ariaExpanded:u(),ariaControls:ne,autoFocus:ve,...tt}),a.createElement(Qe,{type:"button",icon:"calendar",svgIcon:rt.calendarIcon,title:oe,className:"k-input-button",rounded:null,onClick:s()?void 0:F,"aria-label":oe,fillMode:x,onMouseDown:Ue}),!s()&&Ze),s()&&et));return n.label?a.createElement(dt.PickerFloatingLabel,{dateInput:d,label:n.label,editorId:m,editorValid:ae,editorDisabled:y,children:re,style:{width:n.width},...Z}):re});U.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,adaptiveSubtitle:e.string,autoFocus:e.bool,inputAttributes:e.object};const l={defaultShow:!1,defaultValue:null,dateInput:lt.DateInput,calendar:ut.Calendar,toggleButton:st.ToggleButton,popup:ot.Popup,pickerWrap:ct.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=i.createPropsContext();U.displayName="KendoReactDatePicker";exports.DatePicker=U;exports.DatePickerPropsContext=ie;exports.datePickerDefaultProps=l;
|
|
@@ -7,107 +7,110 @@
|
|
|
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 at } from "@progress/kendo-react-popup";
|
|
11
|
+
import { cloneDate as oe, getDate as lt } from "@progress/kendo-date-math";
|
|
12
|
+
import { useId as it, useAdaptiveModeContext as ut, usePropsContext as st, canUseDOM as re, AsyncFocusBlur as ct, classNames as ae, kendoThemeMaps as le, createPropsContext as dt, Keys as k } from "@progress/kendo-react-common";
|
|
13
|
+
import { calendarIcon as ft } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { DateInput as mt } from "../dateinput/DateInput.mjs";
|
|
15
|
+
import { Calendar as pt } from "../calendar/components/Calendar.mjs";
|
|
16
|
+
import { nullable as a, MAX_DATE as gt, MIN_DATE as ht, isInDateRange as vt, setTime as bt } from "../utils.mjs";
|
|
17
|
+
import { toggleCalendar as ie, messages as wt } from "../messages/index.mjs";
|
|
18
|
+
import { useLocalization as yt } from "@progress/kendo-react-intl";
|
|
19
|
+
import { ToggleButton as Ct } from "./ToggleButton.mjs";
|
|
20
|
+
import { PickerWrap as Dt } from "../common/PickerWrap.mjs";
|
|
21
|
+
import { PickerFloatingLabel as kt } from "../hooks/usePickerFloatingLabel.mjs";
|
|
22
|
+
import { ActionSheetContent as Ot } from "@progress/kendo-react-layout";
|
|
23
|
+
import { AdaptiveMode as Mt } from "../common/AdaptiveMode.mjs";
|
|
24
24
|
const ue = o.forwardRef((n, se) => {
|
|
25
|
-
const
|
|
25
|
+
const L = it(n.id), ce = yt(), h = ut(), {
|
|
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:
|
|
33
|
-
disabled:
|
|
32
|
+
pickerWrap: Rt = l.pickerWrap,
|
|
33
|
+
disabled: v = l.disabled,
|
|
34
34
|
format: ve = l.format,
|
|
35
35
|
max: R = l.max,
|
|
36
36
|
min: I = l.min,
|
|
37
|
-
popupSettings:
|
|
38
|
-
tabIndex:
|
|
39
|
-
weekNumber:
|
|
40
|
-
validityStyles:
|
|
37
|
+
popupSettings: b = l.popupSettings,
|
|
38
|
+
tabIndex: be = l.tabIndex,
|
|
39
|
+
weekNumber: we = l.weekNumber,
|
|
40
|
+
validityStyles: W = l.validityStyles,
|
|
41
41
|
size: S = l.size,
|
|
42
|
-
rounded:
|
|
43
|
-
fillMode:
|
|
42
|
+
rounded: _ = l.rounded,
|
|
43
|
+
fillMode: E = l.fillMode,
|
|
44
44
|
autoFocus: ye = l.autoFocus,
|
|
45
|
-
show:
|
|
45
|
+
show: K,
|
|
46
46
|
autoSwitchParts: Ce,
|
|
47
47
|
autoSwitchKeys: De,
|
|
48
48
|
twoDigitYearMax: ke,
|
|
49
49
|
ariaLabel: Oe,
|
|
50
|
-
adaptive:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
adaptive: It,
|
|
51
|
+
adaptiveTitle: Me = n.label || void 0,
|
|
52
|
+
adaptiveSubtitle: Pe,
|
|
53
|
+
formatPlaceholder: Re,
|
|
54
|
+
inputAttributes: Ie,
|
|
55
|
+
validationMessage: q,
|
|
56
|
+
visited: St,
|
|
57
|
+
value: B,
|
|
58
|
+
touched: _t,
|
|
59
|
+
modified: Et,
|
|
60
|
+
_adaptiveMode: Bt = h,
|
|
61
|
+
valid: H,
|
|
62
|
+
focusedDate: Se,
|
|
63
|
+
id: _e,
|
|
63
64
|
ariaLabelledBy: Ee,
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
ariaDescribedBy: Be,
|
|
66
|
+
placeholder: xe,
|
|
67
|
+
...U
|
|
68
|
+
} = st(Pt, n), x = () => {
|
|
66
69
|
if (re)
|
|
67
|
-
return
|
|
68
|
-
},
|
|
69
|
-
const t = O.current !== void 0 ? O.current :
|
|
70
|
+
return y.current && y.current.ownerDocument || window.document;
|
|
71
|
+
}, u = () => !!(g.windowWidth && h && g.windowWidth <= (h == null ? void 0 : h.medium) && n.adaptive), f = () => {
|
|
72
|
+
const t = O.current !== void 0 ? O.current : B !== void 0 ? B : g.value;
|
|
70
73
|
return t !== null ? oe(t) : null;
|
|
71
|
-
}, i = () =>
|
|
72
|
-
const t =
|
|
74
|
+
}, i = () => M.current !== void 0 ? M.current : K !== void 0 ? K : g.show, Te = () => me || l.dateInput, Ae = () => ge || l.toggleButton, Ve = () => pe || l.calendar, Fe = () => he || l.popup, Y = () => n.required !== void 0 ? n.required : !1, T = () => {
|
|
75
|
+
const t = f() || B || null, r = I, s = R, P = vt(t, r, s), F = q !== void 0, N = (!Y() || t != null) && P, z = H !== void 0 ? H : N;
|
|
73
76
|
return {
|
|
74
|
-
customError:
|
|
75
|
-
rangeOverflow: t &&
|
|
77
|
+
customError: F,
|
|
78
|
+
rangeOverflow: t && s.getTime() < t.getTime() || !1,
|
|
76
79
|
rangeUnderflow: t && t.getTime() < r.getTime() || !1,
|
|
77
|
-
valid:
|
|
80
|
+
valid: z,
|
|
78
81
|
valueMissing: t === null
|
|
79
82
|
};
|
|
80
|
-
},
|
|
83
|
+
}, Ne = (t) => {
|
|
81
84
|
for (const r of t)
|
|
82
85
|
D({ windowWidth: r.target.clientWidth });
|
|
83
|
-
},
|
|
86
|
+
}, ze = () => {
|
|
84
87
|
c.current && c.current.focus();
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
+
}, $ = (t) => {
|
|
89
|
+
d.current = t;
|
|
90
|
+
}, m = (t) => {
|
|
88
91
|
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 }));
|
|
89
|
-
},
|
|
90
|
-
const r =
|
|
91
|
-
return r && t ?
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
D({ value: oe(t || void 0) }), O.current = t,
|
|
92
|
+
}, Le = (t) => {
|
|
93
|
+
const r = f();
|
|
94
|
+
return r && t ? bt(t, r) : t;
|
|
95
|
+
}, We = (t) => {
|
|
96
|
+
b != null && b.onMouseDownOutside && b.onMouseDownOutside.call(void 0, t);
|
|
97
|
+
}, j = (t, r) => {
|
|
98
|
+
D({ value: oe(t || void 0) }), O.current = t, M.current = !1, u() || (p.current = !0), n.onChange && n.onChange.call(void 0, {
|
|
96
99
|
syntheticEvent: r.syntheticEvent,
|
|
97
100
|
nativeEvent: r.nativeEvent,
|
|
98
|
-
value:
|
|
101
|
+
value: f(),
|
|
99
102
|
show: i(),
|
|
100
103
|
target: w.current
|
|
101
|
-
}), O.current = void 0,
|
|
102
|
-
},
|
|
103
|
-
const r =
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
const { popupClass: t, ...r } =
|
|
104
|
+
}), O.current = void 0, M.current = void 0, m(!1);
|
|
105
|
+
}, Ke = (t) => {
|
|
106
|
+
const r = Le(t.value);
|
|
107
|
+
j(r, t);
|
|
108
|
+
}, X = () => {
|
|
109
|
+
const { popupClass: t, ...r } = b, s = i(), P = f(), F = P && lt(P), N = ae(t), z = {
|
|
107
110
|
popupClass: "k-datepicker-popup",
|
|
108
|
-
show:
|
|
109
|
-
anchor:
|
|
110
|
-
className:
|
|
111
|
+
show: s,
|
|
112
|
+
anchor: y.current,
|
|
113
|
+
className: N,
|
|
111
114
|
id: G,
|
|
112
115
|
anchorAlign: {
|
|
113
116
|
horizontal: "left",
|
|
@@ -118,56 +121,57 @@ const ue = o.forwardRef((n, se) => {
|
|
|
118
121
|
vertical: "top"
|
|
119
122
|
},
|
|
120
123
|
...r,
|
|
121
|
-
onMouseDownOutside:
|
|
124
|
+
onMouseDownOutside: We
|
|
122
125
|
}, te = {
|
|
123
|
-
disabled:
|
|
124
|
-
value:
|
|
126
|
+
disabled: v,
|
|
127
|
+
value: F,
|
|
125
128
|
min: I,
|
|
126
129
|
max: R,
|
|
127
|
-
weekNumber:
|
|
128
|
-
focusedDate:
|
|
129
|
-
className:
|
|
130
|
-
navigation: !
|
|
131
|
-
onChange:
|
|
132
|
-
}, ne =
|
|
133
|
-
return
|
|
134
|
-
},
|
|
135
|
-
D({ focused: !1 }),
|
|
136
|
-
},
|
|
137
|
-
const { windowWidth: t = 0 } =
|
|
130
|
+
weekNumber: we,
|
|
131
|
+
focusedDate: Se,
|
|
132
|
+
className: u() ? "k-calendar-lg" : "",
|
|
133
|
+
navigation: !u(),
|
|
134
|
+
onChange: Ke
|
|
135
|
+
}, ne = Ve(), rt = Fe();
|
|
136
|
+
return u() ? /* @__PURE__ */ o.createElement(ne, { _ref: $, ...te }) : /* @__PURE__ */ o.createElement(rt, { ...z }, /* @__PURE__ */ o.createElement(ne, { _ref: $, ...te }));
|
|
137
|
+
}, Z = () => {
|
|
138
|
+
D({ focused: !1 }), m(!1);
|
|
139
|
+
}, qe = () => {
|
|
140
|
+
const { windowWidth: t = 0 } = g, r = {
|
|
138
141
|
expand: i(),
|
|
139
|
-
onClose:
|
|
140
|
-
|
|
142
|
+
onClose: Z,
|
|
143
|
+
title: Me,
|
|
144
|
+
subTitle: Pe,
|
|
141
145
|
windowWidth: t
|
|
142
|
-
}
|
|
143
|
-
return /* @__PURE__ */ o.createElement(
|
|
144
|
-
}, We = (t) => {
|
|
145
|
-
Y(t.value, t);
|
|
146
|
-
}, Ke = () => {
|
|
147
|
-
D({ focused: !0 });
|
|
148
|
-
}, qe = () => {
|
|
149
|
-
f(!i());
|
|
150
|
-
}, X = () => {
|
|
151
|
-
h || (m.current = !0, f(!i()));
|
|
146
|
+
};
|
|
147
|
+
return /* @__PURE__ */ o.createElement(Mt, { ...r }, /* @__PURE__ */ o.createElement(Ot, null, X()));
|
|
152
148
|
}, He = (t) => {
|
|
149
|
+
j(t.value, t);
|
|
150
|
+
}, Ue = () => {
|
|
151
|
+
D({ focused: !0 });
|
|
152
|
+
}, Ye = () => {
|
|
153
|
+
m(!i());
|
|
154
|
+
}, A = () => {
|
|
155
|
+
v || (p.current = !0, m(!i()));
|
|
156
|
+
}, $e = (t) => {
|
|
153
157
|
t.preventDefault();
|
|
154
|
-
},
|
|
155
|
-
const { altKey: r, keyCode:
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
+
}, je = (t) => {
|
|
159
|
+
const { altKey: r, keyCode: s } = t;
|
|
160
|
+
if (s === k.esc && i()) {
|
|
161
|
+
p.current = !0, m(!1);
|
|
158
162
|
return;
|
|
159
163
|
}
|
|
160
|
-
r && (
|
|
161
|
-
}, w = o.useRef(null),
|
|
164
|
+
r && (s === k.up || s === k.down) && (t.preventDefault(), t.stopPropagation(), p.current = s === k.up, m(s === k.down));
|
|
165
|
+
}, w = o.useRef(null), y = o.useRef(null), c = o.useRef(null), d = o.useRef(null);
|
|
162
166
|
o.useImperativeHandle(
|
|
163
167
|
w,
|
|
164
168
|
() => ({
|
|
165
169
|
props: n,
|
|
166
170
|
get element() {
|
|
167
|
-
return
|
|
171
|
+
return y.current;
|
|
168
172
|
},
|
|
169
173
|
get calendar() {
|
|
170
|
-
return
|
|
174
|
+
return d.current;
|
|
171
175
|
},
|
|
172
176
|
get dateInput() {
|
|
173
177
|
return c.current;
|
|
@@ -182,54 +186,56 @@ const ue = o.forwardRef((n, se) => {
|
|
|
182
186
|
return T();
|
|
183
187
|
},
|
|
184
188
|
get value() {
|
|
185
|
-
return
|
|
189
|
+
return f();
|
|
186
190
|
},
|
|
187
191
|
get mobileMode() {
|
|
188
|
-
return
|
|
192
|
+
return u();
|
|
189
193
|
},
|
|
190
|
-
togglePopup:
|
|
194
|
+
togglePopup: Ye,
|
|
191
195
|
// Hidden Methods but still accessible
|
|
192
|
-
focus:
|
|
196
|
+
focus: ze
|
|
193
197
|
})
|
|
194
198
|
), o.useImperativeHandle(se, () => w.current);
|
|
195
|
-
const O = o.useRef(void 0),
|
|
199
|
+
const O = o.useRef(void 0), M = o.useRef(void 0), Xe = o.useRef(null), p = o.useRef(!1), V = o.useRef(!1), C = o.useRef(null), [g, Ze] = o.useState({
|
|
196
200
|
value: fe,
|
|
197
201
|
show: de,
|
|
198
202
|
focused: !1
|
|
199
|
-
}), [,
|
|
200
|
-
|
|
203
|
+
}), [, Ge] = o.useReducer((t) => t, !0), D = (t) => {
|
|
204
|
+
Ze((r) => ({ ...r, ...t }));
|
|
201
205
|
};
|
|
202
206
|
o.useEffect(() => {
|
|
203
|
-
|
|
207
|
+
d.current && d.current.element && i() && !V.current && d.current.element.focus({ preventScroll: !0 }), u() && i() && !V.current && setTimeout(() => {
|
|
208
|
+
d.current && d.current.element && d.current.element.focus({ preventScroll: !0 });
|
|
209
|
+
}, 300), c.current && c.current.element && !i() && p.current && c.current.element.focus({ preventScroll: !0 }), V.current = i(), p.current = !1;
|
|
204
210
|
}), o.useEffect(() => {
|
|
205
211
|
var t;
|
|
206
|
-
return C.current = re && window.ResizeObserver && new window.ResizeObserver((r) =>
|
|
212
|
+
return C.current = re && window.ResizeObserver && new window.ResizeObserver((r) => Ne(r)), i() && Ge(), (t = x()) != null && t.body && C.current && C.current.observe(x().body), () => {
|
|
207
213
|
var r;
|
|
208
|
-
clearTimeout(
|
|
214
|
+
clearTimeout(Xe.current), (r = x()) != null && r.body && C.current && C.current.disconnect();
|
|
209
215
|
};
|
|
210
216
|
}, []);
|
|
211
|
-
const G =
|
|
212
|
-
disabled:
|
|
217
|
+
const G = L + "-popup-id", Je = X(), Qe = Te(), et = f(), tt = Ae(), nt = qe(), J = !W || T().valid, Q = ce.toLanguageString(ie, wt[ie]), ot = {
|
|
218
|
+
disabled: v,
|
|
213
219
|
format: ve,
|
|
214
|
-
formatPlaceholder:
|
|
215
|
-
id:
|
|
220
|
+
formatPlaceholder: Re,
|
|
221
|
+
id: _e,
|
|
216
222
|
ariaLabelledBy: Ee,
|
|
217
|
-
ariaDescribedBy:
|
|
223
|
+
ariaDescribedBy: Be,
|
|
218
224
|
ariaLabel: Oe,
|
|
219
225
|
max: R,
|
|
220
226
|
min: I,
|
|
221
227
|
name: n.name,
|
|
222
|
-
onChange:
|
|
228
|
+
onChange: He,
|
|
223
229
|
required: n.required,
|
|
224
230
|
_ref: c,
|
|
225
|
-
tabIndex: i() ? -1 :
|
|
231
|
+
tabIndex: i() ? -1 : be,
|
|
226
232
|
title: n.title,
|
|
227
233
|
valid: T().valid,
|
|
228
|
-
validationMessage:
|
|
229
|
-
validityStyles:
|
|
230
|
-
value:
|
|
234
|
+
validationMessage: q,
|
|
235
|
+
validityStyles: W,
|
|
236
|
+
value: et,
|
|
231
237
|
label: void 0,
|
|
232
|
-
placeholder:
|
|
238
|
+
placeholder: g.focused ? null : xe,
|
|
233
239
|
ariaExpanded: i(),
|
|
234
240
|
size: null,
|
|
235
241
|
fillMode: null,
|
|
@@ -241,79 +247,79 @@ const ue = o.forwardRef((n, se) => {
|
|
|
241
247
|
autoSwitchParts: Ce,
|
|
242
248
|
autoSwitchKeys: De,
|
|
243
249
|
allowCaretMode: n.allowCaretMode,
|
|
244
|
-
inputAttributes:
|
|
250
|
+
inputAttributes: Ie
|
|
245
251
|
}, ee = /* @__PURE__ */ o.createElement(
|
|
246
|
-
|
|
252
|
+
ct,
|
|
247
253
|
{
|
|
248
|
-
onFocus:
|
|
249
|
-
onBlur:
|
|
254
|
+
onFocus: Ue,
|
|
255
|
+
onBlur: u() ? void 0 : Z,
|
|
250
256
|
onSyncBlur: n.onBlur,
|
|
251
257
|
onSyncFocus: n.onFocus
|
|
252
258
|
},
|
|
253
259
|
(t) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
254
260
|
"span",
|
|
255
261
|
{
|
|
256
|
-
...n.label ? {} :
|
|
257
|
-
ref:
|
|
262
|
+
...n.label ? {} : U,
|
|
263
|
+
ref: y,
|
|
258
264
|
className: ae(
|
|
259
265
|
"k-input",
|
|
260
266
|
"k-datepicker",
|
|
261
267
|
{
|
|
262
268
|
[`k-input-${le.sizeMap[S] || S}`]: S,
|
|
263
|
-
[`k-rounded-${le.roundedMap[
|
|
264
|
-
[`k-input-${
|
|
269
|
+
[`k-rounded-${le.roundedMap[_] || _}`]: _,
|
|
270
|
+
[`k-input-${E}`]: E,
|
|
265
271
|
"k-invalid": !J,
|
|
266
|
-
"k-required":
|
|
267
|
-
"k-disabled":
|
|
272
|
+
"k-required": Y(),
|
|
273
|
+
"k-disabled": v
|
|
268
274
|
},
|
|
269
275
|
n.className
|
|
270
276
|
),
|
|
271
|
-
onKeyDown:
|
|
277
|
+
onKeyDown: je,
|
|
272
278
|
style: { width: n.width },
|
|
273
|
-
onFocus: t.onFocus,
|
|
279
|
+
onFocus: u() ? A : t.onFocus,
|
|
274
280
|
onBlur: t.onBlur,
|
|
275
|
-
onClick:
|
|
281
|
+
onClick: u() ? A : void 0
|
|
276
282
|
},
|
|
277
283
|
/* @__PURE__ */ o.createElement(
|
|
278
|
-
|
|
284
|
+
Qe,
|
|
279
285
|
{
|
|
280
286
|
_ref: c,
|
|
281
287
|
ariaRole: "combobox",
|
|
282
288
|
ariaExpanded: i(),
|
|
283
289
|
ariaControls: G,
|
|
284
290
|
autoFocus: ye,
|
|
285
|
-
...
|
|
291
|
+
...ot
|
|
286
292
|
}
|
|
287
293
|
),
|
|
288
294
|
/* @__PURE__ */ o.createElement(
|
|
289
|
-
|
|
295
|
+
tt,
|
|
290
296
|
{
|
|
291
297
|
type: "button",
|
|
292
298
|
icon: "calendar",
|
|
293
|
-
svgIcon:
|
|
299
|
+
svgIcon: ft,
|
|
294
300
|
title: Q,
|
|
295
301
|
className: "k-input-button",
|
|
296
302
|
rounded: null,
|
|
297
|
-
onClick:
|
|
303
|
+
onClick: u() ? void 0 : A,
|
|
298
304
|
"aria-label": Q,
|
|
299
|
-
fillMode:
|
|
300
|
-
onMouseDown:
|
|
305
|
+
fillMode: E,
|
|
306
|
+
onMouseDown: $e
|
|
301
307
|
}
|
|
302
308
|
),
|
|
303
|
-
!
|
|
304
|
-
),
|
|
309
|
+
!u() && Je
|
|
310
|
+
), u() && nt)
|
|
305
311
|
);
|
|
306
312
|
return n.label ? /* @__PURE__ */ o.createElement(
|
|
307
|
-
|
|
313
|
+
kt,
|
|
308
314
|
{
|
|
309
315
|
dateInput: c,
|
|
310
316
|
label: n.label,
|
|
311
|
-
editorId:
|
|
317
|
+
editorId: L,
|
|
312
318
|
editorValid: J,
|
|
313
|
-
editorDisabled:
|
|
319
|
+
editorDisabled: v,
|
|
314
320
|
children: ee,
|
|
315
321
|
style: { width: n.width },
|
|
316
|
-
...
|
|
322
|
+
...U
|
|
317
323
|
}
|
|
318
324
|
) : ee;
|
|
319
325
|
});
|
|
@@ -382,21 +388,22 @@ ue.propTypes = {
|
|
|
382
388
|
fillMode: e.oneOf([null, "solid", "flat", "outline"]),
|
|
383
389
|
adaptive: e.bool,
|
|
384
390
|
adaptiveTitle: e.string,
|
|
391
|
+
adaptiveSubtitle: e.string,
|
|
385
392
|
autoFocus: e.bool,
|
|
386
393
|
inputAttributes: e.object
|
|
387
394
|
};
|
|
388
395
|
const l = {
|
|
389
396
|
defaultShow: !1,
|
|
390
397
|
defaultValue: null,
|
|
391
|
-
dateInput:
|
|
392
|
-
calendar:
|
|
393
|
-
toggleButton:
|
|
394
|
-
popup:
|
|
395
|
-
pickerWrap:
|
|
398
|
+
dateInput: mt,
|
|
399
|
+
calendar: pt,
|
|
400
|
+
toggleButton: Ct,
|
|
401
|
+
popup: at,
|
|
402
|
+
pickerWrap: Dt,
|
|
396
403
|
disabled: !1,
|
|
397
404
|
format: "d",
|
|
398
|
-
max:
|
|
399
|
-
min:
|
|
405
|
+
max: gt,
|
|
406
|
+
min: ht,
|
|
400
407
|
popupSettings: {},
|
|
401
408
|
tabIndex: 0,
|
|
402
409
|
weekNumber: !1,
|
|
@@ -405,10 +412,10 @@ const l = {
|
|
|
405
412
|
rounded: "medium",
|
|
406
413
|
fillMode: "solid",
|
|
407
414
|
autoFocus: !1
|
|
408
|
-
},
|
|
415
|
+
}, Pt = dt();
|
|
409
416
|
ue.displayName = "KendoReactDatePicker";
|
|
410
417
|
export {
|
|
411
418
|
ue as DatePicker,
|
|
412
|
-
|
|
419
|
+
Pt as DatePickerPropsContext,
|
|
413
420
|
l as datePickerDefaultProps
|
|
414
421
|
};
|