@itwin/core-react 4.2.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +7 -4
  2. package/lib/cjs/core-react/_geometry.scss +3 -3
  3. package/lib/cjs/core-react/_math.scss +3 -3
  4. package/lib/cjs/core-react/_typography.scss +3 -3
  5. package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +3 -3
  6. package/lib/cjs/core-react/badge/Badge.scss +3 -3
  7. package/lib/cjs/core-react/badge/NewBadge.scss +3 -3
  8. package/lib/cjs/core-react/base/base.scss +3 -3
  9. package/lib/cjs/core-react/base/index.scss +3 -3
  10. package/lib/cjs/core-react/classes.scss +3 -3
  11. package/lib/cjs/core-react/colorthemes.scss +3 -3
  12. package/lib/cjs/core-react/colorvariables.scss +3 -3
  13. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +3 -3
  14. package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -10
  15. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  16. package/lib/cjs/core-react/dialog/Dialog.js +69 -166
  17. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  18. package/lib/cjs/core-react/dialog/Dialog.scss +59 -217
  19. package/lib/cjs/core-react/expandable/index.scss +3 -3
  20. package/lib/cjs/core-react/expandable/list.scss +3 -3
  21. package/lib/cjs/core-react/icons/SvgPath.scss +3 -3
  22. package/lib/cjs/core-react/icons/WebFontIcon.scss +3 -3
  23. package/lib/cjs/core-react/icons/index.scss +3 -3
  24. package/lib/cjs/core-react/icons/mixins.scss +3 -3
  25. package/lib/cjs/core-react/icons/variables.scss +3 -3
  26. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
  27. package/lib/cjs/core-react/index.scss +3 -3
  28. package/lib/cjs/core-react/inputs/index.scss +3 -3
  29. package/lib/cjs/core-react/inputs/input-label.scss +3 -3
  30. package/lib/cjs/core-react/inputs/input.scss +3 -3
  31. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +3 -3
  32. package/lib/cjs/core-react/inputs/variables.scss +3 -3
  33. package/lib/cjs/core-react/listbox/Listbox.scss +3 -3
  34. package/lib/cjs/core-react/loading/LoadingPrompt.scss +3 -3
  35. package/lib/cjs/core-react/loading/LoadingSpinner.scss +3 -3
  36. package/lib/cjs/core-react/loading/index.scss +3 -3
  37. package/lib/cjs/core-react/loading/mixins.scss +3 -3
  38. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  39. package/lib/cjs/core-react/messagebox/MessageBox.js +2 -2
  40. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  41. package/lib/cjs/core-react/messagebox/MessageBox.scss +3 -3
  42. package/lib/cjs/core-react/popup/Popup.scss +3 -3
  43. package/lib/cjs/core-react/radialmenu/RadialMenu.scss +3 -3
  44. package/lib/cjs/core-react/searchbox/SearchBox.scss +3 -3
  45. package/lib/cjs/core-react/settings/SettingsContainer.scss +3 -3
  46. package/lib/cjs/core-react/style/baseline.scss +3 -3
  47. package/lib/cjs/core-react/style/index.scss +3 -3
  48. package/lib/cjs/core-react/style/opacity.scss +3 -3
  49. package/lib/cjs/core-react/tabs/index.scss +3 -3
  50. package/lib/cjs/core-react/tabs/tabs.scss +3 -3
  51. package/lib/cjs/core-react/tabs/vertical.scss +3 -3
  52. package/lib/cjs/core-react/text/FilteredText.scss +3 -3
  53. package/lib/cjs/core-react/text/block.scss +3 -3
  54. package/lib/cjs/core-react/text/body.scss +3 -3
  55. package/lib/cjs/core-react/text/index.scss +3 -3
  56. package/lib/cjs/core-react/text/mixins.scss +3 -3
  57. package/lib/cjs/core-react/tree/ExpansionToggle.scss +3 -3
  58. package/lib/cjs/core-react/tree/Placeholder.scss +3 -3
  59. package/lib/cjs/core-react/tree/Tree.scss +3 -3
  60. package/lib/esm/core-react/_geometry.scss +3 -3
  61. package/lib/esm/core-react/_math.scss +3 -3
  62. package/lib/esm/core-react/_typography.scss +3 -3
  63. package/lib/esm/core-react/autosuggest/AutoSuggest.scss +3 -3
  64. package/lib/esm/core-react/badge/Badge.scss +3 -3
  65. package/lib/esm/core-react/badge/NewBadge.scss +3 -3
  66. package/lib/esm/core-react/base/base.scss +3 -3
  67. package/lib/esm/core-react/base/index.scss +3 -3
  68. package/lib/esm/core-react/classes.scss +3 -3
  69. package/lib/esm/core-react/colorthemes.scss +3 -3
  70. package/lib/esm/core-react/colorvariables.scss +3 -3
  71. package/lib/esm/core-react/contextmenu/ContextMenu.scss +3 -3
  72. package/lib/esm/core-react/dialog/Dialog.d.ts +3 -10
  73. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  74. package/lib/esm/core-react/dialog/Dialog.js +68 -165
  75. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  76. package/lib/esm/core-react/dialog/Dialog.scss +59 -217
  77. package/lib/esm/core-react/expandable/index.scss +3 -3
  78. package/lib/esm/core-react/expandable/list.scss +3 -3
  79. package/lib/esm/core-react/icons/SvgPath.scss +3 -3
  80. package/lib/esm/core-react/icons/WebFontIcon.scss +3 -3
  81. package/lib/esm/core-react/icons/index.scss +3 -3
  82. package/lib/esm/core-react/icons/mixins.scss +3 -3
  83. package/lib/esm/core-react/icons/variables.scss +3 -3
  84. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
  85. package/lib/esm/core-react/index.scss +3 -3
  86. package/lib/esm/core-react/inputs/index.scss +3 -3
  87. package/lib/esm/core-react/inputs/input-label.scss +3 -3
  88. package/lib/esm/core-react/inputs/input.scss +3 -3
  89. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +3 -3
  90. package/lib/esm/core-react/inputs/variables.scss +3 -3
  91. package/lib/esm/core-react/listbox/Listbox.scss +3 -3
  92. package/lib/esm/core-react/loading/LoadingPrompt.scss +3 -3
  93. package/lib/esm/core-react/loading/LoadingSpinner.scss +3 -3
  94. package/lib/esm/core-react/loading/index.scss +3 -3
  95. package/lib/esm/core-react/loading/mixins.scss +3 -3
  96. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  97. package/lib/esm/core-react/messagebox/MessageBox.js +2 -2
  98. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  99. package/lib/esm/core-react/messagebox/MessageBox.scss +3 -3
  100. package/lib/esm/core-react/popup/Popup.scss +3 -3
  101. package/lib/esm/core-react/radialmenu/RadialMenu.scss +3 -3
  102. package/lib/esm/core-react/searchbox/SearchBox.scss +3 -3
  103. package/lib/esm/core-react/settings/SettingsContainer.scss +3 -3
  104. package/lib/esm/core-react/style/baseline.scss +3 -3
  105. package/lib/esm/core-react/style/index.scss +3 -3
  106. package/lib/esm/core-react/style/opacity.scss +3 -3
  107. package/lib/esm/core-react/tabs/index.scss +3 -3
  108. package/lib/esm/core-react/tabs/tabs.scss +3 -3
  109. package/lib/esm/core-react/tabs/vertical.scss +3 -3
  110. package/lib/esm/core-react/text/FilteredText.scss +3 -3
  111. package/lib/esm/core-react/text/block.scss +3 -3
  112. package/lib/esm/core-react/text/body.scss +3 -3
  113. package/lib/esm/core-react/text/index.scss +3 -3
  114. package/lib/esm/core-react/text/mixins.scss +3 -3
  115. package/lib/esm/core-react/tree/ExpansionToggle.scss +3 -3
  116. package/lib/esm/core-react/tree/Placeholder.scss +3 -3
  117. package/lib/esm/core-react/tree/Tree.scss +3 -3
  118. package/package.json +3 -3
  119. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts +0 -68
  120. package/lib/cjs/core-react/dialog/SimpleDialog.d.ts.map +0 -1
  121. package/lib/cjs/core-react/dialog/SimpleDialog.js +0 -51
  122. package/lib/cjs/core-react/dialog/SimpleDialog.js.map +0 -1
  123. package/lib/esm/core-react/dialog/SimpleDialog.d.ts +0 -68
  124. package/lib/esm/core-react/dialog/SimpleDialog.d.ts.map +0 -1
  125. package/lib/esm/core-react/dialog/SimpleDialog.js +0 -47
  126. package/lib/esm/core-react/dialog/SimpleDialog.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # Change Log - @itwin/core-react
