@momentum-design/components 0.81.0 → 0.81.2

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.
Files changed (30) hide show
  1. package/dist/browser/index.js +191 -191
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/components/dialog/dialog.component.d.ts +49 -21
  4. package/dist/components/dialog/dialog.component.js +143 -93
  5. package/dist/components/dialog/dialog.constants.d.ts +1 -0
  6. package/dist/components/dialog/dialog.constants.js +1 -0
  7. package/dist/components/popover/popover.component.d.ts +8 -1
  8. package/dist/components/popover/popover.component.js +16 -4
  9. package/dist/components/popover/popover.constants.d.ts +1 -0
  10. package/dist/components/popover/popover.constants.js +1 -0
  11. package/dist/components/popover/popover.utils.js +1 -1
  12. package/dist/components/toggletip/toggletip.component.js +1 -0
  13. package/dist/components/tooltip/tooltip.component.js +0 -2
  14. package/dist/custom-elements.json +2667 -2684
  15. package/dist/index.d.ts +1 -2
  16. package/dist/index.js +1 -2
  17. package/dist/react/index.d.ts +6 -7
  18. package/dist/react/index.js +6 -7
  19. package/dist/utils/mixins/FocusTrapMixin.d.ts +6 -5
  20. package/dist/utils/mixins/FocusTrapMixin.js +51 -22
  21. package/dist/utils/mixins/MenuMixin.js +1 -3
  22. package/package.json +1 -1
  23. package/dist/components/menu/index.d.ts +0 -8
  24. package/dist/components/menu/index.js +0 -5
  25. package/dist/components/menu/menu.component.d.ts +0 -19
  26. package/dist/components/menu/menu.component.js +0 -35
  27. package/dist/components/menu/menu.constants.d.ts +0 -2
  28. package/dist/components/menu/menu.constants.js +0 -3
  29. package/dist/react/menu/index.d.ts +0 -13
  30. package/dist/react/menu/index.js +0 -22
package/dist/index.d.ts CHANGED
@@ -29,7 +29,6 @@ import Linksimple from './components/linksimple';
29
29
  import List from './components/list';
30
30
  import ListItem from './components/listitem';
31
31
  import Marker from './components/marker';
32
- import Menu from './components/menu';
33
32
  import MenuBar from './components/menubar';
34
33
  import MenuItem from './components/menuitem';
35
34
  import MenuItemCheckbox from './components/menuitemcheckbox';
@@ -73,6 +72,6 @@ import type { TextType } from './components/text/text.types';
73
72
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
74
73
  import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
75
74
  import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
76
- export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonLink, ButtonGroup, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, Linksimple, List, ListItem, Marker, Menu, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, NavItem, NavItemList, OptGroup, Option, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Tab, TabList, Text, Textarea, ThemeProvider, Toggle, ToggleTip, Tooltip, MenuSection, VirtualizedList, };
75
+ export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonLink, ButtonGroup, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, NavItem, NavItemList, OptGroup, Option, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Tab, TabList, Text, Textarea, ThemeProvider, Toggle, ToggleTip, Tooltip, MenuSection, VirtualizedList, };
77
76
  export type { TextType, SpinnerSize, SpinnerVariant, SkeletonVariant, PopoverPlacement, BadgeType, IconButtonSize, PillButtonSize, ButtonVariant, ButtonColor, };
78
77
  export { inMemoryCache, webAPIIconsCache, BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, SKELETON_VARIANTS, };
package/dist/index.js CHANGED
@@ -30,7 +30,6 @@ import Linksimple from './components/linksimple';
30
30
  import List from './components/list';
31
31
  import ListItem from './components/listitem';
32
32
  import Marker from './components/marker';
33
- import Menu from './components/menu';
34
33
  import MenuBar from './components/menubar';
35
34
  import MenuItem from './components/menuitem';
36
35
  import MenuItemCheckbox from './components/menuitemcheckbox';
