@momentum-design/components 0.85.6 → 0.85.8
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 +225 -201
- package/dist/browser/index.js.map +4 -4
- package/dist/components/menuitem/menuitem.component.d.ts +21 -1
- package/dist/components/menuitem/menuitem.component.js +29 -1
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +26 -15
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +42 -25
- package/dist/components/menuitemcheckbox/menuitemcheckbox.constants.d.ts +1 -1
- package/dist/components/menuitemcheckbox/menuitemcheckbox.constants.js +1 -2
- package/dist/components/menuitemcheckbox/menuitemcheckbox.styles.js +0 -6
- package/dist/components/menuitemradio/menuitemradio.component.d.ts +61 -12
- package/dist/components/menuitemradio/menuitemradio.component.js +125 -40
- package/dist/components/menuitemradio/menuitemradio.constants.d.ts +9 -1
- package/dist/components/menuitemradio/menuitemradio.constants.js +9 -1
- package/dist/components/menuitemradio/menuitemradio.styles.d.ts +2 -0
- package/dist/components/menuitemradio/menuitemradio.styles.js +7 -0
- package/dist/components/menuitemradio/menuitemradio.types.d.ts +4 -1
- package/dist/components/menupopover/menupopover.component.d.ts +6 -0
- package/dist/components/menupopover/menupopover.component.js +11 -3
- package/dist/components/menupopover/menupopover.styles.js +4 -0
- package/dist/components/menupopover/menupopover.types.d.ts +11 -0
- package/dist/components/menupopover/menupopover.types.js +1 -0
- package/dist/components/menupopover/menupopover.utils.d.ts +4 -2
- package/dist/components/menupopover/menupopover.utils.js +1 -1
- package/dist/components/menusection/menusection.component.d.ts +15 -2
- package/dist/components/menusection/menusection.component.js +55 -4
- package/dist/components/menusection/menusection.constants.d.ts +1 -5
- package/dist/components/menusection/menusection.constants.js +1 -5
- package/dist/components/menusection/menusection.styles.d.ts +2 -0
- package/dist/components/menusection/menusection.styles.js +11 -0
- package/dist/components/menusection/menusection.types.d.ts +7 -4
- package/dist/custom-elements.json +1180 -862
- package/dist/index.d.ts +3 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/menuitem/index.d.ts +12 -1
- package/dist/react/menuitem/index.js +12 -1
- package/dist/react/menuitemcheckbox/index.d.ts +18 -7
- package/dist/react/menuitemcheckbox/index.js +18 -7
- package/dist/react/menuitemradio/index.d.ts +25 -2
- package/dist/react/menuitemradio/index.js +25 -2
- package/dist/react/menupopover/index.d.ts +8 -0
- package/dist/react/menupopover/index.js +8 -0
- package/dist/react/menusection/index.d.ts +6 -1
- package/dist/react/menusection/index.js +5 -1
- package/dist/utils/types.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -69,9 +69,11 @@ import type { PopoverPlacement } from './components/popover/popover.types';
|
|
69
69
|
import type { SkeletonVariant } from './components/skeleton/skeleton.types';
|
70
70
|
import type { SpinnerSize, SpinnerVariant } from './components/spinner/spinner.types';
|
71
71
|
import type { TextType } from './components/text/text.types';
|
72
|
+
import type { MenuPopoverActionEvent, MenuPopoverChangeEvent } from './components/menupopover/menupopover.types';
|
73
|
+
import type { MenuSectionChangeEvent } from './components/menusection/menusection.types';
|
72
74
|
import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
|
73
75
|
import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
|
74
76
|
import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
75
77
|
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, 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, MenuSection, 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, VirtualizedList, };
|
76
|
-
export type {
|
78
|
+
export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SpinnerSize, SpinnerVariant, TextType, };
|
77
79
|
export { inMemoryCache, webAPIIconsCache, BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, SKELETON_VARIANTS, };
|
package/dist/react/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export { default as AlertChip } from './alertchip';
|
2
1
|
export { default as Animation } from './animation';
|
3
2
|
export { default as Appheader } from './appheader';
|
3
|
+
export { default as AlertChip } from './alertchip';
|
4
4
|
export { default as Avatar } from './avatar';
|
5
5
|
export { default as AvatarButton } from './avatarbutton';
|
6
6
|
export { default as Badge } from './badge';
|
package/dist/react/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export { default as AlertChip } from './alertchip';
|
2
1
|
export { default as Animation } from './animation';
|
3
2
|
export { default as Appheader } from './appheader';
|
3
|
+
export { default as AlertChip } from './alertchip';
|
4
4
|
export { default as Avatar } from './avatar';
|
5
5
|
export { default as AvatarButton } from './avatarbutton';
|
6
6
|
export { default as Badge } from './badge';
|
@@ -7,7 +7,10 @@ import Component from '../../components/menuitem';
|
|
7
7
|
* The leading and trailing slots can be used to display controls and text.<br/>
|
8
8
|
* Based on the leading/trailing slot, the position of the controls and text can be adjusted.
|
9
9
|
*
|
10
|
-
* Please use
|
10
|
+
* Please use element with role=menu as a parent element even when there is only menuitem for a11y purpose.
|
11
|
+
* For example mdc-menupopover or mdc-menubar.
|
12
|
+
*
|
13
|
+
* Menu item has `name` and `value` attribute that can be used to identify the menu item when it is selected.
|
11
14
|
*
|
12
15
|
* @dependency mdc-text
|
13
16
|
* @dependency mdc-icon
|
@@ -15,6 +18,14 @@ import Component from '../../components/menuitem';
|
|
15
18
|
*
|
16
19
|
* @tagname mdc-menuitem
|
17
20
|
*
|
21
|
+
* @slot leading-controls - slot for menu item controls to appear of leading end.
|
22
|
+
* @slot leading-text-primary-label - slot for menu item primary label.
|
23
|
+
* @slot leading-text-secondary-label - slot for menu item secondary label.
|
24
|
+
* @slot leading-text-tertiary-label - slot for menu item tertiary label.
|
25
|
+
* @slot trailing-text-side-header - slot for menu item side header text.
|
26
|
+
* @slot trailing-text-subline - slot for menu item subline text.
|
27
|
+
* @slot trailing-controls - slot for menu item controls to appear of trailing end.
|
28
|
+
*
|
18
29
|
* @event click - (React: onClick) This event is dispatched when the menuitem is clicked.
|
19
30
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the menuitem.
|
20
31
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the menuitem.
|
@@ -9,7 +9,10 @@ import { TAG_NAME } from '../../components/menuitem/menuitem.constants';
|
|
9
9
|
* The leading and trailing slots can be used to display controls and text.<br/>
|
10
10
|
* Based on the leading/trailing slot, the position of the controls and text can be adjusted.
|
11
11
|
*
|
12
|
-
* Please use
|
12
|
+
* Please use element with role=menu as a parent element even when there is only menuitem for a11y purpose.
|
13
|
+
* For example mdc-menupopover or mdc-menubar.
|
14
|
+
*
|
15
|
+
* Menu item has `name` and `value` attribute that can be used to identify the menu item when it is selected.
|
13
16
|
*
|
14
17
|
* @dependency mdc-text
|
15
18
|
* @dependency mdc-icon
|
@@ -17,6 +20,14 @@ import { TAG_NAME } from '../../components/menuitem/menuitem.constants';
|
|
17
20
|
*
|
18
21
|
* @tagname mdc-menuitem
|
19
22
|
*
|
23
|
+
* @slot leading-controls - slot for menu item controls to appear of leading end.
|
24
|
+
* @slot leading-text-primary-label - slot for menu item primary label.
|
25
|
+
* @slot leading-text-secondary-label - slot for menu item secondary label.
|
26
|
+
* @slot leading-text-tertiary-label - slot for menu item tertiary label.
|
27
|
+
* @slot trailing-text-side-header - slot for menu item side header text.
|
28
|
+
* @slot trailing-text-subline - slot for menu item subline text.
|
29
|
+
* @slot trailing-controls - slot for menu item controls to appear of trailing end.
|
30
|
+
*
|
20
31
|
* @event click - (React: onClick) This event is dispatched when the menuitem is clicked.
|
21
32
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the menuitem.
|
22
33
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the menuitem.
|
@@ -4,21 +4,26 @@ import Component from '../../components/menuitemcheckbox';
|
|
4
4
|
* A menuitemcheckbox component is a checkable menuitem.
|
5
5
|
* There should be no focusable descendants inside this menuitemcheckbox component.
|
6
6
|
*
|
7
|
-
* The `
|
7
|
+
* The `checked` attribute indicates whether the menuitemcheckbox is checked or not.
|
8
8
|
*
|
9
|
-
*
|
10
|
-
*
|
9
|
+
* Menu item checkbox has `name` and `value` attribute that can be used to identify the menu item when it is selected.
|
10
|
+
*
|
11
|
+
* The `indicator` attribute is used to differentiate between <b>checkbox</b>, <b>checkmark</b>, <b>toggle</b> and <b>none</b>.
|
12
|
+
* By default, the `indicator` is set to <b>checkbox</b>.<br/>
|
11
13
|
*
|
12
14
|
* The checkbox will always be positioned on the leading side of the menuitem label and
|
13
15
|
* the toggle and checkmark will always be positioned on the trailing side.
|
14
16
|
*
|
15
17
|
* The checkbox will have the possible states of `true` or `false`.
|
16
|
-
* If the indicator is set to <b>checkmark</b> and if the `
|
18
|
+
* If the indicator is set to <b>checkmark</b> and if the `checked` attribute is set to `true`,
|
17
19
|
* then the checkmark will be displayed. if not, then no indicator will be displayed.
|
18
20
|
*
|
19
|
-
*
|
21
|
+
* The forth options for the `indicator` is <b>none</b>, which will not display any indicator at all.
|
22
|
+
* It is intended to be used for customised menu items where the indicator is implemented differently.
|
23
|
+
* For example, you can use a custom icon or a different visual element to indicate the state of the menu item.
|
24
|
+
* Make sure the new indicator is accessible.
|
20
25
|
*
|
21
|
-
* If
|
26
|
+
* If you want only one item in a group to be checked, consider using menuitemradio component.
|
22
27
|
*
|
23
28
|
* @dependency mdc-staticcheckbox
|
24
29
|
* @dependency mdc-statictoggle
|
@@ -26,7 +31,13 @@ import Component from '../../components/menuitemcheckbox';
|
|
26
31
|
*
|
27
32
|
* @tagname mdc-menuitemcheckbox
|
28
33
|
*
|
29
|
-
* @
|
34
|
+
* @slot leading-controls - slot for menu item checkbox controls to appear of leading end.
|
35
|
+
* @slot leading-text-primary-label - slot for menu item checkbox primary label.
|
36
|
+
* @slot leading-text-secondary-label - slot for menu item checkbox secondary label.
|
37
|
+
* @slot leading-text-tertiary-label - slot for menu item checkbox tertiary label.
|
38
|
+
* @slot trailing-text-side-header - slot for menu item checkbox side header text.
|
39
|
+
* @slot trailing-text-subline - slot for menu item checkbox subline text.
|
40
|
+
* @slot trailing-controls - slot for menu item checkbox controls to appear of trailing end.
|
30
41
|
*
|
31
42
|
* @event change - (React: onChange) This event is dispatched when the menuitemcheckbox changes.
|
32
43
|
* @event click - (React: onClick) This event is dispatched when the menuitemcheckbox is clicked.
|
@@ -6,21 +6,26 @@ import { TAG_NAME } from '../../components/menuitemcheckbox/menuitemcheckbox.con
|
|
6
6
|
* A menuitemcheckbox component is a checkable menuitem.
|
7
7
|
* There should be no focusable descendants inside this menuitemcheckbox component.
|
8
8
|
*
|
9
|
-
* The `
|
9
|
+
* The `checked` attribute indicates whether the menuitemcheckbox is checked or not.
|
10
10
|
*
|
11
|
-
*
|
12
|
-
*
|
11
|
+
* Menu item checkbox has `name` and `value` attribute that can be used to identify the menu item when it is selected.
|
12
|
+
*
|
13
|
+
* The `indicator` attribute is used to differentiate between <b>checkbox</b>, <b>checkmark</b>, <b>toggle</b> and <b>none</b>.
|
14
|
+
* By default, the `indicator` is set to <b>checkbox</b>.<br/>
|
13
15
|
*
|
14
16
|
* The checkbox will always be positioned on the leading side of the menuitem label and
|
15
17
|
* the toggle and checkmark will always be positioned on the trailing side.
|
16
18
|
*
|
17
19
|
* The checkbox will have the possible states of `true` or `false`.
|
18
|
-
* If the indicator is set to <b>checkmark</b> and if the `
|
20
|
+
* If the indicator is set to <b>checkmark</b> and if the `checked` attribute is set to `true`,
|
19
21
|
* then the checkmark will be displayed. if not, then no indicator will be displayed.
|
20
22
|
*
|
21
|
-
*
|
23
|
+
* The forth options for the `indicator` is <b>none</b>, which will not display any indicator at all.
|
24
|
+
* It is intended to be used for customised menu items where the indicator is implemented differently.
|
25
|
+
* For example, you can use a custom icon or a different visual element to indicate the state of the menu item.
|
26
|
+
* Make sure the new indicator is accessible.
|
22
27
|
*
|
23
|
-
* If
|
28
|
+
* If you want only one item in a group to be checked, consider using menuitemradio component.
|
24
29
|
*
|
25
30
|
* @dependency mdc-staticcheckbox
|
26
31
|
* @dependency mdc-statictoggle
|
@@ -28,7 +33,13 @@ import { TAG_NAME } from '../../components/menuitemcheckbox/menuitemcheckbox.con
|
|
28
33
|
*
|
29
34
|
* @tagname mdc-menuitemcheckbox
|
30
35
|
*
|
31
|
-
* @
|
36
|
+
* @slot leading-controls - slot for menu item checkbox controls to appear of leading end.
|
37
|
+
* @slot leading-text-primary-label - slot for menu item checkbox primary label.
|
38
|
+
* @slot leading-text-secondary-label - slot for menu item checkbox secondary label.
|
39
|
+
* @slot leading-text-tertiary-label - slot for menu item checkbox tertiary label.
|
40
|
+
* @slot trailing-text-side-header - slot for menu item checkbox side header text.
|
41
|
+
* @slot trailing-text-subline - slot for menu item checkbox subline text.
|
42
|
+
* @slot trailing-controls - slot for menu item checkbox controls to appear of trailing end.
|
32
43
|
*
|
33
44
|
* @event change - (React: onChange) This event is dispatched when the menuitemcheckbox changes.
|
34
45
|
* @event click - (React: onClick) This event is dispatched when the menuitemcheckbox is clicked.
|
@@ -5,17 +5,40 @@ import Component from '../../components/menuitemradio';
|
|
5
5
|
* A menuitemradio should be checked only one at a time. <br/>
|
6
6
|
* There should be no focusable descendants inside this menuitemradio component.
|
7
7
|
*
|
8
|
-
* The `
|
8
|
+
* The `checked` menuitemradio attribute is used to indicate that the menuitemradio is checked or not.
|
9
|
+
*
|
10
|
+
* Menu item radio has `name` and `value` attribute that can be used to identify the menu item when it is selected.
|
9
11
|
*
|
10
12
|
* If you want more than one item in a group to be checked, consider using menuitemcheckbox component.
|
11
13
|
*
|
12
|
-
*
|
14
|
+
* The `indicator` attribute is used to differentiate between <b>radio</b>, <b>checkmark</b> and <b>none</b>.
|
15
|
+
* By default, the `indicator` is set to <b>radio</b>.<br/>
|
16
|
+
*
|
17
|
+
* The checkbox will always be positioned on the leading side of the menuitem label and
|
18
|
+
* the checkmark will always be positioned on the trailing side.
|
19
|
+
*
|
20
|
+
* The radio will have the possible states of `true` or `false`.
|
21
|
+
* If the indicator is set to <b>checkmark</b> and if the `checked` attribute is set to `true`,
|
22
|
+
* then the checkmark will be displayed. if not, then no indicator will be displayed.
|
23
|
+
*
|
24
|
+
* The third options for the `indicator` is <b>none</b>, which will not display any indicator at all.
|
25
|
+
* It is intended to be used for customised menu items where the indicator is implemented differently.
|
26
|
+
* For example, you can use a custom icon or a different visual element to indicate the state of the menu item.
|
27
|
+
* Make sure the new indicator is accessible.
|
13
28
|
*
|
14
29
|
* @dependency mdc-staticradio
|
15
30
|
* @dependency mdc-text
|
16
31
|
*
|
17
32
|
* @tagname mdc-menuitemradio
|
18
33
|
*
|
34
|
+
* @slot leading-controls - slot for menu item radio controls to appear of leading end.
|
35
|
+
* @slot leading-text-primary-label - slot for menu item radio primary label.
|
36
|
+
* @slot leading-text-secondary-label - slot for menu item radio secondary label.
|
37
|
+
* @slot leading-text-tertiary-label - slot for menu item radio tertiary label.
|
38
|
+
* @slot trailing-text-side-header - slot for menu item radio side header text.
|
39
|
+
* @slot trailing-text-subline - slot for menu item radio subline text.
|
40
|
+
* @slot trailing-controls - slot for menu item radio controls to appear of trailing end.
|
41
|
+
*
|
19
42
|
* @event change - (React: onChange) This event is dispatched when the menuitemradio changes.
|
20
43
|
* @event click - (React: onClick) This event is dispatched when the menuitemradio is clicked.
|
21
44
|
* @event focus - (React: onFocus) This event is dispatched when the menuitemradio receives focus.
|
@@ -7,17 +7,40 @@ import { TAG_NAME } from '../../components/menuitemradio/menuitemradio.constants
|
|
7
7
|
* A menuitemradio should be checked only one at a time. <br/>
|
8
8
|
* There should be no focusable descendants inside this menuitemradio component.
|
9
9
|
*
|
10
|
-
* The `
|
10
|
+
* The `checked` menuitemradio attribute is used to indicate that the menuitemradio is checked or not.
|
11
|
+
*
|
12
|
+
* Menu item radio has `name` and `value` attribute that can be used to identify the menu item when it is selected.
|
11
13
|
*
|
12
14
|
* If you want more than one item in a group to be checked, consider using menuitemcheckbox component.
|
13
15
|
*
|
14
|
-
*
|
16
|
+
* The `indicator` attribute is used to differentiate between <b>radio</b>, <b>checkmark</b> and <b>none</b>.
|
17
|
+
* By default, the `indicator` is set to <b>radio</b>.<br/>
|
18
|
+
*
|
19
|
+
* The checkbox will always be positioned on the leading side of the menuitem label and
|
20
|
+
* the checkmark will always be positioned on the trailing side.
|
21
|
+
*
|
22
|
+
* The radio will have the possible states of `true` or `false`.
|
23
|
+
* If the indicator is set to <b>checkmark</b> and if the `checked` attribute is set to `true`,
|
24
|
+
* then the checkmark will be displayed. if not, then no indicator will be displayed.
|
25
|
+
*
|
26
|
+
* The third options for the `indicator` is <b>none</b>, which will not display any indicator at all.
|
27
|
+
* It is intended to be used for customised menu items where the indicator is implemented differently.
|
28
|
+
* For example, you can use a custom icon or a different visual element to indicate the state of the menu item.
|
29
|
+
* Make sure the new indicator is accessible.
|
15
30
|
*
|
16
31
|
* @dependency mdc-staticradio
|
17
32
|
* @dependency mdc-text
|
18
33
|
*
|
19
34
|
* @tagname mdc-menuitemradio
|
20
35
|
*
|
36
|
+
* @slot leading-controls - slot for menu item radio controls to appear of leading end.
|
37
|
+
* @slot leading-text-primary-label - slot for menu item radio primary label.
|
38
|
+
* @slot leading-text-secondary-label - slot for menu item radio secondary label.
|
39
|
+
* @slot leading-text-tertiary-label - slot for menu item radio tertiary label.
|
40
|
+
* @slot trailing-text-side-header - slot for menu item radio side header text.
|
41
|
+
* @slot trailing-text-subline - slot for menu item radio subline text.
|
42
|
+
* @slot trailing-controls - slot for menu item radio controls to appear of trailing end.
|
43
|
+
*
|
21
44
|
* @event change - (React: onChange) This event is dispatched when the menuitemradio changes.
|
22
45
|
* @event click - (React: onClick) This event is dispatched when the menuitemradio is clicked.
|
23
46
|
* @event focus - (React: onFocus) This event is dispatched when the menuitemradio receives focus.
|
@@ -18,9 +18,17 @@ import Component from '../../components/menupopover';
|
|
18
18
|
* The orientation of the menu popover is always set to `vertical`.
|
19
19
|
*
|
20
20
|
* @tagname mdc-menupopover
|
21
|
+
*
|
22
|
+
* @slot - Default slot for the menu popover content
|
23
|
+
*
|
24
|
+
* @event change - (React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.
|
25
|
+
* @event action - (React: onAction) This event is dispatched when a menuItem selected and the menu closes.
|
26
|
+
*
|
21
27
|
* @slot default - Contains the menu items to be displayed in the popover
|
22
28
|
*/
|
23
29
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
30
|
+
onChange: EventName<import("../../components/menupopover/menupopover.types").MenuPopoverChangeEvent>;
|
31
|
+
onAction: EventName<import("../../components/menupopover/menupopover.types").MenuPopoverActionEvent>;
|
24
32
|
onShown: EventName<Event>;
|
25
33
|
onHidden: EventName<Event>;
|
26
34
|
onCreated: EventName<Event>;
|
@@ -20,6 +20,12 @@ import { TAG_NAME } from '../../components/menupopover/menupopover.constants';
|
|
20
20
|
* The orientation of the menu popover is always set to `vertical`.
|
21
21
|
*
|
22
22
|
* @tagname mdc-menupopover
|
23
|
+
*
|
24
|
+
* @slot - Default slot for the menu popover content
|
25
|
+
*
|
26
|
+
* @event change - (React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.
|
27
|
+
* @event action - (React: onAction) This event is dispatched when a menuItem selected and the menu closes.
|
28
|
+
*
|
23
29
|
* @slot default - Contains the menu items to be displayed in the popover
|
24
30
|
*/
|
25
31
|
const reactWrapper = createComponent({
|
@@ -27,6 +33,8 @@ const reactWrapper = createComponent({
|
|
27
33
|
elementClass: Component,
|
28
34
|
react: React,
|
29
35
|
events: {
|
36
|
+
onChange: 'change',
|
37
|
+
onAction: 'action',
|
30
38
|
onShown: 'shown',
|
31
39
|
onHidden: 'hidden',
|
32
40
|
onCreated: 'created',
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { type EventName } from '@lit/react';
|
1
2
|
import Component from '../../components/menusection';
|
2
3
|
/**
|
3
4
|
* `mdc-menusection` is a container element used to group a set of menu items.
|
@@ -11,6 +12,10 @@ import Component from '../../components/menusection';
|
|
11
12
|
* @tagname mdc-menusection
|
12
13
|
*
|
13
14
|
* @slot - Default slot for inserting `menuitem`, `menuitemcheckbox`, or `menuitemradio`
|
15
|
+
*
|
16
|
+
* @event change - (React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.
|
14
17
|
*/
|
15
|
-
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
18
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
19
|
+
onChange: EventName<import("../../components/menusection/menusection.types").MenuSectionChangeEvent>;
|
20
|
+
}>;
|
16
21
|
export default reactWrapper;
|
@@ -14,12 +14,16 @@ import { TAG_NAME } from '../../components/menusection/menusection.constants';
|
|
14
14
|
* @tagname mdc-menusection
|
15
15
|
*
|
16
16
|
* @slot - Default slot for inserting `menuitem`, `menuitemcheckbox`, or `menuitemradio`
|
17
|
+
*
|
18
|
+
* @event change - (React: onChange) This event is dispatched when a `menuitemcheckbox`, or `menuitemradio` changes.
|
17
19
|
*/
|
18
20
|
const reactWrapper = createComponent({
|
19
21
|
tagName: TAG_NAME,
|
20
22
|
elementClass: Component,
|
21
23
|
react: React,
|
22
|
-
events: {
|
24
|
+
events: {
|
25
|
+
onChange: 'change',
|
26
|
+
},
|
23
27
|
displayName: 'MenuSection',
|
24
28
|
});
|
25
29
|
export default reactWrapper;
|
package/dist/utils/types.d.ts
CHANGED
@@ -1 +1,11 @@
|
|
1
1
|
export type ValueOf<T> = T[keyof T];
|
2
|
+
/**
|
3
|
+
* A generic type for strongly typing custom events with their targets
|
4
|
+
* @typeParam T - The type of the event target (extends EventTarget)
|
5
|
+
* @typeParam D - The type of the detail payload for the custom event
|
6
|
+
*
|
7
|
+
* @see [Strongly Typed Events for Web Components](https://dev.to/stuffbreaker/creating-strongly-typed-events-for-web-components-1jem)
|
8
|
+
*/
|
9
|
+
export type TypedEvent<T extends EventTarget, D = unknown> = CustomEvent<D> & {
|
10
|
+
target: T;
|
11
|
+
};
|
package/package.json
CHANGED