@momentum-design/components 0.121.2 → 0.121.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.
@@ -1,6 +1,7 @@
1
1
  import type { PropertyValues, CSSResult, TemplateResult } from 'lit';
2
2
  import MenuItem from '../menuitem/menuitem.component';
3
3
  import { Indicator } from './menuitemradio.types';
4
+ declare const MenuItemRadio_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/ControlTypeMixin").ControlTypeMixinInterface> & typeof MenuItem;
4
5
  /**
5
6
  * A menuitemradio component is a checkable menuitem that is used in a menu.
6
7
  * A menuitemradio should be checked only one at a time. <br/>
@@ -56,7 +57,7 @@ import { Indicator } from './menuitemradio.types';
56
57
  * @csspart trailing-arrow - Allows customization of trailing arrow icon.
57
58
  * @csspart trailing-text - Allows customization of the trailing text part.
58
59
  */
59
- declare class MenuItemRadio extends MenuItem {
60
+ declare class MenuItemRadio extends MenuItemRadio_base {
60
61
  /**
61
62
  * The aria-checked attribute is used to indicate that the menuitemradio is checked or not.
62
63
  * @default false
@@ -15,6 +15,7 @@ import MenuItem from '../menuitem/menuitem.component';
15
15
  import { TYPE } from '../text/text.constants';
16
16
  import { TAG_NAME as MENUSECTION_TAGNAME } from '../menusection/menusection.constants';
17
17
  import { TAG_NAME as MENUPOPOVER_TAGNAME } from '../menupopover/menupopover.constants';
18
+ import { ControlTypeMixin } from '../../utils/mixins/ControlTypeMixin';
18
19
  import { INDICATOR, DEFAULTS } from './menuitemradio.constants';
19
20
  import styles from './menuitemradio.styles';
20
21
  /**
@@ -72,7 +73,7 @@ import styles from './menuitemradio.styles';
72
73
  * @csspart trailing-arrow - Allows customization of trailing arrow icon.
73
74
  * @csspart trailing-text - Allows customization of the trailing text part.
74
75
  */
75
- class MenuItemRadio extends MenuItem {
76
+ class MenuItemRadio extends ControlTypeMixin(MenuItem) {
76
77
  constructor() {
77
78
  super();
78
79
  /**
@@ -121,8 +122,10 @@ class MenuItemRadio extends MenuItem {
121
122
  handleMouseClick() {
122
123
  if (this.disabled || this.checked)
123
124
  return;
124
- this.updateOtherRadiosCheckedState();
125
- this.checked = true;
125
+ if (this.controlType !== 'controlled') {
126
+ this.updateOtherRadiosCheckedState();
127
+ this.checked = true;
128
+ }
126
129
  this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
127
130
  }
128
131
  update(changedProperties) {
@@ -152,6 +152,10 @@ declare class Slider extends Component {
152
152
  * Aria value text for the slider's end value displayed when range is true.
153
153
  */
154
154
  endAriaValueText?: string;
155
+ /**
156
+ * Whether to hide the tooltip when the thumb is focused or hovered.
157
+ */
158
+ hideTooltip?: boolean;
155
159
  /**
156
160
  * Targets all the input components with type='range'
157
161
  * @internal
@@ -214,7 +214,11 @@ class Slider extends Component {
214
214
  const [inputStart, inputEnd] = this.inputElements;
215
215
  const input = source === 'end' ? inputEnd : inputStart;
216
216
  const value = Number(input === null || input === void 0 ? void 0 : input.value);
217
- if (typeof value !== 'number' || Number.isNaN(value) || this.max === this.min || this.disabled) {
217
+ if (typeof value !== 'number' ||
218
+ Number.isNaN(value) ||
219
+ this.max === this.min ||
220
+ this.disabled ||
221
+ this.hideTooltip) {
218
222
  return nothing;
219
223
  }
220
224
  const normalizedValue = (value - this.min) / (this.max - this.min);
@@ -581,6 +585,10 @@ __decorate([
581
585
  property({ reflect: true, type: String, attribute: 'end-aria-valuetext' }),
582
586
  __metadata("design:type", String)
583
587
  ], Slider.prototype, "endAriaValueText", void 0);
588
+ __decorate([
589
+ property({ reflect: true, type: Boolean, attribute: 'hide-tooltip' }),
590
+ __metadata("design:type", Boolean)
591
+ ], Slider.prototype, "hideTooltip", void 0);
584
592
  __decorate([
585
593
  queryAll('input[type="range"]'),
586
594
  __metadata("design:type", Array)
@@ -7,4 +7,4 @@ interface Events {
7
7
  onInputEvent: OverrideEventTarget<InputEvent, Slider>;
8
8
  onChangeEvent: SliderChangeEvent;
9
9
  }
10
- export type { Events, ThumbStateType };
10
+ export type { Events, ThumbStateType, SliderChangeEvent };