@momentum-design/components 0.102.8 → 0.102.10
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 +6 -2
- package/dist/browser/index.js.map +2 -2
- package/dist/components/dialog/dialog.component.d.ts +1 -1
- package/dist/components/dialog/dialog.component.js +1 -1
- package/dist/components/listitem/listitem.styles.js +5 -0
- package/dist/components/navmenuitem/navmenuitem.styles.js +0 -1
- package/dist/components/popover/popover.component.d.ts +5 -0
- package/dist/components/popover/popover.component.js +12 -2
- package/dist/custom-elements.json +46 -0
- package/package.json +1 -1
@@ -220,7 +220,7 @@ declare class Dialog extends Dialog_base {
|
|
220
220
|
*/
|
221
221
|
private isOpenUpdated;
|
222
222
|
/**
|
223
|
-
* Sets the
|
223
|
+
* Sets the focus back to the trigger element or the last active element.
|
224
224
|
* This is called when the dialog is closed to ensure that the user can continue interacting with the application.
|
225
225
|
*
|
226
226
|
* @internal
|
@@ -376,7 +376,7 @@ class Dialog extends PreventScrollMixin(FocusTrapMixin(FooterMixin(Component)))
|
|
376
376
|
}
|
377
377
|
}
|
378
378
|
/**
|
379
|
-
* Sets the
|
379
|
+
* Sets the focus back to the trigger element or the last active element.
|
380
380
|
* This is called when the dialog is closed to ensure that the user can continue interacting with the application.
|
381
381
|
*
|
382
382
|
* @internal
|
@@ -341,6 +341,11 @@ declare class Popover extends Popover_base {
|
|
341
341
|
* If the popover is hovered, it will not hide the popover.
|
342
342
|
*/
|
343
343
|
private handleFocusOut;
|
344
|
+
/**
|
345
|
+
* Handles focus in event on the trigger element.
|
346
|
+
* This method checks if the trigger element has visible focus or is being hovered.
|
347
|
+
*/
|
348
|
+
private handleFocusIn;
|
344
349
|
/**
|
345
350
|
* Starts the close delay timer.
|
346
351
|
* If the popover is not interactive, it will close the popover after the delay.
|
@@ -330,7 +330,7 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
330
330
|
this.addEventListener('mouseleave', this.startCloseDelay);
|
331
331
|
}
|
332
332
|
if (this.trigger.includes('focusin')) {
|
333
|
-
this.triggerElement.addEventListener('focusin', this.
|
333
|
+
this.triggerElement.addEventListener('focusin', this.handleFocusIn);
|
334
334
|
if (!this.interactive) {
|
335
335
|
this.triggerElement.addEventListener('focusout', this.handleFocusOut);
|
336
336
|
}
|
@@ -351,7 +351,7 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
351
351
|
this.removeEventListener('mouseenter', this.cancelCloseDelay);
|
352
352
|
this.removeEventListener('mouseleave', this.startCloseDelay);
|
353
353
|
// focusin trigger
|
354
|
-
(_d = this.triggerElement) === null || _d === void 0 ? void 0 : _d.removeEventListener('focusin', this.
|
354
|
+
(_d = this.triggerElement) === null || _d === void 0 ? void 0 : _d.removeEventListener('focusin', this.handleFocusIn);
|
355
355
|
(_e = this.triggerElement) === null || _e === void 0 ? void 0 : _e.removeEventListener('focusout', this.handleFocusOut);
|
356
356
|
};
|
357
357
|
/**
|
@@ -443,6 +443,16 @@ class Popover extends PreventScrollMixin(FocusTrapMixin(Component)) {
|
|
443
443
|
this.hide();
|
444
444
|
}
|
445
445
|
};
|
446
|
+
/**
|
447
|
+
* Handles focus in event on the trigger element.
|
448
|
+
* This method checks if the trigger element has visible focus or is being hovered.
|
449
|
+
*/
|
450
|
+
this.handleFocusIn = () => {
|
451
|
+
var _a;
|
452
|
+
if (((_a = this.triggerElement) === null || _a === void 0 ? void 0 : _a.matches(':focus-visible')) || this.isHovered) {
|
453
|
+
this.show();
|
454
|
+
}
|
455
|
+
};
|
446
456
|
/**
|
447
457
|
* Starts the close delay timer.
|
448
458
|
* If the popover is not interactive, it will close the popover after the delay.
|
@@ -10364,6 +10364,16 @@
|
|
10364
10364
|
"module": "components/popover/popover.component.js"
|
10365
10365
|
}
|
10366
10366
|
},
|
10367
|
+
{
|
10368
|
+
"kind": "field",
|
10369
|
+
"name": "handleFocusIn",
|
10370
|
+
"privacy": "private",
|
10371
|
+
"description": "Handles focus in event on the trigger element.\nThis method checks if the trigger element has visible focus or is being hovered.",
|
10372
|
+
"inheritedFrom": {
|
10373
|
+
"name": "Popover",
|
10374
|
+
"module": "components/popover/popover.component.js"
|
10375
|
+
}
|
10376
|
+
},
|
10367
10377
|
{
|
10368
10378
|
"kind": "field",
|
10369
10379
|
"name": "startCloseDelay",
|
@@ -22094,6 +22104,16 @@
|
|
22094
22104
|
"module": "components/popover/popover.component.js"
|
22095
22105
|
}
|
22096
22106
|
},
|
22107
|
+
{
|
22108
|
+
"kind": "field",
|
22109
|
+
"name": "handleFocusIn",
|
22110
|
+
"privacy": "private",
|
22111
|
+
"description": "Handles focus in event on the trigger element.\nThis method checks if the trigger element has visible focus or is being hovered.",
|
22112
|
+
"inheritedFrom": {
|
22113
|
+
"name": "Popover",
|
22114
|
+
"module": "components/popover/popover.component.js"
|
22115
|
+
}
|
22116
|
+
},
|
22097
22117
|
{
|
22098
22118
|
"kind": "field",
|
22099
22119
|
"name": "startCloseDelay",
|
@@ -27018,6 +27038,12 @@
|
|
27018
27038
|
"privacy": "private",
|
27019
27039
|
"description": "Handles focus out event on the trigger element.\nThis method checks if the popover is not hovered and hides the popover.\nIf the popover is hovered, it will not hide the popover."
|
27020
27040
|
},
|
27041
|
+
{
|
27042
|
+
"kind": "field",
|
27043
|
+
"name": "handleFocusIn",
|
27044
|
+
"privacy": "private",
|
27045
|
+
"description": "Handles focus in event on the trigger element.\nThis method checks if the trigger element has visible focus or is being hovered."
|
27046
|
+
},
|
27021
27047
|
{
|
27022
27048
|
"kind": "field",
|
27023
27049
|
"name": "startCloseDelay",
|
@@ -38612,6 +38638,16 @@
|
|
38612
38638
|
"module": "components/popover/popover.component.js"
|
38613
38639
|
}
|
38614
38640
|
},
|
38641
|
+
{
|
38642
|
+
"kind": "field",
|
38643
|
+
"name": "handleFocusIn",
|
38644
|
+
"privacy": "private",
|
38645
|
+
"description": "Handles focus in event on the trigger element.\nThis method checks if the trigger element has visible focus or is being hovered.",
|
38646
|
+
"inheritedFrom": {
|
38647
|
+
"name": "Popover",
|
38648
|
+
"module": "components/popover/popover.component.js"
|
38649
|
+
}
|
38650
|
+
},
|
38615
38651
|
{
|
38616
38652
|
"kind": "field",
|
38617
38653
|
"name": "startCloseDelay",
|
@@ -40602,6 +40638,16 @@
|
|
40602
40638
|
"module": "components/popover/popover.component.js"
|
40603
40639
|
}
|
40604
40640
|
},
|
40641
|
+
{
|
40642
|
+
"kind": "field",
|
40643
|
+
"name": "handleFocusIn",
|
40644
|
+
"privacy": "private",
|
40645
|
+
"description": "Handles focus in event on the trigger element.\nThis method checks if the trigger element has visible focus or is being hovered.",
|
40646
|
+
"inheritedFrom": {
|
40647
|
+
"name": "Popover",
|
40648
|
+
"module": "components/popover/popover.component.js"
|
40649
|
+
}
|
40650
|
+
},
|
40605
40651
|
{
|
40606
40652
|
"kind": "field",
|
40607
40653
|
"name": "startCloseDelay",
|