@progress/kendo-vue-dialogs 8.4.0-develop.2 → 8.4.0-develop.3
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 +9 -0
- package/Dialog.js +1 -1
- package/Dialog.mjs +18 -15
- package/DialogTitleBar.js +1 -1
- package/DialogTitleBar.mjs +1 -0
- package/Window.d.ts +1 -1
- package/Window.js +1 -1
- package/Window.mjs +8 -9
- package/WindowTitlebar.js +1 -1
- package/WindowTitlebar.mjs +29 -25
- package/dist/cdn/js/kendo-vue-dialogs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
package/Dialog.d.ts
CHANGED
|
@@ -91,6 +91,10 @@ declare const Dialog: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
91
91
|
type: PropType<boolean>;
|
|
92
92
|
default: boolean;
|
|
93
93
|
};
|
|
94
|
+
modal: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
94
98
|
width: PropType<string | number>;
|
|
95
99
|
height: PropType<string | number>;
|
|
96
100
|
minWidth: PropType<string | number>;
|
|
@@ -137,6 +141,10 @@ declare const Dialog: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
137
141
|
type: PropType<boolean>;
|
|
138
142
|
default: boolean;
|
|
139
143
|
};
|
|
144
|
+
modal: {
|
|
145
|
+
type: BooleanConstructor;
|
|
146
|
+
default: boolean;
|
|
147
|
+
};
|
|
140
148
|
width: PropType<string | number>;
|
|
141
149
|
height: PropType<string | number>;
|
|
142
150
|
minWidth: PropType<string | number>;
|
|
@@ -152,6 +160,7 @@ declare const Dialog: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
152
160
|
onOverlayclick?: (...args: any[] | unknown[]) => any;
|
|
153
161
|
}>, {
|
|
154
162
|
closeIcon: boolean;
|
|
163
|
+
modal: boolean;
|
|
155
164
|
}, {}, {}, {}, string, () => {
|
|
156
165
|
kCurrentZIndex: number;
|
|
157
166
|
}, true, {}, 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
|
|
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;
|
package/Dialog.mjs
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as I, createVNode as i } from "vue";
|
|
9
9
|
import { DialogTitleBar as C } from "./DialogTitleBar.mjs";
|
|
10
|
-
import { templateRendering as
|
|
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";
|
|
11
11
|
import { packageMetadata as d } from "./package-metadata.mjs";
|
|
12
|
-
import { DEFAULT_DIALOGS_ZINDEX as
|
|
12
|
+
import { DEFAULT_DIALOGS_ZINDEX as W } from "./constants.mjs";
|
|
13
13
|
const K = /* @__PURE__ */ I({
|
|
14
14
|
name: "KendoDialog",
|
|
15
15
|
emits: {
|
|
@@ -27,6 +27,10 @@ const K = /* @__PURE__ */ I({
|
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: !0
|
|
29
29
|
},
|
|
30
|
+
modal: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
30
34
|
width: [String, Number],
|
|
31
35
|
height: [String, Number],
|
|
32
36
|
minWidth: [String, Number],
|
|
@@ -42,7 +46,7 @@ const K = /* @__PURE__ */ I({
|
|
|
42
46
|
},
|
|
43
47
|
provide() {
|
|
44
48
|
return {
|
|
45
|
-
kCurrentZIndex:
|
|
49
|
+
kCurrentZIndex: W
|
|
46
50
|
};
|
|
47
51
|
},
|
|
48
52
|
data() {
|
|
@@ -78,13 +82,12 @@ const K = /* @__PURE__ */ I({
|
|
|
78
82
|
}
|
|
79
83
|
},
|
|
80
84
|
mounted() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.windowElement = this.$refs.wrapper, e.append(this.windowElement);
|
|
84
|
-
}
|
|
85
|
+
const e = this.$props.appendTo ? document.querySelector(this.$props.appendTo) : document.body;
|
|
86
|
+
e && (this.windowElement = this.$el, e.appendChild(this.windowElement));
|
|
85
87
|
},
|
|
86
88
|
beforeUnmount() {
|
|
87
|
-
|
|
89
|
+
var e;
|
|
90
|
+
(e = this.windowElement) != null && e.parentNode && this.windowElement.remove();
|
|
88
91
|
},
|
|
89
92
|
methods: {
|
|
90
93
|
handleCloseDialog(e) {
|
|
@@ -119,11 +122,11 @@ const K = /* @__PURE__ */ I({
|
|
|
119
122
|
width: t,
|
|
120
123
|
height: s,
|
|
121
124
|
minWidth: r,
|
|
122
|
-
dir:
|
|
123
|
-
contentStyle:
|
|
125
|
+
dir: m,
|
|
126
|
+
contentStyle: g,
|
|
124
127
|
wrapperId: u
|
|
125
128
|
} = this.$props;
|
|
126
|
-
const a = this.$props.titleRender ?
|
|
129
|
+
const a = this.$props.titleRender ? y.call(this, this.$props.titleRender, k.call(this)) : null, o = S(this) || [];
|
|
127
130
|
t = this.transformDimesion(t), s = this.transformDimesion(s), r = this.transformDimesion(r);
|
|
128
131
|
const f = this.showLicenseWatermark ? i(D, {
|
|
129
132
|
message: this.licenseMessage
|
|
@@ -136,14 +139,14 @@ const K = /* @__PURE__ */ I({
|
|
|
136
139
|
onKeydown: this.handleKeyDown,
|
|
137
140
|
tabindex: 0,
|
|
138
141
|
id: u,
|
|
139
|
-
dir:
|
|
140
|
-
}, [i("div", {
|
|
142
|
+
dir: m
|
|
143
|
+
}, [this.$props.modal && i("div", {
|
|
141
144
|
class: "k-overlay",
|
|
142
145
|
onClick: this.handleClick
|
|
143
146
|
}, null), i("div", {
|
|
144
147
|
"aria-labelledby": n || a ? e : void 0,
|
|
145
148
|
"aria-describedby": this.contentId,
|
|
146
|
-
"aria-modal":
|
|
149
|
+
"aria-modal": this.$props.modal || void 0,
|
|
147
150
|
class: this.dialogElementClass,
|
|
148
151
|
role: "dialog",
|
|
149
152
|
style: {
|
|
@@ -159,7 +162,7 @@ const K = /* @__PURE__ */ I({
|
|
|
159
162
|
titleRender: a
|
|
160
163
|
}, null), i("div", {
|
|
161
164
|
class: "k-window-content k-dialog-content",
|
|
162
|
-
style:
|
|
165
|
+
style: g,
|
|
163
166
|
id: this.contentId
|
|
164
167
|
}, [o]), p, f])]);
|
|
165
168
|
return this.$props.appendTo ? i("div", null, [c]) : c;
|
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
|
|
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;
|
package/DialogTitleBar.mjs
CHANGED
package/Window.d.ts
CHANGED
|
@@ -208,9 +208,9 @@ declare const Window: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
208
208
|
left: number;
|
|
209
209
|
top: number;
|
|
210
210
|
minWidth: number;
|
|
211
|
+
modal: boolean;
|
|
211
212
|
minHeight: number;
|
|
212
213
|
resizable: boolean;
|
|
213
|
-
modal: boolean;
|
|
214
214
|
doubleClickStageChange: boolean;
|
|
215
215
|
}, {}, {}, {}, string, () => {
|
|
216
216
|
kCurrentZIndex: number;
|
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,D=o.defineComponent({name:"KendoWindow",emits:{resize:t=>!0,move:t=>!0,close:t=>!0,stagechange:t=>!0,overlayclick:null},provide(){return{kCurrentZIndex:C.DEFAULT_DIALOGS_ZINDEX}},props:{id:String,appendTo:String,width:{type:[Number],default:void 0},height:{type:[Number],default:void 0},left:{type:[Number],default:void 0},windowStyle:Object,windowClass:String,top:{type:[Number],default:void 0},initialWidth:[Number],initialHeight:[Number],initialLeft:[Number],initialTop:[Number],minWidth:{type:[Number],default:f},minHeight:{type:[Number],default:m},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},modal:{type:Boolean,default:!1},doubleClickStageChange:{type:Boolean,default:!0},title:String,titleRender:[String,Function],closeButton:[String,Function],minimizeButton:[String,Function],maximizeButton:[String,Function],restoreButton:[String,Function],shouldUpdateOnDrag:Boolean,stage:{type:String,validator:function(t){return["DEFAULT","MINIMIZED","FULLSCREEN"].indexOf(t)!==-1}},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(){this.$props.appendTo&&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(){if(window&&(window.addEventListener("resize",this.handleBrowserWindowResize),this.$props.appendTo)){const t=document.querySelector(this.$props.appendTo);this.windowWrapper=this.$refs.wrapper,t.append(this.windowWrapper)}this.$el&&(this.windowElement=this.$refs.windowElement)},unmounted(){window&&window.removeEventListener("resize",this.handleBrowserWindowResize)},computed:{wrapperClass(){return{"k-dialog-wrapper":this.$props.modal}},windowElementClass(){const{windowClass: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,p=this.$props.minWidth||f,l=this.$props.minHeight||m,h=this.computedTop-t.pageY,d=this.computedLeft-t.pageX,c=t.pageX-this.computedLeft,u=t.pageY-this.computedTop;this.isDragging=!n.end,n.direction.indexOf("n")>=0&&l-(a+h)<0&&(this.currentTop=t.pageY,this.currentHeight=a+h),n.direction.indexOf("s")>=0&&l-u<0&&(this.currentHeight=u),n.direction.indexOf("w")>=0&&p-(s+d)<0&&(this.currentLeft=t.pageX,this.currentWidth=s+d),n.direction.indexOf("e")>=0&&p-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)),p=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 u=this.showLicenseWatermark?o.createVNode(i.WatermarkOverlay,{message:this.licenseMessage},null):null,S=o.createVNode("div",{class:this.wrapperClass,ref:"wrapper",dir:this.$props.dir},[this.$props.modal&&o.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),o.createVNode("div",{tabindex:0,onFocus: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:p},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,u])]);return this.$props.appendTo?o.createVNode("div",null,[S]):S}});exports.Window=D;
|
|
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;
|
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
|
|
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";
|
|
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";
|
|
@@ -105,7 +105,8 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
|
|
|
105
105
|
}, this.titleId = this.generateTitleId();
|
|
106
106
|
},
|
|
107
107
|
beforeUnmount() {
|
|
108
|
-
|
|
108
|
+
var t;
|
|
109
|
+
(t = this.windowWrapper) != null && t.parentNode && this.windowWrapper.remove();
|
|
109
110
|
},
|
|
110
111
|
data() {
|
|
111
112
|
return {
|
|
@@ -121,11 +122,9 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
|
|
|
121
122
|
};
|
|
122
123
|
},
|
|
123
124
|
mounted() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
this.$el && (this.windowElement = this.$refs.windowElement);
|
|
125
|
+
window && window.addEventListener("resize", this.handleBrowserWindowResize);
|
|
126
|
+
const t = this.$props.appendTo ? document.querySelector(this.$props.appendTo) : document.body;
|
|
127
|
+
t && (this.windowWrapper = this.$el, t.appendChild(this.windowWrapper)), this.$el && (this.windowElement = this.$refs.windowElement);
|
|
129
128
|
},
|
|
130
129
|
unmounted() {
|
|
131
130
|
window && window.removeEventListener("resize", this.handleBrowserWindowResize);
|
|
@@ -321,10 +320,10 @@ const $ = 300, I = 300, L = 120, S = 100, r = 5, O = /* @__PURE__ */ C({
|
|
|
321
320
|
}
|
|
322
321
|
},
|
|
323
322
|
render() {
|
|
324
|
-
const t = c.call(this, this.$props.titleRender, u.call(this)), i = c.call(this, this.$props.closeButton, u.call(this)), n = c.call(this, this.$props.minimizeButton, u.call(this)), h = c.call(this, this.$props.maximizeButton, u.call(this)), g = c.call(this, this.$props.restoreButton, u.call(this)), l =
|
|
323
|
+
const t = c.call(this, this.$props.titleRender, u.call(this)), i = c.call(this, this.$props.closeButton, u.call(this)), n = c.call(this, this.$props.minimizeButton, u.call(this)), h = c.call(this, this.$props.maximizeButton, u.call(this)), g = c.call(this, this.$props.restoreButton, u.call(this)), l = W(this), a = l || [], d = this.getActionBarIndex(a);
|
|
325
324
|
let p;
|
|
326
325
|
d !== -1 && (p = a[d], a.splice(d, 1));
|
|
327
|
-
const f = this.showLicenseWatermark ? o(
|
|
326
|
+
const f = this.showLicenseWatermark ? o(T, {
|
|
328
327
|
message: this.licenseMessage
|
|
329
328
|
}, null) : null, E = o("div", {
|
|
330
329
|
class: this.wrapperClass,
|
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
|
|
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;
|
package/WindowTitlebar.mjs
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { getTemplate as
|
|
8
|
+
import { defineComponent as I, h as n, createVNode as i } from "vue";
|
|
9
|
+
import { getTemplate as e } from "@progress/kendo-vue-common";
|
|
10
10
|
import { Button as l } from "@progress/kendo-vue-buttons";
|
|
11
|
-
import { provideLocalizationService as
|
|
12
|
-
import { windowStage as
|
|
13
|
-
import { dialogsWindowMinimizeButton as r, messages as c, dialogsWindowMaximizeButton as u, dialogsWindowRestoreButton as
|
|
14
|
-
import { windowMinimizeIcon as
|
|
15
|
-
const K = /* @__PURE__ */
|
|
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({
|
|
16
16
|
name: "KendoWindowTitleBar",
|
|
17
17
|
props: {
|
|
18
18
|
id: String,
|
|
@@ -54,15 +54,15 @@ const K = /* @__PURE__ */ M({
|
|
|
54
54
|
},
|
|
55
55
|
render() {
|
|
56
56
|
const t = this.$props, {
|
|
57
|
-
stage:
|
|
57
|
+
stage: s,
|
|
58
58
|
title: g,
|
|
59
59
|
titleRender: w,
|
|
60
60
|
minimizeButton: k,
|
|
61
61
|
maximizeButton: p,
|
|
62
62
|
restoreButton: B,
|
|
63
63
|
closeButton: f
|
|
64
|
-
} = t,
|
|
65
|
-
let h =
|
|
64
|
+
} = t, o = M(this);
|
|
65
|
+
let h = e.call(this, {
|
|
66
66
|
h: n,
|
|
67
67
|
template: w,
|
|
68
68
|
defaultRendering: g
|
|
@@ -71,50 +71,54 @@ const K = /* @__PURE__ */ M({
|
|
|
71
71
|
type: "button",
|
|
72
72
|
class: "k-window-titlebar-action",
|
|
73
73
|
icon: "window-minimize",
|
|
74
|
-
svgIcon:
|
|
74
|
+
svgIcon: v,
|
|
75
75
|
fillMode: "flat",
|
|
76
|
+
size: "xsmall",
|
|
76
77
|
onClick: this.onMinimizeClick,
|
|
77
|
-
"aria-label":
|
|
78
|
-
}, null),
|
|
78
|
+
"aria-label": o.toLanguageString(r, c[r])
|
|
79
|
+
}, null), z = e.call(this, {
|
|
79
80
|
h: n,
|
|
80
81
|
template: k,
|
|
81
82
|
defaultRendering: b
|
|
82
|
-
}),
|
|
83
|
+
}), C = i(l, {
|
|
83
84
|
type: "button",
|
|
84
85
|
class: "k-window-titlebar-action",
|
|
85
86
|
icon: "window",
|
|
86
|
-
svgIcon:
|
|
87
|
+
svgIcon: L,
|
|
87
88
|
fillMode: "flat",
|
|
89
|
+
size: "xsmall",
|
|
88
90
|
onClick: this.onFullScreenClick,
|
|
89
|
-
"aria-label":
|
|
90
|
-
}, null), S =
|
|
91
|
+
"aria-label": o.toLanguageString(u, c[u])
|
|
92
|
+
}, null), S = e.call(this, {
|
|
91
93
|
h: n,
|
|
92
94
|
template: p,
|
|
93
|
-
defaultRendering:
|
|
95
|
+
defaultRendering: C
|
|
94
96
|
}), F = i(l, {
|
|
95
97
|
type: "button",
|
|
96
98
|
class: "k-window-titlebar-action",
|
|
97
99
|
icon: "window-restore",
|
|
98
100
|
svgIcon: $,
|
|
99
101
|
fillMode: "flat",
|
|
102
|
+
size: "xsmall",
|
|
100
103
|
onClick: this.onRestoreClick,
|
|
101
|
-
"aria-label":
|
|
102
|
-
}, null), R =
|
|
104
|
+
"aria-label": o.toLanguageString(m, c[m])
|
|
105
|
+
}, null), R = e.call(this, {
|
|
103
106
|
h: n,
|
|
104
107
|
template: B,
|
|
105
108
|
defaultRendering: F
|
|
106
|
-
}),
|
|
109
|
+
}), x = i(l, {
|
|
107
110
|
type: "button",
|
|
108
111
|
class: "k-window-titlebar-action",
|
|
109
112
|
icon: "x",
|
|
110
113
|
svgIcon: j,
|
|
111
114
|
fillMode: "flat",
|
|
115
|
+
size: "xsmall",
|
|
112
116
|
onClick: this.onCloseClick,
|
|
113
|
-
"aria-label":
|
|
114
|
-
}, null),
|
|
117
|
+
"aria-label": o.toLanguageString(d, c[d])
|
|
118
|
+
}, null), D = e.call(this, {
|
|
115
119
|
h: n,
|
|
116
120
|
template: f,
|
|
117
|
-
defaultRendering:
|
|
121
|
+
defaultRendering: x
|
|
118
122
|
});
|
|
119
123
|
return i("div", {
|
|
120
124
|
class: "k-window-titlebar",
|
|
@@ -127,7 +131,7 @@ const K = /* @__PURE__ */ M({
|
|
|
127
131
|
id: this.$props.titleId
|
|
128
132
|
}, [h]), i("div", {
|
|
129
133
|
class: "k-window-titlebar-actions"
|
|
130
|
-
}, [
|
|
134
|
+
}, [s === a.DEFAULT && z, s === a.DEFAULT && S, s !== a.DEFAULT && R, D])]);
|
|
131
135
|
}
|
|
132
136
|
});
|
|
133
137
|
export {
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueDialogs={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueIntl)}(this,function(e,t,i,n,o,s){"use strict";const r=t.defineComponent({props:{id:String,closeIcon:{type:Boolean,default:!0},title:String,titleRender:[String,Function,Object],onClosebuttonclick:Function},methods:{onCloseButtonClick(e){this.$emit("closebuttonclick",e)}},render(){let e,{id:s,closeIcon:r,titleRender:a,title:l}=this.$props;return e=i.getTemplate.call(this,{h:t.h,template:a,defaultRendering:l}),t.createVNode("div",{class:"k-window-titlebar k-dialog-titlebar",id:s},[t.createVNode("span",{class:"k-window-title k-dialog-title"},[e]),t.createVNode("div",{class:"k-window-titlebar-actions k-dialog-titlebar-actions"},[r&&t.createVNode(n.Button,{type:"button",fillMode:"flat","aria-label":"Close",icon:"x",svgIcon:o.xIcon,onClick:this.onCloseButtonClick,class:"k-window-titlebar-action k-dialog-titlebar-action"},null)])])}}),a={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"8.4.0-develop.2",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},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(){if(this.$props.appendTo){const e=document.querySelector(this.$props.appendTo);this.windowElement=this.$refs.wrapper,e.append(this.windowElement)}},beforeUnmount(){this.$props.appendTo&&this.windowElement.remove()},methods:{handleCloseDialog(e){e.preventDefault(),this.$emit("close",{event:e,target:this})},handleKeyDown(e){e.keyCode===i.Keys.esc&&i.hasListener.call(this,"close")&&(e.preventDefault(),this.handleCloseDialog(e))},transformDimesion:e=>"string"==typeof e&&(e.endsWith("px")||e.endsWith("%"))?e:e+"px",getActionBarIndex:e=>e.findIndex(e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar")),generateTitleId:()=>"dialog-title"+i.guid(),generateContentId:()=>"dialog-content"+i.guid(),handleClick(e){this.$emit("overlayclick",e)}},render(){const e=void 0!==this.$props.id?this.$props.id:this.titleId;let{title:n,width:o,height:s,minWidth:a,dir:l,contentStyle:d,wrapperId:h}=this.$props;const c=this.$props.titleRender?i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)):null,p=i.getDefaultSlots(this)||[];o=this.transformDimesion(o),s=this.transformDimesion(s),a=this.transformDimesion(a);const u=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,{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},[t.createVNode("div",{class:"k-overlay",onClick:this.handleClick},null),t.createVNode("div",{"aria-labelledby":n||c?e:void 0,"aria-describedby":this.contentId,"aria-modal":!0,class:this.dialogElementClass,role:"dialog",style:{width:o,height:s,minWidth:a}},[(n||c)&&t.createVNode(r,{closeIcon:m,onClosebuttonclick:this.handleCloseDialog,id:e,title:n,titleRender:c},null),t.createVNode("div",{class:"k-window-content k-dialog-content",style:d,id:this.contentId},[p]),w,u])]);return this.$props.appendTo?t.createVNode("div",null,[f]):f}}),d=t.defineComponent({name:"DialogActionsBar",props:{layout:{type:String,default:"stretched",validator:function(e){return["stretched","start","center","end"].includes(e)}},orientation:{type:String,default:"horizontal",validator:function(e){return["horizontal","vertical"].includes(e)}}},computed:{wrapperClasses(){const{layout:e,orientation:t}=this.$props;return{"k-actions":!0,"k-dialog-actions":!0,"k-window-actions":!0,[`k-actions-${t}`]:t,[`k-actions-${e}`]:e}}},render(){const e=i.getDefaultSlots(this);return t.createVNode("div",{class:this.wrapperClasses},[e])}});var h=(e=>(e.DEFAULT="DEFAULT",e.FULLSCREEN="FULLSCREEN",e.MINIMIZED="MINIMIZED",e))(h||{});const c="dialogs.windowMaximizeButton",p="dialogs.windowMinimizeButton",u="dialogs.windowRestoreButton",g="dialogs.windowCloseButton",w={[c]:"maximize",[p]:"minimize",[u]:"restore",[g]:"close"},m=t.defineComponent({name:"KendoWindowTitleBar",props:{id:String,stage:String,closeButton:[String,Function,Object,Boolean],minimizeButton:[String,Function,Object,Boolean],maximizeButton:[String,Function,Object,Boolean],restoreButton:[String,Function,Object,Boolean],title:String,titleId:String,titleRender:[String,Function,Object,Boolean],onDoubleclick:Function,onMinimizeclick:Function,onFullscreenclick:Function,onRestoreclick:Function,onCloseclick:Function},inject:{kendoLocalizationService:{default:null}},methods:{onDoubleClick(e){this.$emit("doubleclick",e)},onMinimizeClick(e){this.$emit("minimizeclick",e)},onFullScreenClick(e){this.$emit("fullscreenclick",e)},onRestoreClick(e){this.$emit("restoreclick",e)},onCloseClick(e){this.$emit("closeclick",e)}},render(){const e=this.$props,{stage:r,title:a,titleRender:l,minimizeButton:d,maximizeButton:m,restoreButton:f,closeButton:k}=e,v=s.provideLocalizationService(this);let C=i.getTemplate.call(this,{h:t.h,template:l,defaultRendering:a});const S=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-minimize",svgIcon:o.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":v.toLanguageString(p,w[p])},null),L=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:S}),$=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window",svgIcon:o.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":v.toLanguageString(c,w[c])},null),I=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:$}),b=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:o.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":v.toLanguageString(u,w[u])},null),y=i.getTemplate.call(this,{h:t.h,template:f,defaultRendering:b}),D=t.createVNode(n.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:o.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":v.toLanguageString(g,w[g])},null),E=i.getTemplate.call(this,{h:t.h,template:k,defaultRendering:D});return t.createVNode("div",{class:"k-window-titlebar",style:{touchAction:"none"},onDblclick:this.onDoubleClick},[t.createVNode("span",{class:"k-window-title",id:this.$props.titleId},[C]),t.createVNode("div",{class:"k-window-titlebar-actions"},[r===h.DEFAULT&&L,r===h.DEFAULT&&I,r!==h.DEFAULT&&y,E])])}}),f=["n","e","s","w","se","sw","ne","nw"],k=t.defineComponent({name:"ResizeHandlers",emits:{resize:null},methods:{onDrag(e,t){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!1,direction:t})},onRelease(e,t){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!0,direction:t})}},render(){return t.createVNode("div",null,[f.map(function(e,n){return t.createVNode(i.Draggable,{key:n,onDrag:t=>this.onDrag(t,e),onRelease:t=>this.onRelease(t,e)},{default:()=>[t.createVNode("div",{class:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none"}},null)]})},this)])}}),v=t.defineComponent({name:"KendoWindow",emits:{resize: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(){this.$props.appendTo&&this.windowWrapper.remove()},data(){return{currentStage:this.$props.stage||h.DEFAULT,isDragging:!1,currentTop:this.getInitialTop(),currentLeft:this.getInitialLeft(),currentWidth:this.getInitialWidth(),currentHeight:this.getInitialHeight(),titleId:void 0,showLicenseWatermark:!1,licenseMessage:void 0}},mounted(){if(window&&(window.addEventListener("resize",this.handleBrowserWindowResize),this.$props.appendTo)){const e=document.querySelector(this.$props.appendTo);this.windowWrapper=this.$refs.wrapper,e.append(this.windowWrapper)}this.$el&&(this.windowElement=this.$refs.windowElement)},unmounted(){window&&window.removeEventListener("resize",this.handleBrowserWindowResize)},computed:{wrapperClass(){return{"k-dialog-wrapper":this.$props.modal}},windowElementClass(){const{windowClass:e,themeColor:t}=this.$props;return{"k-window":!0,[e]:e,[`k-window-${t}`]:t,"k-window-minimized":"MINIMIZED"===this.currentStage}},computedTop(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.top||this.currentTop,0):0},computedLeft(){return this.windowStage!==h.FULLSCREEN?Math.max(this.$props.left||this.currentLeft,0):0},computedWidth(){let e=this.$props.width||this.currentWidth;return this.windowStage===h.FULLSCREEN&&(e=window.innerWidth),e},computedHeight(){let e=this.$props.height||this.currentHeight;return this.windowStage===h.FULLSCREEN?e=window.innerHeight:this.windowStage===h.MINIMIZED&&(e=0),e},windowStage(){return this.$props.stage||this.currentStage}},methods:{onPress(e){const t=e;this.windowCoordinatesState.differenceLeft=t.pageX-this.computedLeft,this.windowCoordinatesState.differenceTop=t.pageY-this.computedTop},onDrag(e){const t=e;t.originalEvent.preventDefault(),this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&(this.currentTop=Math.max(t.pageY-this.windowCoordinatesState.differenceTop,0),this.currentLeft=t.pageX-this.windowCoordinatesState.differenceLeft,this.isDragging=!0,this.dispatchMoveEvent("move",t,!0,!1))},onRelease(e){const t=e;this.windowStage!==h.FULLSCREEN&&this.$props.draggable&&this.dispatchMoveEvent("move",t,!0,!0),this.isDragging=!1},handleKeyDown(e){if(e.target!==e.currentTarget)return;const t=this.$props.minWidth||120,n=this.$props.minHeight||100;if(e.ctrlKey&&this.$props.resizable){switch(e.keyCode){case i.Keys.up:e.preventDefault(),n<=this.computedHeight-5&&(this.currentHeight=this.currentHeight-5);break;case i.Keys.down:e.preventDefault(),this.currentHeight=this.currentHeight+5;break;case i.Keys.left:t<=this.computedWidth-5&&(this.currentWidth=this.currentWidth-5);break;case i.Keys.right:this.currentWidth=this.currentWidth+5;break;default:return}this.dispatchMoveEvent("resize",e,!1,void 0)}else if(e.altKey)switch(e.keyCode){case i.Keys.up:this.windowStage===h.MINIMIZED?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleFullscreen(e),this.$emit("stagechange",e,this,{state:h.FULLSCREEN}));break;case i.Keys.down:this.windowStage===h.FULLSCREEN?(this.handleRestore(e),this.$emit("stagechange",e,this,{state:h.DEFAULT})):this.windowStage===h.DEFAULT&&(this.handleMinimize(e),this.$emit("stagechange",e,this,{state:h.MINIMIZED}))}else{if(!e.ctrlKey)switch(e.keyCode){case i.Keys.esc:return void this.handleCloseWindow(e);case i.Keys.up:e.preventDefault(),this.currentTop=this.currentTop-5;break;case i.Keys.down:e.preventDefault(),this.currentTop=this.currentTop+5;break;case i.Keys.left:e.preventDefault(),this.currentLeft=this.currentLeft-5;break;case i.Keys.right:e.preventDefault(),this.currentLeft=this.currentLeft+5;break;default:return}this.dispatchMoveEvent("move",e,!1,void 0)}},getInitialTop(){if(void 0!==this.$props.top)return this.$props.top;if(void 0!==this.$props.initialTop)return this.$props.initialTop;let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),window.innerHeight/2-e/2},getInitialLeft(){if(void 0!==this.$props.left)return this.$props.left;if(void 0!==this.$props.initialLeft)return this.$props.initialLeft;let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),window.innerWidth/2-e/2},getInitialWidth(){let e=300;return void 0!==this.$props.width?e=this.$props.width:void 0!==this.$props.initialWidth&&(e=this.$props.initialWidth),e},getInitialHeight(){let e=300;return void 0!==this.$props.height?e=this.$props.height:void 0!==this.$props.initialHeight&&(e=this.$props.initialHeight),e},handleMinimize(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentStage=h.MINIMIZED,this.currentHeight=0,this.$emit("stagechange",e,this,{state:h.MINIMIZED})},handleFullscreen(e){e.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.computedLeft,this.windowCoordinatesState.topBeforeAction=this.computedTop,this.windowCoordinatesState.widthBeforeAction=this.computedWidth,this.windowCoordinatesState.heightBeforeAction=this.computedHeight,this.currentLeft=0,this.currentTop=0,this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight,this.currentStage=h.FULLSCREEN,this.$emit("stagechange",e,this,{state:h.FULLSCREEN})},handleRestore(e){e.preventDefault(),this.windowStage===h.FULLSCREEN?(this.currentStage=h.DEFAULT,this.currentLeft=this.windowCoordinatesState.leftBeforeAction,this.currentTop=this.windowCoordinatesState.topBeforeAction,this.currentWidth=this.windowCoordinatesState.widthBeforeAction,this.currentHeight=this.windowCoordinatesState.heightBeforeAction):this.windowStage===h.MINIMIZED&&(this.currentStage=h.DEFAULT,this.currentHeight=this.windowCoordinatesState.heightBeforeAction),this.$emit("stagechange",e,this,{state:h.DEFAULT})},handleCloseWindow(e){e.preventDefault(),this.$emit("close",e,this,{state:void 0})},handleDoubleClick(e){this.$props.doubleClickStageChange&&(this.windowStage===h.FULLSCREEN||this.windowStage===h.MINIMIZED?this.handleRestore(e):this.handleFullscreen(e))},handleResize(e,t){const i=this.computedWidth,n=this.computedHeight,o=this.$props.minWidth||120,s=this.$props.minHeight||100,r=this.computedTop-e.pageY,a=this.computedLeft-e.pageX,l=e.pageX-this.computedLeft,d=e.pageY-this.computedTop;this.isDragging=!t.end,t.direction.indexOf("n")>=0&&s-(n+r)<0&&(this.currentTop=e.pageY,this.currentHeight=n+r),t.direction.indexOf("s")>=0&&s-d<0&&(this.currentHeight=d),t.direction.indexOf("w")>=0&&o-(i+a)<0&&(this.currentLeft=e.pageX,this.currentWidth=i+a),t.direction.indexOf("e")>=0&&o-l<0&&(this.currentWidth=l),this.dispatchMoveEvent("resize",e,!0,t.end)},dispatchMoveEvent(e,t,i,n){this.$emit(e,{event:t.event,drag:i,end:n,target:this,left:this.currentLeft,top:this.currentTop,width:this.currentWidth,height:this.currentHeight})},handleBrowserWindowResize(){this.windowStage===h.FULLSCREEN&&(this.currentWidth=window.innerWidth,this.currentHeight=window.innerHeight)},handleClick(e){this.$emit("overlayclick",e)},getActionBarIndex:e=>e.findIndex(e=>e&&e.tag&&-1!==e.tag.toLowerCase().indexOf("dialogactionsbar")||e.componentOptions&&e.componentOptions.tag&&-1!==e.componentOptions.tag.toLowerCase().indexOf("actions-bar")||e.type&&e.type.name&&-1!==e.type.name.toLowerCase().indexOf("dialogactionsbar")),generateTitleId:()=>"window-title-"+i.guid()},render(){const e=i.templateRendering.call(this,this.$props.titleRender,i.getListeners.call(this)),n=i.templateRendering.call(this,this.$props.closeButton,i.getListeners.call(this)),o=i.templateRendering.call(this,this.$props.minimizeButton,i.getListeners.call(this)),s=i.templateRendering.call(this,this.$props.maximizeButton,i.getListeners.call(this)),r=i.templateRendering.call(this,this.$props.restoreButton,i.getListeners.call(this)),a=i.getDefaultSlots(this),l=a||[],d=this.getActionBarIndex(l);let c;-1!==d&&(c=l[d],l.splice(d,1));const p=this.showLicenseWatermark?t.createVNode(i.WatermarkOverlay,{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(k,{onResize:this.handleResize},null):null,p])]);return this.$props.appendTo?t.createVNode("div",null,[u]):u}});e.Dialog=l,e.DialogActionsBar=d,e.Window=v});
|
|
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});
|
package/package-metadata.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={name:"@progress/kendo-vue-dialogs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
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;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "8.4.0-develop.
|
|
13
|
+
publishDate: 1779097376,
|
|
14
|
+
version: "8.4.0-develop.3",
|
|
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
|
+
"version": "8.4.0-develop.3",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@progress/kendo-licensing": "^1.7.2",
|
|
28
|
-
"@progress/kendo-vue-buttons": "8.4.0-develop.
|
|
29
|
-
"@progress/kendo-vue-common": "8.4.0-develop.
|
|
30
|
-
"@progress/kendo-vue-intl": "8.4.0-develop.
|
|
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
31
|
"@progress/kendo-svg-icons": "^4.4.0",
|
|
32
32
|
"vue": "^3.0.2"
|
|
33
33
|
},
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"package": {
|
|
49
49
|
"productName": "Kendo UI for Vue",
|
|
50
50
|
"productCode": "KENDOUIVUE",
|
|
51
|
-
"publishDate":
|
|
51
|
+
"publishDate": 1779097376,
|
|
52
52
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/"
|
|
53
53
|
}
|
|
54
54
|
},
|