react-magma-dom 4.2.0-next.0 → 4.2.0-next.1
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/dist/esm/index.js +37 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/react-magma-dom.cjs.development.js +37 -5
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -9200,6 +9200,7 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
9200
9200
|
}
|
|
9201
9201
|
} else {
|
|
9202
9202
|
if (event.key === 'Escape') {
|
|
9203
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
9203
9204
|
setCalendarOpened(false);
|
|
9204
9205
|
iconRef.current.focus();
|
|
9205
9206
|
}
|
|
@@ -9412,6 +9413,7 @@ var Dropdown = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
9412
9413
|
}
|
|
9413
9414
|
function handleKeyDown(event) {
|
|
9414
9415
|
if (event.key === 'Escape') {
|
|
9416
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
9415
9417
|
closeDropdown(event);
|
|
9416
9418
|
}
|
|
9417
9419
|
if (event.key === 'ArrowDown') {
|
|
@@ -20184,10 +20186,16 @@ function ItemsList(props) {
|
|
|
20184
20186
|
}
|
|
20185
20187
|
}), ' ', i18n.combobox.loading);
|
|
20186
20188
|
};
|
|
20189
|
+
function handleEscape(event) {
|
|
20190
|
+
if (event.key === 'Escape') {
|
|
20191
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
20192
|
+
}
|
|
20193
|
+
}
|
|
20187
20194
|
return React__default.createElement(StyledCard$1, {
|
|
20188
20195
|
hasDropShadow: true,
|
|
20189
20196
|
isInverse: isInverse,
|
|
20190
20197
|
isOpen: isOpen,
|
|
20198
|
+
onKeyDown: handleEscape,
|
|
20191
20199
|
style: menuStyle,
|
|
20192
20200
|
theme: theme
|
|
20193
20201
|
}, React__default.createElement(StyledList$1, Object.assign({
|
|
@@ -21014,7 +21022,7 @@ function InternalCombobox(props) {
|
|
|
21014
21022
|
getToggleButtonProps = _useCombobox.getToggleButtonProps,
|
|
21015
21023
|
getLabelProps = _useCombobox.getLabelProps,
|
|
21016
21024
|
getMenuProps = _useCombobox.getMenuProps,
|
|
21017
|
-
|
|
21025
|
+
_getInputProps = _useCombobox.getInputProps,
|
|
21018
21026
|
getComboboxProps = _useCombobox.getComboboxProps,
|
|
21019
21027
|
highlightedIndex = _useCombobox.highlightedIndex,
|
|
21020
21028
|
getItemProps = _useCombobox.getItemProps,
|
|
@@ -21035,6 +21043,16 @@ function InternalCombobox(props) {
|
|
|
21035
21043
|
reset();
|
|
21036
21044
|
}
|
|
21037
21045
|
var clearIndicatorAriaLabel = i18n.combobox.clearIndicatorAriaLabel.replace(/\{labelText\}/g, labelText).replace(/\{selectedItem\}/g, itemToString(selectedItem));
|
|
21046
|
+
function handleOnKeyDown(event) {
|
|
21047
|
+
var count = document.querySelectorAll('[aria-modal="true"]').length;
|
|
21048
|
+
if (event.key === 'Escape') {
|
|
21049
|
+
if (count >= 1 && inputRef.current) {
|
|
21050
|
+
inputRef.current.focus();
|
|
21051
|
+
}
|
|
21052
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
21053
|
+
}
|
|
21054
|
+
onInputKeyDown && typeof onInputKeyDown === 'function' && onInputKeyDown(event);
|
|
21055
|
+
}
|
|
21038
21056
|
return createElement(SelectContainer, {
|
|
21039
21057
|
descriptionId: ariaDescribedBy,
|
|
21040
21058
|
errorMessage: errorMessage,
|
|
@@ -21053,7 +21071,11 @@ function InternalCombobox(props) {
|
|
|
21053
21071
|
customComponents: customComponents,
|
|
21054
21072
|
disabled: disabled,
|
|
21055
21073
|
getComboboxProps: getComboboxProps,
|
|
21056
|
-
getInputProps: getInputProps
|
|
21074
|
+
getInputProps: function getInputProps(options) {
|
|
21075
|
+
return _extends({}, _getInputProps(_extends({}, options, getComboboxProps(_extends({
|
|
21076
|
+
onKeyDown: handleOnKeyDown
|
|
21077
|
+
}, innerRef)))));
|
|
21078
|
+
},
|
|
21057
21079
|
getToggleButtonProps: getToggleButtonProps,
|
|
21058
21080
|
hasError: hasError,
|
|
21059
21081
|
innerRef: ref,
|
|
@@ -21063,7 +21085,7 @@ function InternalCombobox(props) {
|
|
|
21063
21085
|
isTypeahead: isTypeahead,
|
|
21064
21086
|
onInputBlur: onInputBlur,
|
|
21065
21087
|
onInputFocus: onInputFocus,
|
|
21066
|
-
onInputKeyDown:
|
|
21088
|
+
onInputKeyDown: handleOnKeyDown,
|
|
21067
21089
|
onInputKeyPress: onInputKeyPress,
|
|
21068
21090
|
onInputKeyUp: onInputKeyUp,
|
|
21069
21091
|
placeholder: placeholder,
|
|
@@ -21322,6 +21344,16 @@ function MultiCombobox(props) {
|
|
|
21322
21344
|
size: theme.iconSizes.xSmall
|
|
21323
21345
|
})));
|
|
21324
21346
|
})) : null;
|
|
21347
|
+
function handleOnKeyDown(event) {
|
|
21348
|
+
var count = document.querySelectorAll('[aria-modal="true"]').length;
|
|
21349
|
+
if (event.key === 'Escape') {
|
|
21350
|
+
if (count >= 1 && inputRef.current) {
|
|
21351
|
+
inputRef.current.focus();
|
|
21352
|
+
}
|
|
21353
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
21354
|
+
}
|
|
21355
|
+
onInputKeyDown && typeof onInputKeyDown === 'function' && onInputKeyDown(event);
|
|
21356
|
+
}
|
|
21325
21357
|
return createElement(SelectContainer, {
|
|
21326
21358
|
descriptionId: ariaDescribedBy,
|
|
21327
21359
|
errorMessage: errorMessage,
|
|
@@ -21341,7 +21373,7 @@ function MultiCombobox(props) {
|
|
|
21341
21373
|
getComboboxProps: getComboboxProps,
|
|
21342
21374
|
getInputProps: function getInputProps(options) {
|
|
21343
21375
|
return _extends({}, _getInputProps(_extends({}, options, getDropdownProps(_extends({
|
|
21344
|
-
onKeyDown:
|
|
21376
|
+
onKeyDown: handleOnKeyDown
|
|
21345
21377
|
}, innerRef && {
|
|
21346
21378
|
ref: innerRef
|
|
21347
21379
|
})))));
|
|
@@ -21356,7 +21388,7 @@ function MultiCombobox(props) {
|
|
|
21356
21388
|
innerRef: ref,
|
|
21357
21389
|
onInputBlur: onInputBlur,
|
|
21358
21390
|
onInputFocus: handleInputFocus,
|
|
21359
|
-
onInputKeyDown:
|
|
21391
|
+
onInputKeyDown: handleOnKeyDown,
|
|
21360
21392
|
onInputKeyPress: onInputKeyPress,
|
|
21361
21393
|
onInputKeyUp: onInputKeyUp,
|
|
21362
21394
|
placeholder: selectedItems.length > 0 ? null : placeholder,
|