@itwin/itwinui-react 2.12.19 → 2.12.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 764d16fb: Fixed blurring and resizing issues in Dialog/Modal by removing `overflow: hidden` and inline `transform` styles.
|
|
8
|
+
|
|
9
|
+
## 2.12.20
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9f1f3cff: Fixed `ComboBox` to correctly merge `inputProps.style` with internal styles.
|
|
14
|
+
|
|
3
15
|
## 2.12.19
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -34,7 +34,7 @@ const index_js_2 = require("../utils/index.js");
|
|
|
34
34
|
const ComboBoxMultipleContainer_js_1 = require("./ComboBoxMultipleContainer.js");
|
|
35
35
|
const helpers_js_1 = require("./helpers.js");
|
|
36
36
|
exports.ComboBoxInput = React.forwardRef((props, forwardedRef) => {
|
|
37
|
-
const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, ...rest } = props;
|
|
37
|
+
const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, style, ...rest } = props;
|
|
38
38
|
const { isOpen, id, focusedIndex, enableVirtualization, multiple, onClickHandler, } = (0, index_js_2.useSafeContext)(helpers_js_1.ComboBoxStateContext);
|
|
39
39
|
const dispatch = (0, index_js_2.useSafeContext)(helpers_js_1.ComboBoxActionContext);
|
|
40
40
|
const { inputRef, menuRef, optionsExtraInfoRef } = (0, index_js_2.useSafeContext)(helpers_js_1.ComboBoxRefsContext);
|
|
@@ -159,7 +159,10 @@ exports.ComboBoxInput = React.forwardRef((props, forwardedRef) => {
|
|
|
159
159
|
return (React.createElement(React.Fragment, null,
|
|
160
160
|
React.createElement(index_js_1.Input, { ref: refs, onKeyDown: handleKeyDown, onClick: (0, index_js_2.mergeEventHandlers)(onClickProp, handleClick), onFocus: handleFocus, "aria-activedescendant": isOpen && focusedIndex != undefined && focusedIndex > -1
|
|
161
161
|
? getIdFromIndex(focusedIndex)
|
|
162
|
-
: undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style:
|
|
162
|
+
: undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style: {
|
|
163
|
+
...(multiple && { paddingInlineStart: tagContainerWidth + 18 }),
|
|
164
|
+
...style,
|
|
165
|
+
}, "aria-describedby": multiple ? `${id}-selected-live` : undefined, ...rest }),
|
|
163
166
|
multiple && selectTags ? (React.createElement(ComboBoxMultipleContainer_js_1.ComboBoxMultipleContainer, { ref: tagContainerWidthRef, selectedItems: selectTags, id: `${id}-selected-live` })) : null));
|
|
164
167
|
});
|
|
165
168
|
exports.ComboBoxInput.displayName = 'ComboBoxInput';
|
|
@@ -64,7 +64,6 @@ exports.DialogMain = React.forwardRef((props, ref) => {
|
|
|
64
64
|
(0, index_js_1.useTheme)();
|
|
65
65
|
const [style, setStyle] = React.useState();
|
|
66
66
|
const dialogRef = React.useRef(null);
|
|
67
|
-
const [dialogElement, setDialogElement] = React.useState();
|
|
68
67
|
const hasBeenResized = React.useRef(false);
|
|
69
68
|
const previousFocusedElement = React.useRef();
|
|
70
69
|
const originalBodyOverflow = React.useRef('');
|
|
@@ -137,17 +136,13 @@ exports.DialogMain = React.forwardRef((props, ref) => {
|
|
|
137
136
|
...newStyle,
|
|
138
137
|
}));
|
|
139
138
|
}, []);
|
|
140
|
-
const roundedTransform = useRoundedTransform({
|
|
141
|
-
element: dialogElement,
|
|
142
|
-
transform,
|
|
143
|
-
});
|
|
144
139
|
const content = (React.createElement("div", { className: (0, classnames_1.default)('iui-dialog', {
|
|
145
140
|
'iui-dialog-default': styleType === 'default',
|
|
146
141
|
'iui-dialog-full-page': styleType === 'fullPage',
|
|
147
142
|
'iui-dialog-visible': isOpen,
|
|
148
143
|
'iui-dialog-draggable': isDraggable,
|
|
149
|
-
}, className), role: 'dialog', ref: (0, index_js_1.useMergedRefs)(dialogRef, ref
|
|
150
|
-
transform: styleType !== 'fullPage' ?
|
|
144
|
+
}, className), role: 'dialog', ref: (0, index_js_1.useMergedRefs)(dialogRef, ref), onKeyDown: handleKeyDown, tabIndex: -1, "data-iui-placement": placement, style: {
|
|
145
|
+
transform: styleType !== 'fullPage' ? transform : undefined,
|
|
151
146
|
...style,
|
|
152
147
|
...propStyle,
|
|
153
148
|
}, ...rest },
|
|
@@ -180,20 +175,3 @@ exports.DialogMain = React.forwardRef((props, ref) => {
|
|
|
180
175
|
!trapFocus && content)));
|
|
181
176
|
});
|
|
182
177
|
exports.default = exports.DialogMain;
|
|
183
|
-
// ----------------------------------------------------------------------------
|
|
184
|
-
/**
|
|
185
|
-
* Rounds off an element's transform value based on the device's pixel grid, to avoid blurring.
|
|
186
|
-
*/
|
|
187
|
-
const useRoundedTransform = ({ element, transform, }) => {
|
|
188
|
-
const [roundedStyles, setRoundedStyles] = React.useState(transform);
|
|
189
|
-
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
190
|
-
if (!element || typeof DOMMatrix === 'undefined') {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const [x, y] = transform
|
|
194
|
-
? (0, index_js_1.getTranslateValues)(transform)
|
|
195
|
-
: (0, index_js_1.getTranslateValuesFromElement)(element);
|
|
196
|
-
setRoundedStyles(`translate(${(0, index_js_1.roundByDPR)(x)}px, ${(0, index_js_1.roundByDPR)(y)}px)`);
|
|
197
|
-
}, [element, transform]);
|
|
198
|
-
return roundedStyles;
|
|
199
|
-
};
|