@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.
- package/CHANGELOG.md +7 -4
- package/lib/cjs/core-react/_geometry.scss +3 -3
- package/lib/cjs/core-react/_math.scss +3 -3
- package/lib/cjs/core-react/_typography.scss +3 -3
- package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +3 -3
- package/lib/cjs/core-react/badge/Badge.scss +3 -3
- package/lib/cjs/core-react/badge/NewBadge.scss +3 -3
- package/lib/cjs/core-react/base/base.scss +3 -3
- package/lib/cjs/core-react/base/index.scss +3 -3
- package/lib/cjs/core-react/classes.scss +3 -3
- package/lib/cjs/core-react/colorthemes.scss +3 -3
- package/lib/cjs/core-react/colorvariables.scss +3 -3
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +3 -3
- package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -10
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +69 -166
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.scss +59 -217
- package/lib/cjs/core-react/expandable/index.scss +3 -3
- package/lib/cjs/core-react/expandable/list.scss +3 -3
- package/lib/cjs/core-react/icons/SvgPath.scss +3 -3
- package/lib/cjs/core-react/icons/WebFontIcon.scss +3 -3
- package/lib/cjs/core-react/icons/index.scss +3 -3
- package/lib/cjs/core-react/icons/mixins.scss +3 -3
- package/lib/cjs/core-react/icons/variables.scss +3 -3
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
- package/lib/cjs/core-react/index.scss +3 -3
- package/lib/cjs/core-react/inputs/index.scss +3 -3
- package/lib/cjs/core-react/inputs/input-label.scss +3 -3
- package/lib/cjs/core-react/inputs/input.scss +3 -3
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +3 -3
- package/lib/cjs/core-react/inputs/variables.scss +3 -3
- package/lib/cjs/core-react/listbox/Listbox.scss +3 -3
- package/lib/cjs/core-react/loading/LoadingPrompt.scss +3 -3
- package/lib/cjs/core-react/loading/LoadingSpinner.scss +3 -3
- package/lib/cjs/core-react/loading/index.scss +3 -3
- package/lib/cjs/core-react/loading/mixins.scss +3 -3
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +2 -2
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.scss +3 -3
- package/lib/cjs/core-react/popup/Popup.scss +3 -3
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +3 -3
- package/lib/cjs/core-react/searchbox/SearchBox.scss +3 -3
- package/lib/cjs/core-react/settings/SettingsContainer.scss +3 -3
- package/lib/cjs/core-react/style/baseline.scss +3 -3
- package/lib/cjs/core-react/style/index.scss +3 -3
- package/lib/cjs/core-react/style/opacity.scss +3 -3
- package/lib/cjs/core-react/tabs/index.scss +3 -3
- package/lib/cjs/core-react/tabs/tabs.scss +3 -3
- package/lib/cjs/core-react/tabs/vertical.scss +3 -3
- package/lib/cjs/core-react/text/FilteredText.scss +3 -3
- package/lib/cjs/core-react/text/block.scss +3 -3
- package/lib/cjs/core-react/text/body.scss +3 -3
- package/lib/cjs/core-react/text/index.scss +3 -3
- package/lib/cjs/core-react/text/mixins.scss +3 -3
- package/lib/cjs/core-react/tree/ExpansionToggle.scss +3 -3
- package/lib/cjs/core-react/tree/Placeholder.scss +3 -3
- package/lib/cjs/core-react/tree/Tree.scss +3 -3
- package/lib/esm/core-react/_geometry.scss +3 -3
- package/lib/esm/core-react/_math.scss +3 -3
- package/lib/esm/core-react/_typography.scss +3 -3
- package/lib/esm/core-react/autosuggest/AutoSuggest.scss +3 -3
- package/lib/esm/core-react/badge/Badge.scss +3 -3
- package/lib/esm/core-react/badge/NewBadge.scss +3 -3
- package/lib/esm/core-react/base/base.scss +3 -3
- package/lib/esm/core-react/base/index.scss +3 -3
- package/lib/esm/core-react/classes.scss +3 -3
- package/lib/esm/core-react/colorthemes.scss +3 -3
- package/lib/esm/core-react/colorvariables.scss +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +3 -3
- package/lib/esm/core-react/dialog/Dialog.d.ts +3 -10
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +68 -165
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.scss +59 -217
- package/lib/esm/core-react/expandable/index.scss +3 -3
- package/lib/esm/core-react/expandable/list.scss +3 -3
- package/lib/esm/core-react/icons/SvgPath.scss +3 -3
- package/lib/esm/core-react/icons/WebFontIcon.scss +3 -3
- package/lib/esm/core-react/icons/index.scss +3 -3
- package/lib/esm/core-react/icons/mixins.scss +3 -3
- package/lib/esm/core-react/icons/variables.scss +3 -3
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +3 -3
- package/lib/esm/core-react/index.scss +3 -3
- package/lib/esm/core-react/inputs/index.scss +3 -3
- package/lib/esm/core-react/inputs/input-label.scss +3 -3
- package/lib/esm/core-react/inputs/input.scss +3 -3
- package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +3 -3
- package/lib/esm/core-react/inputs/variables.scss +3 -3
- package/lib/esm/core-react/listbox/Listbox.scss +3 -3
- package/lib/esm/core-react/loading/LoadingPrompt.scss +3 -3
- package/lib/esm/core-react/loading/LoadingSpinner.scss +3 -3
- package/lib/esm/core-react/loading/index.scss +3 -3
- package/lib/esm/core-react/loading/mixins.scss +3 -3
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +2 -2
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.scss +3 -3
- package/lib/esm/core-react/popup/Popup.scss +3 -3
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +3 -3
- package/lib/esm/core-react/searchbox/SearchBox.scss +3 -3
- package/lib/esm/core-react/settings/SettingsContainer.scss +3 -3
- package/lib/esm/core-react/style/baseline.scss +3 -3
- package/lib/esm/core-react/style/index.scss +3 -3
- package/lib/esm/core-react/style/opacity.scss +3 -3
- package/lib/esm/core-react/tabs/index.scss +3 -3
- package/lib/esm/core-react/tabs/tabs.scss +3 -3
- package/lib/esm/core-react/tabs/vertical.scss +3 -3
- package/lib/esm/core-react/text/FilteredText.scss +3 -3
- package/lib/esm/core-react/text/block.scss +3 -3
- package/lib/esm/core-react/text/body.scss +3 -3
- package/lib/esm/core-react/text/index.scss +3 -3
- package/lib/esm/core-react/text/mixins.scss +3 -3
- package/lib/esm/core-react/tree/ExpansionToggle.scss +3 -3
- package/lib/esm/core-react/tree/Placeholder.scss +3 -3
- package/lib/esm/core-react/tree/Tree.scss +3 -3
- package/package.json +3 -3
- package/lib/cjs/core-react/dialog/SimpleDialog.d.ts +0 -68
- package/lib/cjs/core-react/dialog/SimpleDialog.d.ts.map +0 -1
- package/lib/cjs/core-react/dialog/SimpleDialog.js +0 -51
- package/lib/cjs/core-react/dialog/SimpleDialog.js.map +0 -1
- package/lib/esm/core-react/dialog/SimpleDialog.d.ts +0 -68
- package/lib/esm/core-react/dialog/SimpleDialog.d.ts.map +0 -1
- package/lib/esm/core-react/dialog/SimpleDialog.js +0 -47
- 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
|
|
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.
|
|
6
|
-
|
|
5
|
+
## 4.3.0
|
|
6
|
+
Mon, 17 Jul 2023 10:16:20 GMT
|
|
7
7
|
|
|
8
|
-
|
|
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.
|
|
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:
|
|
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;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/core-react/dialog/Dialog.tsx"],"names":[],"mappings":"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"}
|
|
@@ -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
|
|
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
|
-
|
|
123
|
-
|
|
81
|
+
// istanbul ignore next
|
|
82
|
+
if (!this.props.resizable || !this._containerRef.current)
|
|
124
83
|
return;
|
|
125
|
-
const { minWidth, maxWidth, minHeight, maxHeight
|
|
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.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (
|
|
162
|
-
|
|
163
|
-
if (
|
|
164
|
-
|
|
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.
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const divStyle = {
|
|
260
|
-
...backgroundStyle,
|
|
261
|
-
...style,
|
|
177
|
+
const dialogBaseContainerStyle = {
|
|
178
|
+
...containerStyle,
|
|
179
|
+
...minMaxStyle,
|
|
262
180
|
};
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
React.createElement(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
React.createElement(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
React.createElement("div", { className: (0, classnames_1.default)("core-dialog-
|
|
275
|
-
React.createElement("div", { className: (0, classnames_1.default)("core-dialog-
|
|
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
|
-
|
|
289
|
-
break;
|
|
198
|
+
return "core-align-top-left";
|
|
290
199
|
case DialogAlignment.Top:
|
|
291
|
-
|
|
292
|
-
break;
|
|
200
|
+
return "core-align-top";
|
|
293
201
|
case DialogAlignment.TopRight:
|
|
294
|
-
|
|
295
|
-
break;
|
|
202
|
+
return "core-align-top-right";
|
|
296
203
|
case DialogAlignment.Left:
|
|
297
|
-
|
|
298
|
-
break;
|
|
204
|
+
return "core-align-left";
|
|
299
205
|
case DialogAlignment.Center:
|
|
300
|
-
|
|
301
|
-
break;
|
|
206
|
+
return "core-align-center";
|
|
302
207
|
case DialogAlignment.Right:
|
|
303
|
-
|
|
304
|
-
break;
|
|
208
|
+
return "core-align-right";
|
|
305
209
|
case DialogAlignment.BottomLeft:
|
|
306
|
-
|
|
307
|
-
break;
|
|
210
|
+
return "core-align-bottom-left";
|
|
308
211
|
case DialogAlignment.Bottom:
|
|
309
|
-
|
|
310
|
-
break;
|
|
212
|
+
return "core-align-bottom";
|
|
311
213
|
case DialogAlignment.BottomRight:
|
|
312
|
-
|
|
313
|
-
break;
|
|
214
|
+
return "core-align-bottom-right";
|
|
314
215
|
}
|
|
315
|
-
return className;
|
|
316
216
|
}
|
|
317
|
-
getFooterButtons(buttonCluster,
|
|
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(
|
|
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:
|
|
276
|
+
minHeight: 135,
|
|
277
|
+
maxWidth: "100%",
|
|
375
278
|
width: "50%",
|
|
376
279
|
hideHeader: false,
|
|
377
280
|
resizable: false,
|