@brightspace-ui/core 3.204.4 → 3.204.6

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.
@@ -351,7 +351,7 @@ export const PopoverMixin = superclass => class extends superclass {
351
351
  this._opened = true;
352
352
 
353
353
  await this.updateComplete; // wait for popover attribute before managing top-layer
354
- if (this._useNativePopover) this.showPopover();
354
+ if (this.isConnected && this._useNativePopover) this.showPopover();
355
355
 
356
356
  this._previousFocusableAncestor = getPreviousFocusableAncestor(this, false, false);
357
357
 
@@ -2,19 +2,13 @@ import '../colors/colors.js';
2
2
  import '../icons/icon.js';
3
3
  import { css, html, LitElement } from 'lit';
4
4
  import { classMap } from 'lit/directives/class-map.js';
5
- import { getFlag } from '../../helpers/flags.js';
6
5
  import { getFocusRingStyles } from '../../helpers/focus.js';
7
6
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
8
7
  import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
9
8
 
10
- export const printMediaQueryOnlyFlag = getFlag('GAUD-8263-scroll-wrapper-media-print', true);
11
-
12
9
  const RTL_MULTIPLIER = navigator.userAgent.indexOf('Edge/') > 0 ? 1 : -1; /* legacy-Edge doesn't reverse scrolling in RTL */
13
10
  const SCROLL_AMOUNT = 0.8;
14
11
 
15
- // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
16
- const PRINT_MEDIA_QUERY_LIST = matchMedia('print');
17
-
18
12
  let focusStyleSheet;
19
13
  function getFocusStyleSheet() {
20
14
  if (!focusStyleSheet) {
@@ -69,7 +63,6 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
69
63
  reflect: true,
70
64
  type: Boolean
71
65
  },
72
- _printMode: { state: true },
73
66
  _scrollbarLeft: {
74
67
  attribute: 'scrollbar-left',
75
68
  reflect: true,
@@ -148,18 +141,15 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
148
141
  }
149
142
 
150
143
  @media print {
151
- /* remove .print-media-query-only when cleaning up GAUD-8263-scroll-wrapper-media-print */
152
- .d2l-scroll-wrapper-actions.print-media-query-only {
144
+ .d2l-scroll-wrapper-actions {
153
145
  display: none;
154
146
  }
155
- /* remove .print-media-query-only when cleaning up GAUD-8263-scroll-wrapper-media-print */
156
- .d2l-scroll-wrapper-container.print-media-query-only {
147
+ .d2l-scroll-wrapper-container {
157
148
  border: none !important;
158
149
  box-sizing: content-box !important;
159
150
  overflow: visible !important;
160
151
  }
161
152
  }
162
-
163
153
  `;
164
154
  }
165
155
 
@@ -172,9 +162,6 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
172
162
  this._container = null;
173
163
  this._hScrollbar = true;
174
164
 
175
- // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
176
- this._printMode = PRINT_MEDIA_QUERY_LIST.matches;
177
-
178
165
  this._resizeObserver = new ResizeObserver(() => requestAnimationFrame(() => this.checkScrollbar()));
179
166
  this._scrollbarLeft = false;
180
167
  this._scrollbarRight = false;
@@ -182,29 +169,12 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
182
169
  this._syncDriverTimeout = null;
183
170
  this._checkScrollThresholds = this._checkScrollThresholds.bind(this);
184
171
 
185
- // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
186
- this._handlePrintChange = this._handlePrintChange.bind(this);
187
-
188
172
  this._synchronizeScroll = this._synchronizeScroll.bind(this);
189
173
  }
190
174
 
191
- connectedCallback() {
192
- super.connectedCallback();
193
-
194
- // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
195
- if (!printMediaQueryOnlyFlag) {
196
- PRINT_MEDIA_QUERY_LIST.addEventListener?.('change', this._handlePrintChange);
197
- }
198
- }
199
-
200
175
  disconnectedCallback() {
201
176
  super.disconnectedCallback();
202
177
  this._disconnectAll();
203
-
204
- // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
205
- if (!printMediaQueryOnlyFlag) {
206
- PRINT_MEDIA_QUERY_LIST.removeEventListener?.('change', this._handlePrintChange);
207
- }
208
178
  }
209
179
 
210
180
  firstUpdated(changedProperties) {
@@ -213,17 +183,11 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
213
183
  }
214
184
 
215
185
  render() {
216
-
217
- // when printing, just get scroll-wrapper out of the way; remove when cleaning up GAUD-8263-scroll-wrapper-media-print
218
- if (this._printMode && !printMediaQueryOnlyFlag) return html`<slot></slot>`;
219
-
220
186
  const containerClasses = {
221
- 'd2l-scroll-wrapper-container': true,
222
- 'print-media-query-only': printMediaQueryOnlyFlag // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
187
+ 'd2l-scroll-wrapper-container': true
223
188
  };
224
189
  const actionsClasses = {
225
- 'd2l-scroll-wrapper-actions': true,
226
- 'print-media-query-only': printMediaQueryOnlyFlag // remove when cleaning up GAUD-8263-scroll-wrapper-media-print
190
+ 'd2l-scroll-wrapper-actions': true
227
191
  };
228
192
  const isRtl = document.documentElement.getAttribute('dir') === 'rtl';
229
193
  const leftScrollLabel = this.localize('components.scroll-wrapper.scroll-left');
@@ -296,18 +260,6 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
296
260
  }
297
261
  }
298
262
 
299
- // remove this handler when cleaning up GAUD-8263-scroll-wrapper-media-print
300
- async _handlePrintChange() {
301
- if (!this._printMode) {
302
- this._disconnectAll();
303
- }
304
- this._printMode = PRINT_MEDIA_QUERY_LIST.matches;
305
- if (!this._printMode) {
306
- await this.updateComplete;
307
- this._updateScrollTargets();
308
- }
309
- }
310
-
311
263
  _scrollLeft() {
312
264
  if (!this._container) return;
313
265
  const scrollDistance = this._container.clientWidth * SCROLL_AMOUNT * -1;
@@ -334,8 +286,6 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
334
286
  _updateScrollTargets() {
335
287
  this._disconnectAll();
336
288
 
337
- if (this._printMode) return;
338
-
339
289
  this._baseContainer = this.shadowRoot.querySelector('.d2l-scroll-wrapper-container');
340
290
  this._container = this.customScrollers?.primary || this._baseContainer;
341
291
  this._secondaryScrollers = this.customScrollers?.secondary || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.204.4",
3
+ "version": "3.204.6",
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",