@momentum-design/components 0.105.2 → 0.105.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 +236 -241
- package/dist/browser/index.js.map +4 -4
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +1 -1
- package/dist/components/buttonsimple/buttonsimple.component.js +2 -2
- package/dist/components/checkbox/checkbox.component.d.ts +3 -2
- package/dist/components/checkbox/checkbox.component.js +11 -2
- package/dist/components/input/input.component.d.ts +3 -7
- package/dist/components/input/input.component.js +11 -11
- package/dist/components/radio/radio.component.d.ts +3 -9
- package/dist/components/radio/radio.component.js +10 -12
- package/dist/components/searchfield/searchfield.component.d.ts +2 -2
- package/dist/components/searchfield/searchfield.component.js +2 -1
- package/dist/components/select/select.component.d.ts +3 -3
- package/dist/components/select/select.component.js +10 -3
- package/dist/components/textarea/textarea.component.d.ts +2 -6
- package/dist/components/textarea/textarea.component.js +11 -11
- package/dist/components/toggle/toggle.component.d.ts +2 -7
- package/dist/components/toggle/toggle.component.js +11 -12
- package/dist/components/virtualizedlist/virtualizedlist.component.d.ts +5 -8
- package/dist/components/virtualizedlist/virtualizedlist.component.js +10 -7
- package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +1 -1
- package/dist/components/virtualizedlist/virtualizedlist.types.d.ts +3 -2
- package/dist/custom-elements.json +1056 -897
- package/dist/index.d.ts +2 -1
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +4 -4
- package/dist/react/virtualizedlist/index.d.ts +2 -2
- package/dist/react/virtualizedlist/index.js +2 -2
- package/dist/utils/mixins/AutoFocusOnMountMixin.d.ts +7 -0
- package/dist/utils/mixins/{AutoFocusMixin.js → AutoFocusOnMountMixin.js} +17 -8
- package/dist/utils/mixins/FormInternalsMixin.d.ts +0 -1
- package/package.json +1 -1
- package/dist/utils/mixins/AutoFocusMixin.d.ts +0 -6
package/dist/index.d.ts
CHANGED
@@ -88,9 +88,10 @@ import type { MenuPopoverActionEvent, MenuPopoverChangeEvent } from './component
|
|
88
88
|
import type { SelectChangeEvent, SelectInputEvent } from './components/select/select.types';
|
89
89
|
import type { MenuSectionChangeEvent } from './components/menusection/menusection.types';
|
90
90
|
import type { InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent } from './components/input/input.types';
|
91
|
+
import type { VirtualizedListScrollEvent } from './components/virtualizedlist/virtualizedlist.types';
|
91
92
|
import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
|
92
93
|
import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
93
94
|
import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
|
94
95
|
export { Accordion, AccordionButton, AccordionGroup, 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, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, Typewriter, ToggleTip, Tooltip, VirtualizedList, Combobox, Slider, ListBox, };
|
95
|
-
export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, TextType, TypewriterType, InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent, };
|
96
|
+
export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, TextType, TypewriterType, InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent, VirtualizedListScrollEvent, };
|
96
97
|
export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
|
package/dist/react/index.d.ts
CHANGED
@@ -4,8 +4,8 @@ export { default as AccordionGroup } from './accordiongroup';
|
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
6
|
export { default as Appheader } from './appheader';
|
7
|
-
export { default as AvatarButton } from './avatarbutton';
|
8
7
|
export { default as Avatar } from './avatar';
|
8
|
+
export { default as AvatarButton } from './avatarbutton';
|
9
9
|
export { default as Badge } from './badge';
|
10
10
|
export { default as Brandvisual } from './brandvisual';
|
11
11
|
export { default as Bullet } from './bullet';
|
@@ -54,20 +54,20 @@ export { default as Progressbar } from './progressbar';
|
|
54
54
|
export { default as Progressspinner } from './progressspinner';
|
55
55
|
export { default as Radio } from './radio';
|
56
56
|
export { default as RadioGroup } from './radiogroup';
|
57
|
+
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
57
58
|
export { default as Searchfield } from './searchfield';
|
58
59
|
export { default as Select } from './select';
|
59
|
-
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
60
60
|
export { default as Selectlistbox } from './selectlistbox';
|
61
61
|
export { default as SideNavigation } from './sidenavigation';
|
62
62
|
export { default as Skeleton } from './skeleton';
|
63
63
|
export { default as Slider } from './slider';
|
64
|
-
export { default as Spinner } from './spinner';
|
65
64
|
export { default as StaticCheckbox } from './staticcheckbox';
|
66
65
|
export { default as StaticRadio } from './staticradio';
|
67
66
|
export { default as StaticToggle } from './statictoggle';
|
67
|
+
export { default as Spinner } from './spinner';
|
68
68
|
export { default as Stepper } from './stepper';
|
69
|
-
export { default as StepperItem } from './stepperitem';
|
70
69
|
export { default as StepperConnector } from './stepperconnector';
|
70
|
+
export { default as StepperItem } from './stepperitem';
|
71
71
|
export { default as Tab } from './tab';
|
72
72
|
export { default as TabList } from './tablist';
|
73
73
|
export { default as Text } from './text';
|
package/dist/react/index.js
CHANGED
@@ -4,8 +4,8 @@ export { default as AccordionGroup } from './accordiongroup';
|
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
6
|
export { default as Appheader } from './appheader';
|
7
|
-
export { default as AvatarButton } from './avatarbutton';
|
8
7
|
export { default as Avatar } from './avatar';
|
8
|
+
export { default as AvatarButton } from './avatarbutton';
|
9
9
|
export { default as Badge } from './badge';
|
10
10
|
export { default as Brandvisual } from './brandvisual';
|
11
11
|
export { default as Bullet } from './bullet';
|
@@ -54,20 +54,20 @@ export { default as Progressbar } from './progressbar';
|
|
54
54
|
export { default as Progressspinner } from './progressspinner';
|
55
55
|
export { default as Radio } from './radio';
|
56
56
|
export { default as RadioGroup } from './radiogroup';
|
57
|
+
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
57
58
|
export { default as Searchfield } from './searchfield';
|
58
59
|
export { default as Select } from './select';
|
59
|
-
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
60
60
|
export { default as Selectlistbox } from './selectlistbox';
|
61
61
|
export { default as SideNavigation } from './sidenavigation';
|
62
62
|
export { default as Skeleton } from './skeleton';
|
63
63
|
export { default as Slider } from './slider';
|
64
|
-
export { default as Spinner } from './spinner';
|
65
64
|
export { default as StaticCheckbox } from './staticcheckbox';
|
66
65
|
export { default as StaticRadio } from './staticradio';
|
67
66
|
export { default as StaticToggle } from './statictoggle';
|
67
|
+
export { default as Spinner } from './spinner';
|
68
68
|
export { default as Stepper } from './stepper';
|
69
|
-
export { default as StepperItem } from './stepperitem';
|
70
69
|
export { default as StepperConnector } from './stepperconnector';
|
70
|
+
export { default as StepperItem } from './stepperitem';
|
71
71
|
export { default as Tab } from './tab';
|
72
72
|
export { default as TabList } from './tablist';
|
73
73
|
export { default as Text } from './text';
|
@@ -10,11 +10,11 @@ import Component from '../../components/virtualizedlist';
|
|
10
10
|
*
|
11
11
|
* @tagname mdc-virtualizedlist
|
12
12
|
*
|
13
|
-
* @event
|
13
|
+
* @event scroll - (React: onScroll) Event that gets called when user scrolls inside of list.
|
14
14
|
*
|
15
15
|
* @slot - Client side List with nested list items.
|
16
16
|
*/
|
17
17
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
18
|
-
onScroll: EventName<import("../../
|
18
|
+
onScroll: EventName<import("../../components/virtualizedlist/virtualizedlist.types").VirtualizedListScrollEvent>;
|
19
19
|
}>;
|
20
20
|
export default reactWrapper;
|
@@ -12,7 +12,7 @@ import { TAG_NAME } from '../../components/virtualizedlist/virtualizedlist.const
|
|
12
12
|
*
|
13
13
|
* @tagname mdc-virtualizedlist
|
14
14
|
*
|
15
|
-
* @event
|
15
|
+
* @event scroll - (React: onScroll) Event that gets called when user scrolls inside of list.
|
16
16
|
*
|
17
17
|
* @slot - Client side List with nested list items.
|
18
18
|
*/
|
@@ -21,7 +21,7 @@ const reactWrapper = createComponent({
|
|
21
21
|
elementClass: Component,
|
22
22
|
react: React,
|
23
23
|
events: {
|
24
|
-
onScroll: '
|
24
|
+
onScroll: 'scroll',
|
25
25
|
},
|
26
26
|
displayName: 'VirtualizedList',
|
27
27
|
});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { Component } from '../../models';
|
2
|
+
import type { Constructor } from './index.types';
|
3
|
+
export declare class AutoFocusOnMountMixinInterface {
|
4
|
+
autoFocusOnMount?: boolean;
|
5
|
+
protected elementToAutoFocus: HTMLElement;
|
6
|
+
}
|
7
|
+
export declare const AutoFocusOnMountMixin: <T extends Constructor<Component>>(superClass: T) => Constructor<Component & AutoFocusOnMountMixinInterface> & T;
|
@@ -8,27 +8,36 @@ 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 } from 'lit/decorators.js';
|
11
|
-
export const
|
11
|
+
export const AutoFocusOnMountMixin = (superClass) => {
|
12
12
|
class InnerMixinClass extends superClass {
|
13
13
|
constructor() {
|
14
14
|
super(...arguments);
|
15
15
|
/**
|
16
|
-
*
|
16
|
+
* @internal
|
17
|
+
*/
|
18
|
+
this.elementToAutoFocus = this;
|
19
|
+
/**
|
20
|
+
* This property indicates whether the element should receive focus automatically when it is mounted.
|
21
|
+
*
|
22
|
+
* It will not focus if the element is re-attached to the DOM after being removed.
|
23
|
+
*
|
17
24
|
* @default false
|
18
25
|
*/
|
19
|
-
this.
|
26
|
+
this.autoFocusOnMount = false;
|
20
27
|
}
|
21
|
-
firstUpdated(changedProperties) {
|
28
|
+
async firstUpdated(changedProperties) {
|
22
29
|
super.firstUpdated(changedProperties);
|
23
|
-
if (this.
|
24
|
-
|
30
|
+
if (this.autoFocusOnMount) {
|
31
|
+
// wait for the element to be fully updated before focusing
|
32
|
+
await this.updateComplete;
|
33
|
+
this.elementToAutoFocus.focus();
|
25
34
|
}
|
26
35
|
}
|
27
36
|
}
|
28
37
|
__decorate([
|
29
|
-
property({ type: Boolean, reflect: true }),
|
38
|
+
property({ type: Boolean, reflect: true, attribute: 'auto-focus-on-mount' }),
|
30
39
|
__metadata("design:type", Boolean)
|
31
|
-
], InnerMixinClass.prototype, "
|
40
|
+
], InnerMixinClass.prototype, "autoFocusOnMount", void 0);
|
32
41
|
// Cast return type to your mixin's interface intersected with the superClass type
|
33
42
|
return InnerMixinClass;
|
34
43
|
};
|
package/package.json
CHANGED
@@ -1,6 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import type { Constructor } from './index.types';
|
3
|
-
export interface AutoFocusMixinInterface {
|
4
|
-
autofocus?: boolean;
|
5
|
-
}
|
6
|
-
export declare const AutoFocusMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<AutoFocusMixinInterface> & T;
|