@progress/kendo-vue-dialogs 6.0.0-develop.3 → 6.0.0-develop.4

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/Dialog.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"),k=require("./DialogTitleBar.js"),n=require("@progress/kendo-vue-common"),h=require("./package-metadata.js"),I=require("./constants.js"),y=o.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],dialogClass:String,themeColor:{type:String,validator:function(e){return["primary","dark","light"].includes(e)}},onClose:Function},provide(){return{kCurrentZIndex:I.DEFAULT_DIALOGS_ZINDEX}},data(){return{showLicenseWatermark:!1}},created(){n.validatePackage(h.packageMetadata),this.showLicenseWatermark=n.shouldShowValidationUI(h.packageMetadata),this.titleId=this.generateTitleId(),this.contentId=this.generateContentId()},computed:{dialogElementClass(){const{dialogClass:e,themeColor:i}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e,[`k-window-${i}`]:i}}},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===n.Keys.esc&&n.hasListener.call(this,"close")&&(e.preventDefault(),this.handleCloseDialog(e))},transformDimesion(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("%"))?e:e+"px"},getActionBarIndex(e){return e.findIndex(t=>t&&t.tag&&t.tag.toLowerCase().indexOf("dialogactionsbar")!==-1||t.componentOptions&&t.componentOptions.tag&&t.componentOptions.tag.toLowerCase().indexOf("actions-bar")!==-1||t.type&&t.type.name&&t.type.name.toLowerCase().indexOf("dialogactionsbar")!==-1)},generateTitleId(){return"dialog-title"+n.guid()},generateContentId(){return"dialog-content"+n.guid()},handleClick(e){this.$emit("overlayclick",e)}},render(){const e=this.$props.id!==void 0?this.$props.id:this.titleId;let{title:i,width:t,height:a,minWidth:s,dir:g,contentStyle:u,wrapperId:m}=this.$props;const d=this.$props.titleRender?n.templateRendering.call(this,this.$props.titleRender,n.getListeners.call(this)):null,r=n.getDefaultSlots(this)||[];t=this.transformDimesion(t),a=this.transformDimesion(a),s=this.transformDimesion(s);const w=this.showLicenseWatermark?o.createVNode(n.WatermarkOverlay,null,null):null,l=this.getActionBarIndex(r);let c;l!==-1&&(c=r[l],r.splice(l,1));const f=this.$props.closeIcon!==void 0?this.$props.closeIcon:!0,p=o.createVNode("div",{ref:"wrapper",class:"k-dialog-wrapper",onKeydown:this.handleKeyDown,tabindex:0,id:m,dir:g},[o.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),o.createVNode("div",{"aria-labelledby":i||d?e:void 0,"aria-describedby":this.contentId,"aria-modal":!0,class:this.dialogElementClass,role:"dialog",style:{width:t,height:a,minWidth:s}},[(i||d)&&o.createVNode(k.DialogTitleBar,{closeIcon:f,onClosebuttonclick:this.handleCloseDialog,id:e,title:i,titleRender:d},null),o.createVNode("div",{class:"k-window-content k-dialog-content",style:u,id:this.contentId},[r]),c,w])]);return this.$props.appendTo?o.createVNode("div",null,[p]):p}});exports.Dialog=y;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),k=require("./DialogTitleBar.js"),n=require("@progress/kendo-vue-common"),h=require("./package-metadata.js"),I=require("./constants.js"),y=o.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(){return{kCurrentZIndex:I.DEFAULT_DIALOGS_ZINDEX}},data(){return{showLicenseWatermark:!1}},created(){n.validatePackage(h.packageMetadata),this.showLicenseWatermark=n.shouldShowValidationUI(h.packageMetadata),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:i}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e,[`k-window-${i}`]:i}}},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===n.Keys.esc&&n.hasListener.call(this,"close")&&(e.preventDefault(),this.handleCloseDialog(e))},transformDimesion(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("%"))?e:e+"px"},getActionBarIndex(e){return e.findIndex(t=>t&&t.tag&&t.tag.toLowerCase().indexOf("dialogactionsbar")!==-1||t.componentOptions&&t.componentOptions.tag&&t.componentOptions.tag.toLowerCase().indexOf("actions-bar")!==-1||t.type&&t.type.name&&t.type.name.toLowerCase().indexOf("dialogactionsbar")!==-1)},generateTitleId(){return"dialog-title"+n.guid()},generateContentId(){return"dialog-content"+n.guid()},handleClick(e){this.$emit("overlayclick",e)}},render(){const e=this.$props.id!==void 0?this.$props.id:this.titleId;let{title:i,width:t,height:s,minWidth:a,dir:g,contentStyle:u,wrapperId:m}=this.$props;const l=this.$props.titleRender?n.templateRendering.call(this,this.$props.titleRender,n.getListeners.call(this)):null,r=n.getDefaultSlots(this)||[];t=this.transformDimesion(t),s=this.transformDimesion(s),a=this.transformDimesion(a);const w=this.showLicenseWatermark?o.createVNode(n.WatermarkOverlay,null,null):null,d=this.getActionBarIndex(r);let c;d!==-1&&(c=r[d],r.splice(d,1));const f=this.$props.closeIcon!==void 0?this.$props.closeIcon:!0,p=o.createVNode("div",{ref:"wrapper",class:this.wrapperClass,onKeydown:this.handleKeyDown,tabindex:0,id:m,dir:g},[o.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),o.createVNode("div",{"aria-labelledby":i||l?e:void 0,"aria-describedby":this.contentId,"aria-modal":!0,class:this.dialogElementClass,role:"dialog",style:{width:t,height:s,minWidth:a}},[(i||l)&&o.createVNode(k.DialogTitleBar,{closeIcon:f,onClosebuttonclick:this.handleCloseDialog,id:e,title:i,titleRender:l},null),o.createVNode("div",{class:"k-window-content k-dialog-content",style:u,id:this.contentId},[r]),c,w])]);return this.$props.appendTo?o.createVNode("div",null,[p]):p}});exports.Dialog=y;
package/Dialog.mjs CHANGED
@@ -6,11 +6,11 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { defineComponent as I, createVNode as o } from "vue";
9
- import { DialogTitleBar as k } from "./DialogTitleBar.mjs";
10
- import { validatePackage as y, shouldShowValidationUI as C, Keys as D, hasListener as S, guid as c, templateRendering as $, getListeners as x, getDefaultSlots as b, WatermarkOverlay as v } from "@progress/kendo-vue-common";
9
+ import { DialogTitleBar as C } from "./DialogTitleBar.mjs";
10
+ import { validatePackage as k, shouldShowValidationUI as y, Keys as S, hasListener as D, guid as c, templateRendering as $, getListeners as x, getDefaultSlots as b, WatermarkOverlay as v } from "@progress/kendo-vue-common";
11
11
  import { packageMetadata as h } from "./package-metadata.mjs";
