@momentum-design/components 0.62.1 → 0.62.3
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 +145 -145
- package/dist/browser/index.js.map +4 -4
- package/dist/components/listitem/index.d.ts +1 -1
- package/dist/components/listitem/index.js +1 -1
- package/dist/components/listitem/listitem.component.d.ts +4 -4
- package/dist/components/listitem/listitem.component.js +2 -2
- package/dist/components/menuitem/index.d.ts +8 -0
- package/dist/components/menuitem/index.js +5 -0
- package/dist/components/menuitem/menuitem.component.d.ts +25 -0
- package/dist/components/menuitem/menuitem.component.js +29 -0
- package/dist/components/menuitem/menuitem.constants.d.ts +2 -0
- package/dist/components/menuitem/menuitem.constants.js +3 -0
- package/dist/components/menuitem/menuitem.types.d.ts +6 -0
- package/dist/components/menuitem/menuitem.types.js +1 -0
- package/dist/components/option/option.component.js +0 -4
- package/dist/custom-elements.json +1426 -1023
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/react/index.d.ts +4 -3
- package/dist/react/index.js +4 -3
- package/dist/react/menuitem/index.d.ts +27 -0
- package/dist/react/menuitem/index.js +35 -0
- package/package.json +1 -1
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { CSSResult, PropertyValues } from 'lit';
|
2
|
-
import { nothing
|
1
|
+
import type { CSSResult, PropertyValues, TemplateResult } from 'lit';
|
2
|
+
import { nothing } from 'lit';
|
3
3
|
import { Component } from '../../models';
|
4
|
-
import
|
4
|
+
import { TextType } from '../text/text.types';
|
5
5
|
import type { ListItemVariants } from './listitem.types';
|
6
|
-
declare const ListItem_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/
|
6
|
+
declare const ListItem_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DisabledMixin").DisabledMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/TabIndexMixin").TabIndexMixinInterface> & typeof Component;
|
7
7
|
/**
|
8
8
|
* mdc-listitem component is used to display a label with different types of controls.
|
9
9
|
* There can be three types of controls, a radio button, a checkbox on the
|
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { property, queryAssignedElements } from 'lit/decorators.js';
|
12
12
|
import { Component } from '../../models';
|
13
|
-
import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
14
13
|
import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
15
14
|
import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
|
16
15
|
import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
@@ -54,7 +53,7 @@ import styles from './listitem.styles';
|
|
54
53
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the listitem.
|
55
54
|
* @event focus - (React: onFocus) This event is dispatched when the listitem receives focus.
|
56
55
|
*/
|
57
|
-
class ListItem extends
|
56
|
+
class ListItem extends DisabledMixin(TabIndexMixin(Component)) {
|
58
57
|
constructor() {
|
59
58
|
super(...arguments);
|
60
59
|
/**
|
@@ -105,6 +104,7 @@ class ListItem extends DataAriaLabelMixin(DisabledMixin(TabIndexMixin(Component)
|
|
105
104
|
if (changedProperties.has('disabled')) {
|
106
105
|
this.tabIndex = this.disabled ? -1 : 0;
|
107
106
|
this.disableSlottedChildren(this.disabled);
|
107
|
+
this.setAttribute('aria-disabled', `${this.disabled}`);
|
108
108
|
}
|
109
109
|
}
|
110
110
|
render() {
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { CSSResult } from 'lit';
|
2
|
+
import ListItem from '../listitem/listitem.component';
|
3
|
+
/**
|
4
|
+
* menuitem component is inherited by listitem component with the role set `menuitem`.<br/>
|
5
|
+
* A menu item can contain an icon on the leading or trailing side.
|
6
|
+
*
|
7
|
+
* The leading and trailing slots can be used to display controls and text.<br/>
|
8
|
+
* Based on the leading/trailing slot, the position of the controls and text can be adjusted.
|
9
|
+
*
|
10
|
+
* Please use mdc-menu as a parent element even when there is only menuitem for a11y purpose.
|
11
|
+
*
|
12
|
+
* @dependency mdc-text
|
13
|
+
*
|
14
|
+
* @tagname mdc-menuitem
|
15
|
+
*
|
16
|
+
* @event click - (React: onClick) This event is dispatched when the menuitem is clicked.
|
17
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the menuitem.
|
18
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the menuitem.
|
19
|
+
* @event focus - (React: onFocus) This event is dispatched when the menuitem receives focus.
|
20
|
+
*/
|
21
|
+
declare class MenuItem extends ListItem {
|
22
|
+
connectedCallback(): void;
|
23
|
+
static styles: Array<CSSResult>;
|
24
|
+
}
|
25
|
+
export default MenuItem;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import ListItem from '../listitem/listitem.component';
|
2
|
+
import { LISTITEM_VARIANTS } from '../listitem/listitem.constants';
|
3
|
+
/**
|
4
|
+
* menuitem component is inherited by listitem component with the role set `menuitem`.<br/>
|
5
|
+
* A menu item can contain an icon on the leading or trailing side.
|
6
|
+
*
|
7
|
+
* The leading and trailing slots can be used to display controls and text.<br/>
|
8
|
+
* Based on the leading/trailing slot, the position of the controls and text can be adjusted.
|
9
|
+
*
|
10
|
+
* Please use mdc-menu as a parent element even when there is only menuitem for a11y purpose.
|
11
|
+
*
|
12
|
+
* @dependency mdc-text
|
13
|
+
*
|
14
|
+
* @tagname mdc-menuitem
|
15
|
+
*
|
16
|
+
* @event click - (React: onClick) This event is dispatched when the menuitem is clicked.
|
17
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the menuitem.
|
18
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the menuitem.
|
19
|
+
* @event focus - (React: onFocus) This event is dispatched when the menuitem receives focus.
|
20
|
+
*/
|
21
|
+
class MenuItem extends ListItem {
|
22
|
+
connectedCallback() {
|
23
|
+
super.connectedCallback();
|
24
|
+
this.role = 'menuitem';
|
25
|
+
this.variant = LISTITEM_VARIANTS.INSET_RECTANGLE;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
MenuItem.styles = [...ListItem.styles];
|
29
|
+
export default MenuItem;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -58,7 +58,6 @@ class Option extends FormInternalsMixin(ListItem) {
|
|
58
58
|
this.secondaryLabel = undefined;
|
59
59
|
this.sideHeaderText = undefined;
|
60
60
|
this.sublineText = undefined;
|
61
|
-
this.dataAriaLabel = undefined;
|
62
61
|
this.addEventListener('focusin', this.displayTooltipForLongText);
|
63
62
|
this.addEventListener('mouseover', this.displayTooltipForLongText);
|
64
63
|
this.addEventListener('focusout', this.hideTooltipOnLeave);
|
@@ -131,9 +130,6 @@ class Option extends FormInternalsMixin(ListItem) {
|
|
131
130
|
}
|
132
131
|
update(changedProperties) {
|
133
132
|
super.update(changedProperties);
|
134
|
-
if (changedProperties.has('disabled')) {
|
135
|
-
this.updateAttribute('aria-disabled', `${this.disabled}`);
|
136
|
-
}
|
137
133
|
if (changedProperties.has('selected')) {
|
138
134
|
this.updateAttribute('aria-selected', `${this.selected}`);
|
139
135
|
}
|