@itwin/itwinui-react 3.17.0-dev.0 → 3.17.0-dev.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 +28 -0
- package/DEV-cjs/core/Dialog/Dialog.js +35 -42
- package/DEV-cjs/core/Dialog/DialogBackdrop.js +6 -1
- package/DEV-cjs/core/Dialog/DialogMain.js +42 -34
- package/DEV-cjs/core/Dialog/DialogMainContext.js +23 -0
- package/DEV-cjs/core/Dialog/DialogTitleBar.js +10 -1
- package/DEV-cjs/core/Panels/Panels.js +1 -1
- package/DEV-cjs/core/SideNavigation/SideNavigation.js +1 -11
- package/DEV-cjs/core/Table/actionHandlers/selectHandler.js +7 -8
- package/DEV-cjs/core/Tabs/Tabs.js +9 -1
- package/DEV-cjs/core/ThemeProvider/ThemeProvider.js +12 -9
- package/DEV-cjs/core/Toast/Toast.js +132 -77
- package/DEV-cjs/core/Toast/Toaster.js +11 -3
- package/DEV-cjs/styles.js +1 -1
- package/DEV-cjs/utils/components/index.js +0 -1
- package/DEV-esm/core/Dialog/Dialog.js +32 -42
- package/DEV-esm/core/Dialog/DialogBackdrop.js +6 -1
- package/DEV-esm/core/Dialog/DialogMain.js +42 -34
- package/DEV-esm/core/Dialog/DialogMainContext.js +3 -0
- package/DEV-esm/core/Dialog/DialogTitleBar.js +10 -1
- package/DEV-esm/core/Panels/Panels.js +2 -1
- package/DEV-esm/core/SideNavigation/SideNavigation.js +2 -17
- package/DEV-esm/core/Table/actionHandlers/selectHandler.js +7 -8
- package/DEV-esm/core/Tabs/Tabs.js +9 -1
- package/DEV-esm/core/ThemeProvider/ThemeProvider.js +12 -9
- package/DEV-esm/core/Toast/Toast.js +131 -75
- package/DEV-esm/core/Toast/Toaster.js +11 -3
- package/DEV-esm/styles.js +1 -1
- package/DEV-esm/utils/components/index.js +0 -1
- package/LICENSE.md +1 -1
- package/cjs/core/Dialog/Dialog.d.ts +1 -1
- package/cjs/core/Dialog/Dialog.js +35 -42
- package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/cjs/core/Dialog/DialogBackdrop.js +6 -1
- package/cjs/core/Dialog/DialogMain.js +42 -34
- package/cjs/core/Dialog/DialogMainContext.d.ts +7 -0
- package/cjs/core/Dialog/DialogMainContext.js +23 -0
- package/cjs/core/Dialog/DialogTitleBar.js +10 -1
- package/cjs/core/Panels/Panels.js +1 -1
- package/cjs/core/SideNavigation/SideNavigation.d.ts +2 -2
- package/cjs/core/SideNavigation/SideNavigation.js +1 -11
- package/cjs/core/Table/actionHandlers/selectHandler.js +7 -8
- package/cjs/core/Tabs/Tabs.js +9 -1
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +2 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +13 -5
- package/cjs/core/ThemeProvider/ThemeProvider.js +12 -9
- package/cjs/core/Toast/Toast.d.ts +1 -1
- package/cjs/core/Toast/Toast.js +132 -77
- package/cjs/core/Toast/Toaster.d.ts +1 -1
- package/cjs/core/Toast/Toaster.js +11 -3
- package/cjs/styles.js +1 -1
- package/cjs/utils/components/index.d.ts +0 -1
- package/cjs/utils/components/index.js +0 -1
- package/cjs/utils/hooks/useGlobals.d.ts +1 -0
- package/esm/core/Dialog/Dialog.d.ts +1 -1
- package/esm/core/Dialog/Dialog.js +32 -42
- package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/esm/core/Dialog/DialogBackdrop.js +6 -1
- package/esm/core/Dialog/DialogMain.js +42 -34
- package/esm/core/Dialog/DialogMainContext.d.ts +7 -0
- package/esm/core/Dialog/DialogMainContext.js +3 -0
- package/esm/core/Dialog/DialogTitleBar.js +10 -1
- package/esm/core/Panels/Panels.js +2 -1
- package/esm/core/SideNavigation/SideNavigation.d.ts +2 -2
- package/esm/core/SideNavigation/SideNavigation.js +2 -17
- package/esm/core/Table/actionHandlers/selectHandler.js +7 -8
- package/esm/core/Tabs/Tabs.js +9 -1
- package/esm/core/ThemeProvider/ThemeContext.d.ts +2 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +13 -5
- package/esm/core/ThemeProvider/ThemeProvider.js +12 -9
- package/esm/core/Toast/Toast.d.ts +1 -1
- package/esm/core/Toast/Toast.js +131 -75
- package/esm/core/Toast/Toaster.d.ts +1 -1
- package/esm/core/Toast/Toaster.js +11 -3
- package/esm/styles.js +1 -1
- package/esm/utils/components/index.d.ts +0 -1
- package/esm/utils/components/index.js +0 -1
- package/esm/utils/hooks/useGlobals.d.ts +1 -0
- package/package.json +5 -7
- package/styles.css +10 -10
- package/DEV-cjs/utils/components/WithCSSTransition.js +0 -60
- package/DEV-esm/utils/components/WithCSSTransition.js +0 -49
- package/cjs/utils/components/WithCSSTransition.d.ts +0 -6
- package/cjs/utils/components/WithCSSTransition.js +0 -60
- package/esm/utils/components/WithCSSTransition.d.ts +0 -6
- package/esm/utils/components/WithCSSTransition.js +0 -49
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.16.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2411](https://github.com/iTwin/iTwinUI/pull/2411): Fixed `Panels.Trigger` not working in older React versions where `useId` is not available.
|
|
8
|
+
- [#2407](https://github.com/iTwin/iTwinUI/pull/2407): Increased contrast (i.e. opacity) of light theme's text selection background. This also affects some other opacities of other components (e.g. shadows and hover backgrounds).
|
|
9
|
+
|
|
10
|
+
## 3.16.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#2402](https://github.com/iTwin/iTwinUI/pull/2402): Fixed an issue in `Tabs` where it wasn't recalculating the active stripe position when a new tab was asynchronously added to the tablist.
|
|
15
|
+
|
|
16
|
+
## 3.16.4
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#2389](https://github.com/iTwin/iTwinUI/pull/2389): Fixed `Table` bug where parent rows had indeterminate checkboxes even when all sub rows were selected.
|
|
21
|
+
- [#2390](https://github.com/iTwin/iTwinUI/pull/2390): Fixed `ThemeProvider` bug of re-mounting its children and losing state when `portalContainer` is toggled between `undefined` and defined.
|
|
22
|
+
- [#2396](https://github.com/iTwin/iTwinUI/pull/2396): Fixed rare bug where icons in button components (e.g. `Button`, `SidenavButton`, etc.) were becoming 0 in width when less space was available.
|
|
23
|
+
|
|
24
|
+
## 3.16.3
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#2384](https://github.com/iTwin/iTwinUI/pull/2384): Fixed the syntax for `react` and `react-dom` version ranges declared in `peerDependencies`.
|
|
29
|
+
- [#2386](https://github.com/iTwin/iTwinUI/pull/2386): Fixed a visual issue in `Tile.Name` where a long string without spaces wasn't wrapping properly.
|
|
30
|
+
|
|
3
31
|
## 3.16.2
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -19,7 +19,6 @@ const _DialogContext = require('./DialogContext.js');
|
|
|
19
19
|
const _DialogButtonBar = require('./DialogButtonBar.js');
|
|
20
20
|
const _DialogMain = require('./DialogMain.js');
|
|
21
21
|
const _index = require('../../utils/index.js');
|
|
22
|
-
const _reacttransitiongroup = require('react-transition-group');
|
|
23
22
|
const DialogComponent = _react.forwardRef((props, ref) => {
|
|
24
23
|
let {
|
|
25
24
|
trapFocus = false,
|
|
@@ -39,49 +38,43 @@ const DialogComponent = _react.forwardRef((props, ref) => {
|
|
|
39
38
|
...rest
|
|
40
39
|
} = props;
|
|
41
40
|
let dialogRootRef = _react.useRef(null);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
timeout: {
|
|
47
|
-
exit: 600,
|
|
48
|
-
},
|
|
49
|
-
mountOnEnter: true,
|
|
50
|
-
unmountOnExit: true,
|
|
51
|
-
},
|
|
52
|
-
_react.createElement(
|
|
53
|
-
_DialogContext.DialogContext.Provider,
|
|
54
|
-
{
|
|
55
|
-
value: {
|
|
56
|
-
isOpen,
|
|
57
|
-
onClose,
|
|
58
|
-
closeOnEsc,
|
|
59
|
-
closeOnExternalClick,
|
|
60
|
-
isDismissible,
|
|
61
|
-
preventDocumentScroll,
|
|
62
|
-
trapFocus,
|
|
63
|
-
setFocus,
|
|
64
|
-
isDraggable,
|
|
65
|
-
isResizable,
|
|
66
|
-
relativeTo,
|
|
67
|
-
dialogRootRef,
|
|
68
|
-
placement,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
_react.createElement(
|
|
72
|
-
_index.Portal,
|
|
41
|
+
let mergedRefs = (0, _index.useMergedRefs)(ref, dialogRootRef);
|
|
42
|
+
return isOpen
|
|
43
|
+
? _react.createElement(
|
|
44
|
+
_DialogContext.DialogContext.Provider,
|
|
73
45
|
{
|
|
74
|
-
|
|
46
|
+
value: {
|
|
47
|
+
isOpen,
|
|
48
|
+
onClose,
|
|
49
|
+
closeOnEsc,
|
|
50
|
+
closeOnExternalClick,
|
|
51
|
+
isDismissible,
|
|
52
|
+
preventDocumentScroll,
|
|
53
|
+
trapFocus,
|
|
54
|
+
setFocus,
|
|
55
|
+
isDraggable,
|
|
56
|
+
isResizable,
|
|
57
|
+
relativeTo,
|
|
58
|
+
placement,
|
|
59
|
+
},
|
|
75
60
|
},
|
|
76
|
-
_react.createElement(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
_react.createElement(
|
|
62
|
+
_index.Portal,
|
|
63
|
+
{
|
|
64
|
+
portal: portal,
|
|
65
|
+
},
|
|
66
|
+
_react.createElement(_index.Box, {
|
|
67
|
+
className: (0, _classnames.default)(
|
|
68
|
+
'iui-dialog-wrapper',
|
|
69
|
+
className,
|
|
70
|
+
),
|
|
71
|
+
'data-iui-relative': 'container' === relativeTo,
|
|
72
|
+
ref: mergedRefs,
|
|
73
|
+
...rest,
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
: null;
|
|
85
78
|
});
|
|
86
79
|
DialogComponent.displayName = 'Dialog';
|
|
87
80
|
const Dialog = Object.assign(DialogComponent, {
|
|
@@ -14,9 +14,11 @@ const _react = _interop_require_wildcard._(require('react'));
|
|
|
14
14
|
const _Backdrop = require('../Backdrop/Backdrop.js');
|
|
15
15
|
const _index = require('../../utils/index.js');
|
|
16
16
|
const _DialogContext = require('./DialogContext.js');
|
|
17
|
+
const _DialogMainContext = require('./DialogMainContext.js');
|
|
17
18
|
const _classnames = _interop_require_default._(require('classnames'));
|
|
18
19
|
const DialogBackdrop = _react.forwardRef((props, ref) => {
|
|
19
20
|
let dialogContext = (0, _DialogContext.useDialogContext)();
|
|
21
|
+
let dialogMainContext = (0, _DialogMainContext.useDialogMainContext)();
|
|
20
22
|
let {
|
|
21
23
|
isVisible = dialogContext.isOpen,
|
|
22
24
|
isDismissible = dialogContext.isDismissible,
|
|
@@ -33,7 +35,10 @@ const DialogBackdrop = _react.forwardRef((props, ref) => {
|
|
|
33
35
|
let handleMouseDown = (event) => {
|
|
34
36
|
event.persist();
|
|
35
37
|
if (event.target !== backdropRef.current) return;
|
|
36
|
-
if (isDismissible && closeOnExternalClick && onClose)
|
|
38
|
+
if (isDismissible && closeOnExternalClick && onClose) {
|
|
39
|
+
dialogMainContext?.beforeClose();
|
|
40
|
+
onClose(event);
|
|
41
|
+
}
|
|
37
42
|
onMouseDown?.(event);
|
|
38
43
|
};
|
|
39
44
|
return _react.createElement(_Backdrop.Backdrop, {
|
|
@@ -14,9 +14,9 @@ const _react = _interop_require_wildcard._(require('react'));
|
|
|
14
14
|
const _classnames = _interop_require_default._(require('classnames'));
|
|
15
15
|
const _index = require('../../utils/index.js');
|
|
16
16
|
const _DialogContext = require('./DialogContext.js');
|
|
17
|
-
const _reacttransitiongroup = require('react-transition-group');
|
|
18
17
|
const _DialogDragContext = require('./DialogDragContext.js');
|
|
19
18
|
const _useDragAndDrop = require('../../utils/hooks/useDragAndDrop.js');
|
|
19
|
+
const _DialogMainContext = require('./DialogMainContext.js');
|
|
20
20
|
const DialogMain = _react.forwardRef((props, ref) => {
|
|
21
21
|
let dialogContext = (0, _DialogContext.useDialogContext)();
|
|
22
22
|
let {
|
|
@@ -37,12 +37,13 @@ const DialogMain = _react.forwardRef((props, ref) => {
|
|
|
37
37
|
placement = dialogContext.placement,
|
|
38
38
|
...rest
|
|
39
39
|
} = props;
|
|
40
|
-
let
|
|
40
|
+
let { dialogRootRef } = dialogContext;
|
|
41
41
|
let dialogRef = _react.useRef(null);
|
|
42
|
-
let hasBeenResized = _react.useRef(false);
|
|
43
42
|
let previousFocusedElement = _react.useRef();
|
|
43
|
+
let [style, setStyle] = _react.useState();
|
|
44
|
+
let hasBeenResized = _react.useRef(false);
|
|
44
45
|
let originalBodyOverflow = _react.useRef('');
|
|
45
|
-
|
|
46
|
+
(0, _index.useLayoutEffect)(() => {
|
|
46
47
|
if (isOpen) originalBodyOverflow.current = document.body.style.overflow;
|
|
47
48
|
}, [isOpen]);
|
|
48
49
|
_react.useEffect(() => {
|
|
@@ -58,17 +59,19 @@ const DialogMain = _react.forwardRef((props, ref) => {
|
|
|
58
59
|
return () => {
|
|
59
60
|
ownerDocument.body.style.overflow = originalBodyOverflow.current;
|
|
60
61
|
};
|
|
61
|
-
}, [isOpen, preventDocumentScroll]);
|
|
62
|
+
}, [dialogRef, isOpen, preventDocumentScroll]);
|
|
62
63
|
let handleKeyDown = (event) => {
|
|
63
64
|
if (event.altKey) return;
|
|
64
65
|
event.persist();
|
|
65
|
-
if (isDismissible && closeOnEsc && 'Escape' === event.key && onClose)
|
|
66
|
+
if (isDismissible && closeOnEsc && 'Escape' === event.key && onClose) {
|
|
67
|
+
beforeClose();
|
|
66
68
|
onClose(event);
|
|
69
|
+
}
|
|
67
70
|
onKeyDown?.(event);
|
|
68
71
|
};
|
|
69
72
|
let { onPointerDown, transform } = (0, _useDragAndDrop.useDragAndDrop)(
|
|
70
73
|
dialogRef,
|
|
71
|
-
|
|
74
|
+
dialogRootRef,
|
|
72
75
|
isDraggable,
|
|
73
76
|
);
|
|
74
77
|
let handlePointerDown = _react.useCallback(
|
|
@@ -88,13 +91,35 @@ const DialogMain = _react.forwardRef((props, ref) => {
|
|
|
88
91
|
insetBlockStart: dialogRef.current?.offsetTop,
|
|
89
92
|
transform: `translate(${translateX}px,${translateY}px)`,
|
|
90
93
|
}));
|
|
91
|
-
}, [isDraggable, isOpen]);
|
|
94
|
+
}, [dialogRef, isDraggable, isOpen]);
|
|
92
95
|
let setResizeStyle = _react.useCallback((newStyle) => {
|
|
93
96
|
setStyle((oldStyle) => ({
|
|
94
97
|
...oldStyle,
|
|
95
98
|
...newStyle,
|
|
96
99
|
}));
|
|
97
100
|
}, []);
|
|
101
|
+
let onEnter = _react.useCallback(() => {
|
|
102
|
+
previousFocusedElement.current =
|
|
103
|
+
dialogRef.current?.ownerDocument.activeElement;
|
|
104
|
+
if (setFocus)
|
|
105
|
+
dialogRef.current?.focus({
|
|
106
|
+
preventScroll: true,
|
|
107
|
+
});
|
|
108
|
+
}, [dialogRef, previousFocusedElement, setFocus]);
|
|
109
|
+
let beforeClose = _react.useCallback(() => {
|
|
110
|
+
if (
|
|
111
|
+
dialogRef.current?.contains(
|
|
112
|
+
dialogRef.current?.ownerDocument.activeElement,
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
previousFocusedElement.current?.focus();
|
|
116
|
+
}, [dialogRef, previousFocusedElement]);
|
|
117
|
+
let mountRef = _react.useCallback(
|
|
118
|
+
(element) => {
|
|
119
|
+
if (element) onEnter();
|
|
120
|
+
},
|
|
121
|
+
[onEnter],
|
|
122
|
+
);
|
|
98
123
|
let content = _react.createElement(
|
|
99
124
|
_index.Box,
|
|
100
125
|
{
|
|
@@ -109,7 +134,7 @@ const DialogMain = _react.forwardRef((props, ref) => {
|
|
|
109
134
|
className,
|
|
110
135
|
),
|
|
111
136
|
role: 'dialog',
|
|
112
|
-
ref: (0, _index.useMergedRefs)(dialogRef, ref),
|
|
137
|
+
ref: (0, _index.useMergedRefs)(dialogRef, mountRef, ref),
|
|
113
138
|
onKeyDown: handleKeyDown,
|
|
114
139
|
tabIndex: -1,
|
|
115
140
|
'data-iui-placement': placement,
|
|
@@ -127,7 +152,7 @@ const DialogMain = _react.forwardRef((props, ref) => {
|
|
|
127
152
|
isResizable &&
|
|
128
153
|
_react.createElement(_index.Resizer, {
|
|
129
154
|
elementRef: dialogRef,
|
|
130
|
-
containerRef:
|
|
155
|
+
containerRef: dialogRootRef,
|
|
131
156
|
onResizeStart: () => {
|
|
132
157
|
if (!hasBeenResized.current) {
|
|
133
158
|
hasBeenResized.current = true;
|
|
@@ -142,31 +167,14 @@ const DialogMain = _react.forwardRef((props, ref) => {
|
|
|
142
167
|
children,
|
|
143
168
|
);
|
|
144
169
|
return _react.createElement(
|
|
145
|
-
|
|
170
|
+
_DialogMainContext.DialogMainContext.Provider,
|
|
146
171
|
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
previousFocusedElement.current =
|
|
154
|
-
dialogRef.current?.ownerDocument.activeElement;
|
|
155
|
-
setFocus &&
|
|
156
|
-
dialogRef.current?.focus({
|
|
157
|
-
preventScroll: true,
|
|
158
|
-
});
|
|
159
|
-
},
|
|
160
|
-
onExit: () => {
|
|
161
|
-
if (
|
|
162
|
-
dialogRef.current?.contains(
|
|
163
|
-
dialogRef.current?.ownerDocument.activeElement,
|
|
164
|
-
)
|
|
165
|
-
)
|
|
166
|
-
previousFocusedElement.current?.focus();
|
|
167
|
-
},
|
|
168
|
-
unmountOnExit: true,
|
|
169
|
-
nodeRef: dialogRef,
|
|
172
|
+
value: _react.useMemo(
|
|
173
|
+
() => ({
|
|
174
|
+
beforeClose,
|
|
175
|
+
}),
|
|
176
|
+
[beforeClose],
|
|
177
|
+
),
|
|
170
178
|
},
|
|
171
179
|
_react.createElement(
|
|
172
180
|
_DialogDragContext.DialogDragContext.Provider,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {
|
|
3
|
+
value: true,
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name],
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
DialogMainContext: function () {
|
|
14
|
+
return DialogMainContext;
|
|
15
|
+
},
|
|
16
|
+
useDialogMainContext: function () {
|
|
17
|
+
return useDialogMainContext;
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
|
|
21
|
+
const _react = _interop_require_wildcard._(require('react'));
|
|
22
|
+
const DialogMainContext = _react.createContext(null);
|
|
23
|
+
const useDialogMainContext = () => _react.useContext(DialogMainContext);
|
|
@@ -15,11 +15,13 @@ const _classnames = _interop_require_default._(require('classnames'));
|
|
|
15
15
|
const _index = require('../../utils/index.js');
|
|
16
16
|
const _IconButton = require('../Buttons/IconButton.js');
|
|
17
17
|
const _DialogContext = require('./DialogContext.js');
|
|
18
|
+
const _DialogMainContext = require('./DialogMainContext.js');
|
|
18
19
|
const _DialogTitleBarTitle = require('./DialogTitleBarTitle.js');
|
|
19
20
|
const _DialogDragContext = require('./DialogDragContext.js');
|
|
20
21
|
const DialogTitleBar = Object.assign(
|
|
21
22
|
_react.forwardRef((props, ref) => {
|
|
22
23
|
let dialogContext = (0, _DialogContext.useDialogContext)();
|
|
24
|
+
let dialogMainContext = (0, _DialogMainContext.useDialogMainContext)();
|
|
23
25
|
let {
|
|
24
26
|
children,
|
|
25
27
|
titleText,
|
|
@@ -31,6 +33,13 @@ const DialogTitleBar = Object.assign(
|
|
|
31
33
|
...rest
|
|
32
34
|
} = props;
|
|
33
35
|
let { onPointerDown } = (0, _DialogDragContext.useDialogDragContext)();
|
|
36
|
+
let onClick = _react.useCallback(
|
|
37
|
+
(e) => {
|
|
38
|
+
dialogMainContext?.beforeClose();
|
|
39
|
+
onClose?.(e);
|
|
40
|
+
},
|
|
41
|
+
[dialogMainContext, onClose],
|
|
42
|
+
);
|
|
34
43
|
return _react.createElement(
|
|
35
44
|
_index.Box,
|
|
36
45
|
{
|
|
@@ -60,7 +69,7 @@ const DialogTitleBar = Object.assign(
|
|
|
60
69
|
{
|
|
61
70
|
size: 'small',
|
|
62
71
|
styleType: 'borderless',
|
|
63
|
-
onClick:
|
|
72
|
+
onClick: onClick,
|
|
64
73
|
'aria-label': 'Close',
|
|
65
74
|
'data-iui-shift': 'right',
|
|
66
75
|
},
|
|
@@ -170,7 +170,7 @@ const PanelTrigger = (props) => {
|
|
|
170
170
|
panels,
|
|
171
171
|
} = (0, _index.useSafeContext)(PanelsWrapperContext);
|
|
172
172
|
let { id: panelId } = (0, _index.useSafeContext)(PanelContext);
|
|
173
|
-
let fallbackId =
|
|
173
|
+
let fallbackId = (0, _index.useId)();
|
|
174
174
|
let triggerId = children.props.id || fallbackId;
|
|
175
175
|
let onClick = _react.useCallback(() => {
|
|
176
176
|
if (null == activePanel) return;
|
|
@@ -125,17 +125,7 @@ const SideNavigation = _react.forwardRef((props, forwardedRef) => {
|
|
|
125
125
|
),
|
|
126
126
|
'bottom' === expanderPlacement && ExpandButton,
|
|
127
127
|
),
|
|
128
|
-
submenu &&
|
|
129
|
-
_react.createElement(
|
|
130
|
-
_index.WithCSSTransition,
|
|
131
|
-
{
|
|
132
|
-
in: isSubmenuOpen,
|
|
133
|
-
dimension: 'width',
|
|
134
|
-
timeout: 200,
|
|
135
|
-
classNames: 'iui',
|
|
136
|
-
},
|
|
137
|
-
submenu,
|
|
138
|
-
),
|
|
128
|
+
submenu && isSubmenuOpen ? submenu : null,
|
|
139
129
|
),
|
|
140
130
|
);
|
|
141
131
|
});
|
|
@@ -29,19 +29,18 @@ const onSelectHandler = (newState, instance, onSelect, isRowDisabled) => {
|
|
|
29
29
|
let newSelectedRowIds = {};
|
|
30
30
|
let handleRow = (row) => {
|
|
31
31
|
if (isRowDisabled?.(row.original)) return false;
|
|
32
|
+
let hasSubComponents = !!row.initialSubRows[0]?.original[_Table.iuiId];
|
|
33
|
+
let hasSubRows = row.subRows.length > 0 && !hasSubComponents;
|
|
32
34
|
let isAllSubSelected = true;
|
|
33
|
-
if (
|
|
35
|
+
if (hasSubRows)
|
|
34
36
|
row.initialSubRows.forEach((subRow) => {
|
|
35
37
|
let result = handleRow(subRow);
|
|
36
38
|
if (!result) isAllSubSelected = false;
|
|
37
39
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
isAllSubSelected)
|
|
43
|
-
)
|
|
44
|
-
newSelectedRowIds[row.id] = true;
|
|
40
|
+
let isRowSelected = newState.selectedRowIds[row.id];
|
|
41
|
+
let case1 = isRowSelected && (!instance.selectSubRows || !hasSubRows);
|
|
42
|
+
let case2 = hasSubRows && isAllSubSelected;
|
|
43
|
+
if (case1 || case2) newSelectedRowIds[row.id] = true;
|
|
45
44
|
return !!newSelectedRowIds[row.id];
|
|
46
45
|
};
|
|
47
46
|
instance.initialRows.forEach((row) => handleRow(row));
|
|
@@ -176,7 +176,15 @@ const Tab = _react.forwardRef((props, forwardedRef) => {
|
|
|
176
176
|
});
|
|
177
177
|
};
|
|
178
178
|
if ('default' !== type && isActive) updateStripe();
|
|
179
|
-
}, [
|
|
179
|
+
}, [
|
|
180
|
+
type,
|
|
181
|
+
orientation,
|
|
182
|
+
isActive,
|
|
183
|
+
tabsWidth,
|
|
184
|
+
setStripeProperties,
|
|
185
|
+
tablistRef,
|
|
186
|
+
value,
|
|
187
|
+
]);
|
|
180
188
|
let onKeyDown = (event) => {
|
|
181
189
|
if (event.altKey) return;
|
|
182
190
|
let allTabs = Array.from(event.currentTarget.parentElement?.children ?? []);
|
|
@@ -21,13 +21,14 @@ const _meta = require('../../utils/meta.js');
|
|
|
21
21
|
const versionWithoutDots = _meta.meta.version.replace(/\./g, '');
|
|
22
22
|
const ownerDocumentAtom = (0, _jotai.atom)(void 0);
|
|
23
23
|
const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
24
|
-
var _themeOptions, _themeOptions1,
|
|
24
|
+
var _themeOptions, _themeOptions1, _future;
|
|
25
25
|
let {
|
|
26
26
|
theme: themeProp = 'inherit',
|
|
27
27
|
children,
|
|
28
28
|
themeOptions = {},
|
|
29
29
|
portalContainer: portalContainerProp,
|
|
30
30
|
includeCss = 'inherit' === themeProp,
|
|
31
|
+
future = {},
|
|
31
32
|
...rest
|
|
32
33
|
} = props;
|
|
33
34
|
useInertPolyfill();
|
|
@@ -39,11 +40,8 @@ const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
|
39
40
|
(_themeOptions1 = themeOptions).highContrast ??
|
|
40
41
|
(_themeOptions1.highContrast =
|
|
41
42
|
'inherit' === themeProp ? parent.highContrast : void 0);
|
|
42
|
-
(
|
|
43
|
-
(
|
|
44
|
-
'inherit' === themeProp
|
|
45
|
-
? parent.context?.themeOptions?.bridgeToFutureVersions
|
|
46
|
-
: void 0);
|
|
43
|
+
(_future = future).themeBridge ??
|
|
44
|
+
(_future.themeBridge = parent.context?.future?.themeBridge);
|
|
47
45
|
let [portalContainerFromParent] = (0, _index.useScopedAtom)(
|
|
48
46
|
_index.portalContainerAtom,
|
|
49
47
|
);
|
|
@@ -51,8 +49,9 @@ const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
|
51
49
|
() => ({
|
|
52
50
|
theme,
|
|
53
51
|
themeOptions,
|
|
52
|
+
future,
|
|
54
53
|
}),
|
|
55
|
-
[theme, JSON.stringify(themeOptions)],
|
|
54
|
+
[theme, JSON.stringify(themeOptions), JSON.stringify(future)],
|
|
56
55
|
);
|
|
57
56
|
return _react.createElement(
|
|
58
57
|
_index.ScopeProvider,
|
|
@@ -80,6 +79,7 @@ const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
|
80
79
|
{
|
|
81
80
|
theme: theme,
|
|
82
81
|
themeOptions: themeOptions,
|
|
82
|
+
future: future,
|
|
83
83
|
ref: (0, _index.useMergedRefs)(
|
|
84
84
|
forwardedRef,
|
|
85
85
|
setRootElement,
|
|
@@ -91,6 +91,7 @@ const ThemeProvider = _react.forwardRef((props, forwardedRef) => {
|
|
|
91
91
|
_react.createElement(PortalContainer, {
|
|
92
92
|
theme: theme,
|
|
93
93
|
themeOptions: themeOptions,
|
|
94
|
+
future: future,
|
|
94
95
|
portalContainerProp: portalContainerProp,
|
|
95
96
|
portalContainerFromParent: portalContainerFromParent,
|
|
96
97
|
isInheritingTheme: 'inherit' === themeProp,
|
|
@@ -119,7 +120,7 @@ const MainRoot = _react.forwardRef((props, forwardedRef) => {
|
|
|
119
120
|
});
|
|
120
121
|
});
|
|
121
122
|
const Root = _react.forwardRef((props, forwardedRef) => {
|
|
122
|
-
let { theme, children, themeOptions, className, ...rest } = props;
|
|
123
|
+
let { theme, children, themeOptions, className, future, ...rest } = props;
|
|
123
124
|
let prefersDark = (0, _index.useMediaQuery)('(prefers-color-scheme: dark)');
|
|
124
125
|
let prefersHighContrast = (0, _index.useMediaQuery)(
|
|
125
126
|
'(prefers-contrast: more)',
|
|
@@ -139,7 +140,7 @@ const Root = _react.forwardRef((props, forwardedRef) => {
|
|
|
139
140
|
),
|
|
140
141
|
'data-iui-theme': shouldApplyDark ? 'dark' : 'light',
|
|
141
142
|
'data-iui-contrast': shouldApplyHC ? 'high' : 'default',
|
|
142
|
-
'data-iui-bridge': !!
|
|
143
|
+
'data-iui-bridge': !!future?.themeBridge || void 0,
|
|
143
144
|
ref: forwardedRef,
|
|
144
145
|
...rest,
|
|
145
146
|
},
|
|
@@ -189,6 +190,7 @@ const PortalContainer = _react.memo(
|
|
|
189
190
|
isInheritingTheme,
|
|
190
191
|
theme,
|
|
191
192
|
themeOptions,
|
|
193
|
+
future,
|
|
192
194
|
}) => {
|
|
193
195
|
let [ownerDocument] = (0, _index.useScopedAtom)(ownerDocumentAtom);
|
|
194
196
|
let [portalContainer, setPortalContainer] = (0, _index.useScopedAtom)(
|
|
@@ -219,6 +221,7 @@ const PortalContainer = _react.memo(
|
|
|
219
221
|
...themeOptions,
|
|
220
222
|
applyBackground: false,
|
|
221
223
|
},
|
|
224
|
+
future: future,
|
|
222
225
|
'data-iui-portal': true,
|
|
223
226
|
style: {
|
|
224
227
|
display: 'contents',
|