2
2
 
3
- This log was last generated on Wed, 05 Jul 2023 07:56:27 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 17 Jul 2023 10:16:20 GMT and should not be manually modified.
4
4
 
5
- ## 4.2.1
6
- Wed, 05 Jul 2023 07:56:27 GMT
5
+ ## 4.3.0
6
+ Mon, 17 Jul 2023 10:16:20 GMT
7
7
 
8
- _Version update only_
8
+ ### Updates
9
+
10
+ - Update sinon to 15.2.0 and @types/sinon to 10.0.15
11
+ - Standardize core-react `Dialog` visuals and behavior by making iTwinUI `Dialog` its base component.
9
12
 
10
13
  ## 4.2.0
11
14
  Tue, 27 Jun 2023 14:50:22 GMT
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @mixin triangle-common {
6
6
  width: 0;
7
7
  height: 0;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @function sqrt($x, $iterations: 10) {
6
6
  $sqr: 1;
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./style/opacity.scss";
6
6
 
7
7
  $title-weight: var(--iui-font-weight-normal);
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../scrollbar";
6
6
  @import "../inputs/variables";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/themecolors";
6
6
 
7
7
  $icon-size: 16px;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../style/themecolors";
6
6
 
7
7
  .core-new-badge {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../_scrollbar";
6
6
 
7
7
  @mixin uicore-centered {
@@ -1,5 +1,5 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./base";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "./style/index";
6
6
  @import "./base/classes";
7
7
  @import "./expandable/classes";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  // cspell:ignore colorvariables
6
6
 
7
7
  /** @note: This file should only be imported by UiCore.ts.
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  // cspell:ignore mediumgray titlebar toolbutton outoffocus
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../icons/variables";
6
6
  @import "../inputs/variables";
7
7
  @import "../style/baseline";
@@ -45,7 +45,7 @@ export interface DialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement
45
45
  footer?: string | React.ReactElement;
46
46
  /** List of DialogButtonDef objects specifying buttons and associated onClick events */
47
47
  buttonCluster?: DialogButtonDef[];
48
- /** Default alignment of dialog. Default: DialogAlignment.Center */
48
+ /** Default alignment of dialog. */
49
49
  alignment?: DialogAlignment;
50
50
  /** Initial x/left position of dialog in px. */
51
51
  x?: number;
@@ -63,9 +63,9 @@ export interface DialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement
63
63
  height?: string | number;
64
64
  /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 300px */
65
65
  minWidth?: string | number;
66
- /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100px */
66
+ /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 135px */
67
67
  minHeight?: string | number;
68
- /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
68
+ /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. Default: 100% */
69
69
  maxWidth?: string | number;
70
70
  /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */
71
71
  maxHeight?: string | number;
@@ -92,14 +92,10 @@ export interface DialogProps extends Omit<React.AllHTMLAttributes<HTMLDivElement
92
92
  interface DialogState {
93
93
  rightResizing: boolean;
94
94
  downResizing: boolean;
95
- moving: boolean;
96
- grabOffsetX: number;
97
- grabOffsetY: number;
98
95
  x?: number;
99
96
  y?: number;
100
97
  width?: number;
101
98
  height?: number;
102
- positionSet: boolean;
103
99
  }
104
100
  /**
105
101
  * Dialog React component with optional resizing and dragging functionality
@@ -114,8 +110,6 @@ export declare class Dialog extends React.Component<DialogProps, DialogState> {
114
110
  constructor(props: DialogProps);
115
111
  private getParentWindow;
116
112
  componentWillUnmount(): void;
117
- /** Keep title bar of movable Dialog at least partially visible */
118
- private _handleAppWindowResize;
119
113
  componentDidMount(): void;
120
114
  handleRefSet: (containerDiv: HTMLDivElement | null) => void;
121
115
  render(): React.ReactElement;
@@ -126,7 +120,6 @@ export declare class Dialog extends React.Component<DialogProps, DialogState> {
126
120
  private _handleStartResizeRight;
127
121
  private _handleStartResizeDown;
128
122
  private _handleStartResizeDownRight;
129
- private _handleStartMove;
130
123
  private _handlePointerMove;
131
124
  private _handlePointerUp;
132
125
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/core-react/dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD;;GAEG;AACH,oBAAY,eAAe;IACzB,OAAO,aAAa;IACpB,GAAG,QA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CAAC;IACtB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACnE,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,aAAa,CAAqC;IAC1D,OAAc,YAAY,EAAE,OAAO,CAAC,WAAW,CAAC,CAW9C;IAEF,gBAAgB;IAChB,SAAyB,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;gBAE1C,KAAK,EAAE,WAAW;IAQ9B,OAAO,CAAC,eAAe;IAKP,oBAAoB,IAAI,IAAI;IAW5B,iBAAiB,IAAI,IAAI;IAOlC,YAAY,iBAAkB,cAAc,GAAG,IAAI,UAExD;IAEc,MAAM,IAAI,KAAK,CAAC,YAAY;IA2J5C,OAAO,CAAC,4BAA4B;IAuBpC,SAAS,CAAC,gBAAgB,CACxB,aAAa,EAAE,eAAe,EAAE,GAAG,SAAS,EACjB,gBAAgB,GAAE,WAAW,CAAC,WAAW,CAAS,EAClD,mBAAmB,GAAE,OAAe,GAC9D,KAAK,CAAC,SAAS,EAAE,GAAG,SAAS;IAuEhC,OAAO,CAAC,YAAY,CAQlB;IAEF,SAAS,CAAC,2BAA2B,UAAW,kBAAkB,KAAG,IAAI,CAKvE;IAEF,OAAO,CAAC,uBAAuB,CAK7B;IAEF,OAAO,CAAC,sBAAsB,CAK5B;IAEF,OAAO,CAAC,2BAA2B,CAKjC;IAEF,OAAO,CAAC,kBAAkB,CAoCxB;IAEF,OAAO,CAAC,gBAAgB,CAiBtB;CACH"}
@@ -14,10 +14,8 @@ const React = require("react");
14
14
  const appui_abstract_1 = require("@itwin/appui-abstract");
15
15
  const DivWithOutsideClick_1 = require("../base/DivWithOutsideClick");
16
16
  const UiCore_1 = require("../UiCore");
17
- const FocusTrap_1 = require("../focustrap/FocusTrap");
18
17
  const itwinui_react_1 = require("@itwin/itwinui-react");
19
- const IconComponent_1 = require("../icons/IconComponent");
20
- const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
18
+ const itwinui_react_2 = require("@itwin/itwinui-react");
21
19
  // cspell:ignore focustrap
22
20
  /** Enum for dialog alignment
23
21
  * @public
@@ -43,28 +41,7 @@ class Dialog extends React.Component {
43
41
  super(props);
44
42
  this._parentDocument = document;
45
43
  this._containerRef = React.createRef();
46
- /** Keep title bar of movable Dialog at least partially visible */
47
44
  // istanbul ignore next
48
- this._handleAppWindowResize = () => {
49
- if (!this._containerRef.current || !this.props.movable)
50
- return;
51
- const parentWindow = this.getParentWindow();
52
- const { x, y } = this.state;
53
- let newX;
54
- let newY;
55
- if (undefined !== y && undefined !== x) {
56
- if (y > parentWindow.innerHeight - 32)
57
- newY = parentWindow.innerHeight - 32;
58
- if (x > parentWindow.innerWidth - 32)
59
- newX = parentWindow.innerWidth - 32;
60
- }
61
- if (newX !== undefined || newY !== undefined)
62
- this.setState({
63
- x: newX !== undefined ? newX : x,
64
- y: newY !== undefined ? newY : y,
65
- positionSet: true,
66
- });
67
- };
68
45
  this.handleRefSet = (containerDiv) => {
69
46
  if (containerDiv)
70
47
  this._parentDocument = containerDiv.ownerDocument;
@@ -100,29 +77,11 @@ class Dialog extends React.Component {
100
77
  const parentWindow = this.getParentWindow();
101
78
  parentWindow.addEventListener("pointermove", this._handlePointerMove, true);
102
79
  };
103
- this._handleStartMove = (event) => {
104
- if (!this.props.movable)
105
- return;
106
- event.preventDefault();
107
- // istanbul ignore else
108
- if (this._containerRef.current) {
109
- const rect = this._containerRef.current.getBoundingClientRect();
110
- const grabOffsetX = event.clientX - rect.left;
111
- const grabOffsetY = event.clientY - rect.top;
112
- this.setState({
113
- grabOffsetX,
114
- grabOffsetY,
115
- moving: true,
116
- });
117
- const parentWindow = this.getParentWindow();
118
- parentWindow.addEventListener("pointermove", this._handlePointerMove, true);
119
- }
120
- };
121
80
  this._handlePointerMove = (event) => {
122
- if ((!this.props.resizable && !this.props.movable) ||
123
- !this._containerRef.current)
81
+ // istanbul ignore next
82
+ if (!this.props.resizable || !this._containerRef.current)
124
83
  return;
125
- const { minWidth, maxWidth, minHeight, maxHeight, movable } = this.props;
84
+ const { minWidth, maxWidth, minHeight, maxHeight } = this.props;
126
85
  let { x, y, width, height } = this.state;
127
86
  // istanbul ignore else
128
87
  if (x === undefined) {
@@ -133,57 +92,34 @@ class Dialog extends React.Component {
133
92
  (x = rect.left),
134
93
  (y = rect.top);
135
94
  }
136
- if (this.props.resizable) {
137
- if (this.state.rightResizing) {
138
- const pointerX = event.clientX;
139
- width = pointerX - x;
140
- // istanbul ignore else
141
- if (typeof minWidth === "number")
142
- width = Math.max(width, minWidth);
143
- if (maxWidth !== undefined && typeof maxWidth === "number")
144
- width = Math.min(width, maxWidth);
145
- }
146
- if (this.state.downResizing) {
147
- const pointerY = event.clientY;
148
- height = pointerY - y;
149
- // istanbul ignore else
150
- if (typeof minHeight === "number")
151
- height = Math.max(height, minHeight);
152
- if (maxHeight !== undefined && typeof maxHeight === "number")
153
- height = Math.min(height, maxHeight);
154
- }
155
- this.setState({ width, height });
95
+ if (this.state.rightResizing) {
96
+ const pointerX = event.clientX;
97
+ width = pointerX - x;
98
+ // istanbul ignore else
99
+ if (typeof minWidth === "number")
100
+ width = Math.max(width, minWidth);
101
+ if (maxWidth !== undefined && typeof maxWidth === "number")
102
+ width = Math.min(width, maxWidth);
156
103
  }
157
- // istanbul ignore next
158
- if (movable && this.state.moving) {
159
- x = event.clientX - this.state.grabOffsetX;
160
- y = event.clientY - this.state.grabOffsetY;
161
- if (y < 0)
162
- y = 0;
163
- if (event.view) {
164
- if (y > event.view.innerHeight - 32)
165
- y = event.view.innerHeight - 32;
166
- if (x > event.view.innerWidth - 32)
167
- x = event.view.innerWidth - 32;
168
- if (width) {
169
- if (x < 0 - width + 32)
170
- x = 0 - width + 32;
171
- }
172
- }
173
- this.setState({ x, y, positionSet: true });
104
+ if (this.state.downResizing) {
105
+ const pointerY = event.clientY;
106
+ height = pointerY - y;
107
+ // istanbul ignore else
108
+ if (typeof minHeight === "number")
109
+ height = Math.max(height, minHeight);
110
+ if (maxHeight !== undefined && typeof maxHeight === "number")
111
+ height = Math.min(height, maxHeight);
174
112
  }
113
+ this.setState({ width, height });
175
114
  };
176
115
  this._handlePointerUp = (_event) => {
177
- if (!this.props.movable && !this.props.resizable)
116
+ if (!this.props.resizable)
178
117
  return;
179
118
  // istanbul ignore else
180
119
  if (this._containerRef.current) {
181
120
  this.setState({
182
121
  rightResizing: false,
183
122
  downResizing: false,
184
- moving: false,
185
- grabOffsetX: 0,
186
- grabOffsetY: 0,
187
123
  });
188
124
  }
189
125
  const parentWindow = this.getParentWindow();
@@ -192,10 +128,6 @@ class Dialog extends React.Component {
192
128
  this.state = {
193
129
  rightResizing: false,
194
130
  downResizing: false,
195
- moving: false,
196
- grabOffsetX: 0,
197
- grabOffsetY: 0,
198
- positionSet: props.x !== undefined || props.y !== undefined,
199
131
  };
200
132
  }
201
133
  getParentWindow() {
@@ -208,118 +140,89 @@ class Dialog extends React.Component {
208
140
  parentWindow.removeEventListener("pointerup", this._handlePointerUp, true);
209
141
  parentWindow.removeEventListener("pointermove", this._handlePointerMove, true);
210
142
  this._parentDocument.removeEventListener("keyup", this._handleKeyUp, true);
211
- parentWindow.addEventListener("resize", this._handleAppWindowResize);
212
143
  }
213
144
  componentDidMount() {
214
145
  const parentWindow = this.getParentWindow();
215
146
  parentWindow.addEventListener("pointerup", this._handlePointerUp, true);
216
147
  this._parentDocument.addEventListener("keyup", this._handleKeyUp, true);
217
- parentWindow.addEventListener("resize", this._handleAppWindowResize);
218
148
  }
219
149
  render() {
220
150
  const { opened, title, footer, buttonCluster, onClose, onEscape, onOutsideClick, minWidth, minHeight, x, y, width, height, maxHeight, maxWidth, backgroundStyle, titleStyle, footerStyle, style, contentStyle, contentClassName, modal, resizable, movable, className, alignment, inset, trapFocus, modelessId, onModelessPointerDown, hideHeader, header, ...props } = this.props;
151
+ let initialOffset = {};
152
+ if (x || y) {
153
+ initialOffset = {
154
+ left: x !== null && x !== void 0 ? x : 0,
155
+ top: y !== null && y !== void 0 ? y : 0,
156
+ transform: "none",
157
+ };
158
+ }
221
159
  const containerStyle = {
160
+ ...initialOffset,
222
161
  margin: "",
223
- left: x,
224
- top: y,
225
162
  width,
226
163
  height,
227
164
  };
228
- if (this.state.x !== undefined || this.state.y !== undefined) {
229
- // istanbul ignore else
230
- if (this.state.x !== undefined) {
231
- containerStyle.marginLeft = "0";
232
- containerStyle.marginRight = "0";
233
- containerStyle.left = this.state.x;
234
- }
235
- // istanbul ignore else
236
- if (this.state.y !== undefined) {
237
- containerStyle.marginTop = "0";
238
- containerStyle.marginBottom = "0";
239
- containerStyle.top = this.state.y;
240
- }
241
- }
242
- if (this.state.width !== undefined || this.state.height !== undefined) {
243
- // istanbul ignore else
244
- if (this.state.width !== undefined)
245
- containerStyle.width = this.state.width;
246
- // istanbul ignore else
247
- if (this.state.height !== undefined)
248
- containerStyle.height = this.state.height;
249
- }
165
+ // istanbul ignore else
166
+ if (this.state.width !== undefined)
167
+ containerStyle.width = this.state.width;
168
+ // istanbul ignore else
169
+ if (this.state.height !== undefined)
170
+ containerStyle.height = this.state.height;
250
171
  const minMaxStyle = {
251
172
  minWidth,
252
173
  minHeight,
253
174
  maxWidth,
254
175
  maxHeight,
255
176
  };
256
- const buttons = this.getFooterButtons(buttonCluster);
257
- const footerElement = footer ||
258
- (buttons && buttons.length > 0 && (React.createElement("div", { className: "core-dialog-buttons" }, buttons)));
259
- const divStyle = {
260
- ...backgroundStyle,
261
- ...style,
177
+ const dialogBaseContainerStyle = {
178
+ ...containerStyle,
179
+ ...minMaxStyle,
262
180
  };
263
- const headerElement = header || (React.createElement("div", { className: (0, classnames_1.default)("core-dialog-head", { "core-dialog-movable": movable }, { "core-dialog-modal": modal }), "data-testid": "core-dialog-head", onPointerDown: this._handleStartMove },
264
- React.createElement("div", { className: "core-dialog-title", "data-testid": "core-dialog-title", style: titleStyle }, title),
265
- React.createElement("button", { className: "core-focus-trap-ignore-initial core-dialog-close icon", "data-testid": "core-dialog-close", onClick: onClose },
266
- React.createElement(IconComponent_1.Icon, { iconSpec: React.createElement(itwinui_icons_react_1.SvgClose, null) }))));
267
- return (React.createElement("div", { ref: this.handleRefSet, className: (0, classnames_1.default)("core-dialog", !modal && "core-dialog-hidden", opened && "core-dialog-opened", className), style: divStyle, "data-testid": "core-dialog-root", ...props }, opened && (React.createElement(DivWithOutsideClick_1.DivWithOutsideClick, { onOutsideClick: onOutsideClick },
268
- React.createElement(FocusTrap_1.FocusTrap, { active: trapFocus && modal, returnFocusOnDeactivate: true },
269
- React.createElement("div", { className: (0, classnames_1.default)("core-dialog-container", this.getCSSClassNameFromAlignment(alignment)), style: { ...containerStyle, ...minMaxStyle }, "data-testid": "core-dialog-container", onPointerDown: this._handleContainerPointerDown },
270
- React.createElement("div", { className: "core-dialog-area", ref: this._containerRef, style: minMaxStyle },
271
- !hideHeader && headerElement,
272
- React.createElement("div", { className: (0, classnames_1.default)("core-dialog-content", { "core-dialog-content-no-inset": !inset }, contentClassName), style: contentStyle }, this.props.children),
273
- footerElement && (React.createElement("div", { className: "core-dialog-footer", style: footerStyle }, footerElement)),
274
- React.createElement("div", { className: (0, classnames_1.default)("core-dialog-drag", "core-dialog-drag-right", { "core-dialog-drag-enabled": resizable }), "data-testid": "core-dialog-drag-right", onPointerDown: this._handleStartResizeRight }),
275
- React.createElement("div", { className: (0, classnames_1.default)("core-dialog-drag", "core-dialog-drag-bottom-mid", { "core-dialog-drag-enabled": resizable }), "data-testid": "core-dialog-drag-bottom", onPointerDown: this._handleStartResizeDown }),
276
- React.createElement("div", { className: (0, classnames_1.default)("core-dialog-drag", "core-dialog-drag-bottom-right", { "core-dialog-drag-enabled": resizable }), "data-testid": "core-dialog-drag-bottom-right", onPointerDown: this._handleStartResizeDownRight }))))))));
181
+ const buttons = this.getFooterButtons(buttonCluster, "high-visibility", true);
182
+ return (React.createElement(itwinui_react_1.Dialog, { isOpen: opened, onClose: onClose, closeOnExternalClick: false, closeOnEsc: false, style: style, className: (0, classnames_1.default)("core-dialog", className), isDraggable: movable, trapFocus: trapFocus && /* istanbul ignore next */ modal, preventDocumentScroll: true, "data-testid": "core-dialog-root", ...props },
183
+ modal && React.createElement(itwinui_react_1.Dialog.Backdrop, { style: backgroundStyle }),
184
+ React.createElement(DivWithOutsideClick_1.DivWithOutsideClick, { onOutsideClick: onOutsideClick },
185
+ React.createElement(itwinui_react_1.Dialog.Main, { ref: this._containerRef, className: (0, classnames_1.default)("core-dialog-main", alignment && this.getCSSClassNameFromAlignment(alignment)), "data-testid": "core-dialog-container", style: dialogBaseContainerStyle, onPointerDown: this._handleContainerPointerDown },
186
+ !hideHeader &&
187
+ (header || (React.createElement(itwinui_react_1.Dialog.TitleBar, { titleText: title, style: titleStyle, "data-testid": "core-dialog-head" }))),
188
+ React.createElement(itwinui_react_1.Dialog.Content, { className: contentClassName, style: { padding: inset ? undefined : 0, ...contentStyle } }, this.props.children),
189
+ footer || (React.createElement(itwinui_react_1.Dialog.ButtonBar, { style: footerStyle }, buttons)),
190
+ resizable && (React.createElement(React.Fragment, null,
191
+ React.createElement("div", { className: (0, classnames_1.default)("core-dialog-resize-bar", "core-drag-right"), onPointerDown: this._handleStartResizeRight, "data-testid": "core-dialog-drag-right" }),
192
+ React.createElement("div", { className: (0, classnames_1.default)("core-dialog-resize-bar", "core-drag-bottom-right"), onPointerDown: this._handleStartResizeDownRight, "data-testid": "core-dialog-drag-bottom-right" }),
193
+ React.createElement("div", { className: (0, classnames_1.default)("core-dialog-resize-bar", "core-drag-bottom"), onPointerDown: this._handleStartResizeDown, "data-testid": "core-dialog-drag-bottom" })))))));
277
194
  }
278
195
  getCSSClassNameFromAlignment(alignment) {
279
- let className = "";
280
- // Drop the alignment CSS class if the Dialog has been sized or moved.
281
- if (this.state.positionSet)
282
- return "";
283
- // istanbul ignore next
284
- if (!alignment)
285
- alignment = DialogAlignment.Center;
286
196
  switch (alignment) {
287
197
  case DialogAlignment.TopLeft:
288
- className = "core-dialog-top-left";
289
- break;
198
+ return "core-align-top-left";
290
199
  case DialogAlignment.Top:
291
- className = "core-dialog-top";
292
- break;
200
+ return "core-align-top";
293
201
  case DialogAlignment.TopRight:
294
- className = "core-dialog-top-right";
295
- break;
202
+ return "core-align-top-right";
296
203
  case DialogAlignment.Left:
297
- className = "core-dialog-left";
298
- break;
204
+ return "core-align-left";
299
205
  case DialogAlignment.Center:
300
- className = "core-dialog-center";
301
- break;
206
+ return "core-align-center";
302
207
  case DialogAlignment.Right:
303
- className = "core-dialog-right";
304
- break;
208
+ return "core-align-right";
305
209
  case DialogAlignment.BottomLeft:
306
- className = "core-dialog-bottom-left";
307
- break;
210
+ return "core-align-bottom-left";
308
211
  case DialogAlignment.Bottom:
309
- className = "core-dialog-bottom";
310
- break;
212
+ return "core-align-bottom";
311
213
  case DialogAlignment.BottomRight:
312
- className = "core-dialog-bottom-right";
313
- break;
214
+ return "core-align-bottom-right";
314
215
  }
315
- return className;
316
216
  }
317
- getFooterButtons(buttonCluster, primaryStyleType = "cta", noCoreButtonClasses = false) {
217
+ getFooterButtons(buttonCluster,
218
+ /* istanbul ignore next */ primaryStyleType = "cta",
219
+ /* istanbul ignore next */ noCoreButtonClasses = false) {
318
220
  if (buttonCluster === undefined)
319
221
  return undefined;
320
222
  const buttons = [];
321
223
  buttonCluster.forEach((button, index) => {
322
224
  let buttonText = "";
225
+ // istanbul ignore next
323
226
  let buttonClass = (0, classnames_1.default)(!noCoreButtonClasses && "core-dialog-button", !noCoreButtonClasses && `dialog-button-${button.type}`, button.className);
324
227
  let usePrimaryStyleType = false;
325
228
  switch (button.type) {
@@ -363,15 +266,15 @@ class Dialog extends React.Component {
363
266
  }
364
267
  if (button.label)
365
268
  buttonText = button.label;
366
- buttons.push(React.createElement(itwinui_react_1.Button, { className: buttonClass, disabled: button.disabled, styleType: usePrimaryStyleType ? primaryStyleType : undefined, key: index.toString(), onClick: button.onClick }, buttonText));
269
+ buttons.push(React.createElement(itwinui_react_2.Button, { className: buttonClass, disabled: button.disabled, styleType: usePrimaryStyleType ? primaryStyleType : undefined, key: index.toString(), onClick: button.onClick }, buttonText));
367
270
  });
368
271
  return buttons;
369
272
  }
370
273
  }
371
274
  Dialog.defaultProps = {
372
- alignment: DialogAlignment.Center,
373
275
  minWidth: 300,
374
- minHeight: 100,
276
+ minHeight: 135,
277
+ maxWidth: "100%",
375
278
  width: "50%",
376
279
  hideHeader: false,
377
280
  resizable: false,