@momentum-design/components 0.80.2 → 0.80.4
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 +18 -18
- package/dist/browser/index.js.map +2 -2
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/menupopover/menupopover.component.js +1 -0
- package/dist/custom-elements.json +1206 -1274
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/utils/mixins/MenuMixin.js +6 -19
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as AlertChip } from './alertchip';
|
2
|
-
export { default as Animation } from './animation';
|
3
2
|
export { default as Appheader } from './appheader';
|
3
|
+
export { default as Animation } from './animation';
|
4
4
|
export { default as Avatar } from './avatar';
|
5
5
|
export { default as AvatarButton } from './avatarbutton';
|
6
6
|
export { default as Badge } from './badge';
|
@@ -44,10 +44,10 @@ export { default as Popover } from './popover';
|
|
44
44
|
export { default as Presence } from './presence';
|
45
45
|
export { default as Progressbar } from './progressbar';
|
46
46
|
export { default as Progressspinner } from './progressspinner';
|
47
|
+
export { default as Radio } from './radio';
|
47
48
|
export { default as RadioGroup } from './radiogroup';
|
48
49
|
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
49
50
|
export { default as Searchfield } from './searchfield';
|
50
|
-
export { default as Radio } from './radio';
|
51
51
|
export { default as Select } from './select';
|
52
52
|
export { default as Spinner } from './spinner';
|
53
53
|
export { default as StaticCheckbox } from './staticcheckbox';
|
package/dist/react/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { default as AlertChip } from './alertchip';
|
2
|
-
export { default as Animation } from './animation';
|
3
2
|
export { default as Appheader } from './appheader';
|
3
|
+
export { default as Animation } from './animation';
|
4
4
|
export { default as Avatar } from './avatar';
|
5
5
|
export { default as AvatarButton } from './avatarbutton';
|
6
6
|
export { default as Badge } from './badge';
|
@@ -44,10 +44,10 @@ export { default as Popover } from './popover';
|
|
44
44
|
export { default as Presence } from './presence';
|
45
45
|
export { default as Progressbar } from './progressbar';
|
46
46
|
export { default as Progressspinner } from './progressspinner';
|
47
|
+
export { default as Radio } from './radio';
|
47
48
|
export { default as RadioGroup } from './radiogroup';
|
48
49
|
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
49
50
|
export { default as Searchfield } from './searchfield';
|
50
|
-
export { default as Radio } from './radio';
|
51
51
|
export { default as Select } from './select';
|
52
52
|
export { default as Spinner } from './spinner';
|
53
53
|
export { default as StaticCheckbox } from './staticcheckbox';
|
@@ -187,6 +187,9 @@ export const MenuMixin = (superClass) => {
|
|
187
187
|
*/
|
188
188
|
getParentMenuItemDetails(menuChildId, menu) {
|
189
189
|
var _a, _b;
|
190
|
+
if (menu === null) {
|
191
|
+
return { menu: null, menuChildId };
|
192
|
+
}
|
190
193
|
if (menu && this.isValidMenu(menu.tagName)) {
|
191
194
|
return { menu, menuChildId };
|
192
195
|
}
|
@@ -254,21 +257,6 @@ export const MenuMixin = (superClass) => {
|
|
254
257
|
const parentMenuItemsChildren = Array.from(((_a = parentMenuItemDetails.menu) === null || _a === void 0 ? void 0 : _a.children) || []).filter((node) => this.isValidMenuItem(node));
|
255
258
|
return { parentMenuItemDetails, parentMenuItemsChildren };
|
256
259
|
}
|
257
|
-
/**
|
258
|
-
* Sets focus to the parent menu item of the given current menu item.
|
259
|
-
* It retrieves the parent menu item details and its children, then focuses
|
260
|
-
* on the menu item that matches the parent menu child ID.
|
261
|
-
* @param currentMenuItem - The current menu item from which to find and focus the parent menu item.
|
262
|
-
*/
|
263
|
-
setFocusToParentMenuItem(currentMenuItem) {
|
264
|
-
var _a;
|
265
|
-
const { parentMenuItemDetails, parentMenuItemsChildren, } = this.getParentMenuContents(currentMenuItem);
|
266
|
-
// Only proceed if menuChildId is non-empty
|
267
|
-
if (parentMenuItemDetails === null || parentMenuItemDetails === void 0 ? void 0 : parentMenuItemDetails.menuChildId) {
|
268
|
-
const menuBarMenuItem = parentMenuItemsChildren.filter((node) => node.getAttribute('id') === parentMenuItemDetails.menuChildId);
|
269
|
-
(_a = menuBarMenuItem[0]) === null || _a === void 0 ? void 0 : _a.focus();
|
270
|
-
}
|
271
|
-
}
|
272
260
|
/**
|
273
261
|
* Opens the popover of the next children menu item if there are children.
|
274
262
|
* If there are no children, then it closes all popovers recursively and
|
@@ -407,7 +395,6 @@ export const MenuMixin = (superClass) => {
|
|
407
395
|
}
|
408
396
|
else if (this.isValidMenuItem(event.target)) {
|
409
397
|
this.setMenuBarPopoverValue(false);
|
410
|
-
this.setFocusToParentMenuItem(this.menuItems[currentIndex]);
|
411
398
|
}
|
412
399
|
break;
|
413
400
|
}
|
@@ -439,17 +426,17 @@ export const MenuMixin = (superClass) => {
|
|
439
426
|
* @param event - The mouse click event.
|
440
427
|
*/
|
441
428
|
handleMouseClick(event) {
|
442
|
-
var _a
|
429
|
+
var _a;
|
443
430
|
const target = event.target;
|
444
431
|
const currentIndex = this.getCurrentIndex(target);
|
445
432
|
if (currentIndex === -1)
|
446
433
|
return;
|
447
|
-
if (this.isValidPopover((
|
434
|
+
if (this.isValidPopover((_a = target === null || target === void 0 ? void 0 : target.nextElementSibling) === null || _a === void 0 ? void 0 : _a.tagName)) {
|
448
435
|
this.closeAllPopoversExceptCurrent(currentIndex);
|
449
436
|
this.openPopoverAndNavigateToNextChildrenMenuItem(currentIndex);
|
450
437
|
}
|
451
438
|
else if (this.isValidMenuItem(target)) {
|
452
|
-
|
439
|
+
target.parentElement.hidePopover();
|
453
440
|
}
|
454
441
|
}
|
455
442
|
}
|
package/package.json
CHANGED