@brightspace-ui/core 2.160.0 → 2.160.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.
@@ -49,6 +49,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
49
49
|
_isFullHeight: { state: true },
|
50
50
|
_left: { state: true },
|
51
51
|
_margin: { state: true },
|
52
|
+
_mobileDropdownShowing: { state: true },
|
52
53
|
_nestedShowing: { state: true },
|
53
54
|
_overflowBottom: { state: true },
|
54
55
|
_overflowTop: { state: true },
|
@@ -67,12 +68,14 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
67
68
|
this._autoSize = true;
|
68
69
|
this._dialogId = getUniqueId();
|
69
70
|
this._fullscreenWithin = 0;
|
71
|
+
this._handleDropdownOpenClose = this._handleDropdownOpenClose.bind(this);
|
70
72
|
this._handleMvcDialogOpen = this._handleMvcDialogOpen.bind(this);
|
71
73
|
this._inIframe = false;
|
72
74
|
this._isFullHeight = false;
|
73
75
|
this._height = 0;
|
74
76
|
this._left = 0;
|
75
77
|
this._margin = { top: defaultMargin.top, right: defaultMargin.right, bottom: defaultMargin.bottom, left: defaultMargin.left };
|
78
|
+
this._mobileDropdownShowing = false;
|
76
79
|
this._nestedShowing = false;
|
77
80
|
this._overflowBottom = false;
|
78
81
|
this._overflowTop = false;
|
@@ -143,6 +146,8 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
143
146
|
_addHandlers() {
|
144
147
|
window.addEventListener('resize', this._updateSize);
|
145
148
|
this.addEventListener('touchstart', this._handleTouchStart);
|
149
|
+
this.addEventListener('d2l-dropdown-open', this._handleDropdownOpenClose, { capture: true });
|
150
|
+
this.addEventListener('d2l-dropdown-close', this._handleDropdownOpenClose, { capture: true });
|
146
151
|
if (this.shadowRoot) this.shadowRoot.querySelector('.d2l-dialog-content').addEventListener('scroll', this._updateOverflow);
|
147
152
|
}
|
148
153
|
|
@@ -331,6 +336,10 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
331
336
|
e.stopPropagation();
|
332
337
|
}
|
333
338
|
|
339
|
+
_handleDropdownOpenClose(e) {
|
340
|
+
this._mobileDropdownShowing = e.composedPath()[0]._useMobileStyling;
|
341
|
+
}
|
342
|
+
|
334
343
|
_handleFocusTrapEnter(e) {
|
335
344
|
// ignore focus trap events when the target is another element
|
336
345
|
// to prevent infinite focus loops
|
@@ -449,6 +458,8 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
449
458
|
_removeHandlers() {
|
450
459
|
window.removeEventListener('resize', this._updateSize);
|
451
460
|
this.removeEventListener('touchstart', this._handleTouchStart);
|
461
|
+
this.removeEventListener('d2l-dropdown-open', this._handleDropdownOpenClose, { capture: true });
|
462
|
+
this.removeEventListener('d2l-dropdown-close', this._handleDropdownOpenClose, { capture: true });
|
452
463
|
if (this.shadowRoot) this.shadowRoot.querySelector('.d2l-dialog-content').removeEventListener('scroll', this._updateOverflow);
|
453
464
|
}
|
454
465
|
|
@@ -477,7 +488,8 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
|
|
477
488
|
'd2l-dialog-outer-nested-showing': !this._useNative && this._nestedShowing,
|
478
489
|
'd2l-dialog-outer-scroll': this._scroll,
|
479
490
|
'd2l-dialog-fullscreen-mobile': info.fullscreenMobile,
|
480
|
-
'd2l-dialog-fullscreen-within': this._fullscreenWithin !== 0
|
491
|
+
'd2l-dialog-fullscreen-within': this._fullscreenWithin !== 0,
|
492
|
+
'd2l-dialog-dropdown-mobile': this._mobileDropdownShowing
|
481
493
|
};
|
482
494
|
|
483
495
|
return html`${this._useNative ?
|
@@ -131,6 +131,10 @@ export const dialogStyles = css`
|
|
131
131
|
overflow: auto;
|
132
132
|
}
|
133
133
|
|
134
|
+
.d2l-dialog-dropdown-mobile .d2l-dialog-content {
|
135
|
+
overflow: hidden; /* workaround to fix clipping of nested fixed position elements with overlowing content in Safari bug: https://bugs.webkit.org/show_bug.cgi?id=160953 */
|
136
|
+
}
|
137
|
+
|
134
138
|
.d2l-dialog-footer {
|
135
139
|
box-sizing: border-box;
|
136
140
|
flex: none;
|
@@ -335,6 +335,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
|
|
335
335
|
opacity: 0;
|
336
336
|
}
|
337
337
|
:host([selected]) d2l-list-item-drag-handle,
|
338
|
+
d2l-list-item-drag-handle:hover,
|
338
339
|
d2l-list-item-drag-handle.d2l-hovering,
|
339
340
|
d2l-list-item-drag-handle.d2l-focusing {
|
340
341
|
opacity: 1;
|
@@ -72,6 +72,7 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
72
72
|
:host {
|
73
73
|
display: flex;
|
74
74
|
margin: 0.25rem;
|
75
|
+
pointer-events: auto; /* required since its parent may set point-events: none; (see generic layout) */
|
75
76
|
}
|
76
77
|
:host([hidden]) {
|
77
78
|
display: none;
|
@@ -181,25 +182,6 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
181
182
|
this.activateKeyboardMode();
|
182
183
|
}
|
183
184
|
|
184
|
-
_onKeyboardButtonFocusIn() {
|
185
|
-
if (hasDisplayedKeyboardTooltip) return;
|
186
|
-
this._displayKeyboardTooltip = true;
|
187
|
-
hasDisplayedKeyboardTooltip = true;
|
188
|
-
}
|
189
|
-
|
190
|
-
_onKeyboardButtonFocusOut(e) {
|
191
|
-
this._displayKeyboardTooltip = false;
|
192
|
-
if (this._movingElement) {
|
193
|
-
this._movingElement = false;
|
194
|
-
e.stopPropagation();
|
195
|
-
e.preventDefault();
|
196
|
-
return;
|
197
|
-
}
|
198
|
-
this._keyboardActive = false;
|
199
|
-
this._dispatchAction(dragActions.save);
|
200
|
-
e.stopPropagation();
|
201
|
-
}
|
202
|
-
|
203
185
|
async _onMoveButtonAction(e) {
|
204
186
|
|
205
187
|
let action = null;
|
@@ -245,6 +227,25 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
245
227
|
|
246
228
|
}
|
247
229
|
|
230
|
+
_onMoveButtonFocusIn() {
|
231
|
+
if (hasDisplayedKeyboardTooltip) return;
|
232
|
+
this._displayKeyboardTooltip = true;
|
233
|
+
hasDisplayedKeyboardTooltip = true;
|
234
|
+
}
|
235
|
+
|
236
|
+
_onMoveButtonFocusOut(e) {
|
237
|
+
this._displayKeyboardTooltip = false;
|
238
|
+
if (this._movingElement) {
|
239
|
+
this._movingElement = false;
|
240
|
+
e.stopPropagation();
|
241
|
+
e.preventDefault();
|
242
|
+
return;
|
243
|
+
}
|
244
|
+
this._keyboardActive = false;
|
245
|
+
this._dispatchAction(dragActions.save);
|
246
|
+
e.stopPropagation();
|
247
|
+
}
|
248
|
+
|
248
249
|
async _onMoveButtonKeydown(e) {
|
249
250
|
if (!this._keyboardActive) {
|
250
251
|
return;
|
@@ -274,6 +275,10 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
274
275
|
|
275
276
|
}
|
276
277
|
|
278
|
+
_onMoveButtonMouseDown(e) {
|
279
|
+
e.preventDefault();
|
280
|
+
}
|
281
|
+
|
277
282
|
_renderDragger() {
|
278
283
|
return html`
|
279
284
|
<button
|
@@ -292,10 +297,11 @@ class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElem
|
|
292
297
|
<d2l-button-move
|
293
298
|
class="d2l-list-item-drag-handle-button"
|
294
299
|
@d2l-button-move-action="${this._onMoveButtonAction}"
|
295
|
-
@focusin="${this.
|
296
|
-
@focusout="${this.
|
300
|
+
@focusin="${this._onMoveButtonFocusIn}"
|
301
|
+
@focusout="${this._onMoveButtonFocusOut}"
|
297
302
|
id="${this._buttonId}"
|
298
303
|
@keydown="${this._onMoveButtonKeydown}"
|
304
|
+
@mousedown="${this._onMoveButtonMouseDown}"
|
299
305
|
text="${this._defaultLabel}">
|
300
306
|
</d2l-button-move>
|
301
307
|
${this._displayKeyboardTooltip ? html`<d2l-tooltip class="vdiff-target" align="start" announced for="${this._buttonId}" for-type="descriptor">${this._renderTooltipContent()}</d2l-tooltip>` : ''}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "2.160.
|
3
|
+
"version": "2.160.2",
|
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",
|