@progress/kendo-react-dialogs 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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 +8 -3
- package/dist/es/Dialog.js +5 -1
- package/dist/es/MiddleLayerOptimization.d.ts +1 -0
- package/dist/es/Window.d.ts +8 -3
- package/dist/es/Window.js +6 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/Dialog.d.ts +8 -3
- package/dist/npm/Dialog.js +11 -7
- package/dist/npm/DialogActionsBar.js +1 -1
- package/dist/npm/MiddleLayerOptimization.d.ts +1 -0
- package/dist/npm/Window.d.ts +8 -3
- package/dist/npm/Window.js +21 -16
- package/dist/npm/WindowActionsBar.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-dialogs.js +1 -1
- package/package.json +7 -7
package/dist/es/Dialog.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
3
4
|
import { DialogProps } from './DialogProps';
|
|
4
5
|
interface DialogState {
|
|
5
6
|
zIndex: number;
|
|
@@ -30,7 +31,11 @@ declare class DialogWithoutContext extends React.Component<DialogProps, DialogSt
|
|
|
30
31
|
/**
|
|
31
32
|
* @hidden
|
|
32
33
|
*/
|
|
33
|
-
static contextType: React.Context<
|
|
34
|
+
static contextType: React.Context<import("@progress/kendo-react-common").ZIndexContextType>;
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
context: React.ContextType<typeof ZIndexContext>;
|
|
34
39
|
/**
|
|
35
40
|
* @hidden
|
|
36
41
|
*/
|
|
@@ -49,11 +54,11 @@ declare class DialogWithoutContext extends React.Component<DialogProps, DialogSt
|
|
|
49
54
|
/**
|
|
50
55
|
* @hidden
|
|
51
56
|
*/
|
|
52
|
-
onKeyDown:
|
|
57
|
+
onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
|
53
58
|
/**
|
|
54
59
|
* @hidden
|
|
55
60
|
*/
|
|
56
|
-
render(): JSX.Element;
|
|
61
|
+
render(): JSX.Element | null;
|
|
57
62
|
private getActionBar;
|
|
58
63
|
private getContent;
|
|
59
64
|
private generateTitleId;
|
package/dist/es/Dialog.js
CHANGED
|
@@ -40,6 +40,10 @@ var DialogWithoutContext = /** @class */ (function (_super) {
|
|
|
40
40
|
__extends(DialogWithoutContext, _super);
|
|
41
41
|
function DialogWithoutContext(props) {
|
|
42
42
|
var _this = _super.call(this, props) || this;
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
_this.context = 0;
|
|
43
47
|
_this._id = guid();
|
|
44
48
|
_this.titleId = _this.generateTitleId();
|
|
45
49
|
/**
|
|
@@ -80,7 +84,7 @@ var DialogWithoutContext = /** @class */ (function (_super) {
|
|
|
80
84
|
}
|
|
81
85
|
};
|
|
82
86
|
_this.getCurrentZIndex = function () {
|
|
83
|
-
if (!_this.state) {
|
|
87
|
+
if (!_this.state || _this.context === undefined) {
|
|
84
88
|
return _this.context ? _this.context : DEFAULT_DIALOGS_ZINDEX;
|
|
85
89
|
}
|
|
86
90
|
return _this.state.zIndex > (_this.context ? _this.context + ZINDEX_DIALOGS_STEP : 0) ? _this.state.zIndex : _this.context + ZINDEX_DIALOGS_STEP;
|
package/dist/es/Window.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { WindowProps } from './WindowProps';
|
|
4
|
+
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
4
5
|
import { Draggable } from '@progress/kendo-react-common';
|
|
5
6
|
import { windowStage } from './StageEnum';
|
|
6
7
|
interface WindowState {
|
|
@@ -53,7 +54,11 @@ declare class WindowWithoutContext extends React.Component<WindowProps, WindowSt
|
|
|
53
54
|
/**
|
|
54
55
|
* @hidden
|
|
55
56
|
*/
|
|
56
|
-
static contextType: React.Context<
|
|
57
|
+
static contextType: React.Context<import("@progress/kendo-react-common").ZIndexContextType>;
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
context: React.ContextType<typeof ZIndexContext>;
|
|
57
62
|
/**
|
|
58
63
|
* **Deprecated.** Use `element` instead.
|
|
59
64
|
*/
|
|
@@ -87,7 +92,7 @@ declare class WindowWithoutContext extends React.Component<WindowProps, WindowSt
|
|
|
87
92
|
/**
|
|
88
93
|
* @hidden
|
|
89
94
|
*/
|
|
90
|
-
onKeyDown:
|
|
95
|
+
onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
|
91
96
|
/**
|
|
92
97
|
* @hidden
|
|
93
98
|
*/
|
|
@@ -111,7 +116,7 @@ declare class WindowWithoutContext extends React.Component<WindowProps, WindowSt
|
|
|
111
116
|
/**
|
|
112
117
|
* @hidden
|
|
113
118
|
*/
|
|
114
|
-
render(): JSX.Element;
|
|
119
|
+
render(): JSX.Element | null;
|
|
115
120
|
private get top();
|
|
116
121
|
private get left();
|
|
117
122
|
private get width();
|
package/dist/es/Window.js
CHANGED
|
@@ -48,6 +48,11 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
48
48
|
__extends(WindowWithoutContext, _super);
|
|
49
49
|
function WindowWithoutContext(props) {
|
|
50
50
|
var _this = _super.call(this, props) || this;
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
_this.context = 0;
|
|
55
|
+
_this.draggable = null;
|
|
51
56
|
_this.offSetCoordinates = { x: 0, y: 0 };
|
|
52
57
|
_this._id = guid();
|
|
53
58
|
/**
|
|
@@ -388,7 +393,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
388
393
|
}
|
|
389
394
|
};
|
|
390
395
|
_this.getCurrentZIndex = function () {
|
|
391
|
-
if (!_this.state) {
|
|
396
|
+
if (!_this.state || _this.context === undefined) {
|
|
392
397
|
return _this.context ? _this.context : DEFAULT_DIALOGS_ZINDEX;
|
|
393
398
|
}
|
|
394
399
|
return _this.state.zIndex > (_this.context ? _this.context + ZINDEX_DIALOGS_STEP : 0) ? _this.state.zIndex : _this.context + ZINDEX_DIALOGS_STEP;
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-dialogs',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1654762042,
|
|
9
9
|
version: '',
|
|
10
10
|
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'
|
|
11
11
|
};
|
package/dist/npm/Dialog.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
+
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
3
4
|
import { DialogProps } from './DialogProps';
|
|
4
5
|
interface DialogState {
|
|
5
6
|
zIndex: number;
|
|
@@ -30,7 +31,11 @@ declare class DialogWithoutContext extends React.Component<DialogProps, DialogSt
|
|
|
30
31
|
/**
|
|
31
32
|
* @hidden
|
|
32
33
|
*/
|
|
33
|
-
static contextType: React.Context<
|
|
34
|
+
static contextType: React.Context<import("@progress/kendo-react-common").ZIndexContextType>;
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
context: React.ContextType<typeof ZIndexContext>;
|
|
34
39
|
/**
|
|
35
40
|
* @hidden
|
|
36
41
|
*/
|
|
@@ -49,11 +54,11 @@ declare class DialogWithoutContext extends React.Component<DialogProps, DialogSt
|
|
|
49
54
|
/**
|
|
50
55
|
* @hidden
|
|
51
56
|
*/
|
|
52
|
-
onKeyDown:
|
|
57
|
+
onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
|
53
58
|
/**
|
|
54
59
|
* @hidden
|
|
55
60
|
*/
|
|
56
|
-
render(): JSX.Element;
|
|
61
|
+
render(): JSX.Element | null;
|
|
57
62
|
private getActionBar;
|
|
58
63
|
private getContent;
|
|
59
64
|
private generateTitleId;
|
package/dist/npm/Dialog.js
CHANGED
|
@@ -43,14 +43,18 @@ var DialogWithoutContext = /** @class */ (function (_super) {
|
|
|
43
43
|
__extends(DialogWithoutContext, _super);
|
|
44
44
|
function DialogWithoutContext(props) {
|
|
45
45
|
var _this = _super.call(this, props) || this;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
_this.context = 0;
|
|
50
|
+
_this._id = (0, kendo_react_common_1.guid)();
|
|
47
51
|
_this.titleId = _this.generateTitleId();
|
|
48
52
|
/**
|
|
49
53
|
* @hidden
|
|
50
54
|
*/
|
|
51
55
|
_this.onCloseDialog = function (event) {
|
|
52
56
|
event.preventDefault();
|
|
53
|
-
kendo_react_common_1.dispatchEvent(_this.props.onClose, event, _this, undefined);
|
|
57
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onClose, event, _this, undefined);
|
|
54
58
|
};
|
|
55
59
|
/**
|
|
56
60
|
* @hidden
|
|
@@ -83,7 +87,7 @@ var DialogWithoutContext = /** @class */ (function (_super) {
|
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
89
|
_this.getCurrentZIndex = function () {
|
|
86
|
-
if (!_this.state) {
|
|
90
|
+
if (!_this.state || _this.context === undefined) {
|
|
87
91
|
return _this.context ? _this.context : constants_1.DEFAULT_DIALOGS_ZINDEX;
|
|
88
92
|
}
|
|
89
93
|
return _this.state.zIndex > (_this.context ? _this.context + constants_1.ZINDEX_DIALOGS_STEP : 0) ? _this.state.zIndex : _this.context + constants_1.ZINDEX_DIALOGS_STEP;
|
|
@@ -91,9 +95,9 @@ var DialogWithoutContext = /** @class */ (function (_super) {
|
|
|
91
95
|
_this.getDocument = function () {
|
|
92
96
|
return _this.props.appendTo ? _this.props.appendTo.ownerDocument : document;
|
|
93
97
|
};
|
|
94
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
98
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
95
99
|
_this.state = {
|
|
96
|
-
zIndex: utils_1.getMaxZIndex(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
100
|
+
zIndex: (0, utils_1.getMaxZIndex)(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
97
101
|
};
|
|
98
102
|
return _this;
|
|
99
103
|
}
|
|
@@ -180,7 +184,7 @@ var DialogWithoutContext = /** @class */ (function (_super) {
|
|
|
180
184
|
* Represents the PropsContext of the `Dialog` component.
|
|
181
185
|
* Used for global configuration of all `Dialog` instances.
|
|
182
186
|
*/
|
|
183
|
-
exports.DialogPropsContext = kendo_react_common_1.createPropsContext();
|
|
187
|
+
exports.DialogPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
184
188
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
185
189
|
/**
|
|
186
190
|
* Represents the [KendoReact Dialog component]({% slug overview_dialog %}).
|
|
@@ -188,5 +192,5 @@ exports.DialogPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
188
192
|
* Accepts properties of type [DialogProps]({% slug api_dialogs_dialogprops %}).
|
|
189
193
|
* Obtaining the `ref` returns an object of type [DialogHandle]({% slug api_dialogs_dialoghandle %}).
|
|
190
194
|
*/
|
|
191
|
-
exports.Dialog = kendo_react_common_1.withPropsContext(exports.DialogPropsContext, DialogWithoutContext);
|
|
195
|
+
exports.Dialog = (0, kendo_react_common_1.withPropsContext)(exports.DialogPropsContext, DialogWithoutContext);
|
|
192
196
|
exports.Dialog.displayName = 'KendoReactDialog';
|
|
@@ -11,7 +11,7 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
11
11
|
*/
|
|
12
12
|
var DialogActionsBar = function (props) {
|
|
13
13
|
var _a = props.layout, layout = _a === void 0 ? defaultProps.layout : _a, children = props.children;
|
|
14
|
-
var wrapperClasses = kendo_react_common_1.classNames('k-dialog-buttongroup', 'k-actions', 'k-hstack', {
|
|
14
|
+
var wrapperClasses = (0, kendo_react_common_1.classNames)('k-dialog-buttongroup', 'k-actions', 'k-hstack', {
|
|
15
15
|
'k-justify-content-start': layout === 'start',
|
|
16
16
|
'k-justify-content-center': layout === 'center',
|
|
17
17
|
'k-justify-content-end': layout === 'end',
|
package/dist/npm/Window.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import { WindowProps } from './WindowProps';
|
|
4
|
+
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
4
5
|
import { Draggable } from '@progress/kendo-react-common';
|
|
5
6
|
import { windowStage } from './StageEnum';
|
|
6
7
|
interface WindowState {
|
|
@@ -53,7 +54,11 @@ declare class WindowWithoutContext extends React.Component<WindowProps, WindowSt
|
|
|
53
54
|
/**
|
|
54
55
|
* @hidden
|
|
55
56
|
*/
|
|
56
|
-
static contextType: React.Context<
|
|
57
|
+
static contextType: React.Context<import("@progress/kendo-react-common").ZIndexContextType>;
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
context: React.ContextType<typeof ZIndexContext>;
|
|
57
62
|
/**
|
|
58
63
|
* **Deprecated.** Use `element` instead.
|
|
59
64
|
*/
|
|
@@ -87,7 +92,7 @@ declare class WindowWithoutContext extends React.Component<WindowProps, WindowSt
|
|
|
87
92
|
/**
|
|
88
93
|
* @hidden
|
|
89
94
|
*/
|
|
90
|
-
onKeyDown:
|
|
95
|
+
onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
|
91
96
|
/**
|
|
92
97
|
* @hidden
|
|
93
98
|
*/
|
|
@@ -111,7 +116,7 @@ declare class WindowWithoutContext extends React.Component<WindowProps, WindowSt
|
|
|
111
116
|
/**
|
|
112
117
|
* @hidden
|
|
113
118
|
*/
|
|
114
|
-
render(): JSX.Element;
|
|
119
|
+
render(): JSX.Element | null;
|
|
115
120
|
private get top();
|
|
116
121
|
private get left();
|
|
117
122
|
private get width();
|
package/dist/npm/Window.js
CHANGED
|
@@ -51,8 +51,13 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
51
51
|
__extends(WindowWithoutContext, _super);
|
|
52
52
|
function WindowWithoutContext(props) {
|
|
53
53
|
var _this = _super.call(this, props) || this;
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
_this.context = 0;
|
|
58
|
+
_this.draggable = null;
|
|
54
59
|
_this.offSetCoordinates = { x: 0, y: 0 };
|
|
55
|
-
_this._id = kendo_react_common_1.guid();
|
|
60
|
+
_this._id = (0, kendo_react_common_1.guid)();
|
|
56
61
|
/**
|
|
57
62
|
* @hidden
|
|
58
63
|
*/
|
|
@@ -92,21 +97,21 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
92
97
|
case kendo_react_common_1.Keys.up:
|
|
93
98
|
if (_this.windowStage === StageEnum_1.windowStage.MINIMIZED) {
|
|
94
99
|
_this.handleRestore(event);
|
|
95
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.DEFAULT });
|
|
100
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.DEFAULT });
|
|
96
101
|
}
|
|
97
102
|
else if (_this.windowStage === StageEnum_1.windowStage.DEFAULT) {
|
|
98
103
|
_this.handleFullscreen(event);
|
|
99
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.FULLSCREEN });
|
|
104
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.FULLSCREEN });
|
|
100
105
|
}
|
|
101
106
|
break;
|
|
102
107
|
case kendo_react_common_1.Keys.down:
|
|
103
108
|
if (_this.windowStage === StageEnum_1.windowStage.FULLSCREEN) {
|
|
104
109
|
_this.handleRestore(event);
|
|
105
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.DEFAULT });
|
|
110
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.DEFAULT });
|
|
106
111
|
}
|
|
107
112
|
else if (_this.windowStage === StageEnum_1.windowStage.DEFAULT) {
|
|
108
113
|
_this.handleMinimize(event);
|
|
109
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.MINIMIZED });
|
|
114
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.MINIMIZED });
|
|
110
115
|
}
|
|
111
116
|
break;
|
|
112
117
|
default:
|
|
@@ -188,7 +193,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
188
193
|
else {
|
|
189
194
|
_this.setState({
|
|
190
195
|
focused: true,
|
|
191
|
-
zIndex: utils_1.getMaxZIndex(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
196
|
+
zIndex: (0, utils_1.getMaxZIndex)(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
192
197
|
});
|
|
193
198
|
}
|
|
194
199
|
};
|
|
@@ -277,7 +282,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
277
282
|
stage: StageEnum_1.windowStage.MINIMIZED,
|
|
278
283
|
height: 0
|
|
279
284
|
});
|
|
280
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.MINIMIZED });
|
|
285
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.MINIMIZED });
|
|
281
286
|
};
|
|
282
287
|
_this.handleFullscreen = function (event) {
|
|
283
288
|
event.preventDefault();
|
|
@@ -295,7 +300,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
295
300
|
height: _this.props.appendTo ? _this.props.appendTo.offsetHeight : innerHeight,
|
|
296
301
|
stage: StageEnum_1.windowStage.FULLSCREEN
|
|
297
302
|
});
|
|
298
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.FULLSCREEN });
|
|
303
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.FULLSCREEN });
|
|
299
304
|
};
|
|
300
305
|
_this.handleRestore = function (event) {
|
|
301
306
|
event.preventDefault();
|
|
@@ -314,11 +319,11 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
314
319
|
height: _this.windowCoordinatesState.heightBeforeAction
|
|
315
320
|
});
|
|
316
321
|
}
|
|
317
|
-
kendo_react_common_1.dispatchEvent(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.DEFAULT });
|
|
322
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onStageChange, event, _this, { state: StageEnum_1.windowStage.DEFAULT });
|
|
318
323
|
};
|
|
319
324
|
_this.handleCloseWindow = function (event) {
|
|
320
325
|
event.preventDefault();
|
|
321
|
-
kendo_react_common_1.dispatchEvent(_this.props.onClose, event, _this, { state: undefined });
|
|
326
|
+
(0, kendo_react_common_1.dispatchEvent)(_this.props.onClose, event, _this, { state: undefined });
|
|
322
327
|
};
|
|
323
328
|
_this.handleDoubleClick = function (e) {
|
|
324
329
|
if (_this.windowStage === StageEnum_1.windowStage.FULLSCREEN || _this.windowStage === StageEnum_1.windowStage.MINIMIZED) {
|
|
@@ -391,7 +396,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
391
396
|
}
|
|
392
397
|
};
|
|
393
398
|
_this.getCurrentZIndex = function () {
|
|
394
|
-
if (!_this.state) {
|
|
399
|
+
if (!_this.state || _this.context === undefined) {
|
|
395
400
|
return _this.context ? _this.context : constants_1.DEFAULT_DIALOGS_ZINDEX;
|
|
396
401
|
}
|
|
397
402
|
return _this.state.zIndex > (_this.context ? _this.context + constants_1.ZINDEX_DIALOGS_STEP : 0) ? _this.state.zIndex : _this.context + constants_1.ZINDEX_DIALOGS_STEP;
|
|
@@ -403,7 +408,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
403
408
|
var currentDocument = _this.getDocument();
|
|
404
409
|
return currentDocument && currentDocument.defaultView;
|
|
405
410
|
};
|
|
406
|
-
kendo_react_common_3.validatePackage(package_metadata_1.packageMetadata);
|
|
411
|
+
(0, kendo_react_common_3.validatePackage)(package_metadata_1.packageMetadata);
|
|
407
412
|
_this.state = {
|
|
408
413
|
stage: _this.props.stage || StageEnum_1.windowStage.DEFAULT,
|
|
409
414
|
isDragging: false,
|
|
@@ -412,7 +417,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
412
417
|
width: _this.getInitialWidth(),
|
|
413
418
|
height: _this.getInitialHeight(),
|
|
414
419
|
focused: true,
|
|
415
|
-
zIndex: utils_1.getMaxZIndex(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
420
|
+
zIndex: (0, utils_1.getMaxZIndex)(_this.getCurrentZIndex(), _this.getDocument(), _this._id)
|
|
416
421
|
};
|
|
417
422
|
_this.windowCoordinatesState = {
|
|
418
423
|
leftBeforeAction: _this.getInitialLeft(),
|
|
@@ -469,7 +474,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
469
474
|
var content = this.getContent(elementsArray);
|
|
470
475
|
var actions = this.getActionBar(elementsArray);
|
|
471
476
|
var currentZIndex = this.getCurrentZIndex();
|
|
472
|
-
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 });
|
|
477
|
+
var classNamesWindow = (0, 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 });
|
|
473
478
|
var windowElement = (React.createElement(kendo_react_common_1.ZIndexContext.Provider, { value: currentZIndex },
|
|
474
479
|
React.createElement(React.Fragment, null,
|
|
475
480
|
this.props.modal && (React.createElement("div", { className: "k-overlay", style: __assign({ zIndex: currentZIndex }, this.props.overlayStyle) })),
|
|
@@ -612,7 +617,7 @@ var WindowWithoutContext = /** @class */ (function (_super) {
|
|
|
612
617
|
* Represents the PropsContext of the `Window` component.
|
|
613
618
|
* Used for global configuration of all `Window` instances.
|
|
614
619
|
*/
|
|
615
|
-
exports.WindowPropsContext = kendo_react_common_2.createPropsContext();
|
|
620
|
+
exports.WindowPropsContext = (0, kendo_react_common_2.createPropsContext)();
|
|
616
621
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
617
622
|
/**
|
|
618
623
|
* Represents the [KendoReact Window component]({% slug overview_window %}).
|
|
@@ -620,5 +625,5 @@ exports.WindowPropsContext = kendo_react_common_2.createPropsContext();
|
|
|
620
625
|
* Accepts properties of type [WindowProps]({% slug api_dialogs_windowprops %}).
|
|
621
626
|
* Obtaining the `ref` returns an object of type [WindowHandle]({% slug api_dialogs_windowhandle %}).
|
|
622
627
|
*/
|
|
623
|
-
exports.Window = kendo_react_common_2.withPropsContext(exports.WindowPropsContext, WindowWithoutContext);
|
|
628
|
+
exports.Window = (0, kendo_react_common_2.withPropsContext)(exports.WindowPropsContext, WindowWithoutContext);
|
|
624
629
|
exports.Window.displayName = 'KendoReactWindow';
|
|
@@ -11,7 +11,7 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
11
11
|
*/
|
|
12
12
|
var WindowActionsBar = function (props) {
|
|
13
13
|
var _a = props.layout, layout = _a === void 0 ? defaultProps.layout : _a, children = props.children;
|
|
14
|
-
var wrapperClasses = kendo_react_common_1.classNames('k-window-buttongroup', 'k-actions', 'k-hstack', {
|
|
14
|
+
var wrapperClasses = (0, kendo_react_common_1.classNames)('k-window-buttongroup', 'k-actions', 'k-hstack', {
|
|
15
15
|
'k-justify-content-start': layout === 'start',
|
|
16
16
|
'k-justify-content-center': layout === 'center',
|
|
17
17
|
'k-justify-content-end': layout === 'end',
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-dialogs',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1654762042,
|
|
12
12
|
version: '',
|
|
13
13
|
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'
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-react-dialogs",["@progress/kendo-react-buttons","@progress/kendo-react-common","prop-types","react","react-dom"],function(e,t){var l={},p={},c={},u={},h={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(p,"__esModule",{value:!0}),Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(h,"__esModule",{value:!0}),{setters:[function(t){Object.keys(t).forEach(function(e){l[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){p[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){c[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){u[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){h[e]=t[e]})}],execute:function(){e((()=>{"use strict";var o={580:function(e,t,o){var n,r,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),f=this&&this.__assign||function(){return(f=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},w=(Object.defineProperty(t,"__esModule",{value:!0}),t.Dialog=t.DialogPropsContext=void 0,o(954)),y=o(493),a=o(895),v=o(348),s=o(379),m=o(811),d=o(811),l=o(363),p=o(147),E=o(56),o=(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,o=this.props,n=o.title,i=o.width,r=o.height,a=o.children,s=o.minWidth,d=o.dir,l=o.style,o=o.contentStyle,a=w.Children.toArray(a),p=this.getContent(a),a=this.getActionBar(a),c=n?{"aria-labelledby":e}:null,u=void 0===this.props.closeIcon||this.props.closeIcon,h=this.getCurrentZIndex(),g=w.createElement(m.ZIndexContext.Provider,{value:h},w.createElement("div",f({},((g={})[E.DATA_DIALOGS_ID]=this._id,g),{className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:d,style:f({zIndex:h},l),ref:function(e){return t.element=e}}),w.createElement("div",{className:"k-overlay"}),w.createElement("div",f({},c,{className:"k-widget k-window k-dialog",role:"dialog",style:{width:i,height:r,minWidth:s}}),this.props.title&&w.createElement(v.DialogTitleBar,{closeIcon:u,onCloseButtonClick:this.onCloseDialog,id:e},n),w.createElement("div",{className:"k-window-content k-dialog-content",style:o},p),a)));return m.canUseDOM?null!==this.props.appendTo?y.createPortal(g,this.props.appendTo||document.body):g: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.displayName="Dialog",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=m.ZIndexContext,c);function c(e){var i=r.call(this,e)||this;return i._id=m.guid(),i.titleId=i.generateTitleId(),i.onCloseDialog=function(e){e.preventDefault(),m.dispatchEvent(i.props.onClose,e,i,void 0)},i.onKeyDown=function(e){e.keyCode===m.Keys.esc&&i.props.onClose&&(e.preventDefault(),i.onCloseDialog(e));var t,o,n=i.element;n&&e.keyCode===m.Keys.tab&&(t=(n=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))[0],n=n[n.length-1],o=i.getDocument(),e.shiftKey?(o&&o.activeElement===t||o&&o.activeElement===i.element)&&(n.focus(),e.preventDefault()):o&&o.activeElement===n&&(t.focus(),e.preventDefault()))},i.getCurrentZIndex=function(){return i.state?i.state.zIndex>(i.context?i.context+E.ZINDEX_DIALOGS_STEP:0)?i.state.zIndex:i.context+E.ZINDEX_DIALOGS_STEP:i.context||E.DEFAULT_DIALOGS_ZINDEX},i.getDocument=function(){return i.props.appendTo?i.props.appendTo.ownerDocument:document},d.validatePackage(l.packageMetadata),i.state={zIndex:p.getMaxZIndex(i.getCurrentZIndex(),i.getDocument(),i._id)},i}t.DialogPropsContext=m.createPropsContext(),t.Dialog=m.withPropsContext(t.DialogPropsContext,o),t.Dialog.displayName="KendoReactDialog"},379:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DialogActionsBar=void 0;var n=o(954),i=o(895),r=o(811),a=(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 n.createElement("div",{className:t},e)},t.DialogActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])},{layout:"stretched"})},348:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DialogTitleBar=void 0;var i=o(954),r=o(536);t.DialogTitleBar=function(e){var t=e.children,o=e.onCloseButtonClick,n=e.id,e=e.closeIcon;return i.createElement("div",{className:"k-window-titlebar k-dialog-titlebar k-header",id:n},i.createElement("div",{className:"k-window-title k-dialog-title"},t),i.createElement("div",{className:"k-window-actions k-dialog-actions"},e&&i.createElement(r.Button,{role:"button","aria-label":"Close",onClick:o,icon:"x",fillMode:"flat",className:"k-window-action k-dialog-action k-dialog-close"})))}},522:function(e,t,o){var n,i,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),o=(Object.defineProperty(t,"__esModule",{value:!0}),t.MiddleLayerOptimization=void 0,i=o(954).Component,r(a,i),a.prototype.shouldComponentUpdate=function(e){return e.shouldUpdateOnDrag||!e.isDragging},a.prototype.render=function(){return this.props.children},a);function a(){return null!==i&&i.apply(this,arguments)||this}t.MiddleLayerOptimization=o},259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.windowStage=void 0,(t=t.windowStage||(t.windowStage={})).DEFAULT="DEFAULT",t.FULLSCREEN="FULLSCREEN",t.MINIMIZED="MINIMIZED"},891:function(e,t,o){var n,i,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},s=(Object.defineProperty(t,"__esModule",{value:!0}),t.Window=t.WindowPropsContext=void 0,o(954)),d=o(493),l=o(895),p=o(583),c=o(811),u=o(811),h=o(151),g=o(522),f=o(259),w=o(811),y=o(363),v=o(617),m=o(56),E=o(147),o=(i=s.Component,r(S,i),S.prototype.componentDidMount=function(){var e,t=this.getWindow(),t=(t&&t.addEventListener("resize",this.handleBrowserWindowResize),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)},S.prototype.componentWillUnmount=function(){var e=this.getWindow();e&&e.removeEventListener("resize",this.handleBrowserWindowResize)},S.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)},S.prototype.render=function(){var t=this,e=s.Children.toArray(this.props.children),o=this.getContent(e),e=this.getActionBar(e),n=this.getCurrentZIndex(),i=c.classNames("k-widget","k-window",this.props.className,{"k-window-minimized":"MINIMIZED"===this.state.stage},{"k-window-focused":this.state.focused}),r=s.createElement(c.ZIndexContext.Provider,{value:n},s.createElement(s.Fragment,null,this.props.modal&&s.createElement("div",{className:"k-overlay",style:a({zIndex:n},this.props.overlayStyle)}),s.createElement("div",a({},((r={})[m.DATA_DIALOGS_ID]=this._id,r),{tabIndex:0,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,ref:function(e){t.windowElement=e,t.element=e},className:i,style:a({top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:n},this.props.style)}),s.createElement(g.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(p.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!==f.windowStage.MINIMIZED?s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},o),e):null,this.windowStage===f.windowStage.DEFAULT&&this.props.resizable?s.createElement(h.ResizeHandlers,{onResize:this.handleResize}):null))));return c.canUseDOM?null!==this.props.appendTo?d.createPortal(r,this.props.appendTo||document.body):r:null},Object.defineProperty(S.prototype,"top",{get:function(){return this.windowStage!==f.windowStage.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"left",{get:function(){return this.windowStage!==f.windowStage.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"width",{get:function(){var e=this.props.width||this.state.width;if(this.windowStage===f.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetWidth;var t=this.getWindow(),e=t?t.innerWidth:0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"height",{get:function(){var e=this.props.height||this.state.height;if(this.windowStage===f.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetHeight;var t=this.getWindow(),e=t?t.innerHeight:0}else this.windowStage===f.windowStage.MINIMIZED&&(e=0);return e},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"windowStage",{get:function(){return this.props.stage||this.state.stage},enumerable:!1,configurable:!0}),S.prototype.getActionBar=function(e){return e.filter(function(e){return e&&e.type===v.WindowActionsBar})},S.prototype.getContent=function(e){return e.filter(function(e){return e&&e.type!==v.WindowActionsBar})},S.displayName="Window",S.propTypes={width:l.number,height:l.number,left:l.number,top:l.number,initialWidth:l.number,initialHeight:l.number,initialLeft:l.number,initialTop:l.number,minWidth:l.number,minHeight:l.number,resizable:l.bool,draggable:l.bool,title:l.any,shouldUpdateOnDrag:l.bool,stage:l.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:l.string,style:l.object,overlayStyle:l.object},S.defaultProps={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0},S.contextType=c.ZIndexContext,S);function S(e){var h=i.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,o=h.props.minHeight||100;if(e.ctrlKey&&h.props.resizable){switch(e.keyCode){case c.Keys.up:e.preventDefault(),o<=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===f.windowStage.MINIMIZED?(h.handleRestore(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.windowStage.DEFAULT})):h.windowStage===f.windowStage.DEFAULT&&(h.handleFullscreen(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.windowStage.FULLSCREEN}));break;case c.Keys.down:h.windowStage===f.windowStage.FULLSCREEN?(h.handleRestore(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.windowStage.DEFAULT})):h.windowStage===f.windowStage.DEFAULT&&(h.handleMinimize(e),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.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!==f.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!==f.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:E.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:f.windowStage.MINIMIZED,height:0}),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.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(),o=t?t.innerWidth:0,t=t?t.innerHeight:0;h.setState({left:0,top:0,width:h.props.appendTo?h.props.appendTo.offsetWidth:o,height:h.props.appendTo?h.props.appendTo.offsetHeight:t,stage:f.windowStage.FULLSCREEN}),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.windowStage.FULLSCREEN})},h.handleRestore=function(e){e.preventDefault(),h.windowStage===f.windowStage.FULLSCREEN?h.setState({stage:f.windowStage.DEFAULT,left:h.windowCoordinatesState.leftBeforeAction,top:h.windowCoordinatesState.topBeforeAction,width:h.windowCoordinatesState.widthBeforeAction,height:h.windowCoordinatesState.heightBeforeAction}):h.windowStage===f.windowStage.MINIMIZED&&h.setState({stage:f.windowStage.DEFAULT,height:h.windowCoordinatesState.heightBeforeAction}),c.dispatchEvent(h.props.onStageChange,e,h,{state:f.windowStage.DEFAULT})},h.handleCloseWindow=function(e){e.preventDefault(),c.dispatchEvent(h.props.onClose,e,h,{state:void 0})},h.handleDoubleClick=function(e){h.windowStage===f.windowStage.FULLSCREEN||h.windowStage===f.windowStage.MINIMIZED?h.handleRestore(e):h.handleFullscreen(e)},h.handleResize=function(e,t){var o=h.props.appendTo?e.pageX-h.offSetCoordinates.x:e.pageX,n=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-n,l=h.left-o,p=o-h.left,c=n-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=n),0<=t.direction.indexOf("s")&&s-c<0&&(u.height=c),0<=t.direction.indexOf("w")&&a-(i+l)<0&&(0<h.left&&(u.width=i+l),u.left=o),0<=t.direction.indexOf("e")&&a-p<0&&(u.width=p),h.setState(u),h.dispatchMoveEvent(h.props.onResize,e,!0,t.end)},h.dispatchMoveEvent=function(e,t,o,n){e&&e.call(void 0,{nativeEvent:t.nativeEvent||t.originalEvent,drag:o,end:n,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===f.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+m.ZINDEX_DIALOGS_STEP:0)?h.state.zIndex:h.context+m.ZINDEX_DIALOGS_STEP:h.context||m.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(y.packageMetadata),h.state={stage:h.props.stage||f.windowStage.DEFAULT,isDragging:!1,top:h.getInitialTop(),left:h.getInitialLeft(),width:h.getInitialWidth(),height:h.getInitialHeight(),focused:!0,zIndex:E.getMaxZIndex(h.getCurrentZIndex(),h.getDocument(),h._id)},h.windowCoordinatesState={leftBeforeAction:h.getInitialLeft(),topBeforeAction:h.getInitialTop(),widthBeforeAction:h.getInitialWidth(),heightBeforeAction:h.getInitialHeight()},h}t.WindowPropsContext=u.createPropsContext(),t.Window=u.withPropsContext(t.WindowPropsContext,o),t.Window.displayName="KendoReactWindow"},617:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowActionsBar=void 0;var n=o(954),i=o(895),r=o(811),a=(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 n.createElement("div",{className:t},e)},t.WindowActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])},{layout:"end"})},151:function(e,t,o){var n,i,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=(Object.defineProperty(t,"__esModule",{value:!0}),t.ResizeHandlers=void 0,o(954)),s=o(811),d=["n","e","s","w","se","sw","ne","nw"],o=(i=a.Component,r(l,i),l.prototype.render=function(){var o=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(),o.props.onResize(e,{end:!1,direction:t})},onRelease:function(e){e=e.event;e.originalEvent.preventDefault(),o.props.onResize(e,{end:!0,direction:t})}},a.createElement("div",{className:"k-resize-handle k-resize-"+t,style:{display:"block",touchAction:"none"}}))}))},l);function l(){return null!==i&&i.apply(this,arguments)||this}t.ResizeHandlers=o},583:function(e,t,o){function n(e){var t=e.children,o=e.onCloseButtonClick,n=e.onMinimizeButtonClick,i=e.onFullScreenButtonClick,r=e.onRestoreButtonClick,a=e.onDoubleClick,s=e.stage,d=e.forwardedRef,n=e.minimizeButton?l.createElement(e.minimizeButton,{onClick:n,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"window-minimize",onClick:n}),i=e.maximizeButton?l.createElement(e.maximizeButton,{onClick:i,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"window-maximize",onClick:i}),r=e.restoreButton?l.createElement(e.restoreButton,{onClick:r,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"window-restore",onClick:r}),e=e.closeButton?l.createElement(e.closeButton,{onClick:o,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"close",onClick:o});return l.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",style:{touchAction:"none"},ref:d,onDoubleClick:a},l.createElement("div",{className:"k-window-title"},t||""),l.createElement("div",{className:"k-window-actions"},s===p.windowStage.DEFAULT&&n,s===p.windowStage.DEFAULT&&i,s!==p.windowStage.DEFAULT&&r,e))}var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},l=(Object.defineProperty(t,"__esModule",{value:!0}),t.WindowTitleBar=void 0,o(954)),p=o(259),c=o(536);t.WindowTitleBar=l.forwardRef(function(e,t){return l.createElement(n,i({},e,{forwardedRef:t}))})},56:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DIALOGS_SELECTOR=t.ZINDEX_DIALOGS_STEP=t.DEFAULT_DIALOGS_ZINDEX=t.DATA_DIALOGS_ID=void 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"},363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata=void 0,t.packageMetadata={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1653648291,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"}},147:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxZIndex=void 0;var a=o(56);t.getMaxZIndex=function(e,o,n){var i,r=e;return o&&o.defaultView?(e=o.querySelectorAll(a.DIALOGS_SELECTOR),i=!1,e.forEach(function(e){var t=o.defaultView.getComputedStyle(e,null);e.getAttribute(a.DATA_DIALOGS_ID)!==n&&null!==t.zIndex&&(e=parseInt(t.zIndex,10),r<=e&&(r=e,i=!0))}),i?r+a.ZINDEX_DIALOGS_STEP:r):r}},536:e=>{e.exports=l},811:e=>{e.exports=p},895:e=>{e.exports=c},954:e=>{e.exports=u},493:e=>{e.exports=h}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;t=n[e]={exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}var e,t,r,a,s,d={};return e=d,Object.defineProperty(e,"__esModule",{value:!0}),e.WindowPropsContext=e.WindowActionsBar=e.Window=e.DialogPropsContext=e.DialogActionsBar=e.Dialog=void 0,t=i(580),Object.defineProperty(e,"Dialog",{enumerable:!0,get:function(){return t.Dialog}}),Object.defineProperty(e,"DialogPropsContext",{enumerable:!0,get:function(){return t.DialogPropsContext}}),r=i(379),Object.defineProperty(e,"DialogActionsBar",{enumerable:!0,get:function(){return r.DialogActionsBar}}),a=i(891),Object.defineProperty(e,"Window",{enumerable:!0,get:function(){return a.Window}}),Object.defineProperty(e,"WindowPropsContext",{enumerable:!0,get:function(){return a.WindowPropsContext}}),s=i(617),Object.defineProperty(e,"WindowActionsBar",{enumerable:!0,get:function(){return s.WindowActionsBar}}),d})())}}});
|
|
1
|
+
System.register("@progress/kendo-react-dialogs",["@progress/kendo-react-buttons","@progress/kendo-react-common","prop-types","react","react-dom"],function(l,e){var p={},c={},u={},h={},g={};return Object.defineProperty(p,"__esModule",{value:!0}),Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(h,"__esModule",{value:!0}),Object.defineProperty(g,"__esModule",{value:!0}),{setters:[function(t){Object.keys(t).forEach(function(e){p[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){c[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){u[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){h[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){g[e]=t[e]})}],execute:function(){function o(e){var t=i[e];if(void 0!==t)return t.exports;t=i[e]={exports:{}};return n[e].call(t.exports,t,t.exports,o),t.exports}var n,i,e,t,r,a,s,d;l((n={580:function(e,t,o){var n,r,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),f=this&&this.__assign||function(){return(f=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},w=(Object.defineProperty(t,"__esModule",{value:!0}),t.Dialog=t.DialogPropsContext=void 0,o(954)),y=o(493),a=o(895),v=o(348),s=o(379),m=o(811),d=o(811),l=o(363),p=o(147),E=o(56),o=(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,o=this.props,n=o.title,i=o.width,r=o.height,a=o.children,s=o.minWidth,d=o.dir,l=o.style,o=o.contentStyle,a=w.Children.toArray(a),p=this.getContent(a),a=this.getActionBar(a),c=n?{"aria-labelledby":e}:null,u=void 0===this.props.closeIcon||this.props.closeIcon,h=this.getCurrentZIndex(),g=w.createElement(m.ZIndexContext.Provider,{value:h},w.createElement("div",f({},((g={})[E.DATA_DIALOGS_ID]=this._id,g),{className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:d,style:f({zIndex:h},l),ref:function(e){return t.element=e}}),w.createElement("div",{className:"k-overlay"}),w.createElement("div",f({},c,{className:"k-widget k-window k-dialog",role:"dialog",style:{width:i,height:r,minWidth:s}}),this.props.title&&w.createElement(v.DialogTitleBar,{closeIcon:u,onCloseButtonClick:this.onCloseDialog,id:e},n),w.createElement("div",{className:"k-window-content k-dialog-content",style:o},p),a)));return m.canUseDOM?null!==this.props.appendTo?y.createPortal(g,this.props.appendTo||document.body):g: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.displayName="Dialog",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=m.ZIndexContext,c);function c(e){var i=r.call(this,e)||this;return i.context=0,i._id=(0,m.guid)(),i.titleId=i.generateTitleId(),i.onCloseDialog=function(e){e.preventDefault(),(0,m.dispatchEvent)(i.props.onClose,e,i,void 0)},i.onKeyDown=function(e){e.keyCode===m.Keys.esc&&i.props.onClose&&(e.preventDefault(),i.onCloseDialog(e));var t,o,n=i.element;n&&e.keyCode===m.Keys.tab&&(t=(n=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))[0],n=n[n.length-1],o=i.getDocument(),e.shiftKey?(o&&o.activeElement===t||o&&o.activeElement===i.element)&&(n.focus(),e.preventDefault()):o&&o.activeElement===n&&(t.focus(),e.preventDefault()))},i.getCurrentZIndex=function(){return i.state&&void 0!==i.context?i.state.zIndex>(i.context?i.context+E.ZINDEX_DIALOGS_STEP:0)?i.state.zIndex:i.context+E.ZINDEX_DIALOGS_STEP:i.context||E.DEFAULT_DIALOGS_ZINDEX},i.getDocument=function(){return i.props.appendTo?i.props.appendTo.ownerDocument:document},(0,d.validatePackage)(l.packageMetadata),i.state={zIndex:(0,p.getMaxZIndex)(i.getCurrentZIndex(),i.getDocument(),i._id)},i}t.DialogPropsContext=(0,m.createPropsContext)(),t.Dialog=(0,m.withPropsContext)(t.DialogPropsContext,o),t.Dialog.displayName="KendoReactDialog"},379:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DialogActionsBar=void 0;var n=o(954),i=o(895),r=o(811),a=(t.DialogActionsBar=function(e){var t=e.layout,t=void 0===t?a.layout:t,e=e.children,t=(0,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 n.createElement("div",{className:t},e)},t.DialogActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])},{layout:"stretched"})},348:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DialogTitleBar=void 0;var i=o(954),r=o(536);t.DialogTitleBar=function(e){var t=e.children,o=e.onCloseButtonClick,n=e.id,e=e.closeIcon;return i.createElement("div",{className:"k-window-titlebar k-dialog-titlebar k-header",id:n},i.createElement("div",{className:"k-window-title k-dialog-title"},t),i.createElement("div",{className:"k-window-actions k-dialog-actions"},e&&i.createElement(r.Button,{role:"button","aria-label":"Close",onClick:o,icon:"x",fillMode:"flat",className:"k-window-action k-dialog-action k-dialog-close"})))}},522:function(e,t,o){var n,i,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),o=(Object.defineProperty(t,"__esModule",{value:!0}),t.MiddleLayerOptimization=void 0,i=o(954).Component,r(a,i),a.prototype.shouldComponentUpdate=function(e){return e.shouldUpdateOnDrag||!e.isDragging},a.prototype.render=function(){return this.props.children},a);function a(){return null!==i&&i.apply(this,arguments)||this}t.MiddleLayerOptimization=o},259:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.windowStage=void 0,(t=t.windowStage||(t.windowStage={})).DEFAULT="DEFAULT",t.FULLSCREEN="FULLSCREEN",t.MINIMIZED="MINIMIZED"},891:function(e,t,o){var n,i,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},s=(Object.defineProperty(t,"__esModule",{value:!0}),t.Window=t.WindowPropsContext=void 0,o(954)),d=o(493),l=o(895),p=o(583),c=o(811),u=o(811),h=o(151),g=o(522),f=o(259),w=o(811),y=o(363),v=o(617),m=o(56),E=o(147),o=(i=s.Component,r(S,i),S.prototype.componentDidMount=function(){var e,t=this.getWindow(),t=(t&&t.addEventListener("resize",this.handleBrowserWindowResize),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)},S.prototype.componentWillUnmount=function(){var e=this.getWindow();e&&e.removeEventListener("resize",this.handleBrowserWindowResize)},S.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)},S.prototype.render=function(){var t=this,e=s.Children.toArray(this.props.children),o=this.getContent(e),e=this.getActionBar(e),n=this.getCurrentZIndex(),i=(0,c.classNames)("k-widget","k-window",this.props.className,{"k-window-minimized":"MINIMIZED"===this.state.stage},{"k-window-focused":this.state.focused}),r=s.createElement(c.ZIndexContext.Provider,{value:n},s.createElement(s.Fragment,null,this.props.modal&&s.createElement("div",{className:"k-overlay",style:a({zIndex:n},this.props.overlayStyle)}),s.createElement("div",a({},((r={})[m.DATA_DIALOGS_ID]=this._id,r),{tabIndex:0,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,ref:function(e){t.windowElement=e,t.element=e},className:i,style:a({top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:n},this.props.style)}),s.createElement(g.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(p.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!==f.windowStage.MINIMIZED?s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},o),e):null,this.windowStage===f.windowStage.DEFAULT&&this.props.resizable?s.createElement(h.ResizeHandlers,{onResize:this.handleResize}):null))));return c.canUseDOM?null!==this.props.appendTo?d.createPortal(r,this.props.appendTo||document.body):r:null},Object.defineProperty(S.prototype,"top",{get:function(){return this.windowStage!==f.windowStage.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"left",{get:function(){return this.windowStage!==f.windowStage.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"width",{get:function(){var e=this.props.width||this.state.width;if(this.windowStage===f.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetWidth;var t=this.getWindow(),e=t?t.innerWidth:0}return e},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"height",{get:function(){var e=this.props.height||this.state.height;if(this.windowStage===f.windowStage.FULLSCREEN){if(this.props.appendTo)return this.props.appendTo.offsetHeight;var t=this.getWindow(),e=t?t.innerHeight:0}else this.windowStage===f.windowStage.MINIMIZED&&(e=0);return e},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"windowStage",{get:function(){return this.props.stage||this.state.stage},enumerable:!1,configurable:!0}),S.prototype.getActionBar=function(e){return e.filter(function(e){return e&&e.type===v.WindowActionsBar})},S.prototype.getContent=function(e){return e.filter(function(e){return e&&e.type!==v.WindowActionsBar})},S.displayName="Window",S.propTypes={width:l.number,height:l.number,left:l.number,top:l.number,initialWidth:l.number,initialHeight:l.number,initialLeft:l.number,initialTop:l.number,minWidth:l.number,minHeight:l.number,resizable:l.bool,draggable:l.bool,title:l.any,shouldUpdateOnDrag:l.bool,stage:l.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:l.string,style:l.object,overlayStyle:l.object},S.defaultProps={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0},S.contextType=c.ZIndexContext,S);function S(e){var h=i.call(this,e)||this;return h.context=0,h.draggable=null,h.offSetCoordinates={x:0,y:0},h._id=(0,c.guid)(),h.onKeyDown=function(e){if(e.target===e.currentTarget){var t=h.props.minWidth||120,o=h.props.minHeight||100;if(e.ctrlKey&&h.props.resizable){switch(e.keyCode){case c.Keys.up:e.preventDefault(),o<=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===f.windowStage.MINIMIZED?(h.handleRestore(e),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.windowStage.DEFAULT})):h.windowStage===f.windowStage.DEFAULT&&(h.handleFullscreen(e),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.windowStage.FULLSCREEN}));break;case c.Keys.down:h.windowStage===f.windowStage.FULLSCREEN?(h.handleRestore(e),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.windowStage.DEFAULT})):h.windowStage===f.windowStage.DEFAULT&&(h.handleMinimize(e),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.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!==f.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!==f.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:(0,E.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:f.windowStage.MINIMIZED,height:0}),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.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(),o=t?t.innerWidth:0,t=t?t.innerHeight:0;h.setState({left:0,top:0,width:h.props.appendTo?h.props.appendTo.offsetWidth:o,height:h.props.appendTo?h.props.appendTo.offsetHeight:t,stage:f.windowStage.FULLSCREEN}),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.windowStage.FULLSCREEN})},h.handleRestore=function(e){e.preventDefault(),h.windowStage===f.windowStage.FULLSCREEN?h.setState({stage:f.windowStage.DEFAULT,left:h.windowCoordinatesState.leftBeforeAction,top:h.windowCoordinatesState.topBeforeAction,width:h.windowCoordinatesState.widthBeforeAction,height:h.windowCoordinatesState.heightBeforeAction}):h.windowStage===f.windowStage.MINIMIZED&&h.setState({stage:f.windowStage.DEFAULT,height:h.windowCoordinatesState.heightBeforeAction}),(0,c.dispatchEvent)(h.props.onStageChange,e,h,{state:f.windowStage.DEFAULT})},h.handleCloseWindow=function(e){e.preventDefault(),(0,c.dispatchEvent)(h.props.onClose,e,h,{state:void 0})},h.handleDoubleClick=function(e){h.windowStage===f.windowStage.FULLSCREEN||h.windowStage===f.windowStage.MINIMIZED?h.handleRestore(e):h.handleFullscreen(e)},h.handleResize=function(e,t){var o=h.props.appendTo?e.pageX-h.offSetCoordinates.x:e.pageX,n=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-n,l=h.left-o,p=o-h.left,c=n-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=n),0<=t.direction.indexOf("s")&&s-c<0&&(u.height=c),0<=t.direction.indexOf("w")&&a-(i+l)<0&&(0<h.left&&(u.width=i+l),u.left=o),0<=t.direction.indexOf("e")&&a-p<0&&(u.width=p),h.setState(u),h.dispatchMoveEvent(h.props.onResize,e,!0,t.end)},h.dispatchMoveEvent=function(e,t,o,n){e&&e.call(void 0,{nativeEvent:t.nativeEvent||t.originalEvent,drag:o,end:n,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===f.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&&void 0!==h.context?h.state.zIndex>(h.context?h.context+m.ZINDEX_DIALOGS_STEP:0)?h.state.zIndex:h.context+m.ZINDEX_DIALOGS_STEP:h.context||m.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},(0,w.validatePackage)(y.packageMetadata),h.state={stage:h.props.stage||f.windowStage.DEFAULT,isDragging:!1,top:h.getInitialTop(),left:h.getInitialLeft(),width:h.getInitialWidth(),height:h.getInitialHeight(),focused:!0,zIndex:(0,E.getMaxZIndex)(h.getCurrentZIndex(),h.getDocument(),h._id)},h.windowCoordinatesState={leftBeforeAction:h.getInitialLeft(),topBeforeAction:h.getInitialTop(),widthBeforeAction:h.getInitialWidth(),heightBeforeAction:h.getInitialHeight()},h}t.WindowPropsContext=(0,u.createPropsContext)(),t.Window=(0,u.withPropsContext)(t.WindowPropsContext,o),t.Window.displayName="KendoReactWindow"},617:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowActionsBar=void 0;var n=o(954),i=o(895),r=o(811),a=(t.WindowActionsBar=function(e){var t=e.layout,t=void 0===t?a.layout:t,e=e.children,t=(0,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 n.createElement("div",{className:t},e)},t.WindowActionsBar.propTypes={children:i.any,layout:i.oneOf(["start","center","end","stretched"])},{layout:"end"})},151:function(e,t,o){var n,i,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=(Object.defineProperty(t,"__esModule",{value:!0}),t.ResizeHandlers=void 0,o(954)),s=o(811),d=["n","e","s","w","se","sw","ne","nw"],o=(i=a.Component,r(l,i),l.prototype.render=function(){var o=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(),o.props.onResize(e,{end:!1,direction:t})},onRelease:function(e){e=e.event;e.originalEvent.preventDefault(),o.props.onResize(e,{end:!0,direction:t})}},a.createElement("div",{className:"k-resize-handle k-resize-"+t,style:{display:"block",touchAction:"none"}}))}))},l);function l(){return null!==i&&i.apply(this,arguments)||this}t.ResizeHandlers=o},583:function(e,t,o){function n(e){var t=e.children,o=e.onCloseButtonClick,n=e.onMinimizeButtonClick,i=e.onFullScreenButtonClick,r=e.onRestoreButtonClick,a=e.onDoubleClick,s=e.stage,d=e.forwardedRef,n=e.minimizeButton?l.createElement(e.minimizeButton,{onClick:n,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"window-minimize",onClick:n}),i=e.maximizeButton?l.createElement(e.maximizeButton,{onClick:i,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"window-maximize",onClick:i}),r=e.restoreButton?l.createElement(e.restoreButton,{onClick:r,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"window-restore",onClick:r}),e=e.closeButton?l.createElement(e.closeButton,{onClick:o,stage:s}):l.createElement(c.Button,{fillMode:"flat",icon:"close",onClick:o});return l.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",style:{touchAction:"none"},ref:d,onDoubleClick:a},l.createElement("div",{className:"k-window-title"},t||""),l.createElement("div",{className:"k-window-actions"},s===p.windowStage.DEFAULT&&n,s===p.windowStage.DEFAULT&&i,s!==p.windowStage.DEFAULT&&r,e))}var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},l=(Object.defineProperty(t,"__esModule",{value:!0}),t.WindowTitleBar=void 0,o(954)),p=o(259),c=o(536);t.WindowTitleBar=l.forwardRef(function(e,t){return l.createElement(n,i({},e,{forwardedRef:t}))})},56:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DIALOGS_SELECTOR=t.ZINDEX_DIALOGS_STEP=t.DEFAULT_DIALOGS_ZINDEX=t.DATA_DIALOGS_ID=void 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"},363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata=void 0,t.packageMetadata={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654762042,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"}},147:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxZIndex=void 0;var a=o(56);t.getMaxZIndex=function(e,o,n){var i,r=e;return o&&o.defaultView?(e=o.querySelectorAll(a.DIALOGS_SELECTOR),i=!1,e.forEach(function(e){var t=o.defaultView.getComputedStyle(e,null);e.getAttribute(a.DATA_DIALOGS_ID)!==n&&null!==t.zIndex&&(e=parseInt(t.zIndex,10),r<=e&&(r=e,i=!0))}),i?r+a.ZINDEX_DIALOGS_STEP:r):r}},536:e=>{e.exports=p},811:e=>{e.exports=c},895:e=>{e.exports=u},954:e=>{e.exports=h},493:e=>{e.exports=g}},i={},e=d={},Object.defineProperty(e,"__esModule",{value:!0}),e.WindowPropsContext=e.WindowActionsBar=e.Window=e.DialogPropsContext=e.DialogActionsBar=e.Dialog=void 0,t=o(580),Object.defineProperty(e,"Dialog",{enumerable:!0,get:function(){return t.Dialog}}),Object.defineProperty(e,"DialogPropsContext",{enumerable:!0,get:function(){return t.DialogPropsContext}}),r=o(379),Object.defineProperty(e,"DialogActionsBar",{enumerable:!0,get:function(){return r.DialogActionsBar}}),a=o(891),Object.defineProperty(e,"Window",{enumerable:!0,get:function(){return a.Window}}),Object.defineProperty(e,"WindowPropsContext",{enumerable:!0,get:function(){return a.WindowPropsContext}}),s=o(617),Object.defineProperty(e,"WindowActionsBar",{enumerable:!0,get:function(){return s.WindowActionsBar}}),d))}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dialogs",
|
|
3
|
-
"version": "5.4.0-dev.
|
|
3
|
+
"version": "5.4.0-dev.202206090823",
|
|
4
4
|
"description": "KendoReact Dialogs package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"jsnext:main": "dist/es/main.js",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"test": "cd ../../ && npm run test -- --testPathPattern=/packages/dialogs/.*",
|
|
15
|
-
"e2e": "cd ../../ && npx jest --config jest.e2e.js packages/dialogs",
|
|
15
|
+
"e2e": "cd ../../ && npx jest --maxWorkers=4 --config jest.e2e.js packages/dialogs",
|
|
16
16
|
"start": "gulp start",
|
|
17
17
|
"build-package": "gulp build-package"
|
|
18
18
|
},
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@progress/kendo-react-common": "5.4.0-dev.
|
|
39
|
+
"@progress/kendo-react-common": "5.4.0-dev.202206090823",
|
|
40
40
|
"prop-types": "^15.6.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@progress/kendo-react-buttons": "5.4.0-dev.
|
|
44
|
-
"@progress/kendo-react-dropdowns": "5.4.0-dev.
|
|
45
|
-
"@progress/kendo-react-intl": "5.4.0-dev.
|
|
46
|
-
"@progress/kendo-react-tooltip": "5.4.0-dev.
|
|
43
|
+
"@progress/kendo-react-buttons": "5.4.0-dev.202206090823",
|
|
44
|
+
"@progress/kendo-react-dropdowns": "5.4.0-dev.202206090823",
|
|
45
|
+
"@progress/kendo-react-intl": "5.4.0-dev.202206090823",
|
|
46
|
+
"@progress/kendo-react-tooltip": "5.4.0-dev.202206090823"
|
|
47
47
|
},
|
|
48
48
|
"@progress": {
|
|
49
49
|
"friendlyName": "Dialogs",
|