@brightspace-ui/core 3.344.4 → 3.344.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.
@@ -6,7 +6,7 @@ import { getFocusRingStyles } from '../../helpers/focus.js';
6
6
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
7
7
 
8
8
  const RTL_MULTIPLIER = navigator.userAgent.indexOf('Edge/') > 0 ? 1 : -1; /* legacy-Edge doesn't reverse scrolling in RTL */
9
- const SCROLL_AMOUNT = 0.8;
9
+ export const SCROLL_AMOUNT = 0.8;
10
10
 
11
11
  let focusStyleSheet;
12
12
  function getFocusStyleSheet() {
@@ -211,6 +211,11 @@ class ScrollWrapper extends LocalizeCoreElement(LitElement) {
211
211
 
212
212
  if (changedProperties.has('customScrollers')) this._updateScrollTargets();
213
213
  if (changedProperties.has('_hScrollbar')) this._updateTabIndex();
214
+ if (changedProperties.has('scrollAreaOffset')) {
215
+ this._allScrollers.forEach(element => {
216
+ if (this.scrollAreaOffset) element.style.scrollPaddingInlineStart = `${this.scrollAreaOffset}px`;
217
+ });
218
+ };
214
219
  }
215
220
 
216
221
  checkScrollbar() {
@@ -5,6 +5,7 @@ import { css, html, LitElement, nothing } from 'lit';
5
5
  import { freshness, FreshnessMixin } from '../../mixins/freshness/freshness-mixin.js';
6
6
  import { cssSizes } from '../inputs/input-checkbox-styles.js';
7
7
  import { getComposedParent } from '../../helpers/dom.js';
8
+ import { getFlag } from '../../helpers/flags.js';
8
9
  import { isPopoverSupported } from '../popover/popover-mixin.js';
9
10
  import { PageableMixin } from '../paging/pageable-mixin.js';
10
11
  import { SelectionMixin } from '../selection/selection-mixin.js';
@@ -433,10 +434,16 @@ export class TableWrapper extends FreshnessMixin(PageableMixin(SelectionMixin(Li
433
434
  }
434
435
  }
435
436
 
437
+ getSyncColumnWidthsCount() {
438
+ return this.#syncColumnWidthsCount;
439
+ }
440
+
436
441
  #hasIntersected = false;
437
442
 
438
443
  #noScrollWidthTimeout = null;
439
444
 
445
+ #syncColumnWidthsCount = 0;
446
+
440
447
  _applyClassNames() {
441
448
  if (!this._table) return;
442
449
 
@@ -566,21 +573,19 @@ export class TableWrapper extends FreshnessMixin(PageableMixin(SelectionMixin(Li
566
573
  // observes when visibility of <table> changes to catch cases
567
574
  // where table is initially hidden (which would cause first/last
568
575
  // row classes to be unset) but then becomes shown
569
- if (typeof(IntersectionObserver) === 'function') {
570
- if (this._tableIntersectionObserver === null) {
571
- this._tableIntersectionObserver = new IntersectionObserver((entries) => {
572
- entries.forEach((entry) => {
573
- if (entry.isIntersecting) {
574
- this.#hasIntersected = true;
575
- this._handleTableChange();
576
- }
577
- });
576
+ if (this._tableIntersectionObserver === null) {
577
+ this._tableIntersectionObserver = new IntersectionObserver((entries) => {
578
+ entries.forEach((entry) => {
579
+ if (entry.isIntersecting) {
580
+ this.#hasIntersected = true;
581
+ this._handleTableChange();
582
+ }
578
583
  });
579
- } else {
580
- this._tableIntersectionObserver.disconnect();
581
- }
582
- this._tableIntersectionObserver.observe(this._table);
584
+ });
585
+ } else {
586
+ this._tableIntersectionObserver.disconnect();
583
587
  }
588
+ this._tableIntersectionObserver.observe(this._table);
584
589
 
585
590
  if (!this._tableResizeObserver) this._tableResizeObserver = new ResizeObserver(entries => this._syncColumnWidths(entries));
586
591
  this._tableResizeObserver.observe(this._table);
@@ -639,7 +644,8 @@ export class TableWrapper extends FreshnessMixin(PageableMixin(SelectionMixin(Li
639
644
  }
640
645
 
641
646
  _syncColumnWidths() {
642
- if (!this._table) return;
647
+ if (!this._table || (getFlag('table-wrapper-prevent-jitter', true) && this.#syncColumnWidthsCount > 0 && !this.#hasIntersected)) return;
648
+ this.#syncColumnWidthsCount++;
643
649
  const head = this._table.querySelector('thead');
644
650
  const body = this._table.querySelector('tbody');
645
651
 
@@ -14243,6 +14243,11 @@
14243
14243
  "type": "boolean",
14244
14244
  "default": "false"
14245
14245
  },
14246
+ {
14247
+ "name": "sticky-content",
14248
+ "type": "boolean",
14249
+ "default": "false"
14250
+ },
14246
14251
  {
14247
14252
  "name": "width",
14248
14253
  "type": "number",
@@ -14252,7 +14257,7 @@
14252
14257
  "properties": [
14253
14258
  {
14254
14259
  "name": "styles",
14255
- "default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t\\t.d2l-scroll-wrapper-gradient {\\n\\t\\t\\tbackground: linear-gradient(to right, #e66465, #9198e5);\\n\\t\\t\\theight: 100px;\\n\\t\\t}\\n\\t\\t.d2l-scroll-wrapper-gradient-secondary {\\n\\t\\t\\tbackground: linear-gradient(to left, #e66465, #9198e5);\\n\\t\\t\\theight: 40px;\\n\\t\\t\\tposition: relative;\\n\\t\\t}\\n\\t\\t.d2l-scroll-wrapper-gradient-secondary button {\\n\\t\\t\\tinset-inline-end: 0;\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t}\\n\\t`\""
14260
+ "default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t\\t.d2l-scroll-wrapper-gradient {\\n\\t\\t\\tbackground: linear-gradient(to right, #e66465, #9198e5);\\n\\t\\t\\theight: 100px;\\n\\t\\t}\\n\\t\\t.d2l-scroll-wrapper-gradient-secondary {\\n\\t\\t\\tbackground: linear-gradient(to left, #e66465, #9198e5);\\n\\t\\t\\theight: 40px;\\n\\t\\t\\tposition: relative;\\n\\t\\t}\\n\\t\\t.d2l-scroll-wrapper-gradient-secondary button {\\n\\t\\t\\tinset-inline-end: 0;\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t}\\n\\t\\t:host([sticky-content]) .d2l-scroll-wrapper-gradient div {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\t\\t.sticky {\\n\\t\\t\\tborder-inline-end: 1px solid black;\\n\\t\\t\\tinset-inline-start: 0;\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\twidth: 200px;\\n\\t\\t}\\n\\t`\""
14256
14261
  },
14257
14262
  {
14258
14263
  "name": "hideActions",
@@ -14272,6 +14277,12 @@
14272
14277
  "type": "boolean",
14273
14278
  "default": "false"
14274
14279
  },
14280
+ {
14281
+ "name": "stickyContent",
14282
+ "attribute": "sticky-content",
14283
+ "type": "boolean",
14284
+ "default": "false"
14285
+ },
14275
14286
  {
14276
14287
  "name": "width",
14277
14288
  "attribute": "width",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.344.4",
3
+ "version": "3.344.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",