@progress/kendo-vue-dateinputs 8.4.0-develop.3 → 8.4.0-develop.5
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/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +44 -43
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +11 -11
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +21 -21
- package/datepicker/ToggleButton.d.ts +4 -4
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +24 -24
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +14 -14
- package/datetimepicker/DateTimeSelector.d.ts +1 -2
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +56 -66
- package/dist/cdn/js/kendo-vue-dateinputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +14 -9
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +1 -1
|
@@ -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 p=require("vue"),r=require("@progress/kendo-vue-common"),i=require("@progress/kendo-date-math"),b=require("@progress/kendo-vue-intl"),F=require("../../package-metadata.js"),M=require("./ViewList.js"),m=require("../../defaults.js"),l=require("../models/CalendarViewEnum.js"),d=require("../../utils.js"),R=require("../services/BusViewService.js"),A=require("../services/DOMService.js"),x=require("../services/NavigationService.js"),y=require("./Header.js"),n=require("../utils/main.js"),E=p.defineComponent({name:"KendoCalendar",inject:{kendoIntlService:{default:null}},model:{event:"changemodel"},props:{activeRangeEnd:{type:String,default:void 0},allowReverse:{type:Boolean,default:!1},cell:[String,Function,Object],className:String,defaultActiveView:{type:String,default:"month"},modelValue:{type:[Date,Array,Object],default:void 0},defaultValue:{type:[Date,Array,Object],default:null},disabled:{type:Boolean,default:!1},focusedDate:Date,id:{type:String,default:function(){return r.guid()}},headerTitle:[String,Function,Object],max:{type:Date,default:function(){return m.MAX_DATE}},min:{type:Date,default:function(){return m.MIN_DATE}},mode:String,navigation:{type:Boolean,default:!0},tabIndex:Number,value:[Date,Array,Object],views:{type:Number,default:1},weekNumber:Boolean,weekCell:[String,Function,Object],topView:{type:String,default:"century"},bottomView:{type:String,default:"month"},onFocus:Function,onBlur:Function,onChange:Function,onKeydown:Function},data:function(){return{valueDuringOnChange:void 0,currentFocusedDate:null,currentActiveView:null,currentValue:null,cellUID:r.guid(),isActive:!1,oldValue:null,didNavigationChange:!1,currentActiveRangeEnd:void 0}},created:function(){r.validatePackage(F.packageMetadata);const e=n.calculateValue(this.currentMin,this.currentMax,this.$props.defaultValue,this.$props.value||this.$props.modelValue),t=n.extractDateFromValue(this.currentMin,this.currentMax,e),a=n.extractMultipleFromValue(this.currentMin,this.currentMax,e),s=n.extractRangeFromValue(e),c=n.extractFocusedDate(t,a,s);this._hasMounted=!1,this.$data.currentFocusedDate=d.dateInRange(this.$props.focusedDate||c||d.getToday(),this.currentMin,this.currentMax),this.$data.currentValue=e,this.$data.currentActiveView=d.viewInRange(l.CalendarViewEnum[this.$props.defaultActiveView],l.CalendarViewEnum[this.$props.bottomView],l.CalendarViewEnum[this.$props.topView]),this.$data.currentActiveRangeEnd=n.extractActiveRange(s,t),this._dates=[],this._calculateFocusFromValue=!1,this._lastView=this.$props.activeView||this.$data.currentActiveView,this._lastViewsCount=this.$props.views,this._dom=new A.DOMService,this._bus=new R.BusViewService(this.handleViewChange),this._navigation=new x.NavigationService(this._bus),this._oldValue=e},watch:{value:function(e){this.$data.currentFocusedDate=e},focusedDate:function(e){this.$data.currentFocusedDate=e}},setup(){return{kendoIntlService:p.inject("kendoIntlService",{})}},mounted(){this.calendarViewList=this.calendarViewListRef,this._calculateFocusFromValue=!0},updated(){const e=n.extractDateFromValue(this.currentMin,this.currentMax,this.computedValue());this._calculateFocusFromValue=!!(this._selectedDate&&e&&this._selectedDate.getTime()&&e.getTime()),this._lastView=this.$props.activeView||this.$data.currentActiveView,this._lastViewsCount=this.$props.views,this._oldValue=this.computedValue(),this.calendarViewList||(this.calendarViewList=this.calendarViewListRef)},computed:{activeRange(){return this.$props.activeRangeEnd!==void 0?this.$props.activeRangeEnd:this.$data.currentActiveRangeEnd},currentMin(){return i.getDate(this.$props.min)},currentMax(){return i.getDate(this.$props.max)}},methods:{element(){return this.$el},computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.$data.currentValue},focus(){this.calendarViewList&&this.calendarViewList.$el.firstElementChild.focus()},handleBlur(){this.$data.isActive=!1},handleFocus(){this.$data.isActive=!0},emitBlur(e){this.$emit("blur",e)},emitFocus(e){this.$emit("focus",e)},handleTodayClick(e){if(this.$props.disabled)return;this.$data.didNavigationChange=!0;const t=i.cloneDate(e.value);this.$data.currentFocusedDate=t,this.$data.currentValue=t,this.triggerChange(t,e)},handleViewChange({view:e}){this.$data.currentActiveView=e},handlePrevClick(e){const t=i.cloneDate(e.value);this.focus(),!this.$props.disabled&&(this.$data.currentFocusedDate=t)},handleTitleClick(){this.focus()},handleNextClick(e){const t=i.cloneDate(e.value);this.focus(),!this.$props.disabled&&(this.$data.currentFocusedDate=t)},handleCellEnter(e){this.$props.mode==="range"&&(this.$data.currentFocusedDate=e)},generateRange(e,t){let{end:a,start:s}=t;const c=t.start!==null&&e.getTime()<=t.start.getTime();return!this.$props.allowReverse&&c?{start:e,end:this._selectedRange.start}:this.activeRange!=="end"?{start:e,end:a}:{start:s||this._selectedDate,end:e}},clampRange(e){return{start:e,end:null}},handleWeekCellClick(e){this.$emit("weekcellclick",e)},handleWeekNameClick(e){this.$emit("weeknameclick",e)},handleDateChange(e){const t=i.cloneDate(e.value),a=this._bus.canMoveDown(this.$data.currentActiveView);if(this.$props.disabled)return;if(a)if(e.isTodayClick)this._bus.moveToBottom(this.$data.currentActiveView);else{this._bus.moveDown(this.$data.currentActiveView,e.event),this.$data.currentFocusedDate=t;return}let s,c;switch(this.$props.mode){case"single":s=i.cloneDate(e.value);break;case"multiple":if(Array.isArray(this._selectedMultiple)){let u=this._selectedMultiple.slice(),h=-1;u.forEach((g,o)=>{i.isEqualDate(g,e.value)&&(h=o)}),h!==-1?u.splice(h,1):u.push(i.cloneDate(e.value)),s=u.slice()}else this._selectedDate?s=[i.cloneDate(this._selectedDate),i.cloneDate(e.value)]:s=[i.cloneDate(e.value)];break;case"range":c=this._selectedRange.start!==null&&this._selectedRange.end!==null&&this.activeRange==="start",s=c?this.clampRange(e.value):this.generateRange(e.value,this._selectedRange),this.$data.currentActiveRangeEnd=this.activeRange!=="end"?"end":"start";break;default:s=i.cloneDate(e.value);break}this.$data.currentValue=s,this.triggerChange(s,e)},triggerChange(e,t){this.$data.valueDuringOnChange=e;const a={event:t.event,value:e,component:this,target:{name:this.$props.name,value:e,valueAsDate:e}};this.$emit("changemodel",e),this.$emit("update:modelValue",e),this.$emit("change",a),this.$data.valueDuringOnChange=void 0},handleMouseDown(e){const t=i.cloneDate(e.value);this.$props.disabled||this.$data.currentActiveView!==0||(this.$data.currentFocusedDate=t)},tableKeyDown(e){const{keyCode:t}=e;if(this.$emit("keydown",e),t===r.Keys.enter){const a={event:e,value:this._focusedDate,component:this,target:{name:this.$props.name,value:this._focusedDate,valueAsDate:this._focusedDate}};this.handleDateChange(a)}else{const a=d.dateInRange(this._navigation.move(this._focusedDate,this._navigation.action(e),this.$data.currentActiveView,this._service,e),this.currentMin,this.currentMax);if(i.isEqualDate(this._focusedDate,a))return;this._calculateFocusFromValue=!1,this.$data.currentFocusedDate=a}e.preventDefault()},isValueEqual(e,t){return e instanceof Date&&t instanceof Date?i.isEqualDate(e,t):e instanceof Object&&t instanceof Object?!!(e&&t&&i.isEqualDate(e.start,t.start)&&i.isEqualDate(e.end,t.end)):e instanceof Array&&t instanceof Array?!!(e&&t&&e.length===t.length):!1},rangeWithFocused(e,t){return{start:e.start,end:e.end===null&&e.start!==null&&this.$data.isActive?t.end:e.end}}},render(){const e=this.$props.views,t=this.computedValue(),a=this.$data.currentFocusedDate,s=t!==null&&this._oldValue!==null?!this.isValueEqual(t,this._oldValue):t!==this._oldValue;this._selectedDate=n.extractDateFromValue(this.currentMin,this.currentMax,t),this._selectedMultiple=n.extractMultipleFromValue(this.currentMin,this.currentMax,t);const c=r.templateRendering.call(this,this.$props.cell,r.getListeners.call(this)),u=r.templateRendering.call(this,this.$props.weekCell,r.getListeners.call(this)),h=r.templateRendering.call(this,this.$props.headerTitle,r.getListeners.call(this)),g=d.viewInRange(this.$data.currentActiveView,l.CalendarViewEnum[this.$props.bottomView],l.CalendarViewEnum[this.$props.topView]);this._selectedDate=n.extractDateFromValue(this.currentMin,this.currentMax,t),this._selectedMultiple=n.extractMultipleFromValue(this.currentMin,this.currentMax,t),this._selectedRange=n.extractRangeFromValue(t);const o=n.extractFocusedDate(this._selectedDate,this._selectedMultiple,this._selectedRange),f=d.dateInRange(s&&o!==null?o:a,this.currentMin,this.currentMax);f instanceof Date?this._focusedDate=i.getDate(f):o&&(this._focusedDate=o);const v=this.rangeWithFocused(this._selectedRange,a);this._intl=b.provideIntlService(this),this._bus.configure(l.CalendarViewEnum[this.$props.bottomView],l.CalendarViewEnum[this.$props.topView]),this._service=this._bus.service(g,this._intl);const D=r.classNames("k-calendar","k-calendar-md",{"k-calendar-range":e>1,"k-disabled":this.$props.disabled,"k-week-number":this.$props.weekNumber},this.$props.className),$=this._lastView!==this.$data.currentActiveView,w=this._dates&&this._service.isInArray(this._focusedDate,this._dates),V=this._lastViewsCount!==this.$props.views;(!w||$||V)&&(this._dates=this._service.datesList(this._focusedDate,e));const _=i.cloneDate(this._dates&&this._dates[0]?this._dates[0]:void 0),C=[this.$props.navigation&&p.createVNode(y.Header,{tabIndex:this.$props.disabled?void 0:this.$props.tabIndex||0,activeView:this.$data.currentActiveView,currentDate:_,focusedDate:this._focusedDate,min:this.currentMin,max:this.currentMax,rangeLength:this.$props.views,onTodayclick:this.handleTodayClick,onNextclick:this.handleNextClick,onPrevclick:this.handlePrevClick,onTitleclick:this.handleTitleClick,bus:this._bus,service:this._service,headerTitle:h},null),p.createVNode(M.ViewList,{allowReverse:this.$props.allowReverse,isActive:this.$data.isActive,tabIndex:this.$props.tabIndex||0,ref:k=>{this.calendarViewListRef=k},activeView:this.$data.currentActiveView,focusedDate:this._focusedDate,min:this.currentMin,max:this.currentMax,bus:this._bus,dates:this._dates,shouldScroll:this.$data.didNavigationChange,service:this._service,cell:c,weekCell:u,dom:this._dom,views:this.$props.views,selectionRange:v,showWeekNumbers:this.$props.weekNumber,onChange:this.handleDateChange,onWeekcellclick:this.handleWeekCellClick,onWeeknameclick:this.handleWeekNameClick,onListmousedown:this.handleMouseDown,onCellenter:this.handleCellEnter,onListkeydown:this.tableKeyDown,onListfocus:this.handleFocus,onListblur:this.handleBlur,value:this._selectedMultiple||this._selectedDate,cellUID:this.$data.cellUID},null)];return p.createVNode("div",{"aria-disabled":this.$props.disabled===!0?!0:void 0,class:D,id:this.$props.id,onFocusout:this.emitBlur,onFocusin:this.emitFocus},[C])}});exports.Calendar=E;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),r=require("@progress/kendo-vue-common"),i=require("@progress/kendo-date-math"),M=require("@progress/kendo-vue-intl"),b=require("../../package-metadata.js"),F=require("./ViewList.js"),m=require("../../defaults.js"),u=require("../models/CalendarViewEnum.js"),l=require("../../utils.js"),R=require("../services/BusViewService.js"),x=require("../services/DOMService.js"),A=require("../services/NavigationService.js"),y=require("./Header.js"),n=require("../utils/main.js"),E=p.defineComponent({name:"KendoCalendar",inject:{kendoIntlService:{default:null}},model:{event:"changemodel"},props:{activeRangeEnd:{type:String,default:void 0},allowReverse:{type:Boolean,default:!1},cell:[String,Function,Object],className:String,defaultActiveView:{type:String,default:"month"},modelValue:{type:[Date,Array,Object],default:void 0},defaultValue:{type:[Date,Array,Object],default:null},disabled:{type:Boolean,default:!1},focusedDate:Date,id:{type:String,default:function(){return r.guid()}},headerTitle:[String,Function,Object],max:{type:Date,default:function(){return m.MAX_DATE}},min:{type:Date,default:function(){return m.MIN_DATE}},mode:String,navigation:{type:Boolean,default:!0},tabIndex:Number,value:[Date,Array,Object],views:{type:Number,default:1},weekNumber:Boolean,weekCell:[String,Function,Object],topView:{type:String,default:"century"},bottomView:{type:String,default:"month"},onFocus:Function,onBlur:Function,onChange:Function,onKeydown:Function},data:function(){return{valueDuringOnChange:void 0,currentFocusedDate:null,currentActiveView:null,currentValue:null,cellUID:r.guid(),isActive:!1,oldValue:null,didNavigationChange:!1,currentActiveRangeEnd:void 0}},created:function(){r.validatePackage(b.packageMetadata);const e=n.calculateValue(this.currentMin,this.currentMax,this.$props.defaultValue,this.$props.value||this.$props.modelValue),t=n.extractDateFromValue(this.currentMin,this.currentMax,e),a=n.extractMultipleFromValue(this.currentMin,this.currentMax,e),s=n.extractRangeFromValue(e),c=n.extractFocusedDate(t,a,s);this._hasMounted=!1,this.$data.currentFocusedDate=l.dateInRange(this.$props.focusedDate||c||l.getToday(),this.currentMin,this.currentMax),this.$data.currentValue=e,this.$data.currentActiveView=l.viewInRange(u.CalendarViewEnum[this.$props.defaultActiveView],u.CalendarViewEnum[this.$props.bottomView],u.CalendarViewEnum[this.$props.topView]),this.$data.currentActiveRangeEnd=n.extractActiveRange(s,t),this._dates=[],this._calculateFocusFromValue=!1,this._lastView=this.$props.activeView||this.$data.currentActiveView,this._lastViewsCount=this.$props.views,this._dom=new x.DOMService,this._bus=new R.BusViewService(this.handleViewChange),this._navigation=new A.NavigationService(this._bus),this._oldValue=e},watch:{value:function(e){const t=n.extractDateFromValue(this.currentMin,this.currentMax,e),a=n.extractMultipleFromValue(this.currentMin,this.currentMax,e),s=n.extractRangeFromValue(e),c=n.extractFocusedDate(t,a,s);this.$data.currentFocusedDate=l.dateInRange(this.$props.focusedDate||c||l.getToday(),this.currentMin,this.currentMax)},focusedDate:function(e){this.$data.currentFocusedDate=e}},setup(){return{kendoIntlService:p.inject("kendoIntlService",{})}},mounted(){this.calendarViewList=this.calendarViewListRef,this._calculateFocusFromValue=!0},updated(){const e=n.extractDateFromValue(this.currentMin,this.currentMax,this.computedValue());this._calculateFocusFromValue=!!(this._selectedDate&&e&&this._selectedDate.getTime()&&e.getTime()),this._lastView=this.$props.activeView||this.$data.currentActiveView,this._lastViewsCount=this.$props.views,this._oldValue=this.computedValue(),this.calendarViewList||(this.calendarViewList=this.calendarViewListRef)},computed:{activeRange(){return this.$props.activeRangeEnd!==void 0?this.$props.activeRangeEnd:this.$data.currentActiveRangeEnd},currentMin(){return i.getDate(this.$props.min)},currentMax(){return i.getDate(this.$props.max)}},methods:{element(){return this.$el},computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.$data.currentValue},focus(){this.calendarViewList&&this.calendarViewList.$el.firstElementChild.focus()},handleBlur(){this.$data.isActive=!1},handleFocus(){this.$data.isActive=!0},emitBlur(e){this.$emit("blur",e)},emitFocus(e){this.$emit("focus",e)},handleTodayClick(e){if(this.$props.disabled)return;this.$data.didNavigationChange=!0;const t=i.cloneDate(e.value);this.$data.currentFocusedDate=t,this.$data.currentValue=t,this.triggerChange(t,e)},handleViewChange({view:e}){this.$data.currentActiveView=e},handlePrevClick(e){const t=i.cloneDate(e.value);this.focus(),!this.$props.disabled&&(this.$data.currentFocusedDate=t)},handleTitleClick(){this.focus()},handleNextClick(e){const t=i.cloneDate(e.value);this.focus(),!this.$props.disabled&&(this.$data.currentFocusedDate=t)},handleCellEnter(e){this.$props.mode==="range"&&(this.$data.currentFocusedDate=e)},generateRange(e,t){let{end:a,start:s}=t;const c=t.start!==null&&e.getTime()<=t.start.getTime();return!this.$props.allowReverse&&c?{start:e,end:this._selectedRange.start}:this.activeRange!=="end"?{start:e,end:a}:{start:s||this._selectedDate,end:e}},clampRange(e){return{start:e,end:null}},handleWeekCellClick(e){this.$emit("weekcellclick",e)},handleWeekNameClick(e){this.$emit("weeknameclick",e)},handleDateChange(e){const t=i.cloneDate(e.value),a=this._bus.canMoveDown(this.$data.currentActiveView);if(this.$props.disabled)return;if(a)if(e.isTodayClick)this._bus.moveToBottom(this.$data.currentActiveView);else{this._bus.moveDown(this.$data.currentActiveView,e.event),this.$data.currentFocusedDate=t;return}let s,c;switch(this.$props.mode){case"single":s=i.cloneDate(e.value);break;case"multiple":if(Array.isArray(this._selectedMultiple)){let o=this._selectedMultiple.slice(),h=-1;o.forEach((g,d)=>{i.isEqualDate(g,e.value)&&(h=d)}),h!==-1?o.splice(h,1):o.push(i.cloneDate(e.value)),s=o.slice()}else this._selectedDate?s=[i.cloneDate(this._selectedDate),i.cloneDate(e.value)]:s=[i.cloneDate(e.value)];break;case"range":c=this._selectedRange.start!==null&&this._selectedRange.end!==null&&this.activeRange==="start",s=c?this.clampRange(e.value):this.generateRange(e.value,this._selectedRange),this.$data.currentActiveRangeEnd=this.activeRange!=="end"?"end":"start";break;default:s=i.cloneDate(e.value);break}this.$data.currentValue=s,this.triggerChange(s,e)},triggerChange(e,t){this.$data.valueDuringOnChange=e;const a={event:t.event,value:e,component:this,target:{name:this.$props.name,value:e,valueAsDate:e}};this.$emit("changemodel",e),this.$emit("update:modelValue",e),this.$emit("change",a),this.$data.valueDuringOnChange=void 0},handleMouseDown(e){const t=i.cloneDate(e.value);this.$props.disabled||this.$data.currentActiveView!==0||(this.$data.currentFocusedDate=t)},tableKeyDown(e){const{keyCode:t}=e;if(this.$emit("keydown",e),t===r.Keys.enter){const a={event:e,value:this._focusedDate,component:this,target:{name:this.$props.name,value:this._focusedDate,valueAsDate:this._focusedDate}};this.handleDateChange(a)}else{const a=l.dateInRange(this._navigation.move(this._focusedDate,this._navigation.action(e),this.$data.currentActiveView,this._service,e),this.currentMin,this.currentMax);if(i.isEqualDate(this._focusedDate,a))return;this._calculateFocusFromValue=!1,this.$data.currentFocusedDate=a}e.preventDefault()},isValueEqual(e,t){return e instanceof Date&&t instanceof Date?i.isEqualDate(e,t):e instanceof Object&&t instanceof Object?!!(e&&t&&i.isEqualDate(e.start,t.start)&&i.isEqualDate(e.end,t.end)):e instanceof Array&&t instanceof Array?!!(e&&t&&e.length===t.length):!1},rangeWithFocused(e,t){return{start:e.start,end:e.end===null&&e.start!==null&&this.$data.isActive?t.end:e.end}}},render(){const e=this.$props.views,t=this.computedValue(),a=this.$data.currentFocusedDate,s=t!==null&&this._oldValue!==null?!this.isValueEqual(t,this._oldValue):t!==this._oldValue;this._selectedDate=n.extractDateFromValue(this.currentMin,this.currentMax,t),this._selectedMultiple=n.extractMultipleFromValue(this.currentMin,this.currentMax,t);const c=r.templateRendering.call(this,this.$props.cell,r.getListeners.call(this)),o=r.templateRendering.call(this,this.$props.weekCell,r.getListeners.call(this)),h=r.templateRendering.call(this,this.$props.headerTitle,r.getListeners.call(this)),g=l.viewInRange(this.$data.currentActiveView,u.CalendarViewEnum[this.$props.bottomView],u.CalendarViewEnum[this.$props.topView]);this._selectedDate=n.extractDateFromValue(this.currentMin,this.currentMax,t),this._selectedMultiple=n.extractMultipleFromValue(this.currentMin,this.currentMax,t),this._selectedRange=n.extractRangeFromValue(t);const d=n.extractFocusedDate(this._selectedDate,this._selectedMultiple,this._selectedRange),f=l.dateInRange(s&&d!==null?d:a,this.currentMin,this.currentMax);f instanceof Date?this._focusedDate=i.getDate(f):d&&(this._focusedDate=d);const v=this.rangeWithFocused(this._selectedRange,a);this._intl=M.provideIntlService(this),this._bus.configure(u.CalendarViewEnum[this.$props.bottomView],u.CalendarViewEnum[this.$props.topView]),this._service=this._bus.service(g,this._intl);const D=r.classNames("k-calendar","k-calendar-md",{"k-calendar-range":e>1,"k-disabled":this.$props.disabled,"k-week-number":this.$props.weekNumber},this.$props.className),$=this._lastView!==this.$data.currentActiveView,w=this._dates&&this._service.isInArray(this._focusedDate,this._dates),V=this._lastViewsCount!==this.$props.views;(!w||$||V)&&(this._dates=this._service.datesList(this._focusedDate,e));const _=i.cloneDate(this._dates&&this._dates[0]?this._dates[0]:void 0),C=[this.$props.navigation&&p.createVNode(y.Header,{tabIndex:this.$props.disabled?void 0:this.$props.tabIndex||0,activeView:this.$data.currentActiveView,currentDate:_,focusedDate:this._focusedDate,min:this.currentMin,max:this.currentMax,rangeLength:this.$props.views,onTodayclick:this.handleTodayClick,onNextclick:this.handleNextClick,onPrevclick:this.handlePrevClick,onTitleclick:this.handleTitleClick,bus:this._bus,service:this._service,headerTitle:h},null),p.createVNode(F.ViewList,{allowReverse:this.$props.allowReverse,isActive:this.$data.isActive,tabIndex:this.$props.tabIndex||0,ref:k=>{this.calendarViewListRef=k},activeView:this.$data.currentActiveView,focusedDate:this._focusedDate,min:this.currentMin,max:this.currentMax,bus:this._bus,dates:this._dates,shouldScroll:this.$data.didNavigationChange,service:this._service,cell:c,weekCell:o,dom:this._dom,views:this.$props.views,selectionRange:v,showWeekNumbers:this.$props.weekNumber,onChange:this.handleDateChange,onWeekcellclick:this.handleWeekCellClick,onWeeknameclick:this.handleWeekNameClick,onListmousedown:this.handleMouseDown,onCellenter:this.handleCellEnter,onListkeydown:this.tableKeyDown,onListfocus:this.handleFocus,onListblur:this.handleBlur,value:this._selectedMultiple||this._selectedDate,cellUID:this.$data.cellUID},null)];return p.createVNode("div",{"aria-disabled":this.$props.disabled===!0?!0:void 0,class:D,id:this.$props.id,onFocusout:this.emitBlur,onFocusin:this.emitFocus},[C])}});exports.Calendar=E;
|
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { templateRendering as
|
|
10
|
-
import { getDate as
|
|
11
|
-
import { provideIntlService as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
import { ViewList as
|
|
14
|
-
import { MIN_DATE as
|
|
8
|
+
import { defineComponent as S, createVNode as m, inject as I } from "vue";
|
|
9
|
+
import { templateRendering as g, getListeners as v, classNames as T, Keys as E, validatePackage as L, guid as V } from "@progress/kendo-vue-common";
|
|
10
|
+
import { getDate as $, cloneDate as a, isEqualDate as o } from "@progress/kendo-date-math";
|
|
11
|
+
import { provideIntlService as O } from "@progress/kendo-vue-intl";
|
|
12
|
+
import { packageMetadata as B } from "../../package-metadata.mjs";
|
|
13
|
+
import { ViewList as j } from "./ViewList.mjs";
|
|
14
|
+
import { MIN_DATE as W, MAX_DATE as K } from "../../defaults.mjs";
|
|
15
15
|
import { CalendarViewEnum as r } from "../models/CalendarViewEnum.mjs";
|
|
16
|
-
import { viewInRange as
|
|
16
|
+
import { viewInRange as k, dateInRange as d, getToday as b } from "../../utils.mjs";
|
|
17
17
|
import { BusViewService as P } from "../services/BusViewService.mjs";
|
|
18
18
|
import { DOMService as q } from "../services/DOMService.mjs";
|
|
19
19
|
import { NavigationService as U } from "../services/NavigationService.mjs";
|
|
20
20
|
import { Header as z } from "./Header.mjs";
|
|
21
|
-
import { extractDateFromValue as h, extractMultipleFromValue as
|
|
22
|
-
const ue = /* @__PURE__ */
|
|
21
|
+
import { extractDateFromValue as h, extractMultipleFromValue as p, extractRangeFromValue as D, extractFocusedDate as w, calculateValue as H, extractActiveRange as X } from "../utils/main.mjs";
|
|
22
|
+
const ue = /* @__PURE__ */ S({
|
|
23
23
|
name: "KendoCalendar",
|
|
24
24
|
inject: {
|
|
25
25
|
kendoIntlService: {
|
|
@@ -60,20 +60,20 @@ const ue = /* @__PURE__ */ N({
|
|
|
60
60
|
id: {
|
|
61
61
|
type: String,
|
|
62
62
|
default: function() {
|
|
63
|
-
return
|
|
63
|
+
return V();
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
headerTitle: [String, Function, Object],
|
|
67
67
|
max: {
|
|
68
68
|
type: Date,
|
|
69
69
|
default: function() {
|
|
70
|
-
return
|
|
70
|
+
return K;
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
min: {
|
|
74
74
|
type: Date,
|
|
75
75
|
default: function() {
|
|
76
|
-
return
|
|
76
|
+
return W;
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
mode: String,
|
|
@@ -108,7 +108,7 @@ const ue = /* @__PURE__ */ N({
|
|
|
108
108
|
currentFocusedDate: null,
|
|
109
109
|
currentActiveView: null,
|
|
110
110
|
currentValue: null,
|
|
111
|
-
cellUID:
|
|
111
|
+
cellUID: V(),
|
|
112
112
|
isActive: !1,
|
|
113
113
|
oldValue: null,
|
|
114
114
|
didNavigationChange: !1,
|
|
@@ -116,13 +116,14 @@ const ue = /* @__PURE__ */ N({
|
|
|
116
116
|
};
|
|
117
117
|
},
|
|
118
118
|
created: function() {
|
|
119
|
-
|
|
120
|
-
const e = H(this.currentMin, this.currentMax, this.$props.defaultValue, this.$props.value || this.$props.modelValue), t = h(this.currentMin, this.currentMax, e), i =
|
|
121
|
-
this._hasMounted = !1, this.$data.currentFocusedDate =
|
|
119
|
+
L(B);
|
|
120
|
+
const e = H(this.currentMin, this.currentMax, this.$props.defaultValue, this.$props.value || this.$props.modelValue), t = h(this.currentMin, this.currentMax, e), i = p(this.currentMin, this.currentMax, e), s = D(e), n = w(t, i, s);
|
|
121
|
+
this._hasMounted = !1, this.$data.currentFocusedDate = d(this.$props.focusedDate || n || b(), this.currentMin, this.currentMax), this.$data.currentValue = e, this.$data.currentActiveView = k(r[this.$props.defaultActiveView], r[this.$props.bottomView], r[this.$props.topView]), this.$data.currentActiveRangeEnd = X(s, t), this._dates = [], this._calculateFocusFromValue = !1, this._lastView = this.$props.activeView || this.$data.currentActiveView, this._lastViewsCount = this.$props.views, this._dom = new q(), this._bus = new P(this.handleViewChange), this._navigation = new U(this._bus), this._oldValue = e;
|
|
122
122
|
},
|
|
123
123
|
watch: {
|
|
124
124
|
value: function(e) {
|
|
125
|
-
this
|
|
125
|
+
const t = h(this.currentMin, this.currentMax, e), i = p(this.currentMin, this.currentMax, e), s = D(e), n = w(t, i, s);
|
|
126
|
+
this.$data.currentFocusedDate = d(this.$props.focusedDate || n || b(), this.currentMin, this.currentMax);
|
|
126
127
|
},
|
|
127
128
|
focusedDate: function(e) {
|
|
128
129
|
this.$data.currentFocusedDate = e;
|
|
@@ -130,7 +131,7 @@ const ue = /* @__PURE__ */ N({
|
|
|
130
131
|
},
|
|
131
132
|
setup() {
|
|
132
133
|
return {
|
|
133
|
-
kendoIntlService:
|
|
134
|
+
kendoIntlService: I("kendoIntlService", {})
|
|
134
135
|
};
|
|
135
136
|
},
|
|
136
137
|
mounted() {
|
|
@@ -145,10 +146,10 @@ const ue = /* @__PURE__ */ N({
|
|
|
145
146
|
return this.$props.activeRangeEnd !== void 0 ? this.$props.activeRangeEnd : this.$data.currentActiveRangeEnd;
|
|
146
147
|
},
|
|
147
148
|
currentMin() {
|
|
148
|
-
return
|
|
149
|
+
return $(this.$props.min);
|
|
149
150
|
},
|
|
150
151
|
currentMax() {
|
|
151
|
-
return
|
|
152
|
+
return $(this.$props.max);
|
|
152
153
|
}
|
|
153
154
|
},
|
|
154
155
|
methods: {
|
|
@@ -247,8 +248,8 @@ const ue = /* @__PURE__ */ N({
|
|
|
247
248
|
case "multiple":
|
|
248
249
|
if (Array.isArray(this._selectedMultiple)) {
|
|
249
250
|
let c = this._selectedMultiple.slice(), u = -1;
|
|
250
|
-
c.forEach((
|
|
251
|
-
o(
|
|
251
|
+
c.forEach((f, l) => {
|
|
252
|
+
o(f, e.value) && (u = l);
|
|
252
253
|
}), u !== -1 ? c.splice(u, 1) : c.push(a(e.value)), s = c.slice();
|
|
253
254
|
} else
|
|
254
255
|
this._selectedDate ? s = [a(this._selectedDate), a(e.value)] : s = [a(e.value)];
|
|
@@ -284,7 +285,7 @@ const ue = /* @__PURE__ */ N({
|
|
|
284
285
|
const {
|
|
285
286
|
keyCode: t
|
|
286
287
|
} = e;
|
|
287
|
-
if (this.$emit("keydown", e), t ===
|
|
288
|
+
if (this.$emit("keydown", e), t === E.enter) {
|
|
288
289
|
const i = {
|
|
289
290
|
event: e,
|
|
290
291
|
value: this._focusedDate,
|
|
@@ -297,7 +298,7 @@ const ue = /* @__PURE__ */ N({
|
|
|
297
298
|
};
|
|
298
299
|
this.handleDateChange(i);
|
|
299
300
|
} else {
|
|
300
|
-
const i =
|
|
301
|
+
const i = d(this._navigation.move(this._focusedDate, this._navigation.action(e), this.$data.currentActiveView, this._service, e), this.currentMin, this.currentMax);
|
|
301
302
|
if (o(this._focusedDate, i))
|
|
302
303
|
return;
|
|
303
304
|
this._calculateFocusFromValue = !1, this.$data.currentFocusedDate = i;
|
|
@@ -316,23 +317,23 @@ const ue = /* @__PURE__ */ N({
|
|
|
316
317
|
},
|
|
317
318
|
render() {
|
|
318
319
|
const e = this.$props.views, t = this.computedValue(), i = this.$data.currentFocusedDate, s = t !== null && this._oldValue !== null ? !this.isValueEqual(t, this._oldValue) : t !== this._oldValue;
|
|
319
|
-
this._selectedDate = h(this.currentMin, this.currentMax, t), this._selectedMultiple =
|
|
320
|
-
const n =
|
|
321
|
-
this._selectedDate = h(this.currentMin, this.currentMax, t), this._selectedMultiple =
|
|
322
|
-
const l =
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
this._intl =
|
|
326
|
-
const
|
|
320
|
+
this._selectedDate = h(this.currentMin, this.currentMax, t), this._selectedMultiple = p(this.currentMin, this.currentMax, t);
|
|
321
|
+
const n = g.call(this, this.$props.cell, v.call(this)), c = g.call(this, this.$props.weekCell, v.call(this)), u = g.call(this, this.$props.headerTitle, v.call(this)), f = k(this.$data.currentActiveView, r[this.$props.bottomView], r[this.$props.topView]);
|
|
322
|
+
this._selectedDate = h(this.currentMin, this.currentMax, t), this._selectedMultiple = p(this.currentMin, this.currentMax, t), this._selectedRange = D(t);
|
|
323
|
+
const l = w(this._selectedDate, this._selectedMultiple, this._selectedRange), _ = d(s && l !== null ? l : i, this.currentMin, this.currentMax);
|
|
324
|
+
_ instanceof Date ? this._focusedDate = $(_) : l && (this._focusedDate = l);
|
|
325
|
+
const C = this.rangeWithFocused(this._selectedRange, i);
|
|
326
|
+
this._intl = O(this), this._bus.configure(r[this.$props.bottomView], r[this.$props.topView]), this._service = this._bus.service(f, this._intl);
|
|
327
|
+
const M = T("k-calendar", "k-calendar-md", {
|
|
327
328
|
"k-calendar-range": e > 1,
|
|
328
329
|
"k-disabled": this.$props.disabled,
|
|
329
330
|
"k-week-number": this.$props.weekNumber
|
|
330
|
-
}, this.$props.className),
|
|
331
|
-
(!
|
|
332
|
-
const
|
|
331
|
+
}, this.$props.className), F = this._lastView !== this.$data.currentActiveView, A = this._dates && this._service.isInArray(this._focusedDate, this._dates), R = this._lastViewsCount !== this.$props.views;
|
|
332
|
+
(!A || F || R) && (this._dates = this._service.datesList(this._focusedDate, e));
|
|
333
|
+
const x = a(this._dates && this._dates[0] ? this._dates[0] : void 0), y = [this.$props.navigation && m(z, {
|
|
333
334
|
tabIndex: this.$props.disabled ? void 0 : this.$props.tabIndex || 0,
|
|
334
335
|
activeView: this.$data.currentActiveView,
|
|
335
|
-
currentDate:
|
|
336
|
+
currentDate: x,
|
|
336
337
|
focusedDate: this._focusedDate,
|
|
337
338
|
min: this.currentMin,
|
|
338
339
|
max: this.currentMax,
|
|
@@ -344,12 +345,12 @@ const ue = /* @__PURE__ */ N({
|
|
|
344
345
|
bus: this._bus,
|
|
345
346
|
service: this._service,
|
|
346
347
|
headerTitle: u
|
|
347
|
-
}, null),
|
|
348
|
+
}, null), m(j, {
|
|
348
349
|
allowReverse: this.$props.allowReverse,
|
|
349
350
|
isActive: this.$data.isActive,
|
|
350
351
|
tabIndex: this.$props.tabIndex || 0,
|
|
351
|
-
ref: (
|
|
352
|
-
this.calendarViewListRef =
|
|
352
|
+
ref: (N) => {
|
|
353
|
+
this.calendarViewListRef = N;
|
|
353
354
|
},
|
|
354
355
|
activeView: this.$data.currentActiveView,
|
|
355
356
|
focusedDate: this._focusedDate,
|
|
@@ -363,7 +364,7 @@ const ue = /* @__PURE__ */ N({
|
|
|
363
364
|
weekCell: c,
|
|
364
365
|
dom: this._dom,
|
|
365
366
|
views: this.$props.views,
|
|
366
|
-
selectionRange:
|
|
367
|
+
selectionRange: C,
|
|
367
368
|
showWeekNumbers: this.$props.weekNumber,
|
|
368
369
|
onChange: this.handleDateChange,
|
|
369
370
|
onWeekcellclick: this.handleWeekCellClick,
|
|
@@ -376,9 +377,9 @@ const ue = /* @__PURE__ */ N({
|
|
|
376
377
|
value: this._selectedMultiple || this._selectedDate,
|
|
377
378
|
cellUID: this.$data.cellUID
|
|
378
379
|
}, null)];
|
|
379
|
-
return
|
|
380
|
+
return m("div", {
|
|
380
381
|
"aria-disabled": this.$props.disabled === !0 ? !0 : void 0,
|
|
381
|
-
class:
|
|
382
|
+
class: M,
|
|
382
383
|
id: this.$props.id,
|
|
383
384
|
onFocusout: this.emitBlur,
|
|
384
385
|
onFocusin: this.emitFocus
|
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 o=require("vue"),u=require("@progress/kendo-date-math"),y=require("@progress/kendo-vue-intl"),T=require("./models/kendo-date.js"),r=require("@progress/kendo-vue-common"),S=require("@progress/kendo-vue-buttons"),B=require("../package-metadata.js"),p=require("./utils.js"),D=require("../utils.js"),l=require("../messages/main.js"),P=require("../timepicker/utils.js"),v=require("../defaults.js"),_=require("@progress/kendo-vue-labels"),b=require("@progress/kendo-svg-icons");function q(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const E="Please enter a valid value!",A=o.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 p.defaultFormat}},formatPlaceholder:{type:[String,Object],default:function(){return p.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 u.cloneDate(D.MAX_DATE)}},min:{type:Date,default:function(){return u.cloneDate(D.MIN_DATE)}},maxTime:{type:Date,default:function(){return u.cloneDate(v.MAX_TIME)}},minTime:{type:Date,default:function(){return u.cloneDate(v.MIN_TIME)}},disabled:{type:Boolean,default:!1},spinners:{type:Boolean,default:!1},name:String,dir:String,label:String,id:String,validationMessage:{type:String,default:E},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,lastSelectedSymbol:void 0,isFocused:!1}},created(){r.validatePackage(B.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=r.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:n}=this.$props;return{"k-dateinput":!0,"k-input":!0,[`k-input-${r.kendoThemeMaps.sizeMap[a]||a}`]:a,[`k-input-${i}`]:i,[`k-rounded-${r.kendoThemeMaps.roundedMap[n]||n}`]:n,"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.$emit("blur",{event:e})},intl(){return y.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&&r.canUseDOM&&document.activeElement!==t&&t.focus({preventScroll:!0})},elementChange(e){const t=this.element();if(!t||!this.kendoDate)return;const{text:a,format:i}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=i;const n=this.computedValue,s=p.approximateStringMatching(a,this.$data.currentFormat,t.value,this.selection().start),c=s.length===1&&s[0][1]==="_";if(!c)for(let d=0;d<s.length;d++)this.kendoDate.parsePart(s[d][0],s[d][1]);s.length&&s[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(s[0][0])),c&&this.switchDateSegment(1),this.triggerChange(e,n)},elementClick(e){this.setSelection(this.selectionByIndex(this.selection().start))},wheel(e){const t=this.element();r.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){switch(e.keyCode){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;default:return}e.preventDefault()}},setSelection(e){const t=this.element();this.$data.lastSelectedSymbol=this.$data.currentFormat[e.start],r.canUseDOM&&window.requestAnimationFrame(()=>{t&&r.canUseDOM&&document.activeElement===t&&t.setSelectionRange(e.start,e.end)})},triggerChange(e,t){this.$data.valueDuringOnChange=this.computedValue,u.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){const{start:t,end:a}=this.selection();if(t<a&&this.$data.currentFormat[t]!==this.$data.currentFormat[a-1]){this.setSelection(this.selectionByIndex(e>0?t:a-1));return}const i=this.$data.currentFormat[t];let n=t+e;for(;n>0&&n<this.$data.currentFormat.length&&!(this.$data.currentFormat[n]!==i&&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!==t||n+1!==a)?this.setSelection({start:s+1,end:n+1}):n<s&&(n!==t||s!==a)&&this.setSelection({start:n,end:s})},modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const a=this.computedValue,i=this.$data.currentFormat[this.selection().start],n=this.kendoDate.symbolMap(i),s=((this.$props.steps||{})[n]||1)*e;this.kendoDate.modifyPart(i,s),this.setSelection(this.selectionBySymbol(i)),this.triggerChange(t,a)},validity(){const e=p.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=r.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=o.ref(null),t=o.inject("kendoIntlService",{}),a=o.inject("kendoLocalizationService",{});return{inputRef:e,kendoIntlService:t,kendoLocalizationService:a}},render(){const e=r.getDefaultSlots(this),t=y.provideLocalizationService(this),{formatPlaceholder:a,format:i,value:n,modelValue:s,name:c,label:d,id:k,ariaLabel:V,ariaExpanded:F,ariaHasPopup:M,ariaRole:I,ariaControls:C,inputAttributes:w}=this.$props,m=n!==void 0?n:s;this.kendoDate.format=i,this.kendoDate.formatPlaceholder=a,this.valueDuringOnChange=this.valueDuringOnChange?this.valueDuringOnChange:void 0,m!==void 0&&this.computedValue!==m&&this.kendoDate.setValue(m);const{text:f,format:x}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=x,this.$data.isEmpty=f===this._emptyText;const g=this.$props.placeholder!==void 0&&this.$data.isEmpty&&!this.$data.isFocused?null:f,$=k||this._inputId,O=!this.$props.validityStyles||this.validity().valid,h=o.createVNode("span",{class:this.wrapperClassNames,dir:this.$props.dir},[o.createVNode("input",o.mergeProps({role:I,tabindex:this.$props.tabIndex,disabled:this.$props.disabled,title:this.$props.title!==void 0?this.$props.title:f,type:"text",spellcheck:!1,autocomplete:"off",autocorrect:"off",class:"k-input-inner",id:$,placeholder:this.$props.placeholder,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onKeydown:this.elementKeyDown,onChange:r.noop,onFocusin:this.handleFocus,onFocusout:this.handleBlur,value:g,name:c,"aria-label":V,"aria-expanded":F,"aria-haspopup":M,"aria-controls":C,"aria-disabled":this.$props.disabled||void 0,ref:r.setRef(this,"input")},w),null),e,this.$props.spinners&&o.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersMouseDown},[o.createVNode(S.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:b.caretAltUpIcon,size:this.$props.size,fillMode:this.$props.fillMode,class:"k-spinner-increase","aria-label":t.toLanguageString(l.increaseValue,l.messages[l.increaseValue]),title:t.toLanguageString(l.increaseValue,l.messages[l.increaseValue]),onClick:this.increasePart},null),o.createVNode(S.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:b.caretAltDownIcon,size:this.$props.size,fillMode:this.$props.fillMode,"aria-label":t.toLanguageString(l.decreaseValue,l.messages[l.decreaseValue]),title:t.toLanguageString(l.decreaseValue,l.messages[l.decreaseValue]),onClick:this.decreasePart},null)])]);return d?o.createVNode(_.FloatingLabel,{label:d,editorId:$,editorValue:g,editorPlaceholder:this.$props.placeholder,editorValid:O,editorDisabled:this.$props.disabled},q(h)?h:{default:()=>[h]}):h}});exports.DateInput=A;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),u=require("@progress/kendo-date-math"),y=require("@progress/kendo-vue-intl"),T=require("./models/kendo-date.js"),r=require("@progress/kendo-vue-common"),S=require("@progress/kendo-vue-buttons"),B=require("../package-metadata.js"),p=require("./utils.js"),v=require("../utils.js"),o=require("../messages/main.js"),P=require("../timepicker/utils.js"),D=require("../defaults.js"),_=require("@progress/kendo-vue-labels"),b=require("@progress/kendo-svg-icons");function q(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!l.isVNode(e)}const E="Please enter a valid value!",A=l.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 p.defaultFormat}},formatPlaceholder:{type:[String,Object],default:function(){return p.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 u.cloneDate(v.MAX_DATE)}},min:{type:Date,default:function(){return u.cloneDate(v.MIN_DATE)}},maxTime:{type:Date,default:function(){return u.cloneDate(D.MAX_TIME)}},minTime:{type:Date,default:function(){return u.cloneDate(D.MIN_TIME)}},disabled:{type:Boolean,default:!1},spinners:{type:Boolean,default:!1},name:String,dir:String,label:String,id:String,validationMessage:{type:String,default:E},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,lastSelectedSymbol:void 0,isFocused:!1}},created(){r.validatePackage(B.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=r.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:n}=this.$props;return{"k-dateinput":!0,"k-input":!0,[`k-input-${r.kendoThemeMaps.sizeMap[a]||a}`]:a,[`k-input-${i}`]:i,[`k-rounded-${r.kendoThemeMaps.roundedMap[n]||n}`]:n,"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.$emit("blur",{event:e})},intl(){return y.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&&r.canUseDOM&&document.activeElement!==t&&t.focus({preventScroll:!0})},elementChange(e){const t=this.element();if(!t||!this.kendoDate)return;const{text:a,format:i}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=i;const n=this.computedValue,s=p.approximateStringMatching(a,this.$data.currentFormat,t.value,this.selection().start),c=s.length===1&&s[0][1]==="_";if(!c)for(let d=0;d<s.length;d++)this.kendoDate.parsePart(s[d][0],s[d][1]);s.length&&s[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(s[0][0])),c&&this.switchDateSegment(1),this.triggerChange(e,n)},elementClick(e){this.setSelection(this.selectionByIndex(this.selection().start))},wheel(e){const t=this.element();r.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){switch(e.keyCode){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;default:return}e.preventDefault()}},setSelection(e){const t=this.element();this.$data.lastSelectedSymbol=this.$data.currentFormat[e.start],r.canUseDOM&&window.requestAnimationFrame(()=>{t&&r.canUseDOM&&document.activeElement===t&&t.setSelectionRange(e.start,e.end)})},triggerChange(e,t){this.$data.valueDuringOnChange=this.computedValue,u.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){const{start:t,end:a}=this.selection();if(t<a&&this.$data.currentFormat[t]!==this.$data.currentFormat[a-1]){this.setSelection(this.selectionByIndex(e>0?t:a-1));return}const i=this.$data.currentFormat[t];let n=t+e;for(;n>0&&n<this.$data.currentFormat.length&&!(this.$data.currentFormat[n]!==i&&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!==t||n+1!==a)?this.setSelection({start:s+1,end:n+1}):n<s&&(n!==t||s!==a)&&this.setSelection({start:n,end:s})},modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const a=this.computedValue,i=this.$data.currentFormat[this.selection().start],n=this.kendoDate.symbolMap(i),s=((this.$props.steps||{})[n]||1)*e;this.kendoDate.modifyPart(i,s),this.setSelection(this.selectionBySymbol(i)),this.triggerChange(t,a)},validity(){const e=p.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=r.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=l.ref(null),t=l.inject("kendoIntlService",{}),a=l.inject("kendoLocalizationService",{});return{inputRef:e,kendoIntlService:t,kendoLocalizationService:a}},render(){const e=r.getDefaultSlots(this),t=y.provideLocalizationService(this),{formatPlaceholder:a,format:i,value:n,modelValue:s,name:c,label:d,id:k,ariaLabel:V,ariaExpanded:F,ariaHasPopup:M,ariaRole:I,ariaControls:C,inputAttributes:w}=this.$props,m=n!==void 0?n:s;this.kendoDate.format=i,this.kendoDate.formatPlaceholder=a,this.valueDuringOnChange=this.valueDuringOnChange?this.valueDuringOnChange:void 0,m!==void 0&&this.computedValue!==m&&this.kendoDate.setValue(m);const{text:f,format:x}=this.kendoDate.getTextAndFormat();this.$data.currentFormat=x,this.$data.isEmpty=f===this._emptyText;const g=this.$props.placeholder!==void 0&&this.$data.isEmpty&&!this.$data.isFocused?null:f,$=k||this._inputId,O=!this.$props.validityStyles||this.validity().valid,h=l.createVNode("span",{class:this.wrapperClassNames,dir:this.$props.dir},[l.createVNode("input",l.mergeProps({role:I,tabindex:this.$props.tabIndex,disabled:this.$props.disabled,title:this.$props.title!==void 0?this.$props.title:f,type:"text",spellcheck:!1,autocomplete:"off",autocorrect:"off",class:"k-input-inner",id:$,placeholder:this.$props.placeholder,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onKeydown:this.elementKeyDown,onChange:r.noop,onFocusin:this.handleFocus,onFocusout:this.handleBlur,value:g,name:c,"aria-label":V,"aria-expanded":F,"aria-haspopup":M,"aria-controls":C,"aria-disabled":this.$props.disabled||void 0,ref:r.setRef(this,"input")},w),null),e,this.$props.spinners&&l.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersMouseDown},[l.createVNode(S.Button,{type:"button",tabIndex:-1,icon:"chevron-up",svgIcon:b.chevronUpIcon,size:this.$props.size,fillMode:this.$props.fillMode,class:"k-spinner-increase","aria-label":t.toLanguageString(o.increaseValue,o.messages[o.increaseValue]),title:t.toLanguageString(o.increaseValue,o.messages[o.increaseValue]),onClick:this.increasePart},null),l.createVNode(S.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"chevron-down",svgIcon:b.chevronDownIcon,size:this.$props.size,fillMode:this.$props.fillMode,"aria-label":t.toLanguageString(o.decreaseValue,o.messages[o.decreaseValue]),title:t.toLanguageString(o.decreaseValue,o.messages[o.decreaseValue]),onClick:this.decreasePart},null)])]);return d?l.createVNode(_.FloatingLabel,{label:d,editorId:$,editorValue:g,editorPlaceholder:this.$props.placeholder,editorValid:O,editorDisabled:this.$props.disabled},q(h)?h:{default:()=>[h]}):h}});exports.DateInput=A;
|
package/dateinput/DateInput.mjs
CHANGED
|
@@ -9,16 +9,16 @@ import { defineComponent as T, createVNode as o, mergeProps as _, ref as O, inje
|
|
|
9
9
|
import { isEqual as B, cloneDate as u } from "@progress/kendo-date-math";
|
|
10
10
|
import { provideLocalizationService as E, provideIntlService as A } from "@progress/kendo-vue-intl";
|
|
11
11
|
import { KendoDate as z } from "./models/kendo-date.mjs";
|
|
12
|
-
import { getDefaultSlots as L, noop as j, setRef as R, getRef as N, canUseDOM as
|
|
12
|
+
import { getDefaultSlots as L, noop as j, setRef as R, getRef as N, canUseDOM as h, kendoThemeMaps as v, validatePackage as K, guid as q } from "@progress/kendo-vue-common";
|
|
13
13
|
import { Button as D } from "@progress/kendo-vue-buttons";
|
|
14
14
|
import { packageMetadata as H } from "../package-metadata.mjs";
|
|
15
15
|
import { isInRange as U, approximateStringMatching as X, defaultFormatPlaceholder as Y, defaultFormat as G } from "./utils.mjs";
|
|
16
16
|
import { MIN_DATE as W, MAX_DATE as J } from "../utils.mjs";
|
|
17
|
-
import { increaseValue as
|
|
17
|
+
import { increaseValue as c, messages as p, decreaseValue as m } from "../messages/main.mjs";
|
|
18
18
|
import { isInTimeRange as Q } from "../timepicker/utils.mjs";
|
|
19
19
|
import { MIN_TIME as Z, MAX_TIME as ee } from "../defaults.mjs";
|
|
20
20
|
import { FloatingLabel as te } from "@progress/kendo-vue-labels";
|
|
21
|
-
import {
|
|
21
|
+
import { chevronUpIcon as ie, chevronDownIcon as ae } from "@progress/kendo-svg-icons";
|
|
22
22
|
function ne(e) {
|
|
23
23
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !P(e);
|
|
24
24
|
}
|
|
@@ -230,7 +230,7 @@ const se = "Please enter a valid value!", De = /* @__PURE__ */ T({
|
|
|
230
230
|
},
|
|
231
231
|
spinnersMouseDown(e) {
|
|
232
232
|
const t = this.element();
|
|
233
|
-
e.preventDefault(), t &&
|
|
233
|
+
e.preventDefault(), t && h && document.activeElement !== t && t.focus({
|
|
234
234
|
preventScroll: !0
|
|
235
235
|
});
|
|
236
236
|
},
|
|
@@ -254,7 +254,7 @@ const se = "Please enter a valid value!", De = /* @__PURE__ */ T({
|
|
|
254
254
|
},
|
|
255
255
|
wheel(e) {
|
|
256
256
|
const t = this.element();
|
|
257
|
-
|
|
257
|
+
h && document.activeElement !== t || (e.deltaY < 0 && (e.preventDefault(), this.increasePart(e)), e.deltaY > 0 && (e.preventDefault(), this.decreasePart(e)));
|
|
258
258
|
},
|
|
259
259
|
increasePart(e) {
|
|
260
260
|
e.preventDefault(), this.modifyDateSegmentValue(1, e);
|
|
@@ -285,8 +285,8 @@ const se = "Please enter a valid value!", De = /* @__PURE__ */ T({
|
|
|
285
285
|
},
|
|
286
286
|
setSelection(e) {
|
|
287
287
|
const t = this.element();
|
|
288
|
-
this.$data.lastSelectedSymbol = this.$data.currentFormat[e.start],
|
|
289
|
-
t &&
|
|
288
|
+
this.$data.lastSelectedSymbol = this.$data.currentFormat[e.start], h && window.requestAnimationFrame(() => {
|
|
289
|
+
t && h && document.activeElement === t && t.setSelectionRange(e.start, e.end);
|
|
290
290
|
});
|
|
291
291
|
},
|
|
292
292
|
triggerChange(e, t) {
|
|
@@ -443,19 +443,19 @@ const se = "Please enter a valid value!", De = /* @__PURE__ */ T({
|
|
|
443
443
|
}, [o(D, {
|
|
444
444
|
type: "button",
|
|
445
445
|
tabIndex: -1,
|
|
446
|
-
icon: "
|
|
446
|
+
icon: "chevron-up",
|
|
447
447
|
svgIcon: ie,
|
|
448
448
|
size: this.$props.size,
|
|
449
449
|
fillMode: this.$props.fillMode,
|
|
450
450
|
class: "k-spinner-increase",
|
|
451
|
-
"aria-label": t.toLanguageString(
|
|
452
|
-
title: t.toLanguageString(
|
|
451
|
+
"aria-label": t.toLanguageString(c, p[c]),
|
|
452
|
+
title: t.toLanguageString(c, p[c]),
|
|
453
453
|
onClick: this.increasePart
|
|
454
454
|
}, null), o(D, {
|
|
455
455
|
type: "button",
|
|
456
456
|
tabIndex: -1,
|
|
457
457
|
class: "k-spinner-decrease",
|
|
458
|
-
icon: "
|
|
458
|
+
icon: "chevron-down",
|
|
459
459
|
svgIcon: ae,
|
|
460
460
|
size: this.$props.size,
|
|
461
461
|
fillMode: this.$props.fillMode,
|
package/datepicker/DatePicker.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),w=require("@progress/kendo-svg-icons"),J=require("@progress/kendo-vue-popup"),l=require("@progress/kendo-date-math"),t=require("@progress/kendo-vue-common"),Q=require("../package-metadata.js"),W=require("../dateinput/DateInput.js"),Y=require("../calendar/components/Calendar.js"),r=require("../utils.js"),o=require("../messages/main.js"),D=require("@progress/kendo-vue-intl"),Z=require("./ToggleButton.js"),ee=require("@progress/kendo-vue-labels");function b(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const te=a.defineComponent({name:"DatePicker",inject:{kendoLocalizationService:{default:null}},model:{event:"changemodel"},emits:{change:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0,iconclick:e=>!0,focus:e=>!0,blur:e=>!0,keydown:e=>!0,open:e=>!0,close:e=>!0},props:{defaultShow:{type:Boolean,default:!1},modelValue:{type:Date,default:void 0},defaultValue:{type:Date,default:void 0},disabled:{type:Boolean,default:!1},dateInput:{type:[String,Object,Function],default:function(){}},calendar:{type:[String,Object,Function],default:function(){}},toggleButton:{type:[String,Object,Function],default:function(){}},label:String,placeholder:String,popup:{type:[String,Object,Function],default:function(){}},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)}},focusedDate:Date,format:{type:[Object,String],default:function(){return"d"}},formatPlaceholder:[Object,String],id:String,max:{type:Date,default:function(){return l.cloneDate(r.MAX_DATE)}},min:{type:Date,default:function(){return l.cloneDate(r.MIN_DATE)}},name:String,popupSettings:{type:Object,default:function(){return{}}},show:{type:Boolean,default:void 0},tabIndex:{type:Number,default:0},title:{type:String,default:function(){return""}},value:Date,weekNumber:Boolean,width:[Number,String],validityStyles:{type:Boolean,default:!0},validationMessage:String,required:Boolean,validate:Boolean,valid:{type:Boolean,default:void 0},ariaLabel:String,inputAttributes:Object},data:function(){return{isFocused:!1,currentValue:void 0,currentShow:void 0,valueDuringOnChange:void 0,showDuringOnChange:void 0,shouldFocusDateInput:!1}},created(){t.validatePackage(Q.packageMetadata),this._popupId=t.guid(),this._anchor=t.guid(),this._dateInput=null,this._calendar=null,this.$data.currentValue=this.$props.defaultValue,this.$data.currentShow=this.$props.defaultShow},mounted(){this._dateInput=t.getRef(this,"dateInput"),(this.$refs.calendar||this.calendarRef)&&(this._calendar=t.getRef(this,"calendar")),this.computedShow&&this.$forceUpdate()},updated(){(this.$refs.calendar||this.calendarRef)&&(this._calendar=t.getRef(this,"calendar")),this.computedShow?this._calendar&&this._calendar.$el&&!this._oldShow&&this._calendar.focus({preventScroll:!0}):this._dateInput&&this._dateInput.$el&&this.$data.shouldFocusDateInput&&this._dateInput.focus({preventScroll:!0}),this.$data.shouldFocusDateInput=!1},watch:{show:function(e,n){this._oldShow=n},currentShow:function(e,n){this._oldShow=n}},computed:{computedValue(){const e=this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.$data.currentValue;return e!==null?l.cloneDate(e):null},computedShow(){return this.$data.showDuringOnChange!==void 0?this.$data.showDuringOnChange:this.$props.show!==void 0?this.$props.show:this.$data.currentShow}},methods:{focus(){this._dateInput&&this._dateInput.focus()},handleFocus(e){this._oldShow=this.computedShow,this.$data.isFocused=!0,this.$emit("focus",{event:e})},handleBlur(e){this.$data.isFocused=!1,this.createBlurTimeout(),this.$emit("blur",{event:e})},calendarBlur(e){this.$emit("blur",{event:e}),clearTimeout(this._blurTimeout),this.createBlurTimeout()},calendarFocus(e){this.$emit("focus",{event:e}),clearTimeout(this._blurTimeout)},createBlurTimeout(){this._blurTimeout=setTimeout(()=>{this._dateInput&&t.canUseDOM&&document.activeElement!==this._dateInput._element&&this.setShow(!1)},200)},validity(){const e=this.computedValue,n=r.isInDateRange(e,this.$props.min,this.$props.max),i=this.$props.validationMessage!==void 0,s=(!this.$props.required||e!==null)&&n,h=this.$props.valid!==void 0?this.$props.valid:s;return{customError:i,rangeOverflow:e&&this.$props.max.getTime()<e.getTime()||!1,rangeUnderflow:e&&e.getTime()<this.$props.min.getTime()||!1,valid:h,valueMissing:e===null}},nextValue(e,n){return e.value!==void 0?e.value:n.value},nextShow(e,n){return e.show!==void 0?e.show:n.show},setShow(e){this.computedShow!==e&&(this.$data.currentShow=e,this.$emit(e?"open":"close",{component:this}))},mergeTime(e){return this.computedValue&&e?r.setTime(e,this.computedValue):e},handleInputValueChange(e){this.handleValueChange(e.value,e)},handleCalendarValueChange(e){const n=this.mergeTime(e.value);this.handleValueChange(n,e)},getDateInputText(){return this.computedValue?!0:this._dateInput?this._dateInput._element.value:""},handleValueChange(e,n){this.$data.currentValue=l.cloneDate(e||void 0),this.$data.valueDuringOnChange=e,this.$data.showDuringOnChange=!1,this.$data.shouldFocusDateInput=!0,this.$emit("changemodel",this.computedValue),this.$emit("update:modelValue",this.computedValue),this.$emit("change",{event:n.event,value:this.computedValue,show:this.computedShow,component:this,target:{name:this.$props.name,value:this.computedValue,valueAsDate:this.computedValue},validity:this.validity()}),this.$data.valueDuringOnChange=void 0,this.$data.showDuringOnChange=void 0,this.setShow(!1)},handleIconClick(e){e.stopPropagation(),e.preventDefault(),!this.$props.disabled&&(this.$data.shouldFocusDateInput=!0,this.$emit("iconclick",e),this.setShow(!this.computedShow))},handleIconMouseDown(e){e.stopPropagation(),e.preventDefault()},handleKeyDown(e){const{altKey:n,keyCode:i}=e;if(i===t.Keys.tab&&this._dateInput&&e.target!==this._dateInput._element){e.preventDefault(),this.$data.shouldFocusDateInput=!0,this.setShow(!1);return}if(i===t.Keys.esc){this.$data.shouldFocusDateInput=!0,this.setShow(!1);return}n&&(i===t.Keys.up||i===t.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.$data.shouldFocusDateInput=i===t.Keys.up,this.setShow(i===t.Keys.down)),this.$emit("keydown",e)}},setup(){const e=a.ref(null),n=a.ref(null),i=a.inject("kendoLocalizationService",{});return{listRef:e,kendoAnchorRef:n,kendoLocalizationService:i}},render(){t.getDefaultSlots(this);const{disabled:e,tabIndex:n,title:i,id:s,format:h,formatPlaceholder:I,min:m,max:$,weekNumber:y,focusedDate:k,width:V,name:_,validationMessage:C,required:T,validityStyles:R,size:c,fillMode:v,rounded:p,ariaLabel:B,inputAttributes:F}=this.$props,{popupClass:O,animate:M,appendTo:q}=this.$props.popupSettings,f=this.computedShow,g=this.computedValue,L=g&&l.getDate(g),S=!this.$props.validityStyles||this.validity().valid,N=t.classNames("k-calendar-container k-group k-reset",O),j=this.$props.toggleButton?t.templateRendering.call(this,this.$props.toggleButton,t.getListeners.call(this)):void 0,x=a.createVNode(Z.ToggleButton,{type:"button",tabIndex:-1,icon:"calendar",svgIcon:w.calendarIcon,onMousedown:this.handleIconMouseDown,onClick:this.handleIconClick,title:D.provideLocalizationService(this).toLanguageString(o.toggleCalendar,o.messages[o.toggleCalendar]),"aria-label":D.provideLocalizationService(this).toLanguageString(o.toggleCalendar,o.messages[o.toggleCalendar]),rounded:null,disabled:e,class:"k-input-button"},null),P=t.getTemplate.call(this,{h:a.h,template:j,defaultRendering:x,defaultSlots:a.createVNode(t.Icon,{name:"calendar",icon:w.calendarIcon},null),additionalListeners:{click:this.handleIconClick}}),z=this.$props.dateInput?t.templateRendering.call(this,this.$props.dateInput,t.getListeners.call(this)):void 0,K=a.createVNode(W.DateInput,{ref:t.setRef(this,"dateInput"),placeholder:this.$props.placeholder,disabled:e,format:h,formatPlaceholder:I,id:s,max:$,min:m,name:_,size:null,rounded:null,fillMode:null,onChange:this.handleInputValueChange,required:T,tabIndex:f?-1:n,title:i,valid:this.validity().valid,validationMessage:C,validityStyles:R,value:g,ariaHasPopup:"grid",ariaExpanded:f,ariaRole:"combobox",ariaControls:this._popupId,ariaLabel:B,inputAttributes:F},null),A=t.getTemplate.call(this,{h:a.h,template:z,defaultRendering:K}),E=this.$props.calendar?t.templateRendering.call(this,this.$props.calendar,t.getListeners.call(this)):void 0,U=a.createVNode(Y.Calendar,{ref:t.setRef(this,"calendar"),onKeydown:this.handleKeyDown,onFocus:this.calendarFocus,onBlur:this.calendarBlur,disabled:e,value:L,min:m,max:$,weekNumber:y,focusedDate:k,onChange:this.handleCalendarValueChange},null),u=t.getTemplate.call(this,{h:a.h,template:E,defaultRendering:U}),H=this.$props.popup?t.templateRendering.call(this,this.$props.popup,t.getListeners.call(this)):void 0,X=a.createVNode(J.Popup,{show:f,anchor:this._anchor,class:N,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},animate:M,appendTo:q},b(u)?u:{default:()=>[u]}),G=t.getTemplate.call(this,{h:a.h,template:H,defaultRendering:X,defaultSlots:u}),d=a.createVNode("span",{ref:t.setRef(this,"kendoAnchor"),role:"group",class:t.classNames("k-input","k-datepicker",{[`k-input-${t.kendoThemeMaps.sizeMap[c]||c}`]:c,[`k-input-${v}`]:v,[`k-rounded-${t.kendoThemeMaps.roundedMap[p]||p}`]:p,"k-invalid":!S,"k-required":this.required,"k-disabled":this.$props.disabled,"k-focus":this.$data.isFocused}),onKeydown:this.handleKeyDown,onFocusin:this.handleFocus,onFocusout:this.handleBlur},[A,P,G]);return this.$props.label?a.createVNode(ee.FloatingLabel,{label:this.$props.label,editorId:s,editorValid:S,editorValue:this.getDateInputText(),editorPlaceholder:this.$props.placeholder,editorDisabled:this.$props.disabled,style:{width:V}},b(d)?d:{default:()=>[d]}):d}});exports.DatePicker=te;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),w=require("@progress/kendo-svg-icons"),J=require("@progress/kendo-vue-popup"),l=require("@progress/kendo-date-math"),t=require("@progress/kendo-vue-common"),Q=require("../package-metadata.js"),W=require("../dateinput/DateInput.js"),Y=require("../calendar/components/Calendar.js"),r=require("../utils.js"),o=require("../messages/main.js"),D=require("@progress/kendo-vue-intl"),Z=require("./ToggleButton.js"),ee=require("@progress/kendo-vue-labels");function b(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const te=a.defineComponent({name:"DatePicker",inject:{kendoLocalizationService:{default:null}},model:{event:"changemodel"},emits:{change:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0,iconclick:e=>!0,focus:e=>!0,blur:e=>!0,keydown:e=>!0,open:e=>!0,close:e=>!0},props:{defaultShow:{type:Boolean,default:!1},modelValue:{type:Date,default:void 0},defaultValue:{type:Date,default:void 0},disabled:{type:Boolean,default:!1},dateInput:{type:[String,Object,Function],default:function(){}},calendar:{type:[String,Object,Function],default:function(){}},toggleButton:{type:[String,Object,Function],default:function(){}},label:String,placeholder:String,popup:{type:[String,Object,Function],default:function(){}},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)}},focusedDate:Date,format:{type:[Object,String],default:function(){return"d"}},formatPlaceholder:[Object,String],id:String,max:{type:Date,default:function(){return l.cloneDate(r.MAX_DATE)}},min:{type:Date,default:function(){return l.cloneDate(r.MIN_DATE)}},name:String,popupSettings:{type:Object,default:function(){return{}}},show:{type:Boolean,default:void 0},tabIndex:{type:Number,default:0},title:{type:String,default:function(){return""}},value:Date,weekNumber:Boolean,width:[Number,String],validityStyles:{type:Boolean,default:!0},validationMessage:String,required:Boolean,validate:Boolean,valid:{type:Boolean,default:void 0},ariaLabel:String,inputAttributes:Object},data:function(){return{isFocused:!1,currentValue:void 0,currentShow:void 0,valueDuringOnChange:void 0,showDuringOnChange:void 0,shouldFocusDateInput:!1}},created(){t.validatePackage(Q.packageMetadata),this._popupId=t.guid(),this._anchor=t.guid(),this._dateInput=null,this._calendar=null,this.$data.currentValue=this.$props.defaultValue,this.$data.currentShow=this.$props.defaultShow},mounted(){this._dateInput=t.getRef(this,"dateInput"),(this.$refs.calendar||this.calendarRef)&&(this._calendar=t.getRef(this,"calendar")),this.computedShow&&this.$forceUpdate()},updated(){(this.$refs.calendar||this.calendarRef)&&(this._calendar=t.getRef(this,"calendar")),this.computedShow?this._calendar&&this._calendar.$el&&!this._oldShow&&this._calendar.focus({preventScroll:!0}):this._dateInput&&this._dateInput.$el&&this.$data.shouldFocusDateInput&&this._dateInput.focus({preventScroll:!0}),this.$data.shouldFocusDateInput=!1},watch:{show:function(e,n){this._oldShow=n},currentShow:function(e,n){this._oldShow=n}},computed:{computedValue(){const e=this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.$data.currentValue;return e!==null?l.cloneDate(e):null},computedShow(){return this.$data.showDuringOnChange!==void 0?this.$data.showDuringOnChange:this.$props.show!==void 0?this.$props.show:this.$data.currentShow}},methods:{focus(){this._dateInput&&this._dateInput.focus()},handleFocus(e){this._oldShow=this.computedShow,this.$data.isFocused=!0,this.$emit("focus",{event:e})},handleBlur(e){this.$data.isFocused=!1,this.createBlurTimeout(),this.$emit("blur",{event:e})},calendarBlur(e){this.$emit("blur",{event:e}),clearTimeout(this._blurTimeout),this.createBlurTimeout()},calendarFocus(e){this.$emit("focus",{event:e}),clearTimeout(this._blurTimeout)},createBlurTimeout(){this._blurTimeout=setTimeout(()=>{this._dateInput&&t.canUseDOM&&typeof document!="undefined"&&document.activeElement!==this._dateInput._element&&this.setShow(!1)},200)},validity(){const e=this.computedValue,n=r.isInDateRange(e,this.$props.min,this.$props.max),i=this.$props.validationMessage!==void 0,s=(!this.$props.required||e!==null)&&n,h=this.$props.valid!==void 0?this.$props.valid:s;return{customError:i,rangeOverflow:e&&this.$props.max.getTime()<e.getTime()||!1,rangeUnderflow:e&&e.getTime()<this.$props.min.getTime()||!1,valid:h,valueMissing:e===null}},nextValue(e,n){return e.value!==void 0?e.value:n.value},nextShow(e,n){return e.show!==void 0?e.show:n.show},setShow(e){this.computedShow!==e&&(this.$data.currentShow=e,this.$emit(e?"open":"close",{component:this}))},mergeTime(e){return this.computedValue&&e?r.setTime(e,this.computedValue):e},handleInputValueChange(e){this.handleValueChange(e.value,e)},handleCalendarValueChange(e){const n=this.mergeTime(e.value);this.handleValueChange(n,e)},getDateInputText(){return this.computedValue?!0:this._dateInput?this._dateInput._element.value:""},handleValueChange(e,n){this.$data.currentValue=l.cloneDate(e||void 0),this.$data.valueDuringOnChange=e,this.$data.showDuringOnChange=!1,this.$data.shouldFocusDateInput=!0,this.$emit("changemodel",this.computedValue),this.$emit("update:modelValue",this.computedValue),this.$emit("change",{event:n.event,value:this.computedValue,show:this.computedShow,component:this,target:{name:this.$props.name,value:this.computedValue,valueAsDate:this.computedValue},validity:this.validity()}),this.$data.valueDuringOnChange=void 0,this.$data.showDuringOnChange=void 0,this.setShow(!1)},handleIconClick(e){e.stopPropagation(),e.preventDefault(),!this.$props.disabled&&(this.$data.shouldFocusDateInput=!0,this.$emit("iconclick",e),this.setShow(!this.computedShow))},handleIconMouseDown(e){e.stopPropagation(),e.preventDefault()},handleKeyDown(e){const{altKey:n,keyCode:i}=e;if(i===t.Keys.tab&&this._dateInput&&e.target!==this._dateInput._element){e.preventDefault(),this.$data.shouldFocusDateInput=!0,this.setShow(!1);return}if(i===t.Keys.esc){this.$data.shouldFocusDateInput=!0,this.setShow(!1);return}n&&(i===t.Keys.up||i===t.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.$data.shouldFocusDateInput=i===t.Keys.up,this.setShow(i===t.Keys.down)),this.$emit("keydown",e)}},setup(){const e=a.ref(null),n=a.ref(null),i=a.inject("kendoLocalizationService",{});return{listRef:e,kendoAnchorRef:n,kendoLocalizationService:i}},render(){t.getDefaultSlots(this);const{disabled:e,tabIndex:n,title:i,id:s,format:h,formatPlaceholder:I,min:m,max:$,weekNumber:y,focusedDate:k,width:V,name:_,validationMessage:C,required:T,validityStyles:R,size:c,fillMode:v,rounded:p,ariaLabel:B,inputAttributes:F}=this.$props,{popupClass:O,animate:M,appendTo:q}=this.$props.popupSettings,f=this.computedShow,g=this.computedValue,L=g&&l.getDate(g),S=!this.$props.validityStyles||this.validity().valid,N=t.classNames("k-calendar-container k-group k-reset",O),j=this.$props.toggleButton?t.templateRendering.call(this,this.$props.toggleButton,t.getListeners.call(this)):void 0,x=a.createVNode(Z.ToggleButton,{type:"button",tabIndex:-1,icon:"calendar",svgIcon:w.calendarIcon,onMousedown:this.handleIconMouseDown,onClick:this.handleIconClick,title:D.provideLocalizationService(this).toLanguageString(o.toggleCalendar,o.messages[o.toggleCalendar]),"aria-label":D.provideLocalizationService(this).toLanguageString(o.toggleCalendar,o.messages[o.toggleCalendar]),rounded:null,disabled:e,class:"k-input-button"},null),P=t.getTemplate.call(this,{h:a.h,template:j,defaultRendering:x,defaultSlots:a.createVNode(t.Icon,{name:"calendar",icon:w.calendarIcon},null),additionalListeners:{click:this.handleIconClick}}),z=this.$props.dateInput?t.templateRendering.call(this,this.$props.dateInput,t.getListeners.call(this)):void 0,K=a.createVNode(W.DateInput,{ref:t.setRef(this,"dateInput"),placeholder:this.$props.placeholder,disabled:e,format:h,formatPlaceholder:I,id:s,max:$,min:m,name:_,size:null,rounded:null,fillMode:null,onChange:this.handleInputValueChange,required:T,tabIndex:f?-1:n,title:i,valid:this.validity().valid,validationMessage:C,validityStyles:R,value:g,ariaHasPopup:"grid",ariaExpanded:f,ariaRole:"combobox",ariaControls:this._popupId,ariaLabel:B,inputAttributes:F},null),A=t.getTemplate.call(this,{h:a.h,template:z,defaultRendering:K}),E=this.$props.calendar?t.templateRendering.call(this,this.$props.calendar,t.getListeners.call(this)):void 0,U=a.createVNode(Y.Calendar,{ref:t.setRef(this,"calendar"),onKeydown:this.handleKeyDown,onFocus:this.calendarFocus,onBlur:this.calendarBlur,disabled:e,value:L,min:m,max:$,weekNumber:y,focusedDate:k,onChange:this.handleCalendarValueChange},null),u=t.getTemplate.call(this,{h:a.h,template:E,defaultRendering:U}),H=this.$props.popup?t.templateRendering.call(this,this.$props.popup,t.getListeners.call(this)):void 0,X=a.createVNode(J.Popup,{show:f,anchor:this._anchor,class:N,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},animate:M,appendTo:q},b(u)?u:{default:()=>[u]}),G=t.getTemplate.call(this,{h:a.h,template:H,defaultRendering:X,defaultSlots:u}),d=a.createVNode("span",{ref:t.setRef(this,"kendoAnchor"),role:"group",class:t.classNames("k-input","k-datepicker",{[`k-input-${t.kendoThemeMaps.sizeMap[c]||c}`]:c,[`k-input-${v}`]:v,[`k-rounded-${t.kendoThemeMaps.roundedMap[p]||p}`]:p,"k-invalid":!S,"k-required":this.required,"k-disabled":this.$props.disabled,"k-focus":this.$data.isFocused}),onKeydown:this.handleKeyDown,onFocusin:this.handleFocus,onFocusout:this.handleBlur},[A,P,G]);return this.$props.label?a.createVNode(ee.FloatingLabel,{label:this.$props.label,editorId:s,editorValid:S,editorValue:this.getDateInputText(),editorPlaceholder:this.$props.placeholder,editorDisabled:this.$props.disabled,style:{width:V}},b(d)?d:{default:()=>[d]}):d}});exports.DatePicker=te;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as oe, createVNode as
|
|
8
|
+
import { defineComponent as oe, createVNode as a, h as s, ref as _, inject as le, isVNode as ue } from "vue";
|
|
9
9
|
import { calendarIcon as k } from "@progress/kendo-svg-icons";
|
|
10
10
|
import { Popup as se } from "@progress/kendo-vue-popup";
|
|
11
11
|
import { getDate as de, cloneDate as d } from "@progress/kendo-date-math";
|
|
@@ -224,13 +224,13 @@ const je = /* @__PURE__ */ oe({
|
|
|
224
224
|
},
|
|
225
225
|
createBlurTimeout() {
|
|
226
226
|
this._blurTimeout = setTimeout(() => {
|
|
227
|
-
this._dateInput && pe && document.activeElement !== this._dateInput._element && this.setShow(!1);
|
|
227
|
+
this._dateInput && pe && typeof document != "undefined" && document.activeElement !== this._dateInput._element && this.setShow(!1);
|
|
228
228
|
}, 200);
|
|
229
229
|
},
|
|
230
230
|
validity() {
|
|
231
|
-
const e = this.computedValue, t = ve(e, this.$props.min, this.$props.max),
|
|
231
|
+
const e = this.computedValue, t = ve(e, this.$props.min, this.$props.max), n = this.$props.validationMessage !== void 0, o = (!this.$props.required || e !== null) && t, f = this.$props.valid !== void 0 ? this.$props.valid : o;
|
|
232
232
|
return {
|
|
233
|
-
customError:
|
|
233
|
+
customError: n,
|
|
234
234
|
rangeOverflow: e && this.$props.max.getTime() < e.getTime() || !1,
|
|
235
235
|
rangeUnderflow: e && e.getTime() < this.$props.min.getTime() || !1,
|
|
236
236
|
valid: f,
|
|
@@ -284,25 +284,25 @@ const je = /* @__PURE__ */ oe({
|
|
|
284
284
|
handleKeyDown(e) {
|
|
285
285
|
const {
|
|
286
286
|
altKey: t,
|
|
287
|
-
keyCode:
|
|
287
|
+
keyCode: n
|
|
288
288
|
} = e;
|
|
289
|
-
if (
|
|
289
|
+
if (n === i.tab && this._dateInput && e.target !== this._dateInput._element) {
|
|
290
290
|
e.preventDefault(), this.$data.shouldFocusDateInput = !0, this.setShow(!1);
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (n === i.esc) {
|
|
294
294
|
this.$data.shouldFocusDateInput = !0, this.setShow(!1);
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
t && (
|
|
297
|
+
t && (n === i.up || n === i.down) && (e.preventDefault(), e.stopPropagation(), this.$data.shouldFocusDateInput = n === i.up, this.setShow(n === i.down)), this.$emit("keydown", e);
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
300
|
setup() {
|
|
301
|
-
const e = _(null), t = _(null),
|
|
301
|
+
const e = _(null), t = _(null), n = le("kendoLocalizationService", {});
|
|
302
302
|
return {
|
|
303
303
|
listRef: e,
|
|
304
304
|
kendoAnchorRef: t,
|
|
305
|
-
kendoLocalizationService:
|
|
305
|
+
kendoLocalizationService: n
|
|
306
306
|
};
|
|
307
307
|
},
|
|
308
308
|
render() {
|
|
@@ -310,7 +310,7 @@ const je = /* @__PURE__ */ oe({
|
|
|
310
310
|
const {
|
|
311
311
|
disabled: e,
|
|
312
312
|
tabIndex: t,
|
|
313
|
-
title:
|
|
313
|
+
title: n,
|
|
314
314
|
id: o,
|
|
315
315
|
format: f,
|
|
316
316
|
formatPlaceholder: R,
|
|
@@ -332,7 +332,7 @@ const je = /* @__PURE__ */ oe({
|
|
|
332
332
|
popupClass: q,
|
|
333
333
|
animate: E,
|
|
334
334
|
appendTo: U
|
|
335
|
-
} = this.$props.popupSettings, $ = this.computedShow, v = this.computedValue, H = v && de(v), y = !this.$props.validityStyles || this.validity().valid, X = V("k-calendar-container k-group k-reset", q), G = this.$props.toggleButton ? r.call(this, this.$props.toggleButton, h.call(this)) : void 0, J =
|
|
335
|
+
} = this.$props.popupSettings, $ = this.computedShow, v = this.computedValue, H = v && de(v), y = !this.$props.validityStyles || this.validity().valid, X = V("k-calendar-container k-group k-reset", q), G = this.$props.toggleButton ? r.call(this, this.$props.toggleButton, h.call(this)) : void 0, J = a(be, {
|
|
336
336
|
type: "button",
|
|
337
337
|
tabIndex: -1,
|
|
338
338
|
icon: "calendar",
|
|
@@ -348,14 +348,14 @@ const je = /* @__PURE__ */ oe({
|
|
|
348
348
|
h: s,
|
|
349
349
|
template: G,
|
|
350
350
|
defaultRendering: J,
|
|
351
|
-
defaultSlots:
|
|
351
|
+
defaultSlots: a(he, {
|
|
352
352
|
name: "calendar",
|
|
353
353
|
icon: k
|
|
354
354
|
}, null),
|
|
355
355
|
additionalListeners: {
|
|
356
356
|
click: this.handleIconClick
|
|
357
357
|
}
|
|
358
|
-
}), W = this.$props.dateInput ? r.call(this, this.$props.dateInput, h.call(this)) : void 0, Y =
|
|
358
|
+
}), W = this.$props.dateInput ? r.call(this, this.$props.dateInput, h.call(this)) : void 0, Y = a(me, {
|
|
359
359
|
ref: S(this, "dateInput"),
|
|
360
360
|
placeholder: this.$props.placeholder,
|
|
361
361
|
disabled: e,
|
|
@@ -371,7 +371,7 @@ const je = /* @__PURE__ */ oe({
|
|
|
371
371
|
onChange: this.handleInputValueChange,
|
|
372
372
|
required: A,
|
|
373
373
|
tabIndex: $ ? -1 : t,
|
|
374
|
-
title:
|
|
374
|
+
title: n,
|
|
375
375
|
valid: this.validity().valid,
|
|
376
376
|
validationMessage: z,
|
|
377
377
|
validityStyles: N,
|
|
@@ -386,7 +386,7 @@ const je = /* @__PURE__ */ oe({
|
|
|
386
386
|
h: s,
|
|
387
387
|
template: W,
|
|
388
388
|
defaultRendering: Y
|
|
389
|
-
}), ee = this.$props.calendar ? r.call(this, this.$props.calendar, h.call(this)) : void 0, te =
|
|
389
|
+
}), ee = this.$props.calendar ? r.call(this, this.$props.calendar, h.call(this)) : void 0, te = a(ge, {
|
|
390
390
|
ref: S(this, "calendar"),
|
|
391
391
|
onKeydown: this.handleKeyDown,
|
|
392
392
|
onFocus: this.calendarFocus,
|
|
@@ -402,7 +402,7 @@ const je = /* @__PURE__ */ oe({
|
|
|
402
402
|
h: s,
|
|
403
403
|
template: ee,
|
|
404
404
|
defaultRendering: te
|
|
405
|
-
}),
|
|
405
|
+
}), ne = this.$props.popup ? r.call(this, this.$props.popup, h.call(this)) : void 0, ae = a(se, {
|
|
406
406
|
show: $,
|
|
407
407
|
anchor: this._anchor,
|
|
408
408
|
class: X,
|
|
@@ -421,10 +421,10 @@ const je = /* @__PURE__ */ oe({
|
|
|
421
421
|
default: () => [l]
|
|
422
422
|
}), ie = p.call(this, {
|
|
423
423
|
h: s,
|
|
424
|
-
template:
|
|
425
|
-
defaultRendering:
|
|
424
|
+
template: ne,
|
|
425
|
+
defaultRendering: ae,
|
|
426
426
|
defaultSlots: l
|
|
427
|
-
}), u =
|
|
427
|
+
}), u = a("span", {
|
|
428
428
|
ref: S(this, "kendoAnchor"),
|
|
429
429
|
role: "group",
|
|
430
430
|
class: V("k-input", "k-datepicker", {
|
|
@@ -440,7 +440,7 @@ const je = /* @__PURE__ */ oe({
|
|
|
440
440
|
onFocusin: this.handleFocus,
|
|
441
441
|
onFocusout: this.handleBlur
|
|
442
442
|
}, [Z, Q, ie]);
|
|
443
|
-
return this.$props.label ?
|
|
443
|
+
return this.$props.label ? a(De, {
|
|
444
444
|
label: this.$props.label,
|
|
445
445
|
editorId: o,
|
|
446
446
|
editorValid: y,
|
|
@@ -42,10 +42,10 @@ declare const ToggleButton: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
42
42
|
type: import('vue').PropType<boolean>;
|
|
43
43
|
default: any;
|
|
44
44
|
};
|
|
45
|
-
size: import('vue').PropType<"small" | "medium" | "
|
|
45
|
+
size: import('vue').PropType<"small" | "medium" | "xs" | "large">;
|
|
46
46
|
rounded: import('vue').PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
47
47
|
fillMode: import('vue').PropType<"flat" | "link" | "solid" | "outline">;
|
|
48
|
-
themeColor: import('vue').PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
48
|
+
themeColor: import('vue').PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
49
49
|
tabIndex: import('vue').PropType<number>;
|
|
50
50
|
accessKey: import('vue').PropType<string>;
|
|
51
51
|
id: import('vue').PropType<string>;
|
|
@@ -120,10 +120,10 @@ declare const ToggleButton: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
120
120
|
type: import('vue').PropType<boolean>;
|
|
121
121
|
default: any;
|
|
122
122
|
};
|
|
123
|
-
size: import('vue').PropType<"small" | "medium" | "
|
|
123
|
+
size: import('vue').PropType<"small" | "medium" | "xs" | "large">;
|
|
124
124
|
rounded: import('vue').PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
125
125
|
fillMode: import('vue').PropType<"flat" | "link" | "solid" | "outline">;
|
|
126
|
-
themeColor: import('vue').PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
126
|
+
themeColor: import('vue').PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
127
127
|
tabIndex: import('vue').PropType<number>;
|
|
128
128
|
accessKey: import('vue').PropType<string>;
|
|
129
129
|
id: import('vue').PropType<string>;
|