@momentum-design/components 0.120.8 → 0.120.10
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/browser/index.js +3 -3
- package/dist/browser/index.js.map +3 -3
- package/dist/components/listitem/listitem.component.d.ts +4 -1
- package/dist/components/listitem/listitem.component.js +14 -3
- package/dist/components/menuitem/menuitem.component.js +2 -2
- package/dist/custom-elements.json +503 -419
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/utils/mixins/ListNavigationMixin.js +10 -2
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
@@ -3,9 +3,9 @@ export { default as AccordionButton } from './accordionbutton';
|
|
3
3
|
export { default as AccordionGroup } from './accordiongroup';
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
|
-
export { default as AnnouncementDialog } from './announcementdialog';
|
7
6
|
export { default as Appheader } from './appheader';
|
8
7
|
export { default as Avatar } from './avatar';
|
8
|
+
export { default as AnnouncementDialog } from './announcementdialog';
|
9
9
|
export { default as AvatarButton } from './avatarbutton';
|
10
10
|
export { default as Badge } from './badge';
|
11
11
|
export { default as Banner } from './banner';
|
@@ -70,8 +70,8 @@ export { default as StaticCheckbox } from './staticcheckbox';
|
|
70
70
|
export { default as StaticChip } from './staticchip';
|
71
71
|
export { default as StaticRadio } from './staticradio';
|
72
72
|
export { default as StaticToggle } from './statictoggle';
|
73
|
-
export { default as StepperConnector } from './stepperconnector';
|
74
73
|
export { default as Stepper } from './stepper';
|
74
|
+
export { default as StepperConnector } from './stepperconnector';
|
75
75
|
export { default as StepperItem } from './stepperitem';
|
76
76
|
export { default as Tab } from './tab';
|
77
77
|
export { default as TabList } from './tablist';
|
package/dist/react/index.js
CHANGED
@@ -3,9 +3,9 @@ export { default as AccordionButton } from './accordionbutton';
|
|
3
3
|
export { default as AccordionGroup } from './accordiongroup';
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
|
-
export { default as AnnouncementDialog } from './announcementdialog';
|
7
6
|
export { default as Appheader } from './appheader';
|
8
7
|
export { default as Avatar } from './avatar';
|
8
|
+
export { default as AnnouncementDialog } from './announcementdialog';
|
9
9
|
export { default as AvatarButton } from './avatarbutton';
|
10
10
|
export { default as Badge } from './badge';
|
11
11
|
export { default as Banner } from './banner';
|
@@ -70,8 +70,8 @@ export { default as StaticCheckbox } from './staticcheckbox';
|
|
70
70
|
export { default as StaticChip } from './staticchip';
|
71
71
|
export { default as StaticRadio } from './staticradio';
|
72
72
|
export { default as StaticToggle } from './statictoggle';
|
73
|
-
export { default as StepperConnector } from './stepperconnector';
|
74
73
|
export { default as Stepper } from './stepper';
|
74
|
+
export { default as StepperConnector } from './stepperconnector';
|
75
75
|
export { default as StepperItem } from './stepperitem';
|
76
76
|
export { default as Tab } from './tab';
|
77
77
|
export { default as TabList } from './tablist';
|
@@ -113,8 +113,14 @@ export const ListNavigationMixin = (superClass) => {
|
|
113
113
|
* @internal
|
114
114
|
*/
|
115
115
|
this.handleNavigationClick = (event) => {
|
116
|
-
const
|
117
|
-
this.
|
116
|
+
const target = event.target;
|
117
|
+
const newIndex = this.getCurrentIndex(target);
|
118
|
+
if (newIndex !== -1) {
|
119
|
+
// When user clicked on a focusable element inside the item, we update the navigation index, but
|
120
|
+
// keep the focus on the clicked element.
|
121
|
+
const focusNewItem = !(this.navItems[newIndex] !== target && document.activeElement === event.target);
|
122
|
+
this.resetTabIndexAndSetFocus(newIndex, undefined, focusNewItem);
|
123
|
+
}
|
118
124
|
};
|
119
125
|
this.addEventListener('keydown', this.handleNavigationKeyDown);
|
120
126
|
this.addEventListener('click', this.handleNavigationClick);
|
@@ -136,6 +142,8 @@ export const ListNavigationMixin = (superClass) => {
|
|
136
142
|
* @returns - The index of the current item in the `navItems` array.
|
137
143
|
*/
|
138
144
|
getCurrentIndex(target) {
|
145
|
+
if (!target)
|
146
|
+
return -1;
|
139
147
|
return this.navItems.findIndex(node => node === target ||
|
140
148
|
// eslint-disable-next-line no-bitwise
|
141
149
|
!!(node.compareDocumentPosition(target) & Node.DOCUMENT_POSITION_CONTAINED_BY));
|