@@ -70,6 +69,6 @@ import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
70
69
  import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, } from './components/button/button.constants';
71
70
  import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
72
71
  // Components Exports
73
- export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonLink, ButtonGroup, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, Linksimple, List, ListItem, Marker, Menu, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, NavItem, NavItemList, OptGroup, Option, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Tab, TabList, Text, Textarea, ThemeProvider, Toggle, ToggleTip, Tooltip, MenuSection, VirtualizedList, };
72
+ export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonLink, ButtonGroup, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, NavItem, NavItemList, OptGroup, Option, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Tab, TabList, Text, Textarea, ThemeProvider, Toggle, ToggleTip, Tooltip, MenuSection, VirtualizedList, };
74
73
  // Constants / Utils Exports
75
74
  export { inMemoryCache, webAPIIconsCache, BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, SKELETON_VARIANTS, };
@@ -1,6 +1,6 @@
1
- export { default as Appheader } from './appheader';
2
1
  export { default as AlertChip } from './alertchip';
3
2
  export { default as Animation } from './animation';
3
+ export { default as Appheader } from './appheader';
4
4
  export { default as Avatar } from './avatar';
5
5
  export { default as AvatarButton } from './avatarbutton';
6
6
  export { default as Badge } from './badge';
@@ -12,14 +12,15 @@ export { default as ButtonLink } from './buttonlink';
12
12
  export { default as Buttonsimple } from './buttonsimple';
13
13
  export { default as Card } from './card';
14
14
  export { default as CardButton } from './cardbutton';
15
+ export { default as CardCheckbox } from './cardcheckbox';
15
16
  export { default as CardRadio } from './cardradio';
16
17
  export { default as Checkbox } from './checkbox';
17
18
  export { default as Chip } from './chip';
18
- export { default as CardCheckbox } from './cardcheckbox';
19
19
  export { default as Coachmark } from './coachmark';
20
20
  export { default as Dialog } from './dialog';
21
21
  export { default as Divider } from './divider';
22
22
  export { default as FilterChip } from './filterchip';
23
+ export { default as FormfieldGroup } from './formfieldgroup';
23
24
  export { default as FormfieldWrapper } from './formfieldwrapper';
24
25
  export { default as Icon } from './icon';
25
26
  export { default as IconProvider } from './iconprovider';
@@ -29,13 +30,11 @@ export { default as Link } from './link';
29
30
  export { default as Linksimple } from './linksimple';
30
31
  export { default as List } from './list';
31
32
  export { default as ListItem } from './listitem';
32
- export { default as FormfieldGroup } from './formfieldgroup';
33
33
  export { default as Marker } from './marker';
34
- export { default as Menu } from './menu';
35
34
  export { default as MenuBar } from './menubar';
36
35
  export { default as MenuItem } from './menuitem';
37
- export { default as MenuItemCheckbox } from './menuitemcheckbox';
38
36
  export { default as MenuItemRadio } from './menuitemradio';
37
+ export { default as MenuItemCheckbox } from './menuitemcheckbox';
39
38
  export { default as MenuPopover } from './menupopover';
40
39
  export { default as MenuSection } from './menusection';
41
40
  export { default as NavItem } from './navitem';
@@ -51,11 +50,11 @@ export { default as RadioGroup } from './radiogroup';
51
50
  export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
52
51
  export { default as Searchfield } from './searchfield';
53
52
  export { default as Select } from './select';
54
- export { default as SideNavigation } from './sidenavigation';
55
- export { default as Skeleton } from './skeleton';
56
53
  export { default as Spinner } from './spinner';
57
54
  export { default as StaticCheckbox } from './staticcheckbox';
58
55
  export { default as StaticRadio } from './staticradio';
56
+ export { default as SideNavigation } from './sidenavigation';
57
+ export { default as Skeleton } from './skeleton';
59
58
  export { default as StaticToggle } from './statictoggle';
60
59
  export { default as Tab } from './tab';
