@momentum-design/components 0.54.1 → 0.54.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 +69 -70
- package/dist/browser/index.js.map +4 -4
- package/dist/components/button/button.component.d.ts +3 -3
- package/dist/components/button/button.component.js +20 -15
- package/dist/components/popover/popover.component.d.ts +1 -1
- package/dist/components/popover/popover.component.js +6 -5
- package/dist/components/popover/popover.styles.js +0 -1
- package/dist/components/select/select.component.d.ts +3 -1
- package/dist/components/select/select.component.js +10 -3
- package/dist/custom-elements.json +72 -72
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
@@ -80,11 +80,11 @@ declare class Button extends Buttonsimple {
|
|
80
80
|
/**
|
81
81
|
* @internal
|
82
82
|
*/
|
83
|
-
private
|
83
|
+
private prefixFilledIconName?;
|
84
84
|
/**
|
85
85
|
* @internal
|
86
86
|
*/
|
87
|
-
private
|
87
|
+
private postfixFilledIconName?;
|
88
88
|
update(changedProperties: PropertyValues): void;
|
89
89
|
/**
|
90
90
|
* Modifies the icon name based on the active state.
|
@@ -94,7 +94,7 @@ declare class Button extends Buttonsimple {
|
|
94
94
|
*
|
95
95
|
* @param active - The active state.
|
96
96
|
*/
|
97
|
-
private
|
97
|
+
private inferFilledIconName;
|
98
98
|
/**
|
99
99
|
* Sets the variant attribute for the button component.
|
100
100
|
* If the provided variant is not included in the BUTTON_VARIANTS,
|
@@ -83,7 +83,7 @@ class Button extends Buttonsimple {
|
|
83
83
|
update(changedProperties) {
|
84
84
|
super.update(changedProperties);
|
85
85
|
if (changedProperties.has('active')) {
|
86
|
-
this.
|
86
|
+
this.inferFilledIconName(this.active);
|
87
87
|
}
|
88
88
|
if (changedProperties.has('size')) {
|
89
89
|
this.setSize(this.size);
|
@@ -99,6 +99,7 @@ class Button extends Buttonsimple {
|
|
99
99
|
this.setSize(this.size);
|
100
100
|
}
|
101
101
|
if (changedProperties.has('prefixIcon') || changedProperties.has('postfixIcon')) {
|
102
|
+
this.inferFilledIconName(this.active);
|
102
103
|
this.inferButtonType();
|
103
104
|
}
|
104
105
|
}
|
@@ -110,24 +111,18 @@ class Button extends Buttonsimple {
|
|
110
111
|
*
|
111
112
|
* @param active - The active state.
|
112
113
|
*/
|
113
|
-
|
114
|
+
inferFilledIconName(active) {
|
114
115
|
if (active) {
|
115
116
|
if (this.prefixIcon) {
|
116
|
-
this.
|
117
|
-
this.prefixIcon = `${getIconNameWithoutStyle(this.prefixIcon)}-filled`;
|
117
|
+
this.prefixFilledIconName = `${getIconNameWithoutStyle(this.prefixIcon)}-filled`;
|
118
118
|
}
|
119
119
|
if (this.postfixIcon) {
|
120
|
-
this.
|
121
|
-
this.postfixIcon = `${getIconNameWithoutStyle(this.postfixIcon)}-filled`;
|
120
|
+
this.postfixFilledIconName = `${getIconNameWithoutStyle(this.postfixIcon)}-filled`;
|
122
121
|
}
|
123
122
|
}
|
124
123
|
else {
|
125
|
-
|
126
|
-
|
127
|
-
}
|
128
|
-
if (this.prevPostfixIcon) {
|
129
|
-
this.postfixIcon = this.prevPostfixIcon;
|
130
|
-
}
|
124
|
+
this.prefixFilledIconName = this.prefixIcon;
|
125
|
+
this.postfixFilledIconName = this.postfixIcon;
|
131
126
|
}
|
132
127
|
}
|
133
128
|
/**
|
@@ -191,10 +186,12 @@ class Button extends Buttonsimple {
|
|
191
186
|
}
|
192
187
|
render() {
|
193
188
|
return html `
|
194
|
-
${this.
|
189
|
+
${this.prefixFilledIconName
|
190
|
+
? html ` <mdc-icon name="${this.prefixFilledIconName}" part="prefix-icon"></mdc-icon>`
|
191
|
+
: ''}
|
195
192
|
<slot @slotchange=${this.inferButtonType}></slot>
|
196
|
-
${this.
|
197
|
-
? html ` <mdc-icon name="${this.
|
193
|
+
${this.postfixFilledIconName
|
194
|
+
? html ` <mdc-icon name="${this.postfixFilledIconName}" part="postfix-icon"></mdc-icon>`
|
198
195
|
: ''}
|
199
196
|
`;
|
200
197
|
}
|
@@ -228,4 +225,12 @@ __decorate([
|
|
228
225
|
state(),
|
229
226
|
__metadata("design:type", String)
|
230
227
|
], Button.prototype, "typeInternal", void 0);
|
228
|
+
__decorate([
|
229
|
+
state(),
|
230
|
+
__metadata("design:type", String)
|
231
|
+
], Button.prototype, "prefixFilledIconName", void 0);
|
232
|
+
__decorate([
|
233
|
+
state(),
|
234
|
+
__metadata("design:type", String)
|
235
|
+
], Button.prototype, "postfixFilledIconName", void 0);
|
231
236
|
export default Button;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CSSResult, PropertyValues } from 'lit';
|
2
2
|
import { Component } from '../../models';
|
3
|
-
import
|
3
|
+
import { PopoverColor, PopoverPlacement, PopoverTrigger } from './popover.types';
|
4
4
|
declare const Popover_base: import("../../utils/mixins/index.types").Constructor<HTMLElement & import("../../utils/mixins/FocusTrapMixin").FocusTrapClassInterface> & typeof Component;
|
5
5
|
/**
|
6
6
|
* Popover component is a lightweight floating UI element that displays additional content when triggered.
|
@@ -7,16 +7,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
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
|
+
import { arrow, autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom';
|
10
11
|
import { html, nothing } from 'lit';
|
11
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
12
12
|
import { property } from 'lit/decorators.js';
|
13
|
-
import {
|
14
|
-
import styles from './popover.styles';
|
13
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
15
14
|
import { Component } from '../../models';
|
16
15
|
import { FocusTrapMixin } from '../../utils/mixins/FocusTrapMixin';
|
17
|
-
import {
|
18
|
-
import { DEFAULTS, POPOVER_PLACEMENT, TRIGGER, COLOR } from './popover.constants';
|
16
|
+
import { COLOR, DEFAULTS, POPOVER_PLACEMENT, TRIGGER } from './popover.constants';
|
19
17
|
import { PopoverEventManager } from './popover.events';
|
18
|
+
import { popoverStack } from './popover.stack';
|
19
|
+
import styles from './popover.styles';
|
20
20
|
import { PopoverUtils } from './popover.utils';
|
21
21
|
/**
|
22
22
|
* Popover component is a lightweight floating UI element that displays additional content when triggered.
|
@@ -536,6 +536,7 @@ class Popover extends FocusTrapMixin(Component) {
|
|
536
536
|
return;
|
537
537
|
Object.assign(popoverContent.style, {
|
538
538
|
maxHeight: `${availableHeight}px`,
|
539
|
+
overflowY: 'auto',
|
539
540
|
});
|
540
541
|
},
|
541
542
|
padding: 50,
|
@@ -35,7 +35,7 @@ declare class Select extends Select_base implements AssociatedFormControl {
|
|
35
35
|
/**
|
36
36
|
* height attribute of the select field. If set,
|
37
37
|
* then a scroll bar will be visible when there more options than the adjusted height.
|
38
|
-
* @default
|
38
|
+
* @default auto
|
39
39
|
*/
|
40
40
|
height: string;
|
41
41
|
/** @internal */
|
@@ -50,6 +50,8 @@ declare class Select extends Select_base implements AssociatedFormControl {
|
|
50
50
|
displayPopover: boolean;
|
51
51
|
/** @internal */
|
52
52
|
activeDescendant: string;
|
53
|
+
/** @internal */
|
54
|
+
popoverWidth: string;
|
53
55
|
/**
|
54
56
|
* @internal
|
55
57
|
* The native select element
|
@@ -50,7 +50,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
50
50
|
/**
|
51
51
|
* height attribute of the select field. If set,
|
52
52
|
* then a scroll bar will be visible when there more options than the adjusted height.
|
53
|
-
* @default
|
53
|
+
* @default auto
|
54
54
|
*/
|
55
55
|
this.height = 'auto';
|
56
56
|
/** @internal */
|
@@ -61,6 +61,8 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
61
61
|
this.displayPopover = false;
|
62
62
|
/** @internal */
|
63
63
|
this.activeDescendant = '';
|
64
|
+
/** @internal */
|
65
|
+
this.popoverWidth = '100%';
|
64
66
|
}
|
65
67
|
connectedCallback() {
|
66
68
|
super.connectedCallback();
|
@@ -233,6 +235,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
233
235
|
break;
|
234
236
|
case KEYS.ESCAPE:
|
235
237
|
this.closePopover();
|
238
|
+
event.stopPropagation();
|
236
239
|
break;
|
237
240
|
case KEYS.HOME:
|
238
241
|
this.setFocusAndTabIndex(0);
|
@@ -453,7 +456,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
453
456
|
placement="${POPOVER_PLACEMENT.BOTTOM_START}"
|
454
457
|
@shown="${this.handlePopoverOpen}"
|
455
458
|
@hidden="${this.handlePopoverClose}"
|
456
|
-
style="--mdc-popover-max-width:
|
459
|
+
style="--mdc-popover-max-width: ${this.popoverWidth}; --mdc-popover-max-height: ${this.height};"
|
457
460
|
>
|
458
461
|
<slot @click="${this.handleOptionsClick}"></slot>
|
459
462
|
</mdc-popover>
|
@@ -511,7 +514,7 @@ __decorate([
|
|
511
514
|
__metadata("design:type", Object)
|
512
515
|
], Select.prototype, "readonly", void 0);
|
513
516
|
__decorate([
|
514
|
-
property({ type: String
|
517
|
+
property({ type: String }),
|
515
518
|
__metadata("design:type", Object)
|
516
519
|
], Select.prototype, "height", void 0);
|
517
520
|
__decorate([
|
@@ -538,6 +541,10 @@ __decorate([
|
|
538
541
|
state(),
|
539
542
|
__metadata("design:type", Object)
|
540
543
|
], Select.prototype, "activeDescendant", void 0);
|
544
|
+
__decorate([
|
545
|
+
state(),
|
546
|
+
__metadata("design:type", Object)
|
547
|
+
], Select.prototype, "popoverWidth", void 0);
|
541
548
|
__decorate([
|
542
549
|
query('select'),
|
543
550
|
__metadata("design:type", HTMLInputElement)
|
@@ -2020,7 +2020,7 @@
|
|
2020
2020
|
},
|
2021
2021
|
{
|
2022
2022
|
"kind": "method",
|
2023
|
-
"name": "
|
2023
|
+
"name": "inferFilledIconName",
|
2024
2024
|
"privacy": "private",
|
2025
2025
|
"parameters": [
|
2026
2026
|
{
|
@@ -9533,77 +9533,6 @@
|
|
9533
9533
|
}
|
9534
9534
|
]
|
9535
9535
|
},
|
9536
|
-
{
|
9537
|
-
"kind": "javascript-module",
|
9538
|
-
"path": "components/marker/marker.component.js",
|
9539
|
-
"declarations": [
|
9540
|
-
{
|
9541
|
-
"kind": "class",
|
9542
|
-
"description": "`mdc-marker`, which is a vertical line and\nused to draw attention to specific parts of\nthe content or to signify important information.\n\n**Marker Variants**:\n- **solid**: Solid marker.\n- **striped**: Striped marker.",
|
9543
|
-
"name": "Marker",
|
9544
|
-
"cssProperties": [
|
9545
|
-
{
|
9546
|
-
"description": "Allows customization of the default background color in solid variant.",
|
9547
|
-
"name": "--mdc-marker-solid-background-color"
|
9548
|
-
},
|
9549
|
-
{
|
9550
|
-
"description": "Allows customization of the default stripes in striped variant.",
|
9551
|
-
"name": "--mdc-marker-striped-color"
|
9552
|
-
},
|
9553
|
-
{
|
9554
|
-
"description": "Allows customization of the default background color in striped variant.",
|
9555
|
-
"name": "--mdc-marker-striped-background-color"
|
9556
|
-
},
|
9557
|
-
{
|
9558
|
-
"description": "Allows customization of the default width.",
|
9559
|
-
"name": "--mdc-marker-width"
|
9560
|
-
}
|
9561
|
-
],
|
9562
|
-
"members": [
|
9563
|
-
{
|
9564
|
-
"kind": "field",
|
9565
|
-
"name": "variant",
|
9566
|
-
"type": {
|
9567
|
-
"text": "MarkerVariants"
|
9568
|
-
},
|
9569
|
-
"privacy": "public",
|
9570
|
-
"description": "There are two variants of markers, each with a width of 0.25rem:\n- **solid**: Solid marker.\n- **striped**: Striped marker.",
|
9571
|
-
"default": "solid",
|
9572
|
-
"attribute": "variant",
|
9573
|
-
"reflects": true
|
9574
|
-
}
|
9575
|
-
],
|
9576
|
-
"attributes": [
|
9577
|
-
{
|
9578
|
-
"name": "variant",
|
9579
|
-
"type": {
|
9580
|
-
"text": "MarkerVariants"
|
9581
|
-
},
|
9582
|
-
"description": "There are two variants of markers, each with a width of 0.25rem:\n- **solid**: Solid marker.\n- **striped**: Striped marker.",
|
9583
|
-
"default": "solid",
|
9584
|
-
"fieldName": "variant"
|
9585
|
-
}
|
9586
|
-
],
|
9587
|
-
"superclass": {
|
9588
|
-
"name": "Component",
|
9589
|
-
"module": "/src/models"
|
9590
|
-
},
|
9591
|
-
"tagName": "mdc-marker",
|
9592
|
-
"jsDoc": "/**\n * `mdc-marker`, which is a vertical line and\n * used to draw attention to specific parts of\n * the content or to signify important information.\n *\n * **Marker Variants**:\n * - **solid**: Solid marker.\n * - **striped**: Striped marker.\n *\n * @tagname mdc-marker\n *\n * @cssproperty --mdc-marker-solid-background-color - Allows customization of the default background color\n * in solid variant.\n * @cssproperty --mdc-marker-striped-color - Allows customization of the default stripes in striped variant.\n * @cssproperty --mdc-marker-striped-background-color - Allows customization of the default background color\n * in striped variant.\n * @cssproperty --mdc-marker-width - Allows customization of the default width.\n */",
|
9593
|
-
"customElement": true
|
9594
|
-
}
|
9595
|
-
],
|
9596
|
-
"exports": [
|
9597
|
-
{
|
9598
|
-
"kind": "js",
|
9599
|
-
"name": "default",
|
9600
|
-
"declaration": {
|
9601
|
-
"name": "Marker",
|
9602
|
-
"module": "components/marker/marker.component.js"
|
9603
|
-
}
|
9604
|
-
}
|
9605
|
-
]
|
9606
|
-
},
|
9607
9536
|
{
|
9608
9537
|
"kind": "javascript-module",
|
9609
9538
|
"path": "components/optgroup/optgroup.component.js",
|
@@ -10511,6 +10440,77 @@
|
|
10511
10440
|
}
|
10512
10441
|
]
|
10513
10442
|
},
|
10443
|
+
{
|
10444
|
+
"kind": "javascript-module",
|
10445
|
+
"path": "components/marker/marker.component.js",
|
10446
|
+
"declarations": [
|
10447
|
+
{
|
10448
|
+
"kind": "class",
|
10449
|
+
"description": "`mdc-marker`, which is a vertical line and\nused to draw attention to specific parts of\nthe content or to signify important information.\n\n**Marker Variants**:\n- **solid**: Solid marker.\n- **striped**: Striped marker.",
|
10450
|
+
"name": "Marker",
|
10451
|
+
"cssProperties": [
|
10452
|
+
{
|
10453
|
+
"description": "Allows customization of the default background color in solid variant.",
|
10454
|
+
"name": "--mdc-marker-solid-background-color"
|
10455
|
+
},
|
10456
|
+
{
|
10457
|
+
"description": "Allows customization of the default stripes in striped variant.",
|
10458
|
+
"name": "--mdc-marker-striped-color"
|
10459
|
+
},
|
10460
|
+
{
|
10461
|
+
"description": "Allows customization of the default background color in striped variant.",
|
10462
|
+
"name": "--mdc-marker-striped-background-color"
|
10463
|
+
},
|
10464
|
+
{
|
10465
|
+
"description": "Allows customization of the default width.",
|
10466
|
+
"name": "--mdc-marker-width"
|
10467
|
+
}
|
10468
|
+
],
|
10469
|
+
"members": [
|
10470
|
+
{
|
10471
|
+
"kind": "field",
|
10472
|
+
"name": "variant",
|
10473
|
+
"type": {
|
10474
|
+
"text": "MarkerVariants"
|
10475
|
+
},
|
10476
|
+
"privacy": "public",
|
10477
|
+
"description": "There are two variants of markers, each with a width of 0.25rem:\n- **solid**: Solid marker.\n- **striped**: Striped marker.",
|
10478
|
+
"default": "solid",
|
10479
|
+
"attribute": "variant",
|
10480
|
+
"reflects": true
|
10481
|
+
}
|
10482
|
+
],
|
10483
|
+
"attributes": [
|
10484
|
+
{
|
10485
|
+
"name": "variant",
|
10486
|
+
"type": {
|
10487
|
+
"text": "MarkerVariants"
|
10488
|
+
},
|
10489
|
+
"description": "There are two variants of markers, each with a width of 0.25rem:\n- **solid**: Solid marker.\n- **striped**: Striped marker.",
|
10490
|
+
"default": "solid",
|
10491
|
+
"fieldName": "variant"
|
10492
|
+
}
|
10493
|
+
],
|
10494
|
+
"superclass": {
|
10495
|
+
"name": "Component",
|
10496
|
+
"module": "/src/models"
|
10497
|
+
},
|
10498
|
+
"tagName": "mdc-marker",
|
10499
|
+
"jsDoc": "/**\n * `mdc-marker`, which is a vertical line and\n * used to draw attention to specific parts of\n * the content or to signify important information.\n *\n * **Marker Variants**:\n * - **solid**: Solid marker.\n * - **striped**: Striped marker.\n *\n * @tagname mdc-marker\n *\n * @cssproperty --mdc-marker-solid-background-color - Allows customization of the default background color\n * in solid variant.\n * @cssproperty --mdc-marker-striped-color - Allows customization of the default stripes in striped variant.\n * @cssproperty --mdc-marker-striped-background-color - Allows customization of the default background color\n * in striped variant.\n * @cssproperty --mdc-marker-width - Allows customization of the default width.\n */",
|
10500
|
+
"customElement": true
|
10501
|
+
}
|
10502
|
+
],
|
10503
|
+
"exports": [
|
10504
|
+
{
|
10505
|
+
"kind": "js",
|
10506
|
+
"name": "default",
|
10507
|
+
"declaration": {
|
10508
|
+
"name": "Marker",
|
10509
|
+
"module": "components/marker/marker.component.js"
|
10510
|
+
}
|
10511
|
+
}
|
10512
|
+
]
|
10513
|
+
},
|
10514
10514
|
{
|
10515
10515
|
"kind": "javascript-module",
|
10516
10516
|
"path": "components/popover/popover.component.js",
|
package/dist/react/index.d.ts
CHANGED
@@ -21,9 +21,9 @@ export { default as InputChip } from './inputchip';
|
|
21
21
|
export { default as Link } from './link';
|
22
22
|
export { default as List } from './list';
|
23
23
|
export { default as ListItem } from './listitem';
|
24
|
-
export { default as Marker } from './marker';
|
25
24
|
export { default as OptGroup } from './optgroup';
|
26
25
|
export { default as Option } from './option';
|
26
|
+
export { default as Marker } from './marker';
|
27
27
|
export { default as Popover } from './popover';
|
28
28
|
export { default as Presence } from './presence';
|
29
29
|
export { default as Progressbar } from './progressbar';
|
package/dist/react/index.js
CHANGED
@@ -21,9 +21,9 @@ export { default as InputChip } from './inputchip';
|
|
21
21
|
export { default as Link } from './link';
|
22
22
|
export { default as List } from './list';
|
23
23
|
export { default as ListItem } from './listitem';
|
24
|
-
export { default as Marker } from './marker';
|
25
24
|
export { default as OptGroup } from './optgroup';
|
26
25
|
export { default as Option } from './option';
|
26
|
+
export { default as Marker } from './marker';
|
27
27
|
export { default as Popover } from './popover';
|
28
28
|
export { default as Presence } from './presence';
|
29
29
|
export { default as Progressbar } from './progressbar';
|
package/package.json
CHANGED