@itwin/itwinui-react 1.29.1 → 1.29.2
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### [1.29.2](https://www.github.com/iTwin/iTwinUI-react/compare/v1.29.1...v1.29.2) (2022-01-24)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
* **Button:** Fix event typings for inline handlers ([#519](https://www.github.com/iTwin/iTwinUI-react/issues/519)) ([c72f5fd](https://www.github.com/iTwin/iTwinUI-react/commit/c72f5fdae00f61d38295f30111f36c403590ebfe))
|
|
8
|
+
* **Modal:** Dont use `stopPropagation` for closing on backdrop click ([#518](https://www.github.com/iTwin/iTwinUI-react/issues/518)) ([83a2400](https://www.github.com/iTwin/iTwinUI-react/commit/83a240046f4f04cc625fa8e53fe62d83a7af4c8b))
|
|
9
|
+
|
|
3
10
|
### [1.29.1](https://www.github.com/iTwin/iTwinUI-react/compare/v1.29.0...v1.29.1) (2022-01-19)
|
|
4
11
|
|
|
5
12
|
### Fixes
|
package/cjs/core/Modal/Modal.js
CHANGED
|
@@ -110,13 +110,16 @@ var Modal = function (props) {
|
|
|
110
110
|
var handleMouseDown = function (event) {
|
|
111
111
|
// Prevents React from resetting its properties
|
|
112
112
|
event.persist();
|
|
113
|
+
if (event.target !== overlayRef.current) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
113
116
|
if (isDismissible && closeOnExternalClick && onClose) {
|
|
114
117
|
onClose(event);
|
|
115
118
|
}
|
|
116
119
|
};
|
|
117
120
|
return !!container ? (react_dom_1.default.createPortal(isOpen && (react_1.default.createElement(utils_1.FocusTrap, null,
|
|
118
121
|
react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-modal', 'iui-modal-visible', className), tabIndex: -1, onKeyDown: handleKeyDown, ref: overlayRef, onMouseDown: handleMouseDown }, rest),
|
|
119
|
-
react_1.default.createElement("div", { className: 'iui-modal-dialog', id: id, style: style, role: 'dialog', "aria-modal": 'true'
|
|
122
|
+
react_1.default.createElement("div", { className: 'iui-modal-dialog', id: id, style: style, role: 'dialog', "aria-modal": 'true' },
|
|
120
123
|
react_1.default.createElement("div", { className: 'iui-title-bar' },
|
|
121
124
|
react_1.default.createElement("div", { className: 'iui-title' }, title),
|
|
122
125
|
isDismissible && (react_1.default.createElement(IconButton_1.IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
|
|
@@ -42,9 +42,9 @@ export interface PolymorphicForwardRefComponent<T, OwnProps = Record<string, unk
|
|
|
42
42
|
as?: T;
|
|
43
43
|
}>> {
|
|
44
44
|
<As = T>(props: As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
45
|
-
as
|
|
45
|
+
as: As;
|
|
46
46
|
}> : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
47
|
-
as
|
|
47
|
+
as: As;
|
|
48
48
|
}> : never): React.ReactElement | null;
|
|
49
49
|
}
|
|
50
50
|
declare type Merge<P1, P2> = Omit<P1, keyof P2> & P2;
|
package/esm/core/Modal/Modal.js
CHANGED
|
@@ -104,13 +104,16 @@ export var Modal = function (props) {
|
|
|
104
104
|
var handleMouseDown = function (event) {
|
|
105
105
|
// Prevents React from resetting its properties
|
|
106
106
|
event.persist();
|
|
107
|
+
if (event.target !== overlayRef.current) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
107
110
|
if (isDismissible && closeOnExternalClick && onClose) {
|
|
108
111
|
onClose(event);
|
|
109
112
|
}
|
|
110
113
|
};
|
|
111
114
|
return !!container ? (ReactDOM.createPortal(isOpen && (React.createElement(FocusTrap, null,
|
|
112
115
|
React.createElement("div", __assign({ className: cx('iui-modal', 'iui-modal-visible', className), tabIndex: -1, onKeyDown: handleKeyDown, ref: overlayRef, onMouseDown: handleMouseDown }, rest),
|
|
113
|
-
React.createElement("div", { className: 'iui-modal-dialog', id: id, style: style, role: 'dialog', "aria-modal": 'true'
|
|
116
|
+
React.createElement("div", { className: 'iui-modal-dialog', id: id, style: style, role: 'dialog', "aria-modal": 'true' },
|
|
114
117
|
React.createElement("div", { className: 'iui-title-bar' },
|
|
115
118
|
React.createElement("div", { className: 'iui-title' }, title),
|
|
116
119
|
isDismissible && (React.createElement(IconButton, { size: 'small', styleType: 'borderless', onClick: onClose, "aria-label": 'Close' },
|
|
@@ -42,9 +42,9 @@ export interface PolymorphicForwardRefComponent<T, OwnProps = Record<string, unk
|
|
|
42
42
|
as?: T;
|
|
43
43
|
}>> {
|
|
44
44
|
<As = T>(props: As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
45
|
-
as
|
|
45
|
+
as: As;
|
|
46
46
|
}> : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
47
|
-
as
|
|
47
|
+
as: As;
|
|
48
48
|
}> : never): React.ReactElement | null;
|
|
49
49
|
}
|
|
50
50
|
declare type Merge<P1, P2> = Omit<P1, keyof P2> & P2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/itwinui-react",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.2",
|
|
4
4
|
"author": "Bentley Systems",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"build-storybook": "build-storybook"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@itwin/itwinui-css": "^0.44.
|
|
43
|
+
"@itwin/itwinui-css": "^0.44.1",
|
|
44
44
|
"@itwin/itwinui-icons-react": "^1.5.0",
|
|
45
45
|
"@itwin/itwinui-illustrations-react": "^1.0.1",
|
|
46
46
|
"@tippyjs/react": "^4.2.5",
|
|
@@ -121,7 +121,8 @@
|
|
|
121
121
|
"nth-check": "^2.0.1",
|
|
122
122
|
"ansi-regex": "^5.0.1",
|
|
123
123
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
|
|
124
|
-
"postcss": "8"
|
|
124
|
+
"postcss": "8",
|
|
125
|
+
"nanoid": "^3.1.31"
|
|
125
126
|
},
|
|
126
127
|
"husky": {
|
|
127
128
|
"hooks": {
|