@progress/kendo-vue-dialogs 8.4.0-develop.4 → 9.0.0-develop.1

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"),I=require("./DialogTitleBar.js"),n=require("@progress/kendo-vue-common"),c=require("./package-metadata.js"),k=require("./constants.js"),y=o.defineComponent({name:"KendoDialog",emits:{close:e=>!0,overlayclick:null},props:{appendTo:String,title:String,titleRender:[String,Function],id:String,wrapperId:String,dir:String,closeIcon:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},width:[String,Number],height:[String,Number],minWidth:[String,Number],className:String,dialogClass:String,onClose:Function},provide(){return{kCurrentZIndex:k.DEFAULT_DIALOGS_ZINDEX}},data(){return{showLicenseWatermark:!1,licenseMessage:void 0}},created(){n.validatePackage(c.packageMetadata),this.showLicenseWatermark=n.shouldShowValidationUI(c.packageMetadata),this.licenseMessage=n.getLicenseMessage(c.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}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e}}},mounted(){const e=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;e&&(this.windowElement=this.$el,e.appendChild(this.windowElement))},beforeUnmount(){var e;(e=this.windowElement)!=null&&e.parentNode&&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:r,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,s=n.getDefaultSlots(this)||[];t=this.transformDimesion(t),a=this.transformDimesion(a),r=this.transformDimesion(r);const w=this.showLicenseWatermark?o.createVNode(n.WatermarkOverlay,{message:this.licenseMessage},null):null,l=this.getActionBarIndex(s);let p;l!==-1&&(p=s[l],s.splice(l,1));const f=this.$props.closeIcon!==void 0?this.$props.closeIcon:!0,h=o.createVNode("div",{ref:"wrapper",class:this.wrapperClass,onKeydown:this.handleKeyDown,tabindex:0,id:m,dir:g},[this.$props.modal&&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":this.$props.modal||void 0,class:this.dialogElementClass,role:"dialog",style:{width:t,height:a,minWidth:r}},[(i||d)&&o.createVNode(I.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},[s]),p,w])]);return this.$props.appendTo?o.createVNode("div",null,[h]):h}});exports.Dialog=y;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),I=require("./DialogTitleBar.js"),n=require("@progress/kendo-vue-common"),c=require("./package-metadata.js"),k=require("./constants.js"),y=o.defineComponent({name:"KendoDialog",emits:{close:e=>!0,overlayclick:null},props:{appendTo:String,title:String,titleRender:[String,Function],id:String,wrapperId:String,dir:String,closeIcon:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},width:[String,Number],height:[String,Number],minWidth:[String,Number],className:String,dialogClass:String,onClose:Function},provide(){return{kCurrentZIndex:k.DEFAULT_DIALOGS_ZINDEX}},data(){return{showLicenseWatermark:!1,licenseMessage:void 0}},created(){n.validatePackage(c.packageMetadata),this.showLicenseWatermark=n.shouldShowValidationUI(c.packageMetadata),this.licenseMessage=n.getLicenseMessage(c.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}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e}}},mounted(){const e=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;e&&(this.windowElement=this.$el,e.appendChild(this.windowElement))},beforeUnmount(){var e;(e=this.windowElement)!=null&&e.parentNode&&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:r,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,s=n.getDefaultSlots(this)||[];t=this.transformDimesion(t),a=this.transformDimesion(a),r=this.transformDimesion(r);const w=this.showLicenseWatermark?o.createVNode(n.WatermarkOverlay,{message:this.licenseMessage},null):null,l=this.getActionBarIndex(s);let p;l!==-1&&(p=s[l],s.splice(l,1));const f=this.$props.closeIcon!==void 0?this.$props.closeIcon:!0,h=o.createVNode("div",{ref:"wrapper",class:this.wrapperClass,onKeydown:this.handleKeyDown,tabindex:0,id:m,dir:g},[this.$props.modal&&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":this.$props.modal||void 0,class:this.dialogElementClass,role:"dialog",style:{width:t,height:a,minWidth:r,overflow:"hidden"}},[(i||d)&&o.createVNode(I.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},[s]),p,w])]);return this.$props.appendTo?o.createVNode("div",null,[h]):h}});exports.Dialog=y;
package/Dialog.mjs CHANGED
@@ -110,7 +110,7 @@ const K = /* @__PURE__ */ I({
110
110
  render() {
111
111
  const e = this.$props.id !== void 0 ? this.$props.id : this.titleId;
112
112
  let {
113
- title: i,
113
+ title: o,
114
114
  width: t,
115
115
  height: s,
116
116
  minWidth: r,
@@ -118,13 +118,13 @@ const K = /* @__PURE__ */ I({
118
118
  contentStyle: g,
119
119
  wrapperId: u
120
120
  } = this.$props;
121
- const a = this.$props.titleRender ? y.call(this, this.$props.titleRender, k.call(this)) : null, o = D(this) || [];
121
+ const a = this.$props.titleRender ? y.call(this, this.$props.titleRender, k.call(this)) : null, i = D(this) || [];
122
122
  t = this.transformDimesion(t), s = this.transformDimesion(s), r = this.transformDimesion(r);
123
123
  const f = this.showLicenseWatermark ? n(S, {
124
124
  message: this.licenseMessage
125
- }, null) : null, l = this.getActionBarIndex(o);
125
+ }, null) : null, l = this.getActionBarIndex(i);
126
126
  let p;
127
- l !== -1 && (p = o[l], o.splice(l, 1));
127
+ l !== -1 && (p = i[l], i.splice(l, 1));
128
128
  const w = this.$props.closeIcon !== void 0 ? this.$props.closeIcon : !0, c = n("div", {
129
129
  ref: "wrapper",
130
130
  class: this.wrapperClass,
@@ -136,7 +136,7 @@ const K = /* @__PURE__ */ I({
136
136
  class: "k-overlay",
137
137
  onClick: this.handleClick
138
138
  }, null), n("div", {
139
- "aria-labelledby": i || a ? e : void 0,
139
+ "aria-labelledby": o || a ? e : void 0,
140
140
  "aria-describedby": this.contentId,
141
141
  "aria-modal": this.$props.modal || void 0,
142
142
  class: this.dialogElementClass,
@@ -144,19 +144,20 @@ const K = /* @__PURE__ */ I({
144
144
  style: {
145
145
  width: t,
146
146
  height: s,
147
- minWidth: r
147
+ minWidth: r,
148
+ overflow: "hidden"
148
149
  }
149
- }, [(i || a) && n(C, {
150
+ }, [(o || a) && n(C, {
150
151
  closeIcon: w,
151
152
  onClosebuttonclick: this.handleCloseDialog,
152
153
  id: e,
153
- title: i,
154
+ title: o,
154
155
  titleRender: a
155
156
  }, null), n("div", {
156
157
  class: "k-window-content k-dialog-content",
157
158
  style: g,
158
159
  id: this.contentId
159
- }, [o]), p, f])]);
160
+ }, [i]), p, f])]);
160
161
  return this.$props.appendTo ? n("div", null, [c]) : c;
161
162
  }
162
163
  });
package/Window.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"),$=require("./WindowTitlebar.js"),i=require("@progress/kendo-vue-common"),I=require("./WindowResizeHandlers.js"),e=require("./StageEnum.js"),g=require("./package-metadata.js"),C=require("./constants.js"),L=300,E=300,f=120,m=100,r=5,W=o.defineComponent({name:"KendoWindow",emits:{resize:t=>!0,move:t=>!0,close:t=>!0,stagechange:t=>!0,overlayclick:null},provide(){return{kCurrentZIndex:C.DEFAULT_DIALOGS_ZINDEX}},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:f},minHeight:{type:[Number],default:m},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(t){return["DEFAULT","MINIMIZED","FULLSCREEN"].indexOf(t)!==-1}},dir:String},created(){i.validatePackage(g.packageMetadata),this.showLicenseWatermark=i.shouldShowValidationUI(g.packageMetadata),this.licenseMessage=i.getLicenseMessage(g.packageMetadata),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()},this.titleId=this.generateTitleId()},beforeUnmount(){var t;(t=this.windowWrapper)!=null&&t.parentNode&&this.windowWrapper.remove()},data(){return{currentStage:this.$props.stage||e.windowStage.DEFAULT,isDragging:!1,currentTop:this.getInitialTop(),currentLeft:this.getInitialLeft(),currentWidth:this.getInitialWidth(),currentHeight:this.getInitialHeight(),titleId:void 0,showLicenseWatermark:!1,licenseMessage:void 0}},mounted(){window&&window.addEventListener("resize",this.handleBrowserWindowResize);const t=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;t&&(this.windowWrapper=this.$el,t.appendChild(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:t}=this.$props;return{"k-window":!0,[t]:t,"k-window-minimized":this.currentStage==="MINIMIZED"}},computedTop(){return this.windowStage!==e.windowStage.FULLSCREEN?Math.max(this.$props.top||this.currentTop,0):0},computedLeft(){return this.windowStage!==e.windowStage.FULLSCREEN?Math.max(this.$props.left||this.currentLeft,0):0},computedWidth(){let t=this.$props.width||this.currentWidth;return this.windowStage===e.windowStage.FULLSCREEN&&(t=window.innerWidth),t},computedHeight(){let t=this.$props.height||this.currentHeight;return this.windowStage===e.windowStage.FULLSCREEN?t=window.innerHeight:this.windowStage===e.windowStage.MINIMIZED&&(t=0),t},windowStage(){return this.$props.stage||this.currentStage}},methods:{onPress(t){const n=t;this.windowCoordinatesState.differenceLeft=n.pageX-this.computedLeft,this.windowCoordinatesState.differenceTop=n.pageY-this.computedTop},onDrag(t){const n=t;n.originalEvent.preventDefault(),this.windowStage!==e.windowStage.FULLSCREEN&&this.$props.draggable&&(this.currentTop=Math.max(n.pageY-this.windowCoordinatesState.differenceTop,0),this.currentLeft=n.pageX-this.windowCoordinatesState.differenceLeft,this.isDragging=!0,this.dispatchMoveEvent("move",n,!0,!1))},onRelease(t){const n=t;this.windowStage!==e.windowStage.FULLSCREEN&&this.$props.draggable&&this.dispatchMoveEvent("move",n,!0,!0),this.isDragging=!1},handleKeyDown(t){if(t.target!==t.currentTarget)return;const n=this.$props.minWidth||f,s=this.$props.minHeight||m;if(t.ctrlKey&&this.$props.resizable){switch(t.keyCode){case i.Keys.up:t.preventDefault(),s<=this.computedHeight-r&&(this.currentHeight=this.currentHeight-r);break;case i.Keys.down:t.preventDefault(),this.currentHeight=this.currentHeight+r;break;case i.Keys.left:n<=this.computedWidth-r&&(this.currentWidth=this.currentWidth-r);break;case i.Keys.right:this.currentWidth=this.currentWidth+r;break;default:return}this.dispatchMoveEvent("resize",t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case i.Keys.up:this.windowStage===e.windowStage.MINIMIZED?(this.handleRestore(t),this.$emit("stagechange",t,this,{state:e.windowStage.DEFAULT})):this.windowStage===e.windowStage.DEFAULT&&(this.handleFullscreen(t),this.$emit("stagechange",t,this,{state:e.windowStage.FULLSCREEN}));break;case i.Keys.down:this.windowStage===e.windowStage.FULLSCREEN?(this.handleRestore(t),this.$emit("stagechange",t,this,{state:e.windowStage.DEFAULT})):this.windowStage===e.windowStage.DEFAULT&&(this.handleMinimize(t),this.$emit("stagechange",t,this,{state:e.windowStage.MINIMIZED}));break}return}if(!t.ctrlKey)switch(t.keyCode){case i.Keys.esc:this.handleCloseWindow(t);return;case i.Keys.up:t.preventDefault(),this.currentTop=this.currentTop-r;break;case i.Keys.down:t.preventDefault(),this.currentTop=this.currentTop+r;break;case i.Keys.left:t.preventDefault(),this.currentLeft=this.currentLeft-r;break;case i.Keys.right:t.preventDefault(),this.currentLeft=this.currentLeft+r;break;default:return}this.dispatchMoveEvent("move",t,!1,void 0)},getInitialTop(){if(this.$props.top!==void 0)return this.$props.top;if(this.$props.initialTop!==void 0)return this.$props.initialTop;let t=E;return this.$props.height!==void 0?t=this.$props.height:this.$props.initialHeight!==void 0&&(t=this.$props.initialHeight),window.innerHeight/2-t/2},getInitialLeft(){if(this.$props.left!==void 0)return this.$props.left;if(this.$props.initialLeft!==void 0)return this.$props.initialLeft;let t=L;return this.$props.width!==void 0?t=this.$props.width:this.$props.initialWidth!==void 0&&(t=this.$props.initialWidth),window.innerWidth/2-t/2},getInitialWidth(){let t=L;return this.$props.width!==void 0?t=this.$props.width:this.$props.initialWidth!==void 0&&(t=this.$props.initialWidth),t},getInitialHeight(){let t=E;return this.$props.height!==void 0?t=this.$props.height:this.$props.initialHeight!==void 0&&(t=this.$props.initialHeight),t},handleMinimize(t){t.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentStage=e.windowStage.MINIMIZED,this.currentHeight=0,this.$emit("stagechange",t,this,{state:e.windowStage.MINIMIZED})},handleFullscreen(t){t.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=e.windowStage.FULLSCREEN,this.$emit("stagechange",t,this,{state:e.windowStage.FULLSCREEN})},handleRestore(t){t.preventDefault(),this.windowStage===e.windowStage.FULLSCREEN?(this.currentStage=e.windowStage.DEFAULT,this.currentLeft=this.windowCoordinatesState.leftBeforeAction,this.currentTop=this.windowCoordinatesState.topBeforeAction,this.currentWidth=this.windowCoordinatesState.widthBeforeAction,this.currentHeight=this.windowCoordinatesState.heightBeforeAction):this.windowStage===e.windowStage.MINIMIZED&&(this.currentStage=e.windowStage.DEFAULT,this.currentHeight=this.windowCoordinatesState.heightBeforeAction),this.$emit("stagechange",t,this,{state:e.windowStage.DEFAULT})},handleCloseWindow(t){t.preventDefault(),this.$emit("close",t,this,{state:void 0})},handleDoubleClick(t){this.$props.doubleClickStageChange&&(this.windowStage===e.windowStage.FULLSCREEN||this.windowStage===e.windowStage.MINIMIZED?this.handleRestore(t):this.handleFullscreen(t))},handleResize(t,n){const s=this.computedWidth,a=this.computedHeight,u=this.$props.minWidth||f,l=this.$props.minHeight||m,h=this.computedTop-t.pageY,d=this.computedLeft-t.pageX,c=t.pageX-this.computedLeft,p=t.pageY-this.computedTop;this.isDragging=!n.end,n.direction.indexOf("n")>=0&&l-(a+h)<0&&(this.currentTop=t.pageY,this.currentHeight=a+h),n.direction.indexOf("s")>=0&&l-p<0&&(this.currentHeight=p),n.direction.indexOf("w")>=0&&u-(s+d)<0&&(this.currentLeft=t.pageX,this.currentWidth=s+d),n.direction.indexOf("e")>=0&&u-c<0&&(this.currentWidth=c),this.dispatchMoveEvent("resize",t,!0,n.end)},dispatchMoveEvent(t,n,s,a){this.$emit(t,{event:n.event,drag:s,end:a,target:this,left:this.currentLeft,top:this.currentTop,width:this.currentWidth,height:this.currentHeight})},handleBrowserWindowResize(){this.windowStage===e.windowStage.FULLSCREEN&&(this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight)},handleClick(t){this.$emit("overlayclick",t)},getActionBarIndex(t){return t.findIndex(s=>s&&s.tag&&s.tag.toLowerCase().indexOf("dialogactionsbar")!==-1||s.componentOptions&&s.componentOptions.tag&&s.componentOptions.tag.toLowerCase().indexOf("actions-bar")!==-1||s.type&&s.type.name&&s.type.name.toLowerCase().indexOf("dialogactionsbar")!==-1)},generateTitleId(){return"window-title-"+i.guid()}},render(){const t=i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)),n=i.templateRendering.call(this,this.$props.closeButton,i.getListeners.call(this)),s=i.templateRendering.call(this,this.$props.minimizeButton,i.getListeners.call(this)),a=i.templateRendering.call(this,this.$props.maximizeButton,i.getListeners.call(this)),u=i.templateRendering.call(this,this.$props.restoreButton,i.getListeners.call(this)),l=i.getDefaultSlots(this),h=l||[],d=this.getActionBarIndex(h);let c;d!==-1&&(c=h[d],h.splice(d,1));const p=this.showLicenseWatermark?o.createVNode(i.WatermarkOverlay,{message:this.licenseMessage},null):null,S=o.createVNode("div",{class:this.wrapperClass,ref:"wrapper",dir:this.$props.dir},[this.$props.modal&&o.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),o.createVNode("div",{tabindex:0,onFocus:w=>w.target.classList.add("k-focus"),onBlur:w=>w.target.classList.remove("k-focus"),onKeydown:this.handleKeyDown,ref:"windowElement",class:this.windowElementClass,role:"dialog","aria-modal":this.$props.modal?!0: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}},[o.createVNode(i.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:"draggable"},{default:()=>[o.createVNode($.WindowTitleBar,{stage:this.windowStage,title:this.$props.title,titleId:this.titleId,titleRender:t,onDoubleclick:this.handleDoubleClick,onMinimizeclick:this.handleMinimize,onFullscreenclick:this.handleFullscreen,onRestoreclick:this.handleRestore,onCloseclick:this.handleCloseWindow,closeButton:n,minimizeButton:s,maximizeButton:a,restoreButton:u},null)]}),this.windowStage!==e.windowStage.MINIMIZED?[o.createVNode("div",{class:"k-window-content"},[l]),c]:null,this.windowStage===e.windowStage.DEFAULT&&this.$props.resizable?o.createVNode(I.ResizeHandlers,{onResize:this.handleResize},null):null,p])]);return this.$props.appendTo?o.createVNode("div",null,[S]):S}});exports.Window=W;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),I=require("./WindowTitlebar.js"),i=require("@progress/kendo-vue-common"),$=require("./WindowResizeHandlers.js"),e=require("./StageEnum.js"),g=require("./package-metadata.js"),C=require("./constants.js"),L=300,E=300,f=120,m=100,r=5,D=o.defineComponent({name:"KendoWindow",emits:{resize:t=>!0,move:t=>!0,close:t=>!0,stagechange:t=>!0,overlayclick:null},provide(){return{kCurrentZIndex:C.DEFAULT_DIALOGS_ZINDEX}},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:f},minHeight:{type:[Number],default:m},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(t){return["DEFAULT","MINIMIZED","FULLSCREEN"].indexOf(t)!==-1}},dir:String},created(){i.validatePackage(g.packageMetadata),this.showLicenseWatermark=i.shouldShowValidationUI(g.packageMetadata),this.licenseMessage=i.getLicenseMessage(g.packageMetadata),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()},this.titleId=this.generateTitleId()},beforeUnmount(){var t;(t=this.windowWrapper)!=null&&t.parentNode&&this.windowWrapper.remove()},data(){return{currentStage:this.$props.stage||e.windowStage.DEFAULT,isDragging:!1,currentTop:this.getInitialTop(),currentLeft:this.getInitialLeft(),currentWidth:this.getInitialWidth(),currentHeight:this.getInitialHeight(),titleId:void 0,showLicenseWatermark:!1,licenseMessage:void 0}},mounted(){window&&window.addEventListener("resize",this.handleBrowserWindowResize);const t=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;t&&(this.windowWrapper=this.$el,t.appendChild(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:t}=this.$props;return{"k-window":!0,[t]:t,"k-window-minimized":this.currentStage==="MINIMIZED"}},computedTop(){return this.windowStage!==e.windowStage.FULLSCREEN?Math.max(this.$props.top||this.currentTop,0):0},computedLeft(){return this.windowStage!==e.windowStage.FULLSCREEN?Math.max(this.$props.left||this.currentLeft,0):0},computedWidth(){let t=this.$props.width||this.currentWidth;return this.windowStage===e.windowStage.FULLSCREEN&&(t=window.innerWidth),t},computedHeight(){let t=this.$props.height||this.currentHeight;return this.windowStage===e.windowStage.FULLSCREEN?t=window.innerHeight:this.windowStage===e.windowStage.MINIMIZED&&(t=0),t},windowStage(){return this.$props.stage||this.currentStage}},methods:{onPress(t){const n=t;this.windowCoordinatesState.differenceLeft=n.pageX-this.computedLeft,this.windowCoordinatesState.differenceTop=n.pageY-this.computedTop},onDrag(t){const n=t;n.originalEvent.preventDefault(),this.windowStage!==e.windowStage.FULLSCREEN&&this.$props.draggable&&(this.currentTop=Math.max(n.pageY-this.windowCoordinatesState.differenceTop,0),this.currentLeft=n.pageX-this.windowCoordinatesState.differenceLeft,this.isDragging=!0,this.dispatchMoveEvent("move",n,!0,!1))},onRelease(t){const n=t;this.windowStage!==e.windowStage.FULLSCREEN&&this.$props.draggable&&this.dispatchMoveEvent("move",n,!0,!0),this.isDragging=!1},handleKeyDown(t){if(t.target!==t.currentTarget)return;const n=this.$props.minWidth||f,s=this.$props.minHeight||m;if(t.ctrlKey&&this.$props.resizable){switch(t.keyCode){case i.Keys.up:t.preventDefault(),s<=this.computedHeight-r&&(this.currentHeight=this.currentHeight-r);break;case i.Keys.down:t.preventDefault(),this.currentHeight=this.currentHeight+r;break;case i.Keys.left:n<=this.computedWidth-r&&(this.currentWidth=this.currentWidth-r);break;case i.Keys.right:this.currentWidth=this.currentWidth+r;break;default:return}this.dispatchMoveEvent("resize",t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case i.Keys.up:this.windowStage===e.windowStage.MINIMIZED?(this.handleRestore(t),this.$emit("stagechange",t,this,{state:e.windowStage.DEFAULT})):this.windowStage===e.windowStage.DEFAULT&&(this.handleFullscreen(t),this.$emit("stagechange",t,this,{state:e.windowStage.FULLSCREEN}));break;case i.Keys.down:this.windowStage===e.windowStage.FULLSCREEN?(this.handleRestore(t),this.$emit("stagechange",t,this,{state:e.windowStage.DEFAULT})):this.windowStage===e.windowStage.DEFAULT&&(this.handleMinimize(t),this.$emit("stagechange",t,this,{state:e.windowStage.MINIMIZED}));break}return}if(!t.ctrlKey)switch(t.keyCode){case i.Keys.esc:this.handleCloseWindow(t);return;case i.Keys.up:t.preventDefault(),this.currentTop=this.currentTop-r;break;case i.Keys.down:t.preventDefault(),this.currentTop=this.currentTop+r;break;case i.Keys.left:t.preventDefault(),this.currentLeft=this.currentLeft-r;break;case i.Keys.right:t.preventDefault(),this.currentLeft=this.currentLeft+r;break;default:return}this.dispatchMoveEvent("move",t,!1,void 0)},getInitialTop(){if(this.$props.top!==void 0)return this.$props.top;if(this.$props.initialTop!==void 0)return this.$props.initialTop;let t=E;return this.$props.height!==void 0?t=this.$props.height:this.$props.initialHeight!==void 0&&(t=this.$props.initialHeight),window.innerHeight/2-t/2},getInitialLeft(){if(this.$props.left!==void 0)return this.$props.left;if(this.$props.initialLeft!==void 0)return this.$props.initialLeft;let t=L;return this.$props.width!==void 0?t=this.$props.width:this.$props.initialWidth!==void 0&&(t=this.$props.initialWidth),window.innerWidth/2-t/2},getInitialWidth(){let t=L;return this.$props.width!==void 0?t=this.$props.width:this.$props.initialWidth!==void 0&&(t=this.$props.initialWidth),t},getInitialHeight(){let t=E;return this.$props.height!==void 0?t=this.$props.height:this.$props.initialHeight!==void 0&&(t=this.$props.initialHeight),t},handleMinimize(t){t.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentStage=e.windowStage.MINIMIZED,this.currentHeight=0,this.$emit("stagechange",t,this,{state:e.windowStage.MINIMIZED})},handleFullscreen(t){t.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=e.windowStage.FULLSCREEN,this.$emit("stagechange",t,this,{state:e.windowStage.FULLSCREEN})},handleRestore(t){t.preventDefault(),this.windowStage===e.windowStage.FULLSCREEN?(this.currentStage=e.windowStage.DEFAULT,this.currentLeft=this.windowCoordinatesState.leftBeforeAction,this.currentTop=this.windowCoordinatesState.topBeforeAction,this.currentWidth=this.windowCoordinatesState.widthBeforeAction,this.currentHeight=this.windowCoordinatesState.heightBeforeAction):this.windowStage===e.windowStage.MINIMIZED&&(this.currentStage=e.windowStage.DEFAULT,this.currentHeight=this.windowCoordinatesState.heightBeforeAction),this.$emit("stagechange",t,this,{state:e.windowStage.DEFAULT})},handleCloseWindow(t){t.preventDefault(),this.$emit("close",t,this,{state:void 0})},handleDoubleClick(t){this.$props.doubleClickStageChange&&(this.windowStage===e.windowStage.FULLSCREEN||this.windowStage===e.windowStage.MINIMIZED?this.handleRestore(t):this.handleFullscreen(t))},handleResize(t,n){const s=this.computedWidth,a=this.computedHeight,w=this.$props.minWidth||f,l=this.$props.minHeight||m,d=this.computedTop-t.pageY,h=this.computedLeft-t.pageX,c=t.pageX-this.computedLeft,u=t.pageY-this.computedTop;this.isDragging=!n.end,n.direction.indexOf("n")>=0&&l-(a+d)<0&&(this.currentTop=t.pageY,this.currentHeight=a+d),n.direction.indexOf("s")>=0&&l-u<0&&(this.currentHeight=u),n.direction.indexOf("w")>=0&&w-(s+h)<0&&(this.currentLeft=t.pageX,this.currentWidth=s+h),n.direction.indexOf("e")>=0&&w-c<0&&(this.currentWidth=c),this.dispatchMoveEvent("resize",t,!0,n.end)},dispatchMoveEvent(t,n,s,a){this.$emit(t,{event:n.event,drag:s,end:a,target:this,left:this.currentLeft,top:this.currentTop,width:this.currentWidth,height:this.currentHeight})},handleBrowserWindowResize(){this.windowStage===e.windowStage.FULLSCREEN&&(this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight)},handleClick(t){this.$emit("overlayclick",t)},getActionBarIndex(t){return t.findIndex(s=>s&&s.tag&&s.tag.toLowerCase().indexOf("dialogactionsbar")!==-1||s.componentOptions&&s.componentOptions.tag&&s.componentOptions.tag.toLowerCase().indexOf("actions-bar")!==-1||s.type&&s.type.name&&s.type.name.toLowerCase().indexOf("dialogactionsbar")!==-1)},generateTitleId(){return"window-title-"+i.guid()}},render(){const t=i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)),n=i.templateRendering.call(this,this.$props.closeButton,i.getListeners.call(this)),s=i.templateRendering.call(this,this.$props.minimizeButton,i.getListeners.call(this)),a=i.templateRendering.call(this,this.$props.maximizeButton,i.getListeners.call(this)),w=i.templateRendering.call(this,this.$props.restoreButton,i.getListeners.call(this)),l=i.getDefaultSlots(this),d=l||[],h=this.getActionBarIndex(d);let c;h!==-1&&(c=d[h],d.splice(h,1));const u=this.showLicenseWatermark?o.createVNode(i.WatermarkOverlay,{message:this.licenseMessage},null):null,S=o.createVNode("div",{class:this.wrapperClass,ref:"wrapper",dir:this.$props.dir},[this.$props.modal&&o.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),o.createVNode("div",{tabindex:0,onFocus:p=>p.target.classList.add("k-focus"),onBlur:p=>p.target.classList.remove("k-focus"),onKeydown:this.handleKeyDown,ref:"windowElement",class:this.windowElementClass,role:"dialog","aria-modal":this.$props.modal?!0:void 0,"aria-labelledby":this.$props.title!==void 0||t?this.titleId:void 0,style:{top:this.computedTop+"px",left:this.computedLeft+"px",width:this.computedWidth+"px",height:this.windowStage!==e.windowStage.MINIMIZED?this.computedHeight+"px":void 0,overflow:this.windowStage!==e.windowStage.MINIMIZED?"hidden":void 0,...this.$props.windowStyle}},[o.createVNode(i.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:"draggable"},{default:()=>[o.createVNode(I.WindowTitleBar,{stage:this.windowStage,title:this.$props.title,titleId:this.titleId,titleRender:t,onDoubleclick:this.handleDoubleClick,onMinimizeclick:this.handleMinimize,onFullscreenclick:this.handleFullscreen,onRestoreclick:this.handleRestore,onCloseclick:this.handleCloseWindow,closeButton:n,minimizeButton:s,maximizeButton:a,restoreButton:w},null)]}),[o.createVNode("div",{class:this.windowStage===e.windowStage.MINIMIZED?"k-window-content k-hidden":"k-window-content"},[l]),this.windowStage!==e.windowStage.MINIMIZED?c:null],this.windowStage===e.windowStage.DEFAULT&&this.$props.resizable?o.createVNode($.ResizeHandlers,{onResize:this.handleResize},null):null,u])]);return this.$props.appendTo?o.createVNode("div",null,[S]):S}});exports.Window=D;
package/Window.mjs CHANGED
@@ -5,14 +5,14 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as C, createVNode as o } from "vue";
9
- import { WindowTitleBar as D } from "./WindowTitlebar.mjs";
10
- import { templateRendering as c, getListeners as u, getDefaultSlots as W, WatermarkOverlay as T, Draggable as B, guid as H, Keys as s, validatePackage as b, shouldShowValidationUI as k, getLicenseMessage as F } from "@progress/kendo-vue-common";
11
- import { ResizeHandlers as M } from "./WindowResizeHandlers.mjs";
8
+ import { defineComponent as D, createVNode as r } from "vue";
9
+ import { WindowTitleBar as C } from "./WindowTitlebar.mjs";
10
+ import { templateRendering as c, getListeners as u, getDefaultSlots as W, WatermarkOverlay as T, Draggable as B, guid as H, Keys as s, validatePackage as M, shouldShowValidationUI as k, getLicenseMessage as b } from "@progress/kendo-vue-common";
11
+ import { ResizeHandlers as N } from "./WindowResizeHandlers.mjs";
12
12
  import { windowStage as e } from "./StageEnum.mjs";