61
60
  export { default as TabList } from './tablist';
@@ -1,6 +1,6 @@
1
- export { default as Appheader } from './appheader';
2
1
  export { default as AlertChip } from './alertchip';
3
2
  export { default as Animation } from './animation';
3
+ export { default as Appheader } from './appheader';
4
4
  export { default as Avatar } from './avatar';
5
5
  export { default as AvatarButton } from './avatarbutton';
6
6
  export { default as Badge } from './badge';
@@ -12,14 +12,15 @@ export { default as ButtonLink } from './buttonlink';
12
12
  export { default as Buttonsimple } from './buttonsimple';
13
13
  export { default as Card } from './card';
14
14
  export { default as CardButton } from './cardbutton';
15
+ export { default as CardCheckbox } from './cardcheckbox';
15
16
  export { default as CardRadio } from './cardradio';
16
17
  export { default as Checkbox } from './checkbox';
17
18
  export { default as Chip } from './chip';
18
- export { default as CardCheckbox } from './cardcheckbox';
19
19
  export { default as Coachmark } from './coachmark';
20
20
  export { default as Dialog } from './dialog';
21
21
  export { default as Divider } from './divider';
22
22
  export { default as FilterChip } from './filterchip';
23
+ export { default as FormfieldGroup } from './formfieldgroup';
23
24
  export { default as FormfieldWrapper } from './formfieldwrapper';
24
25
  export { default as Icon } from './icon';
25
26
  export { default as IconProvider } from './iconprovider';
@@ -29,13 +30,11 @@ export { default as Link } from './link';
29
30
  export { default as Linksimple } from './linksimple';
30
31
  export { default as List } from './list';
31
32
  export { default as ListItem } from './listitem';
32
- export { default as FormfieldGroup } from './formfieldgroup';
33
33
  export { default as Marker } from './marker';
34
- export { default as Menu } from './menu';
35
34
  export { default as MenuBar } from './menubar';
36
35
  export { default as MenuItem } from './menuitem';
37
- export { default as MenuItemCheckbox } from './menuitemcheckbox';
38
36
  export { default as MenuItemRadio } from './menuitemradio';
37
+ export { default as MenuItemCheckbox } from './menuitemcheckbox';
39
38
  export { default as MenuPopover } from './menupopover';
40
39
  export { default as MenuSection } from './menusection';
41
40
  export { default as NavItem } from './navitem';
@@ -51,11 +50,11 @@ export { default as RadioGroup } from './radiogroup';
51
50
  export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
52
51
  export { default as Searchfield } from './searchfield';
53
52
  export { default as Select } from './select';
54
- export { default as SideNavigation } from './sidenavigation';
55
- export { default as Skeleton } from './skeleton';
56
53
  export { default as Spinner } from './spinner';
57
54
  export { default as StaticCheckbox } from './staticcheckbox';
58
55
  export { default as StaticRadio } from './staticradio';
56
+ export { default as SideNavigation } from './sidenavigation';
57
+ export { default as Skeleton } from './skeleton';
59
58
  export { default as StaticToggle } from './statictoggle';
60
59
  export { default as Tab } from './tab';
61
60
  export { default as TabList } from './tablist';
@@ -1,9 +1,10 @@
1
+ import type { Component } from '../../models';
1
2
  import type { Constructor } from './index.types';
