@brightspace-ui/core 3.269.3 → 3.269.5

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.
@@ -175,16 +175,6 @@ class Tooltip extends PopoverMixin(LitElement) {
175
175
  this.offset = 10;
176
176
  this.showTruncatedOnly = false;
177
177
  this.state = 'info';
178
-
179
- this.#handleTargetBlurBound = this.#handleTargetBlur.bind(this);
180
- this.#handleTargetClickBound = this.#handleTargetClick.bind(this);
181
- this.#handleTargetFocusBound = this.#handleTargetFocus.bind(this);
182
- this.#handleTargetMouseEnterBound = this.#handleTargetMouseEnter.bind(this);
183
- this.#handleTargetMouseLeaveBound = this.#handleTargetMouseLeave.bind(this);
184
- this.#handleTargetMutationBound = this.#handleTargetMutation.bind(this);
185
- this.#handleTargetResizeBound = this.#handleTargetResize.bind(this);
186
- this.#handleTargetTouchEndBound = this.#handleTargetTouchEnd.bind(this);
187
- this.#handleTargetTouchStartBound = this.#handleTargetTouchStart.bind(this);
188
178
  }
189
179
 
190
180
  /** @ignore */
@@ -204,7 +194,7 @@ class Tooltip extends PopoverMixin(LitElement) {
204
194
  super.connectedCallback();
205
195
  this.showing = false;
206
196
  this.#addListeners();
207
- window.addEventListener('resize', this.#handleTargetResizeBound);
197
+ window.addEventListener('resize', this.#handleTargetResize);
208
198
 
209
199
  requestAnimationFrame(() => this.#updateTarget());
210
200
  }
@@ -214,7 +204,7 @@ class Tooltip extends PopoverMixin(LitElement) {
214
204
  if (activeTooltip === this) activeTooltip = null;
215
205
 
216
206
  this.#removeListeners();
217
- window.removeEventListener('resize', this.#handleTargetResizeBound);
207
+ window.removeEventListener('resize', this.#handleTargetResize);
218
208
 
219
209
  delayTimeoutId = null;
220
210
 
@@ -273,15 +263,6 @@ class Tooltip extends PopoverMixin(LitElement) {
273
263
  return super.position();
274
264
  }
275
265
 
276
- #handleTargetBlurBound;
277
- #handleTargetClickBound;
278
- #handleTargetFocusBound;
279
- #handleTargetMouseEnterBound;
280
- #handleTargetMouseLeaveBound;
281
- #handleTargetMutationBound;
282
- #handleTargetResizeBound;
283
- #handleTargetTouchEndBound;
284
- #handleTargetTouchStartBound;
285
266
  #hoverTimeout;
286
267
  #isFocusing = false;
287
268
  #isHovering = false;
@@ -296,6 +277,77 @@ class Tooltip extends PopoverMixin(LitElement) {
296
277
  #targetSizeObserver;
297
278
  #targetMutationObserver;
298
279
 
280
+ #handleTargetBlur = () => {
281
+ this.#isFocusing = false;
282
+ this.#updateShowing();
283
+ };
284
+
285
+ #handleTargetClick = () => {
286
+ if (this.closeOnClick) this.hide();
287
+ };
288
+
289
+ #handleTargetFocus = async() => {
290
+ if (this.showTruncatedOnly) {
291
+ await this.#updateTruncating();
292
+ if (!this.#isTruncating) return;
293
+ }
294
+
295
+ if (this.disableFocusLock) {
296
+ this.showing = true;
297
+ } else {
298
+ this.#isFocusing = true;
299
+ this.#updateShowing();
300
+ }
301
+ };
302
+
303
+ #handleTargetMouseEnter = () => {
304
+ // came from tooltip so keep showing
305
+ if (this.#mouseLeftTooltip) {
306
+ this.#isHovering = true;
307
+ return;
308
+ }
309
+
310
+ this.#hoverTimeout = setTimeout(async() => {
311
+ if (this.showTruncatedOnly) {
312
+ await this.#updateTruncating();
313
+ if (!this.#isTruncating) return;
314
+ }
315
+
316
+ this.#isHovering = true;
317
+ this.#updateShowing();
318
+ }, getDelay(this.delay));
319
+ };
320
+
321
+ #handleTargetMouseLeave = () => {
322
+ clearTimeout(this.#hoverTimeout);
323
+ this.#isHovering = false;
324
+ if (this.showing) resetDelayTimeout();
325
+ setTimeout(() => this.#updateShowing(), 100); // delay to allow for mouseenter to fire if hovering on tooltip
326
+ };
327
+
328
+ #handleTargetMutation = ([m]) => {
329
+ if (!this.#target.isConnected || (m.target === this.#target && m.attributeName === 'id')) {
330
+ this.#targetMutationObserver.disconnect();
331
+ this.#updateTarget();
332
+ }
333
+ };
334
+
335
+ #handleTargetResize = () => {
336
+ this.#resizeRunSinceTruncationCheck = true;
337
+ if (!this.showing) return;
338
+ super.position();
339
+ };
340
+
341
+ #handleTargetTouchEnd = () => {
342
+ clearTimeout(this.#longPressTimeout);
343
+ };
344
+
345
+ #handleTargetTouchStart = () => {
346
+ this.#longPressTimeout = setTimeout(() => {
347
+ this.#target.focus();
348
+ }, 500);
349
+ };
350
+
299
351
  // for testing only!
