@progress/kendo-vue-dialogs 5.3.0-dev.202410141143 → 5.3.0-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dialog.js +8 -0
- package/Dialog.mjs +157 -0
- package/DialogActionsBar.js +8 -0
- package/DialogActionsBar.mjs +52 -0
- package/DialogTitleBar.js +8 -0
- package/DialogTitleBar.mjs +59 -0
- package/README.md +27 -36
- package/StageEnum.js +8 -0
- package/StageEnum.mjs +11 -0
- package/Window.js +8 -0
- package/Window.mjs +381 -0
- package/WindowResizeHandlers.js +8 -0
- package/WindowResizeHandlers.mjs +49 -0
- package/WindowTitlebar.js +8 -0
- package/WindowTitlebar.mjs +135 -0
- package/constants.js +8 -0
- package/constants.mjs +11 -0
- package/dist/cdn/js/kendo-vue-dialogs.js +8 -1
- package/index.d.mts +595 -0
- package/index.d.ts +595 -0
- package/index.js +8 -0
- package/index.mjs +15 -0
- package/messages/main.js +8 -0
- package/messages/main.mjs +20 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +18 -0
- package/package.json +22 -39
- package/dist/es/Dialog.d.ts +0 -109
- package/dist/es/Dialog.js +0 -225
- package/dist/es/DialogActionsBar.d.ts +0 -50
- package/dist/es/DialogActionsBar.js +0 -61
- package/dist/es/DialogTitleBar.d.ts +0 -46
- package/dist/es/DialogTitleBar.js +0 -85
- package/dist/es/StageEnum.d.ts +0 -5
- package/dist/es/StageEnum.js +0 -6
- package/dist/es/Window.d.ts +0 -75
- package/dist/es/Window.js +0 -663
- package/dist/es/WindowProps.d.ts +0 -138
- package/dist/es/WindowProps.js +0 -2
- package/dist/es/WindowResizeHandlers.d.ts +0 -30
- package/dist/es/WindowResizeHandlers.js +0 -89
- package/dist/es/WindowTitlebar.d.ts +0 -86
- package/dist/es/WindowTitlebar.js +0 -202
- package/dist/es/additionalTypes.ts +0 -21
- package/dist/es/constants.d.ts +0 -2
- package/dist/es/constants.js +0 -2
- package/dist/es/events.d.ts +0 -34
- package/dist/es/events.js +0 -2
- package/dist/es/main.d.ts +0 -6
- package/dist/es/main.js +0 -4
- package/dist/es/messages/main.d.ts +0 -25
- package/dist/es/messages/main.js +0 -26
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/esm/Dialog.d.ts +0 -109
- package/dist/esm/Dialog.js +0 -225
- package/dist/esm/DialogActionsBar.d.ts +0 -50
- package/dist/esm/DialogActionsBar.js +0 -61
- package/dist/esm/DialogTitleBar.d.ts +0 -46
- package/dist/esm/DialogTitleBar.js +0 -85
- package/dist/esm/StageEnum.d.ts +0 -5
- package/dist/esm/StageEnum.js +0 -6
- package/dist/esm/Window.d.ts +0 -75
- package/dist/esm/Window.js +0 -663
- package/dist/esm/WindowProps.d.ts +0 -138
- package/dist/esm/WindowProps.js +0 -2
- package/dist/esm/WindowResizeHandlers.d.ts +0 -30
- package/dist/esm/WindowResizeHandlers.js +0 -89
- package/dist/esm/WindowTitlebar.d.ts +0 -86
- package/dist/esm/WindowTitlebar.js +0 -202
- package/dist/esm/additionalTypes.ts +0 -21
- package/dist/esm/constants.d.ts +0 -2
- package/dist/esm/constants.js +0 -2
- package/dist/esm/events.d.ts +0 -34
- package/dist/esm/events.js +0 -2
- package/dist/esm/main.d.ts +0 -6
- package/dist/esm/main.js +0 -4
- package/dist/esm/messages/main.d.ts +0 -25
- package/dist/esm/messages/main.js +0 -26
- package/dist/esm/package-metadata.d.ts +0 -5
- package/dist/esm/package-metadata.js +0 -11
- package/dist/esm/package.json +0 -3
- package/dist/npm/Dialog.d.ts +0 -109
- package/dist/npm/Dialog.js +0 -232
- package/dist/npm/DialogActionsBar.d.ts +0 -50
- package/dist/npm/DialogActionsBar.js +0 -68
- package/dist/npm/DialogTitleBar.d.ts +0 -46
- package/dist/npm/DialogTitleBar.js +0 -92
- package/dist/npm/StageEnum.d.ts +0 -5
- package/dist/npm/StageEnum.js +0 -9
- package/dist/npm/Window.d.ts +0 -75
- package/dist/npm/Window.js +0 -670
- package/dist/npm/WindowProps.d.ts +0 -138
- package/dist/npm/WindowProps.js +0 -6
- package/dist/npm/WindowResizeHandlers.d.ts +0 -30
- package/dist/npm/WindowResizeHandlers.js +0 -96
- package/dist/npm/WindowTitlebar.d.ts +0 -86
- package/dist/npm/WindowTitlebar.js +0 -209
- package/dist/npm/additionalTypes.ts +0 -21
- package/dist/npm/constants.d.ts +0 -2
- package/dist/npm/constants.js +0 -5
- package/dist/npm/events.d.ts +0 -34
- package/dist/npm/events.js +0 -3
- package/dist/npm/main.d.ts +0 -6
- package/dist/npm/main.js +0 -12
- package/dist/npm/messages/main.d.ts +0 -25
- package/dist/npm/messages/main.js +0 -29
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
package/Window.mjs
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent as C, createVNode as o } from "vue";
|
|
9
|
+
import { WindowTitleBar as D } from "./WindowTitlebar.mjs";
|
|
10
|
+
import { validatePackage as T, shouldShowValidationUI as W, Keys as s, guid as B, templateRendering as c, getListeners as u, getDefaultSlots as H, WatermarkOverlay as k, Draggable as b } from "@progress/kendo-vue-common";
|
|
11
|
+
import { ResizeHandlers as F } from "./WindowResizeHandlers.mjs";
|
|
12
|
+
import { windowStage as e } from "./StageEnum.mjs";
|
|
13
|
+
import { packageMetadata as E } from "./package-metadata.mjs";
|
|
14
|
+
import { DEFAULT_DIALOGS_ZINDEX as N } from "./constants.mjs";
|
|
15
|
+
const $ = 300, I = 300, m = 120, L = 100, r = 5, O = /* @__PURE__ */ C({
|
|
16
|
+
name: "KendoWindow",
|
|
17
|
+
emits: {
|
|
18
|
+
resize: null,
|
|
19
|
+
move: null,
|
|
20
|
+
close: null,
|
|
21
|
+
stagechange: null,
|
|
22
|
+
overlayclick: null
|
|
23
|
+
},
|
|
24
|
+
provide() {
|
|
25
|
+
return {
|
|
26
|
+
kCurrentZIndex: N
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
id: String,
|
|
31
|
+
appendTo: String,
|
|
32
|
+
width: {
|
|
33
|
+
type: [Number],
|
|
34
|
+
default: void 0
|
|
35
|
+
},
|
|
36
|
+
height: {
|
|
37
|
+
type: [Number],
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
left: {
|
|
41
|
+
type: [Number],
|
|
42
|
+
default: void 0
|
|
43
|
+
},
|
|
44
|
+
windowStyle: Object,
|
|
45
|
+
windowClass: String,
|
|
46
|
+
top: {
|
|
47
|
+
type: [Number],
|
|
48
|
+
default: void 0
|
|
49
|
+
},
|
|
50
|
+
initialWidth: [Number],
|
|
51
|
+
initialHeight: [Number],
|
|
52
|
+
initialLeft: [Number],
|
|
53
|
+
initialTop: [Number],
|
|
54
|
+
minWidth: {
|
|
55
|
+
type: [Number],
|
|
56
|
+
default: m
|
|
57
|
+
},
|
|
58
|
+
minHeight: {
|
|
59
|
+
type: [Number],
|
|
60
|
+
default: L
|
|
61
|
+
},
|
|
62
|
+
resizable: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !0
|
|
65
|
+
},
|
|
66
|
+
draggable: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !0
|
|
69
|
+
},
|
|
70
|
+
modal: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !1
|
|
73
|
+
},
|
|
74
|
+
doubleClickStageChange: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !0
|
|
77
|
+
},
|
|
78
|
+
title: String,
|
|
79
|
+
titleRender: [String, Function],
|
|
80
|
+
closeButton: [String, Function],
|
|
81
|
+
minimizeButton: [String, Function],
|
|
82
|
+
maximizeButton: [String, Function],
|
|
83
|
+
restoreButton: [String, Function],
|
|
84
|
+
shouldUpdateOnDrag: Boolean,
|
|
85
|
+
stage: {
|
|
86
|
+
type: String,
|
|
87
|
+
validator: function(t) {
|
|
88
|
+
return ["DEFAULT", "MINIMIZED", "FULLSCREEN"].indexOf(t) !== -1;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
themeColor: {
|
|
92
|
+
type: String,
|
|
93
|
+
validator: function(t) {
|
|
94
|
+
return [void 0, "primary", "dark", "light"].includes(t);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
dir: String
|
|
98
|
+
},
|
|
99
|
+
created() {
|
|
100
|
+
T(E), this.showLicenseWatermark = W(E), this.windowCoordinatesState = {
|
|
101
|
+
leftBeforeAction: this.getInitialLeft(),
|
|
102
|
+
topBeforeAction: this.getInitialTop(),
|
|
103
|
+
widthBeforeAction: this.getInitialWidth(),
|
|
104
|
+
heightBeforeAction: this.getInitialHeight()
|
|
105
|
+
}, this.titleId = this.generateTitleId();
|
|
106
|
+
},
|
|
107
|
+
beforeUnmount() {
|
|
108
|
+
this.$props.appendTo && this.windowWrapper.remove();
|
|
109
|
+
},
|
|
110
|
+
data() {
|
|
111
|
+
return {
|
|
112
|
+
currentStage: this.$props.stage || e.DEFAULT,
|
|
113
|
+
isDragging: !1,
|
|
114
|
+
currentTop: this.getInitialTop(),
|
|
115
|
+
currentLeft: this.getInitialLeft(),
|
|
116
|
+
currentWidth: this.getInitialWidth(),
|
|
117
|
+
currentHeight: this.getInitialHeight(),
|
|
118
|
+
titleId: void 0,
|
|
119
|
+
showLicenseWatermark: !1
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
mounted() {
|
|
123
|
+
if (window && (window.addEventListener("resize", this.handleBrowserWindowResize), this.$props.appendTo)) {
|
|
124
|
+
const t = document.querySelector(this.$props.appendTo);
|
|
125
|
+
this.windowWrapper = this.$refs.wrapper, t.append(this.windowWrapper);
|
|
126
|
+
}
|
|
127
|
+
this.$el && (this.windowElement = this.$refs.windowElement);
|
|
128
|
+
},
|
|
129
|
+
unmounted() {
|
|
130
|
+
window && window.removeEventListener("resize", this.handleBrowserWindowResize);
|
|
131
|
+
},
|
|
132
|
+
computed: {
|
|
133
|
+
wrapperClass() {
|
|
134
|
+
return {
|
|
135
|
+
"k-dialog-wrapper": this.$props.modal
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
windowElementClass() {
|
|
139
|
+
const {
|
|
140
|
+
windowClass: t,
|
|
141
|
+
themeColor: i
|
|
142
|
+
} = this.$props;
|
|
143
|
+
return {
|
|
144
|
+
"k-window": !0,
|
|
145
|
+
[t]: t,
|
|
146
|
+
[`k-window-${i}`]: i,
|
|
147
|
+
"k-window-minimized": this.currentStage === "MINIMIZED"
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
computedTop() {
|
|
151
|
+
return this.windowStage !== e.FULLSCREEN ? Math.max(this.$props.top || this.currentTop, 0) : 0;
|
|
152
|
+
},
|
|
153
|
+
computedLeft() {
|
|
154
|
+
return this.windowStage !== e.FULLSCREEN ? Math.max(this.$props.left || this.currentLeft, 0) : 0;
|
|
155
|
+
},
|
|
156
|
+
computedWidth() {
|
|
157
|
+
let t = this.$props.width || this.currentWidth;
|
|
158
|
+
return this.windowStage === e.FULLSCREEN && (t = window.innerWidth), t;
|
|
159
|
+
},
|
|
160
|
+
computedHeight() {
|
|
161
|
+
let t = this.$props.height || this.currentHeight;
|
|
162
|
+
return this.windowStage === e.FULLSCREEN ? t = window.innerHeight : this.windowStage === e.MINIMIZED && (t = 0), t;
|
|
163
|
+
},
|
|
164
|
+
windowStage() {
|
|
165
|
+
return this.$props.stage || this.currentStage;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
methods: {
|
|
169
|
+
onPress(t) {
|
|
170
|
+
const i = t;
|
|
171
|
+
this.windowCoordinatesState.differenceLeft = i.pageX - this.computedLeft, this.windowCoordinatesState.differenceTop = i.pageY - this.computedTop;
|
|
172
|
+
},
|
|
173
|
+
onDrag(t) {
|
|
174
|
+
const i = t;
|
|
175
|
+
i.originalEvent.preventDefault(), this.windowStage !== e.FULLSCREEN && this.$props.draggable && (this.currentTop = Math.max(i.pageY - this.windowCoordinatesState.differenceTop, 0), this.currentLeft = i.pageX - this.windowCoordinatesState.differenceLeft, this.isDragging = !0, this.dispatchMoveEvent("move", i, !0, !1));
|
|
176
|
+
},
|
|
177
|
+
onRelease(t) {
|
|
178
|
+
const i = t;
|
|
179
|
+
this.windowStage !== e.FULLSCREEN && this.$props.draggable && this.dispatchMoveEvent("move", i, !0, !0), this.isDragging = !1;
|
|
180
|
+
},
|
|
181
|
+
handleKeyDown(t) {
|
|
182
|
+
if (t.target !== t.currentTarget)
|
|
183
|
+
return;
|
|
184
|
+
const i = this.$props.minWidth || m, n = this.$props.minHeight || L;
|
|
185
|
+
if (t.ctrlKey && this.$props.resizable) {
|
|
186
|
+
switch (t.keyCode) {
|
|
187
|
+
case s.up:
|
|
188
|
+
t.preventDefault(), n <= this.computedHeight - r && (this.currentHeight = this.currentHeight - r);
|
|
189
|
+
break;
|
|
190
|
+
case s.down:
|
|
191
|
+
t.preventDefault(), this.currentHeight = this.currentHeight + r;
|
|
192
|
+
break;
|
|
193
|
+
case s.left:
|
|
194
|
+
i <= this.computedWidth - r && (this.currentWidth = this.currentWidth - r);
|
|
195
|
+
break;
|
|
196
|
+
case s.right:
|
|
197
|
+
this.currentWidth = this.currentWidth + r;
|
|
198
|
+
break;
|
|
199
|
+
default:
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
this.dispatchMoveEvent("resize", t, !1, void 0);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (t.altKey) {
|
|
206
|
+
switch (t.keyCode) {
|
|
207
|
+
case s.up:
|
|
208
|
+
this.windowStage === e.MINIMIZED ? (this.handleRestore(t), this.$emit("stagechange", t, this, {
|
|
209
|
+
state: e.DEFAULT
|
|
210
|
+
})) : this.windowStage === e.DEFAULT && (this.handleFullscreen(t), this.$emit("stagechange", t, this, {
|
|
211
|
+
state: e.FULLSCREEN
|
|
212
|
+
}));
|
|
213
|
+
break;
|
|
214
|
+
case s.down:
|
|
215
|
+
this.windowStage === e.FULLSCREEN ? (this.handleRestore(t), this.$emit("stagechange", t, this, {
|
|
216
|
+
state: e.DEFAULT
|
|
217
|
+
})) : this.windowStage === e.DEFAULT && (this.handleMinimize(t), this.$emit("stagechange", t, this, {
|
|
218
|
+
state: e.MINIMIZED
|
|
219
|
+
}));
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (!t.ctrlKey)
|
|
225
|
+
switch (t.keyCode) {
|
|
226
|
+
case s.esc:
|
|
227
|
+
this.handleCloseWindow(t);
|
|
228
|
+
return;
|
|
229
|
+
case s.up:
|
|
230
|
+
t.preventDefault(), this.currentTop = this.currentTop - r;
|
|
231
|
+
break;
|
|
232
|
+
case s.down:
|
|
233
|
+
t.preventDefault(), this.currentTop = this.currentTop + r;
|
|
234
|
+
break;
|
|
235
|
+
case s.left:
|
|
236
|
+
t.preventDefault(), this.currentLeft = this.currentLeft - r;
|
|
237
|
+
break;
|
|
238
|
+
case s.right:
|
|
239
|
+
t.preventDefault(), this.currentLeft = this.currentLeft + r;
|
|
240
|
+
break;
|
|
241
|
+
default:
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.dispatchMoveEvent("move", t, !1, void 0);
|
|
245
|
+
},
|
|
246
|
+
getInitialTop() {
|
|
247
|
+
if (this.$props.top !== void 0)
|
|
248
|
+
return this.$props.top;
|
|
249
|
+
if (this.$props.initialTop !== void 0)
|
|
250
|
+
return this.$props.initialTop;
|
|
251
|
+
let t = I;
|
|
252
|
+
return this.$props.height !== void 0 ? t = this.$props.height : this.$props.initialHeight !== void 0 && (t = this.$props.initialHeight), window.innerHeight / 2 - t / 2;
|
|
253
|
+
},
|
|
254
|
+
getInitialLeft() {
|
|
255
|
+
if (this.$props.left !== void 0)
|
|
256
|
+
return this.$props.left;
|
|
257
|
+
if (this.$props.initialLeft !== void 0)
|
|
258
|
+
return this.$props.initialLeft;
|
|
259
|
+
let t = $;
|
|
260
|
+
return this.$props.width !== void 0 ? t = this.$props.width : this.$props.initialWidth !== void 0 && (t = this.$props.initialWidth), window.innerWidth / 2 - t / 2;
|
|
261
|
+
},
|
|
262
|
+
getInitialWidth() {
|
|
263
|
+
let t = $;
|
|
264
|
+
return this.$props.width !== void 0 ? t = this.$props.width : this.$props.initialWidth !== void 0 && (t = this.$props.initialWidth), t;
|
|
265
|
+
},
|
|
266
|
+
getInitialHeight() {
|
|
267
|
+
let t = I;
|
|
268
|
+
return this.$props.height !== void 0 ? t = this.$props.height : this.$props.initialHeight !== void 0 && (t = this.$props.initialHeight), t;
|
|
269
|
+
},
|
|
270
|
+
handleMinimize(t) {
|
|
271
|
+
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.MINIMIZED, this.currentHeight = 0, this.$emit("stagechange", t, this, {
|
|
272
|
+
state: e.MINIMIZED
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
handleFullscreen(t) {
|
|
276
|
+
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.FULLSCREEN, this.$emit("stagechange", t, this, {
|
|
277
|
+
state: e.FULLSCREEN
|
|
278
|
+
});
|
|
279
|
+
},
|
|
280
|
+
handleRestore(t) {
|
|
281
|
+
t.preventDefault(), this.windowStage === e.FULLSCREEN ? (this.currentStage = e.DEFAULT, this.currentLeft = this.windowCoordinatesState.leftBeforeAction, this.currentTop = this.windowCoordinatesState.topBeforeAction, this.currentWidth = this.windowCoordinatesState.widthBeforeAction, this.currentHeight = this.windowCoordinatesState.heightBeforeAction) : this.windowStage === e.MINIMIZED && (this.currentStage = e.DEFAULT, this.currentHeight = this.windowCoordinatesState.heightBeforeAction), this.$emit("stagechange", t, this, {
|
|
282
|
+
state: e.DEFAULT
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
handleCloseWindow(t) {
|
|
286
|
+
t.preventDefault(), this.$emit("close", t, this, {
|
|
287
|
+
state: void 0
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
handleDoubleClick(t) {
|
|
291
|
+
this.$props.doubleClickStageChange && (this.windowStage === e.FULLSCREEN || this.windowStage === e.MINIMIZED ? this.handleRestore(t) : this.handleFullscreen(t));
|
|
292
|
+
},
|
|
293
|
+
handleResize(t, i) {
|
|
294
|
+
const n = this.computedWidth, h = this.computedHeight, g = this.$props.minWidth || m, l = this.$props.minHeight || L, a = this.computedTop - t.pageY, d = this.computedLeft - t.pageX, p = t.pageX - this.computedLeft, f = t.pageY - this.computedTop;
|
|
295
|
+
this.isDragging = !i.end, i.direction.indexOf("n") >= 0 && l - (h + a) < 0 && (this.currentTop = t.pageY, this.currentHeight = h + a), i.direction.indexOf("s") >= 0 && l - f < 0 && (this.currentHeight = f), i.direction.indexOf("w") >= 0 && g - (n + d) < 0 && (this.currentLeft = t.pageX, this.currentWidth = n + d), i.direction.indexOf("e") >= 0 && g - p < 0 && (this.currentWidth = p), this.dispatchMoveEvent("resize", t, !0, i.end);
|
|
296
|
+
},
|
|
297
|
+
dispatchMoveEvent(t, i, n, h) {
|
|
298
|
+
this.$emit(t, {
|
|
299
|
+
event: i.event,
|
|
300
|
+
drag: n,
|
|
301
|
+
end: h,
|
|
302
|
+
target: this,
|
|
303
|
+
left: this.currentLeft,
|
|
304
|
+
top: this.currentTop,
|
|
305
|
+
width: this.currentWidth,
|
|
306
|
+
height: this.currentHeight
|
|
307
|
+
});
|
|
308
|
+
},
|
|
309
|
+
handleBrowserWindowResize() {
|
|
310
|
+
this.windowStage === e.FULLSCREEN && (this.currentWidth = window.innerWidth, this.currentHeight = window.innerHeight);
|
|
311
|
+
},
|
|
312
|
+
handleClick(t) {
|
|
313
|
+
this.$emit("overlayclick", t);
|
|
314
|
+
},
|
|
315
|
+
getActionBarIndex(t) {
|
|
316
|
+
return t.findIndex((n) => n && n.tag && n.tag.toLowerCase().indexOf("dialogactionsbar") !== -1 || n.componentOptions && n.componentOptions.tag && n.componentOptions.tag.toLowerCase().indexOf("actions-bar") !== -1 || n.type && n.type.name && n.type.name.toLowerCase().indexOf("dialogactionsbar") !== -1);
|
|
317
|
+
},
|
|
318
|
+
generateTitleId() {
|
|
319
|
+
return "window-title-" + B();
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
render() {
|
|
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 = H(this), a = l || [], d = this.getActionBarIndex(a);
|
|
324
|
+
let p;
|
|
325
|
+
d !== -1 && (p = a[d], a.splice(d, 1));
|
|
326
|
+
const f = this.showLicenseWatermark ? o(k, null, null) : null, S = o("div", {
|
|
327
|
+
class: this.wrapperClass,
|
|
328
|
+
ref: "wrapper",
|
|
329
|
+
dir: this.$props.dir
|
|
330
|
+
}, [this.$props.modal && o("div", {
|
|
331
|
+
class: "k-overlay",
|
|
332
|
+
onClick: this.handleClick
|
|
333
|
+
}, null), o("div", {
|
|
334
|
+
tabindex: 0,
|
|
335
|
+
onFocus: (w) => w.target.classList.add("k-focus"),
|
|
336
|
+
onBlur: (w) => w.target.classList.remove("k-focus"),
|
|
337
|
+
onKeydown: this.handleKeyDown,
|
|
338
|
+
ref: "windowElement",
|
|
339
|
+
class: this.windowElementClass,
|
|
340
|
+
role: "dialog",
|
|
341
|
+
"aria-modal": this.$props.modal ? !0 : void 0,
|
|
342
|
+
"aria-labelledby": this.titleId,
|
|
343
|
+
style: {
|
|
344
|
+
top: this.computedTop + "px",
|
|
345
|
+
left: this.computedLeft + "px",
|
|
346
|
+
width: this.computedWidth + "px",
|
|
347
|
+
height: this.computedHeight + "px" || "",
|
|
348
|
+
...this.$props.windowStyle
|
|
349
|
+
}
|
|
350
|
+
}, [o(b, {
|
|
351
|
+
onPress: this.onPress,
|
|
352
|
+
onDrag: this.onDrag,
|
|
353
|
+
onRelease: this.onRelease,
|
|
354
|
+
ref: "draggable"
|
|
355
|
+
}, {
|
|
356
|
+
default: () => [o(D, {
|
|
357
|
+
stage: this.windowStage,
|
|
358
|
+
title: this.$props.title,
|
|
359
|
+
titleId: this.titleId,
|
|
360
|
+
titleRender: t,
|
|
361
|
+
onDoubleclick: this.handleDoubleClick,
|
|
362
|
+
onMinimizeclick: this.handleMinimize,
|
|
363
|
+
onFullscreenclick: this.handleFullscreen,
|
|
364
|
+
onRestoreclick: this.handleRestore,
|
|
365
|
+
onCloseclick: this.handleCloseWindow,
|
|
366
|
+
closeButton: i,
|
|
367
|
+
minimizeButton: n,
|
|
368
|
+
maximizeButton: h,
|
|
369
|
+
restoreButton: g
|
|
370
|
+
}, null)]
|
|
371
|
+
}), this.windowStage !== e.MINIMIZED ? [o("div", {
|
|
372
|
+
class: "k-window-content"
|
|
373
|
+
}, [l]), p] : null, this.windowStage === e.DEFAULT && this.$props.resizable ? o(F, {
|
|
374
|
+
onResize: this.handleResize
|
|
375
|
+
}, null) : null, f])]);
|
|
376
|
+
return this.$props.appendTo ? o("div", null, [S]) : S;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
export {
|
|
380
|
+
O as Window
|
|
381
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("@progress/kendo-vue-common"),i=["n","e","s","w","se","sw","ne","nw"],o=t.defineComponent({name:"ResizeHandlers",emits:{resize:null},methods:{onDrag(e,n){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!1,direction:n})},onRelease(e,n){e.originalEvent.preventDefault(),this.$emit("resize",e,{end:!0,direction:n})}},render(){return t.createVNode("div",null,[i.map(function(e,n){return t.createVNode(s.Draggable,{key:n,onDrag:r=>this.onDrag(r,e),onRelease:r=>this.onRelease(r,e)},{default:()=>[t.createVNode("div",{class:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none"}},null)]})},this)])}});exports.ResizeHandlers=o;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent as s, createVNode as r } from "vue";
|
|
9
|
+
import { Draggable as t } from "@progress/kendo-vue-common";
|
|
10
|
+
const o = ["n", "e", "s", "w", "se", "sw", "ne", "nw"], d = /* @__PURE__ */ s({
|
|
11
|
+
name: "ResizeHandlers",
|
|
12
|
+
emits: {
|
|
13
|
+
resize: null
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
onDrag(e, n) {
|
|
17
|
+
e.originalEvent.preventDefault(), this.$emit("resize", e, {
|
|
18
|
+
end: !1,
|
|
19
|
+
direction: n
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
onRelease(e, n) {
|
|
23
|
+
e.originalEvent.preventDefault(), this.$emit("resize", e, {
|
|
24
|
+
end: !0,
|
|
25
|
+
direction: n
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
render() {
|
|
30
|
+
return r("div", null, [o.map(function(e, n) {
|
|
31
|
+
return r(t, {
|
|
32
|
+
key: n,
|
|
33
|
+
onDrag: (i) => this.onDrag(i, e),
|
|
34
|
+
onRelease: (i) => this.onRelease(i, e)
|
|
35
|
+
}, {
|
|
36
|
+
default: () => [r("div", {
|
|
37
|
+
class: "k-resize-handle k-resize-" + e,
|
|
38
|
+
style: {
|
|
39
|
+
display: "block",
|
|
40
|
+
touchAction: "none"
|
|
41
|
+
}
|
|
42
|
+
}, null)]
|
|
43
|
+
});
|
|
44
|
+
}, this)]);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
d as ResizeHandlers
|
|
49
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("@progress/kendo-vue-common"),l=require("@progress/kendo-vue-buttons"),R=require("@progress/kendo-vue-intl"),s=require("./StageEnum.js"),e=require("./messages/main.js"),c=require("@progress/kendo-svg-icons"),F=t.defineComponent({name:"KendoWindowTitleBar",props:{id:String,stage:String,closeButton:[String,Function,Object,Boolean],minimizeButton:[String,Function,Object,Boolean],maximizeButton:[String,Function,Object,Boolean],restoreButton:[String,Function,Object,Boolean],title:String,titleId:String,titleRender:[String,Function,Object,Boolean],onDoubleclick:Function,onMinimizeclick:Function,onFullscreenclick:Function,onRestoreclick:Function,onCloseclick:Function},inject:{kendoLocalizationService:{default:null}},methods:{onDoubleClick(n){this.$emit("doubleclick",n)},onMinimizeClick(n){this.$emit("minimizeclick",n)},onFullScreenClick(n){this.$emit("fullscreenclick",n)},onRestoreClick(n){this.$emit("restoreclick",n)},onCloseClick(n){this.$emit("closeclick",n)}},render(){const n=this.$props,{stage:a,title:r,titleRender:u,minimizeButton:d,maximizeButton:g,restoreButton:m,closeButton:w}=n,o=R.provideLocalizationService(this);let k=i.getTemplate.call(this,{h:t.h,template:u,defaultRendering:r});const B=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-minimize",svgIcon:c.windowMinimizeIcon,fillMode:"flat",onClick:this.onMinimizeClick,"aria-label":o.toLanguageString(e.dialogsWindowMinimizeButton,e.messages[e.dialogsWindowMinimizeButton])},null),h=i.getTemplate.call(this,{h:t.h,template:d,defaultRendering:B}),b=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window",svgIcon:c.windowIcon,fillMode:"flat",onClick:this.onFullScreenClick,"aria-label":o.toLanguageString(e.dialogsWindowMaximizeButton,e.messages[e.dialogsWindowMaximizeButton])},null),p=i.getTemplate.call(this,{h:t.h,template:g,defaultRendering:b}),S=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"window-restore",svgIcon:c.windowRestoreIcon,fillMode:"flat",onClick:this.onRestoreClick,"aria-label":o.toLanguageString(e.dialogsWindowRestoreButton,e.messages[e.dialogsWindowRestoreButton])},null),f=i.getTemplate.call(this,{h:t.h,template:m,defaultRendering:S}),C=t.createVNode(l.Button,{type:"button",class:"k-window-titlebar-action",icon:"x",svgIcon:c.xIcon,fillMode:"flat",onClick:this.onCloseClick,"aria-label":o.toLanguageString(e.dialogsWindowCloseButton,e.messages[e.dialogsWindowCloseButton])},null),z=i.getTemplate.call(this,{h:t.h,template:w,defaultRendering:C});return t.createVNode("div",{class:"k-window-titlebar",style:{touchAction:"none"},onDblclick:this.onDoubleClick},[t.createVNode("span",{class:"k-window-title",id:this.$props.titleId},[k]),t.createVNode("div",{class:"k-window-titlebar-actions"},[a===s.windowStage.DEFAULT&&h,a===s.windowStage.DEFAULT&&p,a!==s.windowStage.DEFAULT&&f,z])])}});exports.WindowTitleBar=F;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent as M, h as n, createVNode as i } from "vue";
|
|
9
|
+
import { getTemplate as o } from "@progress/kendo-vue-common";
|
|
10
|
+
import { Button as l } from "@progress/kendo-vue-buttons";
|
|
11
|
+
import { provideLocalizationService as v } from "@progress/kendo-vue-intl";
|
|
12
|
+
import { windowStage as s } from "./StageEnum.mjs";
|
|
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
|
+
name: "KendoWindowTitleBar",
|
|
17
|
+
props: {
|
|
18
|
+
id: String,
|
|
19
|
+
stage: String,
|
|
20
|
+
closeButton: [String, Function, Object, Boolean],
|
|
21
|
+
minimizeButton: [String, Function, Object, Boolean],
|
|
22
|
+
maximizeButton: [String, Function, Object, Boolean],
|
|
23
|
+
restoreButton: [String, Function, Object, Boolean],
|
|
24
|
+
title: String,
|
|
25
|
+
titleId: String,
|
|
26
|
+
titleRender: [String, Function, Object, Boolean],
|
|
27
|
+
onDoubleclick: Function,
|
|
28
|
+
onMinimizeclick: Function,
|
|
29
|
+
onFullscreenclick: Function,
|
|
30
|
+
onRestoreclick: Function,
|
|
31
|
+
onCloseclick: Function
|
|
32
|
+
},
|
|
33
|
+
inject: {
|
|
34
|
+
kendoLocalizationService: {
|
|
35
|
+
default: null
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
onDoubleClick(t) {
|
|
40
|
+
this.$emit("doubleclick", t);
|
|
41
|
+
},
|
|
42
|
+
onMinimizeClick(t) {
|
|
43
|
+
this.$emit("minimizeclick", t);
|
|
44
|
+
},
|
|
45
|
+
onFullScreenClick(t) {
|
|
46
|
+
this.$emit("fullscreenclick", t);
|
|
47
|
+
},
|
|
48
|
+
onRestoreClick(t) {
|
|
49
|
+
this.$emit("restoreclick", t);
|
|
50
|
+
},
|
|
51
|
+
onCloseClick(t) {
|
|
52
|
+
this.$emit("closeclick", t);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
render() {
|
|
56
|
+
const t = this.$props, {
|
|
57
|
+
stage: a,
|
|
58
|
+
title: g,
|
|
59
|
+
titleRender: w,
|
|
60
|
+
minimizeButton: k,
|
|
61
|
+
maximizeButton: p,
|
|
62
|
+
restoreButton: B,
|
|
63
|
+
closeButton: f
|
|
64
|
+
} = t, e = v(this);
|
|
65
|
+
let h = o.call(this, {
|
|
66
|
+
h: n,
|
|
67
|
+
template: w,
|
|
68
|
+
defaultRendering: g
|
|
69
|
+
});
|
|
70
|
+
const b = i(l, {
|
|
71
|
+
type: "button",
|
|
72
|
+
class: "k-window-titlebar-action",
|
|
73
|
+
icon: "window-minimize",
|
|
74
|
+
svgIcon: L,
|
|
75
|
+
fillMode: "flat",
|
|
76
|
+
onClick: this.onMinimizeClick,
|
|
77
|
+
"aria-label": e.toLanguageString(r, c[r])
|
|
78
|
+
}, null), C = o.call(this, {
|
|
79
|
+
h: n,
|
|
80
|
+
template: k,
|
|
81
|
+
defaultRendering: b
|
|
82
|
+
}), z = i(l, {
|
|
83
|
+
type: "button",
|
|
84
|
+
class: "k-window-titlebar-action",
|
|
85
|
+
icon: "window",
|
|
86
|
+
svgIcon: x,
|
|
87
|
+
fillMode: "flat",
|
|
88
|
+
onClick: this.onFullScreenClick,
|
|
89
|
+
"aria-label": e.toLanguageString(u, c[u])
|
|
90
|
+
}, null), S = o.call(this, {
|
|
91
|
+
h: n,
|
|
92
|
+
template: p,
|
|
93
|
+
defaultRendering: z
|
|
94
|
+
}), F = i(l, {
|
|
95
|
+
type: "button",
|
|
96
|
+
class: "k-window-titlebar-action",
|
|
97
|
+
icon: "window-restore",
|
|
98
|
+
svgIcon: $,
|
|
99
|
+
fillMode: "flat",
|
|
100
|
+
onClick: this.onRestoreClick,
|
|
101
|
+
"aria-label": e.toLanguageString(d, c[d])
|
|
102
|
+
}, null), R = o.call(this, {
|
|
103
|
+
h: n,
|
|
104
|
+
template: B,
|
|
105
|
+
defaultRendering: F
|
|
106
|
+
}), D = i(l, {
|
|
107
|
+
type: "button",
|
|
108
|
+
class: "k-window-titlebar-action",
|
|
109
|
+
icon: "x",
|
|
110
|
+
svgIcon: j,
|
|
111
|
+
fillMode: "flat",
|
|
112
|
+
onClick: this.onCloseClick,
|
|
113
|
+
"aria-label": e.toLanguageString(m, c[m])
|
|
114
|
+
}, null), I = o.call(this, {
|
|
115
|
+
h: n,
|
|
116
|
+
template: f,
|
|
117
|
+
defaultRendering: D
|
|
118
|
+
});
|
|
119
|
+
return i("div", {
|
|
120
|
+
class: "k-window-titlebar",
|
|
121
|
+
style: {
|
|
122
|
+
touchAction: "none"
|
|
123
|
+
},
|
|
124
|
+
onDblclick: this.onDoubleClick
|
|
125
|
+
}, [i("span", {
|
|
126
|
+
class: "k-window-title",
|
|
127
|
+
id: this.$props.titleId
|
|
128
|
+
}, [h]), i("div", {
|
|
129
|
+
class: "k-window-titlebar-actions"
|
|
130
|
+
}, [a === s.DEFAULT && C, a === s.DEFAULT && S, a !== s.DEFAULT && R, I])]);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
K as WindowTitleBar
|
|
135
|
+
};
|
package/constants.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=10002;exports.DEFAULT_DIALOGS_ZINDEX=e;
|
package/constants.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
const D = 10002;
|
|
9
|
+
export {
|
|
10
|
+
D as DEFAULT_DIALOGS_ZINDEX
|
|
11
|
+
};
|