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