@progress/kendo-react-dialogs 4.13.0-dev.202111300702 → 4.13.0
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/dist/cdn/js/kendo-react-dialogs.js +1 -1
- package/dist/es/Dialog.d.ts +22 -66
- package/dist/es/Dialog.js +53 -23
- package/dist/es/DialogProps.d.ts +63 -0
- package/dist/es/DialogProps.js +2 -0
- package/dist/es/Window.d.ts +29 -5
- package/dist/es/Window.js +146 -91
- package/dist/es/WindowProps.d.ts +4 -0
- package/dist/es/constants.d.ts +8 -0
- package/dist/es/constants.js +8 -0
- package/dist/es/main.d.ts +2 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/utils.d.ts +2 -0
- package/dist/es/utils.js +22 -0
- package/dist/npm/Dialog.d.ts +22 -66
- package/dist/npm/Dialog.js +52 -22
- package/dist/npm/DialogProps.d.ts +63 -0
- package/dist/npm/DialogProps.js +4 -0
- package/dist/npm/Window.d.ts +29 -5
- package/dist/npm/Window.js +145 -90
- package/dist/npm/WindowProps.d.ts +4 -0
- package/dist/npm/constants.d.ts +8 -0
- package/dist/npm/constants.js +10 -0
- package/dist/npm/main.d.ts +2 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/utils.d.ts +2 -0
- package/dist/npm/utils.js +24 -0
- package/dist/systemjs/kendo-react-dialogs.js +1 -1
- package/package.json +7 -2
package/dist/npm/Window.js
CHANGED
|
@@ -36,6 +36,8 @@ var StageEnum_1 = require("./StageEnum");
|
|
|
36
36
|
var kendo_react_common_3 = require("@progress/kendo-react-common");
|
|
37
37
|
var package_metadata_1 = require("./package-metadata");
|
|
38
38
|
var WindowActionsBar_1 = require("./WindowActionsBar");
|
|
39
|
+
var constants_1 = require("./constants");
|
|
40
|
+
var utils_1 = require("./utils");
|
|
39
41
|
var DEFAULT_WIDTH = 300;
|
|
40
42
|
var DEFAULT_HEIGHT = 300;
|
|
41
43
|
var DEFAULT_MIN_WIDTH = 120;
|
|
@@ -46,48 +48,11 @@ var Window = /** @class */ (function (_super) {
|
|
|
46
48
|
function Window(props) {
|
|
47
49
|
var _this = _super.call(this, props) || this;
|
|
48
50
|
_this.offSetCoordinates = { x: 0, y: 0 };
|
|
51
|
+
_this._id = kendo_react_common_1.guid();
|
|
49
52
|
/**
|
|
50
53
|
* @hidden
|
|
51
54
|
*/
|
|
52
|
-
_this.
|
|
53
|
-
var e = data.event;
|
|
54
|
-
_this.windowCoordinatesState.differenceLeft = e.pageX - _this.left;
|
|
55
|
-
_this.windowCoordinatesState.differenceTop = e.pageY - _this.top;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* @hidden
|
|
59
|
-
*/
|
|
60
|
-
_this.onDrag = function (data) {
|
|
61
|
-
var e = data.event;
|
|
62
|
-
e.originalEvent.preventDefault();
|
|
63
|
-
if (_this.windowStage !== StageEnum_1.windowStage.FULLSCREEN && _this.props.draggable) {
|
|
64
|
-
_this.setState({
|
|
65
|
-
top: Math.max(e.pageY - _this.windowCoordinatesState.differenceTop, 0),
|
|
66
|
-
left: e.pageX - _this.windowCoordinatesState.differenceLeft,
|
|
67
|
-
isDragging: true
|
|
68
|
-
});
|
|
69
|
-
if (_this.props.onMove) {
|
|
70
|
-
// eslint-disable-next-line max-len
|
|
71
|
-
_this.dispatchMoveEvent(_this.props.onMove, e, true, false);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* @hidden
|
|
77
|
-
*/
|
|
78
|
-
_this.onRelease = function (data) {
|
|
79
|
-
var e = data.event;
|
|
80
|
-
if (_this.windowStage !== StageEnum_1.windowStage.FULLSCREEN && _this.props.draggable) {
|
|
81
|
-
if (_this.props.onMove) {
|
|
82
|
-
_this.dispatchMoveEvent(_this.props.onMove, e, true, true);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
_this.setState({
|
|
86
|
-
isDragging: false
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
// Keyboard navigation
|
|
90
|
-
_this.handleKeyDown = function (event) {
|
|
55
|
+
_this.onKeyDown = function (event) {
|
|
91
56
|
if (event.target !== event.currentTarget) {
|
|
92
57
|
return;
|
|
93
58
|
}
|
|
@@ -168,6 +133,74 @@ var Window = /** @class */ (function (_super) {
|
|
|
168
133
|
}
|
|
169
134
|
_this.dispatchMoveEvent(_this.props.onMove, event, false, undefined);
|
|
170
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*/
|
|
139
|
+
_this.onPress = function (data) {
|
|
140
|
+
var e = data.event;
|
|
141
|
+
_this.windowCoordinatesState.differenceLeft = e.pageX - _this.left;
|
|
142
|
+
_this.windowCoordinatesState.differenceTop = e.pageY - _this.top;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @hidden
|
|
146
|
+
*/
|
|
147
|
+
_this.onDrag = function (data) {
|
|
148
|
+
var e = data.event;
|
|
149
|
+
e.originalEvent.preventDefault();
|
|
150
|
+
if (_this.windowStage !== StageEnum_1.windowStage.FULLSCREEN && _this.props.draggable) {
|
|
151
|
+
_this.setState({
|
|
152
|
+
top: Math.max(e.pageY - _this.windowCoordinatesState.differenceTop, 0),
|
|
153
|
+
left: e.pageX - _this.windowCoordinatesState.differenceLeft,
|
|
154
|
+
isDragging: true
|
|
155
|
+
});
|
|
156
|
+
if (_this.props.onMove) {
|
|
157
|
+
// eslint-disable-next-line max-len
|
|
158
|
+
_this.dispatchMoveEvent(_this.props.onMove, e, true, false);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* @hidden
|
|
164
|
+
*/
|
|
165
|
+
_this.onRelease = function (data) {
|
|
166
|
+
var e = data.event;
|
|
167
|
+
if (_this.windowStage !== StageEnum_1.windowStage.FULLSCREEN && _this.props.draggable) {
|
|
168
|
+
if (_this.props.onMove) {
|
|
169
|
+
_this.dispatchMoveEvent(_this.props.onMove, e, true, true);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
_this.setState({
|
|
173
|
+
isDragging: false
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* @hidden
|
|
178
|
+
*/
|
|
179
|
+
_this.onFocus = function () {
|
|
180
|
+
if (_this._blurTimeout) {
|
|
181
|
+
clearTimeout(_this._blurTimeout);
|
|
182
|
+
_this._blurTimeout = undefined;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
_this.setState({
|
|
186
|
+
focused: true,
|
|
187
|
+
zIndex: utils_1.getMaxZIndex(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* @hidden
|
|
193
|
+
*/
|
|
194
|
+
_this.onBlur = function () {
|
|
195
|
+
clearTimeout(_this._blurTimeout);
|
|
196
|
+
var currentWindow = _this.getWindow();
|
|
197
|
+
if (currentWindow) {
|
|
198
|
+
_this._blurTimeout = currentWindow.setTimeout(function () {
|
|
199
|
+
_this.setState({ focused: false });
|
|
200
|
+
_this._blurTimeout = undefined;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
171
204
|
// Get initial coordinates of the Window
|
|
172
205
|
_this.getInitialTop = function () {
|
|
173
206
|
if (_this.props.top !== undefined) {
|
|
@@ -186,7 +219,8 @@ var Window = /** @class */ (function (_super) {
|
|
|
186
219
|
if (_this.props.appendTo) {
|
|
187
220
|
return (_this.props.appendTo.offsetHeight / 2) - (height / 2);
|
|
188
221
|
}
|
|
189
|
-
|
|
222
|
+
var currentWindow = _this.getWindow();
|
|
223
|
+
return currentWindow ? (currentWindow.innerHeight / 2) - (height / 2) : 0;
|
|
190
224
|
};
|
|
191
225
|
_this.getInitialLeft = function () {
|
|
192
226
|
if (_this.props.left !== undefined) {
|
|
@@ -205,7 +239,8 @@ var Window = /** @class */ (function (_super) {
|
|
|
205
239
|
if (_this.props.appendTo) {
|
|
206
240
|
return (_this.props.appendTo.offsetWidth / 2) - (width / 2);
|
|
207
241
|
}
|
|
208
|
-
|
|
242
|
+
var currentWindow = _this.getWindow();
|
|
243
|
+
return currentWindow ? (currentWindow.innerWidth / 2) - (width / 2) : 0;
|
|
209
244
|
};
|
|
210
245
|
_this.getInitialWidth = function () {
|
|
211
246
|
var width = DEFAULT_WIDTH;
|
|
@@ -246,11 +281,14 @@ var Window = /** @class */ (function (_super) {
|
|
|
246
281
|
_this.windowCoordinatesState.topBeforeAction = _this.top;
|
|
247
282
|
_this.windowCoordinatesState.widthBeforeAction = _this.width;
|
|
248
283
|
_this.windowCoordinatesState.heightBeforeAction = _this.height;
|
|
284
|
+
var currentWindow = _this.getWindow();
|
|
285
|
+
var innerWidth = currentWindow ? currentWindow.innerWidth : 0;
|
|
286
|
+
var innerHeight = currentWindow ? currentWindow.innerHeight : 0;
|
|
249
287
|
_this.setState({
|
|
250
288
|
left: 0,
|
|
251
289
|
top: 0,
|
|
252
|
-
width: _this.props.appendTo ? _this.props.appendTo.offsetWidth :
|
|
253
|
-
height: _this.props.appendTo ? _this.props.appendTo.offsetHeight :
|
|
290
|
+
width: _this.props.appendTo ? _this.props.appendTo.offsetWidth : innerWidth,
|
|
291
|
+
height: _this.props.appendTo ? _this.props.appendTo.offsetHeight : innerHeight,
|
|
254
292
|
stage: StageEnum_1.windowStage.FULLSCREEN
|
|
255
293
|
});
|
|
256
294
|
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.FULLSCREEN });
|
|
@@ -339,27 +377,27 @@ var Window = /** @class */ (function (_super) {
|
|
|
339
377
|
};
|
|
340
378
|
_this.handleBrowserWindowResize = function () {
|
|
341
379
|
if (_this.windowStage === StageEnum_1.windowStage.FULLSCREEN) {
|
|
380
|
+
var currentWindow = _this.getWindow();
|
|
381
|
+
var innerWidth_1 = currentWindow ? currentWindow.innerWidth : 0;
|
|
382
|
+
var innerHeight_1 = currentWindow ? currentWindow.innerHeight : 0;
|
|
342
383
|
_this.setState({
|
|
343
|
-
width: _this.props.appendTo ? _this.props.appendTo.offsetWidth :
|
|
344
|
-
height: _this.props.appendTo ? _this.props.appendTo.offsetHeight :
|
|
384
|
+
width: _this.props.appendTo ? _this.props.appendTo.offsetWidth : innerWidth_1,
|
|
385
|
+
height: _this.props.appendTo ? _this.props.appendTo.offsetHeight : innerHeight_1
|
|
345
386
|
});
|
|
346
387
|
}
|
|
347
388
|
};
|
|
348
|
-
_this.
|
|
349
|
-
if (_this.state
|
|
350
|
-
|
|
351
|
-
var maxZindex_1 = 10002;
|
|
352
|
-
allWindows.forEach(function (KRwindow) {
|
|
353
|
-
var computedStyle = window.getComputedStyle(KRwindow, null);
|
|
354
|
-
var zIndexValue = parseInt(computedStyle.zIndex !== null ? computedStyle.zIndex : '10002', 10);
|
|
355
|
-
zIndexValue > maxZindex_1 ? maxZindex_1 = zIndexValue : null;
|
|
356
|
-
});
|
|
357
|
-
if (_this.windowElement && maxZindex_1.toString() === _this.windowElement.style.zIndex) {
|
|
358
|
-
return _this.windowElement.style.zIndex;
|
|
359
|
-
}
|
|
360
|
-
return (maxZindex_1 + 1).toString();
|
|
389
|
+
_this.getCurrentZIndex = function () {
|
|
390
|
+
if (!_this.state) {
|
|
391
|
+
return _this.context ? _this.context : constants_1.DEFAULT_DIALOGS_ZINDEX;
|
|
361
392
|
}
|
|
362
|
-
return _this.
|
|
393
|
+
return _this.state.zIndex > (_this.context ? _this.context + constants_1.ZINDEX_DIALOGS_STEP : 0) ? _this.state.zIndex : _this.context + constants_1.ZINDEX_DIALOGS_STEP;
|
|
394
|
+
};
|
|
395
|
+
_this.getDocument = function () {
|
|
396
|
+
return _this.props.appendTo ? _this.props.appendTo.ownerDocument : document;
|
|
397
|
+
};
|
|
398
|
+
_this.getWindow = function () {
|
|
399
|
+
var currentDocument = _this.getDocument();
|
|
400
|
+
return currentDocument && currentDocument.defaultView;
|
|
363
401
|
};
|
|
364
402
|
kendo_react_common_3.validatePackage(package_metadata_1.packageMetadata);
|
|
365
403
|
_this.state = {
|
|
@@ -369,7 +407,8 @@ var Window = /** @class */ (function (_super) {
|
|
|
369
407
|
left: _this.getInitialLeft(),
|
|
370
408
|
width: _this.getInitialWidth(),
|
|
371
409
|
height: _this.getInitialHeight(),
|
|
372
|
-
focused: true
|
|
410
|
+
focused: true,
|
|
411
|
+
zIndex: utils_1.getMaxZIndex(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
373
412
|
};
|
|
374
413
|
_this.windowCoordinatesState = {
|
|
375
414
|
leftBeforeAction: _this.getInitialLeft(),
|
|
@@ -383,12 +422,14 @@ var Window = /** @class */ (function (_super) {
|
|
|
383
422
|
* @hidden
|
|
384
423
|
*/
|
|
385
424
|
Window.prototype.componentDidMount = function () {
|
|
386
|
-
|
|
387
|
-
|
|
425
|
+
var currentWindow = this.getWindow();
|
|
426
|
+
if (currentWindow) {
|
|
427
|
+
currentWindow.addEventListener('resize', this.handleBrowserWindowResize);
|
|
388
428
|
}
|
|
389
|
-
|
|
429
|
+
var currentDocument = this.getDocument();
|
|
430
|
+
if (this.props.appendTo && currentDocument) {
|
|
390
431
|
var containerCoordinates = this.props.appendTo.getBoundingClientRect();
|
|
391
|
-
var bodyRect =
|
|
432
|
+
var bodyRect = currentDocument.body.getBoundingClientRect();
|
|
392
433
|
this.offSetCoordinates.x = containerCoordinates.left - bodyRect.left;
|
|
393
434
|
this.offSetCoordinates.y = containerCoordinates.top - bodyRect.top;
|
|
394
435
|
}
|
|
@@ -397,17 +438,19 @@ var Window = /** @class */ (function (_super) {
|
|
|
397
438
|
* @hidden
|
|
398
439
|
*/
|
|
399
440
|
Window.prototype.componentWillUnmount = function () {
|
|
400
|
-
|
|
401
|
-
|
|
441
|
+
var currentWindow = this.getWindow();
|
|
442
|
+
if (currentWindow) {
|
|
443
|
+
currentWindow.removeEventListener('resize', this.handleBrowserWindowResize);
|
|
402
444
|
}
|
|
403
445
|
};
|
|
404
446
|
/**
|
|
405
447
|
* @hidden
|
|
406
448
|
*/
|
|
407
449
|
Window.prototype.componentDidUpdate = function () {
|
|
408
|
-
|
|
450
|
+
var currentDocument = this.getDocument();
|
|
451
|
+
if (this.props.appendTo && currentDocument) {
|
|
409
452
|
var containerCoordinates = this.props.appendTo.getBoundingClientRect();
|
|
410
|
-
var bodyRect =
|
|
453
|
+
var bodyRect = currentDocument.body.getBoundingClientRect();
|
|
411
454
|
this.offSetCoordinates.x = containerCoordinates.left - bodyRect.left;
|
|
412
455
|
this.offSetCoordinates.y = containerCoordinates.top - bodyRect.top;
|
|
413
456
|
}
|
|
@@ -417,29 +460,35 @@ var Window = /** @class */ (function (_super) {
|
|
|
417
460
|
*/
|
|
418
461
|
Window.prototype.render = function () {
|
|
419
462
|
var _this = this;
|
|
463
|
+
var _a;
|
|
420
464
|
var elementsArray = React.Children.toArray(this.props.children);
|
|
421
465
|
var content = this.getContent(elementsArray);
|
|
422
466
|
var actions = this.getActionBar(elementsArray);
|
|
467
|
+
var currentZIndex = this.getCurrentZIndex();
|
|
423
468
|
var classNamesWindow = kendo_react_common_1.classNames('k-widget', 'k-window', this.props.className, { 'k-window-minimized': this.state.stage === 'MINIMIZED' }, { 'k-window-focused': this.state.focused });
|
|
424
|
-
var windowElement = (React.createElement(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
React.createElement(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
this.
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
469
|
+
var windowElement = (React.createElement(kendo_react_common_1.ZIndexContext.Provider, { value: currentZIndex },
|
|
470
|
+
React.createElement(React.Fragment, null,
|
|
471
|
+
this.props.modal && (React.createElement("div", { className: "k-overlay", style: __assign({ zIndex: currentZIndex }, this.props.overlayStyle) })),
|
|
472
|
+
React.createElement("div", __assign({}, (_a = {}, _a[constants_1.DATA_DIALOGS_ID] = this._id, _a), { tabIndex: 0, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, ref: function (el) {
|
|
473
|
+
_this.windowElement = el;
|
|
474
|
+
_this.element = el;
|
|
475
|
+
}, className: classNamesWindow, style: __assign({ top: this.top, left: this.left, width: this.width, height: this.height || '', zIndex: currentZIndex }, this.props.style) }),
|
|
476
|
+
React.createElement(MiddleLayerOptimization_1.MiddleLayerOptimization, { shouldUpdateOnDrag: this.props.shouldUpdateOnDrag || false, isDragging: this.state.isDragging },
|
|
477
|
+
React.createElement(kendo_react_common_2.Draggable, { onPress: this.onPress, onDrag: this.onDrag, onRelease: this.onRelease, ref: function (component) { return _this.draggable = component; } },
|
|
478
|
+
React.createElement(WindowTitlebar_1.WindowTitleBar, { stage: this.windowStage, onDoubleClick: this.props.doubleClickStageChange ? this.handleDoubleClick : undefined, onMinimizeButtonClick: this.handleMinimize, onFullScreenButtonClick: this.handleFullscreen, onRestoreButtonClick: this.handleRestore, onCloseButtonClick: this.handleCloseWindow, closeButton: this.props.closeButton, minimizeButton: this.props.minimizeButton, maximizeButton: this.props.maximizeButton, restoreButton: this.props.restoreButton }, this.props.title)),
|
|
479
|
+
this.windowStage !== StageEnum_1.windowStage.MINIMIZED
|
|
480
|
+
? (React.createElement(React.Fragment, null,
|
|
481
|
+
React.createElement("div", { className: "k-window-content" }, content),
|
|
482
|
+
actions))
|
|
483
|
+
: null,
|
|
484
|
+
this.windowStage === StageEnum_1.windowStage.DEFAULT &&
|
|
485
|
+
this.props.resizable
|
|
486
|
+
? React.createElement(WindowResizeHandlers_1.ResizeHandlers, { onResize: this.handleResize })
|
|
487
|
+
: null)))));
|
|
488
|
+
if (kendo_react_common_1.canUseDOM) {
|
|
489
|
+
return ReactDOM.createPortal(windowElement, this.props.appendTo || document.body);
|
|
441
490
|
}
|
|
442
|
-
return
|
|
491
|
+
return null;
|
|
443
492
|
};
|
|
444
493
|
Object.defineProperty(Window.prototype, "top", {
|
|
445
494
|
// Getters
|
|
@@ -470,7 +519,8 @@ var Window = /** @class */ (function (_super) {
|
|
|
470
519
|
width = this.props.appendTo.offsetWidth;
|
|
471
520
|
return width;
|
|
472
521
|
}
|
|
473
|
-
|
|
522
|
+
var currentWindow = this.getWindow();
|
|
523
|
+
width = currentWindow ? currentWindow.innerWidth : 0;
|
|
474
524
|
}
|
|
475
525
|
return width;
|
|
476
526
|
},
|
|
@@ -485,7 +535,8 @@ var Window = /** @class */ (function (_super) {
|
|
|
485
535
|
height = this.props.appendTo.offsetHeight;
|
|
486
536
|
return height;
|
|
487
537
|
}
|
|
488
|
-
|
|
538
|
+
var currentWindow = this.getWindow();
|
|
539
|
+
height = currentWindow ? currentWindow.innerHeight : 0;
|
|
489
540
|
}
|
|
490
541
|
else if (this.windowStage === StageEnum_1.windowStage.MINIMIZED) {
|
|
491
542
|
height = 0;
|
|
@@ -514,7 +565,6 @@ var Window = /** @class */ (function (_super) {
|
|
|
514
565
|
* @hidden
|
|
515
566
|
*/
|
|
516
567
|
Window.propTypes = {
|
|
517
|
-
id: PropTypes.string,
|
|
518
568
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
519
569
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
520
570
|
left: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -531,7 +581,8 @@ var Window = /** @class */ (function (_super) {
|
|
|
531
581
|
shouldUpdateOnDrag: PropTypes.bool,
|
|
532
582
|
stage: PropTypes.oneOf(['DEFAULT', 'MINIMIZED', 'FULLSCREEN']),
|
|
533
583
|
className: PropTypes.string,
|
|
534
|
-
style: PropTypes.object
|
|
584
|
+
style: PropTypes.object,
|
|
585
|
+
overlayStyle: PropTypes.object
|
|
535
586
|
};
|
|
536
587
|
/**
|
|
537
588
|
* @hidden
|
|
@@ -544,6 +595,10 @@ var Window = /** @class */ (function (_super) {
|
|
|
544
595
|
modal: false,
|
|
545
596
|
doubleClickStageChange: true
|
|
546
597
|
};
|
|
598
|
+
/**
|
|
599
|
+
* @hidden
|
|
600
|
+
*/
|
|
601
|
+
Window.contextType = kendo_react_common_1.ZIndexContext;
|
|
547
602
|
return Window;
|
|
548
603
|
}(React.Component));
|
|
549
604
|
exports.Window = Window;
|
|
@@ -106,6 +106,10 @@ export interface WindowProps {
|
|
|
106
106
|
* Set styles to the Window element.
|
|
107
107
|
*/
|
|
108
108
|
style?: React.CSSProperties;
|
|
109
|
+
/**
|
|
110
|
+
* Set styles to the Window overlay element rendered when the `modal` prop is enabled.
|
|
111
|
+
*/
|
|
112
|
+
overlayStyle?: React.CSSProperties;
|
|
109
113
|
/**
|
|
110
114
|
* Sets a class of the Window DOM element.
|
|
111
115
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @hidden */
|
|
2
|
+
export declare const DATA_DIALOGS_ID = "data-windowid";
|
|
3
|
+
/** @hidden */
|
|
4
|
+
export declare const DEFAULT_DIALOGS_ZINDEX = 10002;
|
|
5
|
+
/** @hidden */
|
|
6
|
+
export declare const ZINDEX_DIALOGS_STEP = 2;
|
|
7
|
+
/** @hidden */
|
|
8
|
+
export declare const DIALOGS_SELECTOR = ".k-window:not(.k-dialog), .k-dialog-wrapper";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** @hidden */
|
|
4
|
+
exports.DATA_DIALOGS_ID = 'data-windowid';
|
|
5
|
+
/** @hidden */
|
|
6
|
+
exports.DEFAULT_DIALOGS_ZINDEX = 10002;
|
|
7
|
+
/** @hidden */
|
|
8
|
+
exports.ZINDEX_DIALOGS_STEP = 2;
|
|
9
|
+
/** @hidden */
|
|
10
|
+
exports.DIALOGS_SELECTOR = '.k-window:not(.k-dialog), .k-dialog-wrapper';
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Dialog
|
|
1
|
+
import { Dialog } from './Dialog';
|
|
2
2
|
import { DialogActionsBar } from './DialogActionsBar';
|
|
3
3
|
import { Window } from './Window';
|
|
4
4
|
import { WindowProps } from './WindowProps';
|
|
5
5
|
import { WindowActionsBar } from './WindowActionsBar';
|
|
6
6
|
import { DialogCloseEvent, WindowActionsEvent, WindowMoveEvent } from './events';
|
|
7
7
|
import { ActionsLayout } from './models/actions-layout';
|
|
8
|
+
import { DialogProps } from './DialogProps';
|
|
8
9
|
export { Dialog, DialogProps, DialogActionsBar, DialogCloseEvent, Window, WindowProps, WindowActionsBar, WindowActionsEvent, WindowMoveEvent, ActionsLayout };
|
|
@@ -7,7 +7,7 @@ exports.packageMetadata = {
|
|
|
7
7
|
name: '@progress/kendo-react-dialogs',
|
|
8
8
|
productName: 'KendoReact',
|
|
9
9
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
-
publishDate:
|
|
10
|
+
publishDate: 1638880453,
|
|
11
11
|
version: '',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
13
13
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var constants_1 = require("./constants");
|
|
4
|
+
/** @hidden */
|
|
5
|
+
exports.getMaxZIndex = function (currentZIndex, currentDocument, currentWindowId) {
|
|
6
|
+
var maxZindex = currentZIndex;
|
|
7
|
+
if (currentDocument && currentDocument.defaultView) {
|
|
8
|
+
var allWindows = currentDocument.querySelectorAll(constants_1.DIALOGS_SELECTOR);
|
|
9
|
+
var zIndexChanged_1 = false;
|
|
10
|
+
allWindows.forEach(function (KRwindow) {
|
|
11
|
+
var computedStyle = currentDocument.defaultView.getComputedStyle(KRwindow, null);
|
|
12
|
+
var dataId = KRwindow.getAttribute(constants_1.DATA_DIALOGS_ID);
|
|
13
|
+
if (dataId !== currentWindowId && computedStyle.zIndex !== null) {
|
|
14
|
+
var zIndexValue = parseInt(computedStyle.zIndex, 10);
|
|
15
|
+
if (zIndexValue >= maxZindex) {
|
|
16
|
+
maxZindex = zIndexValue;
|
|
17
|
+
zIndexChanged_1 = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return zIndexChanged_1 ? (maxZindex + constants_1.ZINDEX_DIALOGS_STEP) : maxZindex;
|
|
22
|
+
}
|
|
23
|
+
return maxZindex;
|
|
24
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-react-dialogs",["react","react-dom","prop-types","@progress/kendo-react-common"],function(r){var a,s,p,d;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){a=t(e)},function(e){s=t(e)},function(e){p=t(e)},function(e){d=t(e)}],execute:function(){function i(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var n,o;n=[function(e,t){e.exports=a},function(e,t){e.exports=d},function(e,t){e.exports=p},function(e,t){e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(2),r=n(1);t.DialogActionsBar=function(e){var t=e.layout,t=void 0===t?a.layout:t,e=e.children,t=r.classNames("k-dialog-buttongroup","k-actions","k-hstack",{"k-justify-content-start":"start"===t,"k-justify-content-center":"center"===t,"k-justify-content-end":"end"===t,"k-justify-content-stretch":"stretched"===t});return o.createElement("div",{className:t},e)},t.DialogActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])};var a={layout:"stretched"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1638254659,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t=t.windowStage||(t.windowStage={})).DEFAULT="DEFAULT",t.FULLSCREEN="FULLSCREEN",t.MINIMIZED="MINIMIZED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(2),r=n(1);t.WindowActionsBar=function(e){var t=e.layout,t=void 0===t?a.layout:t,e=e.children,t=r.classNames("k-window-buttongroup","k-actions","k-hstack",{"k-justify-content-start":"start"===t,"k-justify-content-center":"center"===t,"k-justify-content-end":"end"===t,"k-justify-content-stretch":"stretched"===t});return o.createElement("div",{className:t},e)},t.WindowActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])};var a={layout:"end"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(9);t.Dialog=o.Dialog;o=n(4);t.DialogActionsBar=o.DialogActionsBar;o=n(11);t.Window=o.Window;n=n(7);t.WindowActionsBar=n.WindowActionsBar,function(e){for(var t in e)r(t,e[t])}(t)},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),u=this&&this.__assign||function(){return(u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var r,h=n(0),f=n(3),a=n(2),g=n(10),s=n(4),p=n(1),d=n(1),l=n(5),a=(r=h.Component,i(c,r),c.prototype.componentDidMount=function(){this.DialogRef.current&&this.props.autoFocus&&this.DialogRef.current.focus()},c.prototype.render=function(){var e=void 0!==this.props.id?this.props.id:this.titleId,t=this.props,n=t.title,o=t.width,i=t.height,r=t.children,a=t.minWidth,s=t.dir,p=t.style,d=t.contentStyle,l=h.Children.toArray(r),c=this.getContent(l),t=this.getActionBar(l),r=n?{"aria-labelledby":e}:null,l=void 0===this.props.closeIcon||this.props.closeIcon,t=h.createElement("div",{className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.handleKeyDown,tabIndex:0,dir:s,style:p,ref:this.DialogRef},h.createElement("div",{className:"k-overlay"}),h.createElement("div",u({},r,{className:"k-widget k-window k-dialog",role:"dialog",style:{width:o,height:i,minWidth:a}}),this.props.title&&h.createElement(g.DialogTitleBar,{closeIcon:l,onCloseButtonClick:this.handleCloseDialog,id:e},n),h.createElement("div",{className:"k-window-content k-dialog-content",style:d},c),t));return this.props.appendTo?f.createPortal(t,this.props.appendTo):t},c.prototype.getActionBar=function(e){return e.filter(function(e){return e&&e.type===s.DialogActionsBar})},c.prototype.getContent=function(e){return e.filter(function(e){return e&&e.type!==s.DialogActionsBar})},c.prototype.generateTitleId=function(){return"dialog-title"+p.guid()},c.propTypes={title:a.any,id:a.string,dir:a.string,style:a.object,closeIcon:a.bool,width:a.oneOfType([a.number,a.string]),height:a.oneOfType([a.number,a.string]),minWidth:a.oneOfType([a.number,a.string]),autoFocus:a.bool},c.defaultProps={autoFocus:!1},c);function c(e){var o=r.call(this,e)||this;return o.DialogRef=h.createRef(),o.titleId=o.generateTitleId(),o.handleCloseDialog=function(e){e.preventDefault(),p.dispatchEvent(o.props.onClose,e,o,void 0)},o.handleKeyDown=function(e){e.keyCode===p.Keys.esc&&o.props.onClose&&(e.preventDefault(),o.handleCloseDialog(e));var t,n=o.DialogRef.current;n&&e.keyCode===p.Keys.tab&&(n=(t=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))[0],t=t[t.length-1],e.shiftKey?document.activeElement===n&&(t.focus(),e.preventDefault()):document.activeElement===t&&(n.focus(),e.preventDefault()))},d.validatePackage(l.packageMetadata),o}t.Dialog=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.DialogTitleBar=function(e){var t=e.children,n=e.onCloseButtonClick,o=e.id,e=e.closeIcon;return i.createElement("div",{className:"k-window-titlebar k-dialog-titlebar k-header",id:o},i.createElement("div",{className:"k-window-title k-dialog-title"},t),i.createElement("div",{className:"k-window-actions k-dialog-actions"},e&&i.createElement("a",{href:"#",role:"button","aria-label":"Close",onClick:n,className:"k-button k-flat k-button-icon k-window-action k-dialog-action k-dialog-close"},i.createElement("span",{className:"k-icon k-i-x"}))))}},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var a,s=n(0),p=n(3),d=n(2),l=n(12),c=n(1),u=n(1),h=n(13),f=n(14),g=n(6),w=n(1),y=n(5),m=n(7),d=(a=s.Component,i(v,a),v.prototype.componentDidMount=function(){var e,t;window&&window.addEventListener("resize",this.handleBrowserWindowResize),this.props.appendTo&&(e=this.props.appendTo.getBoundingClientRect(),t=document.body.getBoundingClientRect(),this.offSetCoordinates.x=e.left-t.left,this.offSetCoordinates.y=e.top-t.top)},v.prototype.componentWillUnmount=function(){window&&window.removeEventListener("resize",this.handleBrowserWindowResize)},v.prototype.componentDidUpdate=function(){var e,t;this.props.appendTo&&(e=this.props.appendTo.getBoundingClientRect(),t=document.body.getBoundingClientRect(),this.offSetCoordinates.x=e.left-t.left,this.offSetCoordinates.y=e.top-t.top)},v.prototype.render=function(){var t=this,e=s.Children.toArray(this.props.children),n=this.getContent(e),o=this.getActionBar(e),e=c.classNames("k-widget","k-window",this.props.className,{"k-window-minimized":"MINIMIZED"===this.state.stage},{"k-window-focused":this.state.focused}),o=s.createElement(s.Fragment,null,this.props.modal&&s.createElement("div",{className:"k-overlay"}),s.createElement("div",{tabIndex:0,onFocus:function(){return t.setState({focused:!0})},onBlur:function(){return t.setState({focused:!1})},onKeyDown:this.handleKeyDown,ref:function(e){return t.windowElement=e},className:e,style:r({top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:this.setZindex()},this.props.style)},s.createElement(f.MiddleLayerOptimization,{shouldUpdateOnDrag:this.props.shouldUpdateOnDrag||!1,isDragging:this.state.isDragging},s.createElement(u.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:function(e){return t.draggable=e}},s.createElement(l.WindowTitleBar,{stage:this.windowStage,onDoubleClick:this.props.doubleClickStageChange?this.handleDoubleClick:void 0,onMinimizeButtonClick:this.handleMinimize,onFullScreenButtonClick:this.handleFullscreen,onRestoreButtonClick:this.handleRestore,onCloseButtonClick:this.handleCloseWindow,closeButton:this.props.closeButton,minimizeButton:this.props.minimizeButton,maximizeButton:this.props.maximizeButton,restoreButton:this.props.restoreButton},this.props.title)),this.windowStage!==g.windowStage.MINIMIZED?s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},n),o):null,this.windowStage===g.windowStage.DEFAULT&&this.props.resizable?s.createElement(h.ResizeHandlers,{onResize:this.handleResize}):null)));return this.props.appendTo?p.createPortal(o,this.props.appendTo):o},Object.defineProperty(v.prototype,"top",{get:function(){return this.windowStage!==g.windowStage.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"left",{get:function(){return this.windowStage!==g.windowStage.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"width",{get:function(){var e=this.props.width||this.state.width;if(this.windowStage===g.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetWidth;e=window.innerWidth}return e},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"height",{get:function(){var e=this.props.height||this.state.height;if(this.windowStage===g.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetHeight;e=window.innerHeight}else this.windowStage===g.windowStage.MINIMIZED&&(e=0);return e},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"windowStage",{get:function(){return this.props.stage||this.state.stage},enumerable:!0,configurable:!0}),v.prototype.getActionBar=function(e){return e.filter(function(e){return e&&e.type===m.WindowActionsBar})},v.prototype.getContent=function(e){return e.filter(function(e){return e&&e.type!==m.WindowActionsBar})},v.propTypes={id:d.string,width:d.oneOfType([d.number,d.string]),height:d.oneOfType([d.number,d.string]),left:d.oneOfType([d.number,d.string]),top:d.oneOfType([d.number,d.string]),initialwidth:d.oneOfType([d.number,d.string]),initialHeight:d.oneOfType([d.number,d.string]),initialLeft:d.oneOfType([d.number,d.string]),initialTop:d.oneOfType([d.number,d.string]),minWidth:d.oneOfType([d.number,d.string]),minHeight:d.oneOfType([d.number,d.string]),resizable:d.bool,draggable:d.bool,title:d.any,shouldUpdateOnDrag:d.bool,stage:d.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:d.string,style:d.object},v.defaultProps={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0},v);function v(e){var h=a.call(this,e)||this;return h.offSetCoordinates={x:0,y:0},h.onPress=function(e){e=e.event;h.windowCoordinatesState.differenceLeft=e.pageX-h.left,h.windowCoordinatesState.differenceTop=e.pageY-h.top},h.onDrag=function(e){e=e.event;e.originalEvent.preventDefault(),h.windowStage!==g.windowStage.FULLSCREEN&&h.props.draggable&&(h.setState({top:Math.max(e.pageY-h.windowCoordinatesState.differenceTop,0),left:e.pageX-h.windowCoordinatesState.differenceLeft,isDragging:!0}),h.props.onMove&&h.dispatchMoveEvent(h.props.onMove,e,!0,!1))},h.onRelease=function(e){e=e.event;h.windowStage!==g.windowStage.FULLSCREEN&&h.props.draggable&&h.props.onMove&&h.dispatchMoveEvent(h.props.onMove,e,!0,!0),h.setState({isDragging:!1})},h.handleKeyDown=function(e){if(e.target===e.currentTarget){var t=h.props.minWidth||120,n=h.props.minHeight||100;if(e.ctrlKey&&h.props.resizable){switch(e.keyCode){case c.Keys.up:e.preventDefault(),n<=h.height-5&&h.setState({height:h.height-5});break;case c.Keys.down:e.preventDefault(),h.setState({height:h.height+5});break;case c.Keys.left:t<=h.width-5&&h.setState({width:h.width-5});break;case c.Keys.right:h.setState({width:h.width+5});break;default:return}h.dispatchMoveEvent(h.props.onResize,e,!1,void 0)}else if(e.altKey)switch(e.keyCode){case c.Keys.up:h.windowStage===g.windowStage.MINIMIZED?(h.handleRestore(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.DEFAULT})):h.windowStage===g.windowStage.DEFAULT&&(h.handleFullscreen(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.FULLSCREEN}));break;case c.Keys.down:h.windowStage===g.windowStage.FULLSCREEN?(h.handleRestore(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.DEFAULT})):h.windowStage===g.windowStage.DEFAULT&&(h.handleMinimize(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.MINIMIZED}))}else{if(!e.ctrlKey)switch(e.keyCode){case c.Keys.esc:return void(h.props.onClose&&h.handleCloseWindow(e));case c.Keys.up:h.setState({top:h.state.top-5});break;case c.Keys.down:h.setState({top:h.state.top+5});break;case c.Keys.left:h.setState({left:h.state.left-5});break;case c.Keys.right:h.setState({left:h.state.left+5});break;default:return}h.dispatchMoveEvent(h.props.onMove,e,!1,void 0)}}},h.getInitialTop=function(){if(void 0!==h.props.top)return h.props.top;if(void 0!==h.props.initialTop)return h.props.initialTop;var e=300;return void 0!==h.props.height?e=h.props.height:void 0!==h.props.initialHeight&&(e=h.props.initialHeight),h.props.appendTo?h.props.appendTo.offsetHeight/2-e/2:window.innerHeight/2-e/2},h.getInitialLeft=function(){if(void 0!==h.props.left)return h.props.left;if(void 0!==h.props.initialLeft)return h.props.initialLeft;var e=300;return void 0!==h.props.width?e=h.props.width:void 0!==h.props.initialWidth&&(e=h.props.initialWidth),h.props.appendTo?h.props.appendTo.offsetWidth/2-e/2:window.innerWidth/2-e/2},h.getInitialWidth=function(){var e=300;return void 0!==h.props.width?e=h.props.width:void 0!==h.props.initialWidth&&(e=h.props.initialWidth),e},h.getInitialHeight=function(){var e=300;return void 0!==h.props.height?e=h.props.height:void 0!==h.props.initialHeight&&(e=h.props.initialHeight),e},h.handleMinimize=function(e){e.preventDefault(),h.windowCoordinatesState.leftBeforeAction=h.left,h.windowCoordinatesState.topBeforeAction=h.top,h.windowCoordinatesState.widthBeforeAction=h.width,h.windowCoordinatesState.heightBeforeAction=h.height,h.setState({stage:g.windowStage.MINIMIZED,height:0}),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.MINIMIZED})},h.handleFullscreen=function(e){e.preventDefault(),h.windowCoordinatesState.leftBeforeAction=h.left,h.windowCoordinatesState.topBeforeAction=h.top,h.windowCoordinatesState.widthBeforeAction=h.width,h.windowCoordinatesState.heightBeforeAction=h.height,h.setState({left:0,top:0,width:h.props.appendTo?h.props.appendTo.offsetWidth:window.innerWidth,height:h.props.appendTo?h.props.appendTo.offsetHeight:window.innerHeight,stage:g.windowStage.FULLSCREEN}),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.FULLSCREEN})},h.handleRestore=function(e){e.preventDefault(),h.windowStage===g.windowStage.FULLSCREEN?h.setState({stage:g.windowStage.DEFAULT,left:h.windowCoordinatesState.leftBeforeAction,top:h.windowCoordinatesState.topBeforeAction,width:h.windowCoordinatesState.widthBeforeAction,height:h.windowCoordinatesState.heightBeforeAction}):h.windowStage===g.windowStage.MINIMIZED&&h.setState({stage:g.windowStage.DEFAULT,height:h.windowCoordinatesState.heightBeforeAction}),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.DEFAULT})},h.handleCloseWindow=function(e){e.preventDefault(),c.dispatchEvent(h.props.onClose,e,h,{state:void 0})},h.handleDoubleClick=function(e){h.windowStage===g.windowStage.FULLSCREEN||h.windowStage===g.windowStage.MINIMIZED?h.handleRestore(e):h.handleFullscreen(e)},h.handleResize=function(e,t){var n=h.props.appendTo?e.pageX-h.offSetCoordinates.x:e.pageX,o=h.props.appendTo?e.pageY-h.offSetCoordinates.y:e.pageY,i=h.width,r=h.height,a=h.props.minWidth||120,s=h.props.minHeight||100,p=h.top-o,d=h.left-n,l=n-h.left,c=o-h.top,u=Object.assign({},h.state,{isDragging:!t.end});0<=t.direction.indexOf("n")&&s-(r+p)<0&&(0<h.top&&(u.height=r+p),u.top=o),0<=t.direction.indexOf("s")&&s-c<0&&(u.height=c),0<=t.direction.indexOf("w")&&a-(i+d)<0&&(0<h.left&&(u.width=i+d),u.left=n),0<=t.direction.indexOf("e")&&a-l<0&&(u.width=l),h.setState(u),h.dispatchMoveEvent(h.props.onResize,e,!0,t.end)},h.dispatchMoveEvent=function(e,t,n,o){e&&e.call(void 0,{nativeEvent:t.nativeEvent||t.originalEvent,drag:n,end:o,target:h,left:h.state.left,top:h.state.top,width:h.state.width,hight:h.state.height,height:h.state.height})},h.handleBrowserWindowResize=function(){h.windowStage===g.windowStage.FULLSCREEN&&h.setState({width:h.props.appendTo?h.props.appendTo.offsetWidth:window.innerWidth,height:h.props.appendTo?h.props.appendTo.offsetHeight:window.innerHeight})},h.setZindex=function(){if(h.state.focused){var e=document&&document.querySelectorAll(".k-window"),t=10002;return e.forEach(function(e){e=window.getComputedStyle(e,null),e=parseInt(null!==e.zIndex?e.zIndex:"10002",10);t<e&&(t=e)}),h.windowElement&&t.toString()===h.windowElement.style.zIndex?h.windowElement.style.zIndex:(t+1).toString()}return h.windowElement.style.zIndex},w.validatePackage(y.packageMetadata),h.state={stage:h.props.stage||g.windowStage.DEFAULT,isDragging:!1,top:h.getInitialTop(),left:h.getInitialLeft(),width:h.getInitialWidth(),height:h.getInitialHeight(),focused:!0},h.windowCoordinatesState={leftBeforeAction:h.getInitialLeft(),topBeforeAction:h.getInitialTop(),widthBeforeAction:h.getInitialWidth(),heightBeforeAction:h.getInitialHeight()},h}t.Window=d},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});function i(e){var t=e.children,n=e.onCloseButtonClick,o=e.onMinimizeButtonClick,i=e.onFullScreenButtonClick,r=e.onRestoreButtonClick,a=e.onDoubleClick,s=e.stage,p=e.forwardedRef,o=e.minimizeButton?d.createElement(e.minimizeButton,{onClick:o,stage:s}):d.createElement("button",{className:"k-button-icon k-button k-flat",onClick:o},d.createElement("span",{className:"k-icon k-i-window-minimize",role:"presentation"})),i=e.maximizeButton?d.createElement(e.maximizeButton,{onClick:i,stage:s}):d.createElement("button",{className:"k-button-icon k-button k-flat",onClick:i},d.createElement("span",{className:"k-icon k-i-window-maximize",role:"presentation"})),r=e.restoreButton?d.createElement(e.restoreButton,{onClick:r,stage:s}):d.createElement("button",{className:"k-button-icon k-button k-flat",onClick:r},d.createElement("span",{className:"k-icon k-i-window-restore",role:"presentation"})),n=e.closeButton?d.createElement(e.closeButton,{onClick:n,stage:s}):d.createElement("button",{className:"k-button-icon k-button k-flat",onClick:n},d.createElement("span",{className:"k-icon k-i-close",role:"presentation"}));return d.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",style:{touchAction:"none"},ref:p,onDoubleClick:a},d.createElement("div",{className:"k-window-title"},t||""),d.createElement("div",{className:"k-window-actions"},s===l.windowStage.DEFAULT&&o,s===l.windowStage.DEFAULT&&i,s!==l.windowStage.DEFAULT&&r,n))}var d=n(0),l=n(6);t.WindowTitleBar=d.forwardRef(function(e,t){return d.createElement(i,o({},e,{forwardedRef:t}))})},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(0),s=n(1),p=["n","e","s","w","se","sw","ne","nw"],i=(r=a.Component,i(d,r),d.prototype.render=function(){var n=this;return a.createElement("div",null," ",p.map(function(t,e){return a.createElement(s.Draggable,{key:e,onDrag:function(e){e=e.event;e.originalEvent.preventDefault(),n.props.onResize(e,{end:!1,direction:t})},onRelease:function(e){e=e.event;e.originalEvent.preventDefault(),n.props.onResize(e,{end:!0,direction:t})}},a.createElement("div",{className:"k-resize-handle k-resize-"+t,style:{display:"block",touchAction:"none"}}))}))},d);function d(){return null!==r&&r.apply(this,arguments)||this}t.ResizeHandlers=i},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var r,i=(r=n(0).Component,i(a,r),a.prototype.shouldComponentUpdate=function(e){return e.shouldUpdateOnDrag||!e.isDragging},a.prototype.render=function(){return this.props.children},a);function a(){return null!==r&&r.apply(this,arguments)||this}t.MiddleLayerOptimization=i}],o={},i.m=n,i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=8)}}});
|
|
1
|
+
System.register("@progress/kendo-react-dialogs",["react","react-dom","prop-types","@progress/kendo-react-common"],function(r){var a,s,d,p;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){a=t(e)},function(e){s=t(e)},function(e){d=t(e)},function(e){p=t(e)}],execute:function(){function i(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var n,o;o={},i.m=n=[function(e,t){e.exports=a},function(e,t){e.exports=p},function(e,t){e.exports=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DATA_DIALOGS_ID="data-windowid",t.DEFAULT_DIALOGS_ZINDEX=10002,t.ZINDEX_DIALOGS_STEP=2,t.DIALOGS_SELECTOR=".k-window:not(.k-dialog), .k-dialog-wrapper"},function(e,t){e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(2),r=n(1);t.DialogActionsBar=function(e){var t=e.layout,t=void 0===t?a.layout:t,e=e.children,t=r.classNames("k-dialog-buttongroup","k-actions","k-hstack",{"k-justify-content-start":"start"===t,"k-justify-content-center":"center"===t,"k-justify-content-end":"end"===t,"k-justify-content-stretch":"stretched"===t});return o.createElement("div",{className:t},e)},t.DialogActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])};var a={layout:"stretched"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1638880453,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(3);t.getMaxZIndex=function(e,n,o){var i=e;if(n&&n.defaultView){var e=n.querySelectorAll(a.DIALOGS_SELECTOR),r=!1;return e.forEach(function(e){var t=n.defaultView.getComputedStyle(e,null);e.getAttribute(a.DATA_DIALOGS_ID)!==o&&null!==t.zIndex&&(t=parseInt(t.zIndex,10),i<=t&&(i=t,r=!0))}),r?i+a.ZINDEX_DIALOGS_STEP:i}return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t=t.windowStage||(t.windowStage={})).DEFAULT="DEFAULT",t.FULLSCREEN="FULLSCREEN",t.MINIMIZED="MINIMIZED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(2),r=n(1);t.WindowActionsBar=function(e){var t=e.layout,t=void 0===t?a.layout:t,e=e.children,t=r.classNames("k-window-buttongroup","k-actions","k-hstack",{"k-justify-content-start":"start"===t,"k-justify-content-center":"center"===t,"k-justify-content-end":"end"===t,"k-justify-content-stretch":"stretched"===t});return o.createElement("div",{className:t},e)},t.WindowActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])};var a={layout:"end"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(11);t.Dialog=o.Dialog;o=n(5);t.DialogActionsBar=o.DialogActionsBar;o=n(13);t.Window=o.Window;n=n(9);t.WindowActionsBar=n.WindowActionsBar,function(e){for(var t in e)r(t,e[t])}(t)},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),g=this&&this.__assign||function(){return(g=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var r,w=n(0),m=n(4),a=n(2),y=n(12),s=n(5),v=n(1),d=n(1),p=n(6),l=n(7),S=n(3),a=(r=w.Component,i(c,r),c.prototype.componentDidMount=function(){this.element&&this.props.autoFocus&&this.element.focus()},c.prototype.render=function(){var t=this,e=void 0!==this.props.id?this.props.id:this.titleId,n=this.props,o=n.title,i=n.width,r=n.height,a=n.children,s=n.minWidth,d=n.dir,p=n.style,l=n.contentStyle,c=w.Children.toArray(a),u=this.getContent(c),h=this.getActionBar(c),f=o?{"aria-labelledby":e}:null,n=void 0===this.props.closeIcon||this.props.closeIcon,a=this.getCurrentZIndex(),h=w.createElement(v.ZIndexContext.Provider,{value:a},w.createElement("div",g({},((c={})[S.DATA_DIALOGS_ID]=this._id,c),{className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:d,style:g({zIndex:a},p),ref:function(e){return t.element=e}}),w.createElement("div",{className:"k-overlay"}),w.createElement("div",g({},f,{className:"k-widget k-window k-dialog",role:"dialog",style:{width:i,height:r,minWidth:s}}),this.props.title&&w.createElement(y.DialogTitleBar,{closeIcon:n,onCloseButtonClick:this.onCloseDialog,id:e},o),w.createElement("div",{className:"k-window-content k-dialog-content",style:l},u),h)));return v.canUseDOM?m.createPortal(h,this.props.appendTo||document.body):null},c.prototype.getActionBar=function(e){return e.filter(function(e){return e&&e.type===s.DialogActionsBar})},c.prototype.getContent=function(e){return e.filter(function(e){return e&&e.type!==s.DialogActionsBar})},c.prototype.generateTitleId=function(){return"dialog-title"+this._id},c.propTypes={title:a.any,id:a.string,dir:a.string,style:a.object,closeIcon:a.bool,width:a.oneOfType([a.number,a.string]),height:a.oneOfType([a.number,a.string]),minWidth:a.oneOfType([a.number,a.string]),autoFocus:a.bool},c.defaultProps={autoFocus:!1},c.contextType=v.ZIndexContext,c);function c(e){var i=r.call(this,e)||this;return i._id=v.guid(),i.titleId=i.generateTitleId(),i.onCloseDialog=function(e){e.preventDefault(),v.dispatchEvent(i.props.onClose,e,i,void 0)},i.onKeyDown=function(e){e.keyCode===v.Keys.esc&&i.props.onClose&&(e.preventDefault(),i.onCloseDialog(e));var t,n,o=i.element;o&&e.keyCode===v.Keys.tab&&(t=(n=o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))[0],o=n[n.length-1],n=i.getDocument(),e.shiftKey?n&&n.activeElement===t&&(o.focus(),e.preventDefault()):n&&n.activeElement===o&&(t.focus(),e.preventDefault()))},i.getCurrentZIndex=function(){return i.state?i.state.zIndex>(i.context?i.context+S.ZINDEX_DIALOGS_STEP:0)?i.state.zIndex:i.context+S.ZINDEX_DIALOGS_STEP:i.context||S.DEFAULT_DIALOGS_ZINDEX},i.getDocument=function(){return i.props.appendTo?i.props.appendTo.ownerDocument:document},d.validatePackage(p.packageMetadata),i.state={zIndex:l.getMaxZIndex(i.getCurrentZIndex(),i.getDocument(),i._id)},i}t.Dialog=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.DialogTitleBar=function(e){var t=e.children,n=e.onCloseButtonClick,o=e.id,e=e.closeIcon;return i.createElement("div",{className:"k-window-titlebar k-dialog-titlebar k-header",id:o},i.createElement("div",{className:"k-window-title k-dialog-title"},t),i.createElement("div",{className:"k-window-actions k-dialog-actions"},e&&i.createElement("a",{href:"#",role:"button","aria-label":"Close",onClick:n,className:"k-button k-flat k-button-icon k-window-action k-dialog-action k-dialog-close"},i.createElement("span",{className:"k-icon k-i-x"}))))}},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var r,s=n(0),d=n(4),p=n(2),l=n(14),c=n(1),u=n(1),h=n(15),f=n(16),g=n(8),w=n(1),m=n(6),y=n(9),v=n(3),S=n(7),p=(r=s.Component,i(E,r),E.prototype.componentDidMount=function(){var e=this.getWindow();e&&e.addEventListener("resize",this.handleBrowserWindowResize);var t=this.getDocument();this.props.appendTo&&t&&(e=this.props.appendTo.getBoundingClientRect(),t=t.body.getBoundingClientRect(),this.offSetCoordinates.x=e.left-t.left,this.offSetCoordinates.y=e.top-t.top)},E.prototype.componentWillUnmount=function(){var e=this.getWindow();e&&e.removeEventListener("resize",this.handleBrowserWindowResize)},E.prototype.componentDidUpdate=function(){var e,t=this.getDocument();this.props.appendTo&&t&&(e=this.props.appendTo.getBoundingClientRect(),t=t.body.getBoundingClientRect(),this.offSetCoordinates.x=e.left-t.left,this.offSetCoordinates.y=e.top-t.top)},E.prototype.render=function(){var t=this,e=s.Children.toArray(this.props.children),n=this.getContent(e),o=this.getActionBar(e),i=this.getCurrentZIndex(),r=c.classNames("k-widget","k-window",this.props.className,{"k-window-minimized":"MINIMIZED"===this.state.stage},{"k-window-focused":this.state.focused}),o=s.createElement(c.ZIndexContext.Provider,{value:i},s.createElement(s.Fragment,null,this.props.modal&&s.createElement("div",{className:"k-overlay",style:a({zIndex:i},this.props.overlayStyle)}),s.createElement("div",a({},((e={})[v.DATA_DIALOGS_ID]=this._id,e),{tabIndex:0,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,ref:function(e){t.windowElement=e,t.element=e},className:r,style:a({top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:i},this.props.style)}),s.createElement(f.MiddleLayerOptimization,{shouldUpdateOnDrag:this.props.shouldUpdateOnDrag||!1,isDragging:this.state.isDragging},s.createElement(u.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:function(e){return t.draggable=e}},s.createElement(l.WindowTitleBar,{stage:this.windowStage,onDoubleClick:this.props.doubleClickStageChange?this.handleDoubleClick:void 0,onMinimizeButtonClick:this.handleMinimize,onFullScreenButtonClick:this.handleFullscreen,onRestoreButtonClick:this.handleRestore,onCloseButtonClick:this.handleCloseWindow,closeButton:this.props.closeButton,minimizeButton:this.props.minimizeButton,maximizeButton:this.props.maximizeButton,restoreButton:this.props.restoreButton},this.props.title)),this.windowStage!==g.windowStage.MINIMIZED?s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},n),o):null,this.windowStage===g.windowStage.DEFAULT&&this.props.resizable?s.createElement(h.ResizeHandlers,{onResize:this.handleResize}):null))));return c.canUseDOM?d.createPortal(o,this.props.appendTo||document.body):null},Object.defineProperty(E.prototype,"top",{get:function(){return this.windowStage!==g.windowStage.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"left",{get:function(){return this.windowStage!==g.windowStage.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"width",{get:function(){var e=this.props.width||this.state.width;if(this.windowStage===g.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetWidth;var t=this.getWindow(),e=t?t.innerWidth:0}return e},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"height",{get:function(){var e=this.props.height||this.state.height;if(this.windowStage===g.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetHeight;var t=this.getWindow(),e=t?t.innerHeight:0}else this.windowStage===g.windowStage.MINIMIZED&&(e=0);return e},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"windowStage",{get:function(){return this.props.stage||this.state.stage},enumerable:!0,configurable:!0}),E.prototype.getActionBar=function(e){return e.filter(function(e){return e&&e.type===y.WindowActionsBar})},E.prototype.getContent=function(e){return e.filter(function(e){return e&&e.type!==y.WindowActionsBar})},E.propTypes={width:p.oneOfType([p.number,p.string]),height:p.oneOfType([p.number,p.string]),left:p.oneOfType([p.number,p.string]),top:p.oneOfType([p.number,p.string]),initialwidth:p.oneOfType([p.number,p.string]),initialHeight:p.oneOfType([p.number,p.string]),initialLeft:p.oneOfType([p.number,p.string]),initialTop:p.oneOfType([p.number,p.string]),minWidth:p.oneOfType([p.number,p.string]),minHeight:p.oneOfType([p.number,p.string]),resizable:p.bool,draggable:p.bool,title:p.any,shouldUpdateOnDrag:p.bool,stage:p.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:p.string,style:p.object,overlayStyle:p.object},E.defaultProps={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0},E.contextType=c.ZIndexContext,E);function E(e){var h=r.call(this,e)||this;return h.offSetCoordinates={x:0,y:0},h._id=c.guid(),h.onKeyDown=function(e){if(e.target===e.currentTarget){var t=h.props.minWidth||120,n=h.props.minHeight||100;if(e.ctrlKey&&h.props.resizable){switch(e.keyCode){case c.Keys.up:e.preventDefault(),n<=h.height-5&&h.setState({height:h.height-5});break;case c.Keys.down:e.preventDefault(),h.setState({height:h.height+5});break;case c.Keys.left:t<=h.width-5&&h.setState({width:h.width-5});break;case c.Keys.right:h.setState({width:h.width+5});break;default:return}h.dispatchMoveEvent(h.props.onResize,e,!1,void 0)}else if(e.altKey)switch(e.keyCode){case c.Keys.up:h.windowStage===g.windowStage.MINIMIZED?(h.handleRestore(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.DEFAULT})):h.windowStage===g.windowStage.DEFAULT&&(h.handleFullscreen(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.FULLSCREEN}));break;case c.Keys.down:h.windowStage===g.windowStage.FULLSCREEN?(h.handleRestore(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.DEFAULT})):h.windowStage===g.windowStage.DEFAULT&&(h.handleMinimize(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.MINIMIZED}))}else{if(!e.ctrlKey)switch(e.keyCode){case c.Keys.esc:return void(h.props.onClose&&h.handleCloseWindow(e));case c.Keys.up:h.setState({top:h.state.top-5});break;case c.Keys.down:h.setState({top:h.state.top+5});break;case c.Keys.left:h.setState({left:h.state.left-5});break;case c.Keys.right:h.setState({left:h.state.left+5});break;default:return}h.dispatchMoveEvent(h.props.onMove,e,!1,void 0)}}},h.onPress=function(e){e=e.event;h.windowCoordinatesState.differenceLeft=e.pageX-h.left,h.windowCoordinatesState.differenceTop=e.pageY-h.top},h.onDrag=function(e){e=e.event;e.originalEvent.preventDefault(),h.windowStage!==g.windowStage.FULLSCREEN&&h.props.draggable&&(h.setState({top:Math.max(e.pageY-h.windowCoordinatesState.differenceTop,0),left:e.pageX-h.windowCoordinatesState.differenceLeft,isDragging:!0}),h.props.onMove&&h.dispatchMoveEvent(h.props.onMove,e,!0,!1))},h.onRelease=function(e){e=e.event;h.windowStage!==g.windowStage.FULLSCREEN&&h.props.draggable&&h.props.onMove&&h.dispatchMoveEvent(h.props.onMove,e,!0,!0),h.setState({isDragging:!1})},h.onFocus=function(){h._blurTimeout?(clearTimeout(h._blurTimeout),h._blurTimeout=void 0):h.setState({focused:!0,zIndex:S.getMaxZIndex(h.getCurrentZIndex(),h.getDocument(),h._id)})},h.onBlur=function(){clearTimeout(h._blurTimeout);var e=h.getWindow();e&&(h._blurTimeout=e.setTimeout(function(){h.setState({focused:!1}),h._blurTimeout=void 0}))},h.getInitialTop=function(){if(void 0!==h.props.top)return h.props.top;if(void 0!==h.props.initialTop)return h.props.initialTop;var e=300;if(void 0!==h.props.height?e=h.props.height:void 0!==h.props.initialHeight&&(e=h.props.initialHeight),h.props.appendTo)return h.props.appendTo.offsetHeight/2-e/2;var t=h.getWindow();return t?t.innerHeight/2-e/2:0},h.getInitialLeft=function(){if(void 0!==h.props.left)return h.props.left;if(void 0!==h.props.initialLeft)return h.props.initialLeft;var e=300;if(void 0!==h.props.width?e=h.props.width:void 0!==h.props.initialWidth&&(e=h.props.initialWidth),h.props.appendTo)return h.props.appendTo.offsetWidth/2-e/2;var t=h.getWindow();return t?t.innerWidth/2-e/2:0},h.getInitialWidth=function(){var e=300;return void 0!==h.props.width?e=h.props.width:void 0!==h.props.initialWidth&&(e=h.props.initialWidth),e},h.getInitialHeight=function(){var e=300;return void 0!==h.props.height?e=h.props.height:void 0!==h.props.initialHeight&&(e=h.props.initialHeight),e},h.handleMinimize=function(e){e.preventDefault(),h.windowCoordinatesState.leftBeforeAction=h.left,h.windowCoordinatesState.topBeforeAction=h.top,h.windowCoordinatesState.widthBeforeAction=h.width,h.windowCoordinatesState.heightBeforeAction=h.height,h.setState({stage:g.windowStage.MINIMIZED,height:0}),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.MINIMIZED})},h.handleFullscreen=function(e){e.preventDefault(),h.windowCoordinatesState.leftBeforeAction=h.left,h.windowCoordinatesState.topBeforeAction=h.top,h.windowCoordinatesState.widthBeforeAction=h.width,h.windowCoordinatesState.heightBeforeAction=h.height;var t=h.getWindow(),n=t?t.innerWidth:0,t=t?t.innerHeight:0;h.setState({left:0,top:0,width:h.props.appendTo?h.props.appendTo.offsetWidth:n,height:h.props.appendTo?h.props.appendTo.offsetHeight:t,stage:g.windowStage.FULLSCREEN}),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.FULLSCREEN})},h.handleRestore=function(e){e.preventDefault(),h.windowStage===g.windowStage.FULLSCREEN?h.setState({stage:g.windowStage.DEFAULT,left:h.windowCoordinatesState.leftBeforeAction,top:h.windowCoordinatesState.topBeforeAction,width:h.windowCoordinatesState.widthBeforeAction,height:h.windowCoordinatesState.heightBeforeAction}):h.windowStage===g.windowStage.MINIMIZED&&h.setState({stage:g.windowStage.DEFAULT,height:h.windowCoordinatesState.heightBeforeAction}),c.dispatchEvent(h.props.onStageChange,e,h,{state:g.windowStage.DEFAULT})},h.handleCloseWindow=function(e){e.preventDefault(),c.dispatchEvent(h.props.onClose,e,h,{state:void 0})},h.handleDoubleClick=function(e){h.windowStage===g.windowStage.FULLSCREEN||h.windowStage===g.windowStage.MINIMIZED?h.handleRestore(e):h.handleFullscreen(e)},h.handleResize=function(e,t){var n=h.props.appendTo?e.pageX-h.offSetCoordinates.x:e.pageX,o=h.props.appendTo?e.pageY-h.offSetCoordinates.y:e.pageY,i=h.width,r=h.height,a=h.props.minWidth||120,s=h.props.minHeight||100,d=h.top-o,p=h.left-n,l=n-h.left,c=o-h.top,u=Object.assign({},h.state,{isDragging:!t.end});0<=t.direction.indexOf("n")&&s-(r+d)<0&&(0<h.top&&(u.height=r+d),u.top=o),0<=t.direction.indexOf("s")&&s-c<0&&(u.height=c),0<=t.direction.indexOf("w")&&a-(i+p)<0&&(0<h.left&&(u.width=i+p),u.left=n),0<=t.direction.indexOf("e")&&a-l<0&&(u.width=l),h.setState(u),h.dispatchMoveEvent(h.props.onResize,e,!0,t.end)},h.dispatchMoveEvent=function(e,t,n,o){e&&e.call(void 0,{nativeEvent:t.nativeEvent||t.originalEvent,drag:n,end:o,target:h,left:h.state.left,top:h.state.top,width:h.state.width,hight:h.state.height,height:h.state.height})},h.handleBrowserWindowResize=function(){var e,t;h.windowStage===g.windowStage.FULLSCREEN&&(e=(t=h.getWindow())?t.innerWidth:0,t=t?t.innerHeight:0,h.setState({width:h.props.appendTo?h.props.appendTo.offsetWidth:e,height:h.props.appendTo?h.props.appendTo.offsetHeight:t}))},h.getCurrentZIndex=function(){return h.state?h.state.zIndex>(h.context?h.context+v.ZINDEX_DIALOGS_STEP:0)?h.state.zIndex:h.context+v.ZINDEX_DIALOGS_STEP:h.context||v.DEFAULT_DIALOGS_ZINDEX},h.getDocument=function(){return h.props.appendTo?h.props.appendTo.ownerDocument:document},h.getWindow=function(){var e=h.getDocument();return e&&e.defaultView},w.validatePackage(m.packageMetadata),h.state={stage:h.props.stage||g.windowStage.DEFAULT,isDragging:!1,top:h.getInitialTop(),left:h.getInitialLeft(),width:h.getInitialWidth(),height:h.getInitialHeight(),focused:!0,zIndex:S.getMaxZIndex(h.getCurrentZIndex(),h.getDocument(),h._id)},h.windowCoordinatesState={leftBeforeAction:h.getInitialLeft(),topBeforeAction:h.getInitialTop(),widthBeforeAction:h.getInitialWidth(),heightBeforeAction:h.getInitialHeight()},h}t.Window=p},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});function i(e){var t=e.children,n=e.onCloseButtonClick,o=e.onMinimizeButtonClick,i=e.onFullScreenButtonClick,r=e.onRestoreButtonClick,a=e.onDoubleClick,s=e.stage,d=e.forwardedRef,o=e.minimizeButton?p.createElement(e.minimizeButton,{onClick:o,stage:s}):p.createElement("button",{className:"k-button-icon k-button k-flat",onClick:o},p.createElement("span",{className:"k-icon k-i-window-minimize",role:"presentation"})),i=e.maximizeButton?p.createElement(e.maximizeButton,{onClick:i,stage:s}):p.createElement("button",{className:"k-button-icon k-button k-flat",onClick:i},p.createElement("span",{className:"k-icon k-i-window-maximize",role:"presentation"})),r=e.restoreButton?p.createElement(e.restoreButton,{onClick:r,stage:s}):p.createElement("button",{className:"k-button-icon k-button k-flat",onClick:r},p.createElement("span",{className:"k-icon k-i-window-restore",role:"presentation"})),n=e.closeButton?p.createElement(e.closeButton,{onClick:n,stage:s}):p.createElement("button",{className:"k-button-icon k-button k-flat",onClick:n},p.createElement("span",{className:"k-icon k-i-close",role:"presentation"}));return p.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",style:{touchAction:"none"},ref:d,onDoubleClick:a},p.createElement("div",{className:"k-window-title"},t||""),p.createElement("div",{className:"k-window-actions"},s===l.windowStage.DEFAULT&&o,s===l.windowStage.DEFAULT&&i,s!==l.windowStage.DEFAULT&&r,n))}var p=n(0),l=n(8);t.WindowTitleBar=p.forwardRef(function(e,t){return p.createElement(i,o({},e,{forwardedRef:t}))})},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(0),s=n(1),d=["n","e","s","w","se","sw","ne","nw"],i=(r=a.Component,i(p,r),p.prototype.render=function(){var n=this;return a.createElement("div",null," ",d.map(function(t,e){return a.createElement(s.Draggable,{key:e,onDrag:function(e){e=e.event;e.originalEvent.preventDefault(),n.props.onResize(e,{end:!1,direction:t})},onRelease:function(e){e=e.event;e.originalEvent.preventDefault(),n.props.onResize(e,{end:!0,direction:t})}},a.createElement("div",{className:"k-resize-handle k-resize-"+t,style:{display:"block",touchAction:"none"}}))}))},p);function p(){return null!==r&&r.apply(this,arguments)||this}t.ResizeHandlers=i},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var r,i=(r=n(0).Component,i(a,r),a.prototype.shouldComponentUpdate=function(e){return e.shouldUpdateOnDrag||!e.isDragging},a.prototype.render=function(){return this.props.children},a);function a(){return null!==r&&r.apply(this,arguments)||this}t.MiddleLayerOptimization=i}],i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=10)}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dialogs",
|
|
3
|
-
"version": "4.13.0
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "KendoReact Dialogs package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,9 +35,14 @@
|
|
|
35
35
|
"react-dom": "^16.8.2 || ^17.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@progress/kendo-react-common": "4.13.0
|
|
38
|
+
"@progress/kendo-react-common": "4.13.0",
|
|
39
39
|
"prop-types": "^15.6.0"
|
|
40
40
|
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@progress/kendo-react-dropdowns": "4.10.0-dev.202110260913",
|
|
43
|
+
"@progress/kendo-react-intl": "4.10.0-dev.202110260913",
|
|
44
|
+
"@progress/kendo-react-tooltip": "4.10.0-dev.202110260913"
|
|
45
|
+
},
|
|
41
46
|
"@progress": {
|
|
42
47
|
"friendlyName": "Dialogs",
|
|
43
48
|
"framework": "KendoReact"
|