@progress/kendo-vue-dialogs
Advanced tools
Comparing version
@@ -15,2 +15,2 @@ /** | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueDialogs={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueIntl)}(this,(function(e,t,i,n,o,s){"use strict";const r=t.defineComponent({props:{id:String,closeIcon:{type:Boolean,default:!0},title:String,titleRender:[String,Function,Object],onClosebuttonclick:Function},methods:{onCloseButtonClick(e){this.$emit("closebuttonclick",e)}},render(){let e,{id:s,closeIcon:r,titleRender:a,title:l}=this.$props;return e=i.getTemplate.call(this,{h:t.h,template:a,defaultRendering:l}),t.createVNode("div",{class:"k-window-titlebar k-dialog-titlebar",id:s},[t.createVNode("span",{class:"k-window-title k-dialog-title"},[e]),t.createVNode("div",{class:"k-window-titlebar-actions k-dialog-titlebar-actions"},[r&&t.createVNode(n.Button,{type:"button",fillMode:"flat","aria-label":"Close",icon:"x",svgIcon:o.xIcon,onClick:this.onCloseButtonClick,class:"k-window-titlebar-action k-dialog-titlebar-action"},null)])])}}),a={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"6.3.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},l=t.defineComponent({name:"KendoDialog",emits:{close:null,overlayclick:null},props:{appendTo:String,title:String,titleRender:[String,Function],id:String,wrapperId:String,dir:String,closeIcon:{type:Boolean,default:!0},width:[String,Number],height:[String,Number],minWidth:[String,Number],className:String,dialogClass:String,themeColor:{type:String,validator:function(e){return["primary","dark","light"].includes(e)}},onClose:Function},provide:()=>({kCurrentZIndex:10002}),data:()=>({showLicenseWatermark:!1}),created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.titleId=this.generateTitleId(),this.contentId=this.generateContentId()},computed:{wrapperClass(){const{className:e}=this.$props;return{"k-dialog-wrapper":!0,[e]:e}},dialogElementClass(){const{dialogClass:e,themeColor:t}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e,[`k-window-${t}`]:t}}},mounted(){if(this.$props.appendTo){const e=document.querySelector(this.$props.appendTo);this.windowElement=this.$refs.wrapper,e.append(this.windowElement)}},beforeUnmount(){this.$props.appendTo&&this.windowElement.remove()},methods:{handleCloseDialog(e){e.preventDefault(),this.$emit("close",{event:e,target:this})},handleKeyDown(e){e.keyCode===i.Keys.esc&&i.hasListener.call(this,"close")&&(e.preventDefault(),this.handleCloseDialog(e))},transformDimesion:e=>"string"==typeof e&&(e.endsWith("px")||e.endsWith("%"))?e:e+"px",getActionBarIndex:e=>e.findIndex((e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar"))),generateTitleId:()=>"dialog-title"+i.guid(),generateContentId:()=>"dialog-content"+i.guid(),handleClick(e){this.$emit("overlayclick",e)}},render(){const e=void 0!==this.$props.id?this.$props.id:this.titleId;let{title:n,width:o,height:s,minWidth:a,dir:l,contentStyle:d,wrapperId:h}=this.$props;const c=this.$props.titleRender?i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)):null,p=i.getDefaultSlots(this)||[];o=this.transformDimesion(o),s=this.transformDimesion(s),a=this.transformDimesion(a);const u=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,null,null):null,g=this.getActionBarIndex(p);let w;-1!==g&&(w=p[g],p.splice(g,1));const m=void 0===this.$props.closeIcon||this.$props.closeIcon,f=t.createVNode("div",{ref:"wrapper",class:this.wrapperClass,onKeydown:this.handleKeyDown,tabindex:0,id:h,dir:l},[t.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),t.createVNode("div",{"aria-labelledby":n||c?e:void 0,"aria-describedby":this.contentId,"aria-modal":!0,class:this.dialogElementClass,role:"dialog",style:{width:o,height:s,minWidth:a}},[(n||c)&&t.createVNode(r,{closeIcon:m,onClosebuttonclick:this.handleCloseDialog,id:e,title:n,titleRender:c},null),t.createVNode("div",{class:"k-window-content k-dialog-content",style:d,id:this.contentId},[p]),w,u])]);return this.$props.appendTo?t.createVNode("div",null,[f]):f}}),d=t.defineComponent({name:"DialogActionsBar",props:{layout:{type:String,default:"stretched",validator:function(e){return["stretched","start","center","end"].includes(e)}},orientation:{type:String,default:"horizontal",validator:function(e){return["horizontal","vertical"].includes(e)}}},computed:{wrapperClasses(){const{layout:e,orientation:t}=this.$props;return{"k-actions":!0,"k-dialog-actions":!0,"k-window-actions":!0,[`k-actions-${t}`]:t,[`k-actions-${e}`]:e}}},render(){const e=i.getDefaultSlots(this);return t.createVNode("div",{class:this.wrapperClasses},[e])}});var h=(e=>(e.DEFAULT="DEFAULT",e.FULLSCREEN="FULLSCREEN",e.MINIMIZED="MINIMIZED",e))(h||{});const c="dialogs.windowMaximizeButton",p="dialogs.windowMinimizeButton",u="dialogs.windowRestoreButton",g="dialogs.windowCloseButton",w={[c]:"maximize",[p]:"minimize",[u]:"restore",[g]:"close"},m=t.defineComponent({name:"KendoWindowTitleBar",props:{id:String,stage:String,closeButton:[String,Function,Object,Boolean],minimizeButton:[String,Function,Object,Boolean],maximizeButton:[String,Function,Object,Boolean],restoreButton:[String,Function,Object,Boolean],title:String,titleId:String,titleRender:[String,Function,Object,Boolean],onDoubleclick:Function,onMinimizeclick:Function,onFullscreenclick:Function,onRestoreclick:Function,onCloseclick:Function},inject:{kendoLocalizationService:{default:null}},methods:{onDoubleClick(e){this.$emit("doubleclick",e)},onMinimizeClick(e){this.$emit("minimizeclick",e)},onFullScreenClick(e){this.$emit("fullscreenclick",e)},onRestoreClick(e){this.$emit("restoreclick",e)},onCloseClick(e){this.$emit("closeclick",e)}},render(){const e=this.$props,{stage:r,title:a,titleRender:l,minimizeButton:d,maximizeButton:m,restoreButton:f,closeButton:k}=e,v=s.provideLocalizationService(this);let C=i.getTemplate.call(this,{h:t.h,template:l,defaultRendering:a});const S=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-minimize",svgIcon:o.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":v.toLanguageString(p,w[p])},null),L=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:S}),$=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window",svgIcon:o.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":v.toLanguageString(c,w[c])},null),I=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:$}),b=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:o.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":v.toLanguageString(u,w[u])},null),y=i.getTemplate.call(this,{h:t.h,template:f,defaultRendering:b}),D=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:o.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":v.toLanguageString(g,w[g])},null),E=i.getTemplate.call(this,{h:t.h,template:k,defaultRendering:D});return t.createVNode("div",{class:"k-window-titlebar",style:{touchAction:"none"},onDblclick:this.onDoubleClick},[t.createVNode("span",{class:"k-window-title",id:this.$props.titleId},[C]),t.createVNode("div",{class:"k-window-titlebar-actions"},[r===h.DEFAULT&&L,r===h.DEFAULT&&I,r!==h.DEFAULT&&y,E])])}}),f=["n","e","s","w","se","sw","ne","nw"],k=t.defineComponent({name:"ResizeHandlers",emits:{resize:null},methods:{onDrag(e,t){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!1,direction:t})},onRelease(e,t){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!0,direction:t})}},render(){return t.createVNode("div",null,[f.map((function(e,n){return t.createVNode(i.Draggable,{key:n,onDrag:t=>this.onDrag(t,e),onRelease:t=>this.onRelease(t,e)},{default:()=>[t.createVNode("div",{class:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none"}},null)]})}),this)])}}),v=t.defineComponent({name:"KendoWindow",emits:{resize:null,move:null,close:null,stagechange:null,overlayclick:null},provide:()=>({kCurrentZIndex:10002}),props:{id:String,appendTo:String,width:{type:[Number],default:void 0},height:{type:[Number],default:void 0},left:{type:[Number],default:void 0},windowStyle:Object,windowClass:String,top:{type:[Number],default:void 0},initialWidth:[Number],initialHeight:[Number],initialLeft:[Number],initialTop:[Number],minWidth:{type:[Number],default:120},minHeight:{type:[Number],default:100},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},modal:{type:Boolean,default:!1},doubleClickStageChange:{type:Boolean,default:!0},title:String,titleRender:[String,Function],closeButton:[String,Function],minimizeButton:[String,Function],maximizeButton:[String,Function],restoreButton:[String,Function],shouldUpdateOnDrag:Boolean,stage:{type:String,validator:function(e){return-1!==["DEFAULT","MINIMIZED","FULLSCREEN"].indexOf(e)}},themeColor:{type:String,validator:function(e){return[void 0,"primary","dark","light"].includes(e)}},dir:String},created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()},this.titleId=this.generateTitleId()},beforeUnmount(){this.$props.appendTo&&this.windowWrapper.remove()},data(){return{currentStage:this.$props.stage||h.DEFAULT,isDragging:!1,currentTop:this.getInitialTop(),currentLeft:this.getInitialLeft(),currentWidth:this.getInitialWidth(),currentHeight:this.getInitialHeight(),titleId:void 0,showLicenseWatermark:!1}},mounted(){if(window&&(window.addEventListener("resize",this.handleBrowserWindowResize),this.$props.appendTo)){const e=document.querySelector(this.$props.appendTo);this.windowWrapper=this.$refs.wrapper,e.append(this.windowWrapper)}this.$el&&(this.windowElement=this.$refs.windowElement)},unmounted(){window&&window.removeEventListener("resize",this.handleBrowserWindowResize)},computed:{wrapperClass(){return{"k-dialog-wrapper":this.$props.modal}},windowElementClass(){const{windowClass:e,themeColor:t}=this.$props;return{"k-window":!0,[e]:e,[`k-window-${t}`]:t,"k-window-minimized":"MINIMIZED"===this.currentStage}},computedTop(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.top||this.currentTop,0):0},computedLeft(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.left||this.currentLeft,0):0},computedWidth(){let e=this.$props.width||this.currentWidth;return this.windowStage===h.FULLSCREEN&&(e=window.innerWidth),e},computedHeight(){let e=this.$props.height||this.currentHeight;return this.windowStage===h.FULLSCREEN?e=window.innerHeight:this.windowStage===h.MINIMIZED&&(e=0),e},windowStage(){return this.$props.stage||this.currentStage}},methods:{onPress(e){const t=e;this.windowCoordinatesState.differenceLeft=t.pageX-this.computedLeft,this.windowCoordinatesState.differenceTop=t.pageY-this.computedTop},onDrag(e){const t=e;t.originalEvent.preventDefault(),this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&(this.currentTop=Math.max(t.pageY-this.windowCoordinatesState.differenceTop,0),this.currentLeft=t.pageX-this.windowCoordinatesState.differenceLeft,this.isDragging=!0,this.dispatchMoveEvent("move",t,!0,!1))},onRelease(e){const t=e;this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&this.dispatchMoveEvent("move",t,!0,!0),this.isDragging=!1},handleKeyDown(e){if(e.target!==e.currentTarget)return;const t=this.$props.minWidth||120,n=this.$props.minHeight||100;if(e.ctrlKey&&this.$props.resizable){switch(e.keyCode){case i.Keys.up:e.preventDefault(),n<=this.computedHeight-5&&(this.currentHeight=this.currentHeight-5);break;case i.Keys.down:e.preventDefault(),this.currentHeight=this.currentHeight+5;break;case i.Keys.left:t<=this.computedWidth-5&&(this.currentWidth=this.currentWidth-5);break;case i.Keys.right:this.currentWidth=this.currentWidth+5;break;default:return}this.dispatchMoveEvent("resize",e,!1,void 0)}else if(e.altKey)switch(e.keyCode){case i.Keys.up:this.windowStage===h.MINIMIZED?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleFullscreen(e),this.$emit("stagechange",e,this,{state:h.FULLSCREEN}));break;case i.Keys.down:this.windowStage===h.FULLSCREEN?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleMinimize(e),this.$emit("stagechange",e,this,{state:h.MINIMIZED}))}else{if(!e.ctrlKey)switch(e.keyCode){case i.Keys.esc:return void this.handleCloseWindow(e);case i.Keys.up:e.preventDefault(),this.currentTop=this.currentTop-5;break;case i.Keys.down:e.preventDefault(),this.currentTop=this.currentTop+5;break;case i.Keys.left:e.preventDefault(),this.currentLeft=this.currentLeft-5;break;case i.Keys.right:e.preventDefault(),this.currentLeft=this.currentLeft+5;break;default:return}this.dispatchMoveEvent("move",e,!1,void 0)}},getInitialTop(){if(void 0!==this.$props.top)return this.$props.top;if(void 0!==this.$props.initialTop)return this.$props.initialTop;let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),window.innerHeight/2-e/2},getInitialLeft(){if(void 0!==this.$props.left)return this.$props.left;if(void 0!==this.$props.initialLeft)return this.$props.initialLeft;let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),window.innerWidth/2-e/2},getInitialWidth(){let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),e},getInitialHeight(){let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),e},handleMinimize(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentStage=h.MINIMIZED,this.currentHeight=0,this.$emit("stagechange",e,this,{state:h.MINIMIZED})},handleFullscreen(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentLeft=0,this.currentTop=0,this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight,this.currentStage=h.FULLSCREEN,this.$emit("stagechange",e,this,{state:h.FULLSCREEN})},handleRestore(e){e.preventDefault(),this.windowStage===h.FULLSCREEN?(this.currentStage=h.DEFAULT,this.currentLeft=this.windowCoordinatesState.leftBeforeAction,this.currentTop=this.windowCoordinatesState.topBeforeAction,this.currentWidth=this.windowCoordinatesState.widthBeforeAction,this.currentHeight=this.windowCoordinatesState.heightBeforeAction):this.windowStage===h.MINIMIZED&&(this.currentStage=h.DEFAULT,this.currentHeight=this.windowCoordinatesState.heightBeforeAction),this.$emit("stagechange",e,this,{state:h.DEFAULT})},handleCloseWindow(e){e.preventDefault(),this.$emit("close",e,this,{state:void 0})},handleDoubleClick(e){this.$props.doubleClickStageChange&&(this.windowStage===h.FULLSCREEN||this.windowStage===h.MINIMIZED?this.handleRestore(e):this.handleFullscreen(e))},handleResize(e,t){const i=this.computedWidth,n=this.computedHeight,o=this.$props.minWidth||120,s=this.$props.minHeight||100,r=this.computedTop-e.pageY,a=this.computedLeft-e.pageX,l=e.pageX-this.computedLeft,d=e.pageY-this.computedTop;this.isDragging=!t.end,t.direction.indexOf("n")>=0&&s-(n+r)<0&&(this.currentTop=e.pageY,this.currentHeight=n+r),t.direction.indexOf("s")>=0&&s-d<0&&(this.currentHeight=d),t.direction.indexOf("w")>=0&&o-(i+a)<0&&(this.currentLeft=e.pageX,this.currentWidth=i+a),t.direction.indexOf("e")>=0&&o-l<0&&(this.currentWidth=l),this.dispatchMoveEvent("resize",e,!0,t.end)},dispatchMoveEvent(e,t,i,n){this.$emit(e,{event:t.event,drag:i,end:n,target:this,left:this.currentLeft,top:this.currentTop,width:this.currentWidth,height:this.currentHeight})},handleBrowserWindowResize(){this.windowStage===h.FULLSCREEN&&(this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight)},handleClick(e){this.$emit("overlayclick",e)},getActionBarIndex:e=>e.findIndex((e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar"))),generateTitleId:()=>"window-title-"+i.guid()},render(){const e=i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)),n=i.templateRendering.call(this,this.$props.closeButton,i.getListeners.call(this)),o=i.templateRendering.call(this,this.$props.minimizeButton,i.getListeners.call(this)),s=i.templateRendering.call(this,this.$props.maximizeButton,i.getListeners.call(this)),r=i.templateRendering.call(this,this.$props.restoreButton,i.getListeners.call(this)),a=i.getDefaultSlots(this),l=a||[],d=this.getActionBarIndex(l);let c;-1!==d&&(c=l[d],l.splice(d,1));const p=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,null,null):null,u=t.createVNode("div",{class:this.wrapperClass,ref:"wrapper",dir:this.$props.dir},[this.$props.modal&&t.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),t.createVNode("div",{tabindex:0,onFocus:e=>e.target.classList.add("k-focus"),onBlur:e=>e.target.classList.remove("k-focus"),onKeydown:this.handleKeyDown,ref:"windowElement",class:this.windowElementClass,role:"dialog","aria-modal":!!this.$props.modal||void 0,"aria-labelledby":this.titleId,style:{top:this.computedTop+"px",left:this.computedLeft+"px",width:this.computedWidth+"px",height:this.computedHeight+"px"||"",...this.$props.windowStyle}},[t.createVNode(i.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:"draggable"},{default:()=>[t.createVNode(m,{stage:this.windowStage,title:this.$props.title,titleId:this.titleId,titleRender:e,onDoubleclick:this.handleDoubleClick,onMinimizeclick:this.handleMinimize,onFullscreenclick:this.handleFullscreen,onRestoreclick:this.handleRestore,onCloseclick:this.handleCloseWindow,closeButton:n,minimizeButton:o,maximizeButton:s,restoreButton:r},null)]}),this.windowStage!==h.MINIMIZED?[t.createVNode("div",{class:"k-window-content"},[a]),c]:null,this.windowStage===h.DEFAULT&&this.$props.resizable?t.createVNode(k,{onResize:this.handleResize},null):null,p])]);return this.$props.appendTo?t.createVNode("div",null,[u]):u}});e.Dialog=l,e.DialogActionsBar=d,e.Window=v})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueDialogs={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueIntl)}(this,(function(e,t,i,n,o,s){"use strict";const r=t.defineComponent({props:{id:String,closeIcon:{type:Boolean,default:!0},title:String,titleRender:[String,Function,Object],onClosebuttonclick:Function},methods:{onCloseButtonClick(e){this.$emit("closebuttonclick",e)}},render(){let e,{id:s,closeIcon:r,titleRender:a,title:l}=this.$props;return e=i.getTemplate.call(this,{h:t.h,template:a,defaultRendering:l}),t.createVNode("div",{class:"k-window-titlebar k-dialog-titlebar",id:s},[t.createVNode("span",{class:"k-window-title k-dialog-title"},[e]),t.createVNode("div",{class:"k-window-titlebar-actions k-dialog-titlebar-actions"},[r&&t.createVNode(n.Button,{type:"button",fillMode:"flat","aria-label":"Close",icon:"x",svgIcon:o.xIcon,onClick:this.onCloseButtonClick,class:"k-window-titlebar-action k-dialog-titlebar-action"},null)])])}}),a={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"6.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},l=t.defineComponent({name:"KendoDialog",emits:{close:null,overlayclick:null},props:{appendTo:String,title:String,titleRender:[String,Function],id:String,wrapperId:String,dir:String,closeIcon:{type:Boolean,default:!0},width:[String,Number],height:[String,Number],minWidth:[String,Number],className:String,dialogClass:String,themeColor:{type:String,validator:function(e){return["primary","dark","light"].includes(e)}},onClose:Function},provide:()=>({kCurrentZIndex:10002}),data:()=>({showLicenseWatermark:!1}),created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.titleId=this.generateTitleId(),this.contentId=this.generateContentId()},computed:{wrapperClass(){const{className:e}=this.$props;return{"k-dialog-wrapper":!0,[e]:e}},dialogElementClass(){const{dialogClass:e,themeColor:t}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e,[`k-window-${t}`]:t}}},mounted(){if(this.$props.appendTo){const e=document.querySelector(this.$props.appendTo);this.windowElement=this.$refs.wrapper,e.append(this.windowElement)}},beforeUnmount(){this.$props.appendTo&&this.windowElement.remove()},methods:{handleCloseDialog(e){e.preventDefault(),this.$emit("close",{event:e,target:this})},handleKeyDown(e){e.keyCode===i.Keys.esc&&i.hasListener.call(this,"close")&&(e.preventDefault(),this.handleCloseDialog(e))},transformDimesion:e=>"string"==typeof e&&(e.endsWith("px")||e.endsWith("%"))?e:e+"px",getActionBarIndex:e=>e.findIndex((e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar"))),generateTitleId:()=>"dialog-title"+i.guid(),generateContentId:()=>"dialog-content"+i.guid(),handleClick(e){this.$emit("overlayclick",e)}},render(){const e=void 0!==this.$props.id?this.$props.id:this.titleId;let{title:n,width:o,height:s,minWidth:a,dir:l,contentStyle:d,wrapperId:h}=this.$props;const c=this.$props.titleRender?i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)):null,p=i.getDefaultSlots(this)||[];o=this.transformDimesion(o),s=this.transformDimesion(s),a=this.transformDimesion(a);const u=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,null,null):null,g=this.getActionBarIndex(p);let w;-1!==g&&(w=p[g],p.splice(g,1));const m=void 0===this.$props.closeIcon||this.$props.closeIcon,f=t.createVNode("div",{ref:"wrapper",class:this.wrapperClass,onKeydown:this.handleKeyDown,tabindex:0,id:h,dir:l},[t.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),t.createVNode("div",{"aria-labelledby":n||c?e:void 0,"aria-describedby":this.contentId,"aria-modal":!0,class:this.dialogElementClass,role:"dialog",style:{width:o,height:s,minWidth:a}},[(n||c)&&t.createVNode(r,{closeIcon:m,onClosebuttonclick:this.handleCloseDialog,id:e,title:n,titleRender:c},null),t.createVNode("div",{class:"k-window-content k-dialog-content",style:d,id:this.contentId},[p]),w,u])]);return this.$props.appendTo?t.createVNode("div",null,[f]):f}}),d=t.defineComponent({name:"DialogActionsBar",props:{layout:{type:String,default:"stretched",validator:function(e){return["stretched","start","center","end"].includes(e)}},orientation:{type:String,default:"horizontal",validator:function(e){return["horizontal","vertical"].includes(e)}}},computed:{wrapperClasses(){const{layout:e,orientation:t}=this.$props;return{"k-actions":!0,"k-dialog-actions":!0,"k-window-actions":!0,[`k-actions-${t}`]:t,[`k-actions-${e}`]:e}}},render(){const e=i.getDefaultSlots(this);return t.createVNode("div",{class:this.wrapperClasses},[e])}});var h=(e=>(e.DEFAULT="DEFAULT",e.FULLSCREEN="FULLSCREEN",e.MINIMIZED="MINIMIZED",e))(h||{});const c="dialogs.windowMaximizeButton",p="dialogs.windowMinimizeButton",u="dialogs.windowRestoreButton",g="dialogs.windowCloseButton",w={[c]:"maximize",[p]:"minimize",[u]:"restore",[g]:"close"},m=t.defineComponent({name:"KendoWindowTitleBar",props:{id:String,stage:String,closeButton:[String,Function,Object,Boolean],minimizeButton:[String,Function,Object,Boolean],maximizeButton:[String,Function,Object,Boolean],restoreButton:[String,Function,Object,Boolean],title:String,titleId:String,titleRender:[String,Function,Object,Boolean],onDoubleclick:Function,onMinimizeclick:Function,onFullscreenclick:Function,onRestoreclick:Function,onCloseclick:Function},inject:{kendoLocalizationService:{default:null}},methods:{onDoubleClick(e){this.$emit("doubleclick",e)},onMinimizeClick(e){this.$emit("minimizeclick",e)},onFullScreenClick(e){this.$emit("fullscreenclick",e)},onRestoreClick(e){this.$emit("restoreclick",e)},onCloseClick(e){this.$emit("closeclick",e)}},render(){const e=this.$props,{stage:r,title:a,titleRender:l,minimizeButton:d,maximizeButton:m,restoreButton:f,closeButton:k}=e,v=s.provideLocalizationService(this);let C=i.getTemplate.call(this,{h:t.h,template:l,defaultRendering:a});const S=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-minimize",svgIcon:o.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":v.toLanguageString(p,w[p])},null),L=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:S}),$=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window",svgIcon:o.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":v.toLanguageString(c,w[c])},null),I=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:$}),b=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:o.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":v.toLanguageString(u,w[u])},null),y=i.getTemplate.call(this,{h:t.h,template:f,defaultRendering:b}),D=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:o.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":v.toLanguageString(g,w[g])},null),E=i.getTemplate.call(this,{h:t.h,template:k,defaultRendering:D});return t.createVNode("div",{class:"k-window-titlebar",style:{touchAction:"none"},onDblclick:this.onDoubleClick},[t.createVNode("span",{class:"k-window-title",id:this.$props.titleId},[C]),t.createVNode("div",{class:"k-window-titlebar-actions"},[r===h.DEFAULT&&L,r===h.DEFAULT&&I,r!==h.DEFAULT&&y,E])])}}),f=["n","e","s","w","se","sw","ne","nw"],k=t.defineComponent({name:"ResizeHandlers",emits:{resize:null},methods:{onDrag(e,t){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!1,direction:t})},onRelease(e,t){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!0,direction:t})}},render(){return t.createVNode("div",null,[f.map((function(e,n){return t.createVNode(i.Draggable,{key:n,onDrag:t=>this.onDrag(t,e),onRelease:t=>this.onRelease(t,e)},{default:()=>[t.createVNode("div",{class:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none"}},null)]})}),this)])}}),v=t.defineComponent({name:"KendoWindow",emits:{resize:null,move:null,close:null,stagechange:null,overlayclick:null},provide:()=>({kCurrentZIndex:10002}),props:{id:String,appendTo:String,width:{type:[Number],default:void 0},height:{type:[Number],default:void 0},left:{type:[Number],default:void 0},windowStyle:Object,windowClass:String,top:{type:[Number],default:void 0},initialWidth:[Number],initialHeight:[Number],initialLeft:[Number],initialTop:[Number],minWidth:{type:[Number],default:120},minHeight:{type:[Number],default:100},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},modal:{type:Boolean,default:!1},doubleClickStageChange:{type:Boolean,default:!0},title:String,titleRender:[String,Function],closeButton:[String,Function],minimizeButton:[String,Function],maximizeButton:[String,Function],restoreButton:[String,Function],shouldUpdateOnDrag:Boolean,stage:{type:String,validator:function(e){return-1!==["DEFAULT","MINIMIZED","FULLSCREEN"].indexOf(e)}},themeColor:{type:String,validator:function(e){return[void 0,"primary","dark","light"].includes(e)}},dir:String},created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()},this.titleId=this.generateTitleId()},beforeUnmount(){this.$props.appendTo&&this.windowWrapper.remove()},data(){return{currentStage:this.$props.stage||h.DEFAULT,isDragging:!1,currentTop:this.getInitialTop(),currentLeft:this.getInitialLeft(),currentWidth:this.getInitialWidth(),currentHeight:this.getInitialHeight(),titleId:void 0,showLicenseWatermark:!1}},mounted(){if(window&&(window.addEventListener("resize",this.handleBrowserWindowResize),this.$props.appendTo)){const e=document.querySelector(this.$props.appendTo);this.windowWrapper=this.$refs.wrapper,e.append(this.windowWrapper)}this.$el&&(this.windowElement=this.$refs.windowElement)},unmounted(){window&&window.removeEventListener("resize",this.handleBrowserWindowResize)},computed:{wrapperClass(){return{"k-dialog-wrapper":this.$props.modal}},windowElementClass(){const{windowClass:e,themeColor:t}=this.$props;return{"k-window":!0,[e]:e,[`k-window-${t}`]:t,"k-window-minimized":"MINIMIZED"===this.currentStage}},computedTop(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.top||this.currentTop,0):0},computedLeft(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.left||this.currentLeft,0):0},computedWidth(){let e=this.$props.width||this.currentWidth;return this.windowStage===h.FULLSCREEN&&(e=window.innerWidth),e},computedHeight(){let e=this.$props.height||this.currentHeight;return this.windowStage===h.FULLSCREEN?e=window.innerHeight:this.windowStage===h.MINIMIZED&&(e=0),e},windowStage(){return this.$props.stage||this.currentStage}},methods:{onPress(e){const t=e;this.windowCoordinatesState.differenceLeft=t.pageX-this.computedLeft,this.windowCoordinatesState.differenceTop=t.pageY-this.computedTop},onDrag(e){const t=e;t.originalEvent.preventDefault(),this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&(this.currentTop=Math.max(t.pageY-this.windowCoordinatesState.differenceTop,0),this.currentLeft=t.pageX-this.windowCoordinatesState.differenceLeft,this.isDragging=!0,this.dispatchMoveEvent("move",t,!0,!1))},onRelease(e){const t=e;this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&this.dispatchMoveEvent("move",t,!0,!0),this.isDragging=!1},handleKeyDown(e){if(e.target!==e.currentTarget)return;const t=this.$props.minWidth||120,n=this.$props.minHeight||100;if(e.ctrlKey&&this.$props.resizable){switch(e.keyCode){case i.Keys.up:e.preventDefault(),n<=this.computedHeight-5&&(this.currentHeight=this.currentHeight-5);break;case i.Keys.down:e.preventDefault(),this.currentHeight=this.currentHeight+5;break;case i.Keys.left:t<=this.computedWidth-5&&(this.currentWidth=this.currentWidth-5);break;case i.Keys.right:this.currentWidth=this.currentWidth+5;break;default:return}this.dispatchMoveEvent("resize",e,!1,void 0)}else if(e.altKey)switch(e.keyCode){case i.Keys.up:this.windowStage===h.MINIMIZED?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleFullscreen(e),this.$emit("stagechange",e,this,{state:h.FULLSCREEN}));break;case i.Keys.down:this.windowStage===h.FULLSCREEN?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleMinimize(e),this.$emit("stagechange",e,this,{state:h.MINIMIZED}))}else{if(!e.ctrlKey)switch(e.keyCode){case i.Keys.esc:return void this.handleCloseWindow(e);case i.Keys.up:e.preventDefault(),this.currentTop=this.currentTop-5;break;case i.Keys.down:e.preventDefault(),this.currentTop=this.currentTop+5;break;case i.Keys.left:e.preventDefault(),this.currentLeft=this.currentLeft-5;break;case i.Keys.right:e.preventDefault(),this.currentLeft=this.currentLeft+5;break;default:return}this.dispatchMoveEvent("move",e,!1,void 0)}},getInitialTop(){if(void 0!==this.$props.top)return this.$props.top;if(void 0!==this.$props.initialTop)return this.$props.initialTop;let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),window.innerHeight/2-e/2},getInitialLeft(){if(void 0!==this.$props.left)return this.$props.left;if(void 0!==this.$props.initialLeft)return this.$props.initialLeft;let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),window.innerWidth/2-e/2},getInitialWidth(){let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),e},getInitialHeight(){let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),e},handleMinimize(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentStage=h.MINIMIZED,this.currentHeight=0,this.$emit("stagechange",e,this,{state:h.MINIMIZED})},handleFullscreen(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentLeft=0,this.currentTop=0,this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight,this.currentStage=h.FULLSCREEN,this.$emit("stagechange",e,this,{state:h.FULLSCREEN})},handleRestore(e){e.preventDefault(),this.windowStage===h.FULLSCREEN?(this.currentStage=h.DEFAULT,this.currentLeft=this.windowCoordinatesState.leftBeforeAction,this.currentTop=this.windowCoordinatesState.topBeforeAction,this.currentWidth=this.windowCoordinatesState.widthBeforeAction,this.currentHeight=this.windowCoordinatesState.heightBeforeAction):this.windowStage===h.MINIMIZED&&(this.currentStage=h.DEFAULT,this.currentHeight=this.windowCoordinatesState.heightBeforeAction),this.$emit("stagechange",e,this,{state:h.DEFAULT})},handleCloseWindow(e){e.preventDefault(),this.$emit("close",e,this,{state:void 0})},handleDoubleClick(e){this.$props.doubleClickStageChange&&(this.windowStage===h.FULLSCREEN||this.windowStage===h.MINIMIZED?this.handleRestore(e):this.handleFullscreen(e))},handleResize(e,t){const i=this.computedWidth,n=this.computedHeight,o=this.$props.minWidth||120,s=this.$props.minHeight||100,r=this.computedTop-e.pageY,a=this.computedLeft-e.pageX,l=e.pageX-this.computedLeft,d=e.pageY-this.computedTop;this.isDragging=!t.end,t.direction.indexOf("n")>=0&&s-(n+r)<0&&(this.currentTop=e.pageY,this.currentHeight=n+r),t.direction.indexOf("s")>=0&&s-d<0&&(this.currentHeight=d),t.direction.indexOf("w")>=0&&o-(i+a)<0&&(this.currentLeft=e.pageX,this.currentWidth=i+a),t.direction.indexOf("e")>=0&&o-l<0&&(this.currentWidth=l),this.dispatchMoveEvent("resize",e,!0,t.end)},dispatchMoveEvent(e,t,i,n){this.$emit(e,{event:t.event,drag:i,end:n,target:this,left:this.currentLeft,top:this.currentTop,width:this.currentWidth,height:this.currentHeight})},handleBrowserWindowResize(){this.windowStage===h.FULLSCREEN&&(this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight)},handleClick(e){this.$emit("overlayclick",e)},getActionBarIndex:e=>e.findIndex((e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar"))),generateTitleId:()=>"window-title-"+i.guid()},render(){const e=i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)),n=i.templateRendering.call(this,this.$props.closeButton,i.getListeners.call(this)),o=i.templateRendering.call(this,this.$props.minimizeButton,i.getListeners.call(this)),s=i.templateRendering.call(this,this.$props.maximizeButton,i.getListeners.call(this)),r=i.templateRendering.call(this,this.$props.restoreButton,i.getListeners.call(this)),a=i.getDefaultSlots(this),l=a||[],d=this.getActionBarIndex(l);let c;-1!==d&&(c=l[d],l.splice(d,1));const p=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,null,null):null,u=t.createVNode("div",{class:this.wrapperClass,ref:"wrapper",dir:this.$props.dir},[this.$props.modal&&t.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),t.createVNode("div",{tabindex:0,onFocus:e=>e.target.classList.add("k-focus"),onBlur:e=>e.target.classList.remove("k-focus"),onKeydown:this.handleKeyDown,ref:"windowElement",class:this.windowElementClass,role:"dialog","aria-modal":!!this.$props.modal||void 0,"aria-labelledby":this.titleId,style:{top:this.computedTop+"px",left:this.computedLeft+"px",width:this.computedWidth+"px",height:this.computedHeight+"px"||"",...this.$props.windowStyle}},[t.createVNode(i.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:"draggable"},{default:()=>[t.createVNode(m,{stage:this.windowStage,title:this.$props.title,titleId:this.titleId,titleRender:e,onDoubleclick:this.handleDoubleClick,onMinimizeclick:this.handleMinimize,onFullscreenclick:this.handleFullscreen,onRestoreclick:this.handleRestore,onCloseclick:this.handleCloseWindow,closeButton:n,minimizeButton:o,maximizeButton:s,restoreButton:r},null)]}),this.windowStage!==h.MINIMIZED?[t.createVNode("div",{class:"k-window-content"},[a]),c]:null,this.windowStage===h.DEFAULT&&this.$props.resizable?t.createVNode(k,{onResize:this.handleResize},null):null,p])]);return this.$props.appendTo?t.createVNode("div",null,[u]):u}});e.Dialog=l,e.DialogActionsBar=d,e.Window=v})); |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1743147916,version:"6.3.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1743151186,version:"6.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e; |
{ | ||
"name": "@progress/kendo-vue-dialogs", | ||
"version": "6.3.0-develop.1", | ||
"version": "6.3.0", | ||
"description": "TODO", | ||
@@ -22,5 +22,5 @@ "author": "Progress", | ||
"@progress/kendo-licensing": "^1.4.0", | ||
"@progress/kendo-vue-buttons": "6.3.0-develop.1", | ||
"@progress/kendo-vue-common": "6.3.0-develop.1", | ||
"@progress/kendo-vue-intl": "6.3.0-develop.1", | ||
"@progress/kendo-vue-buttons": "6.3.0", | ||
"@progress/kendo-vue-common": "6.3.0", | ||
"@progress/kendo-vue-intl": "6.3.0", | ||
"@progress/kendo-svg-icons": "^4.0.0", | ||
@@ -46,3 +46,3 @@ "vue": "^3.0.2" | ||
"productCode": "KENDOUIVUE", | ||
"publishDate": 1743147916, | ||
"publishDate": 1743151186, | ||
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/" | ||
@@ -49,0 +49,0 @@ } |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6
-14.29%128522
-0.05%