300
352
  _getTarget() {
301
353
  return this.#target;
@@ -324,19 +376,19 @@ class Tooltip extends PopoverMixin(LitElement) {
324
376
 
325
377
  if (!this.#target) return;
326
378
 
327
- this.#target.addEventListener('mouseenter', this.#handleTargetMouseEnterBound);
328
- this.#target.addEventListener('mouseleave', this.#handleTargetMouseLeaveBound);
329
- this.#target.addEventListener('focus', this.#handleTargetFocusBound);
330
- this.#target.addEventListener('blur', this.#handleTargetBlurBound);
331
- this.#target.addEventListener('click', this.#handleTargetClickBound);
332
- this.#target.addEventListener('touchstart', this.#handleTargetTouchStartBound, { passive: true });
333
- this.#target.addEventListener('touchcancel', this.#handleTargetTouchEndBound);
334
- this.#target.addEventListener('touchend', this.#handleTargetTouchEndBound);
379
+ this.#target.addEventListener('mouseenter', this.#handleTargetMouseEnter);
380
+ this.#target.addEventListener('mouseleave', this.#handleTargetMouseLeave);
381
+ this.#target.addEventListener('focus', this.#handleTargetFocus);
382
+ this.#target.addEventListener('blur', this.#handleTargetBlur);
383
+ this.#target.addEventListener('click', this.#handleTargetClick);
384
+ this.#target.addEventListener('touchstart', this.#handleTargetTouchStart, { passive: true });
385
+ this.#target.addEventListener('touchcancel', this.#handleTargetTouchEnd);
386
+ this.#target.addEventListener('touchend', this.#handleTargetTouchEnd);
335
387
 
336
- this.#targetSizeObserver = new ResizeObserver(this.#handleTargetResizeBound);
388
+ this.#targetSizeObserver = new ResizeObserver(this.#handleTargetResize);
337
389
  this.#targetSizeObserver.observe(this.#target);
338
390
 
339
- this.#targetMutationObserver = new MutationObserver(this.#handleTargetMutationBound);
391
+ this.#targetMutationObserver = new MutationObserver(this.#handleTargetMutation);
340
392
  this.#targetMutationObserver.observe(this.#target, { attributes: true, attributeFilter: ['id'] });
341
393
  this.#targetMutationObserver.observe(this.#target.parentNode, { childList: true });
342
394
  }
@@ -361,77 +413,6 @@ class Tooltip extends PopoverMixin(LitElement) {
361
413
  return target;
362
414
  }
363
415
 
364
- #handleTargetBlur() {
365
- this.#isFocusing = false;
366
- this.#updateShowing();
367
- }
368
-
369
- #handleTargetClick() {
370
- if (this.closeOnClick) this.hide();
371
- }
372
-
373
- async #handleTargetFocus() {
374
- if (this.showTruncatedOnly) {
375
- await this.#updateTruncating();
376
- if (!this.#isTruncating) return;
377
- }
378
-
379
- if (this.disableFocusLock) {
380
- this.showing = true;
381
- } else {
382
- this.#isFocusing = true;
383
- this.#updateShowing();
384
- }
385
- }
386
-
387
- #handleTargetMouseEnter() {
388
- // came from tooltip so keep showing
389
- if (this.#mouseLeftTooltip) {
390
- this.#isHovering = true;
391
- return;
392
- }
393
-
394
- this.#hoverTimeout = setTimeout(async() => {
395
- if (this.showTruncatedOnly) {
396
- await this.#updateTruncating();
397
- if (!this.#isTruncating) return;
398
- }
399
-
400
- this.#isHovering = true;
401
- this.#updateShowing();
402
- }, getDelay(this.delay));
403
- }
404
-
405
- #handleTargetMouseLeave() {
406
- clearTimeout(this.#hoverTimeout);
407
- this.#isHovering = false;
408
- if (this.showing) resetDelayTimeout();
409
- setTimeout(() => this.#updateShowing(), 100); // delay to allow for mouseenter to fire if hovering on tooltip
410
- }
411
-
412
- #handleTargetMutation([m]) {
413
- if (!this.#target.isConnected || (m.target === this.#target && m.attributeName === 'id')) {
414
- this.#targetMutationObserver.disconnect();
415
- this.#updateTarget();
416
- }
417
- }
418
-
419
- #handleTargetResize() {
420
- this.#resizeRunSinceTruncationCheck = true;
421
- if (!this.showing) return;
422
- super.position();
423
- }
424
-
425
- #handleTargetTouchEnd() {
426
- clearTimeout(this.#longPressTimeout);
427
- }
428
-
429
- #handleTargetTouchStart() {
430
- this.#longPressTimeout = setTimeout(() => {
431
- this.#target.focus();
432
- }, 500);
433
- }
434
-
435
416
  #handleTooltipMouseEnter() {
