@progress/kendo-vue-dialogs 5.3.0-dev.202409130647 → 5.3.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/Dialog.js +8 -0
  2. package/Dialog.mjs +157 -0
  3. package/DialogActionsBar.js +8 -0
  4. package/DialogActionsBar.mjs +52 -0
  5. package/DialogTitleBar.js +8 -0
  6. package/DialogTitleBar.mjs +59 -0
  7. package/README.md +27 -36
  8. package/StageEnum.js +8 -0
  9. package/StageEnum.mjs +11 -0
  10. package/Window.js +8 -0
  11. package/Window.mjs +381 -0
  12. package/WindowResizeHandlers.js +8 -0
  13. package/WindowResizeHandlers.mjs +49 -0
  14. package/WindowTitlebar.js +8 -0
  15. package/WindowTitlebar.mjs +135 -0
  16. package/constants.js +8 -0
  17. package/constants.mjs +11 -0
  18. package/dist/cdn/js/kendo-vue-dialogs.js +8 -1
  19. package/index.d.mts +595 -0
  20. package/index.d.ts +595 -0
  21. package/index.js +8 -0
  22. package/index.mjs +15 -0
  23. package/messages/main.js +8 -0
  24. package/messages/main.mjs +20 -0
  25. package/package-metadata.js +8 -0
  26. package/package-metadata.mjs +18 -0
  27. package/package.json +22 -39
  28. package/dist/es/Dialog.d.ts +0 -109
  29. package/dist/es/Dialog.js +0 -225
  30. package/dist/es/DialogActionsBar.d.ts +0 -50
  31. package/dist/es/DialogActionsBar.js +0 -61
  32. package/dist/es/DialogTitleBar.d.ts +0 -46
  33. package/dist/es/DialogTitleBar.js +0 -85
  34. package/dist/es/StageEnum.d.ts +0 -5
  35. package/dist/es/StageEnum.js +0 -6
  36. package/dist/es/Window.d.ts +0 -75
  37. package/dist/es/Window.js +0 -663
  38. package/dist/es/WindowProps.d.ts +0 -138
  39. package/dist/es/WindowProps.js +0 -2
  40. package/dist/es/WindowResizeHandlers.d.ts +0 -30
  41. package/dist/es/WindowResizeHandlers.js +0 -89
  42. package/dist/es/WindowTitlebar.d.ts +0 -86
  43. package/dist/es/WindowTitlebar.js +0 -202
  44. package/dist/es/additionalTypes.ts +0 -21
  45. package/dist/es/constants.d.ts +0 -2
  46. package/dist/es/constants.js +0 -2
  47. package/dist/es/events.d.ts +0 -34
  48. package/dist/es/events.js +0 -2
  49. package/dist/es/main.d.ts +0 -6
  50. package/dist/es/main.js +0 -4
  51. package/dist/es/messages/main.d.ts +0 -25
  52. package/dist/es/messages/main.js +0 -26
  53. package/dist/es/package-metadata.d.ts +0 -5
  54. package/dist/es/package-metadata.js +0 -11
  55. package/dist/esm/Dialog.d.ts +0 -109
  56. package/dist/esm/Dialog.js +0 -225
  57. package/dist/esm/DialogActionsBar.d.ts +0 -50
  58. package/dist/esm/DialogActionsBar.js +0 -61
  59. package/dist/esm/DialogTitleBar.d.ts +0 -46
  60. package/dist/esm/DialogTitleBar.js +0 -85
  61. package/dist/esm/StageEnum.d.ts +0 -5
  62. package/dist/esm/StageEnum.js +0 -6
  63. package/dist/esm/Window.d.ts +0 -75
  64. package/dist/esm/Window.js +0 -663
  65. package/dist/esm/WindowProps.d.ts +0 -138
  66. package/dist/esm/WindowProps.js +0 -2
  67. package/dist/esm/WindowResizeHandlers.d.ts +0 -30
  68. package/dist/esm/WindowResizeHandlers.js +0 -89
  69. package/dist/esm/WindowTitlebar.d.ts +0 -86
  70. package/dist/esm/WindowTitlebar.js +0 -202
  71. package/dist/esm/additionalTypes.ts +0 -21
  72. package/dist/esm/constants.d.ts +0 -2
  73. package/dist/esm/constants.js +0 -2
  74. package/dist/esm/events.d.ts +0 -34
  75. package/dist/esm/events.js +0 -2
  76. package/dist/esm/main.d.ts +0 -6
  77. package/dist/esm/main.js +0 -4
  78. package/dist/esm/messages/main.d.ts +0 -25
  79. package/dist/esm/messages/main.js +0 -26
  80. package/dist/esm/package-metadata.d.ts +0 -5
  81. package/dist/esm/package-metadata.js +0 -11
  82. package/dist/esm/package.json +0 -3
  83. package/dist/npm/Dialog.d.ts +0 -109
  84. package/dist/npm/Dialog.js +0 -232
  85. package/dist/npm/DialogActionsBar.d.ts +0 -50
  86. package/dist/npm/DialogActionsBar.js +0 -68
  87. package/dist/npm/DialogTitleBar.d.ts +0 -46
  88. package/dist/npm/DialogTitleBar.js +0 -92
  89. package/dist/npm/StageEnum.d.ts +0 -5
  90. package/dist/npm/StageEnum.js +0 -9
  91. package/dist/npm/Window.d.ts +0 -75
  92. package/dist/npm/Window.js +0 -670
  93. package/dist/npm/WindowProps.d.ts +0 -138
  94. package/dist/npm/WindowProps.js +0 -6
  95. package/dist/npm/WindowResizeHandlers.d.ts +0 -30
  96. package/dist/npm/WindowResizeHandlers.js +0 -96
  97. package/dist/npm/WindowTitlebar.d.ts +0 -86
  98. package/dist/npm/WindowTitlebar.js +0 -209
  99. package/dist/npm/additionalTypes.ts +0 -21
  100. package/dist/npm/constants.d.ts +0 -2
  101. package/dist/npm/constants.js +0 -5
  102. package/dist/npm/events.d.ts +0 -34
  103. package/dist/npm/events.js +0 -3
  104. package/dist/npm/main.d.ts +0 -6
  105. package/dist/npm/main.js +0 -12
  106. package/dist/npm/messages/main.d.ts +0 -25
  107. package/dist/npm/messages/main.js +0 -29
  108. package/dist/npm/package-metadata.d.ts +0 -5
  109. package/dist/npm/package-metadata.js +0 -14