12
12
  import { DEFAULT_DIALOGS_ZINDEX as L } from "./constants.mjs";
13
- const K = /* @__PURE__ */ I({
13
+ const R = /* @__PURE__ */ I({
14
14
  name: "KendoDialog",
15
15
  emits: {
16
16
  close: null,
@@ -30,6 +30,7 @@ const K = /* @__PURE__ */ I({
30
30
  width: [String, Number],
31
31
  height: [String, Number],
32
32
  minWidth: [String, Number],
33
+ className: String,
33
34
  dialogClass: String,
34
35
  themeColor: {
35
36
  type: String,
@@ -50,9 +51,18 @@ const K = /* @__PURE__ */ I({
50
51
  };
51
52
  },
52
53
  created() {
53
- y(h), this.showLicenseWatermark = C(h), this.titleId = this.generateTitleId(), this.contentId = this.generateContentId();
54
+ k(h), this.showLicenseWatermark = y(h), this.titleId = this.generateTitleId(), this.contentId = this.generateContentId();
54
55
  },
55
56
  computed: {
57
+ wrapperClass() {
58
+ const {
59
+ className: e
60
+ } = this.$props;
61
+ return {
62
+ "k-dialog-wrapper": !0,
63
+ [e]: e
64
+ };
65
+ },
56
66
  dialogElementClass() {
57
67
  const {
58
68
  dialogClass: e,
@@ -83,7 +93,7 @@ const K = /* @__PURE__ */ I({
83
93
  });
84
94
  },
85
95
  handleKeyDown(e) {
86
- e.keyCode === D.esc && S.call(this, "close") && (e.preventDefault(), this.handleCloseDialog(e));
96
+ e.keyCode === S.esc && D.call(this, "close") && (e.preventDefault(), this.handleCloseDialog(e));
87
97
  },
88
98
  transformDimesion(e) {
89
99
  return typeof e == "string" && (e.endsWith("px") || e.endsWith("%")) ? e : e + "px";
@@ -119,7 +129,7 @@ const K = /* @__PURE__ */ I({
119
129
  l !== -1 && (d = i[l], i.splice(l, 1));
120
130
  const w = this.$props.closeIcon !== void 0 ? this.$props.closeIcon : !0, p = o("div", {
121
131
  ref: "wrapper",
122
- class: "k-dialog-wrapper",
132
+ class: this.wrapperClass,
123
133
  onKeydown: this.handleKeyDown,
124
134
  tabindex: 0,
125
135
  id: u,
@@ -138,7 +148,7 @@ const K = /* @__PURE__ */ I({
138
148
  height: r,
139
149
  minWidth: s
140
150
  }
141
- }, [(n || a) && o(k, {
151
+ }, [(n || a) && o(C, {
142
152
  closeIcon: w,
143
153
  onClosebuttonclick: this.handleCloseDialog,
144
154
  id: e,
@@ -153,5 +163,5 @@ const K = /* @__PURE__ */ I({
153
163
  }
154
164
  });
155
165
  export {
156
- K as Dialog
166
+ R as Dialog
157
167
  };
@@ -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
- !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",productCodes:["KENDOUIVUE","KENDOUICOMPLETE"],publishDate:0,version:"",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],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:{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:"k-dialog-wrapper",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}),I=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.getTemplate.call(this,{h:t.h,template:m,defaultRendering:I}),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&&$,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
+ !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",productCodes:["KENDOUIVUE","KENDOUICOMPLETE"],publishDate:0,version:"",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}));
package/index.d.mts CHANGED
@@ -29,6 +29,7 @@ default: boolean;
29
29
  width: PropType<string | number>;
30
30
  height: PropType<string | number>;
31
31
  minWidth: PropType<string | number>;
32
+ className: PropType<string>;
32
33
  dialogClass: PropType<string>;
33
34
  themeColor: {
34
35
  type: PropType<string>;
@@ -38,6 +39,10 @@ onClose: PropType<(event: DialogCloseEvent) => void>;
38
39
  }>, {}, {
39
40
  showLicenseWatermark: boolean;
40
41
  }, {
42
+ wrapperClass(): {
43
+ [x: number]: any;
44
+ 'k-dialog-wrapper': boolean;
45
+ };
41
46
  dialogElementClass(): {
42
47
  [x: string]: any;
43
48
  [x: number]: any;
@@ -69,6 +74,7 @@ default: boolean;
69
74
  width: PropType<string | number>;
70
75
  height: PropType<string | number>;
71
76
  minWidth: PropType<string | number>;
77
+ className: PropType<string>;
72
78
  dialogClass: PropType<string>;
73
79
  themeColor: {
74
80
  type: PropType<string>;
package/index.d.ts CHANGED
@@ -29,6 +29,7 @@ default: boolean;
29
29
  width: PropType<string | number>;
30
30
  height: PropType<string | number>;
31
31
  minWidth: PropType<string | number>;
32
+ className: PropType<string>;
32
33
  dialogClass: PropType<string>;
33
34
  themeColor: {
34
35
  type: PropType<string>;
@@ -38,6 +39,10 @@ onClose: PropType<(event: DialogCloseEvent) => void>;
38
39
  }>, {}, {
39
40
  showLicenseWatermark: boolean;
40
41
  }, {
42
+ wrapperClass(): {
43
+ [x: number]: any;
44
+ 'k-dialog-wrapper': boolean;
45
+ };
41
46
  dialogElementClass(): {
42
47
  [x: string]: any;
43
48
  [x: number]: any;
@@ -69,6 +74,7 @@ default: boolean;
69
74
  width: PropType<string | number>;
70
75
  height: PropType<string | number>;
71
76
  minWidth: PropType<string | number>;
77
+ className: PropType<string>;
72
78
  dialogClass: PropType<string>;
73
79
  themeColor: {
74
80
  type: PropType<string>;
@@ -9,7 +9,7 @@ const e = {
9
9
  name: "@progress/kendo-vue-dialogs",
10
10
  productName: "Kendo UI for Vue",
11
11
  productCodes: ["KENDOUIVUE", "KENDOUICOMPLETE"],
12
- publishDate: 1731406665,
12
+ publishDate: 1731424301,
13
13
  version: "",
14
14
  licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/"
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-dialogs",
3
- "version": "6.0.0-develop.3",
3
+ "version": "6.0.0-develop.4",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -16,7 +16,7 @@
16
16
  "sideEffects": false,
17
17
  "peerDependencies": {
18
18
  "@progress/kendo-licensing": "^1.3.4",
19
- "@progress/kendo-vue-common": "6.0.0-develop.3",
19
+ "@progress/kendo-vue-common": "6.0.0-develop.4",
20
20
  "vue": "^3.0.2"
21
21
  },
22
22
  "dependencies": {},