@progress/kendo-react-dateinputs 14.4.1-develop.7 → 14.4.1-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/dateinput/DateInput.d.ts
CHANGED
|
@@ -192,6 +192,7 @@ export declare const DateInput: React.ForwardRefExoticComponent<DateInputProps<a
|
|
|
192
192
|
*/
|
|
193
193
|
export declare const dateInputDefaultProps: {
|
|
194
194
|
format: string;
|
|
195
|
+
defaultValue: null;
|
|
195
196
|
size: "small" | "medium" | "large" | undefined;
|
|
196
197
|
rounded: "small" | "none" | "medium" | "large" | "full" | undefined;
|
|
197
198
|
fillMode: "flat" | "solid" | "outline" | undefined;
|
package/dateinput/DateInput.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 Ve=require("react"),e=require("prop-types"),x=require("@progress/kendo-date-math"),te=require("@progress/kendo-react-buttons"),ne=require("@progress/kendo-svg-icons"),ae=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),ke=require("@progress/kendo-react-labels"),pe=require("@progress/kendo-dateinputs-common"),_=require("./utils.js"),i=require("../utils.js"),c=require("../messages/index.js"),Ae=require("../timepicker/utils.js"),_e=require("../common/ClearButton.js"),je=require("./dateInputIntl.js");function Be(t){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const m in t)if(m!=="default"){const C=Object.getOwnPropertyDescriptor(t,m);Object.defineProperty(b,m,C.get?C:{enumerable:!0,get:()=>t[m]})}}return b.default=t,Object.freeze(b)}const a=Be(Ve),Fe="Please enter a valid value!",B=a.forwardRef((t,b)=>{var ee;const m=o.useId(t.id),C=ae.useInternationalization(),E=ae.useLocalization(),re=o.useUnstyled(),F=o.usePropsContext(j,t).unstyled||re,{format:R=u.format,size:le=u.size,rounded:ue=u.rounded,fillMode:ie=u.fillMode,formatPlaceholder:oe=u.formatPlaceholder,spinners:se=u.spinners,disabled:w=u.disabled,min:ce=u.min,max:de=u.max,minTime:fe=u.minTime,maxTime:me=u.maxTime,validityStyles:ge=u.validityStyles,validationMessage:H=u.validationMessage,placeholder:y=u.placeholder,enableMouseWheel:ve=u.enableMouseWheel,autoCorrectParts:be=u.autoCorrectParts,autoSwitchParts:ye=u.autoSwitchParts,allowCaretMode:he=u.allowCaretMode,twoDigitYearMax:Ie=u.twoDigitYearMax,ariaHasPopup:Oe=u.ariaHasPopup,autoFocus:h=u.autoFocus}=o.usePropsContext(j,t),g=()=>P.current!==void 0?P.current:r.current&&r.current.value,z=()=>{const n=r.current&&r.current.currentText||"",l=g();return y!=null&&!qe.focused&&!l?y:n},U=()=>t.required!==void 0?t.required:!1,q=()=>{const n=g()||t.value,l=ce,D=de,k=_.isInRange(n,l,D)&&Ae.isInTimeRange(n,fe,me),p=H!==void 0,A=(!U()||n!=null)&&k,Ne=t.valid!==void 0?t.valid:A;return{customError:p,rangeOverflow:n&&D.getTime()<n.getTime()||!1,rangeUnderflow:n&&n.getTime()<l.getTime()||!1,valid:Ne,valueMissing:n===null}},De=()=>{s.current&&s.current.focus()},W=()=>new je.DateInputIntl(C),T=()=>{const n=g();return{format:R,steps:t.steps,formatPlaceholder:oe,placeholder:y,selectPreviousSegmentOnBackspace:!0,value:t.value||n,intlService:W(),autoFill:t.autoFill!==void 0?t.autoFill:!1,enableMouseWheel:ve,autoCorrectParts:be,autoSwitchParts:ye,autoSwitchKeys:t.autoSwitchKeys||[],twoDigitYearMax:Ie,allowCaretMode:he}},xe=n=>{d.current&&d.current.classList.add("k-focus"),N({focused:!0}),h&&Z(!0)},Ce=n=>{d.current&&d.current.classList.remove("k-focus"),N({focused:!1})},Ee=(n,l)=>typeof n!=typeof l?!0:typeof n=="string"&&typeof l=="string"?n!==l:typeof n=="object"&&typeof l=="object"?JSON.stringify(n)!==JSON.stringify(l):!1,we=n=>typeof n=="string"?n:{inputFormat:n,displayFormat:n},K=n=>{P.current=g(),Le(),v.current=n,P.current=void 0},J=n=>{t.onChange&&t.onChange(n)},Y=n=>{o.getActiveElement(document)===s.current&&n.preventDefault()},Te=()=>new pe.DateInput(s.current,{...T(),format:we(T().format),events:{focus:xe,blur:Ce,valueChange:K,click:J}}),X=()=>{s.current&&s.current.setCustomValidity&&s.current.setCustomValidity(q().valid?"":H||u.validationMessage)},Z=a.useCallback(n=>{var l;if(s.current&&h&&n){const D=(r==null?void 0:r.current).currentText,k=(r==null?void 0:r.current).currentText.search(/[^a-zA-Z]/),p=D[k],A=D.split(p)[0].length;d.current&&d.current.classList.add("k-focus"),(l=r==null?void 0:r.current)==null||l.selectNearestSegment(A)}},[h]),Me=n=>{!s.current||!r.current||K(n)},Se=n=>{n.preventDefault();const l=o.getActiveElement(document);s.current&&l!==s.current&&s.current.focus({preventScroll:!0})},f=n=>{const l=g();v.current&&t.onChange&&!x.isEqual(v.current.oldValue,l)&&t.onChange.call(void 0,{syntheticEvent:n,nativeEvent:v.current.event,value:v.current.value,target:M.current}),v.current=null},Pe=n=>{var l;(l=r.current)==null||l.modifyDateSegmentValue(1),f(n)},Re=n=>{var l;(l=r.current)==null||l.modifyDateSegmentValue(-1),f(n)},M=a.useRef(null),s=a.useRef(null),d=a.useRef(null);a.useImperativeHandle(M,()=>({props:t,get options(){return T()},get text(){return z()},get element(){return s.current},get name(){return t.name},get value(){return g()},get validity(){return q()},focus:De,updateOnPaste:Me})),a.useImperativeHandle(b,()=>M.current);const r=a.useRef(null),S=a.useRef(null),L=a.useRef(!1),P=a.useRef(null),v=a.useRef(null),I=a.useRef(t),[qe,N]=a.useState({focused:!1}),[,Le]=a.useReducer(n=>n+1,0);a.useLayoutEffect(()=>{L.current||(r.current=Te(),S.current=r.current.dateObject,L.current=!0)},[]),a.useEffect(()=>(X(),L.current||d.current&&d.current.addEventListener("wheel",Y,{passive:!1}),h&&(N({focused:!0}),Z(!0)),()=>{d.current&&d.current.removeEventListener("wheel",Y)}),[]),a.useEffect(()=>{X(),r.current&&(S.current=r.current.dateObject,(Ee(I.current.format,R)||I.current.readonly!==t.readonly||JSON.stringify(I.current.steps)!==JSON.stringify(t.steps)||W().locale!==r.current.options.intlService.locale)&&r.current.setOptions(T(),!0),I.current.value!==t.value&&(S.current.getValue()!==null||t.value!==null)&&S.current.setValue(t.value),t.ariaExpanded!==void 0&&t.ariaExpanded&&(r.current.options.placeholder=null),t.ariaExpanded!==void 0&&!t.ariaExpanded&&(r.current.options.placeholder=y),r.current.refreshElementValue(),I.current={format:R,readonly:t.readonly,ariaExpanded:t.ariaExpanded,steps:t.steps,value:t.value})});const $=t.id||m+"-accessibility-id",O=F&&F.uDateInput,G=z(),V=!ge||q().valid;a.useImperativeHandle(t._ref,()=>M.current);const Q=a.createElement("span",{ref:n=>{d.current=n},style:t.label?void 0:{width:t.width},dir:t.dir,className:o.classNames(o.uDateInput.wrapper({c:O,size:le,fillMode:ie,rounded:ue,disabled:w,required:U(),invalid:!V}),t.className)},a.createElement("input",{ref:n=>{s.current=n},role:t.ariaRole||"textbox",readOnly:t.readonly,tabIndex:t.tabIndex||0,disabled:w,title:t.title!==void 0?t.title:G,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:o.classNames(o.uDateInput.inputInner({c:O})),id:$,value:G,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledBy,"aria-describedby":t.ariaDescribedBy,"aria-haspopup":Oe,"aria-disabled":w,"aria-expanded":t.ariaExpanded,"aria-controls":t.ariaControls,"aria-required":t.required,"aria-invalid":!V,onKeyDown:f,onChange:f,onWheel:f,onInput:f,onClick:f,name:t.name,...t.inputAttributes}),t.children,t.clearButton&&t.value&&a.createElement(_e,{onClick:J,key:"clearbutton"}),se&&a.createElement("span",{className:o.classNames(o.uDateInput.inputSpinner({c:O})),onMouseDown:Se},a.createElement(te.Button,{tabIndex:-1,type:"button",className:o.classNames(o.uDateInput.spinnerIncrease({c:O})),icon:"caret-alt-up",svgIcon:ne.caretAltUpIcon,"aria-label":E.toLanguageString(c.increaseValue,c.messages[c.increaseValue]),title:E.toLanguageString(c.increaseValue,c.messages[c.increaseValue]),onClick:Pe}),a.createElement(te.Button,{tabIndex:-1,type:"button",className:o.classNames(o.uDateInput.spinnerDecrease({c:O})),icon:"caret-alt-down",svgIcon:ne.caretAltDownIcon,"aria-label":E.toLanguageString(c.decreaseValue,c.messages[c.decreaseValue]),title:E.toLanguageString(c.decreaseValue,c.messages[c.decreaseValue]),onClick:Re})));return t.label?a.createElement(ke.FloatingLabel,{label:t.label,editorId:$,editorValue:(ee=s.current)==null?void 0:ee.value,editorValid:V,editorDisabled:w,children:Q,style:{width:t.width}}):Q});B.propTypes={value:e.instanceOf(Date),format:e.oneOfType([i.nullable(e.string),e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([i.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:i.nullable(e.string),month:i.nullable(e.string),day:i.nullable(e.string),hour:i.nullable(e.string),minute:i.nullable(e.string),second:i.nullable(e.string)})]),width:e.oneOfType([e.string,e.number]),tabIndex:e.number,title:e.string,steps:e.shape({year:i.nullable(e.number),month:i.nullable(e.number),day:i.nullable(e.number),hour:i.nullable(e.number),minute:i.nullable(e.number),second:i.nullable(e.number)}),min:e.instanceOf(Date),max:e.instanceOf(Date),disabled:e.bool,spinners:e.bool,name:e.string,dir:e.string,label:e.node,id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,ariaRole:e.string,ariaHasPopup:e.oneOfType([e.bool,e.oneOf(["grid","dialog"])]),ariaExpanded:e.oneOfType([e.bool]),onChange:e.func,validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object};const u={format:_.DEFAULT_FORMAT,size:void 0,rounded:void 0,fillMode:void 0,formatPlaceholder:_.DEFAULT_FORMAT_PLACEHOLDER,spinners:!1,disabled:!1,max:x.cloneDate(i.MAX_DATE),min:x.cloneDate(i.MIN_DATE),minTime:x.cloneDate(i.MIN_TIME),maxTime:x.cloneDate(i.MAX_TIME),validityStyles:!0,validationMessage:Fe,placeholder:null,enableMouseWheel:!0,autoCorrectParts:!0,autoSwitchParts:!0,allowCaretMode:!1,twoDigitYearMax:68,ariaHasPopup:"grid",autoFocus:!1},j=o.createPropsContext();B.displayName="KendoReactDateInput";exports.DateInput=B;exports.DateInputPropsContext=j;exports.dateInputDefaultProps=u;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=require("react"),t=require("prop-types"),x=require("@progress/kendo-date-math"),ne=require("@progress/kendo-react-buttons"),ae=require("@progress/kendo-svg-icons"),re=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),pe=require("@progress/kendo-react-labels"),_e=require("@progress/kendo-dateinputs-common"),j=require("./utils.js"),i=require("../utils.js"),c=require("../messages/index.js"),je=require("../timepicker/utils.js"),Be=require("../common/ClearButton.js"),Fe=require("./dateInputIntl.js");function He(e){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const C=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(b,m,C.get?C:{enumerable:!0,get:()=>e[m]})}}return b.default=e,Object.freeze(b)}const r=He(Ae),ze="Please enter a valid value!",F=r.forwardRef((e,b)=>{var te;const m=o.useId(e.id),C=re.useInternationalization(),E=re.useLocalization(),le=o.useUnstyled(),H=o.usePropsContext(B,e).unstyled||le,{format:V=u.format,defaultValue:ue=u.defaultValue,size:ie=u.size,rounded:oe=u.rounded,fillMode:se=u.fillMode,formatPlaceholder:ce=u.formatPlaceholder,spinners:de=u.spinners,disabled:w=u.disabled,min:fe=u.min,max:me=u.max,minTime:ge=u.minTime,maxTime:ve=u.maxTime,validityStyles:be=u.validityStyles,validationMessage:z=u.validationMessage,placeholder:y=u.placeholder,enableMouseWheel:ye=u.enableMouseWheel,autoCorrectParts:he=u.autoCorrectParts,autoSwitchParts:Ie=u.autoSwitchParts,allowCaretMode:Oe=u.allowCaretMode,twoDigitYearMax:De=u.twoDigitYearMax,ariaHasPopup:xe=u.ariaHasPopup,autoFocus:h=u.autoFocus}=o.usePropsContext(B,e),S=n=>{Le(a=>({...a,...n}))},g=()=>N.value?N.value:R.current!==void 0?R.current:l.current&&l.current.value,U=()=>{const n=l.current&&l.current.currentText||"",a=g();return y!=null&&!N.focused&&!a?y:n},W=()=>e.required!==void 0?e.required:!1,q=()=>{const n=g()||e.value,a=fe,D=me,A=j.isInRange(n,a,D)&&je.isInTimeRange(n,ge,ve),p=z!==void 0,_=(!W()||n!=null)&&A,ke=e.valid!==void 0?e.valid:_;return{customError:p,rangeOverflow:n&&D.getTime()<n.getTime()||!1,rangeUnderflow:n&&n.getTime()<a.getTime()||!1,valid:ke,valueMissing:n===null}},Ce=()=>{s.current&&s.current.focus()},K=()=>new Fe.DateInputIntl(C),T=()=>{const n=g();return{format:V,steps:e.steps,formatPlaceholder:ce,placeholder:y,selectPreviousSegmentOnBackspace:!0,value:e.value!==void 0?e.value:n,intlService:K(),autoFill:e.autoFill!==void 0?e.autoFill:!1,enableMouseWheel:ye,autoCorrectParts:he,autoSwitchParts:Ie,autoSwitchKeys:e.autoSwitchKeys||[],twoDigitYearMax:De,allowCaretMode:Oe}},Ee=n=>{d.current&&d.current.classList.add("k-focus"),S({focused:!0}),h&&$(!0)},we=n=>{d.current&&d.current.classList.remove("k-focus"),S({focused:!1})},Se=(n,a)=>typeof n!=typeof a?!0:typeof n=="string"&&typeof a=="string"?n!==a:typeof n=="object"&&typeof a=="object"?JSON.stringify(n)!==JSON.stringify(a):!1,Te=n=>typeof n=="string"?n:{inputFormat:n,displayFormat:n},J=n=>{R.current=g(),e.value===void 0&&S({value:n.value!==void 0?n.value:null}),Ne(),v.current=n,R.current=void 0},Y=n=>{e.onChange&&e.onChange(n)},X=n=>{o.getActiveElement(document)===s.current&&n.preventDefault()},Me=()=>new _e.DateInput(s.current,{...T(),format:Te(T().format),events:{focus:Ee,blur:we,valueChange:J,click:Y}}),Z=()=>{s.current&&s.current.setCustomValidity&&s.current.setCustomValidity(q().valid?"":z||u.validationMessage)},$=r.useCallback(n=>{var a;if(s.current&&h&&n){const D=(l==null?void 0:l.current).currentText,A=(l==null?void 0:l.current).currentText.search(/[^a-zA-Z]/),p=D[A],_=D.split(p)[0].length;d.current&&d.current.classList.add("k-focus"),(a=l==null?void 0:l.current)==null||a.selectNearestSegment(_)}},[h]),Pe=n=>{!s.current||!l.current||J(n)},Re=n=>{n.preventDefault();const a=o.getActiveElement(document);s.current&&a!==s.current&&s.current.focus({preventScroll:!0})},f=n=>{const a=g();v.current&&e.onChange&&!x.isEqual(v.current.oldValue,a)&&e.onChange.call(void 0,{syntheticEvent:n,nativeEvent:v.current.event,value:v.current.value,target:M.current}),v.current=null},Ve=n=>{var a;(a=l.current)==null||a.modifyDateSegmentValue(1),f(n)},qe=n=>{var a;(a=l.current)==null||a.modifyDateSegmentValue(-1),f(n)},M=r.useRef(null),s=r.useRef(null),d=r.useRef(null);r.useImperativeHandle(M,()=>({props:e,get options(){return T()},get text(){return U()},get element(){return s.current},get name(){return e.name},get value(){return g()},get validity(){return q()},focus:Ce,updateOnPaste:Pe})),r.useImperativeHandle(b,()=>M.current);const l=r.useRef(null),P=r.useRef(null),L=r.useRef(!1),R=r.useRef(null),v=r.useRef(null),I=r.useRef(e),[N,Le]=r.useState({value:e.value===void 0?ue:null,focused:!1}),[,Ne]=r.useReducer(n=>n+1,0);r.useLayoutEffect(()=>{L.current||(l.current=Me(),P.current=l.current.dateObject,L.current=!0)},[]),r.useEffect(()=>(Z(),L.current||d.current&&d.current.addEventListener("wheel",X,{passive:!1}),h&&(S({focused:!0}),$(!0)),()=>{d.current&&d.current.removeEventListener("wheel",X)}),[]),r.useEffect(()=>{Z(),l.current&&(P.current=l.current.dateObject,(Se(I.current.format,V)||I.current.readonly!==e.readonly||JSON.stringify(I.current.steps)!==JSON.stringify(e.steps)||K().locale!==l.current.options.intlService.locale)&&l.current.setOptions(T(),!0),I.current.value!==e.value&&(P.current.getValue()!==null||e.value!==null)&&P.current.setValue(e.value),e.ariaExpanded!==void 0&&e.ariaExpanded&&(l.current.options.placeholder=null),e.ariaExpanded!==void 0&&!e.ariaExpanded&&(l.current.options.placeholder=y),l.current.refreshElementValue(),I.current={format:V,readonly:e.readonly,ariaExpanded:e.ariaExpanded,steps:e.steps,value:e.value})});const G=e.id||m+"-accessibility-id",O=H&&H.uDateInput,Q=U(),k=!be||q().valid;r.useImperativeHandle(e._ref,()=>M.current);const ee=r.createElement("span",{ref:n=>{d.current=n},style:e.label?void 0:{width:e.width},dir:e.dir,className:o.classNames(o.uDateInput.wrapper({c:O,size:ie,fillMode:se,rounded:oe,disabled:w,required:W(),invalid:!k}),e.className)},r.createElement("input",{ref:n=>{s.current=n},role:e.ariaRole||"textbox",readOnly:e.readonly,tabIndex:e.tabIndex||0,disabled:w,title:e.title!==void 0?e.title:Q,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:o.classNames(o.uDateInput.inputInner({c:O})),id:G,value:Q,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-haspopup":xe,"aria-disabled":w,"aria-expanded":e.ariaExpanded,"aria-controls":e.ariaControls,"aria-required":e.required,"aria-invalid":!k,onKeyDown:f,onChange:f,onWheel:f,onInput:f,onClick:f,name:e.name,...e.inputAttributes}),e.children,e.clearButton&&e.value&&r.createElement(Be,{onClick:Y,key:"clearbutton"}),de&&r.createElement("span",{className:o.classNames(o.uDateInput.inputSpinner({c:O})),onMouseDown:Re},r.createElement(ne.Button,{tabIndex:-1,type:"button",className:o.classNames(o.uDateInput.spinnerIncrease({c:O})),icon:"caret-alt-up",svgIcon:ae.caretAltUpIcon,"aria-label":E.toLanguageString(c.increaseValue,c.messages[c.increaseValue]),title:E.toLanguageString(c.increaseValue,c.messages[c.increaseValue]),onClick:Ve}),r.createElement(ne.Button,{tabIndex:-1,type:"button",className:o.classNames(o.uDateInput.spinnerDecrease({c:O})),icon:"caret-alt-down",svgIcon:ae.caretAltDownIcon,"aria-label":E.toLanguageString(c.decreaseValue,c.messages[c.decreaseValue]),title:E.toLanguageString(c.decreaseValue,c.messages[c.decreaseValue]),onClick:qe})));return e.label?r.createElement(pe.FloatingLabel,{label:e.label,editorId:G,editorValue:(te=s.current)==null?void 0:te.value,editorValid:k,editorDisabled:w,children:ee,style:{width:e.width}}):ee});F.propTypes={value:t.instanceOf(Date),format:t.oneOfType([i.nullable(t.string),t.shape({skeleton:t.string,pattern:t.string,date:t.oneOf(["short","medium","long","full"]),time:t.oneOf(["short","medium","long","full"]),datetime:t.oneOf(["short","medium","long","full"]),era:t.oneOf(["narrow","short","long"]),year:t.oneOf(["numeric","2-digit"]),month:t.oneOf(["numeric","2-digit","narrow","short","long"]),day:t.oneOf(["numeric","2-digit"]),weekday:t.oneOf(["narrow","short","long"]),hour:t.oneOf(["numeric","2-digit"]),hour12:t.bool,minute:t.oneOf(["numeric","2-digit"]),second:t.oneOf(["numeric","2-digit"]),timeZoneName:t.oneOf(["short","long"])})]),formatPlaceholder:t.oneOfType([i.nullable(t.oneOf(["wide","narrow","short","formatPattern"])),t.shape({year:i.nullable(t.string),month:i.nullable(t.string),day:i.nullable(t.string),hour:i.nullable(t.string),minute:i.nullable(t.string),second:i.nullable(t.string)})]),width:t.oneOfType([t.string,t.number]),tabIndex:t.number,title:t.string,steps:t.shape({year:i.nullable(t.number),month:i.nullable(t.number),day:i.nullable(t.number),hour:i.nullable(t.number),minute:i.nullable(t.number),second:i.nullable(t.number)}),min:t.instanceOf(Date),max:t.instanceOf(Date),disabled:t.bool,spinners:t.bool,name:t.string,dir:t.string,label:t.node,id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,ariaRole:t.string,ariaHasPopup:t.oneOfType([t.bool,t.oneOf(["grid","dialog"])]),ariaExpanded:t.oneOfType([t.bool]),onChange:t.func,validationMessage:t.string,required:t.bool,valid:t.bool,size:t.oneOf(["small","medium","large"]),rounded:t.oneOf(["small","medium","large","full","none"]),fillMode:t.oneOf(["solid","flat","outline"]),autoFocus:t.bool,inputAttributes:t.object};const u={format:j.DEFAULT_FORMAT,defaultValue:null,size:void 0,rounded:void 0,fillMode:void 0,formatPlaceholder:j.DEFAULT_FORMAT_PLACEHOLDER,spinners:!1,disabled:!1,max:x.cloneDate(i.MAX_DATE),min:x.cloneDate(i.MIN_DATE),minTime:x.cloneDate(i.MIN_TIME),maxTime:x.cloneDate(i.MAX_TIME),validityStyles:!0,validationMessage:ze,placeholder:null,enableMouseWheel:!0,autoCorrectParts:!0,autoSwitchParts:!0,allowCaretMode:!1,twoDigitYearMax:68,ariaHasPopup:"grid",autoFocus:!1},B=o.createPropsContext();F.displayName="KendoReactDateInput";exports.DateInput=F;exports.DateInputPropsContext=B;exports.dateInputDefaultProps=u;
|
package/dateinput/DateInput.mjs
CHANGED
|
@@ -7,143 +7,146 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as r from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { cloneDate as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { caretAltUpIcon as
|
|
13
|
-
import { useInternationalization as
|
|
14
|
-
import { useId as
|
|
15
|
-
import { FloatingLabel as
|
|
16
|
-
import { DateInput as
|
|
17
|
-
import { DEFAULT_FORMAT_PLACEHOLDER as
|
|
18
|
-
import { MAX_TIME as
|
|
19
|
-
import { increaseValue as
|
|
20
|
-
import { isInTimeRange as
|
|
21
|
-
import
|
|
22
|
-
import { DateInputIntl as
|
|
23
|
-
const
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
format:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
const n =
|
|
10
|
+
import { cloneDate as M, isEqual as Fe } from "@progress/kendo-date-math";
|
|
11
|
+
import { Button as Q } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { caretAltUpIcon as He, caretAltDownIcon as Be } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { useInternationalization as qe, useLocalization as ze } from "@progress/kendo-react-intl";
|
|
14
|
+
import { useId as je, useUnstyled as Ue, usePropsContext as ee, classNames as h, uDateInput as O, createPropsContext as We, getActiveElement as te } from "@progress/kendo-react-common";
|
|
15
|
+
import { FloatingLabel as Ke } from "@progress/kendo-react-labels";
|
|
16
|
+
import { DateInput as Je } from "@progress/kendo-dateinputs-common";
|
|
17
|
+
import { DEFAULT_FORMAT_PLACEHOLDER as Ye, DEFAULT_FORMAT as Xe, isInRange as Ze } from "./utils.mjs";
|
|
18
|
+
import { MAX_TIME as Ge, MIN_TIME as $e, MIN_DATE as Qe, MAX_DATE as et, nullable as o } from "../utils.mjs";
|
|
19
|
+
import { increaseValue as S, messages as P, decreaseValue as R } from "../messages/index.mjs";
|
|
20
|
+
import { isInTimeRange as tt } from "../timepicker/utils.mjs";
|
|
21
|
+
import nt from "../common/ClearButton.mjs";
|
|
22
|
+
import { DateInputIntl as at } from "./dateInputIntl.mjs";
|
|
23
|
+
const rt = "Please enter a valid value!", ae = r.forwardRef((t, re) => {
|
|
24
|
+
var $;
|
|
25
|
+
const ie = je(t.id), le = qe(), E = ze(), ue = Ue(), H = ee(ne, t).unstyled || ue, {
|
|
26
|
+
format: L = l.format,
|
|
27
|
+
defaultValue: oe = l.defaultValue,
|
|
28
|
+
size: se = l.size,
|
|
29
|
+
rounded: ce = l.rounded,
|
|
30
|
+
fillMode: de = l.fillMode,
|
|
31
|
+
formatPlaceholder: fe = l.formatPlaceholder,
|
|
32
|
+
spinners: me = l.spinners,
|
|
33
|
+
disabled: I = l.disabled,
|
|
34
|
+
min: ge = l.min,
|
|
35
|
+
max: ve = l.max,
|
|
36
|
+
minTime: ye = l.minTime,
|
|
37
|
+
maxTime: be = l.maxTime,
|
|
38
|
+
validityStyles: he = l.validityStyles,
|
|
39
|
+
validationMessage: B = l.validationMessage,
|
|
40
|
+
placeholder: m = l.placeholder,
|
|
41
|
+
enableMouseWheel: Oe = l.enableMouseWheel,
|
|
42
|
+
autoCorrectParts: Ee = l.autoCorrectParts,
|
|
43
|
+
autoSwitchParts: Ie = l.autoSwitchParts,
|
|
44
|
+
allowCaretMode: xe = l.allowCaretMode,
|
|
45
|
+
twoDigitYearMax: Ce = l.twoDigitYearMax,
|
|
46
|
+
ariaHasPopup: we = l.ariaHasPopup,
|
|
47
|
+
autoFocus: g = l.autoFocus
|
|
48
|
+
} = ee(ne, t), x = (n) => {
|
|
49
|
+
pe((a) => ({ ...a, ...n }));
|
|
50
|
+
}, d = () => N.value ? N.value : T.current !== void 0 ? T.current : i.current && i.current.value, q = () => {
|
|
51
|
+
const n = i.current && i.current.currentText || "", a = d();
|
|
52
|
+
return m != null && !N.focused && !a ? m : n;
|
|
53
|
+
}, z = () => t.required !== void 0 ? t.required : !1, V = () => {
|
|
54
|
+
const n = d() || t.value, a = ge, b = ve, k = Ze(n, a, b) && tt(n, ye, be), _ = B !== void 0, F = (!z() || n != null) && k, _e = t.valid !== void 0 ? t.valid : F;
|
|
52
55
|
return {
|
|
53
|
-
customError:
|
|
56
|
+
customError: _,
|
|
54
57
|
rangeOverflow: n && b.getTime() < n.getTime() || !1,
|
|
55
|
-
rangeUnderflow: n && n.getTime() <
|
|
56
|
-
valid:
|
|
58
|
+
rangeUnderflow: n && n.getTime() < a.getTime() || !1,
|
|
59
|
+
valid: _e,
|
|
57
60
|
valueMissing: n === null
|
|
58
61
|
};
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
+
}, De = () => {
|
|
63
|
+
u.current && u.current.focus();
|
|
64
|
+
}, j = () => new at(le), C = () => {
|
|
62
65
|
const n = d();
|
|
63
66
|
return {
|
|
64
|
-
format:
|
|
67
|
+
format: L,
|
|
65
68
|
steps: t.steps,
|
|
66
|
-
formatPlaceholder:
|
|
69
|
+
formatPlaceholder: fe,
|
|
67
70
|
placeholder: m,
|
|
68
71
|
selectPreviousSegmentOnBackspace: !0,
|
|
69
|
-
value: t.value
|
|
70
|
-
intlService:
|
|
72
|
+
value: t.value !== void 0 ? t.value : n,
|
|
73
|
+
intlService: j(),
|
|
71
74
|
autoFill: t.autoFill !== void 0 ? t.autoFill : !1,
|
|
72
|
-
enableMouseWheel:
|
|
73
|
-
autoCorrectParts:
|
|
74
|
-
autoSwitchParts:
|
|
75
|
+
enableMouseWheel: Oe,
|
|
76
|
+
autoCorrectParts: Ee,
|
|
77
|
+
autoSwitchParts: Ie,
|
|
75
78
|
autoSwitchKeys: t.autoSwitchKeys || [],
|
|
76
|
-
twoDigitYearMax:
|
|
77
|
-
allowCaretMode:
|
|
79
|
+
twoDigitYearMax: Ce,
|
|
80
|
+
allowCaretMode: xe
|
|
78
81
|
};
|
|
79
|
-
},
|
|
80
|
-
s.current && s.current.classList.add("k-focus"),
|
|
81
|
-
},
|
|
82
|
-
s.current && s.current.classList.remove("k-focus"),
|
|
83
|
-
},
|
|
82
|
+
}, Te = (n) => {
|
|
83
|
+
s.current && s.current.classList.add("k-focus"), x({ focused: !0 }), g && Y(!0);
|
|
84
|
+
}, Me = (n) => {
|
|
85
|
+
s.current && s.current.classList.remove("k-focus"), x({ focused: !1 });
|
|
86
|
+
}, Se = (n, a) => typeof n != typeof a ? !0 : typeof n == "string" && typeof a == "string" ? n !== a : typeof n == "object" && typeof a == "object" ? JSON.stringify(n) !== JSON.stringify(a) : !1, Pe = (n) => typeof n == "string" ? n : {
|
|
84
87
|
inputFormat: n,
|
|
85
88
|
displayFormat: n
|
|
86
|
-
}, j = (n) => {
|
|
87
|
-
D.current = d(), Ne(), f.current = n, D.current = void 0;
|
|
88
89
|
}, U = (n) => {
|
|
89
|
-
t.
|
|
90
|
+
T.current = d(), t.value === void 0 && x({ value: n.value !== void 0 ? n.value : null }), ke(), f.current = n, T.current = void 0;
|
|
90
91
|
}, W = (n) => {
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
t.onChange && t.onChange(n);
|
|
93
|
+
}, K = (n) => {
|
|
94
|
+
te(document) === u.current && n.preventDefault();
|
|
95
|
+
}, Re = () => new Je(u.current, {
|
|
96
|
+
...C(),
|
|
97
|
+
format: Pe(C().format),
|
|
95
98
|
events: {
|
|
96
|
-
focus:
|
|
97
|
-
blur:
|
|
98
|
-
valueChange:
|
|
99
|
-
click:
|
|
99
|
+
focus: Te,
|
|
100
|
+
blur: Me,
|
|
101
|
+
valueChange: U,
|
|
102
|
+
click: W
|
|
100
103
|
}
|
|
101
|
-
}),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
}), J = () => {
|
|
105
|
+
u.current && u.current.setCustomValidity && u.current.setCustomValidity(
|
|
106
|
+
V().valid ? "" : B || l.validationMessage
|
|
104
107
|
);
|
|
105
|
-
},
|
|
108
|
+
}, Y = r.useCallback(
|
|
106
109
|
(n) => {
|
|
107
|
-
var
|
|
108
|
-
if (
|
|
109
|
-
const b = (
|
|
110
|
-
s.current && s.current.classList.add("k-focus"), (
|
|
110
|
+
var a;
|
|
111
|
+
if (u.current && g && n) {
|
|
112
|
+
const b = (i == null ? void 0 : i.current).currentText, k = (i == null ? void 0 : i.current).currentText.search(/[^a-zA-Z]/), _ = b[k], F = b.split(_)[0].length;
|
|
113
|
+
s.current && s.current.classList.add("k-focus"), (a = i == null ? void 0 : i.current) == null || a.selectNearestSegment(F);
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
[g]
|
|
114
|
-
),
|
|
115
|
-
!
|
|
116
|
-
},
|
|
117
|
+
), Le = (n) => {
|
|
118
|
+
!u.current || !i.current || U(n);
|
|
119
|
+
}, Ve = (n) => {
|
|
117
120
|
n.preventDefault();
|
|
118
|
-
const
|
|
119
|
-
|
|
121
|
+
const a = te(document);
|
|
122
|
+
u.current && a !== u.current && u.current.focus({ preventScroll: !0 });
|
|
120
123
|
}, c = (n) => {
|
|
121
|
-
const
|
|
122
|
-
f.current && t.onChange && !
|
|
124
|
+
const a = d();
|
|
125
|
+
f.current && t.onChange && !Fe(f.current.oldValue, a) && t.onChange.call(void 0, {
|
|
123
126
|
syntheticEvent: n,
|
|
124
127
|
nativeEvent: f.current.event,
|
|
125
128
|
value: f.current.value,
|
|
126
|
-
target:
|
|
129
|
+
target: w.current
|
|
127
130
|
}), f.current = null;
|
|
128
|
-
},
|
|
129
|
-
var
|
|
130
|
-
(
|
|
131
|
-
},
|
|
132
|
-
var
|
|
133
|
-
(
|
|
134
|
-
},
|
|
131
|
+
}, Ae = (n) => {
|
|
132
|
+
var a;
|
|
133
|
+
(a = i.current) == null || a.modifyDateSegmentValue(1), c(n);
|
|
134
|
+
}, Ne = (n) => {
|
|
135
|
+
var a;
|
|
136
|
+
(a = i.current) == null || a.modifyDateSegmentValue(-1), c(n);
|
|
137
|
+
}, w = r.useRef(null), u = r.useRef(null), s = r.useRef(null);
|
|
135
138
|
r.useImperativeHandle(
|
|
136
|
-
|
|
139
|
+
w,
|
|
137
140
|
() => ({
|
|
138
141
|
props: t,
|
|
139
142
|
get options() {
|
|
140
|
-
return
|
|
143
|
+
return C();
|
|
141
144
|
},
|
|
142
145
|
get text() {
|
|
143
|
-
return
|
|
146
|
+
return q();
|
|
144
147
|
},
|
|
145
148
|
get element() {
|
|
146
|
-
return
|
|
149
|
+
return u.current;
|
|
147
150
|
},
|
|
148
151
|
get name() {
|
|
149
152
|
return t.name;
|
|
@@ -152,30 +155,33 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
152
155
|
return d();
|
|
153
156
|
},
|
|
154
157
|
get validity() {
|
|
155
|
-
return
|
|
158
|
+
return V();
|
|
156
159
|
},
|
|
157
160
|
// hidden methods
|
|
158
|
-
focus:
|
|
159
|
-
updateOnPaste:
|
|
161
|
+
focus: De,
|
|
162
|
+
updateOnPaste: Le
|
|
160
163
|
})
|
|
161
|
-
), r.useImperativeHandle(re, () =>
|
|
162
|
-
const
|
|
164
|
+
), r.useImperativeHandle(re, () => w.current);
|
|
165
|
+
const i = r.useRef(null), D = r.useRef(null), A = r.useRef(!1), T = r.useRef(null), f = r.useRef(null), v = r.useRef(t), [N, pe] = r.useState({
|
|
166
|
+
value: t.value === void 0 ? oe : null,
|
|
167
|
+
focused: !1
|
|
168
|
+
}), [, ke] = r.useReducer((n) => n + 1, 0);
|
|
163
169
|
r.useLayoutEffect(() => {
|
|
164
|
-
|
|
165
|
-
}, []), r.useEffect(() => (
|
|
166
|
-
s.current && s.current.removeEventListener("wheel",
|
|
170
|
+
A.current || (i.current = Re(), D.current = i.current.dateObject, A.current = !0);
|
|
171
|
+
}, []), r.useEffect(() => (J(), A.current || s.current && s.current.addEventListener("wheel", K, { passive: !1 }), g && (x({ focused: !0 }), Y(!0)), () => {
|
|
172
|
+
s.current && s.current.removeEventListener("wheel", K);
|
|
167
173
|
}), []), r.useEffect(() => {
|
|
168
|
-
|
|
169
|
-
format:
|
|
174
|
+
J(), i.current && (D.current = i.current.dateObject, (Se(v.current.format, L) || v.current.readonly !== t.readonly || JSON.stringify(v.current.steps) !== JSON.stringify(t.steps) || j().locale !== i.current.options.intlService.locale) && i.current.setOptions(C(), !0), v.current.value !== t.value && (D.current.getValue() !== null || t.value !== null) && D.current.setValue(t.value), t.ariaExpanded !== void 0 && t.ariaExpanded && (i.current.options.placeholder = null), t.ariaExpanded !== void 0 && !t.ariaExpanded && (i.current.options.placeholder = m), i.current.refreshElementValue(), v.current = {
|
|
175
|
+
format: L,
|
|
170
176
|
readonly: t.readonly,
|
|
171
177
|
ariaExpanded: t.ariaExpanded,
|
|
172
178
|
steps: t.steps,
|
|
173
179
|
value: t.value
|
|
174
180
|
});
|
|
175
181
|
});
|
|
176
|
-
const
|
|
177
|
-
r.useImperativeHandle(t._ref, () =>
|
|
178
|
-
const
|
|
182
|
+
const X = t.id || ie + "-accessibility-id", y = H && H.uDateInput, Z = q(), p = !he || V().valid;
|
|
183
|
+
r.useImperativeHandle(t._ref, () => w.current);
|
|
184
|
+
const G = /* @__PURE__ */ r.createElement(
|
|
179
185
|
"span",
|
|
180
186
|
{
|
|
181
187
|
ref: (n) => {
|
|
@@ -186,12 +192,12 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
186
192
|
className: h(
|
|
187
193
|
O.wrapper({
|
|
188
194
|
c: y,
|
|
189
|
-
size:
|
|
190
|
-
fillMode:
|
|
191
|
-
rounded:
|
|
195
|
+
size: se,
|
|
196
|
+
fillMode: de,
|
|
197
|
+
rounded: ce,
|
|
192
198
|
disabled: I,
|
|
193
|
-
required:
|
|
194
|
-
invalid: !
|
|
199
|
+
required: z(),
|
|
200
|
+
invalid: !p
|
|
195
201
|
}),
|
|
196
202
|
t.className
|
|
197
203
|
)
|
|
@@ -200,30 +206,30 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
200
206
|
"input",
|
|
201
207
|
{
|
|
202
208
|
ref: (n) => {
|
|
203
|
-
|
|
209
|
+
u.current = n;
|
|
204
210
|
},
|
|
205
211
|
role: t.ariaRole || "textbox",
|
|
206
212
|
readOnly: t.readonly,
|
|
207
213
|
tabIndex: t.tabIndex || 0,
|
|
208
214
|
disabled: I,
|
|
209
|
-
title: t.title !== void 0 ? t.title :
|
|
215
|
+
title: t.title !== void 0 ? t.title : Z,
|
|
210
216
|
type: "text",
|
|
211
217
|
spellCheck: !1,
|
|
212
218
|
autoComplete: "off",
|
|
213
219
|
autoCorrect: "off",
|
|
214
220
|
autoFocus: g,
|
|
215
221
|
className: h(O.inputInner({ c: y })),
|
|
216
|
-
id:
|
|
217
|
-
value:
|
|
222
|
+
id: X,
|
|
223
|
+
value: Z,
|
|
218
224
|
"aria-label": t.ariaLabel,
|
|
219
225
|
"aria-labelledby": t.ariaLabelledBy,
|
|
220
226
|
"aria-describedby": t.ariaDescribedBy,
|
|
221
|
-
"aria-haspopup":
|
|
227
|
+
"aria-haspopup": we,
|
|
222
228
|
"aria-disabled": I,
|
|
223
229
|
"aria-expanded": t.ariaExpanded,
|
|
224
230
|
"aria-controls": t.ariaControls,
|
|
225
231
|
"aria-required": t.required,
|
|
226
|
-
"aria-invalid": !
|
|
232
|
+
"aria-invalid": !p,
|
|
227
233
|
onKeyDown: c,
|
|
228
234
|
onChange: c,
|
|
229
235
|
onWheel: c,
|
|
@@ -234,50 +240,50 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
234
240
|
}
|
|
235
241
|
),
|
|
236
242
|
t.children,
|
|
237
|
-
t.clearButton && t.value && /* @__PURE__ */ r.createElement(
|
|
238
|
-
|
|
239
|
-
|
|
243
|
+
t.clearButton && t.value && /* @__PURE__ */ r.createElement(nt, { onClick: W, key: "clearbutton" }),
|
|
244
|
+
me && /* @__PURE__ */ r.createElement("span", { className: h(O.inputSpinner({ c: y })), onMouseDown: Ve }, /* @__PURE__ */ r.createElement(
|
|
245
|
+
Q,
|
|
240
246
|
{
|
|
241
247
|
tabIndex: -1,
|
|
242
248
|
type: "button",
|
|
243
249
|
className: h(O.spinnerIncrease({ c: y })),
|
|
244
250
|
icon: "caret-alt-up",
|
|
245
|
-
svgIcon:
|
|
246
|
-
"aria-label": E.toLanguageString(
|
|
247
|
-
title: E.toLanguageString(
|
|
248
|
-
onClick:
|
|
251
|
+
svgIcon: He,
|
|
252
|
+
"aria-label": E.toLanguageString(S, P[S]),
|
|
253
|
+
title: E.toLanguageString(S, P[S]),
|
|
254
|
+
onClick: Ae
|
|
249
255
|
}
|
|
250
256
|
), /* @__PURE__ */ r.createElement(
|
|
251
|
-
|
|
257
|
+
Q,
|
|
252
258
|
{
|
|
253
259
|
tabIndex: -1,
|
|
254
260
|
type: "button",
|
|
255
261
|
className: h(O.spinnerDecrease({ c: y })),
|
|
256
262
|
icon: "caret-alt-down",
|
|
257
|
-
svgIcon:
|
|
258
|
-
"aria-label": E.toLanguageString(
|
|
259
|
-
title: E.toLanguageString(
|
|
260
|
-
onClick:
|
|
263
|
+
svgIcon: Be,
|
|
264
|
+
"aria-label": E.toLanguageString(R, P[R]),
|
|
265
|
+
title: E.toLanguageString(R, P[R]),
|
|
266
|
+
onClick: Ne
|
|
261
267
|
}
|
|
262
268
|
))
|
|
263
269
|
);
|
|
264
270
|
return t.label ? /* @__PURE__ */ r.createElement(
|
|
265
|
-
|
|
271
|
+
Ke,
|
|
266
272
|
{
|
|
267
273
|
label: t.label,
|
|
268
|
-
editorId:
|
|
269
|
-
editorValue: (
|
|
270
|
-
editorValid:
|
|
274
|
+
editorId: X,
|
|
275
|
+
editorValue: ($ = u.current) == null ? void 0 : $.value,
|
|
276
|
+
editorValid: p,
|
|
271
277
|
editorDisabled: I,
|
|
272
|
-
children:
|
|
278
|
+
children: G,
|
|
273
279
|
style: { width: t.width }
|
|
274
280
|
}
|
|
275
|
-
) :
|
|
281
|
+
) : G;
|
|
276
282
|
});
|
|
277
|
-
|
|
283
|
+
ae.propTypes = {
|
|
278
284
|
value: e.instanceOf(Date),
|
|
279
285
|
format: e.oneOfType([
|
|
280
|
-
|
|
286
|
+
o(e.string),
|
|
281
287
|
e.shape({
|
|
282
288
|
skeleton: e.string,
|
|
283
289
|
pattern: e.string,
|
|
@@ -297,28 +303,28 @@ ne.propTypes = {
|
|
|
297
303
|
})
|
|
298
304
|
]),
|
|
299
305
|
formatPlaceholder: e.oneOfType([
|
|
300
|
-
|
|
306
|
+
o(
|
|
301
307
|
e.oneOf(["wide", "narrow", "short", "formatPattern"])
|
|
302
308
|
),
|
|
303
309
|
e.shape({
|
|
304
|
-
year:
|
|
305
|
-
month:
|
|
306
|
-
day:
|
|
307
|
-
hour:
|
|
308
|
-
minute:
|
|
309
|
-
second:
|
|
310
|
+
year: o(e.string),
|
|
311
|
+
month: o(e.string),
|
|
312
|
+
day: o(e.string),
|
|
313
|
+
hour: o(e.string),
|
|
314
|
+
minute: o(e.string),
|
|
315
|
+
second: o(e.string)
|
|
310
316
|
})
|
|
311
317
|
]),
|
|
312
318
|
width: e.oneOfType([e.string, e.number]),
|
|
313
319
|
tabIndex: e.number,
|
|
314
320
|
title: e.string,
|
|
315
321
|
steps: e.shape({
|
|
316
|
-
year:
|
|
317
|
-
month:
|
|
318
|
-
day:
|
|
319
|
-
hour:
|
|
320
|
-
minute:
|
|
321
|
-
second:
|
|
322
|
+
year: o(e.number),
|
|
323
|
+
month: o(e.number),
|
|
324
|
+
day: o(e.number),
|
|
325
|
+
hour: o(e.number),
|
|
326
|
+
minute: o(e.number),
|
|
327
|
+
second: o(e.number)
|
|
322
328
|
}),
|
|
323
329
|
min: e.instanceOf(Date),
|
|
324
330
|
max: e.instanceOf(Date),
|
|
@@ -347,20 +353,21 @@ ne.propTypes = {
|
|
|
347
353
|
autoFocus: e.bool,
|
|
348
354
|
inputAttributes: e.object
|
|
349
355
|
};
|
|
350
|
-
const
|
|
351
|
-
format:
|
|
356
|
+
const l = {
|
|
357
|
+
format: Xe,
|
|
358
|
+
defaultValue: null,
|
|
352
359
|
size: void 0,
|
|
353
360
|
rounded: void 0,
|
|
354
361
|
fillMode: void 0,
|
|
355
|
-
formatPlaceholder:
|
|
362
|
+
formatPlaceholder: Ye,
|
|
356
363
|
spinners: !1,
|
|
357
364
|
disabled: !1,
|
|
358
|
-
max:
|
|
359
|
-
min:
|
|
360
|
-
minTime:
|
|
361
|
-
maxTime:
|
|
365
|
+
max: M(et),
|
|
366
|
+
min: M(Qe),
|
|
367
|
+
minTime: M($e),
|
|
368
|
+
maxTime: M(Ge),
|
|
362
369
|
validityStyles: !0,
|
|
363
|
-
validationMessage:
|
|
370
|
+
validationMessage: rt,
|
|
364
371
|
placeholder: null,
|
|
365
372
|
enableMouseWheel: !0,
|
|
366
373
|
autoCorrectParts: !0,
|
|
@@ -369,10 +376,10 @@ const o = {
|
|
|
369
376
|
twoDigitYearMax: 68,
|
|
370
377
|
ariaHasPopup: "grid",
|
|
371
378
|
autoFocus: !1
|
|
372
|
-
},
|
|
373
|
-
|
|
379
|
+
}, ne = We();
|
|
380
|
+
ae.displayName = "KendoReactDateInput";
|
|
374
381
|
export {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
382
|
+
ae as DateInput,
|
|
383
|
+
ne as DateInputPropsContext,
|
|
384
|
+
l as dateInputDefaultProps
|
|
378
385
|
};
|