@momentum-design/components 0.29.0 → 0.29.1

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.
@@ -2,7 +2,7 @@ import type { PropertyValues } from 'lit';
2
2
  import { CSSResult } from 'lit';
3
3
  import { Component } from '../../models';
4
4
  import type { ButtonSize, ButtonType } from './buttonsimple.types';
5
- declare const Buttonsimple_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/FormInternalsMixin").FormInternalsMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/TabIndexMixin").TabIndexMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DisabledMixin").DisabledMixinInterface> & typeof Component;
5
+ declare const Buttonsimple_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/TabIndexMixin").TabIndexMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DisabledMixin").DisabledMixinInterface> & typeof Component;
6
6
  /**
7
7
  * `mdc-buttonsimple` is a component that can be configured in various ways to suit different use cases.
8
8
  * It is used as an internal component and is not intended to be used directly by consumers.
@@ -60,6 +60,12 @@ declare class Buttonsimple extends Buttonsimple_base {
60
60
  * @internal
61
61
  */
62
62
  private prevTabindex;
63
+ /** @internal */
64
+ static formAssociated: boolean;
65
+ /** @internal */
66
+ private internals;
67
+ /** @internal */
68
+ get form(): HTMLFormElement | null;
63
69
  constructor();
64
70
  update(changedProperties: PropertyValues): void;
65
71
  protected executeAction(): void;
@@ -11,7 +11,6 @@ import { html } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
12
  import { Component } from '../../models';
13
13
  import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
14
- import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
15
14
  import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
16
15
  import { BUTTON_TYPE, DEFAULTS } from './buttonsimple.constants';
17
16
  import styles from './buttonsimple.styles';
@@ -27,7 +26,11 @@ import styles from './buttonsimple.styles';
27
26
  *
28
27
  * @tagname mdc-buttonsimple
29
28
  */
30
- class Buttonsimple extends FormInternalsMixin(TabIndexMixin(DisabledMixin(Component))) {
29
+ class Buttonsimple extends TabIndexMixin(DisabledMixin(Component)) {
30
+ /** @internal */
31
+ get form() {
32
+ return this.internals.form;
33
+ }
31
34
  constructor() {
32
35
  super();
33
36
  /**
@@ -74,6 +77,8 @@ class Buttonsimple extends FormInternalsMixin(TabIndexMixin(DisabledMixin(Compon
74
77
  * @internal
75
78
  */
76
79
  this.prevTabindex = 0;
80
+ /** @internal */
81
+ this.internals = this.attachInternals();
77
82
  this.addEventListener('click', this.executeAction.bind(this));
78
83
  this.addEventListener('keydown', this.handleKeyDown.bind(this));
79
84
  this.addEventListener('keyup', this.handleKeyUp.bind(this));
@@ -203,6 +208,8 @@ class Buttonsimple extends FormInternalsMixin(TabIndexMixin(DisabledMixin(Compon
203
208
  `;
204
209
  }
205
210
  }
211
+ /** @internal */
212
+ Buttonsimple.formAssociated = true;
206
213
  Buttonsimple.styles = [...Component.styles, ...styles];
207
214
  __decorate([
208
215
  property({ type: Boolean, reflect: true }),
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { html, nothing } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
- import { v4 as uuidv4 } from 'uuid';
14
13
  import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
15
14
  import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
16
15
  import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
@@ -79,7 +78,6 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
79
78
  };
80
79
  // Checkbox does not contain helpTextType property.
81
80
  this.helpTextType = undefined;
82
- this.id = `mdc-input-${uuidv4()}`;
83
81
  }
84
82
  /**
85
83
  * Updates the form value to reflect the current state of the checkbox.
@@ -117,7 +117,6 @@ declare class Input extends Input_base implements AssociatedFormControl {
117
117
  * @default ''
118
118
  */
119
119
  clearAriaLabel: string;
120
- constructor();
121
120
  connectedCallback(): void;
122
121
  /** @internal */
123
122
  formResetCallback(): void;
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { html, nothing } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
- import { v4 as uuidv4 } from 'uuid';
14
13
  import styles from './input.styles';
15
14
  import FormfieldWrapper from '../formfieldwrapper';
16
15
  import { AUTO_CAPITALIZE, DEFAULTS, PREFIX_TEXT_OPTIONS } from './input.constants';
@@ -60,7 +59,7 @@ import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
60
59
  */
61
60
  class Input extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
62
61
  constructor() {
63
- super();
62
+ super(...arguments);
64
63
  /**
65
64
  * The placeholder text that is displayed when the input field is empty.
66
65
  */
@@ -94,7 +93,6 @@ class Input extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
94
93
  * @default ''
95
94
  */
96
95
  this.clearAriaLabel = '';
97
- this.id = `mdc-input-${uuidv4()}`;
98
96
  }
99
97
  connectedCallback() {
100
98
  super.connectedCallback();
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  import { html, nothing } from 'lit';
12
12
  import { property } from 'lit/decorators.js';
13
13
  import { ifDefined } from 'lit/directives/if-defined.js';
14
- import { v4 as uuidv4 } from 'uuid';
15
14
  import styles from './radio.styles';
16
15
  import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
17
16
  import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
@@ -78,7 +77,6 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
78
77
  };
79
78
  // Radio does not contain helpTextType property.
80
79
  this.helpTextType = undefined;
81
- this.id = `mdc-radio-${uuidv4()}`;
82
80
  }
83
81
  firstUpdated() {
84
82
  this.updateTabIndex();
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { html } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
- import { v4 as uuidv4 } from 'uuid';
14
13
  import styles from './toggle.styles';
15
14
  import FormfieldWrapper from '../formfieldwrapper';
16
15
  import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
@@ -76,7 +75,6 @@ class Toggle extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
76
75
  this.autofocus = false;
77
76
  // Toggle does not contain helpTextType property.
78
77
  this.helpTextType = undefined;
79
- this.id = `mdc-toggle-${uuidv4()}`;
80
78
  }
81
79
  /** @internal
82
80
  * Resets the checkbox to its initial state.