2
- export declare class FocusTrapClassInterface {
3
- enabledFocusTrap: boolean;
3
+ export declare abstract class FocusTrapClassInterface {
4
+ protected abstract focusTrap: boolean;
4
5
  enabledPreventScroll: boolean;
5
- setFocusableElements(): void;
6
- setInitialFocus(prefferableElement?: number): void;
6
+ setInitialFocus(elementIndexToReceiveFocus?: number): void;
7
+ activateFocusTrap(): void;
7
8
  deactivateFocusTrap(): void;
8
9
  }
9
- export declare const FocusTrapMixin: <T extends Constructor<HTMLElement>>(superClass: T) => Constructor<HTMLElement & FocusTrapClassInterface> & T;
10
+ export declare const FocusTrapMixin: <T extends Constructor<Component>>(superClass: T) => Constructor<HTMLElement & FocusTrapClassInterface> & T;
@@ -11,14 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  import { property } from 'lit/decorators.js';
12
12
  export const FocusTrapMixin = (superClass) => {
13
13
  class FocusTrap extends superClass {
14
- constructor(...args) {
15
- super(...args);
14
+ constructor() {
15
+ super(...arguments);
16
16
  /**
17
- * Determines whether the focus trap is enabled.
18
- * If true, focus will be restricted to the content within this component.
19
- * @default false
17
+ * Determines whether focus should wrap around when reaching the first or last focusable element.
18
+ * If true, focus will cycle from end to start and vice versa.
19
+ *
20
+ * This only applies when `enabledFocusTrap` is true.
21
+ * @default true
20
22
  */
21
- this.enabledFocusTrap = false;
23
+ this.shouldFocusTrapWrap = true;
22
24
  /**
23
25
  * Prevent outside scrolling when element is shown.
24
26
  * @default false
@@ -28,16 +30,43 @@ export const FocusTrapMixin = (superClass) => {
28
30
  this.focusTrapIndex = -1;
29
31
  /** @internal */
30
32
  this.focusableElements = [];
31
- this.shouldWrapFocus = () => true;
32
- this.addEventListener('keydown', this.handleKeydown);
33
+ /** @internal */
34
+ this.isFocusTrapActivated = false;
35
+ }
36
+ connectedCallback() {
37
+ super.connectedCallback();
38
+ document.addEventListener('keydown', this.handleTabKeydown.bind(this));
39
+ }
40
+ disconnectedCallback() {
41
+ super.disconnectedCallback();
42
+ document.removeEventListener('keydown', this.handleTabKeydown.bind(this));
43
+ }
44
+ async updated(changedProperties) {
45
+ super.updated(changedProperties);
46
+ if (changedProperties.has('focusTrap')) {
47
+ if (!this.focusTrap) {
48
+ this.deactivateFocusTrap();
49
+ }
50
+ }
51
+ }
52
+ /**
53
+ * Activate the focus trap
54
+ * This calculates the focusable elements within the component's shadow root
55
+ */
56
+ activateFocusTrap() {
57
+ if (this.focusTrap) {
58
+ this.isFocusTrapActivated = true;
59
+ this.setFocusableElements();
60
+ }
33
61
  }
34
62
  /**
35
63
  * Deactivate the focus trap.
36
64
  */
37
65
  deactivateFocusTrap() {
38
- this.enabledFocusTrap = false;
39
- this.enabledPreventScroll = false;
66
+ this.isFocusTrapActivated = false;
40
67
  this.focusTrapIndex = -1;
68
+ // todo: this should not override the body overflow style, but reset it instead
69
+ this.enabledPreventScroll = false;
41
70
  document.body.style.overflow = '';
42
71
  }
43
72
  /**
@@ -198,17 +227,17 @@ export const FocusTrapMixin = (superClass) => {
198
227
  /**
199
228
  * Sets the initial focus within the container.
200
229
  *
201
- * @param prefferableElement - The index of the preferable element to focus.
230
+ * @param elementIndexToReceiveFocus - The index of the preferable element to focus.
202
231
  */
203
- setInitialFocus(prefferableElement = 0) {
232
+ setInitialFocus(elementIndexToReceiveFocus = 0) {
204
233
  if (this.focusableElements.length === 0)
205
234
  return;
206
235
  if (this.enabledPreventScroll) {
207
236
  document.body.style.overflow = 'hidden';
208
237
  }
209
- if (this.focusableElements[prefferableElement]) {
210
- this.focusTrapIndex = prefferableElement;
211
- this.focusableElements[prefferableElement].focus();
238
+ if (this.focusableElements[elementIndexToReceiveFocus]) {
239
+ this.focusTrapIndex = elementIndexToReceiveFocus;
240
+ this.focusableElements[elementIndexToReceiveFocus].focus();
212
241
  }
213
242
  }
214
243
  /**
@@ -220,12 +249,11 @@ export const FocusTrapMixin = (superClass) => {
220
249
  */
221
250
  calculateNextIndex(currentIndex, step) {
222
251
  const { length } = this.focusableElements;
223
- const wrapFocus = this.shouldWrapFocus();
224
252
  if (currentIndex === -1) {
225
253
  return step > 0 ? 0 : length - 1;
226
254
  }
227
255
  let nextIndex = currentIndex + step;
228
- if (wrapFocus) {
256
+ if (this.shouldFocusTrapWrap) {
229
257
  if (nextIndex < 0)
230
258
  nextIndex = length - 1;
231
259
  if (nextIndex >= length)
@@ -281,8 +309,9 @@ export const FocusTrapMixin = (superClass) => {
281
309
  * If true, the focus will be trapped in the previous element.
282
310
  */
283
311
  trapFocus(direction) {
284
- if (this.focusableElements.length === 0)
312
+ if (this.focusableElements.length === 0) {
285
313
  return;
314
+ }
286
315
  const activeElement = this.getDeepActiveElement();
287
316
  const activeIndex = this.findElement(activeElement);
288
317
  if (direction) {
@@ -301,8 +330,8 @@ export const FocusTrapMixin = (superClass) => {
301
330
  *
302
331
  * @param event - The keyboard event.
303
332
  */
304
- handleKeydown(event) {
305
- if (!this.enabledFocusTrap || !this.focusableElements.length) {
333
+ handleTabKeydown(event) {
334
+ if (!this.isFocusTrapActivated || !this.focusableElements.length) {
306
335
  return;
307
336
  }
308
337
  if (event.key === 'Tab') {
@@ -312,9 +341,9 @@ export const FocusTrapMixin = (superClass) => {
312
341
  }
313
342
  }
314
343
  __decorate([
315
- property({ type: Boolean }),
344
+ property({ type: Boolean, reflect: true, attribute: 'should-focus-trap-wrap' }),
316
345
  __metadata("design:type", Boolean)
317
- ], FocusTrap.prototype, "enabledFocusTrap", void 0);
346
+ ], FocusTrap.prototype, "shouldFocusTrapWrap", void 0);
318
347
  __decorate([
319
348
  property({ type: Boolean }),
320
349
  __metadata("design:type", Boolean)
@@ -8,7 +8,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { property, queryAssignedElements } from 'lit/decorators.js';
11
- import { TAG_NAME as MENU_TAGNAME } from '../../components/menu/menu.constants';
12
11
  import { ORIENTATION, TAG_NAME as MENUBAR_TAGNAME } from '../../components/menubar/menubar.constants';
13
12
  import { TAG_NAME as MENUPOPOVER_TAGNAME } from '../../components/menupopover/menupopover.constants';
14
13
  import { TAG_NAME as MENUSECTION_TAGNAME } from '../../components/menusection/menusection.constants';
@@ -114,8 +113,7 @@ export const MenuMixin = (superClass) => {
114
113
  * @returns True if the tag name is a valid menu, false otherwise.
115
114
  */
116
115
  isValidMenu(tagName) {
117
- return ((tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase()) === MENU_TAGNAME
118
- || (tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase()) === MENUBAR_TAGNAME || this.isValidNavItemList(tagName));
116
+ return ((tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase()) === MENUBAR_TAGNAME || this.isValidNavItemList(tagName));
119
117
  }
120
118
  /**
121
119
  * Checks if the given tag name is a valid navitemlist tag name.
package/package.json CHANGED
@@ -41,5 +41,5 @@
41
41
  "lottie-web": "^5.12.2",
42
42
  "uuid": "^11.0.5"
43
43
  },
44
- "version": "0.81.0"
44
+ "version": "0.81.2"
45
45
  }
@@ -1,8 +0,0 @@
1
- import '../text';
2
- import Menu from './menu.component';
3
- declare global {
4
- interface HTMLElementTagNameMap {
5
- ['mdc-menu']: Menu;
6
- }
7
- }
8
- export default Menu;
@@ -1,5 +0,0 @@
1
- import '../text';
2
- import Menu from './menu.component';
3
- import { TAG_NAME } from './menu.constants';
4
- Menu.register(TAG_NAME);
5
- export default Menu;
@@ -1,19 +0,0 @@
1
- import { CSSResult } from 'lit';
2
- import List from '../list/list.component';
3
- /**
4
- * mdc-menu component is used to display a group of menu items. It is used as a container to wrap menu items.
5
- * It contains the menu header component.
6
- *
7
- * @dependency mdc-text
8
- *
9
- * @tagname mdc-menu
10
- *
11
- * @slot default - This is a default/unnamed slot
12
- */
13
- declare class Menu extends List {
14
- /** @internal */
15
- listItems: Array<HTMLElement>;
16
- connectedCallback(): void;
17
- static styles: Array<CSSResult>;
18
- }
19
- export default Menu;
@@ -1,35 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { queryAssignedElements } from 'lit/decorators.js';
11
- import { ROLE } from '../../utils/roles';
12
- import List from '../list/list.component';
13
- import { TAG_NAME as MENUITEM_TAGNAME } from '../menuitem/menuitem.constants';
14
- /**
15
- * mdc-menu component is used to display a group of menu items. It is used as a container to wrap menu items.
16
- * It contains the menu header component.
17
- *
18
- * @dependency mdc-text
19
- *
20
- * @tagname mdc-menu
21
- *
22
- * @slot default - This is a default/unnamed slot
23
- */
24
- class Menu extends List {
25
- connectedCallback() {
26
- super.connectedCallback();
27
- this.dataRole = ROLE.MENU;
28
- }
29
- }
30
- Menu.styles = [...List.styles];
31
- __decorate([
32
- queryAssignedElements({ selector: `${MENUITEM_TAGNAME}:not([disabled])` }),
33
- __metadata("design:type", Array)
34
- ], Menu.prototype, "listItems", void 0);
35
- export default Menu;
@@ -1,2 +0,0 @@
1
- declare const TAG_NAME: "mdc-menu";
2
- export { TAG_NAME };
@@ -1,3 +0,0 @@
1
- import utils from '../../utils/tag-name';
2
- const TAG_NAME = utils.constructTagName('menu');
3
- export { TAG_NAME };
@@ -1,13 +0,0 @@
1
- import Component from '../../components/menu';
2
- /**
3
- * mdc-menu component is used to display a group of menu items. It is used as a container to wrap menu items.
4
- * It contains the menu header component.
5
- *
6
- * @dependency mdc-text
7
- *
8
- * @tagname mdc-menu
9
- *
10
- * @slot default - This is a default/unnamed slot
11
- */
12
- declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
13
- export default reactWrapper;
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- import { createComponent } from '@lit/react';
3
- import Component from '../../components/menu';
4
- import { TAG_NAME } from '../../components/menu/menu.constants';
5
- /**
6
- * mdc-menu component is used to display a group of menu items. It is used as a container to wrap menu items.
7
- * It contains the menu header component.
8
- *
9
- * @dependency mdc-text
10
- *
11
- * @tagname mdc-menu
12
- *
13
- * @slot default - This is a default/unnamed slot
14
- */
15
- const reactWrapper = createComponent({
16
- tagName: TAG_NAME,
17
- elementClass: Component,
18
- react: React,
19
- events: {},
20
- displayName: 'Menu',
21
- });
22
- export default reactWrapper;