@brightspace-ui/core 3.21.3 → 3.21.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.
- package/components/popover/popover-mixin.js +10 -0
- package/lang/en.js +2 -2
- package/package.json +1 -1
@@ -1,4 +1,5 @@
|
|
1
1
|
import '../colors/colors.js';
|
2
|
+
import { clearDismissible, setDismissible } from '../../helpers/dismissible.js';
|
2
3
|
import { css, html } from 'lit';
|
3
4
|
import { getComposedActiveElement, getPreviousFocusableAncestor } from '../../helpers/focus.js';
|
4
5
|
import { isComposedAncestor } from '../../helpers/dom.js';
|
@@ -84,6 +85,7 @@ export const PopoverMixin = superclass => class extends superclass {
|
|
84
85
|
disconnectedCallback() {
|
85
86
|
super.disconnectedCallback();
|
86
87
|
this._removeAutoCloseHandlers();
|
88
|
+
this._clearDismissible();
|
87
89
|
}
|
88
90
|
|
89
91
|
updated(changedProperties) {
|
@@ -100,9 +102,11 @@ export const PopoverMixin = superclass => class extends superclass {
|
|
100
102
|
if (this.opened) {
|
101
103
|
this._opener = getComposedActiveElement();
|
102
104
|
this._addAutoCloseHandlers();
|
105
|
+
this._dismissibleId = setDismissible(() => this._close());
|
103
106
|
this.dispatchEvent(new CustomEvent('d2l-popover-open', { bubbles: true, composed: true }));
|
104
107
|
} else if (changedProperties.get('opened') !== undefined) {
|
105
108
|
this._removeAutoCloseHandlers();
|
109
|
+
this._clearDismissible();
|
106
110
|
this.dispatchEvent(new CustomEvent('d2l-popover-close', { bubbles: true, composed: true }));
|
107
111
|
}
|
108
112
|
|
@@ -115,6 +119,12 @@ export const PopoverMixin = superclass => class extends superclass {
|
|
115
119
|
document.addEventListener('click', this._handleAutoCloseClick, { capture: true });
|
116
120
|
}
|
117
121
|
|
122
|
+
_clearDismissible() {
|
123
|
+
if (!this._dismissibleId) return;
|
124
|
+
clearDismissible(this._dismissibleId);
|
125
|
+
this._dismissibleId = null;
|
126
|
+
}
|
127
|
+
|
118
128
|
_close() {
|
119
129
|
const hide = () => {
|
120
130
|
this.opened = false;
|
package/lang/en.js
CHANGED
@@ -29,8 +29,8 @@ export default {
|
|
29
29
|
"components.filter-dimension-set-date-text-value.textDays": "{num, plural, =0 {Today} one {Last {num} day} other {Last {num} days}}",
|
30
30
|
"components.filter-dimension-set-date-text-value.textMonths": "Last {num} months",
|
31
31
|
"components.filter-dimension-set-date-time-range-value.valueTextRange": "{startValue} to {endValue}",
|
32
|
-
"components.filter-dimension-set-date-time-range-value.valueTextRangeStartOnly": "Start: {startValue}",
|
33
|
-
"components.filter-dimension-set-date-time-range-value.valueTextRangeEndOnly": "End: {endValue}",
|
32
|
+
"components.filter-dimension-set-date-time-range-value.valueTextRangeStartOnly": "Start Date: {startValue}",
|
33
|
+
"components.filter-dimension-set-date-time-range-value.valueTextRangeEndOnly": "End Date: {endValue}",
|
34
34
|
"components.filter-dimension-set-date-time-range-value.text": "Custom date range",
|
35
35
|
"components.form-element.defaultError": "{label} is invalid.",
|
36
36
|
"components.form-element.defaultFieldLabel": "Field",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.21.
|
3
|
+
"version": "3.21.4",
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
5
5
|
"type": "module",
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|