@momentum-design/components 0.122.12 → 0.122.13
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 +2 -2
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +2 -2
- package/dist/components/menuitemradio/menuitemradio.component.d.ts +1 -0
- package/dist/components/menuitemradio/menuitemradio.component.js +2 -1
- package/dist/components/menupopover/menupopover.component.js +3 -3
- package/dist/custom-elements.json +2 -2
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ declare class MenuItemCheckbox extends MenuItemCheckbox_base {
|
|
|
70
70
|
connectedCallback(): void;
|
|
71
71
|
/**
|
|
72
72
|
* Handles click events to toggle checked state
|
|
73
|
-
* If the menuitemcheckbox is disabled, it does nothing.
|
|
73
|
+
* If the menuitemcheckbox is disabled or soft-disabled, it does nothing.
|
|
74
74
|
* If the menuitemcheckbox is not disabled, it toggles checked if uncontrolled, and dispatches the 'change' event.
|
|
75
75
|
*/
|
|
76
76
|
private handleMouseClick;
|
|
@@ -91,11 +91,11 @@ class MenuItemCheckbox extends ControlTypeMixin(MenuItem) {
|
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Handles click events to toggle checked state
|
|
94
|
-
* If the menuitemcheckbox is disabled, it does nothing.
|
|
94
|
+
* If the menuitemcheckbox is disabled or soft-disabled, it does nothing.
|
|
95
95
|
* If the menuitemcheckbox is not disabled, it toggles checked if uncontrolled, and dispatches the 'change' event.
|
|
96
96
|
*/
|
|
97
97
|
handleMouseClick() {
|
|
98
|
-
if (this.disabled)
|
|
98
|
+
if (this.disabled || this.softDisabled)
|
|
99
99
|
return;
|
|
100
100
|
if (this.controlType !== 'controlled') {
|
|
101
101
|
this.checked = !this.checked;
|
|
@@ -82,6 +82,7 @@ declare class MenuItemRadio extends MenuItemRadio_base {
|
|
|
82
82
|
private updateOtherRadiosCheckedState;
|
|
83
83
|
/**
|
|
84
84
|
* Handles click events to set checked state and uncheck siblings in the same group and container.
|
|
85
|
+
* If the menuitemradio is disabled, soft-disabled, or already checked, it does nothing.
|
|
85
86
|
* If the menuitemradio is not checked, it sets its checked state to `true`
|
|
86
87
|
* and sets all other menuitemradio elements of the same group with checked state to `false`.
|
|
87
88
|
*/
|
|
@@ -116,11 +116,12 @@ class MenuItemRadio extends ControlTypeMixin(MenuItem) {
|
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* Handles click events to set checked state and uncheck siblings in the same group and container.
|
|
119
|
+
* If the menuitemradio is disabled, soft-disabled, or already checked, it does nothing.
|
|
119
120
|
* If the menuitemradio is not checked, it sets its checked state to `true`
|
|
120
121
|
* and sets all other menuitemradio elements of the same group with checked state to `false`.
|
|
121
122
|
*/
|
|
122
123
|
handleMouseClick() {
|
|
123
|
-
if (this.disabled || this.checked)
|
|
124
|
+
if (this.disabled || this.softDisabled || this.checked)
|
|
124
125
|
return;
|
|
125
126
|
if (this.controlType !== 'controlled') {
|
|
126
127
|
this.updateOtherRadiosCheckedState();
|
|
@@ -226,7 +226,7 @@ class MenuPopover extends Popover {
|
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
case KEYS.ENTER: {
|
|
229
|
-
if (!this.getSubMenuPopoverOfTarget(target)) {
|
|
229
|
+
if (!this.getSubMenuPopoverOfTarget(target) && !target.hasAttribute('soft-disabled')) {
|
|
230
230
|
this.closeAllMenuPopovers();
|
|
231
231
|
this.fireMenuItemAction(target);
|
|
232
232
|
isKeyHandled = true;
|
|
@@ -267,7 +267,7 @@ class MenuPopover extends Popover {
|
|
|
267
267
|
switch (event.key) {
|
|
268
268
|
case KEYS.SPACE: {
|
|
269
269
|
// If the target is a menu item, trigger its click event
|
|
270
|
-
if (!target.matches(`${MENUITEMRADIO_TAGNAME}, ${MENUITEMCHECKBOX_TAGNAME}`)) {
|
|
270
|
+
if (!target.matches(`${MENUITEMRADIO_TAGNAME}, ${MENUITEMCHECKBOX_TAGNAME}`) && !target.hasAttribute('soft-disabled')) {
|
|
271
271
|
// only close all menu popovers if the target is not opening a menu popover
|
|
272
272
|
if (!this.getSubMenuPopoverOfTarget(target)) {
|
|
273
273
|
this.closeAllMenuPopovers();
|
|
@@ -473,7 +473,7 @@ class MenuPopover extends Popover {
|
|
|
473
473
|
// if the target is not a valid menu item or if the event is not trusted (
|
|
474
474
|
// e.g., triggered by keydown originally), do nothing. Pressing space and enter
|
|
475
475
|
// is handled separately in the respective handler.
|
|
476
|
-
if (!isValidMenuItem(target) || !event.isTrusted)
|
|
476
|
+
if (!isValidMenuItem(target) || !event.isTrusted || target.hasAttribute('soft-disabled'))
|
|
477
477
|
return;
|
|
478
478
|
// If the target has a submenu, show it and close other submenus on the same level
|
|
479
479
|
if (this.getSubMenuPopoverOfTarget(target)) {
|
|
@@ -24915,7 +24915,7 @@
|
|
|
24915
24915
|
"kind": "method",
|
|
24916
24916
|
"name": "handleMouseClick",
|
|
24917
24917
|
"privacy": "private",
|
|
24918
|
-
"description": "Handles click events to toggle checked state\nIf the menuitemcheckbox is disabled, it does nothing.\nIf the menuitemcheckbox is not disabled, it toggles checked if uncontrolled, and dispatches the 'change' event."
|
|
24918
|
+
"description": "Handles click events to toggle checked state\nIf the menuitemcheckbox is disabled or soft-disabled, it does nothing.\nIf the menuitemcheckbox is not disabled, it toggles checked if uncontrolled, and dispatches the 'change' event."
|
|
24919
24919
|
},
|
|
24920
24920
|
{
|
|
24921
24921
|
"kind": "method",
|
|
@@ -25985,7 +25985,7 @@
|
|
|
25985
25985
|
"kind": "method",
|
|
25986
25986
|
"name": "handleMouseClick",
|
|
25987
25987
|
"privacy": "private",
|
|
25988
|
-
"description": "Handles click events to set checked state and uncheck siblings in the same group and container.\nIf the menuitemradio is not checked, it sets its checked state to `true`\nand sets all other menuitemradio elements of the same group with checked state to `false`."
|
|
25988
|
+
"description": "Handles click events to set checked state and uncheck siblings in the same group and container.\nIf the menuitemradio is disabled, soft-disabled, or already checked, it does nothing.\nIf the menuitemradio is not checked, it sets its checked state to `true`\nand sets all other menuitemradio elements of the same group with checked state to `false`."
|
|
25989
25989
|
},
|
|
25990
25990
|
{
|
|
25991
25991
|
"kind": "method",
|