@itwin/itwinui-react 2.12.18 → 2.12.20

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.12.20
4
+
5
+ ### Patch Changes
6
+
7
+ - 9f1f3cff: Fixed `ComboBox` to correctly merge `inputProps.style` with internal styles.
8
+
9
+ ## 2.12.19
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1765](https://github.com/iTwin/iTwinUI/pull/1765): Fixed full page `Modal` not showing up.
14
+ - [#1764](https://github.com/iTwin/iTwinUI/pull/1764): Fixed submenu items being unreachable in popout windows.
15
+
3
16
  ## 2.12.18
4
17
 
5
18
  ### Patch Changes
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright © 2021-2023 Bentley Systems, Incorporated. All rights reserved.
3
+ Copyright © 2021-2024 Bentley Systems, Incorporated. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -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: multiple ? { paddingLeft: tagContainerWidth + 18 } : {}, "aria-describedby": multiple ? `${id}-selected-live` : undefined, ...rest }),
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';
@@ -147,7 +147,7 @@ exports.DialogMain = React.forwardRef((props, ref) => {
147
147
  'iui-dialog-visible': isOpen,
148
148
  'iui-dialog-draggable': isDraggable,
149
149
  }, className), role: 'dialog', ref: (0, index_js_1.useMergedRefs)(dialogRef, ref, setDialogElement), onKeyDown: handleKeyDown, tabIndex: -1, "data-iui-placement": placement, style: {
150
- transform: roundedTransform,
150
+ transform: styleType !== 'fullPage' ? roundedTransform : undefined,
151
151
  ...style,
152
152
  ...propStyle,
153
153
  }, ...rest },
@@ -85,10 +85,12 @@ exports.MenuItem = React.forwardRef((props, ref) => {
85
85
  'iui-disabled': disabled,
86
86
  }, className), onClick: () => !disabled && (onClick === null || onClick === void 0 ? void 0 : onClick(value)), ref: refs, style: style, role: role, tabIndex: disabled || role === 'presentation' ? undefined : -1, "aria-selected": isSelected, "aria-haspopup": subMenuItems.length > 0, "aria-disabled": disabled, onKeyDown: onKeyDown, onMouseEnter: () => setIsSubmenuVisible(true), onMouseLeave: (e) => {
87
87
  var _a;
88
- if (!(e.relatedTarget instanceof Node) ||
89
- !((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
90
- setIsSubmenuVisible(false);
88
+ try {
89
+ if (!((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
90
+ setIsSubmenuVisible(false);
91
+ }
91
92
  }
93
+ catch (_b) { }
92
94
  }, ...rest },
93
95
  icon &&
94
96
  React.cloneElement(icon, {
@@ -8,7 +8,7 @@ import { useSafeContext, useMergedRefs, useContainerWidth, mergeEventHandlers, }
8
8
  import { ComboBoxMultipleContainer } from './ComboBoxMultipleContainer.js';
9
9
  import { ComboBoxStateContext, ComboBoxActionContext, ComboBoxRefsContext, } from './helpers.js';
10
10
  export const ComboBoxInput = React.forwardRef((props, forwardedRef) => {
11
- const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, ...rest } = props;
11
+ const { onKeyDown: onKeyDownProp, onFocus: onFocusProp, onClick: onClickProp, selectTags, style, ...rest } = props;
12
12
  const { isOpen, id, focusedIndex, enableVirtualization, multiple, onClickHandler, } = useSafeContext(ComboBoxStateContext);
13
13
  const dispatch = useSafeContext(ComboBoxActionContext);
14
14
  const { inputRef, menuRef, optionsExtraInfoRef } = useSafeContext(ComboBoxRefsContext);
@@ -133,7 +133,10 @@ export const ComboBoxInput = React.forwardRef((props, forwardedRef) => {
133
133
  return (React.createElement(React.Fragment, null,
134
134
  React.createElement(Input, { ref: refs, onKeyDown: handleKeyDown, onClick: mergeEventHandlers(onClickProp, handleClick), onFocus: handleFocus, "aria-activedescendant": isOpen && focusedIndex != undefined && focusedIndex > -1
135
135
  ? getIdFromIndex(focusedIndex)
136
- : undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style: multiple ? { paddingLeft: tagContainerWidth + 18 } : {}, "aria-describedby": multiple ? `${id}-selected-live` : undefined, ...rest }),
136
+ : undefined, role: 'combobox', "aria-controls": isOpen ? `${id}-list` : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off', style: {
137
+ ...(multiple && { paddingInlineStart: tagContainerWidth + 18 }),
138
+ ...style,
139
+ }, "aria-describedby": multiple ? `${id}-selected-live` : undefined, ...rest }),
137
140
  multiple && selectTags ? (React.createElement(ComboBoxMultipleContainer, { ref: tagContainerWidthRef, selectedItems: selectTags, id: `${id}-selected-live` })) : null));
138
141
  });
139
142
  ComboBoxInput.displayName = 'ComboBoxInput';
@@ -118,7 +118,7 @@ export const DialogMain = React.forwardRef((props, ref) => {
118
118
  'iui-dialog-visible': isOpen,
119
119
  'iui-dialog-draggable': isDraggable,
120
120
  }, className), role: 'dialog', ref: useMergedRefs(dialogRef, ref, setDialogElement), onKeyDown: handleKeyDown, tabIndex: -1, "data-iui-placement": placement, style: {
121
- transform: roundedTransform,
121
+ transform: styleType !== 'fullPage' ? roundedTransform : undefined,
122
122
  ...style,
123
123
  ...propStyle,
124
124
  }, ...rest },
@@ -56,10 +56,12 @@ export const MenuItem = React.forwardRef((props, ref) => {
56
56
  'iui-disabled': disabled,
57
57
  }, className), onClick: () => !disabled && (onClick === null || onClick === void 0 ? void 0 : onClick(value)), ref: refs, style: style, role: role, tabIndex: disabled || role === 'presentation' ? undefined : -1, "aria-selected": isSelected, "aria-haspopup": subMenuItems.length > 0, "aria-disabled": disabled, onKeyDown: onKeyDown, onMouseEnter: () => setIsSubmenuVisible(true), onMouseLeave: (e) => {
58
58
  var _a;
59
- if (!(e.relatedTarget instanceof Node) ||
60
- !((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
61
- setIsSubmenuVisible(false);
59
+ try {
60
+ if (!((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
61
+ setIsSubmenuVisible(false);
62
+ }
62
63
  }
64
+ catch (_b) { }
63
65
  }, ...rest },
64
66
  icon &&
65
67
  React.cloneElement(icon, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-react",
3
- "version": "2.12.18",
3
+ "version": "2.12.20",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "cjs/index.js",