436
417
  if (!this.showing) return;
437
418
  this.#isHoveringTooltip = true;
@@ -456,14 +437,14 @@ class Tooltip extends PopoverMixin(LitElement) {
456
437
 
457
438
  if (!this.#target) return;
458
439
 
459
- this.#target.removeEventListener('mouseenter', this.#handleTargetMouseEnterBound);
460
- this.#target.removeEventListener('mouseleave', this.#handleTargetMouseLeaveBound);
461
- this.#target.removeEventListener('focus', this.#handleTargetFocusBound);
462
- this.#target.removeEventListener('blur', this.#handleTargetBlurBound);
463
- this.#target.removeEventListener('click', this.#handleTargetClickBound);
464
- this.#target.removeEventListener('touchstart', this.#handleTargetTouchStartBound);
465
- this.#target.removeEventListener('touchcancel', this.#handleTargetTouchEndBound);
466
- this.#target.removeEventListener('touchend', this.#handleTargetTouchEndBound);
440
+ this.#target.removeEventListener('mouseenter', this.#handleTargetMouseEnter);
441
+ this.#target.removeEventListener('mouseleave', this.#handleTargetMouseLeave);
442
+ this.#target.removeEventListener('focus', this.#handleTargetFocus);
443
+ this.#target.removeEventListener('blur', this.#handleTargetBlur);
444
+ this.#target.removeEventListener('click', this.#handleTargetClick);
445
+ this.#target.removeEventListener('touchstart', this.#handleTargetTouchStart);
446
+ this.#target.removeEventListener('touchcancel', this.#handleTargetTouchEnd);
447
+ this.#target.removeEventListener('touchend', this.#handleTargetTouchEnd);
467
448
 
468
449
  if (this.#targetSizeObserver) {
469
450
  this.#targetSizeObserver.disconnect();
@@ -550,7 +531,7 @@ class Tooltip extends PopoverMixin(LitElement) {
550
531
  if (!super._opened) super.open(this.#target, false);
551
532
  else super.position();
552
533
  } else if (!targetDisabled && isComposedAncestor(this.#target, getComposedActiveElement())) {
553
- this.#handleTargetFocusBound();
534
+ this.#handleTargetFocus();
554
535
  }
555
536
  }
556
537
  this.#addListeners();
@@ -6489,7 +6489,7 @@
6489
6489
  {
6490
6490
  "name": "styles",
6491
6491
  "type": "CSSResult",
6492
- "default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\t--d2l-page-header-max-width: 1230px;\\n\\t\\t\\t--d2l-page-content-max-width: 1230px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1230px;\\n\\t\\t\\t--d2l-page-margin-inline: auto;\\n\\t\\t\\t--d2l-page-padding: 30px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"wide\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 1440px;\\n\\t\\t\\t--d2l-page-content-max-width: 1440px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1440px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"fullscreen\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 100%;\\n\\t\\t\\t--d2l-page-content-max-width: 100%;\\n\\t\\t\\t--d2l-page-footer-max-width: 100%;\\n\\t\\t}\\n\\n\\t\\t@media (max-width: 929px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 24px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t@media (max-width: 767px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 18px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t.header {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 15; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\n\\t\\t.page.header-sticky .header {\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: 0;\\n\\t\\t}\\n\\n\\t\\t.content {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-content-max-width, 100%);\\n\\t\\t\\tpadding-bottom: var(--d2l-page-footer-height, 0); /* Reserve space for fixed footer */\\n\\t\\t}\\n\\n\\t\\tmain {\\n\\t\\t\\tflex: 1;\\n\\t\\t\\tmin-width: min(${MAIN_MIN_WIDTH}px, 100%);\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel {\\n\\t\\t\\theight: calc(100vh - var(--d2l-page-header-height, 0) - var(--d2l-page-footer-height, 0));\\n\\t\\t\\toverflow: clip auto;\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: var(--d2l-page-header-height, 0);\\n\\t\\t}\\n\\n\\t\\t.footer:not([hidden]),\\n\\t\\t.floating-buttons-container {\\n\\t\\t\\tdisplay: inline;\\n\\t\\t}\\n\\t\\t.fixed-footer {\\n\\t\\t\\tbackground-color: white;\\n\\t\\t\\tbox-shadow: 0 -2px 4px rgba(32, 33, 34, 0.2); /* ferrite */\\n\\t\\t\\tinset: auto 0 0;\\n\\t\\t\\tpadding-block-start: 0.75rem;\\n\\t\\t\\tposition: fixed;\\n\\t\\t\\tz-index: 10; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\t\\t.footer-contents {\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-footer-max-width, 100%);\\n\\t\\t}\\n\\t`\""
6492
+ "default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\t--d2l-page-header-max-width: 1230px;\\n\\t\\t\\t--d2l-page-content-max-width: 1230px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1230px;\\n\\t\\t\\t--d2l-page-margin-inline: auto;\\n\\t\\t\\t--d2l-page-padding: 30px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"wide\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 1440px;\\n\\t\\t\\t--d2l-page-content-max-width: 1440px;\\n\\t\\t\\t--d2l-page-footer-max-width: 1440px;\\n\\t\\t}\\n\\n\\t\\t:host([width-type=\\\"fullscreen\\\"]) {\\n\\t\\t\\t--d2l-page-header-max-width: 100%;\\n\\t\\t\\t--d2l-page-content-max-width: 100%;\\n\\t\\t\\t--d2l-page-footer-max-width: 100%;\\n\\t\\t}\\n\\n\\t\\t@media (max-width: 929px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 24px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t@media (max-width: 767px) {\\n\\t\\t\\t:host {\\n\\t\\t\\t\\t--d2l-page-padding: 18px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t.header {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\tz-index: 15; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\n\\t\\t.page.header-sticky .header {\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: 0;\\n\\t\\t}\\n\\n\\t\\t.content {\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-content-max-width, 100%);\\n\\t\\t\\tpadding-bottom: var(--d2l-page-footer-height, 0); /* Reserve space for fixed footer */\\n\\t\\t}\\n\\t\\t.content.has-panels {\\n\\t\\t\\tmin-height: calc(100vh - var(--d2l-page-header-height-measured, 0px));\\n\\t\\t}\\n\\n\\t\\tmain {\\n\\t\\t\\tflex: 1;\\n\\t\\t\\tmin-width: min(${MAIN_MIN_WIDTH}px, 100%);\\n\\t\\t}\\n\\n\\t\\t.side-nav-panel,\\n\\t\\t.supporting-panel {\\n\\t\\t\\tmax-height: calc(100vh - var(--d2l-page-header-height, 0) - var(--d2l-page-footer-height, 0));\\n\\t\\t\\toverflow: clip auto;\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: var(--d2l-page-header-height, 0);\\n\\t\\t}\\n\\n\\t\\t.footer:not([hidden]),\\n\\t\\t.floating-buttons-container {\\n\\t\\t\\tdisplay: inline;\\n\\t\\t}\\n\\t\\t.fixed-footer {\\n\\t\\t\\tbackground-color: white;\\n\\t\\t\\tbox-shadow: 0 -2px 4px rgba(32, 33, 34, 0.2); /* ferrite */\\n\\t\\t\\tinset: auto 0 0;\\n\\t\\t\\tpadding-block-start: 0.75rem;\\n\\t\\t\\tposition: fixed;\\n\\t\\t\\tz-index: 10; /* To be over sticky content of our core components */\\n\\t\\t}\\n\\t\\t.footer-contents {\\n\\t\\t\\tmargin-inline: var(--d2l-page-margin-inline, 0);\\n\\t\\t\\tmax-width: var(--d2l-page-footer-max-width, 100%);\\n\\t\\t}\\n\\t`\""
6493
6493
  },
6494
6494
  {
6495
6495
  "name": "widthType",
@@ -14,26 +14,25 @@ export const RtlMixin = dedupeMixin(superclass => class extends superclass {
14
14
  constructor() {
15
15
  super();
16
16
  this._localeSettings = getDocumentLocaleSettings();
17
- this._handleLanguageChange = this._handleLanguageChange.bind(this);
18
- this._handleLanguageChange();
17
+ this.#handleLanguageChange();
19
18
  }
20
19
 
21
20
  connectedCallback() {
22
21
  super.connectedCallback();
23
- this._localeSettings.addChangeListener(this._handleLanguageChange);
22
+ this._localeSettings.addChangeListener(this.#handleLanguageChange);
24
23
  }
25
24
 
26
25
  disconnectedCallback() {
27
26
  super.disconnectedCallback();
28
- this._localeSettings.removeChangeListener(this._handleLanguageChange);
27
+ this._localeSettings.removeChangeListener(this.#handleLanguageChange);
29
28
  }
30
29
 
31
- _handleLanguageChange() {
30
+ #handleLanguageChange = () => {
32
31
  const dir = document.documentElement.getAttribute('dir');
33
32
  // avoid reflecting "ltr" for better performance
34
33
  if (dir && (dir !== 'ltr' || this.dir === 'rtl')) {
35
34
  this.dir = dir;
36
35
  }
37
- }
36
+ };
38
37
 
39
38
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.269.3",
3
+ "version": "3.269.5",
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",