@progress/kendo-vue-dateinputs 10.2.0-develop.11 → 10.2.0-develop.13

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,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./utils.js"),r=`The size, rounded and fillMode props of the DateInput, DatePicker, DateRangePicker, DateTimePicker and TimePicker no longer have default values. The codemod removed (or replaced with undefined when an earlier spread / v-bind object may provide the prop) the literal null values (size={null}, :fill-mode="null") that it could locate statically; omitting the prop is equivalent to the previous null.
9
+ Review the places it cannot reach: values that evaluate to null at runtime (for example :size="compact ? 'small' : null"), props passed through v-bind="obj" or JSX spreads, the size, rounded and fillMode values set in the *Settings objects, and wrappers that forward these props.
10
+ Before: <DatePicker :size="null" :fill-mode="null" /> rendered no size and fillMode classes, while an omitted prop rendered the default class.
11
+ After: the prop is omitted and no class is rendered; use undefined (or omit the prop) instead of null.
12
+ Replace null with undefined, or omit the prop, in the remaining places.`,e=["size","rounded","fillMode"],n={DateInput:e,DatePicker:e,DateRangePicker:e,DateTimePicker:e,TimePicker:e};function o(i,l){return t.removeNullProps(i,l,t.DATEINPUTS_PACKAGE,n)}exports.aiInstructions=r;exports.default=o;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@progress/kendo-vue-common/codemods"),n=require("@progress/kendo-vue-common/codemods/detect"),i=require("./utils.js"),r=`The size, rounded and fillMode props of the DateInput, DatePicker, DateRangePicker, DateTimePicker and TimePicker no longer have default values ('medium', 'medium' and 'solid'), so the classes that these defaults produced are not rendered unless the props are set explicitly. The rounded validator now also accepts 'none'. The size type of the DateInputSettings, DatePickerSettings, DateRangePickerSettings, DateTimePickerSettings and TimePickerSettings no longer accepts arbitrary strings.
9
+ Review your stylesheets, tests, snapshots and templates that reference the classes below, and every date input or picker that relies on the previous default look.
10
+ Before: the DateInput, DatePicker, DateTimePicker and TimePicker rendered k-input-md k-input-solid k-rounded-md when the props were not set; the swap button of the DateRangePicker rendered k-button-md and k-rounded-md.
11
+ After: none of these classes is rendered unless size, rounded or fillMode is set explicitly.
12
+ Set the props explicitly (for example size="medium" rounded="medium" fillMode="solid") wherever the previous appearance must be kept, and update the CSS selectors, test queries and snapshots that depend on the removed classes.`,a={imports:["DateInput","DatePicker","DateRangePicker","DateTimePicker","TimePicker"],classes:["k-input-md","k-input-solid","k-rounded-md","k-button-md"]};function o(e,s){return t.isRenderingChangeTarget(e.path)&&n.detectChange(e,s,i.DATEINPUTS_PACKAGE,a)&&t.writeInstructionMarker(r,__filename,e.path),e.source}exports.aiInstructions=r;exports.default=o;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 e=require("./dateinputs-appearance-null-props.js"),a=require("./dateinputs-default-appearance-rendering-changes.js");exports.DateinputsAppearanceNullProps=e.default;exports.DateinputsDefaultAppearanceRenderingChanges=a.default;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 g=require("node:path"),d=require("@progress/kendo-vue-common/codemods/sfc");function P(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const h=P(g),x="@progress/kendo-vue-dateinputs",I=new Set([".ts",".tsx",".js",".jsx",".vue"]),m=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0,v=e=>e?.type==="NullLiteral"||e?.type==="Literal"&&e.value===null&&!e.regex,b=(e,r)=>r.includes(d.camelize(e));function O(e,r){if(e.type!=="ObjectProperty"&&e.type!=="Property"||e.computed)return!1;const n=e.key;return n?.type==="Identifier"?b(n.name,r):(n?.type==="StringLiteral"||n?.type==="Literal")&&b(String(n.value),r)}function j(e,r){return e.type===7&&e.name==="bind"&&!!e.arg?.isStatic&&b(e.arg.content,r)&&e.exp?.content.trim()==="null"}const L=new Set(["JSXSpreadAttribute","SpreadElement","SpreadProperty","ExperimentalSpreadProperty"]),E=e=>L.has(e?.type),A=e=>e.type===7&&e.name==="bind"&&!e.arg;function N(e,r,n,c){const a=new Map,l=new Set;if(r.find(e.ImportDeclaration,{source:{value:n}}).forEach(t=>{const i=t.node;if(i.importKind!=="type")for(const s of i.specifiers??[])s.type==="ImportSpecifier"&&s.importKind!=="type"?m(c,s.imported.name)&&a.set(s.local?.name??s.imported.name,s.imported.name):s.type==="ImportNamespaceSpecifier"&&s.local&&l.add(s.local.name)}),!a.size&&!l.size)return;const y=(t,i)=>t.type==="JSXIdentifier"?d.isModuleLevelReference(i,t.name)?a.get(t.name):void 0:t.type==="JSXMemberExpression"&&t.object.type==="JSXIdentifier"&&l.has(t.object.name)&&d.isModuleLevelReference(i,t.object.name)&&m(c,t.property.name)?t.property.name:void 0,S=(t,i)=>t?.type==="Identifier"?d.isModuleLevelReference(i,t.name)?a.get(t.name):void 0:t?.type==="MemberExpression"&&!t.computed&&t.object.type==="Identifier"&&l.has(t.object.name)&&d.isModuleLevelReference(i,t.object.name)&&t.property.type==="Identifier"&&m(c,t.property.name)?t.property.name:void 0;r.find(e.JSXOpeningElement).forEach(t=>{const i=y(t.node.name,t),s=i?m(c,i):void 0;if(!s)return;const p=t.node.attributes??[];for(let u=p.length-1;u>=0;u--){const o=p[u];o.type==="JSXAttribute"&&o.name.type==="JSXIdentifier"&&b(o.name.name,s)&&o.value?.type==="JSXExpressionContainer"&&v(o.value.expression)&&(p.slice(0,u).some(E)?o.value.expression=e.identifier("undefined"):p.splice(u,1))}}),r.find(e.CallExpression).forEach(t=>{const{callee:i,arguments:s}=t.node;if(i.type!=="Identifier"||!["h","createVNode"].includes(i.name))return;const p=S(s[0],t),u=p?m(c,p):void 0;if(!u||s[1]?.type!=="ObjectExpression")return;const o=s[1].properties;for(let f=o.length-1;f>=0;f--)O(o[f],u)&&v(o[f].value)&&(o.slice(0,f).some(E)?o[f].value=e.identifier("undefined"):o.splice(f,1))})}function J(e,r,n,c){if(!I.has(h.extname(e.path))||!e.source.includes(n)||!/\bnull\b/.test(e.source))return e.source;try{return d.transformFile(e,r,{script:(a,l)=>N(a,l,n,c),template:a=>{const l=new Set;for(const y of Object.keys(c))for(const S of a.findElements(y,n))S.props.forEach((t,i)=>{!j(t,c[y])||l.has(t)||(l.add(t),S.props.slice(0,i).some(A)?a.setValue(t,"undefined"):a.removeAttribute(t))})}})}catch{return e.source}}exports.DATEINPUTS_PACKAGE=x;exports.removeNullProps=J;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@progress/kendo-vue-common/codemods"),o=require("@progress/kendo-vue-common/codemods/detect"),r=require("./utils.js"),n=`The Date/Time switcher of the DateTimePicker popup and the default spinner icons of the DateInput changed; some ARIA attributes of the date inputs are now rendered conditionally.
9
+ Review your stylesheets, tests and any code that references the .k-datetime-buttongroup element, the ButtonGroup markup inside it, or the caret-alt icons of the DateInput spinner buttons.
10
+ Before: .k-datetime-buttongroup contains a ButtonGroup (k-button-group) with two toggle buttons (k-button, k-selected on the active one, aria-pressed). The DateInput spinner buttons use the caret-alt-up and caret-alt-down icons (k-i-caret-alt-up, k-i-caret-alt-down font classes; k-svg-i-caret-alt-up, k-svg-i-caret-alt-down SVG classes). The input of the DateInput, DatePicker, DateTimePicker and DateRangePicker (start and end) always renders aria-controls with the popup id; the DateInput input renders role="textbox" by default and aria-disabled="false" when it is enabled.
11
+ After: .k-datetime-buttongroup contains a SegmentedControl (div.k-segmented-control with role="group", a k-segmented-control-thumb element and k-segmented-control-button items with aria-pressed; k-selected marks the active item) that is stretched (k-segmented-control-stretched). The DateInput spinner buttons use the chevron-up and chevron-down icons (k-i-chevron-up, k-i-chevron-down, k-svg-i-chevron-up, k-svg-i-chevron-down). aria-controls is rendered only while the popup is open; the DateInput input has no default role and aria-disabled is rendered only when it is disabled.
12
+ Update CSS selectors, test queries and snapshots that depend on the previous switcher markup, icon classes or ARIA attributes. Change only the selectors that target the DateTimePicker switcher or the DateInput spinners; k-i-caret-alt-up and k-i-caret-alt-down can also belong to other components.`,s={classes:["k-datetime-buttongroup","k-i-caret-alt-up","k-i-caret-alt-down","k-svg-i-caret-alt-up","k-svg-i-caret-alt-down"]};function i(e,a){return t.isRenderingChangeTarget(e.path)&&o.detectChange(e,a,r.DATEINPUTS_PACKAGE,s)&&t.writeInstructionMarker(n,__filename,e.path),e.source}exports.aiInstructions=n;exports.default=i;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 e=require("./dateinputs-rendering-changes.js");exports.DateinputsRenderingChanges=e.default;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 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 e="@progress/kendo-vue-dateinputs";exports.DATEINPUTS_PACKAGE=e;
@@ -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 u=require("vue"),p=require("@progress/kendo-date-math"),V=require("@progress/kendo-vue-intl"),T=require("./models/kendo-date.js"),o=require("@progress/kendo-vue-common"),F=require("@progress/kendo-vue-buttons"),O=require("../package-metadata.js"),$=require("./utils.js"),M=require("../utils.js"),d=require("../messages/main.js"),P=require("../timepicker/utils.js"),w=require("../defaults.js"),_=require("@progress/kendo-vue-labels"),C=require("@progress/kendo-svg-icons");function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!u.isVNode(e)}const q="Please enter a valid value!",A=u.defineComponent({name:"DateInput",model:{event:"changemodel"},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},emits:{change:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0,focus:e=>!0,blur:e=>!0},props:{modelValue:Date,value:Date,defaultValue:Date,format:{type:[String,Object],default:function(){return $.defaultFormat}},formatPlaceholder:{type:[String,Object],default:function(){return $.defaultFormatPlaceholder}},rounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["solid","flat","outline"].includes(e)}},size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},tabIndex:Number,title:String,steps:Object,placeholder:String,max:{type:Date,default:function(){return p.cloneDate(M.MAX_DATE)}},min:{type:Date,default:function(){return p.cloneDate(M.MIN_DATE)}},maxTime:{type:Date,default:function(){return p.cloneDate(w.MAX_TIME)}},minTime:{type:Date,default:function(){return p.cloneDate(w.MIN_TIME)}},disabled:{type:Boolean,default:!1},spinners:{type:Boolean,default:!1},name:String,dir:String,label:String,id:String,validationMessage:{type:String,default:q},required:{type:Boolean,default:!1},validityStyles:{type:Boolean,default:!0},validate:Boolean,valid:{type:Boolean,default:void 0},ariaRole:{type:String,default:void 0},ariaControls:String,ariaLabel:String,ariaExpanded:{type:Boolean,default:void 0},ariaHasPopup:{type:String,default:void 0},inputAttributes:Object},data(){return{kendoDate:null,currentFormat:void 0,valueDuringOnChange:void 0,hasMounted:!1,isEmpty:void 0,isDeleting:!1,lastSelectedSymbol:void 0,isFocused:!1}},created(){o.validatePackage(O.packageMetadata);const{formatPlaceholder:e,format:t,value:a,defaultValue:i}=this.$props;this.kendoDate=new T.KendoDate(this.intl,e,t),this.kendoDate.setValue(null),this._emptyText=this.kendoDate.getTextAndFormat().text,this.kendoDate.setValue(a||i||null),this._element=null,this._inputId=o.guid()},computed:{computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()},wrapperClassNames(){const e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,t=this.$props.disabled,{size:a,fillMode:i,rounded:l}=this.$props;return{"k-dateinput":!0,"k-input":!0,[`k-input-${o.kendoThemeMaps.sizeMap[a]||a}`]:a,[`k-input-${i}`]:i,[`k-rounded-${o.kendoThemeMaps.roundedMap[l]||l}`]:l,"k-disabled":t,"k-invalid":!e&&e!==void 0,"k-focus":this.isFocused,"k-rtl":this.$props.dir==="rtl"}}},methods:{selection(){let e={start:0,end:0};const t=this.element();return t!==null&&t.selectionStart!==void 0&&(e={start:t.selectionStart,end:t.selectionEnd}),e},element(){return this._element},focus(e){this._element&&this._element.focus(e)},handleFocus(e){this.$data.isFocused=!0,this.$emit("focus",{event:e})},handleBlur(e){this.$data.isFocused=!1,this.$data.isDeleting=!1,this.$emit("blur",{event:e})},intl(){return V.provideIntlService(this)},setValidity(){const e=this.element();e&&e.setCustomValidity&&e.setCustomValidity(this.validity().valid?"":this.$props.validationMessage)},spinnersMouseDown(e){const t=this.element();e.preventDefault(),t&&o.canUseDOM&&document.activeElement!==t&&t.focus({preventScroll:!0})},elementChange(e){var g;const t=this.element();if(!t||!this.kendoDate)return;const{text:a,format:i}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=i;const l=this.computedValue,n=e.inputType==="deleteContentBackward",s=(g=e.inputType)==null?void 0:g.startsWith("delete"),r=$.approximateStringMatching(a,this.$data.currentFormat,t.value,this.selection().start),m=r.length===1&&r[0][1]==="_";let h=!1,f=!1;if(!m)for(let c=0;c<r.length;c++){const y=this.kendoDate.parsePart(r[c][0],r[c][1],s);h=!!y.switchToNext,f=!!y.isComplete}if(s){this.handleDelete(n,a,t);return}if(f){t.value=a,this.setSelection(this.selectionBySymbol(r[0][0]));return}if(r.length&&r[0][0]!=="_"&&!h&&this.setSelection(this.selectionBySymbol(r[0][0])),m)this.switchDateSegment(1);else if(h){const c=this.selectionBySymbol(r[0][0]);this.switchDateSegment(1,{start:c.start,end:c.start})}this.triggerChange(e,l)},handleDelete(e,t,a){if(this.$data.isDeleting=!0,!this.kendoDate.hasValue()){a.value=t,this.setSelection(this.selectionByIndex(0));return}e&&this.computedValue===null&&this.switchDateSegment(-1)},elementClick(e){this.setSelection(this.selectionByIndex(this.selection().start))},wheel(e){const t=this.element();o.canUseDOM&&document.activeElement!==t||(e.deltaY<0&&(e.preventDefault(),this.increasePart(e)),e.deltaY>0&&(e.preventDefault(),this.decreasePart(e)))},increasePart(e){e.preventDefault(),this.modifyDateSegmentValue(1,e)},decreasePart(e){e.preventDefault(),this.modifyDateSegmentValue(-1,e)},elementKeyDown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;switch(e.keyCode||{Backspace:8,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Home:36,End:35}[e.key]){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;case 36:this.setSelection(this.selectionByIndex(0));break;case 35:this.setSelection(this.selectionByIndex(this.$data.currentFormat.length));break;default:return}e.preventDefault()},setSelection(e,t=!0){const a=this.element();t&&(this.$data.lastSelectedSymbol=this.$data.currentFormat[e.start]),o.canUseDOM&&window.requestAnimationFrame(()=>{a&&o.canUseDOM&&document.activeElement===a&&a.setSelectionRange(e.start,e.end)})},triggerChange(e,t){this.$data.valueDuringOnChange=this.computedValue,p.isEqual(t,this.computedValue)||(this.$emit("changemodel",this.computedValue),this.$emit("update:modelValue",this.computedValue),this.$emit("change",{event:e,value:this.computedValue,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange,valueAsDate:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},selectionBySymbol(e){let t=-1,a=0;for(let i=0;i<this.$data.currentFormat.length;i++)this.$data.currentFormat[i]===e&&(a=i+1,t===-1&&(t=i));return t<0&&(t=0),{start:t,end:a}},selectionByIndex(e){let t={start:e,end:e};for(let a=e,i=e-1;a<this.$data.currentFormat.length||i>=0;a++,i--){if(a<this.$data.currentFormat.length&&this.$data.currentFormat[a]!=="_"){t=this.selectionBySymbol(this.$data.currentFormat[a]);break}if(i>=0&&this.$data.currentFormat[i]!=="_"){t=this.selectionBySymbol(this.$data.currentFormat[i]);break}}return t},switchDateSegment(e,t){const{start:a,end:i}=t||this.selection();if(a<i&&this.$data.currentFormat[a]!==this.$data.currentFormat[i-1]){this.setSelection(this.selectionByIndex(e>0?a:i-1));return}const l=this.$data.currentFormat[a];let n=a+e;for(;n>0&&n<this.$data.currentFormat.length&&!(this.$data.currentFormat[n]!==l&&this.$data.currentFormat[n]!=="_");)n+=e;if(this.$data.currentFormat[n]==="_")return;let s=n;for(;s>=0&&s<this.$data.currentFormat.length&&this.$data.currentFormat[s]===this.$data.currentFormat[n];)s+=e;n>s&&(s+1!==a||n+1!==i)?this.setSelection({start:s+1,end:n+1}):n<s&&(n!==a||s!==i)&&this.setSelection({start:n,end:s})},modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const a=this.computedValue,i=this.$data.currentFormat[this.selection().start],l=this.kendoDate.symbolMap(i),n=((this.$props.steps||{})[l]||1)*e;this.kendoDate.modifyPart(i,n),this.setSelection(this.selectionBySymbol(i)),this.triggerChange(t,a)},validity(){const e=$.isInRange(this.computedValue,this.$props.min,this.$props.max)&&P.isInTimeRange(this.computedValue,this.$props.minTime,this.$props.maxTime),t=this.$props.validationMessage!==void 0,a=(!this.$props.required||this.computedValue!==null)&&e,i=this.$props.valid!==void 0?this.$props.valid:a;return{customError:t,rangeOverflow:this.computedValue&&this.$props.max.getTime()<this.computedValue.getTime()||!1,rangeUnderflow:this.computedValue&&this.computedValue.getTime()<this.$props.min.getTime()||!1,valid:i,valueMissing:this.computedValue===null}}},mounted(){this._element=o.getRef(this,"input"),this.setValidity(),this.$data.hasMounted=!0},updated(){this.$data.lastSelectedSymbol&&this.setSelection(this.selectionBySymbol(this.$data.lastSelectedSymbol)),this.setValidity()},setup(){const e=u.ref(null),t=u.inject("kendoIntlService",{}),a=u.inject("kendoLocalizationService",{});return{inputRef:e,kendoIntlService:t,kendoLocalizationService:a}},render(){const e=o.getDefaultSlots(this),t=V.provideLocalizationService(this),{formatPlaceholder:a,format:i,value:l,modelValue:n,name:s,label:r,id:m,ariaLabel:h,ariaExpanded:f,ariaHasPopup:g,ariaRole:c,ariaControls:y,inputAttributes:I}=this.$props,D=l!==void 0?l:n;this.kendoDate.format=i,this.kendoDate.formatPlaceholder=a,this.valueDuringOnChange=this.valueDuringOnChange?this.valueDuringOnChange:void 0,D!==void 0&&this.computedValue!==D&&!this.$data.isDeleting&&this.kendoDate.setValue(D);const{text:v,format:B}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=B,this.$data.isEmpty=v===this._emptyText;const k=this.$props.placeholder!==void 0&&this.$data.isEmpty&&!this.$data.isFocused?null:v,b=m||this._inputId,x=!this.$props.validityStyles||this.validity().valid,S=u.createVNode("span",{class:this.wrapperClassNames,dir:this.$props.dir},[u.createVNode("input",u.mergeProps({role:c,tabindex:this.$props.tabIndex,disabled:this.$props.disabled,title:this.$props.title!==void 0?this.$props.title:v,type:"text",spellcheck:!1,autocomplete:"off",autocorrect:"off",class:"k-input-inner",id:b,placeholder:this.$props.placeholder,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onKeydown:this.elementKeyDown,onChange:o.noop,onFocusin:this.handleFocus,onFocusout:this.handleBlur,value:k,name:s,"aria-label":h,"aria-expanded":f,"aria-haspopup":g,"aria-controls":y,"aria-disabled":this.$props.disabled||void 0,ref:o.setRef(this,"input")},I),null),e,this.$props.spinners&&u.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersMouseDown},[u.createVNode(F.Button,{type:"button",tabIndex:-1,icon:"chevron-up",svgIcon:C.chevronUpIcon,size:this.$props.size,fillMode:this.$props.fillMode,class:"k-spinner-increase","aria-label":t.toLanguageString(d.increaseValue,d.messages[d.increaseValue]),title:t.toLanguageString(d.increaseValue,d.messages[d.increaseValue]),onClick:this.increasePart},null),u.createVNode(F.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"chevron-down",svgIcon:C.chevronDownIcon,size:this.$props.size,fillMode:this.$props.fillMode,"aria-label":t.toLanguageString(d.decreaseValue,d.messages[d.decreaseValue]),title:t.toLanguageString(d.decreaseValue,d.messages[d.decreaseValue]),onClick:this.decreasePart},null)])]);return r?u.createVNode(_.FloatingLabel,{label:r,editorId:b,editorValue:k,editorPlaceholder:this.$props.placeholder,editorValid:x,editorDisabled:this.$props.disabled},E(S)?S:{default:()=>[S]}):S}});exports.DateInput=A;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),p=require("@progress/kendo-date-math"),V=require("@progress/kendo-vue-intl"),T=require("./models/kendo-date.js"),o=require("@progress/kendo-vue-common"),F=require("@progress/kendo-vue-buttons"),O=require("../package-metadata.js"),$=require("./utils.js"),M=require("../utils.js"),d=require("../messages/main.js"),P=require("../timepicker/utils.js"),w=require("../defaults.js"),_=require("@progress/kendo-vue-labels"),C=require("@progress/kendo-svg-icons");function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!u.isVNode(e)}const q="Please enter a valid value!",A=u.defineComponent({name:"DateInput",model:{event:"changemodel"},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},emits:{change:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0,focus:e=>!0,blur:e=>!0},props:{modelValue:Date,value:Date,defaultValue:Date,format:{type:[String,Object],default:function(){return $.defaultFormat}},formatPlaceholder:{type:[String,Object],default:function(){return $.defaultFormatPlaceholder}},rounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["solid","flat","outline"].includes(e)}},size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},tabIndex:Number,title:String,steps:Object,placeholder:String,max:{type:Date,default:function(){return p.cloneDate(M.MAX_DATE)}},min:{type:Date,default:function(){return p.cloneDate(M.MIN_DATE)}},maxTime:{type:Date,default:function(){return p.cloneDate(w.MAX_TIME)}},minTime:{type:Date,default:function(){return p.cloneDate(w.MIN_TIME)}},disabled:{type:Boolean,default:!1},spinners:{type:Boolean,default:!1},name:String,dir:String,label:String,id:String,validationMessage:{type:String,default:q},required:{type:Boolean,default:!1},validityStyles:{type:Boolean,default:!0},validate:Boolean,valid:{type:Boolean,default:void 0},ariaRole:{type:String,default:void 0},ariaControls:String,ariaLabel:String,ariaExpanded:{type:Boolean,default:void 0},ariaHasPopup:{type:String,default:void 0},inputAttributes:Object},data(){return{kendoDate:null,currentFormat:void 0,valueDuringOnChange:void 0,hasMounted:!1,isEmpty:void 0,isDeleting:!1,lastSelectedSymbol:void 0,isFocused:!1}},created(){o.validatePackage(O.packageMetadata);const{formatPlaceholder:e,format:t,value:a,defaultValue:i}=this.$props;this.kendoDate=new T.KendoDate(this.intl,e,t),this.kendoDate.setValue(null),this._emptyText=this.kendoDate.getTextAndFormat().text,this.kendoDate.setValue(a||i||null),this._element=null,this._inputId=o.guid()},computed:{computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()},wrapperClassNames(){const e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,t=this.$props.disabled,{size:a,fillMode:i,rounded:l}=this.$props;return{"k-dateinput":!0,"k-input":!0,[`k-input-${o.kendoThemeMaps.sizeMap[a]||a}`]:a,[`k-input-${i}`]:i,[`k-rounded-${o.kendoThemeMaps.roundedMap[l]||l}`]:l,"k-disabled":t,"k-invalid":!e&&e!==void 0,"k-focus":this.isFocused,"k-rtl":this.$props.dir==="rtl"}}},methods:{selection(){let e={start:0,end:0};const t=this.element();return t!==null&&t.selectionStart!==void 0&&(e={start:t.selectionStart,end:t.selectionEnd}),e},element(){return this._element},focus(e){this._element&&this._element.focus(e)},handleFocus(e){this.$data.isFocused=!0,this.$emit("focus",{event:e})},handleBlur(e){this.$data.isFocused=!1,this.$data.isDeleting=!1,this.$emit("blur",{event:e})},intl(){return V.provideIntlService(this)},setValidity(){const e=this.element();e&&e.setCustomValidity&&e.setCustomValidity(this.validity().valid?"":this.$props.validationMessage)},spinnersMouseDown(e){const t=this.element();e.preventDefault(),t&&o.canUseDOM&&document.activeElement!==t&&t.focus({preventScroll:!0})},elementChange(e){var g;const t=this.element();if(!t||!this.kendoDate)return;const{text:a,format:i}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=i;const l=this.computedValue,n=e.inputType==="deleteContentBackward",s=(g=e.inputType)==null?void 0:g.startsWith("delete"),r=$.approximateStringMatching(a,this.$data.currentFormat,t.value,this.selection().start),m=r.length===1&&r[0][1]==="_";let h=!1,f=!1;if(!m)for(let c=0;c<r.length;c++){const y=this.kendoDate.parsePart(r[c][0],r[c][1],s);h=!!y.switchToNext,f=!!y.isComplete}if(s){this.handleDelete(n,a,t);return}if(f){t.value=a,this.setSelection(this.selectionBySymbol(r[0][0]));return}if(r.length&&r[0][0]!=="_"&&!h&&this.setSelection(this.selectionBySymbol(r[0][0])),m)this.switchDateSegment(1);else if(h){const c=this.selectionBySymbol(r[0][0]);this.switchDateSegment(1,{start:c.start,end:c.start})}this.triggerChange(e,l)},handleDelete(e,t,a){if(this.$data.isDeleting=!0,!this.kendoDate.hasValue()){a.value=t,this.setSelection(this.selectionByIndex(0));return}e&&this.computedValue===null&&this.switchDateSegment(-1)},elementClick(e){this.setSelection(this.selectionByIndex(this.selection().start))},wheel(e){const t=this.element();o.canUseDOM&&document.activeElement!==t||(e.deltaY<0&&(e.preventDefault(),this.increasePart(e)),e.deltaY>0&&(e.preventDefault(),this.decreasePart(e)))},increasePart(e){e.preventDefault(),this.modifyDateSegmentValue(1,e)},decreasePart(e){e.preventDefault(),this.modifyDateSegmentValue(-1,e)},elementKeyDown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;switch(e.keyCode||{Backspace:8,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Home:36,End:35}[e.key]){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;case 36:this.setSelection(this.selectionByIndex(0));break;case 35:this.setSelection(this.selectionByIndex(this.$data.currentFormat.length));break;default:return}e.preventDefault()},setSelection(e,t=!0){const a=this.element();t&&(this.$data.lastSelectedSymbol=this.$data.currentFormat[e.start]),o.canUseDOM&&(a&&document.activeElement===a&&a.setSelectionRange(e.start,e.end),window.requestAnimationFrame(()=>{a&&o.canUseDOM&&document.activeElement===a&&a.setSelectionRange(e.start,e.end)}))},triggerChange(e,t){this.$data.valueDuringOnChange=this.computedValue,p.isEqual(t,this.computedValue)||(this.$emit("changemodel",this.computedValue),this.$emit("update:modelValue",this.computedValue),this.$emit("change",{event:e,value:this.computedValue,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange,valueAsDate:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},selectionBySymbol(e){let t=-1,a=0;for(let i=0;i<this.$data.currentFormat.length;i++)this.$data.currentFormat[i]===e&&(a=i+1,t===-1&&(t=i));return t<0&&(t=0),{start:t,end:a}},selectionByIndex(e){let t={start:e,end:e};for(let a=e,i=e-1;a<this.$data.currentFormat.length||i>=0;a++,i--){if(a<this.$data.currentFormat.length&&this.$data.currentFormat[a]!=="_"){t=this.selectionBySymbol(this.$data.currentFormat[a]);break}if(i>=0&&this.$data.currentFormat[i]!=="_"){t=this.selectionBySymbol(this.$data.currentFormat[i]);break}}return t},switchDateSegment(e,t){const{start:a,end:i}=t||this.selection();if(a<i&&this.$data.currentFormat[a]!==this.$data.currentFormat[i-1]){this.setSelection(this.selectionByIndex(e>0?a:i-1));return}const l=this.$data.currentFormat[a];let n=a+e;for(;n>0&&n<this.$data.currentFormat.length&&!(this.$data.currentFormat[n]!==l&&this.$data.currentFormat[n]!=="_");)n+=e;if(this.$data.currentFormat[n]==="_")return;let s=n;for(;s>=0&&s<this.$data.currentFormat.length&&this.$data.currentFormat[s]===this.$data.currentFormat[n];)s+=e;n>s&&(s+1!==a||n+1!==i)?this.setSelection({start:s+1,end:n+1}):n<s&&(n!==a||s!==i)&&this.setSelection({start:n,end:s})},modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const a=this.computedValue,i=this.$data.currentFormat[this.selection().start],l=this.kendoDate.symbolMap(i),n=((this.$props.steps||{})[l]||1)*e;this.kendoDate.modifyPart(i,n),this.setSelection(this.selectionBySymbol(i)),this.triggerChange(t,a)},validity(){const e=$.isInRange(this.computedValue,this.$props.min,this.$props.max)&&P.isInTimeRange(this.computedValue,this.$props.minTime,this.$props.maxTime),t=this.$props.validationMessage!==void 0,a=(!this.$props.required||this.computedValue!==null)&&e,i=this.$props.valid!==void 0?this.$props.valid:a;return{customError:t,rangeOverflow:this.computedValue&&this.$props.max.getTime()<this.computedValue.getTime()||!1,rangeUnderflow:this.computedValue&&this.computedValue.getTime()<this.$props.min.getTime()||!1,valid:i,valueMissing:this.computedValue===null}}},mounted(){this._element=o.getRef(this,"input"),this.setValidity(),this.$data.hasMounted=!0},updated(){this.$data.lastSelectedSymbol&&this.setSelection(this.selectionBySymbol(this.$data.lastSelectedSymbol)),this.setValidity()},setup(){const e=u.ref(null),t=u.inject("kendoIntlService",{}),a=u.inject("kendoLocalizationService",{});return{inputRef:e,kendoIntlService:t,kendoLocalizationService:a}},render(){const e=o.getDefaultSlots(this),t=V.provideLocalizationService(this),{formatPlaceholder:a,format:i,value:l,modelValue:n,name:s,label:r,id:m,ariaLabel:h,ariaExpanded:f,ariaHasPopup:g,ariaRole:c,ariaControls:y,inputAttributes:I}=this.$props,D=l!==void 0?l:n;this.kendoDate.format=i,this.kendoDate.formatPlaceholder=a,this.valueDuringOnChange=this.valueDuringOnChange?this.valueDuringOnChange:void 0,D!==void 0&&this.computedValue!==D&&!this.$data.isDeleting&&this.kendoDate.setValue(D);const{text:v,format:B}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=B,this.$data.isEmpty=v===this._emptyText;const k=this.$props.placeholder!==void 0&&this.$data.isEmpty&&!this.$data.isFocused?null:v,b=m||this._inputId,x=!this.$props.validityStyles||this.validity().valid,S=u.createVNode("span",{class:this.wrapperClassNames,dir:this.$props.dir},[u.createVNode("input",u.mergeProps({role:c,tabindex:this.$props.tabIndex,disabled:this.$props.disabled,title:this.$props.title!==void 0?this.$props.title:v,type:"text",spellcheck:!1,autocomplete:"off",autocorrect:"off",class:"k-input-inner",id:b,placeholder:this.$props.placeholder,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onKeydown:this.elementKeyDown,onChange:o.noop,onFocusin:this.handleFocus,onFocusout:this.handleBlur,value:k,name:s,"aria-label":h,"aria-expanded":f,"aria-haspopup":g,"aria-controls":y,"aria-disabled":this.$props.disabled||void 0,ref:o.setRef(this,"input")},I),null),e,this.$props.spinners&&u.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersMouseDown},[u.createVNode(F.Button,{type:"button",tabIndex:-1,icon:"chevron-up",svgIcon:C.chevronUpIcon,size:this.$props.size,fillMode:this.$props.fillMode,class:"k-spinner-increase","aria-label":t.toLanguageString(d.increaseValue,d.messages[d.increaseValue]),title:t.toLanguageString(d.increaseValue,d.messages[d.increaseValue]),onClick:this.increasePart},null),u.createVNode(F.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"chevron-down",svgIcon:C.chevronDownIcon,size:this.$props.size,fillMode:this.$props.fillMode,"aria-label":t.toLanguageString(d.decreaseValue,d.messages[d.decreaseValue]),title:t.toLanguageString(d.decreaseValue,d.messages[d.decreaseValue]),onClick:this.decreasePart},null)])]);return r?u.createVNode(_.FloatingLabel,{label:r,editorId:b,editorValue:k,editorPlaceholder:this.$props.placeholder,editorValid:x,editorDisabled:this.$props.disabled},E(S)?S:{default:()=>[S]}):S}});exports.DateInput=A;
@@ -9,7 +9,7 @@ import { defineComponent as M, createVNode as d, mergeProps as T, ref as _, inje
9
9
  import { isEqual as P, cloneDate as g } from "@progress/kendo-date-math";
10
10
  import { provideLocalizationService as E, provideIntlService as A } from "@progress/kendo-vue-intl";
11
11
  import { KendoDate as L } from "./models/kendo-date.mjs";
12
- import { getDefaultSlots as z, noop as j, setRef as R, getRef as N, canUseDOM as y, kendoThemeMaps as w, validatePackage as K, guid as H } from "@progress/kendo-vue-common";
12
+ import { getDefaultSlots as z, noop as R, setRef as j, getRef as N, canUseDOM as y, kendoThemeMaps as w, validatePackage as K, guid as H } from "@progress/kendo-vue-common";
13
13
  import { Button as C } from "@progress/kendo-vue-buttons";
14
14
  import { packageMetadata as q } from "../package-metadata.mjs";
15
15
  import { isInRange as U, approximateStringMatching as W, defaultFormatPlaceholder as X, defaultFormat as Y } from "./utils.mjs";
@@ -328,9 +328,9 @@ const se = "Please enter a valid value!", ve = /* @__PURE__ */ M({
328
328
  },
329
329
  setSelection(e, t = !0) {
330
330
  const i = this.element();
331
- t && (this.$data.lastSelectedSymbol = this.$data.currentFormat[e.start]), y && window.requestAnimationFrame(() => {
331
+ t && (this.$data.lastSelectedSymbol = this.$data.currentFormat[e.start]), y && (i && document.activeElement === i && i.setSelectionRange(e.start, e.end), window.requestAnimationFrame(() => {
332
332
  i && y && document.activeElement === i && i.setSelectionRange(e.start, e.end);
333
- });
333
+ }));
334
334
  },
335
335
  triggerChange(e, t) {
336
336
  this.$data.valueDuringOnChange = this.computedValue, P(t, this.computedValue) || (this.$emit("changemodel", this.computedValue), this.$emit("update:modelValue", this.computedValue), this.$emit("change", {
@@ -469,7 +469,7 @@ const se = "Please enter a valid value!", ve = /* @__PURE__ */ M({
469
469
  onClick: this.elementClick,
470
470
  onInput: this.elementChange,
471
471
  onKeydown: this.elementKeyDown,
472
- onChange: j,
472
+ onChange: R,
473
473
  onFocusin: this.handleFocus,
474
474
  onFocusout: this.handleBlur,
475
475
  value: k,
@@ -479,7 +479,7 @@ const se = "Please enter a valid value!", ve = /* @__PURE__ */ M({
479
479
  "aria-haspopup": p,
480
480
  "aria-controls": m,
481
481
  "aria-disabled": this.$props.disabled || void 0,
482
- ref: R(this, "input")
482
+ ref: j(this, "input")
483
483
  }, I), null), e, this.$props.spinners && d("span", {
484
484
  class: "k-input-spinner k-spin-button",
485
485
  onMousedown: this.spinnersMouseDown