@@ -1,663 +0,0 @@
1
- var __assign = this && this.__assign || function () {
2
- __assign = Object.assign || function (t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) {
6
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
7
- }
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- // @ts-ignore
14
- import * as Vue from 'vue';
15
- var allVue = Vue;
16
- var gh = allVue.h;
17
- var isV3 = allVue.version && allVue.version[0] === '3';
18
- import { WindowTitleBar } from './WindowTitlebar.js';
19
- import { Keys, guid, Draggable, templateDefinition, getDefaultSlots, templateRendering, getListeners, validatePackage, WatermarkOverlay, shouldShowValidationUI } from '@progress/kendo-vue-common';
20
- import { ResizeHandlers } from './WindowResizeHandlers.js';
21
- import { windowStage } from './StageEnum.js';
22
- import { packageMetadata } from './package-metadata.js';
23
- import { DEFAULT_DIALOGS_ZINDEX } from './constants.js';
24
- var DEFAULT_WIDTH = 300;
25
- var DEFAULT_HEIGHT = 300;
26
- var DEFAULT_MIN_WIDTH = 120;
27
- var DEFAULT_MIN_HEIGHT = 100;
28
- var DEFAULT_STEP = 5;
29
- /**
30
- * @hidden
31
- */
32
- var WindowVue2 = {
33
- name: 'KendoWindow',
34
- // @ts-ignore
35
- emits: {
36
- 'resize': null,
37
- 'move': null,
38
- 'close': null,
39
- 'stagechange': null,
40
- 'overlayclick': null
41
- },
42
- provide: function provide() {
43
- return {
44
- kCurrentZIndex: DEFAULT_DIALOGS_ZINDEX
45
- };
46
- },
47
- props: {
48
- id: String,
49
- appendTo: String,
50
- width: {
51
- type: [Number],
52
- default: undefined
53
- },
54
- height: {
55
- type: [Number],
56
- default: undefined
57
- },
58
- left: {
59
- type: [Number],
60
- default: undefined
61
- },
62
- windowStyle: Object,
63
- windowClass: String,
64
- top: {
65
- type: [Number],
66
- default: undefined
67
- },
68
- initialWidth: [Number],
69
- initialHeight: [Number],
70
- initialLeft: [Number],
71
- initialTop: [Number],
72
- minWidth: {
73
- type: [Number],
74
- default: DEFAULT_MIN_WIDTH
75
- },
76
- minHeight: {
77
- type: [Number],
78
- default: DEFAULT_MIN_HEIGHT
79
- },
80
- resizable: {
81
- type: Boolean,
82
- default: true
83
- },
84
- draggable: {
85
- type: Boolean,
86
- default: true
87
- },
88
- modal: {
89
- type: Boolean,
90
- default: false
91
- },
92
- doubleClickStageChange: {
93
- type: Boolean,
94
- default: true
95
- },
96
- title: String,
97
- titleRender: templateDefinition,
98
- closeButton: templateDefinition,
99
- minimizeButton: templateDefinition,
100
- maximizeButton: templateDefinition,
101
- restoreButton: templateDefinition,
102
- shouldUpdateOnDrag: Boolean,
103
- stage: {
104
- type: String,
105
- validator: function validator(value) {
106
- return ['DEFAULT', 'MINIMIZED', 'FULLSCREEN'].indexOf(value) !== -1;
107
- }
108
- },
109
- themeColor: {
110
- type: String,
111
- validator: function validator(value) {
112
- return [undefined, 'primary', 'dark', 'light'].includes(value);
113
- }
114
- }
115
- },
116
- // @ts-ignore
117
- setup: !isV3 ? undefined : function () {
118
- var v3 = !!isV3;
119
- return {
120
- v3: v3
121
- };
122
- },
123
- created: function created() {
124
- validatePackage(packageMetadata);
125
- this.showLicenseWatermark = shouldShowValidationUI(packageMetadata);
126
- this.windowCoordinatesState = {
127
- leftBeforeAction: this.getInitialLeft(),
128
- topBeforeAction: this.getInitialTop(),
129
- widthBeforeAction: this.getInitialWidth(),
130
- heightBeforeAction: this.getInitialHeight()
131
- };
132
- this.titleId = this.generateTitleId();
133
- },
134
- beforeDestroy: !!isV3 ? undefined : function () {
135
- if (this.$props.appendTo) {
136
- this.windowWrapper.remove();
137
- }
138
- },
139
- beforeUnmount: function beforeUnmount() {
140
- if (this.$props.appendTo) {
141
- this.windowWrapper.remove();
142
- }
143
- },
144
- data: function data() {
145
- return {
146
- currentStage: this.$props.stage || windowStage.DEFAULT,
147
- isDragging: false,
148
- currentTop: this.getInitialTop(),
149
- currentLeft: this.getInitialLeft(),
150
- currentWidth: this.getInitialWidth(),
151
- currentHeight: this.getInitialHeight(),
152
- titleId: undefined,
153
- showLicenseWatermark: false
154
- };
155
- },
156
- mounted: function mounted() {
157
- if (window) {
158
- window.addEventListener('resize', this.handleBrowserWindowResize);
159
- if (this.$props.appendTo) {
160
- var body = document.querySelector(this.$props.appendTo);
161
- this.windowWrapper = this.$refs.wrapper;
162
- body.append(this.windowWrapper);
163
- }
164
- }
165
- if (this.$el) {
166
- // this.draggable = this.$refs.draggable;
167
- this.windowElement = this.$refs.windowElement;
168
- }
169
- },
170
- destroyed: !!isV3 ? undefined : function () {
171
- if (window) {
172
- window.removeEventListener('resize', this.handleBrowserWindowResize);
173
- }
174
- },
175
- // @ts-ignore
176
- unmounted: function unmounted() {
177
- if (window) {
178
- window.removeEventListener('resize', this.handleBrowserWindowResize);
179
- }
180
- },
181
- computed: {
182
- wrapperClass: function wrapperClass() {
183
- return {
184
- 'k-dialog-wrapper': this.$props.modal
185
- };
186
- },
187
- windowElementClass: function windowElementClass() {
188
- var _a;
189
- var _b = this.$props,
190
- windowClass = _b.windowClass,
191
- themeColor = _b.themeColor;
192
- return _a = {
193
- 'k-window': true
194
- }, _a[windowClass] = windowClass, _a["k-window-".concat(themeColor)] = themeColor, _a['k-window-minimized'] = this.currentStage === 'MINIMIZED', _a;
195
- },
196
- computedTop: function computedTop() {
197
- if (this.windowStage !== windowStage.FULLSCREEN) {
198
- return Math.max(this.$props.top || this.currentTop, 0);
199
- }
200
- return 0;
201
- },
202
- computedLeft: function computedLeft() {
203
- if (this.windowStage !== windowStage.FULLSCREEN) {
204
- return Math.max(this.$props.left || this.currentLeft, 0);
205
- }
206
- return 0;
207
- },
208
- computedWidth: function computedWidth() {
209
- var width = this.$props.width || this.currentWidth;
210
- if (this.windowStage === windowStage.FULLSCREEN) {
211
- width = window.innerWidth;
212
- }
213
- return width;
214
- },
215
- computedHeight: function computedHeight() {
216
- var height = this.$props.height || this.currentHeight;
217
- if (this.windowStage === windowStage.FULLSCREEN) {
218
- height = window.innerHeight;
219
- } else if (this.windowStage === windowStage.MINIMIZED) {
220
- height = 0;
221
- }
222
- return height;
223
- },
224
- windowStage: function windowStage() {
225
- return this.$props.stage || this.currentStage;
226
- }
227
- },
228
- methods: {
229
- onPress: function onPress(event) {
230
- var e = event;
231
- this.windowCoordinatesState.differenceLeft = e.pageX - this.computedLeft;
232
- this.windowCoordinatesState.differenceTop = e.pageY - this.computedTop;
233
- },
234
- onDrag: function onDrag(event) {
235
- var e = event;
236
- e.originalEvent.preventDefault();
237
- if (this.windowStage !== windowStage.FULLSCREEN && this.$props.draggable) {
238
- this.currentTop = Math.max(e.pageY - this.windowCoordinatesState.differenceTop, 0);
239
- this.currentLeft = e.pageX - this.windowCoordinatesState.differenceLeft;
240
- this.isDragging = true;
241
- this.dispatchMoveEvent('move', e, true, false);
242
- }
243
- },
244
- onRelease: function onRelease(event) {
245
- var e = event;
246
- if (this.windowStage !== windowStage.FULLSCREEN && this.$props.draggable) {
247
- this.dispatchMoveEvent('move', e, true, true);
248
- }
249
- this.isDragging = false;
250
- },
251
- handleKeyDown: function handleKeyDown(event) {
252
- if (event.target !== event.currentTarget) {
253
- return;
254
- }
255
- var minWidth = this.$props.minWidth || DEFAULT_MIN_WIDTH;
256
- var minHeight = this.$props.minHeight || DEFAULT_MIN_HEIGHT;
257
- if (event.ctrlKey && this.$props.resizable) {
258
- switch (event.keyCode) {
259
- case Keys.up:
260
- event.preventDefault();
261
- if (minHeight <= this.computedHeight - DEFAULT_STEP) {
262
- this.currentHeight = this.currentHeight - DEFAULT_STEP;
263
- }
264
- break;
265
- case Keys.down:
266
- event.preventDefault();
267
- this.currentHeight = this.currentHeight + DEFAULT_STEP;
268
- break;
269
- case Keys.left:
270
- if (minWidth <= this.computedWidth - DEFAULT_STEP) {
271
- this.currentWidth = this.currentWidth - DEFAULT_STEP;
272
- }
273
- break;
274
- case Keys.right:
275
- this.currentWidth = this.currentWidth + DEFAULT_STEP;
276
- break;
277
- default:
278
- return;
279
- }
280
- this.dispatchMoveEvent('resize', event, false, undefined);
281
- return;
282
- }
283
- if (event.altKey) {
284
- switch (event.keyCode) {
285
- case Keys.up:
286
- if (this.windowStage === windowStage.MINIMIZED) {
287
- this.handleRestore(event);
288
- this.$emit('stagechange', event, this, {
289
- state: windowStage.DEFAULT
290
- });
291
- } else if (this.windowStage === windowStage.DEFAULT) {
292
- this.handleFullscreen(event);
293
- this.$emit('stagechange', event, this, {
294
- state: windowStage.FULLSCREEN
295
- });
296
- }
297
- break;
298
- case Keys.down:
299
- if (this.windowStage === windowStage.FULLSCREEN) {
300
- this.handleRestore(event);
301
- this.$emit('stagechange', event, this, {
302
- state: windowStage.DEFAULT
303
- });
304
- } else if (this.windowStage === windowStage.DEFAULT) {
305
- this.handleMinimize(event);
306
- this.$emit('stagechange', event, this, {
307
- state: windowStage.MINIMIZED
308
- });
309
- }
310
- break;
311
- default:
312
- }
313
- return;
314
- }
315
- if (!event.ctrlKey) {
316
- switch (event.keyCode) {
317
- case Keys.esc:
318
- this.handleCloseWindow(event);
319
- return;
320
- case Keys.up:
321
- event.preventDefault();
322
- this.currentTop = this.currentTop - DEFAULT_STEP;
323
- break;
324
- case Keys.down:
325
- event.preventDefault();
326
- this.currentTop = this.currentTop + DEFAULT_STEP;
327
- break;
328
- case Keys.left:
329
- event.preventDefault();
330
- this.currentLeft = this.currentLeft - DEFAULT_STEP;
331
- break;
332
- case Keys.right:
333
- event.preventDefault();
334
- this.currentLeft = this.currentLeft + DEFAULT_STEP;
335
- break;
336
- default:
337
- return;
338
- }
339
- }
340
- this.dispatchMoveEvent('move', event, false, undefined);
341
- },
342
- getInitialTop: function getInitialTop() {
343
- if (this.$props.top !== undefined) {
344
- return this.$props.top;
345
- }
346
- if (this.$props.initialTop !== undefined) {
347
- return this.$props.initialTop;
348
- }
349
- var height = DEFAULT_HEIGHT;
350
- if (this.$props.height !== undefined) {
351
- height = this.$props.height;
352
- } else if (this.$props.initialHeight !== undefined) {
353
- height = this.$props.initialHeight;
354
- }
355
- return window.innerHeight / 2 - height / 2;
356
- },
357
- getInitialLeft: function getInitialLeft() {
358
- if (this.$props.left !== undefined) {
359
- return this.$props.left;
360
- }
361
- if (this.$props.initialLeft !== undefined) {
362
- return this.$props.initialLeft;
363
- }
364
- var width = DEFAULT_WIDTH;
365
- if (this.$props.width !== undefined) {
366
- width = this.$props.width;
367
- } else if (this.$props.initialWidth !== undefined) {
368
- width = this.$props.initialWidth;
369
- }
370
- return window.innerWidth / 2 - width / 2;
371
- },
372
- getInitialWidth: function getInitialWidth() {
373
- var width = DEFAULT_WIDTH;
374
- if (this.$props.width !== undefined) {
375
- width = this.$props.width;
376
- } else if (this.$props.initialWidth !== undefined) {
377
- width = this.$props.initialWidth;
378
- }
379
- return width;
380
- },
381
- getInitialHeight: function getInitialHeight() {
382
- var height = DEFAULT_HEIGHT;
383
- if (this.$props.height !== undefined) {
384
- height = this.$props.height;
385
- } else if (this.$props.initialHeight !== undefined) {
386
- height = this.$props.initialHeight;
387
- }
388
- return height;
389
- },
390
- handleMinimize: function handleMinimize(event) {
391
- event.preventDefault();
392
- this.windowCoordinatesState.leftBeforeAction = this.computedLeft;
393
- this.windowCoordinatesState.topBeforeAction = this.computedTop;
394
- this.windowCoordinatesState.widthBeforeAction = this.computedWidth;
395
- this.windowCoordinatesState.heightBeforeAction = this.computedHeight;
396
- this.currentStage = windowStage.MINIMIZED;
397
- this.currentHeight = 0;
398
- this.$emit('stagechange', event, this, {
399
- state: windowStage.MINIMIZED
400
- });
401
- },
402
- handleFullscreen: function handleFullscreen(event) {
403
- event.preventDefault();
404
- this.windowCoordinatesState.leftBeforeAction = this.computedLeft;
405
- this.windowCoordinatesState.topBeforeAction = this.computedTop;
406
- this.windowCoordinatesState.widthBeforeAction = this.computedWidth;
407
- this.windowCoordinatesState.heightBeforeAction = this.computedHeight;
408
- this.currentLeft = 0;
409
- this.currentTop = 0;
410
- this.currentWidth = window.innerWidth;
411
- this.currentHeight = window.innerHeight;
412
- this.currentStage = windowStage.FULLSCREEN;
413
- this.$emit('stagechange', event, this, {
414
- state: windowStage.FULLSCREEN
415
- });
416
- },
417
- handleRestore: function handleRestore(event) {
418
- event.preventDefault();
419
- if (this.windowStage === windowStage.FULLSCREEN) {
420
- this.currentStage = windowStage.DEFAULT;
421
- this.currentLeft = this.windowCoordinatesState.leftBeforeAction;
422
- this.currentTop = this.windowCoordinatesState.topBeforeAction;
423
- this.currentWidth = this.windowCoordinatesState.widthBeforeAction;
424
- this.currentHeight = this.windowCoordinatesState.heightBeforeAction;
425
- } else if (this.windowStage === windowStage.MINIMIZED) {
426
- this.currentStage = windowStage.DEFAULT;
427
- this.currentHeight = this.windowCoordinatesState.heightBeforeAction;
428
- }
429
- this.$emit('stagechange', event, this, {
430
- state: windowStage.DEFAULT
431
- });
432
- },
433
- handleCloseWindow: function handleCloseWindow(event) {
434
- event.preventDefault();
435
- this.$emit('close', event, this, {
436
- state: undefined
437
- });
438
- },
439
- handleDoubleClick: function handleDoubleClick(e) {
440
- if (!this.$props.doubleClickStageChange) {
441
- return;
442
- }
443
- if (this.windowStage === windowStage.FULLSCREEN || this.windowStage === windowStage.MINIMIZED) {
444
- this.handleRestore(e);
445
- } else {
446
- this.handleFullscreen(e);
447
- }
448
- },
449
- handleResize: function handleResize(event, props) {
450
- var currentWidth = this.computedWidth;
451
- var currentHeight = this.computedHeight;
452
- var minWidth = this.$props.minWidth || DEFAULT_MIN_WIDTH;
453
- var minHeight = this.$props.minHeight || DEFAULT_MIN_HEIGHT;
454
- var heightDifference = this.computedTop - event.pageY;
455
- var widthDifference = this.computedLeft - event.pageX;
456
- var newWidth = event.pageX - this.computedLeft;
457
- var newHeight = event.pageY - this.computedTop;
458
- this.isDragging = !props.end;
459
- if (props.direction.indexOf('n') >= 0 && minHeight - (currentHeight + heightDifference) < 0) {
460
- this.currentTop = event.pageY;
461
- this.currentHeight = currentHeight + heightDifference;
462
- }
463
- if (props.direction.indexOf('s') >= 0 && minHeight - newHeight < 0) {
464
- this.currentHeight = newHeight;
465
- }
466
- if (props.direction.indexOf('w') >= 0 && minWidth - (currentWidth + widthDifference) < 0) {
467
- this.currentLeft = event.pageX;
468
- this.currentWidth = currentWidth + widthDifference;
469
- }
470
- if (props.direction.indexOf('e') >= 0 && minWidth - newWidth < 0) {
471
- this.currentWidth = newWidth;
472
- }
473
- this.dispatchMoveEvent('resize', event, true, props.end);
474
- },
475
- dispatchMoveEvent: function dispatchMoveEvent(eventName, event, drag, end) {
476
- this.$emit(eventName, {
477
- event: event.event,
478
- drag: drag,
479
- end: end,
480
- target: this,
481
- left: this.currentLeft,
482
- top: this.currentTop,
483
- width: this.currentWidth,
484
- height: this.currentHeight
485
- });
486
- },
487
- handleBrowserWindowResize: function handleBrowserWindowResize() {
488
- if (this.windowStage === windowStage.FULLSCREEN) {
489
- this.currentWidth = window.innerWidth;
490
- this.currentHeight = window.innerHeight;
491
- }
492
- },
493
- handleClick: function handleClick(e) {
494
- this.$emit('overlayclick', e);
495
- },
496
- getActionBarIndex: function getActionBarIndex(children) {
497
- var actionBarIndex = children.findIndex(function (child) {
498
- return child && child.tag && child.tag.toLowerCase().indexOf('dialogactionsbar') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('actions-bar') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('dialogactionsbar') !== -1;
499
- });
500
- return actionBarIndex;
501
- },
502
- generateTitleId: function generateTitleId() {
503
- return 'window-title-' + guid();
504
- }
505
- },
506
- // @ts-ignore
507
- render: function render(createElement) {
508
- var _this = this;
509
- var h = gh || createElement;
510
- var titleRender = templateRendering.call(this, this.$props.titleRender, getListeners.call(this));
511
- var closeButton = templateRendering.call(this, this.$props.closeButton, getListeners.call(this));
512
- var minimizeButton = templateRendering.call(this, this.$props.minimizeButton, getListeners.call(this));
513
- var maximizeButton = templateRendering.call(this, this.$props.maximizeButton, getListeners.call(this));
514
- var restoreButton = templateRendering.call(this, this.$props.restoreButton, getListeners.call(this));
515
- var defaultSlot = getDefaultSlots(this);
516
- var content = defaultSlot || [];
517
- var actionBarIndex = this.getActionBarIndex(content);
518
- var actions;
519
- if (actionBarIndex !== -1) {
520
- actions = content[actionBarIndex];
521
- content.splice(actionBarIndex, 1);
522
- }
523
- var watermark = this.showLicenseWatermark ? h(WatermarkOverlay) : null;
524
- var windowElement = h("div", {
525
- "class": this.wrapperClass,
526
- ref: 'wrapper'
527
- }, [this.$props.modal && h("div", {
528
- "class": "k-overlay",
529
- onClick: this.handleClick,
530
- on: this.v3 ? undefined : {
531
- "click": this.handleClick
532
- }
533
- }), h("div", {
534
- tabindex: 0,
535
- attrs: this.v3 ? undefined : {
536
- tabindex: 0,
537
- role: 'dialog',
538
- "aria-modal": this.$props.modal ? true : undefined,
539
- "aria-labelledby": this.titleId
540
- },
541
- onFocus: function onFocus(e) {
542
- return e.target.classList.add('k-focus');
543
- },
544
- on: this.v3 ? undefined : {
545
- "focus": function onFocus(e) {
546
- return e.target.classList.add('k-focus');
547
- },
548
- "blur": function blur(e) {
549
- return e.target.classList.remove('k-focus');
550
- },
551
- "keydown": this.handleKeyDown
552
- },
553
- onBlur: function blur(e) {
554
- return e.target.classList.remove('k-focus');
555
- },
556
- onKeydown: this.handleKeyDown,
557
- ref: 'windowElement',
558
- "class": this.windowElementClass,
559
- role: 'dialog',
560
- "aria-modal": this.$props.modal ? true : undefined,
561
- "aria-labelledby": this.titleId,
562
- style: __assign({
563
- top: this.computedTop + 'px',
564
- left: this.computedLeft + 'px',
565
- width: this.computedWidth + 'px',
566
- height: this.computedHeight + 'px' || ''
567
- }, this.$props.windowStyle)
568
- }, [
569
- // @ts-ignore function children
570
- h(Draggable, {
571
- onPress: this.onPress,
572
- on: this.v3 ? undefined : {
573
- "press": this.onPress,
574
- "drag": this.onDrag,
575
- "release": this.onRelease
576
- },
577
- onDrag: this.onDrag,
578
- onRelease: this.onRelease,
579
- ref: 'draggable'
580
- }, this.v3 ? function () {
581
- return [
582
- // @ts-ignore function children
583
- h(WindowTitleBar, {
584
- stage: _this.windowStage,
585
- attrs: _this.v3 ? undefined : {
586
- stage: _this.windowStage,
587
- title: _this.$props.title,
588
- titleId: _this.titleId,
589
- titleRender: titleRender,
590
- closeButton: closeButton,
591
- minimizeButton: minimizeButton,
592
- maximizeButton: maximizeButton,
593
- restoreButton: restoreButton
594
- },
595
- title: _this.$props.title,
596
- titleId: _this.titleId,
597
- titleRender: titleRender,
598
- onDoubleclick: _this.handleDoubleClick,
599
- on: _this.v3 ? undefined : {
600
- "doubleclick": _this.handleDoubleClick,
601
- "minimizeclick": _this.handleMinimize,
602
- "fullscreenclick": _this.handleFullscreen,
603
- "restoreclick": _this.handleRestore,
604
- "closeclick": _this.handleCloseWindow
605
- },
606
- onMinimizeclick: _this.handleMinimize,
607
- onFullscreenclick: _this.handleFullscreen,
608
- onRestoreclick: _this.handleRestore,
609
- onCloseclick: _this.handleCloseWindow,
610
- closeButton: closeButton,
611
- minimizeButton: minimizeButton,
612
- maximizeButton: maximizeButton,
613
- restoreButton: restoreButton
614
- })];
615
- } : [h(WindowTitleBar, {
616
- stage: _this.windowStage,
617
- attrs: _this.v3 ? undefined : {
618
- stage: _this.windowStage,
619
- title: _this.$props.title,
620
- titleId: _this.titleId,
621
- titleRender: titleRender,
622
- closeButton: closeButton,
623
- minimizeButton: minimizeButton,
624
- maximizeButton: maximizeButton,
625
- restoreButton: restoreButton
626
- },
627
- title: _this.$props.title,
628
- titleId: _this.titleId,
629
- titleRender: titleRender,
630
- onDoubleclick: _this.handleDoubleClick,
631
- on: _this.v3 ? undefined : {
632
- "doubleclick": _this.handleDoubleClick,
633
- "minimizeclick": _this.handleMinimize,
634
- "fullscreenclick": _this.handleFullscreen,
635
- "restoreclick": _this.handleRestore,
636
- "closeclick": _this.handleCloseWindow
637
- },
638
- onMinimizeclick: _this.handleMinimize,
639
- onFullscreenclick: _this.handleFullscreen,
640
- onRestoreclick: _this.handleRestore,
641
- onCloseclick: _this.handleCloseWindow,
642
- closeButton: closeButton,
643
- minimizeButton: minimizeButton,
644
- maximizeButton: maximizeButton,
645
- restoreButton: restoreButton
646
- })]), this.windowStage !== windowStage.MINIMIZED ? [h("div", {
647
- "class": "k-window-content"
648
- }, [defaultSlot]), actions] : null, this.windowStage === windowStage.DEFAULT && this.$props.resizable
649
- // @ts-ignore function children
650
- ? h(ResizeHandlers, {
651
- onResize: this.handleResize,
652
- on: this.v3 ? undefined : {
653
- "resize": this.handleResize
654
- }
655
- }) : null, watermark])]);
656
- return this.$props.appendTo ? h("div", [windowElement]) : windowElement;
657
- }
658
- };
659
- /**
660
- * @hidden
661
- */
662
- var Window = WindowVue2;
663
- export { Window, WindowVue2 };