@momentum-design/components 0.120.9 → 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 +1990 -1906
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +5 -5
- 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';
|
@@ -28,10 +28,10 @@ export { default as Divider } from './divider';
|
|
28
28
|
export { default as FilterChip } from './filterchip';
|
29
29
|
export { default as FormfieldGroup } from './formfieldgroup';
|
30
30
|
export { default as FormfieldWrapper } from './formfieldwrapper';
|
31
|
+
export { default as Icon } from './icon';
|
31
32
|
export { default as IconProvider } from './iconprovider';
|
32
33
|
export { default as Illustration } from './illustration';
|
33
34
|
export { default as IllustrationProvider } from './illustrationprovider';
|
34
|
-
export { default as Icon } from './icon';
|
35
35
|
export { default as Input } from './input';
|
36
36
|
export { default as InputChip } from './inputchip';
|
37
37
|
export { default as Link } from './link';
|
@@ -57,14 +57,14 @@ export { default as Presence } from './presence';
|
|
57
57
|
export { default as Progressbar } from './progressbar';
|
58
58
|
export { default as Progressspinner } from './progressspinner';
|
59
59
|
export { default as Radio } from './radio';
|
60
|
-
export { default as Searchfield } from './searchfield';
|
61
|
-
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
62
60
|
export { default as RadioGroup } from './radiogroup';
|
61
|
+
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
62
|
+
export { default as Searchfield } from './searchfield';
|
63
63
|
export { default as Select } from './select';
|
64
64
|
export { default as Selectlistbox } from './selectlistbox';
|
65
|
+
export { default as SideNavigation } from './sidenavigation';
|
65
66
|
export { default as Skeleton } from './skeleton';
|
66
67
|
export { default as Slider } from './slider';
|
67
|
-
export { default as SideNavigation } from './sidenavigation';
|
68
68
|
export { default as Spinner } from './spinner';
|
69
69
|
export { default as StaticCheckbox } from './staticcheckbox';
|
70
70
|
export { default as StaticChip } from './staticchip';
|
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';
|
@@ -28,10 +28,10 @@ export { default as Divider } from './divider';
|
|
28
28
|
export { default as FilterChip } from './filterchip';
|
29
29
|
export { default as FormfieldGroup } from './formfieldgroup';
|
30
30
|
export { default as FormfieldWrapper } from './formfieldwrapper';
|
31
|
+
export { default as Icon } from './icon';
|
31
32
|
export { default as IconProvider } from './iconprovider';
|
32
33
|
export { default as Illustration } from './illustration';
|
33
34
|
export { default as IllustrationProvider } from './illustrationprovider';
|
34
|
-
export { default as Icon } from './icon';
|
35
35
|
export { default as Input } from './input';
|
36
36
|
export { default as InputChip } from './inputchip';
|
37
37
|
export { default as Link } from './link';
|
@@ -57,14 +57,14 @@ export { default as Presence } from './presence';
|
|
57
57
|
export { default as Progressbar } from './progressbar';
|
58
58
|
export { default as Progressspinner } from './progressspinner';
|
59
59
|
export { default as Radio } from './radio';
|
60
|
-
export { default as Searchfield } from './searchfield';
|
61
|
-
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
62
60
|
export { default as RadioGroup } from './radiogroup';
|
61
|
+
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
62
|
+
export { default as Searchfield } from './searchfield';
|
63
63
|
export { default as Select } from './select';
|
64
64
|
export { default as Selectlistbox } from './selectlistbox';
|
65
|
+
export { default as SideNavigation } from './sidenavigation';
|
65
66
|
export { default as Skeleton } from './skeleton';
|
66
67
|
export { default as Slider } from './slider';
|
67
|
-
export { default as SideNavigation } from './sidenavigation';
|
68
68
|
export { default as Spinner } from './spinner';
|
69
69
|
export { default as StaticCheckbox } from './staticcheckbox';
|
70
70
|
export { default as StaticChip } from './staticchip';
|
@@ -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));
|