13
13
  import { packageMetadata as m } from "./package-metadata.mjs";
14
- import { DEFAULT_DIALOGS_ZINDEX as N } from "./constants.mjs";
15
- const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
14
+ import { DEFAULT_DIALOGS_ZINDEX as F } from "./constants.mjs";
15
+ const I = 300, $ = 300, S = 120, L = 100, o = 5, O = /* @__PURE__ */ D({
16
16
  name: "KendoWindow",
17
17
  emits: {
18
18
  resize: (t) => !0,
@@ -23,7 +23,7 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
23
23
  },
24
24
  provide() {
25
25
  return {
26
- kCurrentZIndex: N
26
+ kCurrentZIndex: F
27
27
  };
28
28
  },
29
29
  props: {
@@ -53,11 +53,11 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
53
53
  initialTop: [Number],
54
54
  minWidth: {
55
55
  type: [Number],
56
- default: L
56
+ default: S
57
57
  },
58
58
  minHeight: {
59
59
  type: [Number],
60
- default: S
60
+ default: L
61
61
  },
62
62
  resizable: {
63
63
  type: Boolean,
@@ -91,7 +91,7 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
91
91
  dir: String
92
92
  },
93
93
  created() {
94
- b(m), this.showLicenseWatermark = k(m), this.licenseMessage = F(m), this.windowCoordinatesState = {
94
+ M(m), this.showLicenseWatermark = k(m), this.licenseMessage = b(m), this.windowCoordinatesState = {
95
95
  leftBeforeAction: this.getInitialLeft(),
96
96
  topBeforeAction: this.getInitialTop(),
97
97
  widthBeforeAction: this.getInitialWidth(),
@@ -173,20 +173,20 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
173
173
  handleKeyDown(t) {
174
174
  if (t.target !== t.currentTarget)
175
175
  return;
176
- const i = this.$props.minWidth || L, n = this.$props.minHeight || S;
176
+ const i = this.$props.minWidth || S, n = this.$props.minHeight || L;
177
177
  if (t.ctrlKey && this.$props.resizable) {
178
178
  switch (t.keyCode) {
179
179
  case s.up:
180
- t.preventDefault(), n <= this.computedHeight - r && (this.currentHeight = this.currentHeight - r);
180
+ t.preventDefault(), n <= this.computedHeight - o && (this.currentHeight = this.currentHeight - o);
181
181
  break;
182
182
  case s.down:
183
- t.preventDefault(), this.currentHeight = this.currentHeight + r;
183
+ t.preventDefault(), this.currentHeight = this.currentHeight + o;
184
184
  break;
185
185
  case s.left:
186
- i <= this.computedWidth - r && (this.currentWidth = this.currentWidth - r);
186
+ i <= this.computedWidth - o && (this.currentWidth = this.currentWidth - o);
187
187
  break;
188
188
  case s.right:
189
- this.currentWidth = this.currentWidth + r;
189
+ this.currentWidth = this.currentWidth + o;
190
190
  break;
191
191
  default:
192
192
  return;
@@ -219,16 +219,16 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
219
219
  this.handleCloseWindow(t);
220
220
  return;
221
221
  case s.up:
222
- t.preventDefault(), this.currentTop = this.currentTop - r;
222
+ t.preventDefault(), this.currentTop = this.currentTop - o;
223
223
  break;
224
224
  case s.down:
225
- t.preventDefault(), this.currentTop = this.currentTop + r;
225
+ t.preventDefault(), this.currentTop = this.currentTop + o;
226
226
  break;
227
227
  case s.left:
228
- t.preventDefault(), this.currentLeft = this.currentLeft - r;
228
+ t.preventDefault(), this.currentLeft = this.currentLeft - o;
229
229
  break;
230
230
  case s.right:
231
- t.preventDefault(), this.currentLeft = this.currentLeft + r;
231
+ t.preventDefault(), this.currentLeft = this.currentLeft + o;
232
232
  break;
233
233
  default:
234
234
  return;
@@ -240,7 +240,7 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
240
240
  return this.$props.top;
241
241
  if (this.$props.initialTop !== void 0)
242
242
  return this.$props.initialTop;
243
- let t = I;
243
+ let t = $;
244
244
  return this.$props.height !== void 0 ? t = this.$props.height : this.$props.initialHeight !== void 0 && (t = this.$props.initialHeight), window.innerHeight / 2 - t / 2;
245
245
  },
246
246
  getInitialLeft() {
@@ -248,15 +248,15 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
248
248
  return this.$props.left;
249
249
  if (this.$props.initialLeft !== void 0)
250
250
  return this.$props.initialLeft;
251
- let t = $;
251
+ let t = I;
252
252
  return this.$props.width !== void 0 ? t = this.$props.width : this.$props.initialWidth !== void 0 && (t = this.$props.initialWidth), window.innerWidth / 2 - t / 2;
253
253
  },
254
254
  getInitialWidth() {
255
- let t = $;
255
+ let t = I;
256
256
  return this.$props.width !== void 0 ? t = this.$props.width : this.$props.initialWidth !== void 0 && (t = this.$props.initialWidth), t;
257
257
  },
258
258
  getInitialHeight() {
259
- let t = I;
259
+ let t = $;
260
260
  return this.$props.height !== void 0 ? t = this.$props.height : this.$props.initialHeight !== void 0 && (t = this.$props.initialHeight), t;
261
261
  },
262
262
  handleMinimize(t) {
@@ -283,8 +283,8 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
283
283
  this.$props.doubleClickStageChange && (this.windowStage === e.FULLSCREEN || this.windowStage === e.MINIMIZED ? this.handleRestore(t) : this.handleFullscreen(t));
284
284
  },
285
285
  handleResize(t, i) {
286
- const n = this.computedWidth, h = this.computedHeight, g = this.$props.minWidth || L, l = this.$props.minHeight || S, a = this.computedTop - t.pageY, d = this.computedLeft - t.pageX, p = t.pageX - this.computedLeft, f = t.pageY - this.computedTop;
287
- this.isDragging = !i.end, i.direction.indexOf("n") >= 0 && l - (h + a) < 0 && (this.currentTop = t.pageY, this.currentHeight = h + a), i.direction.indexOf("s") >= 0 && l - f < 0 && (this.currentHeight = f), i.direction.indexOf("w") >= 0 && g - (n + d) < 0 && (this.currentLeft = t.pageX, this.currentWidth = n + d), i.direction.indexOf("e") >= 0 && g - p < 0 && (this.currentWidth = p), this.dispatchMoveEvent("resize", t, !0, i.end);
286
+ const n = this.computedWidth, h = this.computedHeight, g = this.$props.minWidth || S, l = this.$props.minHeight || L, a = this.computedTop - t.pageY, d = this.computedLeft - t.pageX, p = t.pageX - this.computedLeft, w = t.pageY - this.computedTop;
287
+ this.isDragging = !i.end, i.direction.indexOf("n") >= 0 && l - (h + a) < 0 && (this.currentTop = t.pageY, this.currentHeight = h + a), i.direction.indexOf("s") >= 0 && l - w < 0 && (this.currentHeight = w), i.direction.indexOf("w") >= 0 && g - (n + d) < 0 && (this.currentLeft = t.pageX, this.currentWidth = n + d), i.direction.indexOf("e") >= 0 && g - p < 0 && (this.currentWidth = p), this.dispatchMoveEvent("resize", t, !0, i.end);
288
288
  },
289
289
  dispatchMoveEvent(t, i, n, h) {
290
290
  this.$emit(t, {
@@ -315,39 +315,40 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
315
315
  const t = c.call(this, this.$props.titleRender, u.call(this)), i = c.call(this, this.$props.closeButton, u.call(this)), n = c.call(this, this.$props.minimizeButton, u.call(this)), h = c.call(this, this.$props.maximizeButton, u.call(this)), g = c.call(this, this.$props.restoreButton, u.call(this)), l = W(this), a = l || [], d = this.getActionBarIndex(a);
316
316
  let p;
317
317
  d !== -1 && (p = a[d], a.splice(d, 1));
318
- const f = this.showLicenseWatermark ? o(T, {
318
+ const w = this.showLicenseWatermark ? r(T, {
319
319
  message: this.licenseMessage
320
- }, null) : null, E = o("div", {
320
+ }, null) : null, E = r("div", {
321
321
  class: this.wrapperClass,
322
322
  ref: "wrapper",
323
323
  dir: this.$props.dir
324
- }, [this.$props.modal && o("div", {
324
+ }, [this.$props.modal && r("div", {
325
325
  class: "k-overlay",
326
326
  onClick: this.handleClick
327
- }, null), o("div", {
327
+ }, null), r("div", {
328
328
  tabindex: 0,
329
- onFocus: (w) => w.target.classList.add("k-focus"),
330
- onBlur: (w) => w.target.classList.remove("k-focus"),
329
+ onFocus: (f) => f.target.classList.add("k-focus"),
330
+ onBlur: (f) => f.target.classList.remove("k-focus"),
331
331
  onKeydown: this.handleKeyDown,
332
332
  ref: "windowElement",
333
333
  class: this.windowElementClass,
334
334
  role: "dialog",
335
335
  "aria-modal": this.$props.modal ? !0 : void 0,
336
- "aria-labelledby": this.titleId,
336
+ "aria-labelledby": this.$props.title !== void 0 || t ? this.titleId : void 0,
337
337
  style: {
338
338
  top: this.computedTop + "px",
339
339
  left: this.computedLeft + "px",
340
340
  width: this.computedWidth + "px",
341
- height: this.computedHeight + "px" || "",
341
+ height: this.windowStage !== e.MINIMIZED ? this.computedHeight + "px" : void 0,
342
+ overflow: this.windowStage !== e.MINIMIZED ? "hidden" : void 0,
342
343
  ...this.$props.windowStyle
343
344
  }
344
- }, [o(B, {
345
+ }, [r(B, {
345
346
  onPress: this.onPress,
346
347
  onDrag: this.onDrag,
347
348
  onRelease: this.onRelease,
348
349
  ref: "draggable"
349
350
  }, {
350
- default: () => [o(D, {
351
+ default: () => [r(C, {
351
352
  stage: this.windowStage,
352
353
  title: this.$props.title,
353
354
  titleId: this.titleId,
@@ -362,12 +363,12 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
362
363
  maximizeButton: h,
363
364
  restoreButton: g
364
365
  }, null)]
365
- }), this.windowStage !== e.MINIMIZED ? [o("div", {
366
- class: "k-window-content"
367
- }, [l]), p] : null, this.windowStage === e.DEFAULT && this.$props.resizable ? o(M, {
366
+ }), [r("div", {
367
+ class: this.windowStage === e.MINIMIZED ? "k-window-content k-hidden" : "k-window-content"
368
+ }, [l]), this.windowStage !== e.MINIMIZED ? p : null], this.windowStage === e.DEFAULT && this.$props.resizable ? r(N, {
368
369
  onResize: this.handleResize
369
- }, null) : null, f])]);
370
- return this.$props.appendTo ? o("div", null, [E]) : E;
370
+ }, null) : null, w])]);
371
+ return this.$props.appendTo ? r("div", null, [E]) : E;
371
372
  }
372
373
  });
373
374
  export {
package/WindowTitlebar.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 t=require("vue"),i=require("@progress/kendo-vue-common"),l=require("@progress/kendo-vue-buttons"),R=require("@progress/kendo-vue-intl"),s=require("./StageEnum.js"),e=require("./messages/main.js"),c=require("@progress/kendo-svg-icons"),F=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(n){this.$emit("doubleclick",n)},onMinimizeClick(n){this.$emit("minimizeclick",n)},onFullScreenClick(n){this.$emit("fullscreenclick",n)},onRestoreClick(n){this.$emit("restoreclick",n)},onCloseClick(n){this.$emit("closeclick",n)}},render(){const n=this.$props,{stage:a,title:r,titleRender:u,minimizeButton:d,maximizeButton:g,restoreButton:m,closeButton:w}=n,o=R.provideLocalizationService(this);let k=i.getTemplate.call(this,{h:t.h,template:u,defaultRendering:r});const B=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-minimize",svgIcon:c.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":o.toLanguageString(e.dialogsWindowMinimizeButton,e.messages[e.dialogsWindowMinimizeButton])},null),h=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:B}),b=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window",svgIcon:c.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":o.toLanguageString(e.dialogsWindowMaximizeButton,e.messages[e.dialogsWindowMaximizeButton])},null),p=i.getTemplate.call(this,{h:t.h,template:g,defaultRendering:b}),S=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:c.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":o.toLanguageString(e.dialogsWindowRestoreButton,e.messages[e.dialogsWindowRestoreButton])},null),f=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:S}),C=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:c.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":o.toLanguageString(e.dialogsWindowCloseButton,e.messages[e.dialogsWindowCloseButton])},null),z=i.getTemplate.call(this,{h:t.h,template:w,defaultRendering:C});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},[k]),t.createVNode("div",{class:"k-window-titlebar-actions"},[a===s.windowStage.DEFAULT&&h,a===s.windowStage.DEFAULT&&p,a!==s.windowStage.DEFAULT&&f,z])])}});exports.WindowTitleBar=F;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("@progress/kendo-vue-common"),l=require("@progress/kendo-vue-buttons"),R=require("@progress/kendo-vue-intl"),a=require("./StageEnum.js"),t=require("./messages/main.js"),c=require("@progress/kendo-svg-icons"),F=e.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(i){this.$emit("doubleclick",i)},onMinimizeClick(i){this.$emit("minimizeclick",i)},onFullScreenClick(i){this.$emit("fullscreenclick",i)},onRestoreClick(i){this.$emit("restoreclick",i)},onCloseClick(i){this.$emit("closeclick",i)}},render(){const i=this.$props,{stage:s,title:r,titleRender:u,minimizeButton:d,maximizeButton:g,restoreButton:m,closeButton:w}=i,o=R.provideLocalizationService(this);let k=n.getTemplate.call(this,{h:e.h,template:u,defaultRendering:r});const B=e.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"window-minimize",svgIcon:c.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":o.toLanguageString(t.dialogsWindowMinimizeButton,t.messages[t.dialogsWindowMinimizeButton])},null),h=n.getTemplate.call(this,{h:e.h,template:d,defaultRendering:B}),b=e.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"window",svgIcon:c.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":o.toLanguageString(t.dialogsWindowMaximizeButton,t.messages[t.dialogsWindowMaximizeButton])},null),p=n.getTemplate.call(this,{h:e.h,template:g,defaultRendering:b}),z=e.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"window-restore",svgIcon:c.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":o.toLanguageString(t.dialogsWindowRestoreButton,t.messages[t.dialogsWindowRestoreButton])},null),S=n.getTemplate.call(this,{h:e.h,template:m,defaultRendering:z}),f=e.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"x",svgIcon:c.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":o.toLanguageString(t.dialogsWindowCloseButton,t.messages[t.dialogsWindowCloseButton])},null),C=n.getTemplate.call(this,{h:e.h,template:w,defaultRendering:f});return e.createVNode("div",{class:"k-window-titlebar",style:{touchAction:"none"},onDblclick:this.onDoubleClick},[e.createVNode("span",{class:"k-window-title",id:this.$props.titleId},[k]),e.createVNode("div",{class:"k-window-titlebar-actions"},[s===a.windowStage.DEFAULT&&h,s===a.windowStage.DEFAULT&&p,s!==a.windowStage.DEFAULT&&S,C])])}});exports.WindowTitleBar=F;
@@ -5,14 +5,14 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as M, h as n, createVNode as i } from "vue";
9
- import { getTemplate as o } from "@progress/kendo-vue-common";
8
+ import { defineComponent as I, h as n, createVNode as i } from "vue";
9
+ import { getTemplate as e } from "@progress/kendo-vue-common";
10
10
  import { Button as l } from "@progress/kendo-vue-buttons";
