@itwin/itwinui-react 3.18.2 → 3.19.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 +50 -0
- package/DEV-cjs/core/ComboBox/ComboBoxMenuItem.js +1 -1
- package/DEV-cjs/core/Menu/MenuItem.js +8 -7
- package/DEV-cjs/core/Select/Select.js +18 -10
- package/DEV-cjs/core/SideNavigation/SideNavigation.js +2 -2
- package/DEV-cjs/core/Table/ColumnHeader.js +7 -3
- package/DEV-cjs/core/Table/Table.js +65 -5
- package/DEV-cjs/core/Table/cells/DefaultCell.js +14 -9
- package/DEV-cjs/core/Table/columns/actionColumn.js +1 -0
- package/DEV-cjs/core/Table/columns/expanderColumn.js +25 -20
- package/DEV-cjs/core/Table/columns/selectionColumn.js +14 -8
- package/DEV-cjs/core/Table/hooks/useExpanderCell.js +10 -6
- package/DEV-cjs/core/Tag/Tag.js +8 -2
- package/DEV-cjs/core/ThemeProvider/ThemeProvider.js +46 -46
- package/DEV-cjs/core/ToggleSwitch/ToggleSwitch.js +15 -4
- package/DEV-cjs/styles.js +1 -1
- package/DEV-cjs/utils/components/index.js +1 -1
- package/DEV-cjs/utils/components/lineClamp.js +23 -0
- package/DEV-cjs/utils/functions/react.js +18 -4
- package/DEV-cjs/utils/hooks/useControlledState.js +5 -1
- package/DEV-cjs/utils/providers/FutureFlagsProvider.js +48 -0
- package/DEV-cjs/utils/providers/index.js +1 -0
- package/DEV-esm/core/ComboBox/ComboBoxMenuItem.js +1 -1
- package/DEV-esm/core/Menu/MenuItem.js +8 -7
- package/DEV-esm/core/Select/Select.js +19 -10
- package/DEV-esm/core/SideNavigation/SideNavigation.js +2 -2
- package/DEV-esm/core/Table/ColumnHeader.js +8 -4
- package/DEV-esm/core/Table/Table.js +65 -5
- package/DEV-esm/core/Table/cells/DefaultCell.js +15 -10
- package/DEV-esm/core/Table/columns/actionColumn.js +1 -0
- package/DEV-esm/core/Table/columns/expanderColumn.js +25 -20
- package/DEV-esm/core/Table/columns/selectionColumn.js +14 -8
- package/DEV-esm/core/Table/hooks/useExpanderCell.js +10 -6
- package/DEV-esm/core/Tag/Tag.js +11 -3
- package/DEV-esm/core/ThemeProvider/ThemeProvider.js +48 -42
- package/DEV-esm/core/ToggleSwitch/ToggleSwitch.js +15 -5
- package/DEV-esm/styles.js +1 -1
- package/DEV-esm/utils/components/index.js +1 -1
- package/DEV-esm/utils/components/lineClamp.js +13 -0
- package/DEV-esm/utils/functions/react.js +6 -1
- package/DEV-esm/utils/hooks/useControlledState.js +5 -1
- package/DEV-esm/utils/providers/FutureFlagsProvider.js +28 -0
- package/DEV-esm/utils/providers/index.js +1 -0
- package/cjs/core/Buttons/DropdownButton.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +5 -16
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +1 -1
- package/cjs/core/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/cjs/core/Menu/MenuItem.d.ts +7 -1
- package/cjs/core/Menu/MenuItem.js +8 -7
- package/cjs/core/Popover/Popover.d.ts +5 -3
- package/cjs/core/Select/Select.js +18 -10
- package/cjs/core/SideNavigation/SideNavigation.js +2 -2
- package/cjs/core/Table/ColumnHeader.js +7 -3
- package/cjs/core/Table/Table.d.ts +2 -2
- package/cjs/core/Table/Table.js +65 -5
- package/cjs/core/Table/cells/DefaultCell.js +14 -9
- package/cjs/core/Table/columns/actionColumn.d.ts +1 -0
- package/cjs/core/Table/columns/actionColumn.js +1 -0
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -2
- package/cjs/core/Table/columns/expanderColumn.js +25 -20
- package/cjs/core/Table/columns/selectionColumn.d.ts +2 -2
- package/cjs/core/Table/columns/selectionColumn.js +14 -8
- package/cjs/core/Table/hooks/useExpanderCell.js +10 -6
- package/cjs/core/Tabs/Tabs.d.ts +4 -1
- package/cjs/core/Tag/Tag.js +8 -2
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -2
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +8 -18
- package/cjs/core/ThemeProvider/ThemeProvider.js +46 -46
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +21 -0
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +15 -4
- package/cjs/styles.js +1 -1
- package/cjs/utils/components/index.d.ts +1 -1
- package/cjs/utils/components/index.js +1 -1
- package/cjs/utils/components/lineClamp.d.ts +5 -0
- package/cjs/utils/components/lineClamp.js +23 -0
- package/cjs/utils/functions/react.d.ts +5 -0
- package/cjs/utils/functions/react.js +18 -4
- package/cjs/utils/hooks/useControlledState.d.ts +5 -2
- package/cjs/utils/hooks/useControlledState.js +5 -1
- package/cjs/utils/hooks/useGlobals.d.ts +0 -1
- package/cjs/utils/providers/FutureFlagsProvider.d.ts +37 -0
- package/cjs/utils/providers/FutureFlagsProvider.js +48 -0
- package/cjs/utils/providers/index.d.ts +1 -0
- package/cjs/utils/providers/index.js +1 -0
- package/esm/core/Buttons/DropdownButton.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +5 -16
- package/esm/core/ComboBox/ComboBoxMenuItem.js +1 -1
- package/esm/core/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/esm/core/Menu/MenuItem.d.ts +7 -1
- package/esm/core/Menu/MenuItem.js +8 -7
- package/esm/core/Popover/Popover.d.ts +5 -3
- package/esm/core/Select/Select.js +19 -10
- package/esm/core/SideNavigation/SideNavigation.js +2 -2
- package/esm/core/Table/ColumnHeader.js +8 -4
- package/esm/core/Table/Table.d.ts +2 -2
- package/esm/core/Table/Table.js +65 -5
- package/esm/core/Table/cells/DefaultCell.js +15 -10
- package/esm/core/Table/columns/actionColumn.d.ts +1 -0
- package/esm/core/Table/columns/actionColumn.js +1 -0
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -2
- package/esm/core/Table/columns/expanderColumn.js +25 -20
- package/esm/core/Table/columns/selectionColumn.d.ts +2 -2
- package/esm/core/Table/columns/selectionColumn.js +14 -8
- package/esm/core/Table/hooks/useExpanderCell.js +10 -6
- package/esm/core/Tabs/Tabs.d.ts +4 -1
- package/esm/core/Tag/Tag.js +11 -3
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -2
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +8 -18
- package/esm/core/ThemeProvider/ThemeProvider.js +48 -42
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +21 -0
- package/esm/core/ToggleSwitch/ToggleSwitch.js +15 -5
- package/esm/styles.js +1 -1
- package/esm/utils/components/index.d.ts +1 -1
- package/esm/utils/components/index.js +1 -1
- package/esm/utils/components/lineClamp.d.ts +5 -0
- package/esm/utils/components/lineClamp.js +13 -0
- package/esm/utils/functions/react.d.ts +5 -0
- package/esm/utils/functions/react.js +6 -1
- package/esm/utils/hooks/useControlledState.d.ts +5 -2
- package/esm/utils/hooks/useControlledState.js +5 -1
- package/esm/utils/hooks/useGlobals.d.ts +0 -1
- package/esm/utils/providers/FutureFlagsProvider.d.ts +37 -0
- package/esm/utils/providers/FutureFlagsProvider.js +28 -0
- package/esm/utils/providers/index.d.ts +1 -0
- package/esm/utils/providers/index.js +1 -0
- package/package.json +11 -5
- package/styles.css +10 -10
- package/DEV-cjs/utils/components/LineClamp.js +0 -50
- package/DEV-esm/utils/components/LineClamp.js +0 -36
- package/cjs/utils/components/LineClamp.d.ts +0 -5
- package/cjs/utils/components/LineClamp.js +0 -50
- package/esm/utils/components/LineClamp.d.ts +0 -5
- package/esm/utils/components/LineClamp.js +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Future flags**:
|
|
8
|
+
|
|
9
|
+
- [#2573](https://github.com/iTwin/iTwinUI/pull/2573): Added the ability to pass `future={true}` to `ThemeProvider` to enable _all_ future flags.
|
|
10
|
+
- [#2543](https://github.com/iTwin/iTwinUI/pull/2543): Added a new future flag to `ThemeProvider`'s `future` prop: `ToggleSwitch.consistentPropsSpread`. Setting this to `true` will result in all `ToggleSwitch` DOM props being applied on the input element.
|
|
11
|
+
- [#2544](https://github.com/iTwin/iTwinUI/pull/2544): Added a new `wrapperProps` prop to `ToggleSwitch` to pass props to the wrapper. To prevent breaking changes:
|
|
12
|
+
- If this new `wrapperProps` is provided or `ThemeProvider`'s `ToggleSwitch.consistentPropsSpread` future flag is `true`, `className` and `style` will be applied on the `input` and `wrapperProps` will be applied on the wrapper.
|
|
13
|
+
- Else, `className` and `style` continue to be applied on the wrapper.
|
|
14
|
+
- [#2576](https://github.com/iTwin/iTwinUI/pull/2576): `MenuItem`'s `value` prop has been deprecated. When the `value` is not passed, the `onClick` prop will now be called with the `event` instead of `value`.
|
|
15
|
+
- [#2551](https://github.com/iTwin/iTwinUI/pull/2551): `Tree` now horizontally scrolls instead of truncation of `TreeNode`s when in horizontally overflowing `Tree`s.
|
|
16
|
+
- [#2528](https://github.com/iTwin/iTwinUI/pull/2528): The behavior of all `on[Value]Change` props has been made consistent such that they are only called when `[value]` actually _changes_ (uncontrolled mode) or should _change_ (controlled mode).
|
|
17
|
+
Affected props include:
|
|
18
|
+
- `Tabs.Wrapper`: `onValueChange` prop
|
|
19
|
+
- `Tabs`: `onTabSelected` prop
|
|
20
|
+
- `DropdownMenu`: `onVisibleChange` prop
|
|
21
|
+
- `Popover`: `onVisibleChange` prop
|
|
22
|
+
- `Tooltip`: `onVisibleChange` prop
|
|
23
|
+
- [#2541](https://github.com/iTwin/iTwinUI/pull/2541), [#2584](https://github.com/iTwin/iTwinUI/pull/2584): Visual changes to `Tabs` for better accessibility and appearance when in theme bridge mode.
|
|
24
|
+
- `Tabs.Wrapper` without `type` declared focus `outline-offset` inset more so to not obstruct the active tab stripe.
|
|
25
|
+
- `Tabs.Wrapper type='borderless'` dividing line reduced to give the active tab stripe a visual difference.
|
|
26
|
+
- `Tabs.Wrapper type='borderless'` active tab no longer has `background-color` change.
|
|
27
|
+
- `Tabs.TabDescription` has `color` change with `transition`.
|
|
28
|
+
- `Tabs.Wrapper type='default'` disabled tab will now have the same background color as the non-disabled tab.
|
|
29
|
+
- [#2585](https://github.com/iTwin/iTwinUI/pull/2585): Bumped the minimum required versions of `@floating-ui/react`, `@tanstack/react-virtual`, and `@swc/helpers`.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [#2569](https://github.com/iTwin/iTwinUI/pull/2569), [#2578](https://github.com/iTwin/iTwinUI/pull/2578): The [**theme bridge**](https://github.com/iTwin/iTwinUI/wiki/StrataKit-theme-bridge) has been updated to more closely match the latest StrataKit visuals. The most prominent change is in the background-color of various components.
|
|
34
|
+
- [#2551](https://github.com/iTwin/iTwinUI/pull/2551): Fixed non-virtualized `Tree` where the `TreeNode`s now stretch to the full width of the horizontally scrolling `Tree`.
|
|
35
|
+
- **Table**:
|
|
36
|
+
- [#2568](https://github.com/iTwin/iTwinUI/pull/2568): Fixed `Table` bug where it unintentionally tried to add non-DOM props (e.g. `useControlledState` and `autoResetResize`) to the DOM which lead to a React console warning.
|
|
37
|
+
- [#2579](https://github.com/iTwin/iTwinUI/pull/2579): Changed the internal implementation of `Table` cells so that an extra wrapper element is rendered when the cell contains _text only_. Any custom cell content (passed via `Cell`) will now be rendered as-is.
|
|
38
|
+
- [#2568](https://github.com/iTwin/iTwinUI/pull/2568): `Table`'s `defaultColumn` prop is now respected.
|
|
39
|
+
- [#2583](https://github.com/iTwin/iTwinUI/pull/2583): Fixed `Table` to no longer give a hydration mismatch error when using `ActionColumn`.
|
|
40
|
+
- [#2575](https://github.com/iTwin/iTwinUI/pull/2575): `DropdownButton`'s `menuItems` now also allows directly passing `React.JSX.Element[]` or `React.JSX.Element` (like `DropdownMenu`'s `menuItems`). If doing so, can be used with `dropdownMenuProps` prop's `closeOnItemClick`.
|
|
41
|
+
- [#2571](https://github.com/iTwin/iTwinUI/pull/2571): Fixed `DropdownMenu` and other components to no longer result in a React warning of `ref` being incorrectly accessed as a prop in React 18 or earlier.
|
|
42
|
+
- [#2575](https://github.com/iTwin/iTwinUI/pull/2575): Fixed `DropdownMenu`'s `children` type to be `React.JSX.Element` instead of `React.ReactNode`.
|
|
43
|
+
- [#2574](https://github.com/iTwin/iTwinUI/pull/2574): `ButtonGroup` no longer has overlapping borders between adjacent iTwinUI borderless buttons.
|
|
44
|
+
- [#2570](https://github.com/iTwin/iTwinUI/pull/2570): Fixed `Tag` to correctly merge `labelProps.onClick` and `removeButtonProps.onClick` with the internal `onClick` handlers.
|
|
45
|
+
- [#2581](https://github.com/iTwin/iTwinUI/pull/2581): Moved legacy `::-webkit-scrollbar` styles under a `@supports` block.
|
|
46
|
+
|
|
47
|
+
## 3.18.3
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- [#2554](https://github.com/iTwin/iTwinUI/pull/2554): Fixed color mismatch between font icons and svg icons in `IconButton` and `MenuItem`. (NOTE: Despite this fix, use of font icons is still discouraged).
|
|
52
|
+
|
|
3
53
|
## 3.18.2
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
|
@@ -49,7 +49,7 @@ const ComboBoxMenuItem = _react.memo(
|
|
|
49
49
|
disabled: disabled,
|
|
50
50
|
focused: focusedIndex === index,
|
|
51
51
|
ref: refs,
|
|
52
|
-
onClick: () => onClick?.(
|
|
52
|
+
onClick: () => onClick?.(),
|
|
53
53
|
role: role,
|
|
54
54
|
tabIndex: 'presentation' === role ? void 0 : -1,
|
|
55
55
|
'aria-selected': isSelected,
|
|
@@ -70,13 +70,10 @@ const MenuItem = _react.forwardRef((props, forwardedRef) => {
|
|
|
70
70
|
}),
|
|
71
71
|
[hasSubMenu],
|
|
72
72
|
);
|
|
73
|
-
let onClick = () => {
|
|
73
|
+
let onClick = (event) => {
|
|
74
74
|
if (disabled) return;
|
|
75
75
|
if (shouldCloseMenuOnClick) dropdownMenu?.close();
|
|
76
|
-
onClickProp?.(value);
|
|
77
|
-
};
|
|
78
|
-
let handlers = {
|
|
79
|
-
onClick,
|
|
76
|
+
onClickProp?.(value ?? event);
|
|
80
77
|
};
|
|
81
78
|
let focusableItemIndex = parentMenu?.focusableElements.findIndex(
|
|
82
79
|
(el) => el === menuItemRef.current,
|
|
@@ -101,9 +98,13 @@ const MenuItem = _react.forwardRef((props, forwardedRef) => {
|
|
|
101
98
|
...(parentMenu?.popoverGetItemProps != null
|
|
102
99
|
? parentMenu.popoverGetItemProps({
|
|
103
100
|
focusableItemIndex,
|
|
104
|
-
userProps:
|
|
101
|
+
userProps: {
|
|
102
|
+
onClick,
|
|
103
|
+
},
|
|
105
104
|
})
|
|
106
|
-
:
|
|
105
|
+
: {
|
|
106
|
+
onClick,
|
|
107
|
+
}),
|
|
107
108
|
...rest,
|
|
108
109
|
},
|
|
109
110
|
startIcon &&
|
|
@@ -183,7 +183,13 @@ const CustomSelect = _react.forwardRef((props, forwardedRef) => {
|
|
|
183
183
|
isSelected,
|
|
184
184
|
})
|
|
185
185
|
: _react.createElement(_MenuItem.MenuItem, null, option.label);
|
|
186
|
-
let {
|
|
186
|
+
let {
|
|
187
|
+
label,
|
|
188
|
+
icon,
|
|
189
|
+
startIcon: startIconProp,
|
|
190
|
+
value: _,
|
|
191
|
+
...restOption
|
|
192
|
+
} = option;
|
|
187
193
|
let startIcon = startIconProp ?? icon;
|
|
188
194
|
return _react.cloneElement(menuItem, {
|
|
189
195
|
key: `${label}-${index}`,
|
|
@@ -467,15 +473,17 @@ const SelectListbox = _react.forwardRef((props, forwardedRef) => {
|
|
|
467
473
|
}, []);
|
|
468
474
|
let children = _react.useMemo(
|
|
469
475
|
() =>
|
|
470
|
-
_react.Children.map(childrenProp, (child, index) =>
|
|
471
|
-
_react.isValidElement(child)
|
|
472
|
-
?
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
476
|
+
_react.Children.map(childrenProp, (child, index) => {
|
|
477
|
+
if (_react.isValidElement(child)) {
|
|
478
|
+
let ref = _index.isReact17or18 ? child.ref : child.props.ref;
|
|
479
|
+
return _react.createElement(_react1.CompositeItem, {
|
|
480
|
+
key: index,
|
|
481
|
+
ref: ref,
|
|
482
|
+
render: child,
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
return child;
|
|
486
|
+
}),
|
|
479
487
|
[childrenProp],
|
|
480
488
|
);
|
|
481
489
|
return _react.createElement(
|
|
@@ -56,9 +56,9 @@ const SideNavigation = _react.forwardRef((props, forwardedRef) => {
|
|
|
56
56
|
className: 'iui-sidenav-button iui-expand',
|
|
57
57
|
size: 'small',
|
|
58
58
|
onClick: _react.useCallback(() => {
|
|
59
|
-
setIsExpanded(
|
|
59
|
+
setIsExpanded(!isExpanded);
|
|
60
60
|
onExpanderClick?.();
|
|
61
|
-
}, [onExpanderClick, setIsExpanded]),
|
|
61
|
+
}, [isExpanded, onExpanderClick, setIsExpanded]),
|
|
62
62
|
},
|
|
63
63
|
_react.createElement(_index.SvgChevronRight, null),
|
|
64
64
|
);
|
|
@@ -105,10 +105,14 @@ const ColumnHeader = _react.forwardRef((props, forwardedRef) => {
|
|
|
105
105
|
'string' == typeof column.Header
|
|
106
106
|
? _react.createElement(
|
|
107
107
|
_index.ShadowRoot,
|
|
108
|
-
|
|
108
|
+
{
|
|
109
|
+
css: _index.lineClamp.css,
|
|
110
|
+
},
|
|
109
111
|
_react.createElement(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
'div',
|
|
113
|
+
{
|
|
114
|
+
className: _index.lineClamp.className,
|
|
115
|
+
},
|
|
112
116
|
_react.createElement('slot', null),
|
|
113
117
|
),
|
|
114
118
|
_react.createElement('slot', {
|
|
@@ -100,6 +100,38 @@ const Table = (props) => {
|
|
|
100
100
|
caption = 'Table',
|
|
101
101
|
role,
|
|
102
102
|
scrollToRow,
|
|
103
|
+
useControlledState,
|
|
104
|
+
autoResetExpanded,
|
|
105
|
+
autoResetFilters,
|
|
106
|
+
autoResetGlobalFilter,
|
|
107
|
+
autoResetHiddenColumns,
|
|
108
|
+
autoResetPage,
|
|
109
|
+
autoResetResize,
|
|
110
|
+
autoResetSelectedRows,
|
|
111
|
+
autoResetSortBy,
|
|
112
|
+
defaultCanFilter,
|
|
113
|
+
defaultCanSort,
|
|
114
|
+
defaultColumn: defaultColumnProp,
|
|
115
|
+
disableFilters,
|
|
116
|
+
disableGlobalFilter,
|
|
117
|
+
disableMultiSort,
|
|
118
|
+
disableSortRemove,
|
|
119
|
+
disabledMultiRemove,
|
|
120
|
+
expandSubRows,
|
|
121
|
+
globalFilter,
|
|
122
|
+
initialState,
|
|
123
|
+
isMultiSortEvent,
|
|
124
|
+
manualExpandedKey,
|
|
125
|
+
manualFilters,
|
|
126
|
+
manualGlobalFilter,
|
|
127
|
+
manualRowSelectedKey,
|
|
128
|
+
manualSortBy,
|
|
129
|
+
maxMultiSortColCount,
|
|
130
|
+
orderByFn,
|
|
131
|
+
pageCount,
|
|
132
|
+
sortTypes,
|
|
133
|
+
manualPagination,
|
|
134
|
+
paginateExpandedRows,
|
|
103
135
|
..._rest
|
|
104
136
|
} = props;
|
|
105
137
|
let { ariaRestAttributes, nonAriaRestAttributes } = _react.useMemo(
|
|
@@ -140,8 +172,9 @@ const Table = (props) => {
|
|
|
140
172
|
maxWidth: 0,
|
|
141
173
|
minWidth: 0,
|
|
142
174
|
width: 0,
|
|
175
|
+
...defaultColumnProp,
|
|
143
176
|
}),
|
|
144
|
-
[],
|
|
177
|
+
[defaultColumnProp],
|
|
145
178
|
);
|
|
146
179
|
let rowHeight = _react.useMemo(() => {
|
|
147
180
|
if ('condensed' === density) return 50;
|
|
@@ -295,9 +328,36 @@ const Table = (props) => {
|
|
|
295
328
|
);
|
|
296
329
|
let instance = (0, _reacttable.useTable)(
|
|
297
330
|
{
|
|
298
|
-
manualPagination: !paginatorRenderer,
|
|
299
|
-
paginateExpandedRows: false,
|
|
300
|
-
|
|
331
|
+
manualPagination: manualPagination ?? !paginatorRenderer,
|
|
332
|
+
paginateExpandedRows: paginateExpandedRows ?? false,
|
|
333
|
+
useControlledState,
|
|
334
|
+
autoResetExpanded,
|
|
335
|
+
autoResetFilters,
|
|
336
|
+
autoResetGlobalFilter,
|
|
337
|
+
autoResetHiddenColumns,
|
|
338
|
+
autoResetPage,
|
|
339
|
+
autoResetResize,
|
|
340
|
+
autoResetSelectedRows,
|
|
341
|
+
autoResetSortBy,
|
|
342
|
+
defaultCanFilter,
|
|
343
|
+
defaultCanSort,
|
|
344
|
+
disableFilters,
|
|
345
|
+
disableGlobalFilter,
|
|
346
|
+
disableMultiSort,
|
|
347
|
+
disableSortRemove,
|
|
348
|
+
disabledMultiRemove,
|
|
349
|
+
expandSubRows,
|
|
350
|
+
globalFilter,
|
|
351
|
+
isMultiSortEvent,
|
|
352
|
+
manualExpandedKey,
|
|
353
|
+
manualFilters,
|
|
354
|
+
manualGlobalFilter,
|
|
355
|
+
manualRowSelectedKey,
|
|
356
|
+
manualSortBy,
|
|
357
|
+
maxMultiSortColCount,
|
|
358
|
+
orderByFn,
|
|
359
|
+
pageCount: pageCount ?? -1,
|
|
360
|
+
sortTypes,
|
|
301
361
|
columns,
|
|
302
362
|
defaultColumn,
|
|
303
363
|
disableSortBy: !isSortable,
|
|
@@ -308,7 +368,7 @@ const Table = (props) => {
|
|
|
308
368
|
getSubRows: subComponent ? getSubRowsWithSubComponents : getSubRows,
|
|
309
369
|
initialState: {
|
|
310
370
|
pageSize,
|
|
311
|
-
...
|
|
371
|
+
...initialState,
|
|
312
372
|
},
|
|
313
373
|
columnResizeMode,
|
|
314
374
|
getRowId: subComponent ? getRowIdWithSubComponents : getRowId,
|
|
@@ -37,6 +37,10 @@ const DefaultCell = (props) => {
|
|
|
37
37
|
);
|
|
38
38
|
let isCellRendererChildrenCustom =
|
|
39
39
|
_react.useContext(DefaultCellRendererPropsChildren) !== props.children;
|
|
40
|
+
let isDefaultTextCell =
|
|
41
|
+
'string' == typeof props.cellProps.value &&
|
|
42
|
+
!isCustomCell &&
|
|
43
|
+
!isCellRendererChildrenCustom;
|
|
40
44
|
let {
|
|
41
45
|
cellElementProps: {
|
|
42
46
|
className: cellElementClassName,
|
|
@@ -51,9 +55,7 @@ const DefaultCell = (props) => {
|
|
|
51
55
|
className,
|
|
52
56
|
style,
|
|
53
57
|
status,
|
|
54
|
-
clamp =
|
|
55
|
-
!isCustomCell &&
|
|
56
|
-
!isCellRendererChildrenCustom,
|
|
58
|
+
clamp = isDefaultTextCell,
|
|
57
59
|
...rest
|
|
58
60
|
} = props;
|
|
59
61
|
let { key: cellElementKey, ...cellElementPropsRest } = cellElementProps;
|
|
@@ -84,12 +86,14 @@ const DefaultCell = (props) => {
|
|
|
84
86
|
_react.createElement(
|
|
85
87
|
TableCellContent,
|
|
86
88
|
{
|
|
87
|
-
shouldRenderWrapper:
|
|
89
|
+
shouldRenderWrapper: isDefaultTextCell,
|
|
88
90
|
},
|
|
89
91
|
clamp
|
|
90
92
|
? _react.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
'div',
|
|
94
|
+
{
|
|
95
|
+
className: _index.lineClamp.className,
|
|
96
|
+
},
|
|
93
97
|
_react.createElement('slot', null),
|
|
94
98
|
)
|
|
95
99
|
: _react.createElement('slot', null),
|
|
@@ -129,15 +133,15 @@ if ('development' === process.env.NODE_ENV)
|
|
|
129
133
|
const TableCellContent = (props) => {
|
|
130
134
|
let { children, shouldRenderWrapper } = props;
|
|
131
135
|
return shouldRenderWrapper
|
|
132
|
-
?
|
|
133
|
-
: _react.createElement(
|
|
136
|
+
? _react.createElement(
|
|
134
137
|
'div',
|
|
135
138
|
{
|
|
136
139
|
className: '_iui-table-cell-default-content',
|
|
137
140
|
onClick: (e) => e.stopPropagation(),
|
|
138
141
|
},
|
|
139
142
|
children,
|
|
140
|
-
)
|
|
143
|
+
)
|
|
144
|
+
: children;
|
|
141
145
|
};
|
|
142
146
|
const css = `
|
|
143
147
|
._iui-table-cell-default-content {
|
|
@@ -151,4 +155,5 @@ const css = `
|
|
|
151
155
|
inset: -6px;
|
|
152
156
|
z-index: -1;
|
|
153
157
|
}
|
|
158
|
+
${_index.lineClamp.css}
|
|
154
159
|
`;
|
|
@@ -35,30 +35,35 @@ const ExpanderColumn = (props = {}) => {
|
|
|
35
35
|
maxWidth: 48,
|
|
36
36
|
columnClassName: 'iui-slot',
|
|
37
37
|
cellClassName: 'iui-slot',
|
|
38
|
-
Cell: (
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
Cell: () => null,
|
|
39
|
+
cellRenderer: (props) => {
|
|
40
|
+
let { row } = props.cellProps;
|
|
41
|
+
let children = subComponent?.(row)
|
|
42
|
+
? _react.createElement(
|
|
43
|
+
_IconButton.IconButton,
|
|
44
|
+
{
|
|
45
|
+
'aria-label': 'Toggle expandable content',
|
|
46
|
+
className: 'iui-table-row-expander',
|
|
47
|
+
styleType: 'borderless',
|
|
48
|
+
size: 'small',
|
|
49
|
+
onClick: (e) => {
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
row.toggleRowExpanded();
|
|
52
|
+
},
|
|
53
|
+
disabled: isDisabled?.(row.original),
|
|
54
|
+
'aria-expanded': row.isExpanded,
|
|
55
|
+
},
|
|
56
|
+
_react.createElement(_index.SvgChevronRight, null),
|
|
57
|
+
)
|
|
58
|
+
: null;
|
|
41
59
|
return _react.createElement(
|
|
42
|
-
|
|
60
|
+
_index1.DefaultCell,
|
|
43
61
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
styleType: 'borderless',
|
|
47
|
-
size: 'small',
|
|
48
|
-
onClick: (e) => {
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
row.toggleRowExpanded();
|
|
51
|
-
},
|
|
52
|
-
disabled: isDisabled?.(props.row.original),
|
|
53
|
-
'aria-expanded': row.isExpanded,
|
|
62
|
+
...props,
|
|
63
|
+
isDisabled: (rowData) => !!isDisabled?.(rowData),
|
|
54
64
|
},
|
|
55
|
-
|
|
65
|
+
children,
|
|
56
66
|
);
|
|
57
67
|
},
|
|
58
|
-
cellRenderer: (props) =>
|
|
59
|
-
_react.createElement(_index1.DefaultCell, {
|
|
60
|
-
...props,
|
|
61
|
-
isDisabled: (rowData) => !!isDisabled?.(rowData),
|
|
62
|
-
}),
|
|
63
68
|
};
|
|
64
69
|
};
|
|
@@ -64,8 +64,10 @@ const SelectionColumn = (props = {}) => {
|
|
|
64
64
|
onChange: () => toggleAllRowsSelected(nextToggleState),
|
|
65
65
|
});
|
|
66
66
|
},
|
|
67
|
-
Cell: (
|
|
68
|
-
|
|
67
|
+
Cell: () => null,
|
|
68
|
+
cellRenderer: (props) => {
|
|
69
|
+
let { row, selectSubRows = true } = props.cellProps;
|
|
70
|
+
let children = _react.createElement(_Checkbox.Checkbox, {
|
|
69
71
|
...row.getToggleRowSelectedProps(),
|
|
70
72
|
style: {},
|
|
71
73
|
title: '',
|
|
@@ -85,11 +87,15 @@ const SelectionColumn = (props = {}) => {
|
|
|
85
87
|
);
|
|
86
88
|
else row.toggleRowSelected(!row.isSelected);
|
|
87
89
|
},
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
});
|
|
91
|
+
return _react.createElement(
|
|
92
|
+
_index.DefaultCell,
|
|
93
|
+
{
|
|
94
|
+
...props,
|
|
95
|
+
isDisabled: (rowData) => !!isDisabled?.(rowData),
|
|
96
|
+
},
|
|
97
|
+
children,
|
|
98
|
+
);
|
|
99
|
+
},
|
|
94
100
|
};
|
|
95
101
|
};
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, 'useExpanderCell', {
|
|
|
11
11
|
const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require('react'));
|
|
13
13
|
const _index = require('../columns/index.js');
|
|
14
|
+
const _DefaultCell = require('../cells/DefaultCell.js');
|
|
14
15
|
const useExpanderCell =
|
|
15
16
|
(subComponent, expanderCell, isRowDisabled) => (hooks) => {
|
|
16
17
|
if (!subComponent) return;
|
|
@@ -26,14 +27,17 @@ const useExpanderCell =
|
|
|
26
27
|
return [
|
|
27
28
|
{
|
|
28
29
|
...expanderColumn,
|
|
29
|
-
|
|
30
|
-
? (
|
|
30
|
+
cellRenderer: expanderCell
|
|
31
|
+
? (props) =>
|
|
31
32
|
_react.createElement(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
_DefaultCell.DefaultCell,
|
|
34
|
+
{
|
|
35
|
+
...props,
|
|
36
|
+
isDisabled: (rowData) => !!isRowDisabled?.(rowData),
|
|
37
|
+
},
|
|
38
|
+
expanderCell(props.cellProps),
|
|
35
39
|
)
|
|
36
|
-
: expanderColumn.
|
|
40
|
+
: expanderColumn.cellRenderer,
|
|
37
41
|
},
|
|
38
42
|
...columns,
|
|
39
43
|
];
|
package/DEV-cjs/core/Tag/Tag.js
CHANGED
|
@@ -53,8 +53,11 @@ const Tag = _react.forwardRef((props, forwardedRef) => {
|
|
|
53
53
|
_index.Box,
|
|
54
54
|
{
|
|
55
55
|
as: shouldUseLinkAction ? _LinkAction.LinkAction : 'span',
|
|
56
|
-
onClick: shouldUseLinkAction ? onClick : void 0,
|
|
57
56
|
...labelProps,
|
|
57
|
+
onClick: (0, _index.mergeEventHandlers)(
|
|
58
|
+
labelProps?.onClick,
|
|
59
|
+
shouldUseLinkAction ? onClick : void 0,
|
|
60
|
+
),
|
|
58
61
|
className: (0, _classnames.default)(
|
|
59
62
|
'iui-tag-label',
|
|
60
63
|
labelProps?.className,
|
|
@@ -69,9 +72,12 @@ const Tag = _react.forwardRef((props, forwardedRef) => {
|
|
|
69
72
|
{
|
|
70
73
|
styleType: 'borderless',
|
|
71
74
|
size: 'small',
|
|
72
|
-
onClick: onRemove,
|
|
73
75
|
'aria-label': 'Delete tag',
|
|
74
76
|
...removeButtonProps,
|
|
77
|
+
onClick: (0, _index.mergeEventHandlers)(
|
|
78
|
+
removeButtonProps?.onClick,
|
|
79
|
+
onRemove,
|
|
80
|
+
),
|
|
75
81
|
className: (0, _classnames.default)(
|
|
76
82
|
'iui-tag-button',
|
|
77
83
|
removeButtonProps?.className,
|
|
@@ -24,14 +24,14 @@ const _meta = require('../../utils/meta.js');
|
|
|
24
24
|
const versionWithoutDots = _meta.meta.version.replace(/\./g, '');
|
|
25
25
|
const OwnerDocumentContext = _react.createContext(void 0);
|
|
26
26
|
const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
27
|
-
var _themeOptions, _themeOptions1
|
|
27
|
+
var _themeOptions, _themeOptions1;
|
|
28
28
|
let {
|
|
29
29
|
theme: themeProp = 'inherit',
|
|
30
30
|
children,
|
|
31
31
|
themeOptions = {},
|
|
32
32
|
portalContainer: portalContainerProp,
|
|
33
33
|
includeCss = 'inherit' === themeProp,
|
|
34
|
-
future = {},
|
|
34
|
+
future: futureProp = {},
|
|
35
35
|
...rest
|
|
36
36
|
} = props;
|
|
37
37
|
useInertPolyfill();
|
|
@@ -43,68 +43,69 @@ const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
|
43
43
|
(_themeOptions1 = themeOptions).highContrast ??
|
|
44
44
|
(_themeOptions1.highContrast =
|
|
45
45
|
'inherit' === themeProp ? parent.highContrast : void 0);
|
|
46
|
-
(_future = future).themeBridge ??
|
|
47
|
-
(_future.themeBridge = parent.context?.future?.themeBridge);
|
|
48
46
|
let portalContainerFromParent = _react.useContext(
|
|
49
47
|
_index.PortalContainerContext,
|
|
50
48
|
);
|
|
51
|
-
let
|
|
49
|
+
let themeContextValue = _react.useMemo(
|
|
52
50
|
() => ({
|
|
53
51
|
theme,
|
|
54
52
|
themeOptions,
|
|
55
|
-
future,
|
|
56
53
|
}),
|
|
57
|
-
[theme, JSON.stringify(themeOptions)
|
|
54
|
+
[theme, JSON.stringify(themeOptions)],
|
|
58
55
|
);
|
|
59
56
|
let [portalContainer, setPortalContainer] = _react.useState(
|
|
60
57
|
portalContainerProp || null,
|
|
61
58
|
);
|
|
62
59
|
return _react.createElement(
|
|
63
|
-
_index.
|
|
60
|
+
_index.FutureFlagsProvider,
|
|
64
61
|
{
|
|
65
|
-
value:
|
|
62
|
+
value: futureProp,
|
|
66
63
|
},
|
|
67
64
|
_react.createElement(
|
|
68
|
-
_index.
|
|
69
|
-
|
|
65
|
+
_index.PortalContainerContext.Provider,
|
|
66
|
+
{
|
|
67
|
+
value: portalContainer,
|
|
68
|
+
},
|
|
70
69
|
_react.createElement(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
value: contextValue,
|
|
74
|
-
},
|
|
70
|
+
_index.HydrationProvider,
|
|
71
|
+
null,
|
|
75
72
|
_react.createElement(
|
|
76
|
-
|
|
73
|
+
_ThemeContext.ThemeContext.Provider,
|
|
77
74
|
{
|
|
78
|
-
|
|
75
|
+
value: themeContextValue,
|
|
79
76
|
},
|
|
80
|
-
includeCss && rootElement
|
|
81
|
-
? _react.createElement(FallbackStyles, {
|
|
82
|
-
root: rootElement,
|
|
83
|
-
})
|
|
84
|
-
: null,
|
|
85
77
|
_react.createElement(
|
|
86
|
-
|
|
78
|
+
_Toaster.ToastProvider,
|
|
87
79
|
{
|
|
88
|
-
|
|
89
|
-
themeOptions: themeOptions,
|
|
90
|
-
future: future,
|
|
91
|
-
ref: (0, _index.useMergedRefs)(
|
|
92
|
-
forwardedRef,
|
|
93
|
-
setRootElement,
|
|
94
|
-
useIuiDebugRef,
|
|
95
|
-
),
|
|
96
|
-
...rest,
|
|
80
|
+
inherit: 'inherit' === themeProp && !portalContainerProp,
|
|
97
81
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
82
|
+
includeCss && rootElement
|
|
83
|
+
? _react.createElement(FallbackStyles, {
|
|
84
|
+
root: rootElement,
|
|
85
|
+
})
|
|
86
|
+
: null,
|
|
87
|
+
_react.createElement(
|
|
88
|
+
MainRoot,
|
|
89
|
+
{
|
|
90
|
+
theme: theme,
|
|
91
|
+
themeOptions: themeOptions,
|
|
92
|
+
ref: (0, _index.useMergedRefs)(
|
|
93
|
+
forwardedRef,
|
|
94
|
+
setRootElement,
|
|
95
|
+
useIuiDebugRef,
|
|
96
|
+
),
|
|
97
|
+
...rest,
|
|
98
|
+
},
|
|
99
|
+
children,
|
|
100
|
+
_react.createElement(PortalContainer, {
|
|
101
|
+
theme: theme,
|
|
102
|
+
themeOptions: themeOptions,
|
|
103
|
+
portalContainerProp: portalContainerProp,
|
|
104
|
+
portalContainerFromParent: portalContainerFromParent,
|
|
105
|
+
setPortalContainer: setPortalContainer,
|
|
106
|
+
isInheritingTheme: 'inherit' === themeProp,
|
|
107
|
+
}),
|
|
108
|
+
),
|
|
108
109
|
),
|
|
109
110
|
),
|
|
110
111
|
),
|
|
@@ -134,7 +135,7 @@ const MainRoot = _react.forwardRef((props, forwardedRef) => {
|
|
|
134
135
|
);
|
|
135
136
|
});
|
|
136
137
|
const Root = _react.forwardRef((props, forwardedRef) => {
|
|
137
|
-
let { theme, children, themeOptions, className,
|
|
138
|
+
let { theme, children, themeOptions, className, ...rest } = props;
|
|
138
139
|
let prefersDark = (0, _index.useMediaQuery)('(prefers-color-scheme: dark)');
|
|
139
140
|
let prefersHighContrast = (0, _index.useMediaQuery)(
|
|
140
141
|
'(prefers-contrast: more)',
|
|
@@ -142,6 +143,7 @@ const Root = _react.forwardRef((props, forwardedRef) => {
|
|
|
142
143
|
let shouldApplyDark = 'dark' === theme || ('os' === theme && prefersDark);
|
|
143
144
|
let shouldApplyHC = themeOptions?.highContrast ?? prefersHighContrast;
|
|
144
145
|
let shouldApplyBackground = themeOptions?.applyBackground;
|
|
146
|
+
let themeBridge = (0, _index.useFutureFlag)('themeBridge');
|
|
145
147
|
return _react.createElement(
|
|
146
148
|
_index.Box,
|
|
147
149
|
{
|
|
@@ -154,7 +156,7 @@ const Root = _react.forwardRef((props, forwardedRef) => {
|
|
|
154
156
|
),
|
|
155
157
|
'data-iui-theme': shouldApplyDark ? 'dark' : 'light',
|
|
156
158
|
'data-iui-contrast': shouldApplyHC ? 'high' : 'default',
|
|
157
|
-
'data-iui-bridge':
|
|
159
|
+
'data-iui-bridge': themeBridge ? 'true' : void 0,
|
|
158
160
|
ref: forwardedRef,
|
|
159
161
|
...rest,
|
|
160
162
|
},
|
|
@@ -205,7 +207,6 @@ const PortalContainer = _react.memo(
|
|
|
205
207
|
isInheritingTheme,
|
|
206
208
|
theme,
|
|
207
209
|
themeOptions,
|
|
208
|
-
future,
|
|
209
210
|
}) => {
|
|
210
211
|
let ownerDocument = _react.useContext(OwnerDocumentContext);
|
|
211
212
|
let shouldSetupPortalContainer =
|
|
@@ -237,7 +238,6 @@ const PortalContainer = _react.memo(
|
|
|
237
238
|
...themeOptions,
|
|
238
239
|
applyBackground: false,
|
|
239
240
|
},
|
|
240
|
-
future: future,
|
|
241
241
|
'data-iui-portal': true,
|
|
242
242
|
style: {
|
|
243
243
|
display: 'contents',
|