@momentum-design/components 0.139.7 → 0.139.9
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.
|
@@ -667,10 +667,19 @@ class Popover extends KeyDownHandledMixin(KeyToActionMixin(BackdropMixin(Prevent
|
|
|
667
667
|
? 'clippingAncestors'
|
|
668
668
|
: Array.from(document.querySelectorAll(this.boundary));
|
|
669
669
|
const rootBoundary = this.boundaryRoot;
|
|
670
|
+
let arrowOffset = 0;
|
|
671
|
+
if (this.showArrow) {
|
|
672
|
+
this.arrowElement = this.renderRoot.querySelector('div[part="popover-arrow"]');
|
|
673
|
+
if (this.arrowElement) {
|
|
674
|
+
const arrowLen = this.arrowElement.offsetHeight;
|
|
675
|
+
arrowOffset = Math.sqrt(2 * arrowLen ** 2) / 2;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
670
678
|
const middleware = [];
|
|
671
679
|
if (this.inline) {
|
|
672
680
|
middleware.push(inlineMiddleware());
|
|
673
681
|
}
|
|
682
|
+
middleware.push(offset(typeof this.offset === 'number' ? this.offset + arrowOffset : this.offset));
|
|
674
683
|
middleware.push(shift({
|
|
675
684
|
boundary,
|
|
676
685
|
rootBoundary,
|
|
@@ -704,16 +713,9 @@ class Popover extends KeyDownHandledMixin(KeyToActionMixin(BackdropMixin(Prevent
|
|
|
704
713
|
padding: 50,
|
|
705
714
|
}));
|
|
706
715
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
this.arrowElement = this.renderRoot.querySelector('div[part="popover-arrow"]');
|
|
710
|
-
if (this.arrowElement) {
|
|
711
|
-
const arrowLen = this.arrowElement.offsetHeight;
|
|
712
|
-
arrowOffset = Math.sqrt(2 * arrowLen ** 2) / 2;
|
|
713
|
-
middleware.push(arrow({ element: this.arrowElement, padding: 12 }));
|
|
714
|
-
}
|
|
716
|
+
if (this.showArrow && this.arrowElement) {
|
|
717
|
+
middleware.push(arrow({ element: this.arrowElement, padding: 12 }));
|
|
715
718
|
}
|
|
716
|
-
middleware.push(offset(typeof this.offset === 'number' ? this.offset + arrowOffset : this.offset));
|
|
717
719
|
this.floatingUICleanupFunction = autoUpdate(triggerElement, this, async () => {
|
|
718
720
|
const { triggerElement } = this;
|
|
719
721
|
if (!triggerElement)
|
|
@@ -27,20 +27,21 @@ const styles = [
|
|
|
27
27
|
display: contents;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
:host(:hover)::part(
|
|
30
|
+
:host(:hover)::part(radio-indicator) {
|
|
31
31
|
--mdc-staticradio-outer-circle-background-color: var(--mds-color-theme-control-inactive-hover);
|
|
32
|
+
cursor: pointer;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
:host(:active)::part(
|
|
35
|
+
:host(:active)::part(radio-indicator) {
|
|
35
36
|
--mdc-staticradio-outer-circle-background-color: var(--mds-color-theme-control-inactive-pressed);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
:host([checked]:hover)::part(
|
|
39
|
+
:host([checked]:hover)::part(radio-indicator) {
|
|
39
40
|
--mdc-staticradio-outer-circle-border-color: var(--mds-color-theme-control-active-hover);
|
|
40
41
|
--mdc-staticradio-outer-circle-background-color: var(--mds-color-theme-control-active-hover);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
:host([checked]:active)::part(
|
|
44
|
+
:host([checked]:active)::part(radio-indicator) {
|
|
44
45
|
--mdc-staticradio-outer-circle-border-color: var(--mds-color-theme-control-active-pressed);
|
|
45
46
|
--mdc-staticradio-outer-circle-background-color: var(--mds-color-theme-control-active-pressed);
|
|
46
47
|
}
|
package/dist/utils/dom.js
CHANGED
|
@@ -183,6 +183,7 @@ export const findFocusable = (root, options = {}) => {
|
|
|
183
183
|
const stopAtNonTabbable = (_d = options === null || options === void 0 ? void 0 : options.stopAtNonTabbable) !== null && _d !== void 0 ? _d : false;
|
|
184
184
|
const matches = new Set([]);
|
|
185
185
|
const internalFocusableCheck = (element) => {
|
|
186
|
+
var _a;
|
|
186
187
|
// Excluded
|
|
187
188
|
if (excludesSet.has(root) || isMatchAny(element, excludeSelectors))
|
|
188
189
|
return 'stop';
|
|
@@ -198,6 +199,8 @@ export const findFocusable = (root, options = {}) => {
|
|
|
198
199
|
return 'stop';
|
|
199
200
|
}
|
|
200
201
|
}
|
|
202
|
+
if ((_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.delegatesFocus)
|
|
203
|
+
return 'continue';
|
|
201
204
|
return isMatchAny(element, includeSelectors) || (isTabbable(element) && isInteractiveElement(element))
|
|
202
205
|
? 'focusable'
|
|
203
206
|
: 'continue';
|