11
- import { provideLocalizationService as v } from "@progress/kendo-vue-intl";
12
- import { windowStage as s } from "./StageEnum.mjs";
11
+ import { provideLocalizationService as M } from "@progress/kendo-vue-intl";
12
+ import { windowStage as a } from "./StageEnum.mjs";
13
13
  import { dialogsWindowMinimizeButton as r, messages as c, dialogsWindowMaximizeButton as u, dialogsWindowRestoreButton as d, dialogsWindowCloseButton as m } from "./messages/main.mjs";
14
- import { windowMinimizeIcon as L, windowIcon as x, windowRestoreIcon as $, xIcon as j } from "@progress/kendo-svg-icons";
15
- const K = /* @__PURE__ */ M({
14
+ import { windowMinimizeIcon as v, windowIcon as L, windowRestoreIcon as $, xIcon as j } from "@progress/kendo-svg-icons";
15
+ const K = /* @__PURE__ */ I({
16
16
  name: "KendoWindowTitleBar",
17
17
  props: {
18
18
  id: String,
@@ -54,15 +54,15 @@ const K = /* @__PURE__ */ M({
54
54
  },
55
55
  render() {
56
56
  const t = this.$props, {
57
- stage: a,
57
+ stage: s,
58
58
  title: g,
59
59
  titleRender: w,
60
60
  minimizeButton: k,
61
61
  maximizeButton: p,
62
62
  restoreButton: B,
63
63
  closeButton: f
64
- } = t, e = v(this);
65
- let h = o.call(this, {
64
+ } = t, o = M(this);
65
+ let h = e.call(this, {
66
66
  h: n,
67
67
  template: w,
68
68
  defaultRendering: g
@@ -70,51 +70,55 @@ const K = /* @__PURE__ */ M({
70
70
  const b = i(l, {
71
71
  type: "button",
72
72
  class: "k-window-titlebar-action",
73
+ size: "xs",
73
74
  icon: "window-minimize",
74
- svgIcon: L,
75
+ svgIcon: v,
75
76
  fillMode: "flat",
76
77
  onClick: this.onMinimizeClick,
77
- "aria-label": e.toLanguageString(r, c[r])
78
- }, null), C = o.call(this, {
78
+ "aria-label": o.toLanguageString(r, c[r])
79
+ }, null), z = e.call(this, {
79
80
  h: n,
80
81
  template: k,
81
82
  defaultRendering: b
82
- }), z = i(l, {
83
+ }), C = i(l, {
83
84
  type: "button",
84
85
  class: "k-window-titlebar-action",
86
+ size: "xs",
85
87
  icon: "window",
86
- svgIcon: x,
88
+ svgIcon: L,
87
89
  fillMode: "flat",
88
90
  onClick: this.onFullScreenClick,
89
- "aria-label": e.toLanguageString(u, c[u])
90
- }, null), S = o.call(this, {
91
+ "aria-label": o.toLanguageString(u, c[u])
92
+ }, null), S = e.call(this, {
91
93
  h: n,
92
94
  template: p,
93
- defaultRendering: z
95
+ defaultRendering: C
94
96
  }), F = i(l, {
95
97
  type: "button",
96
98
  class: "k-window-titlebar-action",
99
+ size: "xs",
97
100
  icon: "window-restore",
98
101
  svgIcon: $,
99
102
  fillMode: "flat",
100
103
  onClick: this.onRestoreClick,
101
- "aria-label": e.toLanguageString(d, c[d])
102
- }, null), R = o.call(this, {
104
+ "aria-label": o.toLanguageString(d, c[d])
105
+ }, null), R = e.call(this, {
103
106
  h: n,
104
107
  template: B,
105
108
  defaultRendering: F
106
- }), D = i(l, {
109
+ }), x = i(l, {
107
110
  type: "button",
108
111
  class: "k-window-titlebar-action",
112
+ size: "xs",
109
113
  icon: "x",
110
114
  svgIcon: j,
111
115
  fillMode: "flat",
112
116
  onClick: this.onCloseClick,
113
- "aria-label": e.toLanguageString(m, c[m])
114
- }, null), I = o.call(this, {
117
+ "aria-label": o.toLanguageString(m, c[m])
118
+ }, null), D = e.call(this, {
115
119
  h: n,
116
120
  template: f,
117
- defaultRendering: D
121
+ defaultRendering: x
118
122
  });
119
123
  return i("div", {
120
124
  class: "k-window-titlebar",
@@ -127,7 +131,7 @@ const K = /* @__PURE__ */ M({
127
131
  id: this.$props.titleId
128
132
  }, [h]), i("div", {
129
133
  class: "k-window-titlebar-actions"
130
- }, [a === s.DEFAULT && C, a === s.DEFAULT && S, a !== s.DEFAULT && R, I])]);
134
+ }, [s === a.DEFAULT && z, s === a.DEFAULT && S, s !== a.DEFAULT && R, D])]);
131
135
  }
132
136
  });
133
137
  export {
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !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:"8.4.0-develop.4",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},l=t.defineComponent({name:"KendoDialog",emits:{close:e=>!0,overlayclick:null},props:{appendTo:String,title:String,titleRender:[String,Function],id:String,wrapperId:String,dir:String,closeIcon:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},width:[String,Number],height:[String,Number],minWidth:[String,Number],className:String,dialogClass:String,onClose:Function},provide:()=>({kCurrentZIndex:10002}),data:()=>({showLicenseWatermark:!1,licenseMessage:void 0}),created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.licenseMessage=i.getLicenseMessage(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}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e}}},mounted(){const e=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;e&&(this.windowElement=this.$el,e.appendChild(this.windowElement))},beforeUnmount(){var e;null!=(e=this.windowElement)&&e.parentNode&&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,{message:this.licenseMessage},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},[this.$props.modal&&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":this.$props.modal||void 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:v}=e,k=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":k.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":k.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":k.toLanguageString(u,w[u])},null),E=i.getTemplate.call(this,{h:t.h,template:f,defaultRendering:b}),y=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:o.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":k.toLanguageString(g,w[g])},null),D=i.getTemplate.call(this,{h:t.h,template:v,defaultRendering:y});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&&E,D])])}}),f=["n","e","s","w","se","sw","ne","nw"],v=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)])}}),k=t.defineComponent({name:"KendoWindow",emits:{resize:e=>!0,move:e=>!0,close:e=>!0,stagechange:e=>!0,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)}},dir:String},created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.licenseMessage=i.getLicenseMessage(a),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()},this.titleId=this.generateTitleId()},beforeUnmount(){var e;null!=(e=this.windowWrapper)&&e.parentNode&&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,licenseMessage:void 0}},mounted(){window&&window.addEventListener("resize",this.handleBrowserWindowResize);const e=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;e&&(this.windowWrapper=this.$el,e.appendChild(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}=this.$props;return{"k-window":!0,[e]:e,"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,{message:this.licenseMessage},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(v,{onResize:this.handleResize},null):null,p])]);return this.$props.appendTo?t.createVNode("div",null,[u]):u}});e.Dialog=l,e.DialogActionsBar=d,e.Window=k});
15
+ !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:"9.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},l=t.defineComponent({name:"KendoDialog",emits:{close:e=>!0,overlayclick:null},props:{appendTo:String,title:String,titleRender:[String,Function],id:String,wrapperId:String,dir:String,closeIcon:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},width:[String,Number],height:[String,Number],minWidth:[String,Number],className:String,dialogClass:String,onClose:Function},provide:()=>({kCurrentZIndex:10002}),data:()=>({showLicenseWatermark:!1,licenseMessage:void 0}),created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.licenseMessage=i.getLicenseMessage(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}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e}}},mounted(){const e=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;e&&(this.windowElement=this.$el,e.appendChild(this.windowElement))},beforeUnmount(){var e;null!=(e=this.windowElement)&&e.parentNode&&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,{message:this.licenseMessage},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},[this.$props.modal&&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":this.$props.modal||void 0,class:this.dialogElementClass,role:"dialog",style:{width:o,height:s,minWidth:a,overflow:"hidden"}},[(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:v}=e,k=s.provideLocalizationService(this);let S=i.getTemplate.call(this,{h:t.h,template:l,defaultRendering:a});const C=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"window-minimize",svgIcon:o.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":k.toLanguageString(p,w[p])},null),I=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:C}),L=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"window",svgIcon:o.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":k.toLanguageString(c,w[c])},null),$=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:L}),b=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"window-restore",svgIcon:o.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":k.toLanguageString(u,w[u])},null),E=i.getTemplate.call(this,{h:t.h,template:f,defaultRendering:b}),D=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",size:"xs",icon:"x",svgIcon:o.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":k.toLanguageString(g,w[g])},null),y=i.getTemplate.call(this,{h:t.h,template:v,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},[S]),t.createVNode("div",{class:"k-window-titlebar-actions"},[r===h.DEFAULT&&I,r===h.DEFAULT&&$,r!==h.DEFAULT&&E,y])])}}),f=["n","e","s","w","se","sw","ne","nw"],v=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)])}}),k=t.defineComponent({name:"KendoWindow",emits:{resize:e=>!0,move:e=>!0,close:e=>!0,stagechange:e=>!0,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)}},dir:String},created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.licenseMessage=i.getLicenseMessage(a),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()},this.titleId=this.generateTitleId()},beforeUnmount(){var e;null!=(e=this.windowWrapper)&&e.parentNode&&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,licenseMessage:void 0}},mounted(){window&&window.addEventListener("resize",this.handleBrowserWindowResize);const e=this.$props.appendTo?document.querySelector(this.$props.appendTo):document.body;e&&(this.windowWrapper=this.$el,e.appendChild(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}=this.$props;return{"k-window":!0,[e]:e,"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,{message:this.licenseMessage},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":void 0!==this.$props.title||e?this.titleId:void 0,style:{top:this.computedTop+"px",left:this.computedLeft+"px",width:this.computedWidth+"px",height:this.windowStage!==h.MINIMIZED?this.computedHeight+"px":void 0,overflow:this.windowStage!==h.MINIMIZED?"hidden":void 0,...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)]}),[t.createVNode("div",{class:this.windowStage===h.MINIMIZED?"k-window-content k-hidden":"k-window-content"},[a]),this.windowStage!==h.MINIMIZED?c:null],this.windowStage===h.DEFAULT&&this.$props.resizable?t.createVNode(v,{onResize:this.handleResize},null):null,p])]);return this.$props.appendTo?t.createVNode("div",null,[u]):u}});e.Dialog=l,e.DialogActionsBar=d,e.Window=k});
@@ -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 e={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1779123005,version:"8.4.0-develop.4",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e;
8
+ "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: 1779204847,version:"9.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "Kendo UI for Vue",
11
11
  productCode: "KENDOUIVUE",
12
12
  productCodes: ["KENDOUIVUE"],
13
- publishDate: 1779123005,
14
- version: "8.4.0-develop.4",
13
+ publishDate: 1779204847,
14
+ version: "9.0.0-develop.1",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-dialogs",
3
- "version": "8.4.0-develop.4",
3
+ "version": "9.0.0-develop.1",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -25,9 +25,9 @@
25
25
  "sideEffects": false,
26
26
  "peerDependencies": {
27
27
  "@progress/kendo-licensing": "^1.7.2",
28
- "@progress/kendo-vue-buttons": "8.4.0-develop.4",
29
- "@progress/kendo-vue-common": "8.4.0-develop.4",
30
- "@progress/kendo-vue-intl": "8.4.0-develop.4",
28
+ "@progress/kendo-vue-buttons": "9.0.0-develop.1",
29
+ "@progress/kendo-vue-common": "9.0.0-develop.1",
30
+ "@progress/kendo-vue-intl": "9.0.0-develop.1",
31
31
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
32
32
  "vue": "^3.0.2"
33
33
  },
@@ -48,7 +48,7 @@
48
48
  "package": {
49
49
  "productName": "Kendo UI for Vue",
50
50
  "productCode": "KENDOUIVUE",
51
- "publishDate": 1779123005,
51
+ "publishDate": 1779204847,
52
52
  "licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/"
53
53
  }
54
54
  },