@momentum-design/components 0.105.2 → 0.105.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 +234 -239
- 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/custom-elements.json +1412 -1266
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +4 -4
- 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/react/index.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
export { default as Accordion } from './accordion';
|
2
1
|
export { default as AccordionButton } from './accordionbutton';
|
2
|
+
export { default as Accordion } from './accordion';
|
3
3
|
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';
|
@@ -55,8 +55,8 @@ export { default as Progressspinner } from './progressspinner';
|
|
55
55
|
export { default as Radio } from './radio';
|
56
56
|
export { default as RadioGroup } from './radiogroup';
|
57
57
|
export { default as Searchfield } from './searchfield';
|
58
|
-
export { default as Select } from './select';
|
59
58
|
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
59
|
+
export { default as Select } from './select';
|
60
60
|
export { default as Selectlistbox } from './selectlistbox';
|
61
61
|
export { default as SideNavigation } from './sidenavigation';
|
62
62
|
export { default as Skeleton } from './skeleton';
|
@@ -66,8 +66,8 @@ export { default as StaticCheckbox } from './staticcheckbox';
|
|
66
66
|
export { default as StaticRadio } from './staticradio';
|
67
67
|
export { default as StaticToggle } from './statictoggle';
|
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
@@ -1,11 +1,11 @@
|
|
1
|
-
export { default as Accordion } from './accordion';
|
2
1
|
export { default as AccordionButton } from './accordionbutton';
|
2
|
+
export { default as Accordion } from './accordion';
|
3
3
|
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';
|
@@ -55,8 +55,8 @@ export { default as Progressspinner } from './progressspinner';
|
|
55
55
|
export { default as Radio } from './radio';
|
56
56
|
export { default as RadioGroup } from './radiogroup';
|
57
57
|
export { default as Searchfield } from './searchfield';
|
58
|
-
export { default as Select } from './select';
|
59
58
|
export { default as ScreenreaderAnnouncer } from './screenreaderannouncer';
|
59
|
+
export { default as Select } from './select';
|
60
60
|
export { default as Selectlistbox } from './selectlistbox';
|
61
61
|
export { default as SideNavigation } from './sidenavigation';
|
62
62
|
export { default as Skeleton } from './skeleton';
|
@@ -66,8 +66,8 @@ export { default as StaticCheckbox } from './staticcheckbox';
|
|
66
66
|
export { default as StaticRadio } from './staticradio';
|
67
67
|
export { default as StaticToggle } from './statictoggle';
|
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';
|
@@ -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;
|