@momentum-design/components 0.103.0 → 0.103.2
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 +156 -152
- package/dist/browser/index.js.map +3 -3
- package/dist/components/button/button.component.d.ts +2 -0
- package/dist/components/button/button.component.js +3 -1
- package/dist/components/button/button.styles.js +3 -2
- package/dist/components/listitem/listitem.component.js +8 -1
- package/dist/components/listitem/listitem.styles.js +0 -4
- package/dist/components/popover/popover.component.d.ts +15 -1
- package/dist/components/popover/popover.component.js +32 -6
- package/dist/components/popover/popover.constants.d.ts +1 -0
- package/dist/components/popover/popover.constants.js +1 -0
- package/dist/components/popover/popover.styles.js +9 -0
- package/dist/components/popover/popover.utils.js +1 -0
- package/dist/components/select/select.component.d.ts +40 -0
- package/dist/components/select/select.component.js +64 -8
- package/dist/components/select/select.styles.js +28 -33
- package/dist/custom-elements.json +761 -481
- package/dist/react/button/index.d.ts +2 -0
- package/dist/react/button/index.js +2 -0
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/select/index.d.ts +14 -0
- package/dist/react/select/index.js +14 -0
- package/package.json +1 -1
@@ -35,6 +35,8 @@ declare const Button_base: import("../../utils/mixins/index.types").Constructor<
|
|
35
35
|
* @tagname mdc-button
|
36
36
|
*
|
37
37
|
* @slot - Text label of the button.
|
38
|
+
*
|
39
|
+
* @csspart button-text - Text label of the button, passed in default slot
|
38
40
|
*/
|
39
41
|
declare class Button extends Button_base {
|
40
42
|
/**
|
@@ -46,6 +46,8 @@ import { getIconNameWithoutStyle } from './button.utils';
|
|
46
46
|
* @tagname mdc-button
|
47
47
|
*
|
48
48
|
* @slot - Text label of the button.
|
49
|
+
*
|
50
|
+
* @csspart button-text - Text label of the button, passed in default slot
|
49
51
|
*/
|
50
52
|
class Button extends ButtonComponentMixin(Buttonsimple) {
|
51
53
|
constructor() {
|
@@ -129,7 +131,7 @@ class Button extends ButtonComponentMixin(Buttonsimple) {
|
|
129
131
|
length-unit="rem"
|
130
132
|
></mdc-icon>`
|
131
133
|
: ''}
|
132
|
-
<slot @slotchange=${this.inferButtonType}></slot>
|
134
|
+
<slot @slotchange=${this.inferButtonType} part="button-text"></slot>
|
133
135
|
${this.postfixFilledIconName
|
134
136
|
? html ` <mdc-icon
|
135
137
|
name="${this.postfixFilledIconName}"
|
@@ -236,8 +236,9 @@ const styles = css `
|
|
236
236
|
--mdc-button-primary-disabled-color: var(--mds-color-theme-inverted-text-primary-disabled);
|
237
237
|
}
|
238
238
|
|
239
|
-
:host([data-btn-type='pill'])
|
240
|
-
:host([data-btn-type='pill-with-icon'])
|
239
|
+
:host([data-btn-type='pill'])::part(button-text),
|
240
|
+
:host([data-btn-type='pill-with-icon'])::part(button-text) {
|
241
|
+
display: block;
|
241
242
|
white-space: nowrap;
|
242
243
|
overflow: hidden;
|
243
244
|
text-overflow: ellipsis;
|
@@ -133,7 +133,14 @@ class ListItem extends DisabledMixin(TabIndexMixin(Component)) {
|
|
133
133
|
* Handles the click event on the list item.
|
134
134
|
* If the tooltip is open, it has to be closed first.
|
135
135
|
*/
|
136
|
-
handleClick() {
|
136
|
+
handleClick(event) {
|
137
|
+
if (this.disabled) {
|
138
|
+
// when disabled, prevent the click event from propagating
|
139
|
+
// and from firing on the host (immediate)
|
140
|
+
event.stopImmediatePropagation();
|
141
|
+
event.preventDefault();
|
142
|
+
return;
|
143
|
+
}
|
137
144
|
// If the tooltip is open, it has to be closed first.
|
138
145
|
this.hideTooltipOnLeave();
|
139
146
|
}
|
@@ -123,7 +123,7 @@ declare class Popover extends Popover_base {
|
|
123
123
|
*
|
124
124
|
* @see [Floating UI - padding](https://floating-ui.com/docs/detectOverflow#padding)
|
125
125
|
*/
|
126
|
-
boundaryPadding
|
126
|
+
boundaryPadding?: number;
|
127
127
|
/**
|
128
128
|
* Determines whether the focus trap is enabled.
|
129
129
|
* If true, focus will be restricted to the content within this component.
|
@@ -220,6 +220,20 @@ declare class Popover extends Popover_base {
|
|
220
220
|
* @default null
|
221
221
|
*/
|
222
222
|
closeButtonAriaLabel: string | null;
|
223
|
+
/**
|
224
|
+
* The strategy of the popover.
|
225
|
+
* This determines how the popover is positioned in the DOM.
|
226
|
+
* - **absolute**: The popover is positioned absolutely relative to the nearest positioned ancestor.
|
227
|
+
* - **fixed**: The popover is positioned fixed relative to the viewport.
|
228
|
+
*
|
229
|
+
* Default as `absolute` is recommended for most cases.
|
230
|
+
* In cases where the popover gets clipped by a scrollable container,
|
231
|
+
* you can set this to `fixed` to avoid clipping.
|
232
|
+
*
|
233
|
+
* @default absolute
|
234
|
+
* @see [Floating UI - strategy](https://floating-ui.com/docs/computePosition#strategy)
|
235
|
+
*/
|
236
|
+
strategy: 'absolute' | 'fixed';
|
223
237
|
/**
|
224
238
|
* Role of the popover
|
225
239
|
* @default dialog
|
@@ -224,6 +224,20 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
224
224
|
* @default null
|
225
225
|
*/
|
226
226
|
this.closeButtonAriaLabel = null;
|
227
|
+
/**
|
228
|
+
* The strategy of the popover.
|
229
|
+
* This determines how the popover is positioned in the DOM.
|
230
|
+
* - **absolute**: The popover is positioned absolutely relative to the nearest positioned ancestor.
|
231
|
+
* - **fixed**: The popover is positioned fixed relative to the viewport.
|
232
|
+
*
|
233
|
+
* Default as `absolute` is recommended for most cases.
|
234
|
+
* In cases where the popover gets clipped by a scrollable container,
|
235
|
+
* you can set this to `fixed` to avoid clipping.
|
236
|
+
*
|
237
|
+
* @default absolute
|
238
|
+
* @see [Floating UI - strategy](https://floating-ui.com/docs/computePosition#strategy)
|
239
|
+
*/
|
240
|
+
this.strategy = DEFAULTS.STRATEGY;
|
227
241
|
/**
|
228
242
|
* Role of the popover
|
229
243
|
* @default dialog
|
@@ -525,18 +539,23 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
525
539
|
this.positionPopover = () => {
|
526
540
|
if (!this.triggerElement)
|
527
541
|
return;
|
542
|
+
const boundary = !this.boundary || this.boundary === 'clippingAncestors'
|
543
|
+
? 'clippingAncestors'
|
544
|
+
: Array.from(document.querySelectorAll(this.boundary));
|
545
|
+
const rootBoundary = this.boundaryRoot;
|
528
546
|
const middleware = [
|
529
547
|
shift({
|
530
|
-
boundary
|
531
|
-
|
532
|
-
: Array.from(document.querySelectorAll(this.boundary)),
|
533
|
-
rootBoundary: this.boundaryRoot,
|
548
|
+
boundary,
|
549
|
+
rootBoundary,
|
534
550
|
padding: this.boundaryPadding,
|
535
551
|
}),
|
536
552
|
];
|
537
553
|
let popoverOffset = this.offset;
|
538
554
|
if (this.flip) {
|
539
|
-
middleware.push(flip(
|
555
|
+
middleware.push(flip({
|
556
|
+
boundary,
|
557
|
+
rootBoundary,
|
558
|
+
}));
|
540
559
|
}
|
541
560
|
if (this.size) {
|
542
561
|
// expose a CSS variable for the available height
|
@@ -546,6 +565,8 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
546
565
|
};
|
547
566
|
const popoverContent = this.renderRoot.querySelector('[part="popover-content"]');
|
548
567
|
middleware.push(size({
|
568
|
+
boundary,
|
569
|
+
rootBoundary,
|
549
570
|
apply({ availableHeight }) {
|
550
571
|
if (!popoverContent)
|
551
572
|
return;
|
@@ -574,6 +595,7 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
574
595
|
const { x, y, middlewareData, placement } = await computePosition(this.triggerElement, this, {
|
575
596
|
placement: this.placement,
|
576
597
|
middleware,
|
598
|
+
strategy: this.strategy,
|
577
599
|
});
|
578
600
|
this.utils.updatePopoverStyle(x, y);
|
579
601
|
if (middlewareData.arrow && this.arrowElement) {
|
@@ -855,7 +877,7 @@ __decorate([
|
|
855
877
|
], Popover.prototype, "boundaryRoot", void 0);
|
856
878
|
__decorate([
|
857
879
|
property({ type: Number, reflect: true, attribute: 'boundary-padding' }),
|
858
|
-
__metadata("design:type",
|
880
|
+
__metadata("design:type", Number)
|
859
881
|
], Popover.prototype, "boundaryPadding", void 0);
|
860
882
|
__decorate([
|
861
883
|
property({ type: Boolean, reflect: true, attribute: 'focus-trap' }),
|
@@ -925,6 +947,10 @@ __decorate([
|
|
925
947
|
property({ type: String, attribute: 'close-button-aria-label', reflect: true }),
|
926
948
|
__metadata("design:type", Object)
|
927
949
|
], Popover.prototype, "closeButtonAriaLabel", void 0);
|
950
|
+
__decorate([
|
951
|
+
property({ type: String, reflect: true, attribute: 'strategy' }),
|
952
|
+
__metadata("design:type", String)
|
953
|
+
], Popover.prototype, "strategy", void 0);
|
928
954
|
__decorate([
|
929
955
|
property({ type: String, reflect: true }),
|
930
956
|
__metadata("design:type", Object)
|
@@ -51,5 +51,6 @@ declare const DEFAULTS: {
|
|
51
51
|
readonly DISABLE_ARIA_HAS_POPUP: false;
|
52
52
|
readonly PROPAGATE_EVENT_ON_ESCAPE: false;
|
53
53
|
readonly KEEP_CONNECTED_TOOLTIP_CLOSED: true;
|
54
|
+
readonly STRATEGY: "absolute";
|
54
55
|
};
|
55
56
|
export { TAG_NAME, POPOVER_PLACEMENT, COLOR, TRIGGER, DEFAULTS };
|
@@ -26,6 +26,14 @@ const styles = css `
|
|
26
26
|
width: var(--mdc-popover-max-width);
|
27
27
|
}
|
28
28
|
|
29
|
+
:host([strategy='absolute']) {
|
30
|
+
position: absolute;
|
31
|
+
}
|
32
|
+
|
33
|
+
:host([strategy='fixed']) {
|
34
|
+
position: fixed;
|
35
|
+
}
|
36
|
+
|
29
37
|
:host([visible]) {
|
30
38
|
display: block;
|
31
39
|
}
|
@@ -47,6 +55,7 @@ const styles = css `
|
|
47
55
|
|
48
56
|
:host::part(popover-content) {
|
49
57
|
position: relative;
|
58
|
+
cursor: default;
|
50
59
|
padding: 0.75rem;
|
51
60
|
min-width: max-content;
|
52
61
|
z-index: 9998;
|
@@ -32,6 +32,20 @@ declare const Select_base: import("../../utils/mixins/index.types").Constructor<
|
|
32
32
|
* @event input - (React: onInput) This event is dispatched when the select is changed.
|
33
33
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the select.
|
34
34
|
* @event focus - (React: onFocus) This event is dispatched when the select receives focus.
|
35
|
+
*
|
36
|
+
* @cssproperty --mdc-select-background-color - The background color of the combobox of select.
|
37
|
+
* @cssproperty --mdc-select-background-color-hover - The background color of the combobox of select when hovered.
|
38
|
+
* @cssproperty --mdc-select-background-color-active - The background color of the combobox of select when active.
|
39
|
+
* @cssproperty --mdc-select-background-color-disabled - The background color of the combobox of select when disabled.
|
40
|
+
* @cssproperty --mdc-select-text-color - The text color of the select.
|
41
|
+
* @cssproperty --mdc-select-text-color-selected - The text color of the selected option in the select.
|
42
|
+
* @cssproperty --mdc-select-text-color-disabled - The text color of the select when disabled.
|
43
|
+
* @cssproperty --mdc-select-border-color - The border color of the select.
|
44
|
+
* @cssproperty --mdc-select-border-color-disabled - The border color of the select when disabled.
|
45
|
+
* @cssproperty --mdc-select-border-color-success - The border color of the select when in success state.
|
46
|
+
* @cssproperty --mdc-select-border-color-warning - The border color of the select when in warning state.
|
47
|
+
* @cssproperty --mdc-select-border-color-error - The border color of the select when in error state.
|
48
|
+
* @cssproperty --mdc-select-width - The width of the select.
|
35
49
|
*/
|
36
50
|
declare class Select extends Select_base implements AssociatedFormControl {
|
37
51
|
/**
|
@@ -61,6 +75,32 @@ declare class Select extends Select_base implements AssociatedFormControl {
|
|
61
75
|
* @default undefined
|
62
76
|
*/
|
63
77
|
softDisabled?: boolean;
|
78
|
+
/**
|
79
|
+
* This describes the clipping element(s) or area that overflow of the used popover will be checked relative to.
|
80
|
+
* The default is 'clippingAncestors', which are the overflow ancestors which will cause the
|
81
|
+
* element to be clipped.
|
82
|
+
*
|
83
|
+
* Possible values:
|
84
|
+
* - 'clippingAncestors'
|
85
|
+
* - any css selector
|
86
|
+
*
|
87
|
+
* @default 'clippingAncestors'
|
88
|
+
*
|
89
|
+
* @see [Floating UI - boundary](https://floating-ui.com/docs/detectOverflow#boundary)
|
90
|
+
*/
|
91
|
+
boundary: 'clippingAncestors' | string;
|
92
|
+
/**
|
93
|
+
* The strategy of the popover within Select.
|
94
|
+
* This determines how the popover is positioned in the DOM.
|
95
|
+
*
|
96
|
+
* In case `boundary` is set to something other than 'clippingAncestors',
|
97
|
+
* it might be necessary to set the `strategy` to 'fixed' to ensure that the popover
|
98
|
+
* is not getting clipped by scrollable containers enclosing the select.
|
99
|
+
*
|
100
|
+
* @default absolute
|
101
|
+
* @see [Floating UI - strategy](https://floating-ui.com/docs/computePosition#strategy)
|
102
|
+
*/
|
103
|
+
strategy: 'absolute' | 'fixed';
|
64
104
|
/** @internal */
|
65
105
|
slottedListboxes: Array<HTMLElement>;
|
66
106
|
/** @internal */
|
@@ -17,7 +17,7 @@ import { ROLE } from '../../utils/roles';
|
|
17
17
|
import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
|
18
18
|
import { DEFAULTS as FORMFIELD_DEFAULTS, VALIDATION } from '../formfieldwrapper/formfieldwrapper.constants';
|
19
19
|
import { TAG_NAME as OPTION_TAG_NAME } from '../option/option.constants';
|
20
|
-
import { POPOVER_PLACEMENT } from '../popover/popover.constants';
|
20
|
+
import { POPOVER_PLACEMENT, DEFAULTS as POPOVER_DEFAULTS } from '../popover/popover.constants';
|
21
21
|
import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
22
22
|
import { ARROW_ICON, LISTBOX_ID, TRIGGER_ID } from './select.constants';
|
23
23
|
import styles from './select.styles';
|
@@ -48,6 +48,20 @@ import styles from './select.styles';
|
|
48
48
|
* @event input - (React: onInput) This event is dispatched when the select is changed.
|
49
49
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the select.
|
50
50
|
* @event focus - (React: onFocus) This event is dispatched when the select receives focus.
|
51
|
+
*
|
52
|
+
* @cssproperty --mdc-select-background-color - The background color of the combobox of select.
|
53
|
+
* @cssproperty --mdc-select-background-color-hover - The background color of the combobox of select when hovered.
|
54
|
+
* @cssproperty --mdc-select-background-color-active - The background color of the combobox of select when active.
|
55
|
+
* @cssproperty --mdc-select-background-color-disabled - The background color of the combobox of select when disabled.
|
56
|
+
* @cssproperty --mdc-select-text-color - The text color of the select.
|
57
|
+
* @cssproperty --mdc-select-text-color-selected - The text color of the selected option in the select.
|
58
|
+
* @cssproperty --mdc-select-text-color-disabled - The text color of the select when disabled.
|
59
|
+
* @cssproperty --mdc-select-border-color - The border color of the select.
|
60
|
+
* @cssproperty --mdc-select-border-color-disabled - The border color of the select when disabled.
|
61
|
+
* @cssproperty --mdc-select-border-color-success - The border color of the select when in success state.
|
62
|
+
* @cssproperty --mdc-select-border-color-warning - The border color of the select when in warning state.
|
63
|
+
* @cssproperty --mdc-select-border-color-error - The border color of the select when in error state.
|
64
|
+
* @cssproperty --mdc-select-width - The width of the select.
|
51
65
|
*/
|
52
66
|
class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
53
67
|
constructor() {
|
@@ -67,6 +81,32 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
67
81
|
* The placeholder text which will be shown on the text if provided.
|
68
82
|
*/
|
69
83
|
this.placement = POPOVER_PLACEMENT.BOTTOM_START;
|
84
|
+
/**
|
85
|
+
* This describes the clipping element(s) or area that overflow of the used popover will be checked relative to.
|
86
|
+
* The default is 'clippingAncestors', which are the overflow ancestors which will cause the
|
87
|
+
* element to be clipped.
|
88
|
+
*
|
89
|
+
* Possible values:
|
90
|
+
* - 'clippingAncestors'
|
91
|
+
* - any css selector
|
92
|
+
*
|
93
|
+
* @default 'clippingAncestors'
|
94
|
+
*
|
95
|
+
* @see [Floating UI - boundary](https://floating-ui.com/docs/detectOverflow#boundary)
|
96
|
+
*/
|
97
|
+
this.boundary = POPOVER_DEFAULTS.BOUNDARY;
|
98
|
+
/**
|
99
|
+
* The strategy of the popover within Select.
|
100
|
+
* This determines how the popover is positioned in the DOM.
|
101
|
+
*
|
102
|
+
* In case `boundary` is set to something other than 'clippingAncestors',
|
103
|
+
* it might be necessary to set the `strategy` to 'fixed' to ensure that the popover
|
104
|
+
* is not getting clipped by scrollable containers enclosing the select.
|
105
|
+
*
|
106
|
+
* @default absolute
|
107
|
+
* @see [Floating UI - strategy](https://floating-ui.com/docs/computePosition#strategy)
|
108
|
+
*/
|
109
|
+
this.strategy = POPOVER_DEFAULTS.STRATEGY;
|
70
110
|
/** @internal */
|
71
111
|
this.displayPopover = false;
|
72
112
|
/** @internal */
|
@@ -74,11 +114,11 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
74
114
|
}
|
75
115
|
getAllValidOptions() {
|
76
116
|
var _a;
|
77
|
-
return Array.from(((_a = this.slottedListboxes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll(OPTION_TAG_NAME)) || []);
|
117
|
+
return Array.from(((_a = this.slottedListboxes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${OPTION_TAG_NAME}:not([disabled])`)) || []);
|
78
118
|
}
|
79
119
|
getFirstValidOption() {
|
80
120
|
var _a;
|
81
|
-
return (_a = this.slottedListboxes[0]) === null || _a === void 0 ? void 0 : _a.querySelector(OPTION_TAG_NAME);
|
121
|
+
return (_a = this.slottedListboxes[0]) === null || _a === void 0 ? void 0 : _a.querySelector(`${OPTION_TAG_NAME}:not([disabled])`);
|
82
122
|
}
|
83
123
|
getLastValidOption() {
|
84
124
|
const options = this.getAllValidOptions();
|
@@ -86,7 +126,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
86
126
|
}
|
87
127
|
getFirstSelectedOption() {
|
88
128
|
var _a;
|
89
|
-
return (_a = this.slottedListboxes[0]) === null || _a === void 0 ? void 0 : _a.querySelector(`${OPTION_TAG_NAME}[selected]`);
|
129
|
+
return (_a = this.slottedListboxes[0]) === null || _a === void 0 ? void 0 : _a.querySelector(`${OPTION_TAG_NAME}[selected]:not([disabled])`);
|
90
130
|
}
|
91
131
|
/**
|
92
132
|
* Handles the first updated lifecycle event.
|
@@ -155,9 +195,15 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
155
195
|
* @param event - The event which triggered this function.
|
156
196
|
*/
|
157
197
|
handleOptionsClick(event) {
|
158
|
-
|
159
|
-
|
160
|
-
|
198
|
+
const option = event.target;
|
199
|
+
if (option &&
|
200
|
+
option.tagName === OPTION_TAG_NAME.toUpperCase() &&
|
201
|
+
!option.hasAttribute('disabled') &&
|
202
|
+
!option.hasAttribute('soft-disabled')) {
|
203
|
+
this.setSelectedOption(option);
|
204
|
+
this.displayPopover = false;
|
205
|
+
this.fireEvents();
|
206
|
+
}
|
161
207
|
}
|
162
208
|
/**
|
163
209
|
* Sets the selected option in the component state and updates the input element's value.
|
@@ -508,6 +554,8 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
508
554
|
focus-back-to-trigger
|
509
555
|
focus-trap
|
510
556
|
size
|
557
|
+
boundary="${ifDefined(this.boundary)}"
|
558
|
+
strategy="${ifDefined(this.strategy)}"
|
511
559
|
placement="${this.placement}"
|
512
560
|
@closebyescape="${() => {
|
513
561
|
this.displayPopover = false;
|
@@ -515,7 +563,7 @@ class Select extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
515
563
|
@closebyoutsideclick="${() => {
|
516
564
|
this.displayPopover = false;
|
517
565
|
}}"
|
518
|
-
style="--mdc-popover-max-width:
|
566
|
+
style="--mdc-popover-max-width: var(--mdc-select-width); --mdc-popover-max-height: ${this.height};"
|
519
567
|
>
|
520
568
|
<slot @click="${this.handleOptionsClick}"></slot>
|
521
569
|
</mdc-popover>
|
@@ -545,6 +593,14 @@ __decorate([
|
|
545
593
|
property({ type: Boolean, attribute: 'soft-disabled' }),
|
546
594
|
__metadata("design:type", Boolean)
|
547
595
|
], Select.prototype, "softDisabled", void 0);
|
596
|
+
__decorate([
|
597
|
+
property({ type: String, reflect: true, attribute: 'boundary' }),
|
598
|
+
__metadata("design:type", String)
|
599
|
+
], Select.prototype, "boundary", void 0);
|
600
|
+
__decorate([
|
601
|
+
property({ type: String, reflect: true, attribute: 'strategy' }),
|
602
|
+
__metadata("design:type", String)
|
603
|
+
], Select.prototype, "strategy", void 0);
|
548
604
|
__decorate([
|
549
605
|
queryAssignedElements({ selector: 'mdc-selectlistbox' }),
|
550
606
|
__metadata("design:type", Array)
|
@@ -3,23 +3,24 @@ import { hostFocusRingStyles } from '../../utils/styles';
|
|
3
3
|
const styles = css `
|
4
4
|
:host {
|
5
5
|
--mdc-select-background-color: var(--mds-color-theme-background-primary-ghost);
|
6
|
-
--mdc-select-
|
7
|
-
--mdc-select-
|
8
|
-
--mdc-select-
|
9
|
-
--mdc-select-
|
10
|
-
--mdc-select-
|
11
|
-
--mdc-select-
|
12
|
-
--mdc-select-
|
13
|
-
--mdc-select-
|
14
|
-
--mdc-select-
|
15
|
-
--mdc-select-
|
16
|
-
--mdc-select-
|
6
|
+
--mdc-select-background-color-hover: var(--mds-color-theme-background-primary-hover);
|
7
|
+
--mdc-select-background-color-active: var(--mds-color-theme-background-primary-active);
|
8
|
+
--mdc-select-background-color-disabled: var(--mds-color-theme-background-input-disabled);
|
9
|
+
--mdc-select-text-color: var(--mds-color-theme-text-secondary-normal);
|
10
|
+
--mdc-select-text-color-selected: var(--mds-color-theme-text-primary-normal);
|
11
|
+
--mdc-select-text-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
12
|
+
--mdc-select-border-color: var(--mds-color-theme-outline-input-normal);
|
13
|
+
--mdc-select-border-color-disabled: var(--mds-color-theme-outline-primary-disabled);
|
14
|
+
--mdc-select-border-color-success: var(--mds-color-theme-text-success-normal);
|
15
|
+
--mdc-select-border-color-warning: var(--mds-color-theme-text-warning-normal);
|
16
|
+
--mdc-select-border-color-error: var(--mds-color-theme-text-error-normal);
|
17
|
+
--mdc-select-width: 100%;
|
17
18
|
|
18
19
|
display: flex;
|
19
20
|
flex-direction: column;
|
20
21
|
row-gap: 0.5rem;
|
21
22
|
align-items: unset;
|
22
|
-
width:
|
23
|
+
width: var(--mdc-select-width);
|
23
24
|
}
|
24
25
|
:host::part(native-input) {
|
25
26
|
margin: 0;
|
@@ -46,7 +47,7 @@ const styles = css `
|
|
46
47
|
:host::part(base-container) {
|
47
48
|
border-radius: 0.5rem;
|
48
49
|
padding: 5.5px 6px 5.5px 12px;
|
49
|
-
border: 1px solid var(--mdc-select-
|
50
|
+
border: 1px solid var(--mdc-select-border-color);
|
50
51
|
background: var(--mdc-select-background-color);
|
51
52
|
display: flex;
|
52
53
|
gap: 0.375rem;
|
@@ -54,21 +55,21 @@ const styles = css `
|
|
54
55
|
user-select: none;
|
55
56
|
}
|
56
57
|
:host::part(base-container):hover {
|
57
|
-
background-color: var(--mdc-select-background-hover);
|
58
|
+
background-color: var(--mdc-select-background-color-hover);
|
58
59
|
}
|
59
60
|
:host::part(base-container):active {
|
60
|
-
background-color: var(--mdc-select-background-active);
|
61
|
+
background-color: var(--mdc-select-background-color-active);
|
61
62
|
}
|
62
63
|
:host::part(base-text) {
|
63
64
|
height: 1.3125rem;
|
64
65
|
width: 100%;
|
65
|
-
color: var(--mdc-select-
|
66
|
+
color: var(--mdc-select-text-color);
|
66
67
|
overflow: hidden;
|
67
68
|
text-overflow: ellipsis;
|
68
69
|
white-space: nowrap;
|
69
70
|
}
|
70
71
|
:host::part(selected) {
|
71
|
-
color: var(--mdc-select-
|
72
|
+
color: var(--mdc-select-text-color-selected);
|
72
73
|
}
|
73
74
|
:host::part(selected-icon) {
|
74
75
|
flex-shrink: 0;
|
@@ -80,22 +81,23 @@ const styles = css `
|
|
80
81
|
}
|
81
82
|
:host mdc-popover::part(popover-content) {
|
82
83
|
min-width: auto;
|
84
|
+
width: var(--mdc-select-width);
|
83
85
|
max-height: var(--mdc-popover-max-height);
|
84
86
|
padding: 0.75rem 0.5rem;
|
85
87
|
}
|
86
88
|
|
87
89
|
/* Help text border colors */
|
88
90
|
:host([help-text-type='success'])::part(base-container) {
|
89
|
-
border-color: var(--mdc-select-
|
90
|
-
}
|
91
|
-
:host([help-text-type='error'])::part(base-container) {
|
92
|
-
border-color: var(--mdc-select-error-border-color);
|
91
|
+
border-color: var(--mdc-select-border-color-success);
|
93
92
|
}
|
94
93
|
:host([help-text-type='warning'])::part(base-container) {
|
95
|
-
border-color: var(--mdc-select-
|
94
|
+
border-color: var(--mdc-select-border-color-warning);
|
95
|
+
}
|
96
|
+
:host([help-text-type='error'])::part(base-container) {
|
97
|
+
border-color: var(--mdc-select-border-color-error);
|
96
98
|
}
|
97
99
|
|
98
|
-
/* Disabled,
|
100
|
+
/* Disabled, soft-disabled */
|
99
101
|
:host([disabled])::part(base-container),
|
100
102
|
:host([soft-disabled])::part(base-container),
|
101
103
|
:host([readonly])::part(base-container),
|
@@ -105,19 +107,12 @@ const styles = css `
|
|
105
107
|
:host([help-text-type='success'][readonly])::part(base-container),
|
106
108
|
:host([help-text-type='error'][readonly])::part(base-container),
|
107
109
|
:host([help-text-type='warning'][readonly])::part(base-container) {
|
108
|
-
border-color: var(--mdc-select-
|
109
|
-
background: var(--mdc-select-
|
110
|
-
}
|
111
|
-
:host([readonly])::part(base-text) {
|
112
|
-
color: var(--mdc-select-selected-text-color);
|
110
|
+
border-color: var(--mdc-select-border-color-disabled);
|
111
|
+
background: var(--mdc-select-background-color-disabled);
|
113
112
|
}
|
114
113
|
:host([disabled])::part(base-text),
|
115
114
|
:host([soft-disabled])::part(base-text) {
|
116
|
-
color: var(--mdc-select-
|
117
|
-
}
|
118
|
-
:host([soft-disabled])::part(icon-container),
|
119
|
-
:host([readonly])::part(icon-container) {
|
120
|
-
color: var(--mdc-select-disabled-text-color);
|
115
|
+
color: var(--mdc-select-text-color-disabled);
|
121
116
|
}
|
122
117
|
`;
|
123
118
|
export default [styles, ...hostFocusRingStyles(true)];
|