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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dialog.d.ts CHANGED
@@ -43,10 +43,6 @@ export interface DialogProps {
43
43
  * Specifies the minimum width of the Dialog.
44
44
  */
45
45
  minWidth?: number | string;
46
- /**
47
- * Specifies the theme color of the Dialog. The available options are `primary`, `dark`, and `light`.
48
- */
49
- themeColor?: 'primary' | 'dark' | 'light' | string;
50
46
  /**
51
47
  * Fires when the **Close** button in the title is clicked or when the `Esc` button is pressed.
52
48
  */
@@ -100,10 +96,6 @@ declare const Dialog: import('vue').DefineComponent<import('vue').ExtractPropTyp
100
96
  minWidth: PropType<string | number>;
101
97
  className: PropType<string>;
102
98
  dialogClass: PropType<string>;
103
- themeColor: {
104
- type: PropType<string>;
105
- validator: (value: any) => any;
106
- };
107
99
  onClose: PropType<(event: DialogCloseEvent) => void>;
108
100
  }>, {}, {
109
101
  showLicenseWatermark: boolean;
@@ -114,7 +106,6 @@ declare const Dialog: import('vue').DefineComponent<import('vue').ExtractPropTyp
114
106
  'k-dialog-wrapper': boolean;
115
107
  };
116
108
  dialogElementClass(): {
117
- [x: string]: any;
118
109
  [x: number]: any;
119
110
  'k-window': boolean;
120
111
  'k-dialog': boolean;
@@ -150,10 +141,6 @@ declare const Dialog: import('vue').DefineComponent<import('vue').ExtractPropTyp
150
141
  minWidth: PropType<string | number>;
151
142
  className: PropType<string>;
152
143
  dialogClass: PropType<string>;
153
- themeColor: {
154
- type: PropType<string>;
155
- validator: (value: any) => any;
156
- };
157
144
  onClose: PropType<(event: DialogCloseEvent) => void>;
158
145
  }>> & Readonly<{
159
146
  onClose?: (event: DialogCloseEvent) => any;
package/Dialog.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),k=require("./DialogTitleBar.js"),n=require("@progress/kendo-vue-common"),c=require("./package-metadata.js"),y=require("./constants.js"),C=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,themeColor:{type:String,validator:function(e){return["primary","dark","light"].includes(e)}},onClose:Function},provide(){return{kCurrentZIndex:y.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,themeColor:i}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e,[`k-window-${i}`]:i}}},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(k.DialogTitleBar,{closeIcon:f,onClosebuttonclick:this.handleCloseDialog,id:e,title:i,titleRender:d},null),o.createVNode("div",{class:"k-window-content k-dialog-content",style:u,id:this.contentId},[s]),p,w])]);return this.$props.appendTo?o.createVNode("div",null,[h]):h}});exports.Dialog=C;
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;
package/Dialog.mjs CHANGED
@@ -5,9 +5,9 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as I, createVNode as i } from "vue";
8
+ import { defineComponent as I, createVNode as n } from "vue";
9
9
  import { DialogTitleBar as C } from "./DialogTitleBar.mjs";
10
- import { templateRendering as y, getListeners as k, getDefaultSlots as S, WatermarkOverlay as D, guid as h, Keys as $, hasListener as x, validatePackage as b, shouldShowValidationUI as v, getLicenseMessage as L } from "@progress/kendo-vue-common";
10
+ import { templateRendering as y, getListeners as k, getDefaultSlots as D, WatermarkOverlay as S, guid as h, Keys as $, hasListener as x, validatePackage as b, shouldShowValidationUI as v, getLicenseMessage as L } from "@progress/kendo-vue-common";
11
11
  import { packageMetadata as d } from "./package-metadata.mjs";
12
12
  import { DEFAULT_DIALOGS_ZINDEX as W } from "./constants.mjs";
