@itwin/itwinui-react 2.12.9 → 2.12.11
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 +13 -0
- package/cjs/core/Modal/Modal.d.ts +1 -1
- package/cjs/core/Modal/Modal.js +1 -1
- package/cjs/core/Table/SubRowExpander.js +1 -1
- package/cjs/core/Table/columns/expanderColumn.js +1 -1
- package/cjs/core/Table/hooks/useScrollToRow.js +2 -2
- package/cjs/core/Toast/Toaster.js +1 -1
- package/esm/core/Modal/Modal.d.ts +1 -1
- package/esm/core/Modal/Modal.js +1 -1
- package/esm/core/Table/SubRowExpander.js +1 -1
- package/esm/core/Table/columns/expanderColumn.js +1 -1
- package/esm/core/Table/hooks/useScrollToRow.js +2 -2
- package/esm/core/Toast/Toaster.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1607](https://github.com/iTwin/iTwinUI/pull/1607): Add `aria-expanded` on table row expander button
|
|
8
|
+
|
|
9
|
+
## 2.12.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1590](https://github.com/iTwin/iTwinUI/pull/1590): Fixed undefined property access in `useScrollToRow`.
|
|
14
|
+
- [#1587](https://github.com/iTwin/iTwinUI/pull/1587): Fixed an issue where v2 toasts and modals were being added to v1 containers.
|
|
15
|
+
|
|
3
16
|
## 2.12.9
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -31,7 +31,7 @@ export declare type ModalProps = {
|
|
|
31
31
|
onKeyDown?: React.KeyboardEventHandler;
|
|
32
32
|
/**
|
|
33
33
|
* Id of the root where the modal will be rendered in.
|
|
34
|
-
* @default '
|
|
34
|
+
* @default 'iui2-react-portal-container'
|
|
35
35
|
*/
|
|
36
36
|
modalRootId?: string;
|
|
37
37
|
/**
|
package/cjs/core/Modal/Modal.js
CHANGED
|
@@ -57,7 +57,7 @@ const index_js_2 = require("../Dialog/index.js");
|
|
|
57
57
|
* </Modal>
|
|
58
58
|
*/
|
|
59
59
|
const Modal = (props) => {
|
|
60
|
-
const { isOpen = false, isDismissible = true, closeOnEsc = true, closeOnExternalClick = true, onClose, title, children, modalRootId = '
|
|
60
|
+
const { isOpen = false, isDismissible = true, closeOnEsc = true, closeOnExternalClick = true, onClose, title, children, modalRootId = 'iui2-react-portal-container', ownerDocument = (0, index_js_1.getDocument)(), ...rest } = props;
|
|
61
61
|
(0, index_js_1.useTheme)();
|
|
62
62
|
const [container, setContainer] = React.useState();
|
|
63
63
|
React.useEffect(() => {
|
|
@@ -38,7 +38,7 @@ const SubRowExpander = (props) => {
|
|
|
38
38
|
}, className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
39
39
|
e.stopPropagation();
|
|
40
40
|
cell.row.toggleRowExpanded();
|
|
41
|
-
}, disabled: isDisabled }, React.createElement(index_js_1.SvgChevronRight, { style: {
|
|
41
|
+
}, disabled: isDisabled, "aria-expanded": cell.row.isExpanded }, React.createElement(index_js_1.SvgChevronRight, { style: {
|
|
42
42
|
transform: cell.row.isExpanded ? 'rotate(90deg)' : undefined,
|
|
43
43
|
} })))));
|
|
44
44
|
};
|
|
@@ -77,7 +77,7 @@ const ExpanderColumn = (props = {}) => {
|
|
|
77
77
|
return (React.createElement(index_js_2.IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
78
78
|
e.stopPropagation();
|
|
79
79
|
row.toggleRowExpanded();
|
|
80
|
-
}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(props.row.original) }, React.createElement(index_js_1.SvgChevronRight, null)));
|
|
80
|
+
}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(props.row.original), "aria-expanded": row.isExpanded }, React.createElement(index_js_1.SvgChevronRight, null)));
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
cellRenderer: (props) => (React.createElement(index_js_3.DefaultCell, { ...props, isDisabled: (rowData) => !!(isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(rowData)) })),
|
|
@@ -49,14 +49,14 @@ function useScrollToRow({ data, enableVirtualization, page, paginatorRenderer, s
|
|
|
49
49
|
// For non-virtualized tables, we need to add a ref to each row
|
|
50
50
|
// and scroll to the element
|
|
51
51
|
React.useEffect(() => {
|
|
52
|
-
var _a;
|
|
52
|
+
var _a, _b;
|
|
53
53
|
if (enableVirtualization ||
|
|
54
54
|
scrollToIndex === undefined ||
|
|
55
55
|
scrollToIndex === null ||
|
|
56
56
|
scrollToIndex < 0) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
(
|
|
59
|
+
(_b = rowRefs.current[(_a = pageRef.current[scrollToIndex]) === null || _a === void 0 ? void 0 : _a.id]) === null || _b === void 0 ? void 0 : _b.scrollIntoView();
|
|
60
60
|
}, [enableVirtualization, scrollToIndex]);
|
|
61
61
|
const tableRowRef = React.useCallback((row) => {
|
|
62
62
|
return (element) => {
|
|
@@ -31,7 +31,7 @@ const React = __importStar(require("react"));
|
|
|
31
31
|
const ReactDOM = __importStar(require("react-dom"));
|
|
32
32
|
const index_js_1 = require("../utils/index.js");
|
|
33
33
|
const ToastWrapper_js_1 = require("./ToastWrapper.js");
|
|
34
|
-
const TOASTS_CONTAINER_ID = '
|
|
34
|
+
const TOASTS_CONTAINER_ID = 'iui2-toasts-container';
|
|
35
35
|
class Toaster {
|
|
36
36
|
constructor() {
|
|
37
37
|
this.toasts = [];
|
|
@@ -31,7 +31,7 @@ export declare type ModalProps = {
|
|
|
31
31
|
onKeyDown?: React.KeyboardEventHandler;
|
|
32
32
|
/**
|
|
33
33
|
* Id of the root where the modal will be rendered in.
|
|
34
|
-
* @default '
|
|
34
|
+
* @default 'iui2-react-portal-container'
|
|
35
35
|
*/
|
|
36
36
|
modalRootId?: string;
|
|
37
37
|
/**
|
package/esm/core/Modal/Modal.js
CHANGED
|
@@ -28,7 +28,7 @@ import { Dialog } from '../Dialog/index.js';
|
|
|
28
28
|
* </Modal>
|
|
29
29
|
*/
|
|
30
30
|
export const Modal = (props) => {
|
|
31
|
-
const { isOpen = false, isDismissible = true, closeOnEsc = true, closeOnExternalClick = true, onClose, title, children, modalRootId = '
|
|
31
|
+
const { isOpen = false, isDismissible = true, closeOnEsc = true, closeOnExternalClick = true, onClose, title, children, modalRootId = 'iui2-react-portal-container', ownerDocument = getDocument(), ...rest } = props;
|
|
32
32
|
useTheme();
|
|
33
33
|
const [container, setContainer] = React.useState();
|
|
34
34
|
React.useEffect(() => {
|
|
@@ -12,7 +12,7 @@ export const SubRowExpander = (props) => {
|
|
|
12
12
|
}, className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
13
13
|
e.stopPropagation();
|
|
14
14
|
cell.row.toggleRowExpanded();
|
|
15
|
-
}, disabled: isDisabled }, React.createElement(SvgChevronRight, { style: {
|
|
15
|
+
}, disabled: isDisabled, "aria-expanded": cell.row.isExpanded }, React.createElement(SvgChevronRight, { style: {
|
|
16
16
|
transform: cell.row.isExpanded ? 'rotate(90deg)' : undefined,
|
|
17
17
|
} })))));
|
|
18
18
|
};
|
|
@@ -51,7 +51,7 @@ export const ExpanderColumn = (props = {}) => {
|
|
|
51
51
|
return (React.createElement(IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
52
52
|
e.stopPropagation();
|
|
53
53
|
row.toggleRowExpanded();
|
|
54
|
-
}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(props.row.original) }, React.createElement(SvgChevronRight, null)));
|
|
54
|
+
}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(props.row.original), "aria-expanded": row.isExpanded }, React.createElement(SvgChevronRight, null)));
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
cellRenderer: (props) => (React.createElement(DefaultCell, { ...props, isDisabled: (rowData) => !!(isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(rowData)) })),
|
|
@@ -23,14 +23,14 @@ export function useScrollToRow({ data, enableVirtualization, page, paginatorRend
|
|
|
23
23
|
// For non-virtualized tables, we need to add a ref to each row
|
|
24
24
|
// and scroll to the element
|
|
25
25
|
React.useEffect(() => {
|
|
26
|
-
var _a;
|
|
26
|
+
var _a, _b;
|
|
27
27
|
if (enableVirtualization ||
|
|
28
28
|
scrollToIndex === undefined ||
|
|
29
29
|
scrollToIndex === null ||
|
|
30
30
|
scrollToIndex < 0) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
(
|
|
33
|
+
(_b = rowRefs.current[(_a = pageRef.current[scrollToIndex]) === null || _a === void 0 ? void 0 : _a.id]) === null || _b === void 0 ? void 0 : _b.scrollIntoView();
|
|
34
34
|
}, [enableVirtualization, scrollToIndex]);
|
|
35
35
|
const tableRowRef = React.useCallback((row) => {
|
|
36
36
|
return (element) => {
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import * as ReactDOM from 'react-dom';
|
|
7
7
|
import { getContainer, getDocument } from '../utils/index.js';
|
|
8
8
|
import { ToastWrapper } from './ToastWrapper.js';
|
|
9
|
-
const TOASTS_CONTAINER_ID = '
|
|
9
|
+
const TOASTS_CONTAINER_ID = 'iui2-toasts-container';
|
|
10
10
|
export default class Toaster {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.toasts = [];
|