@progress/kendo-react-dialogs 4.13.0 → 4.14.0-dev.202112150919

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/es/Window.js CHANGED
@@ -27,7 +27,7 @@ import * as ReactDOM from 'react-dom';
27
27
  import * as PropTypes from 'prop-types';
28
28
  import { WindowTitleBar } from './WindowTitlebar';
29
29
  import { dispatchEvent, Keys, classNames, guid, ZIndexContext, canUseDOM } from '@progress/kendo-react-common';
30
- import { Draggable } from '@progress/kendo-react-common';
30
+ import { Draggable, createPropsContext, withPropsContext } from '@progress/kendo-react-common';
31
31
  import { ResizeHandlers } from './WindowResizeHandlers';
32
32
  import { MiddleLayerOptimization } from './MiddleLayerOptimization';
33
33
  import { windowStage } from './StageEnum';
@@ -41,9 +41,10 @@ var DEFAULT_HEIGHT = 300;
41
41
  var DEFAULT_MIN_WIDTH = 120;
42
42
  var DEFAULT_MIN_HEIGHT = 100;
43
43
  var DEFAULT_STEP = 5;
44
- var Window = /** @class */ (function (_super) {
45
- __extends(Window, _super);
46
- function Window(props) {
44
+ /** @hidden */
45
+ var WindowWithoutContext = /** @class */ (function (_super) {
46
+ __extends(WindowWithoutContext, _super);
47
+ function WindowWithoutContext(props) {
47
48
  var _this = _super.call(this, props) || this;
48
49
  _this.offSetCoordinates = { x: 0, y: 0 };
49
50
  _this._id = guid();
@@ -419,7 +420,7 @@ var Window = /** @class */ (function (_super) {
419
420
  /**
420
421
  * @hidden
421
422
  */
422
- Window.prototype.componentDidMount = function () {
423
+ WindowWithoutContext.prototype.componentDidMount = function () {
423
424
  var currentWindow = this.getWindow();
424
425
  if (currentWindow) {
425
426
  currentWindow.addEventListener('resize', this.handleBrowserWindowResize);
@@ -435,7 +436,7 @@ var Window = /** @class */ (function (_super) {
435
436
  /**
436
437
  * @hidden
437
438
  */
438
- Window.prototype.componentWillUnmount = function () {
439
+ WindowWithoutContext.prototype.componentWillUnmount = function () {
439
440
  var currentWindow = this.getWindow();
440
441
  if (currentWindow) {
441
442
  currentWindow.removeEventListener('resize', this.handleBrowserWindowResize);
@@ -444,7 +445,7 @@ var Window = /** @class */ (function (_super) {
444
445
  /**
445
446
  * @hidden
446
447
  */
447
- Window.prototype.componentDidUpdate = function () {
448
+ WindowWithoutContext.prototype.componentDidUpdate = function () {
448
449
  var currentDocument = this.getDocument();
449
450
  if (this.props.appendTo && currentDocument) {
450
451
  var containerCoordinates = this.props.appendTo.getBoundingClientRect();
@@ -456,7 +457,7 @@ var Window = /** @class */ (function (_super) {
456
457
  /**
457
458
  * @hidden
458
459
  */
459
- Window.prototype.render = function () {
460
+ WindowWithoutContext.prototype.render = function () {
460
461
  var _this = this;
461
462
  var _a;
462
463
  var elementsArray = React.Children.toArray(this.props.children);
@@ -488,7 +489,7 @@ var Window = /** @class */ (function (_super) {
488
489
  }
489
490
  return null;
490
491
  };
491
- Object.defineProperty(Window.prototype, "top", {
492
+ Object.defineProperty(WindowWithoutContext.prototype, "top", {
492
493
  // Getters
493
494
  get: function () {
494
495
  if (this.windowStage !== windowStage.FULLSCREEN) {
@@ -499,7 +500,7 @@ var Window = /** @class */ (function (_super) {
499
500
  enumerable: true,
500
501
  configurable: true
501
502
  });
502
- Object.defineProperty(Window.prototype, "left", {
503
+ Object.defineProperty(WindowWithoutContext.prototype, "left", {
503
504
  get: function () {
504
505
  if (this.windowStage !== windowStage.FULLSCREEN) {
505
506
  return Math.max(this.props.left || this.state.left, 0);
@@ -509,7 +510,7 @@ var Window = /** @class */ (function (_super) {
509
510
  enumerable: true,
510
511
  configurable: true
511
512
  });
512
- Object.defineProperty(Window.prototype, "width", {
513
+ Object.defineProperty(WindowWithoutContext.prototype, "width", {
513
514
  get: function () {
514
515
  var width = this.props.width || this.state.width;
515
516
  if (this.windowStage === windowStage.FULLSCREEN) {
@@ -525,7 +526,7 @@ var Window = /** @class */ (function (_super) {
525
526
  enumerable: true,
526
527
  configurable: true
527
528
  });
528
- Object.defineProperty(Window.prototype, "height", {
529
+ Object.defineProperty(WindowWithoutContext.prototype, "height", {
529
530
  get: function () {
530
531
  var height = this.props.height || this.state.height;
531
532
  if (this.windowStage === windowStage.FULLSCREEN) {
@@ -544,35 +545,36 @@ var Window = /** @class */ (function (_super) {
544
545
  enumerable: true,
545
546
  configurable: true
546
547
  });
547
- Object.defineProperty(Window.prototype, "windowStage", {
548
+ Object.defineProperty(WindowWithoutContext.prototype, "windowStage", {
548
549
  get: function () {
549
550
  return this.props.stage || this.state.stage;
550
551
  },
551
552
  enumerable: true,
552
553
  configurable: true
553
554
  });
554
- Window.prototype.getActionBar = function (children) {
555
+ WindowWithoutContext.prototype.getActionBar = function (children) {
555
556
  return children.filter(function (child) { return child && child.type === WindowActionsBar; });
556
557
  };
557
- Window.prototype.getContent = function (children) {
558
+ WindowWithoutContext.prototype.getContent = function (children) {
558
559
  return children.filter(function (child) {
559
560
  return child && child.type !== WindowActionsBar;
560
561
  });
561
562
  };
563
+ WindowWithoutContext.displayName = 'Window';
562
564
  /**
563
565
  * @hidden
564
566
  */
565
- Window.propTypes = {
566
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
567
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
568
- left: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
569
- top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
570
- initialwidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
571
- initialHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
572
- initialLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
573
- initialTop: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
574
- minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
575
- minHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
567
+ WindowWithoutContext.propTypes = {
568
+ width: PropTypes.number,
569
+ height: PropTypes.number,
570
+ left: PropTypes.number,
571
+ top: PropTypes.number,
572
+ initialWidth: PropTypes.number,
573
+ initialHeight: PropTypes.number,
574
+ initialLeft: PropTypes.number,
575
+ initialTop: PropTypes.number,
576
+ minWidth: PropTypes.number,
577
+ minHeight: PropTypes.number,
576
578
  resizable: PropTypes.bool,
577
579
  draggable: PropTypes.bool,
578
580
  title: PropTypes.any,
@@ -585,7 +587,7 @@ var Window = /** @class */ (function (_super) {
585
587
  /**
586
588
  * @hidden
587
589
  */
588
- Window.defaultProps = {
590
+ WindowWithoutContext.defaultProps = {
589
591
  minWidth: DEFAULT_MIN_WIDTH,
590
592
  minHeight: DEFAULT_MIN_HEIGHT,
591
593
  resizable: true,
@@ -596,7 +598,20 @@ var Window = /** @class */ (function (_super) {
596
598
  /**
597
599
  * @hidden
598
600
  */
599
- Window.contextType = ZIndexContext;
600
- return Window;
601
+ WindowWithoutContext.contextType = ZIndexContext;
602
+ return WindowWithoutContext;
601
603
  }(React.Component));
602
- export { Window };
604
+ /**
605
+ * Represents the PropsContext of the `Window` component.
606
+ * Used for global configuration of all `Window` instances.
607
+ */
608
+ export var WindowPropsContext = createPropsContext();
609
+ /* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
610
+ /**
611
+ * Represents the [KendoReact Window component]({% slug overview_window %}).
612
+ *
613
+ * Accepts properties of type [WindowProps]({% slug api_dialogs_windowprops %}).
614
+ * Obtaining the `ref` returns an object of type [WindowHandle]({% slug api_dialogs_windowhandle %}).
615
+ */
616
+ export var Window = withPropsContext(WindowPropsContext, WindowWithoutContext);
617
+ Window.displayName = 'KendoReactWindow';
package/dist/es/main.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Dialog } from './Dialog';
1
+ import { Dialog, DialogHandle, DialogPropsContext } from './Dialog';
2
2
  import { DialogActionsBar } from './DialogActionsBar';
3
- import { Window } from './Window';
3
+ import { Window, WindowHandle, WindowPropsContext } 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
8
  import { DialogProps } from './DialogProps';
9
- export { Dialog, DialogProps, DialogActionsBar, DialogCloseEvent, Window, WindowProps, WindowActionsBar, WindowActionsEvent, WindowMoveEvent, ActionsLayout };
9
+ export { Dialog, DialogProps, DialogActionsBar, DialogCloseEvent, DialogHandle, DialogPropsContext, Window, WindowProps, WindowActionsBar, WindowActionsEvent, WindowMoveEvent, WindowHandle, WindowPropsContext, ActionsLayout };
package/dist/es/main.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Dialog } from './Dialog';
1
+ import { Dialog, DialogPropsContext } from './Dialog';
2
2
  import { DialogActionsBar } from './DialogActionsBar';
3
- import { Window } from './Window';
3
+ import { Window, WindowPropsContext } from './Window';
4
4
  import { WindowActionsBar } from './WindowActionsBar';
5
- export { Dialog, DialogActionsBar, Window, WindowActionsBar };
5
+ export { Dialog, DialogActionsBar, DialogPropsContext, Window, WindowActionsBar, WindowPropsContext };
@@ -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: 1638880453,
8
+ publishDate: 1639558579,
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
  };
@@ -4,7 +4,9 @@ import { DialogProps } from './DialogProps';
4
4
  interface DialogState {
5
5
  zIndex: number;
6
6
  }
7
- export declare class Dialog extends React.Component<DialogProps, DialogState> {
7
+ /** @hidden */
8
+ declare class DialogWithoutContext extends React.Component<DialogProps, DialogState> {
9
+ static displayName: string;
8
10
  /**
9
11
  * @hidden
10
12
  */
@@ -58,4 +60,23 @@ export declare class Dialog extends React.Component<DialogProps, DialogState> {
58
60
  private getCurrentZIndex;
59
61
  private getDocument;
60
62
  }
63
+ /**
64
+ * Represents the PropsContext of the `Dialog` component.
65
+ * Used for global configuration of all `Dialog` instances.
66
+ */
67
+ export declare const DialogPropsContext: React.Context<(p: DialogProps) => DialogProps>;
68
+ /**
69
+ * Represent the `ref` of the Dialog component.
70
+ */
71
+ export interface DialogHandle extends Pick<DialogWithoutContext, keyof DialogWithoutContext> {
72
+ }
73
+ /** @hidden */
74
+ export declare type Dialog = DialogHandle;
75
+ /**
76
+ * Represents the [KendoReact Dialog component]({% slug overview_dialog %}).
77
+ *
78
+ * Accepts properties of type [DialogProps]({% slug api_dialogs_dialogprops %}).
79
+ * Obtaining the `ref` returns an object of type [DialogHandle]({% slug api_dialogs_dialoghandle %}).
80
+ */
81
+ export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<any>>;
61
82
  export {};
@@ -34,9 +34,11 @@ var kendo_react_common_2 = require("@progress/kendo-react-common");
34
34
  var package_metadata_1 = require("./package-metadata");
35
35
  var utils_1 = require("./utils");
36
36
  var constants_1 = require("./constants");
37
- var Dialog = /** @class */ (function (_super) {
38
- __extends(Dialog, _super);
39
- function Dialog(props) {
37
+ // tslint:enable:max-line-length
38
+ /** @hidden */
39
+ var DialogWithoutContext = /** @class */ (function (_super) {
40
+ __extends(DialogWithoutContext, _super);
41
+ function DialogWithoutContext(props) {
40
42
  var _this = _super.call(this, props) || this;
41
43
  _this._id = kendo_react_common_1.guid();
42
44
  _this.titleId = _this.generateTitleId();
@@ -94,7 +96,7 @@ var Dialog = /** @class */ (function (_super) {
94
96
  /**
95
97
  * @hidden
96
98
  */
97
- Dialog.prototype.componentDidMount = function () {
99
+ DialogWithoutContext.prototype.componentDidMount = function () {
98
100
  if (this.element) {
99
101
  if (this.props.autoFocus) {
100
102
  this.element.focus();
@@ -104,7 +106,7 @@ var Dialog = /** @class */ (function (_super) {
104
106
  /**
105
107
  * @hidden
106
108
  */
107
- Dialog.prototype.render = function () {
109
+ DialogWithoutContext.prototype.render = function () {
108
110
  var _this = this;
109
111
  var _a;
110
112
  var id = this.props.id !== undefined ? this.props.id : this.titleId;
@@ -130,21 +132,22 @@ var Dialog = /** @class */ (function (_super) {
130
132
  }
131
133
  return null;
132
134
  };
133
- Dialog.prototype.getActionBar = function (children) {
135
+ DialogWithoutContext.prototype.getActionBar = function (children) {
134
136
  return children.filter(function (child) { return child && child.type === DialogActionsBar_1.DialogActionsBar; });
135
137
  };
136
- Dialog.prototype.getContent = function (children) {
138
+ DialogWithoutContext.prototype.getContent = function (children) {
137
139
  return children.filter(function (child) {
138
140
  return child && child.type !== DialogActionsBar_1.DialogActionsBar;
139
141
  });
140
142
  };
141
- Dialog.prototype.generateTitleId = function () {
143
+ DialogWithoutContext.prototype.generateTitleId = function () {
142
144
  return 'dialog-title' + this._id;
143
145
  };
146
+ DialogWithoutContext.displayName = 'Dialog';
144
147
  /**
145
148
  * @hidden
146
149
  */
147
- Dialog.propTypes = {
150
+ DialogWithoutContext.propTypes = {
148
151
  title: PropTypes.any,
149
152
  id: PropTypes.string,
150
153
  dir: PropTypes.string,
@@ -158,13 +161,26 @@ var Dialog = /** @class */ (function (_super) {
158
161
  /**
159
162
  * @hidden
160
163
  */
161
- Dialog.defaultProps = {
164
+ DialogWithoutContext.defaultProps = {
162
165
  autoFocus: false
163
166
  };
164
167
  /**
165
168
  * @hidden
166
169
  */
167
- Dialog.contextType = kendo_react_common_1.ZIndexContext;
168
- return Dialog;
170
+ DialogWithoutContext.contextType = kendo_react_common_1.ZIndexContext;
171
+ return DialogWithoutContext;
169
172
  }(React.Component));
170
- exports.Dialog = Dialog;
173
+ /**
174
+ * Represents the PropsContext of the `Dialog` component.
175
+ * Used for global configuration of all `Dialog` instances.
176
+ */
177
+ exports.DialogPropsContext = kendo_react_common_1.createPropsContext();
178
+ /* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
179
+ /**
180
+ * Represents the [KendoReact Dialog component]({% slug overview_dialog %}).
181
+ *
182
+ * Accepts properties of type [DialogProps]({% slug api_dialogs_dialogprops %}).
183
+ * Obtaining the `ref` returns an object of type [DialogHandle]({% slug api_dialogs_dialoghandle %}).
184
+ */
185
+ exports.Dialog = kendo_react_common_1.withPropsContext(exports.DialogPropsContext, DialogWithoutContext);
186
+ exports.Dialog.displayName = 'KendoReactDialog';
@@ -13,21 +13,23 @@ interface WindowState {
13
13
  focused: boolean;
14
14
  zIndex: number;
15
15
  }
16
- export declare class Window extends React.Component<WindowProps, WindowState> {
16
+ /** @hidden */
17
+ declare class WindowWithoutContext extends React.Component<WindowProps, WindowState> {
18
+ static displayName: string;
17
19
  /**
18
20
  * @hidden
19
21
  */
20
22
  static propTypes: {
21
- width: PropTypes.Requireable<string | number>;
22
- height: PropTypes.Requireable<string | number>;
23
- left: PropTypes.Requireable<string | number>;
24
- top: PropTypes.Requireable<string | number>;
25
- initialwidth: PropTypes.Requireable<string | number>;
26
- initialHeight: PropTypes.Requireable<string | number>;
27
- initialLeft: PropTypes.Requireable<string | number>;
28
- initialTop: PropTypes.Requireable<string | number>;
29
- minWidth: PropTypes.Requireable<string | number>;
30
- minHeight: PropTypes.Requireable<string | number>;
23
+ width: PropTypes.Requireable<number>;
24
+ height: PropTypes.Requireable<number>;
25
+ left: PropTypes.Requireable<number>;
26
+ top: PropTypes.Requireable<number>;
27
+ initialWidth: PropTypes.Requireable<number>;
28
+ initialHeight: PropTypes.Requireable<number>;
29
+ initialLeft: PropTypes.Requireable<number>;
30
+ initialTop: PropTypes.Requireable<number>;
31
+ minWidth: PropTypes.Requireable<number>;
32
+ minHeight: PropTypes.Requireable<number>;
31
33
  resizable: PropTypes.Requireable<boolean>;
32
34
  draggable: PropTypes.Requireable<boolean>;
33
35
  title: PropTypes.Requireable<any>;
@@ -133,4 +135,31 @@ export declare class Window extends React.Component<WindowProps, WindowState> {
133
135
  private getDocument;
134
136
  private getWindow;
135
137
  }
138
+ /**
139
+ * Represents the PropsContext of the `Window` component.
140
+ * Used for global configuration of all `Window` instances.
141
+ */
142
+ export declare const WindowPropsContext: React.Context<(p: WindowProps) => WindowProps>;
143
+ /**
144
+ * Represent the `ref` of the Window component.
145
+ */
146
+ export interface WindowHandle extends Pick<WindowWithoutContext, keyof WindowWithoutContext> {
147
+ /**
148
+ * The Window element.
149
+ */
150
+ element?: HTMLDivElement | null;
151
+ /**
152
+ * **Deprecated.** Use `element` instead.
153
+ */
154
+ windowElement?: HTMLDivElement | null;
155
+ }
156
+ /** @hidden */
157
+ export declare type Window = WindowHandle;
158
+ /**
159
+ * Represents the [KendoReact Window component]({% slug overview_window %}).
160
+ *
161
+ * Accepts properties of type [WindowProps]({% slug api_dialogs_windowprops %}).
162
+ * Obtaining the `ref` returns an object of type [WindowHandle]({% slug api_dialogs_windowhandle %}).
163
+ */
164
+ export declare const Window: React.ForwardRefExoticComponent<WindowProps & React.RefAttributes<any>>;
136
165
  export {};
@@ -43,9 +43,10 @@ var DEFAULT_HEIGHT = 300;
43
43
  var DEFAULT_MIN_WIDTH = 120;
44
44
  var DEFAULT_MIN_HEIGHT = 100;
45
45
  var DEFAULT_STEP = 5;
46
- var Window = /** @class */ (function (_super) {
47
- __extends(Window, _super);
48
- function Window(props) {
46
+ /** @hidden */
47
+ var WindowWithoutContext = /** @class */ (function (_super) {
48
+ __extends(WindowWithoutContext, _super);
49
+ function WindowWithoutContext(props) {
49
50
  var _this = _super.call(this, props) || this;
50
51
  _this.offSetCoordinates = { x: 0, y: 0 };
51
52
  _this._id = kendo_react_common_1.guid();
@@ -421,7 +422,7 @@ var Window = /** @class */ (function (_super) {
421
422
  /**
422
423
  * @hidden
423
424
  */
424
- Window.prototype.componentDidMount = function () {
425
+ WindowWithoutContext.prototype.componentDidMount = function () {
425
426
  var currentWindow = this.getWindow();
426
427
  if (currentWindow) {
427
428
  currentWindow.addEventListener('resize', this.handleBrowserWindowResize);
@@ -437,7 +438,7 @@ var Window = /** @class */ (function (_super) {
437
438
  /**
438
439
  * @hidden
439
440
  */
440
- Window.prototype.componentWillUnmount = function () {
441
+ WindowWithoutContext.prototype.componentWillUnmount = function () {
441
442
  var currentWindow = this.getWindow();
442
443
  if (currentWindow) {
443
444
  currentWindow.removeEventListener('resize', this.handleBrowserWindowResize);
@@ -446,7 +447,7 @@ var Window = /** @class */ (function (_super) {
446
447
  /**
447
448
  * @hidden
448
449
  */
449
- Window.prototype.componentDidUpdate = function () {
450
+ WindowWithoutContext.prototype.componentDidUpdate = function () {
450
451
  var currentDocument = this.getDocument();
451
452
  if (this.props.appendTo && currentDocument) {
452
453
  var containerCoordinates = this.props.appendTo.getBoundingClientRect();
@@ -458,7 +459,7 @@ var Window = /** @class */ (function (_super) {
458
459
  /**
459
460
  * @hidden
460
461
  */
461
- Window.prototype.render = function () {
462
+ WindowWithoutContext.prototype.render = function () {
462
463
  var _this = this;
463
464
  var _a;
464
465
  var elementsArray = React.Children.toArray(this.props.children);
@@ -490,7 +491,7 @@ var Window = /** @class */ (function (_super) {
490
491
  }
491
492
  return null;
492
493
  };
493
- Object.defineProperty(Window.prototype, "top", {
494
+ Object.defineProperty(WindowWithoutContext.prototype, "top", {
494
495
  // Getters
495
496
  get: function () {
496
497
  if (this.windowStage !== StageEnum_1.windowStage.FULLSCREEN) {
@@ -501,7 +502,7 @@ var Window = /** @class */ (function (_super) {
501
502
  enumerable: true,
502
503
  configurable: true
503
504
  });
504
- Object.defineProperty(Window.prototype, "left", {
505
+ Object.defineProperty(WindowWithoutContext.prototype, "left", {
505
506
  get: function () {
506
507
  if (this.windowStage !== StageEnum_1.windowStage.FULLSCREEN) {
507
508
  return Math.max(this.props.left || this.state.left, 0);
@@ -511,7 +512,7 @@ var Window = /** @class */ (function (_super) {
511
512
  enumerable: true,
512
513
  configurable: true
513
514
  });
514
- Object.defineProperty(Window.prototype, "width", {
515
+ Object.defineProperty(WindowWithoutContext.prototype, "width", {
515
516
  get: function () {
516
517
  var width = this.props.width || this.state.width;
517
518
  if (this.windowStage === StageEnum_1.windowStage.FULLSCREEN) {
@@ -527,7 +528,7 @@ var Window = /** @class */ (function (_super) {
527
528
  enumerable: true,
528
529
  configurable: true
529
530
  });
530
- Object.defineProperty(Window.prototype, "height", {
531
+ Object.defineProperty(WindowWithoutContext.prototype, "height", {
531
532
  get: function () {
532
533
  var height = this.props.height || this.state.height;
533
534
  if (this.windowStage === StageEnum_1.windowStage.FULLSCREEN) {
@@ -546,35 +547,36 @@ var Window = /** @class */ (function (_super) {
546
547
  enumerable: true,
547
548
  configurable: true
548
549
  });
549
- Object.defineProperty(Window.prototype, "windowStage", {
550
+ Object.defineProperty(WindowWithoutContext.prototype, "windowStage", {
550
551
  get: function () {
551
552
  return this.props.stage || this.state.stage;
552
553
  },
553
554
  enumerable: true,
554
555
  configurable: true
555
556
  });
556
- Window.prototype.getActionBar = function (children) {
557
+ WindowWithoutContext.prototype.getActionBar = function (children) {
557
558
  return children.filter(function (child) { return child && child.type === WindowActionsBar_1.WindowActionsBar; });
558
559
  };
559
- Window.prototype.getContent = function (children) {
560
+ WindowWithoutContext.prototype.getContent = function (children) {
560
561
  return children.filter(function (child) {
561
562
  return child && child.type !== WindowActionsBar_1.WindowActionsBar;
562
563
  });
563
564
  };
565
+ WindowWithoutContext.displayName = 'Window';
564
566
  /**
565
567
  * @hidden
566
568
  */
567
- Window.propTypes = {
568
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
569
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
570
- left: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
571
- top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
572
- initialwidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
573
- initialHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
574
- initialLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
575
- initialTop: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
576
- minWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
577
- minHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
569
+ WindowWithoutContext.propTypes = {
570
+ width: PropTypes.number,
571
+ height: PropTypes.number,
572
+ left: PropTypes.number,
573
+ top: PropTypes.number,
574
+ initialWidth: PropTypes.number,
575
+ initialHeight: PropTypes.number,
576
+ initialLeft: PropTypes.number,
577
+ initialTop: PropTypes.number,
578
+ minWidth: PropTypes.number,
579
+ minHeight: PropTypes.number,
578
580
  resizable: PropTypes.bool,
579
581
  draggable: PropTypes.bool,
580
582
  title: PropTypes.any,
@@ -587,7 +589,7 @@ var Window = /** @class */ (function (_super) {
587
589
  /**
588
590
  * @hidden
589
591
  */
590
- Window.defaultProps = {
592
+ WindowWithoutContext.defaultProps = {
591
593
  minWidth: DEFAULT_MIN_WIDTH,
592
594
  minHeight: DEFAULT_MIN_HEIGHT,
593
595
  resizable: true,
@@ -598,7 +600,20 @@ var Window = /** @class */ (function (_super) {
598
600
  /**
599
601
  * @hidden
600
602
  */
601
- Window.contextType = kendo_react_common_1.ZIndexContext;
602
- return Window;
603
+ WindowWithoutContext.contextType = kendo_react_common_1.ZIndexContext;
604
+ return WindowWithoutContext;
603
605
  }(React.Component));
604
- exports.Window = Window;
606
+ /**
607
+ * Represents the PropsContext of the `Window` component.
608
+ * Used for global configuration of all `Window` instances.
609
+ */
610
+ exports.WindowPropsContext = kendo_react_common_2.createPropsContext();
611
+ /* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
612
+ /**
613
+ * Represents the [KendoReact Window component]({% slug overview_window %}).
614
+ *
615
+ * Accepts properties of type [WindowProps]({% slug api_dialogs_windowprops %}).
616
+ * Obtaining the `ref` returns an object of type [WindowHandle]({% slug api_dialogs_windowhandle %}).
617
+ */
618
+ exports.Window = kendo_react_common_2.withPropsContext(exports.WindowPropsContext, WindowWithoutContext);
619
+ exports.Window.displayName = 'KendoReactWindow';
@@ -1,9 +1,9 @@
1
- import { Dialog } from './Dialog';
1
+ import { Dialog, DialogHandle, DialogPropsContext } from './Dialog';
2
2
  import { DialogActionsBar } from './DialogActionsBar';
3
- import { Window } from './Window';
3
+ import { Window, WindowHandle, WindowPropsContext } 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
8
  import { DialogProps } from './DialogProps';
9
- export { Dialog, DialogProps, DialogActionsBar, DialogCloseEvent, Window, WindowProps, WindowActionsBar, WindowActionsEvent, WindowMoveEvent, ActionsLayout };
9
+ export { Dialog, DialogProps, DialogActionsBar, DialogCloseEvent, DialogHandle, DialogPropsContext, Window, WindowProps, WindowActionsBar, WindowActionsEvent, WindowMoveEvent, WindowHandle, WindowPropsContext, ActionsLayout };
package/dist/npm/main.js CHANGED
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Dialog_1 = require("./Dialog");
4
4
  exports.Dialog = Dialog_1.Dialog;
5
+ exports.DialogPropsContext = Dialog_1.DialogPropsContext;
5
6
  var DialogActionsBar_1 = require("./DialogActionsBar");
6
7
  exports.DialogActionsBar = DialogActionsBar_1.DialogActionsBar;
7
8
  var Window_1 = require("./Window");
8
9
  exports.Window = Window_1.Window;
10
+ exports.WindowPropsContext = Window_1.WindowPropsContext;
9
11
  var WindowActionsBar_1 = require("./WindowActionsBar");
10
12
  exports.WindowActionsBar = WindowActionsBar_1.WindowActionsBar;
@@ -7,7 +7,7 @@ exports.packageMetadata = {
7
7
  name: '@progress/kendo-react-dialogs',
8
8
  productName: 'KendoReact',
9
9
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
10
- publishDate: 1638880453,
10
+ publishDate: 1639558579,
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
  };