@itwin/itwinui-react 3.19.7 → 3.20.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 +19 -0
- package/DEV-cjs/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/DEV-cjs/core/ComboBox/ComboBox.js +6 -2
- package/DEV-cjs/core/Dialog/DialogTitleBarTitle.js +1 -1
- package/DEV-cjs/core/DropdownMenu/DropdownMenu.js +1 -1
- package/DEV-cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
- package/DEV-cjs/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/DEV-cjs/core/Table/SubRowExpander.js +1 -1
- package/DEV-cjs/core/Table/Table.js +1 -1
- package/DEV-cjs/core/Table/TableCell.js +27 -18
- package/DEV-cjs/core/Table/cells/DefaultCell.js +63 -85
- package/DEV-cjs/core/Table/columns/expanderColumn.js +1 -1
- package/DEV-cjs/core/Tabs/Tabs.js +10 -6
- package/DEV-cjs/core/Tile/Tile.js +1 -2
- package/DEV-cjs/core/Tree/TreeNodeExpander.js +1 -5
- package/DEV-cjs/styles.js +1 -1
- package/DEV-esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
- package/DEV-esm/core/ComboBox/ComboBox.js +6 -2
- package/DEV-esm/core/Dialog/DialogTitleBarTitle.js +1 -1
- package/DEV-esm/core/DropdownMenu/DropdownMenu.js +1 -1
- package/DEV-esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
- package/DEV-esm/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/DEV-esm/core/Table/SubRowExpander.js +2 -2
- package/DEV-esm/core/Table/Table.js +1 -1
- package/DEV-esm/core/Table/TableCell.js +22 -19
- package/DEV-esm/core/Table/cells/DefaultCell.js +62 -84
- package/DEV-esm/core/Table/columns/expanderColumn.js +2 -2
- package/DEV-esm/core/Tabs/Tabs.js +8 -2
- package/DEV-esm/core/Tile/Tile.js +1 -2
- package/DEV-esm/core/Tree/TreeNodeExpander.js +2 -5
- package/DEV-esm/styles.js +1 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/cjs/core/ComboBox/ComboBox.js +6 -2
- package/cjs/core/Dialog/Dialog.d.ts +1 -1
- package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/cjs/core/Dialog/DialogTitleBarTitle.d.ts +1 -1
- package/cjs/core/Dialog/DialogTitleBarTitle.js +1 -1
- package/cjs/core/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/cjs/core/DropdownMenu/DropdownMenu.js +1 -1
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/cjs/core/StatusMessage/StatusMessage.d.ts +1 -1
- package/cjs/core/Table/SubRowExpander.js +1 -1
- package/cjs/core/Table/Table.js +1 -1
- package/cjs/core/Table/TableCell.js +27 -18
- package/cjs/core/Table/cells/DefaultCell.d.ts +14 -3
- package/cjs/core/Table/cells/DefaultCell.js +63 -85
- package/cjs/core/Table/columns/expanderColumn.js +1 -1
- package/cjs/core/Tabs/Tabs.js +10 -6
- package/cjs/core/Tile/Tile.d.ts +1 -1
- package/cjs/core/Tile/Tile.js +1 -2
- package/cjs/core/Toast/Toast.d.ts +2 -0
- package/cjs/core/Tree/TreeNodeExpander.js +1 -5
- package/cjs/styles.js +1 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
- package/esm/core/ComboBox/ComboBox.js +6 -2
- package/esm/core/Dialog/Dialog.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBarTitle.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBarTitle.js +1 -1
- package/esm/core/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/esm/core/DropdownMenu/DropdownMenu.js +1 -1
- package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
- package/esm/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/esm/core/StatusMessage/StatusMessage.d.ts +1 -1
- package/esm/core/Table/SubRowExpander.js +2 -2
- package/esm/core/Table/Table.js +1 -1
- package/esm/core/Table/TableCell.js +22 -19
- package/esm/core/Table/cells/DefaultCell.d.ts +14 -3
- package/esm/core/Table/cells/DefaultCell.js +62 -84
- package/esm/core/Table/columns/expanderColumn.js +2 -2
- package/esm/core/Tabs/Tabs.js +8 -2
- package/esm/core/Tile/Tile.d.ts +1 -1
- package/esm/core/Tile/Tile.js +1 -2
- package/esm/core/Toast/Toast.d.ts +2 -0
- package/esm/core/Tree/TreeNodeExpander.js +2 -5
- package/esm/styles.js +1 -1
- package/package.json +5 -5
- package/styles.css +12 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2660](https://github.com/iTwin/iTwinUI/pull/2660): Updated the **theme bridge** to use `@stratakit/mui` instead of `@stratakit/foundations`.
|
|
8
|
+
- eee1bcfd838b07743a6a2d96c50160ad62497235: `styles.css` will now declare `@layer mui, stratakit` after `@layer itwinui`.
|
|
9
|
+
- DOM changes:
|
|
10
|
+
- [#2663](https://github.com/iTwin/iTwinUI/pull/2663): Improved the accessibility of **Dialog** and **Tile** by rendering headings by default. The default heading level is `<h2>`, which can be customized passing the `as` prop to `Dialog.TitleBar.Title` and `Tile.NameLabel` respectively.
|
|
11
|
+
- [#2664](https://github.com/iTwin/iTwinUI/pull/2664): Refactored the internal structure of text-only cells to improve the rendering performance of `Table`. The wrapper elements used for line clamping and increasing text selection hit target size are now always rendered in light DOM, avoiding the overhead of shadow DOM.
|
|
12
|
+
- [#2664](https://github.com/iTwin/iTwinUI/pull/2664): Added `text` prop to `DefaultCell` as an alternative to `children`. Using this prop will ensure that the cell content is conditionally wrapped with additional elements for better text selection experience and line clamping (if `clamp` prop is not `false`).
|
|
13
|
+
- [#2662](https://github.com/iTwin/iTwinUI/pull/2662): Replaced several instances of the `SvgChevronRight` icon with `SvgChevronRightSmall` for better visual balance. Components affected: `Breadcrumbs`, `ExpandableBlock`, `Table` (row expanders), and `TreeNode`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#2617](https://github.com/iTwin/iTwinUI/pull/2617): Fixed `Tabs` bug where orientation related styles of nested tabs were sometimes incorrect. (**Note**: Nesting tabs is still _not_ recommended for UX reasons.)
|
|
18
|
+
- 6f2f94d4341f41aead12cbafacf97f0fc6ea2113: `ComboBox` options will now attempt to use `value` (instead of `label`) as `key` in cases where it is serializable.
|
|
19
|
+
- 0abc87b4c2d1db88f263056e534f19c6ab171b8d: `DropdownMenu` will now close by default when a menu item is clicked. Set `closeOnItemClick={false}` to opt out of this behavior.
|
|
20
|
+
- 4b4a5cde202d34995e9036985a329c6383e13dc6: Memoized `getItemKey` in `Table`.
|
|
21
|
+
|
|
3
22
|
## 3.19.7
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -169,7 +169,7 @@ const Separator = ({ separator }) =>
|
|
|
169
169
|
className: 'iui-breadcrumbs-separator',
|
|
170
170
|
'aria-hidden': true,
|
|
171
171
|
},
|
|
172
|
-
separator ?? _react.createElement(_index.
|
|
172
|
+
separator ?? _react.createElement(_index.SvgChevronRightSmall, null),
|
|
173
173
|
);
|
|
174
174
|
const BreadcrumbsItem = _react.forwardRef((props, forwardedRef) => {
|
|
175
175
|
let { as: asProp, ...rest } = props;
|
|
@@ -24,8 +24,12 @@ const _ComboBoxMenuItem = require('./ComboBoxMenuItem.js');
|
|
|
24
24
|
const isMultipleEnabled = (variable, multiple) =>
|
|
25
25
|
multiple && (Array.isArray(variable) || null == variable);
|
|
26
26
|
const isSingleOnChange = (onChange, multiple) => !multiple;
|
|
27
|
-
const getOptionId = (option, idPrefix) =>
|
|
28
|
-
option.id
|
|
27
|
+
const getOptionId = (option, idPrefix) => {
|
|
28
|
+
if (option.id) return option.id;
|
|
29
|
+
if ('string' == typeof option.value || 'number' == typeof option.value)
|
|
30
|
+
return `${idPrefix}-option-${option.value.toString().replace(/\s/g, '-')}`;
|
|
31
|
+
return `${idPrefix}-option-${option.label.replace(/\s/g, '-')}`;
|
|
32
|
+
};
|
|
29
33
|
const ComboBox = _react.forwardRef((props, forwardedRef) => {
|
|
30
34
|
let idPrefix = (0, _index.useId)();
|
|
31
35
|
let defaultFilterFunction = _react.useCallback(
|
|
@@ -9,6 +9,6 @@ Object.defineProperty(exports, 'DialogTitleBarTitle', {
|
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
11
|
const _index = require('../../utils/index.js');
|
|
12
|
-
const DialogTitleBarTitle = _index.polymorphic.
|
|
12
|
+
const DialogTitleBarTitle = _index.polymorphic.h2('iui-dialog-title');
|
|
13
13
|
if ('development' === process.env.NODE_ENV)
|
|
14
14
|
DialogTitleBarTitle.displayName = 'Dialog.TitleBar.Title';
|
|
@@ -48,7 +48,7 @@ const DropdownMenuContent = _react.forwardRef((props, forwardedRef) => {
|
|
|
48
48
|
onVisibleChange,
|
|
49
49
|
portal = true,
|
|
50
50
|
middleware,
|
|
51
|
-
closeOnItemClick =
|
|
51
|
+
closeOnItemClick = true,
|
|
52
52
|
...rest
|
|
53
53
|
} = props;
|
|
54
54
|
let [visible, setVisible] = (0, _index.useControlledState)(
|
|
@@ -147,7 +147,7 @@ const ExpandableBlockExpandIcon = _react.forwardRef((props, forwardedRef) => {
|
|
|
147
147
|
...rest,
|
|
148
148
|
},
|
|
149
149
|
children ??
|
|
150
|
-
_react.createElement(_index.
|
|
150
|
+
_react.createElement(_index.SvgChevronRightSmall, {
|
|
151
151
|
'aria-hidden': true,
|
|
152
152
|
}),
|
|
153
153
|
);
|
|
@@ -38,7 +38,7 @@ const SubRowExpander = (props) => {
|
|
|
38
38
|
disabled: isDisabled,
|
|
39
39
|
...rest,
|
|
40
40
|
},
|
|
41
|
-
_react.createElement(_index.
|
|
41
|
+
_react.createElement(_index.SvgChevronRightSmall, {
|
|
42
42
|
style: {
|
|
43
43
|
transform: cell.row.isExpanded ? 'rotate(90deg)' : void 0,
|
|
44
44
|
},
|
|
@@ -561,7 +561,7 @@ const Table = (props) => {
|
|
|
561
561
|
count: page.length,
|
|
562
562
|
getScrollElement: () => tableRef.current,
|
|
563
563
|
estimateSize: () => rowHeight,
|
|
564
|
-
getItemKey: (index) => page[index].id,
|
|
564
|
+
getItemKey: _react.useCallback((index) => page[index].id, [page]),
|
|
565
565
|
overscan: 1,
|
|
566
566
|
});
|
|
567
567
|
(0, _index.useLayoutEffect)(() => {
|
|
@@ -67,24 +67,18 @@ const TableCell = (props) => {
|
|
|
67
67
|
}),
|
|
68
68
|
[cell, tableInstance],
|
|
69
69
|
);
|
|
70
|
-
let
|
|
70
|
+
let expander = _react.useMemo(
|
|
71
71
|
() =>
|
|
72
|
-
|
|
73
|
-
_react.
|
|
74
|
-
null,
|
|
75
|
-
tableHasSubRows &&
|
|
76
|
-
hasSubRowExpander &&
|
|
77
|
-
cell.row.canExpand &&
|
|
78
|
-
_react.createElement(_SubRowExpander.SubRowExpander, {
|
|
72
|
+
tableHasSubRows && hasSubRowExpander && cell.row.canExpand
|
|
73
|
+
? _react.createElement(_SubRowExpander.SubRowExpander, {
|
|
79
74
|
cell: cell,
|
|
80
75
|
isDisabled: isDisabled,
|
|
81
76
|
cellProps: cellProps,
|
|
82
77
|
expanderCell: expanderCell,
|
|
83
78
|
density: density,
|
|
84
79
|
slot: 'start',
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
),
|
|
80
|
+
})
|
|
81
|
+
: null,
|
|
88
82
|
[
|
|
89
83
|
cell,
|
|
90
84
|
cellProps,
|
|
@@ -95,32 +89,40 @@ const TableCell = (props) => {
|
|
|
95
89
|
tableHasSubRows,
|
|
96
90
|
],
|
|
97
91
|
);
|
|
98
|
-
let
|
|
92
|
+
let cellContent = _react.useMemo(() => cell.render('Cell'), [cell]);
|
|
93
|
+
let shadows = _react.useMemo(
|
|
99
94
|
() =>
|
|
100
95
|
_react.createElement(
|
|
101
96
|
_react.Fragment,
|
|
102
97
|
null,
|
|
103
|
-
cellContent,
|
|
104
98
|
'left' === cell.column.sticky &&
|
|
105
99
|
tableInstance.state.sticky.isScrolledToRight &&
|
|
106
100
|
_react.createElement(_index2.Box, {
|
|
107
101
|
className: 'iui-table-cell-shadow-right',
|
|
108
|
-
slot: 'shadows',
|
|
109
102
|
}),
|
|
110
103
|
'right' === cell.column.sticky &&
|
|
111
104
|
tableInstance.state.sticky.isScrolledToLeft &&
|
|
112
105
|
_react.createElement(_index2.Box, {
|
|
113
106
|
className: 'iui-table-cell-shadow-left',
|
|
114
|
-
slot: 'shadows',
|
|
115
107
|
}),
|
|
116
108
|
),
|
|
117
109
|
[
|
|
118
110
|
cell.column.sticky,
|
|
119
|
-
cellContent,
|
|
120
111
|
tableInstance.state.sticky.isScrolledToLeft,
|
|
121
112
|
tableInstance.state.sticky.isScrolledToRight,
|
|
122
113
|
],
|
|
123
114
|
);
|
|
115
|
+
let defaultCellRendererChildren = _react.useMemo(
|
|
116
|
+
() =>
|
|
117
|
+
_react.createElement(
|
|
118
|
+
_react.Fragment,
|
|
119
|
+
null,
|
|
120
|
+
cellContent,
|
|
121
|
+
expander,
|
|
122
|
+
shadows,
|
|
123
|
+
),
|
|
124
|
+
[cellContent, expander, shadows],
|
|
125
|
+
);
|
|
124
126
|
let cellRendererProps = _react.useMemo(
|
|
125
127
|
() => ({
|
|
126
128
|
cellElementProps,
|
|
@@ -133,9 +135,16 @@ const TableCell = (props) => {
|
|
|
133
135
|
_react.Fragment,
|
|
134
136
|
null,
|
|
135
137
|
_react.createElement(
|
|
136
|
-
_DefaultCell.
|
|
138
|
+
_DefaultCell.DefaultCellContext.Provider,
|
|
137
139
|
{
|
|
138
|
-
value:
|
|
140
|
+
value: _react.useMemo(
|
|
141
|
+
() => ({
|
|
142
|
+
children: defaultCellRendererChildren,
|
|
143
|
+
expander,
|
|
144
|
+
shadows,
|
|
145
|
+
}),
|
|
146
|
+
[defaultCellRendererChildren, expander, shadows],
|
|
147
|
+
),
|
|
139
148
|
},
|
|
140
149
|
cell.column.cellRenderer
|
|
141
150
|
? cell.column.cellRenderer({
|
|
@@ -13,8 +13,8 @@ _export(exports, {
|
|
|
13
13
|
DefaultCell: function () {
|
|
14
14
|
return DefaultCell;
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
return
|
|
16
|
+
DefaultCellContext: function () {
|
|
17
|
+
return DefaultCellContext;
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
const _interop_require_default = require('@swc/helpers/_/_interop_require_default');
|
|
@@ -26,7 +26,7 @@ const _classnames = /*#__PURE__*/ _interop_require_default._(
|
|
|
26
26
|
);
|
|
27
27
|
const _index = require('../../../utils/index.js');
|
|
28
28
|
const _utils = require('../utils.js');
|
|
29
|
-
const
|
|
29
|
+
const DefaultCellContext = _react.createContext({});
|
|
30
30
|
const DefaultCell = (props) => {
|
|
31
31
|
let instance = _react.useContext(_utils.TableInstanceContext);
|
|
32
32
|
let isCustomCell = _react.useMemo(
|
|
@@ -35,8 +35,9 @@ const DefaultCell = (props) => {
|
|
|
35
35
|
?.Cell !== _reacttable.defaultColumn.Cell,
|
|
36
36
|
[instance, props.cellProps.column.id],
|
|
37
37
|
);
|
|
38
|
+
let defaultCellContext = _react.useContext(DefaultCellContext);
|
|
38
39
|
let isCellRendererChildrenCustom =
|
|
39
|
-
|
|
40
|
+
defaultCellContext.children !== props.children;
|
|
40
41
|
let isDefaultTextCell =
|
|
41
42
|
'string' == typeof props.cellProps.value &&
|
|
42
43
|
!isCustomCell &&
|
|
@@ -55,10 +56,33 @@ const DefaultCell = (props) => {
|
|
|
55
56
|
className,
|
|
56
57
|
style,
|
|
57
58
|
status,
|
|
58
|
-
|
|
59
|
+
text = isDefaultTextCell ? cellProps.value : void 0,
|
|
60
|
+
clamp = !!text,
|
|
59
61
|
...rest
|
|
60
62
|
} = props;
|
|
61
63
|
let { key: cellElementKey, ...cellElementPropsRest } = cellElementProps;
|
|
64
|
+
let decorations = {
|
|
65
|
+
start: startIcon
|
|
66
|
+
? _react.createElement(
|
|
67
|
+
_index.Box,
|
|
68
|
+
{
|
|
69
|
+
className: 'iui-table-cell-start-icon',
|
|
70
|
+
key: `${cellElementKey}-start`,
|
|
71
|
+
},
|
|
72
|
+
startIcon,
|
|
73
|
+
)
|
|
74
|
+
: null,
|
|
75
|
+
end: endIcon
|
|
76
|
+
? _react.createElement(
|
|
77
|
+
_index.Box,
|
|
78
|
+
{
|
|
79
|
+
className: 'iui-table-cell-end-icon',
|
|
80
|
+
key: `${cellElementKey}-end`,
|
|
81
|
+
},
|
|
82
|
+
endIcon,
|
|
83
|
+
)
|
|
84
|
+
: null,
|
|
85
|
+
};
|
|
62
86
|
return _react.createElement(
|
|
63
87
|
_index.Box,
|
|
64
88
|
{
|
|
@@ -73,87 +97,41 @@ const DefaultCell = (props) => {
|
|
|
73
97
|
...style,
|
|
74
98
|
},
|
|
75
99
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
_index.Box,
|
|
111
|
-
{
|
|
112
|
-
className: 'iui-table-cell-start-icon',
|
|
113
|
-
slot: 'start',
|
|
114
|
-
key: `${cellElementKey}-start`,
|
|
115
|
-
},
|
|
116
|
-
startIcon,
|
|
117
|
-
),
|
|
118
|
-
children,
|
|
119
|
-
endIcon &&
|
|
120
|
-
_react.createElement(
|
|
121
|
-
_index.Box,
|
|
122
|
-
{
|
|
123
|
-
className: 'iui-table-cell-end-icon',
|
|
124
|
-
slot: 'end',
|
|
125
|
-
key: `${cellElementKey}-end`,
|
|
126
|
-
},
|
|
127
|
-
endIcon,
|
|
128
|
-
),
|
|
100
|
+
(() => {
|
|
101
|
+
if (text)
|
|
102
|
+
return _react.createElement(
|
|
103
|
+
_react.Fragment,
|
|
104
|
+
null,
|
|
105
|
+
decorations.start,
|
|
106
|
+
defaultCellContext.expander,
|
|
107
|
+
_react.createElement(
|
|
108
|
+
_index.Box,
|
|
109
|
+
{
|
|
110
|
+
className: 'iui-table-cell-default-content',
|
|
111
|
+
onClick: (e) => e.stopPropagation(),
|
|
112
|
+
},
|
|
113
|
+
clamp
|
|
114
|
+
? _react.createElement(
|
|
115
|
+
_index.Box,
|
|
116
|
+
{
|
|
117
|
+
className: 'iui-line-clamp',
|
|
118
|
+
},
|
|
119
|
+
text,
|
|
120
|
+
)
|
|
121
|
+
: text,
|
|
122
|
+
),
|
|
123
|
+
decorations.end,
|
|
124
|
+
defaultCellContext.shadows,
|
|
125
|
+
);
|
|
126
|
+
return _react.createElement(
|
|
127
|
+
_react.Fragment,
|
|
128
|
+
null,
|
|
129
|
+
decorations.start,
|
|
130
|
+
children,
|
|
131
|
+
decorations.end,
|
|
132
|
+
);
|
|
133
|
+
})(),
|
|
129
134
|
);
|
|
130
135
|
};
|
|
131
136
|
if ('development' === process.env.NODE_ENV)
|
|
132
137
|
DefaultCell.displayName = 'DefaultCell';
|
|
133
|
-
const TableCellContent = (props) => {
|
|
134
|
-
let { children, shouldRenderWrapper } = props;
|
|
135
|
-
return shouldRenderWrapper
|
|
136
|
-
? _react.createElement(
|
|
137
|
-
'div',
|
|
138
|
-
{
|
|
139
|
-
className: '_iui-table-cell-default-content',
|
|
140
|
-
onClick: (e) => e.stopPropagation(),
|
|
141
|
-
},
|
|
142
|
-
children,
|
|
143
|
-
)
|
|
144
|
-
: children;
|
|
145
|
-
};
|
|
146
|
-
const css = `
|
|
147
|
-
._iui-table-cell-default-content {
|
|
148
|
-
position: relative;
|
|
149
|
-
isolation: isolate;
|
|
150
|
-
}
|
|
151
|
-
._iui-table-cell-default-content::before {
|
|
152
|
-
content: '';
|
|
153
|
-
display: block;
|
|
154
|
-
position: absolute;
|
|
155
|
-
inset: -6px;
|
|
156
|
-
z-index: -1;
|
|
157
|
-
}
|
|
158
|
-
${_index.lineClamp.css}
|
|
159
|
-
`;
|
|
@@ -52,7 +52,7 @@ const ExpanderColumn = (props = {}) => {
|
|
|
52
52
|
disabled: isDisabled?.(props.row.original),
|
|
53
53
|
'aria-expanded': row.isExpanded,
|
|
54
54
|
},
|
|
55
|
-
_react.createElement(_index.
|
|
55
|
+
_react.createElement(_index.SvgChevronRightSmall, null),
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
cellRenderer: (props) =>
|
|
@@ -85,11 +85,8 @@ const TabsWrapperPresentation = _react.forwardRef((props, forwardedRef) => {
|
|
|
85
85
|
let { orientation = 'horizontal', ...rest } = props;
|
|
86
86
|
return _react.createElement(_index.Box, {
|
|
87
87
|
...rest,
|
|
88
|
-
className: (0, _classnames.default)(
|
|
89
|
-
|
|
90
|
-
`iui-${orientation}`,
|
|
91
|
-
props.className,
|
|
92
|
-
),
|
|
88
|
+
className: (0, _classnames.default)('iui-tabs-wrapper', props.className),
|
|
89
|
+
'data-iui-orientation': orientation,
|
|
93
90
|
ref: forwardedRef,
|
|
94
91
|
});
|
|
95
92
|
});
|
|
@@ -290,6 +287,7 @@ const Tab = _react.forwardRef((props, forwardedRef) => {
|
|
|
290
287
|
if ('auto' === focusActivationMode && !props.disabled)
|
|
291
288
|
setActiveValue(value);
|
|
292
289
|
}),
|
|
290
|
+
'data-iui-orientation': orientation,
|
|
293
291
|
},
|
|
294
292
|
label ? _react.createElement(Tabs.TabLabel, null, label) : children,
|
|
295
293
|
);
|
|
@@ -336,6 +334,7 @@ if ('development' === process.env.NODE_ENV)
|
|
|
336
334
|
TabDescription.displayName = 'Tabs.TabDescription';
|
|
337
335
|
const TabsActions = _react.forwardRef((props, ref) => {
|
|
338
336
|
let { wrapperProps, className, children, ...rest } = props;
|
|
337
|
+
let { orientation } = (0, _index.useSafeContext)(TabsContext);
|
|
339
338
|
return _react.createElement(
|
|
340
339
|
_index.Box,
|
|
341
340
|
{
|
|
@@ -344,12 +343,14 @@ const TabsActions = _react.forwardRef((props, ref) => {
|
|
|
344
343
|
'iui-tabs-actions-wrapper',
|
|
345
344
|
wrapperProps?.className,
|
|
346
345
|
),
|
|
346
|
+
'data-iui-orientation': orientation,
|
|
347
347
|
},
|
|
348
348
|
_react.createElement(
|
|
349
349
|
_index.Box,
|
|
350
350
|
{
|
|
351
351
|
className: (0, _classnames.default)('iui-tabs-actions', className),
|
|
352
352
|
ref: ref,
|
|
353
|
+
'data-iui-orientation': orientation,
|
|
353
354
|
...rest,
|
|
354
355
|
},
|
|
355
356
|
children,
|
|
@@ -360,7 +361,9 @@ if ('development' === process.env.NODE_ENV)
|
|
|
360
361
|
TabsActions.displayName = 'Tabs.Actions';
|
|
361
362
|
const TabsPanel = _react.forwardRef((props, ref) => {
|
|
362
363
|
let { value, className, children, ...rest } = props;
|
|
363
|
-
let { activeValue, idPrefix } = (0, _index.useSafeContext)(
|
|
364
|
+
let { activeValue, idPrefix, orientation } = (0, _index.useSafeContext)(
|
|
365
|
+
TabsContext,
|
|
366
|
+
);
|
|
364
367
|
return _react.createElement(
|
|
365
368
|
_index.Box,
|
|
366
369
|
{
|
|
@@ -371,6 +374,7 @@ const TabsPanel = _react.forwardRef((props, ref) => {
|
|
|
371
374
|
ref: ref,
|
|
372
375
|
...rest,
|
|
373
376
|
id: `${idPrefix}-panel-${value.replaceAll(' ', '-')}`,
|
|
377
|
+
'data-iui-orientation': orientation,
|
|
374
378
|
},
|
|
375
379
|
children,
|
|
376
380
|
);
|
|
@@ -210,7 +210,7 @@ const TileNameIcon = _react.forwardRef((props, forwardedRef) => {
|
|
|
210
210
|
});
|
|
211
211
|
if ('development' === process.env.NODE_ENV)
|
|
212
212
|
TileNameIcon.displayName = 'Tile.NameIcon';
|
|
213
|
-
const TileNameLabel = _index.polymorphic.
|
|
213
|
+
const TileNameLabel = _index.polymorphic.h2('iui-tile-name-label');
|
|
214
214
|
if ('development' === process.env.NODE_ENV)
|
|
215
215
|
TileNameLabel.displayName = 'Tile.NameLabel';
|
|
216
216
|
const TileContentArea = _index.polymorphic.div('iui-tile-content');
|
|
@@ -243,7 +243,6 @@ const TileMoreOptions = _react.forwardRef((props, forwardedRef) => {
|
|
|
243
243
|
{
|
|
244
244
|
onVisibleChange: setIsMenuVisible,
|
|
245
245
|
menuItems: children,
|
|
246
|
-
closeOnItemClick: true,
|
|
247
246
|
},
|
|
248
247
|
_react.createElement(
|
|
249
248
|
_IconButton.IconButton,
|
|
@@ -16,12 +16,8 @@ const _classnames = /*#__PURE__*/ _interop_require_default._(
|
|
|
16
16
|
);
|
|
17
17
|
const _index = require('../../utils/index.js');
|
|
18
18
|
const _IconButton = require('../Buttons/IconButton.js');
|
|
19
|
-
const _TreeContext = require('./TreeContext.js');
|
|
20
19
|
const TreeNodeExpander = _react.forwardRef((props, ref) => {
|
|
21
20
|
let { isExpanded, expanderIconProps = {}, ...rest } = props;
|
|
22
|
-
let size = _react.useContext(_TreeContext.TreeContext)?.size ?? 'default';
|
|
23
|
-
let ChevronIcon =
|
|
24
|
-
'small' === size ? _index.SvgChevronRightSmall : _index.SvgChevronRight;
|
|
25
21
|
return _react.createElement(
|
|
26
22
|
_IconButton.IconButton,
|
|
27
23
|
{
|
|
@@ -31,7 +27,7 @@ const TreeNodeExpander = _react.forwardRef((props, ref) => {
|
|
|
31
27
|
ref: ref,
|
|
32
28
|
...rest,
|
|
33
29
|
},
|
|
34
|
-
_react.createElement(
|
|
30
|
+
_react.createElement(_index.SvgChevronRightSmall, {
|
|
35
31
|
...expanderIconProps,
|
|
36
32
|
className: (0, _classnames.default)(
|
|
37
33
|
'iui-tree-node-content-expander-icon',
|
package/DEV-cjs/styles.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import {
|
|
4
|
-
SvgChevronRight,
|
|
5
4
|
Box,
|
|
6
5
|
OverflowContainer,
|
|
7
6
|
useWarningLogger,
|
|
8
7
|
cloneElementWithRef,
|
|
8
|
+
SvgChevronRightSmall,
|
|
9
9
|
} from '../../utils/index.js';
|
|
10
10
|
import { Button } from '../Buttons/Button.js';
|
|
11
11
|
import { Anchor } from '../Typography/Anchor.js';
|
|
@@ -161,7 +161,7 @@ let Separator = ({ separator }) =>
|
|
|
161
161
|
className: 'iui-breadcrumbs-separator',
|
|
162
162
|
'aria-hidden': true,
|
|
163
163
|
},
|
|
164
|
-
separator ?? React.createElement(
|
|
164
|
+
separator ?? React.createElement(SvgChevronRightSmall, null),
|
|
165
165
|
);
|
|
166
166
|
let BreadcrumbsItem = React.forwardRef((props, forwardedRef) => {
|
|
167
167
|
let { as: asProp, ...rest } = props;
|
|
@@ -20,8 +20,12 @@ import { ComboBoxMenuItem } from './ComboBoxMenuItem.js';
|
|
|
20
20
|
let isMultipleEnabled = (variable, multiple) =>
|
|
21
21
|
multiple && (Array.isArray(variable) || null == variable);
|
|
22
22
|
let isSingleOnChange = (onChange, multiple) => !multiple;
|
|
23
|
-
let getOptionId = (option, idPrefix) =>
|
|
24
|
-
option.id
|
|
23
|
+
let getOptionId = (option, idPrefix) => {
|
|
24
|
+
if (option.id) return option.id;
|
|
25
|
+
if ('string' == typeof option.value || 'number' == typeof option.value)
|
|
26
|
+
return `${idPrefix}-option-${option.value.toString().replace(/\s/g, '-')}`;
|
|
27
|
+
return `${idPrefix}-option-${option.label.replace(/\s/g, '-')}`;
|
|
28
|
+
};
|
|
25
29
|
export const ComboBox = React.forwardRef((props, forwardedRef) => {
|
|
26
30
|
let idPrefix = useId();
|
|
27
31
|
let defaultFilterFunction = React.useCallback(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { polymorphic } from '../../utils/index.js';
|
|
2
|
-
export const DialogTitleBarTitle = polymorphic.
|
|
2
|
+
export const DialogTitleBarTitle = polymorphic.h2('iui-dialog-title');
|
|
3
3
|
if ('development' === process.env.NODE_ENV)
|
|
4
4
|
DialogTitleBarTitle.displayName = 'Dialog.TitleBar.Title';
|
|
@@ -2,13 +2,13 @@ import cx from 'classnames';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import {
|
|
4
4
|
StatusIconMap,
|
|
5
|
-
SvgChevronRight,
|
|
6
5
|
Box,
|
|
7
6
|
useSafeContext,
|
|
8
7
|
polymorphic,
|
|
9
8
|
mergeEventHandlers,
|
|
10
9
|
ButtonBase,
|
|
11
10
|
useId,
|
|
11
|
+
SvgChevronRightSmall,
|
|
12
12
|
} from '../../utils/index.js';
|
|
13
13
|
import { Icon } from '../Icon/Icon.js';
|
|
14
14
|
import { LinkBox } from '../LinkAction/LinkAction.js';
|
|
@@ -128,7 +128,7 @@ let ExpandableBlockExpandIcon = React.forwardRef((props, forwardedRef) => {
|
|
|
128
128
|
...rest,
|
|
129
129
|
},
|
|
130
130
|
children ??
|
|
131
|
-
React.createElement(
|
|
131
|
+
React.createElement(SvgChevronRightSmall, {
|
|
132
132
|
'aria-hidden': true,
|
|
133
133
|
}),
|
|
134
134
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SvgChevronRightSmall } from '../../utils/index.js';
|
|
3
3
|
import { IconButton } from '../Buttons/IconButton.js';
|
|
4
4
|
export const SubRowExpander = (props) => {
|
|
5
5
|
let { cell, isDisabled, cellProps, expanderCell, density, ...rest } = props;
|
|
@@ -27,7 +27,7 @@ export const SubRowExpander = (props) => {
|
|
|
27
27
|
disabled: isDisabled,
|
|
28
28
|
...rest,
|
|
29
29
|
},
|
|
30
|
-
React.createElement(
|
|
30
|
+
React.createElement(SvgChevronRightSmall, {
|
|
31
31
|
style: {
|
|
32
32
|
transform: cell.row.isExpanded ? 'rotate(90deg)' : void 0,
|
|
33
33
|
},
|
|
@@ -567,7 +567,7 @@ export const Table = (props) => {
|
|
|
567
567
|
count: page.length,
|
|
568
568
|
getScrollElement: () => tableRef.current,
|
|
569
569
|
estimateSize: () => rowHeight,
|
|
570
|
-
getItemKey: (index) => page[index].id,
|
|
570
|
+
getItemKey: React.useCallback((index) => page[index].id, [page]),
|
|
571
571
|
overscan: 1,
|
|
572
572
|
});
|
|
573
573
|
useLayoutEffect(() => {
|