13
13
  const K = /* @__PURE__ */ I({
@@ -36,12 +36,6 @@ const K = /* @__PURE__ */ I({
36
36
  minWidth: [String, Number],
37
37
  className: String,
38
38
  dialogClass: String,
39
- themeColor: {
40
- type: String,
41
- validator: function(e) {
42
- return ["primary", "dark", "light"].includes(e);
43
- }
44
- },
45
39
  onClose: Function
46
40
  },
47
41
  provide() {
@@ -70,14 +64,12 @@ const K = /* @__PURE__ */ I({
70
64
  },
71
65
  dialogElementClass() {
72
66
  const {
73
- dialogClass: e,
74
- themeColor: n
67
+ dialogClass: e
75
68
  } = this.$props;
76
69
  return {
77
70
  "k-window": !0,
78
71
  "k-dialog": !0,
79
- [e]: e,
80
- [`k-window-${n}`]: n
72
+ [e]: e
81
73
  };
82
74
  }
83
75
  },
@@ -118,7 +110,7 @@ const K = /* @__PURE__ */ I({
118
110
  render() {
119
111
  const e = this.$props.id !== void 0 ? this.$props.id : this.titleId;
120
112
  let {
121
- title: n,
113
+ title: i,
122
114
  width: t,
123
115
  height: s,
124
116
  minWidth: r,
@@ -126,25 +118,25 @@ const K = /* @__PURE__ */ I({
126
118
  contentStyle: g,
127
119
  wrapperId: u
128
120
  } = this.$props;
129
- const a = this.$props.titleRender ? y.call(this, this.$props.titleRender, k.call(this)) : null, o = S(this) || [];
121
+ const a = this.$props.titleRender ? y.call(this, this.$props.titleRender, k.call(this)) : null, o = D(this) || [];
130
122
  t = this.transformDimesion(t), s = this.transformDimesion(s), r = this.transformDimesion(r);
131
- const f = this.showLicenseWatermark ? i(D, {
123
+ const f = this.showLicenseWatermark ? n(S, {
132
124
  message: this.licenseMessage
133
125
  }, null) : null, l = this.getActionBarIndex(o);
134
126
  let p;
135
127
  l !== -1 && (p = o[l], o.splice(l, 1));
136
- const w = this.$props.closeIcon !== void 0 ? this.$props.closeIcon : !0, c = i("div", {
128
+ const w = this.$props.closeIcon !== void 0 ? this.$props.closeIcon : !0, c = n("div", {
137
129
  ref: "wrapper",
138
130
  class: this.wrapperClass,
139
131
  onKeydown: this.handleKeyDown,
140
132
  tabindex: 0,
141
133
  id: u,
142
134
  dir: m
143
- }, [this.$props.modal && i("div", {
135
+ }, [this.$props.modal && n("div", {
144
136
  class: "k-overlay",
145
137
  onClick: this.handleClick
146
- }, null), i("div", {
147
- "aria-labelledby": n || a ? e : void 0,
138
+ }, null), n("div", {
139
+ "aria-labelledby": i || a ? e : void 0,
148
140
  "aria-describedby": this.contentId,
149
141
  "aria-modal": this.$props.modal || void 0,
150
142
  class: this.dialogElementClass,
@@ -154,18 +146,18 @@ const K = /* @__PURE__ */ I({
154
146
  height: s,
155
147
  minWidth: r
156
148
  }
157
- }, [(n || a) && i(C, {
149
+ }, [(i || a) && n(C, {
158
150
  closeIcon: w,
159
151
  onClosebuttonclick: this.handleCloseDialog,
160
152
  id: e,
161
- title: n,
153
+ title: i,
162
154
  titleRender: a
163
- }, null), i("div", {
155
+ }, null), n("div", {
164
156
  class: "k-window-content k-dialog-content",
165
157
  style: g,
166
158
  id: this.contentId
167
159
  }, [o]), p, f])]);
168
- return this.$props.appendTo ? i("div", null, [c]) : c;
160
+ return this.$props.appendTo ? n("div", null, [c]) : c;
169
161
  }
170
162
  });
171
163
  export {
package/DialogTitleBar.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 e=require("vue"),a=require("@progress/kendo-vue-common"),c=require("@progress/kendo-vue-buttons"),r=require("@progress/kendo-svg-icons"),s=e.defineComponent({props:{id:String,closeIcon:{type:Boolean,default:!0},title:String,titleRender:[String,Function,Object],onClosebuttonclick:Function},methods:{onCloseButtonClick(t){this.$emit("closebuttonclick",t)}},render(){let{id:t,closeIcon:i,titleRender:l,title:n}=this.$props,o;return o=a.getTemplate.call(this,{h:e.h,template:l,defaultRendering:n}),e.createVNode("div",{class:"k-window-titlebar k-dialog-titlebar",id:t},[e.createVNode("span",{class:"k-window-title k-dialog-title"},[o]),e.createVNode("div",{class:"k-window-titlebar-actions k-dialog-titlebar-actions"},[i&&e.createVNode(c.Button,{type:"button",fillMode:"flat",size:"xsmall","aria-label":"Close",icon:"x",svgIcon:r.xIcon,onClick:this.onCloseButtonClick,class:"k-window-titlebar-action k-dialog-titlebar-action"},null)])])}});exports.DialogTitleBar=s;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),a=require("@progress/kendo-vue-common"),c=require("@progress/kendo-vue-buttons"),r=require("@progress/kendo-svg-icons"),s=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{id:e,closeIcon:i,titleRender:l,title:n}=this.$props,o;return o=a.getTemplate.call(this,{h:t.h,template:l,defaultRendering:n}),t.createVNode("div",{class:"k-window-titlebar k-dialog-titlebar",id:e},[t.createVNode("span",{class:"k-window-title k-dialog-title"},[o]),t.createVNode("div",{class:"k-window-titlebar-actions k-dialog-titlebar-actions"},[i&&t.createVNode(c.Button,{type:"button",fillMode:"flat","aria-label":"Close",icon:"x",svgIcon:r.xIcon,onClick:this.onCloseButtonClick,class:"k-window-titlebar-action k-dialog-titlebar-action"},null)])])}});exports.DialogTitleBar=s;
@@ -46,7 +46,6 @@ const b = /* @__PURE__ */ a({
46
46
  }, [o && t(s, {
47
47
  type: "button",
48
48
  fillMode: "flat",
49
- size: "xsmall",
50
49
  "aria-label": "Close",
51
50
  icon: "x",
52
51
  svgIcon: d,
package/Window.d.ts CHANGED
@@ -71,10 +71,6 @@ declare const Window: import('vue').DefineComponent<import('vue').ExtractPropTyp
71
71
  type: PropType<string>;
72
72
  validator: (value: string) => boolean;
73
73
  };
74
- themeColor: {
75
- type: PropType<string>;
76
- validator: (value: any) => any;
77
- };
78
74
  dir: PropType<string>;
79
75
  }>, {}, {
80
76
  currentStage: string;
@@ -91,7 +87,6 @@ declare const Window: import('vue').DefineComponent<import('vue').ExtractPropTyp
91
87
  'k-dialog-wrapper': any;
92
88
  };
93
89
  windowElementClass(): {
94
- [x: string]: any;
95
90
  [x: number]: any;
96
91
  'k-window': boolean;
97
92
  'k-window-minimized': boolean;
@@ -190,10 +185,6 @@ declare const Window: import('vue').DefineComponent<import('vue').ExtractPropTyp
190
185
  type: PropType<string>;
191
186
  validator: (value: string) => boolean;
192
187
  };
193
- themeColor: {
194
- type: PropType<string>;
195
- validator: (value: any) => any;
196
- };
197
188
  dir: PropType<string>;
198
189
  }>> & Readonly<{
199
190
  onClose?: (event: WindowActionsEvent) => any;
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}},themeColor:{type:String,validator:function(t){return[void 0,"primary","dark","light"].includes(t)}},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,themeColor:n}=this.$props;return{"k-window":!0,[t]:t,[`k-window-${n}`]:n,"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"),$=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;
package/Window.mjs CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { defineComponent as C, createVNode as o } from "vue";
9
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 k, shouldShowValidationUI as b, getLicenseMessage as F } from "@progress/kendo-vue-common";
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
11
  import { ResizeHandlers as M } from "./WindowResizeHandlers.mjs";
12
12
  import { windowStage as e } from "./StageEnum.mjs";
13
13
  import { packageMetadata as m } from "./package-metadata.mjs";
@@ -88,16 +88,10 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
88
88
  return ["DEFAULT", "MINIMIZED", "FULLSCREEN"].indexOf(t) !== -1;
89
89
  }
90
90
  },
91
- themeColor: {
92
- type: String,
93
- validator: function(t) {
94
- return [void 0, "primary", "dark", "light"].includes(t);
95
- }
96
- },
97
91
  dir: String
98
92
  },
99
93
  created() {
100
- k(m), this.showLicenseWatermark = b(m), this.licenseMessage = F(m), this.windowCoordinatesState = {
94
+ b(m), this.showLicenseWatermark = k(m), this.licenseMessage = F(m), this.windowCoordinatesState = {
101
95
  leftBeforeAction: this.getInitialLeft(),
102
96
  topBeforeAction: this.getInitialTop(),
103
97
  widthBeforeAction: this.getInitialWidth(),
@@ -137,13 +131,11 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
137
131
  },
138
132
  windowElementClass() {
139
133
  const {
140
- windowClass: t,
141
- themeColor: i
134
+ windowClass: t
142
135
  } = this.$props;
143
136
  return {
144
137
  "k-window": !0,
145
138
  [t]: t,
146
- [`k-window-${i}`]: i,
147
139
  "k-window-minimized": this.currentStage === "MINIMIZED"
148
140
  };
149
141
  },
package/WindowProps.d.ts CHANGED
@@ -87,10 +87,6 @@ export interface WindowProps {
87
87
  * Specifies if the Window will be resizable ([see example]({% slug dimensionsresizing_window %}#toc-resizing)).
88
88
  */
89
89
  resizable?: boolean;
90
- /**
91
- * Specifies the theme color of the Dialog.
92
- */
93
- themeColor?: 'promary' | 'dark' | 'light' | string;
94
90
  /**
95
91
  * Acccepts a named slot `string`, functional or class component for the restore button. If set to `false` the button is not rendered.
96
92
  *
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 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:m,restoreButton:g,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",icon:"window-minimize",svgIcon:c.windowMinimizeIcon,fillMode:"flat",size:"xsmall",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",icon:"window",svgIcon:c.windowIcon,fillMode:"flat",size:"xsmall",onClick:this.onFullScreenClick,"aria-label":o.toLanguageString(t.dialogsWindowMaximizeButton,t.messages[t.dialogsWindowMaximizeButton])},null),p=n.getTemplate.call(this,{h:e.h,template:m,defaultRendering:b}),z=e.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:c.windowRestoreIcon,fillMode:"flat",size:"xsmall",onClick:this.onRestoreClick,"aria-label":o.toLanguageString(t.dialogsWindowRestoreButton,t.messages[t.dialogsWindowRestoreButton])},null),S=n.getTemplate.call(this,{h:e.h,template:g,defaultRendering:z}),f=e.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:c.xIcon,fillMode:"flat",size:"xsmall",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;
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;
@@ -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 I, h as n, createVNode as i } from "vue";
9
- import { getTemplate as e } from "@progress/kendo-vue-common";
8
+ import { defineComponent as M, h as n, createVNode as i } from "vue";
9
+ import { getTemplate as o } from "@progress/kendo-vue-common";
10
10
  import { Button as l } from "@progress/kendo-vue-buttons";
11
- import { provideLocalizationService as M } from "@progress/kendo-vue-intl";
12
- import { windowStage as a } from "./StageEnum.mjs";
13
- import { dialogsWindowMinimizeButton as r, messages as c, dialogsWindowMaximizeButton as u, dialogsWindowRestoreButton as m, dialogsWindowCloseButton as d } from "./messages/main.mjs";
14
- import { windowMinimizeIcon as v, windowIcon as L, windowRestoreIcon as $, xIcon as j } from "@progress/kendo-svg-icons";
15
- const K = /* @__PURE__ */ I({
11
+ import { provideLocalizationService as v } from "@progress/kendo-vue-intl";
12
+ import { windowStage as s } from "./StageEnum.mjs";
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({
16
16
  name: "KendoWindowTitleBar",
17
17
  props: {
18
18
  id: String,
@@ -54,15 +54,15 @@ const K = /* @__PURE__ */ I({
54
54
  },
55
55
  render() {
56
56
  const t = this.$props, {
57
- stage: s,
57
+ stage: a,
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, o = M(this);
65
- let h = e.call(this, {
64
+ } = t, e = v(this);
65
+ let h = o.call(this, {
66
66
  h: n,
67
67
  template: w,
68
68
  defaultRendering: g
@@ -71,54 +71,50 @@ const K = /* @__PURE__ */ I({
71
71
  type: "button",
72
72
  class: "k-window-titlebar-action",
73
73
  icon: "window-minimize",
74
- svgIcon: v,
74
+ svgIcon: L,
75
75
  fillMode: "flat",
76
- size: "xsmall",
77
76
  onClick: this.onMinimizeClick,
78
- "aria-label": o.toLanguageString(r, c[r])
79
- }, null), z = e.call(this, {
77
+ "aria-label": e.toLanguageString(r, c[r])
78
+ }, null), C = o.call(this, {
80
79
  h: n,
81
80
  template: k,
82
81
  defaultRendering: b
83
- }), C = i(l, {
82
+ }), z = i(l, {
84
83
  type: "button",
85
84
  class: "k-window-titlebar-action",
86
85
  icon: "window",
87
- svgIcon: L,
86
+ svgIcon: x,
88
87
  fillMode: "flat",
89
- size: "xsmall",
90
88
  onClick: this.onFullScreenClick,
91
- "aria-label": o.toLanguageString(u, c[u])
92
- }, null), S = e.call(this, {
89
+ "aria-label": e.toLanguageString(u, c[u])
90
+ }, null), S = o.call(this, {
93
91
  h: n,
94
92
  template: p,
95
- defaultRendering: C
93
+ defaultRendering: z
96
94
  }), F = i(l, {
97
95
  type: "button",
98
96
  class: "k-window-titlebar-action",
99
97
  icon: "window-restore",
100
98
  svgIcon: $,
101
99
  fillMode: "flat",
102
- size: "xsmall",
103
100
  onClick: this.onRestoreClick,
104
- "aria-label": o.toLanguageString(m, c[m])
105
- }, null), R = e.call(this, {
101
+ "aria-label": e.toLanguageString(d, c[d])
102
+ }, null), R = o.call(this, {
106
103
  h: n,
107
104
  template: B,
108
105
  defaultRendering: F
109
- }), x = i(l, {
106
+ }), D = i(l, {
110
107
  type: "button",
111
108
  class: "k-window-titlebar-action",
112
109
  icon: "x",
113
110
  svgIcon: j,
114
111
  fillMode: "flat",
115
- size: "xsmall",
116
112
  onClick: this.onCloseClick,
117
- "aria-label": o.toLanguageString(d, c[d])
118
- }, null), D = e.call(this, {
113
+ "aria-label": e.toLanguageString(m, c[m])
114
+ }, null), I = o.call(this, {
119
115
  h: n,
120
116
  template: f,
121
- defaultRendering: x
117
+ defaultRendering: D
122
118
  });
123
119
  return i("div", {
124
120
  class: "k-window-titlebar",
@@ -131,7 +127,7 @@ const K = /* @__PURE__ */ I({
131
127
  id: this.$props.titleId
132
128
  }, [h]), i("div", {
133
129
  class: "k-window-titlebar-actions"
134
- }, [s === a.DEFAULT && z, s === a.DEFAULT && S, s !== a.DEFAULT && R, D])]);
130
+ }, [a === s.DEFAULT && C, a === s.DEFAULT && S, a !== s.DEFAULT && R, I])]);
135
131
  }
136
132
  });
137
133
  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",size:"xsmall","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.3",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,themeColor:{type:String,validator:function(e){return["primary","dark","light"].includes(e)}},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,themeColor:t}=this.$props;return{"k-window":!0,"k-dialog":!0,[e]:e,[`k-window-${t}`]:t}}},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",size:"xsmall",onClick:this.onMinimizeClick,"aria-label":k.toLanguageString(p,w[p])},null),L=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:S}),$=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window",svgIcon:o.windowIcon,fillMode:"flat",size:"xsmall",onClick:this.onFullScreenClick,"aria-label":k.toLanguageString(c,w[c])},null),I=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:$}),b=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:o.windowRestoreIcon,fillMode:"flat",size:"xsmall",onClick:this.onRestoreClick,"aria-label":k.toLanguageString(u,w[u])},null),y=i.getTemplate.call(this,{h:t.h,template:f,defaultRendering:b}),E=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:o.xIcon,fillMode:"flat",size:"xsmall",onClick:this.onCloseClick,"aria-label":k.toLanguageString(g,w[g])},null),D=i.getTemplate.call(this,{h:t.h,template:v,defaultRendering:E});return t.createVNode("div",{class:"k-window-titlebar",style:{touchAction:"none"},onDblclick:this.onDoubleClick},[t.createVNode("span",{class:"k-window-title",id:this.$props.titleId},[C]),t.createVNode("div",{class:"k-window-titlebar-actions"},[r===h.DEFAULT&&L,r===h.DEFAULT&&I,r!==h.DEFAULT&&y,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)}},themeColor:{type:String,validator:function(e){return[void 0,"primary","dark","light"].includes(e)}},dir:String},created(){i.validatePackage(a),this.showLicenseWatermark=i.shouldShowValidationUI(a),this.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,themeColor:t}=this.$props;return{"k-window":!0,[e]:e,[`k-window-${t}`]:t,"k-window-minimized":"MINIMIZED"===this.currentStage}},computedTop(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.top||this.currentTop,0):0},computedLeft(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.left||this.currentLeft,0):0},computedWidth(){let e=this.$props.width||this.currentWidth;return this.windowStage===h.FULLSCREEN&&(e=window.innerWidth),e},computedHeight(){let e=this.$props.height||this.currentHeight;return this.windowStage===h.FULLSCREEN?e=window.innerHeight:this.windowStage===h.MINIMIZED&&(e=0),e},windowStage(){return this.$props.stage||this.currentStage}},methods:{onPress(e){const t=e;this.windowCoordinatesState.differenceLeft=t.pageX-this.computedLeft,this.windowCoordinatesState.differenceTop=t.pageY-this.computedTop},onDrag(e){const t=e;t.originalEvent.preventDefault(),this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&(this.currentTop=Math.max(t.pageY-this.windowCoordinatesState.differenceTop,0),this.currentLeft=t.pageX-this.windowCoordinatesState.differenceLeft,this.isDragging=!0,this.dispatchMoveEvent("move",t,!0,!1))},onRelease(e){const t=e;this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&this.dispatchMoveEvent("move",t,!0,!0),this.isDragging=!1},handleKeyDown(e){if(e.target!==e.currentTarget)return;const t=this.$props.minWidth||120,n=this.$props.minHeight||100;if(e.ctrlKey&&this.$props.resizable){switch(e.keyCode){case i.Keys.up:e.preventDefault(),n<=this.computedHeight-5&&(this.currentHeight=this.currentHeight-5);break;case i.Keys.down:e.preventDefault(),this.currentHeight=this.currentHeight+5;break;case i.Keys.left:t<=this.computedWidth-5&&(this.currentWidth=this.currentWidth-5);break;case i.Keys.right:this.currentWidth=this.currentWidth+5;break;default:return}this.dispatchMoveEvent("resize",e,!1,void 0)}else if(e.altKey)switch(e.keyCode){case i.Keys.up:this.windowStage===h.MINIMIZED?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleFullscreen(e),this.$emit("stagechange",e,this,{state:h.FULLSCREEN}));break;case i.Keys.down:this.windowStage===h.FULLSCREEN?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleMinimize(e),this.$emit("stagechange",e,this,{state:h.MINIMIZED}))}else{if(!e.ctrlKey)switch(e.keyCode){case i.Keys.esc:return void this.handleCloseWindow(e);case i.Keys.up:e.preventDefault(),this.currentTop=this.currentTop-5;break;case i.Keys.down:e.preventDefault(),this.currentTop=this.currentTop+5;break;case i.Keys.left:e.preventDefault(),this.currentLeft=this.currentLeft-5;break;case i.Keys.right:e.preventDefault(),this.currentLeft=this.currentLeft+5;break;default:return}this.dispatchMoveEvent("move",e,!1,void 0)}},getInitialTop(){if(void 0!==this.$props.top)return this.$props.top;if(void 0!==this.$props.initialTop)return this.$props.initialTop;let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),window.innerHeight/2-e/2},getInitialLeft(){if(void 0!==this.$props.left)return this.$props.left;if(void 0!==this.$props.initialLeft)return this.$props.initialLeft;let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),window.innerWidth/2-e/2},getInitialWidth(){let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),e},getInitialHeight(){let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),e},handleMinimize(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentStage=h.MINIMIZED,this.currentHeight=0,this.$emit("stagechange",e,this,{state:h.MINIMIZED})},handleFullscreen(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentLeft=0,this.currentTop=0,this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight,this.currentStage=h.FULLSCREEN,this.$emit("stagechange",e,this,{state:h.FULLSCREEN})},handleRestore(e){e.preventDefault(),this.windowStage===h.FULLSCREEN?(this.currentStage=h.DEFAULT,this.currentLeft=this.windowCoordinatesState.leftBeforeAction,this.currentTop=this.windowCoordinatesState.topBeforeAction,this.currentWidth=this.windowCoordinatesState.widthBeforeAction,this.currentHeight=this.windowCoordinatesState.heightBeforeAction):this.windowStage===h.MINIMIZED&&(this.currentStage=h.DEFAULT,this.currentHeight=this.windowCoordinatesState.heightBeforeAction),this.$emit("stagechange",e,this,{state:h.DEFAULT})},handleCloseWindow(e){e.preventDefault(),this.$emit("close",e,this,{state:void 0})},handleDoubleClick(e){this.$props.doubleClickStageChange&&(this.windowStage===h.FULLSCREEN||this.windowStage===h.MINIMIZED?this.handleRestore(e):this.handleFullscreen(e))},handleResize(e,t){const i=this.computedWidth,n=this.computedHeight,o=this.$props.minWidth||120,s=this.$props.minHeight||100,r=this.computedTop-e.pageY,a=this.computedLeft-e.pageX,l=e.pageX-this.computedLeft,d=e.pageY-this.computedTop;this.isDragging=!t.end,t.direction.indexOf("n")>=0&&s-(n+r)<0&&(this.currentTop=e.pageY,this.currentHeight=n+r),t.direction.indexOf("s")>=0&&s-d<0&&(this.currentHeight=d),t.direction.indexOf("w")>=0&&o-(i+a)<0&&(this.currentLeft=e.pageX,this.currentWidth=i+a),t.direction.indexOf("e")>=0&&o-l<0&&(this.currentWidth=l),this.dispatchMoveEvent("resize",e,!0,t.end)},dispatchMoveEvent(e,t,i,n){this.$emit(e,{event:t.event,drag:i,end:n,target:this,left:this.currentLeft,top:this.currentTop,width:this.currentWidth,height:this.currentHeight})},handleBrowserWindowResize(){this.windowStage===h.FULLSCREEN&&(this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight)},handleClick(e){this.$emit("overlayclick",e)},getActionBarIndex:e=>e.findIndex(e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar")),generateTitleId:()=>"window-title-"+i.guid()},render(){const e=i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)),n=i.templateRendering.call(this,this.$props.closeButton,i.getListeners.call(this)),o=i.templateRendering.call(this,this.$props.minimizeButton,i.getListeners.call(this)),s=i.templateRendering.call(this,this.$props.maximizeButton,i.getListeners.call(this)),r=i.templateRendering.call(this,this.$props.restoreButton,i.getListeners.call(this)),a=i.getDefaultSlots(this),l=a||[],d=this.getActionBarIndex(l);let c;-1!==d&&(c=l[d],l.splice(d,1));const p=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,{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:"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});
@@ -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: 1779097376,version:"8.4.0-develop.3",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: 1779123005,version:"8.4.0-develop.4",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: 1779097376,
14
- version: "8.4.0-develop.3",
13
+ publishDate: 1779123005,
14
+ version: "8.4.0-develop.4",
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.3",
3
+ "version": "8.4.0-develop.4",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -25,10 +25,10 @@
25
25
  "sideEffects": false,
26
26
  "peerDependencies": {
27
27
  "@progress/kendo-licensing": "^1.7.2",
28
- "@progress/kendo-vue-buttons": "8.4.0-develop.3",
29
- "@progress/kendo-vue-common": "8.4.0-develop.3",
30
- "@progress/kendo-vue-intl": "8.4.0-develop.3",
31
- "@progress/kendo-svg-icons": "^4.4.0",
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",
31
+ "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
32
32
  "vue": "^3.0.2"
33
33
  },
34
34
  "dependencies": {},
@@ -48,7 +48,7 @@
48
48
  "package": {
49
49
  "productName": "Kendo UI for Vue",
50
50
  "productCode": "KENDOUIVUE",
51
- "publishDate": 1779097376,
51
+ "publishDate": 1779123005,
52
52
  "licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/"
53
53
  }
54
54
  },
@@ -58,5 +58,10 @@
58
58
  "repository": {
59
59
  "type": "git",
60
60
  "url": "git+https://github.com/telerik/kendo-vue.git"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "@progress/kendo-svg-icons": {
64
+ "optional": true
65
+ }
61
66
  }
62
67
  }